hytopia 0.7.3-dev1 → 0.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bun-server.mjs +2 -2
- package/node-server.mjs +1 -1
- package/package.json +1 -1
package/bun-server.mjs
CHANGED
|
@@ -403,7 +403,7 @@ For example, you can use the \`pathToFileURL()\` method of the \`url\` core modu
|
|
|
403
403
|
Instead, \`yield\` should either be called with a value, or not be called at all. For example:
|
|
404
404
|
if (condition) { yield value; }`)};import{Buffer as AK1}from"buffer";import{StringDecoder as xK1}from"string_decoder";var eF=(Z,J,X)=>{if(X)return;if(Z)return{transform:hK1.bind(void 0,new TextEncoder)};let Y=new xK1(J);return{transform:fK1.bind(void 0,Y),final:bK1.bind(void 0,Y)}},hK1=function*(Z,J){if(AK1.isBuffer(J))yield JZ(J);else if(typeof J==="string")yield Z.encode(J);else yield J},fK1=function*(Z,J){yield m8(J)?Z.write(J):J},bK1=function*(Z){let J=Z.end();if(J!=="")yield J};import{callbackify as cm}from"util";var BN=cm(async(Z,J,X,Y)=>{J.currentIterable=Z(...X);try{for await(let $ of J.currentIterable)Y.push($)}finally{delete J.currentIterable}}),ZU=async function*(Z,J,X){if(X===J.length){yield Z;return}let{transform:Y=gK1}=J[X];for await(let $ of Y(Z))yield*ZU($,J,X+1)},lm=async function*(Z){for(let[J,{final:X}]of Object.entries(Z))yield*yK1(X,Number(J),Z)},yK1=async function*(Z,J,X){if(Z===void 0)return;for await(let Y of Z())yield*ZU(Y,X,J+1)},pm=cm(async({currentIterable:Z},J)=>{if(Z!==void 0){await(J?Z.throw(J):Z.return());return}if(J)throw J}),gK1=function*(Z){yield Z};var ON=(Z,J,X,Y)=>{try{for(let $ of Z(...J))X.push($);Y()}catch($){Y($)}},im=(Z,J)=>[...J.flatMap((X)=>[...pX(X,Z,0)]),...v3(Z)],pX=function*(Z,J,X){if(X===J.length){yield Z;return}let{transform:Y=uK1}=J[X];for(let $ of Y(Z))yield*pX($,J,X+1)},v3=function*(Z){for(let[J,{final:X}]of Object.entries(Z))yield*mK1(X,Number(J),Z)},mK1=function*(Z,J,X){if(Z===void 0)return;for(let Y of Z())yield*pX(Y,X,J+1)},uK1=function*(Z){yield Z};var jN=({value:Z,value:{transform:J,final:X,writableObjectMode:Y,readableObjectMode:$},optionName:Q},{encoding:W})=>{let K={},G=am(Z,W,Q),H=lX(J),z=lX(X),q=H?BN.bind(void 0,ZU,K):ON.bind(void 0,pX),V=H||z?BN.bind(void 0,lm,K):ON.bind(void 0,v3),F=H||z?pm.bind(void 0,K):void 0;return{stream:new dK1({writableObjectMode:Y,writableHighWaterMark:nm(Y),readableObjectMode:$,readableHighWaterMark:nm($),transform(w,L,O){q([w,G,0],this,O)},flush(w){V([G],this,w)},destroy:F})}},JU=(Z,J,X,Y)=>{let $=J.filter(({type:W})=>W==="generator"),Q=Y?$.reverse():$;for(let{value:W,optionName:K}of Q){let G=am(W,X,K);Z=im(G,Z)}return Z},am=({transform:Z,final:J,binary:X,writableObjectMode:Y,readableObjectMode:$,preserveNewlines:Q},W,K)=>{let G={};return[{transform:mm(Y,K)},eF(X,W,Y),tF(X,Q,Y,G),{transform:Z,final:J},{transform:um($,K)},gm({binary:X,preserveNewlines:Q,readableObjectMode:$,state:G})].filter(Boolean)};var sm=(Z,J)=>{for(let X of cK1(Z))lK1(Z,X,J)},cK1=(Z)=>new Set(Object.entries(Z).filter(([,{direction:J}])=>J==="input").map(([J])=>Number(J))),lK1=(Z,J,X)=>{let{stdioItems:Y}=Z[J],$=Y.filter(({contents:K})=>K!==void 0);if($.length===0)return;if(J!==0){let[{type:K,optionName:G}]=$;throw new TypeError(`Only the \`stdin\` option, not \`${G}\`, can be ${QJ[K]} with synchronous methods.`)}let W=$.map(({contents:K})=>K).map((K)=>pK1(K,Y));X.input=N3(W)},pK1=(Z,J)=>{let X=JU(Z,J,"utf8",!0);return iK1(X),N3(X)},iK1=(Z)=>{let J=Z.find((X)=>typeof X!=="string"&&!m8(X));if(J!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${J}.`)};import{writeFileSync as oK1,appendFileSync as rK1}from"fs";var XU=({stdioItems:Z,encoding:J,verboseInfo:X,fdNumber:Y})=>Y!=="all"&&KQ(X,Y)&&!u5.has(J)&&nK1(Y)&&(Z.some(({type:$,value:Q})=>$==="native"&&aK1.has(Q))||Z.every(({type:$})=>w9.has($))),nK1=(Z)=>Z===1||Z===2,aK1=new Set(["pipe","overlapped"]),om=async(Z,J,X,Y)=>{for await(let $ of Z)if(!sK1(J))tm($,X,Y)},rm=(Z,J,X)=>{for(let Y of Z)tm(Y,J,X)},sK1=(Z)=>Z._readableState.pipes.length>0,tm=(Z,J,X)=>{let Y=FF(Z);n4({type:"output",verboseMessage:Y,fdNumber:J,verboseInfo:X})};var em=({fileDescriptors:Z,syncResult:{output:J},options:X,isMaxBuffer:Y,verboseInfo:$})=>{if(J===null)return{output:Array.from({length:3})};let Q={},W=new Set([]);return{output:J.map((G,H)=>tK1({result:G,fileDescriptors:Z,fdNumber:H,state:Q,outputFiles:W,isMaxBuffer:Y,verboseInfo:$},X)),...Q}},tK1=({result:Z,fileDescriptors:J,fdNumber:X,state:Y,outputFiles:$,isMaxBuffer:Q,verboseInfo:W},{buffer:K,encoding:G,lines:H,stripFinalNewline:z,maxBuffer:q})=>{if(Z===null)return;let V=Zm(Z,Q,q),F=JZ(V),{stdioItems:U,objectMode:w}=J[X],L=eK1([F],U,G,Y),{serializedResult:O,finalResult:N=O}=Z31({chunks:L,objectMode:w,encoding:G,lines:H,stripFinalNewline:z,fdNumber:X});J31({serializedResult:O,fdNumber:X,state:Y,verboseInfo:W,encoding:G,stdioItems:U,objectMode:w});let M=K[X]?N:void 0;try{if(Y.error===void 0)X31(O,U,$);return M}catch(j){return Y.error=j,M}},eK1=(Z,J,X,Y)=>{try{return JU(Z,J,X,!1)}catch($){return Y.error=$,Z}},Z31=({chunks:Z,objectMode:J,encoding:X,lines:Y,stripFinalNewline:$,fdNumber:Q})=>{if(J)return{serializedResult:Z};if(X==="buffer")return{serializedResult:N3(Z)};let W=Ub(Z,X);if(Y[Q])return{serializedResult:W,finalResult:wN(W,!$[Q],J)};return{serializedResult:W}},J31=({serializedResult:Z,fdNumber:J,state:X,verboseInfo:Y,encoding:$,stdioItems:Q,objectMode:W})=>{if(!XU({stdioItems:Q,encoding:$,verboseInfo:Y,fdNumber:J}))return;let K=wN(Z,!1,W);try{rm(K,J,Y)}catch(G){X.error??=G}},X31=(Z,J,X)=>{for(let{path:Y,append:$}of J.filter(({type:Q})=>oF.has(Q))){let Q=typeof Y==="string"?Y:Y.toString();if($||X.has(Q))rK1(Y,Z);else X.add(Q),oK1(Y,Z)}};var Zu=([,Z,J],X)=>{if(!X.all)return;if(Z===void 0)return J;if(J===void 0)return Z;if(Array.isArray(Z))return Array.isArray(J)?[...Z,...J]:[...Z,QZ(J,X,"all")];if(Array.isArray(J))return[QZ(Z,X,"all"),...J];if(m8(Z)&&m8(J))return CR([Z,J]);return`${Z}${J}`};import{once as MN}from"events";var Ju=async(Z,J)=>{let[X,Y]=await Y31(Z);return J.isForcefullyTerminated??=!1,[X,Y]},Y31=async(Z)=>{let[J,X]=await Promise.allSettled([MN(Z,"spawn"),MN(Z,"exit")]);if(J.status==="rejected")return[];return X.status==="rejected"?Xu(Z):X.value},Xu=async(Z)=>{try{return await MN(Z,"exit")}catch{return Xu(Z)}},Yu=async(Z)=>{let[J,X]=await Z;if(!$31(J,X)&&RN(J,X))throw new a4;return[J,X]},$31=(Z,J)=>Z===void 0&&J===void 0,RN=(Z,J)=>Z!==0||J!==null;var $u=({error:Z,status:J,signal:X,output:Y},{maxBuffer:$})=>{let Q=Q31(Z,J,X),W=Q?.code==="ETIMEDOUT",K=eg(Q,Y,$);return{resultError:Q,exitCode:J,signal:X,timedOut:W,isMaxBuffer:K}},Q31=(Z,J,X)=>{if(Z!==void 0)return Z;return RN(J,X)?new a4:void 0};var Qu=(Z,J,X)=>{let{file:Y,commandArguments:$,command:Q,escapedCommand:W,startTime:K,verboseInfo:G,options:H,fileDescriptors:z}=K31(Z,J,X),q=z31({file:Y,commandArguments:$,options:H,command:Q,escapedCommand:W,verboseInfo:G,fileDescriptors:z,startTime:K});return wQ(q,G,H)},K31=(Z,J,X)=>{let{command:Y,escapedCommand:$,startTime:Q,verboseInfo:W}=LF(Z,J,X),K=G31(X),{file:G,commandArguments:H,options:z}=yF(Z,J,K);H31(z);let q=hm(z,W);return{file:G,commandArguments:H,command:Y,escapedCommand:$,startTime:Q,verboseInfo:W,options:z,fileDescriptors:q}},G31=(Z)=>Z.node&&!Z.ipc?{...Z,ipc:!1}:Z,H31=({ipc:Z,ipcInput:J,detached:X,cancelSignal:Y})=>{if(J)YU("ipcInput");if(Z)YU("ipc: true");if(X)YU("detached: true");if(Y)YU("cancelSignal")},YU=(Z)=>{throw new TypeError(`The "${Z}" option cannot be used with synchronous methods.`)},z31=({file:Z,commandArguments:J,options:X,command:Y,escapedCommand:$,verboseInfo:Q,fileDescriptors:W,startTime:K})=>{let G=q31({file:Z,commandArguments:J,options:X,command:Y,escapedCommand:$,fileDescriptors:W,startTime:K});if(G.failed)return G;let{resultError:H,exitCode:z,signal:q,timedOut:V,isMaxBuffer:F}=$u(G,X),{output:U,error:w=H}=em({fileDescriptors:W,syncResult:G,options:X,isMaxBuffer:F,verboseInfo:Q}),L=U.map((N,M)=>QZ(N,X,M)),O=QZ(Zu(U,X),X,"all");return F31({error:w,exitCode:z,signal:q,timedOut:V,isMaxBuffer:F,stdio:L,all:O,options:X,command:Y,escapedCommand:$,startTime:K})},q31=({file:Z,commandArguments:J,options:X,command:Y,escapedCommand:$,fileDescriptors:Q,startTime:W})=>{try{sm(Q,X);let K=V31(X);return W31(Z,J,K)}catch(K){return LQ({error:K,command:Y,escapedCommand:$,fileDescriptors:Q,options:X,startTime:W,isSync:!0})}},V31=({encoding:Z,maxBuffer:J,...X})=>({...X,encoding:"buffer",maxBuffer:iF(J)}),F31=({error:Z,exitCode:J,signal:X,timedOut:Y,isMaxBuffer:$,stdio:Q,all:W,options:K,command:G,escapedCommand:H,startTime:z})=>Z===void 0?nF({command:G,escapedCommand:H,stdio:Q,all:W,ipcOutput:[],options:K,startTime:z}):I3({error:Z,command:G,escapedCommand:H,timedOut:Y,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:$,isForcefullyTerminated:!1,exitCode:J,signal:X,stdio:Q,all:W,ipcOutput:[],options:K,startTime:z,isSync:!0});import{setMaxListeners as ZH1}from"events";import{spawn as JH1}from"child_process";import zu from"process";import{once as NN,on as U31}from"events";var Wu=({anyProcess:Z,channel:J,isSubprocess:X,ipc:Y},{reference:$=!0,filter:Q}={})=>{return zQ({methodName:"getOneMessage",isSubprocess:X,ipc:Y,isConnected:_F(Z)}),L31({anyProcess:Z,channel:J,isSubprocess:X,filter:Q,reference:$})},L31=async({anyProcess:Z,channel:J,isSubprocess:X,filter:Y,reference:$})=>{EF(J,$);let Q=$J(Z,J,X),W=new AbortController;try{return await Promise.race([w31(Q,Y,W),B31(Q,X,W),O31(Q,X,W)])}catch(K){throw qQ(Z),K}finally{W.abort(),IF(J,$)}},w31=async(Z,J,{signal:X})=>{if(J===void 0){let[Y]=await NN(Z,"message",{signal:X});return Y}for await(let[Y]of U31(Z,"message",{signal:X}))if(J(Y))return Y},B31=async(Z,J,{signal:X})=>{await NN(Z,"disconnect",{signal:X}),py(J)},O31=async(Z,J,{signal:X})=>{let[Y]=await NN(Z,"strict:error",{signal:X});throw CF(Y,J)};import{once as Gu,on as j31}from"events";var Hu=({anyProcess:Z,channel:J,isSubprocess:X,ipc:Y},{reference:$=!0}={})=>DN({anyProcess:Z,channel:J,isSubprocess:X,ipc:Y,shouldAwait:!X,reference:$}),DN=({anyProcess:Z,channel:J,isSubprocess:X,ipc:Y,shouldAwait:$,reference:Q})=>{zQ({methodName:"getEachMessage",isSubprocess:X,ipc:Y,isConnected:_F(Z)}),EF(J,Q);let W=$J(Z,J,X),K=new AbortController,G={};return M31(Z,W,K),R31({ipcEmitter:W,isSubprocess:X,controller:K,state:G}),N31({anyProcess:Z,channel:J,ipcEmitter:W,isSubprocess:X,shouldAwait:$,controller:K,state:G,reference:Q})},M31=async(Z,J,X)=>{try{await Gu(J,"disconnect",{signal:X.signal}),X.abort()}catch{}},R31=async({ipcEmitter:Z,isSubprocess:J,controller:X,state:Y})=>{try{let[$]=await Gu(Z,"strict:error",{signal:X.signal});Y.error=CF($,J),X.abort()}catch{}},N31=async function*({anyProcess:Z,channel:J,ipcEmitter:X,isSubprocess:Y,shouldAwait:$,controller:Q,state:W,reference:K}){try{for await(let[G]of j31(X,"message",{signal:Q.signal}))Ku(W),yield G}catch{Ku(W)}finally{if(Q.abort(),IF(J,K),!Y)qQ(Z);if($)await Z}},Ku=({error:Z})=>{if(Z)throw Z};var qu=(Z,{ipc:J})=>{Object.assign(Z,Fu(Z,!1,J))},Vu=()=>{let Z=zu,J=!0,X=zu.channel!==void 0;return{...Fu(Z,!0,X),getCancelSignal:Og.bind(void 0,{anyProcess:Z,channel:Z.channel,isSubprocess:!0,ipc:X})}},Fu=(Z,J,X)=>({sendMessage:fF.bind(void 0,{anyProcess:Z,channel:Z.channel,isSubprocess:J,ipc:X}),getOneMessage:Wu.bind(void 0,{anyProcess:Z,channel:Z.channel,isSubprocess:J,ipc:X}),getEachMessage:Hu.bind(void 0,{anyProcess:Z,channel:Z.channel,isSubprocess:J,ipc:X})});import{ChildProcess as D31}from"child_process";import{PassThrough as P31,Readable as C31,Writable as T31,Duplex as k31}from"stream";var Uu=({error:Z,command:J,escapedCommand:X,fileDescriptors:Y,options:$,startTime:Q,verboseInfo:W})=>{FN(Y);let K=new D31;E31(K,Y),Object.assign(K,{readable:I31,writable:v31,duplex:S31});let G=LQ({error:Z,command:J,escapedCommand:X,fileDescriptors:Y,options:$,startTime:Q,isSync:!1}),H=_31(G,W,$);return{subprocess:K,promise:H}},E31=(Z,J)=>{let X=S3(),Y=S3(),$=S3(),Q=Array.from({length:J.length-3},S3),W=S3(),K=[X,Y,$,...Q];Object.assign(Z,{stdin:X,stdout:Y,stderr:$,all:W,stdio:K})},S3=()=>{let Z=new P31;return Z.end(),Z},I31=()=>new C31({read(){}}),v31=()=>new T31({write(){}}),S31=()=>new k31({read(){},write(){}}),_31=async(Z,J,X)=>wQ(Z,J,X);import{createReadStream as Lu,createWriteStream as wu}from"fs";import{Buffer as A31}from"buffer";import{Readable as _3,Writable as x31,Duplex as h31}from"stream";var Ou=(Z,J)=>rF(f31,Z,J,!1),A3=({type:Z,optionName:J})=>{throw new TypeError(`The \`${J}\` option cannot be ${QJ[Z]}.`)},Bu={fileNumber:A3,generator:jN,asyncGenerator:jN,nodeStream:({value:Z})=>({stream:Z}),webTransform({value:{transform:Z,writableObjectMode:J,readableObjectMode:X}}){let Y=J||X;return{stream:h31.fromWeb(Z,{objectMode:Y})}},duplex:({value:{transform:Z}})=>({stream:Z}),native(){}},f31={input:{...Bu,fileUrl:({value:Z})=>({stream:Lu(Z)}),filePath:({value:{file:Z}})=>({stream:Lu(Z)}),webStream:({value:Z})=>({stream:_3.fromWeb(Z)}),iterable:({value:Z})=>({stream:_3.from(Z)}),asyncIterable:({value:Z})=>({stream:_3.from(Z)}),string:({value:Z})=>({stream:_3.from(Z)}),uint8Array:({value:Z})=>({stream:_3.from(A31.from(Z))})},output:{...Bu,fileUrl:({value:Z})=>({stream:wu(Z)}),filePath:({value:{file:Z,append:J}})=>({stream:wu(Z,J?{flags:"a"}:{})}),webStream:({value:Z})=>({stream:x31.fromWeb(Z)}),iterable:A3,asyncIterable:A3,string:A3,uint8Array:A3}};import{on as b31,once as ju}from"events";import{PassThrough as y31,getDefaultHighWaterMark as g31}from"stream";import{finished as Nu}from"stream/promises";function iX(Z){if(!Array.isArray(Z))throw new TypeError(`Expected an array, got \`${typeof Z}\`.`);for(let $ of Z)PN($);let J=Z.some(({readableObjectMode:$})=>$),X=m31(Z,J),Y=new Du({objectMode:J,writableHighWaterMark:X,readableHighWaterMark:X});for(let $ of Z)Y.add($);return Y}var m31=(Z,J)=>{if(Z.length===0)return g31(J);let X=Z.filter(({readableObjectMode:Y})=>Y===J).map(({readableHighWaterMark:Y})=>Y);return Math.max(...X)};class Du extends y31{#Z=new Set([]);#J=new Set([]);#Y=new Set([]);#X;#$=Symbol("unpipe");#z=new WeakMap;add(Z){if(PN(Z),this.#Z.has(Z))return;this.#Z.add(Z),this.#X??=u31(this,this.#Z,this.#$);let J=l31({passThroughStream:this,stream:Z,streams:this.#Z,ended:this.#J,aborted:this.#Y,onFinished:this.#X,unpipeEvent:this.#$});this.#z.set(Z,J),Z.pipe(this,{end:!1})}async remove(Z){if(PN(Z),!this.#Z.has(Z))return!1;let J=this.#z.get(Z);if(J===void 0)return!1;return this.#z.delete(Z),Z.unpipe(this),await J,!0}}var u31=async(Z,J,X)=>{$U(Z,Mu);let Y=new AbortController;try{await Promise.race([d31(Z,Y),c31(Z,J,X,Y)])}finally{Y.abort(),$U(Z,-Mu)}},d31=async(Z,{signal:J})=>{try{await Nu(Z,{signal:J,cleanup:!0})}catch(X){throw Pu(Z,X),X}},c31=async(Z,J,X,{signal:Y})=>{for await(let[$]of b31(Z,"unpipe",{signal:Y}))if(J.has($))$.emit(X)},PN=(Z)=>{if(typeof Z?.pipe!=="function")throw new TypeError(`Expected a readable stream, got: \`${typeof Z}\`.`)},l31=async({passThroughStream:Z,stream:J,streams:X,ended:Y,aborted:$,onFinished:Q,unpipeEvent:W})=>{$U(Z,Ru);let K=new AbortController;try{await Promise.race([p31(Q,J,K),i31({passThroughStream:Z,stream:J,streams:X,ended:Y,aborted:$,controller:K}),n31({stream:J,streams:X,ended:Y,aborted:$,unpipeEvent:W,controller:K})])}finally{K.abort(),$U(Z,-Ru)}if(X.size>0&&X.size===Y.size+$.size)if(Y.size===0&&$.size>0)CN(Z);else a31(Z)},p31=async(Z,J,{signal:X})=>{try{if(await Z,!X.aborted)CN(J)}catch(Y){if(!X.aborted)Pu(J,Y)}},i31=async({passThroughStream:Z,stream:J,streams:X,ended:Y,aborted:$,controller:{signal:Q}})=>{try{if(await Nu(J,{signal:Q,cleanup:!0,readable:!0,writable:!1}),X.has(J))Y.add(J)}catch(W){if(Q.aborted||!X.has(J))return;if(Cu(W))$.add(J);else Tu(Z,W)}},n31=async({stream:Z,streams:J,ended:X,aborted:Y,unpipeEvent:$,controller:{signal:Q}})=>{if(await ju(Z,$,{signal:Q}),!Z.readable)return ju(Q,"abort",{signal:Q});J.delete(Z),X.delete(Z),Y.delete(Z)},a31=(Z)=>{if(Z.writable)Z.end()},Pu=(Z,J)=>{if(Cu(J))CN(Z);else Tu(Z,J)},Cu=(Z)=>Z?.code==="ERR_STREAM_PREMATURE_CLOSE",CN=(Z)=>{if(Z.readable||Z.writable)Z.destroy()},Tu=(Z,J)=>{if(!Z.destroyed)Z.once("error",s31),Z.destroy(J)},s31=()=>{},$U=(Z,J)=>{let X=Z.getMaxListeners();if(X!==0&&X!==Number.POSITIVE_INFINITY)Z.setMaxListeners(X+J)},Mu=2,Ru=1;import{finished as ku}from"stream/promises";var OQ=(Z,J)=>{Z.pipe(J),o31(Z,J),r31(Z,J)},o31=async(Z,J)=>{if($4(Z)||$4(J))return;try{await ku(Z,{cleanup:!0,readable:!0,writable:!1})}catch{}TN(J)},TN=(Z)=>{if(Z.writable)Z.end()},r31=async(Z,J)=>{if($4(Z)||$4(J))return;try{await ku(J,{cleanup:!0,readable:!1,writable:!0})}catch{}kN(Z)},kN=(Z)=>{if(Z.readable)Z.destroy()};var Eu=(Z,J,X)=>{let Y=new Map;for(let[$,{stdioItems:Q,direction:W}]of Object.entries(J)){for(let{stream:K}of Q.filter(({type:G})=>w9.has(G)))t31(Z,K,W,$);for(let{stream:K}of Q.filter(({type:G})=>!w9.has(G)))ZG1({subprocess:Z,stream:K,direction:W,fdNumber:$,pipeGroups:Y,controller:X})}for(let[$,Q]of Y.entries()){let W=Q.length===1?Q[0]:iX(Q);OQ(W,$)}},t31=(Z,J,X,Y)=>{if(X==="output")OQ(Z.stdio[Y],J);else OQ(J,Z.stdio[Y]);let $=e31[Y];if($!==void 0)Z[$]=J;Z.stdio[Y]=J},e31=["stdin","stdout","stderr"],ZG1=({subprocess:Z,stream:J,direction:X,fdNumber:Y,pipeGroups:$,controller:Q})=>{if(J===void 0)return;JG1(J,Q);let[W,K]=X==="output"?[J,Z.stdio[Y]]:[Z.stdio[Y],J],G=$.get(W)??[];$.set(W,[...G,K])},JG1=(Z,{signal:J})=>{if($4(Z))dX(Z,XG1,J)},XG1=2;import{addAbortListener as QG1}from"events";var nX=[];nX.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")nX.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")nX.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var QU=(Z)=>!!Z&&typeof Z==="object"&&typeof Z.removeListener==="function"&&typeof Z.emit==="function"&&typeof Z.reallyExit==="function"&&typeof Z.listeners==="function"&&typeof Z.kill==="function"&&typeof Z.pid==="number"&&typeof Z.on==="function",EN=Symbol.for("signal-exit emitter"),IN=globalThis,YG1=Object.defineProperty.bind(Object);class Iu{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(IN[EN])return IN[EN];YG1(IN,EN,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(Z,J){this.listeners[Z].push(J)}removeListener(Z,J){let X=this.listeners[Z],Y=X.indexOf(J);if(Y===-1)return;if(Y===0&&X.length===1)X.length=0;else X.splice(Y,1)}emit(Z,J,X){if(this.emitted[Z])return!1;this.emitted[Z]=!0;let Y=!1;for(let $ of this.listeners[Z])Y=$(J,X)===!0||Y;if(Z==="exit")Y=this.emit("afterExit",J,X)||Y;return Y}}class SN{}var $G1=(Z)=>{return{onExit(J,X){return Z.onExit(J,X)},load(){return Z.load()},unload(){return Z.unload()}}};class vu extends SN{onExit(){return()=>{}}load(){}unload(){}}class Su extends SN{#Z=vN.platform==="win32"?"SIGINT":"SIGHUP";#J=new Iu;#Y;#X;#$;#z={};#V=!1;constructor(Z){super();this.#Y=Z,this.#z={};for(let J of nX)this.#z[J]=()=>{let X=this.#Y.listeners(J),{count:Y}=this.#J,$=Z;if(typeof $.__signal_exit_emitter__==="object"&&typeof $.__signal_exit_emitter__.count==="number")Y+=$.__signal_exit_emitter__.count;if(X.length===Y){this.unload();let Q=this.#J.emit("exit",null,J),W=J==="SIGHUP"?this.#Z:J;if(!Q)Z.kill(Z.pid,W)}};this.#$=Z.reallyExit,this.#X=Z.emit}onExit(Z,J){if(!QU(this.#Y))return()=>{};if(this.#V===!1)this.load();let X=J?.alwaysLast?"afterExit":"exit";return this.#J.on(X,Z),()=>{if(this.#J.removeListener(X,Z),this.#J.listeners.exit.length===0&&this.#J.listeners.afterExit.length===0)this.unload()}}load(){if(this.#V)return;this.#V=!0,this.#J.count+=1;for(let Z of nX)try{let J=this.#z[Z];if(J)this.#Y.on(Z,J)}catch(J){}this.#Y.emit=(Z,...J)=>{return this.#G(Z,...J)},this.#Y.reallyExit=(Z)=>{return this.#K(Z)}}unload(){if(!this.#V)return;this.#V=!1,nX.forEach((Z)=>{let J=this.#z[Z];if(!J)throw new Error("Listener not defined for signal: "+Z);try{this.#Y.removeListener(Z,J)}catch(X){}}),this.#Y.emit=this.#X,this.#Y.reallyExit=this.#$,this.#J.count-=1}#K(Z){if(!QU(this.#Y))return 0;return this.#Y.exitCode=Z||0,this.#J.emit("exit",this.#Y.exitCode,null),this.#$.call(this.#Y,this.#Y.exitCode)}#G(Z,...J){let X=this.#X;if(Z==="exit"&&QU(this.#Y)){if(typeof J[0]==="number")this.#Y.exitCode=J[0];let Y=X.call(this.#Y,Z,...J);return this.#J.emit("exit",this.#Y.exitCode,null),Y}else return X.call(this.#Y,Z,...J)}}var vN=globalThis.process,{onExit:_u,load:hQ6,unload:fQ6}=$G1(QU(vN)?new Su(vN):new vu);var Au=(Z,{cleanup:J,detached:X},{signal:Y})=>{if(!J||X)return;let $=_u(()=>{Z.kill()});QG1(Y,()=>{$()})};var hu=({source:Z,sourcePromise:J,boundOptions:X,createNested:Y},...$)=>{let Q=UF(),{destination:W,destinationStream:K,destinationError:G,from:H,unpipeSignal:z}=WG1(X,Y,$),{sourceStream:q,sourceError:V}=GG1(Z,H),{options:F,fileDescriptors:U}=o4.get(Z);return{sourcePromise:J,sourceStream:q,sourceOptions:F,sourceError:V,destination:W,destinationStream:K,destinationError:G,unpipeSignal:z,fileDescriptors:U,startTime:Q}},WG1=(Z,J,X)=>{try{let{destination:Y,pipeOptions:{from:$,to:Q,unpipeSignal:W}={}}=KG1(Z,J,...X),K=kF(Y,Q);return{destination:Y,destinationStream:K,from:$,unpipeSignal:W}}catch(Y){return{destinationError:Y}}},KG1=(Z,J,X,...Y)=>{if(Array.isArray(X))return{destination:J(xu,Z)(X,...Y),pipeOptions:Z};if(typeof X==="string"||X instanceof URL||DR(X)){if(Object.keys(Z).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[$,Q,W]=$F(X,...Y);return{destination:J(xu)($,Q,W),pipeOptions:W}}if(o4.has(X)){if(Object.keys(Z).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:X,pipeOptions:Y[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${X}`)},xu=({options:Z})=>({options:{...Z,stdin:"pipe",piped:!0}}),GG1=(Z,J)=>{try{return{sourceStream:VQ(Z,J)}}catch(X){return{sourceError:X}}};var bu=({sourceStream:Z,sourceError:J,destinationStream:X,destinationError:Y,fileDescriptors:$,sourceOptions:Q,startTime:W})=>{let K=HG1({sourceStream:Z,sourceError:J,destinationStream:X,destinationError:Y});if(K!==void 0)throw _N({error:K,fileDescriptors:$,sourceOptions:Q,startTime:W})},HG1=({sourceStream:Z,sourceError:J,destinationStream:X,destinationError:Y})=>{if(J!==void 0&&Y!==void 0)return Y;if(Y!==void 0)return kN(Z),Y;if(J!==void 0)return TN(X),J},_N=({error:Z,fileDescriptors:J,sourceOptions:X,startTime:Y})=>LQ({error:Z,command:fu,escapedCommand:fu,fileDescriptors:J,options:X,startTime:Y,isSync:!1}),fu="source.pipe(destination)";var yu=async(Z)=>{let[{status:J,reason:X,value:Y=X},{status:$,reason:Q,value:W=Q}]=await Z;if(!W.pipedFrom.includes(Y))W.pipedFrom.push(Y);if($==="rejected")throw W;if(J==="rejected")throw Y;return W};import{finished as zG1}from"stream/promises";var gu=(Z,J,X)=>{let Y=WU.has(J)?VG1(Z,J):qG1(Z,J);return dX(Z,UG1,X.signal),dX(J,LG1,X.signal),FG1(J),Y},qG1=(Z,J)=>{let X=iX([Z]);return OQ(X,J),WU.set(J,X),X},VG1=(Z,J)=>{let X=WU.get(J);return X.add(Z),X},FG1=async(Z)=>{try{await zG1(Z,{cleanup:!0,readable:!1,writable:!0})}catch{}WU.delete(Z)},WU=new WeakMap,UG1=2,LG1=1;import{aborted as wG1}from"util";var mu=(Z,J)=>Z===void 0?[]:[BG1(Z,J)],BG1=async(Z,{sourceStream:J,mergedStream:X,fileDescriptors:Y,sourceOptions:$,startTime:Q})=>{await wG1(Z,J),await X.remove(J);let W=new Error("Pipe canceled by `unpipeSignal` option.");throw _N({error:W,fileDescriptors:Y,sourceOptions:$,startTime:Q})};var KU=(Z,...J)=>{if(O8(J[0]))return KU.bind(void 0,{...Z,boundOptions:{...Z.boundOptions,...J[0]}});let{destination:X,...Y}=hu(Z,...J),$=OG1({...Y,destination:X});return $.pipe=KU.bind(void 0,{...Z,source:X,sourcePromise:$,boundOptions:{}}),$},OG1=async({sourcePromise:Z,sourceStream:J,sourceOptions:X,sourceError:Y,destination:$,destinationStream:Q,destinationError:W,unpipeSignal:K,fileDescriptors:G,startTime:H})=>{let z=jG1(Z,$);bu({sourceStream:J,sourceError:Y,destinationStream:Q,destinationError:W,fileDescriptors:G,sourceOptions:X,startTime:H});let q=new AbortController;try{let V=gu(J,Q,q);return await Promise.race([yu(z),...mu(K,{sourceStream:J,mergedStream:V,sourceOptions:X,fileDescriptors:G,startTime:H})])}finally{q.abort()}},jG1=(Z,J)=>Promise.allSettled([Z,J]);import{setImmediate as TG1}from"timers/promises";import{on as MG1}from"events";import{getDefaultHighWaterMark as RG1}from"stream";var GU=({subprocessStdout:Z,subprocess:J,binary:X,shouldEncode:Y,encoding:$,preserveNewlines:Q})=>{let W=new AbortController;return NG1(J,W),du({stream:Z,controller:W,binary:X,shouldEncode:!Z.readableObjectMode&&Y,encoding:$,shouldSplit:!Z.readableObjectMode,preserveNewlines:Q})},NG1=async(Z,J)=>{try{await Z}catch{}finally{J.abort()}},AN=({stream:Z,onStreamEnd:J,lines:X,encoding:Y,stripFinalNewline:$,allMixed:Q})=>{let W=new AbortController;DG1(J,W,Z);let K=Z.readableObjectMode&&!Q;return du({stream:Z,controller:W,binary:Y==="buffer",shouldEncode:!K,encoding:Y,shouldSplit:!K&&X,preserveNewlines:!$})},DG1=async(Z,J,X)=>{try{await Z}catch{X.destroy()}finally{J.abort()}},du=({stream:Z,controller:J,binary:X,shouldEncode:Y,encoding:$,shouldSplit:Q,preserveNewlines:W})=>{let K=MG1(Z,"data",{signal:J.signal,highWaterMark:uu,highWatermark:uu});return PG1({onStdoutChunk:K,controller:J,binary:X,shouldEncode:Y,encoding:$,shouldSplit:Q,preserveNewlines:W})},xN=RG1(!0),uu=xN,PG1=async function*({onStdoutChunk:Z,controller:J,binary:X,shouldEncode:Y,encoding:$,shouldSplit:Q,preserveNewlines:W}){let K=CG1({binary:X,shouldEncode:Y,encoding:$,shouldSplit:Q,preserveNewlines:W});try{for await(let[G]of Z)yield*pX(G,K,0)}catch(G){if(!J.signal.aborted)throw G}finally{yield*v3(K)}},CG1=({binary:Z,shouldEncode:J,encoding:X,shouldSplit:Y,preserveNewlines:$})=>[eF(Z,X,!J),tF(Z,$,!Y,{})].filter(Boolean);var cu=async({stream:Z,onStreamEnd:J,fdNumber:X,encoding:Y,buffer:$,maxBuffer:Q,lines:W,allMixed:K,stripFinalNewline:G,verboseInfo:H,streamInfo:z})=>{let q=kG1({stream:Z,onStreamEnd:J,fdNumber:X,encoding:Y,allMixed:K,verboseInfo:H,streamInfo:z});if(!$){await Promise.all([EG1(Z),q]);return}let V=UN(G,X),F=AN({stream:Z,onStreamEnd:J,lines:W,encoding:Y,stripFinalNewline:V,allMixed:K}),[U]=await Promise.all([IG1({stream:Z,iterable:F,fdNumber:X,encoding:Y,maxBuffer:Q,lines:W}),q]);return U},kG1=async({stream:Z,onStreamEnd:J,fdNumber:X,encoding:Y,allMixed:$,verboseInfo:Q,streamInfo:{fileDescriptors:W}})=>{if(!XU({stdioItems:W[X]?.stdioItems,encoding:Y,verboseInfo:Q,fdNumber:X}))return;let K=AN({stream:Z,onStreamEnd:J,lines:!0,encoding:Y,stripFinalNewline:!0,allMixed:$});await om(K,Z,X,Q)},EG1=async(Z)=>{if(await TG1(),Z.readableFlowing===null)Z.resume()},IG1=async({stream:Z,stream:{readableObjectMode:J},iterable:X,fdNumber:Y,encoding:$,maxBuffer:Q,lines:W})=>{try{if(J||W)return await dF(X,{maxBuffer:Q});if($==="buffer")return new Uint8Array(await cF(X,{maxBuffer:Q}));return await pF(X,{maxBuffer:Q})}catch(K){return lu(og({error:K,stream:Z,readableObjectMode:J,lines:W,encoding:$,fdNumber:Y}))}},hN=async(Z)=>{try{return await Z}catch(J){return lu(J)}},lu=({bufferedData:Z})=>Vb(Z)?new Uint8Array(Z):Z;import{finished as vG1}from"stream/promises";var x3=async(Z,J,X,{isSameDirection:Y,stopOnExit:$=!1}={})=>{let Q=SG1(Z,X),W=new AbortController;try{await Promise.race([...$?[X.exitPromise]:[],vG1(Z,{cleanup:!0,signal:W.signal})])}catch(K){if(!Q.stdinCleanedUp)xG1(K,J,X,Y)}finally{W.abort()}},SG1=(Z,{originalStreams:[J],subprocess:X})=>{let Y={stdinCleanedUp:!1};if(Z===J)_G1(Z,X,Y);return Y},_G1=(Z,J,X)=>{let{_destroy:Y}=Z;Z._destroy=(...$)=>{AG1(J,X),Y.call(Z,...$)}},AG1=({exitCode:Z,signalCode:J},X)=>{if(Z!==null||J!==null)X.stdinCleanedUp=!0},xG1=(Z,J,X,Y)=>{if(!hG1(Z,J,X,Y))throw Z},hG1=(Z,J,X,Y=!0)=>{if(X.propagating)return pu(Z)||HU(Z);return X.propagating=!0,fN(X,J)===Y?pu(Z):HU(Z)},fN=({fileDescriptors:Z},J)=>J!=="all"&&Z[J].direction==="input",HU=(Z)=>Z?.code==="ERR_STREAM_PREMATURE_CLOSE",pu=(Z)=>Z?.code==="EPIPE";var iu=({subprocess:Z,encoding:J,buffer:X,maxBuffer:Y,lines:$,stripFinalNewline:Q,verboseInfo:W,streamInfo:K})=>Z.stdio.map((G,H)=>bN({stream:G,fdNumber:H,encoding:J,buffer:X[H],maxBuffer:Y[H],lines:$[H],allMixed:!1,stripFinalNewline:Q,verboseInfo:W,streamInfo:K})),bN=async({stream:Z,fdNumber:J,encoding:X,buffer:Y,maxBuffer:$,lines:Q,allMixed:W,stripFinalNewline:K,verboseInfo:G,streamInfo:H})=>{if(!Z)return;let z=x3(Z,J,H);if(fN(H,J)){await z;return}let[q]=await Promise.all([cu({stream:Z,onStreamEnd:z,fdNumber:J,encoding:X,buffer:Y,maxBuffer:$,lines:Q,allMixed:W,stripFinalNewline:K,verboseInfo:G,streamInfo:H}),z]);return q};var nu=({stdout:Z,stderr:J},{all:X})=>X&&(Z||J)?iX([Z,J].filter(Boolean)):void 0,au=({subprocess:Z,encoding:J,buffer:X,maxBuffer:Y,lines:$,stripFinalNewline:Q,verboseInfo:W,streamInfo:K})=>bN({...fG1(Z,X),fdNumber:"all",encoding:J,maxBuffer:Y[1]+Y[2],lines:$[1]||$[2],allMixed:bG1(Z),stripFinalNewline:Q,verboseInfo:W,streamInfo:K}),fG1=({stdout:Z,stderr:J,all:X},[,Y,$])=>{let Q=Y||$;if(!Q)return{stream:X,buffer:Q};if(!Y)return{stream:J,buffer:Q};if(!$)return{stream:Z,buffer:Q};return{stream:X,buffer:Q}},bG1=({all:Z,stdout:J,stderr:X})=>Z&&J&&X&&J.readableObjectMode!==X.readableObjectMode;import{once as yG1}from"events";var su=(Z)=>KQ(Z,"ipc"),ou=(Z,J)=>{let X=FF(Z);n4({type:"ipc",verboseMessage:X,fdNumber:"ipc",verboseInfo:J})};var ru=async({subprocess:Z,buffer:J,maxBuffer:X,ipc:Y,ipcOutput:$,verboseInfo:Q})=>{if(!Y)return $;let W=su(Q),K=XZ(J,"ipc"),G=XZ(X,"ipc");for await(let H of DN({anyProcess:Z,channel:Z.channel,isSubprocess:!1,ipc:Y,shouldAwait:!1,reference:!0})){if(K)rg(Z,$,G),$.push(H);if(W)ou(H,Q)}return $},tu=async(Z,J)=>{return await Promise.allSettled([Z]),J};var eu=async({subprocess:Z,options:{encoding:J,buffer:X,maxBuffer:Y,lines:$,timeoutDuration:Q,cancelSignal:W,gracefulCancel:K,forceKillAfterDelay:G,stripFinalNewline:H,ipc:z,ipcInput:q},context:V,verboseInfo:F,fileDescriptors:U,originalStreams:w,onInternalError:L,controller:O})=>{let N=Ju(Z,V),M={originalStreams:w,fileDescriptors:U,subprocess:Z,exitPromise:N,propagating:!1},j=iu({subprocess:Z,encoding:J,buffer:X,maxBuffer:Y,lines:$,stripFinalNewline:H,verboseInfo:F,streamInfo:M}),P=au({subprocess:Z,encoding:J,buffer:X,maxBuffer:Y,lines:$,stripFinalNewline:H,verboseInfo:F,streamInfo:M}),D=[],C=ru({subprocess:Z,buffer:X,maxBuffer:Y,ipc:z,ipcOutput:D,verboseInfo:F}),k=gG1(w,Z,M),T=mG1(U,M);try{return await Promise.race([Promise.all([{},Yu(N),Promise.all(j),P,C,Eg(Z,q),...k,...T]),L,uG1(Z,O),...Dg(Z,Q,V,O),...ly({subprocess:Z,cancelSignal:W,gracefulCancel:K,context:V,controller:O}),...Rg({subprocess:Z,cancelSignal:W,gracefulCancel:K,forceKillAfterDelay:G,context:V,controller:O})])}catch(x){return V.terminationReason??="other",Promise.all([{error:x},N,Promise.all(j.map((S)=>hN(S))),hN(P),tu(C,D),Promise.allSettled(k),Promise.allSettled(T)])}},gG1=(Z,J,X)=>Z.map((Y,$)=>Y===J.stdio[$]?void 0:x3(Y,$,X)),mG1=(Z,J)=>Z.flatMap(({stdioItems:X},Y)=>X.filter(({value:$,stream:Q=$})=>W4(Q,{checkOpen:!1})&&!$4(Q)).map(({type:$,value:Q,stream:W=Q})=>x3(W,Y,J,{isSameDirection:w9.has($),stopOnExit:$==="native"}))),uG1=async(Z,{signal:J})=>{let[X]=await yG1(Z,"error",{signal:J});throw X};var Zd=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),h3=(Z,J,X)=>{let Y=Z[X];if(!Y.has(J))Y.set(J,[]);let $=Y.get(J),Q=s4();return $.push(Q),{resolve:Q.resolve.bind(Q),promises:$}},jQ=async({resolve:Z,promises:J},X)=>{Z();let[Y]=await Promise.race([Promise.allSettled([!0,X]),Promise.all([!1,...J])]);return!Y};import{Readable as dG1}from"stream";import{callbackify as cG1}from"util";import{finished as Jd}from"stream/promises";var yN=async(Z)=>{if(Z===void 0)return;try{await gN(Z)}catch{}},Xd=async(Z)=>{if(Z===void 0)return;try{await mN(Z)}catch{}},gN=async(Z)=>{await Jd(Z,{cleanup:!0,readable:!1,writable:!0})},mN=async(Z)=>{await Jd(Z,{cleanup:!0,readable:!0,writable:!1})},zU=async(Z,J)=>{if(await Z,J)throw J},qU=(Z,J,X)=>{if(X&&!HU(X))Z.destroy(X);else if(J)Z.destroy()};var Yd=({subprocess:Z,concurrentStreams:J,encoding:X},{from:Y,binary:$=!0,preserveNewlines:Q=!0}={})=>{let W=$||u5.has(X),{subprocessStdout:K,waitReadableDestroy:G}=uN(Z,Y,J),{readableEncoding:H,readableObjectMode:z,readableHighWaterMark:q}=dN(K,W),{read:V,onStdoutDataDone:F}=cN({subprocessStdout:K,subprocess:Z,binary:W,encoding:X,preserveNewlines:Q}),U=new dG1({read:V,destroy:cG1(pN.bind(void 0,{subprocessStdout:K,subprocess:Z,waitReadableDestroy:G})),highWaterMark:q,objectMode:z,encoding:H});return lN({subprocessStdout:K,onStdoutDataDone:F,readable:U,subprocess:Z}),U},uN=(Z,J,X)=>{let Y=VQ(Z,J),$=h3(X,Y,"readableDestroy");return{subprocessStdout:Y,waitReadableDestroy:$}},dN=({readableEncoding:Z,readableObjectMode:J,readableHighWaterMark:X},Y)=>Y?{readableEncoding:Z,readableObjectMode:J,readableHighWaterMark:X}:{readableEncoding:Z,readableObjectMode:!0,readableHighWaterMark:xN},cN=({subprocessStdout:Z,subprocess:J,binary:X,encoding:Y,preserveNewlines:$})=>{let Q=s4(),W=GU({subprocessStdout:Z,subprocess:J,binary:X,shouldEncode:!X,encoding:Y,preserveNewlines:$});return{read(){lG1(this,W,Q)},onStdoutDataDone:Q}},lG1=async(Z,J,X)=>{try{let{value:Y,done:$}=await J.next();if($)X.resolve();else Z.push(Y)}catch{}},lN=async({subprocessStdout:Z,onStdoutDataDone:J,readable:X,subprocess:Y,subprocessStdin:$})=>{try{if(await mN(Z),await Y,await yN($),await J,X.readable)X.push(null)}catch(Q){await yN($),$d(X,Q)}},pN=async({subprocessStdout:Z,subprocess:J,waitReadableDestroy:X},Y)=>{if(await jQ(X,J))$d(Z,Y),await zU(J,Y)},$d=(Z,J)=>{qU(Z,Z.readable,J)};import{Writable as pG1}from"stream";import{callbackify as Qd}from"util";var Wd=({subprocess:Z,concurrentStreams:J},{to:X}={})=>{let{subprocessStdin:Y,waitWritableFinal:$,waitWritableDestroy:Q}=iN(Z,X,J),W=new pG1({...nN(Y,Z,$),destroy:Qd(sN.bind(void 0,{subprocessStdin:Y,subprocess:Z,waitWritableFinal:$,waitWritableDestroy:Q})),highWaterMark:Y.writableHighWaterMark,objectMode:Y.writableObjectMode});return aN(Y,W),W},iN=(Z,J,X)=>{let Y=kF(Z,J),$=h3(X,Y,"writableFinal"),Q=h3(X,Y,"writableDestroy");return{subprocessStdin:Y,waitWritableFinal:$,waitWritableDestroy:Q}},nN=(Z,J,X)=>({write:iG1.bind(void 0,Z),final:Qd(nG1.bind(void 0,Z,J,X))}),iG1=(Z,J,X,Y)=>{if(Z.write(J,X))Y();else Z.once("drain",Y)},nG1=async(Z,J,X)=>{if(await jQ(X,J)){if(Z.writable)Z.end();await J}},aN=async(Z,J,X)=>{try{if(await gN(Z),J.writable)J.end()}catch(Y){await Xd(X),Kd(J,Y)}},sN=async({subprocessStdin:Z,subprocess:J,waitWritableFinal:X,waitWritableDestroy:Y},$)=>{if(await jQ(X,J),await jQ(Y,J))Kd(Z,$),await zU(J,$)},Kd=(Z,J)=>{qU(Z,Z.writable,J)};import{Duplex as aG1}from"stream";import{callbackify as sG1}from"util";var Gd=({subprocess:Z,concurrentStreams:J,encoding:X},{from:Y,to:$,binary:Q=!0,preserveNewlines:W=!0}={})=>{let K=Q||u5.has(X),{subprocessStdout:G,waitReadableDestroy:H}=uN(Z,Y,J),{subprocessStdin:z,waitWritableFinal:q,waitWritableDestroy:V}=iN(Z,$,J),{readableEncoding:F,readableObjectMode:U,readableHighWaterMark:w}=dN(G,K),{read:L,onStdoutDataDone:O}=cN({subprocessStdout:G,subprocess:Z,binary:K,encoding:X,preserveNewlines:W}),N=new aG1({read:L,...nN(z,Z,q),destroy:sG1(oG1.bind(void 0,{subprocessStdout:G,subprocessStdin:z,subprocess:Z,waitReadableDestroy:H,waitWritableFinal:q,waitWritableDestroy:V})),readableHighWaterMark:w,writableHighWaterMark:z.writableHighWaterMark,readableObjectMode:U,writableObjectMode:z.writableObjectMode,encoding:F});return lN({subprocessStdout:G,onStdoutDataDone:O,readable:N,subprocess:Z,subprocessStdin:z}),aN(z,N,G),N},oG1=async({subprocessStdout:Z,subprocessStdin:J,subprocess:X,waitReadableDestroy:Y,waitWritableFinal:$,waitWritableDestroy:Q},W)=>{await Promise.all([pN({subprocessStdout:Z,subprocess:X,waitReadableDestroy:Y},W),sN({subprocessStdin:J,subprocess:X,waitWritableFinal:$,waitWritableDestroy:Q},W)])};var oN=(Z,J,{from:X,binary:Y=!1,preserveNewlines:$=!1}={})=>{let Q=Y||u5.has(J),W=VQ(Z,X),K=GU({subprocessStdout:W,subprocess:Z,binary:Q,shouldEncode:!0,encoding:J,preserveNewlines:$});return rG1(K,W,Z)},rG1=async function*(Z,J,X){try{yield*Z}finally{if(J.readable)J.destroy();await X}};var Hd=(Z,{encoding:J})=>{let X=Zd();Z.readable=Yd.bind(void 0,{subprocess:Z,concurrentStreams:X,encoding:J}),Z.writable=Wd.bind(void 0,{subprocess:Z,concurrentStreams:X}),Z.duplex=Gd.bind(void 0,{subprocess:Z,concurrentStreams:X,encoding:J}),Z.iterable=oN.bind(void 0,Z,J),Z[Symbol.asyncIterator]=oN.bind(void 0,Z,J,{})};var zd=(Z,J)=>{for(let[X,Y]of eG1){let $=Y.value.bind(J);Reflect.defineProperty(Z,X,{...Y,value:$})}},tG1=(async()=>{})().constructor.prototype,eG1=["then","catch","finally"].map((Z)=>[Z,Reflect.getOwnPropertyDescriptor(tG1,Z)]);var qd=(Z,J,X,Y)=>{let{file:$,commandArguments:Q,command:W,escapedCommand:K,startTime:G,verboseInfo:H,options:z,fileDescriptors:q}=XH1(Z,J,X),{subprocess:V,promise:F}=$H1({file:$,commandArguments:Q,options:z,startTime:G,verboseInfo:H,command:W,escapedCommand:K,fileDescriptors:q});return V.pipe=KU.bind(void 0,{source:V,sourcePromise:F,boundOptions:{},createNested:Y}),zd(V,F),o4.set(V,{options:z,fileDescriptors:q}),V},XH1=(Z,J,X)=>{let{command:Y,escapedCommand:$,startTime:Q,verboseInfo:W}=LF(Z,J,X),{file:K,commandArguments:G,options:H}=yF(Z,J,X),z=YH1(H),q=Ou(z,W);return{file:K,commandArguments:G,command:Y,escapedCommand:$,startTime:Q,verboseInfo:W,options:z,fileDescriptors:q}},YH1=({timeout:Z,signal:J,...X})=>{if(J!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...X,timeoutDuration:Z}},$H1=({file:Z,commandArguments:J,options:X,startTime:Y,verboseInfo:$,command:Q,escapedCommand:W,fileDescriptors:K})=>{let G;try{G=JH1(Z,J,X)}catch(U){return Uu({error:U,command:Q,escapedCommand:W,fileDescriptors:K,options:X,startTime:Y,verboseInfo:$})}let H=new AbortController;ZH1(Number.POSITIVE_INFINITY,H.signal);let z=[...G.stdio];Eu(G,K,H),Au(G,X,H);let q={},V=s4();G.kill=dy.bind(void 0,{kill:G.kill.bind(G),options:X,onInternalError:V,context:q,controller:H}),G.all=nu(G,X),Hd(G,X),qu(G,X);let F=QH1({subprocess:G,options:X,startTime:Y,verboseInfo:$,fileDescriptors:K,originalStreams:z,command:Q,escapedCommand:W,context:q,onInternalError:V,controller:H});return{subprocess:G,promise:F}},QH1=async({subprocess:Z,options:J,startTime:X,verboseInfo:Y,fileDescriptors:$,originalStreams:Q,command:W,escapedCommand:K,context:G,onInternalError:H,controller:z})=>{let[q,[V,F],U,w,L]=await eu({subprocess:Z,options:J,context:G,verboseInfo:Y,fileDescriptors:$,originalStreams:Q,onInternalError:H,controller:z});z.abort(),H.resolve();let O=U.map((j,P)=>QZ(j,J,P)),N=QZ(w,J,"all"),M=WH1({errorInfo:q,exitCode:V,signal:F,stdio:O,all:N,ipcOutput:L,context:G,options:J,command:W,escapedCommand:K,startTime:X});return wQ(M,Y,J)},WH1=({errorInfo:Z,exitCode:J,signal:X,stdio:Y,all:$,ipcOutput:Q,context:W,options:K,command:G,escapedCommand:H,startTime:z})=>("error"in Z)?I3({error:Z.error,command:G,escapedCommand:H,timedOut:W.terminationReason==="timeout",isCanceled:W.terminationReason==="cancel"||W.terminationReason==="gracefulCancel",isGracefullyCanceled:W.terminationReason==="gracefulCancel",isMaxBuffer:Z.error instanceof YZ,isForcefullyTerminated:W.isForcefullyTerminated,exitCode:J,signal:X,stdio:Y,all:$,ipcOutput:Q,options:K,startTime:z,isSync:!1}):nF({command:G,escapedCommand:H,stdio:Y,all:$,ipcOutput:Q,options:K,startTime:z});var VU=(Z,J)=>{let X=Object.fromEntries(Object.entries(J).map(([Y,$])=>[Y,KH1(Y,Z[Y],$)]));return{...Z,...X}},KH1=(Z,J,X)=>{if(GH1.has(Z)&&O8(J)&&O8(X))return{...J,...X};return X},GH1=new Set(["env",...IR]);var WJ=(Z,J,X,Y)=>{let $=(W,K,G)=>WJ(W,K,X,G),Q=(...W)=>HH1({mapArguments:Z,deepOptions:X,boundOptions:J,setBoundExeca:Y,createNested:$},...W);if(Y!==void 0)Y(Q,$,J);return Q},HH1=({mapArguments:Z,deepOptions:J={},boundOptions:X={},setBoundExeca:Y,createNested:$},Q,...W)=>{if(O8(Q))return $(Z,VU(X,Q),Y);let{file:K,commandArguments:G,options:H,isSync:z}=zH1({mapArguments:Z,firstArgument:Q,nextArguments:W,deepOptions:J,boundOptions:X});return z?Qu(K,G,H):qd(K,G,H,$)},zH1=({mapArguments:Z,firstArgument:J,nextArguments:X,deepOptions:Y,boundOptions:$})=>{let Q=Ob(J)?jb(J,X):[J,...X],[W,K,G]=$F(...Q),H=VU(VU(Y,$),G),{file:z=W,commandArguments:q=K,options:V=H,isSync:F=!1}=Z({file:W,commandArguments:K,options:H});return{file:z,commandArguments:q,options:V,isSync:F}};var Vd=({file:Z,commandArguments:J})=>Ud(Z,J),Fd=({file:Z,commandArguments:J})=>({...Ud(Z,J),isSync:!0}),Ud=(Z,J)=>{if(J.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${Z} ${J}.`);let[X,...Y]=qH1(Z);return{file:X,commandArguments:Y}},qH1=(Z)=>{if(typeof Z!=="string")throw new TypeError(`The command must be a string: ${String(Z)}.`);let J=Z.trim();if(J==="")return[];let X=[];for(let Y of J.split(VH1)){let $=X.at(-1);if($&&$.endsWith("\\"))X[X.length-1]=`${$.slice(0,-1)} ${Y}`;else X.push(Y)}return X},VH1=/ +/g;var Ld=(Z,J,X)=>{Z.sync=J(FH1,X),Z.s=Z.sync},wd=({options:Z})=>Bd(Z),FH1=({options:Z})=>({...Bd(Z),isSync:!0}),Bd=(Z)=>({options:{...UH1(Z),...Z}}),UH1=({input:Z,inputFile:J,stdio:X})=>Z===void 0&&J===void 0&&X===void 0?{stdin:"inherit"}:{},Od={preferLocal:!0};var jd=WJ(()=>({})),P36=WJ(()=>({isSync:!0})),C36=WJ(Vd),T36=WJ(Fd),k36=WJ(Cg),E36=WJ(wd,{},Od,Ld),{sendMessage:I36,getOneMessage:v36,getEachMessage:S36,getCancelSignal:_36}=Vu();var gd=t(Sd(),1);var b3=(Z)=>{if(typeof Z!=="string")throw new TypeError("invalid pattern");if(Z.length>65536)throw new TypeError("pattern is too long")};var NH1={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},y3=(Z)=>Z.replace(/[[\]\\-]/g,"\\$&"),DH1=(Z)=>Z.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),_d=(Z)=>Z.join(""),Ad=(Z,J)=>{let X=J;if(Z.charAt(X)!=="[")throw new Error("not in a brace expression");let Y=[],$=[],Q=X+1,W=!1,K=!1,G=!1,H=!1,z=X,q="";Z:while(Q<Z.length){let w=Z.charAt(Q);if((w==="!"||w==="^")&&Q===X+1){H=!0,Q++;continue}if(w==="]"&&W&&!G){z=Q+1;break}if(W=!0,w==="\\"){if(!G){G=!0,Q++;continue}}if(w==="["&&!G){for(let[L,[O,N,M]]of Object.entries(NH1))if(Z.startsWith(L,Q)){if(q)return["$.",!1,Z.length-X,!0];if(Q+=L.length,M)$.push(O);else Y.push(O);K=K||N;continue Z}}if(G=!1,q){if(w>q)Y.push(y3(q)+"-"+y3(w));else if(w===q)Y.push(y3(w));q="",Q++;continue}if(Z.startsWith("-]",Q+1)){Y.push(y3(w+"-")),Q+=2;continue}if(Z.startsWith("-",Q+1)){q=w,Q+=2;continue}Y.push(y3(w)),Q++}if(z<Q)return["",!1,0,!1];if(!Y.length&&!$.length)return["$.",!1,Z.length-X,!0];if($.length===0&&Y.length===1&&/^\\?.$/.test(Y[0])&&!H){let w=Y[0].length===2?Y[0].slice(-1):Y[0];return[DH1(w),!1,z-X,!1]}let V="["+(H?"^":"")+_d(Y)+"]",F="["+(H?"":"^")+_d($)+"]";return[Y.length&&$.length?"("+V+"|"+F+")":Y.length?V:F,K,z-X,!0]};var K4=(Z,{windowsPathsNoEscape:J=!1}={})=>{return J?Z.replace(/\[([^\/\\])\]/g,"$1"):Z.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1")};var PH1=new Set(["!","?","+","*","@"]),xd=(Z)=>PH1.has(Z),CH1="(?!(?:^|/)\\.\\.?(?:$|/))",FU="(?!\\.)",TH1=new Set(["[","."]),kH1=new Set(["..","."]),EH1=new Set("().*{}+?[]^$\\!"),IH1=(Z)=>Z.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),ZD="[^/]",hd=ZD+"*?",fd=ZD+"+?";class U6{type;#Z;#J;#Y=!1;#X=[];#$;#z;#V;#K=!1;#G;#H;#q=!1;constructor(Z,J,X={}){if(this.type=Z,Z)this.#J=!0;if(this.#$=J,this.#Z=this.#$?this.#$.#Z:this,this.#G=this.#Z===this?X:this.#Z.#G,this.#V=this.#Z===this?[]:this.#Z.#V,Z==="!"&&!this.#Z.#K)this.#V.push(this);this.#z=this.#$?this.#$.#X.length:0}get hasMagic(){if(this.#J!==void 0)return this.#J;for(let Z of this.#X){if(typeof Z==="string")continue;if(Z.type||Z.hasMagic)return this.#J=!0}return this.#J}toString(){if(this.#H!==void 0)return this.#H;if(!this.type)return this.#H=this.#X.map((Z)=>String(Z)).join("");else return this.#H=this.type+"("+this.#X.map((Z)=>String(Z)).join("|")+")"}#Q(){if(this!==this.#Z)throw new Error("should only call on root");if(this.#K)return this;this.toString(),this.#K=!0;let Z;while(Z=this.#V.pop()){if(Z.type!=="!")continue;let J=Z,X=J.#$;while(X){for(let Y=J.#z+1;!X.type&&Y<X.#X.length;Y++)for(let $ of Z.#X){if(typeof $==="string")throw new Error("string part in extglob AST??");$.copyIn(X.#X[Y])}J=X,X=J.#$}}return this}push(...Z){for(let J of Z){if(J==="")continue;if(typeof J!=="string"&&!(J instanceof U6&&J.#$===this))throw new Error("invalid part: "+J);this.#X.push(J)}}toJSON(){let Z=this.type===null?this.#X.slice().map((J)=>typeof J==="string"?J:J.toJSON()):[this.type,...this.#X.map((J)=>J.toJSON())];if(this.isStart()&&!this.type)Z.unshift([]);if(this.isEnd()&&(this===this.#Z||this.#Z.#K&&this.#$?.type==="!"))Z.push({});return Z}isStart(){if(this.#Z===this)return!0;if(!this.#$?.isStart())return!1;if(this.#z===0)return!0;let Z=this.#$;for(let J=0;J<this.#z;J++){let X=Z.#X[J];if(!(X instanceof U6&&X.type==="!"))return!1}return!0}isEnd(){if(this.#Z===this)return!0;if(this.#$?.type==="!")return!0;if(!this.#$?.isEnd())return!1;if(!this.type)return this.#$?.isEnd();let Z=this.#$?this.#$.#X.length:0;return this.#z===Z-1}copyIn(Z){if(typeof Z==="string")this.push(Z);else this.push(Z.clone(this))}clone(Z){let J=new U6(this.type,Z);for(let X of this.#X)J.copyIn(X);return J}static#U(Z,J,X,Y){let $=!1,Q=!1,W=-1,K=!1;if(J.type===null){let V=X,F="";while(V<Z.length){let U=Z.charAt(V++);if($||U==="\\"){$=!$,F+=U;continue}if(Q){if(V===W+1){if(U==="^"||U==="!")K=!0}else if(U==="]"&&!(V===W+2&&K))Q=!1;F+=U;continue}else if(U==="["){Q=!0,W=V,K=!1,F+=U;continue}if(!Y.noext&&xd(U)&&Z.charAt(V)==="("){J.push(F),F="";let w=new U6(U,J);V=U6.#U(Z,w,V,Y),J.push(w);continue}F+=U}return J.push(F),V}let G=X+1,H=new U6(null,J),z=[],q="";while(G<Z.length){let V=Z.charAt(G++);if($||V==="\\"){$=!$,q+=V;continue}if(Q){if(G===W+1){if(V==="^"||V==="!")K=!0}else if(V==="]"&&!(G===W+2&&K))Q=!1;q+=V;continue}else if(V==="["){Q=!0,W=G,K=!1,q+=V;continue}if(xd(V)&&Z.charAt(G)==="("){H.push(q),q="";let F=new U6(V,H);H.push(F),G=U6.#U(Z,F,G,Y);continue}if(V==="|"){H.push(q),q="",z.push(H),H=new U6(null,J);continue}if(V===")"){if(q===""&&J.#X.length===0)J.#q=!0;return H.push(q),q="",J.push(...z,H),G}q+=V}return J.type=null,J.#J=void 0,J.#X=[Z.substring(X-1)],G}static fromGlob(Z,J={}){let X=new U6(null,void 0,J);return U6.#U(Z,X,0,J),X}toMMPattern(){if(this!==this.#Z)return this.#Z.toMMPattern();let Z=this.toString(),[J,X,Y,$]=this.toRegExpSource();if(!(Y||this.#J||this.#G.nocase&&!this.#G.nocaseMagicOnly&&Z.toUpperCase()!==Z.toLowerCase()))return X;let W=(this.#G.nocase?"i":"")+($?"u":"");return Object.assign(new RegExp(`^${J}$`,W),{_src:J,_glob:Z})}get options(){return this.#G}toRegExpSource(Z){let J=Z??!!this.#G.dot;if(this.#Z===this)this.#Q();if(!this.type){let K=this.isStart()&&this.isEnd(),G=this.#X.map((V)=>{let[F,U,w,L]=typeof V==="string"?U6.#L(V,this.#J,K):V.toRegExpSource(Z);return this.#J=this.#J||w,this.#Y=this.#Y||L,F}).join(""),H="";if(this.isStart()){if(typeof this.#X[0]==="string"){if(!(this.#X.length===1&&kH1.has(this.#X[0]))){let F=TH1,U=J&&F.has(G.charAt(0))||G.startsWith("\\.")&&F.has(G.charAt(2))||G.startsWith("\\.\\.")&&F.has(G.charAt(4)),w=!J&&!Z&&F.has(G.charAt(0));H=U?CH1:w?FU:""}}}let z="";if(this.isEnd()&&this.#Z.#K&&this.#$?.type==="!")z="(?:$|\\/)";return[H+G+z,K4(G),this.#J=!!this.#J,this.#Y]}let X=this.type==="*"||this.type==="+",Y=this.type==="!"?"(?:(?!(?:":"(?:",$=this.#w(J);if(this.isStart()&&this.isEnd()&&!$&&this.type!=="!"){let K=this.toString();return this.#X=[K],this.type=null,this.#J=void 0,[K,K4(this.toString()),!1,!1]}let Q=!X||Z||J||!FU?"":this.#w(!0);if(Q===$)Q="";if(Q)$=`(?:${$})(?:${Q})*?`;let W="";if(this.type==="!"&&this.#q)W=(this.isStart()&&!J?FU:"")+fd;else{let K=this.type==="!"?"))"+(this.isStart()&&!J&&!Z?FU:"")+hd+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&Q?")":this.type==="*"&&Q?")?":`)${this.type}`;W=Y+$+K}return[W,K4($),this.#J=!!this.#J,this.#Y]}#w(Z){return this.#X.map((J)=>{if(typeof J==="string")throw new Error("string type in extglob ast??");let[X,Y,$,Q]=J.toRegExpSource(Z);return this.#Y=this.#Y||Q,X}).filter((J)=>!(this.isStart()&&this.isEnd())||!!J).join("|")}static#L(Z,J,X=!1){let Y=!1,$="",Q=!1;for(let W=0;W<Z.length;W++){let K=Z.charAt(W);if(Y){Y=!1,$+=(EH1.has(K)?"\\":"")+K;continue}if(K==="\\"){if(W===Z.length-1)$+="\\\\";else Y=!0;continue}if(K==="["){let[G,H,z,q]=Ad(Z,W);if(z){$+=G,Q=Q||H,W+=z-1,J=J||q;continue}}if(K==="*"){if(X&&Z==="*")$+=fd;else $+=hd;J=!0;continue}if(K==="?"){$+=ZD,J=!0;continue}$+=IH1(K)}return[$,K4(Z),!!J,Q]}}var MQ=(Z,{windowsPathsNoEscape:J=!1}={})=>{return J?Z.replace(/[?*()[\]]/g,"[$&]"):Z.replace(/[?*()[\]\\]/g,"\\$&")};var m6=(Z,J,X={})=>{if(b3(J),!X.nocomment&&J.charAt(0)==="#")return!1;return new O9(J,X).match(Z)},vH1=/^\*+([^+@!?\*\[\(]*)$/,SH1=(Z)=>(J)=>!J.startsWith(".")&&J.endsWith(Z),_H1=(Z)=>(J)=>J.endsWith(Z),AH1=(Z)=>{return Z=Z.toLowerCase(),(J)=>!J.startsWith(".")&&J.toLowerCase().endsWith(Z)},xH1=(Z)=>{return Z=Z.toLowerCase(),(J)=>J.toLowerCase().endsWith(Z)},hH1=/^\*+\.\*+$/,fH1=(Z)=>!Z.startsWith(".")&&Z.includes("."),bH1=(Z)=>Z!=="."&&Z!==".."&&Z.includes("."),yH1=/^\.\*+$/,gH1=(Z)=>Z!=="."&&Z!==".."&&Z.startsWith("."),mH1=/^\*+$/,uH1=(Z)=>Z.length!==0&&!Z.startsWith("."),dH1=(Z)=>Z.length!==0&&Z!=="."&&Z!=="..",cH1=/^\?+([^+@!?\*\[\(]*)?$/,lH1=([Z,J=""])=>{let X=md([Z]);if(!J)return X;return J=J.toLowerCase(),(Y)=>X(Y)&&Y.toLowerCase().endsWith(J)},pH1=([Z,J=""])=>{let X=ud([Z]);if(!J)return X;return J=J.toLowerCase(),(Y)=>X(Y)&&Y.toLowerCase().endsWith(J)},iH1=([Z,J=""])=>{let X=ud([Z]);return!J?X:(Y)=>X(Y)&&Y.endsWith(J)},nH1=([Z,J=""])=>{let X=md([Z]);return!J?X:(Y)=>X(Y)&&Y.endsWith(J)},md=([Z])=>{let J=Z.length;return(X)=>X.length===J&&!X.startsWith(".")},ud=([Z])=>{let J=Z.length;return(X)=>X.length===J&&X!=="."&&X!==".."},dd=typeof process==="object"&&process?typeof process.env==="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",bd={win32:{sep:"\\"},posix:{sep:"/"}},aH1=dd==="win32"?bd.win32.sep:bd.posix.sep;m6.sep=aH1;var L6=Symbol("globstar **");m6.GLOBSTAR=L6;var sH1="[^/]",oH1=sH1+"*?",rH1="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",tH1="(?:(?!(?:\\/|^)\\.).)*?",eH1=(Z,J={})=>(X)=>m6(X,Z,J);m6.filter=eH1;var B9=(Z,J={})=>Object.assign({},Z,J),Zz1=(Z)=>{if(!Z||typeof Z!=="object"||!Object.keys(Z).length)return m6;let J=m6;return Object.assign((Y,$,Q={})=>J(Y,$,B9(Z,Q)),{Minimatch:class Y extends J.Minimatch{constructor($,Q={}){super($,B9(Z,Q))}static defaults($){return J.defaults(B9(Z,$)).Minimatch}},AST:class Y extends J.AST{constructor($,Q,W={}){super($,Q,B9(Z,W))}static fromGlob($,Q={}){return J.AST.fromGlob($,B9(Z,Q))}},unescape:(Y,$={})=>J.unescape(Y,B9(Z,$)),escape:(Y,$={})=>J.escape(Y,B9(Z,$)),filter:(Y,$={})=>J.filter(Y,B9(Z,$)),defaults:(Y)=>J.defaults(B9(Z,Y)),makeRe:(Y,$={})=>J.makeRe(Y,B9(Z,$)),braceExpand:(Y,$={})=>J.braceExpand(Y,B9(Z,$)),match:(Y,$,Q={})=>J.match(Y,$,B9(Z,Q)),sep:J.sep,GLOBSTAR:L6})};m6.defaults=Zz1;var cd=(Z,J={})=>{if(b3(Z),J.nobrace||!/\{(?:(?!\{).)*\}/.test(Z))return[Z];return gd.default(Z)};m6.braceExpand=cd;var Jz1=(Z,J={})=>new O9(Z,J).makeRe();m6.makeRe=Jz1;var Xz1=(Z,J,X={})=>{let Y=new O9(J,X);if(Z=Z.filter(($)=>Y.match($)),Y.options.nonull&&!Z.length)Z.push(J);return Z};m6.match=Xz1;var yd=/[?*]|[+@!]\(.*?\)|\[|\]/,Yz1=(Z)=>Z.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");class O9{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(Z,J={}){if(b3(Z),J=J||{},this.options=J,this.pattern=Z,this.platform=J.platform||dd,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!J.windowsPathsNoEscape||J.allowWindowsEscape===!1,this.windowsPathsNoEscape)this.pattern=this.pattern.replace(/\\/g,"/");this.preserveMultipleSlashes=!!J.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!J.nonegate,this.comment=!1,this.empty=!1,this.partial=!!J.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=J.windowsNoMagicRoot!==void 0?J.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let Z of this.set)for(let J of Z)if(typeof J!=="string")return!0;return!1}debug(...Z){}make(){let Z=this.pattern,J=this.options;if(!J.nocomment&&Z.charAt(0)==="#"){this.comment=!0;return}if(!Z){this.empty=!0;return}if(this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],J.debug)this.debug=(...$)=>console.error(...$);this.debug(this.pattern,this.globSet);let X=this.globSet.map(($)=>this.slashSplit($));this.globParts=this.preprocess(X),this.debug(this.pattern,this.globParts);let Y=this.globParts.map(($,Q,W)=>{if(this.isWindows&&this.windowsNoMagicRoot){let K=$[0]===""&&$[1]===""&&($[2]==="?"||!yd.test($[2]))&&!yd.test($[3]),G=/^[a-z]:/i.test($[0]);if(K)return[...$.slice(0,4),...$.slice(4).map((H)=>this.parse(H))];else if(G)return[$[0],...$.slice(1).map((H)=>this.parse(H))]}return $.map((K)=>this.parse(K))});if(this.debug(this.pattern,Y),this.set=Y.filter(($)=>$.indexOf(!1)===-1),this.isWindows)for(let $=0;$<this.set.length;$++){let Q=this.set[$];if(Q[0]===""&&Q[1]===""&&this.globParts[$][2]==="?"&&typeof Q[3]==="string"&&/^[a-z]:$/i.test(Q[3]))Q[2]="?"}this.debug(this.pattern,this.set)}preprocess(Z){if(this.options.noglobstar){for(let X=0;X<Z.length;X++)for(let Y=0;Y<Z[X].length;Y++)if(Z[X][Y]==="**")Z[X][Y]="*"}let{optimizationLevel:J=1}=this.options;if(J>=2)Z=this.firstPhasePreProcess(Z),Z=this.secondPhasePreProcess(Z);else if(J>=1)Z=this.levelOneOptimize(Z);else Z=this.adjascentGlobstarOptimize(Z);return Z}adjascentGlobstarOptimize(Z){return Z.map((J)=>{let X=-1;while((X=J.indexOf("**",X+1))!==-1){let Y=X;while(J[Y+1]==="**")Y++;if(Y!==X)J.splice(X,Y-X)}return J})}levelOneOptimize(Z){return Z.map((J)=>{return J=J.reduce((X,Y)=>{let $=X[X.length-1];if(Y==="**"&&$==="**")return X;if(Y===".."){if($&&$!==".."&&$!=="."&&$!=="**")return X.pop(),X}return X.push(Y),X},[]),J.length===0?[""]:J})}levelTwoFileOptimize(Z){if(!Array.isArray(Z))Z=this.slashSplit(Z);let J=!1;do{if(J=!1,!this.preserveMultipleSlashes){for(let Y=1;Y<Z.length-1;Y++){let $=Z[Y];if(Y===1&&$===""&&Z[0]==="")continue;if($==="."||$==="")J=!0,Z.splice(Y,1),Y--}if(Z[0]==="."&&Z.length===2&&(Z[1]==="."||Z[1]===""))J=!0,Z.pop()}let X=0;while((X=Z.indexOf("..",X+1))!==-1){let Y=Z[X-1];if(Y&&Y!=="."&&Y!==".."&&Y!=="**")J=!0,Z.splice(X-1,2),X-=2}}while(J);return Z.length===0?[""]:Z}firstPhasePreProcess(Z){let J=!1;do{J=!1;for(let X of Z){let Y=-1;while((Y=X.indexOf("**",Y+1))!==-1){let Q=Y;while(X[Q+1]==="**")Q++;if(Q>Y)X.splice(Y+1,Q-Y);let W=X[Y+1],K=X[Y+2],G=X[Y+3];if(W!=="..")continue;if(!K||K==="."||K===".."||!G||G==="."||G==="..")continue;J=!0,X.splice(Y,1);let H=X.slice(0);H[Y]="**",Z.push(H),Y--}if(!this.preserveMultipleSlashes){for(let Q=1;Q<X.length-1;Q++){let W=X[Q];if(Q===1&&W===""&&X[0]==="")continue;if(W==="."||W==="")J=!0,X.splice(Q,1),Q--}if(X[0]==="."&&X.length===2&&(X[1]==="."||X[1]===""))J=!0,X.pop()}let $=0;while(($=X.indexOf("..",$+1))!==-1){let Q=X[$-1];if(Q&&Q!=="."&&Q!==".."&&Q!=="**"){J=!0;let K=$===1&&X[$+1]==="**"?["."]:[];if(X.splice($-1,2,...K),X.length===0)X.push("");$-=2}}}}while(J);return Z}secondPhasePreProcess(Z){for(let J=0;J<Z.length-1;J++)for(let X=J+1;X<Z.length;X++){let Y=this.partsMatch(Z[J],Z[X],!this.preserveMultipleSlashes);if(Y){Z[J]=[],Z[X]=Y;break}}return Z.filter((J)=>J.length)}partsMatch(Z,J,X=!1){let Y=0,$=0,Q=[],W="";while(Y<Z.length&&$<J.length)if(Z[Y]===J[$])Q.push(W==="b"?J[$]:Z[Y]),Y++,$++;else if(X&&Z[Y]==="**"&&J[$]===Z[Y+1])Q.push(Z[Y]),Y++;else if(X&&J[$]==="**"&&Z[Y]===J[$+1])Q.push(J[$]),$++;else if(Z[Y]==="*"&&J[$]&&(this.options.dot||!J[$].startsWith("."))&&J[$]!=="**"){if(W==="b")return!1;W="a",Q.push(Z[Y]),Y++,$++}else if(J[$]==="*"&&Z[Y]&&(this.options.dot||!Z[Y].startsWith("."))&&Z[Y]!=="**"){if(W==="a")return!1;W="b",Q.push(J[$]),Y++,$++}else return!1;return Z.length===J.length&&Q}parseNegate(){if(this.nonegate)return;let Z=this.pattern,J=!1,X=0;for(let Y=0;Y<Z.length&&Z.charAt(Y)==="!";Y++)J=!J,X++;if(X)this.pattern=Z.slice(X);this.negate=J}matchOne(Z,J,X=!1){let Y=this.options;if(this.isWindows){let U=typeof Z[0]==="string"&&/^[a-z]:$/i.test(Z[0]),w=!U&&Z[0]===""&&Z[1]===""&&Z[2]==="?"&&/^[a-z]:$/i.test(Z[3]),L=typeof J[0]==="string"&&/^[a-z]:$/i.test(J[0]),O=!L&&J[0]===""&&J[1]===""&&J[2]==="?"&&typeof J[3]==="string"&&/^[a-z]:$/i.test(J[3]),N=w?3:U?0:void 0,M=O?3:L?0:void 0;if(typeof N==="number"&&typeof M==="number"){let[j,P]=[Z[N],J[M]];if(j.toLowerCase()===P.toLowerCase()){if(J[M]=j,M>N)J=J.slice(M);else if(N>M)Z=Z.slice(N)}}}let{optimizationLevel:$=1}=this.options;if($>=2)Z=this.levelTwoFileOptimize(Z);this.debug("matchOne",this,{file:Z,pattern:J}),this.debug("matchOne",Z.length,J.length);for(var Q=0,W=0,K=Z.length,G=J.length;Q<K&&W<G;Q++,W++){this.debug("matchOne loop");var H=J[W],z=Z[Q];if(this.debug(J,H,z),H===!1)return!1;if(H===L6){this.debug("GLOBSTAR",[J,H,z]);var q=Q,V=W+1;if(V===G){this.debug("** at the end");for(;Q<K;Q++)if(Z[Q]==="."||Z[Q]===".."||!Y.dot&&Z[Q].charAt(0)===".")return!1;return!0}while(q<K){var F=Z[q];if(this.debug(`
|
|
405
405
|
globstar while`,Z,q,J,V,F),this.matchOne(Z.slice(q),J.slice(V),X))return this.debug("globstar found match!",q,K,F),!0;else{if(F==="."||F===".."||!Y.dot&&F.charAt(0)==="."){this.debug("dot detected!",Z,q,J,V);break}this.debug("globstar swallow a segment, and continue"),q++}}if(X){if(this.debug(`
|
|
406
|
-
>>> no match, partial?`,Z,q,J,V),q===K)return!0}return!1}let U;if(typeof H==="string")U=z===H,this.debug("string match",H,z,U);else U=H.test(z),this.debug("pattern match",H,z,U);if(!U)return!1}if(Q===K&&W===G)return!0;else if(Q===K)return X;else if(W===G)return Q===K-1&&Z[Q]==="";else throw new Error("wtf?")}braceExpand(){return cd(this.pattern,this.options)}parse(Z){b3(Z);let J=this.options;if(Z==="**")return L6;if(Z==="")return"";let X,Y=null;if(X=Z.match(mH1))Y=J.dot?dH1:uH1;else if(X=Z.match(vH1))Y=(J.nocase?J.dot?xH1:AH1:J.dot?_H1:SH1)(X[1]);else if(X=Z.match(cH1))Y=(J.nocase?J.dot?pH1:lH1:J.dot?iH1:nH1)(X);else if(X=Z.match(hH1))Y=J.dot?bH1:fH1;else if(X=Z.match(yH1))Y=gH1;let $=U6.fromGlob(Z,this.options).toMMPattern();if(Y&&typeof $==="object")Reflect.defineProperty($,"test",{value:Y});return $}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let Z=this.set;if(!Z.length)return this.regexp=!1,this.regexp;let J=this.options,X=J.noglobstar?oH1:J.dot?rH1:tH1,Y=new Set(J.nocase?["i"]:[]),$=Z.map((K)=>{let G=K.map((H)=>{if(H instanceof RegExp)for(let z of H.flags.split(""))Y.add(z);return typeof H==="string"?Yz1(H):H===L6?L6:H._src});return G.forEach((H,z)=>{let q=G[z+1],V=G[z-1];if(H!==L6||V===L6)return;if(V===void 0)if(q!==void 0&&q!==L6)G[z+1]="(?:\\/|"+X+"\\/)?"+q;else G[z]=X;else if(q===void 0)G[z-1]=V+"(?:\\/|"+X+")?";else if(q!==L6)G[z-1]=V+"(?:\\/|\\/"+X+"\\/)"+q,G[z+1]=L6}),G.filter((H)=>H!==L6).join("/")}).join("|"),[Q,W]=Z.length>1?["(?:",")"]:["",""];if($="^"+Q+$+W+"$",this.negate)$="^(?!"+$+").+$";try{this.regexp=new RegExp($,[...Y].join(""))}catch(K){this.regexp=!1}return this.regexp}slashSplit(Z){if(this.preserveMultipleSlashes)return Z.split("/");else if(this.isWindows&&/^\/\/[^\/]+/.test(Z))return["",...Z.split(/\/+/)];else return Z.split(/\/+/)}match(Z,J=this.partial){if(this.debug("match",Z,this.pattern),this.comment)return!1;if(this.empty)return Z==="";if(Z==="/"&&J)return!0;let X=this.options;if(this.isWindows)Z=Z.split("\\").join("/");let Y=this.slashSplit(Z);this.debug(this.pattern,"split",Y);let $=this.set;this.debug(this.pattern,"set",$);let Q=Y[Y.length-1];if(!Q)for(let W=Y.length-2;!Q&&W>=0;W--)Q=Y[W];for(let W=0;W<$.length;W++){let K=$[W],G=Y;if(X.matchBase&&K.length===1)G=[Q];if(this.matchOne(G,K,J)){if(X.flipNegate)return!0;return!this.negate}}if(X.flipNegate)return!1;return this.negate}static defaults(Z){return m6.defaults(Z).Minimatch}}m6.AST=U6;m6.Minimatch=O9;m6.escape=MQ;m6.unescape=K4;import{fileURLToPath as hz1}from"url";var RQ=typeof performance==="object"&&performance&&typeof performance.now==="function"?performance:Date,pd=new Set,JD=typeof process==="object"&&!!process?process:{},id=(Z,J,X,Y)=>{typeof JD.emitWarning==="function"?JD.emitWarning(Z,J,X,Y):console.error(`[${X}] ${J}: ${Z}`)},UU=globalThis.AbortController,ld=globalThis.AbortSignal;if(typeof UU==="undefined"){ld=class X{onabort;_onabort=[];reason;aborted=!1;addEventListener(Y,$){this._onabort.push($)}},UU=class X{constructor(){J()}signal=new ld;abort(Y){if(this.signal.aborted)return;this.signal.reason=Y,this.signal.aborted=!0;for(let $ of this.signal._onabort)$(Y);this.signal.onabort?.(Y)}};let Z=JD.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",J=()=>{if(!Z)return;Z=!1,id("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",J)}}var $z1=(Z)=>!pd.has(Z),r36=Symbol("type"),KJ=(Z)=>Z&&Z===Math.floor(Z)&&Z>0&&isFinite(Z),nd=(Z)=>!KJ(Z)?null:Z<=Math.pow(2,8)?Uint8Array:Z<=Math.pow(2,16)?Uint16Array:Z<=Math.pow(2,32)?Uint32Array:Z<=Number.MAX_SAFE_INTEGER?g3:null;class g3 extends Array{constructor(Z){super(Z);this.fill(0)}}class NQ{heap;length;static#Z=!1;static create(Z){let J=nd(Z);if(!J)return[];NQ.#Z=!0;let X=new NQ(Z,J);return NQ.#Z=!1,X}constructor(Z,J){if(!NQ.#Z)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new J(Z),this.length=0}push(Z){this.heap[this.length++]=Z}pop(){return this.heap[--this.length]}}class m3{#Z;#J;#Y;#X;#$;#z;#V;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#K;#G;#H;#q;#Q;#U;#w;#L;#O;#k;#j;#E;#N;#R;#M;#C;#B;#v;static unsafeExposeInternals(Z){return{starts:Z.#N,ttls:Z.#R,sizes:Z.#E,keyMap:Z.#H,keyList:Z.#q,valList:Z.#Q,next:Z.#U,prev:Z.#w,get head(){return Z.#L},get tail(){return Z.#O},free:Z.#k,isBackgroundFetch:(J)=>Z.#F(J),backgroundFetch:(J,X,Y,$)=>Z.#h(J,X,Y,$),moveToTail:(J)=>Z.#y(J),indexes:(J)=>Z.#T(J),rindexes:(J)=>Z.#I(J),isStale:(J)=>Z.#P(J)}}get max(){return this.#Z}get maxSize(){return this.#J}get calculatedSize(){return this.#G}get size(){return this.#K}get fetchMethod(){return this.#z}get memoMethod(){return this.#V}get dispose(){return this.#Y}get onInsert(){return this.#X}get disposeAfter(){return this.#$}constructor(Z){let{max:J=0,ttl:X,ttlResolution:Y=1,ttlAutopurge:$,updateAgeOnGet:Q,updateAgeOnHas:W,allowStale:K,dispose:G,onInsert:H,disposeAfter:z,noDisposeOnSet:q,noUpdateTTL:V,maxSize:F=0,maxEntrySize:U=0,sizeCalculation:w,fetchMethod:L,memoMethod:O,noDeleteOnFetchRejection:N,noDeleteOnStaleGet:M,allowStaleOnFetchRejection:j,allowStaleOnFetchAbort:P,ignoreFetchAbort:D}=Z;if(J!==0&&!KJ(J))throw new TypeError("max option must be a nonnegative integer");let C=J?nd(J):Array;if(!C)throw new Error("invalid max value: "+J);if(this.#Z=J,this.#J=F,this.maxEntrySize=U||this.#J,this.sizeCalculation=w,this.sizeCalculation){if(!this.#J&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!=="function")throw new TypeError("sizeCalculation set to non-function")}if(O!==void 0&&typeof O!=="function")throw new TypeError("memoMethod must be a function if defined");if(this.#V=O,L!==void 0&&typeof L!=="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#z=L,this.#C=!!L,this.#H=new Map,this.#q=new Array(J).fill(void 0),this.#Q=new Array(J).fill(void 0),this.#U=new C(J),this.#w=new C(J),this.#L=0,this.#O=0,this.#k=NQ.create(J),this.#K=0,this.#G=0,typeof G==="function")this.#Y=G;if(typeof H==="function")this.#X=H;if(typeof z==="function")this.#$=z,this.#j=[];else this.#$=void 0,this.#j=void 0;if(this.#M=!!this.#Y,this.#v=!!this.#X,this.#B=!!this.#$,this.noDisposeOnSet=!!q,this.noUpdateTTL=!!V,this.noDeleteOnFetchRejection=!!N,this.allowStaleOnFetchRejection=!!j,this.allowStaleOnFetchAbort=!!P,this.ignoreFetchAbort=!!D,this.maxEntrySize!==0){if(this.#J!==0){if(!KJ(this.#J))throw new TypeError("maxSize must be a positive integer if specified")}if(!KJ(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#m()}if(this.allowStale=!!K,this.noDeleteOnStaleGet=!!M,this.updateAgeOnGet=!!Q,this.updateAgeOnHas=!!W,this.ttlResolution=KJ(Y)||Y===0?Y:1,this.ttlAutopurge=!!$,this.ttl=X||0,this.ttl){if(!KJ(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#W()}if(this.#Z===0&&this.ttl===0&&this.#J===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#Z&&!this.#J){if($z1("LRU_CACHE_UNBOUNDED"))pd.add("LRU_CACHE_UNBOUNDED"),id("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning","LRU_CACHE_UNBOUNDED",m3)}}getRemainingTTL(Z){return this.#H.has(Z)?1/0:0}#W(){let Z=new g3(this.#Z),J=new g3(this.#Z);this.#R=Z,this.#N=J,this.#S=($,Q,W=RQ.now())=>{if(J[$]=Q!==0?W:0,Z[$]=Q,Q!==0&&this.ttlAutopurge){let K=setTimeout(()=>{if(this.#P($))this.#_(this.#q[$],"expire")},Q+1);if(K.unref)K.unref()}},this.#A=($)=>{J[$]=Z[$]!==0?RQ.now():0},this.#D=($,Q)=>{if(Z[Q]){let W=Z[Q],K=J[Q];if(!W||!K)return;$.ttl=W,$.start=K,$.now=X||Y();let G=$.now-K;$.remainingTTL=W-G}};let X=0,Y=()=>{let $=RQ.now();if(this.ttlResolution>0){X=$;let Q=setTimeout(()=>X=0,this.ttlResolution);if(Q.unref)Q.unref()}return $};this.getRemainingTTL=($)=>{let Q=this.#H.get($);if(Q===void 0)return 0;let W=Z[Q],K=J[Q];if(!W||!K)return 1/0;let G=(X||Y())-K;return W-G},this.#P=($)=>{let Q=J[$],W=Z[$];return!!W&&!!Q&&(X||Y())-Q>W}}#A=()=>{};#D=()=>{};#S=()=>{};#P=()=>!1;#m(){let Z=new g3(this.#Z);this.#G=0,this.#E=Z,this.#x=(J)=>{this.#G-=Z[J],Z[J]=0},this.#u=(J,X,Y,$)=>{if(this.#F(X))return 0;if(!KJ(Y))if($){if(typeof $!=="function")throw new TypeError("sizeCalculation must be a function");if(Y=$(X,J),!KJ(Y))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return Y},this.#f=(J,X,Y)=>{if(Z[J]=X,this.#J){let $=this.#J-Z[J];while(this.#G>$)this.#b(!0)}if(this.#G+=Z[J],Y)Y.entrySize=X,Y.totalCalculatedSize=this.#G}}#x=(Z)=>{};#f=(Z,J,X)=>{};#u=(Z,J,X,Y)=>{if(X||Y)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#T({allowStale:Z=this.allowStale}={}){if(this.#K)for(let J=this.#O;;){if(!this.#d(J))break;if(Z||!this.#P(J))yield J;if(J===this.#L)break;else J=this.#w[J]}}*#I({allowStale:Z=this.allowStale}={}){if(this.#K)for(let J=this.#L;;){if(!this.#d(J))break;if(Z||!this.#P(J))yield J;if(J===this.#O)break;else J=this.#U[J]}}#d(Z){return Z!==void 0&&this.#H.get(this.#q[Z])===Z}*entries(){for(let Z of this.#T())if(this.#Q[Z]!==void 0&&this.#q[Z]!==void 0&&!this.#F(this.#Q[Z]))yield[this.#q[Z],this.#Q[Z]]}*rentries(){for(let Z of this.#I())if(this.#Q[Z]!==void 0&&this.#q[Z]!==void 0&&!this.#F(this.#Q[Z]))yield[this.#q[Z],this.#Q[Z]]}*keys(){for(let Z of this.#T()){let J=this.#q[Z];if(J!==void 0&&!this.#F(this.#Q[Z]))yield J}}*rkeys(){for(let Z of this.#I()){let J=this.#q[Z];if(J!==void 0&&!this.#F(this.#Q[Z]))yield J}}*values(){for(let Z of this.#T())if(this.#Q[Z]!==void 0&&!this.#F(this.#Q[Z]))yield this.#Q[Z]}*rvalues(){for(let Z of this.#I())if(this.#Q[Z]!==void 0&&!this.#F(this.#Q[Z]))yield this.#Q[Z]}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(Z,J={}){for(let X of this.#T()){let Y=this.#Q[X],$=this.#F(Y)?Y.__staleWhileFetching:Y;if($===void 0)continue;if(Z($,this.#q[X],this))return this.get(this.#q[X],J)}}forEach(Z,J=this){for(let X of this.#T()){let Y=this.#Q[X],$=this.#F(Y)?Y.__staleWhileFetching:Y;if($===void 0)continue;Z.call(J,$,this.#q[X],this)}}rforEach(Z,J=this){for(let X of this.#I()){let Y=this.#Q[X],$=this.#F(Y)?Y.__staleWhileFetching:Y;if($===void 0)continue;Z.call(J,$,this.#q[X],this)}}purgeStale(){let Z=!1;for(let J of this.#I({allowStale:!0}))if(this.#P(J))this.#_(this.#q[J],"expire"),Z=!0;return Z}info(Z){let J=this.#H.get(Z);if(J===void 0)return;let X=this.#Q[J],Y=this.#F(X)?X.__staleWhileFetching:X;if(Y===void 0)return;let $={value:Y};if(this.#R&&this.#N){let Q=this.#R[J],W=this.#N[J];if(Q&&W){let K=Q-(RQ.now()-W);$.ttl=K,$.start=Date.now()}}if(this.#E)$.size=this.#E[J];return $}dump(){let Z=[];for(let J of this.#T({allowStale:!0})){let X=this.#q[J],Y=this.#Q[J],$=this.#F(Y)?Y.__staleWhileFetching:Y;if($===void 0||X===void 0)continue;let Q={value:$};if(this.#R&&this.#N){Q.ttl=this.#R[J];let W=RQ.now()-this.#N[J];Q.start=Math.floor(Date.now()-W)}if(this.#E)Q.size=this.#E[J];Z.unshift([X,Q])}return Z}load(Z){this.clear();for(let[J,X]of Z){if(X.start){let Y=Date.now()-X.start;X.start=RQ.now()-Y}this.set(J,X.value,X)}}set(Z,J,X={}){if(J===void 0)return this.delete(Z),this;let{ttl:Y=this.ttl,start:$,noDisposeOnSet:Q=this.noDisposeOnSet,sizeCalculation:W=this.sizeCalculation,status:K}=X,{noUpdateTTL:G=this.noUpdateTTL}=X,H=this.#u(Z,J,X.size||0,W);if(this.maxEntrySize&&H>this.maxEntrySize){if(K)K.set="miss",K.maxEntrySizeExceeded=!0;return this.#_(Z,"set"),this}let z=this.#K===0?void 0:this.#H.get(Z);if(z===void 0){if(z=this.#K===0?this.#O:this.#k.length!==0?this.#k.pop():this.#K===this.#Z?this.#b(!1):this.#K,this.#q[z]=Z,this.#Q[z]=J,this.#H.set(Z,z),this.#U[this.#O]=z,this.#w[z]=this.#O,this.#O=z,this.#K++,this.#f(z,H,K),K)K.set="add";if(G=!1,this.#v)this.#X?.(J,Z,"add")}else{this.#y(z);let q=this.#Q[z];if(J!==q){if(this.#C&&this.#F(q)){q.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:V}=q;if(V!==void 0&&!Q){if(this.#M)this.#Y?.(V,Z,"set");if(this.#B)this.#j?.push([V,Z,"set"])}}else if(!Q){if(this.#M)this.#Y?.(q,Z,"set");if(this.#B)this.#j?.push([q,Z,"set"])}if(this.#x(z),this.#f(z,H,K),this.#Q[z]=J,K){K.set="replace";let V=q&&this.#F(q)?q.__staleWhileFetching:q;if(V!==void 0)K.oldValue=V}}else if(K)K.set="update";if(this.#v)this.onInsert?.(J,Z,J===q?"update":"replace")}if(Y!==0&&!this.#R)this.#W();if(this.#R){if(!G)this.#S(z,Y,$);if(K)this.#D(K,z)}if(!Q&&this.#B&&this.#j){let q=this.#j,V;while(V=q?.shift())this.#$?.(...V)}return this}pop(){try{while(this.#K){let Z=this.#Q[this.#L];if(this.#b(!0),this.#F(Z)){if(Z.__staleWhileFetching)return Z.__staleWhileFetching}else if(Z!==void 0)return Z}}finally{if(this.#B&&this.#j){let Z=this.#j,J;while(J=Z?.shift())this.#$?.(...J)}}}#b(Z){let J=this.#L,X=this.#q[J],Y=this.#Q[J];if(this.#C&&this.#F(Y))Y.__abortController.abort(new Error("evicted"));else if(this.#M||this.#B){if(this.#M)this.#Y?.(Y,X,"evict");if(this.#B)this.#j?.push([Y,X,"evict"])}if(this.#x(J),Z)this.#q[J]=void 0,this.#Q[J]=void 0,this.#k.push(J);if(this.#K===1)this.#L=this.#O=0,this.#k.length=0;else this.#L=this.#U[J];return this.#H.delete(X),this.#K--,J}has(Z,J={}){let{updateAgeOnHas:X=this.updateAgeOnHas,status:Y}=J,$=this.#H.get(Z);if($!==void 0){let Q=this.#Q[$];if(this.#F(Q)&&Q.__staleWhileFetching===void 0)return!1;if(!this.#P($)){if(X)this.#A($);if(Y)Y.has="hit",this.#D(Y,$);return!0}else if(Y)Y.has="stale",this.#D(Y,$)}else if(Y)Y.has="miss";return!1}peek(Z,J={}){let{allowStale:X=this.allowStale}=J,Y=this.#H.get(Z);if(Y===void 0||!X&&this.#P(Y))return;let $=this.#Q[Y];return this.#F($)?$.__staleWhileFetching:$}#h(Z,J,X,Y){let $=J===void 0?void 0:this.#Q[J];if(this.#F($))return $;let Q=new UU,{signal:W}=X;W?.addEventListener("abort",()=>Q.abort(W.reason),{signal:Q.signal});let K={signal:Q.signal,options:X,context:Y},G=(U,w=!1)=>{let{aborted:L}=Q.signal,O=X.ignoreFetchAbort&&U!==void 0;if(X.status)if(L&&!w){if(X.status.fetchAborted=!0,X.status.fetchError=Q.signal.reason,O)X.status.fetchAbortIgnored=!0}else X.status.fetchResolved=!0;if(L&&!O&&!w)return z(Q.signal.reason);let N=V;if(this.#Q[J]===V)if(U===void 0)if(N.__staleWhileFetching)this.#Q[J]=N.__staleWhileFetching;else this.#_(Z,"fetch");else{if(X.status)X.status.fetchUpdated=!0;this.set(Z,U,K.options)}return U},H=(U)=>{if(X.status)X.status.fetchRejected=!0,X.status.fetchError=U;return z(U)},z=(U)=>{let{aborted:w}=Q.signal,L=w&&X.allowStaleOnFetchAbort,O=L||X.allowStaleOnFetchRejection,N=O||X.noDeleteOnFetchRejection,M=V;if(this.#Q[J]===V){if(!N||M.__staleWhileFetching===void 0)this.#_(Z,"fetch");else if(!L)this.#Q[J]=M.__staleWhileFetching}if(O){if(X.status&&M.__staleWhileFetching!==void 0)X.status.returnedStale=!0;return M.__staleWhileFetching}else if(M.__returned===M)throw U},q=(U,w)=>{let L=this.#z?.(Z,$,K);if(L&&L instanceof Promise)L.then((O)=>U(O===void 0?void 0:O),w);Q.signal.addEventListener("abort",()=>{if(!X.ignoreFetchAbort||X.allowStaleOnFetchAbort){if(U(void 0),X.allowStaleOnFetchAbort)U=(O)=>G(O,!0)}})};if(X.status)X.status.fetchDispatched=!0;let V=new Promise(q).then(G,H),F=Object.assign(V,{__abortController:Q,__staleWhileFetching:$,__returned:void 0});if(J===void 0)this.set(Z,F,{...K.options,status:void 0}),J=this.#H.get(Z);else this.#Q[J]=F;return F}#F(Z){if(!this.#C)return!1;let J=Z;return!!J&&J instanceof Promise&&J.hasOwnProperty("__staleWhileFetching")&&J.__abortController instanceof UU}async fetch(Z,J={}){let{allowStale:X=this.allowStale,updateAgeOnGet:Y=this.updateAgeOnGet,noDeleteOnStaleGet:$=this.noDeleteOnStaleGet,ttl:Q=this.ttl,noDisposeOnSet:W=this.noDisposeOnSet,size:K=0,sizeCalculation:G=this.sizeCalculation,noUpdateTTL:H=this.noUpdateTTL,noDeleteOnFetchRejection:z=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:q=this.allowStaleOnFetchRejection,ignoreFetchAbort:V=this.ignoreFetchAbort,allowStaleOnFetchAbort:F=this.allowStaleOnFetchAbort,context:U,forceRefresh:w=!1,status:L,signal:O}=J;if(!this.#C){if(L)L.fetch="get";return this.get(Z,{allowStale:X,updateAgeOnGet:Y,noDeleteOnStaleGet:$,status:L})}let N={allowStale:X,updateAgeOnGet:Y,noDeleteOnStaleGet:$,ttl:Q,noDisposeOnSet:W,size:K,sizeCalculation:G,noUpdateTTL:H,noDeleteOnFetchRejection:z,allowStaleOnFetchRejection:q,allowStaleOnFetchAbort:F,ignoreFetchAbort:V,status:L,signal:O},M=this.#H.get(Z);if(M===void 0){if(L)L.fetch="miss";let j=this.#h(Z,M,N,U);return j.__returned=j}else{let j=this.#Q[M];if(this.#F(j)){let T=X&&j.__staleWhileFetching!==void 0;if(L){if(L.fetch="inflight",T)L.returnedStale=!0}return T?j.__staleWhileFetching:j.__returned=j}let P=this.#P(M);if(!w&&!P){if(L)L.fetch="hit";if(this.#y(M),Y)this.#A(M);if(L)this.#D(L,M);return j}let D=this.#h(Z,M,N,U),k=D.__staleWhileFetching!==void 0&&X;if(L){if(L.fetch=P?"stale":"refresh",k&&P)L.returnedStale=!0}return k?D.__staleWhileFetching:D.__returned=D}}async forceFetch(Z,J={}){let X=await this.fetch(Z,J);if(X===void 0)throw new Error("fetch() returned undefined");return X}memo(Z,J={}){let X=this.#V;if(!X)throw new Error("no memoMethod provided to constructor");let{context:Y,forceRefresh:$,...Q}=J,W=this.get(Z,Q);if(!$&&W!==void 0)return W;let K=X(Z,W,{options:Q,context:Y});return this.set(Z,K,Q),K}get(Z,J={}){let{allowStale:X=this.allowStale,updateAgeOnGet:Y=this.updateAgeOnGet,noDeleteOnStaleGet:$=this.noDeleteOnStaleGet,status:Q}=J,W=this.#H.get(Z);if(W!==void 0){let K=this.#Q[W],G=this.#F(K);if(Q)this.#D(Q,W);if(this.#P(W)){if(Q)Q.get="stale";if(!G){if(!$)this.#_(Z,"expire");if(Q&&X)Q.returnedStale=!0;return X?K:void 0}else{if(Q&&X&&K.__staleWhileFetching!==void 0)Q.returnedStale=!0;return X?K.__staleWhileFetching:void 0}}else{if(Q)Q.get="hit";if(G)return K.__staleWhileFetching;if(this.#y(W),Y)this.#A(W);return K}}else if(Q)Q.get="miss"}#c(Z,J){this.#w[J]=Z,this.#U[Z]=J}#y(Z){if(Z!==this.#O){if(Z===this.#L)this.#L=this.#U[Z];else this.#c(this.#w[Z],this.#U[Z]);this.#c(this.#O,Z),this.#O=Z}}delete(Z){return this.#_(Z,"delete")}#_(Z,J){let X=!1;if(this.#K!==0){let Y=this.#H.get(Z);if(Y!==void 0)if(X=!0,this.#K===1)this.#g(J);else{this.#x(Y);let $=this.#Q[Y];if(this.#F($))$.__abortController.abort(new Error("deleted"));else if(this.#M||this.#B){if(this.#M)this.#Y?.($,Z,J);if(this.#B)this.#j?.push([$,Z,J])}if(this.#H.delete(Z),this.#q[Y]=void 0,this.#Q[Y]=void 0,Y===this.#O)this.#O=this.#w[Y];else if(Y===this.#L)this.#L=this.#U[Y];else{let Q=this.#w[Y];this.#U[Q]=this.#U[Y];let W=this.#U[Y];this.#w[W]=this.#w[Y]}this.#K--,this.#k.push(Y)}}if(this.#B&&this.#j?.length){let Y=this.#j,$;while($=Y?.shift())this.#$?.(...$)}return X}clear(){return this.#g("delete")}#g(Z){for(let J of this.#I({allowStale:!0})){let X=this.#Q[J];if(this.#F(X))X.__abortController.abort(new Error("deleted"));else{let Y=this.#q[J];if(this.#M)this.#Y?.(X,Y,Z);if(this.#B)this.#j?.push([X,Y,Z])}}if(this.#H.clear(),this.#Q.fill(void 0),this.#q.fill(void 0),this.#R&&this.#N)this.#R.fill(0),this.#N.fill(0);if(this.#E)this.#E.fill(0);if(this.#L=0,this.#O=0,this.#k.length=0,this.#G=0,this.#K=0,this.#B&&this.#j){let J=this.#j,X;while(X=J?.shift())this.#$?.(...X)}}}import{posix as Lz1,win32 as qD}from"path";import{fileURLToPath as wz1}from"url";import{lstatSync as Bz1,readdir as Oz1,readdirSync as jz1,readlinkSync as Mz1,realpathSync as Rz1}from"fs";import*as Nz1 from"fs";import{lstat as Pz1,readdir as Cz1,readlink as Tz1,realpath as kz1}from"fs/promises";import{EventEmitter as KD}from"events";import td from"stream";import{StringDecoder as Qz1}from"string_decoder";var ad=typeof process==="object"&&process?process:{stdout:null,stderr:null},Wz1=(Z)=>!!Z&&typeof Z==="object"&&(Z instanceof sX||Z instanceof td||Kz1(Z)||Gz1(Z)),Kz1=(Z)=>!!Z&&typeof Z==="object"&&Z instanceof KD&&typeof Z.pipe==="function"&&Z.pipe!==td.Writable.prototype.pipe,Gz1=(Z)=>!!Z&&typeof Z==="object"&&Z instanceof KD&&typeof Z.write==="function"&&typeof Z.end==="function",WZ=Symbol("EOF"),KZ=Symbol("maybeEmitEnd"),GJ=Symbol("emittedEnd"),LU=Symbol("emittingEnd"),u3=Symbol("emittedError"),wU=Symbol("closed"),sd=Symbol("read"),BU=Symbol("flush"),od=Symbol("flushChunk"),G4=Symbol("encoding"),DQ=Symbol("decoder"),r8=Symbol("flowing"),d3=Symbol("paused"),PQ=Symbol("resume"),t8=Symbol("buffer"),u6=Symbol("pipes"),e8=Symbol("bufferLength"),XD=Symbol("bufferPush"),OU=Symbol("bufferShift"),D6=Symbol("objectMode"),j8=Symbol("destroyed"),YD=Symbol("error"),$D=Symbol("emitData"),rd=Symbol("emitEnd"),QD=Symbol("emitEnd2"),t4=Symbol("async"),WD=Symbol("abort"),jU=Symbol("aborted"),c3=Symbol("signal"),aX=Symbol("dataListeners"),d5=Symbol("discarded"),l3=(Z)=>Promise.resolve().then(Z),Hz1=(Z)=>Z(),zz1=(Z)=>Z==="end"||Z==="finish"||Z==="prefinish",qz1=(Z)=>Z instanceof ArrayBuffer||!!Z&&typeof Z==="object"&&Z.constructor&&Z.constructor.name==="ArrayBuffer"&&Z.byteLength>=0,Vz1=(Z)=>!Buffer.isBuffer(Z)&&ArrayBuffer.isView(Z);class GD{src;dest;opts;ondrain;constructor(Z,J,X){this.src=Z,this.dest=J,this.opts=X,this.ondrain=()=>Z[PQ](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(Z){}end(){if(this.unpipe(),this.opts.end)this.dest.end()}}class ed extends GD{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(Z,J,X){super(Z,J,X);this.proxyErrors=(Y)=>J.emit("error",Y),Z.on("error",this.proxyErrors)}}var Fz1=(Z)=>!!Z.objectMode,Uz1=(Z)=>!Z.objectMode&&!!Z.encoding&&Z.encoding!=="buffer";class sX extends KD{[r8]=!1;[d3]=!1;[u6]=[];[t8]=[];[D6];[G4];[t4];[DQ];[WZ]=!1;[GJ]=!1;[LU]=!1;[wU]=!1;[u3]=null;[e8]=0;[j8]=!1;[c3];[jU]=!1;[aX]=0;[d5]=!1;writable=!0;readable=!0;constructor(...Z){let J=Z[0]||{};super();if(J.objectMode&&typeof J.encoding==="string")throw new TypeError("Encoding and objectMode may not be used together");if(Fz1(J))this[D6]=!0,this[G4]=null;else if(Uz1(J))this[G4]=J.encoding,this[D6]=!1;else this[D6]=!1,this[G4]=null;if(this[t4]=!!J.async,this[DQ]=this[G4]?new Qz1(this[G4]):null,J&&J.debugExposeBuffer===!0)Object.defineProperty(this,"buffer",{get:()=>this[t8]});if(J&&J.debugExposePipes===!0)Object.defineProperty(this,"pipes",{get:()=>this[u6]});let{signal:X}=J;if(X)if(this[c3]=X,X.aborted)this[WD]();else X.addEventListener("abort",()=>this[WD]())}get bufferLength(){return this[e8]}get encoding(){return this[G4]}set encoding(Z){throw new Error("Encoding must be set at instantiation time")}setEncoding(Z){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[D6]}set objectMode(Z){throw new Error("objectMode must be set at instantiation time")}get["async"](){return this[t4]}set["async"](Z){this[t4]=this[t4]||!!Z}[WD](){this[jU]=!0,this.emit("abort",this[c3]?.reason),this.destroy(this[c3]?.reason)}get aborted(){return this[jU]}set aborted(Z){}write(Z,J,X){if(this[jU])return!1;if(this[WZ])throw new Error("write after end");if(this[j8])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;if(typeof J==="function")X=J,J="utf8";if(!J)J="utf8";let Y=this[t4]?l3:Hz1;if(!this[D6]&&!Buffer.isBuffer(Z)){if(Vz1(Z))Z=Buffer.from(Z.buffer,Z.byteOffset,Z.byteLength);else if(qz1(Z))Z=Buffer.from(Z);else if(typeof Z!=="string")throw new Error("Non-contiguous data written to non-objectMode stream")}if(this[D6]){if(this[r8]&&this[e8]!==0)this[BU](!0);if(this[r8])this.emit("data",Z);else this[XD](Z);if(this[e8]!==0)this.emit("readable");if(X)Y(X);return this[r8]}if(!Z.length){if(this[e8]!==0)this.emit("readable");if(X)Y(X);return this[r8]}if(typeof Z==="string"&&!(J===this[G4]&&!this[DQ]?.lastNeed))Z=Buffer.from(Z,J);if(Buffer.isBuffer(Z)&&this[G4])Z=this[DQ].write(Z);if(this[r8]&&this[e8]!==0)this[BU](!0);if(this[r8])this.emit("data",Z);else this[XD](Z);if(this[e8]!==0)this.emit("readable");if(X)Y(X);return this[r8]}read(Z){if(this[j8])return null;if(this[d5]=!1,this[e8]===0||Z===0||Z&&Z>this[e8])return this[KZ](),null;if(this[D6])Z=null;if(this[t8].length>1&&!this[D6])this[t8]=[this[G4]?this[t8].join(""):Buffer.concat(this[t8],this[e8])];let J=this[sd](Z||null,this[t8][0]);return this[KZ](),J}[sd](Z,J){if(this[D6])this[OU]();else{let X=J;if(Z===X.length||Z===null)this[OU]();else if(typeof X==="string")this[t8][0]=X.slice(Z),J=X.slice(0,Z),this[e8]-=Z;else this[t8][0]=X.subarray(Z),J=X.subarray(0,Z),this[e8]-=Z}if(this.emit("data",J),!this[t8].length&&!this[WZ])this.emit("drain");return J}end(Z,J,X){if(typeof Z==="function")X=Z,Z=void 0;if(typeof J==="function")X=J,J="utf8";if(Z!==void 0)this.write(Z,J);if(X)this.once("end",X);if(this[WZ]=!0,this.writable=!1,this[r8]||!this[d3])this[KZ]();return this}[PQ](){if(this[j8])return;if(!this[aX]&&!this[u6].length)this[d5]=!0;if(this[d3]=!1,this[r8]=!0,this.emit("resume"),this[t8].length)this[BU]();else if(this[WZ])this[KZ]();else this.emit("drain")}resume(){return this[PQ]()}pause(){this[r8]=!1,this[d3]=!0,this[d5]=!1}get destroyed(){return this[j8]}get flowing(){return this[r8]}get paused(){return this[d3]}[XD](Z){if(this[D6])this[e8]+=1;else this[e8]+=Z.length;this[t8].push(Z)}[OU](){if(this[D6])this[e8]-=1;else this[e8]-=this[t8][0].length;return this[t8].shift()}[BU](Z=!1){do;while(this[od](this[OU]())&&this[t8].length);if(!Z&&!this[t8].length&&!this[WZ])this.emit("drain")}[od](Z){return this.emit("data",Z),this[r8]}pipe(Z,J){if(this[j8])return Z;this[d5]=!1;let X=this[GJ];if(J=J||{},Z===ad.stdout||Z===ad.stderr)J.end=!1;else J.end=J.end!==!1;if(J.proxyErrors=!!J.proxyErrors,X){if(J.end)Z.end()}else if(this[u6].push(!J.proxyErrors?new GD(this,Z,J):new ed(this,Z,J)),this[t4])l3(()=>this[PQ]());else this[PQ]();return Z}unpipe(Z){let J=this[u6].find((X)=>X.dest===Z);if(J){if(this[u6].length===1){if(this[r8]&&this[aX]===0)this[r8]=!1;this[u6]=[]}else this[u6].splice(this[u6].indexOf(J),1);J.unpipe()}}addListener(Z,J){return this.on(Z,J)}on(Z,J){let X=super.on(Z,J);if(Z==="data"){if(this[d5]=!1,this[aX]++,!this[u6].length&&!this[r8])this[PQ]()}else if(Z==="readable"&&this[e8]!==0)super.emit("readable");else if(zz1(Z)&&this[GJ])super.emit(Z),this.removeAllListeners(Z);else if(Z==="error"&&this[u3]){let Y=J;if(this[t4])l3(()=>Y.call(this,this[u3]));else Y.call(this,this[u3])}return X}removeListener(Z,J){return this.off(Z,J)}off(Z,J){let X=super.off(Z,J);if(Z==="data"){if(this[aX]=this.listeners("data").length,this[aX]===0&&!this[d5]&&!this[u6].length)this[r8]=!1}return X}removeAllListeners(Z){let J=super.removeAllListeners(Z);if(Z==="data"||Z===void 0){if(this[aX]=0,!this[d5]&&!this[u6].length)this[r8]=!1}return J}get emittedEnd(){return this[GJ]}[KZ](){if(!this[LU]&&!this[GJ]&&!this[j8]&&this[t8].length===0&&this[WZ]){if(this[LU]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[wU])this.emit("close");this[LU]=!1}}emit(Z,...J){let X=J[0];if(Z!=="error"&&Z!=="close"&&Z!==j8&&this[j8])return!1;else if(Z==="data")return!this[D6]&&!X?!1:this[t4]?(l3(()=>this[$D](X)),!0):this[$D](X);else if(Z==="end")return this[rd]();else if(Z==="close"){if(this[wU]=!0,!this[GJ]&&!this[j8])return!1;let $=super.emit("close");return this.removeAllListeners("close"),$}else if(Z==="error"){this[u3]=X,super.emit(YD,X);let $=!this[c3]||this.listeners("error").length?super.emit("error",X):!1;return this[KZ](),$}else if(Z==="resume"){let $=super.emit("resume");return this[KZ](),$}else if(Z==="finish"||Z==="prefinish"){let $=super.emit(Z);return this.removeAllListeners(Z),$}let Y=super.emit(Z,...J);return this[KZ](),Y}[$D](Z){for(let X of this[u6])if(X.dest.write(Z)===!1)this.pause();let J=this[d5]?!1:super.emit("data",Z);return this[KZ](),J}[rd](){if(this[GJ])return!1;return this[GJ]=!0,this.readable=!1,this[t4]?(l3(()=>this[QD]()),!0):this[QD]()}[QD](){if(this[DQ]){let J=this[DQ].end();if(J){for(let X of this[u6])X.dest.write(J);if(!this[d5])super.emit("data",J)}}for(let J of this[u6])J.end();let Z=super.emit("end");return this.removeAllListeners("end"),Z}async collect(){let Z=Object.assign([],{dataLength:0});if(!this[D6])Z.dataLength=0;let J=this.promise();return this.on("data",(X)=>{if(Z.push(X),!this[D6])Z.dataLength+=X.length}),await J,Z}async concat(){if(this[D6])throw new Error("cannot concat in objectMode");let Z=await this.collect();return this[G4]?Z.join(""):Buffer.concat(Z,Z.dataLength)}async promise(){return new Promise((Z,J)=>{this.on(j8,()=>J(new Error("stream destroyed"))),this.on("error",(X)=>J(X)),this.on("end",()=>Z())})}[Symbol.asyncIterator](){this[d5]=!1;let Z=!1,J=async()=>{return this.pause(),Z=!0,{value:void 0,done:!0}};return{next:()=>{if(Z)return J();let Y=this.read();if(Y!==null)return Promise.resolve({done:!1,value:Y});if(this[WZ])return J();let $,Q,W=(z)=>{this.off("data",K),this.off("end",G),this.off(j8,H),J(),Q(z)},K=(z)=>{this.off("error",W),this.off("end",G),this.off(j8,H),this.pause(),$({value:z,done:!!this[WZ]})},G=()=>{this.off("error",W),this.off("data",K),this.off(j8,H),J(),$({done:!0,value:void 0})},H=()=>W(new Error("stream destroyed"));return new Promise((z,q)=>{Q=q,$=z,this.once(j8,H),this.once("error",W),this.once("end",G),this.once("data",K)})},throw:J,return:J,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[d5]=!1;let Z=!1,J=()=>{return this.pause(),this.off(YD,J),this.off(j8,J),this.off("end",J),Z=!0,{done:!0,value:void 0}},X=()=>{if(Z)return J();let Y=this.read();return Y===null?J():{done:!1,value:Y}};return this.once("end",J),this.once(YD,J),this.once(j8,J),{next:X,throw:J,return:J,[Symbol.iterator](){return this}}}destroy(Z){if(this[j8]){if(Z)this.emit("error",Z);else this.emit(j8);return this}this[j8]=!0,this[d5]=!0,this[t8].length=0,this[e8]=0;let J=this;if(typeof J.close==="function"&&!this[wU])J.close();if(Z)this.emit("error",Z);else this.emit(j8);return this}static get isStream(){return Wz1}}var Dz1=Rz1.native,i3={lstatSync:Bz1,readdir:Oz1,readdirSync:jz1,readlinkSync:Mz1,realpathSync:Dz1,promises:{lstat:Pz1,readdir:Cz1,readlink:Tz1,realpath:kz1}},$c=(Z)=>!Z||Z===i3||Z===Nz1?i3:{...i3,...Z,promises:{...i3.promises,...Z.promises||{}}},Qc=/^\\\\\?\\([a-z]:)\\?$/i,Ez1=(Z)=>Z.replace(/\//g,"\\").replace(Qc,"$1\\"),Iz1=/[\\\/]/,M9=0,Wc=1,Kc=2,e4=4,Gc=6,Hc=8,oX=10,zc=12,j9=15,p3=~j9,HD=16,Zc=32,n3=64,H4=128,MU=256,NU=512,Jc=n3|H4|NU,vz1=1023,zD=(Z)=>Z.isFile()?Hc:Z.isDirectory()?e4:Z.isSymbolicLink()?oX:Z.isCharacterDevice()?Kc:Z.isBlockDevice()?Gc:Z.isSocket()?zc:Z.isFIFO()?Wc:M9,Xc=new Map,a3=(Z)=>{let J=Xc.get(Z);if(J)return J;let X=Z.normalize("NFKD");return Xc.set(Z,X),X},Yc=new Map,RU=(Z)=>{let J=Yc.get(Z);if(J)return J;let X=a3(Z.toLowerCase());return Yc.set(Z,X),X};class VD extends m3{constructor(){super({max:256})}}class qc extends m3{constructor(Z=16384){super({maxSize:Z,sizeCalculation:(J)=>J.length+1})}}var Vc=Symbol("PathScurry setAsCwd");class d6{name;root;roots;parent;nocase;isCWD=!1;#Z;#J;get dev(){return this.#J}#Y;get mode(){return this.#Y}#X;get nlink(){return this.#X}#$;get uid(){return this.#$}#z;get gid(){return this.#z}#V;get rdev(){return this.#V}#K;get blksize(){return this.#K}#G;get ino(){return this.#G}#H;get size(){return this.#H}#q;get blocks(){return this.#q}#Q;get atimeMs(){return this.#Q}#U;get mtimeMs(){return this.#U}#w;get ctimeMs(){return this.#w}#L;get birthtimeMs(){return this.#L}#O;get atime(){return this.#O}#k;get mtime(){return this.#k}#j;get ctime(){return this.#j}#E;get birthtime(){return this.#E}#N;#R;#M;#C;#B;#v;#W;#A;#D;#S;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(Z,J=M9,X,Y,$,Q,W){if(this.name=Z,this.#N=$?RU(Z):a3(Z),this.#W=J&vz1,this.nocase=$,this.roots=Y,this.root=X||this,this.#A=Q,this.#M=W.fullpath,this.#B=W.relative,this.#v=W.relativePosix,this.parent=W.parent,this.parent)this.#Z=this.parent.#Z;else this.#Z=$c(W.fs)}depth(){if(this.#R!==void 0)return this.#R;if(!this.parent)return this.#R=0;return this.#R=this.parent.depth()+1}childrenCache(){return this.#A}resolve(Z){if(!Z)return this;let J=this.getRootString(Z),Y=Z.substring(J.length).split(this.splitSep);return J?this.getRoot(J).#P(Y):this.#P(Y)}#P(Z){let J=this;for(let X of Z)J=J.child(X);return J}children(){let Z=this.#A.get(this);if(Z)return Z;let J=Object.assign([],{provisional:0});return this.#A.set(this,J),this.#W&=~HD,J}child(Z,J){if(Z===""||Z===".")return this;if(Z==="..")return this.parent||this;let X=this.children(),Y=this.nocase?RU(Z):a3(Z);for(let K of X)if(K.#N===Y)return K;let $=this.parent?this.sep:"",Q=this.#M?this.#M+$+Z:void 0,W=this.newChild(Z,M9,{...J,parent:this,fullpath:Q});if(!this.canReaddir())W.#W|=H4;return X.push(W),W}relative(){if(this.isCWD)return"";if(this.#B!==void 0)return this.#B;let Z=this.name,J=this.parent;if(!J)return this.#B=this.name;let X=J.relative();return X+(!X||!J.parent?"":this.sep)+Z}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#v!==void 0)return this.#v;let Z=this.name,J=this.parent;if(!J)return this.#v=this.fullpathPosix();let X=J.relativePosix();return X+(!X||!J.parent?"":"/")+Z}fullpath(){if(this.#M!==void 0)return this.#M;let Z=this.name,J=this.parent;if(!J)return this.#M=this.name;let Y=J.fullpath()+(!J.parent?"":this.sep)+Z;return this.#M=Y}fullpathPosix(){if(this.#C!==void 0)return this.#C;if(this.sep==="/")return this.#C=this.fullpath();if(!this.parent){let Y=this.fullpath().replace(/\\/g,"/");if(/^[a-z]:\//i.test(Y))return this.#C=`//?/${Y}`;else return this.#C=Y}let Z=this.parent,J=Z.fullpathPosix(),X=J+(!J||!Z.parent?"":"/")+this.name;return this.#C=X}isUnknown(){return(this.#W&j9)===M9}isType(Z){return this[`is${Z}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#W&j9)===Hc}isDirectory(){return(this.#W&j9)===e4}isCharacterDevice(){return(this.#W&j9)===Kc}isBlockDevice(){return(this.#W&j9)===Gc}isFIFO(){return(this.#W&j9)===Wc}isSocket(){return(this.#W&j9)===zc}isSymbolicLink(){return(this.#W&oX)===oX}lstatCached(){return this.#W&Zc?this:void 0}readlinkCached(){return this.#D}realpathCached(){return this.#S}readdirCached(){let Z=this.children();return Z.slice(0,Z.provisional)}canReadlink(){if(this.#D)return!0;if(!this.parent)return!1;let Z=this.#W&j9;return!(Z!==M9&&Z!==oX||this.#W&MU||this.#W&H4)}calledReaddir(){return!!(this.#W&HD)}isENOENT(){return!!(this.#W&H4)}isNamed(Z){return!this.nocase?this.#N===a3(Z):this.#N===RU(Z)}async readlink(){let Z=this.#D;if(Z)return Z;if(!this.canReadlink())return;if(!this.parent)return;try{let J=await this.#Z.promises.readlink(this.fullpath()),X=(await this.parent.realpath())?.resolve(J);if(X)return this.#D=X}catch(J){this.#b(J.code);return}}readlinkSync(){let Z=this.#D;if(Z)return Z;if(!this.canReadlink())return;if(!this.parent)return;try{let J=this.#Z.readlinkSync(this.fullpath()),X=this.parent.realpathSync()?.resolve(J);if(X)return this.#D=X}catch(J){this.#b(J.code);return}}#m(Z){this.#W|=HD;for(let J=Z.provisional;J<Z.length;J++){let X=Z[J];if(X)X.#x()}}#x(){if(this.#W&H4)return;this.#W=(this.#W|H4)&p3,this.#f()}#f(){let Z=this.children();Z.provisional=0;for(let J of Z)J.#x()}#u(){this.#W|=NU,this.#T()}#T(){if(this.#W&n3)return;let Z=this.#W;if((Z&j9)===e4)Z&=p3;this.#W=Z|n3,this.#f()}#I(Z=""){if(Z==="ENOTDIR"||Z==="EPERM")this.#T();else if(Z==="ENOENT")this.#x();else this.children().provisional=0}#d(Z=""){if(Z==="ENOTDIR")this.parent.#T();else if(Z==="ENOENT")this.#x()}#b(Z=""){let J=this.#W;if(J|=MU,Z==="ENOENT")J|=H4;if(Z==="EINVAL"||Z==="UNKNOWN")J&=p3;if(this.#W=J,Z==="ENOTDIR"&&this.parent)this.parent.#T()}#h(Z,J){return this.#c(Z,J)||this.#F(Z,J)}#F(Z,J){let X=zD(Z),Y=this.newChild(Z.name,X,{parent:this}),$=Y.#W&j9;if($!==e4&&$!==oX&&$!==M9)Y.#W|=n3;return J.unshift(Y),J.provisional++,Y}#c(Z,J){for(let X=J.provisional;X<J.length;X++){let Y=J[X];if((this.nocase?RU(Z.name):a3(Z.name))!==Y.#N)continue;return this.#y(Z,Y,X,J)}}#y(Z,J,X,Y){let $=J.name;if(J.#W=J.#W&p3|zD(Z),$!==Z.name)J.name=Z.name;if(X!==Y.provisional){if(X===Y.length-1)Y.pop();else Y.splice(X,1);Y.unshift(J)}return Y.provisional++,J}async lstat(){if((this.#W&H4)===0)try{return this.#_(await this.#Z.promises.lstat(this.fullpath())),this}catch(Z){this.#d(Z.code)}}lstatSync(){if((this.#W&H4)===0)try{return this.#_(this.#Z.lstatSync(this.fullpath())),this}catch(Z){this.#d(Z.code)}}#_(Z){let{atime:J,atimeMs:X,birthtime:Y,birthtimeMs:$,blksize:Q,blocks:W,ctime:K,ctimeMs:G,dev:H,gid:z,ino:q,mode:V,mtime:F,mtimeMs:U,nlink:w,rdev:L,size:O,uid:N}=Z;this.#O=J,this.#Q=X,this.#E=Y,this.#L=$,this.#K=Q,this.#q=W,this.#j=K,this.#w=G,this.#J=H,this.#z=z,this.#G=q,this.#Y=V,this.#k=F,this.#U=U,this.#X=w,this.#V=L,this.#H=O,this.#$=N;let M=zD(Z);if(this.#W=this.#W&p3|M|Zc,M!==M9&&M!==e4&&M!==oX)this.#W|=n3}#g=[];#p=!1;#i(Z){this.#p=!1;let J=this.#g.slice();this.#g.length=0,J.forEach((X)=>X(null,Z))}readdirCB(Z,J=!1){if(!this.canReaddir()){if(J)Z(null,[]);else queueMicrotask(()=>Z(null,[]));return}let X=this.children();if(this.calledReaddir()){let $=X.slice(0,X.provisional);if(J)Z(null,$);else queueMicrotask(()=>Z(null,$));return}if(this.#g.push(Z),this.#p)return;this.#p=!0;let Y=this.fullpath();this.#Z.readdir(Y,{withFileTypes:!0},($,Q)=>{if($)this.#I($.code),X.provisional=0;else{for(let W of Q)this.#h(W,X);this.#m(X)}this.#i(X.slice(0,X.provisional));return})}#l;async readdir(){if(!this.canReaddir())return[];let Z=this.children();if(this.calledReaddir())return Z.slice(0,Z.provisional);let J=this.fullpath();if(this.#l)await this.#l;else{let X=()=>{};this.#l=new Promise((Y)=>X=Y);try{for(let Y of await this.#Z.promises.readdir(J,{withFileTypes:!0}))this.#h(Y,Z);this.#m(Z)}catch(Y){this.#I(Y.code),Z.provisional=0}this.#l=void 0,X()}return Z.slice(0,Z.provisional)}readdirSync(){if(!this.canReaddir())return[];let Z=this.children();if(this.calledReaddir())return Z.slice(0,Z.provisional);let J=this.fullpath();try{for(let X of this.#Z.readdirSync(J,{withFileTypes:!0}))this.#h(X,Z);this.#m(Z)}catch(X){this.#I(X.code),Z.provisional=0}return Z.slice(0,Z.provisional)}canReaddir(){if(this.#W&Jc)return!1;let Z=j9&this.#W;if(!(Z===M9||Z===e4||Z===oX))return!1;return!0}shouldWalk(Z,J){return(this.#W&e4)===e4&&!(this.#W&Jc)&&!Z.has(this)&&(!J||J(this))}async realpath(){if(this.#S)return this.#S;if((NU|MU|H4)&this.#W)return;try{let Z=await this.#Z.promises.realpath(this.fullpath());return this.#S=this.resolve(Z)}catch(Z){this.#u()}}realpathSync(){if(this.#S)return this.#S;if((NU|MU|H4)&this.#W)return;try{let Z=this.#Z.realpathSync(this.fullpath());return this.#S=this.resolve(Z)}catch(Z){this.#u()}}[Vc](Z){if(Z===this)return;Z.isCWD=!1,this.isCWD=!0;let J=new Set([]),X=[],Y=this;while(Y&&Y.parent)J.add(Y),Y.#B=X.join(this.sep),Y.#v=X.join("/"),Y=Y.parent,X.push("..");Y=Z;while(Y&&Y.parent&&!J.has(Y))Y.#B=void 0,Y.#v=void 0,Y=Y.parent}}class DU extends d6{sep="\\";splitSep=Iz1;constructor(Z,J=M9,X,Y,$,Q,W){super(Z,J,X,Y,$,Q,W)}newChild(Z,J=M9,X={}){return new DU(Z,J,this.root,this.roots,this.nocase,this.childrenCache(),X)}getRootString(Z){return qD.parse(Z).root}getRoot(Z){if(Z=Ez1(Z.toUpperCase()),Z===this.root.name)return this.root;for(let[J,X]of Object.entries(this.roots))if(this.sameRoot(Z,J))return this.roots[Z]=X;return this.roots[Z]=new s3(Z,this).root}sameRoot(Z,J=this.root.name){return Z=Z.toUpperCase().replace(/\//g,"\\").replace(Qc,"$1\\"),Z===J}}class PU extends d6{splitSep="/";sep="/";constructor(Z,J=M9,X,Y,$,Q,W){super(Z,J,X,Y,$,Q,W)}getRootString(Z){return Z.startsWith("/")?"/":""}getRoot(Z){return this.root}newChild(Z,J=M9,X={}){return new PU(Z,J,this.root,this.roots,this.nocase,this.childrenCache(),X)}}class FD{root;rootPath;roots;cwd;#Z;#J;#Y;nocase;#X;constructor(Z=process.cwd(),J,X,{nocase:Y,childrenCacheSize:$=16384,fs:Q=i3}={}){if(this.#X=$c(Q),Z instanceof URL||Z.startsWith("file://"))Z=wz1(Z);let W=J.resolve(Z);this.roots=Object.create(null),this.rootPath=this.parseRootPath(W),this.#Z=new VD,this.#J=new VD,this.#Y=new qc($);let K=W.substring(this.rootPath.length).split(X);if(K.length===1&&!K[0])K.pop();if(Y===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=Y,this.root=this.newRoot(this.#X),this.roots[this.rootPath]=this.root;let G=this.root,H=K.length-1,z=J.sep,q=this.rootPath,V=!1;for(let F of K){let U=H--;G=G.child(F,{relative:new Array(U).fill("..").join(z),relativePosix:new Array(U).fill("..").join("/"),fullpath:q+=(V?"":z)+F}),V=!0}this.cwd=G}depth(Z=this.cwd){if(typeof Z==="string")Z=this.cwd.resolve(Z);return Z.depth()}childrenCache(){return this.#Y}resolve(...Z){let J="";for(let $=Z.length-1;$>=0;$--){let Q=Z[$];if(!Q||Q===".")continue;if(J=J?`${Q}/${J}`:Q,this.isAbsolute(Q))break}let X=this.#Z.get(J);if(X!==void 0)return X;let Y=this.cwd.resolve(J).fullpath();return this.#Z.set(J,Y),Y}resolvePosix(...Z){let J="";for(let $=Z.length-1;$>=0;$--){let Q=Z[$];if(!Q||Q===".")continue;if(J=J?`${Q}/${J}`:Q,this.isAbsolute(Q))break}let X=this.#J.get(J);if(X!==void 0)return X;let Y=this.cwd.resolve(J).fullpathPosix();return this.#J.set(J,Y),Y}relative(Z=this.cwd){if(typeof Z==="string")Z=this.cwd.resolve(Z);return Z.relative()}relativePosix(Z=this.cwd){if(typeof Z==="string")Z=this.cwd.resolve(Z);return Z.relativePosix()}basename(Z=this.cwd){if(typeof Z==="string")Z=this.cwd.resolve(Z);return Z.name}dirname(Z=this.cwd){if(typeof Z==="string")Z=this.cwd.resolve(Z);return(Z.parent||Z).fullpath()}async readdir(Z=this.cwd,J={withFileTypes:!0}){if(typeof Z==="string")Z=this.cwd.resolve(Z);else if(!(Z instanceof d6))J=Z,Z=this.cwd;let{withFileTypes:X}=J;if(!Z.canReaddir())return[];else{let Y=await Z.readdir();return X?Y:Y.map(($)=>$.name)}}readdirSync(Z=this.cwd,J={withFileTypes:!0}){if(typeof Z==="string")Z=this.cwd.resolve(Z);else if(!(Z instanceof d6))J=Z,Z=this.cwd;let{withFileTypes:X=!0}=J;if(!Z.canReaddir())return[];else if(X)return Z.readdirSync();else return Z.readdirSync().map((Y)=>Y.name)}async lstat(Z=this.cwd){if(typeof Z==="string")Z=this.cwd.resolve(Z);return Z.lstat()}lstatSync(Z=this.cwd){if(typeof Z==="string")Z=this.cwd.resolve(Z);return Z.lstatSync()}async readlink(Z=this.cwd,{withFileTypes:J}={withFileTypes:!1}){if(typeof Z==="string")Z=this.cwd.resolve(Z);else if(!(Z instanceof d6))J=Z.withFileTypes,Z=this.cwd;let X=await Z.readlink();return J?X:X?.fullpath()}readlinkSync(Z=this.cwd,{withFileTypes:J}={withFileTypes:!1}){if(typeof Z==="string")Z=this.cwd.resolve(Z);else if(!(Z instanceof d6))J=Z.withFileTypes,Z=this.cwd;let X=Z.readlinkSync();return J?X:X?.fullpath()}async realpath(Z=this.cwd,{withFileTypes:J}={withFileTypes:!1}){if(typeof Z==="string")Z=this.cwd.resolve(Z);else if(!(Z instanceof d6))J=Z.withFileTypes,Z=this.cwd;let X=await Z.realpath();return J?X:X?.fullpath()}realpathSync(Z=this.cwd,{withFileTypes:J}={withFileTypes:!1}){if(typeof Z==="string")Z=this.cwd.resolve(Z);else if(!(Z instanceof d6))J=Z.withFileTypes,Z=this.cwd;let X=Z.realpathSync();return J?X:X?.fullpath()}async walk(Z=this.cwd,J={}){if(typeof Z==="string")Z=this.cwd.resolve(Z);else if(!(Z instanceof d6))J=Z,Z=this.cwd;let{withFileTypes:X=!0,follow:Y=!1,filter:$,walkFilter:Q}=J,W=[];if(!$||$(Z))W.push(X?Z:Z.fullpath());let K=new Set,G=(z,q)=>{K.add(z),z.readdirCB((V,F)=>{if(V)return q(V);let U=F.length;if(!U)return q();let w=()=>{if(--U===0)q()};for(let L of F){if(!$||$(L))W.push(X?L:L.fullpath());if(Y&&L.isSymbolicLink())L.realpath().then((O)=>O?.isUnknown()?O.lstat():O).then((O)=>O?.shouldWalk(K,Q)?G(O,w):w());else if(L.shouldWalk(K,Q))G(L,w);else w()}},!0)},H=Z;return new Promise((z,q)=>{G(H,(V)=>{if(V)return q(V);z(W)})})}walkSync(Z=this.cwd,J={}){if(typeof Z==="string")Z=this.cwd.resolve(Z);else if(!(Z instanceof d6))J=Z,Z=this.cwd;let{withFileTypes:X=!0,follow:Y=!1,filter:$,walkFilter:Q}=J,W=[];if(!$||$(Z))W.push(X?Z:Z.fullpath());let K=new Set([Z]);for(let G of K){let H=G.readdirSync();for(let z of H){if(!$||$(z))W.push(X?z:z.fullpath());let q=z;if(z.isSymbolicLink()){if(!(Y&&(q=z.realpathSync())))continue;if(q.isUnknown())q.lstatSync()}if(q.shouldWalk(K,Q))K.add(q)}}return W}[Symbol.asyncIterator](){return this.iterate()}iterate(Z=this.cwd,J={}){if(typeof Z==="string")Z=this.cwd.resolve(Z);else if(!(Z instanceof d6))J=Z,Z=this.cwd;return this.stream(Z,J)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(Z=this.cwd,J={}){if(typeof Z==="string")Z=this.cwd.resolve(Z);else if(!(Z instanceof d6))J=Z,Z=this.cwd;let{withFileTypes:X=!0,follow:Y=!1,filter:$,walkFilter:Q}=J;if(!$||$(Z))yield X?Z:Z.fullpath();let W=new Set([Z]);for(let K of W){let G=K.readdirSync();for(let H of G){if(!$||$(H))yield X?H:H.fullpath();let z=H;if(H.isSymbolicLink()){if(!(Y&&(z=H.realpathSync())))continue;if(z.isUnknown())z.lstatSync()}if(z.shouldWalk(W,Q))W.add(z)}}}stream(Z=this.cwd,J={}){if(typeof Z==="string")Z=this.cwd.resolve(Z);else if(!(Z instanceof d6))J=Z,Z=this.cwd;let{withFileTypes:X=!0,follow:Y=!1,filter:$,walkFilter:Q}=J,W=new sX({objectMode:!0});if(!$||$(Z))W.write(X?Z:Z.fullpath());let K=new Set,G=[Z],H=0,z=()=>{let q=!1;while(!q){let V=G.shift();if(!V){if(H===0)W.end();return}H++,K.add(V);let F=(w,L,O=!1)=>{if(w)return W.emit("error",w);if(Y&&!O){let N=[];for(let M of L)if(M.isSymbolicLink())N.push(M.realpath().then((j)=>j?.isUnknown()?j.lstat():j));if(N.length){Promise.all(N).then(()=>F(null,L,!0));return}}for(let N of L)if(N&&(!$||$(N))){if(!W.write(X?N:N.fullpath()))q=!0}H--;for(let N of L){let M=N.realpathCached()||N;if(M.shouldWalk(K,Q))G.push(M)}if(q&&!W.flowing)W.once("drain",z);else if(!U)z()},U=!0;V.readdirCB(F,!0),U=!1}};return z(),W}streamSync(Z=this.cwd,J={}){if(typeof Z==="string")Z=this.cwd.resolve(Z);else if(!(Z instanceof d6))J=Z,Z=this.cwd;let{withFileTypes:X=!0,follow:Y=!1,filter:$,walkFilter:Q}=J,W=new sX({objectMode:!0}),K=new Set;if(!$||$(Z))W.write(X?Z:Z.fullpath());let G=[Z],H=0,z=()=>{let q=!1;while(!q){let V=G.shift();if(!V){if(H===0)W.end();return}H++,K.add(V);let F=V.readdirSync();for(let U of F)if(!$||$(U)){if(!W.write(X?U:U.fullpath()))q=!0}H--;for(let U of F){let w=U;if(U.isSymbolicLink()){if(!(Y&&(w=U.realpathSync())))continue;if(w.isUnknown())w.lstatSync()}if(w.shouldWalk(K,Q))G.push(w)}}if(q&&!W.flowing)W.once("drain",z)};return z(),W}chdir(Z=this.cwd){let J=this.cwd;this.cwd=typeof Z==="string"?this.cwd.resolve(Z):Z,this.cwd[Vc](J)}}class s3 extends FD{sep="\\";constructor(Z=process.cwd(),J={}){let{nocase:X=!0}=J;super(Z,qD,"\\",{...J,nocase:X});this.nocase=X;for(let Y=this.cwd;Y;Y=Y.parent)Y.nocase=this.nocase}parseRootPath(Z){return qD.parse(Z).root.toUpperCase()}newRoot(Z){return new DU(this.rootPath,e4,void 0,this.roots,this.nocase,this.childrenCache(),{fs:Z})}isAbsolute(Z){return Z.startsWith("/")||Z.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(Z)}}class o3 extends FD{sep="/";constructor(Z=process.cwd(),J={}){let{nocase:X=!1}=J;super(Z,Lz1,"/",{...J,nocase:X});this.nocase=X}parseRootPath(Z){return"/"}newRoot(Z){return new PU(this.rootPath,e4,void 0,this.roots,this.nocase,this.childrenCache(),{fs:Z})}isAbsolute(Z){return Z.startsWith("/")}}class CU extends o3{constructor(Z=process.cwd(),J={}){let{nocase:X=!0}=J;super(Z,{...J,nocase:X})}}var HG6=process.platform==="win32"?DU:PU,Fc=process.platform==="win32"?s3:process.platform==="darwin"?CU:o3;var Sz1=(Z)=>Z.length>=1,_z1=(Z)=>Z.length>=1;class CQ{#Z;#J;#Y;length;#X;#$;#z;#V;#K;#G;#H=!0;constructor(Z,J,X,Y){if(!Sz1(Z))throw new TypeError("empty pattern list");if(!_z1(J))throw new TypeError("empty glob list");if(J.length!==Z.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=Z.length,X<0||X>=this.length)throw new TypeError("index out of range");if(this.#Z=Z,this.#J=J,this.#Y=X,this.#X=Y,this.#Y===0){if(this.isUNC()){let[$,Q,W,K,...G]=this.#Z,[H,z,q,V,...F]=this.#J;if(G[0]==="")G.shift(),F.shift();let U=[$,Q,W,K,""].join("/"),w=[H,z,q,V,""].join("/");this.#Z=[U,...G],this.#J=[w,...F],this.length=this.#Z.length}else if(this.isDrive()||this.isAbsolute()){let[$,...Q]=this.#Z,[W,...K]=this.#J;if(Q[0]==="")Q.shift(),K.shift();let G=$+"/",H=W+"/";this.#Z=[G,...Q],this.#J=[H,...K],this.length=this.#Z.length}}}pattern(){return this.#Z[this.#Y]}isString(){return typeof this.#Z[this.#Y]==="string"}isGlobstar(){return this.#Z[this.#Y]===L6}isRegExp(){return this.#Z[this.#Y]instanceof RegExp}globString(){return this.#z=this.#z||(this.#Y===0?this.isAbsolute()?this.#J[0]+this.#J.slice(1).join("/"):this.#J.join("/"):this.#J.slice(this.#Y).join("/"))}hasMore(){return this.length>this.#Y+1}rest(){if(this.#$!==void 0)return this.#$;if(!this.hasMore())return this.#$=null;return this.#$=new CQ(this.#Z,this.#J,this.#Y+1,this.#X),this.#$.#G=this.#G,this.#$.#K=this.#K,this.#$.#V=this.#V,this.#$}isUNC(){let Z=this.#Z;return this.#K!==void 0?this.#K:this.#K=this.#X==="win32"&&this.#Y===0&&Z[0]===""&&Z[1]===""&&typeof Z[2]==="string"&&!!Z[2]&&typeof Z[3]==="string"&&!!Z[3]}isDrive(){let Z=this.#Z;return this.#V!==void 0?this.#V:this.#V=this.#X==="win32"&&this.#Y===0&&this.length>1&&typeof Z[0]==="string"&&/^[a-z]:$/i.test(Z[0])}isAbsolute(){let Z=this.#Z;return this.#G!==void 0?this.#G:this.#G=Z[0]===""&&Z.length>1||this.isDrive()||this.isUNC()}root(){let Z=this.#Z[0];return typeof Z==="string"&&this.isAbsolute()&&this.#Y===0?Z:""}checkFollowGlobstar(){return!(this.#Y===0||!this.isGlobstar()||!this.#H)}markFollowGlobstar(){if(this.#Y===0||!this.isGlobstar()||!this.#H)return!1;return this.#H=!1,!0}}var Az1=typeof process==="object"&&process&&typeof process.platform==="string"?process.platform:"linux";class r3{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(Z,{nobrace:J,nocase:X,noext:Y,noglobstar:$,platform:Q=Az1}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=Q,this.mmopts={dot:!0,nobrace:J,nocase:X,noext:Y,noglobstar:$,optimizationLevel:2,platform:Q,nocomment:!0,nonegate:!0};for(let W of Z)this.add(W)}add(Z){let J=new O9(Z,this.mmopts);for(let X=0;X<J.set.length;X++){let Y=J.set[X],$=J.globParts[X];if(!Y||!$)throw new Error("invalid pattern object");while(Y[0]==="."&&$[0]===".")Y.shift(),$.shift();let Q=new CQ(Y,$,0,this.platform),W=new O9(Q.globString(),this.mmopts),K=$[$.length-1]==="**",G=Q.isAbsolute();if(G)this.absolute.push(W);else this.relative.push(W);if(K)if(G)this.absoluteChildren.push(W);else this.relativeChildren.push(W)}}ignored(Z){let J=Z.fullpath(),X=`${J}/`,Y=Z.relative()||".",$=`${Y}/`;for(let Q of this.relative)if(Q.match(Y)||Q.match($))return!0;for(let Q of this.absolute)if(Q.match(J)||Q.match(X))return!0;return!1}childrenIgnored(Z){let J=Z.fullpath()+"/",X=(Z.relative()||".")+"/";for(let Y of this.relativeChildren)if(Y.match(X))return!0;for(let Y of this.absoluteChildren)if(Y.match(J))return!0;return!1}}class UD{store;constructor(Z=new Map){this.store=Z}copy(){return new UD(new Map(this.store))}hasWalked(Z,J){return this.store.get(Z.fullpath())?.has(J.globString())}storeWalked(Z,J){let X=Z.fullpath(),Y=this.store.get(X);if(Y)Y.add(J.globString());else this.store.set(X,new Set([J.globString()]))}}class Uc{store=new Map;add(Z,J,X){let Y=(J?2:0)|(X?1:0),$=this.store.get(Z);this.store.set(Z,$===void 0?Y:Y&$)}entries(){return[...this.store.entries()].map(([Z,J])=>[Z,!!(J&2),!!(J&1)])}}class Lc{store=new Map;add(Z,J){if(!Z.canReaddir())return;let X=this.store.get(Z);if(X){if(!X.find((Y)=>Y.globString()===J.globString()))X.push(J)}else this.store.set(Z,[J])}get(Z){let J=this.store.get(Z);if(!J)throw new Error("attempting to walk unknown path");return J}entries(){return this.keys().map((Z)=>[Z,this.store.get(Z)])}keys(){return[...this.store.keys()].filter((Z)=>Z.canReaddir())}}class t3{hasWalkedCache;matches=new Uc;subwalks=new Lc;patterns;follow;dot;opts;constructor(Z,J){this.opts=Z,this.follow=!!Z.follow,this.dot=!!Z.dot,this.hasWalkedCache=J?J.copy():new UD}processPatterns(Z,J){this.patterns=J;let X=J.map((Y)=>[Z,Y]);for(let[Y,$]of X){this.hasWalkedCache.storeWalked(Y,$);let Q=$.root(),W=$.isAbsolute()&&this.opts.absolute!==!1;if(Q){Y=Y.resolve(Q==="/"&&this.opts.root!==void 0?this.opts.root:Q);let z=$.rest();if(!z){this.matches.add(Y,!0,!1);continue}else $=z}if(Y.isENOENT())continue;let K,G,H=!1;while(typeof(K=$.pattern())==="string"&&(G=$.rest()))Y=Y.resolve(K),$=G,H=!0;if(K=$.pattern(),G=$.rest(),H){if(this.hasWalkedCache.hasWalked(Y,$))continue;this.hasWalkedCache.storeWalked(Y,$)}if(typeof K==="string"){let z=K===".."||K===""||K===".";this.matches.add(Y.resolve(K),W,z);continue}else if(K===L6){if(!Y.isSymbolicLink()||this.follow||$.checkFollowGlobstar())this.subwalks.add(Y,$);let z=G?.pattern(),q=G?.rest();if(!G||(z===""||z===".")&&!q)this.matches.add(Y,W,z===""||z===".");else if(z===".."){let V=Y.parent||Y;if(!q)this.matches.add(V,W,!0);else if(!this.hasWalkedCache.hasWalked(V,q))this.subwalks.add(V,q)}}else if(K instanceof RegExp)this.subwalks.add(Y,$)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new t3(this.opts,this.hasWalkedCache)}filterEntries(Z,J){let X=this.subwalks.get(Z),Y=this.child();for(let $ of J)for(let Q of X){let W=Q.isAbsolute(),K=Q.pattern(),G=Q.rest();if(K===L6)Y.testGlobstar($,Q,G,W);else if(K instanceof RegExp)Y.testRegExp($,K,G,W);else Y.testString($,K,G,W)}return Y}testGlobstar(Z,J,X,Y){if(this.dot||!Z.name.startsWith(".")){if(!J.hasMore())this.matches.add(Z,Y,!1);if(Z.canReaddir()){if(this.follow||!Z.isSymbolicLink())this.subwalks.add(Z,J);else if(Z.isSymbolicLink()){if(X&&J.checkFollowGlobstar())this.subwalks.add(Z,X);else if(J.markFollowGlobstar())this.subwalks.add(Z,J)}}}if(X){let $=X.pattern();if(typeof $==="string"&&$!==".."&&$!==""&&$!==".")this.testString(Z,$,X.rest(),Y);else if($===".."){let Q=Z.parent||Z;this.subwalks.add(Q,X)}else if($ instanceof RegExp)this.testRegExp(Z,$,X.rest(),Y)}}testRegExp(Z,J,X,Y){if(!J.test(Z.name))return;if(!X)this.matches.add(Z,Y,!1);else this.subwalks.add(Z,X)}testString(Z,J,X,Y){if(!Z.isNamed(J))return;if(!X)this.matches.add(Z,Y,!1);else this.subwalks.add(Z,X)}}var xz1=(Z,J)=>typeof Z==="string"?new r3([Z],J):Array.isArray(Z)?new r3(Z,J):Z;class LD{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#Z=[];#J;#Y;signal;maxDepth;includeChildMatches;constructor(Z,J,X){if(this.patterns=Z,this.path=J,this.opts=X,this.#Y=!X.posix&&X.platform==="win32"?"\\":"/",this.includeChildMatches=X.includeChildMatches!==!1,X.ignore||!this.includeChildMatches){if(this.#J=xz1(X.ignore??[],X),!this.includeChildMatches&&typeof this.#J.add!=="function")throw new Error("cannot ignore child matches, ignore lacks add() method.")}if(this.maxDepth=X.maxDepth||1/0,X.signal)this.signal=X.signal,this.signal.addEventListener("abort",()=>{this.#Z.length=0})}#X(Z){return this.seen.has(Z)||!!this.#J?.ignored?.(Z)}#$(Z){return!!this.#J?.childrenIgnored?.(Z)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let Z=void 0;while(!this.paused&&(Z=this.#Z.shift()))Z()}onResume(Z){if(this.signal?.aborted)return;if(!this.paused)Z();else this.#Z.push(Z)}async matchCheck(Z,J){if(J&&this.opts.nodir)return;let X;if(this.opts.realpath){if(X=Z.realpathCached()||await Z.realpath(),!X)return;Z=X}let $=Z.isUnknown()||this.opts.stat?await Z.lstat():Z;if(this.opts.follow&&this.opts.nodir&&$?.isSymbolicLink()){let Q=await $.realpath();if(Q&&(Q.isUnknown()||this.opts.stat))await Q.lstat()}return this.matchCheckTest($,J)}matchCheckTest(Z,J){return Z&&(this.maxDepth===1/0||Z.depth()<=this.maxDepth)&&(!J||Z.canReaddir())&&(!this.opts.nodir||!Z.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!Z.isSymbolicLink()||!Z.realpathCached()?.isDirectory())&&!this.#X(Z)?Z:void 0}matchCheckSync(Z,J){if(J&&this.opts.nodir)return;let X;if(this.opts.realpath){if(X=Z.realpathCached()||Z.realpathSync(),!X)return;Z=X}let $=Z.isUnknown()||this.opts.stat?Z.lstatSync():Z;if(this.opts.follow&&this.opts.nodir&&$?.isSymbolicLink()){let Q=$.realpathSync();if(Q&&(Q?.isUnknown()||this.opts.stat))Q.lstatSync()}return this.matchCheckTest($,J)}matchFinish(Z,J){if(this.#X(Z))return;if(!this.includeChildMatches&&this.#J?.add){let $=`${Z.relativePosix()}/**`;this.#J.add($)}let X=this.opts.absolute===void 0?J:this.opts.absolute;this.seen.add(Z);let Y=this.opts.mark&&Z.isDirectory()?this.#Y:"";if(this.opts.withFileTypes)this.matchEmit(Z);else if(X){let $=this.opts.posix?Z.fullpathPosix():Z.fullpath();this.matchEmit($+Y)}else{let $=this.opts.posix?Z.relativePosix():Z.relative(),Q=this.opts.dotRelative&&!$.startsWith(".."+this.#Y)?"."+this.#Y:"";this.matchEmit(!$?"."+Y:Q+$+Y)}}async match(Z,J,X){let Y=await this.matchCheck(Z,X);if(Y)this.matchFinish(Y,J)}matchSync(Z,J,X){let Y=this.matchCheckSync(Z,X);if(Y)this.matchFinish(Y,J)}walkCB(Z,J,X){if(this.signal?.aborted)X();this.walkCB2(Z,J,new t3(this.opts),X)}walkCB2(Z,J,X,Y){if(this.#$(Z))return Y();if(this.signal?.aborted)Y();if(this.paused){this.onResume(()=>this.walkCB2(Z,J,X,Y));return}X.processPatterns(Z,J);let $=1,Q=()=>{if(--$===0)Y()};for(let[W,K,G]of X.matches.entries()){if(this.#X(W))continue;$++,this.match(W,K,G).then(()=>Q())}for(let W of X.subwalkTargets()){if(this.maxDepth!==1/0&&W.depth()>=this.maxDepth)continue;$++;let K=W.readdirCached();if(W.calledReaddir())this.walkCB3(W,K,X,Q);else W.readdirCB((G,H)=>this.walkCB3(W,H,X,Q),!0)}Q()}walkCB3(Z,J,X,Y){X=X.filterEntries(Z,J);let $=1,Q=()=>{if(--$===0)Y()};for(let[W,K,G]of X.matches.entries()){if(this.#X(W))continue;$++,this.match(W,K,G).then(()=>Q())}for(let[W,K]of X.subwalks.entries())$++,this.walkCB2(W,K,X.child(),Q);Q()}walkCBSync(Z,J,X){if(this.signal?.aborted)X();this.walkCB2Sync(Z,J,new t3(this.opts),X)}walkCB2Sync(Z,J,X,Y){if(this.#$(Z))return Y();if(this.signal?.aborted)Y();if(this.paused){this.onResume(()=>this.walkCB2Sync(Z,J,X,Y));return}X.processPatterns(Z,J);let $=1,Q=()=>{if(--$===0)Y()};for(let[W,K,G]of X.matches.entries()){if(this.#X(W))continue;this.matchSync(W,K,G)}for(let W of X.subwalkTargets()){if(this.maxDepth!==1/0&&W.depth()>=this.maxDepth)continue;$++;let K=W.readdirSync();this.walkCB3Sync(W,K,X,Q)}Q()}walkCB3Sync(Z,J,X,Y){X=X.filterEntries(Z,J);let $=1,Q=()=>{if(--$===0)Y()};for(let[W,K,G]of X.matches.entries()){if(this.#X(W))continue;this.matchSync(W,K,G)}for(let[W,K]of X.subwalks.entries())$++,this.walkCB2Sync(W,K,X.child(),Q);Q()}}class TU extends LD{matches=new Set;constructor(Z,J,X){super(Z,J,X)}matchEmit(Z){this.matches.add(Z)}async walk(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown())await this.path.lstat();return await new Promise((Z,J)=>{this.walkCB(this.path,this.patterns,()=>{if(this.signal?.aborted)J(this.signal.reason);else Z(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown())this.path.lstatSync();return this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}}class kU extends LD{results;constructor(Z,J,X){super(Z,J,X);this.results=new sX({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(Z){if(this.results.write(Z),!this.results.flowing)this.pause()}stream(){let Z=this.path;if(Z.isUnknown())Z.lstat().then(()=>{this.walkCB(Z,this.patterns,()=>this.results.end())});else this.walkCB(Z,this.patterns,()=>this.results.end());return this.results}streamSync(){if(this.path.isUnknown())this.path.lstatSync();return this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}}var fz1=typeof process==="object"&&process&&typeof process.platform==="string"?process.platform:"linux";class Z7{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(Z,J){if(!J)throw new TypeError("glob options required");if(this.withFileTypes=!!J.withFileTypes,this.signal=J.signal,this.follow=!!J.follow,this.dot=!!J.dot,this.dotRelative=!!J.dotRelative,this.nodir=!!J.nodir,this.mark=!!J.mark,!J.cwd)this.cwd="";else if(J.cwd instanceof URL||J.cwd.startsWith("file://"))J.cwd=hz1(J.cwd);if(this.cwd=J.cwd||"",this.root=J.root,this.magicalBraces=!!J.magicalBraces,this.nobrace=!!J.nobrace,this.noext=!!J.noext,this.realpath=!!J.realpath,this.absolute=J.absolute,this.includeChildMatches=J.includeChildMatches!==!1,this.noglobstar=!!J.noglobstar,this.matchBase=!!J.matchBase,this.maxDepth=typeof J.maxDepth==="number"?J.maxDepth:1/0,this.stat=!!J.stat,this.ignore=J.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof Z==="string")Z=[Z];if(this.windowsPathsNoEscape=!!J.windowsPathsNoEscape||J.allowWindowsEscape===!1,this.windowsPathsNoEscape)Z=Z.map((K)=>K.replace(/\\/g,"/"));if(this.matchBase){if(J.noglobstar)throw new TypeError("base matching requires globstar");Z=Z.map((K)=>K.includes("/")?K:`./**/${K}`)}if(this.pattern=Z,this.platform=J.platform||fz1,this.opts={...J,platform:this.platform},J.scurry){if(this.scurry=J.scurry,J.nocase!==void 0&&J.nocase!==J.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let K=J.platform==="win32"?s3:J.platform==="darwin"?CU:J.platform?o3:Fc;this.scurry=new K(this.cwd,{nocase:J.nocase,fs:J.fs})}this.nocase=this.scurry.nocase;let X=this.platform==="darwin"||this.platform==="win32",Y={...J,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:X,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},$=this.pattern.map((K)=>new O9(K,Y)),[Q,W]=$.reduce((K,G)=>{return K[0].push(...G.set),K[1].push(...G.globParts),K},[[],[]]);this.patterns=Q.map((K,G)=>{let H=W[G];if(!H)throw new Error("invalid pattern object");return new CQ(K,H,0,this.platform)})}async walk(){return[...await new TU(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new TU(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new kU(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new kU(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}}var wD=(Z,J={})=>{if(!Array.isArray(Z))Z=[Z];for(let X of Z)if(new O9(X,J).hasMagic())return!0;return!1};function IU(Z,J={}){return new Z7(Z,J).streamSync()}function Bc(Z,J={}){return new Z7(Z,J).stream()}function Oc(Z,J={}){return new Z7(Z,J).walkSync()}async function wc(Z,J={}){return new Z7(Z,J).walk()}function vU(Z,J={}){return new Z7(Z,J).iterateSync()}function jc(Z,J={}){return new Z7(Z,J).iterate()}var bz1=IU,yz1=Object.assign(Bc,{sync:IU}),gz1=vU,mz1=Object.assign(jc,{sync:vU}),uz1=Object.assign(Oc,{stream:IU,iterate:vU}),EU=Object.assign(wc,{glob:wc,globSync:Oc,sync:uz1,globStream:Bc,stream:yz1,globStreamSync:IU,streamSync:bz1,globIterate:jc,iterate:mz1,globIterateSync:vU,iterateSync:gz1,Glob:Z7,hasMagic:wD,escape:MQ,unescape:K4});EU.glob=EU;class BD{constructor(){this._listeners={}}addEventListener(Z,J){let X=this._listeners;if(X[Z]===void 0)X[Z]=[];if(X[Z].indexOf(J)===-1)X[Z].push(J);return this}removeEventListener(Z,J){let Y=this._listeners[Z];if(Y!==void 0){let $=Y.indexOf(J);if($!==-1)Y.splice($,1)}return this}dispatchEvent(Z){let X=this._listeners[Z.type];if(X!==void 0){let Y=X.slice(0);for(let $=0,Q=Y.length;$<Q;$++)Y[$].call(this,Z)}return this}dispose(){for(let Z in this._listeners)delete this._listeners[Z]}}class w5{constructor(Z,J,X,Y={}){if(this._name=void 0,this._parent=void 0,this._child=void 0,this._attributes=void 0,this._disposed=!1,this._name=Z,this._parent=J,this._child=X,this._attributes=Y,!J.isOnGraph(X))throw new Error("Cannot connect disconnected graphs.")}getName(){return this._name}getParent(){return this._parent}getChild(){return this._child}setChild(Z){return this._child=Z,this}getAttributes(){return this._attributes}dispose(){if(this._disposed)return;this._parent._destroyRef(this),this._disposed=!0}isDisposed(){return this._disposed}}class TQ extends BD{constructor(...Z){super(...Z);this._emptySet=new Set,this._edges=new Set,this._parentEdges=new Map,this._childEdges=new Map}listEdges(){return Array.from(this._edges)}listParentEdges(Z){return Array.from(this._childEdges.get(Z)||this._emptySet)}listParents(Z){let J=new Set;for(let X of this.listParentEdges(Z))J.add(X.getParent());return Array.from(J)}listChildEdges(Z){return Array.from(this._parentEdges.get(Z)||this._emptySet)}listChildren(Z){let J=new Set;for(let X of this.listChildEdges(Z))J.add(X.getChild());return Array.from(J)}disconnectParents(Z,J){for(let X of this.listParentEdges(Z))if(!J||J(X.getParent()))X.dispose();return this}_createEdge(Z,J,X,Y){let $=new w5(Z,J,X,Y);this._edges.add($);let Q=$.getParent();if(!this._parentEdges.has(Q))this._parentEdges.set(Q,new Set);this._parentEdges.get(Q).add($);let W=$.getChild();if(!this._childEdges.has(W))this._childEdges.set(W,new Set);return this._childEdges.get(W).add($),$}_destroyEdge(Z){return this._edges.delete(Z),this._parentEdges.get(Z.getParent()).delete(Z),this._childEdges.get(Z.getChild()).delete(Z),this}}function e3(){return e3=Object.assign||function(Z){for(var J=1;J<arguments.length;J++){var X=arguments[J];for(var Y in X)if(Object.prototype.hasOwnProperty.call(X,Y))Z[Y]=X[Y]}return Z},e3.apply(this,arguments)}class P6{constructor(Z){if(this.list=[],Z)for(let J of Z)this.list.push(J)}add(Z){this.list.push(Z)}remove(Z){let J=this.list.indexOf(Z);if(J>=0)this.list.splice(J,1)}removeChild(Z){let J=[];for(let X of this.list)if(X.getChild()===Z)J.push(X);for(let X of J)this.remove(X);return J}listRefsByChild(Z){let J=[];for(let X of this.list)if(X.getChild()===Z)J.push(X);return J}values(){return this.list}}class P0{constructor(Z){if(this.set=new Set,this.map=new Map,Z)for(let J of Z)this.add(J)}add(Z){let J=Z.getChild();this.removeChild(J),this.set.add(Z),this.map.set(J,Z)}remove(Z){this.set.delete(Z),this.map.delete(Z.getChild())}removeChild(Z){let J=this.map.get(Z)||null;if(J)this.remove(J);return J}getRefByChild(Z){return this.map.get(Z)||null}values(){return Array.from(this.set)}}class r1{constructor(Z){if(this.map={},Z)Object.assign(this.map,Z)}set(Z,J){this.map[Z]=J}delete(Z){delete this.map[Z]}get(Z){return this.map[Z]||null}keys(){return Object.keys(this.map)}values(){return Object.values(this.map)}}var h0=Symbol("attributes"),z4=Symbol("immutableKeys");class kQ extends BD{constructor(Z){super();this._disposed=!1,this.graph=void 0,this[h0]=void 0,this[z4]=void 0,this.graph=Z,this[z4]=new Set,this[h0]=this._createAttributes()}getDefaults(){return{}}_createAttributes(){let Z=this.getDefaults(),J={};for(let X in Z){let Y=Z[X];if(Y instanceof kQ){let $=this.graph._createEdge(X,this,Y);this[z4].add(X),J[X]=$}else J[X]=Y}return J}isOnGraph(Z){return this.graph===Z.graph}isDisposed(){return this._disposed}dispose(){if(this._disposed)return;this.graph.listChildEdges(this).forEach((Z)=>Z.dispose()),this.graph.disconnectParents(this),this._disposed=!0,this.dispatchEvent({type:"dispose"})}detach(){return this.graph.disconnectParents(this),this}swap(Z,J){for(let X in this[h0]){let Y=this[h0][X];if(Y instanceof w5){let $=Y;if($.getChild()===Z)this.setRef(X,J,$.getAttributes())}else if(Y instanceof P6)for(let $ of Y.listRefsByChild(Z)){let Q=$.getAttributes();this.removeRef(X,Z),this.addRef(X,J,Q)}else if(Y instanceof P0){let $=Y.getRefByChild(Z);if($){let Q=$.getAttributes();this.removeRef(X,Z),this.addRef(X,J,Q)}}else if(Y instanceof r1)for(let $ of Y.keys()){let Q=Y.get($);if(Q.getChild()===Z)this.setRefMap(X,$,J,Q.getAttributes())}}return this}get(Z){return this[h0][Z]}set(Z,J){return this[h0][Z]=J,this.dispatchEvent({type:"change",attribute:Z})}getRef(Z){let J=this[h0][Z];return J?J.getChild():null}setRef(Z,J,X){if(this[z4].has(Z))throw new Error(`Cannot overwrite immutable attribute, "${Z}".`);let Y=this[h0][Z];if(Y)Y.dispose();if(!J)return this;let $=this.graph._createEdge(Z,this,J,X);return this[h0][Z]=$,this.dispatchEvent({type:"change",attribute:Z})}listRefs(Z){return this.assertRefList(Z).values().map((X)=>X.getChild())}addRef(Z,J,X){let Y=this.graph._createEdge(Z,this,J,X);return this.assertRefList(Z).add(Y),this.dispatchEvent({type:"change",attribute:Z})}removeRef(Z,J){let X=this.assertRefList(Z);if(X instanceof P6)for(let Y of X.listRefsByChild(J))Y.dispose();else{let Y=X.getRefByChild(J);if(Y)Y.dispose()}return this}assertRefList(Z){let J=this[h0][Z];if(J instanceof P6||J instanceof P0)return J;throw new Error(`Expected RefList or RefSet for attribute "${Z}"`)}listRefMapKeys(Z){return this.assertRefMap(Z).keys()}listRefMapValues(Z){return this.assertRefMap(Z).values().map((J)=>J.getChild())}getRefMap(Z,J){let Y=this.assertRefMap(Z).get(J);return Y?Y.getChild():null}setRefMap(Z,J,X,Y){let $=this.assertRefMap(Z),Q=$.get(J);if(Q)Q.dispose();if(!X)return this;Y=Object.assign(Y||{},{key:J});let W=this.graph._createEdge(Z,this,X,e3({},Y,{key:J}));return $.set(J,W),this.dispatchEvent({type:"change",attribute:Z,key:J})}assertRefMap(Z){let J=this[h0][Z];if(J instanceof r1)return J;throw new Error(`Expected RefMap for attribute "${Z}"`)}dispatchEvent(Z){return super.dispatchEvent(e3({},Z,{target:this})),this.graph.dispatchEvent(e3({},Z,{target:this,type:`node:${Z.type}`})),this}_destroyRef(Z){let J=Z.getName();if(this[h0][J]===Z){if(this[h0][J]=null,this[z4].has(J))Z.getChild().dispose()}else if(this[h0][J]instanceof P6)this[h0][J].remove(Z);else if(this[h0][J]instanceof P0)this[h0][J].remove(Z);else if(this[h0][J]instanceof r1){let X=this[h0][J];for(let Y of X.keys())if(X.get(Y)===Z)X.delete(Y)}else return;this.graph._destroyEdge(Z),this.dispatchEvent({type:"change",attribute:J})}}var Tc="v4.1.1",fU="@glb.bin",a;(function(Z){Z.ACCESSOR="Accessor",Z.ANIMATION="Animation",Z.ANIMATION_CHANNEL="AnimationChannel",Z.ANIMATION_SAMPLER="AnimationSampler",Z.BUFFER="Buffer",Z.CAMERA="Camera",Z.MATERIAL="Material",Z.MESH="Mesh",Z.PRIMITIVE="Primitive",Z.PRIMITIVE_TARGET="PrimitiveTarget",Z.NODE="Node",Z.ROOT="Root",Z.SCENE="Scene",Z.SKIN="Skin",Z.TEXTURE="Texture",Z.TEXTURE_INFO="TextureInfo"})(a||(a={}));var bU;(function(Z){Z.INTERLEAVED="interleaved",Z.SEPARATE="separate"})(bU||(bU={}));var c5;(function(Z){Z.ARRAY_BUFFER="ARRAY_BUFFER",Z.ELEMENT_ARRAY_BUFFER="ELEMENT_ARRAY_BUFFER",Z.INVERSE_BIND_MATRICES="INVERSE_BIND_MATRICES",Z.OTHER="OTHER",Z.SPARSE="SPARSE"})(c5||(c5={}));var yU;(function(Z){Z[Z.R=4096]="R",Z[Z.G=256]="G",Z[Z.B=16]="B",Z[Z.A=1]="A"})(yU||(yU={}));var GZ;(function(Z){Z.GLTF="GLTF",Z.GLB="GLB"})(GZ||(GZ={}));var qJ={"5120":Int8Array,"5121":Uint8Array,"5122":Int16Array,"5123":Uint16Array,"5125":Uint32Array,"5126":Float32Array},jD=typeof Float32Array!=="undefined"?Float32Array:Array;if(!Math.hypot)Math.hypot=function(){var Z=0,J=arguments.length;while(J--)Z+=arguments[J]*arguments[J];return Math.sqrt(Z)};function dz1(){var Z=new jD(3);if(jD!=Float32Array)Z[0]=0,Z[1]=0,Z[2]=0;return Z}function OD(Z){var J=Z[0],X=Z[1],Y=Z[2];return Math.hypot(J,X,Y)}function cz1(Z,J,X){var Y=J[0],$=J[1],Q=J[2],W=X[3]*Y+X[7]*$+X[11]*Q+X[15];return W=W||1,Z[0]=(X[0]*Y+X[4]*$+X[8]*Q+X[12])/W,Z[1]=(X[1]*Y+X[5]*$+X[9]*Q+X[13])/W,Z[2]=(X[2]*Y+X[6]*$+X[10]*Q+X[14])/W,Z}(function(){var Z=dz1();return function(J,X,Y,$,Q,W){var K,G;if(!X)X=3;if(!Y)Y=0;if($)G=Math.min($*X+Y,J.length);else G=J.length;for(K=Y;K<G;K+=X)Z[0]=J[K],Z[1]=J[K+1],Z[2]=J[K+2],Q(Z,Z,W),J[K]=Z[0],J[K+1]=Z[1],J[K+2]=Z[2];return J}})();function DD(Z){let J=kc(),X=Z.propertyType===a.NODE?[Z]:Z.listChildren();for(let Y of X)Y.traverse(($)=>{let Q=$.getMesh();if(!Q)return;let W=lz1(Q,$.getWorldMatrix());if(W.min.every(isFinite)&&W.max.every(isFinite))MD(W.min,J),MD(W.max,J)});return J}function lz1(Z,J){let X=kc();for(let Y of Z.listPrimitives()){let $=Y.getAttribute("POSITION"),Q=Y.getIndices();if(!$)continue;let W=[0,0,0],K=[0,0,0];for(let G=0,H=Q?Q.getCount():$.getCount();G<H;G++){let z=Q?Q.getScalar(G):G;W=$.getElement(z,W),K=cz1(K,W,J),MD(K,X)}}return X}function MD(Z,J){for(let X=0;X<3;X++)J.min[X]=Math.min(Z[X],J.min[X]),J.max[X]=Math.max(Z[X],J.max[X])}function kc(){return{min:[1/0,1/0,1/0],max:[-1/0,-1/0,-1/0]}}class n0{static createBufferFromDataURI(Z){if(typeof Buffer==="undefined"){let J=atob(Z.split(",")[1]),X=new Uint8Array(J.length);for(let Y=0;Y<J.length;Y++)X[Y]=J.charCodeAt(Y);return X}else{let J=Z.split(",")[1],X=Z.indexOf("base64")>=0;return Buffer.from(J,X?"base64":"utf8")}}static encodeText(Z){return new TextEncoder().encode(Z)}static decodeText(Z){return new TextDecoder().decode(Z)}static concat(Z){let J=0;for(let $ of Z)J+=$.byteLength;let X=new Uint8Array(J),Y=0;for(let $ of Z)X.set($,Y),Y+=$.byteLength;return X}static pad(Z,J=0){let X=this.padNumber(Z.byteLength);if(X===Z.byteLength)return Z;let Y=new Uint8Array(X);if(Y.set(Z),J!==0)for(let $=Z.byteLength;$<X;$++)Y[$]=J;return Y}static padNumber(Z){return Math.ceil(Z/4)*4}static equals(Z,J){if(Z===J)return!0;if(Z.byteLength!==J.byteLength)return!1;let X=Z.byteLength;while(X--)if(Z[X]!==J[X])return!1;return!0}static toView(Z,J=0,X=1/0){return new Uint8Array(Z.buffer,Z.byteOffset+J,Math.min(Z.byteLength,X))}static assertView(Z){if(Z&&!ArrayBuffer.isView(Z))throw new Error(`Method requires Uint8Array parameter; received "${typeof Z}".`);return Z}}class PD{static hexToFactor(Z,J){Z=Math.floor(Z);let X=J;return X[0]=(Z>>16&255)/255,X[1]=(Z>>8&255)/255,X[2]=(Z&255)/255,this.convertSRGBToLinear(J,J)}static factorToHex(Z){let J=[...Z],[X,Y,$]=this.convertLinearToSRGB(Z,J);return X*255<<16^Y*255<<8^$*255<<0}static convertSRGBToLinear(Z,J){let X=Z,Y=J;for(let $=0;$<3;$++)Y[$]=X[$]<0.04045?X[$]*0.0773993808:Math.pow(X[$]*0.9478672986+0.0521327014,2.4);return J}static convertLinearToSRGB(Z,J){let X=Z,Y=J;for(let $=0;$<3;$++)Y[$]=X[$]<0.0031308?X[$]*12.92:1.055*Math.pow(X[$],0.41666)-0.055;return J}}class Ec{match(Z){return Z.length>=3&&Z[0]===255&&Z[1]===216&&Z[2]===255}getSize(Z){let J=new DataView(Z.buffer,Z.byteOffset+4),X,Y;while(J.byteLength){if(X=J.getUint16(0,!1),pz1(J,X),Y=J.getUint8(X+1),Y===192||Y===193||Y===194)return[J.getUint16(X+7,!1),J.getUint16(X+5,!1)];J=new DataView(Z.buffer,J.byteOffset+X+2)}throw new TypeError("Invalid JPG, no size found")}getChannels(Z){return 3}}class uU{match(Z){return Z.length>=8&&Z[0]===137&&Z[1]===80&&Z[2]===78&&Z[3]===71&&Z[4]===13&&Z[5]===10&&Z[6]===26&&Z[7]===10}getSize(Z){let J=new DataView(Z.buffer,Z.byteOffset);if(n0.decodeText(Z.slice(12,16))===uU.PNG_FRIED_CHUNK_NAME)return[J.getUint32(32,!1),J.getUint32(36,!1)];return[J.getUint32(16,!1),J.getUint32(20,!1)]}getChannels(Z){return 4}}uU.PNG_FRIED_CHUNK_NAME="CgBI";class HZ{static registerFormat(Z,J){this.impls[Z]=J}static getMimeType(Z){for(let J in this.impls)if(this.impls[J].match(Z))return J;return null}static getSize(Z,J){if(!this.impls[J])return null;return this.impls[J].getSize(Z)}static getChannels(Z,J){if(!this.impls[J])return null;return this.impls[J].getChannels(Z)}static getVRAMByteLength(Z,J){if(!this.impls[J])return null;if(this.impls[J].getVRAMByteLength)return this.impls[J].getVRAMByteLength(Z);let X=0,Y=4,$=this.getSize(Z,J);if(!$)return null;while($[0]>1||$[1]>1)X+=$[0]*$[1]*Y,$[0]=Math.max(Math.floor($[0]/2),1),$[1]=Math.max(Math.floor($[1]/2),1);return X+=1*Y,X}static mimeTypeToExtension(Z){if(Z==="image/jpeg")return"jpg";return Z.split("/").pop()}static extensionToMimeType(Z){if(Z==="jpg")return"image/jpeg";if(!Z)return"";return`image/${Z}`}}HZ.impls={"image/jpeg":new Ec,"image/png":new uU};function pz1(Z,J){if(J>Z.byteLength)throw new TypeError("Corrupt JPG, exceeded buffer limits");if(Z.getUint8(J)!==255)throw new TypeError("Invalid JPG, marker table corrupted");return Z}class zZ{static basename(Z){let J=Z.split(/[\\/]/).pop();return J.substring(0,J.lastIndexOf("."))}static extension(Z){if(Z.startsWith("data:image/")){let J=Z.match(/data:(image\/\w+)/)[1];return HZ.mimeTypeToExtension(J)}else if(Z.startsWith("data:model/gltf+json"))return"gltf";else if(Z.startsWith("data:model/gltf-binary"))return"glb";else if(Z.startsWith("data:application/"))return"bin";return Z.split(/[\\/]/).pop().split(/[.]/).pop()}}function Mc(Z){return Object.prototype.toString.call(Z)==="[object Object]"}function rX(Z){if(Mc(Z)===!1)return!1;let J=Z.constructor;if(J===void 0)return!0;let X=J.prototype;if(Mc(X)===!1)return!1;if(Object.prototype.hasOwnProperty.call(X,"isPrototypeOf")===!1)return!1;return!0}var RD,ZG;(function(Z){Z[Z.SILENT=4]="SILENT",Z[Z.ERROR=3]="ERROR",Z[Z.WARN=2]="WARN",Z[Z.INFO=1]="INFO",Z[Z.DEBUG=0]="DEBUG"})(ZG||(ZG={}));class O5{constructor(Z){this.verbosity=void 0,this.verbosity=Z}debug(Z){if(this.verbosity<=O5.Verbosity.DEBUG)console.debug(Z)}info(Z){if(this.verbosity<=O5.Verbosity.INFO)console.info(Z)}warn(Z){if(this.verbosity<=O5.Verbosity.WARN)console.warn(Z)}error(Z){if(this.verbosity<=O5.Verbosity.ERROR)console.error(Z)}}RD=O5;O5.Verbosity=ZG;O5.DEFAULT_INSTANCE=new RD(RD.Verbosity.INFO);function iz1(Z){var J=Z[0],X=Z[1],Y=Z[2],$=Z[3],Q=Z[4],W=Z[5],K=Z[6],G=Z[7],H=Z[8],z=Z[9],q=Z[10],V=Z[11],F=Z[12],U=Z[13],w=Z[14],L=Z[15],O=J*W-X*Q,N=J*K-Y*Q,M=J*G-$*Q,j=X*K-Y*W,P=X*G-$*W,D=Y*G-$*K,C=H*U-z*F,k=H*w-q*F,T=H*L-V*F,x=z*w-q*U,S=z*L-V*U,h=q*L-V*w;return O*h-N*S+M*x+j*T-P*k+D*C}function nz1(Z,J,X){var Y=J[0],$=J[1],Q=J[2],W=J[3],K=J[4],G=J[5],H=J[6],z=J[7],q=J[8],V=J[9],F=J[10],U=J[11],w=J[12],L=J[13],O=J[14],N=J[15],M=X[0],j=X[1],P=X[2],D=X[3];return Z[0]=M*Y+j*K+P*q+D*w,Z[1]=M*$+j*G+P*V+D*L,Z[2]=M*Q+j*H+P*F+D*O,Z[3]=M*W+j*z+P*U+D*N,M=X[4],j=X[5],P=X[6],D=X[7],Z[4]=M*Y+j*K+P*q+D*w,Z[5]=M*$+j*G+P*V+D*L,Z[6]=M*Q+j*H+P*F+D*O,Z[7]=M*W+j*z+P*U+D*N,M=X[8],j=X[9],P=X[10],D=X[11],Z[8]=M*Y+j*K+P*q+D*w,Z[9]=M*$+j*G+P*V+D*L,Z[10]=M*Q+j*H+P*F+D*O,Z[11]=M*W+j*z+P*U+D*N,M=X[12],j=X[13],P=X[14],D=X[15],Z[12]=M*Y+j*K+P*q+D*w,Z[13]=M*$+j*G+P*V+D*L,Z[14]=M*Q+j*H+P*F+D*O,Z[15]=M*W+j*z+P*U+D*N,Z}function az1(Z,J){var X=J[0],Y=J[1],$=J[2],Q=J[4],W=J[5],K=J[6],G=J[8],H=J[9],z=J[10];return Z[0]=Math.hypot(X,Y,$),Z[1]=Math.hypot(Q,W,K),Z[2]=Math.hypot(G,H,z),Z}function sz1(Z,J){var X=new jD(3);az1(X,J);var Y=1/X[0],$=1/X[1],Q=1/X[2],W=J[0]*Y,K=J[1]*$,G=J[2]*Q,H=J[4]*Y,z=J[5]*$,q=J[6]*Q,V=J[8]*Y,F=J[9]*$,U=J[10]*Q,w=W+z+U,L=0;if(w>0)L=Math.sqrt(w+1)*2,Z[3]=0.25*L,Z[0]=(q-F)/L,Z[1]=(V-G)/L,Z[2]=(K-H)/L;else if(W>z&&W>U)L=Math.sqrt(1+W-z-U)*2,Z[3]=(q-F)/L,Z[0]=0.25*L,Z[1]=(K+H)/L,Z[2]=(V+G)/L;else if(z>U)L=Math.sqrt(1+z-W-U)*2,Z[3]=(V-G)/L,Z[0]=(K+H)/L,Z[1]=0.25*L,Z[2]=(q+F)/L;else L=Math.sqrt(1+U-W-z)*2,Z[3]=(K-H)/L,Z[0]=(V+G)/L,Z[1]=(q+F)/L,Z[2]=0.25*L;return Z}class c0{static identity(Z){return Z}static eq(Z,J,X=0.00001){if(Z.length!==J.length)return!1;for(let Y=0;Y<Z.length;Y++)if(Math.abs(Z[Y]-J[Y])>X)return!1;return!0}static clamp(Z,J,X){if(Z<J)return J;if(Z>X)return X;return Z}static decodeNormalizedInt(Z,J){switch(J){case 5126:return Z;case 5123:return Z/65535;case 5121:return Z/255;case 5122:return Math.max(Z/32767,-1);case 5120:return Math.max(Z/127,-1);default:throw new Error("Invalid component type.")}}static encodeNormalizedInt(Z,J){switch(J){case 5126:return Z;case 5123:return Math.round(c0.clamp(Z,0,1)*65535);case 5121:return Math.round(c0.clamp(Z,0,1)*255);case 5122:return Math.round(c0.clamp(Z,-1,1)*32767);case 5120:return Math.round(c0.clamp(Z,-1,1)*127);default:throw new Error("Invalid component type.")}}static decompose(Z,J,X,Y){let $=OD([Z[0],Z[1],Z[2]]),Q=OD([Z[4],Z[5],Z[6]]),W=OD([Z[8],Z[9],Z[10]]);if(iz1(Z)<0)$=-$;J[0]=Z[12],J[1]=Z[13],J[2]=Z[14];let G=Z.slice(),H=1/$,z=1/Q,q=1/W;G[0]*=H,G[1]*=H,G[2]*=H,G[4]*=z,G[5]*=z,G[6]*=z,G[8]*=q,G[9]*=q,G[10]*=q,sz1(X,G),Y[0]=$,Y[1]=Q,Y[2]=W}static compose(Z,J,X,Y){let $=Y,Q=J[0],W=J[1],K=J[2],G=J[3],H=Q+Q,z=W+W,q=K+K,V=Q*H,F=Q*z,U=Q*q,w=W*z,L=W*q,O=K*q,N=G*H,M=G*z,j=G*q,P=X[0],D=X[1],C=X[2];return $[0]=(1-(w+O))*P,$[1]=(F+j)*P,$[2]=(U-M)*P,$[3]=0,$[4]=(F-j)*D,$[5]=(1-(V+O))*D,$[6]=(L+N)*D,$[7]=0,$[8]=(U+M)*C,$[9]=(L-N)*C,$[10]=(1-(V+w))*C,$[11]=0,$[12]=Z[0],$[13]=Z[1],$[14]=Z[2],$[15]=1,$}}function oz1(Z,J){if(!!Z!==!!J)return!1;let X=Z.getChild(),Y=J.getChild();return X===Y||X.equals(Y)}function rz1(Z,J){if(!!Z!==!!J)return!1;let X=Z.values(),Y=J.values();if(X.length!==Y.length)return!1;for(let $=0;$<X.length;$++){let Q=X[$],W=Y[$];if(Q.getChild()===W.getChild())continue;if(!Q.getChild().equals(W.getChild()))return!1}return!0}function tz1(Z,J){if(!!Z!==!!J)return!1;let X=Z.keys(),Y=J.keys();if(X.length!==Y.length)return!1;for(let $ of X){let Q=Z.get($),W=J.get($);if(!!Q!==!!W)return!1;let K=Q.getChild(),G=W.getChild();if(K===G)continue;if(!K.equals(G))return!1}return!0}function Ic(Z,J){if(Z===J)return!0;if(!!Z!==!!J||!Z||!J)return!1;if(Z.length!==J.length)return!1;for(let X=0;X<Z.length;X++)if(Z[X]!==J[X])return!1;return!0}function vc(Z,J){if(Z===J)return!0;if(!!Z!==!!J)return!1;if(!rX(Z)||!rX(J))return Z===J;let X=Z,Y=J,$=0,Q=0,W;for(W in X)$++;for(W in Y)Q++;if($!==Q)return!1;for(W in X){let K=X[W],G=Y[W];if(gU(K)&&gU(G)){if(!Ic(K,G))return!1}else if(rX(K)&&rX(G)){if(!vc(K,G))return!1}else if(K!==G)return!1}return!0}function gU(Z){return Array.isArray(Z)||ArrayBuffer.isView(Z)}var Rc="23456789abdegjkmnpqrvwxyzABDEGJKMNPQRVWXYZ",ez1=999,Zq1=6,Nc=new Set,Jq1=function Z(){let J="";for(let X=0;X<Zq1;X++)J+=Rc.charAt(Math.floor(Math.random()*Rc.length));return J},Sc=function Z(){for(let J=0;J<ez1;J++){let X=Jq1();if(!Nc.has(X))return Nc.add(X),X}return""},Dc="https://null.example";class R9{static dirname(Z){let J=Z.lastIndexOf("/");if(J===-1)return"./";return Z.substring(0,J+1)}static basename(Z){return zZ.basename(new URL(Z,Dc).pathname)}static extension(Z){return zZ.extension(new URL(Z,Dc).pathname)}static resolve(Z,J){if(!this.isRelativePath(J))return J;let X=Z.split("/"),Y=J.split("/");X.pop();for(let $=0;$<Y.length;$++){if(Y[$]===".")continue;if(Y[$]==="..")X.pop();else X.push(Y[$])}return X.join("/")}static isAbsoluteURL(Z){return this.PROTOCOL_REGEXP.test(Z)}static isRelativePath(Z){return!/^(?:[a-zA-Z]+:)?\//.test(Z)}}R9.DEFAULT_INIT={};R9.PROTOCOL_REGEXP=/^[a-zA-Z]+:\/\//;var zJ=(Z)=>Z,Xq1=new Set;class dU extends kQ{constructor(Z,J=""){super(Z);this[h0].name=J,this.init(),this.dispatchEvent({type:"create"})}getGraph(){return this.graph}getDefaults(){return Object.assign(super.getDefaults(),{name:"",extras:{}})}set(Z,J){if(Array.isArray(J))J=J.slice();return super.set(Z,J)}getName(){return this.get("name")}setName(Z){return this.set("name",Z)}getExtras(){return this.get("extras")}setExtras(Z){return this.set("extras",Z)}clone(){return new this.constructor(this.graph).copy(this,zJ)}copy(Z,J=zJ){for(let X in this[h0]){let Y=this[h0][X];if(Y instanceof w5){if(!this[z4].has(X))Y.dispose()}else if(Y instanceof P6||Y instanceof P0)for(let $ of Y.values())$.dispose();else if(Y instanceof r1)for(let $ of Y.values())$.dispose()}for(let X in Z[h0]){let Y=this[h0][X],$=Z[h0][X];if($ instanceof w5)if(this[z4].has(X))Y.getChild().copy(J($.getChild()),J);else this.setRef(X,J($.getChild()),$.getAttributes());else if($ instanceof P0||$ instanceof P6)for(let Q of $.values())this.addRef(X,J(Q.getChild()),Q.getAttributes());else if($ instanceof r1)for(let Q of $.keys()){let W=$.get(Q);this.setRefMap(X,Q,J(W.getChild()),W.getAttributes())}else if(rX($))this[h0][X]=JSON.parse(JSON.stringify($));else if(Array.isArray($)||$ instanceof ArrayBuffer||ArrayBuffer.isView($))this[h0][X]=$.slice();else this[h0][X]=$}return this}equals(Z,J=Xq1){if(this===Z)return!0;if(this.propertyType!==Z.propertyType)return!1;for(let X in this[h0]){if(J.has(X))continue;let Y=this[h0][X],$=Z[h0][X];if(Y instanceof w5||$ instanceof w5){if(!oz1(Y,$))return!1}else if(Y instanceof P0||$ instanceof P0||Y instanceof P6||$ instanceof P6){if(!rz1(Y,$))return!1}else if(Y instanceof r1||$ instanceof r1){if(!tz1(Y,$))return!1}else if(rX(Y)||rX($)){if(!vc(Y,$))return!1}else if(gU(Y)||gU($)){if(!Ic(Y,$))return!1}else if(Y!==$)return!1}return!0}detach(){return this.graph.disconnectParents(this,(Z)=>Z.propertyType!=="Root"),this}listParents(){return this.graph.listParents(this)}}class T6 extends dU{getDefaults(){return Object.assign(super.getDefaults(),{extensions:new r1})}getExtension(Z){return this.getRefMap("extensions",Z)}setExtension(Z,J){if(J)J._validateParent(this);return this.setRefMap("extensions",Z,J)}listExtensions(){return this.listRefMapValues("extensions")}}class v0 extends T6{init(){this.propertyType=a.ACCESSOR}getDefaults(){return Object.assign(super.getDefaults(),{array:null,type:v0.Type.SCALAR,componentType:v0.ComponentType.FLOAT,normalized:!1,sparse:!1,buffer:null})}static getElementSize(Z){switch(Z){case v0.Type.SCALAR:return 1;case v0.Type.VEC2:return 2;case v0.Type.VEC3:return 3;case v0.Type.VEC4:return 4;case v0.Type.MAT2:return 4;case v0.Type.MAT3:return 9;case v0.Type.MAT4:return 16;default:throw new Error("Unexpected type: "+Z)}}static getComponentSize(Z){switch(Z){case v0.ComponentType.BYTE:return 1;case v0.ComponentType.UNSIGNED_BYTE:return 1;case v0.ComponentType.SHORT:return 2;case v0.ComponentType.UNSIGNED_SHORT:return 2;case v0.ComponentType.UNSIGNED_INT:return 4;case v0.ComponentType.FLOAT:return 4;default:throw new Error("Unexpected component type: "+Z)}}getMinNormalized(Z){let J=this.getNormalized(),X=this.getElementSize(),Y=this.getComponentType();if(this.getMin(Z),J)for(let $=0;$<X;$++)Z[$]=c0.decodeNormalizedInt(Z[$],Y);return Z}getMin(Z){let J=this.getArray(),X=this.getCount(),Y=this.getElementSize();for(let $=0;$<Y;$++)Z[$]=1/0;for(let $=0;$<X*Y;$+=Y)for(let Q=0;Q<Y;Q++){let W=J[$+Q];if(Number.isFinite(W))Z[Q]=Math.min(Z[Q],W)}return Z}getMaxNormalized(Z){let J=this.getNormalized(),X=this.getElementSize(),Y=this.getComponentType();if(this.getMax(Z),J)for(let $=0;$<X;$++)Z[$]=c0.decodeNormalizedInt(Z[$],Y);return Z}getMax(Z){let J=this.get("array"),X=this.getCount(),Y=this.getElementSize();for(let $=0;$<Y;$++)Z[$]=-1/0;for(let $=0;$<X*Y;$+=Y)for(let Q=0;Q<Y;Q++){let W=J[$+Q];if(Number.isFinite(W))Z[Q]=Math.max(Z[Q],W)}return Z}getCount(){let Z=this.get("array");return Z?Z.length/this.getElementSize():0}getType(){return this.get("type")}setType(Z){return this.set("type",Z)}getElementSize(){return v0.getElementSize(this.get("type"))}getComponentSize(){return this.get("array").BYTES_PER_ELEMENT}getComponentType(){return this.get("componentType")}getNormalized(){return this.get("normalized")}setNormalized(Z){return this.set("normalized",Z)}getScalar(Z){let J=this.getElementSize(),X=this.getComponentType(),Y=this.getArray();if(this.getNormalized())return c0.decodeNormalizedInt(Y[Z*J],X);return Y[Z*J]}setScalar(Z,J){let X=this.getElementSize(),Y=this.getComponentType(),$=this.getArray();if(this.getNormalized())$[Z*X]=c0.encodeNormalizedInt(J,Y);else $[Z*X]=J;return this}getElement(Z,J){let X=this.getNormalized(),Y=this.getElementSize(),$=this.getComponentType(),Q=this.getArray();for(let W=0;W<Y;W++)if(X)J[W]=c0.decodeNormalizedInt(Q[Z*Y+W],$);else J[W]=Q[Z*Y+W];return J}setElement(Z,J){let X=this.getNormalized(),Y=this.getElementSize(),$=this.getComponentType(),Q=this.getArray();for(let W=0;W<Y;W++)if(X)Q[Z*Y+W]=c0.encodeNormalizedInt(J[W],$);else Q[Z*Y+W]=J[W];return this}getSparse(){return this.get("sparse")}setSparse(Z){return this.set("sparse",Z)}getBuffer(){return this.getRef("buffer")}setBuffer(Z){return this.setRef("buffer",Z)}getArray(){return this.get("array")}setArray(Z){return this.set("componentType",Z?Yq1(Z):v0.ComponentType.FLOAT),this.set("array",Z),this}getByteLength(){let Z=this.get("array");return Z?Z.byteLength:0}}v0.Type={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};v0.ComponentType={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,FLOAT:5126};function Yq1(Z){switch(Z.constructor){case Float32Array:return v0.ComponentType.FLOAT;case Uint32Array:return v0.ComponentType.UNSIGNED_INT;case Uint16Array:return v0.ComponentType.UNSIGNED_SHORT;case Uint8Array:return v0.ComponentType.UNSIGNED_BYTE;case Int16Array:return v0.ComponentType.SHORT;case Int8Array:return v0.ComponentType.BYTE;default:throw new Error("Unknown accessor componentType.")}}class CD extends T6{init(){this.propertyType=a.ANIMATION}getDefaults(){return Object.assign(super.getDefaults(),{channels:new P0,samplers:new P0})}addChannel(Z){return this.addRef("channels",Z)}removeChannel(Z){return this.removeRef("channels",Z)}listChannels(){return this.listRefs("channels")}addSampler(Z){return this.addRef("samplers",Z)}removeSampler(Z){return this.removeRef("samplers",Z)}listSamplers(){return this.listRefs("samplers")}}class tX extends T6{init(){this.propertyType=a.ANIMATION_CHANNEL}getDefaults(){return Object.assign(super.getDefaults(),{targetPath:null,targetNode:null,sampler:null})}getTargetPath(){return this.get("targetPath")}setTargetPath(Z){return this.set("targetPath",Z)}getTargetNode(){return this.getRef("targetNode")}setTargetNode(Z){return this.setRef("targetNode",Z)}getSampler(){return this.getRef("sampler")}setSampler(Z){return this.setRef("sampler",Z)}}tX.TargetPath={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"};class EQ extends T6{init(){this.propertyType=a.ANIMATION_SAMPLER}getDefaultAttributes(){return Object.assign(super.getDefaults(),{interpolation:EQ.Interpolation.LINEAR,input:null,output:null})}getInterpolation(){return this.get("interpolation")}setInterpolation(Z){return this.set("interpolation",Z)}getInput(){return this.getRef("input")}setInput(Z){return this.setRef("input",Z,{usage:c5.OTHER})}getOutput(){return this.getRef("output")}setOutput(Z){return this.setRef("output",Z,{usage:c5.OTHER})}}EQ.Interpolation={LINEAR:"LINEAR",STEP:"STEP",CUBICSPLINE:"CUBICSPLINE"};class TD extends T6{init(){this.propertyType=a.BUFFER}getDefaults(){return Object.assign(super.getDefaults(),{uri:""})}getURI(){return this.get("uri")}setURI(Z){return this.set("uri",Z)}}class eX extends T6{init(){this.propertyType=a.CAMERA}getDefaults(){return Object.assign(super.getDefaults(),{type:eX.Type.PERSPECTIVE,znear:0.1,zfar:100,aspectRatio:null,yfov:Math.PI*2*50/360,xmag:1,ymag:1})}getType(){return this.get("type")}setType(Z){return this.set("type",Z)}getZNear(){return this.get("znear")}setZNear(Z){return this.set("znear",Z)}getZFar(){return this.get("zfar")}setZFar(Z){return this.set("zfar",Z)}getAspectRatio(){return this.get("aspectRatio")}setAspectRatio(Z){return this.set("aspectRatio",Z)}getYFov(){return this.get("yfov")}setYFov(Z){return this.set("yfov",Z)}getXMag(){return this.get("xmag")}setXMag(Z){return this.set("xmag",Z)}getYMag(){return this.get("ymag")}setYMag(Z){return this.set("ymag",Z)}}eX.Type={PERSPECTIVE:"perspective",ORTHOGRAPHIC:"orthographic"};class IQ extends dU{_validateParent(Z){if(!this.parentTypes.includes(Z.propertyType))throw new Error(`Parent "${Z.propertyType}" invalid for child "${this.propertyType}".`)}}IQ.EXTENSION_NAME=void 0;class B5 extends T6{init(){this.propertyType=a.TEXTURE_INFO}getDefaults(){return Object.assign(super.getDefaults(),{texCoord:0,magFilter:null,minFilter:null,wrapS:B5.WrapMode.REPEAT,wrapT:B5.WrapMode.REPEAT})}getTexCoord(){return this.get("texCoord")}setTexCoord(Z){return this.set("texCoord",Z)}getMagFilter(){return this.get("magFilter")}setMagFilter(Z){return this.set("magFilter",Z)}getMinFilter(){return this.get("minFilter")}setMinFilter(Z){return this.set("minFilter",Z)}getWrapS(){return this.get("wrapS")}setWrapS(Z){return this.set("wrapS",Z)}getWrapT(){return this.get("wrapT")}setWrapT(Z){return this.set("wrapT",Z)}}B5.WrapMode={CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497};B5.MagFilter={NEAREST:9728,LINEAR:9729};B5.MinFilter={NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987};var{R:SU,G:_U,B:AU,A:$q1}=yU;class J7 extends T6{init(){this.propertyType=a.MATERIAL}getDefaults(){return Object.assign(super.getDefaults(),{alphaMode:J7.AlphaMode.OPAQUE,alphaCutoff:0.5,doubleSided:!1,baseColorFactor:[1,1,1,1],baseColorTexture:null,baseColorTextureInfo:new B5(this.graph,"baseColorTextureInfo"),emissiveFactor:[0,0,0],emissiveTexture:null,emissiveTextureInfo:new B5(this.graph,"emissiveTextureInfo"),normalScale:1,normalTexture:null,normalTextureInfo:new B5(this.graph,"normalTextureInfo"),occlusionStrength:1,occlusionTexture:null,occlusionTextureInfo:new B5(this.graph,"occlusionTextureInfo"),roughnessFactor:1,metallicFactor:1,metallicRoughnessTexture:null,metallicRoughnessTextureInfo:new B5(this.graph,"metallicRoughnessTextureInfo")})}getDoubleSided(){return this.get("doubleSided")}setDoubleSided(Z){return this.set("doubleSided",Z)}getAlpha(){return this.get("baseColorFactor")[3]}setAlpha(Z){let J=this.get("baseColorFactor").slice();return J[3]=Z,this.set("baseColorFactor",J)}getAlphaMode(){return this.get("alphaMode")}setAlphaMode(Z){return this.set("alphaMode",Z)}getAlphaCutoff(){return this.get("alphaCutoff")}setAlphaCutoff(Z){return this.set("alphaCutoff",Z)}getBaseColorFactor(){return this.get("baseColorFactor")}setBaseColorFactor(Z){return this.set("baseColorFactor",Z)}getBaseColorTexture(){return this.getRef("baseColorTexture")}getBaseColorTextureInfo(){return this.getRef("baseColorTexture")?this.getRef("baseColorTextureInfo"):null}setBaseColorTexture(Z){return this.setRef("baseColorTexture",Z,{channels:SU|_U|AU|$q1,isColor:!0})}getEmissiveFactor(){return this.get("emissiveFactor")}setEmissiveFactor(Z){return this.set("emissiveFactor",Z)}getEmissiveTexture(){return this.getRef("emissiveTexture")}getEmissiveTextureInfo(){return this.getRef("emissiveTexture")?this.getRef("emissiveTextureInfo"):null}setEmissiveTexture(Z){return this.setRef("emissiveTexture",Z,{channels:SU|_U|AU,isColor:!0})}getNormalScale(){return this.get("normalScale")}setNormalScale(Z){return this.set("normalScale",Z)}getNormalTexture(){return this.getRef("normalTexture")}getNormalTextureInfo(){return this.getRef("normalTexture")?this.getRef("normalTextureInfo"):null}setNormalTexture(Z){return this.setRef("normalTexture",Z,{channels:SU|_U|AU})}getOcclusionStrength(){return this.get("occlusionStrength")}setOcclusionStrength(Z){return this.set("occlusionStrength",Z)}getOcclusionTexture(){return this.getRef("occlusionTexture")}getOcclusionTextureInfo(){return this.getRef("occlusionTexture")?this.getRef("occlusionTextureInfo"):null}setOcclusionTexture(Z){return this.setRef("occlusionTexture",Z,{channels:SU})}getRoughnessFactor(){return this.get("roughnessFactor")}setRoughnessFactor(Z){return this.set("roughnessFactor",Z)}getMetallicFactor(){return this.get("metallicFactor")}setMetallicFactor(Z){return this.set("metallicFactor",Z)}getMetallicRoughnessTexture(){return this.getRef("metallicRoughnessTexture")}getMetallicRoughnessTextureInfo(){return this.getRef("metallicRoughnessTexture")?this.getRef("metallicRoughnessTextureInfo"):null}setMetallicRoughnessTexture(Z){return this.setRef("metallicRoughnessTexture",Z,{channels:_U|AU})}}J7.AlphaMode={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};class XG extends T6{init(){this.propertyType=a.MESH}getDefaults(){return Object.assign(super.getDefaults(),{weights:[],primitives:new P0})}addPrimitive(Z){return this.addRef("primitives",Z)}removePrimitive(Z){return this.removeRef("primitives",Z)}listPrimitives(){return this.listRefs("primitives")}getWeights(){return this.get("weights")}setWeights(Z){return this.set("weights",Z)}}class cU extends T6{init(){this.propertyType=a.NODE}getDefaults(){return Object.assign(super.getDefaults(),{translation:[0,0,0],rotation:[0,0,0,1],scale:[1,1,1],weights:[],camera:null,mesh:null,skin:null,children:new P0})}copy(Z,J=zJ){if(J===zJ)throw new Error("Node cannot be copied.");return super.copy(Z,J)}getTranslation(){return this.get("translation")}getRotation(){return this.get("rotation")}getScale(){return this.get("scale")}setTranslation(Z){return this.set("translation",Z)}setRotation(Z){return this.set("rotation",Z)}setScale(Z){return this.set("scale",Z)}getMatrix(){return c0.compose(this.get("translation"),this.get("rotation"),this.get("scale"),[])}setMatrix(Z){let J=this.get("translation").slice(),X=this.get("rotation").slice(),Y=this.get("scale").slice();return c0.decompose(Z,J,X,Y),this.set("translation",J).set("rotation",X).set("scale",Y)}getWorldTranslation(){let Z=[0,0,0];return c0.decompose(this.getWorldMatrix(),Z,[0,0,0,1],[1,1,1]),Z}getWorldRotation(){let Z=[0,0,0,1];return c0.decompose(this.getWorldMatrix(),[0,0,0],Z,[1,1,1]),Z}getWorldScale(){let Z=[1,1,1];return c0.decompose(this.getWorldMatrix(),[0,0,0],[0,0,0,1],Z),Z}getWorldMatrix(){let Z=[];for(let Y=this;Y!=null;Y=Y.getParentNode())Z.push(Y);let J,X=Z.pop().getMatrix();while(J=Z.pop())nz1(X,X,J.getMatrix());return X}addChild(Z){let J=Z.getParentNode();if(J)J.removeChild(Z);for(let X of Z.listParents())if(X.propertyType===a.SCENE)X.removeChild(Z);return this.addRef("children",Z)}removeChild(Z){return this.removeRef("children",Z)}listChildren(){return this.listRefs("children")}getParentNode(){for(let Z of this.listParents())if(Z.propertyType===a.NODE)return Z;return null}getMesh(){return this.getRef("mesh")}setMesh(Z){return this.setRef("mesh",Z)}getCamera(){return this.getRef("camera")}setCamera(Z){return this.setRef("camera",Z)}getSkin(){return this.getRef("skin")}setSkin(Z){return this.setRef("skin",Z)}getWeights(){return this.get("weights")}setWeights(Z){return this.set("weights",Z)}traverse(Z){Z(this);for(let J of this.listChildren())J.traverse(Z);return this}}class M8 extends T6{init(){this.propertyType=a.PRIMITIVE}getDefaults(){return Object.assign(super.getDefaults(),{mode:M8.Mode.TRIANGLES,material:null,indices:null,attributes:new r1,targets:new P0})}getIndices(){return this.getRef("indices")}setIndices(Z){return this.setRef("indices",Z,{usage:c5.ELEMENT_ARRAY_BUFFER})}getAttribute(Z){return this.getRefMap("attributes",Z)}setAttribute(Z,J){return this.setRefMap("attributes",Z,J,{usage:c5.ARRAY_BUFFER})}listAttributes(){return this.listRefMapValues("attributes")}listSemantics(){return this.listRefMapKeys("attributes")}getMaterial(){return this.getRef("material")}setMaterial(Z){return this.setRef("material",Z)}getMode(){return this.get("mode")}setMode(Z){return this.set("mode",Z)}listTargets(){return this.listRefs("targets")}addTarget(Z){return this.addRef("targets",Z)}removeTarget(Z){return this.removeRef("targets",Z)}}M8.Mode={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class kD extends dU{init(){this.propertyType=a.PRIMITIVE_TARGET}getDefaults(){return Object.assign(super.getDefaults(),{attributes:new r1})}getAttribute(Z){return this.getRefMap("attributes",Z)}setAttribute(Z,J){return this.setRefMap("attributes",Z,J,{usage:c5.ARRAY_BUFFER})}listAttributes(){return this.listRefMapValues("attributes")}listSemantics(){return this.listRefMapKeys("attributes")}}function c6(){return c6=Object.assign?Object.assign.bind():function(Z){for(var J=1;J<arguments.length;J++){var X=arguments[J];for(var Y in X)({}).hasOwnProperty.call(X,Y)&&(Z[Y]=X[Y])}return Z},c6.apply(null,arguments)}class vQ extends T6{init(){this.propertyType=a.SCENE}getDefaults(){return Object.assign(super.getDefaults(),{children:new P0})}copy(Z,J=zJ){if(J===zJ)throw new Error("Scene cannot be copied.");return super.copy(Z,J)}addChild(Z){let J=Z.getParentNode();if(J)J.removeChild(Z);return this.addRef("children",Z)}removeChild(Z){return this.removeRef("children",Z)}listChildren(){return this.listRefs("children")}traverse(Z){for(let J of this.listChildren())J.traverse(Z);return this}}class ED extends T6{init(){this.propertyType=a.SKIN}getDefaults(){return Object.assign(super.getDefaults(),{skeleton:null,inverseBindMatrices:null,joints:new P0})}getSkeleton(){return this.getRef("skeleton")}setSkeleton(Z){return this.setRef("skeleton",Z)}getInverseBindMatrices(){return this.getRef("inverseBindMatrices")}setInverseBindMatrices(Z){return this.setRef("inverseBindMatrices",Z,{usage:c5.INVERSE_BIND_MATRICES})}addJoint(Z){return this.addRef("joints",Z)}removeJoint(Z){return this.removeRef("joints",Z)}listJoints(){return this.listRefs("joints")}}class ZY extends T6{init(){this.propertyType=a.TEXTURE}getDefaults(){return Object.assign(super.getDefaults(),{image:null,mimeType:"",uri:""})}getMimeType(){return this.get("mimeType")||HZ.extensionToMimeType(zZ.extension(this.get("uri")))}setMimeType(Z){return this.set("mimeType",Z)}getURI(){return this.get("uri")}setURI(Z){this.set("uri",Z);let J=HZ.extensionToMimeType(zZ.extension(Z));if(J)this.set("mimeType",J);return this}getImage(){return this.get("image")}setImage(Z){return this.set("image",n0.assertView(Z))}getSize(){let Z=this.get("image");if(!Z)return null;return HZ.getSize(Z,this.getMimeType())}}class JY extends T6{init(){this.propertyType=a.ROOT}getDefaults(){return Object.assign(super.getDefaults(),{asset:{generator:`glTF-Transform ${Tc}`,version:"2.0"},defaultScene:null,accessors:new P0,animations:new P0,buffers:new P0,cameras:new P0,materials:new P0,meshes:new P0,nodes:new P0,scenes:new P0,skins:new P0,textures:new P0})}constructor(Z){super(Z);this._extensions=new Set,Z.addEventListener("node:create",(J)=>{this._addChildOfRoot(J.target)})}clone(){throw new Error("Root cannot be cloned.")}copy(Z,J=zJ){if(J===zJ)throw new Error("Root cannot be copied.");this.set("asset",c6({},Z.get("asset"))),this.setName(Z.getName()),this.setExtras(c6({},Z.getExtras())),this.setDefaultScene(Z.getDefaultScene()?J(Z.getDefaultScene()):null);for(let X of Z.listRefMapKeys("extensions")){let Y=Z.getExtension(X);this.setExtension(X,J(Y))}return this}_addChildOfRoot(Z){if(Z instanceof vQ)this.addRef("scenes",Z);else if(Z instanceof cU)this.addRef("nodes",Z);else if(Z instanceof eX)this.addRef("cameras",Z);else if(Z instanceof ED)this.addRef("skins",Z);else if(Z instanceof XG)this.addRef("meshes",Z);else if(Z instanceof J7)this.addRef("materials",Z);else if(Z instanceof ZY)this.addRef("textures",Z);else if(Z instanceof CD)this.addRef("animations",Z);else if(Z instanceof v0)this.addRef("accessors",Z);else if(Z instanceof TD)this.addRef("buffers",Z);return this}getAsset(){return this.get("asset")}listExtensionsUsed(){return Array.from(this._extensions)}listExtensionsRequired(){return this.listExtensionsUsed().filter((Z)=>Z.isRequired())}_enableExtension(Z){return this._extensions.add(Z),this}_disableExtension(Z){return this._extensions.delete(Z),this}listScenes(){return this.listRefs("scenes")}setDefaultScene(Z){return this.setRef("defaultScene",Z)}getDefaultScene(){return this.getRef("defaultScene")}listNodes(){return this.listRefs("nodes")}listCameras(){return this.listRefs("cameras")}listSkins(){return this.listRefs("skins")}listMeshes(){return this.listRefs("meshes")}listMaterials(){return this.listRefs("materials")}listTextures(){return this.listRefs("textures")}listAnimations(){return this.listRefs("animations")}listAccessors(){return this.listRefs("accessors")}listBuffers(){return this.listRefs("buffers")}}class C6{static fromGraph(Z){return C6._GRAPH_DOCUMENTS.get(Z)||null}constructor(){this._graph=new TQ,this._root=new JY(this._graph),this._logger=O5.DEFAULT_INSTANCE,C6._GRAPH_DOCUMENTS.set(this._graph,this)}getRoot(){return this._root}getGraph(){return this._graph}getLogger(){return this._logger}setLogger(Z){return this._logger=Z,this}clone(){throw new Error("Use 'cloneDocument(source)' from '@gltf-transform/functions'.")}merge(Z){throw new Error("Use 'mergeDocuments(target, source)' from '@gltf-transform/functions'.")}async transform(...Z){let J=Z.map((X)=>X.name);for(let X of Z)await X(this,{stack:J});return this}createExtension(Z){let J=Z.EXTENSION_NAME;return this.getRoot().listExtensionsUsed().find((Y)=>Y.extensionName===J)||new Z(this)}createScene(Z=""){return new vQ(this._graph,Z)}createNode(Z=""){return new cU(this._graph,Z)}createCamera(Z=""){return new eX(this._graph,Z)}createSkin(Z=""){return new ED(this._graph,Z)}createMesh(Z=""){return new XG(this._graph,Z)}createPrimitive(){return new M8(this._graph)}createPrimitiveTarget(Z=""){return new kD(this._graph,Z)}createMaterial(Z=""){return new J7(this._graph,Z)}createTexture(Z=""){return new ZY(this._graph,Z)}createAnimation(Z=""){return new CD(this._graph,Z)}createAnimationChannel(Z=""){return new tX(this._graph,Z)}createAnimationSampler(Z=""){return new EQ(this._graph,Z)}createAccessor(Z="",J=null){if(!J)J=this.getRoot().listBuffers()[0];return new v0(this._graph,Z).setBuffer(J)}createBuffer(Z=""){return new TD(this._graph,Z)}}C6._GRAPH_DOCUMENTS=new WeakMap;class _c{constructor(Z){this.extensionName="",this.prereadTypes=[],this.prewriteTypes=[],this.readDependencies=[],this.writeDependencies=[],this.document=void 0,this.required=!1,this.properties=new Set,this._listener=void 0,this.document=Z,Z.getRoot()._enableExtension(this),this._listener=(X)=>{let Y=X,$=Y.target;if($ instanceof IQ&&$.extensionName===this.extensionName){if(Y.type==="node:create")this._addExtensionProperty($);if(Y.type==="node:dispose")this._removeExtensionProperty($)}};let J=Z.getGraph();J.addEventListener("node:create",this._listener),J.addEventListener("node:dispose",this._listener)}dispose(){this.document.getRoot()._disableExtension(this);let Z=this.document.getGraph();Z.removeEventListener("node:create",this._listener),Z.removeEventListener("node:dispose",this._listener);for(let J of this.properties)J.dispose()}static register(){}isRequired(){return this.required}setRequired(Z){return this.required=Z,this}listProperties(){return Array.from(this.properties)}_addExtensionProperty(Z){return this.properties.add(Z),this}_removeExtensionProperty(Z){return this.properties.delete(Z),this}install(Z,J){return this}preread(Z,J){return this}prewrite(Z,J){return this}}_c.EXTENSION_NAME=void 0;class Ac{constructor(Z){this.jsonDoc=void 0,this.buffers=[],this.bufferViews=[],this.bufferViewBuffers=[],this.accessors=[],this.textures=[],this.textureInfos=new Map,this.materials=[],this.meshes=[],this.cameras=[],this.nodes=[],this.skins=[],this.animations=[],this.scenes=[],this.jsonDoc=Z}setTextureInfo(Z,J){if(this.textureInfos.set(Z,J),J.texCoord!==void 0)Z.setTexCoord(J.texCoord);if(J.extras!==void 0)Z.setExtras(J.extras);let X=this.jsonDoc.json.textures[J.index];if(X.sampler===void 0)return;let Y=this.jsonDoc.json.samplers[X.sampler];if(Y.magFilter!==void 0)Z.setMagFilter(Y.magFilter);if(Y.minFilter!==void 0)Z.setMinFilter(Y.minFilter);if(Y.wrapS!==void 0)Z.setWrapS(Y.wrapS);if(Y.wrapT!==void 0)Z.setWrapT(Y.wrapT)}}var Pc={logger:O5.DEFAULT_INSTANCE,extensions:[],dependencies:{}},Qq1=new Set([a.BUFFER,a.TEXTURE,a.MATERIAL,a.MESH,a.PRIMITIVE,a.NODE,a.SCENE]);class xc{static read(Z,J=Pc){let X=c6({},Pc,J),{json:Y}=Z,$=new C6().setLogger(X.logger);this.validate(Z,X);let Q=new Ac(Z),W=Y.asset,K=$.getRoot().getAsset();if(W.copyright)K.copyright=W.copyright;if(W.extras)K.extras=W.extras;if(Y.extras!==void 0)$.getRoot().setExtras(c6({},Y.extras));let G=Y.extensionsUsed||[],H=Y.extensionsRequired||[];X.extensions.sort((D,C)=>D.EXTENSION_NAME>C.EXTENSION_NAME?1:-1);for(let D of X.extensions)if(G.includes(D.EXTENSION_NAME)){let C=$.createExtension(D).setRequired(H.includes(D.EXTENSION_NAME)),k=C.prereadTypes.filter((T)=>!Qq1.has(T));if(k.length)X.logger.warn(`Preread hooks for some types (${k.join()}), requested by extension ${C.extensionName}, are unsupported. Please file an issue or a PR.`);for(let T of C.readDependencies)C.install(T,X.dependencies[T])}let z=Y.buffers||[];$.getRoot().listExtensionsUsed().filter((D)=>D.prereadTypes.includes(a.BUFFER)).forEach((D)=>D.preread(Q,a.BUFFER)),Q.buffers=z.map((D)=>{let C=$.createBuffer(D.name);if(D.extras)C.setExtras(D.extras);if(D.uri&&D.uri.indexOf("__")!==0)C.setURI(D.uri);return C});let q=Y.bufferViews||[];Q.bufferViewBuffers=q.map((D,C)=>{if(!Q.bufferViews[C]){let k=Z.json.buffers[D.buffer],T=k.uri?Z.resources[k.uri]:Z.resources[fU],x=D.byteOffset||0;Q.bufferViews[C]=n0.toView(T,x,D.byteLength)}return Q.buffers[D.buffer]});let V=Y.accessors||[];Q.accessors=V.map((D)=>{let C=Q.bufferViewBuffers[D.bufferView],k=$.createAccessor(D.name,C).setType(D.type);if(D.extras)k.setExtras(D.extras);if(D.normalized!==void 0)k.setNormalized(D.normalized);if(D.bufferView===void 0)return k;return k.setArray(hU(D,Q)),k});let F=Y.images||[],U=Y.textures||[];$.getRoot().listExtensionsUsed().filter((D)=>D.prereadTypes.includes(a.TEXTURE)).forEach((D)=>D.preread(Q,a.TEXTURE)),Q.textures=F.map((D)=>{let C=$.createTexture(D.name);if(D.extras)C.setExtras(D.extras);if(D.bufferView!==void 0){let k=Y.bufferViews[D.bufferView],T=Z.json.buffers[k.buffer],x=T.uri?Z.resources[T.uri]:Z.resources[fU],S=k.byteOffset||0,h=k.byteLength,I=x.slice(S,S+h);C.setImage(I)}else if(D.uri!==void 0){if(C.setImage(Z.resources[D.uri]),D.uri.indexOf("__")!==0)C.setURI(D.uri)}if(D.mimeType!==void 0)C.setMimeType(D.mimeType);else if(D.uri){let k=zZ.extension(D.uri);C.setMimeType(HZ.extensionToMimeType(k))}return C}),$.getRoot().listExtensionsUsed().filter((D)=>D.prereadTypes.includes(a.MATERIAL)).forEach((D)=>D.preread(Q,a.MATERIAL));let w=Y.materials||[];Q.materials=w.map((D)=>{let C=$.createMaterial(D.name);if(D.extras)C.setExtras(D.extras);if(D.alphaMode!==void 0)C.setAlphaMode(D.alphaMode);if(D.alphaCutoff!==void 0)C.setAlphaCutoff(D.alphaCutoff);if(D.doubleSided!==void 0)C.setDoubleSided(D.doubleSided);let k=D.pbrMetallicRoughness||{};if(k.baseColorFactor!==void 0)C.setBaseColorFactor(k.baseColorFactor);if(D.emissiveFactor!==void 0)C.setEmissiveFactor(D.emissiveFactor);if(k.metallicFactor!==void 0)C.setMetallicFactor(k.metallicFactor);if(k.roughnessFactor!==void 0)C.setRoughnessFactor(k.roughnessFactor);if(k.baseColorTexture!==void 0){let T=k.baseColorTexture,x=Q.textures[U[T.index].source];C.setBaseColorTexture(x),Q.setTextureInfo(C.getBaseColorTextureInfo(),T)}if(D.emissiveTexture!==void 0){let T=D.emissiveTexture,x=Q.textures[U[T.index].source];C.setEmissiveTexture(x),Q.setTextureInfo(C.getEmissiveTextureInfo(),T)}if(D.normalTexture!==void 0){let T=D.normalTexture,x=Q.textures[U[T.index].source];if(C.setNormalTexture(x),Q.setTextureInfo(C.getNormalTextureInfo(),T),D.normalTexture.scale!==void 0)C.setNormalScale(D.normalTexture.scale)}if(D.occlusionTexture!==void 0){let T=D.occlusionTexture,x=Q.textures[U[T.index].source];if(C.setOcclusionTexture(x),Q.setTextureInfo(C.getOcclusionTextureInfo(),T),D.occlusionTexture.strength!==void 0)C.setOcclusionStrength(D.occlusionTexture.strength)}if(k.metallicRoughnessTexture!==void 0){let T=k.metallicRoughnessTexture,x=Q.textures[U[T.index].source];C.setMetallicRoughnessTexture(x),Q.setTextureInfo(C.getMetallicRoughnessTextureInfo(),T)}return C}),$.getRoot().listExtensionsUsed().filter((D)=>D.prereadTypes.includes(a.MESH)).forEach((D)=>D.preread(Q,a.MESH));let L=Y.meshes||[];$.getRoot().listExtensionsUsed().filter((D)=>D.prereadTypes.includes(a.PRIMITIVE)).forEach((D)=>D.preread(Q,a.PRIMITIVE)),Q.meshes=L.map((D)=>{let C=$.createMesh(D.name);if(D.extras)C.setExtras(D.extras);if(D.weights!==void 0)C.setWeights(D.weights);return(D.primitives||[]).forEach((T)=>{let x=$.createPrimitive();if(T.extras)x.setExtras(T.extras);if(T.material!==void 0)x.setMaterial(Q.materials[T.material]);if(T.mode!==void 0)x.setMode(T.mode);for(let[I,v]of Object.entries(T.attributes||{}))x.setAttribute(I,Q.accessors[v]);if(T.indices!==void 0)x.setIndices(Q.accessors[T.indices]);let S=D.extras&&D.extras.targetNames||[];(T.targets||[]).forEach((I,v)=>{let A=S[v]||v.toString(),p=$.createPrimitiveTarget(A);for(let[n,o]of Object.entries(I))p.setAttribute(n,Q.accessors[o]);x.addTarget(p)}),C.addPrimitive(x)}),C});let O=Y.cameras||[];Q.cameras=O.map((D)=>{let C=$.createCamera(D.name).setType(D.type);if(D.extras)C.setExtras(D.extras);if(D.type===eX.Type.PERSPECTIVE){let k=D.perspective;if(C.setYFov(k.yfov),C.setZNear(k.znear),k.zfar!==void 0)C.setZFar(k.zfar);if(k.aspectRatio!==void 0)C.setAspectRatio(k.aspectRatio)}else{let k=D.orthographic;C.setZNear(k.znear).setZFar(k.zfar).setXMag(k.xmag).setYMag(k.ymag)}return C});let N=Y.nodes||[];$.getRoot().listExtensionsUsed().filter((D)=>D.prereadTypes.includes(a.NODE)).forEach((D)=>D.preread(Q,a.NODE)),Q.nodes=N.map((D)=>{let C=$.createNode(D.name);if(D.extras)C.setExtras(D.extras);if(D.translation!==void 0)C.setTranslation(D.translation);if(D.rotation!==void 0)C.setRotation(D.rotation);if(D.scale!==void 0)C.setScale(D.scale);if(D.matrix!==void 0){let k=[0,0,0],T=[0,0,0,1],x=[1,1,1];c0.decompose(D.matrix,k,T,x),C.setTranslation(k),C.setRotation(T),C.setScale(x)}if(D.weights!==void 0)C.setWeights(D.weights);return C});let M=Y.skins||[];Q.skins=M.map((D)=>{let C=$.createSkin(D.name);if(D.extras)C.setExtras(D.extras);if(D.inverseBindMatrices!==void 0)C.setInverseBindMatrices(Q.accessors[D.inverseBindMatrices]);if(D.skeleton!==void 0)C.setSkeleton(Q.nodes[D.skeleton]);for(let k of D.joints)C.addJoint(Q.nodes[k]);return C}),N.map((D,C)=>{let k=Q.nodes[C];if((D.children||[]).forEach((x)=>k.addChild(Q.nodes[x])),D.mesh!==void 0)k.setMesh(Q.meshes[D.mesh]);if(D.camera!==void 0)k.setCamera(Q.cameras[D.camera]);if(D.skin!==void 0)k.setSkin(Q.skins[D.skin])});let j=Y.animations||[];Q.animations=j.map((D)=>{let C=$.createAnimation(D.name);if(D.extras)C.setExtras(D.extras);let T=(D.samplers||[]).map((S)=>{let h=$.createAnimationSampler().setInput(Q.accessors[S.input]).setOutput(Q.accessors[S.output]).setInterpolation(S.interpolation||EQ.Interpolation.LINEAR);if(S.extras)h.setExtras(S.extras);return C.addSampler(h),h});return(D.channels||[]).forEach((S)=>{let h=$.createAnimationChannel().setSampler(T[S.sampler]).setTargetPath(S.target.path);if(S.target.node!==void 0)h.setTargetNode(Q.nodes[S.target.node]);if(S.extras)h.setExtras(S.extras);C.addChannel(h)}),C});let P=Y.scenes||[];if($.getRoot().listExtensionsUsed().filter((D)=>D.prereadTypes.includes(a.SCENE)).forEach((D)=>D.preread(Q,a.SCENE)),Q.scenes=P.map((D)=>{let C=$.createScene(D.name);if(D.extras)C.setExtras(D.extras);return(D.nodes||[]).map((T)=>Q.nodes[T]).forEach((T)=>C.addChild(T)),C}),Y.scene!==void 0)$.getRoot().setDefaultScene(Q.scenes[Y.scene]);return $.getRoot().listExtensionsUsed().forEach((D)=>D.read(Q)),V.forEach((D,C)=>{let k=Q.accessors[C],T=!!D.sparse,x=!D.bufferView&&!k.getArray();if(T||x)k.setSparse(!0).setArray(Kq1(D,Q))}),$}static validate(Z,J){let X=Z.json;if(X.asset.version!=="2.0")throw new Error(`Unsupported glTF version, "${X.asset.version}".`);if(X.extensionsRequired){for(let Y of X.extensionsRequired)if(!J.extensions.find(($)=>$.EXTENSION_NAME===Y))throw new Error(`Missing required extension, "${Y}".`)}if(X.extensionsUsed){for(let Y of X.extensionsUsed)if(!J.extensions.find(($)=>$.EXTENSION_NAME===Y))J.logger.warn(`Missing optional extension, "${Y}".`)}}}function Wq1(Z,J){let X=J.jsonDoc,Y=J.bufferViews[Z.bufferView],$=X.json.bufferViews[Z.bufferView],Q=qJ[Z.componentType],W=v0.getElementSize(Z.type),K=Q.BYTES_PER_ELEMENT,G=Z.byteOffset||0,H=new Q(Z.count*W),z=new DataView(Y.buffer,Y.byteOffset,Y.byteLength),q=$.byteStride;for(let V=0;V<Z.count;V++)for(let F=0;F<W;F++){let U=G+V*q+F*K,w;switch(Z.componentType){case v0.ComponentType.FLOAT:w=z.getFloat32(U,!0);break;case v0.ComponentType.UNSIGNED_INT:w=z.getUint32(U,!0);break;case v0.ComponentType.UNSIGNED_SHORT:w=z.getUint16(U,!0);break;case v0.ComponentType.UNSIGNED_BYTE:w=z.getUint8(U);break;case v0.ComponentType.SHORT:w=z.getInt16(U,!0);break;case v0.ComponentType.BYTE:w=z.getInt8(U);break;default:throw new Error(`Unexpected componentType "${Z.componentType}".`)}H[V*W+F]=w}return H}function hU(Z,J){let X=J.jsonDoc,Y=J.bufferViews[Z.bufferView],$=X.json.bufferViews[Z.bufferView],Q=qJ[Z.componentType],W=v0.getElementSize(Z.type),K=Q.BYTES_PER_ELEMENT,G=W*K;if($.byteStride!==void 0&&$.byteStride!==G)return Wq1(Z,J);let H=Y.byteOffset+(Z.byteOffset||0),z=Z.count*W*K;return new Q(Y.buffer.slice(H,H+z))}function Kq1(Z,J){let X=qJ[Z.componentType],Y=v0.getElementSize(Z.type),$;if(Z.bufferView!==void 0)$=hU(Z,J);else $=new X(Z.count*Y);let Q=Z.sparse;if(!Q)return $;let W=Q.count,K=c6({},Z,Q.indices,{count:W,type:"SCALAR"}),G=c6({},Z,Q.values,{count:W}),H=hU(K,J),z=hU(G,J);for(let q=0;q<K.count;q++)for(let V=0;V<Y;V++)$[H[q]*Y+V]=z[q*Y+V];return $}var JG;(function(Z){Z[Z.ARRAY_BUFFER=34962]="ARRAY_BUFFER",Z[Z.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER"})(JG||(JG={}));class HJ{constructor(Z,J,X){this._doc=void 0,this.jsonDoc=void 0,this.options=void 0,this.accessorIndexMap=new Map,this.animationIndexMap=new Map,this.bufferIndexMap=new Map,this.cameraIndexMap=new Map,this.skinIndexMap=new Map,this.materialIndexMap=new Map,this.meshIndexMap=new Map,this.nodeIndexMap=new Map,this.imageIndexMap=new Map,this.textureDefIndexMap=new Map,this.textureInfoDefMap=new Map,this.samplerDefIndexMap=new Map,this.sceneIndexMap=new Map,this.imageBufferViews=[],this.otherBufferViews=new Map,this.otherBufferViewsIndexMap=new Map,this.extensionData={},this.bufferURIGenerator=void 0,this.imageURIGenerator=void 0,this.logger=void 0,this._accessorUsageMap=new Map,this.accessorUsageGroupedByParent=new Set(["ARRAY_BUFFER"]),this.accessorParents=new Map,this._doc=Z,this.jsonDoc=J,this.options=X;let Y=Z.getRoot(),$=Y.listBuffers().length,Q=Y.listTextures().length;this.bufferURIGenerator=new ND($>1,()=>X.basename||"buffer"),this.imageURIGenerator=new ND(Q>1,(W)=>Gq1(Z,W)||X.basename||"texture"),this.logger=Z.getLogger()}createTextureInfoDef(Z,J){let X={magFilter:J.getMagFilter()||void 0,minFilter:J.getMinFilter()||void 0,wrapS:J.getWrapS(),wrapT:J.getWrapT()},Y=JSON.stringify(X);if(!this.samplerDefIndexMap.has(Y))this.samplerDefIndexMap.set(Y,this.jsonDoc.json.samplers.length),this.jsonDoc.json.samplers.push(X);let $={source:this.imageIndexMap.get(Z),sampler:this.samplerDefIndexMap.get(Y)},Q=JSON.stringify($);if(!this.textureDefIndexMap.has(Q))this.textureDefIndexMap.set(Q,this.jsonDoc.json.textures.length),this.jsonDoc.json.textures.push($);let W={index:this.textureDefIndexMap.get(Q)};if(J.getTexCoord()!==0)W.texCoord=J.getTexCoord();if(Object.keys(J.getExtras()).length>0)W.extras=J.getExtras();return this.textureInfoDefMap.set(J,W),W}createPropertyDef(Z){let J={};if(Z.getName())J.name=Z.getName();if(Object.keys(Z.getExtras()).length>0)J.extras=Z.getExtras();return J}createAccessorDef(Z){let J=this.createPropertyDef(Z);if(J.type=Z.getType(),J.componentType=Z.getComponentType(),J.count=Z.getCount(),this._doc.getGraph().listParentEdges(Z).some((Y)=>Y.getName()==="attributes"&&Y.getAttributes().key==="POSITION"||Y.getName()==="input"))J.max=Z.getMax([]).map(Math.fround),J.min=Z.getMin([]).map(Math.fround);if(Z.getNormalized())J.normalized=Z.getNormalized();return J}createImageData(Z,J,X){if(this.options.format===GZ.GLB)this.imageBufferViews.push(J),Z.bufferView=this.jsonDoc.json.bufferViews.length,this.jsonDoc.json.bufferViews.push({buffer:0,byteOffset:-1,byteLength:J.byteLength});else{let Y=HZ.mimeTypeToExtension(X.getMimeType());Z.uri=this.imageURIGenerator.createURI(X,Y),this.assignResourceURI(Z.uri,J,!1)}}assignResourceURI(Z,J,X){let Y=this.jsonDoc.resources;if(!(Z in Y)){Y[Z]=J;return}if(J===Y[Z]){this.logger.warn(`Duplicate resource URI, "${Z}".`);return}let $=`Resource URI "${Z}" already assigned to different data.`;if(!X){this.logger.warn($);return}throw new Error($)}getAccessorUsage(Z){let J=this._accessorUsageMap.get(Z);if(J)return J;if(Z.getSparse())return c5.SPARSE;for(let X of this._doc.getGraph().listParentEdges(Z)){let{usage:Y}=X.getAttributes();if(Y)return Y;if(X.getParent().propertyType!==a.ROOT)this.logger.warn(`Missing attribute ".usage" on edge, "${X.getName()}".`)}return c5.OTHER}addAccessorToUsageGroup(Z,J){let X=this._accessorUsageMap.get(Z);if(X&&X!==J)throw new Error(`Accessor with usage "${X}" cannot be reused as "${J}".`);return this._accessorUsageMap.set(Z,J),this}}HJ.BufferViewTarget=JG;HJ.BufferViewUsage=c5;HJ.USAGE_TO_TARGET={[c5.ARRAY_BUFFER]:JG.ARRAY_BUFFER,[c5.ELEMENT_ARRAY_BUFFER]:JG.ELEMENT_ARRAY_BUFFER};class ND{constructor(Z,J){this.multiple=void 0,this.basename=void 0,this.counter={},this.multiple=Z,this.basename=J}createURI(Z,J){if(Z.getURI())return Z.getURI();else if(!this.multiple)return`${this.basename(Z)}.${J}`;else{let X=this.basename(Z);return this.counter[X]=this.counter[X]||1,`${X}_${this.counter[X]++}.${J}`}}}function Gq1(Z,J){let X=Z.getGraph().listParentEdges(J).find((Y)=>Y.getParent()!==Z.getRoot());return X?X.getName().replace(/texture$/i,""):""}var{BufferViewUsage:xU}=HJ,{UNSIGNED_INT:Hq1,UNSIGNED_SHORT:zq1,UNSIGNED_BYTE:qq1}=v0.ComponentType,Vq1=new Set([a.ACCESSOR,a.BUFFER,a.MATERIAL,a.MESH]);class hc{static write(Z,J){let X=Z.getGraph(),Y=Z.getRoot(),$={asset:c6({generator:`glTF-Transform ${Tc}`},Y.getAsset()),extras:c6({},Y.getExtras())},Q={json:$,resources:{}},W=new HJ(Z,Q,J),K=J.logger||O5.DEFAULT_INSTANCE,G=new Set(J.extensions.map((L)=>L.EXTENSION_NAME)),H=Z.getRoot().listExtensionsUsed().filter((L)=>G.has(L.extensionName)).sort((L,O)=>L.extensionName>O.extensionName?1:-1),z=Z.getRoot().listExtensionsRequired().filter((L)=>G.has(L.extensionName)).sort((L,O)=>L.extensionName>O.extensionName?1:-1);if(H.length<Z.getRoot().listExtensionsUsed().length)K.warn("Some extensions were not registered for I/O, and will not be written.");for(let L of H){let O=L.prewriteTypes.filter((N)=>!Vq1.has(N));if(O.length)K.warn(`Prewrite hooks for some types (${O.join()}), requested by extension ${L.extensionName}, are unsupported. Please file an issue or a PR.`);for(let N of L.writeDependencies)L.install(N,J.dependencies[N])}function q(L,O,N,M){let j=[],P=0;for(let k of L){let T=W.createAccessorDef(k);T.bufferView=$.bufferViews.length;let x=k.getArray(),S=n0.pad(n0.toView(x));T.byteOffset=P,P+=S.byteLength,j.push(S),W.accessorIndexMap.set(k,$.accessors.length),$.accessors.push(T)}let D=n0.concat(j),C={buffer:O,byteOffset:N,byteLength:D.byteLength};if(M)C.target=M;return $.bufferViews.push(C),{buffers:j,byteLength:P}}function V(L,O,N){let M=L[0].getCount(),j=0;for(let T of L){let x=W.createAccessorDef(T);x.bufferView=$.bufferViews.length,x.byteOffset=j;let S=T.getElementSize(),h=T.getComponentSize();j+=n0.padNumber(S*h),W.accessorIndexMap.set(T,$.accessors.length),$.accessors.push(x)}let P=M*j,D=new ArrayBuffer(P),C=new DataView(D);for(let T=0;T<M;T++){let x=0;for(let S of L){let h=S.getElementSize(),I=S.getComponentSize(),v=S.getComponentType(),A=S.getArray();for(let p=0;p<h;p++){let n=T*j+x+p*I,o=A[T*h+p];switch(v){case v0.ComponentType.FLOAT:C.setFloat32(n,o,!0);break;case v0.ComponentType.BYTE:C.setInt8(n,o);break;case v0.ComponentType.SHORT:C.setInt16(n,o,!0);break;case v0.ComponentType.UNSIGNED_BYTE:C.setUint8(n,o);break;case v0.ComponentType.UNSIGNED_SHORT:C.setUint16(n,o,!0);break;case v0.ComponentType.UNSIGNED_INT:C.setUint32(n,o,!0);break;default:throw new Error("Unexpected component type: "+v)}}x+=n0.padNumber(h*I)}}let k={buffer:O,byteOffset:N,byteLength:P,byteStride:j,target:HJ.BufferViewTarget.ARRAY_BUFFER};return $.bufferViews.push(k),{byteLength:P,buffers:[new Uint8Array(D)]}}function F(L,O,N){let M=[],j=0,P=new Map,D=-1/0,C=!1;for(let v of L){let A=W.createAccessorDef(v);$.accessors.push(A),W.accessorIndexMap.set(v,$.accessors.length-1);let p=[],n=[],o=[],X0=new Array(v.getElementSize()).fill(0);for(let a0=0,I8=v.getCount();a0<I8;a0++){if(v.getElement(a0,o),c0.eq(o,X0,0))continue;D=Math.max(a0,D),p.push(a0);for(let s1=0;s1<o.length;s1++)n.push(o[s1])}let Q0=p.length,E0={accessorDef:A,count:Q0};if(P.set(v,E0),Q0===0)continue;if(Q0>v.getCount()/2)C=!0;let I0=qJ[v.getComponentType()];E0.indices=p,E0.values=new I0(n)}if(!Number.isFinite(D))return{buffers:M,byteLength:j};if(C)K.warn("Some sparse accessors have >50% non-zero elements, which may increase file size.");let k=D<255?Uint8Array:D<65535?Uint16Array:Uint32Array,T=D<255?qq1:D<65535?zq1:Hq1,x={buffer:O,byteOffset:N+j,byteLength:0};for(let v of L){let A=P.get(v);if(A.count===0)continue;A.indicesByteOffset=x.byteLength;let p=n0.pad(n0.toView(new k(A.indices)));M.push(p),j+=p.byteLength,x.byteLength+=p.byteLength}$.bufferViews.push(x);let S=$.bufferViews.length-1,h={buffer:O,byteOffset:N+j,byteLength:0};for(let v of L){let A=P.get(v);if(A.count===0)continue;A.valuesByteOffset=h.byteLength;let p=n0.pad(n0.toView(A.values));M.push(p),j+=p.byteLength,h.byteLength+=p.byteLength}$.bufferViews.push(h);let I=$.bufferViews.length-1;for(let v of L){let A=P.get(v);if(A.count===0)continue;A.accessorDef.sparse={count:A.count,indices:{bufferView:S,byteOffset:A.indicesByteOffset,componentType:T},values:{bufferView:I,byteOffset:A.valuesByteOffset}}}return{buffers:M,byteLength:j}}if($.accessors=[],$.bufferViews=[],$.samplers=[],$.textures=[],$.images=Y.listTextures().map((L,O)=>{let N=W.createPropertyDef(L);if(L.getMimeType())N.mimeType=L.getMimeType();let M=L.getImage();if(M)W.createImageData(N,M,L);return W.imageIndexMap.set(L,O),N}),H.filter((L)=>L.prewriteTypes.includes(a.ACCESSOR)).forEach((L)=>L.prewrite(W,a.ACCESSOR)),Y.listAccessors().forEach((L)=>{let{accessorUsageGroupedByParent:O,accessorParents:N}=W;if(W.accessorIndexMap.has(L))return;let M=W.getAccessorUsage(L);if(W.addAccessorToUsageGroup(L,M),O.has(M)){let j=X.listParents(L).find((P)=>P.propertyType!==a.ROOT);N.set(L,j)}}),H.filter((L)=>L.prewriteTypes.includes(a.BUFFER)).forEach((L)=>L.prewrite(W,a.BUFFER)),(Y.listAccessors().length>0||W.otherBufferViews.size>0||Y.listTextures().length>0&&J.format===GZ.GLB)&&Y.listBuffers().length===0)throw new Error("Buffer required for Document resources, but none was found.");if($.buffers=[],Y.listBuffers().forEach((L,O)=>{let N=W.createPropertyDef(L),M=W.accessorUsageGroupedByParent,j=L.listParents().filter((h)=>h instanceof v0),P=new Set(j.map((h)=>W.accessorParents.get(h))),D=new Map(Array.from(P).map((h,I)=>[h,I])),C={};for(let h of j){var k;if(W.accessorIndexMap.has(h))continue;let I=W.getAccessorUsage(h),v=I;if(M.has(I)){let A=W.accessorParents.get(h);v+=`:${D.get(A)}`}C[k=v]||(C[k]={usage:I,accessors:[]}),C[v].accessors.push(h)}let T=[],x=$.buffers.length,S=0;for(let{usage:h,accessors:I}of Object.values(C))if(h===xU.ARRAY_BUFFER&&J.vertexLayout===bU.INTERLEAVED){let v=V(I,x,S);S+=v.byteLength;for(let A of v.buffers)T.push(A)}else if(h===xU.ARRAY_BUFFER)for(let v of I){let A=V([v],x,S);S+=A.byteLength;for(let p of A.buffers)T.push(p)}else if(h===xU.SPARSE){let v=F(I,x,S);S+=v.byteLength;for(let A of v.buffers)T.push(A)}else if(h===xU.ELEMENT_ARRAY_BUFFER){let v=HJ.BufferViewTarget.ELEMENT_ARRAY_BUFFER,A=q(I,x,S,v);S+=A.byteLength;for(let p of A.buffers)T.push(p)}else{let v=q(I,x,S);S+=v.byteLength;for(let A of v.buffers)T.push(A)}if(W.imageBufferViews.length&&O===0){for(let h=0;h<W.imageBufferViews.length;h++)if($.bufferViews[$.images[h].bufferView].byteOffset=S,S+=W.imageBufferViews[h].byteLength,T.push(W.imageBufferViews[h]),S%8){let I=8-S%8;S+=I,T.push(new Uint8Array(I))}}if(W.otherBufferViews.has(L))for(let h of W.otherBufferViews.get(L))$.bufferViews.push({buffer:x,byteOffset:S,byteLength:h.byteLength}),W.otherBufferViewsIndexMap.set(h,$.bufferViews.length-1),S+=h.byteLength,T.push(h);if(S){let h;if(J.format===GZ.GLB)h=fU;else h=W.bufferURIGenerator.createURI(L,"bin"),N.uri=h;N.byteLength=S,W.assignResourceURI(h,n0.concat(T),!0)}$.buffers.push(N),W.bufferIndexMap.set(L,O)}),Y.listAccessors().find((L)=>!L.getBuffer()))K.warn("Skipped writing one or more Accessors: no Buffer assigned.");H.filter((L)=>L.prewriteTypes.includes(a.MATERIAL)).forEach((L)=>L.prewrite(W,a.MATERIAL)),$.materials=Y.listMaterials().map((L,O)=>{let N=W.createPropertyDef(L);if(L.getAlphaMode()!==J7.AlphaMode.OPAQUE)N.alphaMode=L.getAlphaMode();if(L.getAlphaMode()===J7.AlphaMode.MASK)N.alphaCutoff=L.getAlphaCutoff();if(L.getDoubleSided())N.doubleSided=!0;if(N.pbrMetallicRoughness={},!c0.eq(L.getBaseColorFactor(),[1,1,1,1]))N.pbrMetallicRoughness.baseColorFactor=L.getBaseColorFactor();if(!c0.eq(L.getEmissiveFactor(),[0,0,0]))N.emissiveFactor=L.getEmissiveFactor();if(L.getRoughnessFactor()!==1)N.pbrMetallicRoughness.roughnessFactor=L.getRoughnessFactor();if(L.getMetallicFactor()!==1)N.pbrMetallicRoughness.metallicFactor=L.getMetallicFactor();if(L.getBaseColorTexture()){let M=L.getBaseColorTexture(),j=L.getBaseColorTextureInfo();N.pbrMetallicRoughness.baseColorTexture=W.createTextureInfoDef(M,j)}if(L.getEmissiveTexture()){let M=L.getEmissiveTexture(),j=L.getEmissiveTextureInfo();N.emissiveTexture=W.createTextureInfoDef(M,j)}if(L.getNormalTexture()){let M=L.getNormalTexture(),j=L.getNormalTextureInfo(),P=W.createTextureInfoDef(M,j);if(L.getNormalScale()!==1)P.scale=L.getNormalScale();N.normalTexture=P}if(L.getOcclusionTexture()){let M=L.getOcclusionTexture(),j=L.getOcclusionTextureInfo(),P=W.createTextureInfoDef(M,j);if(L.getOcclusionStrength()!==1)P.strength=L.getOcclusionStrength();N.occlusionTexture=P}if(L.getMetallicRoughnessTexture()){let M=L.getMetallicRoughnessTexture(),j=L.getMetallicRoughnessTextureInfo();N.pbrMetallicRoughness.metallicRoughnessTexture=W.createTextureInfoDef(M,j)}return W.materialIndexMap.set(L,O),N}),H.filter((L)=>L.prewriteTypes.includes(a.MESH)).forEach((L)=>L.prewrite(W,a.MESH)),$.meshes=Y.listMeshes().map((L,O)=>{let N=W.createPropertyDef(L),M=null;if(N.primitives=L.listPrimitives().map((j)=>{let P={attributes:{}};P.mode=j.getMode();let D=j.getMaterial();if(D)P.material=W.materialIndexMap.get(D);if(Object.keys(j.getExtras()).length)P.extras=j.getExtras();let C=j.getIndices();if(C)P.indices=W.accessorIndexMap.get(C);for(let k of j.listSemantics())P.attributes[k]=W.accessorIndexMap.get(j.getAttribute(k));for(let k of j.listTargets()){let T={};for(let x of k.listSemantics())T[x]=W.accessorIndexMap.get(k.getAttribute(x));P.targets=P.targets||[],P.targets.push(T)}if(j.listTargets().length&&!M)M=j.listTargets().map((k)=>k.getName());return P}),L.getWeights().length)N.weights=L.getWeights();if(M)N.extras=N.extras||{},N.extras.targetNames=M;return W.meshIndexMap.set(L,O),N}),$.cameras=Y.listCameras().map((L,O)=>{let N=W.createPropertyDef(L);if(N.type=L.getType(),N.type===eX.Type.PERSPECTIVE){N.perspective={znear:L.getZNear(),zfar:L.getZFar(),yfov:L.getYFov()};let M=L.getAspectRatio();if(M!==null)N.perspective.aspectRatio=M}else N.orthographic={znear:L.getZNear(),zfar:L.getZFar(),xmag:L.getXMag(),ymag:L.getYMag()};return W.cameraIndexMap.set(L,O),N}),$.nodes=Y.listNodes().map((L,O)=>{let N=W.createPropertyDef(L);if(!c0.eq(L.getTranslation(),[0,0,0]))N.translation=L.getTranslation();if(!c0.eq(L.getRotation(),[0,0,0,1]))N.rotation=L.getRotation();if(!c0.eq(L.getScale(),[1,1,1]))N.scale=L.getScale();if(L.getWeights().length)N.weights=L.getWeights();return W.nodeIndexMap.set(L,O),N}),$.skins=Y.listSkins().map((L,O)=>{let N=W.createPropertyDef(L),M=L.getInverseBindMatrices();if(M)N.inverseBindMatrices=W.accessorIndexMap.get(M);let j=L.getSkeleton();if(j)N.skeleton=W.nodeIndexMap.get(j);return N.joints=L.listJoints().map((P)=>W.nodeIndexMap.get(P)),W.skinIndexMap.set(L,O),N}),Y.listNodes().forEach((L,O)=>{let N=$.nodes[O],M=L.getMesh();if(M)N.mesh=W.meshIndexMap.get(M);let j=L.getCamera();if(j)N.camera=W.cameraIndexMap.get(j);let P=L.getSkin();if(P)N.skin=W.skinIndexMap.get(P);if(L.listChildren().length>0)N.children=L.listChildren().map((D)=>W.nodeIndexMap.get(D))}),$.animations=Y.listAnimations().map((L,O)=>{let N=W.createPropertyDef(L),M=new Map;return N.samplers=L.listSamplers().map((j,P)=>{let D=W.createPropertyDef(j);return D.input=W.accessorIndexMap.get(j.getInput()),D.output=W.accessorIndexMap.get(j.getOutput()),D.interpolation=j.getInterpolation(),M.set(j,P),D}),N.channels=L.listChannels().map((j)=>{let P=W.createPropertyDef(j);return P.sampler=M.get(j.getSampler()),P.target={node:W.nodeIndexMap.get(j.getTargetNode()),path:j.getTargetPath()},P}),W.animationIndexMap.set(L,O),N}),$.scenes=Y.listScenes().map((L,O)=>{let N=W.createPropertyDef(L);return N.nodes=L.listChildren().map((M)=>W.nodeIndexMap.get(M)),W.sceneIndexMap.set(L,O),N});let w=Y.getDefaultScene();if(w)$.scene=Y.listScenes().indexOf(w);return $.extensionsUsed=H.map((L)=>L.extensionName),$.extensionsRequired=z.map((L)=>L.extensionName),H.forEach((L)=>L.write(W)),Fq1($),Q}}function Fq1(Z){let J=[];for(let X in Z){let Y=Z[X];if(Array.isArray(Y)&&Y.length===0)J.push(X);else if(Y===null||Y==="")J.push(X);else if(Y&&typeof Y==="object"&&Object.keys(Y).length===0)J.push(X)}for(let X of J)delete Z[X]}var mU;(function(Z){Z[Z.JSON=1313821514]="JSON",Z[Z.BIN=5130562]="BIN"})(mU||(mU={}));class fc{constructor(){this._logger=O5.DEFAULT_INSTANCE,this._extensions=new Set,this._dependencies={},this._vertexLayout=bU.INTERLEAVED,this.lastReadBytes=0,this.lastWriteBytes=0}setLogger(Z){return this._logger=Z,this}registerExtensions(Z){for(let J of Z)this._extensions.add(J),J.register();return this}registerDependencies(Z){return Object.assign(this._dependencies,Z),this}setVertexLayout(Z){return this._vertexLayout=Z,this}async read(Z){return await this.readJSON(await this.readAsJSON(Z))}async readAsJSON(Z){let J=await this.readURI(Z,"view");this.lastReadBytes=J.byteLength;let X=Cc(J)?this._binaryToJSON(J):{json:JSON.parse(n0.decodeText(J)),resources:{}};return await this._readResourcesExternal(X,this.dirname(Z)),this._readResourcesInternal(X),X}async readJSON(Z){return Z=this._copyJSON(Z),this._readResourcesInternal(Z),xc.read(Z,{extensions:Array.from(this._extensions),dependencies:this._dependencies,logger:this._logger})}async binaryToJSON(Z){let J=this._binaryToJSON(n0.assertView(Z));this._readResourcesInternal(J);let X=J.json;if(X.buffers&&X.buffers.some((Y)=>Uq1(J,Y)))throw new Error("Cannot resolve external buffers with binaryToJSON().");else if(X.images&&X.images.some((Y)=>Lq1(J,Y)))throw new Error("Cannot resolve external images with binaryToJSON().");return J}async readBinary(Z){return this.readJSON(await this.binaryToJSON(n0.assertView(Z)))}async writeJSON(Z,J={}){if(J.format===GZ.GLB&&Z.getRoot().listBuffers().length>1)throw new Error("GLB must have 0\u20131 buffers.");return hc.write(Z,{format:J.format||GZ.GLTF,basename:J.basename||"",logger:this._logger,vertexLayout:this._vertexLayout,dependencies:c6({},this._dependencies),extensions:Array.from(this._extensions)})}async writeBinary(Z){let{json:J,resources:X}=await this.writeJSON(Z,{format:GZ.GLB}),Y=new Uint32Array([1179937895,2,12]),$=JSON.stringify(J),Q=n0.pad(n0.encodeText($),32),W=n0.toView(new Uint32Array([Q.byteLength,1313821514])),K=n0.concat([W,Q]);Y[Y.length-1]+=K.byteLength;let G=Object.values(X)[0];if(!G||!G.byteLength)return n0.concat([n0.toView(Y),K]);let H=n0.pad(G,0),z=n0.toView(new Uint32Array([H.byteLength,5130562])),q=n0.concat([z,H]);return Y[Y.length-1]+=q.byteLength,n0.concat([n0.toView(Y),K,q])}async _readResourcesExternal(Z,J){var X=this;let Y=Z.json.images||[],$=Z.json.buffers||[],Q=[...Y,...$].map(async function(W){let K=W.uri;if(!K||K.match(/data:/))return Promise.resolve();Z.resources[K]=await X.readURI(X.resolve(J,K),"view"),X.lastReadBytes+=Z.resources[K].byteLength});await Promise.all(Q)}_readResourcesInternal(Z){function J($){if(!$.uri)return;if($.uri in Z.resources){n0.assertView(Z.resources[$.uri]);return}if($.uri.match(/data:/)){let Q=`__${Sc()}.${zZ.extension($.uri)}`;Z.resources[Q]=n0.createBufferFromDataURI($.uri),$.uri=Q}}(Z.json.images||[]).forEach(($)=>{if($.bufferView===void 0&&$.uri===void 0)throw new Error("Missing resource URI or buffer view.");J($)}),(Z.json.buffers||[]).forEach(J)}_copyJSON(Z){let{images:J,buffers:X}=Z.json;if(Z={json:c6({},Z.json),resources:c6({},Z.resources)},J)Z.json.images=J.map((Y)=>c6({},Y));if(X)Z.json.buffers=X.map((Y)=>c6({},Y));return Z}_binaryToJSON(Z){if(!Cc(Z))throw new Error("Invalid glTF 2.0 binary.");let J=new Uint32Array(Z.buffer,Z.byteOffset+12,2);if(J[1]!==mU.JSON)throw new Error("Missing required GLB JSON chunk.");let X=20,Y=J[0],$=n0.decodeText(n0.toView(Z,X,Y)),Q=JSON.parse($),W=X+Y;if(Z.byteLength<=W)return{json:Q,resources:{}};let K=new Uint32Array(Z.buffer,Z.byteOffset+W,2);if(K[1]!==mU.BIN)return{json:Q,resources:{}};let G=K[0],H=n0.toView(Z,W+8,G);return{json:Q,resources:{[fU]:H}}}}function Uq1(Z,J){return J.uri!==void 0&&!(J.uri in Z.resources)}function Lq1(Z,J){return J.uri!==void 0&&!(J.uri in Z.resources)&&J.bufferView===void 0}function Cc(Z){if(Z.byteLength<3*Uint32Array.BYTES_PER_ELEMENT)return!1;let J=new Uint32Array(Z.buffer,Z.byteOffset,3);return J[0]===1179937895&&J[1]===2}class ID extends fc{constructor(Z=null,J=R9.DEFAULT_INIT){super();this._fetch=void 0,this._fetchConfig=void 0,this._init=void 0,this._fetchEnabled=!1,this._fetch=Z,this._fetchConfig=J,this._init=this.init()}async init(){if(this._init)return this._init;return Promise.all([import("fs"),import("path")]).then(([Z,J])=>{this._fs=Z.promises,this._path=J})}setAllowNetwork(Z){if(Z&&!this._fetch)throw new Error("NodeIO requires a Fetch API implementation for HTTP requests.");return this._fetchEnabled=Z,this}async readURI(Z,J){if(await this.init(),R9.isAbsoluteURL(Z)){if(!this._fetchEnabled||!this._fetch)throw new Error("Network request blocked. Allow HTTP requests explicitly, if needed.");let X=await this._fetch(Z,this._fetchConfig);switch(J){case"view":return new Uint8Array(await X.arrayBuffer());case"text":return X.text()}}else switch(J){case"view":return this._fs.readFile(Z);case"text":return this._fs.readFile(Z,"utf8")}}resolve(Z,J){if(R9.isAbsoluteURL(Z)||R9.isAbsoluteURL(J))return R9.resolve(Z,J);return this._path.resolve(Z,decodeURIComponent(J))}dirname(Z){if(R9.isAbsoluteURL(Z))return R9.dirname(Z);return this._path.dirname(Z)}async write(Z,J){await this.init(),await(!!Z.match(/\.glb$/)?this._writeGLB(Z,J):this._writeGLTF(Z,J))}async _writeGLTF(Z,J){var X=this;this.lastWriteBytes=0;let{json:Y,resources:$}=await this.writeJSON(J,{format:GZ.GLTF,basename:zZ.basename(Z)}),{_fs:Q,_path:W}=this,K=W.dirname(Z),G=JSON.stringify(Y,null,2);await Q.writeFile(Z,G),this.lastWriteBytes+=G.length;for(let H of wq1(Object.keys($),10))await Promise.all(H.map(async function(z){if(R9.isAbsoluteURL(z)){if(R9.extension(z)==="bin")throw new Error(`Cannot write buffer to path "${z}".`);return}let q=W.join(K,decodeURIComponent(z));await Q.mkdir(W.dirname(q),{recursive:!0}),await Q.writeFile(q,$[z]),X.lastWriteBytes+=$[z].byteLength}))}async _writeGLB(Z,J){let X=await this.writeBinary(J);await this._fs.writeFile(Z,X),this.lastWriteBytes=X.byteLength}}function wq1(Z,J){let X=[];for(let Y=0,$=Z.length;Y<$;Y+=J){let Q=[];for(let W=0;W<J&&Y+W<$;W++)Q.push(Z[Y+W]);X.push(Q)}return X}var _i=t(vD(),1),Ai=t(Li(),1),KL1=t(Si(),1);async function GL1(Z,J){if(!(Z instanceof Uint8Array))throw new Error("[ndarray-pixels] Input must be Uint8Array or Buffer.");let{data:X,info:Y}=await Ai.default(Z).ensureAlpha().raw().toBuffer({resolveWithObject:!0});return _i.default(new Uint8Array(X),[Y.width,Y.height,4],[4,4*Y.width|0,1],0)}async function xi(Z,J){return GL1(Z)}var HL1="v4.1.3",GP="@glb.bin",s;(function(Z){Z.ACCESSOR="Accessor",Z.ANIMATION="Animation",Z.ANIMATION_CHANNEL="AnimationChannel",Z.ANIMATION_SAMPLER="AnimationSampler",Z.BUFFER="Buffer",Z.CAMERA="Camera",Z.MATERIAL="Material",Z.MESH="Mesh",Z.PRIMITIVE="Primitive",Z.PRIMITIVE_TARGET="PrimitiveTarget",Z.NODE="Node",Z.ROOT="Root",Z.SCENE="Scene",Z.SKIN="Skin",Z.TEXTURE="Texture",Z.TEXTURE_INFO="TextureInfo"})(s||(s={}));var hi;(function(Z){Z.INTERLEAVED="interleaved",Z.SEPARATE="separate"})(hi||(hi={}));var i5;(function(Z){Z.ARRAY_BUFFER="ARRAY_BUFFER",Z.ELEMENT_ARRAY_BUFFER="ELEMENT_ARRAY_BUFFER",Z.INVERSE_BIND_MATRICES="INVERSE_BIND_MATRICES",Z.OTHER="OTHER",Z.SPARSE="SPARSE"})(i5||(i5={}));var n5;(function(Z){Z[Z.R=4096]="R",Z[Z.G=256]="G",Z[Z.B=16]="B",Z[Z.A=1]="A"})(n5||(n5={}));var XP;(function(Z){Z.GLTF="GLTF",Z.GLB="GLB"})(XP||(XP={}));var YP=typeof Float32Array!=="undefined"?Float32Array:Array;if(!Math.hypot)Math.hypot=function(){var Z=0,J=arguments.length;while(J--)Z+=arguments[J]*arguments[J];return Math.sqrt(Z)};function zL1(){var Z=new YP(3);if(YP!=Float32Array)Z[0]=0,Z[1]=0,Z[2]=0;return Z}function JP(Z){var J=Z[0],X=Z[1],Y=Z[2];return Math.hypot(J,X,Y)}function qL1(Z,J,X){var Y=J[0],$=J[1],Q=J[2],W=X[3]*Y+X[7]*$+X[11]*Q+X[15];return W=W||1,Z[0]=(X[0]*Y+X[4]*$+X[8]*Q+X[12])/W,Z[1]=(X[1]*Y+X[5]*$+X[9]*Q+X[13])/W,Z[2]=(X[2]*Y+X[6]*$+X[10]*Q+X[14])/W,Z}(function(){var Z=zL1();return function(J,X,Y,$,Q,W){var K,G;if(!X)X=3;if(!Y)Y=0;if($)G=Math.min($*X+Y,J.length);else G=J.length;for(K=Y;K<G;K+=X)Z[0]=J[K],Z[1]=J[K+1],Z[2]=J[K+2],Q(Z,Z,W),J[K]=Z[0],J[K+1]=Z[1],J[K+2]=Z[2];return J}})();function gi(Z){let J=mi(),X=Z.propertyType===s.NODE?[Z]:Z.listChildren();for(let Y of X)Y.traverse(($)=>{let Q=$.getMesh();if(!Q)return;let W=VL1(Q,$.getWorldMatrix());if(W.min.every(isFinite)&&W.max.every(isFinite))$P(W.min,J),$P(W.max,J)});return J}function VL1(Z,J){let X=mi();for(let Y of Z.listPrimitives()){let $=Y.getAttribute("POSITION"),Q=Y.getIndices();if(!$)continue;let W=[0,0,0],K=[0,0,0];for(let G=0,H=Q?Q.getCount():$.getCount();G<H;G++){let z=Q?Q.getScalar(G):G;W=$.getElement(z,W),K=qL1(K,W,J),$P(K,X)}}return X}function $P(Z,J){for(let X=0;X<3;X++)J.min[X]=Math.min(Z[X],J.min[X]),J.max[X]=Math.max(Z[X],J.max[X])}function mi(){return{min:[1/0,1/0,1/0],max:[-1/0,-1/0,-1/0]}}class k6{static createBufferFromDataURI(Z){if(typeof Buffer==="undefined"){let J=atob(Z.split(",")[1]),X=new Uint8Array(J.length);for(let Y=0;Y<J.length;Y++)X[Y]=J.charCodeAt(Y);return X}else{let J=Z.split(",")[1],X=Z.indexOf("base64")>=0;return Buffer.from(J,X?"base64":"utf8")}}static encodeText(Z){return new TextEncoder().encode(Z)}static decodeText(Z){return new TextDecoder().decode(Z)}static concat(Z){let J=0;for(let $ of Z)J+=$.byteLength;let X=new Uint8Array(J),Y=0;for(let $ of Z)X.set($,Y),Y+=$.byteLength;return X}static pad(Z,J=0){let X=this.padNumber(Z.byteLength);if(X===Z.byteLength)return Z;let Y=new Uint8Array(X);if(Y.set(Z),J!==0)for(let $=Z.byteLength;$<X;$++)Y[$]=J;return Y}static padNumber(Z){return Math.ceil(Z/4)*4}static equals(Z,J){if(Z===J)return!0;if(Z.byteLength!==J.byteLength)return!1;let X=Z.byteLength;while(X--)if(Z[X]!==J[X])return!1;return!0}static toView(Z,J=0,X=1/0){return new Uint8Array(Z.buffer,Z.byteOffset+J,Math.min(Z.byteLength,X))}static assertView(Z){if(Z&&!ArrayBuffer.isView(Z))throw new Error(`Method requires Uint8Array parameter; received "${typeof Z}".`);return Z}}class ui{match(Z){return Z.length>=3&&Z[0]===255&&Z[1]===216&&Z[2]===255}getSize(Z){let J=new DataView(Z.buffer,Z.byteOffset+4),X,Y;while(J.byteLength){if(X=J.getUint16(0,!1),FL1(J,X),Y=J.getUint8(X+1),Y===192||Y===193||Y===194)return[J.getUint16(X+7,!1),J.getUint16(X+5,!1)];J=new DataView(Z.buffer,J.byteOffset+X+2)}throw new TypeError("Invalid JPG, no size found")}getChannels(Z){return 3}}class O2{match(Z){return Z.length>=8&&Z[0]===137&&Z[1]===80&&Z[2]===78&&Z[3]===71&&Z[4]===13&&Z[5]===10&&Z[6]===26&&Z[7]===10}getSize(Z){let J=new DataView(Z.buffer,Z.byteOffset);if(k6.decodeText(Z.slice(12,16))===O2.PNG_FRIED_CHUNK_NAME)return[J.getUint32(32,!1),J.getUint32(36,!1)];return[J.getUint32(16,!1),J.getUint32(20,!1)]}getChannels(Z){return 4}}O2.PNG_FRIED_CHUNK_NAME="CgBI";class V4{static registerFormat(Z,J){this.impls[Z]=J}static getMimeType(Z){for(let J in this.impls)if(this.impls[J].match(Z))return J;return null}static getSize(Z,J){if(!this.impls[J])return null;return this.impls[J].getSize(Z)}static getChannels(Z,J){if(!this.impls[J])return null;return this.impls[J].getChannels(Z)}static getVRAMByteLength(Z,J){if(!this.impls[J])return null;if(this.impls[J].getVRAMByteLength)return this.impls[J].getVRAMByteLength(Z);let X=0,Y=4,$=this.getSize(Z,J);if(!$)return null;while($[0]>1||$[1]>1)X+=$[0]*$[1]*Y,$[0]=Math.max(Math.floor($[0]/2),1),$[1]=Math.max(Math.floor($[1]/2),1);return X+=1*Y,X}static mimeTypeToExtension(Z){if(Z==="image/jpeg")return"jpg";return Z.split("/").pop()}static extensionToMimeType(Z){if(Z==="jpg")return"image/jpeg";if(!Z)return"";return`image/${Z}`}}V4.impls={"image/jpeg":new ui,"image/png":new O2};function FL1(Z,J){if(J>Z.byteLength)throw new TypeError("Corrupt JPG, exceeded buffer limits");if(Z.getUint8(J)!==255)throw new TypeError("Invalid JPG, marker table corrupted");return Z}class VG{static basename(Z){let J=Z.split(/[\\/]/).pop();return J.substring(0,J.lastIndexOf("."))}static extension(Z){if(Z.startsWith("data:image/")){let J=Z.match(/data:(image\/\w+)/)[1];return V4.mimeTypeToExtension(J)}else if(Z.startsWith("data:model/gltf+json"))return"gltf";else if(Z.startsWith("data:model/gltf-binary"))return"glb";else if(Z.startsWith("data:application/"))return"bin";return Z.split(/[\\/]/).pop().split(/[.]/).pop()}}function fi(Z){return Object.prototype.toString.call(Z)==="[object Object]"}function QY(Z){if(fi(Z)===!1)return!1;let J=Z.constructor;if(J===void 0)return!0;let X=J.prototype;if(fi(X)===!1)return!1;if(Object.prototype.hasOwnProperty.call(X,"isPrototypeOf")===!1)return!1;return!0}var QP,WP;(function(Z){Z[Z.SILENT=4]="SILENT",Z[Z.ERROR=3]="ERROR",Z[Z.WARN=2]="WARN",Z[Z.INFO=1]="INFO",Z[Z.DEBUG=0]="DEBUG"})(WP||(WP={}));class K7{constructor(Z){this.verbosity=void 0,this.verbosity=Z}debug(Z){if(this.verbosity<=K7.Verbosity.DEBUG)console.debug(Z)}info(Z){if(this.verbosity<=K7.Verbosity.INFO)console.info(Z)}warn(Z){if(this.verbosity<=K7.Verbosity.WARN)console.warn(Z)}error(Z){if(this.verbosity<=K7.Verbosity.ERROR)console.error(Z)}}QP=K7;K7.Verbosity=WP;K7.DEFAULT_INSTANCE=new QP(QP.Verbosity.INFO);function UL1(Z){var J=Z[0],X=Z[1],Y=Z[2],$=Z[3],Q=Z[4],W=Z[5],K=Z[6],G=Z[7],H=Z[8],z=Z[9],q=Z[10],V=Z[11],F=Z[12],U=Z[13],w=Z[14],L=Z[15],O=J*W-X*Q,N=J*K-Y*Q,M=J*G-$*Q,j=X*K-Y*W,P=X*G-$*W,D=Y*G-$*K,C=H*U-z*F,k=H*w-q*F,T=H*L-V*F,x=z*w-q*U,S=z*L-V*U,h=q*L-V*w;return O*h-N*S+M*x+j*T-P*k+D*C}function LL1(Z,J,X){var Y=J[0],$=J[1],Q=J[2],W=J[3],K=J[4],G=J[5],H=J[6],z=J[7],q=J[8],V=J[9],F=J[10],U=J[11],w=J[12],L=J[13],O=J[14],N=J[15],M=X[0],j=X[1],P=X[2],D=X[3];return Z[0]=M*Y+j*K+P*q+D*w,Z[1]=M*$+j*G+P*V+D*L,Z[2]=M*Q+j*H+P*F+D*O,Z[3]=M*W+j*z+P*U+D*N,M=X[4],j=X[5],P=X[6],D=X[7],Z[4]=M*Y+j*K+P*q+D*w,Z[5]=M*$+j*G+P*V+D*L,Z[6]=M*Q+j*H+P*F+D*O,Z[7]=M*W+j*z+P*U+D*N,M=X[8],j=X[9],P=X[10],D=X[11],Z[8]=M*Y+j*K+P*q+D*w,Z[9]=M*$+j*G+P*V+D*L,Z[10]=M*Q+j*H+P*F+D*O,Z[11]=M*W+j*z+P*U+D*N,M=X[12],j=X[13],P=X[14],D=X[15],Z[12]=M*Y+j*K+P*q+D*w,Z[13]=M*$+j*G+P*V+D*L,Z[14]=M*Q+j*H+P*F+D*O,Z[15]=M*W+j*z+P*U+D*N,Z}function wL1(Z,J){var X=J[0],Y=J[1],$=J[2],Q=J[4],W=J[5],K=J[6],G=J[8],H=J[9],z=J[10];return Z[0]=Math.hypot(X,Y,$),Z[1]=Math.hypot(Q,W,K),Z[2]=Math.hypot(G,H,z),Z}function BL1(Z,J){var X=new YP(3);wL1(X,J);var Y=1/X[0],$=1/X[1],Q=1/X[2],W=J[0]*Y,K=J[1]*$,G=J[2]*Q,H=J[4]*Y,z=J[5]*$,q=J[6]*Q,V=J[8]*Y,F=J[9]*$,U=J[10]*Q,w=W+z+U,L=0;if(w>0)L=Math.sqrt(w+1)*2,Z[3]=0.25*L,Z[0]=(q-F)/L,Z[1]=(V-G)/L,Z[2]=(K-H)/L;else if(W>z&&W>U)L=Math.sqrt(1+W-z-U)*2,Z[3]=(q-F)/L,Z[0]=0.25*L,Z[1]=(K+H)/L,Z[2]=(V+G)/L;else if(z>U)L=Math.sqrt(1+z-W-U)*2,Z[3]=(V-G)/L,Z[0]=(K+H)/L,Z[1]=0.25*L,Z[2]=(q+F)/L;else L=Math.sqrt(1+U-W-z)*2,Z[3]=(K-H)/L,Z[0]=(V+G)/L,Z[1]=(q+F)/L,Z[2]=0.25*L;return Z}class K8{static identity(Z){return Z}static eq(Z,J,X=0.00001){if(Z.length!==J.length)return!1;for(let Y=0;Y<Z.length;Y++)if(Math.abs(Z[Y]-J[Y])>X)return!1;return!0}static clamp(Z,J,X){if(Z<J)return J;if(Z>X)return X;return Z}static decodeNormalizedInt(Z,J){switch(J){case 5126:return Z;case 5123:return Z/65535;case 5121:return Z/255;case 5122:return Math.max(Z/32767,-1);case 5120:return Math.max(Z/127,-1);default:throw new Error("Invalid component type.")}}static encodeNormalizedInt(Z,J){switch(J){case 5126:return Z;case 5123:return Math.round(K8.clamp(Z,0,1)*65535);case 5121:return Math.round(K8.clamp(Z,0,1)*255);case 5122:return Math.round(K8.clamp(Z,-1,1)*32767);case 5120:return Math.round(K8.clamp(Z,-1,1)*127);default:throw new Error("Invalid component type.")}}static decompose(Z,J,X,Y){let $=JP([Z[0],Z[1],Z[2]]),Q=JP([Z[4],Z[5],Z[6]]),W=JP([Z[8],Z[9],Z[10]]);if(UL1(Z)<0)$=-$;J[0]=Z[12],J[1]=Z[13],J[2]=Z[14];let G=Z.slice(),H=1/$,z=1/Q,q=1/W;G[0]*=H,G[1]*=H,G[2]*=H,G[4]*=z,G[5]*=z,G[6]*=z,G[8]*=q,G[9]*=q,G[10]*=q,BL1(X,G),Y[0]=$,Y[1]=Q,Y[2]=W}static compose(Z,J,X,Y){let $=Y,Q=J[0],W=J[1],K=J[2],G=J[3],H=Q+Q,z=W+W,q=K+K,V=Q*H,F=Q*z,U=Q*q,w=W*z,L=W*q,O=K*q,N=G*H,M=G*z,j=G*q,P=X[0],D=X[1],C=X[2];return $[0]=(1-(w+O))*P,$[1]=(F+j)*P,$[2]=(U-M)*P,$[3]=0,$[4]=(F-j)*D,$[5]=(1-(V+O))*D,$[6]=(L+N)*D,$[7]=0,$[8]=(U+M)*C,$[9]=(L-N)*C,$[10]=(1-(V+w))*C,$[11]=0,$[12]=Z[0],$[13]=Z[1],$[14]=Z[2],$[15]=1,$}}function OL1(Z,J){if(!!Z!==!!J)return!1;let X=Z.getChild(),Y=J.getChild();return X===Y||X.equals(Y)}function jL1(Z,J){if(!!Z!==!!J)return!1;let X=Z.values(),Y=J.values();if(X.length!==Y.length)return!1;for(let $=0;$<X.length;$++){let Q=X[$],W=Y[$];if(Q.getChild()===W.getChild())continue;if(!Q.getChild().equals(W.getChild()))return!1}return!0}function ML1(Z,J){if(!!Z!==!!J)return!1;let X=Z.keys(),Y=J.keys();if(X.length!==Y.length)return!1;for(let $ of X){let Q=Z.get($),W=J.get($);if(!!Q!==!!W)return!1;let K=Q.getChild(),G=W.getChild();if(K===G)continue;if(!K.equals(G))return!1}return!0}function di(Z,J){if(Z===J)return!0;if(!!Z!==!!J||!Z||!J)return!1;if(Z.length!==J.length)return!1;for(let X=0;X<Z.length;X++)if(Z[X]!==J[X])return!1;return!0}function ci(Z,J){if(Z===J)return!0;if(!!Z!==!!J)return!1;if(!QY(Z)||!QY(J))return Z===J;let X=Z,Y=J,$=0,Q=0,W;for(W in X)$++;for(W in Y)Q++;if($!==Q)return!1;for(W in X){let K=X[W],G=Y[W];if(L2(K)&&L2(G)){if(!di(K,G))return!1}else if(QY(K)&&QY(G)){if(!ci(K,G))return!1}else if(K!==G)return!1}return!0}function L2(Z){return Array.isArray(Z)||ArrayBuffer.isView(Z)}var bi="https://null.example";class HP{static dirname(Z){let J=Z.lastIndexOf("/");if(J===-1)return"./";return Z.substring(0,J+1)}static basename(Z){return VG.basename(new URL(Z,bi).pathname)}static extension(Z){return VG.extension(new URL(Z,bi).pathname)}static resolve(Z,J){if(!this.isRelativePath(J))return J;let X=Z.split("/"),Y=J.split("/");X.pop();for(let $=0;$<Y.length;$++){if(Y[$]===".")continue;if(Y[$]==="..")X.pop();else X.push(Y[$])}return X.join("/")}static isAbsoluteURL(Z){return this.PROTOCOL_REGEXP.test(Z)}static isRelativePath(Z){return!/^(?:[a-zA-Z]+:)?\//.test(Z)}}HP.DEFAULT_INIT={};HP.PROTOCOL_REGEXP=/^[a-zA-Z]+:\/\//;var BJ=(Z)=>Z,RL1=new Set;class j2 extends kQ{constructor(Z,J=""){super(Z);this[h0].name=J,this.init(),this.dispatchEvent({type:"create"})}getGraph(){return this.graph}getDefaults(){return Object.assign(super.getDefaults(),{name:"",extras:{}})}set(Z,J){if(Array.isArray(J))J=J.slice();return super.set(Z,J)}getName(){return this.get("name")}setName(Z){return this.set("name",Z)}getExtras(){return this.get("extras")}setExtras(Z){return this.set("extras",Z)}clone(){return new this.constructor(this.graph).copy(this,BJ)}copy(Z,J=BJ){for(let X in this[h0]){let Y=this[h0][X];if(Y instanceof w5){if(!this[z4].has(X))Y.dispose()}else if(Y instanceof P6||Y instanceof P0)for(let $ of Y.values())$.dispose();else if(Y instanceof r1)for(let $ of Y.values())$.dispose()}for(let X in Z[h0]){let Y=this[h0][X],$=Z[h0][X];if($ instanceof w5)if(this[z4].has(X))Y.getChild().copy(J($.getChild()),J);else this.setRef(X,J($.getChild()),$.getAttributes());else if($ instanceof P0||$ instanceof P6)for(let Q of $.values())this.addRef(X,J(Q.getChild()),Q.getAttributes());else if($ instanceof r1)for(let Q of $.keys()){let W=$.get(Q);this.setRefMap(X,Q,J(W.getChild()),W.getAttributes())}else if(QY($))this[h0][X]=JSON.parse(JSON.stringify($));else if(Array.isArray($)||$ instanceof ArrayBuffer||ArrayBuffer.isView($))this[h0][X]=$.slice();else this[h0][X]=$}return this}equals(Z,J=RL1){if(this===Z)return!0;if(this.propertyType!==Z.propertyType)return!1;for(let X in this[h0]){if(J.has(X))continue;let Y=this[h0][X],$=Z[h0][X];if(Y instanceof w5||$ instanceof w5){if(!OL1(Y,$))return!1}else if(Y instanceof P0||$ instanceof P0||Y instanceof P6||$ instanceof P6){if(!jL1(Y,$))return!1}else if(Y instanceof r1||$ instanceof r1){if(!ML1(Y,$))return!1}else if(QY(Y)||QY($)){if(!ci(Y,$))return!1}else if(L2(Y)||L2($)){if(!di(Y,$))return!1}else if(Y!==$)return!1}return!0}detach(){return this.graph.disconnectParents(this,(Z)=>Z.propertyType!=="Root"),this}listParents(){return this.graph.listParents(this)}}class E6 extends j2{getDefaults(){return Object.assign(super.getDefaults(),{extensions:new r1})}getExtension(Z){return this.getRefMap("extensions",Z)}setExtension(Z,J){if(J)J._validateParent(this);return this.setRefMap("extensions",Z,J)}listExtensions(){return this.listRefMapValues("extensions")}}class R0 extends E6{init(){this.propertyType=s.ACCESSOR}getDefaults(){return Object.assign(super.getDefaults(),{array:null,type:R0.Type.SCALAR,componentType:R0.ComponentType.FLOAT,normalized:!1,sparse:!1,buffer:null})}static getElementSize(Z){switch(Z){case R0.Type.SCALAR:return 1;case R0.Type.VEC2:return 2;case R0.Type.VEC3:return 3;case R0.Type.VEC4:return 4;case R0.Type.MAT2:return 4;case R0.Type.MAT3:return 9;case R0.Type.MAT4:return 16;default:throw new Error("Unexpected type: "+Z)}}static getComponentSize(Z){switch(Z){case R0.ComponentType.BYTE:return 1;case R0.ComponentType.UNSIGNED_BYTE:return 1;case R0.ComponentType.SHORT:return 2;case R0.ComponentType.UNSIGNED_SHORT:return 2;case R0.ComponentType.UNSIGNED_INT:return 4;case R0.ComponentType.FLOAT:return 4;default:throw new Error("Unexpected component type: "+Z)}}getMinNormalized(Z){let J=this.getNormalized(),X=this.getElementSize(),Y=this.getComponentType();if(this.getMin(Z),J)for(let $=0;$<X;$++)Z[$]=K8.decodeNormalizedInt(Z[$],Y);return Z}getMin(Z){let J=this.getArray(),X=this.getCount(),Y=this.getElementSize();for(let $=0;$<Y;$++)Z[$]=1/0;for(let $=0;$<X*Y;$+=Y)for(let Q=0;Q<Y;Q++){let W=J[$+Q];if(Number.isFinite(W))Z[Q]=Math.min(Z[Q],W)}return Z}getMaxNormalized(Z){let J=this.getNormalized(),X=this.getElementSize(),Y=this.getComponentType();if(this.getMax(Z),J)for(let $=0;$<X;$++)Z[$]=K8.decodeNormalizedInt(Z[$],Y);return Z}getMax(Z){let J=this.get("array"),X=this.getCount(),Y=this.getElementSize();for(let $=0;$<Y;$++)Z[$]=-1/0;for(let $=0;$<X*Y;$+=Y)for(let Q=0;Q<Y;Q++){let W=J[$+Q];if(Number.isFinite(W))Z[Q]=Math.max(Z[Q],W)}return Z}getCount(){let Z=this.get("array");return Z?Z.length/this.getElementSize():0}getType(){return this.get("type")}setType(Z){return this.set("type",Z)}getElementSize(){return R0.getElementSize(this.get("type"))}getComponentSize(){return this.get("array").BYTES_PER_ELEMENT}getComponentType(){return this.get("componentType")}getNormalized(){return this.get("normalized")}setNormalized(Z){return this.set("normalized",Z)}getScalar(Z){let J=this.getElementSize(),X=this.getComponentType(),Y=this.getArray();if(this.getNormalized())return K8.decodeNormalizedInt(Y[Z*J],X);return Y[Z*J]}setScalar(Z,J){let X=this.getElementSize(),Y=this.getComponentType(),$=this.getArray();if(this.getNormalized())$[Z*X]=K8.encodeNormalizedInt(J,Y);else $[Z*X]=J;return this}getElement(Z,J){let X=this.getNormalized(),Y=this.getElementSize(),$=this.getComponentType(),Q=this.getArray();for(let W=0;W<Y;W++)if(X)J[W]=K8.decodeNormalizedInt(Q[Z*Y+W],$);else J[W]=Q[Z*Y+W];return J}setElement(Z,J){let X=this.getNormalized(),Y=this.getElementSize(),$=this.getComponentType(),Q=this.getArray();for(let W=0;W<Y;W++)if(X)Q[Z*Y+W]=K8.encodeNormalizedInt(J[W],$);else Q[Z*Y+W]=J[W];return this}getSparse(){return this.get("sparse")}setSparse(Z){return this.set("sparse",Z)}getBuffer(){return this.getRef("buffer")}setBuffer(Z){return this.setRef("buffer",Z)}getArray(){return this.get("array")}setArray(Z){return this.set("componentType",Z?NL1(Z):R0.ComponentType.FLOAT),this.set("array",Z),this}getByteLength(){let Z=this.get("array");return Z?Z.byteLength:0}}R0.Type={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};R0.ComponentType={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,FLOAT:5126};function NL1(Z){switch(Z.constructor){case Float32Array:return R0.ComponentType.FLOAT;case Uint32Array:return R0.ComponentType.UNSIGNED_INT;case Uint16Array:return R0.ComponentType.UNSIGNED_SHORT;case Uint8Array:return R0.ComponentType.UNSIGNED_BYTE;case Int16Array:return R0.ComponentType.SHORT;case Int8Array:return R0.ComponentType.BYTE;default:throw new Error("Unknown accessor componentType.")}}class zP extends E6{init(){this.propertyType=s.ANIMATION}getDefaults(){return Object.assign(super.getDefaults(),{channels:new P0,samplers:new P0})}addChannel(Z){return this.addRef("channels",Z)}removeChannel(Z){return this.removeRef("channels",Z)}listChannels(){return this.listRefs("channels")}addSampler(Z){return this.addRef("samplers",Z)}removeSampler(Z){return this.removeRef("samplers",Z)}listSamplers(){return this.listRefs("samplers")}}class UG extends E6{init(){this.propertyType=s.ANIMATION_CHANNEL}getDefaults(){return Object.assign(super.getDefaults(),{targetPath:null,targetNode:null,sampler:null})}getTargetPath(){return this.get("targetPath")}setTargetPath(Z){return this.set("targetPath",Z)}getTargetNode(){return this.getRef("targetNode")}setTargetNode(Z){return this.setRef("targetNode",Z)}getSampler(){return this.getRef("sampler")}setSampler(Z){return this.setRef("sampler",Z)}}UG.TargetPath={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"};class mQ extends E6{init(){this.propertyType=s.ANIMATION_SAMPLER}getDefaultAttributes(){return Object.assign(super.getDefaults(),{interpolation:mQ.Interpolation.LINEAR,input:null,output:null})}getInterpolation(){return this.get("interpolation")}setInterpolation(Z){return this.set("interpolation",Z)}getInput(){return this.getRef("input")}setInput(Z){return this.setRef("input",Z,{usage:i5.OTHER})}getOutput(){return this.getRef("output")}setOutput(Z){return this.setRef("output",Z,{usage:i5.OTHER})}}mQ.Interpolation={LINEAR:"LINEAR",STEP:"STEP",CUBICSPLINE:"CUBICSPLINE"};class qP extends E6{init(){this.propertyType=s.BUFFER}getDefaults(){return Object.assign(super.getDefaults(),{uri:""})}getURI(){return this.get("uri")}setURI(Z){return this.set("uri",Z)}}class LG extends E6{init(){this.propertyType=s.CAMERA}getDefaults(){return Object.assign(super.getDefaults(),{type:LG.Type.PERSPECTIVE,znear:0.1,zfar:100,aspectRatio:null,yfov:Math.PI*2*50/360,xmag:1,ymag:1})}getType(){return this.get("type")}setType(Z){return this.set("type",Z)}getZNear(){return this.get("znear")}setZNear(Z){return this.set("znear",Z)}getZFar(){return this.get("zfar")}setZFar(Z){return this.set("zfar",Z)}getAspectRatio(){return this.get("aspectRatio")}setAspectRatio(Z){return this.set("aspectRatio",Z)}getYFov(){return this.get("yfov")}setYFov(Z){return this.set("yfov",Z)}getXMag(){return this.get("xmag")}setXMag(Z){return this.set("xmag",Z)}getYMag(){return this.get("ymag")}setYMag(Z){return this.set("ymag",Z)}}LG.Type={PERSPECTIVE:"perspective",ORTHOGRAPHIC:"orthographic"};class n1 extends j2{_validateParent(Z){if(!this.parentTypes.includes(Z.propertyType))throw new Error(`Parent "${Z.propertyType}" invalid for child "${this.propertyType}".`)}}n1.EXTENSION_NAME=void 0;class T1 extends E6{init(){this.propertyType=s.TEXTURE_INFO}getDefaults(){return Object.assign(super.getDefaults(),{texCoord:0,magFilter:null,minFilter:null,wrapS:T1.WrapMode.REPEAT,wrapT:T1.WrapMode.REPEAT})}getTexCoord(){return this.get("texCoord")}setTexCoord(Z){return this.set("texCoord",Z)}getMagFilter(){return this.get("magFilter")}setMagFilter(Z){return this.set("magFilter",Z)}getMinFilter(){return this.get("minFilter")}setMinFilter(Z){return this.set("minFilter",Z)}getWrapS(){return this.get("wrapS")}setWrapS(Z){return this.set("wrapS",Z)}getWrapT(){return this.get("wrapT")}setWrapT(Z){return this.set("wrapT",Z)}}T1.WrapMode={CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497};T1.MagFilter={NEAREST:9728,LINEAR:9729};T1.MinFilter={NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987};var{R:V2,G:F2,B:U2,A:DL1}=n5;class wG extends E6{init(){this.propertyType=s.MATERIAL}getDefaults(){return Object.assign(super.getDefaults(),{alphaMode:wG.AlphaMode.OPAQUE,alphaCutoff:0.5,doubleSided:!1,baseColorFactor:[1,1,1,1],baseColorTexture:null,baseColorTextureInfo:new T1(this.graph,"baseColorTextureInfo"),emissiveFactor:[0,0,0],emissiveTexture:null,emissiveTextureInfo:new T1(this.graph,"emissiveTextureInfo"),normalScale:1,normalTexture:null,normalTextureInfo:new T1(this.graph,"normalTextureInfo"),occlusionStrength:1,occlusionTexture:null,occlusionTextureInfo:new T1(this.graph,"occlusionTextureInfo"),roughnessFactor:1,metallicFactor:1,metallicRoughnessTexture:null,metallicRoughnessTextureInfo:new T1(this.graph,"metallicRoughnessTextureInfo")})}getDoubleSided(){return this.get("doubleSided")}setDoubleSided(Z){return this.set("doubleSided",Z)}getAlpha(){return this.get("baseColorFactor")[3]}setAlpha(Z){let J=this.get("baseColorFactor").slice();return J[3]=Z,this.set("baseColorFactor",J)}getAlphaMode(){return this.get("alphaMode")}setAlphaMode(Z){return this.set("alphaMode",Z)}getAlphaCutoff(){return this.get("alphaCutoff")}setAlphaCutoff(Z){return this.set("alphaCutoff",Z)}getBaseColorFactor(){return this.get("baseColorFactor")}setBaseColorFactor(Z){return this.set("baseColorFactor",Z)}getBaseColorTexture(){return this.getRef("baseColorTexture")}getBaseColorTextureInfo(){return this.getRef("baseColorTexture")?this.getRef("baseColorTextureInfo"):null}setBaseColorTexture(Z){return this.setRef("baseColorTexture",Z,{channels:V2|F2|U2|DL1,isColor:!0})}getEmissiveFactor(){return this.get("emissiveFactor")}setEmissiveFactor(Z){return this.set("emissiveFactor",Z)}getEmissiveTexture(){return this.getRef("emissiveTexture")}getEmissiveTextureInfo(){return this.getRef("emissiveTexture")?this.getRef("emissiveTextureInfo"):null}setEmissiveTexture(Z){return this.setRef("emissiveTexture",Z,{channels:V2|F2|U2,isColor:!0})}getNormalScale(){return this.get("normalScale")}setNormalScale(Z){return this.set("normalScale",Z)}getNormalTexture(){return this.getRef("normalTexture")}getNormalTextureInfo(){return this.getRef("normalTexture")?this.getRef("normalTextureInfo"):null}setNormalTexture(Z){return this.setRef("normalTexture",Z,{channels:V2|F2|U2})}getOcclusionStrength(){return this.get("occlusionStrength")}setOcclusionStrength(Z){return this.set("occlusionStrength",Z)}getOcclusionTexture(){return this.getRef("occlusionTexture")}getOcclusionTextureInfo(){return this.getRef("occlusionTexture")?this.getRef("occlusionTextureInfo"):null}setOcclusionTexture(Z){return this.setRef("occlusionTexture",Z,{channels:V2})}getRoughnessFactor(){return this.get("roughnessFactor")}setRoughnessFactor(Z){return this.set("roughnessFactor",Z)}getMetallicFactor(){return this.get("metallicFactor")}setMetallicFactor(Z){return this.set("metallicFactor",Z)}getMetallicRoughnessTexture(){return this.getRef("metallicRoughnessTexture")}getMetallicRoughnessTextureInfo(){return this.getRef("metallicRoughnessTexture")?this.getRef("metallicRoughnessTextureInfo"):null}setMetallicRoughnessTexture(Z){return this.setRef("metallicRoughnessTexture",Z,{channels:F2|U2})}}wG.AlphaMode={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};class VP extends E6{init(){this.propertyType=s.MESH}getDefaults(){return Object.assign(super.getDefaults(),{weights:[],primitives:new P0})}addPrimitive(Z){return this.addRef("primitives",Z)}removePrimitive(Z){return this.removeRef("primitives",Z)}listPrimitives(){return this.listRefs("primitives")}getWeights(){return this.get("weights")}setWeights(Z){return this.set("weights",Z)}}class FP extends E6{init(){this.propertyType=s.NODE}getDefaults(){return Object.assign(super.getDefaults(),{translation:[0,0,0],rotation:[0,0,0,1],scale:[1,1,1],weights:[],camera:null,mesh:null,skin:null,children:new P0})}copy(Z,J=BJ){if(J===BJ)throw new Error("Node cannot be copied.");return super.copy(Z,J)}getTranslation(){return this.get("translation")}getRotation(){return this.get("rotation")}getScale(){return this.get("scale")}setTranslation(Z){return this.set("translation",Z)}setRotation(Z){return this.set("rotation",Z)}setScale(Z){return this.set("scale",Z)}getMatrix(){return K8.compose(this.get("translation"),this.get("rotation"),this.get("scale"),[])}setMatrix(Z){let J=this.get("translation").slice(),X=this.get("rotation").slice(),Y=this.get("scale").slice();return K8.decompose(Z,J,X,Y),this.set("translation",J).set("rotation",X).set("scale",Y)}getWorldTranslation(){let Z=[0,0,0];return K8.decompose(this.getWorldMatrix(),Z,[0,0,0,1],[1,1,1]),Z}getWorldRotation(){let Z=[0,0,0,1];return K8.decompose(this.getWorldMatrix(),[0,0,0],Z,[1,1,1]),Z}getWorldScale(){let Z=[1,1,1];return K8.decompose(this.getWorldMatrix(),[0,0,0],[0,0,0,1],Z),Z}getWorldMatrix(){let Z=[];for(let Y=this;Y!=null;Y=Y.getParentNode())Z.push(Y);let J,X=Z.pop().getMatrix();while(J=Z.pop())LL1(X,X,J.getMatrix());return X}addChild(Z){let J=Z.getParentNode();if(J)J.removeChild(Z);for(let X of Z.listParents())if(X.propertyType===s.SCENE)X.removeChild(Z);return this.addRef("children",Z)}removeChild(Z){return this.removeRef("children",Z)}listChildren(){return this.listRefs("children")}getParentNode(){for(let Z of this.listParents())if(Z.propertyType===s.NODE)return Z;return null}getMesh(){return this.getRef("mesh")}setMesh(Z){return this.setRef("mesh",Z)}getCamera(){return this.getRef("camera")}setCamera(Z){return this.setRef("camera",Z)}getSkin(){return this.getRef("skin")}setSkin(Z){return this.setRef("skin",Z)}getWeights(){return this.get("weights")}setWeights(Z){return this.set("weights",Z)}traverse(Z){Z(this);for(let J of this.listChildren())J.traverse(Z);return this}}class OJ extends E6{init(){this.propertyType=s.PRIMITIVE}getDefaults(){return Object.assign(super.getDefaults(),{mode:OJ.Mode.TRIANGLES,material:null,indices:null,attributes:new r1,targets:new P0})}getIndices(){return this.getRef("indices")}setIndices(Z){return this.setRef("indices",Z,{usage:i5.ELEMENT_ARRAY_BUFFER})}getAttribute(Z){return this.getRefMap("attributes",Z)}setAttribute(Z,J){return this.setRefMap("attributes",Z,J,{usage:i5.ARRAY_BUFFER})}listAttributes(){return this.listRefMapValues("attributes")}listSemantics(){return this.listRefMapKeys("attributes")}getMaterial(){return this.getRef("material")}setMaterial(Z){return this.setRef("material",Z)}getMode(){return this.get("mode")}setMode(Z){return this.set("mode",Z)}listTargets(){return this.listRefs("targets")}addTarget(Z){return this.addRef("targets",Z)}removeTarget(Z){return this.removeRef("targets",Z)}}OJ.Mode={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class li extends j2{init(){this.propertyType=s.PRIMITIVE_TARGET}getDefaults(){return Object.assign(super.getDefaults(),{attributes:new r1})}getAttribute(Z){return this.getRefMap("attributes",Z)}setAttribute(Z,J){return this.setRefMap("attributes",Z,J,{usage:i5.ARRAY_BUFFER})}listAttributes(){return this.listRefMapValues("attributes")}listSemantics(){return this.listRefMapKeys("attributes")}}function w2(){return w2=Object.assign?Object.assign.bind():function(Z){for(var J=1;J<arguments.length;J++){var X=arguments[J];for(var Y in X)({}).hasOwnProperty.call(X,Y)&&(Z[Y]=X[Y])}return Z},w2.apply(null,arguments)}class UP extends E6{init(){this.propertyType=s.SCENE}getDefaults(){return Object.assign(super.getDefaults(),{children:new P0})}copy(Z,J=BJ){if(J===BJ)throw new Error("Scene cannot be copied.");return super.copy(Z,J)}addChild(Z){let J=Z.getParentNode();if(J)J.removeChild(Z);return this.addRef("children",Z)}removeChild(Z){return this.removeRef("children",Z)}listChildren(){return this.listRefs("children")}traverse(Z){for(let J of this.listChildren())J.traverse(Z);return this}}class LP extends E6{init(){this.propertyType=s.SKIN}getDefaults(){return Object.assign(super.getDefaults(),{skeleton:null,inverseBindMatrices:null,joints:new P0})}getSkeleton(){return this.getRef("skeleton")}setSkeleton(Z){return this.setRef("skeleton",Z)}getInverseBindMatrices(){return this.getRef("inverseBindMatrices")}setInverseBindMatrices(Z){return this.setRef("inverseBindMatrices",Z,{usage:i5.INVERSE_BIND_MATRICES})}addJoint(Z){return this.addRef("joints",Z)}removeJoint(Z){return this.removeRef("joints",Z)}listJoints(){return this.listRefs("joints")}}class wP extends E6{init(){this.propertyType=s.TEXTURE}getDefaults(){return Object.assign(super.getDefaults(),{image:null,mimeType:"",uri:""})}getMimeType(){return this.get("mimeType")||V4.extensionToMimeType(VG.extension(this.get("uri")))}setMimeType(Z){return this.set("mimeType",Z)}getURI(){return this.get("uri")}setURI(Z){this.set("uri",Z);let J=V4.extensionToMimeType(VG.extension(Z));if(J)this.set("mimeType",J);return this}getImage(){return this.get("image")}setImage(Z){return this.set("image",k6.assertView(Z))}getSize(){let Z=this.get("image");if(!Z)return null;return V4.getSize(Z,this.getMimeType())}}class M2 extends E6{init(){this.propertyType=s.ROOT}getDefaults(){return Object.assign(super.getDefaults(),{asset:{generator:`glTF-Transform ${HL1}`,version:"2.0"},defaultScene:null,accessors:new P0,animations:new P0,buffers:new P0,cameras:new P0,materials:new P0,meshes:new P0,nodes:new P0,scenes:new P0,skins:new P0,textures:new P0})}constructor(Z){super(Z);this._extensions=new Set,Z.addEventListener("node:create",(J)=>{this._addChildOfRoot(J.target)})}clone(){throw new Error("Root cannot be cloned.")}copy(Z,J=BJ){if(J===BJ)throw new Error("Root cannot be copied.");this.set("asset",w2({},Z.get("asset"))),this.setName(Z.getName()),this.setExtras(w2({},Z.getExtras())),this.setDefaultScene(Z.getDefaultScene()?J(Z.getDefaultScene()):null);for(let X of Z.listRefMapKeys("extensions")){let Y=Z.getExtension(X);this.setExtension(X,J(Y))}return this}_addChildOfRoot(Z){if(Z instanceof UP)this.addRef("scenes",Z);else if(Z instanceof FP)this.addRef("nodes",Z);else if(Z instanceof LG)this.addRef("cameras",Z);else if(Z instanceof LP)this.addRef("skins",Z);else if(Z instanceof VP)this.addRef("meshes",Z);else if(Z instanceof wG)this.addRef("materials",Z);else if(Z instanceof wP)this.addRef("textures",Z);else if(Z instanceof zP)this.addRef("animations",Z);else if(Z instanceof R0)this.addRef("accessors",Z);else if(Z instanceof qP)this.addRef("buffers",Z);return this}getAsset(){return this.get("asset")}listExtensionsUsed(){return Array.from(this._extensions)}listExtensionsRequired(){return this.listExtensionsUsed().filter((Z)=>Z.isRequired())}_enableExtension(Z){return this._extensions.add(Z),this}_disableExtension(Z){return this._extensions.delete(Z),this}listScenes(){return this.listRefs("scenes")}setDefaultScene(Z){return this.setRef("defaultScene",Z)}getDefaultScene(){return this.getRef("defaultScene")}listNodes(){return this.listRefs("nodes")}listCameras(){return this.listRefs("cameras")}listSkins(){return this.listRefs("skins")}listMeshes(){return this.listRefs("meshes")}listMaterials(){return this.listRefs("materials")}listTextures(){return this.listRefs("textures")}listAnimations(){return this.listRefs("animations")}listAccessors(){return this.listRefs("accessors")}listBuffers(){return this.listRefs("buffers")}}class B2{static fromGraph(Z){return B2._GRAPH_DOCUMENTS.get(Z)||null}constructor(){this._graph=new TQ,this._root=new M2(this._graph),this._logger=K7.DEFAULT_INSTANCE,B2._GRAPH_DOCUMENTS.set(this._graph,this)}getRoot(){return this._root}getGraph(){return this._graph}getLogger(){return this._logger}setLogger(Z){return this._logger=Z,this}clone(){throw new Error("Use 'cloneDocument(source)' from '@gltf-transform/functions'.")}merge(Z){throw new Error("Use 'mergeDocuments(target, source)' from '@gltf-transform/functions'.")}async transform(...Z){let J=Z.map((X)=>X.name);for(let X of Z)await X(this,{stack:J});return this}createExtension(Z){let J=Z.EXTENSION_NAME;return this.getRoot().listExtensionsUsed().find((Y)=>Y.extensionName===J)||new Z(this)}createScene(Z=""){return new UP(this._graph,Z)}createNode(Z=""){return new FP(this._graph,Z)}createCamera(Z=""){return new LG(this._graph,Z)}createSkin(Z=""){return new LP(this._graph,Z)}createMesh(Z=""){return new VP(this._graph,Z)}createPrimitive(){return new OJ(this._graph)}createPrimitiveTarget(Z=""){return new li(this._graph,Z)}createMaterial(Z=""){return new wG(this._graph,Z)}createTexture(Z=""){return new wP(this._graph,Z)}createAnimation(Z=""){return new zP(this._graph,Z)}createAnimationChannel(Z=""){return new UG(this._graph,Z)}createAnimationSampler(Z=""){return new mQ(this._graph,Z)}createAccessor(Z="",J=null){if(!J)J=this.getRoot().listBuffers()[0];return new R0(this._graph,Z).setBuffer(J)}createBuffer(Z=""){return new qP(this._graph,Z)}}B2._GRAPH_DOCUMENTS=new WeakMap;class I1{constructor(Z){this.extensionName="",this.prereadTypes=[],this.prewriteTypes=[],this.readDependencies=[],this.writeDependencies=[],this.document=void 0,this.required=!1,this.properties=new Set,this._listener=void 0,this.document=Z,Z.getRoot()._enableExtension(this),this._listener=(X)=>{let Y=X,$=Y.target;if($ instanceof n1&&$.extensionName===this.extensionName){if(Y.type==="node:create")this._addExtensionProperty($);if(Y.type==="node:dispose")this._removeExtensionProperty($)}};let J=Z.getGraph();J.addEventListener("node:create",this._listener),J.addEventListener("node:dispose",this._listener)}dispose(){this.document.getRoot()._disableExtension(this);let Z=this.document.getGraph();Z.removeEventListener("node:create",this._listener),Z.removeEventListener("node:dispose",this._listener);for(let J of this.properties)J.dispose()}static register(){}isRequired(){return this.required}setRequired(Z){return this.required=Z,this}listProperties(){return Array.from(this.properties)}_addExtensionProperty(Z){return this.properties.add(Z),this}_removeExtensionProperty(Z){return this.properties.delete(Z),this}install(Z,J){return this}preread(Z,J){return this}prewrite(Z,J){return this}}I1.EXTENSION_NAME=void 0;var lH6={logger:K7.DEFAULT_INSTANCE,extensions:[],dependencies:{}},pH6=new Set([s.BUFFER,s.TEXTURE,s.MATERIAL,s.MESH,s.PRIMITIVE,s.NODE,s.SCENE]);var FG;(function(Z){Z[Z.ARRAY_BUFFER=34962]="ARRAY_BUFFER",Z[Z.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER"})(FG||(FG={}));class jJ{constructor(Z,J,X){this._doc=void 0,this.jsonDoc=void 0,this.options=void 0,this.accessorIndexMap=new Map,this.animationIndexMap=new Map,this.bufferIndexMap=new Map,this.cameraIndexMap=new Map,this.skinIndexMap=new Map,this.materialIndexMap=new Map,this.meshIndexMap=new Map,this.nodeIndexMap=new Map,this.imageIndexMap=new Map,this.textureDefIndexMap=new Map,this.textureInfoDefMap=new Map,this.samplerDefIndexMap=new Map,this.sceneIndexMap=new Map,this.imageBufferViews=[],this.otherBufferViews=new Map,this.otherBufferViewsIndexMap=new Map,this.extensionData={},this.bufferURIGenerator=void 0,this.imageURIGenerator=void 0,this.logger=void 0,this._accessorUsageMap=new Map,this.accessorUsageGroupedByParent=new Set(["ARRAY_BUFFER"]),this.accessorParents=new Map,this._doc=Z,this.jsonDoc=J,this.options=X;let Y=Z.getRoot(),$=Y.listBuffers().length,Q=Y.listTextures().length;this.bufferURIGenerator=new KP($>1,()=>X.basename||"buffer"),this.imageURIGenerator=new KP(Q>1,(W)=>PL1(Z,W)||X.basename||"texture"),this.logger=Z.getLogger()}createTextureInfoDef(Z,J){let X={magFilter:J.getMagFilter()||void 0,minFilter:J.getMinFilter()||void 0,wrapS:J.getWrapS(),wrapT:J.getWrapT()},Y=JSON.stringify(X);if(!this.samplerDefIndexMap.has(Y))this.samplerDefIndexMap.set(Y,this.jsonDoc.json.samplers.length),this.jsonDoc.json.samplers.push(X);let $={source:this.imageIndexMap.get(Z),sampler:this.samplerDefIndexMap.get(Y)},Q=JSON.stringify($);if(!this.textureDefIndexMap.has(Q))this.textureDefIndexMap.set(Q,this.jsonDoc.json.textures.length),this.jsonDoc.json.textures.push($);let W={index:this.textureDefIndexMap.get(Q)};if(J.getTexCoord()!==0)W.texCoord=J.getTexCoord();if(Object.keys(J.getExtras()).length>0)W.extras=J.getExtras();return this.textureInfoDefMap.set(J,W),W}createPropertyDef(Z){let J={};if(Z.getName())J.name=Z.getName();if(Object.keys(Z.getExtras()).length>0)J.extras=Z.getExtras();return J}createAccessorDef(Z){let J=this.createPropertyDef(Z);if(J.type=Z.getType(),J.componentType=Z.getComponentType(),J.count=Z.getCount(),this._doc.getGraph().listParentEdges(Z).some((Y)=>Y.getName()==="attributes"&&Y.getAttributes().key==="POSITION"||Y.getName()==="input"))J.max=Z.getMax([]).map(Math.fround),J.min=Z.getMin([]).map(Math.fround);if(Z.getNormalized())J.normalized=Z.getNormalized();return J}createImageData(Z,J,X){if(this.options.format===XP.GLB)this.imageBufferViews.push(J),Z.bufferView=this.jsonDoc.json.bufferViews.length,this.jsonDoc.json.bufferViews.push({buffer:0,byteOffset:-1,byteLength:J.byteLength});else{let Y=V4.mimeTypeToExtension(X.getMimeType());Z.uri=this.imageURIGenerator.createURI(X,Y),this.assignResourceURI(Z.uri,J,!1)}}assignResourceURI(Z,J,X){let Y=this.jsonDoc.resources;if(!(Z in Y)){Y[Z]=J;return}if(J===Y[Z]){this.logger.warn(`Duplicate resource URI, "${Z}".`);return}let $=`Resource URI "${Z}" already assigned to different data.`;if(!X){this.logger.warn($);return}throw new Error($)}getAccessorUsage(Z){let J=this._accessorUsageMap.get(Z);if(J)return J;if(Z.getSparse())return i5.SPARSE;for(let X of this._doc.getGraph().listParentEdges(Z)){let{usage:Y}=X.getAttributes();if(Y)return Y;if(X.getParent().propertyType!==s.ROOT)this.logger.warn(`Missing attribute ".usage" on edge, "${X.getName()}".`)}return i5.OTHER}addAccessorToUsageGroup(Z,J){let X=this._accessorUsageMap.get(Z);if(X&&X!==J)throw new Error(`Accessor with usage "${X}" cannot be reused as "${J}".`);return this._accessorUsageMap.set(Z,J),this}}jJ.BufferViewTarget=FG;jJ.BufferViewUsage=i5;jJ.USAGE_TO_TARGET={[i5.ARRAY_BUFFER]:FG.ARRAY_BUFFER,[i5.ELEMENT_ARRAY_BUFFER]:FG.ELEMENT_ARRAY_BUFFER};class KP{constructor(Z,J){this.multiple=void 0,this.basename=void 0,this.counter={},this.multiple=Z,this.basename=J}createURI(Z,J){if(Z.getURI())return Z.getURI();else if(!this.multiple)return`${this.basename(Z)}.${J}`;else{let X=this.basename(Z);return this.counter[X]=this.counter[X]||1,`${X}_${this.counter[X]++}.${J}`}}}function PL1(Z,J){let X=Z.getGraph().listParentEdges(J).find((Y)=>Y.getParent()!==Z.getRoot());return X?X.getName().replace(/texture$/i,""):""}var{UNSIGNED_INT:iH6,UNSIGNED_SHORT:nH6,UNSIGNED_BYTE:aH6}=R0.ComponentType,sH6=new Set([s.ACCESSOR,s.BUFFER,s.MATERIAL,s.MESH]);var yi;(function(Z){Z[Z.JSON=1313821514]="JSON",Z[Z.BIN=5130562]="BIN"})(yi||(yi={}));var ii=163,ni=166;function CL1(){return{vkFormat:0,typeSize:1,pixelWidth:0,pixelHeight:0,pixelDepth:0,layerCount:0,faceCount:1,supercompressionScheme:0,levels:[],dataFormatDescriptor:[{vendorId:0,descriptorType:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],keyValue:{},globalData:null}}class uQ{constructor(Z,J,X,Y){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(Z.buffer,Z.byteOffset+J,X),this._littleEndian=Y,this._offset=0}_nextUint8(){let Z=this._dataView.getUint8(this._offset);return this._offset+=1,Z}_nextUint16(){let Z=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,Z}_nextUint32(){let Z=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,Z}_nextUint64(){let Z=this._dataView.getUint32(this._offset,this._littleEndian),J=this._dataView.getUint32(this._offset+4,this._littleEndian),X=Z+4294967296*J;return this._offset+=8,X}_nextInt32(){let Z=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,Z}_nextUint8Array(Z){let J=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._offset,Z);return this._offset+=Z,J}_skip(Z){return this._offset+=Z,this}_scan(Z,J=0){let X=this._offset,Y=0;while(this._dataView.getUint8(this._offset)!==J&&Y<Z)Y++,this._offset++;if(Y<Z)this._offset++;return new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+X,Y)}}var tH6=new Uint8Array([0]),n6=[171,75,84,88,32,50,48,187,13,10,26,10];function pi(Z){return new TextDecoder().decode(Z)}function R2(Z){let J=new Uint8Array(Z.buffer,Z.byteOffset,n6.length);if(J[0]!==n6[0]||J[1]!==n6[1]||J[2]!==n6[2]||J[3]!==n6[3]||J[4]!==n6[4]||J[5]!==n6[5]||J[6]!==n6[6]||J[7]!==n6[7]||J[8]!==n6[8]||J[9]!==n6[9]||J[10]!==n6[10]||J[11]!==n6[11])throw new Error("Missing KTX 2.0 identifier.");let X=CL1(),Y=17*Uint32Array.BYTES_PER_ELEMENT,$=new uQ(Z,n6.length,Y,!0);X.vkFormat=$._nextUint32(),X.typeSize=$._nextUint32(),X.pixelWidth=$._nextUint32(),X.pixelHeight=$._nextUint32(),X.pixelDepth=$._nextUint32(),X.layerCount=$._nextUint32(),X.faceCount=$._nextUint32();let Q=$._nextUint32();X.supercompressionScheme=$._nextUint32();let W=$._nextUint32(),K=$._nextUint32(),G=$._nextUint32(),H=$._nextUint32(),z=$._nextUint64(),q=$._nextUint64(),V=Q*3*8,F=new uQ(Z,n6.length+Y,V,!0);for(let V6=0;V6<Q;V6++)X.levels.push({levelData:new Uint8Array(Z.buffer,Z.byteOffset+F._nextUint64(),F._nextUint64()),uncompressedByteLength:F._nextUint64()});let U=new uQ(Z,W,K,!0);U._skip(4);let w=U._nextUint16(),L=U._nextUint16(),O=U._nextUint16(),N=U._nextUint16(),M=U._nextUint8(),j=U._nextUint8(),P=U._nextUint8(),D=U._nextUint8(),C=[U._nextUint8(),U._nextUint8(),U._nextUint8(),U._nextUint8()],k=[U._nextUint8(),U._nextUint8(),U._nextUint8(),U._nextUint8(),U._nextUint8(),U._nextUint8(),U._nextUint8(),U._nextUint8()],x={vendorId:w,descriptorType:L,versionNumber:O,colorModel:M,colorPrimaries:j,transferFunction:P,flags:D,texelBlockDimension:C,bytesPlane:k,samples:[]},S=6,h=4,I=(N/4-S)/h;for(let V6=0;V6<I;V6++){let s7={bitOffset:U._nextUint16(),bitLength:U._nextUint8(),channelType:U._nextUint8(),samplePosition:[U._nextUint8(),U._nextUint8(),U._nextUint8(),U._nextUint8()],sampleLower:Number.NEGATIVE_INFINITY,sampleUpper:Number.POSITIVE_INFINITY};if(s7.channelType&64)s7.sampleLower=U._nextInt32(),s7.sampleUpper=U._nextInt32();else s7.sampleLower=U._nextUint32(),s7.sampleUpper=U._nextUint32();x.samples[V6]=s7}X.dataFormatDescriptor.length=0,X.dataFormatDescriptor.push(x);let v=new uQ(Z,G,H,!0);while(v._offset<H){let V6=v._nextUint32(),s7=v._scan(V6),MV=pi(s7);if(X.keyValue[MV]=v._nextUint8Array(V6-s7.byteLength-1),MV.match(/^ktx/i)){let Of=pi(X.keyValue[MV]);X.keyValue[MV]=Of.substring(0,Of.lastIndexOf("\x00"))}let EX1=V6%4?4-V6%4:0;v._skip(EX1)}if(q<=0)return X;let A=new uQ(Z,z,q,!0),p=A._nextUint16(),n=A._nextUint16(),o=A._nextUint32(),X0=A._nextUint32(),Q0=A._nextUint32(),E0=A._nextUint32(),I0=[];for(let V6=0;V6<Q;V6++)I0.push({imageFlags:A._nextUint32(),rgbSliceByteOffset:A._nextUint32(),rgbSliceByteLength:A._nextUint32(),alphaSliceByteOffset:A._nextUint32(),alphaSliceByteLength:A._nextUint32()});let a0=z+A._offset,I8=a0+o,s1=I8+X0,l4=s1+Q0,e9=new Uint8Array(Z.buffer,Z.byteOffset+a0,o),e$=new Uint8Array(Z.buffer,Z.byteOffset+I8,X0),ZQ=new Uint8Array(Z.buffer,Z.byteOffset+s1,Q0),fX=new Uint8Array(Z.buffer,Z.byteOffset+l4,E0);return X.globalData={endpointCount:p,selectorCount:n,imageDescs:I0,endpointsData:e9,selectorsData:e$,tablesData:ZQ,extendedData:fX},X}var RP="EXT_mesh_gpu_instancing",OP="EXT_meshopt_compression",TL1="EXT_texture_webp",kL1="EXT_texture_avif",Kn="KHR_draco_mesh_compression",NP="KHR_lights_punctual",DP="KHR_materials_anisotropy",PP="KHR_materials_clearcoat",CP="KHR_materials_diffuse_transmission",TP="KHR_materials_dispersion",kP="KHR_materials_emissive_strength",EP="KHR_materials_ior",IP="KHR_materials_iridescence",vP="KHR_materials_pbrSpecularGlossiness",SP="KHR_materials_sheen",_P="KHR_materials_specular",AP="KHR_materials_transmission",xP="KHR_materials_unlit",hP="KHR_materials_volume",MY="KHR_materials_variants",EL1="KHR_mesh_quantization",IL1="KHR_texture_basisu",fP="KHR_texture_transform",N2="KHR_xmp_json_ld",jP="INSTANCE_ATTRIBUTE";class bP extends n1{init(){this.extensionName=RP,this.propertyType="InstancedMesh",this.parentTypes=[s.NODE]}getDefaults(){return Object.assign(super.getDefaults(),{attributes:new r1})}getAttribute(Z){return this.getRefMap("attributes",Z)}setAttribute(Z,J){return this.setRefMap("attributes",Z,J,{usage:jP})}listAttributes(){return this.listRefMapValues("attributes")}listSemantics(){return this.listRefMapKeys("attributes")}}bP.EXTENSION_NAME=RP;var WY=RP;class C2 extends I1{constructor(...Z){super(...Z);this.extensionName=WY,this.provideTypes=[s.NODE],this.prewriteTypes=[s.ACCESSOR]}createInstancedMesh(){return new bP(this.document.getGraph())}read(Z){return(Z.jsonDoc.json.nodes||[]).forEach((Y,$)=>{if(!Y.extensions||!Y.extensions[WY])return;let Q=Y.extensions[WY],W=this.createInstancedMesh();for(let K in Q.attributes)W.setAttribute(K,Z.accessors[Q.attributes[K]]);Z.nodes[$].setExtension(WY,W)}),this}prewrite(Z){Z.accessorUsageGroupedByParent.add(jP);for(let J of this.properties)for(let X of J.listAttributes())Z.addAccessorToUsageGroup(X,jP);return this}write(Z){let J=Z.jsonDoc;return this.document.getRoot().listNodes().forEach((X)=>{let Y=X.getExtension(WY);if(Y){let $=Z.nodeIndexMap.get(X),Q=J.json.nodes[$],W={attributes:{}};Y.listSemantics().forEach((K)=>{let G=Y.getAttribute(K);W.attributes[K]=Z.accessorIndexMap.get(G)}),Q.extensions=Q.extensions||{},Q.extensions[WY]=W}}),this}}C2.EXTENSION_NAME=WY;function UZ(){return UZ=Object.assign?Object.assign.bind():function(Z){for(var J=1;J<arguments.length;J++){var X=arguments[J];for(var Y in X)({}).hasOwnProperty.call(X,Y)&&(Z[Y]=X[Y])}return Z},UZ.apply(null,arguments)}var MG;(function(Z){Z.QUANTIZE="quantize",Z.FILTER="filter"})(MG||(MG={}));var cQ;(function(Z){Z.ATTRIBUTES="ATTRIBUTES",Z.TRIANGLES="TRIANGLES",Z.INDICES="INDICES"})(cQ||(cQ={}));var G8;(function(Z){Z.NONE="NONE",Z.OCTAHEDRAL="OCTAHEDRAL",Z.QUATERNION="QUATERNION",Z.EXPONENTIAL="EXPONENTIAL"})(G8||(G8={}));var{BYTE:vL1,SHORT:ai,FLOAT:SL1}=R0.ComponentType,{encodeNormalizedInt:si,decodeNormalizedInt:MP}=K8;function _L1(Z,J,X,Y){let{filter:$,bits:Q}=Y,W={array:Z.getArray(),byteStride:Z.getElementSize()*Z.getComponentSize(),componentType:Z.getComponentType(),normalized:Z.getNormalized()};if(X!==cQ.ATTRIBUTES)return W;if($!==G8.NONE){let K=Z.getNormalized()?AL1(Z):new Float32Array(W.array);switch($){case G8.EXPONENTIAL:W.byteStride=Z.getElementSize()*4,W.componentType=SL1,W.normalized=!1,W.array=J.encodeFilterExp(K,Z.getCount(),W.byteStride,Q);break;case G8.OCTAHEDRAL:W.byteStride=Q>8?8:4,W.componentType=Q>8?ai:vL1,W.normalized=!0,K=Z.getElementSize()===3?hL1(K):K,W.array=J.encodeFilterOct(K,Z.getCount(),W.byteStride,Q);break;case G8.QUATERNION:W.byteStride=8,W.componentType=ai,W.normalized=!0,W.array=J.encodeFilterQuat(K,Z.getCount(),W.byteStride,Q);break;default:throw new Error("Invalid filter.")}if(W.min=Z.getMin([]),W.max=Z.getMax([]),Z.getNormalized())W.min=W.min.map((G)=>MP(G,Z.getComponentType())),W.max=W.max.map((G)=>MP(G,Z.getComponentType()));if(W.normalized)W.min=W.min.map((G)=>si(G,W.componentType)),W.max=W.max.map((G)=>si(G,W.componentType))}else if(W.byteStride%4)W.array=xL1(W.array,Z.getElementSize()),W.byteStride=W.array.byteLength/Z.getCount();return W}function AL1(Z){let J=Z.getComponentType(),X=Z.getArray(),Y=new Float32Array(X.length);for(let $=0;$<X.length;$++)Y[$]=MP(X[$],J);return Y}function xL1(Z,J){let Y=k6.padNumber(Z.BYTES_PER_ELEMENT*J)/Z.BYTES_PER_ELEMENT,$=Z.length/J,Q=new Z.constructor($*Y);for(let W=0;W*J<Z.length;W++)for(let K=0;K<J;K++)Q[W*Y+K]=Z[W*J+K];return Q}function hL1(Z){let J=new Float32Array(Z.length*4/3);for(let X=0,Y=Z.length/3;X<Y;X++)J[X*4]=Z[X*3],J[X*4+1]=Z[X*3+1],J[X*4+2]=Z[X*3+2];return J}function fL1(Z,J){if(J===jJ.BufferViewUsage.ELEMENT_ARRAY_BUFFER)return Z.listParents().some((Y)=>{return Y instanceof OJ&&Y.getMode()===OJ.Mode.TRIANGLES})?cQ.TRIANGLES:cQ.INDICES;return cQ.ATTRIBUTES}function bL1(Z,J){let X=J.getGraph().listParentEdges(Z).filter((Y)=>!(Y.getParent()instanceof M2));for(let Y of X){let $=Y.getName(),Q=Y.getAttributes().key||"",W=Y.getParent().propertyType===s.PRIMITIVE_TARGET;if($==="indices")return{filter:G8.NONE};if($==="attributes"){if(Q==="POSITION")return{filter:G8.NONE};if(Q==="TEXCOORD_0")return{filter:G8.NONE};if(Q.startsWith("JOINTS_"))return{filter:G8.NONE};if(Q.startsWith("WEIGHTS_"))return{filter:G8.NONE};if(Q==="NORMAL"||Q==="TANGENT")return W?{filter:G8.NONE}:{filter:G8.OCTAHEDRAL,bits:8}}if($==="output"){let K=Gn(Z);if(K==="rotation")return{filter:G8.QUATERNION,bits:16};if(K==="translation")return{filter:G8.EXPONENTIAL,bits:12};if(K==="scale")return{filter:G8.EXPONENTIAL,bits:12};return{filter:G8.NONE}}if($==="input")return{filter:G8.NONE};if($==="inverseBindMatrices")return{filter:G8.NONE}}return{filter:G8.NONE}}function Gn(Z){for(let J of Z.listParents()){if(!(J instanceof mQ))continue;for(let X of J.listParents()){if(!(X instanceof UG))continue;return X.getTargetPath()}}return null}function yL1(Z){if(!Z.extensions||!Z.extensions[OP])return!1;return!!Z.extensions[OP].fallback}var a6=OP,oi={method:MG.QUANTIZE};class NG extends I1{constructor(...Z){super(...Z);this.extensionName=a6,this.prereadTypes=[s.BUFFER,s.PRIMITIVE],this.prewriteTypes=[s.BUFFER,s.ACCESSOR],this.readDependencies=["meshopt.decoder"],this.writeDependencies=["meshopt.encoder"],this._decoder=null,this._decoderFallbackBufferMap=new Map,this._encoder=null,this._encoderOptions=oi,this._encoderFallbackBuffer=null,this._encoderBufferViews={},this._encoderBufferViewData={},this._encoderBufferViewAccessors={}}install(Z,J){if(Z==="meshopt.decoder")this._decoder=J;if(Z==="meshopt.encoder")this._encoder=J;return this}setEncoderOptions(Z){return this._encoderOptions=UZ({},oi,Z),this}preread(Z,J){if(!this._decoder){if(!this.isRequired())return this;throw new Error(`[${a6}] Please install extension dependency, "meshopt.decoder".`)}if(!this._decoder.supported){if(!this.isRequired())return this;throw new Error(`[${a6}]: Missing WASM support.`)}if(J===s.BUFFER)this._prereadBuffers(Z);else if(J===s.PRIMITIVE)this._prereadPrimitives(Z);return this}_prereadBuffers(Z){let J=Z.jsonDoc;(J.json.bufferViews||[]).forEach((Y,$)=>{if(!Y.extensions||!Y.extensions[a6])return;let Q=Y.extensions[a6],W=Q.byteOffset||0,K=Q.byteLength||0,G=Q.count,H=Q.byteStride,z=new Uint8Array(G*H),q=J.json.buffers[Q.buffer],V=q.uri?J.resources[q.uri]:J.resources[GP],F=k6.toView(V,W,K);this._decoder.decodeGltfBuffer(z,G,H,F,Q.mode,Q.filter),Z.bufferViews[$]=z})}_prereadPrimitives(Z){let J=Z.jsonDoc;(J.json.bufferViews||[]).forEach((Y)=>{if(!Y.extensions||!Y.extensions[a6])return;let $=Y.extensions[a6],Q=Z.buffers[$.buffer],W=Z.buffers[Y.buffer],K=J.json.buffers[Y.buffer];if(yL1(K))this._decoderFallbackBufferMap.set(W,Q)})}read(Z){if(!this.isRequired())return this;for(let[J,X]of this._decoderFallbackBufferMap){for(let Y of J.listParents())if(Y instanceof R0)Y.swap(J,X);J.dispose()}return this}prewrite(Z,J){if(J===s.ACCESSOR)this._prewriteAccessors(Z);else if(J===s.BUFFER)this._prewriteBuffers(Z);return this}_prewriteAccessors(Z){let J=Z.jsonDoc.json,X=this._encoder,Y=this._encoderOptions,$=this.document.getGraph(),Q=this.document.createBuffer(),W=this.document.getRoot().listBuffers().indexOf(Q),K=1,G=new Map,H=(z)=>{for(let q of $.listParents(z)){if(q.propertyType===s.ROOT)continue;let V=G.get(z);if(V===void 0)G.set(z,V=K++);return V}return-1};this._encoderFallbackBuffer=Q,this._encoderBufferViews={},this._encoderBufferViewData={},this._encoderBufferViewAccessors={};for(let z of this.document.getRoot().listAccessors()){if(Gn(z)==="weights")continue;if(z.getSparse())continue;let q=Z.getAccessorUsage(z),V=Z.accessorUsageGroupedByParent.has(q)?H(z):null,F=fL1(z,q),U=Y.method===MG.FILTER?bL1(z,this.document):{filter:G8.NONE},w=_L1(z,X,F,U),{array:L,byteStride:O}=w,N=z.getBuffer();if(!N)throw new Error(`${a6}: Missing buffer for accessor.`);let M=this.document.getRoot().listBuffers().indexOf(N),j=[q,V,F,U.filter,O,M].join(":"),P=this._encoderBufferViews[j],D=this._encoderBufferViewData[j],C=this._encoderBufferViewAccessors[j];if(!P||!D)C=this._encoderBufferViewAccessors[j]=[],D=this._encoderBufferViewData[j]=[],P=this._encoderBufferViews[j]={buffer:W,target:jJ.USAGE_TO_TARGET[q],byteOffset:0,byteLength:0,byteStride:q===jJ.BufferViewUsage.ARRAY_BUFFER?O:void 0,extensions:{[a6]:{buffer:M,byteOffset:0,byteLength:0,mode:F,filter:U.filter!==G8.NONE?U.filter:void 0,byteStride:O,count:0}}};let k=Z.createAccessorDef(z);if(k.componentType=w.componentType,k.normalized=w.normalized,k.byteOffset=P.byteLength,k.min&&w.min)k.min=w.min;if(k.max&&w.max)k.max=w.max;Z.accessorIndexMap.set(z,J.accessors.length),J.accessors.push(k),C.push(k),D.push(new Uint8Array(L.buffer,L.byteOffset,L.byteLength)),P.byteLength+=L.byteLength,P.extensions.EXT_meshopt_compression.count+=z.getCount()}}_prewriteBuffers(Z){let J=this._encoder;for(let X in this._encoderBufferViews){let Y=this._encoderBufferViews[X],$=this._encoderBufferViewData[X],Q=this.document.getRoot().listBuffers()[Y.extensions[a6].buffer],W=Z.otherBufferViews.get(Q)||[],{count:K,byteStride:G,mode:H}=Y.extensions[a6],z=k6.concat($),q=J.encodeGltfBuffer(z,K,G,H),V=k6.pad(q);Y.extensions[a6].byteLength=q.byteLength,$.length=0,$.push(V),W.push(V),Z.otherBufferViews.set(Q,W)}}write(Z){let J=0;for(let Q in this._encoderBufferViews){let W=this._encoderBufferViews[Q],K=this._encoderBufferViewData[Q][0],G=Z.otherBufferViewsIndexMap.get(K),H=this._encoderBufferViewAccessors[Q];for(let F of H)F.bufferView=G;let z=Z.jsonDoc.json.bufferViews[G],q=z.byteOffset||0;Object.assign(z,W),z.byteOffset=J;let V=z.extensions[a6];V.byteOffset=q,J+=k6.padNumber(W.byteLength)}let X=this._encoderFallbackBuffer,Y=Z.bufferIndexMap.get(X),$=Z.jsonDoc.json.buffers[Y];return $.byteLength=J,$.extensions={[a6]:{fallback:!0}},X.dispose(),this}}NG.EXTENSION_NAME=a6;NG.EncoderMethod=MG;var BG=kL1;class Hn{match(Z){return Z.length>=12&&k6.decodeText(Z.slice(4,12))==="ftypavif"}getSize(Z){if(!this.match(Z))return null;let J=new DataView(Z.buffer,Z.byteOffset,Z.byteLength),X=ri(J,0);if(!X)return null;let Y=X.end;while(X=ri(J,Y))if(X.type==="meta")Y=X.start+4;else if(X.type==="iprp"||X.type==="ipco")Y=X.start;else if(X.type==="ispe")return[J.getUint32(X.start+4),J.getUint32(X.start+8)];else if(X.type==="mdat")break;else Y=X.end;return null}getChannels(Z){return 4}}class T2 extends I1{constructor(...Z){super(...Z);this.extensionName=BG,this.prereadTypes=[s.TEXTURE]}static register(){V4.registerFormat("image/avif",new Hn)}preread(Z){return(Z.jsonDoc.json.textures||[]).forEach((X)=>{if(X.extensions&&X.extensions[BG])X.source=X.extensions[BG].source}),this}read(Z){return this}write(Z){let J=Z.jsonDoc;return this.document.getRoot().listTextures().forEach((X)=>{if(X.getMimeType()==="image/avif"){let Y=Z.imageIndexMap.get(X);(J.json.textures||[]).forEach((Q)=>{if(Q.source===Y)Q.extensions=Q.extensions||{},Q.extensions[BG]={source:Q.source},delete Q.source})}}),this}}T2.EXTENSION_NAME=BG;function ri(Z,J){if(Z.byteLength<4+J)return null;let X=Z.getUint32(J);if(Z.byteLength<X+J||X<8)return null;return{type:k6.decodeText(new Uint8Array(Z.buffer,Z.byteOffset+J+4,4)),start:J+8,end:J+X}}var OG=TL1;class zn{match(Z){return Z.length>=12&&Z[8]===87&&Z[9]===69&&Z[10]===66&&Z[11]===80}getSize(Z){let J=k6.decodeText(Z.slice(0,4)),X=k6.decodeText(Z.slice(8,12));if(J!=="RIFF"||X!=="WEBP")return null;let Y=new DataView(Z.buffer,Z.byteOffset),$=12;while($<Y.byteLength){let Q=k6.decodeText(new Uint8Array([Y.getUint8($),Y.getUint8($+1),Y.getUint8($+2),Y.getUint8($+3)])),W=Y.getUint32($+4,!0);if(Q==="VP8 "){let K=Y.getInt16($+14,!0)&16383,G=Y.getInt16($+16,!0)&16383;return[K,G]}else if(Q==="VP8L"){let K=Y.getUint8($+9),G=Y.getUint8($+10),H=Y.getUint8($+11),z=Y.getUint8($+12),q=1+((G&63)<<8|K),V=1+((z&15)<<10|H<<2|(G&192)>>6);return[q,V]}$+=8+W+W%2}return null}getChannels(Z){return 4}}class k2 extends I1{constructor(...Z){super(...Z);this.extensionName=OG,this.prereadTypes=[s.TEXTURE]}static register(){V4.registerFormat("image/webp",new zn)}preread(Z){return(Z.jsonDoc.json.textures||[]).forEach((X)=>{if(X.extensions&&X.extensions[OG])X.source=X.extensions[OG].source}),this}read(Z){return this}write(Z){let J=Z.jsonDoc;return this.document.getRoot().listTextures().forEach((X)=>{if(X.getMimeType()==="image/webp"){let Y=Z.imageIndexMap.get(X);(J.json.textures||[]).forEach((Q)=>{if(Q.source===Y)Q.extensions=Q.extensions||{},Q.extensions[OG]={source:Q.source},delete Q.source})}}),this}}k2.EXTENSION_NAME=OG;var ti=Kn,d8,qn,Vn;function gL1(Z,J){let X=new d8.DecoderBuffer;try{if(X.Init(J,J.length),Z.GetEncodedGeometryType(X)!==d8.TRIANGULAR_MESH)throw new Error(`[${ti}] Unknown geometry type.`);let $=new d8.Mesh;if(!Z.DecodeBufferToMesh(X,$).ok()||$.ptr===0)throw new Error(`[${ti}] Decoding failure.`);return $}finally{d8.destroy(X)}}function mL1(Z,J){let Y=J.num_faces()*3,$,Q;if(J.num_points()<=65534){let W=Y*Uint16Array.BYTES_PER_ELEMENT;$=d8._malloc(W),Z.GetTrianglesUInt16Array(J,W,$),Q=new Uint16Array(d8.HEAPU16.buffer,$,Y).slice()}else{let W=Y*Uint32Array.BYTES_PER_ELEMENT;$=d8._malloc(W),Z.GetTrianglesUInt32Array(J,W,$),Q=new Uint32Array(d8.HEAPU32.buffer,$,Y).slice()}return d8._free($),Q}function uL1(Z,J,X,Y){let $=Vn[Y.componentType],Q=qn[Y.componentType],W=X.num_components(),G=J.num_points()*W,H=G*Q.BYTES_PER_ELEMENT,z=d8._malloc(H);Z.GetAttributeDataArrayForAllPoints(J,X,$,H,z);let q=new Q(d8.HEAPF32.buffer,z,G).slice();return d8._free(z),q}function dL1(Z){d8=Z,qn={[R0.ComponentType.FLOAT]:Float32Array,[R0.ComponentType.UNSIGNED_INT]:Uint32Array,[R0.ComponentType.UNSIGNED_SHORT]:Uint16Array,[R0.ComponentType.UNSIGNED_BYTE]:Uint8Array,[R0.ComponentType.SHORT]:Int16Array,[R0.ComponentType.BYTE]:Int8Array},Vn={[R0.ComponentType.FLOAT]:d8.DT_FLOAT32,[R0.ComponentType.UNSIGNED_INT]:d8.DT_UINT32,[R0.ComponentType.UNSIGNED_SHORT]:d8.DT_UINT16,[R0.ComponentType.UNSIGNED_BYTE]:d8.DT_UINT8,[R0.ComponentType.SHORT]:d8.DT_INT16,[R0.ComponentType.BYTE]:d8.DT_INT8}}var D9,RG;(function(Z){Z[Z.EDGEBREAKER=1]="EDGEBREAKER",Z[Z.SEQUENTIAL=0]="SEQUENTIAL"})(RG||(RG={}));var P9;(function(Z){Z.POSITION="POSITION",Z.NORMAL="NORMAL",Z.COLOR="COLOR",Z.TEX_COORD="TEX_COORD",Z.GENERIC="GENERIC"})(P9||(P9={}));var Fn={[P9.POSITION]:14,[P9.NORMAL]:10,[P9.COLOR]:8,[P9.TEX_COORD]:12,[P9.GENERIC]:12},ei={decodeSpeed:5,encodeSpeed:5,method:RG.EDGEBREAKER,quantizationBits:Fn,quantizationVolume:"mesh"};function cL1(Z){D9=Z}function lL1(Z,J=ei){let X=UZ({},ei,J);X.quantizationBits=UZ({},Fn,J.quantizationBits);let Y=new D9.MeshBuilder,$=new D9.Mesh,Q=new D9.ExpertEncoder($),W={},K=new D9.DracoInt8Array,G=Z.listTargets().length>0,H=!1;for(let w of Z.listSemantics()){let L=Z.getAttribute(w);if(L.getSparse()){H=!0;continue}let O=pL1(w),N=iL1(Y,L.getComponentType(),$,D9[O],L.getCount(),L.getElementSize(),L.getArray());if(N===-1)throw new Error(`Error compressing "${w}" attribute.`);if(W[w]=N,X.quantizationVolume==="mesh"||w!=="POSITION")Q.SetAttributeQuantization(N,X.quantizationBits[O]);else if(typeof X.quantizationVolume==="object"){let{quantizationVolume:M}=X,j=Math.max(M.max[0]-M.min[0],M.max[1]-M.min[1],M.max[2]-M.min[2]);Q.SetAttributeExplicitQuantization(N,X.quantizationBits[O],L.getElementSize(),M.min,j)}else throw new Error("Invalid quantization volume state.")}let z=Z.getIndices();if(!z)throw new D2("Primitive must have indices.");if(Y.AddFacesToMesh($,z.getCount()/3,z.getArray()),Q.SetSpeedOptions(X.encodeSpeed,X.decodeSpeed),Q.SetTrackEncodedProperties(!0),X.method===RG.SEQUENTIAL||G||H)Q.SetEncodingMethod(D9.MESH_SEQUENTIAL_ENCODING);else Q.SetEncodingMethod(D9.MESH_EDGEBREAKER_ENCODING);let q=Q.EncodeToDracoBuffer(!(G||H),K);if(q<=0)throw new D2("Error applying Draco compression.");let V=new Uint8Array(q);for(let w=0;w<q;++w)V[w]=K.GetValue(w);let F=Q.GetNumberOfEncodedPoints(),U=Q.GetNumberOfEncodedFaces()*3;return D9.destroy(K),D9.destroy($),D9.destroy(Y),D9.destroy(Q),{numVertices:F,numIndices:U,data:V,attributeIDs:W}}function pL1(Z){if(Z==="POSITION")return P9.POSITION;else if(Z==="NORMAL")return P9.NORMAL;else if(Z.startsWith("COLOR_"))return P9.COLOR;else if(Z.startsWith("TEXCOORD_"))return P9.TEX_COORD;return P9.GENERIC}function iL1(Z,J,X,Y,$,Q,W){switch(J){case R0.ComponentType.UNSIGNED_BYTE:return Z.AddUInt8Attribute(X,Y,$,Q,W);case R0.ComponentType.BYTE:return Z.AddInt8Attribute(X,Y,$,Q,W);case R0.ComponentType.UNSIGNED_SHORT:return Z.AddUInt16Attribute(X,Y,$,Q,W);case R0.ComponentType.SHORT:return Z.AddInt16Attribute(X,Y,$,Q,W);case R0.ComponentType.UNSIGNED_INT:return Z.AddUInt32Attribute(X,Y,$,Q,W);case R0.ComponentType.FLOAT:return Z.AddFloatAttribute(X,Y,$,Q,W);default:throw new Error(`Unexpected component type, "${J}".`)}}class D2 extends Error{}var N8=Kn;class DG extends I1{constructor(...Z){super(...Z);this.extensionName=N8,this.prereadTypes=[s.PRIMITIVE],this.prewriteTypes=[s.ACCESSOR],this.readDependencies=["draco3d.decoder"],this.writeDependencies=["draco3d.encoder"],this._decoderModule=null,this._encoderModule=null,this._encoderOptions={}}install(Z,J){if(Z==="draco3d.decoder")this._decoderModule=J,dL1(this._decoderModule);if(Z==="draco3d.encoder")this._encoderModule=J,cL1(this._encoderModule);return this}setEncoderOptions(Z){return this._encoderOptions=Z,this}preread(Z){if(!this._decoderModule)throw new Error(`[${N8}] Please install extension dependency, "draco3d.decoder".`);let J=this.document.getLogger(),X=Z.jsonDoc,Y=new Map;try{let $=X.json.meshes||[];for(let Q of $)for(let W of Q.primitives){if(!W.extensions||!W.extensions[N8])continue;let K=W.extensions[N8],[G,H]=Y.get(K.bufferView)||[];if(!H||!G){let z=X.json.bufferViews[K.bufferView],q=X.json.buffers[z.buffer],V=q.uri?X.resources[q.uri]:X.resources[GP],F=z.byteOffset||0,U=z.byteLength,w=k6.toView(V,F,U);G=new this._decoderModule.Decoder,H=gL1(G,w),Y.set(K.bufferView,[G,H]),J.debug(`[${N8}] Decompressed ${w.byteLength} bytes.`)}for(let z in K.attributes){let q=Z.jsonDoc.json.accessors[W.attributes[z]],V=G.GetAttributeByUniqueId(H,K.attributes[z]),F=uL1(G,H,V,q);Z.accessors[W.attributes[z]].setArray(F)}if(W.indices!==void 0)Z.accessors[W.indices].setArray(mL1(G,H))}}finally{for(let[$,Q]of Array.from(Y.values()))this._decoderModule.destroy($),this._decoderModule.destroy(Q)}return this}read(Z){return this}prewrite(Z,J){if(!this._encoderModule)throw new Error(`[${N8}] Please install extension dependency, "draco3d.encoder".`);let X=this.document.getLogger();X.debug(`[${N8}] Compression options: ${JSON.stringify(this._encoderOptions)}`);let Y=nL1(this.document),$=new Map,Q="mesh";if(this._encoderOptions.quantizationVolume==="scene")if(this.document.getRoot().listScenes().length!==1)X.warn(`[${N8}]: quantizationVolume=scene requires exactly 1 scene.`);else Q=gi(this.document.getRoot().listScenes().pop());for(let W of Array.from(Y.keys())){let K=Y.get(W);if(!K)throw new Error("Unexpected primitive.");if($.has(K)){$.set(K,$.get(K));continue}let G=W.getIndices(),H=Z.jsonDoc.json.accessors,z;try{z=lL1(W,UZ({},this._encoderOptions,{quantizationVolume:Q}))}catch(F){if(F instanceof D2){X.warn(`[${N8}]: ${F.message} Skipping primitive compression.`);continue}throw F}$.set(K,z);let q=Z.createAccessorDef(G);if(q.count=z.numIndices,Z.accessorIndexMap.set(G,H.length),H.push(q),z.numVertices>65534&&R0.getComponentSize(q.componentType)<=2)q.componentType=R0.ComponentType.UNSIGNED_INT;else if(z.numVertices>254&&R0.getComponentSize(q.componentType)<=1)q.componentType=R0.ComponentType.UNSIGNED_SHORT;for(let F of W.listSemantics()){let U=W.getAttribute(F);if(z.attributeIDs[F]===void 0)continue;let w=Z.createAccessorDef(U);w.count=z.numVertices,Z.accessorIndexMap.set(U,H.length),H.push(w)}let V=W.getAttribute("POSITION").getBuffer()||this.document.getRoot().listBuffers()[0];if(!Z.otherBufferViews.has(V))Z.otherBufferViews.set(V,[]);Z.otherBufferViews.get(V).push(z.data)}return X.debug(`[${N8}] Compressed ${Y.size} primitives.`),Z.extensionData[N8]={primitiveHashMap:Y,primitiveEncodingMap:$},this}write(Z){let J=Z.extensionData[N8];for(let X of this.document.getRoot().listMeshes()){let Y=Z.jsonDoc.json.meshes[Z.meshIndexMap.get(X)];for(let $=0;$<X.listPrimitives().length;$++){let Q=X.listPrimitives()[$],W=Y.primitives[$],K=J.primitiveHashMap.get(Q);if(!K)continue;let G=J.primitiveEncodingMap.get(K);if(!G)continue;W.extensions=W.extensions||{},W.extensions[N8]={bufferView:Z.otherBufferViewsIndexMap.get(G.data),attributes:G.attributeIDs}}}if(!J.primitiveHashMap.size){let X=Z.jsonDoc.json;X.extensionsUsed=(X.extensionsUsed||[]).filter((Y)=>Y!==N8),X.extensionsRequired=(X.extensionsRequired||[]).filter((Y)=>Y!==N8)}return this}}DG.EXTENSION_NAME=N8;DG.EncoderMethod=RG;function nL1(Z){let J=Z.getLogger(),X=new Set,Y=new Set,$=0,Q=0;for(let q of Z.getRoot().listMeshes())for(let V of q.listPrimitives())if(!V.getIndices())Y.add(V),$++;else if(V.getMode()!==OJ.Mode.TRIANGLES)Y.add(V),Q++;else X.add(V);if($>0)J.warn(`[${N8}] Skipping Draco compression of ${$} non-indexed primitives.`);if(Q>0)J.warn(`[${N8}] Skipping Draco compression of ${Q} non-TRIANGLES primitives.`);let W=Z.getRoot().listAccessors(),K=new Map;for(let q=0;q<W.length;q++)K.set(W[q],q);let G=new Map,H=new Set,z=new Map;for(let q of Array.from(X)){let V=Zn(q,K);if(H.has(V)){z.set(q,V);continue}if(G.has(q.getIndices())){let F=q.getIndices(),U=F.clone();K.set(U,Z.getRoot().listAccessors().length-1),q.swap(F,U)}for(let F of q.listAttributes())if(G.has(F)){let U=F.clone();K.set(U,Z.getRoot().listAccessors().length-1),q.swap(F,U)}V=Zn(q,K),H.add(V),z.set(q,V),G.set(q.getIndices(),V);for(let F of q.listAttributes())G.set(F,V)}for(let q of Array.from(G.keys())){let V=new Set(q.listParents().map((F)=>F.propertyType));if(V.size!==2||!V.has(s.PRIMITIVE)||!V.has(s.ROOT))throw new Error(`[${N8}] Compressed accessors must only be used as indices or vertex attributes.`)}for(let q of Array.from(X)){let V=z.get(q),F=q.getIndices();if(G.get(F)!==V||q.listAttributes().some((U)=>G.get(U)!==V))throw new Error(`[${N8}] Draco primitives must share all, or no, accessors.`)}for(let q of Array.from(Y)){let V=q.getIndices();if(G.has(V)||q.listAttributes().some((F)=>G.has(F)))throw new Error(`[${N8}] Accessor cannot be shared by compressed and uncompressed primitives.`)}return z}function Zn(Z,J){let X=[],Y=Z.getIndices();X.push(J.get(Y));for(let $ of Z.listAttributes())X.push(J.get($));return X.sort().join("|")}class lQ extends n1{init(){this.extensionName=NP,this.propertyType="Light",this.parentTypes=[s.NODE]}getDefaults(){return Object.assign(super.getDefaults(),{color:[1,1,1],intensity:1,type:lQ.Type.POINT,range:null,innerConeAngle:0,outerConeAngle:Math.PI/4})}getColor(){return this.get("color")}setColor(Z){return this.set("color",Z)}getIntensity(){return this.get("intensity")}setIntensity(Z){return this.set("intensity",Z)}getType(){return this.get("type")}setType(Z){return this.set("type",Z)}getRange(){return this.get("range")}setRange(Z){return this.set("range",Z)}getInnerConeAngle(){return this.get("innerConeAngle")}setInnerConeAngle(Z){return this.set("innerConeAngle",Z)}getOuterConeAngle(){return this.get("outerConeAngle")}setOuterConeAngle(Z){return this.set("outerConeAngle",Z)}}lQ.EXTENSION_NAME=NP;lQ.Type={POINT:"point",SPOT:"spot",DIRECTIONAL:"directional"};var G7=NP;class yP extends I1{constructor(...Z){super(...Z);this.extensionName=G7}createLight(Z=""){return new lQ(this.document.getGraph(),Z)}read(Z){let J=Z.jsonDoc;if(!J.json.extensions||!J.json.extensions[G7])return this;let $=(J.json.extensions[G7].lights||[]).map((Q)=>{var W,K;let G=this.createLight().setName(Q.name||"").setType(Q.type);if(Q.color!==void 0)G.setColor(Q.color);if(Q.intensity!==void 0)G.setIntensity(Q.intensity);if(Q.range!==void 0)G.setRange(Q.range);if(((W=Q.spot)==null?void 0:W.innerConeAngle)!==void 0)G.setInnerConeAngle(Q.spot.innerConeAngle);if(((K=Q.spot)==null?void 0:K.outerConeAngle)!==void 0)G.setOuterConeAngle(Q.spot.outerConeAngle);return G});return J.json.nodes.forEach((Q,W)=>{if(!Q.extensions||!Q.extensions[G7])return;let K=Q.extensions[G7];Z.nodes[W].setExtension(G7,$[K.light])}),this}write(Z){let J=Z.jsonDoc;if(this.properties.size===0)return this;let X=[],Y=new Map;for(let $ of this.properties){let Q=$,W={type:Q.getType()};if(!K8.eq(Q.getColor(),[1,1,1]))W.color=Q.getColor();if(Q.getIntensity()!==1)W.intensity=Q.getIntensity();if(Q.getRange()!=null)W.range=Q.getRange();if(Q.getName())W.name=Q.getName();if(Q.getType()===lQ.Type.SPOT)W.spot={innerConeAngle:Q.getInnerConeAngle(),outerConeAngle:Q.getOuterConeAngle()};X.push(W),Y.set(Q,X.length-1)}return this.document.getRoot().listNodes().forEach(($)=>{let Q=$.getExtension(G7);if(Q){let W=Z.nodeIndexMap.get($),K=J.json.nodes[W];K.extensions=K.extensions||{},K.extensions[G7]={light:Y.get(Q)}}}),J.json.extensions=J.json.extensions||{},J.json.extensions[G7]={lights:X},this}}yP.EXTENSION_NAME=G7;var{R:aL1,G:sL1,B:oL1}=n5;class gP extends n1{init(){this.extensionName=DP,this.propertyType="Anisotropy",this.parentTypes=[s.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{anisotropyStrength:0,anisotropyRotation:0,anisotropyTexture:null,anisotropyTextureInfo:new T1(this.graph,"anisotropyTextureInfo")})}getAnisotropyStrength(){return this.get("anisotropyStrength")}setAnisotropyStrength(Z){return this.set("anisotropyStrength",Z)}getAnisotropyRotation(){return this.get("anisotropyRotation")}setAnisotropyRotation(Z){return this.set("anisotropyRotation",Z)}getAnisotropyTexture(){return this.getRef("anisotropyTexture")}getAnisotropyTextureInfo(){return this.getRef("anisotropyTexture")?this.getRef("anisotropyTextureInfo"):null}setAnisotropyTexture(Z){return this.setRef("anisotropyTexture",Z,{channels:aL1|sL1|oL1})}}gP.EXTENSION_NAME=DP;var KY=DP;class mP extends I1{constructor(...Z){super(...Z);this.extensionName=KY,this.prereadTypes=[s.MESH],this.prewriteTypes=[s.MESH]}createAnisotropy(){return new gP(this.document.getGraph())}read(Z){return this}write(Z){return this}preread(Z){let J=Z.jsonDoc,X=J.json.materials||[],Y=J.json.textures||[];return X.forEach(($,Q)=>{if($.extensions&&$.extensions[KY]){let W=this.createAnisotropy();Z.materials[Q].setExtension(KY,W);let K=$.extensions[KY];if(K.anisotropyStrength!==void 0)W.setAnisotropyStrength(K.anisotropyStrength);if(K.anisotropyRotation!==void 0)W.setAnisotropyRotation(K.anisotropyRotation);if(K.anisotropyTexture!==void 0){let G=K.anisotropyTexture,H=Z.textures[Y[G.index].source];W.setAnisotropyTexture(H),Z.setTextureInfo(W.getAnisotropyTextureInfo(),G)}}}),this}prewrite(Z){let J=Z.jsonDoc;return this.document.getRoot().listMaterials().forEach((X)=>{let Y=X.getExtension(KY);if(Y){let $=Z.materialIndexMap.get(X),Q=J.json.materials[$];Q.extensions=Q.extensions||{};let W=Q.extensions[KY]={};if(Y.getAnisotropyStrength()>0)W.anisotropyStrength=Y.getAnisotropyStrength();if(Y.getAnisotropyRotation()!==0)W.anisotropyRotation=Y.getAnisotropyRotation();if(Y.getAnisotropyTexture()){let K=Y.getAnisotropyTexture(),G=Y.getAnisotropyTextureInfo();W.anisotropyTexture=Z.createTextureInfoDef(K,G)}}}),this}}mP.EXTENSION_NAME=KY;var{R:Jn,G:Xn,B:rL1}=n5;class uP extends n1{init(){this.extensionName=PP,this.propertyType="Clearcoat",this.parentTypes=[s.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{clearcoatFactor:0,clearcoatTexture:null,clearcoatTextureInfo:new T1(this.graph,"clearcoatTextureInfo"),clearcoatRoughnessFactor:0,clearcoatRoughnessTexture:null,clearcoatRoughnessTextureInfo:new T1(this.graph,"clearcoatRoughnessTextureInfo"),clearcoatNormalScale:1,clearcoatNormalTexture:null,clearcoatNormalTextureInfo:new T1(this.graph,"clearcoatNormalTextureInfo")})}getClearcoatFactor(){return this.get("clearcoatFactor")}setClearcoatFactor(Z){return this.set("clearcoatFactor",Z)}getClearcoatTexture(){return this.getRef("clearcoatTexture")}getClearcoatTextureInfo(){return this.getRef("clearcoatTexture")?this.getRef("clearcoatTextureInfo"):null}setClearcoatTexture(Z){return this.setRef("clearcoatTexture",Z,{channels:Jn})}getClearcoatRoughnessFactor(){return this.get("clearcoatRoughnessFactor")}setClearcoatRoughnessFactor(Z){return this.set("clearcoatRoughnessFactor",Z)}getClearcoatRoughnessTexture(){return this.getRef("clearcoatRoughnessTexture")}getClearcoatRoughnessTextureInfo(){return this.getRef("clearcoatRoughnessTexture")?this.getRef("clearcoatRoughnessTextureInfo"):null}setClearcoatRoughnessTexture(Z){return this.setRef("clearcoatRoughnessTexture",Z,{channels:Xn})}getClearcoatNormalScale(){return this.get("clearcoatNormalScale")}setClearcoatNormalScale(Z){return this.set("clearcoatNormalScale",Z)}getClearcoatNormalTexture(){return this.getRef("clearcoatNormalTexture")}getClearcoatNormalTextureInfo(){return this.getRef("clearcoatNormalTexture")?this.getRef("clearcoatNormalTextureInfo"):null}setClearcoatNormalTexture(Z){return this.setRef("clearcoatNormalTexture",Z,{channels:Jn|Xn|rL1})}}uP.EXTENSION_NAME=PP;var GY=PP;class dP extends I1{constructor(...Z){super(...Z);this.extensionName=GY,this.prereadTypes=[s.MESH],this.prewriteTypes=[s.MESH]}createClearcoat(){return new uP(this.document.getGraph())}read(Z){return this}write(Z){return this}preread(Z){let J=Z.jsonDoc,X=J.json.materials||[],Y=J.json.textures||[];return X.forEach(($,Q)=>{if($.extensions&&$.extensions[GY]){let W=this.createClearcoat();Z.materials[Q].setExtension(GY,W);let K=$.extensions[GY];if(K.clearcoatFactor!==void 0)W.setClearcoatFactor(K.clearcoatFactor);if(K.clearcoatRoughnessFactor!==void 0)W.setClearcoatRoughnessFactor(K.clearcoatRoughnessFactor);if(K.clearcoatTexture!==void 0){let G=K.clearcoatTexture,H=Z.textures[Y[G.index].source];W.setClearcoatTexture(H),Z.setTextureInfo(W.getClearcoatTextureInfo(),G)}if(K.clearcoatRoughnessTexture!==void 0){let G=K.clearcoatRoughnessTexture,H=Z.textures[Y[G.index].source];W.setClearcoatRoughnessTexture(H),Z.setTextureInfo(W.getClearcoatRoughnessTextureInfo(),G)}if(K.clearcoatNormalTexture!==void 0){let G=K.clearcoatNormalTexture,H=Z.textures[Y[G.index].source];if(W.setClearcoatNormalTexture(H),Z.setTextureInfo(W.getClearcoatNormalTextureInfo(),G),G.scale!==void 0)W.setClearcoatNormalScale(G.scale)}}}),this}prewrite(Z){let J=Z.jsonDoc;return this.document.getRoot().listMaterials().forEach((X)=>{let Y=X.getExtension(GY);if(Y){let $=Z.materialIndexMap.get(X),Q=J.json.materials[$];Q.extensions=Q.extensions||{};let W=Q.extensions[GY]={clearcoatFactor:Y.getClearcoatFactor(),clearcoatRoughnessFactor:Y.getClearcoatRoughnessFactor()};if(Y.getClearcoatTexture()){let K=Y.getClearcoatTexture(),G=Y.getClearcoatTextureInfo();W.clearcoatTexture=Z.createTextureInfoDef(K,G)}if(Y.getClearcoatRoughnessTexture()){let K=Y.getClearcoatRoughnessTexture(),G=Y.getClearcoatRoughnessTextureInfo();W.clearcoatRoughnessTexture=Z.createTextureInfoDef(K,G)}if(Y.getClearcoatNormalTexture()){let K=Y.getClearcoatNormalTexture(),G=Y.getClearcoatNormalTextureInfo();if(W.clearcoatNormalTexture=Z.createTextureInfoDef(K,G),Y.getClearcoatNormalScale()!==1)W.clearcoatNormalTexture.scale=Y.getClearcoatNormalScale()}}}),this}}dP.EXTENSION_NAME=GY;var{R:tL1,G:eL1,B:Zw1,A:Jw1}=n5;class cP extends n1{init(){this.extensionName=CP,this.propertyType="DiffuseTransmission",this.parentTypes=[s.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{diffuseTransmissionFactor:0,diffuseTransmissionTexture:null,diffuseTransmissionTextureInfo:new T1(this.graph,"diffuseTransmissionTextureInfo"),diffuseTransmissionColorFactor:[1,1,1],diffuseTransmissionColorTexture:null,diffuseTransmissionColorTextureInfo:new T1(this.graph,"diffuseTransmissionColorTextureInfo")})}getDiffuseTransmissionFactor(){return this.get("diffuseTransmissionFactor")}setDiffuseTransmissionFactor(Z){return this.set("diffuseTransmissionFactor",Z)}getDiffuseTransmissionTexture(){return this.getRef("diffuseTransmissionTexture")}getDiffuseTransmissionTextureInfo(){return this.getRef("diffuseTransmissionTexture")?this.getRef("diffuseTransmissionTextureInfo"):null}setDiffuseTransmissionTexture(Z){return this.setRef("diffuseTransmissionTexture",Z,{channels:Jw1})}getDiffuseTransmissionColorFactor(){return this.get("diffuseTransmissionColorFactor")}setDiffuseTransmissionColorFactor(Z){return this.set("diffuseTransmissionColorFactor",Z)}getDiffuseTransmissionColorTexture(){return this.getRef("diffuseTransmissionColorTexture")}getDiffuseTransmissionColorTextureInfo(){return this.getRef("diffuseTransmissionColorTexture")?this.getRef("diffuseTransmissionColorTextureInfo"):null}setDiffuseTransmissionColorTexture(Z){return this.setRef("diffuseTransmissionColorTexture",Z,{channels:tL1|eL1|Zw1})}}cP.EXTENSION_NAME=CP;var HY=CP;class lP extends I1{constructor(...Z){super(...Z);this.extensionName=HY}createDiffuseTransmission(){return new cP(this.document.getGraph())}read(Z){let J=Z.jsonDoc,X=J.json.materials||[],Y=J.json.textures||[];return X.forEach(($,Q)=>{if($.extensions&&$.extensions[HY]){let W=this.createDiffuseTransmission();Z.materials[Q].setExtension(HY,W);let K=$.extensions[HY];if(K.diffuseTransmissionFactor!==void 0)W.setDiffuseTransmissionFactor(K.diffuseTransmissionFactor);if(K.diffuseTransmissionColorFactor!==void 0)W.setDiffuseTransmissionColorFactor(K.diffuseTransmissionColorFactor);if(K.diffuseTransmissionTexture!==void 0){let G=K.diffuseTransmissionTexture,H=Z.textures[Y[G.index].source];W.setDiffuseTransmissionTexture(H),Z.setTextureInfo(W.getDiffuseTransmissionTextureInfo(),G)}if(K.diffuseTransmissionColorTexture!==void 0){let G=K.diffuseTransmissionColorTexture,H=Z.textures[Y[G.index].source];W.setDiffuseTransmissionColorTexture(H),Z.setTextureInfo(W.getDiffuseTransmissionColorTextureInfo(),G)}}}),this}write(Z){let J=Z.jsonDoc;for(let X of this.document.getRoot().listMaterials()){let Y=X.getExtension(HY);if(!Y)continue;let $=Z.materialIndexMap.get(X),Q=J.json.materials[$];Q.extensions=Q.extensions||{};let W=Q.extensions[HY]={diffuseTransmissionFactor:Y.getDiffuseTransmissionFactor(),diffuseTransmissionColorFactor:Y.getDiffuseTransmissionColorFactor()};if(Y.getDiffuseTransmissionTexture()){let K=Y.getDiffuseTransmissionTexture(),G=Y.getDiffuseTransmissionTextureInfo();W.diffuseTransmissionTexture=Z.createTextureInfoDef(K,G)}if(Y.getDiffuseTransmissionColorTexture()){let K=Y.getDiffuseTransmissionColorTexture(),G=Y.getDiffuseTransmissionColorTextureInfo();W.diffuseTransmissionColorTexture=Z.createTextureInfoDef(K,G)}}return this}}lP.EXTENSION_NAME=HY;class pP extends n1{init(){this.extensionName=TP,this.propertyType="Dispersion",this.parentTypes=[s.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{dispersion:0})}getDispersion(){return this.get("dispersion")}setDispersion(Z){return this.set("dispersion",Z)}}pP.EXTENSION_NAME=TP;var zY=TP;class iP extends I1{constructor(...Z){super(...Z);this.extensionName=zY,this.prereadTypes=[s.MESH],this.prewriteTypes=[s.MESH]}createDispersion(){return new pP(this.document.getGraph())}read(Z){return this}write(Z){return this}preread(Z){return(Z.jsonDoc.json.materials||[]).forEach((Y,$)=>{if(Y.extensions&&Y.extensions[zY]){let Q=this.createDispersion();Z.materials[$].setExtension(zY,Q);let W=Y.extensions[zY];if(W.dispersion!==void 0)Q.setDispersion(W.dispersion)}}),this}prewrite(Z){let J=Z.jsonDoc;return this.document.getRoot().listMaterials().forEach((X)=>{let Y=X.getExtension(zY);if(Y){let $=Z.materialIndexMap.get(X),Q=J.json.materials[$];Q.extensions=Q.extensions||{},Q.extensions[zY]={dispersion:Y.getDispersion()}}}),this}}iP.EXTENSION_NAME=zY;class nP extends n1{init(){this.extensionName=kP,this.propertyType="EmissiveStrength",this.parentTypes=[s.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{emissiveStrength:1})}getEmissiveStrength(){return this.get("emissiveStrength")}setEmissiveStrength(Z){return this.set("emissiveStrength",Z)}}nP.EXTENSION_NAME=kP;var qY=kP;class aP extends I1{constructor(...Z){super(...Z);this.extensionName=qY,this.prereadTypes=[s.MESH],this.prewriteTypes=[s.MESH]}createEmissiveStrength(){return new nP(this.document.getGraph())}read(Z){return this}write(Z){return this}preread(Z){return(Z.jsonDoc.json.materials||[]).forEach((Y,$)=>{if(Y.extensions&&Y.extensions[qY]){let Q=this.createEmissiveStrength();Z.materials[$].setExtension(qY,Q);let W=Y.extensions[qY];if(W.emissiveStrength!==void 0)Q.setEmissiveStrength(W.emissiveStrength)}}),this}prewrite(Z){let J=Z.jsonDoc;return this.document.getRoot().listMaterials().forEach((X)=>{let Y=X.getExtension(qY);if(Y){let $=Z.materialIndexMap.get(X),Q=J.json.materials[$];Q.extensions=Q.extensions||{},Q.extensions[qY]={emissiveStrength:Y.getEmissiveStrength()}}}),this}}aP.EXTENSION_NAME=qY;class sP extends n1{init(){this.extensionName=EP,this.propertyType="IOR",this.parentTypes=[s.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{ior:1.5})}getIOR(){return this.get("ior")}setIOR(Z){return this.set("ior",Z)}}sP.EXTENSION_NAME=EP;var VY=EP;class E2 extends I1{constructor(...Z){super(...Z);this.extensionName=VY,this.prereadTypes=[s.MESH],this.prewriteTypes=[s.MESH]}createIOR(){return new sP(this.document.getGraph())}read(Z){return this}write(Z){return this}preread(Z){return(Z.jsonDoc.json.materials||[]).forEach((Y,$)=>{if(Y.extensions&&Y.extensions[VY]){let Q=this.createIOR();Z.materials[$].setExtension(VY,Q);let W=Y.extensions[VY];if(W.ior!==void 0)Q.setIOR(W.ior)}}),this}prewrite(Z){let J=Z.jsonDoc;return this.document.getRoot().listMaterials().forEach((X)=>{let Y=X.getExtension(VY);if(Y){let $=Z.materialIndexMap.get(X),Q=J.json.materials[$];Q.extensions=Q.extensions||{},Q.extensions[VY]={ior:Y.getIOR()}}}),this}}E2.EXTENSION_NAME=VY;var{R:Xw1,G:Yw1}=n5;class oP extends n1{init(){this.extensionName=IP,this.propertyType="Iridescence",this.parentTypes=[s.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{iridescenceFactor:0,iridescenceTexture:null,iridescenceTextureInfo:new T1(this.graph,"iridescenceTextureInfo"),iridescenceIOR:1.3,iridescenceThicknessMinimum:100,iridescenceThicknessMaximum:400,iridescenceThicknessTexture:null,iridescenceThicknessTextureInfo:new T1(this.graph,"iridescenceThicknessTextureInfo")})}getIridescenceFactor(){return this.get("iridescenceFactor")}setIridescenceFactor(Z){return this.set("iridescenceFactor",Z)}getIridescenceTexture(){return this.getRef("iridescenceTexture")}getIridescenceTextureInfo(){return this.getRef("iridescenceTexture")?this.getRef("iridescenceTextureInfo"):null}setIridescenceTexture(Z){return this.setRef("iridescenceTexture",Z,{channels:Xw1})}getIridescenceIOR(){return this.get("iridescenceIOR")}setIridescenceIOR(Z){return this.set("iridescenceIOR",Z)}getIridescenceThicknessMinimum(){return this.get("iridescenceThicknessMinimum")}setIridescenceThicknessMinimum(Z){return this.set("iridescenceThicknessMinimum",Z)}getIridescenceThicknessMaximum(){return this.get("iridescenceThicknessMaximum")}setIridescenceThicknessMaximum(Z){return this.set("iridescenceThicknessMaximum",Z)}getIridescenceThicknessTexture(){return this.getRef("iridescenceThicknessTexture")}getIridescenceThicknessTextureInfo(){return this.getRef("iridescenceThicknessTexture")?this.getRef("iridescenceThicknessTextureInfo"):null}setIridescenceThicknessTexture(Z){return this.setRef("iridescenceThicknessTexture",Z,{channels:Yw1})}}oP.EXTENSION_NAME=IP;var FY=IP;class rP extends I1{constructor(...Z){super(...Z);this.extensionName=FY,this.prereadTypes=[s.MESH],this.prewriteTypes=[s.MESH]}createIridescence(){return new oP(this.document.getGraph())}read(Z){return this}write(Z){return this}preread(Z){let J=Z.jsonDoc,X=J.json.materials||[],Y=J.json.textures||[];return X.forEach(($,Q)=>{if($.extensions&&$.extensions[FY]){let W=this.createIridescence();Z.materials[Q].setExtension(FY,W);let K=$.extensions[FY];if(K.iridescenceFactor!==void 0)W.setIridescenceFactor(K.iridescenceFactor);if(K.iridescenceIor!==void 0)W.setIridescenceIOR(K.iridescenceIor);if(K.iridescenceThicknessMinimum!==void 0)W.setIridescenceThicknessMinimum(K.iridescenceThicknessMinimum);if(K.iridescenceThicknessMaximum!==void 0)W.setIridescenceThicknessMaximum(K.iridescenceThicknessMaximum);if(K.iridescenceTexture!==void 0){let G=K.iridescenceTexture,H=Z.textures[Y[G.index].source];W.setIridescenceTexture(H),Z.setTextureInfo(W.getIridescenceTextureInfo(),G)}if(K.iridescenceThicknessTexture!==void 0){let G=K.iridescenceThicknessTexture,H=Z.textures[Y[G.index].source];W.setIridescenceThicknessTexture(H),Z.setTextureInfo(W.getIridescenceThicknessTextureInfo(),G)}}}),this}prewrite(Z){let J=Z.jsonDoc;return this.document.getRoot().listMaterials().forEach((X)=>{let Y=X.getExtension(FY);if(Y){let $=Z.materialIndexMap.get(X),Q=J.json.materials[$];Q.extensions=Q.extensions||{};let W=Q.extensions[FY]={};if(Y.getIridescenceFactor()>0)W.iridescenceFactor=Y.getIridescenceFactor();if(Y.getIridescenceIOR()!==1.3)W.iridescenceIor=Y.getIridescenceIOR();if(Y.getIridescenceThicknessMinimum()!==100)W.iridescenceThicknessMinimum=Y.getIridescenceThicknessMinimum();if(Y.getIridescenceThicknessMaximum()!==400)W.iridescenceThicknessMaximum=Y.getIridescenceThicknessMaximum();if(Y.getIridescenceTexture()){let K=Y.getIridescenceTexture(),G=Y.getIridescenceTextureInfo();W.iridescenceTexture=Z.createTextureInfoDef(K,G)}if(Y.getIridescenceThicknessTexture()){let K=Y.getIridescenceThicknessTexture(),G=Y.getIridescenceThicknessTextureInfo();W.iridescenceThicknessTexture=Z.createTextureInfoDef(K,G)}}}),this}}rP.EXTENSION_NAME=FY;var{R:Yn,G:$n,B:Qn,A:Wn}=n5;class tP extends n1{init(){this.extensionName=vP,this.propertyType="PBRSpecularGlossiness",this.parentTypes=[s.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{diffuseFactor:[1,1,1,1],diffuseTexture:null,diffuseTextureInfo:new T1(this.graph,"diffuseTextureInfo"),specularFactor:[1,1,1],glossinessFactor:1,specularGlossinessTexture:null,specularGlossinessTextureInfo:new T1(this.graph,"specularGlossinessTextureInfo")})}getDiffuseFactor(){return this.get("diffuseFactor")}setDiffuseFactor(Z){return this.set("diffuseFactor",Z)}getDiffuseTexture(){return this.getRef("diffuseTexture")}getDiffuseTextureInfo(){return this.getRef("diffuseTexture")?this.getRef("diffuseTextureInfo"):null}setDiffuseTexture(Z){return this.setRef("diffuseTexture",Z,{channels:Yn|$n|Qn|Wn,isColor:!0})}getSpecularFactor(){return this.get("specularFactor")}setSpecularFactor(Z){return this.set("specularFactor",Z)}getGlossinessFactor(){return this.get("glossinessFactor")}setGlossinessFactor(Z){return this.set("glossinessFactor",Z)}getSpecularGlossinessTexture(){return this.getRef("specularGlossinessTexture")}getSpecularGlossinessTextureInfo(){return this.getRef("specularGlossinessTexture")?this.getRef("specularGlossinessTextureInfo"):null}setSpecularGlossinessTexture(Z){return this.setRef("specularGlossinessTexture",Z,{channels:Yn|$n|Qn|Wn})}}tP.EXTENSION_NAME=vP;var UY=vP;class I2 extends I1{constructor(...Z){super(...Z);this.extensionName=UY,this.prereadTypes=[s.MESH],this.prewriteTypes=[s.MESH]}createPBRSpecularGlossiness(){return new tP(this.document.getGraph())}read(Z){return this}write(Z){return this}preread(Z){let J=Z.jsonDoc,X=J.json.materials||[],Y=J.json.textures||[];return X.forEach(($,Q)=>{if($.extensions&&$.extensions[UY]){let W=this.createPBRSpecularGlossiness();Z.materials[Q].setExtension(UY,W);let K=$.extensions[UY];if(K.diffuseFactor!==void 0)W.setDiffuseFactor(K.diffuseFactor);if(K.specularFactor!==void 0)W.setSpecularFactor(K.specularFactor);if(K.glossinessFactor!==void 0)W.setGlossinessFactor(K.glossinessFactor);if(K.diffuseTexture!==void 0){let G=K.diffuseTexture,H=Z.textures[Y[G.index].source];W.setDiffuseTexture(H),Z.setTextureInfo(W.getDiffuseTextureInfo(),G)}if(K.specularGlossinessTexture!==void 0){let G=K.specularGlossinessTexture,H=Z.textures[Y[G.index].source];W.setSpecularGlossinessTexture(H),Z.setTextureInfo(W.getSpecularGlossinessTextureInfo(),G)}}}),this}prewrite(Z){let J=Z.jsonDoc;return this.document.getRoot().listMaterials().forEach((X)=>{let Y=X.getExtension(UY);if(Y){let $=Z.materialIndexMap.get(X),Q=J.json.materials[$];Q.extensions=Q.extensions||{};let W=Q.extensions[UY]={diffuseFactor:Y.getDiffuseFactor(),specularFactor:Y.getSpecularFactor(),glossinessFactor:Y.getGlossinessFactor()};if(Y.getDiffuseTexture()){let K=Y.getDiffuseTexture(),G=Y.getDiffuseTextureInfo();W.diffuseTexture=Z.createTextureInfoDef(K,G)}if(Y.getSpecularGlossinessTexture()){let K=Y.getSpecularGlossinessTexture(),G=Y.getSpecularGlossinessTextureInfo();W.specularGlossinessTexture=Z.createTextureInfoDef(K,G)}}}),this}}I2.EXTENSION_NAME=UY;var{R:$w1,G:Qw1,B:Ww1,A:Kw1}=n5;class eP extends n1{init(){this.extensionName=SP,this.propertyType="Sheen",this.parentTypes=[s.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{sheenColorFactor:[0,0,0],sheenColorTexture:null,sheenColorTextureInfo:new T1(this.graph,"sheenColorTextureInfo"),sheenRoughnessFactor:0,sheenRoughnessTexture:null,sheenRoughnessTextureInfo:new T1(this.graph,"sheenRoughnessTextureInfo")})}getSheenColorFactor(){return this.get("sheenColorFactor")}setSheenColorFactor(Z){return this.set("sheenColorFactor",Z)}getSheenColorTexture(){return this.getRef("sheenColorTexture")}getSheenColorTextureInfo(){return this.getRef("sheenColorTexture")?this.getRef("sheenColorTextureInfo"):null}setSheenColorTexture(Z){return this.setRef("sheenColorTexture",Z,{channels:$w1|Qw1|Ww1,isColor:!0})}getSheenRoughnessFactor(){return this.get("sheenRoughnessFactor")}setSheenRoughnessFactor(Z){return this.set("sheenRoughnessFactor",Z)}getSheenRoughnessTexture(){return this.getRef("sheenRoughnessTexture")}getSheenRoughnessTextureInfo(){return this.getRef("sheenRoughnessTexture")?this.getRef("sheenRoughnessTextureInfo"):null}setSheenRoughnessTexture(Z){return this.setRef("sheenRoughnessTexture",Z,{channels:Kw1})}}eP.EXTENSION_NAME=SP;var LY=SP;class ZC extends I1{constructor(...Z){super(...Z);this.extensionName=LY,this.prereadTypes=[s.MESH],this.prewriteTypes=[s.MESH]}createSheen(){return new eP(this.document.getGraph())}read(Z){return this}write(Z){return this}preread(Z){let J=Z.jsonDoc,X=J.json.materials||[],Y=J.json.textures||[];return X.forEach(($,Q)=>{if($.extensions&&$.extensions[LY]){let W=this.createSheen();Z.materials[Q].setExtension(LY,W);let K=$.extensions[LY];if(K.sheenColorFactor!==void 0)W.setSheenColorFactor(K.sheenColorFactor);if(K.sheenRoughnessFactor!==void 0)W.setSheenRoughnessFactor(K.sheenRoughnessFactor);if(K.sheenColorTexture!==void 0){let G=K.sheenColorTexture,H=Z.textures[Y[G.index].source];W.setSheenColorTexture(H),Z.setTextureInfo(W.getSheenColorTextureInfo(),G)}if(K.sheenRoughnessTexture!==void 0){let G=K.sheenRoughnessTexture,H=Z.textures[Y[G.index].source];W.setSheenRoughnessTexture(H),Z.setTextureInfo(W.getSheenRoughnessTextureInfo(),G)}}}),this}prewrite(Z){let J=Z.jsonDoc;return this.document.getRoot().listMaterials().forEach((X)=>{let Y=X.getExtension(LY);if(Y){let $=Z.materialIndexMap.get(X),Q=J.json.materials[$];Q.extensions=Q.extensions||{};let W=Q.extensions[LY]={sheenColorFactor:Y.getSheenColorFactor(),sheenRoughnessFactor:Y.getSheenRoughnessFactor()};if(Y.getSheenColorTexture()){let K=Y.getSheenColorTexture(),G=Y.getSheenColorTextureInfo();W.sheenColorTexture=Z.createTextureInfoDef(K,G)}if(Y.getSheenRoughnessTexture()){let K=Y.getSheenRoughnessTexture(),G=Y.getSheenRoughnessTextureInfo();W.sheenRoughnessTexture=Z.createTextureInfoDef(K,G)}}}),this}}ZC.EXTENSION_NAME=LY;var{R:Gw1,G:Hw1,B:zw1,A:qw1}=n5;class JC extends n1{init(){this.extensionName=_P,this.propertyType="Specular",this.parentTypes=[s.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{specularFactor:1,specularTexture:null,specularTextureInfo:new T1(this.graph,"specularTextureInfo"),specularColorFactor:[1,1,1],specularColorTexture:null,specularColorTextureInfo:new T1(this.graph,"specularColorTextureInfo")})}getSpecularFactor(){return this.get("specularFactor")}setSpecularFactor(Z){return this.set("specularFactor",Z)}getSpecularColorFactor(){return this.get("specularColorFactor")}setSpecularColorFactor(Z){return this.set("specularColorFactor",Z)}getSpecularTexture(){return this.getRef("specularTexture")}getSpecularTextureInfo(){return this.getRef("specularTexture")?this.getRef("specularTextureInfo"):null}setSpecularTexture(Z){return this.setRef("specularTexture",Z,{channels:qw1})}getSpecularColorTexture(){return this.getRef("specularColorTexture")}getSpecularColorTextureInfo(){return this.getRef("specularColorTexture")?this.getRef("specularColorTextureInfo"):null}setSpecularColorTexture(Z){return this.setRef("specularColorTexture",Z,{channels:Gw1|Hw1|zw1,isColor:!0})}}JC.EXTENSION_NAME=_P;var wY=_P;class v2 extends I1{constructor(...Z){super(...Z);this.extensionName=wY,this.prereadTypes=[s.MESH],this.prewriteTypes=[s.MESH]}createSpecular(){return new JC(this.document.getGraph())}read(Z){return this}write(Z){return this}preread(Z){let J=Z.jsonDoc,X=J.json.materials||[],Y=J.json.textures||[];return X.forEach(($,Q)=>{if($.extensions&&$.extensions[wY]){let W=this.createSpecular();Z.materials[Q].setExtension(wY,W);let K=$.extensions[wY];if(K.specularFactor!==void 0)W.setSpecularFactor(K.specularFactor);if(K.specularColorFactor!==void 0)W.setSpecularColorFactor(K.specularColorFactor);if(K.specularTexture!==void 0){let G=K.specularTexture,H=Z.textures[Y[G.index].source];W.setSpecularTexture(H),Z.setTextureInfo(W.getSpecularTextureInfo(),G)}if(K.specularColorTexture!==void 0){let G=K.specularColorTexture,H=Z.textures[Y[G.index].source];W.setSpecularColorTexture(H),Z.setTextureInfo(W.getSpecularColorTextureInfo(),G)}}}),this}prewrite(Z){let J=Z.jsonDoc;return this.document.getRoot().listMaterials().forEach((X)=>{let Y=X.getExtension(wY);if(Y){let $=Z.materialIndexMap.get(X),Q=J.json.materials[$];Q.extensions=Q.extensions||{};let W=Q.extensions[wY]={};if(Y.getSpecularFactor()!==1)W.specularFactor=Y.getSpecularFactor();if(!K8.eq(Y.getSpecularColorFactor(),[1,1,1]))W.specularColorFactor=Y.getSpecularColorFactor();if(Y.getSpecularTexture()){let K=Y.getSpecularTexture(),G=Y.getSpecularTextureInfo();W.specularTexture=Z.createTextureInfoDef(K,G)}if(Y.getSpecularColorTexture()){let K=Y.getSpecularColorTexture(),G=Y.getSpecularColorTextureInfo();W.specularColorTexture=Z.createTextureInfoDef(K,G)}}}),this}}v2.EXTENSION_NAME=wY;var{R:Vw1}=n5;class XC extends n1{init(){this.extensionName=AP,this.propertyType="Transmission",this.parentTypes=[s.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{transmissionFactor:0,transmissionTexture:null,transmissionTextureInfo:new T1(this.graph,"transmissionTextureInfo")})}getTransmissionFactor(){return this.get("transmissionFactor")}setTransmissionFactor(Z){return this.set("transmissionFactor",Z)}getTransmissionTexture(){return this.getRef("transmissionTexture")}getTransmissionTextureInfo(){return this.getRef("transmissionTexture")?this.getRef("transmissionTextureInfo"):null}setTransmissionTexture(Z){return this.setRef("transmissionTexture",Z,{channels:Vw1})}}XC.EXTENSION_NAME=AP;var BY=AP;class YC extends I1{constructor(...Z){super(...Z);this.extensionName=BY,this.prereadTypes=[s.MESH],this.prewriteTypes=[s.MESH]}createTransmission(){return new XC(this.document.getGraph())}read(Z){return this}write(Z){return this}preread(Z){let J=Z.jsonDoc,X=J.json.materials||[],Y=J.json.textures||[];return X.forEach(($,Q)=>{if($.extensions&&$.extensions[BY]){let W=this.createTransmission();Z.materials[Q].setExtension(BY,W);let K=$.extensions[BY];if(K.transmissionFactor!==void 0)W.setTransmissionFactor(K.transmissionFactor);if(K.transmissionTexture!==void 0){let G=K.transmissionTexture,H=Z.textures[Y[G.index].source];W.setTransmissionTexture(H),Z.setTextureInfo(W.getTransmissionTextureInfo(),G)}}}),this}prewrite(Z){let J=Z.jsonDoc;return this.document.getRoot().listMaterials().forEach((X)=>{let Y=X.getExtension(BY);if(Y){let $=Z.materialIndexMap.get(X),Q=J.json.materials[$];Q.extensions=Q.extensions||{};let W=Q.extensions[BY]={transmissionFactor:Y.getTransmissionFactor()};if(Y.getTransmissionTexture()){let K=Y.getTransmissionTexture(),G=Y.getTransmissionTextureInfo();W.transmissionTexture=Z.createTextureInfoDef(K,G)}}}),this}}YC.EXTENSION_NAME=BY;class $C extends n1{init(){this.extensionName=xP,this.propertyType="Unlit",this.parentTypes=[s.MATERIAL]}}$C.EXTENSION_NAME=xP;var dQ=xP;class S2 extends I1{constructor(...Z){super(...Z);this.extensionName=dQ,this.prereadTypes=[s.MESH],this.prewriteTypes=[s.MESH]}createUnlit(){return new $C(this.document.getGraph())}read(Z){return this}write(Z){return this}preread(Z){return(Z.jsonDoc.json.materials||[]).forEach((X,Y)=>{if(X.extensions&&X.extensions[dQ])Z.materials[Y].setExtension(dQ,this.createUnlit())}),this}prewrite(Z){let J=Z.jsonDoc;return this.document.getRoot().listMaterials().forEach((X)=>{if(X.getExtension(dQ)){let Y=Z.materialIndexMap.get(X),$=J.json.materials[Y];$.extensions=$.extensions||{},$.extensions[dQ]={}}}),this}}S2.EXTENSION_NAME=dQ;class QC extends n1{init(){this.extensionName=MY,this.propertyType="Mapping",this.parentTypes=["MappingList"]}getDefaults(){return Object.assign(super.getDefaults(),{material:null,variants:new P0})}getMaterial(){return this.getRef("material")}setMaterial(Z){return this.setRef("material",Z)}addVariant(Z){return this.addRef("variants",Z)}removeVariant(Z){return this.removeRef("variants",Z)}listVariants(){return this.listRefs("variants")}}QC.EXTENSION_NAME=MY;class WC extends n1{init(){this.extensionName=MY,this.propertyType="MappingList",this.parentTypes=[s.PRIMITIVE]}getDefaults(){return Object.assign(super.getDefaults(),{mappings:new P0})}addMapping(Z){return this.addRef("mappings",Z)}removeMapping(Z){return this.removeRef("mappings",Z)}listMappings(){return this.listRefs("mappings")}}WC.EXTENSION_NAME=MY;class P2 extends n1{init(){this.extensionName=MY,this.propertyType="Variant",this.parentTypes=["MappingList"]}}P2.EXTENSION_NAME=MY;var H7=MY;class KC extends I1{constructor(...Z){super(...Z);this.extensionName=H7}createMappingList(){return new WC(this.document.getGraph())}createVariant(Z=""){return new P2(this.document.getGraph(),Z)}createMapping(){return new QC(this.document.getGraph())}listVariants(){return Array.from(this.properties).filter((Z)=>Z instanceof P2)}read(Z){let J=Z.jsonDoc;if(!J.json.extensions||!J.json.extensions[H7])return this;let $=(J.json.extensions[H7].variants||[]).map((W)=>this.createVariant().setName(W.name||""));return(J.json.meshes||[]).forEach((W,K)=>{let G=Z.meshes[K];(W.primitives||[]).forEach((z,q)=>{if(!z.extensions||!z.extensions[H7])return;let V=this.createMappingList(),F=z.extensions[H7];for(let U of F.mappings){let w=this.createMapping();if(U.material!==void 0)w.setMaterial(Z.materials[U.material]);for(let L of U.variants||[])w.addVariant($[L]);V.addMapping(w)}G.listPrimitives()[q].setExtension(H7,V)})}),this}write(Z){let J=Z.jsonDoc,X=this.listVariants();if(!X.length)return this;let Y=[],$=new Map;for(let Q of X)$.set(Q,Y.length),Y.push(Z.createPropertyDef(Q));for(let Q of this.document.getRoot().listMeshes()){let W=Z.meshIndexMap.get(Q);Q.listPrimitives().forEach((K,G)=>{let H=K.getExtension(H7);if(!H)return;let z=Z.jsonDoc.json.meshes[W].primitives[G],q=H.listMappings().map((V)=>{let F=Z.createPropertyDef(V),U=V.getMaterial();if(U)F.material=Z.materialIndexMap.get(U);return F.variants=V.listVariants().map((w)=>$.get(w)),F});z.extensions=z.extensions||{},z.extensions[H7]={mappings:q}})}return J.json.extensions=J.json.extensions||{},J.json.extensions[H7]={variants:Y},this}}KC.EXTENSION_NAME=H7;var{G:Fw1}=n5;class GC extends n1{init(){this.extensionName=hP,this.propertyType="Volume",this.parentTypes=[s.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{thicknessFactor:0,thicknessTexture:null,thicknessTextureInfo:new T1(this.graph,"thicknessTexture"),attenuationDistance:1/0,attenuationColor:[1,1,1]})}getThicknessFactor(){return this.get("thicknessFactor")}setThicknessFactor(Z){return this.set("thicknessFactor",Z)}getThicknessTexture(){return this.getRef("thicknessTexture")}getThicknessTextureInfo(){return this.getRef("thicknessTexture")?this.getRef("thicknessTextureInfo"):null}setThicknessTexture(Z){return this.setRef("thicknessTexture",Z,{channels:Fw1})}getAttenuationDistance(){return this.get("attenuationDistance")}setAttenuationDistance(Z){return this.set("attenuationDistance",Z)}getAttenuationColor(){return this.get("attenuationColor")}setAttenuationColor(Z){return this.set("attenuationColor",Z)}}GC.EXTENSION_NAME=hP;var OY=hP;class HC extends I1{constructor(...Z){super(...Z);this.extensionName=OY,this.prereadTypes=[s.MESH],this.prewriteTypes=[s.MESH]}createVolume(){return new GC(this.document.getGraph())}read(Z){return this}write(Z){return this}preread(Z){let J=Z.jsonDoc,X=J.json.materials||[],Y=J.json.textures||[];return X.forEach(($,Q)=>{if($.extensions&&$.extensions[OY]){let W=this.createVolume();Z.materials[Q].setExtension(OY,W);let K=$.extensions[OY];if(K.thicknessFactor!==void 0)W.setThicknessFactor(K.thicknessFactor);if(K.attenuationDistance!==void 0)W.setAttenuationDistance(K.attenuationDistance);if(K.attenuationColor!==void 0)W.setAttenuationColor(K.attenuationColor);if(K.thicknessTexture!==void 0){let G=K.thicknessTexture,H=Z.textures[Y[G.index].source];W.setThicknessTexture(H),Z.setTextureInfo(W.getThicknessTextureInfo(),G)}}}),this}prewrite(Z){let J=Z.jsonDoc;return this.document.getRoot().listMaterials().forEach((X)=>{let Y=X.getExtension(OY);if(Y){let $=Z.materialIndexMap.get(X),Q=J.json.materials[$];Q.extensions=Q.extensions||{};let W=Q.extensions[OY]={};if(Y.getThicknessFactor()>0)W.thicknessFactor=Y.getThicknessFactor();if(Number.isFinite(Y.getAttenuationDistance()))W.attenuationDistance=Y.getAttenuationDistance();if(!K8.eq(Y.getAttenuationColor(),[1,1,1]))W.attenuationColor=Y.getAttenuationColor();if(Y.getThicknessTexture()){let K=Y.getThicknessTexture(),G=Y.getThicknessTextureInfo();W.thicknessTexture=Z.createTextureInfoDef(K,G)}}}),this}}HC.EXTENSION_NAME=OY;var Un=EL1;class PG extends I1{constructor(...Z){super(...Z);this.extensionName=Un}read(Z){return this}write(Z){return this}}PG.EXTENSION_NAME=Un;var jG=IL1;class Ln{match(Z){return Z[0]===171&&Z[1]===75&&Z[2]===84&&Z[3]===88&&Z[4]===32&&Z[5]===50&&Z[6]===48&&Z[7]===187&&Z[8]===13&&Z[9]===10&&Z[10]===26&&Z[11]===10}getSize(Z){let J=R2(Z);return[J.pixelWidth,J.pixelHeight]}getChannels(Z){let X=R2(Z).dataFormatDescriptor[0];if(X.colorModel===ii)return X.samples.length===2&&(X.samples[1].channelType&15)===15?4:3;else if(X.colorModel===ni)return(X.samples[0].channelType&15)===3?4:3;throw new Error(`Unexpected KTX2 colorModel, "${X.colorModel}".`)}getVRAMByteLength(Z){let J=R2(Z),X=this.getChannels(Z)>3,Y=0;for(let $=0;$<J.levels.length;$++){let Q=J.levels[$];if(Q.uncompressedByteLength)Y+=Q.uncompressedByteLength;else{let W=Math.max(1,Math.floor(J.pixelWidth/Math.pow(2,$))),K=Math.max(1,Math.floor(J.pixelHeight/Math.pow(2,$))),G=X?16:8;Y+=W/4*(K/4)*G}}return Y}}class zC extends I1{constructor(...Z){super(...Z);this.extensionName=jG,this.prereadTypes=[s.TEXTURE]}static register(){V4.registerFormat("image/ktx2",new Ln)}preread(Z){return Z.jsonDoc.json.textures.forEach((J)=>{if(J.extensions&&J.extensions[jG]){let X=J.extensions[jG];J.source=X.source}}),this}read(Z){return this}write(Z){let J=Z.jsonDoc;return this.document.getRoot().listTextures().forEach((X)=>{if(X.getMimeType()==="image/ktx2"){let Y=Z.imageIndexMap.get(X);J.json.textures.forEach(($)=>{if($.source===Y)$.extensions=$.extensions||{},$.extensions[jG]={source:$.source},delete $.source})}}),this}}zC.EXTENSION_NAME=jG;class qC extends n1{init(){this.extensionName=fP,this.propertyType="Transform",this.parentTypes=[s.TEXTURE_INFO]}getDefaults(){return Object.assign(super.getDefaults(),{offset:[0,0],rotation:0,scale:[1,1],texCoord:null})}getOffset(){return this.get("offset")}setOffset(Z){return this.set("offset",Z)}getRotation(){return this.get("rotation")}setRotation(Z){return this.set("rotation",Z)}getScale(){return this.get("scale")}setScale(Z){return this.set("scale",Z)}getTexCoord(){return this.get("texCoord")}setTexCoord(Z){return this.set("texCoord",Z)}}qC.EXTENSION_NAME=fP;var jY=fP;class VC extends I1{constructor(...Z){super(...Z);this.extensionName=jY}createTransform(){return new qC(this.document.getGraph())}read(Z){for(let[J,X]of Array.from(Z.textureInfos.entries())){if(!X.extensions||!X.extensions[jY])continue;let Y=this.createTransform(),$=X.extensions[jY];if($.offset!==void 0)Y.setOffset($.offset);if($.rotation!==void 0)Y.setRotation($.rotation);if($.scale!==void 0)Y.setScale($.scale);if($.texCoord!==void 0)Y.setTexCoord($.texCoord);J.setExtension(jY,Y)}return this}write(Z){let J=Array.from(Z.textureInfoDefMap.entries());for(let[X,Y]of J){let $=X.getExtension(jY);if(!$)continue;Y.extensions=Y.extensions||{};let Q={},W=K8.eq;if(!W($.getOffset(),[0,0]))Q.offset=$.getOffset();if($.getRotation()!==0)Q.rotation=$.getRotation();if(!W($.getScale(),[1,1]))Q.scale=$.getScale();if($.getTexCoord()!=null)Q.texCoord=$.getTexCoord();Y.extensions[jY]=Q}return this}}VC.EXTENSION_NAME=jY;var Uw1=[s.ROOT,s.SCENE,s.NODE,s.MESH,s.MATERIAL,s.TEXTURE,s.ANIMATION];class FC extends n1{init(){this.extensionName=N2,this.propertyType="Packet",this.parentTypes=Uw1}getDefaults(){return Object.assign(super.getDefaults(),{context:{},properties:{}})}getContext(){return this.get("context")}setContext(Z){return this.set("context",UZ({},Z))}listProperties(){return Object.keys(this.get("properties"))}getProperty(Z){let J=this.get("properties");return Z in J?J[Z]:null}setProperty(Z,J){this._assertContext(Z);let X=UZ({},this.get("properties"));if(J)X[Z]=J;else delete X[Z];return this.set("properties",X)}toJSONLD(){let Z=BP(this.get("context")),J=BP(this.get("properties"));return UZ({"@context":Z},J)}fromJSONLD(Z){Z=BP(Z);let J=Z["@context"];if(J)this.set("context",J);return delete Z["@context"],this.set("properties",Z)}_assertContext(Z){if(!(Z.split(":")[0]in this.get("context")))throw new Error(`${N2}: Missing context for term, "${Z}".`)}}FC.EXTENSION_NAME=N2;function BP(Z){return JSON.parse(JSON.stringify(Z))}var FZ=N2;class UC extends I1{constructor(...Z){super(...Z);this.extensionName=FZ}createPacket(){return new FC(this.document.getGraph())}listPackets(){return Array.from(this.properties)}read(Z){var J;let X=(J=Z.jsonDoc.json.extensions)==null?void 0:J[FZ];if(!X||!X.packets)return this;let Y=Z.jsonDoc.json,$=this.document.getRoot(),Q=X.packets.map((G)=>this.createPacket().fromJSONLD(G)),W=[[Y.asset],Y.scenes,Y.nodes,Y.meshes,Y.materials,Y.images,Y.animations],K=[[$],$.listScenes(),$.listNodes(),$.listMeshes(),$.listMaterials(),$.listTextures(),$.listAnimations()];for(let G=0;G<W.length;G++){let H=W[G]||[];for(let z=0;z<H.length;z++){let q=H[z];if(q.extensions&&q.extensions[FZ]){let V=q.extensions[FZ];K[G][z].setExtension(FZ,Q[V.packet])}}}return this}write(Z){let{json:J}=Z.jsonDoc,X=[];for(let Y of this.properties){X.push(Y.toJSONLD());for(let $ of Y.listParents()){let Q;switch($.propertyType){case s.ROOT:Q=J.asset;break;case s.SCENE:Q=J.scenes[Z.sceneIndexMap.get($)];break;case s.NODE:Q=J.nodes[Z.nodeIndexMap.get($)];break;case s.MESH:Q=J.meshes[Z.meshIndexMap.get($)];break;case s.MATERIAL:Q=J.materials[Z.materialIndexMap.get($)];break;case s.TEXTURE:Q=J.images[Z.imageIndexMap.get($)];break;case s.ANIMATION:Q=J.animations[Z.animationIndexMap.get($)];break;default:Q=null,this.document.getLogger().warn(`[${FZ}]: Unsupported parent property, "${$.propertyType}"`);break}if(!Q)continue;Q.extensions=Q.extensions||{},Q.extensions[FZ]={packet:X.length-1}}}if(X.length>0)J.extensions=J.extensions||{},J.extensions[FZ]={packets:X};return this}}UC.EXTENSION_NAME=FZ;var Lw1=[DG,yP,mP,dP,lP,iP,aP,E2,rP,I2,v2,ZC,YC,S2,KC,HC,PG,zC,VC,UC],Xz6=[C2,NG,T2,k2,...Lw1];var ww1=t(vD(),1);function nQ(){return nQ=Object.assign?Object.assign.bind():function(Z){for(var J=1;J<arguments.length;J++){var X=arguments[J];for(var Y in X)({}).hasOwnProperty.call(X,Y)&&(Z[Y]=X[Y])}return Z},nQ.apply(null,arguments)}var{POINTS:wn,LINES:_2,LINE_STRIP:Bw1,LINE_LOOP:Ow1,TRIANGLES:A2,TRIANGLE_STRIP:jw1,TRIANGLE_FAN:Mw1}=M8.Mode;function DJ(Z,J){return Object.defineProperty(J,"name",{value:Z}),J}function z7(Z,J){let X=nQ({},Z);for(let Y in J)if(J[Y]!==void 0)X[Y]=J[Y];return X}function fn(Z){let J=Z.getIndices(),X=Z.getAttribute("POSITION");switch(Z.getMode()){case M8.Mode.POINTS:return J?J.getCount():X.getCount();case M8.Mode.LINES:return J?J.getCount()/2:X.getCount()/2;case M8.Mode.LINE_LOOP:return J?J.getCount():X.getCount();case M8.Mode.LINE_STRIP:return J?J.getCount()-1:X.getCount()-1;case M8.Mode.TRIANGLES:return J?J.getCount()/3:X.getCount()/3;case M8.Mode.TRIANGLE_STRIP:case M8.Mode.TRIANGLE_FAN:return J?J.getCount()-2:X.getCount()-2;default:throw new Error("Unexpected mode: "+Z.getMode())}}var Rw1=new Intl.NumberFormat(void 0,{maximumFractionDigits:0});function OC(Z){return Rw1.format(Z)}function Nw1(Z,J,X=2){let Y=Z>J?"\u2013":"+",$="%";return Y+(Math.abs(Z-J)/Z*100).toFixed(X)+"%"}function y2(Z,J){return`${OC(Z)} \u2192 ${OC(J)} (${Nw1(Z,J)})`}function CC(Z){let J=[];for(let X of Z.listAttributes())J.push(X);for(let X of Z.listTargets())for(let Y of X.listAttributes())J.push(Y);return Array.from(new Set(J))}function Dw1(Z,J,X){Z.swap(J,X);for(let Y of Z.listTargets())Y.swap(J,X)}function Pw1(Z,J){if(Z==null&&J==null)return!0;if(Z==null||J==null)return!1;if(Z.length!==J.length)return!1;for(let X=0;X<Z.length;X++)if(Z[X]!==J[X])return!1;return!0}function LZ(Z,J){return Z.createAccessor(J.getName()).setArray(J.getArray()).setType(J.getType()).setBuffer(J.getBuffer()).setNormalized(J.getNormalized()).setSparse(J.getSparse())}function Cw1(Z,J=Z){let X=TC(Z,J);for(let Y=0;Y<X.length;Y++)X[Y]=Y;return X}function TC(Z,J=Z){return J<=65534?new Uint16Array(Z):new Uint32Array(Z)}function Tw1(Z){return Z.listParents().some((J)=>J.propertyType!==a.ROOT)}function bn(Z){for(let J in Z)return!1;return!0}function yn(Z){let J=C6.fromGraph(Z.getGraph()),X=Z.getMaterial(),Y=J.getRoot().listMaterials().indexOf(X),$=Ew1[Z.getMode()],Q=!!Z.getIndices(),W=Z.listSemantics().sort().map((G)=>{let H=Z.getAttribute(G),z=H.getElementSize(),q=H.getComponentType();return`${G}:${z}:${q}`}).join("+"),K=Z.listTargets().map((G)=>{return G.listSemantics().sort().map((H)=>{let z=Z.getAttribute(H),q=z.getElementSize(),V=z.getComponentType();return`${H}:${q}:${V}`}).join("+")}).join("~");return`${Y}|${$}|${Q}|${W}|${K}`}function kw1(Z){return Math.pow(2,Math.ceil(Math.log(Z)/Math.LN2))}var Ew1={[wn]:wn,[_2]:_2,[Bw1]:_2,[Ow1]:_2,[A2]:A2,[jw1]:A2,[Mw1]:A2},pQ="center",Bn={pivot:"center"};function gn(Z=Bn){let J=z7(Bn,Z);return DJ(pQ,(X)=>{let Y=X.getLogger(),$=X.getRoot(),Q=$.listAnimations().length>0||$.listSkins().length>0;X.getRoot().listScenes().forEach((W,K)=>{Y.debug(`${pQ}: Scene ${K+1} / ${$.listScenes().length}.`);let G;if(typeof J.pivot==="string"){let z=DD(W);if(G=[(z.max[0]-z.min[0])/2+z.min[0],(z.max[1]-z.min[1])/2+z.min[1],(z.max[2]-z.min[2])/2+z.min[2]],J.pivot==="above")G[1]=z.max[1];if(J.pivot==="below")G[1]=z.min[1]}else G=J.pivot;Y.debug(`${pQ}: Pivot "${G.join(", ")}".`);let H=[-1*G[0],-1*G[1],-1*G[2]];if(Q){Y.debug(`${pQ}: Model contains animation or skin. Adding a wrapper node.`);let z=X.createNode("Pivot").setTranslation(H);W.listChildren().forEach((q)=>z.addChild(q)),W.addChild(z)}else Y.debug(`${pQ}: Skipping wrapper, offsetting all root nodes.`),W.listChildren().forEach((z)=>{let q=z.getTranslation();z.setTranslation([q[0]+H[0],q[1]+H[1],q[2]+H[2]])})}),Y.debug(`${pQ}: Complete.`)})}function Iw1(Z){let J=new Set,X=Z,Y;while(Y=X.getParentNode()){if(J.has(Y))throw new Error("Circular dependency in scene graph.");J.add(Y),X=Y}return X.listParents().filter(($)=>$ instanceof vQ)}function vw1(Z){let J=Iw1(Z),X=Z.getParentNode();if(!X)return Z;Z.setMatrix(Z.getWorldMatrix()),X.removeChild(Z);for(let Y of J)Y.addChild(Z);return Z}var aQ=typeof Float32Array!=="undefined"?Float32Array:Array;if(!Math.hypot)Math.hypot=function(){var Z=0,J=arguments.length;while(J--)Z+=arguments[J]*arguments[J];return Math.sqrt(Z)};function Sw1(Z,J){var X=J[0],Y=J[1],$=J[2],Q=J[3],W=J[4],K=J[5],G=J[6],H=J[7],z=J[8],q=J[9],V=J[10],F=J[11],U=J[12],w=J[13],L=J[14],O=J[15],N=X*K-Y*W,M=X*G-$*W,j=X*H-Q*W,P=Y*G-$*K,D=Y*H-Q*K,C=$*H-Q*G,k=z*w-q*U,T=z*L-V*U,x=z*O-F*U,S=q*L-V*w,h=q*O-F*w,I=V*O-F*L,v=N*I-M*h+j*S+P*x-D*T+C*k;if(!v)return null;return v=1/v,Z[0]=(K*I-G*h+H*S)*v,Z[1]=($*h-Y*I-Q*S)*v,Z[2]=(w*C-L*D+O*P)*v,Z[3]=(V*D-q*C-F*P)*v,Z[4]=(G*x-W*I-H*T)*v,Z[5]=(X*I-$*x+Q*T)*v,Z[6]=(L*j-U*C-O*M)*v,Z[7]=(z*C-V*j+F*M)*v,Z[8]=(W*h-K*x+H*k)*v,Z[9]=(Y*x-X*h-Q*k)*v,Z[10]=(U*D-w*j+O*N)*v,Z[11]=(q*j-z*D-F*N)*v,Z[12]=(K*T-W*S-G*k)*v,Z[13]=(X*S-Y*T+$*k)*v,Z[14]=(w*M-U*P-L*N)*v,Z[15]=(z*P-q*M+V*N)*v,Z}function _w1(Z){var J=Z[0],X=Z[1],Y=Z[2],$=Z[3],Q=Z[4],W=Z[5],K=Z[6],G=Z[7],H=Z[8],z=Z[9],q=Z[10],V=Z[11],F=Z[12],U=Z[13],w=Z[14],L=Z[15],O=J*W-X*Q,N=J*K-Y*Q,M=J*G-$*Q,j=X*K-Y*W,P=X*G-$*W,D=Y*G-$*K,C=H*U-z*F,k=H*w-q*F,T=H*L-V*F,x=z*w-q*U,S=z*L-V*U,h=q*L-V*w;return O*h-N*S+M*x+j*T-P*k+D*C}function mn(Z,J,X){var Y=J[0],$=J[1],Q=J[2],W=J[3],K=J[4],G=J[5],H=J[6],z=J[7],q=J[8],V=J[9],F=J[10],U=J[11],w=J[12],L=J[13],O=J[14],N=J[15],M=X[0],j=X[1],P=X[2],D=X[3];return Z[0]=M*Y+j*K+P*q+D*w,Z[1]=M*$+j*G+P*V+D*L,Z[2]=M*Q+j*H+P*F+D*O,Z[3]=M*W+j*z+P*U+D*N,M=X[4],j=X[5],P=X[6],D=X[7],Z[4]=M*Y+j*K+P*q+D*w,Z[5]=M*$+j*G+P*V+D*L,Z[6]=M*Q+j*H+P*F+D*O,Z[7]=M*W+j*z+P*U+D*N,M=X[8],j=X[9],P=X[10],D=X[11],Z[8]=M*Y+j*K+P*q+D*w,Z[9]=M*$+j*G+P*V+D*L,Z[10]=M*Q+j*H+P*F+D*O,Z[11]=M*W+j*z+P*U+D*N,M=X[12],j=X[13],P=X[14],D=X[15],Z[12]=M*Y+j*K+P*q+D*w,Z[13]=M*$+j*G+P*V+D*L,Z[14]=M*Q+j*H+P*F+D*O,Z[15]=M*W+j*z+P*U+D*N,Z}function Aw1(){var Z=new aQ(9);if(aQ!=Float32Array)Z[1]=0,Z[2]=0,Z[3]=0,Z[5]=0,Z[6]=0,Z[7]=0;return Z[0]=1,Z[4]=1,Z[8]=1,Z}function xw1(Z,J){return Z[0]=J[0],Z[1]=J[1],Z[2]=J[2],Z[3]=J[4],Z[4]=J[5],Z[5]=J[6],Z[6]=J[8],Z[7]=J[9],Z[8]=J[10],Z}function hw1(Z,J){if(Z===J){var X=J[1],Y=J[2],$=J[5];Z[1]=J[3],Z[2]=J[6],Z[3]=X,Z[5]=J[7],Z[6]=Y,Z[7]=$}else Z[0]=J[0],Z[1]=J[3],Z[2]=J[6],Z[3]=J[1],Z[4]=J[4],Z[5]=J[7],Z[6]=J[2],Z[7]=J[5],Z[8]=J[8];return Z}function fw1(Z,J){var X=J[0],Y=J[1],$=J[2],Q=J[3],W=J[4],K=J[5],G=J[6],H=J[7],z=J[8],q=z*W-K*H,V=-z*Q+K*G,F=H*Q-W*G,U=X*q+Y*V+$*F;if(!U)return null;return U=1/U,Z[0]=q*U,Z[1]=(-z*Y+$*H)*U,Z[2]=(K*Y-$*W)*U,Z[3]=V*U,Z[4]=(z*X-$*G)*U,Z[5]=(-K*X+$*Q)*U,Z[6]=F*U,Z[7]=(-H*X+Y*G)*U,Z[8]=(W*X-Y*Q)*U,Z}function g2(){var Z=new aQ(3);if(aQ!=Float32Array)Z[0]=0,Z[1]=0,Z[2]=0;return Z}function bw1(Z,J,X){return Z[0]=J[0]*X[0],Z[1]=J[1]*X[1],Z[2]=J[2]*X[2],Z}function un(Z,J){var X=J[0],Y=J[1],$=J[2],Q=X*X+Y*Y+$*$;if(Q>0)Q=1/Math.sqrt(Q);return Z[0]=J[0]*Q,Z[1]=J[1]*Q,Z[2]=J[2]*Q,Z}function yw1(Z,J,X){var Y=J[0],$=J[1],Q=J[2],W=X[3]*Y+X[7]*$+X[11]*Q+X[15];return W=W||1,Z[0]=(X[0]*Y+X[4]*$+X[8]*Q+X[12])/W,Z[1]=(X[1]*Y+X[5]*$+X[9]*Q+X[13])/W,Z[2]=(X[2]*Y+X[6]*$+X[10]*Q+X[14])/W,Z}function gw1(Z,J,X){var Y=J[0],$=J[1],Q=J[2];return Z[0]=Y*X[0]+$*X[3]+Q*X[6],Z[1]=Y*X[1]+$*X[4]+Q*X[7],Z[2]=Y*X[2]+$*X[5]+Q*X[8],Z}var mw1=bw1;(function(){var Z=g2();return function(J,X,Y,$,Q,W){var K,G;if(!X)X=3;if(!Y)Y=0;if($)G=Math.min($*X+Y,J.length);else G=J.length;for(K=Y;K<G;K+=X)Z[0]=J[K],Z[1]=J[K+1],Z[2]=J[K+2],Q(Z,Z,W),J[K]=Z[0],J[K+1]=Z[1],J[K+2]=Z[2];return J}})();var RJ="dedup",LC={keepUniqueNames:!1,propertyTypes:[a.ACCESSOR,a.MESH,a.TEXTURE,a.MATERIAL,a.SKIN]};function dn(Z=LC){let J=z7(LC,Z),X=new Set(J.propertyTypes);for(let Y of J.propertyTypes)if(!LC.propertyTypes.includes(Y))throw new Error(`${RJ}: Unsupported deduplication on type "${Y}".`);return DJ(RJ,(Y)=>{let $=Y.getLogger();if(X.has(a.ACCESSOR))uw1(Y);if(X.has(a.TEXTURE))cw1(Y,J);if(X.has(a.MATERIAL))lw1(Y,J);if(X.has(a.MESH))dw1(Y,J);if(X.has(a.SKIN))pw1(Y,J);$.debug(`${RJ}: Complete.`)})}function uw1(Z){let J=Z.getLogger(),X=new Map,Y=new Map,$=new Map,Q=new Map,W=Z.getRoot().listMeshes();W.forEach((q)=>{q.listPrimitives().forEach((V)=>{V.listAttributes().forEach((F)=>K(F,Y)),K(V.getIndices(),X)})});for(let q of Z.getRoot().listAnimations())for(let V of q.listSamplers())K(V.getInput(),$),K(V.getOutput(),Q);function K(q,V){if(!q)return;let F=[q.getCount(),q.getType(),q.getComponentType(),q.getNormalized(),q.getSparse()].join(":"),U=V.get(F);if(!U)V.set(F,U=new Set);U.add(q)}function G(q,V){for(let F=0;F<q.length;F++){let U=q[F],w=n0.toView(U.getArray());if(V.has(U))continue;for(let L=F+1;L<q.length;L++){let O=q[L];if(V.has(O))continue;if(n0.equals(w,n0.toView(O.getArray())))V.set(O,U)}}}let H=0,z=new Map;for(let q of[Y,X,$,Q])for(let V of q.values())H+=V.size,G(Array.from(V),z);J.debug(`${RJ}: Merged ${z.size} of ${H} accessors.`),W.forEach((q)=>{q.listPrimitives().forEach((V)=>{V.listAttributes().forEach((U)=>{if(z.has(U))V.swap(U,z.get(U))});let F=V.getIndices();if(F&&z.has(F))V.swap(F,z.get(F))})});for(let q of Z.getRoot().listAnimations())for(let V of q.listSamplers()){let F=V.getInput(),U=V.getOutput();if(F&&z.has(F))V.swap(F,z.get(F));if(U&&z.has(U))V.swap(U,z.get(U))}Array.from(z.keys()).forEach((q)=>q.dispose())}function dw1(Z,J){let X=Z.getLogger(),Y=Z.getRoot(),$=new Map;Y.listAccessors().forEach((K,G)=>$.set(K,G)),Y.listMaterials().forEach((K,G)=>$.set(K,G));let Q=Y.listMeshes().length,W=new Map;for(let K of Y.listMeshes()){let G=[];for(let z of K.listPrimitives())G.push(cn(z,$));let H="";if(J.keepUniqueNames)H+=K.getName()+";";if(H+=G.join(";"),W.has(H)){let z=W.get(H);K.listParents().forEach((q)=>{if(q.propertyType!==a.ROOT)q.swap(K,z)}),K.dispose()}else W.set(H,K)}X.debug(`${RJ}: Merged ${Q-W.size} of ${Q} meshes.`)}function cw1(Z,J){let X=Z.getLogger(),Y=Z.getRoot(),$=Y.listTextures(),Q=new Map;for(let W=0;W<$.length;W++){let K=$[W],G=K.getImage();if(Q.has(K))continue;for(let H=W+1;H<$.length;H++){let z=$[H],q=z.getImage();if(Q.has(z))continue;if(K.getMimeType()!==z.getMimeType())continue;if(J.keepUniqueNames&&K.getName()!==z.getName())continue;let V=K.getSize(),F=z.getSize();if(!V||!F)continue;if(V[0]!==F[0])continue;if(V[1]!==F[1])continue;if(!G||!q)continue;if(n0.equals(G,q))Q.set(z,K)}}X.debug(`${RJ}: Merged ${Q.size} of ${Y.listTextures().length} textures.`),Array.from(Q.entries()).forEach(([W,K])=>{W.listParents().forEach((G)=>{if(!(G instanceof JY))G.swap(W,K)}),W.dispose()})}function lw1(Z,J){let X=Z.getLogger(),$=Z.getRoot().listMaterials(),Q=new Map,W=new Map,K=new Set;if(!J.keepUniqueNames)K.add("name");for(let G=0;G<$.length;G++){let H=$[G];if(Q.has(H))continue;if(On(H,W))continue;for(let z=G+1;z<$.length;z++){let q=$[z];if(Q.has(q))continue;if(On(q,W))continue;if(H.equals(q,K))Q.set(q,H)}}X.debug(`${RJ}: Merged ${Q.size} of ${$.length} materials.`),Array.from(Q.entries()).forEach(([G,H])=>{G.listParents().forEach((z)=>{if(!(z instanceof JY))z.swap(G,H)}),G.dispose()})}function pw1(Z,J){let X=Z.getLogger(),$=Z.getRoot().listSkins(),Q=new Map,W=new Set(["joints"]);if(!J.keepUniqueNames)W.add("name");for(let K=0;K<$.length;K++){let G=$[K];if(Q.has(G))continue;for(let H=K+1;H<$.length;H++){let z=$[H];if(Q.has(z))continue;if(G.equals(z,W)&&Pw1(G.listJoints(),z.listJoints()))Q.set(z,G)}}X.debug(`${RJ}: Merged ${Q.size} of ${$.length} skins.`),Array.from(Q.entries()).forEach(([K,G])=>{K.listParents().forEach((H)=>{if(!(H instanceof JY))H.swap(K,G)}),K.dispose()})}function cn(Z,J){let X=[];for(let Y of Z.listSemantics()){let $=Z.getAttribute(Y);X.push(Y+":"+J.get($))}if(Z instanceof M8){let Y=Z.getIndices();if(Y)X.push("indices:"+J.get(Y));let $=Z.getMaterial();if($)X.push("material:"+J.get($));X.push("mode:"+Z.getMode());for(let Q of Z.listTargets())X.push("target:"+cn(Q,J))}return X.join(",")}function On(Z,J){if(J.has(Z))return J.get(Z);let X=Z.getGraph(),Y=new Set,$=X.listParentEdges(Z);while($.length>0){let Q=$.pop();if(Q.getAttributes().modifyChild===!0)return J.set(Z,!0),!0;let W=Q.getChild();if(Y.has(W))continue;for(let K of X.listChildEdges(W))$.push(K)}return J.set(Z,!1),!1}function ln(){var Z=new aQ(4);if(aQ!=Float32Array)Z[0]=0,Z[1]=0,Z[2]=0,Z[3]=0;return Z}function iw1(Z,J,X){return Z[0]=J[0]+X[0],Z[1]=J[1]+X[1],Z[2]=J[2]+X[2],Z[3]=J[3]+X[3],Z}function nw1(Z,J,X){return Z[0]=J[0]-X[0],Z[1]=J[1]-X[1],Z[2]=J[2]-X[2],Z[3]=J[3]-X[3],Z}function aw1(Z,J,X){return Z[0]=J[0]*X[0],Z[1]=J[1]*X[1],Z[2]=J[2]*X[2],Z[3]=J[3]*X[3],Z}function sw1(Z,J,X){return Z[0]=J[0]*X,Z[1]=J[1]*X,Z[2]=J[2]*X,Z[3]=J[3]*X,Z}function ow1(Z){var J=Z[0],X=Z[1],Y=Z[2],$=Z[3];return Math.hypot(J,X,Y,$)}var pn=nw1,rw1=aw1,nn=ow1;(function(){var Z=ln();return function(J,X,Y,$,Q,W){var K,G;if(!X)X=4;if(!Y)Y=0;if($)G=Math.min($*X+Y,J.length);else G=J.length;for(K=Y;K<G;K+=X)Z[0]=J[K],Z[1]=J[K+1],Z[2]=J[K+2],Z[3]=J[K+3],Q(Z,Z,W),J[K]=Z[0],J[K+1]=Z[1],J[K+2]=Z[2],J[K+3]=Z[3];return J}})();var tw1=/color|emissive|diffuse/i;function ew1(Z){return Z.getGraph().listParentEdges(Z).some(($)=>{return $.getAttributes().isColor||tw1.test($.getName())})?"srgb":null}function ZB1(Z){let J=Z.getGraph(),X=new Set,Y=new Set;function $(Q){let W=new Set;for(let K of J.listChildEdges(Q))if(K.getChild()instanceof ZY)W.add(K.getName()+"Info");for(let K of J.listChildEdges(Q)){let G=K.getChild();if(X.has(G))continue;if(X.add(G),G instanceof B5&&W.has(K.getName()))Y.add(G);else if(G instanceof IQ)$(G)}}return $(Z),Array.from(Y)}function JB1(Z){let X=C6.fromGraph(Z.getGraph()).getRoot(),Y=Z.getGraph().listParentEdges(Z).filter(($)=>$.getParent()!==X).map(($)=>$.getName());return Array.from(new Set(Y))}var iQ="prune",jC=0.011764705882352941,jn={propertyTypes:[a.NODE,a.SKIN,a.MESH,a.CAMERA,a.PRIMITIVE,a.PRIMITIVE_TARGET,a.ANIMATION,a.MATERIAL,a.TEXTURE,a.ACCESSOR,a.BUFFER],keepLeaves:!1,keepAttributes:!1,keepIndices:!1,keepSolidTextures:!1,keepExtras:!1};function m2(Z=jn){let J=z7(jn,Z),X=new Set(J.propertyTypes),Y=J.keepExtras;return DJ(iQ,async($)=>{let Q=$.getLogger(),W=$.getRoot(),K=$.getGraph(),G=new an,H=(z)=>G.dispose(z.target);if(K.addEventListener("node:dispose",H),X.has(a.MESH))for(let z of W.listMeshes()){if(z.listPrimitives().length>0)continue;z.dispose()}if(X.has(a.NODE)){if(!J.keepLeaves)for(let z of W.listScenes())sn(K,z,Y);for(let z of W.listNodes())C9(z,Y)}if(X.has(a.SKIN))for(let z of W.listSkins())C9(z,Y);if(X.has(a.MESH))for(let z of W.listMeshes())C9(z,Y);if(X.has(a.CAMERA))for(let z of W.listCameras())C9(z,Y);if(X.has(a.PRIMITIVE))Mn(K,a.PRIMITIVE,Y);if(X.has(a.PRIMITIVE_TARGET))Mn(K,a.PRIMITIVE_TARGET,Y);if(!J.keepAttributes&&X.has(a.ACCESSOR)){let z=new Map;for(let q of W.listMeshes())for(let V of q.listPrimitives()){let F=V.getMaterial();if(!F)continue;let U=on($,V,F),w=YB1(V,U);Rn(V,w),V.listTargets().forEach((L)=>Rn(L,w)),z.has(F)?z.get(F).add(V):z.set(F,new Set([V]))}for(let[q,V]of z)$B1(q,Array.from(V))}if(!J.keepIndices&&X.has(a.ACCESSOR))for(let z of W.listMeshes())for(let q of z.listPrimitives())XB1(q);if(X.has(a.ANIMATION))for(let z of W.listAnimations()){for(let q of z.listChannels())if(!q.getTargetNode())q.dispose();if(!z.listChannels().length){let q=z.listSamplers();C9(z,Y),q.forEach((V)=>C9(V,Y))}else z.listSamplers().forEach((q)=>C9(q,Y))}if(X.has(a.MATERIAL))W.listMaterials().forEach((z)=>C9(z,Y));if(X.has(a.TEXTURE)){if(W.listTextures().forEach((z)=>C9(z,Y)),!J.keepSolidTextures)await QB1($)}if(X.has(a.ACCESSOR))W.listAccessors().forEach((z)=>C9(z,Y));if(X.has(a.BUFFER))W.listBuffers().forEach((z)=>C9(z,Y));if(K.removeEventListener("node:dispose",H),!G.empty()){let z=G.entries().map(([q,V])=>`${q} (${V})`).join(", ");Q.info(`${iQ}: Removed types... ${z}`)}else Q.debug(`${iQ}: No unused properties found.`);Q.debug(`${iQ}: Complete.`)})}class an{constructor(){this.disposed={}}empty(){for(let Z in this.disposed)return!1;return!0}entries(){return Object.entries(this.disposed)}dispose(Z){this.disposed[Z.propertyType]=this.disposed[Z.propertyType]||0,this.disposed[Z.propertyType]++}}function C9(Z,J){let X=Z.listParents().filter(($)=>!($ instanceof JY||$ instanceof tX)),Y=J&&!bn(Z.getExtras());if(!X.length&&!Y)Z.dispose()}function Mn(Z,J,X){for(let Y of Z.listEdges()){let $=Y.getParent();if($.propertyType===J)C9($,X)}}function sn(Z,J,X){if(J.listChildren().forEach((W)=>sn(Z,W,X)),J instanceof vQ)return;let Y=Z.listParentEdges(J).some((W)=>{let K=W.getParent().propertyType;return K!==a.ROOT&&K!==a.SCENE&&K!==a.NODE}),$=Z.listChildren(J).length===0,Q=X&&!bn(J.getExtras());if($&&!Y&&!Q)J.dispose()}function Rn(Z,J){for(let X of J)Z.setAttribute(X,null)}function XB1(Z){let J=Z.getIndices(),X=J&&J.getArray(),Y=Z.listAttributes()[0];if(!X||!Y)return;if(J.getCount()!==Y.getCount())return;for(let $=0,Q=X.length;$<Q;$++)if($!==X[$])return;Z.setIndices(null)}function YB1(Z,J){let X=[];for(let Y of Z.listSemantics())if(Y==="NORMAL"&&!J.has(Y))X.push(Y);else if(Y==="TANGENT"&&!J.has(Y))X.push(Y);else if(Y.startsWith("TEXCOORD_")&&!J.has(Y))X.push(Y);else if(Y.startsWith("COLOR_")&&Y!=="COLOR_0")X.push(Y);return X}function on(Z,J,X,Y=new Set){let Q=Z.getGraph().listChildEdges(X),W=new Set;for(let H of Q)if(H.getChild()instanceof ZY)W.add(H.getName());for(let H of Q){let z=H.getName(),q=H.getChild();if(q instanceof B5){if(W.has(z.replace(/Info$/,"")))Y.add(`TEXCOORD_${q.getTexCoord()}`)}if(q instanceof ZY&&z.match(/normalTexture/i))Y.add("TANGENT");if(q instanceof IQ)on(Z,J,q,Y)}let K=X instanceof J7&&!X.getExtension("KHR_materials_unlit"),G=J.getMode()===M8.Mode.POINTS;if(K&&!G)Y.add("NORMAL");return Y}function $B1(Z,J){let X=ZB1(Z),Y=new Set(X.map((G)=>G.getTexCoord())),$=Array.from(Y).sort(),Q=new Map($.map((G,H)=>[G,H])),W=new Map($.map((G,H)=>[`TEXCOORD_${G}`,`TEXCOORD_${H}`]));for(let G of X){let H=G.getTexCoord();G.setTexCoord(Q.get(H))}for(let G of J){let H=G.listSemantics().filter((z)=>z.startsWith("TEXCOORD_")).sort();K(G,H),G.listTargets().forEach((z)=>K(z,H))}function K(G,H){for(let z of H){let q=G.getAttribute(z);if(!q)continue;let V=W.get(z);if(V===z)continue;G.setAttribute(V,q),G.setAttribute(z,null)}}}async function QB1(Z){let J=Z.getRoot(),X=Z.getGraph(),Y=Z.getLogger(),Q=J.listTextures().map(async(W)=>{var K;let G=await KB1(W);if(!G)return;if(ew1(W)==="srgb")PD.convertSRGBToLinear(G,G);let H=W.getName()||W.getURI(),z=(K=W.getSize())==null?void 0:K.join("x"),q=JB1(W);for(let V of X.listParentEdges(W)){let F=V.getParent();if(F!==J&&WB1(F,G,V.getName(),Y))V.dispose()}if(W.listParents().length===1)W.dispose(),Y.debug(`${iQ}: Removed solid-color texture "${H}" (${z}px ${q.join(", ")})`)});await Promise.all(Q)}function WB1(Z,J,X,Y){if(Z instanceof J7)switch(X){case"baseColorTexture":return Z.setBaseColorFactor(rw1(J,J,Z.getBaseColorFactor())),!0;case"emissiveTexture":return Z.setEmissiveFactor(mw1([0,0,0],J.slice(0,3),Z.getEmissiveFactor())),!0;case"occlusionTexture":return Math.abs(J[0]-1)<=jC;case"metallicRoughnessTexture":return Z.setRoughnessFactor(J[1]*Z.getRoughnessFactor()),Z.setMetallicFactor(J[2]*Z.getMetallicFactor()),!0;case"normalTexture":return nn(pn(ln(),J,[0.5,0.5,1,1]))<=jC}return Y.warn(`${iQ}: Detected single-color ${X} texture. Pruning ${X} not yet supported.`),!1}async function KB1(Z){let J=await GB1(Z);if(!J)return null;let X=[1/0,1/0,1/0,1/0],Y=[-1/0,-1/0,-1/0,-1/0],$=[0,0,0,0],[Q,W]=J.shape;for(let K=0;K<Q;K++){for(let G=0;G<W;G++)for(let H=0;H<4;H++)X[H]=Math.min(X[H],J.get(K,G,H)),Y[H]=Math.max(Y[H],J.get(K,G,H));if(nn(pn($,Y,X))/255>jC)return null}return sw1($,iw1($,Y,X),0.00196078431372549)}async function GB1(Z){try{return await xi(Z.getImage(),Z.getMimeType())}catch(J){return null}}var MJ=4294967295;class rn{constructor(Z){this.attributes=[],this.u8=void 0,this.u32=void 0;let J=0;for(let X of CC(Z))J+=this._initAttribute(X);this.u8=new Uint8Array(J),this.u32=new Uint32Array(this.u8.buffer)}_initAttribute(Z){let J=Z.getArray(),X=new Uint8Array(J.buffer,J.byteOffset,J.byteLength),Y=Z.getElementSize()*Z.getComponentSize(),$=n0.padNumber(Y);return this.attributes.push({u8:X,byteStride:Y,paddedByteStride:$}),$}hash(Z){let J=0;for(let{u8:X,byteStride:Y,paddedByteStride:$}of this.attributes){for(let Q=0;Q<$;Q++)if(Q<Y)this.u8[J+Q]=X[Z*Y+Q];else this.u8[J+Q]=0;J+=$}return HB1(0,this.u32)}equal(Z,J){for(let{u8:X,byteStride:Y}of this.attributes)for(let $=0;$<Y;$++)if(X[Z*Y+$]!==X[J*Y+$])return!1;return!0}}function HB1(Z,J){for(let $=0,Q=J.length;$<Q;$++){let W=J[$];W=Math.imul(W,1540483477)>>>0,W=(W^W>>24)>>>0,W=Math.imul(W,1540483477)>>>0,Z=Math.imul(Z,1540483477)>>>0,Z=(Z^W)>>>0}return Z}function zB1(Z,J,X,Y,$=MJ){let Q=J-1,K=X.hash(Y)&Q;for(let G=0;G<=Q;G++){let H=Z[K];if(H===$||X.equal(H,Y))return K;K=K+G+1&Q}throw new Error("Hash table full.")}var w6;(function(Z){Z.RENDER="render",Z.RENDER_CACHED="render-cached",Z.UPLOAD="upload",Z.UPLOAD_NAIVE="upload-naive",Z.DISTINCT="distinct",Z.DISTINCT_POSITION="distinct-position",Z.UNUSED="unused"})(w6||(w6={}));function NJ(Z,J){let X=Z.getAttribute("POSITION"),Y=Z.getIndices();switch(J){case w6.RENDER:return Y?Y.getCount():X.getCount();case w6.RENDER_CACHED:return Y?new Set(Y.getArray()).size:X.getCount();case w6.UPLOAD_NAIVE:case w6.UPLOAD:return X.getCount();case w6.DISTINCT:case w6.DISTINCT_POSITION:return qB1(J);case w6.UNUSED:return Y?X.getCount()-new Set(Y.getArray()).size:0;default:return VB1(J)}}function qB1(Z){throw new Error(`Not implemented: ${Z}`)}function VB1(Z){throw new Error(`Unexpected value: ${Z}`)}function TG(Z,J,X){let Y=C6.fromGraph(Z.getGraph());if(!J||!X)[J,X]=FB1(Z);let $=Z.getIndices(),Q=$?$.getArray():null,W=NJ(Z,w6.RENDER),K=Y.createAccessor(),G=W,H=TC(G,X);for(let q=0;q<G;q++)H[q]=J[Q?Q[q]:q];Z.setIndices(K.setArray(H));let z=CC(Z);for(let q of Z.listAttributes()){let V=LZ(Y,q);MC(q,$,J,V,X),Z.swap(q,V)}for(let q of Z.listTargets())for(let V of q.listAttributes()){let F=LZ(Y,V);MC(V,$,J,F,X),q.swap(V,F)}if($&&$.listParents().length===1)$.dispose();for(let q of z)if(q.listParents().length===1)q.dispose();return Z}function MC(Z,J,X,Y,$){let Q=Z.getElementSize(),W=Z.getArray(),K=J?J.getArray():null,G=J?J.getCount():Z.getCount(),H=new W.constructor($*Q),z=new Uint8Array($);for(let q=0;q<G;q++){let V=K?K[q]:q,F=X[V];if(z[F])continue;for(let U=0;U<Q;U++)H[F*Q+U]=W[V*Q+U];z[F]=1}return Y.setArray(H)}function FB1(Z){let J=NJ(Z,w6.UPLOAD),X=Z.getIndices(),Y=X?X.getArray():null;if(!X||!Y)return[Cw1(J,1e6),J];let $=new Uint32Array(J).fill(MJ),Q=0;for(let W=0;W<Y.length;W++){let K=Y[W];if($[K]===MJ)$[K]=Q++}return[$,Q]}var RC="weld",h2={overwrite:!0,cleanup:!0};function kC(Z=h2){let J=z7(h2,Z);return DJ(RC,async(X)=>{let Y=X.getLogger();for(let $ of X.getRoot().listMeshes()){for(let Q of $.listPrimitives())if(u2(Q,J),NJ(Q,w6.RENDER)===0)Q.dispose();if($.listPrimitives().length===0)$.dispose()}if(J.cleanup)await X.transform(m2({propertyTypes:[a.ACCESSOR,a.NODE],keepAttributes:!0,keepIndices:!0,keepLeaves:!1}),dn({propertyTypes:[a.ACCESSOR]}));Y.debug(`${RC}: Complete.`)})}function u2(Z,J=h2){let X=Z.getGraph(),$=C6.fromGraph(X).getLogger(),Q=nQ({},h2,J);if(Z.getIndices()&&!Q.overwrite)return;if(Z.getMode()===M8.Mode.POINTS)return;let W=Z.getAttribute("POSITION").getCount(),K=Z.getIndices(),G=K==null?void 0:K.getArray(),H=K?K.getCount():W,z=new rn(Z),q=kw1(W+W/4),V=new Uint32Array(q).fill(MJ),F=new Uint32Array(W).fill(MJ),U=0;for(let w=0;w<H;w++){let L=G?G[w]:w;if(F[L]!==MJ)continue;let O=zB1(V,q,z,L,MJ),N=V[O];if(N===MJ)V[O]=L,F[L]=U++;else F[L]=F[N]}$.debug(`${RC}: ${y2(W,U)} vertices.`),TG(Z,F,U)}var{FLOAT:UB1}=v0.ComponentType;function tn(Z,J){let X=Z.getAttribute("POSITION");if(X)Nn(J,X);let Y=Z.getAttribute("NORMAL");if(Y)Dn(J,Y);let $=Z.getAttribute("TANGENT");if($)Pn(J,$);for(let Q of Z.listTargets()){let W=Q.getAttribute("POSITION");if(W)Nn(J,W);let K=Q.getAttribute("NORMAL");if(K)Dn(J,K);let G=Q.getAttribute("TANGENT");if(G)Pn(J,G)}if(_w1(J)<0)LB1(Z)}function Nn(Z,J){let X=J.getComponentType(),Y=J.getNormalized(),$=J.getArray(),Q=X===UB1?$:new Float32Array($.length),W=g2();for(let K=0,G=J.getCount();K<G;K++){if(Y)W[0]=c0.decodeNormalizedInt($[K*3],X),W[1]=c0.decodeNormalizedInt($[K*3+1],X),W[2]=c0.decodeNormalizedInt($[K*3+2],X);else W[0]=$[K*3],W[1]=$[K*3+1],W[2]=$[K*3+2];yw1(W,W,Z),Q[K*3]=W[0],Q[K*3+1]=W[1],Q[K*3+2]=W[2]}J.setArray(Q).setNormalized(!1)}function Dn(Z,J){let X=J.getArray(),Y=J.getNormalized(),$=J.getComponentType(),Q=Aw1();xw1(Q,Z),fw1(Q,Q),hw1(Q,Q);let W=g2();for(let K=0,G=J.getCount();K<G;K++){if(Y)W[0]=c0.decodeNormalizedInt(X[K*3],$),W[1]=c0.decodeNormalizedInt(X[K*3+1],$),W[2]=c0.decodeNormalizedInt(X[K*3+2],$);else W[0]=X[K*3],W[1]=X[K*3+1],W[2]=X[K*3+2];if(gw1(W,W,Q),un(W,W),Y)X[K*3]=c0.decodeNormalizedInt(W[0],$),X[K*3+1]=c0.decodeNormalizedInt(W[1],$),X[K*3+2]=c0.decodeNormalizedInt(W[2],$);else X[K*3]=W[0],X[K*3+1]=W[1],X[K*3+2]=W[2]}}function Pn(Z,J){let X=J.getArray(),Y=J.getNormalized(),$=J.getComponentType(),Q=g2();for(let W=0,K=J.getCount();W<K;W++){if(Y)Q[0]=c0.decodeNormalizedInt(X[W*4],$),Q[1]=c0.decodeNormalizedInt(X[W*4+1],$),Q[2]=c0.decodeNormalizedInt(X[W*4+2],$);else Q[0]=X[W*4],Q[1]=X[W*4+1],Q[2]=X[W*4+2];if(Q[0]=Z[0]*Q[0]+Z[4]*Q[1]+Z[8]*Q[2],Q[1]=Z[1]*Q[0]+Z[5]*Q[1]+Z[9]*Q[2],Q[2]=Z[2]*Q[0]+Z[6]*Q[1]+Z[10]*Q[2],un(Q,Q),Y)X[W*4]=c0.decodeNormalizedInt(Q[0],$),X[W*4+1]=c0.decodeNormalizedInt(Q[1],$),X[W*4+2]=c0.decodeNormalizedInt(Q[2],$);else X[W*4]=Q[0],X[W*4+1]=Q[1],X[W*4+2]=Q[2]}}function LB1(Z){if(Z.getMode()!==M8.Mode.TRIANGLES)return;if(!Z.getIndices())u2(Z);let J=Z.getIndices();for(let X=0,Y=J.getCount();X<Y;X+=3){let $=J.getScalar(X),Q=J.getScalar(X+2);J.setScalar(X,Q),J.setScalar(X+2,$)}}function wB1(Z,J){for(let X of Z.listPrimitives()){let Y=BB1(X,Z);if(X!==Y)Z.removePrimitive(X).addPrimitive(Y)}for(let X of Z.listPrimitives())TG(X),tn(X,J)}function BB1(Z,J){if(Z.listParents().some((Y)=>Y instanceof XG&&Y!==J))Z=Z.clone();for(let Y of Z.listTargets())if(Y.listParents().some((Q)=>Q instanceof M8&&Q!==Z))Z.removeTarget(Y).addTarget(Y.clone());return Z}var Cn=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function en(Z){let J=Z.getMesh(),X=Z.getMatrix();if(J&&!c0.eq(X,Cn))wB1(J,X);for(let Y of Z.listChildren()){let $=Y.getMatrix();mn($,$,X),Y.setMatrix($)}return Z.setMatrix(Cn)}var{LINES:OB1,LINE_STRIP:jB1,LINE_LOOP:MB1,TRIANGLES:RB1,TRIANGLE_STRIP:NB1,TRIANGLE_FAN:DB1}=M8.Mode;function PB1(Z){let J=Z.getGraph(),X=C6.fromGraph(J);if(!Z.getIndices())u2(Z);let Y=Z.getIndices(),$=Y.getArray(),Q=fn(Z),K=new qJ[Y.getComponentType()](Q*2),G=Z.getMode();if(G===jB1)for(let z=0;z<Q;z++)K[z*2]=$[z],K[z*2+1]=$[z+1];else if(G===MB1)for(let z=0;z<Q;z++)if(z<Q-1)K[z*2]=$[z],K[z*2+1]=$[z+1];else K[z*2]=$[z],K[z*2+1]=$[0];else throw new Error("Only LINE_STRIP and LINE_LOOP may be converted to LINES.");Z.setMode(OB1);let H=X.getRoot();if(Y.listParents().some((z)=>z!==H&&z!==Z))Z.setIndices(LZ(X,Y).setArray(K));else Y.setArray(K)}function Za(Z){let J=Z.getGraph(),X=C6.fromGraph(J);if(!Z.getIndices())u2(Z);let Y=Z.getIndices(),$=Y.getArray(),Q=fn(Z),K=new qJ[Y.getComponentType()](Q*3),G=Z.getMode();if(G===NB1)for(let z=0,q=$.length;z<q-2;z++)if(z%2)K[z*3]=$[z+1],K[z*3+1]=$[z],K[z*3+2]=$[z+2];else K[z*3]=$[z],K[z*3+1]=$[z+1],K[z*3+2]=$[z+2];else if(G===DB1)for(let z=0;z<Q;z++)K[z*3]=$[0],K[z*3+1]=$[z+1],K[z*3+2]=$[z+2];else throw new Error("Only TRIANGLE_STRIP and TRIANGLE_FAN may be converted to TRIANGLES.");Z.setMode(RB1);let H=X.getRoot();if(Y.listParents().some((z)=>z!==H&&z!==Z))Z.setIndices(LZ(X,Y).setArray(K));else Y.setArray(K)}var Tn="dequantize",f2={pattern:/^((?!JOINTS_).)*$/};function Ja(Z=f2){let J=z7(f2,Z);return DJ(Tn,(X)=>{let Y=X.getLogger();for(let $ of X.getRoot().listMeshes())for(let Q of $.listPrimitives())CB1(Q,J);X.createExtension(PG).dispose(),Y.debug(`${Tn}: Complete.`)})}function CB1(Z,J=f2){let X=z7(f2,J);for(let Y of Z.listSemantics())if(X.pattern.test(Y))NC(Z.getAttribute(Y));for(let Y of Z.listTargets())for(let $ of Y.listSemantics())if(X.pattern.test($))NC(Y.getAttribute($))}function NC(Z){let J=Z.getArray();if(!J)return;let X=b2(J,Z.getComponentType(),Z.getNormalized());Z.setArray(X).setNormalized(!1)}function b2(Z,J,X){let Y=new Float32Array(Z.length);for(let $=0,Q=Z.length;$<Q;$++)if(X)Y[$]=c0.decodeNormalizedInt(Z[$],J);else Y[$]=Z[$];return Y}var{TEXTURE_INFO:Xa,ROOT:Gz6}=a;function Ya(Z){let J=new C6().setLogger(Z.getLogger()),X=EC(J,Z);return TB1(J,Z,X),J.getRoot().copy(Z.getRoot(),X),J}function TB1(Z,J,X){X||(X=EC(Z,J));for(let Y of J.getRoot().listExtensionsUsed()){let $=Z.createExtension(Y.constructor);if(Y.isRequired())$.setRequired(!0)}return kB1(Z,J,EB1(J),X)}function kB1(Z,J,X,Y){Y||(Y=EC(Z,J));let $=new Map;for(let Q of X)if(!$.has(Q)&&Q.propertyType!==Xa)$.set(Q,Y(Q));for(let[Q,W]of $.entries())W.copy(Q,Y);return $}function EC(Z,J){let X=new Map([[J.getRoot(),Z.getRoot()]]);return(Y)=>{if(Y.propertyType===Xa)return Y;let $=X.get(Y);if(!$)$=new Y.constructor(Z.getGraph()),X.set(Y,$);return $}}function EB1(Z){let J=new Set;for(let X of Z.getGraph().listEdges())J.add(X.getChild());return Array.from(J)}var wC="flatten",kn={cleanup:!0};function $a(Z=kn){let J=z7(kn,Z);return DJ(wC,async(X)=>{let Y=X.getRoot(),$=X.getLogger(),Q=new Set;for(let H of Y.listSkins())for(let z of H.listJoints())Q.add(z);let W=new Set;for(let H of Y.listAnimations())for(let z of H.listChannels()){let q=z.getTargetNode();if(q&&z.getTargetPath()!=="weights")W.add(q)}let K=new Set,G=new Set;for(let H of Y.listScenes())H.traverse((z)=>{let q=z.getParentNode();if(!q)return;if(Q.has(q)||K.has(q))K.add(z);if(W.has(q)||G.has(q))G.add(z)});for(let H of Y.listScenes())H.traverse((z)=>{if(W.has(z))return;if(K.has(z))return;if(G.has(z))return;vw1(z)});if(W.size)$.debug(`${wC}: Flattening node hierarchies with TRS animation not yet supported.`);if(J.cleanup)await X.transform(m2({propertyTypes:[a.NODE],keepLeaves:!1}));$.debug(`${wC}: Complete.`)})}function Qa(Z){return DD(Z)}var IB1={skipValidation:!1},En=4294967295,{LINE_STRIP:vB1,LINE_LOOP:SB1,TRIANGLE_STRIP:_B1,TRIANGLE_FAN:AB1}=M8.Mode;function xB1(Z,J={}){let X=z7(IB1,J),Y=Z[0],$=C6.fromGraph(Y.getGraph());if(!X.skipValidation&&new Set(Z.map(yn)).size>1)throw new Error("Requires >=2 Primitives, sharing the same Material and Mode, with compatible vertex attributes and indices.");for(let F of Z)switch(F.getMode()){case vB1:case SB1:PB1(F);break;case _B1:case AB1:Za(F);break}let Q=[],W=new Uint32Array(Z.length),K=0,G=0;for(let F=0;F<Z.length;F++){let U=Z[F],w=U.getIndices(),L=U.getAttribute("POSITION").getCount(),O=w?w.getArray():null,N=w?w.getCount():L,M=new Uint32Array(L).fill(En);for(let j=0;j<N;j++){let P=O?O[j]:j;if(M[P]===En)M[P]=K++,W[F]++}Q.push(M),G+=N}let H=$.createPrimitive().setMode(Y.getMode()).setMaterial(Y.getMaterial());for(let F of Y.listSemantics()){let U=Y.getAttribute(F),w=qJ[U.getComponentType()],L=LZ($,U).setArray(new w(K*U.getElementSize()));H.setAttribute(F,L)}let z=Y.getIndices(),q=z?LZ($,z).setArray(TC(G,K)):null;H.setIndices(q);let V=0;for(let F=0;F<Q.length;F++){let U=Z[F],w=U.getIndices(),L=w?w.getCount():-1,O=Q[F];if(w&&q)fB1(w,O,q,V),V+=L;for(let N of H.listSemantics()){let M=U.getAttribute(N),j=H.getAttribute(N);hB1(M,w,O,j)}}return H}function hB1(Z,J,X,Y){let $=Z.getElementSize(),Q=J?J.getArray():null,W=Z.getCount(),K=Z.getArray(),G=Y.getArray(),H=new Uint8Array(Z.getCount());for(let z=0,q=J?J.getCount():W;z<q;z++){let V=Q?Q[z]:z,F=X[V];if(H[F])continue;for(let U=0;U<$;U++)G[F*$+U]=K[V*$+U];H[F]=1}}function fB1(Z,J,X,Y){let $=Z.getCount(),Q=Z.getArray(),W=X.getArray();for(let K=0;K<$;K++){let G=Q[K],H=J[G];W[Y+K]=H}}var DC="join",{ROOT:bB1,NODE:yB1,MESH:gB1,PRIMITIVE:mB1,ACCESSOR:uB1}=a,BC=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],In={keepMeshes:!1,keepNamed:!1,cleanup:!0};function Wa(Z=In){let J=z7(In,Z);return DJ(DC,async(X)=>{let Y=X.getRoot(),$=X.getLogger();for(let Q of Y.listScenes())vn(X,Q,J),Q.traverse((W)=>vn(X,W,J));if(J.cleanup)await X.transform(m2({propertyTypes:[yB1,gB1,mB1,uB1],keepAttributes:!0,keepIndices:!0,keepLeaves:!1}));$.debug(`${DC}: Complete.`)})}function vn(Z,J,X){let Y=Z.getLogger(),$={},Q=J.listChildren();for(let G=0;G<Q.length;G++){let H=Q[G];if(H.listParents().some((V)=>V instanceof tX))continue;let q=H.getMesh();if(!q)continue;if(H.getExtension("EXT_mesh_gpu_instancing"))continue;if(H.getSkin())continue;for(let V of q.listPrimitives()){if(V.listTargets().length>0)continue;let F=V.getMaterial();if(F&&F.getExtension("KHR_materials_volume"))continue;TG(V),cB1(V);let U=yn(V),w=q.getName()||H.getName();if(X.keepMeshes||X.keepNamed&&w)U+=`|${G}`;if(!(U in $))$[U]={prims:[],primMeshes:[],primNodes:[],dstNode:H,dstMesh:void 0};let L=$[U];L.prims.push(V),L.primNodes.push(H)}}let W=Object.values($).filter(({prims:G})=>G.length>1),K=new Set(W.flatMap((G)=>G.primNodes));for(let G of K){let H=G.getMesh();if(H.listParents().some((q)=>{return q.propertyType!==bB1&&G!==q}))G.setMesh(H.clone())}for(let G of W){let{dstNode:H,primNodes:z}=G;G.dstMesh=H.getMesh(),G.primMeshes=z.map((q)=>q.getMesh())}for(let G of W){let{prims:H,primNodes:z,primMeshes:q,dstNode:V,dstMesh:F}=G,U=V.getMatrix();for(let O=0;O<H.length;O++){let N=z[O],M=q[O],j=H[O];if(M.removePrimitive(j),Tw1(j))j=H[O]=dB1(H[O]);if(N!==V)mn(BC,Sw1(BC,U),N.getMatrix()),tn(j,BC)}let w=xB1(H),L=w.listAttributes()[0].getCount();F.addPrimitive(w),Y.debug(`${DC}: Joined Primitives (${H.length}) containing ${OC(L)} vertices under Node "${V.getName()}".`)}}function dB1(Z){let J=Z.clone();for(let Y of J.listSemantics())J.setAttribute(Y,J.getAttribute(Y).clone());let X=J.getIndices();if(X)J.setIndices(X.clone());return J}function cB1(Z){for(let J of["POSITION","NORMAL","TANGENT"]){let X=Z.getAttribute(J);if(X)NC(X)}}var{TRANSLATION:Hz6,ROTATION:zz6,SCALE:qz6,WEIGHTS:Vz6}=tX.TargetPath;var lB1={pattern:/.*/,quantizationVolume:"mesh",quantizePosition:14,quantizeNormal:10,quantizeTexcoord:12,quantizeColor:8,quantizeWeight:8,quantizeGeneric:12,normalizeWeights:!0,cleanup:!0};var Fz6=nQ({level:"high"},lB1);var pB1="unweld";function iB1(Z,J=new Map){let X=Z.getIndices();if(!X)return;let Y=Z.getGraph(),$=C6.fromGraph(Y),Q=$.getLogger(),W=Z.getAttribute("POSITION").getCount();for(let G of Z.listAttributes())if(Z.swap(G,Sn($,G,X,J)),G.listParents().length===1)G.dispose();for(let G of Z.listTargets())for(let H of G.listAttributes())if(G.swap(H,Sn($,H,X,J)),H.listParents().length===1)H.dispose();let K=Z.getAttribute("POSITION").getCount();if(Q.debug(`${pB1}: ${y2(W,K)} vertices.`),Z.setIndices(null),X.listParents().length===1)X.dispose()}function Sn(Z,J,X,Y){if(Y.has(J)&&Y.get(J).has(X))return Y.get(J).get(X);let $=J.getArray(),W=new $.constructor(X.getCount()*J.getElementSize()),K=X.getArray(),G=J.getElementSize();for(let z=0,q=X.getCount();z<q;z++)for(let V=0;V<G;V++)W[z*G+V]=$[K[z]*G+V];if(!Y.has(J))Y.set(J,new Map);let H=LZ(Z,J).setArray(W);return Y.get(J).set(X,H),H}var _n;(function(Z){Z[Z.STEP=0]="STEP",Z[Z.LERP=1]="LERP",Z[Z.SLERP=2]="SLERP"})(_n||(_n={}));var nB1=0.000001;function aB1(Z,J,X,Y=0.0001){let $=J.length/Z.length,Q=new Array($).fill(0),W=new Array($).fill(0),K=new Array($).fill(0),G=new Array($).fill(0),H=Z.length-1,z=1;for(let q=1;q<H;++q){let V=Z[z-1],F=Z[q],U=Z[q+1],w=(F-V)/(U-V),L=!1;if(F!==U&&(q!==1||F!==Z[0])){if(CG(J,z-1,G),CG(J,q,W),CG(J,q+1,K),X==="slerp"){let O=rB1(Q,G,K,w),N=xn(G,W)+xn(W,K);L=!x2(W,O,Y)||N+Number.EPSILON>=Math.PI}else if(X==="lerp"){let O=oB1(Q,G,K,w);L=!x2(W,O,Y)}else if(X==="step")L=!x2(W,G)||!x2(W,K)}if(L){if(q!==z)Z[z]=Z[q],An(J,z,CG(J,q,Q));z++}}if(H>0)Z[z]=Z[H],An(J,z,CG(J,H,Q)),z++;return z}function CG(Z,J,X){for(let Y=0,$=X.length;Y<$;Y++)X[Y]=Z[J*$+Y];return X}function An(Z,J,X){for(let Y=0,$=X.length;Y<$;Y++)Z[J*$+Y]=X[Y]}function x2(Z,J,X=0){if(Z.length!==J.length)return!1;for(let Y=0;Y<Z.length;Y++)if(Math.abs(Z[Y]-J[Y])>X)return!1;return!0}function sB1(Z,J,X){return Z*(1-X)+J*X}function oB1(Z,J,X,Y){for(let $=0;$<J.length;$++)Z[$]=sB1(J[$],X[$],Y);return Z}function rB1(Z,J,X,Y){let $=J[0],Q=J[1],W=J[2],K=J[3],G=X[0],H=X[1],z=X[2],q=X[3],V,F,U,w,L;if(F=$*G+Q*H+W*z+K*q,F<0)F=-F,G=-G,H=-H,z=-z,q=-q;if(1-F>nB1)V=Math.acos(F),U=Math.sin(V),w=Math.sin((1-Y)*V)/U,L=Math.sin(Y*V)/U;else w=1-Y,L=Y;return Z[0]=w*$+L*G,Z[1]=w*Q+L*H,Z[2]=w*W+L*z,Z[3]=w*K+L*q,Z}function xn(Z,J){let X=tB1(Z,J);return Math.acos(2*X*X-1)}function tB1(Z,J){return Z[0]*J[0]+Z[1]*J[1]+Z[2]*J[2]+Z[3]*J[3]}var Uz6=new Float32Array(0),Lz6={ready:Promise.resolve(),resample:aB1,tolerance:0.0001,cleanup:!0};var RY="simplify",{POINTS:Ka,LINES:eB1,LINE_STRIP:ZO1,LINE_LOOP:JO1,TRIANGLES:XO1,TRIANGLE_STRIP:Ga,TRIANGLE_FAN:Ha}=M8.Mode,za={ratio:0,error:0.0001,lockBorder:!1,cleanup:!0};function qa(Z){let J=z7(za,Z),X=J.simplifier;if(!X)throw new Error(`${RY}: simplifier dependency required \u2014 install "meshoptimizer".`);return DJ(RY,async(Y)=>{let $=Y.getLogger();await X.ready,await Y.transform(kC({overwrite:!1,cleanup:J.cleanup}));let Q=0;for(let W of Y.getRoot().listMeshes()){for(let K of W.listPrimitives()){let G=K.getMode();if(G===XO1||G===Ga||G===Ha){if(hn(K,J),NJ(K,w6.RENDER)===0)K.dispose()}else if(K.getMode()===Ka&&!!X.simplifyPoints){if(hn(K,J),NJ(K,w6.RENDER)===0)K.dispose()}else Q++}if(W.listPrimitives().length===0)W.dispose()}if(Q>0)$.warn(`${RY}: Skipping simplification of ${Q} primitives: Unsupported draw mode.`);if(J.cleanup)await Y.transform(m2({propertyTypes:[a.ACCESSOR,a.NODE],keepAttributes:!0,keepIndices:!0,keepLeaves:!1}),dn({propertyTypes:[a.ACCESSOR]}));$.debug(`${RY}: Complete.`)})}function hn(Z,J){let X=nQ({},za,J),Y=X.simplifier,$=Z.getGraph(),Q=C6.fromGraph($),W=Q.getLogger();switch(Z.getMode()){case Ka:return YO1(Q,Z,X);case eB1:case ZO1:case JO1:return W.warn(`${RY}: Skipping primitive simplification: Unsupported draw mode.`),Z;case Ga:case Ha:Za(Z);break}let K=NJ(Z,w6.UPLOAD),G=NJ(Z,w6.RENDER);if(G<K/2)TG(Z);let H=Z.getAttribute("POSITION"),z=Z.getIndices(),q=H.getArray(),V=z.getArray();if(!(q instanceof Float32Array))q=b2(q,H.getComponentType(),H.getNormalized());if(!(V instanceof Uint32Array))V=new Uint32Array(V);let F=Math.floor(X.ratio*G/3)*3,U=X.lockBorder?["LockBorder"]:[],[w,L]=Y.simplify(V,q,3,F,X.error,U);if(Z.setIndices(LZ(Q,z).setArray(w)),z.listParents().length===1)z.dispose();TG(Z);let O=NJ(Z,w6.UPLOAD);if(O<=65534)Z.getIndices().setArray(new Uint16Array(Z.getIndices().getArray()));return W.debug(`${RY}: ${y2(K,O)} vertices, error: ${L.toFixed(4)}.`),Z}function YO1(Z,J,X){let Y=X.simplifier,$=Z.getLogger();if(J.getIndices())iB1(J);let W=J.getAttribute("POSITION"),K=J.getAttribute("COLOR_0"),G=W.getCount(),H=W.getArray(),z=K?K.getArray():void 0,q=K?K.getComponentSize():void 0;if(!(H instanceof Float32Array))H=b2(H,W.getComponentType(),W.getNormalized());if(z&&!(z instanceof Float32Array))z=b2(z,W.getComponentType(),W.getNormalized());Y.useExperimentalFeatures=!0;let V=Math.floor(X.ratio*G),F=Y.simplifyPoints(H,3,V,z,q);Y.useExperimentalFeatures=!1;let[U,w]=Y.compactMesh(F);$.debug(`${RY}: ${y2(W.getCount(),w)} vertices.`);for(let L of CC(J)){let O=LZ(Z,L);if(MC(L,null,U,O,w),Dw1(J,L,O),L.listParents().length===1)L.dispose()}return J}var PC;(function(Z){Z.LANCZOS3="lanczos3",Z.LANCZOS2="lanczos2"})(PC||(PC={}));var wz6={resizeFilter:PC.LANCZOS3,pattern:void 0,formats:void 0,slots:void 0,quality:void 0,effort:void 0,lossless:!1,nearLossless:!1,limitInputPixels:!0};var Oz6=function(){var Z="b9H79TebbbeJq9Geueu9Geub9Gbb9Gvuuuuueu9Gduueu9Gluuuueu9Gvuuuuub9Gouuuuuub9Gluuuub9GiuuueuiKLdilevlevlooroowwvwbDDbelve9Weiiviebeoweuec:G:Qdkr;RiOo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWVbe8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9c9V919U9KbdE9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949wWV79P9V9UbiY9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWVbl8E9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWV9c9V919U9Kbv8A9TW79O9V9Wt9FW9U9J9V9KW69U9KW949wWV79P9V9UboE9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JWbra9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JW9c9V919U9KbwL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9p9JtbDK9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9r919HtbqL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVT949WbkE9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OWbPa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OW9ttV9P9Wbsa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9WbzK9TW79O9V9Wt9F79W9Ht9P9H29t9VVt9sW9T9H9WbHl79IV9RbODwebcekdQXq;A9pLdbk;QqeKu8Jjjjjbcjo9Rgv8Kjjjjbcbhodnalcefae0mbabcbRbN:kjjbc:GeV86bbavcjdfcbcjdzNjjjb8AdnaiTmbavcjdfadalz:tjjjb8Akabaefhrabcefhwavalfcbcbcjdal9RalcFe0EzNjjjb8Aavavcjdfalz:tjjjbhDcj;abal9Uc;WFbGgecjdaecjd6Ehqcbhkindndnaiak9nmbaDcjlfcbcjdzNjjjb8Aaqaiak9Rakaqfai6Egxcsfgecl4cifcd4hmadakal2fhPdndndnaec9WGgsTmbcbhzaPhHawhOxekdnaxmbalheinaraw9Ram6miawcbamzNjjjbamfhwaecufgembxvkkcbhAaPhOinaDaAfRbbhCaDcjlfheaOhoaxhXinaeaoRbbgQaC9RgCcetaCcKtcK91cr4786bbaoalfhoaecefheaQhCaXcufgXmbkaraw9Ram6mdaOcefhOawcbamzNjjjbamfhwaAcefgAal9hmbxlkkindnaxTmbaDazfRbbhCaDcjlfheaHhoaxhXinaeaoRbbgQaC9RgCcetaCcKtcK91cr4786bbaoalfhoaecefheaQhCaXcufgXmbkkaraO9Ram6mearaOcbamzNjjjbgLamfgw9RcK6mecbhKaDcjlfhOinaDcjlfaKfhYcwhAczhQceheindndnaegXce9hmbcuhoaYRbbmecbhodninaogecsSmeaecefhoaOaefcefRbbTmbkkcucbaecs6EhoxekaXcethocuaXtc;:bGcFb7hCcbheinaoaCaOaefRbb9nfhoaecefgecz9hmbkkaoaQaoaQ6geEhQaXaAaeEhAaXcetheaXcl6mbkdndndndnaAcufPdiebkaLaKco4fgeaeRbbcdciaAclSEaKci4coGtV86bbaAcw9hmeawaY8Pbb83bbawcwfaYcwf8Pbb83bbawczfhwxdkaLaKco4fgeaeRbbceaKci4coGtV86bbkdncwaA9Tg8Ambinawcb86bbawcefhwxbkkcuaAtcu7hYcbhEaOh3ina3hea8AhCcbhoinaeRbbgQaYcFeGgXaQaX6EaoaAtVhoaecefheaCcufgCmbkawao86bba3a8Afh3awcefhwaEa8AfgEcz6mbkcbheindnaOaefRbbgoaX6mbawao86bbawcefhwkaecefgecz9hmbkkdnaKczfgKas9pmbaOczfhOaraw9RcL0mekkaKas6meawTmeaHcefhHawhOazcefgzalSmixbkkcbhoxikcbhoaraw9Ralcaalca0E6mddnalc8F0mbawcbcaal9RgezNjjjbaefhwkawaDcjdfalz:tjjjbalfab9RhoxdkaDaPaxcufal2falz:tjjjb8Aaxakfhkawmbkcbhokavcjof8Kjjjjbaok9heeuaecaaeca0Eabcj;abae9Uc;WFbGgdcjdadcjd6Egdfcufad9Uae2adcl4cifcd4adV2fcefkmbcbabBdN:kjjbk:zse5u8Jjjjjbc;ae9Rgl8Kjjjjbcbhvdnaici9UgocHfae0mbabcbyd:e:kjjbgrc;GeV86bbalc;abfcFecjezNjjjb8AalcUfgw9cu83ibalc8WfgD9cu83ibalcyfgq9cu83ibalcafgk9cu83ibalcKfgx9cu83ibalczfgm9cu83ibal9cu83iwal9cu83ibabaefc9WfhPabcefgsaofhednaiTmbcmcsarcb9kgzEhHcbhOcbhAcbhCcbhXcbhQindnaeaP9nmbcbhvxikaQcufhvadaCcdtfgLydbhKaLcwfydbhYaLclfydbh8AcbhEdndndninalc;abfavcsGcitfgoydlh3dndndnaoydbgoaK9hmba3a8ASmekdnaoa8A9hmba3aY9hmbaEcefhExekaoaY9hmea3aK9hmeaEcdfhEkaEc870mdaXcufhvaLaEciGcx2goc:y1jjbfydbcdtfydbh3aLaocN1jjbfydbcdtfydbh8AaLaoc:q1jjbfydbcdtfydbhKcbhodnindnalavcsGcdtfydba39hmbaohYxdkcuhYavcufhvaocefgocz9hmbkkaOa3aOSgvaYce9iaYaH9oVgoGfhOdndndncbcsavEaYaoEgvcs9hmbarce9imba3a3aAa3cefaASgvEgAcefSmecmcsavEhvkasavaEcdtc;WeGV86bbavcs9hmea3aA9Rgvcetavc8F917hvinaeavcFb0crtavcFbGV86bbaecefheavcje6hoavcr4hvaoTmbka3hAxvkcPhvasaEcdtcPV86bba3hAkavTmiavaH9omicdhocehEaQhYxlkavcufhvaEclfgEc;ab9hmbkkdnaLceaYaOSceta8AaOSEcx2gvc:q1jjbfydbcdtfydbgKTaLavcN1jjbfydbcdtfydbg8AceSGaLavc:y1jjbfydbcdtfydbg3cdSGaOcb9hGazGg5ce9hmbaw9cu83ibaD9cu83ibaq9cu83ibak9cu83ibax9cu83ibam9cu83ibal9cu83iwal9cu83ibcbhOkcbhEaXcufgvhodnindnalaocsGcdtfydba8A9hmbaEhYxdkcuhYaocufhoaEcefgEcz9hmbkkcbhodnindnalavcsGcdtfydba39hmbaohExdkcuhEavcufhvaocefgocz9hmbkkaOaKaOSg8EfhLdndnaYcm0mbaYcefhYxekcbcsa8AaLSgvEhYaLavfhLkdndnaEcm0mbaEcefhExekcbcsa3aLSgvEhEaLavfhLkc9:cua8EEh8FcbhvaEaYcltVgacFeGhodndndninavcj1jjbfRbbaoSmeavcefgvcz9hmbxdkka5aKaO9havcm0VVmbasavc;WeV86bbxekasa8F86bbaeaa86bbaecefhekdna8EmbaKaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombkaKhAkdnaYcs9hmba8AaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombka8AhAkdnaEcs9hmba3aA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombka3hAkalaXcdtfaKBdbaXcefcsGhvdndnaYPzbeeeeeeeeeeeeeebekalavcdtfa8ABdbaXcdfcsGhvkdndnaEPzbeeeeeeeeeeeeeebekalavcdtfa3BdbavcefcsGhvkcihoalc;abfaQcitfgEaKBdlaEa8ABdbaQcefcsGhYcdhEavhXaLhOxekcdhoalaXcdtfa3BdbcehEaXcefcsGhXaQhYkalc;abfaYcitfgva8ABdlava3Bdbalc;abfaQaEfcsGcitfgva3BdlavaKBdbascefhsaQaofcsGhQaCcifgCai6mbkkcbhvaeaP0mbcbhvinaeavfavcj1jjbfRbb86bbavcefgvcz9hmbkaeab9Ravfhvkalc;aef8KjjjjbavkZeeucbhddninadcefgdc8F0meceadtae6mbkkadcrfcFeGcr9Uci2cdfabci9U2cHfkmbcbabBd:e:kjjbk:ydewu8Jjjjjbcz9Rhlcbhvdnaicvfae0mbcbhvabcbRb:e:kjjbc;qeV86bbal9cb83iwabcefhoabaefc98fhrdnaiTmbcbhwcbhDindnaoar6mbcbskadaDcdtfydbgqalcwfawaqav9Rgvavc8F91gv7av9Rc507gwcdtfgkydb9Rgvc8E91c9:Gavcdt7awVhvinaoavcFb0gecrtavcFbGV86bbavcr4hvaocefhoaembkakaqBdbaqhvaDcefgDai9hmbkkcbhvaoar0mbaocbBbbaoab9RclfhvkavkBeeucbhddninadcefgdc8F0meceadtae6mbkkadcwfcFeGcr9Uab2cvfk:bvli99dui99ludnaeTmbcuadcetcuftcu7:Yhvdndncuaicuftcu7:YgoJbbbZMgr:lJbbb9p9DTmbar:Ohwxekcjjjj94hwkcbhicbhDinalclfIdbgrJbbbbJbbjZalIdbgq:lar:lMalcwfIdbgk:lMgr:varJbbbb9BEgrNhxaqarNhrdndnakJbbbb9GTmbaxhqxekJbbjZar:l:tgqaq:maxJbbbb9GEhqJbbjZax:l:tgxax:marJbbbb9GEhrkdndnalcxfIdbgxJbbj:;axJbbj:;9GEgkJbbjZakJbbjZ9FEavNJbbbZJbbb:;axJbbbb9GEMgx:lJbbb9p9DTmbax:Ohmxekcjjjj94hmkdndnaqJbbj:;aqJbbj:;9GEgxJbbjZaxJbbjZ9FEaoNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:OhPxekcjjjj94hPkdndnarJbbj:;arJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;arJbbbb9GEMgr:lJbbb9p9DTmbar:Ohsxekcjjjj94hskdndnadcl9hmbabaifgzas86bbazcifam86bbazcdfaw86bbazcefaP86bbxekabaDfgzas87ebazcofam87ebazclfaw87ebazcdfaP87ebkalczfhlaiclfhiaDcwfhDaecufgembkkk;hlld99eud99eudnaeTmbdndncuaicuftcu7:YgvJbbbZMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikaic;8FiGhrinabcofcicdalclfIdb:lalIdb:l9EgialcwfIdb:lalaicdtfIdb:l9EEgialcxfIdb:lalaicdtfIdb:l9EEgiarV87ebdndnJbbj:;JbbjZalaicdtfIdbJbbbb9DEgoalaicd7cdtfIdbJ;Zl:1ZNNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabcdfaq87ebdndnalaicefciGcdtfIdbJ;Zl:1ZNaoNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabaq87ebdndnaoalaicufciGcdtfIdbJ;Zl:1ZNNgoJbbj:;aoJbbj:;9GEgwJbbjZawJbbjZ9FEavNJbbbZJbbb:;aoJbbbb9GEMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikabclfai87ebabcwfhbalczfhlaecufgembkkk;3viDue99eu8Jjjjjbcjd9Rgo8Kjjjjbadcd4hrdndndndnavcd9hmbadcl6meaohwarhDinawc:CuBdbawclfhwaDcufgDmbkaeTmiadcl6mdarcdthqalhkcbhxinaohwakhDarhminawawydbgPcbaDIdbgs:8cL4cFeGc:cufasJbbbb9BEgzaPaz9kEBdbaDclfhDawclfhwamcufgmmbkakaqfhkaxcefgxaeSmixbkkaeTmdxekaeTmekarcdthkavce9hhqadcl6hdcbhxindndndnaqmbadmdc:CuhDalhwarhminaDcbawIdbgs:8cL4cFeGc:cufasJbbbb9BEgPaDaP9kEhDawclfhwamcufgmmbxdkkc:CuhDdndnavPleddbdkadmdaohwalhmarhPinawcbamIdbgs:8cL4cFeGgzc;:bazc;:b9kEc:cufasJbbbb9BEBdbamclfhmawclfhwaPcufgPmbxdkkadmecbhwarhminaoawfcbalawfIdbgs:8cL4cFeGgPc8AaPc8A9kEc:cufasJbbbb9BEBdbawclfhwamcufgmmbkkadmbcbhwarhPinaDhmdnavceSmbaoawfydbhmkdndnalawfIdbgscjjj;8iamai9RcefgmcLt9R::NJbbbZJbbb:;asJbbbb9GEMgs:lJbbb9p9DTmbas:Ohzxekcjjjj94hzkabawfazcFFFrGamcKtVBdbawclfhwaPcufgPmbkkabakfhbalakfhlaxcefgxae9hmbkkaocjdf8Kjjjjbk;HqdCui998Jjjjjbc:qd9Rgv8Kjjjjbavc:Sefcbc;KbzNjjjb8AcbhodnadTmbcbhoaiTmbdnabae9hmbavcuadcdtgradcFFFFi0Ecbyd:m:kjjbHjjjjbbgeBd:SeavceBd:mdaeabarz:tjjjb8Akavc:GefcwfcbBdbav9cb83i:Geavc:Gefaeadaiavc:Sefz:njjjbavyd:Gehwadci9UgDcbyd:m:kjjbHjjjjbbhravc:Sefavyd:mdgqcdtfarBdbavaqcefgkBd:mdarcbaDzNjjjbhxavc:SefakcdtfcuaicdtaicFFFFi0Ecbyd:m:kjjbHjjjjbbgmBdbavaqcdfgPBd:mdawhramhkinakalIdbalarydbgscwascw6Ecdtfc;ebfIdbMUdbarclfhrakclfhkaicufgimbkavc:SefaPcdtfcuaDcdtadcFFFF970Ecbyd:m:kjjbHjjjjbbgPBdbdnadci6mbaehraPhkaDhiinakamarydbcdtfIdbamarclfydbcdtfIdbMamarcwfydbcdtfIdbMUdbarcxfhrakclfhkaicufgimbkkaqcifhoavc;qbfhzavhravyd:KehHavyd:OehOcbhscbhkcbhAcehCinarhXcihQaeakci2gLcdtfgrydbhdarclfydbhqabaAcx2fgicwfarcwfydbgKBdbaiclfaqBdbaiadBdbaxakfce86bbazaKBdwazaqBdlazadBdbaPakcdtfcbBdbdnasTmbcihQaXhiinazaQcdtfaiydbgrBdbaQaraK9harad9haraq9hGGfhQaiclfhiascufgsmbkkaAcefhAcbhsinaOaHaeasaLfcdtfydbcdtgifydbcdtfgKhrawaifgqydbgdhidnadTmbdninarydbakSmearclfhraicufgiTmdxbkkaraKadcdtfc98fydbBdbaqaqydbcufBdbkascefgsci9hmbkdndnaQTmbcuhkJbbbbhYcbhqavyd:KehKavyd:OehLindndnawazaqcdtfydbcdtgsfydbgrmbaqcefhqxekaqcs0hiamasfgdIdbh8AadalcbaqcefgqaiEcdtfIdbalarcwarcw6Ecdtfc;ebfIdbMgEUdbaEa8A:thEarcdthiaLaKasfydbcdtfhrinaParydbgscdtfgdaEadIdbMg8AUdba8AaYaYa8A9DgdEhYasakadEhkarclfhraic98fgimbkkaqaQ9hmbkakcu9hmekaCaD9pmdindnaxaCfRbbmbaChkxdkaDaCcefgC9hmbxikkaQczaQcz6EhsazhraXhzakcu9hmbkkaocdtavc:Seffc98fhrdninaoTmearydbcbyd1:kjjbH:bjjjbbarc98fhraocufhoxbkkavc:qdf8Kjjjjbk;IlevucuaicdtgvaicFFFFi0Egocbyd:m:kjjbHjjjjbbhralalyd9GgwcdtfarBdbalawcefBd9GabarBdbaocbyd:m:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdlcuadcdtadcFFFFi0Ecbyd:m:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdwabydbcbavzNjjjb8Aadci9UhDdnadTmbabydbhoaehladhrinaoalydbcdtfgvavydbcefBdbalclfhlarcufgrmbkkdnaiTmbabydbhlabydlhrcbhvaihoinaravBdbarclfhralydbavfhvalclfhlaocufgombkkdnadci6mbabydlhrabydwhvcbhlinaecwfydbhoaeclfydbhdaraeydbcdtfgwawydbgwcefBdbavawcdtfalBdbaradcdtfgdadydbgdcefBdbavadcdtfalBdbaraocdtfgoaoydbgocefBdbavaocdtfalBdbaecxfheaDalcefgl9hmbkkdnaiTmbabydlheabydbhlinaeaeydbalydb9RBdbalclfhlaeclfheaicufgimbkkkQbabaeadaic:01jjbz:mjjjbkQbabaeadaic:C:jjjbz:mjjjbk9DeeuabcFeaicdtzNjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk;Wkivuo99lu8Jjjjjbc;W;Gb9Rgl8Kjjjjbcbhvalcj;Gbfcbc;KbzNjjjb8AalcuadcdtadcFFFFi0Egocbyd:m:kjjbHjjjjbbgrBdj9GalceBd;G9GalcFFF;7rBdwal9cFFF;7;3FF:;Fb83dbalcFFF97Bd;S9Gal9cFFF;7FFF:;u83d;K9Gaicd4hwdndnadmbJFFuFhDJFFuuhqJFFuuhkJFFuFhxJFFuuhmJFFuFhPxekawcdthsaehzincbhiinalaifgHazaifIdbgDaHIdbgxaxaD9EEUdbalc;K;GbfaifgHaDaHIdbgxaxaD9DEUdbaiclfgicx9hmbkazasfhzavcefgvad9hmbkalIdwhqalId;S9GhDalIdlhkalId;O9GhxalIdbhmalId;K9GhPkdndnadTmbJbbbbJbbjZJbbbbaPam:tgPaPJbbbb9DEgPaxak:tgxaxaP9DEgxaDaq:tgDaDax9DEgD:vaDJbbbb9BEhDawcdthsarhHadhzindndnaDaeIdbam:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcv2c;j:KM;jbGhvdndnaDaeclfIdbak:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcq2cM;j:KMeGavVhvdndnaDaecwfIdbaq:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaHavaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcC2c:KM;j:KdGVBdbaeasfheaHclfhHazcufgzmbkalcbcj;GbzNjjjbhiarhHadheinaiaHydbgzcFrGcx2fgvavydbcefBdbaiazcq4cFrGcx2fgvavydlcefBdlaiazcC4cFrGcx2fgzazydwcefBdwaHclfhHaecufgembxdkkalcbcj;GbzNjjjb8AkcbhHcbhzcbhecbhvinalaHfgiydbhsaiazBdbaicwfgwydbhOawavBdbaiclfgiydbhwaiaeBdbasazfhzaOavfhvawaefheaHcxfgHcj;Gb9hmbkcbhHalaocbyd:m:kjjbHjjjjbbgiBd:e9GdnadTmbabhzinazaHBdbazclfhzadaHcefgH9hmbkabhHadhzinalaraHydbgecdtfydbcFrGcx2fgvavydbgvcefBdbaiavcdtfaeBdbaHclfhHazcufgzmbkaihHadhzinalaraHydbgecdtfydbcq4cFrGcx2fgvavydlgvcefBdlabavcdtfaeBdbaHclfhHazcufgzmbkabhHadhzinalaraHydbgecdtfydbcC4cFrGcx2fgvavydwgvcefBdwaiavcdtfaeBdbaHclfhHazcufgzmbkcbhHinabaiydbcdtfaHBdbaiclfhiadaHcefgH9hmbkkclhidninaic98Smealcj;Gbfaifydbcbyd1:kjjbH:bjjjbbaic98fhixbkkalc;W;Gbf8Kjjjjbk9teiucbcbyd:q:kjjbgeabcifc98GfgbBd:q:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:q:kjjbgeabcrfc94GfgbBd:q:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd:q:kjjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd:q:kjjbfgdBd:q:kjjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akkk:Iddbcjwk:edb4:h9w9N94:P:gW:j9O:ye9Pbbbbbbebbbdbbbebbbdbbbbbbbdbbbbbbbebbbbbbb:l29hZ;69:9kZ;N;76Z;rg97Z;z;o9xZ8J;B85Z;:;u9yZ;b;k9HZ:2;Z9DZ9e:l9mZ59A8KZ:r;T3Z:A:zYZ79OHZ;j4::8::Y:D9V8:bbbb9s:49:Z8R:hBZ9M9M;M8:L;z;o8:;8:PG89q;x:J878R:hQ8::M:B;e87bbbbbbjZbbjZbbjZ:E;V;N8::Y:DsZ9i;H;68:xd;R8:;h0838:;W:NoZbbbb:WV9O8:uf888:9i;H;68:9c9G;L89;n;m9m89;D8Ko8:bbbbf:8tZ9m836ZS:2AZL;zPZZ818EZ9e:lxZ;U98F8:819E;68:bc:eqkzebbbebbbdbbba:vbb",J=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!=="object")return{supported:!1};var X,Y=WebAssembly.instantiate($(Z),{}).then(function(F){X=F.instance,X.exports.__wasm_call_ctors(),X.exports.meshopt_encodeVertexVersion(0),X.exports.meshopt_encodeIndexVersion(1)});function $(F){var U=new Uint8Array(F.length);for(var w=0;w<F.length;++w){var L=F.charCodeAt(w);U[w]=L>96?L-97:L>64?L-39:L+4}var O=0;for(var w=0;w<F.length;++w)U[O++]=U[w]<60?J[U[w]]:(U[w]-60)*64+U[++w];return U.buffer.slice(0,O)}function Q(F){if(!F)throw new Error("Assertion failed")}function W(F){return new Uint8Array(F.buffer,F.byteOffset,F.byteLength)}function K(F,U,w,L){var O=X.exports.sbrk,N=O(U.length*4),M=O(w*4),j=new Uint8Array(X.exports.memory.buffer),P=W(U);if(j.set(P,N),L)L(N,N,U.length,w);var D=F(M,N,U.length,w);j=new Uint8Array(X.exports.memory.buffer);var C=new Uint32Array(w);new Uint8Array(C.buffer).set(j.subarray(M,M+w*4)),P.set(j.subarray(N,N+U.length*4)),O(N-O(0));for(var k=0;k<U.length;++k)U[k]=C[U[k]];return[C,D]}function G(F,U,w,L){var O=X.exports.sbrk,N=O(w*4),M=O(w*L),j=new Uint8Array(X.exports.memory.buffer);j.set(W(U),M),F(N,M,w,L),j=new Uint8Array(X.exports.memory.buffer);var P=new Uint32Array(w);return new Uint8Array(P.buffer).set(j.subarray(N,N+w*4)),O(N-O(0)),P}function H(F,U,w,L,O){var N=X.exports.sbrk,M=N(U),j=N(L*O),P=new Uint8Array(X.exports.memory.buffer);P.set(W(w),j);var D=F(M,U,j,L,O),C=new Uint8Array(D);return C.set(P.subarray(M,M+D)),N(M-N(0)),C}function z(F){var U=0;for(var w=0;w<F.length;++w){var L=F[w];U=U<L?L:U}return U}function q(F,U){if(Q(U==2||U==4),U==4)return new Uint32Array(F.buffer,F.byteOffset,F.byteLength/4);else{var w=new Uint16Array(F.buffer,F.byteOffset,F.byteLength/2);return new Uint32Array(w)}}function V(F,U,w,L,O,N,M){var j=X.exports.sbrk,P=j(w*L),D=j(w*N),C=new Uint8Array(X.exports.memory.buffer);C.set(W(U),D),F(P,w,L,O,D,M);var k=new Uint8Array(w*L);return k.set(C.subarray(P,P+w*L)),j(P-j(0)),k}return{ready:Y,supported:!0,reorderMesh:function(F,U,w){var L=U?w?X.exports.meshopt_optimizeVertexCacheStrip:X.exports.meshopt_optimizeVertexCache:void 0;return K(X.exports.meshopt_optimizeVertexFetchRemap,F,z(F)+1,L)},reorderPoints:function(F,U){return Q(F instanceof Float32Array),Q(F.length%U==0),Q(U>=3),G(X.exports.meshopt_spatialSortRemap,F,F.length/U,U*4)},encodeVertexBuffer:function(F,U,w){Q(w>0&&w<=256),Q(w%4==0);var L=X.exports.meshopt_encodeVertexBufferBound(U,w);return H(X.exports.meshopt_encodeVertexBuffer,L,F,U,w)},encodeIndexBuffer:function(F,U,w){Q(w==2||w==4),Q(U%3==0);var L=q(F,w),O=X.exports.meshopt_encodeIndexBufferBound(U,z(L)+1);return H(X.exports.meshopt_encodeIndexBuffer,O,L,U,4)},encodeIndexSequence:function(F,U,w){Q(w==2||w==4);var L=q(F,w),O=X.exports.meshopt_encodeIndexSequenceBound(U,z(L)+1);return H(X.exports.meshopt_encodeIndexSequence,O,L,U,4)},encodeGltfBuffer:function(F,U,w,L){var O={ATTRIBUTES:this.encodeVertexBuffer,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return Q(O[L]),O[L](F,U,w)},encodeFilterOct:function(F,U,w,L){return Q(w==4||w==8),Q(L>=1&&L<=16),V(X.exports.meshopt_encodeFilterOct,F,U,w,L,16)},encodeFilterQuat:function(F,U,w,L){return Q(w==8),Q(L>=4&&L<=16),V(X.exports.meshopt_encodeFilterQuat,F,U,w,L,16)},encodeFilterExp:function(F,U,w,L,O){Q(w>0&&w%4==0),Q(L>=1&&L<=24);var N={Separate:0,SharedVector:1,SharedComponent:2,Clamped:3};return V(X.exports.meshopt_encodeFilterExp,F,U,w,L,w,O?N[O]:1)}}}();var Mz6=function(){var Z="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q:Odkr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq;w8Wqdbk;esezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9Uc;WFbGgocjdaocjd6EhDaicefhocbhqdnindndndnaeaq9nmbaDaeaq9RaqaDfae6Egkcsfglcl4cifcd4hxalc9WGgmTmecbhPawcjdfhsaohzinaraz9Rax6mvarazaxfgo9RcK6mvczhlcbhHinalgic9WfgOawcj;cbffhldndndndndnazaOco4fRbbaHcoG4ciGPlbedibkal9cb83ibalcwf9cb83ibxikalaoRblaoRbbgOco4gAaAciSgAE86bbawcj;cbfaifglcGfaoclfaAfgARbbaOcl4ciGgCaCciSgCE86bbalcVfaAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc7faAaCfgARbbaOciGgOaOciSgOE86bbalctfaAaOfgARbbaoRbegOco4gCaCciSgCE86bbalc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc93faAaCfgARbbaOciGgOaOciSgOE86bbalc94faAaOfgARbbaoRbdgOco4gCaCciSgCE86bbalc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc97faAaCfgARbbaOciGgOaOciSgOE86bbalc98faAaOfgORbbaoRbigoco4gAaAciSgAE86bbalc99faOaAfgORbbaocl4ciGgAaAciSgAE86bbalc9:faOaAfgORbbaocd4ciGgAaAciSgAE86bbalcufaOaAfglRbbaociGgoaociSgoE86bbalaofhoxdkalaoRbwaoRbbgOcl4gAaAcsSgAE86bbawcj;cbfaifglcGfaocwfaAfgARbbaOcsGgOaOcsSgOE86bbalcVfaAaOfgORbbaoRbegAcl4gCaCcsSgCE86bbalc7faOaCfgORbbaAcsGgAaAcsSgAE86bbalctfaOaAfgORbbaoRbdgAcl4gCaCcsSgCE86bbalc91faOaCfgORbbaAcsGgAaAcsSgAE86bbalc4faOaAfgORbbaoRbigAcl4gCaCcsSgCE86bbalc93faOaCfgORbbaAcsGgAaAcsSgAE86bbalc94faOaAfgORbbaoRblgAcl4gCaCcsSgCE86bbalc95faOaCfgORbbaAcsGgAaAcsSgAE86bbalc96faOaAfgORbbaoRbvgAcl4gCaCcsSgCE86bbalc97faOaCfgORbbaAcsGgAaAcsSgAE86bbalc98faOaAfgORbbaoRbogAcl4gCaCcsSgCE86bbalc99faOaCfgORbbaAcsGgAaAcsSgAE86bbalc9:faOaAfgORbbaoRbrgocl4gAaAcsSgAE86bbalcufaOaAfglRbbaocsGgoaocsSgoE86bbalaofhoxekalao8Pbb83bbalcwfaocwf8Pbb83bbaoczfhokdnaiam9pmbaHcdfhHaiczfhlarao9RcL0mekkaiam6mvaoTmvdnakTmbawaPfRbbhHawcj;cbfhlashiakhOinaialRbbgzce4cbazceG9R7aHfgH86bbaiadfhialcefhlaOcufgOmbkkascefhsaohzaPcefgPad9hmbxikkcbc99arao9Radcaadca0ESEhoxlkaoaxad2fhCdnakmbadhlinaoTmlarao9Rax6mlaoaxfhoalcufglmbkaChoxekcbhmawcjdfhAinarao9Rax6miawamfRbbhHawcj;cbfhlaAhiakhOinaialRbbgzce4cbazceG9R7aHfgH86bbaiadfhialcefhlaOcufgOmbkaAcefhAaoaxfhoamcefgmad9hmbkaChokabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqaombkc9:hoxekc9:hokavcj;ebf8Kjjjjbaok;cseHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;oiliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabaiavcefciGfcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavciGfgkcd7cetfaD87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavcufciGfcetfaD87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohvxekcjjjj94hvkabakcetfav87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklzNbb",J="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q:6dkr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq:p9sqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk:N8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhlaicefhodnaeTmbadTmbalc;WFbGglcjdalcjd6EhwcbhDinawaeaD9RaDawfae6Egqcsfglc9WGgkci2hxakcethmalcl4cifcd4hPabaDad2fhsakc;ab6hzcbhHincbhOaohAdndninaraA9RaP6meavcj;cbfaOak2fhCaAaPfhocbhidnazmbarao9Rc;Gb6mbcbhlinaCalfhidndndndndnaAalco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklbaoczfhokdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklzaoczfhokdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklaaoczfhokdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WaoclfaYpQbfaXc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WaocwfaYpQbfaXc:q:yjjbfRbbfhoxekaiaopbbbpkl8Waoczfhokalc;abfhialcjefak0meaihlarao9Rc;Fb0mbkkdnaiak9pmbaici4hlinarao9RcK6miaCaifhXdndndndndnaAaico4fRbbalcoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpkbbxikaXaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkbbaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaXaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkbbaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaXaopbbbpkbbaoczfhokalcdfhlaiczfgiak6mbkkaoTmeaohAaOcefgOclSmdxbkkc9:hoxlkdnakTmbavcjdfaHfhiavaHfpbdbhYcbhXinaiavcj;cbfaXfglpblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLalakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEalamfpblbg3cep9Ta3aQp9op9Hp9rg3alaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfhiaXczfgXak6mbkkaHclfgHad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfgDae6mbkkcbc99arao9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk::seHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:wPliuo97eue978Jjjjjbca9Rhiaec98Ghldndnadcl9hmbdnalTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalaeSmeaipxbbbbbbbbbbbbbbbbgqpklbaiabalcdtfgdaeciGglcdtgv;8qbbdnalTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDaqp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkadaiav;8qbbskdnalTmbcbhvabhdinadczfgxaxpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oaoarpmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgval6mbkkalaeSmbaiaeciGgvcitgdfcbcaad9R;8kbaiabalcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oaoarpmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalaeSmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbheabhdinadadpbbbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbadczfhdaeclfgeav6mbkkdnavalSmbaialciGgecdtgdVcbc;abad9R;8kbaiabavcdtfgvad;8qbbdnaeTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepklbkavaiad;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz:Dbb",X=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),Y=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!=="object")return{supported:!1};var $=WebAssembly.validate(X)?K(J):K(Z),Q,W=WebAssembly.instantiate($,{}).then(function(O){Q=O.instance,Q.exports.__wasm_call_ctors()});function K(O){var N=new Uint8Array(O.length);for(var M=0;M<O.length;++M){var j=O.charCodeAt(M);N[M]=j>96?j-97:j>64?j-39:j+4}var P=0;for(var M=0;M<O.length;++M)N[P++]=N[M]<60?Y[N[M]]:(N[M]-60)*64+N[++M];return N.buffer.slice(0,P)}function G(O,N,M,j,P,D,C){var k=O.exports.sbrk,T=j+3&-4,x=k(T*P),S=k(D.length),h=new Uint8Array(O.exports.memory.buffer);h.set(D,S);var I=N(x,j,P,S,D.length);if(I==0&&C)C(x,T,P);if(M.set(h.subarray(x,x+j*P)),k(x-k(0)),I!=0)throw new Error("Malformed buffer data: "+I)}var H={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},z={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},q=[],V=0;function F(O){var N={object:new Worker(O),pending:0,requests:{}};return N.object.onmessage=function(M){var j=M.data;N.pending-=j.count,N.requests[j.id][j.action](j.value),delete N.requests[j.id]},N}function U(O){var N="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array($)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+L.name+";"+G.toString()+L.toString(),M=new Blob([N],{type:"text/javascript"}),j=URL.createObjectURL(M);for(var P=q.length;P<O;++P)q[P]=F(j);for(var P=O;P<q.length;++P)q[P].object.postMessage({});q.length=O,URL.revokeObjectURL(j)}function w(O,N,M,j,P){var D=q[0];for(var C=1;C<q.length;++C)if(q[C].pending<D.pending)D=q[C];return new Promise(function(k,T){var x=new Uint8Array(M),S=++V;D.pending+=O,D.requests[S]={resolve:k,reject:T},D.object.postMessage({id:S,count:O,size:N,source:x,mode:j,filter:P},[x.buffer])})}function L(O){var N=O.data;if(!N.id)return self.close();self.ready.then(function(M){try{var j=new Uint8Array(N.count*N.size);G(M,M.exports[N.mode],j,N.count,N.size,N.source,M.exports[N.filter]),self.postMessage({id:N.id,count:N.count,action:"resolve",value:j},[j.buffer])}catch(P){self.postMessage({id:N.id,count:N.count,action:"reject",value:P})}})}return{ready:W,supported:!0,useWorkers:function(O){U(O)},decodeVertexBuffer:function(O,N,M,j,P){G(Q,Q.exports.meshopt_decodeVertexBuffer,O,N,M,j,Q.exports[H[P]])},decodeIndexBuffer:function(O,N,M,j){G(Q,Q.exports.meshopt_decodeIndexBuffer,O,N,M,j)},decodeIndexSequence:function(O,N,M,j){G(Q,Q.exports.meshopt_decodeIndexSequence,O,N,M,j)},decodeGltfBuffer:function(O,N,M,j,P,D){G(Q,Q.exports[z[P]],O,N,M,j,Q.exports[H[D]])},decodeGltfBufferAsync:function(O,N,M,j,P){if(q.length>0)return w(O,N,M,z[j],H[P]);return W.then(function(){var D=new Uint8Array(O*N);return G(Q,Q.exports[z[j]],D,O,N,M,Q.exports[H[P]]),D})}}}();var Va=function(){var Z="b9H79Tebbbe9Hk9Geueu9Geub9Gbb9Gsuuuuuuuuuuuu99uueu9Gvuuuuub9Gvuuuuue999Gquuuuuuu99uueu9Gwuuuuuu99ueu9Giuuue999Gluuuueu9GiuuueuizsdilvoirwDbqqbeqlve9Weiiviebeoweuecj:Pdkr:Tewo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbz9TW79O9V9Wt9F79P9T9W29P9M95bl8E9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9OcttV9P9I91tW7bvQ9TW79O9V9Wt9F79P9T9W29P9M959q9V9P9Ut7boX9TW79O9V9Wt9F79P9T9W29P9M959t9J9H2Wbra9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9Wbwl79IV9RbDDwebcekdmxq;UMesdbk:kfvKue99euY99Qu8Jjjjjbc;W;qb9Rgs8Kjjjjbcbhzascxfcbc;Kbz:ljjjb8AdnabaeSmbabaeadcdtz:kjjjb8AkdnamcdGTmbalcrfci4gHcbyd;S1jjbHjjjjbbheascxfasyd2gOcdtfaeBdbasaOcefBd2aecbaHz:ljjjbhAcbhlcbhednadTmbcbhlabheadhHinaAaeydbgOci4fgCaCRbbgCceaOcrGgOtV86bbaCcu7aO4ceGalfhlaeclfheaHcufgHmbkcualcdtalcFFFFi0Ehekaecbyd;S1jjbHjjjjbbhzascxfasyd2gecdtfazBdbasaecefBd2alcd4alfhOcehHinaHgecethHaeaO6mbkcbhXcuaecdtgOaecFFFFi0Ecbyd;S1jjbHjjjjbbhHascxfasyd2gCcdtfaHBdbasaCcefBd2aHcFeaOz:ljjjbhQdnadTmbaecufhCcbhLinabaXcdtfgKydbgAc:v;t;h;Ev2hOcbhedndninaQaOaCGgOcdtfgYydbgHcuSmeazaHcdtfydbaASmdaecefgeaOfhOaeaC9nmbxdkkazaLcdtfaABdbaYaLBdbaLhHaLcefhLkaKaHBdbaXcefgXad9hmbkkaQcbyd;O1jjbH:bjjjbbasasyd2cufBd2kcualcefgecdtaecFFFFi0Ecbyd;S1jjbHjjjjbbh8Aascxfasyd2gecdtfa8ABdbasa8ABdlasaecefBd2cuadcitadcFFFFe0Ecbyd;S1jjbHjjjjbbhEascxfasyd2gecdtfaEBdbasaEBdwasaecefBd2asclfabadalcbz:cjjjbcualcdtg3alcFFFFi0Eg5cbyd;S1jjbHjjjjbbhQascxfasyd2gecdtfaQBdbasaecefBd2a5cbyd;S1jjbHjjjjbbh8Eascxfasyd2gecdtfa8EBdbasaecefBd2alcd4alfhOcehHinaHgecethHaeaO6mbkcbhLcuaecdtgOaecFFFFi0Ecbyd;S1jjbHjjjjbbhHascxfasyd2gCcdtfaHBdbasaCcefBd2aHcFeaOz:ljjjbhXdnalTmbavcd4hCaecufhHinaLhednazTmbazaLcdtfydbhekaiaeaC2cdtfgeydlgOcH4aO7c:F:b:DD2aeydbgOcH4aO7c;D;O:B8J27aeydwgecH4ae7c:3F;N8N27aHGheaLcdth8FdndndndndnazTmbaza8FfhKcbhOinaXaecdtfgYydbgAcuSmlaiazaAcdtfydbaC2cdtfaiaKydbaC2cdtfcxz:ojjjbTmiaOcefgOaefaHGheaOaH9nmbxdkkaiaLaC2cdtfhKcbhOinaXaecdtfgYydbgAcuSmiaiaAaC2cdtfaKcxz:ojjjbTmdaOcefgOaefaHGheaOaH9nmbkkcbhYkaYydbgecu9hmekaYaLBdbaLhekaQa8FfaeBdbaLcefgLal9hmbkcbhea8EhHinaHaeBdbaHclfhHalaecefge9hmbkcbheaQhHa8EhOindnaeaHydbgCSmbaOa8EaCcdtfgCydbBdbaCaeBdbkaHclfhHaOclfhOalaecefge9hmbkkcbhaaXcbyd;O1jjbH:bjjjbbasasyd2cufBd2alcbyd;S1jjbHjjjjbbhXascxfasyd2gecdtfaXBdbasaecefBd2a5cbyd;S1jjbHjjjjbbheascxfasyd2gHcdtfaeBdbasaHcefBd2a5cbyd;S1jjbHjjjjbbhHascxfasyd2gOcdtfaHBdbasaOcefBd2aecFea3z:ljjjbhhaHcFea3z:ljjjbhgdnalTmbaEcwfh8Jindna8AaagOcefgacdtfydbgCa8AaOcdtgefydbgHSmbaCaH9Rh8FaEaHcitfh3agaefh8KahaefhLcbhAindndna3aAcitfydbgYaO9hmbaLaOBdba8KaOBdbxekdna8AaYcdtg8LfgeclfydbgHaeydbgeSmbaEaecitgCfydbaOSmeaHae9Rh8Maecu7aHfhKa8JaCfhHcbheinaKaeSmeaecefheaHydbhCaHcwfhHaCaO9hmbkaea8M6mekaga8LfgeaOaYaeydbcuSEBdbaLaYaOaLydbcuSEBdbkaAcefgAa8F9hmbkkaaal9hmbkaQhHa8EhOaghCahhAcbheindndnaeaHydbgY9hmbdnaeaOydbgY9hmbaAydbhYdnaCydbgKcu9hmbaYcu9hmbaXaefcb86bbxikaXaefhLdnaeaKSmbaeaYSmbaLce86bbxikaLcl86bbxdkdnaea8EaYcdtgKfydb9hmbdnaCydbgLcuSmbaeaLSmbaAydbg8FcuSmbaea8FSmbagaKfydbg3cuSmba3aYSmbahaKfydbgKcuSmbaKaYSmbdnaQaLcdtfydbgYaQaKcdtfydb9hmbaYaQa8FcdtfydbgKSmbaKaQa3cdtfydb9hmbaXaefcd86bbxlkaXaefcl86bbxikaXaefcl86bbxdkaXaefcl86bbxekaXaefaXaYfRbb86bbkaHclfhHaOclfhOaCclfhCaAclfhAalaecefge9hmbkdnaqTmbdndnazTmbazheaQhHalhOindnaqaeydbfRbbTmbaXaHydbfcl86bbkaeclfheaHclfhHaOcufgOmbxdkkaQhealhHindnaqRbbTmbaXaeydbfcl86bbkaqcefhqaeclfheaHcufgHmbkkaQhealhOaXhHindnaXaeydbfRbbcl9hmbaHcl86bbkaeclfheaHcefhHaOcufgOmbkkamceGTmbaXhealhHindnaeRbbce9hmbaecl86bbkaecefheaHcufgHmbkkcualcx2alc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbhaascxfasyd2gecdtfaaBdbasaecefBd2aaaialavazz:djjjbh8NdndnaDmbcbhycbh8Jxekcbh8JawhecbhHindnaeIdbJbbbb9ETmbasc;Wbfa8JcdtfaHBdba8Jcefh8JkaeclfheaDaHcefgH9hmbkcua8Jal2gecdtaecFFFFi0Ecbyd;S1jjbHjjjjbbhyascxfasyd2gecdtfayBdbasaecefBd2alTmba8JTmbarcd4hLdnazTmba8JcdthicbhYayhKinaoazaYcdtfydbaL2cdtfhAasc;WbfheaKhHa8JhOinaHaAaeydbcdtgCfIdbawaCfIdbNUdbaeclfheaHclfhHaOcufgOmbkaKaifhKaYcefgYal9hmbxdkka8JcdthicbhYayhKinaoaYaL2cdtfhAasc;WbfheaKhHa8JhOinaHaAaeydbcdtgCfIdbawaCfIdbNUdbaeclfheaHclfhHaOcufgOmbkaKaifhKaYcefgYal9hmbkkcualc8S2gHalc;D;O;f8U0EgCcbyd;S1jjbHjjjjbbheascxfasyd2gOcdtfaeBdbasaOcefBd2aecbaHz:ljjjbhqdndndndna8JTmbaCcbyd;S1jjbHjjjjbbhvascxfasyd2gecdtfavBdbcehOasaecefBd2avcbaHz:ljjjb8Acua8Jal2gecltgHaecFFFFb0Ecbyd;S1jjbHjjjjbbhrascxfasyd2gecdtfarBdbasaecefBd2arcbaHz:ljjjb8AadmexikcbhvadTmecbhrkcbhAabhHindnaaaHclfydbgYcx2fgeIdbaaaHydbgKcx2fgOIdbg8P:tgIaaaHcwfydbgLcx2fgCIdlaOIdlg8R:tg8SNaCIdba8P:tgRaeIdla8R:tg8UN:tg8Va8VNa8UaCIdwaOIdwg8W:tg8XNa8SaeIdwa8W:tg8UN:tg8Sa8SNa8UaRNa8XaIN:tgIaINMM:rgRJbbbb9ETmba8VaR:vh8VaIaR:vhIa8SaR:vh8SkaqaQaKcdtfydbc8S2fgea8SaR:rgRa8SNNg8UaeIdbMUdbaeaIaRaINg8YNg8XaeIdlMUdlaea8VaRa8VNg8ZNg80aeIdwMUdwaea8Ya8SNg8YaeIdxMUdxaea8Za8SNg81aeIdzMUdzaea8ZaINg8ZaeIdCMUdCaea8SaRa8Va8WNa8Sa8PNa8RaINMM:mg8RNg8PNg8SaeIdKMUdKaeaIa8PNgIaeId3MUd3aea8Va8PNg8VaeIdaMUdaaea8Pa8RNg8PaeId8KMUd8KaeaRaeIdyMUdyaqaQaYcdtfydbc8S2fgea8UaeIdbMUdbaea8XaeIdlMUdlaea80aeIdwMUdwaea8YaeIdxMUdxaea81aeIdzMUdzaea8ZaeIdCMUdCaea8SaeIdKMUdKaeaIaeId3MUd3aea8VaeIdaMUdaaea8PaeId8KMUd8KaeaRaeIdyMUdyaqaQaLcdtfydbc8S2fgea8UaeIdbMUdbaea8XaeIdlMUdlaea80aeIdwMUdwaea8YaeIdxMUdxaea81aeIdzMUdzaea8ZaeIdCMUdCaea8SaeIdKMUdKaeaIaeId3MUd3aea8VaeIdaMUdaaea8PaeId8KMUd8KaeaRaeIdyMUdyaHcxfhHaAcifgAad6mbkcbhiabhKinabaicdtfhYcbhHinaXaYaHc:G1jjbfydbcdtfydbgOfRbbhedndnaXaKaHfydbgCfRbbgAc99fcFeGcpe0mbaeceSmbaecd9hmekdnaAcufcFeGce0mbahaCcdtfydbaO9hmekdnaecufcFeGce0mbagaOcdtfydbaC9hmekdnaAcv2aefcj1jjbfRbbTmbaQaOcdtfydbaQaCcdtfydb0mekJbbacJbbacJbbjZaeceSEaAceSEh8ZdnaaaYaHc:K1jjbfydbcdtfydbcx2fgeIdwaaaCcx2fgAIdwg8R:tg8VaaaOcx2fgLIdwa8R:tg8Sa8SNaLIdbaAIdbg8W:tgIaINaLIdlaAIdlg8U:tgRaRNMMg8PNa8Va8SNaeIdba8W:tg80aINaRaeIdla8U:tg8YNMMg8Xa8SN:tg8Va8VNa80a8PNa8XaIN:tg8Sa8SNa8Ya8PNa8XaRN:tgIaINMM:rgRJbbbb9ETmba8VaR:vh8VaIaR:vhIa8SaR:vh8SkaqaQaCcdtfydbc8S2fgea8Sa8Za8P:rNgRa8SNNg8XaeIdbMUdbaeaIaRaINg8ZNg80aeIdlMUdlaea8VaRa8VNg8PNg8YaeIdwMUdwaea8Za8SNg8ZaeIdxMUdxaea8Pa8SNg81aeIdzMUdzaea8PaINgBaeIdCMUdCaea8SaRa8Va8RNa8Sa8WNa8UaINMM:mg8RNg8PNg8SaeIdKMUdKaeaIa8PNgIaeId3MUd3aea8Va8PNg8VaeIdaMUdaaea8Pa8RNg8PaeId8KMUd8KaeaRaeIdyMUdyaqaQaOcdtfydbc8S2fgea8XaeIdbMUdbaea80aeIdlMUdlaea8YaeIdwMUdwaea8ZaeIdxMUdxaea81aeIdzMUdzaeaBaeIdCMUdCaea8SaeIdKMUdKaeaIaeId3MUd3aea8VaeIdaMUdaaea8PaeId8KMUd8KaeaRaeIdyMUdykaHclfgHcx9hmbkaKcxfhKaicifgiad6mbkdna8JTmbcbhKinJbbbbh8WaaabaKcdtfgeclfydbgLcx2fgHIdwaaaeydbgicx2fgOIdwg8Y:tgIaINaHIdbaOIdbg81:tg8Va8VNaHIdlaOIdlgB:tgRaRNMMg8Zaaaecwfydbg8Fcx2fgeIdwa8Y:tg8PNaIaIa8PNa8VaeIdba81:tg8RNaRaeIdlaB:tg8UNMMg8SN:tJbbbbJbbjZa8Za8Pa8PNa8Ra8RNa8Ua8UNMMg80Na8Sa8SN:tg8X:va8XJbbbb9BEg8XNh83a80aINa8Pa8SN:ta8XNhUa8Za8UNaRa8SN:ta8XNh85a80aRNa8Ua8SN:ta8XNh86a8Za8RNa8Va8SN:ta8XNh87a80a8VNa8Ra8SN:ta8XNh88a8Va8UNa8RaRN:tg8Sa8SNaRa8PNa8UaIN:tg8Sa8SNaIa8RNa8Pa8VN:tg8Sa8SNMM:rJbbbZNh8Sayaia8J2g3cdtfhHaya8Fa8J2gwcdtfhOayaLa8J2g8LcdtfhCa8Y:mh89aB:mh8:a81:mhZcbhAa8JhYJbbbbh8UJbbbbh8XJbbbbh8ZJbbbbh80Jbbbbh8YJbbbbh81JbbbbhBJbbbbhnJbbbbhcinasc;WbfaAfgecwfa8SaUaCIdbaHIdbg8P:tgRNa83aOIdba8P:tg8RNMgINUdbaeclfa8Sa86aRNa85a8RNMg8VNUdbaea8Sa88aRNa87a8RNMgRNUdbaecxfa8Sa89aINa8:a8VNa8PaZaRNMMMg8PNUdba8SaIa8VNNa80Mh80a8SaIaRNNa8YMh8Ya8Sa8VaRNNa81Mh81a8Sa8Pa8PNNa8WMh8Wa8SaIa8PNNa8UMh8Ua8Sa8Va8PNNa8XMh8Xa8SaRa8PNNa8ZMh8Za8SaIaINNaBMhBa8Sa8Va8VNNanMhna8SaRaRNNacMhcaHclfhHaCclfhCaOclfhOaAczfhAaYcufgYmbkavaic8S2fgeacaeIdbMUdbaeanaeIdlMUdlaeaBaeIdwMUdwaea81aeIdxMUdxaea8YaeIdzMUdzaea80aeIdCMUdCaea8ZaeIdKMUdKaea8XaeId3MUd3aea8UaeIdaMUdaaea8WaeId8KMUd8Kaea8SaeIdyMUdyavaLc8S2fgeacaeIdbMUdbaeanaeIdlMUdlaeaBaeIdwMUdwaea81aeIdxMUdxaea8YaeIdzMUdzaea80aeIdCMUdCaea8ZaeIdKMUdKaea8XaeId3MUd3aea8UaeIdaMUdaaea8WaeId8KMUd8Kaea8SaeIdyMUdyava8Fc8S2fgeacaeIdbMUdbaeanaeIdlMUdlaeaBaeIdwMUdwaea81aeIdxMUdxaea8YaeIdzMUdzaea80aeIdCMUdCaea8ZaeIdKMUdKaea8XaeId3MUd3aea8UaeIdaMUdaaea8WaeId8KMUd8Kaea8SaeIdyMUdyara3cltfhYcbhHa8JhCinaYaHfgeasc;WbfaHfgOIdbaeIdbMUdbaeclfgAaOclfIdbaAIdbMUdbaecwfgAaOcwfIdbaAIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaCcufgCmbkara8LcltfhYcbhHa8JhCinaYaHfgeasc;WbfaHfgOIdbaeIdbMUdbaeclfgAaOclfIdbaAIdbMUdbaecwfgAaOcwfIdbaAIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaCcufgCmbkarawcltfhYcbhHa8JhCinaYaHfgeasc;WbfaHfgOIdbaeIdbMUdbaeclfgAaOclfIdbaAIdbMUdbaecwfgAaOcwfIdbaAIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaCcufgCmbkaKcifgKad6mbkkcbhOxekcehOcbhrkcbh8FdndnamcwGg9cmbJbbbbh8ZcbhJcbhocbhCxekcbhea5cbyd;S1jjbHjjjjbbhCascxfasyd2gHcdtfaCBdbasaHcefBd2dnalTmbaChHinaHaeBdbaHclfhHalaecefge9hmbkkdnaOmbcbhiinabaicdtfhLcbhKinaQaLaKcdtgec:G1jjbfydbcdtfydbcdtfydbhHdnaCaQaLaefydbcdtfydbgOcdtfgAydbgeaOSmbinaAaCaegOcdtfgYydbgeBdbaYhAaOae9hmbkkdnaCaHcdtfgAydbgeaHSmbinaAaCaegHcdtfgYydbgeBdbaYhAaHae9hmbkkdnaOaHSmbaCaOaHaOaH0EcdtfaOaHaOaH6EBdbkaKcefgKci9hmbkaicifgiad6mbkkcbhJdnalTmbcbhYindnaQaYcdtgefydbaY9hmbaYhHdnaCaefgKydbgeaYSmbaKhOinaOaCaegHcdtfgAydbgeBdbaAhOaHae9hmbkkaKaHBdbkaYcefgYal9hmbkcbheaQhOaChHcbhJindndnaeaOydbgA9hmbdnaeaHydbgA9hmbaHaJBdbaJcefhJxdkaHaCaAcdtfydbBdbxekaHaCaAcdtfydbBdbkaOclfhOaHclfhHalaecefge9hmbkkcuaJcltgeaJcjjjjiGEcbyd;S1jjbHjjjjbbhoascxfasyd2gHcdtfaoBdbasaHcefBd2aocbaez:ljjjbhAdnalTmbaChOaahealhYinaecwfIdbh8SaeclfIdbhIaAaOydbcltfgHaeIdbaHIdbMUdbaHclfgKaIaKIdbMUdbaHcwfgKa8SaKIdbMUdbaHcxfgHaHIdbJbbjZMUdbaOclfhOaecxfheaYcufgYmbkkdnaJTmbaAheaJhHinaecxfgOIdbh8SaOcbBdbaeaeIdbJbbbbJbbjZa8S:va8SJbbbb9BEg8SNUdbaeclfgOa8SaOIdbNUdbaecwfgOa8SaOIdbNUdbaeczfheaHcufgHmbkkdnalTmbaChOaahealhYinaAaOydbcltfgHcxfgKaecwfIdbaHcwfIdb:tg8Sa8SNaeIdbaHIdb:tg8Sa8SNaeclfIdbaHclfIdb:tg8Sa8SNMMg8SaKIdbgIaIa8S9DEUdbaOclfhOaecxfheaYcufgYmbkkdnaJmbcbhJJFFuuh8ZxekaAcxfheaAhHaJhOinaHaeIdbUdbaeczfheaHclfhHaOcufgOmbkJFFuuh8ZaAheaJhHinaeIdbg8Sa8Za8Za8S9EEh8ZaeclfheaHcufgHmbkkasydlh9ednalTmba9eclfhea9eydbhAaXhHalhYcbhOincbaeydbgKaA9RaHRbbcpeGEaOfhOaHcefhHaeclfheaKhAaYcufgYmbkaOce4h8Fkcuada8F9RcifgTcx2aTc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbhDascxfasyd2gecdtfaDBdbasaecefBd2cuaTcdtaTcFFFFi0Ecbyd;S1jjbHjjjjbbhSascxfasyd2gecdtfaSBdbasaecefBd2a5cbyd;S1jjbHjjjjbbh8Mascxfasyd2gecdtfa8MBdbasaecefBd2alcbyd;S1jjbHjjjjbbh9hascxfasyd2gecdtfa9hBdbasaecefBd2axaxNa8NJbbjZamclGEg83a83N:vhcJbbbbhndnadak9nmbdnaTci6mba8Jclth9iaDcwfh6JbbbbhBJbbbbhninasclfabadalaQz:cjjjbabh8FcbhEcbh5inaba5cdtfh3cbheindnaQa8FaefydbgOcdtgifydbgYaQa3aec:W1jjbfydbcdtfydbgHcdtgwfydbgKSmbaXaHfRbbgLcv2aXaOfRbbgAfc;a1jjbfRbbg8AaAcv2aLfg8Lc;a1jjbfRbbg8KVcFeGTmbdnaKaY9nmba8Lcj1jjbfRbbcFeGmekaAcufhYdnaAaL9hmbaYcFeGce0mbahaifydbaH9hmekdndnaAclSmbaLcl9hmekdnaYcFeGce0mbahaifydbaH9hmdkaLcufcFeGce0mbagawfydbaO9hmekaDaEcx2fgAaHaOa8KcFeGgYEBdlaAaOaHaYEBdbaAaYa8AGcb9hBdwaEcefhEkaeclfgecx9hmbkdna5cifg5ad9pmba8Fcxfh8FaEcifaT9nmekkaETmdcbhiinJbbbbJbbjZaqaQaDaicx2fgAydlgKaAydbgYaAydwgHEgLcdtfydbc8S2fgeIdyg8S:va8SJbbbb9BEaeIdwaaaYaKaHEg8Fcx2fgHIdwgRNaeIdzaHIdbg8PNaeIdaMg8Sa8SMMaRNaeIdlaHIdlg8RNaeIdCaRNaeId3Mg8Sa8SMMa8RNaeIdba8PNaeIdxa8RNaeIdKMg8Sa8SMMa8PNaeId8KMMM:lNh80JbbbbJbbjZaqaQaYcdtfydbc8S2fgeIdyg8S:va8SJbbbb9BEaeIdwaaaKcx2fgHIdwg8VNaeIdzaHIdbg8WNaeIdaMg8Sa8SMMa8VNaeIdlaHIdlg8UNaeIdCa8VNaeId3Mg8Sa8SMMa8UNaeIdba8WNaeIdxa8UNaeIdKMg8Sa8SMMa8WNaeId8KMMM:lNh8YaAcwfh3aAclfhwdna8JTmbavaYc8S2fgOIdwa8VNaOIdza8WNaOIdaMg8Sa8SMMa8VNaOIdla8UNaOIdCa8VNaOId3Mg8Sa8SMMa8UNaOIdba8WNaOIdxa8UNaOIdKMg8Sa8SMMa8WNaOId8KMMMh8SayaKa8J2cdtfhHaraYa8J2cltfheaOIdyh8Xa8JhOinaHIdbgIaIa8XNaecxfIdba8VaecwfIdbNa8WaeIdbNa8UaeclfIdbNMMMgIaIM:tNa8SMh8SaHclfhHaeczfheaOcufgOmbkavaLc8S2fgOIdwaRNaOIdza8PNaOIdaMgIaIMMaRNaOIdla8RNaOIdCaRNaOId3MgIaIMMa8RNaOIdba8PNaOIdxa8RNaOIdKMgIaIMMa8PNaOId8KMMMhIaya8Fa8J2cdtfhHaraLa8J2cltfheaOIdyh8Wa8JhOinaHIdbg8Va8Va8WNaecxfIdbaRaecwfIdbNa8PaeIdbNa8RaeclfIdbNMMMg8Va8VM:tNaIMhIaHclfhHaeczfheaOcufgOmbka80aI:lMh80a8Ya8S:lMh8YkawaKa8Fa8Ya809FgeEBdbaAaYaLaeEBdba3a8Ya80aeEUdbaicefgiaE9hmbkasc;Wbfcbcj;qbz:ljjjb8Aa6heaEhHinasc;WbfaeydbcA4cF8FGgOcFAaOcFA6EcdtfgOaOydbcefBdbaecxfheaHcufgHmbkcbhecbhHinasc;WbfaefgOydbhAaOaHBdbaAaHfhHaeclfgecj;qb9hmbkcbhea6hHinasc;WbfaHydbcA4cF8FGgOcFAaOcFA6EcdtfgOaOydbgOcefBdbaSaOcdtfaeBdbaHcxfhHaEaecefge9hmbkadak9RgOci9Uh9kdnalTmbcbhea8MhHinaHaeBdbaHclfhHalaecefge9hmbkkcbh0a9hcbalz:ljjjbh9maOcO9Uh9na9kce4h9oasydwh9pcbh8KcbhwdninaDaSawcdtfydbcx2fg3Idwg8Sac9Emea8Ka9k9pmeJFFuuhIdna9oaE9pmbaDaSa9ocdtfydbcx2fIdwJbb;aZNhIkdna8SaI9ETmba8San9ETmba8Ka9n0mdkdna9maQa3ydlgicdtg9qfydbgAfg9rRbba9maQa3ydbgLcdtg9sfydbgHfg9tRbbVmbaXaLfRbbh9udna9eaHcdtfgeclfydbgOaeydbgeSmbaOae9RhKa9paecitfheaaaAcx2fg8Lcwfh5a8Lclfh9vaaaHcx2fg8Acwfh9wa8Aclfh9xcbhHceh8Fdnindna8MaeydbcdtfydbgOaASmba8MaeclfydbcdtfydbgYaASmbaOaYSmbaaaYcx2fgYIdbaaaOcx2fgOIdbg8V:tg8Sa9xIdbaOIdlgR:tg8WNa8AIdba8V:tg8UaYIdlaR:tgIN:tg8Pa8Sa9vIdbaR:tg8XNa8LIdba8V:tg80aIN:tgRNaIa9wIdbaOIdwg8R:tg8YNa8WaYIdwa8R:tg8VN:tg8WaIa5Idba8R:tg81Na8Xa8VN:tgINa8Va8UNa8Ya8SN:tg8Ra8Va80Na81a8SN:tg8SNMMa8Pa8PNa8Wa8WNa8Ra8RNMMaRaRNaIaINa8Sa8SNMMN:rJbbj8:N9FmdkaecwfheaHcefgHaK6h8FaKaH9hmbkka8FceGTmba9ocefh9oxeka3cwfhHdndndndna9uc9:fPdebdkaLheina8MaecdtgefaiBdba8EaefydbgeaL9hmbxikkdnagahaha9sfydbaiSEa8Ea9sfydbgLcdtfydbgecu9hmba8Ea9qfydbheka8Ma9sfaiBdbaehika8MaLcdtfaiBdbka9tce86bba9rce86bbaHIdbg8Sanana8S9DEhna0cefh0cecda9uceSEa8Kfh8KkawcefgwaE9hmbkka0TmddnalTmbcbhKcbhiindna8MaicdtgefydbgOaiSmbaQaOcdtfydbh8FdnaiaQaefydb9hg3mbaqa8Fc8S2fgeaqaic8S2fgHIdbaeIdbMUdbaeaHIdlaeIdlMUdlaeaHIdwaeIdwMUdwaeaHIdxaeIdxMUdxaeaHIdzaeIdzMUdzaeaHIdCaeIdCMUdCaeaHIdKaeIdKMUdKaeaHId3aeId3MUd3aeaHIdaaeIdaMUdaaeaHId8KaeId8KMUd8KaeaHIdyaeIdyMUdyka8JTmbavaOc8S2fgeavaic8S2gwfgHIdbaeIdbMUdbaeaHIdlaeIdlMUdlaeaHIdwaeIdwMUdwaeaHIdxaeIdxMUdxaeaHIdzaeIdzMUdzaeaHIdCaeIdCMUdCaeaHIdKaeIdKMUdKaeaHId3aeId3MUd3aeaHIdaaeIdaMUdaaeaHId8KaeId8KMUd8KaeaHIdyaeIdyMUdya9iaO2hLarhHa8JhAinaHaLfgeaHaKfgOIdbaeIdbMUdbaeclfgYaOclfIdbaYIdbMUdbaecwfgYaOcwfIdbaYIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaAcufgAmbka3mbJbbbbJbbjZaqawfgeIdyg8S:va8SJbbbb9BEaeIdwaaa8Fcx2fgHIdwg8SNaeIdzaHIdbgINaeIdaMg8Va8VMMa8SNaeIdlaHIdlg8VNaeIdCa8SNaeId3Mg8Sa8SMMa8VNaeIdbaINaeIdxa8VNaeIdKMg8Sa8SMMaINaeId8KMMM:lNg8SaBaBa8S9DEhBkaKa9ifhKaicefgial9hmbkcbhHahheindnaeydbgOcuSmbdnaHa8MaOcdtgAfydbgO9hmbcuhOahaAfydbgAcuSmba8MaAcdtfydbhOkaeaOBdbkaeclfhealaHcefgH9hmbkcbhHagheindnaeydbgOcuSmbdnaHa8MaOcdtgAfydbgO9hmbcuhOagaAfydbgAcuSmba8MaAcdtfydbhOkaeaOBdbkaeclfhealaHcefgH9hmbkkaBana8JEhBcbhYabhecbhKindna8MaeydbcdtfydbgHa8MaeclfydbcdtfydbgOSmbaHa8MaecwfydbcdtfydbgASmbaOaASmbabaYcdtfgLaHBdbaLcwfaABdbaLclfaOBdbaYcifhYkaecxfheaKcifgKad6mbkdndna9cTmbaYak9nmba8ZaB9FTmbcbhdabhecbhHindnaoaCaeydbgOcdtfydbcdtfIdbaB9ETmbabadcdtfgAaOBdbaAclfaeclfydbBdbaAcwfaecwfydbBdbadcifhdkaecxfheaHcifgHaY6mbkJFFuuh8ZaJTmeaoheaJhHJFFuuh8SinaeIdbgIa8Sa8SaI9EEg8Va8SaIaB9EgOEh8Sa8Va8ZaOEh8ZaeclfheaHcufgHmbxdkkaYhdkadak0mbxdkkasclfabadalaQz:cjjjbkdndnadak0mbadhOxekdna9cmbadhOxekdna8Zac9FmbadhOxekina8ZJbb;aZNg8Saca8Sac9DEh8VJbbbbh8SdnaJTmbaoheaJhHinaeIdbgIa8SaIa8V9FEa8SaIa8S9EEh8SaeclfheaHcufgHmbkkcbhOabhecbhHindnaoaCaeydbgAcdtfydbcdtfIdba8V9ETmbabaOcdtfgYaABdbaYclfaeclfydbBdbaYcwfaecwfydbBdbaOcifhOkaecxfheaHcifgHad6mbkJFFuuh8ZdnaJTmbaoheaJhHJFFuuhIinaeIdbgRaIaIaR9EEg8PaIaRa8V9EgAEhIa8Pa8ZaAEh8ZaeclfheaHcufgHmbkkdnaOad9hmbadhOxdka8Sanana8S9DEhnaOak9nmeaOhda8Zac9FmbkkdnamcjjjjlGTmbazmbaOTmbcbhQabheinaXaeydbgAfRbbc3thKaecwfgLydbhHdndnahaAcdtg8FfydbaeclfgiydbgCSmbcbhYagaCcdtfydbaA9hmekcjjjj94hYkaeaKaYVaAVBdbaXaCfRbbc3thKdndnahaCcdtfydbaHSmbcbhYagaHcdtfydbaC9hmekcjjjj94hYkaiaKaYVaCVBdbaXaHfRbbc3thYdndnahaHcdtfydbaASmbcbhCaga8FfydbaH9hmekcjjjj94hCkaLaYaCVaHVBdbaecxfheaQcifgQaO6mbkkdnazTmbaOTmbaOheinabazabydbcdtfydbBdbabclfhbaecufgembkkdnaPTmbaPa83an:rNUdbkasyd2gecdtascxffc98fhHdninaeTmeaHydbcbyd;O1jjbH:bjjjbbaHc98fhHaecufhexbkkasc;W;qbf8KjjjjbaOk;Yieouabydlhvabydbclfcbaicdtz:ljjjbhoadci9UhrdnadTmbdnalTmbaehwadhDinaoalawydbcdtfydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbxdkkaehwadhDinaoawydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbkkdnaiTmbcbhDaohwinawydbhqawaDBdbawclfhwaqaDfhDaicufgimbkkdnadci6mbinaecwfydbhwaeclfydbhDaeydbhidnalTmbalawcdtfydbhwalaDcdtfydbhDalaicdtfydbhikavaoaicdtfgqydbcitfaDBdbavaqydbcitfawBdlaqaqydbcefBdbavaoaDcdtfgqydbcitfawBdbavaqydbcitfaiBdlaqaqydbcefBdbavaoawcdtfgwydbcitfaiBdbavawydbcitfaDBdlawawydbcefBdbaecxfhearcufgrmbkkabydbcbBdbk;Podvuv998Jjjjjbca9RgvcFFF;7rBd3av9cFFF;7;3FF:;Fb83dCavcFFF97Bdzav9cFFF;7FFF:;u83dwdnadTmbaicd4hodnabmbdnalTmbcbhrinaealarcdtfydbao2cdtfhwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkarcefgrad9hmbxikkaocdthrcbhwincbhiinavcCfaifgDaeaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkaearfheawcefgwad9hmbxdkkdnalTmbcbhrinabarcx2fgiaealarcdtfydbao2cdtfgwIdbUdbaiawIdlUdlaiawIdwUdwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkarcefgrad9hmbxdkkaocdthlcbhraehwinabarcx2fgiaearao2cdtfgDIdbUdbaiaDIdlUdlaiaDIdwUdwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkawalfhwarcefgrad9hmbkkJbbbbavIdwavIdCgk:tgqaqJbbbb9DEgqavIdxavIdKgx:tgmamaq9DEgqavIdzavId3gm:tgPaPaq9DEhPdnabTmbadTmbJbbbbJbbjZaP:vaPJbbbb9BEhqinabaqabIdbak:tNUdbabclfgvaqavIdbax:tNUdbabcwfgvaqavIdbam:tNUdbabcxfhbadcufgdmbkkaPk8MbabaeadaialavcbcbcbcbcbaoarawaDz:bjjjbk8MbabaeadaialavaoarawaDaqakaxamaPz:bjjjbk:nCoDud99rue99lul998Jjjjjbc;Wb9Rgw8KjjjjbdndnarmbcbhDxekawcxfcbc;Kbz:ljjjb8Aawcuadcx2adc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbgqBdxawceBd2aqaeadaicbz:djjjb8AawcuadcdtadcFFFFi0Egkcbyd;S1jjbHjjjjbbgxBdzawcdBd2adcd4adfhmceheinaegicetheaiam6mbkcbhPawcuaicdtgsaicFFFFi0Ecbyd;S1jjbHjjjjbbgzBdCawciBd2dndnar:ZgH:rJbbbZMgO:lJbbb9p9DTmbaO:Ohexekcjjjj94hekaicufhAc:bwhmcbhCadhXcbhQinaChLaeamgKcufaeaK9iEaPgDcefaeaD9kEhYdndnadTmbaYcuf:YhOaqhiaxheadhmindndnaiIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhCxekcjjjj94hCkaCcCthCdndnaiclfIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhExekcjjjj94hEkaEcqtaCVhCdndnaicwfIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhExekcjjjj94hEkaeaCaEVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:ljjjbh3cbh5cbh8Eindna3axa8EcdtfydbgCcm4aC7c:v;t;h;Ev2gics4ai7aAGgmcdtfgEydbgecuSmbaeaCSmbcehiina3amaifaAGgmcdtfgEydbgecuSmeaicefhiaeaC9hmbkkaEaCBdba5aecuSfh5a8Ecefg8Ead9hmbxdkkazcFeasz:ljjjb8Acbh5kaDaYa5ar0giEhPaLa5aiEhCdna5arSmbaYaKaiEgmaP9Rcd9imbdndnaQcl0mbdnaX:ZgOaL:Zg8A:taY:Yg8FaD:Y:tgaa8FaK:Y:tgha5:ZggaH:tNNNaOaH:tahNa8Aag:tNa8AaH:taaNagaO:tNM:va8FMJbbbZMgO:lJbbb9p9DTmbaO:Ohexdkcjjjj94hexekaPamfcd9Theka5aXaiEhXaQcefgQcs9hmekkdndnaCmbcihicbhDxekcbhiawakcbyd;S1jjbHjjjjbbg8EBdKawclBd2aPcuf:Yh8AdndnadTmbaqhiaxheadhmindndnaiIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhCxekcjjjj94hCkaCcCthCdndnaiclfIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhExekcjjjj94hEkaEcqtaCVhCdndnaicwfIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhExekcjjjj94hEkaeaCaEVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:ljjjbh3cbhDcbh5inaxa5cdtgYfydbgCcm4aC7c:v;t;h;Ev2gics4ai7hecbhidndnina3aeaAGgmcdtfgEydbgecuSmednaxaecdtgEfydbaCSmbaicefgiamfheaiaA9nmekka8EaEfydbhixekaEa5BdbaDhiaDcefhDka8EaYfaiBdba5cefg5ad9hmbkcuaDc32giaDc;j:KM;jb0EhexekazcFeasz:ljjjb8AcbhDcbhekawaecbyd;S1jjbHjjjjbbgeBd3awcvBd2aecbaiz:ljjjbhEavcd4hxdnadTmbdnalTmbaxcdth3a8EhCalheaqhmadhAinaEaCydbc32fgiamIdbaiIdbMUdbaiamclfIdbaiIdlMUdlaiamcwfIdbaiIdwMUdwaiaeIdbaiIdxMUdxaiaeclfIdbaiIdzMUdzaiaecwfIdbaiIdCMUdCaiaiIdKJbbjZMUdKaCclfhCaea3fheamcxfhmaAcufgAmbxdkka8EhmaqheadhCinaEamydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiaiIdxJbbbbMUdxaiaiIdzJbbbbMUdzaiaiIdCJbbbbMUdCaiaiIdKJbbjZMUdKamclfhmaecxfheaCcufgCmbkkdnaDTmbaEhiaDheinaiaiIdbJbbbbJbbjZaicKfIdbgO:vaOJbbbb9BEgONUdbaiclfgmaOamIdbNUdbaicwfgmaOamIdbNUdbaicxfgmaOamIdbNUdbaiczfgmaOamIdbNUdbaicCfgmaOamIdbNUdbaic3fhiaecufgembkkcbhCawcuaDcdtgYaDcFFFFi0Egicbyd;S1jjbHjjjjbbgeBdaawcoBd2awaicbyd;S1jjbHjjjjbbg3Bd8KaecFeaYz:ljjjbh5dnadTmbJbbjZJbbjZa8A:vaPceSEaoNgOaONh8Aaxcdthxalheina8Aaec;C1jjbalEgmIdwaEa8EydbgAc32fgiIdC:tgOaONamIdbaiIdx:tgOaONamIdlaiIdz:tgOaONMMNaqcwfIdbaiIdw:tgOaONaqIdbaiIdb:tgOaONaqclfIdbaiIdl:tgOaONMMMhOdndna5aAcdtgifgmydbcuSmba3aifIdbaO9ETmekamaCBdba3aifaOUdbka8Eclfh8EaeaxfheaqcxfhqadaCcefgC9hmbkkaba5aYz:kjjjb8AcrhikaicdthiinaiTmeaic98fgiawcxffydbcbyd;O1jjbH:bjjjbbxbkkawc;Wbf8KjjjjbaDk:Odieui99iu8Jjjjjbca9RgicFFF;7rBd3ai9cFFF;7;3FF:;Fb83dCaicFFF97Bdzai9cFFF;7FFF:;u83dwdndnaembJbbjFhlJbbjFhvJbbjFhoxekadcd4cdthrcbhwincbhdinaicCfadfgDabadfIdbglaDIdbgvaval9EEUdbaicwfadfgDalaDIdbgvaval9DEUdbadclfgdcx9hmbkabarfhbawcefgwae9hmbkaiIdzaiId3:thoaiIdxaiIdK:thvaiIdwaiIdC:thlkJbbbbalalJbbbb9DEglavaval9DEglaoaoal9DEk9DeeuabcFeaicdtz:ljjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk9teiucbcbyd;W1jjbgeabcifc98GfgbBd;W1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;W1jjbgeabcrfc94GfgbBd;W1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd;W1jjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd;W1jjbfgdBd;W1jjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akk6eiucbhidnadTmbdninabRbbglaeRbbgv9hmeaecefheabcefhbadcufgdmbxdkkalav9Rhikaikk:bedbcjwk9Oeeebeebebbeeebebbbbbebebbbbbbbbbebbbdbbbbbbbebbbebbbdbbbbbbbbbbbeeeeebebbebbebebbbeebbbbbbbbbbbbbbbbbbbbbc;OwkxebbbdbbbjNbb",J=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!=="object")return{supported:!1};var X,Y=WebAssembly.instantiate($(Z),{}).then(function(U){X=U.instance,X.exports.__wasm_call_ctors()});function $(U){var w=new Uint8Array(U.length);for(var L=0;L<U.length;++L){var O=U.charCodeAt(L);w[L]=O>96?O-97:O>64?O-39:O+4}var N=0;for(var L=0;L<U.length;++L)w[N++]=w[L]<60?J[w[L]]:(w[L]-60)*64+w[++L];return w.buffer.slice(0,N)}function Q(U){if(!U)throw new Error("Assertion failed")}function W(U){return new Uint8Array(U.buffer,U.byteOffset,U.byteLength)}function K(U,w,L){var O=X.exports.sbrk,N=O(w.length*4),M=O(L*4),j=new Uint8Array(X.exports.memory.buffer),P=W(w);j.set(P,N);var D=U(M,N,w.length,L);j=new Uint8Array(X.exports.memory.buffer);var C=new Uint32Array(L);new Uint8Array(C.buffer).set(j.subarray(M,M+L*4)),P.set(j.subarray(N,N+w.length*4)),O(N-O(0));for(var k=0;k<w.length;++k)w[k]=C[w[k]];return[C,D]}function G(U){var w=0;for(var L=0;L<U.length;++L){var O=U[L];w=w<O?O:w}return w}function H(U,w,L,O,N,M,j,P,D){var C=X.exports.sbrk,k=C(4),T=C(L*4),x=C(N*M),S=C(L*4),h=new Uint8Array(X.exports.memory.buffer);h.set(W(O),x),h.set(W(w),S);var I=U(T,S,L,x,N,M,j,P,D,k);h=new Uint8Array(X.exports.memory.buffer);var v=new Uint32Array(I);W(v).set(h.subarray(T,T+I*4));var A=new Float32Array(1);return W(A).set(h.subarray(k,k+4)),C(k-C(0)),[v,A[0]]}function z(U,w,L,O,N,M,j,P,D,C,k,T,x){var S=X.exports.sbrk,h=S(4),I=S(L*4),v=S(N*M),A=S(N*P),p=S(D.length*4),n=S(L*4),o=C?S(N):0,X0=new Uint8Array(X.exports.memory.buffer);if(X0.set(W(O),v),X0.set(W(j),A),X0.set(W(D),p),X0.set(W(w),n),C)X0.set(W(C),o);var Q0=U(I,n,L,v,N,M,A,P,p,D.length,o,k,T,x,h);X0=new Uint8Array(X.exports.memory.buffer);var E0=new Uint32Array(Q0);W(E0).set(X0.subarray(I,I+Q0*4));var I0=new Float32Array(1);return W(I0).set(X0.subarray(h,h+4)),S(h-S(0)),[E0,I0[0]]}function q(U,w,L,O){var N=X.exports.sbrk,M=N(L*O),j=new Uint8Array(X.exports.memory.buffer);j.set(W(w),M);var P=U(M,L,O);return N(M-N(0)),P}function V(U,w,L,O,N,M,j,P){var D=X.exports.sbrk,C=D(P*4),k=D(L*O),T=D(L*M),x=new Uint8Array(X.exports.memory.buffer);if(x.set(W(w),k),N)x.set(W(N),T);var S=U(C,k,L,O,T,M,j,P);x=new Uint8Array(X.exports.memory.buffer);var h=new Uint32Array(S);return W(h).set(x.subarray(C,C+S*4)),D(C-D(0)),h}var F={LockBorder:1,Sparse:2,ErrorAbsolute:4,Prune:8,_InternalDebug:1073741824};return{ready:Y,supported:!0,useExperimentalFeatures:!1,compactMesh:function(U){Q(U instanceof Uint32Array||U instanceof Int32Array||U instanceof Uint16Array||U instanceof Int16Array),Q(U.length%3==0);var w=U.BYTES_PER_ELEMENT==4?U:new Uint32Array(U);return K(X.exports.meshopt_optimizeVertexFetchRemap,w,G(U)+1)},simplify:function(U,w,L,O,N,M){Q(U instanceof Uint32Array||U instanceof Int32Array||U instanceof Uint16Array||U instanceof Int16Array),Q(U.length%3==0),Q(w instanceof Float32Array),Q(w.length%L==0),Q(L>=3),Q(O>=0&&O<=U.length),Q(O%3==0),Q(N>=0);var j=0;for(var P=0;P<(M?M.length:0);++P)Q(M[P]in F),Q(this.useExperimentalFeatures||M[P]!="Prune"),j|=F[M[P]];var D=U.BYTES_PER_ELEMENT==4?U:new Uint32Array(U),C=H(X.exports.meshopt_simplify,D,U.length,w,w.length/L,L*4,O,N,j);return C[0]=U instanceof Uint32Array?C[0]:new U.constructor(C[0]),C},simplifyWithAttributes:function(U,w,L,O,N,M,j,P,D,C){Q(this.useExperimentalFeatures),Q(U instanceof Uint32Array||U instanceof Int32Array||U instanceof Uint16Array||U instanceof Int16Array),Q(U.length%3==0),Q(w instanceof Float32Array),Q(w.length%L==0),Q(L>=3),Q(O instanceof Float32Array),Q(O.length%N==0),Q(N>=0),Q(j==null||j instanceof Uint8Array),Q(j==null||j.length==w.length/L),Q(P>=0&&P<=U.length),Q(P%3==0),Q(D>=0),Q(Array.isArray(M)),Q(N>=M.length),Q(M.length<=32);for(var k=0;k<M.length;++k)Q(M[k]>=0);var T=0;for(var k=0;k<(C?C.length:0);++k)Q(C[k]in F),T|=F[C[k]];var x=U.BYTES_PER_ELEMENT==4?U:new Uint32Array(U),S=z(X.exports.meshopt_simplifyWithAttributes,x,U.length,w,w.length/L,L*4,O,N*4,new Float32Array(M),j?new Uint8Array(j):null,P,D,T);return S[0]=U instanceof Uint32Array?S[0]:new U.constructor(S[0]),S},getScale:function(U,w){return Q(U instanceof Float32Array),Q(U.length%w==0),Q(w>=3),q(X.exports.meshopt_simplifyScale,U,U.length/w,w*4)},simplifyPoints:function(U,w,L,O,N,M){if(Q(this.useExperimentalFeatures),Q(U instanceof Float32Array),Q(U.length%w==0),Q(w>=3),Q(L>=0&&L<=U.length/w),O)return Q(O instanceof Float32Array),Q(O.length%N==0),Q(N>=3),Q(U.length/w==O.length/N),V(X.exports.meshopt_simplifyPoints,U,U.length/w,w*4,O,N*4,M,L);else return V(X.exports.meshopt_simplifyPoints,U,U.length/w,w*4,void 0,0,0,L)}}}();var Dz6=function(){var Z="b9H79Tebbbefx9Geueu9Geub9Gbb9Giuuueu9Gkuuuuuuuuuu99eu9Gvuuuuueu9Gkuuuuuuuuu9999eu9Gruuuuuuub9Gkuuuuuuuuuuueu9Gouuuuuub9Giuuub9GluuuubiOHdilvorwDqrkbiibeilve9Weiiviebeoweuec:q:Odkr:Yewo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9I919P29K9nW79O2Wt79c9V919U9KbeX9TW79O9V9Wt9F9I919P29K9nW79O2Wt7bd39TW79O9V9Wt9F9J9V9T9W91tWJ2917tWV9c9V919U9K7br39TW79O9V9Wt9F9J9V9T9W91tW9nW79O2Wt9c9V919U9K7bDL9TW79O9V9Wt9F9V9Wt9P9T9P96W9nW79O2Wtbql79IV9RbkDwebcekdsPq;L9kHdbkIbabaec9:fgefcufae9Ugeabci9Uadfcufad9Ugbaeab0Ek:oAlPue99eux998Jjjjjbc:We9Rgk8Kjjjjbakc;mbfcbc;Kbz:njjjb8AakcuaocdtgxaocFFFFi0Egmcbyd:e1jjbHjjjjbbgPBd9makceBd:SeakaPBdnakamcbyd:e1jjbHjjjjbbgsBd9qakcdBd:SeakasBd9eakcualcdtalcFFFFi0Ecbyd:e1jjbHjjjjbbgzBd9uakazBd9iakciBd:SeaPcbaxz:njjjbhHalci9UhOdnalTmbaihPalhAinaHaPydbcdtfgCaCydbcefBdbaPclfhPaAcufgAmbkkdnaoTmbcbhPashAaHhCaohXinaAaPBdbaAclfhAaCydbaPfhPaCclfhCaXcufgXmbkkdnalci6mbcbhPaihAinaAcwfydbhCaAclfydbhXasaAydbcdtfgQaQydbgQcefBdbazaQcdtfaPBdbasaXcdtfgXaXydbgXcefBdbazaXcdtfaPBdbasaCcdtfgCaCydbgCcefBdbazaCcdtfaPBdbaAcxfhAaOaPcefgP9hmbkkdnaoTmbaHhAashPaohCinaPaPydbaAydb9RBdbaAclfhAaPclfhPaCcufgCmbkkakamcbyd:e1jjbHjjjjbbgPBd9yakclBd:SeaPaHaxz:mjjjbhmakaOcbyd:e1jjbHjjjjbbgPBd9CakcvBd:SeaPcbaOz:njjjbhLakcuaOcK2alcjjjjd0Ecbyd:e1jjbHjjjjbbgKBd9GakcoBd:SeJbbbbhYdnalci6g8Ambarcd4hxaihAaKhPaOhrJbbbbhEinavaAclfydbax2cdtfgCIdlh3avaAydbax2cdtfgXIdlhYavaAcwfydbax2cdtfgQIdlh5aCIdwh8EaXIdwh8FaQIdwhaaPaCIdbghaXIdbggMaQIdbg8JMJbbnn:vUdbaPclfaXIdlaCIdlMaQIdlMJbbnn:vUdbaQIdwh8KaCIdwh8LaXIdwh8MaPcxfa3aY:tg3aaa8F:tgaNa5aY:tg5a8Ea8F:tg8EN:tgYJbbbbJbbjZahag:tgha5Na8Jag:tgga3N:tg8Fa8FNaYaYNa8EagNaaahN:tgYaYNMM:rgg:vagJbbbb9BEg3NUdbaPczfaYa3NUdbaPcCfa8Fa3NUdbaPcwfa8Ka8Ma8LMMJbbnn:vUdbaEagMhEaAcxfhAaPcKfhParcufgrmbkaEaO:Z:vJbbbZNhYkakcuaOcdtalcFFFF970Ecbyd:e1jjbHjjjjbbgCBd9KakcrBd:SeaYaD:ZN:rhYdna8AmbcbhPaChAinaAaPBdbaAclfhAaOaPcefgP9hmbkkaYJbbbZNh8MakcuaOcltalcFFFFd0Ecbyd:e1jjbHjjjjbbg8ABd9OakcwBd:Secba8AaKaCaOz:djjjb8Aakaocbyd:e1jjbHjjjjbbgPBd2aPcFeaoz:njjjbhrakc8Wfcwf9cb83ibak9cb83i8WcbhPJbbbbhEJbbbbh5Jbbbbh8EJbbbbhYJbbbbh8FJbbbbhgcbhlinJbbbbh3dnaPTmbJbbjZaP:Z:vh3kaka8Ea3NgaUdaaka5a3NghUd3akaEa3Ng8JUdKJbbbbh3dnagagNaYaYNa8Fa8FNMMg8KJbbbb9BmbJbbjZa8K:r:vh3kakaga3NUd8Saka8Fa3NUdyakaYa3NUd8Kdndndnakyd8WgQakydUgAakcKfaeaiakc;abfaKamara8Maqz:ejjjbgCcuSmbdnaPaD9pmbaAaraiaCcx2fgXydbfRbbcFeSfaraXclfydbfRbbcFeSfaraXcwfydbfRbbcFeSfaw9nmdkaQaAcbaeaiakc;abfaKamara8MJbbbbz:ejjjbgCcu9hmekakaaUdCakahUdzaka8JUdxakcuBdwakcFFF;7rBdla8AcbaKaLakcxfakcwfakclfz:fjjjbakydwgCcuSmekdnakc8WfaiaCcx2fgOydbgPaOclfydbgAaOcwfydbgXarabaeadalawaDz:gjjjbTmbalcefhlJbbbbhEJbbbbh5Jbbbbh8EJbbbbhYJbbbbh8FJbbbbhgkamaPcdtfgPaPydbcufBdbamaAcdtfgPaPydbcufBdbamaXcdtfgPaPydbcufBdbcbhXinazasaOaXcdtfydbcdtgAfydbcdtfgxhPaHaAfgvydbgQhAdnaQTmbdninaPydbaCSmeaPclfhPaAcufgATmdxbkkaPaxaQcdtfc98fydbBdbavavydbcufBdbkaXcefgXci9hmbkaKaCcK2fgPIdbh3aPIdlhaaPIdwhhaPIdxh8JaPIdzh8KaPIdCh8LaLaCfce86bbaga8LMhga8Fa8KMh8FaYa8JMhYa8EahMh8Ea5aaMh5aEa3MhEakyd88hPxekkdnaPTmbdnakyd80gAaPci2fgCciGTmbadaCfcbaPaAcu7fciGcefz:njjjb8AkabalcltfgPak8Pi8W83dbaPcwfakc8Wfcwf8Pib83dbalcefhlkcahPdninaPc98Smeakc;mbfaPfydbcbydj1jjbH:bjjjbbaPc98fhPxbkkakc:Wef8Kjjjjbalk;3vivuv99lu8Jjjjjbca9Rgv8Kjjjjbdndnalcw0mbaiydbhoaeabcitfgralcdtcufBdlaraoBdbdnalcd6mbaiclfhoalcufhwarcxfhrinaoydbhDarcuBdbarc98faDBdbarcwfhraoclfhoawcufgwmbkkalabfhrxekcbhDavczfcwfcbBdbav9cb83izavcwfcbBdbav9cb83ibJbbjZhqJbbjZhkinadaiaDcdtfydbcK2fhwcbhrinavczfarfgoawarfIdbgxaoIdbgm:tgPakNamMgmUdbavarfgoaPaxam:tNaoIdbMUdbarclfgrcx9hmbkJbbjZaqJbbjZMgq:vhkaDcefgDal9hmbkcbhoadcbcecdavIdlgxavIdwgm9GEgravIdbgPam9GEaraPax9GEgscdtgrfhzavczfarfIdbhxaihralhwinaiaocdtfgDydbhHaDarydbgOBdbaraHBdbarclfhraoazaOcK2fIdbax9Dfhoawcufgwmbkaeabcitfhrdndnaocv6mbaoalc98f6mekaraiydbBdbaralcdtcufBdlaiclfhoalcufhwarcxfhrinaoydbhDarcuBdbarc98faDBdbarcwfhraoclfhoawcufgwmbkalabfhrxekaraxUdbaeabcitfgrarydlc98GasVBdlabcefaeadaiaoz:djjjbhwararydlciGawabcu7fcdtVBdlawaeadaiaocdtfalao9Rz:djjjbhrkavcaf8Kjjjjbark;Bloeue99vue99Due99dndnaembcuhkxekJbbjZaq:thxaiabcdtfhmavydbhPavydlhsavydwhzcbhHJFFuuhOcvhbcuhkindnaPamaHcdtfydbcdtgvfydbgATmbazasavfydbcdtfhiindndnawalaiydbgCcx2fgvclfydbgXfRbbcFeSawavydbgQfRbbcFeSfawavcwfydbgLfRbbcFeSfgKmbcbhvxekcehvaraQcdtfydbgYceSmbcehvaraXcdtfydbg8AceSmbcehvaraLcdtfydbgEceSmbdna8AcdSaYcdSfaEcdSfcd6mbaKcefhvxekaKcdfhvkdnavab9kmbdndnadTmbaoaCcK2fgQIdwadIdw:tg3a3NaQIdbadIdb:tg3a3NaQIdladIdl:tg3a3NMM:raD:vaxNJbbjZMJ9VO:d86JbbjZaQIdCadIdCNaQIdxadIdxNaQIdzadIdzNMMaqN:tg3a3J9VO:d869DENh3xekaraQcdtfydbaraXcdtfydbfaraLcdtfydbfc99f:Zh3kaCakavab6a3aO9DVgQEhkavabaQEhba3aOaQEhOkaiclfhiaAcufgAmbkkaHcefgHae9hmbkkakk;bddlue99dndndnabaecitfgrydlgwciGgDci9hmbarclfhqxekinabcbawcd4gwalaDcdtfIdbabaecitfIdb:tgkJbbbb9FEgDaecefgefadaialavaoz:fjjjbak:laoIdb9FTmdabaDaw7aefgecitfgrydlgwciGgDci9hmbkarclfhqkabaecitfhecuhbindnaiaeydbgDfRbbmbadaDcK2fgrIdwalIdw:tgkakNarIdbalIdb:tgkakNarIdlalIdl:tgkakNMM:rgkaoIdb9DTmbaoakUdbavaDBdbaqydbhwkaecwfheabcefgbawcd46mbkkk;yleoudnaladfgkRbbcFeSalaefgxRbbgmcFeSfabydwgPfalaifgsRbbcFeSfaD0abydxaq9pVgzce9hmbavawcltfgmab8Pdb83dbamcwfabcwfgm8Pdb83dbdndnamydbmbcbhqxekcbhDaohminalamabydbcdtfydbfcFe86bbamclfhmaDcefgDabydwgq6mbkkdnabydxglci2gDabydlgmfgPciGTmbaraPfcbalamcu7fciGcefz:njjjb8Aabydxci2hDabydlhmabydwhqkab9cb83dwababydbaqfBdbabaDcifc98GamfBdlaxRbbhmcbhPkdnamcFeGcFe9hmbaxaP86bbababydwgmcefBdwaoabydbcdtfamcdtfaeBdbkdnakRbbcFe9hmbakabydw86bbababydwgmcefBdwaoabydbcdtfamcdtfadBdbkdnasRbbcFe9hmbasabydw86bbababydwgmcefBdwaoabydbcdtfamcdtfaiBdbkarabydlfabydxci2faxRbb86bbarabydlfabydxci2fcefakRbb86bbarabydlfabydxci2fcdfasRbb86bbababydxcefBdxazk;Ckovud99euv99eul998Jjjjjbc:G;ae9Rgo8KjjjjbdndnadTmbavcd4hrcbhwcbhDindnaiaeclfydbar2cdtfgvIdbaiaeydbar2cdtfgqIdbgk:tgxaiaecwfydbar2cdtfgmIdlaqIdlgP:tgsNamIdbak:tgzavIdlaP:tgPN:tgkakNaPamIdwaqIdwgH:tgONasavIdwaH:tgHN:tgPaPNaHazNaOaxN:tgxaxNMM:rgsJbbbb9Bmbaoc:G:qefawcx2fgAakas:vUdwaAaxas:vUdlaAaPas:vUdbaocafawc8K2fgAaq8Pdb83dbaAav8Pdb83dxaAam8Pdb83dKaAcwfaqcwfydbBdbaAcCfavcwfydbBdbaAcafamcwfydbBdbawcefhwkaecxfheaDcifgDad6mbkab9cb83dbabcyf9cb83dbabcaf9cb83dbabcKf9cb83dbabczf9cb83dbabcwf9cb83dbawTmeao9cb83iKao9cb83izaoczfaocafawci2z1jjjbaoIdKhCaoIdChXaoIdzhQao9cb83iwao9cb83ibaoaoc:G:qefawz1jjjbJbbjZhkaoIdwgPJbbbbJbbjZaPaPNaoIdbgPaPNaoIdlgsasNMM:rgx:vaxJbbbb9BEgzNhxasazNhsaPazNhzaoc:G:qefheawhvinaecwfIdbaxNaeIdbazNasaeclfIdbNMMgPakaPak9DEhkaecxfheavcufgvmbkabaCUdwabaXUdlabaQUdbabaoId3UdxdndnakJ;n;m;m899FmbJbbbbhPaoc:G:qefheaocafhvinaCavcwfIdb:taecwfIdbgHNaQavIdb:taeIdbgONaXavclfIdb:taeclfIdbgLNMMaxaHNazaONasaLNMM:vgHaPaHaP9EEhPavc8KfhvaecxfheawcufgwmbkabazUd3abc8KfaxUdbabcafasUdbabcKfaCaxaPN:tUdbabcCfaXasaPN:tUdbabaQazaPN:tUdzabJbbjZakakN:t:rgkUdydndnaxJbbj:;axJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;axJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohexekcjjjj94hekabc8Ufae86bbdndnasJbbj:;asJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;asJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohvxekcjjjj94hvkabcRfav86bbdndnazJbbj:;azJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;azJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohqxekcjjjj94hqkabaq86b8SdndnaecKtcK91:YJbb;:9c:vax:t:lavcKtcK91:YJbb;:9c:vas:t:laqcKtcK91:YJbb;:9c:vaz:t:lakMMMJbb;:9cNJbbjZMgk:lJbbb9p9DTmbak:Ohexekcjjjj94hekaecFbaecFb9iEhexekabcjjj;8iBdycFbhekabae86b8Vxekab9cb83dbabcyf9cb83dbabcaf9cb83dbabcKf9cb83dbabczf9cb83dbabcwf9cb83dbkaoc:G;aef8Kjjjjbk:mvdouq99cbhi8Jjjjjbca9RglczfcwfcbBdbal9cb83izalcwfcbBdbal9cb83ibdnadTmbcbhvinaeaifhocbhrinalczfarfgwavawydbgwaoarfIdbgDaearawcx2ffIdb9DEBdbalarfgwavawydbgwaDaearawcx2ffIdb9EEBdbarclfgrcx9hmbkaicxfhiavcefgvad9hmbkkJbbbbhDcbhrcbhicbhvinaealarfydbcx2fgwIdwaealczfarfydbcx2fgoIdw:tgqaqNawIdbaoIdb:tgqaqNawIdlaoIdl:tgqaqNMMgqaDaqaD9EgwEhDavaiawEhiarclfhravcefgvci9hmbkaealczfaicdtgvfydbcx2fgrIdwaealavfydbcx2fglIdwMJbbbZNhqarIdlalIdlMJbbbZNhkarIdbalIdbMJbbbZNhxaD:rJbbbZNhDdnadTmbindnaecwfIdbgmaq:tgPaPNaeIdbgsax:tgPaPNaeclfIdbgzak:tgPaPNMMgPaDaDN9ETmbaqaDaP:rgH:vJbbbZNJbbbZMgPNamJbbjZaP:tgONMhqakaPNazaONMhkaxaPNasaONMhxaDaHMJbbbZNhDkaecxfheadcufgdmbkkabaDUdxabaqUdwabakUdlabaxUdbkjeeiu8Jjjjjbcj8W9Rgr8Kjjjjbaici2hwdnaiTmbawceawce0EhDarhiinaiaeadRbbcdtfydbBdbadcefhdaiclfhiaDcufgDmbkkabarawaladaoz:hjjjbarcj8Wf8Kjjjjbk:Ylequ8Jjjjjbcjx9Rgl8Kjjjjbcbhvalcjqfcbaiz:njjjb8AdndnadTmbcjehoaehrincuhwarhDcuhqavhkdninawakaoalcjqfaDcefRbbfRbb9RcFeGci6aoalcjqfaDRbbfRbb9RcFeGci6faoalcjqfaDcdfRbbfRbb9RcFeGci6fgxaq9mgmEhwdnammbaxce0mdkaxaqaxaq9kEhqaDcifhDadakcefgk9hmbkkaeawci2fgDcdfRbbhqaDcefRbbhxaDRbbhkaeavci2fgDcifaDawav9Rci2z:qjjjb8Aakalcjqffaocefgo86bbaxalcjqffao86bbaDcdfaq86bbaDcefax86bbaDak86bbaqalcjqffao86bbarcifhravcefgvad9hmbkalcFeaiz:njjjbhoadci2gDceaDce0EhqcbhxindnaoaeRbbgkfgwRbbgDcFe9hmbawax86bbaocjdfaxcdtfabakcdtfydbBdbaxhDaxcefhxkaeaD86bbaecefheaqcufgqmbkaxcdthDxekcbhDkabalcjdfaDz:mjjjb8Aalcjxf8Kjjjjbk9teiucbcbyd11jjbgeabcifc98GfgbBd11jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd11jjbgeabcrfc94GfgbBd11jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd11jjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd11jjbfgdBd11jjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akk:;Deludndndnadch9pmbabaeSmdaeabadfgi9Rcbadcet9R0mekabaead;8qbbxekaeab7ciGhldndndnabae9pmbdnalTmbadhvabhixikdnabciGmbadhvabhixdkadTmiabaeRbb86bbadcufhvdnabcefgiciGmbaecefhexdkavTmiabaeRbe86beadc9:fhvdnabcdfgiciGmbaecdfhexdkavTmiabaeRbd86bdadc99fhvdnabcifgiciGmbaecifhexdkavTmiabaeRbi86biabclfhiaeclfheadc98fhvxekdnalmbdnaiciGTmbadTmlabadcufgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc9:fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc99fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc98fgdfaeadfRbb86bbkadcl6mbdnadc98fgocd4cefciGgiTmbaec98fhlabc98fhvinavadfaladfydbBdbadc98fhdaicufgimbkkaocx6mbaec9Wfhvabc9WfhoinaoadfgicxfavadfglcxfydbBdbaicwfalcwfydbBdbaiclfalclfydbBdbaialydbBdbadc9Wfgdci0mbkkadTmdadhidnadciGglTmbaecufhvabcufhoadhiinaoaifavaifRbb86bbaicufhialcufglmbkkadcl6mdaec98fhlabc98fhvinavaifgecifalaifgdcifRbb86bbaecdfadcdfRbb86bbaecefadcefRbb86bbaeadRbb86bbaic98fgimbxikkavcl6mbdnavc98fglcd4cefcrGgdTmbavadcdt9RhvinaiaeydbBdbaeclfheaiclfhiadcufgdmbkkalc36mbinaiaeydbBdbaiaeydlBdlaiaeydwBdwaiaeydxBdxaiaeydzBdzaiaeydCBdCaiaeydKBdKaiaeyd3Bd3aecafheaicafhiavc9Gfgvci0mbkkavTmbdndnavcrGgdmbavhlxekavc94GhlinaiaeRbb86bbaicefhiaecefheadcufgdmbkkavcw6mbinaiaeRbb86bbaiaeRbe86beaiaeRbd86bdaiaeRbi86biaiaeRbl86blaiaeRbv86bvaiaeRbo86boaiaeRbr86braicwfhiaecwfhealc94fglmbkkabkkAebcjwkxebbbdbbbzNbb",J=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!=="object")return{supported:!1};var X,Y=WebAssembly.instantiate($(Z),{}).then(function(U){X=U.instance,X.exports.__wasm_call_ctors()});function $(U){var w=new Uint8Array(U.length);for(var L=0;L<U.length;++L){var O=U.charCodeAt(L);w[L]=O>96?O-97:O>64?O-39:O+4}var N=0;for(var L=0;L<U.length;++L)w[N++]=w[L]<60?J[w[L]]:(w[L]-60)*64+w[++L];return w.buffer.slice(0,N)}function Q(U){if(!U)throw new Error("Assertion failed")}function W(U){return new Uint8Array(U.buffer,U.byteOffset,U.byteLength)}var K=48,G=16;function H(U,w){var L=U.meshlets[w*4+0],O=U.meshlets[w*4+1],N=U.meshlets[w*4+2],M=U.meshlets[w*4+3];return{vertices:U.vertices.subarray(L,L+N),triangles:U.triangles.subarray(O,O+M*3)}}function z(U,w,L,O,N,M,j){var P=X.exports.sbrk,D=X.exports.meshopt_buildMeshletsBound(U.length,N,M),C=P(D*G),k=P(D*N*4),T=P(D*M*3),x=P(U.byteLength),S=P(w.byteLength),h=new Uint8Array(X.exports.memory.buffer);h.set(W(U),x),h.set(W(w),S);var I=X.exports.meshopt_buildMeshlets(C,k,T,x,U.length,S,L,O,N,M,j);h=new Uint8Array(X.exports.memory.buffer);var v=h.subarray(C,C+I*G),A=new Uint32Array(v.buffer,v.byteOffset,v.byteLength/4).slice();for(var p=0;p<I;++p){var n=A[p*4+0],o=A[p*4+1],L=A[p*4+2],X0=A[p*4+3];X.exports.meshopt_optimizeMeshlet(k+n*4,T+o,X0,L)}var Q0=A[(I-1)*4+0],E0=A[(I-1)*4+1],I0=A[(I-1)*4+2],a0=A[(I-1)*4+3],I8=Q0+I0,s1=E0+(a0*3+3&-4),l4={meshlets:A,vertices:new Uint32Array(h.buffer,k,I8).slice(),triangles:new Uint8Array(h.buffer,T,s1*3).slice(),meshletCount:I};return P(C-P(0)),l4}function q(U){var w=new Float32Array(X.exports.memory.buffer,U,K/4);return{centerX:w[0],centerY:w[1],centerZ:w[2],radius:w[3],coneApexX:w[4],coneApexY:w[5],coneApexZ:w[6],coneAxisX:w[7],coneAxisY:w[8],coneAxisZ:w[9],coneCutoff:w[10]}}function V(U,w,L,O){var N=X.exports.sbrk,M=[],j=N(w.byteLength),P=N(U.vertices.byteLength),D=N(U.triangles.byteLength),C=N(K),k=new Uint8Array(X.exports.memory.buffer);k.set(W(w),j),k.set(W(U.vertices),P),k.set(W(U.triangles),D);for(var T=0;T<U.meshletCount;++T){var x=U.meshlets[T*4+0],S=U.meshlets[T*4+0+1],h=U.meshlets[T*4+0+3];X.exports.meshopt_computeMeshletBounds(C,P+x*4,D+S,h,j,L,O),M.push(q(C))}return N(j-N(0)),M}function F(U,w,L,O){var N=X.exports.sbrk,M=N(K),j=N(U.byteLength),P=N(w.byteLength),D=new Uint8Array(X.exports.memory.buffer);D.set(W(U),j),D.set(W(w),P),X.exports.meshopt_computeClusterBounds(M,j,U.length,P,L,O);var C=q(M);return N(M-N(0)),C}return{ready:Y,supported:!0,buildMeshlets:function(U,w,L,O,N,M){Q(U.length%3==0),Q(w instanceof Float32Array),Q(w.length%L==0),Q(L>=3),Q(O<=255||O>0),Q(N<=512),Q(N%4==0),M=M||0;var j=U.BYTES_PER_ELEMENT==4?U:new Uint32Array(U);return z(j,w,w.length/L,L*4,O,N,M)},computeClusterBounds:function(U,w,L){Q(U.length%3==0),Q(U.length/3<=512),Q(w instanceof Float32Array),Q(w.length%L==0),Q(L>=3);var O=U.BYTES_PER_ELEMENT==4?U:new Uint32Array(U);return F(O,w,w.length/L,L*4)},computeMeshletBounds:function(U,w,L){return Q(U.meshletCount!=0),Q(w instanceof Float32Array),Q(w.length%L==0),Q(L>=3),V(U,w,w.length/L,L*4)},extractMeshlet:function(U,w){return Q(w>=0&&w<U.meshletCount),H(U,w)}}}();var sQ={OPTIMIZED_DIR:".optimized",CHECKSUM_EXT:".md5",DIRECTORIES:[(()=>{try{return a5.dirname(u.resolve("@hytopia.com/assets"))}catch{return null}})(),a5.resolve(process.cwd(),"assets")].filter(Boolean),OPTIMIZER_RUNS:[{suffix:"",options:["--compress","false","--instance","false","--simplify","false"]},{suffix:"-named-nodes",options:["--compress","false","--instance","false","--simplify","false","--join","true","--join-named","false"]}]};class R5{static instance=new R5;optimize=!0;optimizeEveryStart=!1;_modelUriDocuments=new Map;_modelUriBoundingBoxes=new Map;_modelUriNodeNames=new Map;_modelUriTrimeshes=new Map;constructor(){}async preloadModels(){let Z=await this._getAbsoluteModelPaths();console.log(`ModelRegistry.preloadModels(): Preloading ${Z.length} models...`);for(let J of Z){if(this.optimize)await this._resolveOptimizedModelPath(J);await this._loadModelData(J)}console.log(`ModelRegistry.preloadModels(): Preloaded ${Z.length} models!`)}getAnimationNames(Z){let J=this._modelUriDocuments.get(Z);if(!J)m.fatalError(`ModelRegistry.getAnimationNames(): Model ${Z} not found!`);return J.getRoot().listAnimations().map((Y)=>Y.getName())}getBoundingBox(Z){let J=this._modelUriBoundingBoxes.get(Z);if(!J)m.fatalError(`ModelRegistry.getBoundingBox(): Model ${Z} not found!`);return J}getDepth(Z){let J=this.getBoundingBox(Z);return J.max.z-J.min.z}getHeight(Z){let J=this.getBoundingBox(Z);return J.max.y-J.min.y}getNodeNames(Z){let J=this._modelUriNodeNames.get(Z);if(!J)m.fatalError(`ModelRegistry.getNodeNames(): Model ${Z} not found!`);return J}getTrimesh(Z,J=1){let X=this._modelUriTrimeshes.get(Z);if(!X){m.error(`ModelRegistry.getTrimesh(): Model ${Z} not found!`);return}let Y=X.vertices;if(J!==1){Y=new Float32Array(Y.length);for(let $=0;$<Y.length;$++)Y[$]=X.vertices[$]*J}return{vertices:Y,indices:X.indices}}getWidth(Z){let J=this.getBoundingBox(Z);return J.max.x-J.min.x}modelHasNode(Z,J){let X=this._modelUriNodeNames.get(Z);if(!X)m.fatalError(`ModelRegistry.modelHasNode(): Model ${Z} not found!`);return X.includes(J)}_absoluteModelPathToModelUri(Z){let J=a5.normalize(Z);for(let X of sQ.DIRECTORIES){let Y=a5.normalize(X);if(J.startsWith(Y))return a5.relative(Y,J).replace(/\\/g,"/")}return a5.basename(J)}async _getAbsoluteModelPaths(){let Z=[];for(let J of sQ.DIRECTORIES){let X=a5.resolve(process.cwd(),J);if(!PJ.existsSync(X))continue;let Y=await EU("**/*.{gltf,glb}",{cwd:X,follow:!0});for(let $ of Y)Z.push(a5.join(X,$))}return Z}async _loadModelData(Z){let J=await new ID().read(Z),X=Qa(J.getRoot().listScenes()[0]),Y=J.getRoot().listNodes().map((Q)=>Q.getName()),$=this._absoluteModelPathToModelUri(Z);this._modelUriDocuments.set($,J),this._modelUriBoundingBoxes.set($,{min:{x:X.min[0],y:X.min[1],z:X.min[2]},max:{x:X.max[0],y:X.max[1],z:X.max[2]}}),this._modelUriNodeNames.set($,Y),this._modelUriTrimeshes.set($,await this._buildTrimesh($))}async _resolveOptimizedModelPath(Z){let J=this._buildOptimizedModelPath(Z);if(!this.optimizeEveryStart&&this._isOptimizedVersionValid(Z))return J;return await this._optimizeModel(Z,J)}_isOptimizedVersionValid(Z){let J=`${this._buildOptimizedModelPath(Z)}${sQ.CHECKSUM_EXT}`;if(!PJ.existsSync(J))return!1;let X=this._calculateChecksum(Z),Y=PJ.readFileSync(J,"utf8");return X===Y}_calculateChecksum(Z){if(!PJ.existsSync(Z))return"";let J=PJ.readFileSync(Z);return $O1.createHash("sha256").update(J.toString("base64")).digest("hex")}_buildOptimizedModelPath(Z){let J=a5.basename(Z),X=J.replace(/\.[^/.]+$/,""),Y=a5.dirname(Z),$=a5.join(Y,sQ.OPTIMIZED_DIR,X);return a5.join($,J)}async _buildTrimesh(Z,J=1,X=0.001){let Y=this._modelUriDocuments.get(Z);if(!Y)m.fatalError(`ModelRegistry._buildTrimesh(): Model ${Z} not found!`);let $=Ya(Y);$.setLogger(new O5(ZG.WARN)),await $.transform(gn({pivot:"center"}),$a(),Wa(),kC(),qa({simplifier:Va,ratio:J,error:X}),Ja());for(let H of $.getRoot().listScenes())for(let z of H.listChildren())en(z);let Q=$.getRoot().listMeshes()[0];if(!Q){m.error(`ModelRegistry._buildTrimesh(): Model ${Z} has no root mesh!`);return}let W=Q.listPrimitives()[0];if(!W){m.error(`ModelRegistry._buildTrimesh(): Model ${Z} has no root primitive!`);return}let K=W.getAttribute("POSITION"),G=W.getIndices();if(!K||!G){m.error(`ModelRegistry._buildTrimesh(): Model ${Z} missing required geometry data!`);return}return{vertices:K.getArray(),indices:G.getArray()}}async _optimizeModel(Z,J){let X=a5.dirname(J);PJ.rmSync(X,{recursive:!0,force:!0}),PJ.mkdirSync(X,{recursive:!0}),console.log(`ModelRegistry: Optimizing model ${this._absoluteModelPathToModelUri(Z)}...`);for(let Y of sQ.OPTIMIZER_RUNS){let $=J.replace(/(\.[^/.]+)$/,`${Y.suffix}$1`),{stderr:Q}=await jd("npx",["gltf-transform","optimize",Z,$,...Y.options]);if(Q)return m.warning(`ModelRegistry._optimizeModel(): Error optimizing model ${this._absoluteModelPathToModelUri(Z)}, defaulting to unoptimized model. Error: ${Q}`),Z}return PJ.writeFileSync(`${J}${sQ.CHECKSUM_EXT}`,this._calculateChecksum(Z)),J}}var kG;(($)=>{$.DYNAMIC="dynamic";$.FIXED="fixed";$.KINEMATIC_POSITION="kinematic_position";$.KINEMATIC_VELOCITY="kinematic_velocity"})(kG||={});var IC=0.001,Fa="dynamic";class NY extends w0{_additionalMass=0;_colliders=new Set;_explicitSleep=!1;_enabledPositions={x:!0,y:!0,z:!0};_enabledRotations={x:!0,y:!0,z:!0};_rigidBody;_rigidBodyDesc;_rigidBodyType;_simulation;constructor(Z){super();Z.type??=Fa,this._rigidBodyDesc=this._createRigidBodyDesc(Z),this._rigidBodyType=Z.type,this._applyRigidBodyOptions(Z),this._autoAddToSimulation(Z)}get additionalMass(){if(!this._requireNotRemoved("additionalMass"))return 0;return this._additionalMass}get additionalSolverIterations(){if(!this._requireNotRemoved("additionalSolverIterations"))return 0;return this._rigidBody?this._rigidBody.additionalSolverIterations():this._rigidBodyDesc.additionalSolverIterations}get angularDamping(){if(!this._requireNotRemoved("angularDamping"))return 0;return this._rigidBody?this._rigidBody.angularDamping():this._rigidBodyDesc.angularDamping}get angularVelocity(){if(!this._requireNotRemoved("angularVelocity"))return{x:0,y:0,z:0};return this._rigidBody?this._rigidBody.angvel():this._rigidBodyDesc.angvel}get colliders(){return this._colliders}get dominanceGroup(){if(!this._requireNotRemoved("dominanceGroup"))return 0;return this._rigidBody?this._rigidBody.dominanceGroup():this._rigidBodyDesc.dominanceGroup}get directionFromRotation(){let{x:Z,y:J,z:X,w:Y}=this.rotation;return{x:-2*(Z*X+Y*J),y:-2*(J*X-Y*Z),z:-(1-2*(Z*Z+J*J))}}get effectiveAngularInertia(){if(!this._requireNotRemoved("effectiveAngularInertia"))return;return this._rigidBody?this._rigidBody.effectiveAngularInertia():void 0}get effectiveInverseMass(){if(!this._requireNotRemoved("effectiveInverseMass"))return;return this._rigidBody?this._rigidBody.effectiveInvMass():void 0}get effectiveWorldInversePrincipalAngularInertiaSqrt(){if(!this._requireNotRemoved("effectiveWorldInversePrincipalAngularInertiaSqrt"))return;return this._rigidBody?this._rigidBody.effectiveWorldInvInertiaSqrt():void 0}get enabledRotations(){if(!this._requireNotRemoved("enabledRotations"))return{x:!0,y:!0,z:!0};return this._enabledRotations}get enabledPositions(){if(!this._requireNotRemoved("enabledPositions"))return{x:!0,y:!0,z:!0};return this._enabledPositions}get gravityScale(){if(!this._requireNotRemoved("gravityScale"))return 0;return this._rigidBody?this._rigidBody.gravityScale():this._rigidBodyDesc.gravityScale}get inverseMass(){if(!this._requireNotRemoved("inverseMass"))return;return this._rigidBody?this._rigidBody.invMass():void 0}get inversePrincipalAngularInertiaSqrt(){if(!this._requireNotRemoved("inversePrincipalAngularInertiaSqrt"))return;return this._rigidBody?this._rigidBody.invPrincipalInertiaSqrt():void 0}get isCcdEnabled(){if(!this._requireNotRemoved("isCcdEnabled"))return!1;return this._rigidBody?this._rigidBody.isCcdEnabled():this._rigidBodyDesc.ccdEnabled}get isDynamic(){if(!this._requireNotRemoved("isDynamic"))return!1;return this._rigidBodyType==="dynamic"}get isEnabled(){if(!this._requireNotRemoved("isEnabled"))return!1;return this._rigidBody?this._rigidBody.isEnabled():this._rigidBodyDesc.enabled}get isFixed(){if(!this._requireNotRemoved("isFixed"))return!1;return this._rigidBodyType==="fixed"}get isKinematic(){if(!this._requireNotRemoved("isKinematic"))return!1;return["kinematic_position","kinematic_velocity"].includes(this._rigidBodyType)}get isKinematicPositionBased(){if(!this._requireNotRemoved("isKinematicPositionBased"))return!1;return this._rigidBodyType==="kinematic_position"}get isKinematicVelocityBased(){if(!this._requireNotRemoved("isKinematicVelocityBased"))return!1;return this._rigidBodyType==="kinematic_velocity"}get isMoving(){if(!this._requireNotRemoved("isMoving"))return!1;return this._rigidBody?this._rigidBody.isMoving():!1}get isRemoved(){return!this._rigidBody&&!this._rigidBodyDesc}get isSimulated(){if(!this._requireNotRemoved("isSimulated"))return!1;return this._rigidBody?!0:!1}get isSleeping(){if(!this._requireNotRemoved("isSleeping"))return!1;return this._rigidBody?this._rigidBody.isSleeping():this._rigidBodyDesc.sleeping}get linearDamping(){if(!this._requireNotRemoved("linearDamping"))return 0;return this._rigidBody?this._rigidBody.linearDamping():this._rigidBodyDesc.linearDamping}get linearVelocity(){if(!this._requireNotRemoved("linearVelocity"))return{x:0,y:0,z:0};return this._rigidBody?this._rigidBody.linvel():this._rigidBodyDesc.linvel}get localCenterOfMass(){if(!this._requireNotRemoved("localCenterOfMass"))return{x:0,y:0,z:0};return this._rigidBody?this._rigidBody.localCom():this._rigidBodyDesc.centerOfMass}get mass(){if(!this._requireNotRemoved("mass"))return 0;return this._rigidBody?this._rigidBody.mass():this._rigidBodyDesc.mass}get nextKinematicRotation(){if(!this._requireNotRemoved("nextKinematicRotation"))return{x:0,y:0,z:0,w:1};return this._rigidBody?this._rigidBody.nextRotation():this._rigidBodyDesc.rotation}get nextKinematicPosition(){if(!this._requireNotRemoved("nextKinematicPosition"))return{x:0,y:0,z:0};return this._rigidBody?this._rigidBody.nextTranslation():this._rigidBodyDesc.translation}get numColliders(){return this._colliders.size}get principalAngularInertia(){if(!this._requireNotRemoved("principalAngularInertia"))return{x:0,y:0,z:0};return this._rigidBody?this._rigidBody.principalInertia():this._rigidBodyDesc.principalAngularInertia}get principalAngularInertiaLocalFrame(){if(!this._requireNotRemoved("principalAngularInertiaLocalFrame"))return;return this._rigidBody?this._rigidBody.principalInertiaLocalFrame():void 0}get position(){if(!this._requireNotRemoved("position"))return{x:0,y:0,z:0};return this._rigidBody?this._rigidBody.translation():this._rigidBodyDesc.translation}get rawRigidBody(){if(!this._requireNotRemoved("rawRigidBody"))return;return this._rigidBody}get rotation(){if(!this._requireNotRemoved("rotation"))return{x:0,y:0,z:0,w:1};return this._rigidBody?this._rigidBody.rotation():this._rigidBodyDesc.rotation}get softCcdPrediction(){if(!this._requireNotRemoved("softCcdPrediction"))return 0;return this._rigidBody?this._rigidBody.softCcdPrediction():this._rigidBodyDesc.softCcdPrediction}get type(){if(!this._requireNotRemoved("type"))return"dynamic";return this._rigidBodyType}get worldCenterOfMass(){if(!this._requireNotRemoved("worldCenterOfMass"))return;return this._rigidBody?this._rigidBody.worldCom():void 0}setAdditionalMass(Z){if(!this._requireDynamic("setAdditionalMass"))return;if(!this._requireNotRemoved("setAdditionalMass"))return;this._rigidBody?this._rigidBody.setAdditionalMass(Z,!this._explicitSleep):this._rigidBodyDesc.setAdditionalMass(Z)}setAdditionalMassProperties(Z){if(!this._requireDynamic("setAdditionalMassProperties"))return;if(!this._requireNotRemoved("setAdditionalMassProperties"))return;let{additionalMass:J,centerOfMass:X,principalAngularInertia:Y,principalAngularInertiaLocalFrame:$}=Z;this._rigidBody?this._rigidBody.setAdditionalMassProperties(J,X,Y,$,!this._explicitSleep):this._rigidBodyDesc.setAdditionalMassProperties(J,X,Y,$)}setAdditionalSolverIterations(Z){if(!this._requireDynamic("setAdditionalSolverIterations"))return;if(!this._requireNotRemoved("setAdditionalSolverIterations"))return;this._rigidBody?this._rigidBody.setAdditionalSolverIterations(Z):this._rigidBodyDesc.setAdditionalSolverIterations(Z)}setAngularDamping(Z){if(!this._requireDynamic("setAngularDamping"))return;if(!this._requireNotRemoved("setAngularDamping"))return;this._rigidBody?this._rigidBody.setAngularDamping(Z):this._rigidBodyDesc.setAngularDamping(Z)}setAngularVelocity(Z){if(!this._requireNotKinematicPositionBased("setAngularVelocity"))return;if(!this._requireNotRemoved("setAngularVelocity"))return;this._rigidBody?this._rigidBody.setAngvel(Z,!this._explicitSleep):this._rigidBodyDesc.setAngvel(Z)}setCcdEnabled(Z){if(!this._requireDynamic("setCcdEnabled"))return;if(!this._requireNotRemoved("setCcdEnabled"))return;this._rigidBody?this._rigidBody.enableCcd(Z):this._rigidBodyDesc.setCcdEnabled(Z)}setDominanceGroup(Z){if(!this._requireDynamic("setDominanceGroup"))return;if(!this._requireNotRemoved("setDominanceGroup"))return;this._rigidBody?this._rigidBody.setDominanceGroup(Z):this._rigidBodyDesc.setDominanceGroup(Z)}setEnabled(Z){if(!this._requireNotRemoved("setEnabled"))return;this._rigidBody?this._rigidBody.setEnabled(Z):this._rigidBodyDesc.setEnabled(Z)}setEnabledPositions(Z){if(!this._requireDynamic("setEnabledPositions"))return;if(!this._requireNotRemoved("setEnabledPositions"))return;this._rigidBody?this._rigidBody.setEnabledTranslations(Z.x,Z.y,Z.z,!this._explicitSleep):this._rigidBodyDesc.enabledTranslations(Z.x,Z.y,Z.z),this._enabledPositions=Z}setEnabledRotations(Z){if(!this._requireDynamic("setEnabledRotations"))return;if(!this._requireNotRemoved("setEnabledRotations"))return;this._rigidBody?this._rigidBody.setEnabledRotations(Z.x,Z.y,Z.z,!this._explicitSleep):this._rigidBodyDesc.enabledRotations(Z.x,Z.y,Z.z),this._enabledRotations=Z}setGravityScale(Z){if(!this._requireDynamic("setGravityScale"))return;if(!this._requireNotRemoved("setGravityScale"))return;this._rigidBody?this._rigidBody.setGravityScale(Z,!this._explicitSleep):this._rigidBodyDesc.setGravityScale(Z)}setLinearDamping(Z){if(!this._requireDynamic("setLinearDamping"))return;if(!this._requireNotRemoved("setLinearDamping"))return;this._rigidBody?this._rigidBody.setLinearDamping(Z):this._rigidBodyDesc.setLinearDamping(Z)}setLinearVelocity(Z){if(!this._requireNotKinematicPositionBased("setLinearVelocity"))return;if(!this._requireNotRemoved("setLinearVelocity"))return;this._rigidBody?this._rigidBody.setLinvel(Z,!this._explicitSleep):this._rigidBodyDesc.setLinvel(Z.x,Z.y,Z.z)}setNextKinematicRotation(Z){if(!this._requireKinematic("setNextKinematicRotation"))return;if(!this._requireNotRemoved("setNextKinematicRotation"))return;this._rigidBody?this._rigidBody.setNextKinematicRotation(Z):this._rigidBodyDesc.setRotation(Z)}setNextKinematicPosition(Z){if(!this._requireKinematic("setNextKinematicPosition"))return;if(!this._requireNotRemoved("setNextKinematicPosition"))return;this._rigidBody?this._rigidBody.setNextKinematicTranslation(Z):this._rigidBodyDesc.setTranslation(Z.x,Z.y,Z.z)}setPosition(Z){if(!this._requireNotRemoved("setPosition"))return;this._rigidBody?this._rigidBody.setTranslation(Z,!this._explicitSleep):this._rigidBodyDesc.setTranslation(Z.x,Z.y,Z.z)}setRotation(Z){if(!this._requireNotRemoved("setRotation"))return;this._rigidBody?this._rigidBody.setRotation(Z,!this._explicitSleep):this._rigidBodyDesc.setRotation(Z)}setSleeping(Z){if(!this._requireDynamic("setSleeping"))return;if(!this._requireNotRemoved("setSleeping"))return;this._rigidBody?Z?this._rigidBody.sleep():this._rigidBody.wakeUp():this._rigidBodyDesc.sleeping=Z,this._explicitSleep=Z}setSoftCcdPrediction(Z){if(!this._requireDynamic("setSoftCcdPrediction"))return;if(!this._requireNotRemoved("setSoftCcdPrediction"))return;this._rigidBody?this._rigidBody.setSoftCcdPrediction(Z):this._rigidBodyDesc.setSoftCcdPrediction(Z)}setCollisionGroupsForSolidColliders(Z){if(!this._requireNotRemoved("setCollisionGroupsForSolidColliders"))return;this._colliders.forEach((J)=>{if(J.isSensor)return;J.setCollisionGroups(Z)})}setCollisionGroupsForSensorColliders(Z){if(!this._requireNotRemoved("setCollisionGroupsForSensorColliders"))return;this._colliders.forEach((J)=>{if(!J.isSensor)return;J.setCollisionGroups(Z)})}setType(Z){if(!this._requireNotRemoved("setType"))return;let X={["dynamic"]:J1.RigidBodyType.Dynamic,["fixed"]:J1.RigidBodyType.Fixed,["kinematic_position"]:J1.RigidBodyType.KinematicPositionBased,["kinematic_velocity"]:J1.RigidBodyType.KinematicVelocityBased}[Z];if(X===void 0)return m.error(`Invalid RigidBodyType: ${Z}`);this._rigidBody?this._rigidBody.setBodyType(X,!this._explicitSleep):this._rigidBodyDesc.status=X,this._rigidBodyType=Z}addForce(Z){if(!this._requireNotRemoved("addForce"))return;if(!this._requireCreated("addForce"))return;if(!this._requireDynamic("addForce"))return;if(this._isNegligibleVector(Z))return;this._rigidBody.addForce(Z,!this._explicitSleep)}addTorque(Z){if(!this._requireNotRemoved("addTorque"))return;if(!this._requireCreated("addTorque"))return;if(!this._requireDynamic("addTorque"))return;if(this._isNegligibleVector(Z))return;this._rigidBody.addTorque(Z,!this._explicitSleep)}addChildColliderToSimulation(Z){if(!this._requireNotRemoved("addChildColliderToSimulation"))return;if(!this._requireCreated("addChildColliderToSimulation"))return;Z.addToSimulation(this._simulation,this)}addToSimulation(Z){if(!this._requireNotRemoved("addToSimulation"))return;if(this._rigidBody)return m.error("RigidBody.addToSimulation(): Rigid body already exists in the simulation!");this._simulation=Z,this._rigidBody=this._simulation.createRawRigidBody(this._rigidBodyDesc),this._colliders.forEach((J)=>{if(!J.isSimulated)J.addToSimulation(Z,this)})}applyImpulse(Z){if(!this._requireNotRemoved("applyImpulse"))return;if(!this._requireCreated("applyImpulse"))return;if(!this._requireDynamic("applyImpulse"))return;if(this._isNegligibleVector(Z))return;this._rigidBody.applyImpulse(Z,!this._explicitSleep)}applyImpulseAtPoint(Z,J){if(!this._requireNotRemoved("applyImpulseAtPoint"))return;if(!this._requireCreated("applyImpulseAtPoint"))return;if(!this._requireDynamic("applyImpulseAtPoint"))return;if(this._isNegligibleVector(Z))return;this._rigidBody.applyImpulseAtPoint(Z,J,!this._explicitSleep)}applyTorqueImpulse(Z){if(!this._requireNotRemoved("applyTorqueImpulse"))return;if(!this._requireCreated("applyTorqueImpulse"))return;if(!this._requireDynamic("applyTorqueImpulse"))return;this._rigidBody.applyTorqueImpulse(Z,!this._explicitSleep)}createAndAddChildCollider(Z){if(!this._requireNotRemoved("createAndAddChildCollider"))return null;return this._simulation?new s5({...Z,parentRigidBody:this,simulation:this._simulation}):this._createAndAddPendingChildCollider(Z)}createAndAddChildColliders(Z){let J=[];return Z.forEach((X)=>{let Y=this.createAndAddChildCollider(X);if(Y)J.push(Y)}),J}getCollidersByTag(Z){let J=[];for(let X of this._colliders)if(X.tag===Z)J.push(X);return J}linkCollider(Z){if(!this._requireNotRemoved("linkCollider"))return;if(Z.parentRigidBody!==this)return m.error("RigidBody.linkCollider(): Collider cannot be linked because it is not a child of this rigid body!");this._colliders.add(Z)}lockAllRotations(){if(!this._requireNotRemoved("lockAllRotations"))return;this.setEnabledRotations({x:!1,y:!1,z:!1})}lockAllPositions(){if(!this._requireNotRemoved("lockAllPositions"))return;this.setEnabledPositions({x:!1,y:!1,z:!1})}removeFromSimulation(){if(!this._requireNotRemoved("removeFromSimulation"))return;if(!this._rigidBody)return m.error("RigidBody.removeFromSimulation(): Rigid body does not exist in the simulation!");this._colliders.forEach((Z)=>{Z.removeFromSimulation()}),this._simulation.removeRawRigidBody(this._rigidBody),this._simulation=void 0,this._rigidBody=void 0}unlinkCollider(Z){if(!this._requireNotRemoved("unlinkCollider"))return;if(!Z.isRemoved)return m.error("RigidBody.unlinkCollider(): Collider is still simulated and therefore cannot be unlinked from this rigid body!");this._colliders.delete(Z)}resetAngularVelocity(){if(!this._requireNotRemoved("resetAngularVelocity"))return;if(!this._requireCreated("resetAngularVelocity"))return;this.setAngularVelocity({x:0,y:0,z:0})}resetForces(){if(!this._requireNotRemoved("resetForces"))return;if(!this._requireCreated("resetForces"))return;this._rigidBody.resetForces(!this._explicitSleep)}resetLinearVelocity(){if(!this._requireNotRemoved("resetLinearVelocity"))return;if(!this._requireCreated("resetLinearVelocity"))return;this.setLinearVelocity({x:0,y:0,z:0})}resetTorques(){if(!this._requireNotRemoved("resetTorques"))return;if(!this._requireCreated("resetTorques"))return;this._rigidBody.resetTorques(!this._explicitSleep)}sleep(){if(!this._requireNotRemoved("sleep"))return;this.setSleeping(!0)}wakeUp(){if(!this._requireNotRemoved("wakeUp"))return;this.setSleeping(!1)}_applyRigidBodyOptions(Z){[["additionalMass",this.setAdditionalMass.bind(this)],["additionalMassProperties",this.setAdditionalMassProperties.bind(this)],["additionalSolverIterations",this.setAdditionalSolverIterations.bind(this)],["angularDamping",this.setAngularDamping.bind(this)],["angularVelocity",this.setAngularVelocity.bind(this)],["dominanceGroup",this.setDominanceGroup.bind(this)],["ccdEnabled",this.setCcdEnabled.bind(this)],["enabled",this.setEnabled.bind(this)],["enabledPositions",this.setEnabledPositions.bind(this)],["enabledRotations",this.setEnabledRotations.bind(this)],["gravityScale",this.setGravityScale.bind(this)],["linearDamping",this.setLinearDamping.bind(this)],["linearVelocity",this.setLinearVelocity.bind(this)],["position",this.setPosition.bind(this)],["rotation",this.setRotation.bind(this)],["sleeping",this.setSleeping.bind(this)],["softCcdPrediction",this.setSoftCcdPrediction.bind(this)]].forEach(([X,Y])=>{if(X in Z)Y(Z[X])})}_autoAddToSimulation(Z){if(Z.colliders)this._createAndAddPendingChildColliders(Z.colliders);if(Z.simulation)this.addToSimulation(Z.simulation)}_createAndAddPendingChildCollider(Z){if(!this._requireNotRemoved("createAndAddPendingChildCollider"))return null;if(!this._requireNotSimulated("createAndAddPendingChildCollider"))return null;let J=new s5(Z);return this._colliders.add(J),J}_createAndAddPendingChildColliders(Z){let J=[];return Z.forEach((X)=>{let Y=this._createAndAddPendingChildCollider(X);if(Y)J.push(Y)}),J}_createRigidBodyDesc(Z){let J=Z.type??Fa;return{["dynamic"]:()=>J1.RigidBodyDesc.dynamic(),["fixed"]:()=>J1.RigidBodyDesc.fixed(),["kinematic_position"]:()=>J1.RigidBodyDesc.kinematicPositionBased(),["kinematic_velocity"]:()=>J1.RigidBodyDesc.kinematicVelocityBased()}[J]()}_requireCreated(Z){if(!this._rigidBody||!this._simulation)m.error(`RigidBody._requireCreated(): Rigid body has not been created and therefore does not support the invoked method: ${Z}()`);return!!this._rigidBody&&!!this._simulation}_requireDynamic(Z){if(!this.isDynamic)m.error(`RigidBody._requireDynamic(): Rigid body is not dynamic and therefore does not support the invoked method: ${Z}()`);return this.isDynamic}_requireKinematic(Z){if(!this.isKinematic)m.error(`RigidBody._requireKinematic(): Rigid body is not kinematic and therefore does not support the invoked method: ${Z}()`);return this.isKinematic}_requireNotKinematicPositionBased(Z){if(this.isKinematicPositionBased)m.error(`RigidBody._requireNotKinematicPositionBased(): Rigid body is kinematic position based and therefore does not support the invoked method: ${Z}()`);return!this.isKinematicPositionBased}_requireNotRemoved(Z){if(!this._rigidBody&&!this._rigidBodyDesc)m.error(`RigidBody._requireNotRemoved(): Rigid body has been removed and therefore does not support the invoked method: ${Z}()`);return!!this._rigidBody||!!this._rigidBodyDesc}_requireNotSimulated(Z){if(this.isSimulated)m.error(`RigidBody._requireNotSimulated(): Rigid body is simulated and therefore does not support the invoked method: ${Z}()`);return!this.isSimulated}_isNegligibleVector(Z){return Math.abs(Z.x)<IC&&Math.abs(Z.y)<IC&&Math.abs(Z.z)<IC}}var vC;(($)=>{$[$.Average=0]="Average";$[$.Min=1]="Min";$[$.Multiply=2]="Multiply";$[$.Max=3]="Max"})(vC||={});var EG;((z)=>{z.NONE="none";z.BALL="ball";z.BLOCK="block";z.CAPSULE="capsule";z.CONE="cone";z.CYLINDER="cylinder";z.ROUND_CYLINDER="round-cylinder";z.TRIMESH="trimesh";z.VOXELS="voxels";z.WEDGE="wedge"})(EG||={});class s5 extends w0{_collider;_colliderDesc;_onCollision;_parentRigidBody;_relativePosition={x:0,y:0,z:0};_relativeRotation={x:0,y:0,z:0,w:1};_shape;_simulation;_tag;constructor(Z){super();this._colliderDesc=this._createColliderDesc(Z),this._shape=Z.shape,this._applyColliderOptions(Z),this._autoAddToSimulation(Z)}static optionsFromBlockHalfExtents(Z){return{shape:"block",halfExtents:Z}}static optionsFromModelUri(Z,J=1,X){let Y=R5.instance.getBoundingBox(Z),$=Y.max.x-Y.min.x,Q=Y.max.y-Y.min.y,W=Y.max.z-Y.min.z,K=Math.max($,W),G=Math.min($,W),H=K/G,z=K/Q,q=K*J/2,V=(N)=>Math.max(0.01,N),F=()=>({shape:"block",halfExtents:{x:V($*J/2),y:V(Q*J/2),z:V(W*J/2)}}),U=()=>({shape:"round-cylinder",radius:V(q),halfHeight:V(Q*J/2),borderRadius:V(q*0.1)}),w=()=>{let N=R5.instance.getTrimesh(Z,J);if(!N)return;return{shape:"trimesh",vertices:N.vertices,indices:N.indices}},L=()=>({shape:"wedge",extents:{x:$*J,y:Q*J,z:W*J}}),O=()=>({shape:"capsule",radius:V(q),halfHeight:V(Q*J/2-q)});if(X)switch(X){case"block":return F();case"capsule":return O();case"round-cylinder":return U();case"trimesh":{let N=w();if(!N){m.error(`Collider.optionsFromModelUri(): Failed to create trimesh options for model ${Z}, falling back to generic shape!`);break}return N}case"wedge":return L();default:m.warning(`Collider.optionsFromModelUri(): Preferred shape ${X} is not yet supported with Collider.optionsFromModelUri(), defaulting to generic shape!`)}if(H>2)return F();if(z>1.5)return U();return O()}get bounciness(){if(!this._requireNotRemoved("bounciness"))return 0;return this._collider?this._collider.restitution():this._colliderDesc.restitution}get bouncinessCombineRule(){if(!this._requireNotRemoved("bouncinessCombineRule"))return 0;return this._collider?this._collider.restitutionCombineRule():this._colliderDesc.restitutionCombineRule}get collisionGroups(){if(!this._requireNotRemoved("collisionGroups"))return{belongsTo:[],collidesWith:[]};return this._collider?Y4.decodeRawCollisionGroups(this._collider.collisionGroups()):Y4.decodeRawCollisionGroups(this._colliderDesc.collisionGroups)}get friction(){if(!this._requireNotRemoved("friction"))return 0;return this._collider?this._collider.friction():this._colliderDesc.friction}get frictionCombineRule(){if(!this._requireNotRemoved("frictionCombineRule"))return 0;return this._collider?this._collider.frictionCombineRule():this._colliderDesc.frictionCombineRule}get isEnabled(){if(!this._requireNotRemoved("isEnabled"))return!1;return this._collider?this._collider.isEnabled():this._colliderDesc.enabled}get isRemoved(){return!this._collider&&!this._colliderDesc}get isSensor(){if(!this._requireNotRemoved("isSensor"))return!1;return this._collider?this._collider.isSensor():this._colliderDesc.isSensor}get isSimulated(){if(!this._requireNotRemoved("isSimulated"))return!1;return!!this._collider}get parentRigidBody(){if(!this._requireNotRemoved("parentRigidBody"))return;return this._parentRigidBody}get rawCollider(){if(!this._requireNotRemoved("rawCollider"))return;return this._collider}get rawShape(){if(!this._requireNotRemoved("rawShape"))return;return this._collider?this._collider.shape:this._colliderDesc.shape}get relativePosition(){if(!this._requireNotRemoved("relativePosition"))return{x:0,y:0,z:0};return this._relativePosition}get relativeRotation(){if(!this._requireNotRemoved("relativeRotation"))return{x:0,y:0,z:0,w:1};return this._relativeRotation}get shape(){if(!this._requireNotRemoved("shape"))return"none";return this._shape}get tag(){if(!this._requireNotRemoved("tag"))return;return this._tag}setBounciness(Z){if(!this._requireNotRemoved("setBounciness"))return;this._collider?this._collider.setRestitution(Z):this._colliderDesc.setRestitution(Z)}setBouncinessCombineRule(Z){if(!this._requireNotRemoved("setBouncinessCombineRule"))return;this._collider?this._collider.setRestitutionCombineRule(Z):this._colliderDesc.setRestitutionCombineRule(Z)}setCollisionGroups(Z){if(!this._requireNotRemoved("setCollisionGroups"))return;let J=Y4.buildRawCollisionGroups(Z);this._collider?this._collider.setCollisionGroups(J):this._colliderDesc.setCollisionGroups(J)}setEnabled(Z){if(!this._requireNotRemoved("setEnabled"))return;this._collider?this._collider.setEnabled(Z):this._colliderDesc.setEnabled(Z)}setFriction(Z){if(!this._requireNotRemoved("setFriction"))return;this._collider?this._collider.setFriction(Z):this._colliderDesc.setFriction(Z)}setFrictionCombineRule(Z){if(!this._requireNotRemoved("setFrictionCombineRule"))return;this._collider?this._collider.setFrictionCombineRule(Z):this._colliderDesc.setFrictionCombineRule(Z)}setMass(Z){if(!this._requireNotRemoved("setMass"))return;this._collider?this._collider.setMass(Z):this._colliderDesc.setMass(Z)}setOnCollision(Z){if(!this._requireNotRemoved("setOnCollision"))return;if(this._onCollision=Z,this.isSimulated)if(this.enableCollisionEvents(!!Z),Z)this._simulation.colliderMap.setColliderCollisionCallback(this,Z);else this._simulation.colliderMap.removeColliderCollisionCallback(this)}setRelativeRotation(Z){if(!this._requireNotRemoved("setRelativeRotation"))return;this._relativeRotation=Z,this._collider?this._collider.parent()?this._collider.setRotationWrtParent(Z):this._collider.setRotation(Z):this._colliderDesc.setRotation(Z)}setRelativePosition(Z){if(!this._requireNotRemoved("setRelativePosition"))return;this._relativePosition=Z,this._collider?this._collider.parent()?this._collider.setTranslationWrtParent(Z):this._collider.setTranslation(Z):this._colliderDesc.setTranslation(Z.x,Z.y,Z.z)}setSensor(Z){if(!this._requireNotRemoved("setSensor"))return;this._collider?this._collider.setSensor(Z):this._colliderDesc.setSensor(Z)}setTag(Z){if(!this._requireNotRemoved("setTag"))return;this._tag=Z}setVoxel(Z,J){if(!this._requireNotRemoved("setVoxel"))return;if(!this._requireSimulated("setVoxel"))return;if(this.shape!=="voxels")return m.error("Collider.setVoxel(): Collider is not a voxels collider!");this._collider.setVoxel(Z.x,Z.y,Z.z,J)}addToSimulation(Z,J){if(!this._requireNotRemoved("addToSimulation"))return;if(!this._requireUnsimulated("addToSimulation"))return;if(J){if(!J.isSimulated)return m.error("Collider.addToSimulation(): Rigid body must be simulated before adding a collider to it!");if(J.type==="dynamic"&&this.shape==="trimesh")m.warning("Collider.addToSimulation(): Trimesh colliders are strongly discouraged to be used with dynamic rigid bodies, they will not contribute any mass!")}if(this._simulation=Z,this._parentRigidBody=J,this._collider=this._simulation.createRawCollider(this._colliderDesc,J?.rawRigidBody),this._colliderDesc=void 0,J)J.linkCollider(this);if(this._onCollision)this.setOnCollision(this._onCollision)}combineVoxelStates(Z){if(!this._requireNotRemoved("combineVoxelStates"))return;if(!this._requireSimulated("combineVoxelStates"))return;if(!Z.isSimulated)return m.error("Collider.combineVoxelStates(): Other collider is not simulated!");if(this.shape!=="voxels")return m.error("Collider.combineVoxelStates(): Collider is not a voxels collider!");if(Z.shape!=="voxels")return m.error("Collider.combineVoxelStates(): Other collider is not a voxels collider!");this._collider.combineVoxelStates(Z.rawCollider,0,0,0)}enableCollisionEvents(Z){if(!this._requireNotRemoved("enableCollisionEvents"))return;let J=this._collider?this._collider.activeEvents():this._colliderDesc.activeEvents,X=Z?J|J1.ActiveEvents.COLLISION_EVENTS:J&~J1.ActiveEvents.COLLISION_EVENTS;(this._collider??this._colliderDesc).setActiveEvents(X),this._setActiveCollisionTypes()}enableContactForceEvents(Z){if(!this._requireNotRemoved("enableContactForceEvents"))return;let J=this._collider?this._collider.activeEvents():this._colliderDesc.activeEvents,X=Z?J|J1.ActiveEvents.CONTACT_FORCE_EVENTS:J&~J1.ActiveEvents.CONTACT_FORCE_EVENTS;(this._collider??this._colliderDesc).setActiveEvents(X),this._setActiveCollisionTypes()}propagateVoxelChange(Z,J){if(!this._requireNotRemoved("propagateVoxelChange"))return;if(!this._requireSimulated("propagateVoxelChange"))return;if(!Z.isSimulated)return m.error("Collider.propagateVoxelChange(): Other collider is not simulated!");if(this.shape!=="voxels")return m.error("Collider.propagateVoxelChange(): Collider is not a voxels collider!");if(Z.shape!=="voxels")return m.error("Collider.propagateVoxelChange(): Other collider is not a voxels collider!");this._collider.propagateVoxelChange(Z.rawCollider,J.x,J.y,J.z,0,0,0)}removeFromSimulation(){if(!this._requireNotRemoved("removeFromSimulation"))return;if(!this._requireSimulated("removeFromSimulation"))return;if(this._simulation.removeRawCollider(this._collider),this._simulation=void 0,this._collider=void 0,this._parentRigidBody)this._parentRigidBody.unlinkCollider(this);this._parentRigidBody=void 0}scale(Z){if(!this._requireNotRemoved("scale"))return;switch(this.setRelativePosition({x:this.relativePosition.x*Z,y:this.relativePosition.y*Z,z:this.relativePosition.z*Z}),this._shape){case"ball":{if(this._collider)this._collider.setRadius(this._collider.radius()*Z);else this._colliderDesc.shape.radius*=Z;return}case"block":{if(this._collider){let J=this._collider.halfExtents();this._collider.setHalfExtents({x:J.x*Z,y:J.y*Z,z:J.z*Z})}else this._colliderDesc.shape.halfExtents.x*=Z,this._colliderDesc.shape.halfExtents.y*=Z,this._colliderDesc.shape.halfExtents.z*=Z;return}case"capsule":{if(this._collider)this._collider.setHalfHeight(this._collider.halfHeight()*Z),this._collider.setRadius(this._collider.radius()*Z);else this._colliderDesc.shape.halfHeight*=Z,this._colliderDesc.shape.radius*=Z;return}case"cone":{if(this._collider)this._collider.setHalfHeight(this._collider.halfHeight()*Z),this._collider.setRadius(this._collider.radius()*Z);else this._colliderDesc.shape.halfHeight*=Z,this._colliderDesc.shape.radius*=Z;return}case"cylinder":{if(this._collider)this._collider.setHalfHeight(this._collider.halfHeight()*Z),this._collider.setRadius(this._collider.radius()*Z);else this._colliderDesc.shape.halfHeight*=Z,this._colliderDesc.shape.radius*=Z;return}case"round-cylinder":{if(this._collider)this._collider.setHalfHeight(this._collider.halfHeight()*Z),this._collider.setRoundRadius(this._collider.roundRadius()*Z),this._collider.setRadius(this._collider.radius()*Z);else this._colliderDesc.shape.halfHeight=this._colliderDesc.shape.halfHeight*Z,this._colliderDesc.shape.borderRadius=this._colliderDesc.shape.borderRadius*Z,this._colliderDesc.shape.radius=this._colliderDesc.shape.radius*Z;return}case"trimesh":{m.error("Collider.setScale(): Trimesh colliders cannot be scaled!");return}case"voxels":{m.error("Collider.setScale(): Voxels colliders cannot be scaled!");return}case"wedge":{m.error("Collider.setScale(): Wedge colliders cannot be scaled!");return}default:m.fatalError(`Collider.setScale(): ${this._shape} is not a valid collider shape!`)}}_applyColliderOptions(Z){[["bounciness",this.setBounciness.bind(this)],["bouncinessCombineRule",this.setBouncinessCombineRule.bind(this)],["collisionGroups",this.setCollisionGroups.bind(this)],["enabled",this.setEnabled.bind(this)],["friction",this.setFriction.bind(this)],["frictionCombineRule",this.setFrictionCombineRule.bind(this)],["isSensor",this.setSensor.bind(this)],["mass",this.setMass.bind(this)],["onCollision",this.setOnCollision.bind(this)],["relativePosition",this.setRelativePosition.bind(this)],["relativeRotation",this.setRelativeRotation.bind(this)],["tag",this.setTag.bind(this)]].forEach(([X,Y])=>{if(Z[X]!==void 0)Y.call(this,Z[X])})}_autoAddToSimulation(Z){if(Z.simulation)this.addToSimulation(Z.simulation,Z.parentRigidBody)}_buildWedgeConvexHullVertices(Z){let{x:J,y:X,z:Y}=Z,$=J/2,Q=Y/2,W=X/2;return new Float32Array([-$,0-W,-Q,$,0-W,-Q,$,0-W,Q,-$,0-W,Q,-$,X-W,-Q,$,X-W,-Q])}_createColliderDesc(Z){let{shape:J,flags:X}=Z;switch(J){case"ball":{if(!Z.radius)m.fatalError("Ball collider must have a radius!");return J1.ColliderDesc.ball(Z.radius)}case"block":{if(!Z.halfExtents)m.fatalError("Block collider must have halfExtents!");return J1.ColliderDesc.cuboid(Z.halfExtents.x,Z.halfExtents.y,Z.halfExtents.z)}case"capsule":{if(!Z.halfHeight||!Z.radius)m.fatalError("Capsule collider must have halfHeight and radius!");return J1.ColliderDesc.capsule(Z.halfHeight,Z.radius)}case"cone":{if(!Z.radius||!Z.halfHeight)m.fatalError("Cone collider must have radius and halfHeight!");return J1.ColliderDesc.cone(Z.halfHeight,Z.radius)}case"cylinder":{if(!Z.radius||!Z.halfHeight)m.fatalError("Cylinder collider must have radius and halfHeight!");return J1.ColliderDesc.cylinder(Z.halfHeight,Z.radius)}case"round-cylinder":{if(!Z.radius||!Z.halfHeight||!Z.borderRadius)m.fatalError("Round cylinder collider must have radius, halfHeight, and borderRadius!");return J1.ColliderDesc.roundCylinder(Z.halfHeight,Z.radius,Z.borderRadius)}case"trimesh":{if(!Z.indices||!Z.vertices)m.fatalError("Trimesh collider must have vertices and indices!");return J1.ColliderDesc.trimesh(Z.vertices,Z.indices,X)}case"voxels":{if(!Z.coordinates||!Z.size)m.fatalError("Voxels collider must have coordinates and size!");return J1.ColliderDesc.voxels(this._coordinatesToInt32Array(Z.coordinates),Z.size)}case"wedge":{if(!Z.extents)m.fatalError("Wedge collider must have extents!");let Y=this._buildWedgeConvexHullVertices(Z.extents),$=J1.ColliderDesc.convexHull(Y);if(!$)throw m.fatalError("Failed to create convex hull for wedge collider!"),new Error("Convex hull creation failed");return $}default:m.fatalError(`Collider._createColliderDesc(): ${J} is not a valid collider shape!`)}}_requireSimulated(Z){if(!this.isSimulated)m.error(`Collider._requireSimulated(): Collider is not simulated, invoked method: ${Z}()`);return this.isSimulated}_requireUnsimulated(Z){if(this.isSimulated)m.error(`Collider._requireUnsimulated(): Collider is already simulated, invoked method: ${Z}()`);return!this.isSimulated}_requireNotRemoved(Z){if(this.isRemoved)m.error(`Collider._requireNotRemoved(): Collider is removed, invoked method: ${Z}()`);return!this.isRemoved}_setActiveCollisionTypes(){(this._collider??this._colliderDesc).setActiveCollisionTypes(J1.ActiveCollisionTypes.DYNAMIC_DYNAMIC|J1.ActiveCollisionTypes.DYNAMIC_KINEMATIC|J1.ActiveCollisionTypes.DYNAMIC_FIXED|J1.ActiveCollisionTypes.KINEMATIC_KINEMATIC|J1.ActiveCollisionTypes.KINEMATIC_FIXED)}_coordinatesToInt32Array(Z){let J=new Int32Array(Z.length*3);for(let X=0;X<Z.length;X++){let Y=Z[X],$=X*3;J[$]=Math.floor(Y.x),J[$+1]=Math.floor(Y.y),J[$+2]=Math.floor(Y.z)}return J}}var QO1={shape:"voxels"},SC;((X)=>{X.ENTITY_COLLISION="BLOCK_TYPE.ENTITY_COLLISION";X.ENTITY_CONTACT_FORCE="BLOCK_TYPE.ENTITY_CONTACT_FORCE"})(SC||={});class o5 extends w0{_id;_blockTypeRegistry;_customColliderOptions;_halfExtents;_isLiquid;_name;_textureUri;constructor(Z,J={id:-1,textureUri:"textures/missing.png",name:"Unknown"}){if(J.id<0)m.fatalError("BlockType.constructor(): BlockType id not set.");super();this._id=J.id,this._blockTypeRegistry=Z,this._customColliderOptions=J.customColliderOptions,this._halfExtents=J.halfExtents??{x:0.5,y:0.5,z:0.5},this._isLiquid=J.isLiquid??!1,this._name=J.name,this._textureUri=J.textureUri}get id(){return this._id}get blockTypeRegistry(){return this._blockTypeRegistry}get colliderOptions(){return{...this._customColliderOptions,...QO1}}get halfExtents(){return this._halfExtents}get isLiquid(){return this._isLiquid}get isMeshable(){return!this._customColliderOptions}get name(){return this._name}get size(){return{x:this._halfExtents.x*2,y:this._halfExtents.y*2,z:this._halfExtents.z*2}}get textureUri(){return this._textureUri}createCollider(Z){let J=new s5({...this.colliderOptions,coordinates:Z,size:this.size});if(this.isLiquid)J.setSensor(!0);if(this.hasListeners("BLOCK_TYPE.ENTITY_COLLISION")||this.isLiquid)J.enableCollisionEvents(!0);if(this.hasListeners("BLOCK_TYPE.ENTITY_CONTACT_FORCE"))J.enableContactForceEvents(!0);if(Y4.isDefaultCollisionGroups(J.collisionGroups))J.setCollisionGroups({belongsTo:[1],collidesWith:[65535&~1]});return J}serialize(){return j0.serializeBlockType(this,this._blockTypeRegistry.world.tickAllocator)}}var _C;((J)=>J.REGISTER_BLOCK_TYPE="BLOCK_TYPE_REGISTRY.REGISTER_BLOCK_TYPE")(_C||={});class IG extends w0{_blockTypes=new Map;_world;constructor(Z){super();this._world=Z}get world(){return this._world}getAllBlockTypes(Z=!1){return Z?this._world.tickAllocator.getArray(this._blockTypes.values()):Array.from(this._blockTypes.values())}getBlockType(Z){let J=this._blockTypes.get(Z);if(!J)m.fatalError(`BlockTypeRegistry.getBlockType(): BlockType with id ${Z} not found.`);return J}registerGenericBlockType(Z){let X=new class extends o5{constructor(Y,$){super(Y,$)}}(this,Z);return this.registerBlockType(X),X}registerBlockType(Z){this._blockTypes.set(Z.id,Z),this.emitWithWorld(this._world,"BLOCK_TYPE_REGISTRY.REGISTER_BLOCK_TYPE",{blockTypeRegistry:this,id:Z.id,blockType:Z})}serialize(){return j0.serializeBlockTypeRegistry(this,this._world.tickAllocator)}}var Hk={};p4(Hk,{worldSchema:()=>Gk,worldPacketDefinition:()=>Ke,vectorSchema:()=>W1,vectorBooleanSchema:()=>YT1,uiSchema:()=>Wk,uiPacketDefinition:()=>Qe,uiDatasSchema:()=>Kk,uiDatasPacketDefinition:()=>We,uiDataSendPacketDefinition:()=>lt,uiDataSchema:()=>eG,syncResponseSchema:()=>Qk,syncResponsePacketDefinition:()=>$e,syncRequestSchema:()=>AT,syncRequestPacketDefinition:()=>ct,stateRequestSchema:()=>_T,stateRequestPacketDefinition:()=>dt,sceneUIsSchema:()=>$k,sceneUIsPacketDefinition:()=>Ye,sceneUISchema:()=>Yk,rgbColorSchema:()=>v6,registeredPackets:()=>kL,quaternionSchema:()=>pT,playersSchema:()=>Xk,playersPacketDefinition:()=>Xe,playerSchema:()=>Jk,physicsDebugRenderSchema:()=>Zk,physicsDebugRenderPacketDefinition:()=>Ze,physicsDebugRaycastsSchema:()=>eT,physicsDebugRaycastsPacketDefinition:()=>Je,physicsDebugRaycastSchema:()=>tT,particleEmittersSchema:()=>rT,particleEmittersPacketDefinition:()=>et,particleEmitterSchema:()=>oT,outboundPackets:()=>TL,modelNodeOverrideSchema:()=>lT,lightsSchema:()=>sT,lightsPacketDefinition:()=>tt,lightSchema:()=>aT,isValidPacket:()=>QT1,inputSchema:()=>ST,inputPacketDefinition:()=>ut,inboundPackets:()=>CL,hexColorSchema:()=>IT,heartbeatSchema:()=>ET,heartbeatPacketDefinition:()=>yt,entitySchema:()=>iT,entitiesSchema:()=>nT,entitiesPacketDefinition:()=>rt,definePacket:()=>T0,debugConfigSchema:()=>vT,debugConfigPacketDefinition:()=>mt,createPacket:()=>nC1,connectionSchema:()=>kT,connectionPacketDefinition:()=>bt,chunksSchema:()=>cT,chunksPacketDefinition:()=>ot,chunkSchema:()=>dT,chatMessagesSchema:()=>uT,chatMessagesPacketDefinition:()=>st,chatMessageSendPacketDefinition:()=>gt,chatMessageSchema:()=>tG,cameraSchema:()=>mT,cameraPacketDefinition:()=>at,blocksSchema:()=>bT,blocksPacketDefinition:()=>it,blockTypesSchema:()=>gT,blockTypesPacketDefinition:()=>nt,blockTypeSchema:()=>yT,blockSchema:()=>fT,bidirectionalPackets:()=>PL,audiosSchema:()=>hT,audiosPacketDefinition:()=>pt,audioSchema:()=>xT,PacketId:()=>S1});var PL={};p4(PL,{heartbeatPacketDefinition:()=>yt,connectionPacketDefinition:()=>bt});var CT=t(ht(),1);class TT extends CT.default{static instance=new CT.default}var S1;((T)=>{T[T.SYNC_REQUEST=0]="SYNC_REQUEST";T[T.INPUT=1]="INPUT";T[T.STATE_REQUEST=2]="STATE_REQUEST";T[T.CHAT_MESSAGE_SEND=3]="CHAT_MESSAGE_SEND";T[T.UI_DATA_SEND=4]="UI_DATA_SEND";T[T.SYNC_RESPONSE=32]="SYNC_RESPONSE";T[T.AUDIOS=33]="AUDIOS";T[T.BLOCKS=34]="BLOCKS";T[T.BLOCK_TYPES=35]="BLOCK_TYPES";T[T.CHAT_MESSAGES=36]="CHAT_MESSAGES";T[T.CHUNKS=37]="CHUNKS";T[T.ENTITIES=38]="ENTITIES";T[T.WORLD=39]="WORLD";T[T.CAMERA=40]="CAMERA";T[T.UI=41]="UI";T[T.UI_DATAS=42]="UI_DATAS";T[T.SCENE_UIS=43]="SCENE_UIS";T[T.LIGHTS=44]="LIGHTS";T[T.PLAYERS=45]="PLAYERS";T[T.PARTICLE_EMITTERS=46]="PARTICLE_EMITTERS";T[T.CONNECTION=116]="CONNECTION";T[T.HEARTBEAT=117]="HEARTBEAT";T[T.DEBUG_CONFIG=128]="DEBUG_CONFIG";T[T.PHYSICS_DEBUG_RENDER=192]="PHYSICS_DEBUG_RENDER";T[T.PHYSICS_DEBUG_RAYCASTS=193]="PHYSICS_DEBUG_RAYCASTS"})(S1||={});function nC1(Z,J,X,Y){if(!Z.validate(J))throw new Error(`Invalid payload for packet with id ${Z.id}. Error: ${TT.instance.errorsText(Z.validate.errors)}`);let $=Y??[];if($[0]=Z.id,$[1]=J,typeof X==="number")$.push(X);return $}function T0(Z,J){return{id:Z,schema:J,validate:TT.instance.compile(J)}}var aC1={type:"object",properties:{i:{type:"string"}},required:["i"],additionalProperties:!1},ft={type:"object",properties:{role:{type:"string",enum:["auto","client","server"],nullable:!0},fingerprints:{type:"array",items:{type:"object",properties:{algorithm:{type:"string",enum:["sha-1","sha-224","sha-256","sha-384","sha-512"]},value:{type:"string"}},required:["algorithm","value"]}}},required:["fingerprints"],additionalProperties:!1},sC1={type:"object",properties:{foundation:{type:"string"},priority:{type:"number"},ip:{type:"string"},address:{type:"string"},protocol:{type:"string",enum:["udp","tcp"]},port:{type:"number"},type:{type:"string",enum:["host"]},tcpType:{type:"string",enum:["passive"],nullable:!0}},required:["foundation","priority","ip","address","protocol","port","type"],additionalProperties:!1},oC1={type:"object",properties:{usernameFragment:{type:"string"},password:{type:"string"},iceLite:{type:"boolean",nullable:!0}},required:["usernameFragment","password"],additionalProperties:!1},rC1={type:"object",properties:{i:{type:"string"},l:{type:"string"}},required:["i","l"],additionalProperties:!1},tC1={type:"object",properties:{port:{type:"number"},OS:{type:"number"},MIS:{type:"number"},maxMessageSize:{type:"number"}},required:["port","OS","MIS","maxMessageSize"],additionalProperties:!0},eC1={type:"object",properties:{streamId:{type:"number"},ordered:{type:"boolean",nullable:!0},maxPacketLifeTime:{type:"number",nullable:!0},maxRetransmits:{type:"number",nullable:!0}},required:["streamId"],additionalProperties:!1},ZT1={type:"object",properties:{i:{type:"string"},f:{type:"string",enum:["cs","sc"]},ip:oC1,ic:{type:"array",items:sC1},d:ft,s:tC1},required:["i","f","ip","ic","d","s"],additionalProperties:!1},JT1={type:"object",properties:{i:{type:"string"},d:ft},required:["i","d"],additionalProperties:!1},XT1={type:"object",properties:{i:{type:"string",nullable:!0},pi:{type:"string",nullable:!0},l:{type:"string"},s:eC1},required:["l","s"],additionalProperties:!1},kT={type:"object",properties:{i:{type:"string",nullable:!0},k:{type:"boolean",nullable:!0},c:{...JT1,nullable:!0},ca:{...aC1,nullable:!0},d:{type:"array",items:{...XT1},nullable:!0},pa:{...rC1,nullable:!0},t:{type:"array",items:{...ZT1},nullable:!0}},additionalProperties:!1};var bt=T0(116,kT);var ET={type:"null",nullable:!0};var yt=T0(117,ET);var CL={};p4(CL,{uiDataSendPacketDefinition:()=>lt,syncRequestPacketDefinition:()=>ct,stateRequestPacketDefinition:()=>dt,inputPacketDefinition:()=>ut,debugConfigPacketDefinition:()=>mt,chatMessageSendPacketDefinition:()=>gt});var IT={type:"string",pattern:"^[0-9A-Fa-f]{6}$"};var tG={type:"object",properties:{m:{type:"string"},c:{...IT,nullable:!0},p:{type:"string",nullable:!0}},required:["m"],additionalProperties:!1};var gt=T0(3,tG);var vT={type:"object",properties:{pdr:{type:"boolean",nullable:!0}},additionalProperties:!1};var mt=T0(128,vT);var ST={type:"object",properties:{"1":{type:"boolean",nullable:!0},"2":{type:"boolean",nullable:!0},"3":{type:"boolean",nullable:!0},"4":{type:"boolean",nullable:!0},"5":{type:"boolean",nullable:!0},"6":{type:"boolean",nullable:!0},"7":{type:"boolean",nullable:!0},"8":{type:"boolean",nullable:!0},"9":{type:"boolean",nullable:!0},"0":{type:"boolean",nullable:!0},w:{type:"boolean",nullable:!0},a:{type:"boolean",nullable:!0},s:{type:"boolean",nullable:!0},d:{type:"boolean",nullable:!0},q:{type:"boolean",nullable:!0},e:{type:"boolean",nullable:!0},r:{type:"boolean",nullable:!0},f:{type:"boolean",nullable:!0},z:{type:"boolean",nullable:!0},x:{type:"boolean",nullable:!0},c:{type:"boolean",nullable:!0},v:{type:"boolean",nullable:!0},u:{type:"boolean",nullable:!0},i:{type:"boolean",nullable:!0},o:{type:"boolean",nullable:!0},j:{type:"boolean",nullable:!0},k:{type:"boolean",nullable:!0},l:{type:"boolean",nullable:!0},n:{type:"boolean",nullable:!0},m:{type:"boolean",nullable:!0},sp:{type:"boolean",nullable:!0},sh:{type:"boolean",nullable:!0},tb:{type:"boolean",nullable:!0},ml:{type:"boolean",nullable:!0},mr:{type:"boolean",nullable:!0},cp:{type:"number",nullable:!0},cy:{type:"number",nullable:!0},sq:{type:"number",nullable:!0}},additionalProperties:!1};var ut=T0(1,ST);var _T={type:"object",properties:{},additionalProperties:!1};var dt=T0(2,_T);var AT={type:"null",nullable:!0};var ct=T0(0,AT);var eG={type:"object",properties:{},additionalProperties:!0};var lt=T0(4,eG);var TL={};p4(TL,{worldPacketDefinition:()=>Ke,uiPacketDefinition:()=>Qe,uiDatasPacketDefinition:()=>We,syncResponsePacketDefinition:()=>$e,sceneUIsPacketDefinition:()=>Ye,playersPacketDefinition:()=>Xe,physicsDebugRenderPacketDefinition:()=>Ze,physicsDebugRaycastsPacketDefinition:()=>Je,particleEmittersPacketDefinition:()=>et,lightsPacketDefinition:()=>tt,entitiesPacketDefinition:()=>rt,chunksPacketDefinition:()=>ot,chatMessagesPacketDefinition:()=>st,cameraPacketDefinition:()=>at,blocksPacketDefinition:()=>it,blockTypesPacketDefinition:()=>nt,audiosPacketDefinition:()=>pt});var W1={type:"array",items:[{type:"number"},{type:"number"},{type:"number"}],minItems:3,maxItems:3};var xT={type:"object",properties:{i:{type:"number"},a:{type:"string",nullable:!0},cd:{type:"number",nullable:!0},d:{type:"number",nullable:!0},de:{type:"number",nullable:!0},di:{type:"number",minimum:0,nullable:!0},e:{type:"number",nullable:!0},l:{type:"boolean",nullable:!0},o:{type:"number",nullable:!0},p:{...W1,nullable:!0},pa:{type:"boolean",nullable:!0},pl:{type:"boolean",nullable:!0},pr:{type:"number",minimum:0,nullable:!0},r:{type:"boolean",nullable:!0},rd:{type:"number",nullable:!0},s:{type:"number",nullable:!0},v:{type:"number",minimum:0,maximum:1,nullable:!0}},required:["i"],additionalProperties:!1};var hT={type:"array",items:{...xT}};var pt=T0(33,hT);var fT={type:"object",properties:{i:{type:"number"},c:W1},required:["i","c"],additionalProperties:!1};var bT={type:"array",items:{...fT}};var it=T0(34,bT);var yT={type:"object",properties:{i:{type:"number"},l:{type:"boolean",nullable:!0},n:{type:"string",nullable:!0},t:{type:"string",nullable:!0}},required:["i"],additionalProperties:!1};var gT={type:"array",items:{...yT}};var nt=T0(35,gT);var mT={type:"object",properties:{m:{type:"number",nullable:!0},e:{type:"number",nullable:!0},et:{type:"number",nullable:!0},fo:{type:"number",nullable:!0},ffo:{type:"number",nullable:!0},fv:{type:"number",nullable:!0},h:{type:"array",items:{type:"string"},nullable:!0},o:{...W1,nullable:!0},p:{...W1,nullable:!0},pt:{...W1,nullable:!0},pl:{...W1,nullable:!0},s:{type:"array",items:{type:"string"},nullable:!0},sa:{type:"number",nullable:!0},z:{type:"number",nullable:!0}},additionalProperties:!1};var uT={type:"array",items:{...tG}};var dT={type:"object",properties:{c:W1,b:{type:"array",items:{type:"number",minimum:0,maximum:255},minItems:4096,maxItems:4096,nullable:!0},rm:{type:"boolean",nullable:!0}},required:["c"],additionalProperties:!1};var cT={type:"array",items:{...dT}};var v6={type:"array",items:[{type:"number",minimum:0,maximum:255},{type:"number",minimum:0,maximum:255},{type:"number",minimum:0,maximum:255}],minItems:3,maxItems:3};var lT={type:"object",properties:{n:{type:"string"},h:{type:"boolean",nullable:!0},o:{type:"number",minimum:0,maximum:1,nullable:!0},r:{type:"boolean",nullable:!0},s:{type:"number",nullable:!0},t:{...v6,nullable:!0}},required:["n"],additionalProperties:!1};var pT={type:"array",items:[{type:"number"},{type:"number"},{type:"number"},{type:"number"}],minItems:4,maxItems:4};var iT={type:"object",properties:{i:{type:"number"},al:{type:"array",items:{type:"string"},nullable:!0},ao:{type:"array",items:{type:"string"},nullable:!0},ap:{type:"number",nullable:!0},as:{type:"array",items:{type:"string"},nullable:!0},bh:{...W1,nullable:!0},bt:{type:"string",nullable:!0},h:{type:"array",items:{type:"string"},nullable:!0},m:{type:"string",nullable:!0},mo:{type:"array",items:{...lT},nullable:!0},mt:{type:"string",nullable:!0},n:{type:"string",nullable:!0},o:{type:"number",nullable:!0},p:{...W1,nullable:!0},pe:{type:"number",nullable:!0},pn:{type:"string",nullable:!0},r:{...pT,nullable:!0},rm:{type:"boolean",nullable:!0},s:{type:"number",nullable:!0},sn:{type:"array",items:{type:"string"},nullable:!0},t:{...v6,nullable:!0}},required:["i"],additionalProperties:!1};var nT={type:"array",items:{...iT}};var aT={type:"object",properties:{i:{type:"number"},a:{type:"number",nullable:!0},e:{type:"number",nullable:!0},c:{...v6,nullable:!0},d:{type:"number",nullable:!0},n:{type:"number",nullable:!0},o:{...W1,nullable:!0},p:{...W1,nullable:!0},pe:{type:"number",minimum:0,maximum:1,nullable:!0},rm:{type:"boolean",nullable:!0},t:{type:"number",nullable:!0},te:{type:"number",nullable:!0},tp:{...W1,nullable:!0}},required:["i"],additionalProperties:!1};var sT={type:"array",items:{...aT}};var oT={type:"object",properties:{i:{type:"number"},at:{type:"number",nullable:!0},ce:{...v6,nullable:!0},cev:{...v6,nullable:!0},cs:{...v6,nullable:!0},csv:{...v6,nullable:!0},e:{type:"number",nullable:!0},en:{type:"string",nullable:!0},g:{...W1,nullable:!0},l:{type:"number",nullable:!0},lv:{type:"number",nullable:!0},mp:{type:"number",nullable:!0},o:{...W1,nullable:!0},oe:{type:"number",nullable:!0},oev:{type:"number",nullable:!0},os:{type:"number",nullable:!0},osv:{type:"number",nullable:!0},p:{...W1,nullable:!0},pa:{type:"boolean",nullable:!0},pv:{...W1,nullable:!0},r:{type:"number",nullable:!0},rv:{type:"number",nullable:!0},rm:{type:"boolean",nullable:!0},se:{type:"number",nullable:!0},sev:{type:"number",nullable:!0},ss:{type:"number",nullable:!0},ssv:{type:"number",nullable:!0},t:{type:"boolean",nullable:!0},tu:{type:"string",nullable:!0},v:{...W1,nullable:!0},vv:{...W1,nullable:!0}},required:["i"],additionalProperties:!1};var rT={type:"array",items:{...oT}};var tT={type:"object",properties:{o:{...W1},d:{...W1},l:{type:"number"},h:{type:"boolean"}},required:["o","d","l","h"],additionalProperties:!1};var eT={type:"array",items:{...tT}};var Zk={type:"object",properties:{v:{type:"array",items:{type:"number"}},c:{type:"array",items:{type:"number"}}},required:["v","c"],additionalProperties:!1};var Jk={type:"object",properties:{i:{type:"string"},p:{type:"string",nullable:!0},rm:{type:"boolean",nullable:!0},u:{type:"string",nullable:!0}},required:["i"],additionalProperties:!1};var Xk={type:"array",items:{...Jk}};var Yk={type:"object",properties:{i:{type:"number"},e:{type:"number",nullable:!0},o:{...W1,nullable:!0},p:{...W1,nullable:!0},rm:{type:"boolean",nullable:!0},s:{type:"object",nullable:!0},t:{type:"string",nullable:!0},v:{type:"number",nullable:!0}},required:["i"],additionalProperties:!1};var $k={type:"array",items:{...Yk}};var Qk={type:"object",properties:{r:{type:"number"},s:{type:"number"},p:{type:"number"},n:{type:"number"}},required:["r","s","p","n"],additionalProperties:!1};var Wk={type:"object",properties:{p:{type:"boolean",nullable:!0},u:{type:"string",nullable:!0}},additionalProperties:!1};var Kk={type:"array",items:{...eG}};var YT1={type:"array",items:[{type:"boolean"},{type:"boolean"},{type:"boolean"}],minItems:3,maxItems:3};var Gk={type:"object",properties:{i:{type:"number"},ac:{...v6,nullable:!0},ai:{type:"number",nullable:!0},dc:{...v6,nullable:!0},di:{type:"number",nullable:!0},dp:{...W1,nullable:!0},fc:{...v6,nullable:!0},ff:{type:"number",nullable:!0},fn:{type:"number",nullable:!0},n:{type:"string",nullable:!0},s:{type:"string",nullable:!0},si:{type:"number",nullable:!0},t:{type:"number",nullable:!0}},required:["i"],additionalProperties:!1};var at=T0(40,mT);var st=T0(36,uT);var ot=T0(37,cT);var rt=T0(38,nT);var tt=T0(44,sT);var et=T0(46,rT);var Ze=T0(192,Zk);var Je=T0(193,eT);var Xe=T0(45,Xk);var Ye=T0(43,$k);var $e=T0(32,Qk);var Qe=T0(41,Wk);var We=T0(42,Kk);var Ke=T0(39,Gk);var kL=new Map,$T1={...PL,...CL,...TL};for(let Z of Object.values($T1))if("id"in Z&&"schema"in Z){let J=Z;if(kL.has(J.id))throw new Error(`Packet with id ${J.id} is already registered.`);kL.set(J.id,J)}function QT1(Z){if(typeof Z!=="object"||Z===null||typeof Z[0]!=="number"||Z[0]<0||Z[1]===void 0||Z[2]!==void 0&&(typeof Z[2]!=="number"||Z[2]<0))return!1;let J=kL.get(Z[0]);return!!J&&J.validate(Z[1])}var Z0=Hk;var _e=t(ve(),1);import IY from"fs";import Se from"path";var JH="./dev/persistence";class F7{static instance=new F7;gameId=process.env.HYTOPIA_GAME_ID;lobbyId=process.env.HYTOPIA_LOBBY_ID;_creativeGateway;constructor(){try{this._creativeGateway=new _e.CreativeGateway}catch{console.warn(["\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501","\uD83D\uDEA8 HYTOPIA PLATFORM GATEWAY IS NOT INITIALIZED \uD83D\uDEA8","","\uD83D\uDD27 Local development is still possible, but these features will be disabled:"," \u2022 \uD83D\uDC64 Player Accounts"," \u2022 \uD83C\uDFAD Player Cosmetics"," \u2022 \uD83D\uDC1B Crash Analytics & Debug Logs","","\uD83D\uDCA1 These features will be enabled but modified:"," \u2022 \uD83D\uDCBE Player & Global Persisted Data - Data will be persisted"," locally in the ./dev/persistence directory of your project."," Player ids for data persistence will begin at 1 for the first "," player to join your local server, and increments for each"," additional player. This means that if you restart your"," server, the first player id will be 1 again. This is to ensure"," that data persistence across server restarts can be easily"," tested and debugged in local development.","","To enable the HYTOPIA Platform Gateway locally:"," 1. Set these environment variables:"," HYTOPIA_API_KEY, HYTOPIA_GAME_ID, HYTOPIA_LOBBY_ID"," 2. You can find these values at: https://create.hytopia.com","","Note: In production, these environment variables will be auto-populated ","& the HYTOPIA Platform Gateway will automatically be initialized \uD83D\uDE80","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",""].join(`
|
|
406
|
+
>>> no match, partial?`,Z,q,J,V),q===K)return!0}return!1}let U;if(typeof H==="string")U=z===H,this.debug("string match",H,z,U);else U=H.test(z),this.debug("pattern match",H,z,U);if(!U)return!1}if(Q===K&&W===G)return!0;else if(Q===K)return X;else if(W===G)return Q===K-1&&Z[Q]==="";else throw new Error("wtf?")}braceExpand(){return cd(this.pattern,this.options)}parse(Z){b3(Z);let J=this.options;if(Z==="**")return L6;if(Z==="")return"";let X,Y=null;if(X=Z.match(mH1))Y=J.dot?dH1:uH1;else if(X=Z.match(vH1))Y=(J.nocase?J.dot?xH1:AH1:J.dot?_H1:SH1)(X[1]);else if(X=Z.match(cH1))Y=(J.nocase?J.dot?pH1:lH1:J.dot?iH1:nH1)(X);else if(X=Z.match(hH1))Y=J.dot?bH1:fH1;else if(X=Z.match(yH1))Y=gH1;let $=U6.fromGlob(Z,this.options).toMMPattern();if(Y&&typeof $==="object")Reflect.defineProperty($,"test",{value:Y});return $}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let Z=this.set;if(!Z.length)return this.regexp=!1,this.regexp;let J=this.options,X=J.noglobstar?oH1:J.dot?rH1:tH1,Y=new Set(J.nocase?["i"]:[]),$=Z.map((K)=>{let G=K.map((H)=>{if(H instanceof RegExp)for(let z of H.flags.split(""))Y.add(z);return typeof H==="string"?Yz1(H):H===L6?L6:H._src});return G.forEach((H,z)=>{let q=G[z+1],V=G[z-1];if(H!==L6||V===L6)return;if(V===void 0)if(q!==void 0&&q!==L6)G[z+1]="(?:\\/|"+X+"\\/)?"+q;else G[z]=X;else if(q===void 0)G[z-1]=V+"(?:\\/|"+X+")?";else if(q!==L6)G[z-1]=V+"(?:\\/|\\/"+X+"\\/)"+q,G[z+1]=L6}),G.filter((H)=>H!==L6).join("/")}).join("|"),[Q,W]=Z.length>1?["(?:",")"]:["",""];if($="^"+Q+$+W+"$",this.negate)$="^(?!"+$+").+$";try{this.regexp=new RegExp($,[...Y].join(""))}catch(K){this.regexp=!1}return this.regexp}slashSplit(Z){if(this.preserveMultipleSlashes)return Z.split("/");else if(this.isWindows&&/^\/\/[^\/]+/.test(Z))return["",...Z.split(/\/+/)];else return Z.split(/\/+/)}match(Z,J=this.partial){if(this.debug("match",Z,this.pattern),this.comment)return!1;if(this.empty)return Z==="";if(Z==="/"&&J)return!0;let X=this.options;if(this.isWindows)Z=Z.split("\\").join("/");let Y=this.slashSplit(Z);this.debug(this.pattern,"split",Y);let $=this.set;this.debug(this.pattern,"set",$);let Q=Y[Y.length-1];if(!Q)for(let W=Y.length-2;!Q&&W>=0;W--)Q=Y[W];for(let W=0;W<$.length;W++){let K=$[W],G=Y;if(X.matchBase&&K.length===1)G=[Q];if(this.matchOne(G,K,J)){if(X.flipNegate)return!0;return!this.negate}}if(X.flipNegate)return!1;return this.negate}static defaults(Z){return m6.defaults(Z).Minimatch}}m6.AST=U6;m6.Minimatch=O9;m6.escape=MQ;m6.unescape=K4;import{fileURLToPath as hz1}from"url";var RQ=typeof performance==="object"&&performance&&typeof performance.now==="function"?performance:Date,pd=new Set,JD=typeof process==="object"&&!!process?process:{},id=(Z,J,X,Y)=>{typeof JD.emitWarning==="function"?JD.emitWarning(Z,J,X,Y):console.error(`[${X}] ${J}: ${Z}`)},UU=globalThis.AbortController,ld=globalThis.AbortSignal;if(typeof UU==="undefined"){ld=class X{onabort;_onabort=[];reason;aborted=!1;addEventListener(Y,$){this._onabort.push($)}},UU=class X{constructor(){J()}signal=new ld;abort(Y){if(this.signal.aborted)return;this.signal.reason=Y,this.signal.aborted=!0;for(let $ of this.signal._onabort)$(Y);this.signal.onabort?.(Y)}};let Z=JD.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",J=()=>{if(!Z)return;Z=!1,id("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",J)}}var $z1=(Z)=>!pd.has(Z),r36=Symbol("type"),KJ=(Z)=>Z&&Z===Math.floor(Z)&&Z>0&&isFinite(Z),nd=(Z)=>!KJ(Z)?null:Z<=Math.pow(2,8)?Uint8Array:Z<=Math.pow(2,16)?Uint16Array:Z<=Math.pow(2,32)?Uint32Array:Z<=Number.MAX_SAFE_INTEGER?g3:null;class g3 extends Array{constructor(Z){super(Z);this.fill(0)}}class NQ{heap;length;static#Z=!1;static create(Z){let J=nd(Z);if(!J)return[];NQ.#Z=!0;let X=new NQ(Z,J);return NQ.#Z=!1,X}constructor(Z,J){if(!NQ.#Z)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new J(Z),this.length=0}push(Z){this.heap[this.length++]=Z}pop(){return this.heap[--this.length]}}class m3{#Z;#J;#Y;#X;#$;#z;#V;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#K;#G;#H;#q;#Q;#U;#w;#L;#O;#k;#j;#E;#N;#R;#M;#C;#B;#v;static unsafeExposeInternals(Z){return{starts:Z.#N,ttls:Z.#R,sizes:Z.#E,keyMap:Z.#H,keyList:Z.#q,valList:Z.#Q,next:Z.#U,prev:Z.#w,get head(){return Z.#L},get tail(){return Z.#O},free:Z.#k,isBackgroundFetch:(J)=>Z.#F(J),backgroundFetch:(J,X,Y,$)=>Z.#h(J,X,Y,$),moveToTail:(J)=>Z.#y(J),indexes:(J)=>Z.#T(J),rindexes:(J)=>Z.#I(J),isStale:(J)=>Z.#P(J)}}get max(){return this.#Z}get maxSize(){return this.#J}get calculatedSize(){return this.#G}get size(){return this.#K}get fetchMethod(){return this.#z}get memoMethod(){return this.#V}get dispose(){return this.#Y}get onInsert(){return this.#X}get disposeAfter(){return this.#$}constructor(Z){let{max:J=0,ttl:X,ttlResolution:Y=1,ttlAutopurge:$,updateAgeOnGet:Q,updateAgeOnHas:W,allowStale:K,dispose:G,onInsert:H,disposeAfter:z,noDisposeOnSet:q,noUpdateTTL:V,maxSize:F=0,maxEntrySize:U=0,sizeCalculation:w,fetchMethod:L,memoMethod:O,noDeleteOnFetchRejection:N,noDeleteOnStaleGet:M,allowStaleOnFetchRejection:j,allowStaleOnFetchAbort:P,ignoreFetchAbort:D}=Z;if(J!==0&&!KJ(J))throw new TypeError("max option must be a nonnegative integer");let C=J?nd(J):Array;if(!C)throw new Error("invalid max value: "+J);if(this.#Z=J,this.#J=F,this.maxEntrySize=U||this.#J,this.sizeCalculation=w,this.sizeCalculation){if(!this.#J&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!=="function")throw new TypeError("sizeCalculation set to non-function")}if(O!==void 0&&typeof O!=="function")throw new TypeError("memoMethod must be a function if defined");if(this.#V=O,L!==void 0&&typeof L!=="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#z=L,this.#C=!!L,this.#H=new Map,this.#q=new Array(J).fill(void 0),this.#Q=new Array(J).fill(void 0),this.#U=new C(J),this.#w=new C(J),this.#L=0,this.#O=0,this.#k=NQ.create(J),this.#K=0,this.#G=0,typeof G==="function")this.#Y=G;if(typeof H==="function")this.#X=H;if(typeof z==="function")this.#$=z,this.#j=[];else this.#$=void 0,this.#j=void 0;if(this.#M=!!this.#Y,this.#v=!!this.#X,this.#B=!!this.#$,this.noDisposeOnSet=!!q,this.noUpdateTTL=!!V,this.noDeleteOnFetchRejection=!!N,this.allowStaleOnFetchRejection=!!j,this.allowStaleOnFetchAbort=!!P,this.ignoreFetchAbort=!!D,this.maxEntrySize!==0){if(this.#J!==0){if(!KJ(this.#J))throw new TypeError("maxSize must be a positive integer if specified")}if(!KJ(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#m()}if(this.allowStale=!!K,this.noDeleteOnStaleGet=!!M,this.updateAgeOnGet=!!Q,this.updateAgeOnHas=!!W,this.ttlResolution=KJ(Y)||Y===0?Y:1,this.ttlAutopurge=!!$,this.ttl=X||0,this.ttl){if(!KJ(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#W()}if(this.#Z===0&&this.ttl===0&&this.#J===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#Z&&!this.#J){if($z1("LRU_CACHE_UNBOUNDED"))pd.add("LRU_CACHE_UNBOUNDED"),id("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning","LRU_CACHE_UNBOUNDED",m3)}}getRemainingTTL(Z){return this.#H.has(Z)?1/0:0}#W(){let Z=new g3(this.#Z),J=new g3(this.#Z);this.#R=Z,this.#N=J,this.#S=($,Q,W=RQ.now())=>{if(J[$]=Q!==0?W:0,Z[$]=Q,Q!==0&&this.ttlAutopurge){let K=setTimeout(()=>{if(this.#P($))this.#_(this.#q[$],"expire")},Q+1);if(K.unref)K.unref()}},this.#A=($)=>{J[$]=Z[$]!==0?RQ.now():0},this.#D=($,Q)=>{if(Z[Q]){let W=Z[Q],K=J[Q];if(!W||!K)return;$.ttl=W,$.start=K,$.now=X||Y();let G=$.now-K;$.remainingTTL=W-G}};let X=0,Y=()=>{let $=RQ.now();if(this.ttlResolution>0){X=$;let Q=setTimeout(()=>X=0,this.ttlResolution);if(Q.unref)Q.unref()}return $};this.getRemainingTTL=($)=>{let Q=this.#H.get($);if(Q===void 0)return 0;let W=Z[Q],K=J[Q];if(!W||!K)return 1/0;let G=(X||Y())-K;return W-G},this.#P=($)=>{let Q=J[$],W=Z[$];return!!W&&!!Q&&(X||Y())-Q>W}}#A=()=>{};#D=()=>{};#S=()=>{};#P=()=>!1;#m(){let Z=new g3(this.#Z);this.#G=0,this.#E=Z,this.#x=(J)=>{this.#G-=Z[J],Z[J]=0},this.#u=(J,X,Y,$)=>{if(this.#F(X))return 0;if(!KJ(Y))if($){if(typeof $!=="function")throw new TypeError("sizeCalculation must be a function");if(Y=$(X,J),!KJ(Y))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return Y},this.#f=(J,X,Y)=>{if(Z[J]=X,this.#J){let $=this.#J-Z[J];while(this.#G>$)this.#b(!0)}if(this.#G+=Z[J],Y)Y.entrySize=X,Y.totalCalculatedSize=this.#G}}#x=(Z)=>{};#f=(Z,J,X)=>{};#u=(Z,J,X,Y)=>{if(X||Y)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#T({allowStale:Z=this.allowStale}={}){if(this.#K)for(let J=this.#O;;){if(!this.#d(J))break;if(Z||!this.#P(J))yield J;if(J===this.#L)break;else J=this.#w[J]}}*#I({allowStale:Z=this.allowStale}={}){if(this.#K)for(let J=this.#L;;){if(!this.#d(J))break;if(Z||!this.#P(J))yield J;if(J===this.#O)break;else J=this.#U[J]}}#d(Z){return Z!==void 0&&this.#H.get(this.#q[Z])===Z}*entries(){for(let Z of this.#T())if(this.#Q[Z]!==void 0&&this.#q[Z]!==void 0&&!this.#F(this.#Q[Z]))yield[this.#q[Z],this.#Q[Z]]}*rentries(){for(let Z of this.#I())if(this.#Q[Z]!==void 0&&this.#q[Z]!==void 0&&!this.#F(this.#Q[Z]))yield[this.#q[Z],this.#Q[Z]]}*keys(){for(let Z of this.#T()){let J=this.#q[Z];if(J!==void 0&&!this.#F(this.#Q[Z]))yield J}}*rkeys(){for(let Z of this.#I()){let J=this.#q[Z];if(J!==void 0&&!this.#F(this.#Q[Z]))yield J}}*values(){for(let Z of this.#T())if(this.#Q[Z]!==void 0&&!this.#F(this.#Q[Z]))yield this.#Q[Z]}*rvalues(){for(let Z of this.#I())if(this.#Q[Z]!==void 0&&!this.#F(this.#Q[Z]))yield this.#Q[Z]}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(Z,J={}){for(let X of this.#T()){let Y=this.#Q[X],$=this.#F(Y)?Y.__staleWhileFetching:Y;if($===void 0)continue;if(Z($,this.#q[X],this))return this.get(this.#q[X],J)}}forEach(Z,J=this){for(let X of this.#T()){let Y=this.#Q[X],$=this.#F(Y)?Y.__staleWhileFetching:Y;if($===void 0)continue;Z.call(J,$,this.#q[X],this)}}rforEach(Z,J=this){for(let X of this.#I()){let Y=this.#Q[X],$=this.#F(Y)?Y.__staleWhileFetching:Y;if($===void 0)continue;Z.call(J,$,this.#q[X],this)}}purgeStale(){let Z=!1;for(let J of this.#I({allowStale:!0}))if(this.#P(J))this.#_(this.#q[J],"expire"),Z=!0;return Z}info(Z){let J=this.#H.get(Z);if(J===void 0)return;let X=this.#Q[J],Y=this.#F(X)?X.__staleWhileFetching:X;if(Y===void 0)return;let $={value:Y};if(this.#R&&this.#N){let Q=this.#R[J],W=this.#N[J];if(Q&&W){let K=Q-(RQ.now()-W);$.ttl=K,$.start=Date.now()}}if(this.#E)$.size=this.#E[J];return $}dump(){let Z=[];for(let J of this.#T({allowStale:!0})){let X=this.#q[J],Y=this.#Q[J],$=this.#F(Y)?Y.__staleWhileFetching:Y;if($===void 0||X===void 0)continue;let Q={value:$};if(this.#R&&this.#N){Q.ttl=this.#R[J];let W=RQ.now()-this.#N[J];Q.start=Math.floor(Date.now()-W)}if(this.#E)Q.size=this.#E[J];Z.unshift([X,Q])}return Z}load(Z){this.clear();for(let[J,X]of Z){if(X.start){let Y=Date.now()-X.start;X.start=RQ.now()-Y}this.set(J,X.value,X)}}set(Z,J,X={}){if(J===void 0)return this.delete(Z),this;let{ttl:Y=this.ttl,start:$,noDisposeOnSet:Q=this.noDisposeOnSet,sizeCalculation:W=this.sizeCalculation,status:K}=X,{noUpdateTTL:G=this.noUpdateTTL}=X,H=this.#u(Z,J,X.size||0,W);if(this.maxEntrySize&&H>this.maxEntrySize){if(K)K.set="miss",K.maxEntrySizeExceeded=!0;return this.#_(Z,"set"),this}let z=this.#K===0?void 0:this.#H.get(Z);if(z===void 0){if(z=this.#K===0?this.#O:this.#k.length!==0?this.#k.pop():this.#K===this.#Z?this.#b(!1):this.#K,this.#q[z]=Z,this.#Q[z]=J,this.#H.set(Z,z),this.#U[this.#O]=z,this.#w[z]=this.#O,this.#O=z,this.#K++,this.#f(z,H,K),K)K.set="add";if(G=!1,this.#v)this.#X?.(J,Z,"add")}else{this.#y(z);let q=this.#Q[z];if(J!==q){if(this.#C&&this.#F(q)){q.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:V}=q;if(V!==void 0&&!Q){if(this.#M)this.#Y?.(V,Z,"set");if(this.#B)this.#j?.push([V,Z,"set"])}}else if(!Q){if(this.#M)this.#Y?.(q,Z,"set");if(this.#B)this.#j?.push([q,Z,"set"])}if(this.#x(z),this.#f(z,H,K),this.#Q[z]=J,K){K.set="replace";let V=q&&this.#F(q)?q.__staleWhileFetching:q;if(V!==void 0)K.oldValue=V}}else if(K)K.set="update";if(this.#v)this.onInsert?.(J,Z,J===q?"update":"replace")}if(Y!==0&&!this.#R)this.#W();if(this.#R){if(!G)this.#S(z,Y,$);if(K)this.#D(K,z)}if(!Q&&this.#B&&this.#j){let q=this.#j,V;while(V=q?.shift())this.#$?.(...V)}return this}pop(){try{while(this.#K){let Z=this.#Q[this.#L];if(this.#b(!0),this.#F(Z)){if(Z.__staleWhileFetching)return Z.__staleWhileFetching}else if(Z!==void 0)return Z}}finally{if(this.#B&&this.#j){let Z=this.#j,J;while(J=Z?.shift())this.#$?.(...J)}}}#b(Z){let J=this.#L,X=this.#q[J],Y=this.#Q[J];if(this.#C&&this.#F(Y))Y.__abortController.abort(new Error("evicted"));else if(this.#M||this.#B){if(this.#M)this.#Y?.(Y,X,"evict");if(this.#B)this.#j?.push([Y,X,"evict"])}if(this.#x(J),Z)this.#q[J]=void 0,this.#Q[J]=void 0,this.#k.push(J);if(this.#K===1)this.#L=this.#O=0,this.#k.length=0;else this.#L=this.#U[J];return this.#H.delete(X),this.#K--,J}has(Z,J={}){let{updateAgeOnHas:X=this.updateAgeOnHas,status:Y}=J,$=this.#H.get(Z);if($!==void 0){let Q=this.#Q[$];if(this.#F(Q)&&Q.__staleWhileFetching===void 0)return!1;if(!this.#P($)){if(X)this.#A($);if(Y)Y.has="hit",this.#D(Y,$);return!0}else if(Y)Y.has="stale",this.#D(Y,$)}else if(Y)Y.has="miss";return!1}peek(Z,J={}){let{allowStale:X=this.allowStale}=J,Y=this.#H.get(Z);if(Y===void 0||!X&&this.#P(Y))return;let $=this.#Q[Y];return this.#F($)?$.__staleWhileFetching:$}#h(Z,J,X,Y){let $=J===void 0?void 0:this.#Q[J];if(this.#F($))return $;let Q=new UU,{signal:W}=X;W?.addEventListener("abort",()=>Q.abort(W.reason),{signal:Q.signal});let K={signal:Q.signal,options:X,context:Y},G=(U,w=!1)=>{let{aborted:L}=Q.signal,O=X.ignoreFetchAbort&&U!==void 0;if(X.status)if(L&&!w){if(X.status.fetchAborted=!0,X.status.fetchError=Q.signal.reason,O)X.status.fetchAbortIgnored=!0}else X.status.fetchResolved=!0;if(L&&!O&&!w)return z(Q.signal.reason);let N=V;if(this.#Q[J]===V)if(U===void 0)if(N.__staleWhileFetching)this.#Q[J]=N.__staleWhileFetching;else this.#_(Z,"fetch");else{if(X.status)X.status.fetchUpdated=!0;this.set(Z,U,K.options)}return U},H=(U)=>{if(X.status)X.status.fetchRejected=!0,X.status.fetchError=U;return z(U)},z=(U)=>{let{aborted:w}=Q.signal,L=w&&X.allowStaleOnFetchAbort,O=L||X.allowStaleOnFetchRejection,N=O||X.noDeleteOnFetchRejection,M=V;if(this.#Q[J]===V){if(!N||M.__staleWhileFetching===void 0)this.#_(Z,"fetch");else if(!L)this.#Q[J]=M.__staleWhileFetching}if(O){if(X.status&&M.__staleWhileFetching!==void 0)X.status.returnedStale=!0;return M.__staleWhileFetching}else if(M.__returned===M)throw U},q=(U,w)=>{let L=this.#z?.(Z,$,K);if(L&&L instanceof Promise)L.then((O)=>U(O===void 0?void 0:O),w);Q.signal.addEventListener("abort",()=>{if(!X.ignoreFetchAbort||X.allowStaleOnFetchAbort){if(U(void 0),X.allowStaleOnFetchAbort)U=(O)=>G(O,!0)}})};if(X.status)X.status.fetchDispatched=!0;let V=new Promise(q).then(G,H),F=Object.assign(V,{__abortController:Q,__staleWhileFetching:$,__returned:void 0});if(J===void 0)this.set(Z,F,{...K.options,status:void 0}),J=this.#H.get(Z);else this.#Q[J]=F;return F}#F(Z){if(!this.#C)return!1;let J=Z;return!!J&&J instanceof Promise&&J.hasOwnProperty("__staleWhileFetching")&&J.__abortController instanceof UU}async fetch(Z,J={}){let{allowStale:X=this.allowStale,updateAgeOnGet:Y=this.updateAgeOnGet,noDeleteOnStaleGet:$=this.noDeleteOnStaleGet,ttl:Q=this.ttl,noDisposeOnSet:W=this.noDisposeOnSet,size:K=0,sizeCalculation:G=this.sizeCalculation,noUpdateTTL:H=this.noUpdateTTL,noDeleteOnFetchRejection:z=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:q=this.allowStaleOnFetchRejection,ignoreFetchAbort:V=this.ignoreFetchAbort,allowStaleOnFetchAbort:F=this.allowStaleOnFetchAbort,context:U,forceRefresh:w=!1,status:L,signal:O}=J;if(!this.#C){if(L)L.fetch="get";return this.get(Z,{allowStale:X,updateAgeOnGet:Y,noDeleteOnStaleGet:$,status:L})}let N={allowStale:X,updateAgeOnGet:Y,noDeleteOnStaleGet:$,ttl:Q,noDisposeOnSet:W,size:K,sizeCalculation:G,noUpdateTTL:H,noDeleteOnFetchRejection:z,allowStaleOnFetchRejection:q,allowStaleOnFetchAbort:F,ignoreFetchAbort:V,status:L,signal:O},M=this.#H.get(Z);if(M===void 0){if(L)L.fetch="miss";let j=this.#h(Z,M,N,U);return j.__returned=j}else{let j=this.#Q[M];if(this.#F(j)){let T=X&&j.__staleWhileFetching!==void 0;if(L){if(L.fetch="inflight",T)L.returnedStale=!0}return T?j.__staleWhileFetching:j.__returned=j}let P=this.#P(M);if(!w&&!P){if(L)L.fetch="hit";if(this.#y(M),Y)this.#A(M);if(L)this.#D(L,M);return j}let D=this.#h(Z,M,N,U),k=D.__staleWhileFetching!==void 0&&X;if(L){if(L.fetch=P?"stale":"refresh",k&&P)L.returnedStale=!0}return k?D.__staleWhileFetching:D.__returned=D}}async forceFetch(Z,J={}){let X=await this.fetch(Z,J);if(X===void 0)throw new Error("fetch() returned undefined");return X}memo(Z,J={}){let X=this.#V;if(!X)throw new Error("no memoMethod provided to constructor");let{context:Y,forceRefresh:$,...Q}=J,W=this.get(Z,Q);if(!$&&W!==void 0)return W;let K=X(Z,W,{options:Q,context:Y});return this.set(Z,K,Q),K}get(Z,J={}){let{allowStale:X=this.allowStale,updateAgeOnGet:Y=this.updateAgeOnGet,noDeleteOnStaleGet:$=this.noDeleteOnStaleGet,status:Q}=J,W=this.#H.get(Z);if(W!==void 0){let K=this.#Q[W],G=this.#F(K);if(Q)this.#D(Q,W);if(this.#P(W)){if(Q)Q.get="stale";if(!G){if(!$)this.#_(Z,"expire");if(Q&&X)Q.returnedStale=!0;return X?K:void 0}else{if(Q&&X&&K.__staleWhileFetching!==void 0)Q.returnedStale=!0;return X?K.__staleWhileFetching:void 0}}else{if(Q)Q.get="hit";if(G)return K.__staleWhileFetching;if(this.#y(W),Y)this.#A(W);return K}}else if(Q)Q.get="miss"}#c(Z,J){this.#w[J]=Z,this.#U[Z]=J}#y(Z){if(Z!==this.#O){if(Z===this.#L)this.#L=this.#U[Z];else this.#c(this.#w[Z],this.#U[Z]);this.#c(this.#O,Z),this.#O=Z}}delete(Z){return this.#_(Z,"delete")}#_(Z,J){let X=!1;if(this.#K!==0){let Y=this.#H.get(Z);if(Y!==void 0)if(X=!0,this.#K===1)this.#g(J);else{this.#x(Y);let $=this.#Q[Y];if(this.#F($))$.__abortController.abort(new Error("deleted"));else if(this.#M||this.#B){if(this.#M)this.#Y?.($,Z,J);if(this.#B)this.#j?.push([$,Z,J])}if(this.#H.delete(Z),this.#q[Y]=void 0,this.#Q[Y]=void 0,Y===this.#O)this.#O=this.#w[Y];else if(Y===this.#L)this.#L=this.#U[Y];else{let Q=this.#w[Y];this.#U[Q]=this.#U[Y];let W=this.#U[Y];this.#w[W]=this.#w[Y]}this.#K--,this.#k.push(Y)}}if(this.#B&&this.#j?.length){let Y=this.#j,$;while($=Y?.shift())this.#$?.(...$)}return X}clear(){return this.#g("delete")}#g(Z){for(let J of this.#I({allowStale:!0})){let X=this.#Q[J];if(this.#F(X))X.__abortController.abort(new Error("deleted"));else{let Y=this.#q[J];if(this.#M)this.#Y?.(X,Y,Z);if(this.#B)this.#j?.push([X,Y,Z])}}if(this.#H.clear(),this.#Q.fill(void 0),this.#q.fill(void 0),this.#R&&this.#N)this.#R.fill(0),this.#N.fill(0);if(this.#E)this.#E.fill(0);if(this.#L=0,this.#O=0,this.#k.length=0,this.#G=0,this.#K=0,this.#B&&this.#j){let J=this.#j,X;while(X=J?.shift())this.#$?.(...X)}}}import{posix as Lz1,win32 as qD}from"path";import{fileURLToPath as wz1}from"url";import{lstatSync as Bz1,readdir as Oz1,readdirSync as jz1,readlinkSync as Mz1,realpathSync as Rz1}from"fs";import*as Nz1 from"fs";import{lstat as Pz1,readdir as Cz1,readlink as Tz1,realpath as kz1}from"fs/promises";import{EventEmitter as KD}from"events";import td from"stream";import{StringDecoder as Qz1}from"string_decoder";var ad=typeof process==="object"&&process?process:{stdout:null,stderr:null},Wz1=(Z)=>!!Z&&typeof Z==="object"&&(Z instanceof sX||Z instanceof td||Kz1(Z)||Gz1(Z)),Kz1=(Z)=>!!Z&&typeof Z==="object"&&Z instanceof KD&&typeof Z.pipe==="function"&&Z.pipe!==td.Writable.prototype.pipe,Gz1=(Z)=>!!Z&&typeof Z==="object"&&Z instanceof KD&&typeof Z.write==="function"&&typeof Z.end==="function",WZ=Symbol("EOF"),KZ=Symbol("maybeEmitEnd"),GJ=Symbol("emittedEnd"),LU=Symbol("emittingEnd"),u3=Symbol("emittedError"),wU=Symbol("closed"),sd=Symbol("read"),BU=Symbol("flush"),od=Symbol("flushChunk"),G4=Symbol("encoding"),DQ=Symbol("decoder"),r8=Symbol("flowing"),d3=Symbol("paused"),PQ=Symbol("resume"),t8=Symbol("buffer"),u6=Symbol("pipes"),e8=Symbol("bufferLength"),XD=Symbol("bufferPush"),OU=Symbol("bufferShift"),D6=Symbol("objectMode"),j8=Symbol("destroyed"),YD=Symbol("error"),$D=Symbol("emitData"),rd=Symbol("emitEnd"),QD=Symbol("emitEnd2"),t4=Symbol("async"),WD=Symbol("abort"),jU=Symbol("aborted"),c3=Symbol("signal"),aX=Symbol("dataListeners"),d5=Symbol("discarded"),l3=(Z)=>Promise.resolve().then(Z),Hz1=(Z)=>Z(),zz1=(Z)=>Z==="end"||Z==="finish"||Z==="prefinish",qz1=(Z)=>Z instanceof ArrayBuffer||!!Z&&typeof Z==="object"&&Z.constructor&&Z.constructor.name==="ArrayBuffer"&&Z.byteLength>=0,Vz1=(Z)=>!Buffer.isBuffer(Z)&&ArrayBuffer.isView(Z);class GD{src;dest;opts;ondrain;constructor(Z,J,X){this.src=Z,this.dest=J,this.opts=X,this.ondrain=()=>Z[PQ](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(Z){}end(){if(this.unpipe(),this.opts.end)this.dest.end()}}class ed extends GD{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(Z,J,X){super(Z,J,X);this.proxyErrors=(Y)=>J.emit("error",Y),Z.on("error",this.proxyErrors)}}var Fz1=(Z)=>!!Z.objectMode,Uz1=(Z)=>!Z.objectMode&&!!Z.encoding&&Z.encoding!=="buffer";class sX extends KD{[r8]=!1;[d3]=!1;[u6]=[];[t8]=[];[D6];[G4];[t4];[DQ];[WZ]=!1;[GJ]=!1;[LU]=!1;[wU]=!1;[u3]=null;[e8]=0;[j8]=!1;[c3];[jU]=!1;[aX]=0;[d5]=!1;writable=!0;readable=!0;constructor(...Z){let J=Z[0]||{};super();if(J.objectMode&&typeof J.encoding==="string")throw new TypeError("Encoding and objectMode may not be used together");if(Fz1(J))this[D6]=!0,this[G4]=null;else if(Uz1(J))this[G4]=J.encoding,this[D6]=!1;else this[D6]=!1,this[G4]=null;if(this[t4]=!!J.async,this[DQ]=this[G4]?new Qz1(this[G4]):null,J&&J.debugExposeBuffer===!0)Object.defineProperty(this,"buffer",{get:()=>this[t8]});if(J&&J.debugExposePipes===!0)Object.defineProperty(this,"pipes",{get:()=>this[u6]});let{signal:X}=J;if(X)if(this[c3]=X,X.aborted)this[WD]();else X.addEventListener("abort",()=>this[WD]())}get bufferLength(){return this[e8]}get encoding(){return this[G4]}set encoding(Z){throw new Error("Encoding must be set at instantiation time")}setEncoding(Z){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[D6]}set objectMode(Z){throw new Error("objectMode must be set at instantiation time")}get["async"](){return this[t4]}set["async"](Z){this[t4]=this[t4]||!!Z}[WD](){this[jU]=!0,this.emit("abort",this[c3]?.reason),this.destroy(this[c3]?.reason)}get aborted(){return this[jU]}set aborted(Z){}write(Z,J,X){if(this[jU])return!1;if(this[WZ])throw new Error("write after end");if(this[j8])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;if(typeof J==="function")X=J,J="utf8";if(!J)J="utf8";let Y=this[t4]?l3:Hz1;if(!this[D6]&&!Buffer.isBuffer(Z)){if(Vz1(Z))Z=Buffer.from(Z.buffer,Z.byteOffset,Z.byteLength);else if(qz1(Z))Z=Buffer.from(Z);else if(typeof Z!=="string")throw new Error("Non-contiguous data written to non-objectMode stream")}if(this[D6]){if(this[r8]&&this[e8]!==0)this[BU](!0);if(this[r8])this.emit("data",Z);else this[XD](Z);if(this[e8]!==0)this.emit("readable");if(X)Y(X);return this[r8]}if(!Z.length){if(this[e8]!==0)this.emit("readable");if(X)Y(X);return this[r8]}if(typeof Z==="string"&&!(J===this[G4]&&!this[DQ]?.lastNeed))Z=Buffer.from(Z,J);if(Buffer.isBuffer(Z)&&this[G4])Z=this[DQ].write(Z);if(this[r8]&&this[e8]!==0)this[BU](!0);if(this[r8])this.emit("data",Z);else this[XD](Z);if(this[e8]!==0)this.emit("readable");if(X)Y(X);return this[r8]}read(Z){if(this[j8])return null;if(this[d5]=!1,this[e8]===0||Z===0||Z&&Z>this[e8])return this[KZ](),null;if(this[D6])Z=null;if(this[t8].length>1&&!this[D6])this[t8]=[this[G4]?this[t8].join(""):Buffer.concat(this[t8],this[e8])];let J=this[sd](Z||null,this[t8][0]);return this[KZ](),J}[sd](Z,J){if(this[D6])this[OU]();else{let X=J;if(Z===X.length||Z===null)this[OU]();else if(typeof X==="string")this[t8][0]=X.slice(Z),J=X.slice(0,Z),this[e8]-=Z;else this[t8][0]=X.subarray(Z),J=X.subarray(0,Z),this[e8]-=Z}if(this.emit("data",J),!this[t8].length&&!this[WZ])this.emit("drain");return J}end(Z,J,X){if(typeof Z==="function")X=Z,Z=void 0;if(typeof J==="function")X=J,J="utf8";if(Z!==void 0)this.write(Z,J);if(X)this.once("end",X);if(this[WZ]=!0,this.writable=!1,this[r8]||!this[d3])this[KZ]();return this}[PQ](){if(this[j8])return;if(!this[aX]&&!this[u6].length)this[d5]=!0;if(this[d3]=!1,this[r8]=!0,this.emit("resume"),this[t8].length)this[BU]();else if(this[WZ])this[KZ]();else this.emit("drain")}resume(){return this[PQ]()}pause(){this[r8]=!1,this[d3]=!0,this[d5]=!1}get destroyed(){return this[j8]}get flowing(){return this[r8]}get paused(){return this[d3]}[XD](Z){if(this[D6])this[e8]+=1;else this[e8]+=Z.length;this[t8].push(Z)}[OU](){if(this[D6])this[e8]-=1;else this[e8]-=this[t8][0].length;return this[t8].shift()}[BU](Z=!1){do;while(this[od](this[OU]())&&this[t8].length);if(!Z&&!this[t8].length&&!this[WZ])this.emit("drain")}[od](Z){return this.emit("data",Z),this[r8]}pipe(Z,J){if(this[j8])return Z;this[d5]=!1;let X=this[GJ];if(J=J||{},Z===ad.stdout||Z===ad.stderr)J.end=!1;else J.end=J.end!==!1;if(J.proxyErrors=!!J.proxyErrors,X){if(J.end)Z.end()}else if(this[u6].push(!J.proxyErrors?new GD(this,Z,J):new ed(this,Z,J)),this[t4])l3(()=>this[PQ]());else this[PQ]();return Z}unpipe(Z){let J=this[u6].find((X)=>X.dest===Z);if(J){if(this[u6].length===1){if(this[r8]&&this[aX]===0)this[r8]=!1;this[u6]=[]}else this[u6].splice(this[u6].indexOf(J),1);J.unpipe()}}addListener(Z,J){return this.on(Z,J)}on(Z,J){let X=super.on(Z,J);if(Z==="data"){if(this[d5]=!1,this[aX]++,!this[u6].length&&!this[r8])this[PQ]()}else if(Z==="readable"&&this[e8]!==0)super.emit("readable");else if(zz1(Z)&&this[GJ])super.emit(Z),this.removeAllListeners(Z);else if(Z==="error"&&this[u3]){let Y=J;if(this[t4])l3(()=>Y.call(this,this[u3]));else Y.call(this,this[u3])}return X}removeListener(Z,J){return this.off(Z,J)}off(Z,J){let X=super.off(Z,J);if(Z==="data"){if(this[aX]=this.listeners("data").length,this[aX]===0&&!this[d5]&&!this[u6].length)this[r8]=!1}return X}removeAllListeners(Z){let J=super.removeAllListeners(Z);if(Z==="data"||Z===void 0){if(this[aX]=0,!this[d5]&&!this[u6].length)this[r8]=!1}return J}get emittedEnd(){return this[GJ]}[KZ](){if(!this[LU]&&!this[GJ]&&!this[j8]&&this[t8].length===0&&this[WZ]){if(this[LU]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[wU])this.emit("close");this[LU]=!1}}emit(Z,...J){let X=J[0];if(Z!=="error"&&Z!=="close"&&Z!==j8&&this[j8])return!1;else if(Z==="data")return!this[D6]&&!X?!1:this[t4]?(l3(()=>this[$D](X)),!0):this[$D](X);else if(Z==="end")return this[rd]();else if(Z==="close"){if(this[wU]=!0,!this[GJ]&&!this[j8])return!1;let $=super.emit("close");return this.removeAllListeners("close"),$}else if(Z==="error"){this[u3]=X,super.emit(YD,X);let $=!this[c3]||this.listeners("error").length?super.emit("error",X):!1;return this[KZ](),$}else if(Z==="resume"){let $=super.emit("resume");return this[KZ](),$}else if(Z==="finish"||Z==="prefinish"){let $=super.emit(Z);return this.removeAllListeners(Z),$}let Y=super.emit(Z,...J);return this[KZ](),Y}[$D](Z){for(let X of this[u6])if(X.dest.write(Z)===!1)this.pause();let J=this[d5]?!1:super.emit("data",Z);return this[KZ](),J}[rd](){if(this[GJ])return!1;return this[GJ]=!0,this.readable=!1,this[t4]?(l3(()=>this[QD]()),!0):this[QD]()}[QD](){if(this[DQ]){let J=this[DQ].end();if(J){for(let X of this[u6])X.dest.write(J);if(!this[d5])super.emit("data",J)}}for(let J of this[u6])J.end();let Z=super.emit("end");return this.removeAllListeners("end"),Z}async collect(){let Z=Object.assign([],{dataLength:0});if(!this[D6])Z.dataLength=0;let J=this.promise();return this.on("data",(X)=>{if(Z.push(X),!this[D6])Z.dataLength+=X.length}),await J,Z}async concat(){if(this[D6])throw new Error("cannot concat in objectMode");let Z=await this.collect();return this[G4]?Z.join(""):Buffer.concat(Z,Z.dataLength)}async promise(){return new Promise((Z,J)=>{this.on(j8,()=>J(new Error("stream destroyed"))),this.on("error",(X)=>J(X)),this.on("end",()=>Z())})}[Symbol.asyncIterator](){this[d5]=!1;let Z=!1,J=async()=>{return this.pause(),Z=!0,{value:void 0,done:!0}};return{next:()=>{if(Z)return J();let Y=this.read();if(Y!==null)return Promise.resolve({done:!1,value:Y});if(this[WZ])return J();let $,Q,W=(z)=>{this.off("data",K),this.off("end",G),this.off(j8,H),J(),Q(z)},K=(z)=>{this.off("error",W),this.off("end",G),this.off(j8,H),this.pause(),$({value:z,done:!!this[WZ]})},G=()=>{this.off("error",W),this.off("data",K),this.off(j8,H),J(),$({done:!0,value:void 0})},H=()=>W(new Error("stream destroyed"));return new Promise((z,q)=>{Q=q,$=z,this.once(j8,H),this.once("error",W),this.once("end",G),this.once("data",K)})},throw:J,return:J,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[d5]=!1;let Z=!1,J=()=>{return this.pause(),this.off(YD,J),this.off(j8,J),this.off("end",J),Z=!0,{done:!0,value:void 0}},X=()=>{if(Z)return J();let Y=this.read();return Y===null?J():{done:!1,value:Y}};return this.once("end",J),this.once(YD,J),this.once(j8,J),{next:X,throw:J,return:J,[Symbol.iterator](){return this}}}destroy(Z){if(this[j8]){if(Z)this.emit("error",Z);else this.emit(j8);return this}this[j8]=!0,this[d5]=!0,this[t8].length=0,this[e8]=0;let J=this;if(typeof J.close==="function"&&!this[wU])J.close();if(Z)this.emit("error",Z);else this.emit(j8);return this}static get isStream(){return Wz1}}var Dz1=Rz1.native,i3={lstatSync:Bz1,readdir:Oz1,readdirSync:jz1,readlinkSync:Mz1,realpathSync:Dz1,promises:{lstat:Pz1,readdir:Cz1,readlink:Tz1,realpath:kz1}},$c=(Z)=>!Z||Z===i3||Z===Nz1?i3:{...i3,...Z,promises:{...i3.promises,...Z.promises||{}}},Qc=/^\\\\\?\\([a-z]:)\\?$/i,Ez1=(Z)=>Z.replace(/\//g,"\\").replace(Qc,"$1\\"),Iz1=/[\\\/]/,M9=0,Wc=1,Kc=2,e4=4,Gc=6,Hc=8,oX=10,zc=12,j9=15,p3=~j9,HD=16,Zc=32,n3=64,H4=128,MU=256,NU=512,Jc=n3|H4|NU,vz1=1023,zD=(Z)=>Z.isFile()?Hc:Z.isDirectory()?e4:Z.isSymbolicLink()?oX:Z.isCharacterDevice()?Kc:Z.isBlockDevice()?Gc:Z.isSocket()?zc:Z.isFIFO()?Wc:M9,Xc=new Map,a3=(Z)=>{let J=Xc.get(Z);if(J)return J;let X=Z.normalize("NFKD");return Xc.set(Z,X),X},Yc=new Map,RU=(Z)=>{let J=Yc.get(Z);if(J)return J;let X=a3(Z.toLowerCase());return Yc.set(Z,X),X};class VD extends m3{constructor(){super({max:256})}}class qc extends m3{constructor(Z=16384){super({maxSize:Z,sizeCalculation:(J)=>J.length+1})}}var Vc=Symbol("PathScurry setAsCwd");class d6{name;root;roots;parent;nocase;isCWD=!1;#Z;#J;get dev(){return this.#J}#Y;get mode(){return this.#Y}#X;get nlink(){return this.#X}#$;get uid(){return this.#$}#z;get gid(){return this.#z}#V;get rdev(){return this.#V}#K;get blksize(){return this.#K}#G;get ino(){return this.#G}#H;get size(){return this.#H}#q;get blocks(){return this.#q}#Q;get atimeMs(){return this.#Q}#U;get mtimeMs(){return this.#U}#w;get ctimeMs(){return this.#w}#L;get birthtimeMs(){return this.#L}#O;get atime(){return this.#O}#k;get mtime(){return this.#k}#j;get ctime(){return this.#j}#E;get birthtime(){return this.#E}#N;#R;#M;#C;#B;#v;#W;#A;#D;#S;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(Z,J=M9,X,Y,$,Q,W){if(this.name=Z,this.#N=$?RU(Z):a3(Z),this.#W=J&vz1,this.nocase=$,this.roots=Y,this.root=X||this,this.#A=Q,this.#M=W.fullpath,this.#B=W.relative,this.#v=W.relativePosix,this.parent=W.parent,this.parent)this.#Z=this.parent.#Z;else this.#Z=$c(W.fs)}depth(){if(this.#R!==void 0)return this.#R;if(!this.parent)return this.#R=0;return this.#R=this.parent.depth()+1}childrenCache(){return this.#A}resolve(Z){if(!Z)return this;let J=this.getRootString(Z),Y=Z.substring(J.length).split(this.splitSep);return J?this.getRoot(J).#P(Y):this.#P(Y)}#P(Z){let J=this;for(let X of Z)J=J.child(X);return J}children(){let Z=this.#A.get(this);if(Z)return Z;let J=Object.assign([],{provisional:0});return this.#A.set(this,J),this.#W&=~HD,J}child(Z,J){if(Z===""||Z===".")return this;if(Z==="..")return this.parent||this;let X=this.children(),Y=this.nocase?RU(Z):a3(Z);for(let K of X)if(K.#N===Y)return K;let $=this.parent?this.sep:"",Q=this.#M?this.#M+$+Z:void 0,W=this.newChild(Z,M9,{...J,parent:this,fullpath:Q});if(!this.canReaddir())W.#W|=H4;return X.push(W),W}relative(){if(this.isCWD)return"";if(this.#B!==void 0)return this.#B;let Z=this.name,J=this.parent;if(!J)return this.#B=this.name;let X=J.relative();return X+(!X||!J.parent?"":this.sep)+Z}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#v!==void 0)return this.#v;let Z=this.name,J=this.parent;if(!J)return this.#v=this.fullpathPosix();let X=J.relativePosix();return X+(!X||!J.parent?"":"/")+Z}fullpath(){if(this.#M!==void 0)return this.#M;let Z=this.name,J=this.parent;if(!J)return this.#M=this.name;let Y=J.fullpath()+(!J.parent?"":this.sep)+Z;return this.#M=Y}fullpathPosix(){if(this.#C!==void 0)return this.#C;if(this.sep==="/")return this.#C=this.fullpath();if(!this.parent){let Y=this.fullpath().replace(/\\/g,"/");if(/^[a-z]:\//i.test(Y))return this.#C=`//?/${Y}`;else return this.#C=Y}let Z=this.parent,J=Z.fullpathPosix(),X=J+(!J||!Z.parent?"":"/")+this.name;return this.#C=X}isUnknown(){return(this.#W&j9)===M9}isType(Z){return this[`is${Z}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#W&j9)===Hc}isDirectory(){return(this.#W&j9)===e4}isCharacterDevice(){return(this.#W&j9)===Kc}isBlockDevice(){return(this.#W&j9)===Gc}isFIFO(){return(this.#W&j9)===Wc}isSocket(){return(this.#W&j9)===zc}isSymbolicLink(){return(this.#W&oX)===oX}lstatCached(){return this.#W&Zc?this:void 0}readlinkCached(){return this.#D}realpathCached(){return this.#S}readdirCached(){let Z=this.children();return Z.slice(0,Z.provisional)}canReadlink(){if(this.#D)return!0;if(!this.parent)return!1;let Z=this.#W&j9;return!(Z!==M9&&Z!==oX||this.#W&MU||this.#W&H4)}calledReaddir(){return!!(this.#W&HD)}isENOENT(){return!!(this.#W&H4)}isNamed(Z){return!this.nocase?this.#N===a3(Z):this.#N===RU(Z)}async readlink(){let Z=this.#D;if(Z)return Z;if(!this.canReadlink())return;if(!this.parent)return;try{let J=await this.#Z.promises.readlink(this.fullpath()),X=(await this.parent.realpath())?.resolve(J);if(X)return this.#D=X}catch(J){this.#b(J.code);return}}readlinkSync(){let Z=this.#D;if(Z)return Z;if(!this.canReadlink())return;if(!this.parent)return;try{let J=this.#Z.readlinkSync(this.fullpath()),X=this.parent.realpathSync()?.resolve(J);if(X)return this.#D=X}catch(J){this.#b(J.code);return}}#m(Z){this.#W|=HD;for(let J=Z.provisional;J<Z.length;J++){let X=Z[J];if(X)X.#x()}}#x(){if(this.#W&H4)return;this.#W=(this.#W|H4)&p3,this.#f()}#f(){let Z=this.children();Z.provisional=0;for(let J of Z)J.#x()}#u(){this.#W|=NU,this.#T()}#T(){if(this.#W&n3)return;let Z=this.#W;if((Z&j9)===e4)Z&=p3;this.#W=Z|n3,this.#f()}#I(Z=""){if(Z==="ENOTDIR"||Z==="EPERM")this.#T();else if(Z==="ENOENT")this.#x();else this.children().provisional=0}#d(Z=""){if(Z==="ENOTDIR")this.parent.#T();else if(Z==="ENOENT")this.#x()}#b(Z=""){let J=this.#W;if(J|=MU,Z==="ENOENT")J|=H4;if(Z==="EINVAL"||Z==="UNKNOWN")J&=p3;if(this.#W=J,Z==="ENOTDIR"&&this.parent)this.parent.#T()}#h(Z,J){return this.#c(Z,J)||this.#F(Z,J)}#F(Z,J){let X=zD(Z),Y=this.newChild(Z.name,X,{parent:this}),$=Y.#W&j9;if($!==e4&&$!==oX&&$!==M9)Y.#W|=n3;return J.unshift(Y),J.provisional++,Y}#c(Z,J){for(let X=J.provisional;X<J.length;X++){let Y=J[X];if((this.nocase?RU(Z.name):a3(Z.name))!==Y.#N)continue;return this.#y(Z,Y,X,J)}}#y(Z,J,X,Y){let $=J.name;if(J.#W=J.#W&p3|zD(Z),$!==Z.name)J.name=Z.name;if(X!==Y.provisional){if(X===Y.length-1)Y.pop();else Y.splice(X,1);Y.unshift(J)}return Y.provisional++,J}async lstat(){if((this.#W&H4)===0)try{return this.#_(await this.#Z.promises.lstat(this.fullpath())),this}catch(Z){this.#d(Z.code)}}lstatSync(){if((this.#W&H4)===0)try{return this.#_(this.#Z.lstatSync(this.fullpath())),this}catch(Z){this.#d(Z.code)}}#_(Z){let{atime:J,atimeMs:X,birthtime:Y,birthtimeMs:$,blksize:Q,blocks:W,ctime:K,ctimeMs:G,dev:H,gid:z,ino:q,mode:V,mtime:F,mtimeMs:U,nlink:w,rdev:L,size:O,uid:N}=Z;this.#O=J,this.#Q=X,this.#E=Y,this.#L=$,this.#K=Q,this.#q=W,this.#j=K,this.#w=G,this.#J=H,this.#z=z,this.#G=q,this.#Y=V,this.#k=F,this.#U=U,this.#X=w,this.#V=L,this.#H=O,this.#$=N;let M=zD(Z);if(this.#W=this.#W&p3|M|Zc,M!==M9&&M!==e4&&M!==oX)this.#W|=n3}#g=[];#p=!1;#i(Z){this.#p=!1;let J=this.#g.slice();this.#g.length=0,J.forEach((X)=>X(null,Z))}readdirCB(Z,J=!1){if(!this.canReaddir()){if(J)Z(null,[]);else queueMicrotask(()=>Z(null,[]));return}let X=this.children();if(this.calledReaddir()){let $=X.slice(0,X.provisional);if(J)Z(null,$);else queueMicrotask(()=>Z(null,$));return}if(this.#g.push(Z),this.#p)return;this.#p=!0;let Y=this.fullpath();this.#Z.readdir(Y,{withFileTypes:!0},($,Q)=>{if($)this.#I($.code),X.provisional=0;else{for(let W of Q)this.#h(W,X);this.#m(X)}this.#i(X.slice(0,X.provisional));return})}#l;async readdir(){if(!this.canReaddir())return[];let Z=this.children();if(this.calledReaddir())return Z.slice(0,Z.provisional);let J=this.fullpath();if(this.#l)await this.#l;else{let X=()=>{};this.#l=new Promise((Y)=>X=Y);try{for(let Y of await this.#Z.promises.readdir(J,{withFileTypes:!0}))this.#h(Y,Z);this.#m(Z)}catch(Y){this.#I(Y.code),Z.provisional=0}this.#l=void 0,X()}return Z.slice(0,Z.provisional)}readdirSync(){if(!this.canReaddir())return[];let Z=this.children();if(this.calledReaddir())return Z.slice(0,Z.provisional);let J=this.fullpath();try{for(let X of this.#Z.readdirSync(J,{withFileTypes:!0}))this.#h(X,Z);this.#m(Z)}catch(X){this.#I(X.code),Z.provisional=0}return Z.slice(0,Z.provisional)}canReaddir(){if(this.#W&Jc)return!1;let Z=j9&this.#W;if(!(Z===M9||Z===e4||Z===oX))return!1;return!0}shouldWalk(Z,J){return(this.#W&e4)===e4&&!(this.#W&Jc)&&!Z.has(this)&&(!J||J(this))}async realpath(){if(this.#S)return this.#S;if((NU|MU|H4)&this.#W)return;try{let Z=await this.#Z.promises.realpath(this.fullpath());return this.#S=this.resolve(Z)}catch(Z){this.#u()}}realpathSync(){if(this.#S)return this.#S;if((NU|MU|H4)&this.#W)return;try{let Z=this.#Z.realpathSync(this.fullpath());return this.#S=this.resolve(Z)}catch(Z){this.#u()}}[Vc](Z){if(Z===this)return;Z.isCWD=!1,this.isCWD=!0;let J=new Set([]),X=[],Y=this;while(Y&&Y.parent)J.add(Y),Y.#B=X.join(this.sep),Y.#v=X.join("/"),Y=Y.parent,X.push("..");Y=Z;while(Y&&Y.parent&&!J.has(Y))Y.#B=void 0,Y.#v=void 0,Y=Y.parent}}class DU extends d6{sep="\\";splitSep=Iz1;constructor(Z,J=M9,X,Y,$,Q,W){super(Z,J,X,Y,$,Q,W)}newChild(Z,J=M9,X={}){return new DU(Z,J,this.root,this.roots,this.nocase,this.childrenCache(),X)}getRootString(Z){return qD.parse(Z).root}getRoot(Z){if(Z=Ez1(Z.toUpperCase()),Z===this.root.name)return this.root;for(let[J,X]of Object.entries(this.roots))if(this.sameRoot(Z,J))return this.roots[Z]=X;return this.roots[Z]=new s3(Z,this).root}sameRoot(Z,J=this.root.name){return Z=Z.toUpperCase().replace(/\//g,"\\").replace(Qc,"$1\\"),Z===J}}class PU extends d6{splitSep="/";sep="/";constructor(Z,J=M9,X,Y,$,Q,W){super(Z,J,X,Y,$,Q,W)}getRootString(Z){return Z.startsWith("/")?"/":""}getRoot(Z){return this.root}newChild(Z,J=M9,X={}){return new PU(Z,J,this.root,this.roots,this.nocase,this.childrenCache(),X)}}class FD{root;rootPath;roots;cwd;#Z;#J;#Y;nocase;#X;constructor(Z=process.cwd(),J,X,{nocase:Y,childrenCacheSize:$=16384,fs:Q=i3}={}){if(this.#X=$c(Q),Z instanceof URL||Z.startsWith("file://"))Z=wz1(Z);let W=J.resolve(Z);this.roots=Object.create(null),this.rootPath=this.parseRootPath(W),this.#Z=new VD,this.#J=new VD,this.#Y=new qc($);let K=W.substring(this.rootPath.length).split(X);if(K.length===1&&!K[0])K.pop();if(Y===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=Y,this.root=this.newRoot(this.#X),this.roots[this.rootPath]=this.root;let G=this.root,H=K.length-1,z=J.sep,q=this.rootPath,V=!1;for(let F of K){let U=H--;G=G.child(F,{relative:new Array(U).fill("..").join(z),relativePosix:new Array(U).fill("..").join("/"),fullpath:q+=(V?"":z)+F}),V=!0}this.cwd=G}depth(Z=this.cwd){if(typeof Z==="string")Z=this.cwd.resolve(Z);return Z.depth()}childrenCache(){return this.#Y}resolve(...Z){let J="";for(let $=Z.length-1;$>=0;$--){let Q=Z[$];if(!Q||Q===".")continue;if(J=J?`${Q}/${J}`:Q,this.isAbsolute(Q))break}let X=this.#Z.get(J);if(X!==void 0)return X;let Y=this.cwd.resolve(J).fullpath();return this.#Z.set(J,Y),Y}resolvePosix(...Z){let J="";for(let $=Z.length-1;$>=0;$--){let Q=Z[$];if(!Q||Q===".")continue;if(J=J?`${Q}/${J}`:Q,this.isAbsolute(Q))break}let X=this.#J.get(J);if(X!==void 0)return X;let Y=this.cwd.resolve(J).fullpathPosix();return this.#J.set(J,Y),Y}relative(Z=this.cwd){if(typeof Z==="string")Z=this.cwd.resolve(Z);return Z.relative()}relativePosix(Z=this.cwd){if(typeof Z==="string")Z=this.cwd.resolve(Z);return Z.relativePosix()}basename(Z=this.cwd){if(typeof Z==="string")Z=this.cwd.resolve(Z);return Z.name}dirname(Z=this.cwd){if(typeof Z==="string")Z=this.cwd.resolve(Z);return(Z.parent||Z).fullpath()}async readdir(Z=this.cwd,J={withFileTypes:!0}){if(typeof Z==="string")Z=this.cwd.resolve(Z);else if(!(Z instanceof d6))J=Z,Z=this.cwd;let{withFileTypes:X}=J;if(!Z.canReaddir())return[];else{let Y=await Z.readdir();return X?Y:Y.map(($)=>$.name)}}readdirSync(Z=this.cwd,J={withFileTypes:!0}){if(typeof Z==="string")Z=this.cwd.resolve(Z);else if(!(Z instanceof d6))J=Z,Z=this.cwd;let{withFileTypes:X=!0}=J;if(!Z.canReaddir())return[];else if(X)return Z.readdirSync();else return Z.readdirSync().map((Y)=>Y.name)}async lstat(Z=this.cwd){if(typeof Z==="string")Z=this.cwd.resolve(Z);return Z.lstat()}lstatSync(Z=this.cwd){if(typeof Z==="string")Z=this.cwd.resolve(Z);return Z.lstatSync()}async readlink(Z=this.cwd,{withFileTypes:J}={withFileTypes:!1}){if(typeof Z==="string")Z=this.cwd.resolve(Z);else if(!(Z instanceof d6))J=Z.withFileTypes,Z=this.cwd;let X=await Z.readlink();return J?X:X?.fullpath()}readlinkSync(Z=this.cwd,{withFileTypes:J}={withFileTypes:!1}){if(typeof Z==="string")Z=this.cwd.resolve(Z);else if(!(Z instanceof d6))J=Z.withFileTypes,Z=this.cwd;let X=Z.readlinkSync();return J?X:X?.fullpath()}async realpath(Z=this.cwd,{withFileTypes:J}={withFileTypes:!1}){if(typeof Z==="string")Z=this.cwd.resolve(Z);else if(!(Z instanceof d6))J=Z.withFileTypes,Z=this.cwd;let X=await Z.realpath();return J?X:X?.fullpath()}realpathSync(Z=this.cwd,{withFileTypes:J}={withFileTypes:!1}){if(typeof Z==="string")Z=this.cwd.resolve(Z);else if(!(Z instanceof d6))J=Z.withFileTypes,Z=this.cwd;let X=Z.realpathSync();return J?X:X?.fullpath()}async walk(Z=this.cwd,J={}){if(typeof Z==="string")Z=this.cwd.resolve(Z);else if(!(Z instanceof d6))J=Z,Z=this.cwd;let{withFileTypes:X=!0,follow:Y=!1,filter:$,walkFilter:Q}=J,W=[];if(!$||$(Z))W.push(X?Z:Z.fullpath());let K=new Set,G=(z,q)=>{K.add(z),z.readdirCB((V,F)=>{if(V)return q(V);let U=F.length;if(!U)return q();let w=()=>{if(--U===0)q()};for(let L of F){if(!$||$(L))W.push(X?L:L.fullpath());if(Y&&L.isSymbolicLink())L.realpath().then((O)=>O?.isUnknown()?O.lstat():O).then((O)=>O?.shouldWalk(K,Q)?G(O,w):w());else if(L.shouldWalk(K,Q))G(L,w);else w()}},!0)},H=Z;return new Promise((z,q)=>{G(H,(V)=>{if(V)return q(V);z(W)})})}walkSync(Z=this.cwd,J={}){if(typeof Z==="string")Z=this.cwd.resolve(Z);else if(!(Z instanceof d6))J=Z,Z=this.cwd;let{withFileTypes:X=!0,follow:Y=!1,filter:$,walkFilter:Q}=J,W=[];if(!$||$(Z))W.push(X?Z:Z.fullpath());let K=new Set([Z]);for(let G of K){let H=G.readdirSync();for(let z of H){if(!$||$(z))W.push(X?z:z.fullpath());let q=z;if(z.isSymbolicLink()){if(!(Y&&(q=z.realpathSync())))continue;if(q.isUnknown())q.lstatSync()}if(q.shouldWalk(K,Q))K.add(q)}}return W}[Symbol.asyncIterator](){return this.iterate()}iterate(Z=this.cwd,J={}){if(typeof Z==="string")Z=this.cwd.resolve(Z);else if(!(Z instanceof d6))J=Z,Z=this.cwd;return this.stream(Z,J)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(Z=this.cwd,J={}){if(typeof Z==="string")Z=this.cwd.resolve(Z);else if(!(Z instanceof d6))J=Z,Z=this.cwd;let{withFileTypes:X=!0,follow:Y=!1,filter:$,walkFilter:Q}=J;if(!$||$(Z))yield X?Z:Z.fullpath();let W=new Set([Z]);for(let K of W){let G=K.readdirSync();for(let H of G){if(!$||$(H))yield X?H:H.fullpath();let z=H;if(H.isSymbolicLink()){if(!(Y&&(z=H.realpathSync())))continue;if(z.isUnknown())z.lstatSync()}if(z.shouldWalk(W,Q))W.add(z)}}}stream(Z=this.cwd,J={}){if(typeof Z==="string")Z=this.cwd.resolve(Z);else if(!(Z instanceof d6))J=Z,Z=this.cwd;let{withFileTypes:X=!0,follow:Y=!1,filter:$,walkFilter:Q}=J,W=new sX({objectMode:!0});if(!$||$(Z))W.write(X?Z:Z.fullpath());let K=new Set,G=[Z],H=0,z=()=>{let q=!1;while(!q){let V=G.shift();if(!V){if(H===0)W.end();return}H++,K.add(V);let F=(w,L,O=!1)=>{if(w)return W.emit("error",w);if(Y&&!O){let N=[];for(let M of L)if(M.isSymbolicLink())N.push(M.realpath().then((j)=>j?.isUnknown()?j.lstat():j));if(N.length){Promise.all(N).then(()=>F(null,L,!0));return}}for(let N of L)if(N&&(!$||$(N))){if(!W.write(X?N:N.fullpath()))q=!0}H--;for(let N of L){let M=N.realpathCached()||N;if(M.shouldWalk(K,Q))G.push(M)}if(q&&!W.flowing)W.once("drain",z);else if(!U)z()},U=!0;V.readdirCB(F,!0),U=!1}};return z(),W}streamSync(Z=this.cwd,J={}){if(typeof Z==="string")Z=this.cwd.resolve(Z);else if(!(Z instanceof d6))J=Z,Z=this.cwd;let{withFileTypes:X=!0,follow:Y=!1,filter:$,walkFilter:Q}=J,W=new sX({objectMode:!0}),K=new Set;if(!$||$(Z))W.write(X?Z:Z.fullpath());let G=[Z],H=0,z=()=>{let q=!1;while(!q){let V=G.shift();if(!V){if(H===0)W.end();return}H++,K.add(V);let F=V.readdirSync();for(let U of F)if(!$||$(U)){if(!W.write(X?U:U.fullpath()))q=!0}H--;for(let U of F){let w=U;if(U.isSymbolicLink()){if(!(Y&&(w=U.realpathSync())))continue;if(w.isUnknown())w.lstatSync()}if(w.shouldWalk(K,Q))G.push(w)}}if(q&&!W.flowing)W.once("drain",z)};return z(),W}chdir(Z=this.cwd){let J=this.cwd;this.cwd=typeof Z==="string"?this.cwd.resolve(Z):Z,this.cwd[Vc](J)}}class s3 extends FD{sep="\\";constructor(Z=process.cwd(),J={}){let{nocase:X=!0}=J;super(Z,qD,"\\",{...J,nocase:X});this.nocase=X;for(let Y=this.cwd;Y;Y=Y.parent)Y.nocase=this.nocase}parseRootPath(Z){return qD.parse(Z).root.toUpperCase()}newRoot(Z){return new DU(this.rootPath,e4,void 0,this.roots,this.nocase,this.childrenCache(),{fs:Z})}isAbsolute(Z){return Z.startsWith("/")||Z.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(Z)}}class o3 extends FD{sep="/";constructor(Z=process.cwd(),J={}){let{nocase:X=!1}=J;super(Z,Lz1,"/",{...J,nocase:X});this.nocase=X}parseRootPath(Z){return"/"}newRoot(Z){return new PU(this.rootPath,e4,void 0,this.roots,this.nocase,this.childrenCache(),{fs:Z})}isAbsolute(Z){return Z.startsWith("/")}}class CU extends o3{constructor(Z=process.cwd(),J={}){let{nocase:X=!0}=J;super(Z,{...J,nocase:X})}}var HG6=process.platform==="win32"?DU:PU,Fc=process.platform==="win32"?s3:process.platform==="darwin"?CU:o3;var Sz1=(Z)=>Z.length>=1,_z1=(Z)=>Z.length>=1;class CQ{#Z;#J;#Y;length;#X;#$;#z;#V;#K;#G;#H=!0;constructor(Z,J,X,Y){if(!Sz1(Z))throw new TypeError("empty pattern list");if(!_z1(J))throw new TypeError("empty glob list");if(J.length!==Z.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=Z.length,X<0||X>=this.length)throw new TypeError("index out of range");if(this.#Z=Z,this.#J=J,this.#Y=X,this.#X=Y,this.#Y===0){if(this.isUNC()){let[$,Q,W,K,...G]=this.#Z,[H,z,q,V,...F]=this.#J;if(G[0]==="")G.shift(),F.shift();let U=[$,Q,W,K,""].join("/"),w=[H,z,q,V,""].join("/");this.#Z=[U,...G],this.#J=[w,...F],this.length=this.#Z.length}else if(this.isDrive()||this.isAbsolute()){let[$,...Q]=this.#Z,[W,...K]=this.#J;if(Q[0]==="")Q.shift(),K.shift();let G=$+"/",H=W+"/";this.#Z=[G,...Q],this.#J=[H,...K],this.length=this.#Z.length}}}pattern(){return this.#Z[this.#Y]}isString(){return typeof this.#Z[this.#Y]==="string"}isGlobstar(){return this.#Z[this.#Y]===L6}isRegExp(){return this.#Z[this.#Y]instanceof RegExp}globString(){return this.#z=this.#z||(this.#Y===0?this.isAbsolute()?this.#J[0]+this.#J.slice(1).join("/"):this.#J.join("/"):this.#J.slice(this.#Y).join("/"))}hasMore(){return this.length>this.#Y+1}rest(){if(this.#$!==void 0)return this.#$;if(!this.hasMore())return this.#$=null;return this.#$=new CQ(this.#Z,this.#J,this.#Y+1,this.#X),this.#$.#G=this.#G,this.#$.#K=this.#K,this.#$.#V=this.#V,this.#$}isUNC(){let Z=this.#Z;return this.#K!==void 0?this.#K:this.#K=this.#X==="win32"&&this.#Y===0&&Z[0]===""&&Z[1]===""&&typeof Z[2]==="string"&&!!Z[2]&&typeof Z[3]==="string"&&!!Z[3]}isDrive(){let Z=this.#Z;return this.#V!==void 0?this.#V:this.#V=this.#X==="win32"&&this.#Y===0&&this.length>1&&typeof Z[0]==="string"&&/^[a-z]:$/i.test(Z[0])}isAbsolute(){let Z=this.#Z;return this.#G!==void 0?this.#G:this.#G=Z[0]===""&&Z.length>1||this.isDrive()||this.isUNC()}root(){let Z=this.#Z[0];return typeof Z==="string"&&this.isAbsolute()&&this.#Y===0?Z:""}checkFollowGlobstar(){return!(this.#Y===0||!this.isGlobstar()||!this.#H)}markFollowGlobstar(){if(this.#Y===0||!this.isGlobstar()||!this.#H)return!1;return this.#H=!1,!0}}var Az1=typeof process==="object"&&process&&typeof process.platform==="string"?process.platform:"linux";class r3{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(Z,{nobrace:J,nocase:X,noext:Y,noglobstar:$,platform:Q=Az1}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=Q,this.mmopts={dot:!0,nobrace:J,nocase:X,noext:Y,noglobstar:$,optimizationLevel:2,platform:Q,nocomment:!0,nonegate:!0};for(let W of Z)this.add(W)}add(Z){let J=new O9(Z,this.mmopts);for(let X=0;X<J.set.length;X++){let Y=J.set[X],$=J.globParts[X];if(!Y||!$)throw new Error("invalid pattern object");while(Y[0]==="."&&$[0]===".")Y.shift(),$.shift();let Q=new CQ(Y,$,0,this.platform),W=new O9(Q.globString(),this.mmopts),K=$[$.length-1]==="**",G=Q.isAbsolute();if(G)this.absolute.push(W);else this.relative.push(W);if(K)if(G)this.absoluteChildren.push(W);else this.relativeChildren.push(W)}}ignored(Z){let J=Z.fullpath(),X=`${J}/`,Y=Z.relative()||".",$=`${Y}/`;for(let Q of this.relative)if(Q.match(Y)||Q.match($))return!0;for(let Q of this.absolute)if(Q.match(J)||Q.match(X))return!0;return!1}childrenIgnored(Z){let J=Z.fullpath()+"/",X=(Z.relative()||".")+"/";for(let Y of this.relativeChildren)if(Y.match(X))return!0;for(let Y of this.absoluteChildren)if(Y.match(J))return!0;return!1}}class UD{store;constructor(Z=new Map){this.store=Z}copy(){return new UD(new Map(this.store))}hasWalked(Z,J){return this.store.get(Z.fullpath())?.has(J.globString())}storeWalked(Z,J){let X=Z.fullpath(),Y=this.store.get(X);if(Y)Y.add(J.globString());else this.store.set(X,new Set([J.globString()]))}}class Uc{store=new Map;add(Z,J,X){let Y=(J?2:0)|(X?1:0),$=this.store.get(Z);this.store.set(Z,$===void 0?Y:Y&$)}entries(){return[...this.store.entries()].map(([Z,J])=>[Z,!!(J&2),!!(J&1)])}}class Lc{store=new Map;add(Z,J){if(!Z.canReaddir())return;let X=this.store.get(Z);if(X){if(!X.find((Y)=>Y.globString()===J.globString()))X.push(J)}else this.store.set(Z,[J])}get(Z){let J=this.store.get(Z);if(!J)throw new Error("attempting to walk unknown path");return J}entries(){return this.keys().map((Z)=>[Z,this.store.get(Z)])}keys(){return[...this.store.keys()].filter((Z)=>Z.canReaddir())}}class t3{hasWalkedCache;matches=new Uc;subwalks=new Lc;patterns;follow;dot;opts;constructor(Z,J){this.opts=Z,this.follow=!!Z.follow,this.dot=!!Z.dot,this.hasWalkedCache=J?J.copy():new UD}processPatterns(Z,J){this.patterns=J;let X=J.map((Y)=>[Z,Y]);for(let[Y,$]of X){this.hasWalkedCache.storeWalked(Y,$);let Q=$.root(),W=$.isAbsolute()&&this.opts.absolute!==!1;if(Q){Y=Y.resolve(Q==="/"&&this.opts.root!==void 0?this.opts.root:Q);let z=$.rest();if(!z){this.matches.add(Y,!0,!1);continue}else $=z}if(Y.isENOENT())continue;let K,G,H=!1;while(typeof(K=$.pattern())==="string"&&(G=$.rest()))Y=Y.resolve(K),$=G,H=!0;if(K=$.pattern(),G=$.rest(),H){if(this.hasWalkedCache.hasWalked(Y,$))continue;this.hasWalkedCache.storeWalked(Y,$)}if(typeof K==="string"){let z=K===".."||K===""||K===".";this.matches.add(Y.resolve(K),W,z);continue}else if(K===L6){if(!Y.isSymbolicLink()||this.follow||$.checkFollowGlobstar())this.subwalks.add(Y,$);let z=G?.pattern(),q=G?.rest();if(!G||(z===""||z===".")&&!q)this.matches.add(Y,W,z===""||z===".");else if(z===".."){let V=Y.parent||Y;if(!q)this.matches.add(V,W,!0);else if(!this.hasWalkedCache.hasWalked(V,q))this.subwalks.add(V,q)}}else if(K instanceof RegExp)this.subwalks.add(Y,$)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new t3(this.opts,this.hasWalkedCache)}filterEntries(Z,J){let X=this.subwalks.get(Z),Y=this.child();for(let $ of J)for(let Q of X){let W=Q.isAbsolute(),K=Q.pattern(),G=Q.rest();if(K===L6)Y.testGlobstar($,Q,G,W);else if(K instanceof RegExp)Y.testRegExp($,K,G,W);else Y.testString($,K,G,W)}return Y}testGlobstar(Z,J,X,Y){if(this.dot||!Z.name.startsWith(".")){if(!J.hasMore())this.matches.add(Z,Y,!1);if(Z.canReaddir()){if(this.follow||!Z.isSymbolicLink())this.subwalks.add(Z,J);else if(Z.isSymbolicLink()){if(X&&J.checkFollowGlobstar())this.subwalks.add(Z,X);else if(J.markFollowGlobstar())this.subwalks.add(Z,J)}}}if(X){let $=X.pattern();if(typeof $==="string"&&$!==".."&&$!==""&&$!==".")this.testString(Z,$,X.rest(),Y);else if($===".."){let Q=Z.parent||Z;this.subwalks.add(Q,X)}else if($ instanceof RegExp)this.testRegExp(Z,$,X.rest(),Y)}}testRegExp(Z,J,X,Y){if(!J.test(Z.name))return;if(!X)this.matches.add(Z,Y,!1);else this.subwalks.add(Z,X)}testString(Z,J,X,Y){if(!Z.isNamed(J))return;if(!X)this.matches.add(Z,Y,!1);else this.subwalks.add(Z,X)}}var xz1=(Z,J)=>typeof Z==="string"?new r3([Z],J):Array.isArray(Z)?new r3(Z,J):Z;class LD{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#Z=[];#J;#Y;signal;maxDepth;includeChildMatches;constructor(Z,J,X){if(this.patterns=Z,this.path=J,this.opts=X,this.#Y=!X.posix&&X.platform==="win32"?"\\":"/",this.includeChildMatches=X.includeChildMatches!==!1,X.ignore||!this.includeChildMatches){if(this.#J=xz1(X.ignore??[],X),!this.includeChildMatches&&typeof this.#J.add!=="function")throw new Error("cannot ignore child matches, ignore lacks add() method.")}if(this.maxDepth=X.maxDepth||1/0,X.signal)this.signal=X.signal,this.signal.addEventListener("abort",()=>{this.#Z.length=0})}#X(Z){return this.seen.has(Z)||!!this.#J?.ignored?.(Z)}#$(Z){return!!this.#J?.childrenIgnored?.(Z)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let Z=void 0;while(!this.paused&&(Z=this.#Z.shift()))Z()}onResume(Z){if(this.signal?.aborted)return;if(!this.paused)Z();else this.#Z.push(Z)}async matchCheck(Z,J){if(J&&this.opts.nodir)return;let X;if(this.opts.realpath){if(X=Z.realpathCached()||await Z.realpath(),!X)return;Z=X}let $=Z.isUnknown()||this.opts.stat?await Z.lstat():Z;if(this.opts.follow&&this.opts.nodir&&$?.isSymbolicLink()){let Q=await $.realpath();if(Q&&(Q.isUnknown()||this.opts.stat))await Q.lstat()}return this.matchCheckTest($,J)}matchCheckTest(Z,J){return Z&&(this.maxDepth===1/0||Z.depth()<=this.maxDepth)&&(!J||Z.canReaddir())&&(!this.opts.nodir||!Z.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!Z.isSymbolicLink()||!Z.realpathCached()?.isDirectory())&&!this.#X(Z)?Z:void 0}matchCheckSync(Z,J){if(J&&this.opts.nodir)return;let X;if(this.opts.realpath){if(X=Z.realpathCached()||Z.realpathSync(),!X)return;Z=X}let $=Z.isUnknown()||this.opts.stat?Z.lstatSync():Z;if(this.opts.follow&&this.opts.nodir&&$?.isSymbolicLink()){let Q=$.realpathSync();if(Q&&(Q?.isUnknown()||this.opts.stat))Q.lstatSync()}return this.matchCheckTest($,J)}matchFinish(Z,J){if(this.#X(Z))return;if(!this.includeChildMatches&&this.#J?.add){let $=`${Z.relativePosix()}/**`;this.#J.add($)}let X=this.opts.absolute===void 0?J:this.opts.absolute;this.seen.add(Z);let Y=this.opts.mark&&Z.isDirectory()?this.#Y:"";if(this.opts.withFileTypes)this.matchEmit(Z);else if(X){let $=this.opts.posix?Z.fullpathPosix():Z.fullpath();this.matchEmit($+Y)}else{let $=this.opts.posix?Z.relativePosix():Z.relative(),Q=this.opts.dotRelative&&!$.startsWith(".."+this.#Y)?"."+this.#Y:"";this.matchEmit(!$?"."+Y:Q+$+Y)}}async match(Z,J,X){let Y=await this.matchCheck(Z,X);if(Y)this.matchFinish(Y,J)}matchSync(Z,J,X){let Y=this.matchCheckSync(Z,X);if(Y)this.matchFinish(Y,J)}walkCB(Z,J,X){if(this.signal?.aborted)X();this.walkCB2(Z,J,new t3(this.opts),X)}walkCB2(Z,J,X,Y){if(this.#$(Z))return Y();if(this.signal?.aborted)Y();if(this.paused){this.onResume(()=>this.walkCB2(Z,J,X,Y));return}X.processPatterns(Z,J);let $=1,Q=()=>{if(--$===0)Y()};for(let[W,K,G]of X.matches.entries()){if(this.#X(W))continue;$++,this.match(W,K,G).then(()=>Q())}for(let W of X.subwalkTargets()){if(this.maxDepth!==1/0&&W.depth()>=this.maxDepth)continue;$++;let K=W.readdirCached();if(W.calledReaddir())this.walkCB3(W,K,X,Q);else W.readdirCB((G,H)=>this.walkCB3(W,H,X,Q),!0)}Q()}walkCB3(Z,J,X,Y){X=X.filterEntries(Z,J);let $=1,Q=()=>{if(--$===0)Y()};for(let[W,K,G]of X.matches.entries()){if(this.#X(W))continue;$++,this.match(W,K,G).then(()=>Q())}for(let[W,K]of X.subwalks.entries())$++,this.walkCB2(W,K,X.child(),Q);Q()}walkCBSync(Z,J,X){if(this.signal?.aborted)X();this.walkCB2Sync(Z,J,new t3(this.opts),X)}walkCB2Sync(Z,J,X,Y){if(this.#$(Z))return Y();if(this.signal?.aborted)Y();if(this.paused){this.onResume(()=>this.walkCB2Sync(Z,J,X,Y));return}X.processPatterns(Z,J);let $=1,Q=()=>{if(--$===0)Y()};for(let[W,K,G]of X.matches.entries()){if(this.#X(W))continue;this.matchSync(W,K,G)}for(let W of X.subwalkTargets()){if(this.maxDepth!==1/0&&W.depth()>=this.maxDepth)continue;$++;let K=W.readdirSync();this.walkCB3Sync(W,K,X,Q)}Q()}walkCB3Sync(Z,J,X,Y){X=X.filterEntries(Z,J);let $=1,Q=()=>{if(--$===0)Y()};for(let[W,K,G]of X.matches.entries()){if(this.#X(W))continue;this.matchSync(W,K,G)}for(let[W,K]of X.subwalks.entries())$++,this.walkCB2Sync(W,K,X.child(),Q);Q()}}class TU extends LD{matches=new Set;constructor(Z,J,X){super(Z,J,X)}matchEmit(Z){this.matches.add(Z)}async walk(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown())await this.path.lstat();return await new Promise((Z,J)=>{this.walkCB(this.path,this.patterns,()=>{if(this.signal?.aborted)J(this.signal.reason);else Z(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown())this.path.lstatSync();return this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}}class kU extends LD{results;constructor(Z,J,X){super(Z,J,X);this.results=new sX({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(Z){if(this.results.write(Z),!this.results.flowing)this.pause()}stream(){let Z=this.path;if(Z.isUnknown())Z.lstat().then(()=>{this.walkCB(Z,this.patterns,()=>this.results.end())});else this.walkCB(Z,this.patterns,()=>this.results.end());return this.results}streamSync(){if(this.path.isUnknown())this.path.lstatSync();return this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}}var fz1=typeof process==="object"&&process&&typeof process.platform==="string"?process.platform:"linux";class Z7{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(Z,J){if(!J)throw new TypeError("glob options required");if(this.withFileTypes=!!J.withFileTypes,this.signal=J.signal,this.follow=!!J.follow,this.dot=!!J.dot,this.dotRelative=!!J.dotRelative,this.nodir=!!J.nodir,this.mark=!!J.mark,!J.cwd)this.cwd="";else if(J.cwd instanceof URL||J.cwd.startsWith("file://"))J.cwd=hz1(J.cwd);if(this.cwd=J.cwd||"",this.root=J.root,this.magicalBraces=!!J.magicalBraces,this.nobrace=!!J.nobrace,this.noext=!!J.noext,this.realpath=!!J.realpath,this.absolute=J.absolute,this.includeChildMatches=J.includeChildMatches!==!1,this.noglobstar=!!J.noglobstar,this.matchBase=!!J.matchBase,this.maxDepth=typeof J.maxDepth==="number"?J.maxDepth:1/0,this.stat=!!J.stat,this.ignore=J.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof Z==="string")Z=[Z];if(this.windowsPathsNoEscape=!!J.windowsPathsNoEscape||J.allowWindowsEscape===!1,this.windowsPathsNoEscape)Z=Z.map((K)=>K.replace(/\\/g,"/"));if(this.matchBase){if(J.noglobstar)throw new TypeError("base matching requires globstar");Z=Z.map((K)=>K.includes("/")?K:`./**/${K}`)}if(this.pattern=Z,this.platform=J.platform||fz1,this.opts={...J,platform:this.platform},J.scurry){if(this.scurry=J.scurry,J.nocase!==void 0&&J.nocase!==J.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let K=J.platform==="win32"?s3:J.platform==="darwin"?CU:J.platform?o3:Fc;this.scurry=new K(this.cwd,{nocase:J.nocase,fs:J.fs})}this.nocase=this.scurry.nocase;let X=this.platform==="darwin"||this.platform==="win32",Y={...J,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:X,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},$=this.pattern.map((K)=>new O9(K,Y)),[Q,W]=$.reduce((K,G)=>{return K[0].push(...G.set),K[1].push(...G.globParts),K},[[],[]]);this.patterns=Q.map((K,G)=>{let H=W[G];if(!H)throw new Error("invalid pattern object");return new CQ(K,H,0,this.platform)})}async walk(){return[...await new TU(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new TU(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new kU(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new kU(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}}var wD=(Z,J={})=>{if(!Array.isArray(Z))Z=[Z];for(let X of Z)if(new O9(X,J).hasMagic())return!0;return!1};function IU(Z,J={}){return new Z7(Z,J).streamSync()}function Bc(Z,J={}){return new Z7(Z,J).stream()}function Oc(Z,J={}){return new Z7(Z,J).walkSync()}async function wc(Z,J={}){return new Z7(Z,J).walk()}function vU(Z,J={}){return new Z7(Z,J).iterateSync()}function jc(Z,J={}){return new Z7(Z,J).iterate()}var bz1=IU,yz1=Object.assign(Bc,{sync:IU}),gz1=vU,mz1=Object.assign(jc,{sync:vU}),uz1=Object.assign(Oc,{stream:IU,iterate:vU}),EU=Object.assign(wc,{glob:wc,globSync:Oc,sync:uz1,globStream:Bc,stream:yz1,globStreamSync:IU,streamSync:bz1,globIterate:jc,iterate:mz1,globIterateSync:vU,iterateSync:gz1,Glob:Z7,hasMagic:wD,escape:MQ,unescape:K4});EU.glob=EU;class BD{constructor(){this._listeners={}}addEventListener(Z,J){let X=this._listeners;if(X[Z]===void 0)X[Z]=[];if(X[Z].indexOf(J)===-1)X[Z].push(J);return this}removeEventListener(Z,J){let Y=this._listeners[Z];if(Y!==void 0){let $=Y.indexOf(J);if($!==-1)Y.splice($,1)}return this}dispatchEvent(Z){let X=this._listeners[Z.type];if(X!==void 0){let Y=X.slice(0);for(let $=0,Q=Y.length;$<Q;$++)Y[$].call(this,Z)}return this}dispose(){for(let Z in this._listeners)delete this._listeners[Z]}}class w5{constructor(Z,J,X,Y={}){if(this._name=void 0,this._parent=void 0,this._child=void 0,this._attributes=void 0,this._disposed=!1,this._name=Z,this._parent=J,this._child=X,this._attributes=Y,!J.isOnGraph(X))throw new Error("Cannot connect disconnected graphs.")}getName(){return this._name}getParent(){return this._parent}getChild(){return this._child}setChild(Z){return this._child=Z,this}getAttributes(){return this._attributes}dispose(){if(this._disposed)return;this._parent._destroyRef(this),this._disposed=!0}isDisposed(){return this._disposed}}class TQ extends BD{constructor(...Z){super(...Z);this._emptySet=new Set,this._edges=new Set,this._parentEdges=new Map,this._childEdges=new Map}listEdges(){return Array.from(this._edges)}listParentEdges(Z){return Array.from(this._childEdges.get(Z)||this._emptySet)}listParents(Z){let J=new Set;for(let X of this.listParentEdges(Z))J.add(X.getParent());return Array.from(J)}listChildEdges(Z){return Array.from(this._parentEdges.get(Z)||this._emptySet)}listChildren(Z){let J=new Set;for(let X of this.listChildEdges(Z))J.add(X.getChild());return Array.from(J)}disconnectParents(Z,J){for(let X of this.listParentEdges(Z))if(!J||J(X.getParent()))X.dispose();return this}_createEdge(Z,J,X,Y){let $=new w5(Z,J,X,Y);this._edges.add($);let Q=$.getParent();if(!this._parentEdges.has(Q))this._parentEdges.set(Q,new Set);this._parentEdges.get(Q).add($);let W=$.getChild();if(!this._childEdges.has(W))this._childEdges.set(W,new Set);return this._childEdges.get(W).add($),$}_destroyEdge(Z){return this._edges.delete(Z),this._parentEdges.get(Z.getParent()).delete(Z),this._childEdges.get(Z.getChild()).delete(Z),this}}function e3(){return e3=Object.assign||function(Z){for(var J=1;J<arguments.length;J++){var X=arguments[J];for(var Y in X)if(Object.prototype.hasOwnProperty.call(X,Y))Z[Y]=X[Y]}return Z},e3.apply(this,arguments)}class P6{constructor(Z){if(this.list=[],Z)for(let J of Z)this.list.push(J)}add(Z){this.list.push(Z)}remove(Z){let J=this.list.indexOf(Z);if(J>=0)this.list.splice(J,1)}removeChild(Z){let J=[];for(let X of this.list)if(X.getChild()===Z)J.push(X);for(let X of J)this.remove(X);return J}listRefsByChild(Z){let J=[];for(let X of this.list)if(X.getChild()===Z)J.push(X);return J}values(){return this.list}}class P0{constructor(Z){if(this.set=new Set,this.map=new Map,Z)for(let J of Z)this.add(J)}add(Z){let J=Z.getChild();this.removeChild(J),this.set.add(Z),this.map.set(J,Z)}remove(Z){this.set.delete(Z),this.map.delete(Z.getChild())}removeChild(Z){let J=this.map.get(Z)||null;if(J)this.remove(J);return J}getRefByChild(Z){return this.map.get(Z)||null}values(){return Array.from(this.set)}}class r1{constructor(Z){if(this.map={},Z)Object.assign(this.map,Z)}set(Z,J){this.map[Z]=J}delete(Z){delete this.map[Z]}get(Z){return this.map[Z]||null}keys(){return Object.keys(this.map)}values(){return Object.values(this.map)}}var h0=Symbol("attributes"),z4=Symbol("immutableKeys");class kQ extends BD{constructor(Z){super();this._disposed=!1,this.graph=void 0,this[h0]=void 0,this[z4]=void 0,this.graph=Z,this[z4]=new Set,this[h0]=this._createAttributes()}getDefaults(){return{}}_createAttributes(){let Z=this.getDefaults(),J={};for(let X in Z){let Y=Z[X];if(Y instanceof kQ){let $=this.graph._createEdge(X,this,Y);this[z4].add(X),J[X]=$}else J[X]=Y}return J}isOnGraph(Z){return this.graph===Z.graph}isDisposed(){return this._disposed}dispose(){if(this._disposed)return;this.graph.listChildEdges(this).forEach((Z)=>Z.dispose()),this.graph.disconnectParents(this),this._disposed=!0,this.dispatchEvent({type:"dispose"})}detach(){return this.graph.disconnectParents(this),this}swap(Z,J){for(let X in this[h0]){let Y=this[h0][X];if(Y instanceof w5){let $=Y;if($.getChild()===Z)this.setRef(X,J,$.getAttributes())}else if(Y instanceof P6)for(let $ of Y.listRefsByChild(Z)){let Q=$.getAttributes();this.removeRef(X,Z),this.addRef(X,J,Q)}else if(Y instanceof P0){let $=Y.getRefByChild(Z);if($){let Q=$.getAttributes();this.removeRef(X,Z),this.addRef(X,J,Q)}}else if(Y instanceof r1)for(let $ of Y.keys()){let Q=Y.get($);if(Q.getChild()===Z)this.setRefMap(X,$,J,Q.getAttributes())}}return this}get(Z){return this[h0][Z]}set(Z,J){return this[h0][Z]=J,this.dispatchEvent({type:"change",attribute:Z})}getRef(Z){let J=this[h0][Z];return J?J.getChild():null}setRef(Z,J,X){if(this[z4].has(Z))throw new Error(`Cannot overwrite immutable attribute, "${Z}".`);let Y=this[h0][Z];if(Y)Y.dispose();if(!J)return this;let $=this.graph._createEdge(Z,this,J,X);return this[h0][Z]=$,this.dispatchEvent({type:"change",attribute:Z})}listRefs(Z){return this.assertRefList(Z).values().map((X)=>X.getChild())}addRef(Z,J,X){let Y=this.graph._createEdge(Z,this,J,X);return this.assertRefList(Z).add(Y),this.dispatchEvent({type:"change",attribute:Z})}removeRef(Z,J){let X=this.assertRefList(Z);if(X instanceof P6)for(let Y of X.listRefsByChild(J))Y.dispose();else{let Y=X.getRefByChild(J);if(Y)Y.dispose()}return this}assertRefList(Z){let J=this[h0][Z];if(J instanceof P6||J instanceof P0)return J;throw new Error(`Expected RefList or RefSet for attribute "${Z}"`)}listRefMapKeys(Z){return this.assertRefMap(Z).keys()}listRefMapValues(Z){return this.assertRefMap(Z).values().map((J)=>J.getChild())}getRefMap(Z,J){let Y=this.assertRefMap(Z).get(J);return Y?Y.getChild():null}setRefMap(Z,J,X,Y){let $=this.assertRefMap(Z),Q=$.get(J);if(Q)Q.dispose();if(!X)return this;Y=Object.assign(Y||{},{key:J});let W=this.graph._createEdge(Z,this,X,e3({},Y,{key:J}));return $.set(J,W),this.dispatchEvent({type:"change",attribute:Z,key:J})}assertRefMap(Z){let J=this[h0][Z];if(J instanceof r1)return J;throw new Error(`Expected RefMap for attribute "${Z}"`)}dispatchEvent(Z){return super.dispatchEvent(e3({},Z,{target:this})),this.graph.dispatchEvent(e3({},Z,{target:this,type:`node:${Z.type}`})),this}_destroyRef(Z){let J=Z.getName();if(this[h0][J]===Z){if(this[h0][J]=null,this[z4].has(J))Z.getChild().dispose()}else if(this[h0][J]instanceof P6)this[h0][J].remove(Z);else if(this[h0][J]instanceof P0)this[h0][J].remove(Z);else if(this[h0][J]instanceof r1){let X=this[h0][J];for(let Y of X.keys())if(X.get(Y)===Z)X.delete(Y)}else return;this.graph._destroyEdge(Z),this.dispatchEvent({type:"change",attribute:J})}}var Tc="v4.1.1",fU="@glb.bin",a;(function(Z){Z.ACCESSOR="Accessor",Z.ANIMATION="Animation",Z.ANIMATION_CHANNEL="AnimationChannel",Z.ANIMATION_SAMPLER="AnimationSampler",Z.BUFFER="Buffer",Z.CAMERA="Camera",Z.MATERIAL="Material",Z.MESH="Mesh",Z.PRIMITIVE="Primitive",Z.PRIMITIVE_TARGET="PrimitiveTarget",Z.NODE="Node",Z.ROOT="Root",Z.SCENE="Scene",Z.SKIN="Skin",Z.TEXTURE="Texture",Z.TEXTURE_INFO="TextureInfo"})(a||(a={}));var bU;(function(Z){Z.INTERLEAVED="interleaved",Z.SEPARATE="separate"})(bU||(bU={}));var c5;(function(Z){Z.ARRAY_BUFFER="ARRAY_BUFFER",Z.ELEMENT_ARRAY_BUFFER="ELEMENT_ARRAY_BUFFER",Z.INVERSE_BIND_MATRICES="INVERSE_BIND_MATRICES",Z.OTHER="OTHER",Z.SPARSE="SPARSE"})(c5||(c5={}));var yU;(function(Z){Z[Z.R=4096]="R",Z[Z.G=256]="G",Z[Z.B=16]="B",Z[Z.A=1]="A"})(yU||(yU={}));var GZ;(function(Z){Z.GLTF="GLTF",Z.GLB="GLB"})(GZ||(GZ={}));var qJ={"5120":Int8Array,"5121":Uint8Array,"5122":Int16Array,"5123":Uint16Array,"5125":Uint32Array,"5126":Float32Array},jD=typeof Float32Array!=="undefined"?Float32Array:Array;if(!Math.hypot)Math.hypot=function(){var Z=0,J=arguments.length;while(J--)Z+=arguments[J]*arguments[J];return Math.sqrt(Z)};function dz1(){var Z=new jD(3);if(jD!=Float32Array)Z[0]=0,Z[1]=0,Z[2]=0;return Z}function OD(Z){var J=Z[0],X=Z[1],Y=Z[2];return Math.hypot(J,X,Y)}function cz1(Z,J,X){var Y=J[0],$=J[1],Q=J[2],W=X[3]*Y+X[7]*$+X[11]*Q+X[15];return W=W||1,Z[0]=(X[0]*Y+X[4]*$+X[8]*Q+X[12])/W,Z[1]=(X[1]*Y+X[5]*$+X[9]*Q+X[13])/W,Z[2]=(X[2]*Y+X[6]*$+X[10]*Q+X[14])/W,Z}(function(){var Z=dz1();return function(J,X,Y,$,Q,W){var K,G;if(!X)X=3;if(!Y)Y=0;if($)G=Math.min($*X+Y,J.length);else G=J.length;for(K=Y;K<G;K+=X)Z[0]=J[K],Z[1]=J[K+1],Z[2]=J[K+2],Q(Z,Z,W),J[K]=Z[0],J[K+1]=Z[1],J[K+2]=Z[2];return J}})();function DD(Z){let J=kc(),X=Z.propertyType===a.NODE?[Z]:Z.listChildren();for(let Y of X)Y.traverse(($)=>{let Q=$.getMesh();if(!Q)return;let W=lz1(Q,$.getWorldMatrix());if(W.min.every(isFinite)&&W.max.every(isFinite))MD(W.min,J),MD(W.max,J)});return J}function lz1(Z,J){let X=kc();for(let Y of Z.listPrimitives()){let $=Y.getAttribute("POSITION"),Q=Y.getIndices();if(!$)continue;let W=[0,0,0],K=[0,0,0];for(let G=0,H=Q?Q.getCount():$.getCount();G<H;G++){let z=Q?Q.getScalar(G):G;W=$.getElement(z,W),K=cz1(K,W,J),MD(K,X)}}return X}function MD(Z,J){for(let X=0;X<3;X++)J.min[X]=Math.min(Z[X],J.min[X]),J.max[X]=Math.max(Z[X],J.max[X])}function kc(){return{min:[1/0,1/0,1/0],max:[-1/0,-1/0,-1/0]}}class n0{static createBufferFromDataURI(Z){if(typeof Buffer==="undefined"){let J=atob(Z.split(",")[1]),X=new Uint8Array(J.length);for(let Y=0;Y<J.length;Y++)X[Y]=J.charCodeAt(Y);return X}else{let J=Z.split(",")[1],X=Z.indexOf("base64")>=0;return Buffer.from(J,X?"base64":"utf8")}}static encodeText(Z){return new TextEncoder().encode(Z)}static decodeText(Z){return new TextDecoder().decode(Z)}static concat(Z){let J=0;for(let $ of Z)J+=$.byteLength;let X=new Uint8Array(J),Y=0;for(let $ of Z)X.set($,Y),Y+=$.byteLength;return X}static pad(Z,J=0){let X=this.padNumber(Z.byteLength);if(X===Z.byteLength)return Z;let Y=new Uint8Array(X);if(Y.set(Z),J!==0)for(let $=Z.byteLength;$<X;$++)Y[$]=J;return Y}static padNumber(Z){return Math.ceil(Z/4)*4}static equals(Z,J){if(Z===J)return!0;if(Z.byteLength!==J.byteLength)return!1;let X=Z.byteLength;while(X--)if(Z[X]!==J[X])return!1;return!0}static toView(Z,J=0,X=1/0){return new Uint8Array(Z.buffer,Z.byteOffset+J,Math.min(Z.byteLength,X))}static assertView(Z){if(Z&&!ArrayBuffer.isView(Z))throw new Error(`Method requires Uint8Array parameter; received "${typeof Z}".`);return Z}}class PD{static hexToFactor(Z,J){Z=Math.floor(Z);let X=J;return X[0]=(Z>>16&255)/255,X[1]=(Z>>8&255)/255,X[2]=(Z&255)/255,this.convertSRGBToLinear(J,J)}static factorToHex(Z){let J=[...Z],[X,Y,$]=this.convertLinearToSRGB(Z,J);return X*255<<16^Y*255<<8^$*255<<0}static convertSRGBToLinear(Z,J){let X=Z,Y=J;for(let $=0;$<3;$++)Y[$]=X[$]<0.04045?X[$]*0.0773993808:Math.pow(X[$]*0.9478672986+0.0521327014,2.4);return J}static convertLinearToSRGB(Z,J){let X=Z,Y=J;for(let $=0;$<3;$++)Y[$]=X[$]<0.0031308?X[$]*12.92:1.055*Math.pow(X[$],0.41666)-0.055;return J}}class Ec{match(Z){return Z.length>=3&&Z[0]===255&&Z[1]===216&&Z[2]===255}getSize(Z){let J=new DataView(Z.buffer,Z.byteOffset+4),X,Y;while(J.byteLength){if(X=J.getUint16(0,!1),pz1(J,X),Y=J.getUint8(X+1),Y===192||Y===193||Y===194)return[J.getUint16(X+7,!1),J.getUint16(X+5,!1)];J=new DataView(Z.buffer,J.byteOffset+X+2)}throw new TypeError("Invalid JPG, no size found")}getChannels(Z){return 3}}class uU{match(Z){return Z.length>=8&&Z[0]===137&&Z[1]===80&&Z[2]===78&&Z[3]===71&&Z[4]===13&&Z[5]===10&&Z[6]===26&&Z[7]===10}getSize(Z){let J=new DataView(Z.buffer,Z.byteOffset);if(n0.decodeText(Z.slice(12,16))===uU.PNG_FRIED_CHUNK_NAME)return[J.getUint32(32,!1),J.getUint32(36,!1)];return[J.getUint32(16,!1),J.getUint32(20,!1)]}getChannels(Z){return 4}}uU.PNG_FRIED_CHUNK_NAME="CgBI";class HZ{static registerFormat(Z,J){this.impls[Z]=J}static getMimeType(Z){for(let J in this.impls)if(this.impls[J].match(Z))return J;return null}static getSize(Z,J){if(!this.impls[J])return null;return this.impls[J].getSize(Z)}static getChannels(Z,J){if(!this.impls[J])return null;return this.impls[J].getChannels(Z)}static getVRAMByteLength(Z,J){if(!this.impls[J])return null;if(this.impls[J].getVRAMByteLength)return this.impls[J].getVRAMByteLength(Z);let X=0,Y=4,$=this.getSize(Z,J);if(!$)return null;while($[0]>1||$[1]>1)X+=$[0]*$[1]*Y,$[0]=Math.max(Math.floor($[0]/2),1),$[1]=Math.max(Math.floor($[1]/2),1);return X+=1*Y,X}static mimeTypeToExtension(Z){if(Z==="image/jpeg")return"jpg";return Z.split("/").pop()}static extensionToMimeType(Z){if(Z==="jpg")return"image/jpeg";if(!Z)return"";return`image/${Z}`}}HZ.impls={"image/jpeg":new Ec,"image/png":new uU};function pz1(Z,J){if(J>Z.byteLength)throw new TypeError("Corrupt JPG, exceeded buffer limits");if(Z.getUint8(J)!==255)throw new TypeError("Invalid JPG, marker table corrupted");return Z}class zZ{static basename(Z){let J=Z.split(/[\\/]/).pop();return J.substring(0,J.lastIndexOf("."))}static extension(Z){if(Z.startsWith("data:image/")){let J=Z.match(/data:(image\/\w+)/)[1];return HZ.mimeTypeToExtension(J)}else if(Z.startsWith("data:model/gltf+json"))return"gltf";else if(Z.startsWith("data:model/gltf-binary"))return"glb";else if(Z.startsWith("data:application/"))return"bin";return Z.split(/[\\/]/).pop().split(/[.]/).pop()}}function Mc(Z){return Object.prototype.toString.call(Z)==="[object Object]"}function rX(Z){if(Mc(Z)===!1)return!1;let J=Z.constructor;if(J===void 0)return!0;let X=J.prototype;if(Mc(X)===!1)return!1;if(Object.prototype.hasOwnProperty.call(X,"isPrototypeOf")===!1)return!1;return!0}var RD,ZG;(function(Z){Z[Z.SILENT=4]="SILENT",Z[Z.ERROR=3]="ERROR",Z[Z.WARN=2]="WARN",Z[Z.INFO=1]="INFO",Z[Z.DEBUG=0]="DEBUG"})(ZG||(ZG={}));class O5{constructor(Z){this.verbosity=void 0,this.verbosity=Z}debug(Z){if(this.verbosity<=O5.Verbosity.DEBUG)console.debug(Z)}info(Z){if(this.verbosity<=O5.Verbosity.INFO)console.info(Z)}warn(Z){if(this.verbosity<=O5.Verbosity.WARN)console.warn(Z)}error(Z){if(this.verbosity<=O5.Verbosity.ERROR)console.error(Z)}}RD=O5;O5.Verbosity=ZG;O5.DEFAULT_INSTANCE=new RD(RD.Verbosity.INFO);function iz1(Z){var J=Z[0],X=Z[1],Y=Z[2],$=Z[3],Q=Z[4],W=Z[5],K=Z[6],G=Z[7],H=Z[8],z=Z[9],q=Z[10],V=Z[11],F=Z[12],U=Z[13],w=Z[14],L=Z[15],O=J*W-X*Q,N=J*K-Y*Q,M=J*G-$*Q,j=X*K-Y*W,P=X*G-$*W,D=Y*G-$*K,C=H*U-z*F,k=H*w-q*F,T=H*L-V*F,x=z*w-q*U,S=z*L-V*U,h=q*L-V*w;return O*h-N*S+M*x+j*T-P*k+D*C}function nz1(Z,J,X){var Y=J[0],$=J[1],Q=J[2],W=J[3],K=J[4],G=J[5],H=J[6],z=J[7],q=J[8],V=J[9],F=J[10],U=J[11],w=J[12],L=J[13],O=J[14],N=J[15],M=X[0],j=X[1],P=X[2],D=X[3];return Z[0]=M*Y+j*K+P*q+D*w,Z[1]=M*$+j*G+P*V+D*L,Z[2]=M*Q+j*H+P*F+D*O,Z[3]=M*W+j*z+P*U+D*N,M=X[4],j=X[5],P=X[6],D=X[7],Z[4]=M*Y+j*K+P*q+D*w,Z[5]=M*$+j*G+P*V+D*L,Z[6]=M*Q+j*H+P*F+D*O,Z[7]=M*W+j*z+P*U+D*N,M=X[8],j=X[9],P=X[10],D=X[11],Z[8]=M*Y+j*K+P*q+D*w,Z[9]=M*$+j*G+P*V+D*L,Z[10]=M*Q+j*H+P*F+D*O,Z[11]=M*W+j*z+P*U+D*N,M=X[12],j=X[13],P=X[14],D=X[15],Z[12]=M*Y+j*K+P*q+D*w,Z[13]=M*$+j*G+P*V+D*L,Z[14]=M*Q+j*H+P*F+D*O,Z[15]=M*W+j*z+P*U+D*N,Z}function az1(Z,J){var X=J[0],Y=J[1],$=J[2],Q=J[4],W=J[5],K=J[6],G=J[8],H=J[9],z=J[10];return Z[0]=Math.hypot(X,Y,$),Z[1]=Math.hypot(Q,W,K),Z[2]=Math.hypot(G,H,z),Z}function sz1(Z,J){var X=new jD(3);az1(X,J);var Y=1/X[0],$=1/X[1],Q=1/X[2],W=J[0]*Y,K=J[1]*$,G=J[2]*Q,H=J[4]*Y,z=J[5]*$,q=J[6]*Q,V=J[8]*Y,F=J[9]*$,U=J[10]*Q,w=W+z+U,L=0;if(w>0)L=Math.sqrt(w+1)*2,Z[3]=0.25*L,Z[0]=(q-F)/L,Z[1]=(V-G)/L,Z[2]=(K-H)/L;else if(W>z&&W>U)L=Math.sqrt(1+W-z-U)*2,Z[3]=(q-F)/L,Z[0]=0.25*L,Z[1]=(K+H)/L,Z[2]=(V+G)/L;else if(z>U)L=Math.sqrt(1+z-W-U)*2,Z[3]=(V-G)/L,Z[0]=(K+H)/L,Z[1]=0.25*L,Z[2]=(q+F)/L;else L=Math.sqrt(1+U-W-z)*2,Z[3]=(K-H)/L,Z[0]=(V+G)/L,Z[1]=(q+F)/L,Z[2]=0.25*L;return Z}class c0{static identity(Z){return Z}static eq(Z,J,X=0.00001){if(Z.length!==J.length)return!1;for(let Y=0;Y<Z.length;Y++)if(Math.abs(Z[Y]-J[Y])>X)return!1;return!0}static clamp(Z,J,X){if(Z<J)return J;if(Z>X)return X;return Z}static decodeNormalizedInt(Z,J){switch(J){case 5126:return Z;case 5123:return Z/65535;case 5121:return Z/255;case 5122:return Math.max(Z/32767,-1);case 5120:return Math.max(Z/127,-1);default:throw new Error("Invalid component type.")}}static encodeNormalizedInt(Z,J){switch(J){case 5126:return Z;case 5123:return Math.round(c0.clamp(Z,0,1)*65535);case 5121:return Math.round(c0.clamp(Z,0,1)*255);case 5122:return Math.round(c0.clamp(Z,-1,1)*32767);case 5120:return Math.round(c0.clamp(Z,-1,1)*127);default:throw new Error("Invalid component type.")}}static decompose(Z,J,X,Y){let $=OD([Z[0],Z[1],Z[2]]),Q=OD([Z[4],Z[5],Z[6]]),W=OD([Z[8],Z[9],Z[10]]);if(iz1(Z)<0)$=-$;J[0]=Z[12],J[1]=Z[13],J[2]=Z[14];let G=Z.slice(),H=1/$,z=1/Q,q=1/W;G[0]*=H,G[1]*=H,G[2]*=H,G[4]*=z,G[5]*=z,G[6]*=z,G[8]*=q,G[9]*=q,G[10]*=q,sz1(X,G),Y[0]=$,Y[1]=Q,Y[2]=W}static compose(Z,J,X,Y){let $=Y,Q=J[0],W=J[1],K=J[2],G=J[3],H=Q+Q,z=W+W,q=K+K,V=Q*H,F=Q*z,U=Q*q,w=W*z,L=W*q,O=K*q,N=G*H,M=G*z,j=G*q,P=X[0],D=X[1],C=X[2];return $[0]=(1-(w+O))*P,$[1]=(F+j)*P,$[2]=(U-M)*P,$[3]=0,$[4]=(F-j)*D,$[5]=(1-(V+O))*D,$[6]=(L+N)*D,$[7]=0,$[8]=(U+M)*C,$[9]=(L-N)*C,$[10]=(1-(V+w))*C,$[11]=0,$[12]=Z[0],$[13]=Z[1],$[14]=Z[2],$[15]=1,$}}function oz1(Z,J){if(!!Z!==!!J)return!1;let X=Z.getChild(),Y=J.getChild();return X===Y||X.equals(Y)}function rz1(Z,J){if(!!Z!==!!J)return!1;let X=Z.values(),Y=J.values();if(X.length!==Y.length)return!1;for(let $=0;$<X.length;$++){let Q=X[$],W=Y[$];if(Q.getChild()===W.getChild())continue;if(!Q.getChild().equals(W.getChild()))return!1}return!0}function tz1(Z,J){if(!!Z!==!!J)return!1;let X=Z.keys(),Y=J.keys();if(X.length!==Y.length)return!1;for(let $ of X){let Q=Z.get($),W=J.get($);if(!!Q!==!!W)return!1;let K=Q.getChild(),G=W.getChild();if(K===G)continue;if(!K.equals(G))return!1}return!0}function Ic(Z,J){if(Z===J)return!0;if(!!Z!==!!J||!Z||!J)return!1;if(Z.length!==J.length)return!1;for(let X=0;X<Z.length;X++)if(Z[X]!==J[X])return!1;return!0}function vc(Z,J){if(Z===J)return!0;if(!!Z!==!!J)return!1;if(!rX(Z)||!rX(J))return Z===J;let X=Z,Y=J,$=0,Q=0,W;for(W in X)$++;for(W in Y)Q++;if($!==Q)return!1;for(W in X){let K=X[W],G=Y[W];if(gU(K)&&gU(G)){if(!Ic(K,G))return!1}else if(rX(K)&&rX(G)){if(!vc(K,G))return!1}else if(K!==G)return!1}return!0}function gU(Z){return Array.isArray(Z)||ArrayBuffer.isView(Z)}var Rc="23456789abdegjkmnpqrvwxyzABDEGJKMNPQRVWXYZ",ez1=999,Zq1=6,Nc=new Set,Jq1=function Z(){let J="";for(let X=0;X<Zq1;X++)J+=Rc.charAt(Math.floor(Math.random()*Rc.length));return J},Sc=function Z(){for(let J=0;J<ez1;J++){let X=Jq1();if(!Nc.has(X))return Nc.add(X),X}return""},Dc="https://null.example";class R9{static dirname(Z){let J=Z.lastIndexOf("/");if(J===-1)return"./";return Z.substring(0,J+1)}static basename(Z){return zZ.basename(new URL(Z,Dc).pathname)}static extension(Z){return zZ.extension(new URL(Z,Dc).pathname)}static resolve(Z,J){if(!this.isRelativePath(J))return J;let X=Z.split("/"),Y=J.split("/");X.pop();for(let $=0;$<Y.length;$++){if(Y[$]===".")continue;if(Y[$]==="..")X.pop();else X.push(Y[$])}return X.join("/")}static isAbsoluteURL(Z){return this.PROTOCOL_REGEXP.test(Z)}static isRelativePath(Z){return!/^(?:[a-zA-Z]+:)?\//.test(Z)}}R9.DEFAULT_INIT={};R9.PROTOCOL_REGEXP=/^[a-zA-Z]+:\/\//;var zJ=(Z)=>Z,Xq1=new Set;class dU extends kQ{constructor(Z,J=""){super(Z);this[h0].name=J,this.init(),this.dispatchEvent({type:"create"})}getGraph(){return this.graph}getDefaults(){return Object.assign(super.getDefaults(),{name:"",extras:{}})}set(Z,J){if(Array.isArray(J))J=J.slice();return super.set(Z,J)}getName(){return this.get("name")}setName(Z){return this.set("name",Z)}getExtras(){return this.get("extras")}setExtras(Z){return this.set("extras",Z)}clone(){return new this.constructor(this.graph).copy(this,zJ)}copy(Z,J=zJ){for(let X in this[h0]){let Y=this[h0][X];if(Y instanceof w5){if(!this[z4].has(X))Y.dispose()}else if(Y instanceof P6||Y instanceof P0)for(let $ of Y.values())$.dispose();else if(Y instanceof r1)for(let $ of Y.values())$.dispose()}for(let X in Z[h0]){let Y=this[h0][X],$=Z[h0][X];if($ instanceof w5)if(this[z4].has(X))Y.getChild().copy(J($.getChild()),J);else this.setRef(X,J($.getChild()),$.getAttributes());else if($ instanceof P0||$ instanceof P6)for(let Q of $.values())this.addRef(X,J(Q.getChild()),Q.getAttributes());else if($ instanceof r1)for(let Q of $.keys()){let W=$.get(Q);this.setRefMap(X,Q,J(W.getChild()),W.getAttributes())}else if(rX($))this[h0][X]=JSON.parse(JSON.stringify($));else if(Array.isArray($)||$ instanceof ArrayBuffer||ArrayBuffer.isView($))this[h0][X]=$.slice();else this[h0][X]=$}return this}equals(Z,J=Xq1){if(this===Z)return!0;if(this.propertyType!==Z.propertyType)return!1;for(let X in this[h0]){if(J.has(X))continue;let Y=this[h0][X],$=Z[h0][X];if(Y instanceof w5||$ instanceof w5){if(!oz1(Y,$))return!1}else if(Y instanceof P0||$ instanceof P0||Y instanceof P6||$ instanceof P6){if(!rz1(Y,$))return!1}else if(Y instanceof r1||$ instanceof r1){if(!tz1(Y,$))return!1}else if(rX(Y)||rX($)){if(!vc(Y,$))return!1}else if(gU(Y)||gU($)){if(!Ic(Y,$))return!1}else if(Y!==$)return!1}return!0}detach(){return this.graph.disconnectParents(this,(Z)=>Z.propertyType!=="Root"),this}listParents(){return this.graph.listParents(this)}}class T6 extends dU{getDefaults(){return Object.assign(super.getDefaults(),{extensions:new r1})}getExtension(Z){return this.getRefMap("extensions",Z)}setExtension(Z,J){if(J)J._validateParent(this);return this.setRefMap("extensions",Z,J)}listExtensions(){return this.listRefMapValues("extensions")}}class v0 extends T6{init(){this.propertyType=a.ACCESSOR}getDefaults(){return Object.assign(super.getDefaults(),{array:null,type:v0.Type.SCALAR,componentType:v0.ComponentType.FLOAT,normalized:!1,sparse:!1,buffer:null})}static getElementSize(Z){switch(Z){case v0.Type.SCALAR:return 1;case v0.Type.VEC2:return 2;case v0.Type.VEC3:return 3;case v0.Type.VEC4:return 4;case v0.Type.MAT2:return 4;case v0.Type.MAT3:return 9;case v0.Type.MAT4:return 16;default:throw new Error("Unexpected type: "+Z)}}static getComponentSize(Z){switch(Z){case v0.ComponentType.BYTE:return 1;case v0.ComponentType.UNSIGNED_BYTE:return 1;case v0.ComponentType.SHORT:return 2;case v0.ComponentType.UNSIGNED_SHORT:return 2;case v0.ComponentType.UNSIGNED_INT:return 4;case v0.ComponentType.FLOAT:return 4;default:throw new Error("Unexpected component type: "+Z)}}getMinNormalized(Z){let J=this.getNormalized(),X=this.getElementSize(),Y=this.getComponentType();if(this.getMin(Z),J)for(let $=0;$<X;$++)Z[$]=c0.decodeNormalizedInt(Z[$],Y);return Z}getMin(Z){let J=this.getArray(),X=this.getCount(),Y=this.getElementSize();for(let $=0;$<Y;$++)Z[$]=1/0;for(let $=0;$<X*Y;$+=Y)for(let Q=0;Q<Y;Q++){let W=J[$+Q];if(Number.isFinite(W))Z[Q]=Math.min(Z[Q],W)}return Z}getMaxNormalized(Z){let J=this.getNormalized(),X=this.getElementSize(),Y=this.getComponentType();if(this.getMax(Z),J)for(let $=0;$<X;$++)Z[$]=c0.decodeNormalizedInt(Z[$],Y);return Z}getMax(Z){let J=this.get("array"),X=this.getCount(),Y=this.getElementSize();for(let $=0;$<Y;$++)Z[$]=-1/0;for(let $=0;$<X*Y;$+=Y)for(let Q=0;Q<Y;Q++){let W=J[$+Q];if(Number.isFinite(W))Z[Q]=Math.max(Z[Q],W)}return Z}getCount(){let Z=this.get("array");return Z?Z.length/this.getElementSize():0}getType(){return this.get("type")}setType(Z){return this.set("type",Z)}getElementSize(){return v0.getElementSize(this.get("type"))}getComponentSize(){return this.get("array").BYTES_PER_ELEMENT}getComponentType(){return this.get("componentType")}getNormalized(){return this.get("normalized")}setNormalized(Z){return this.set("normalized",Z)}getScalar(Z){let J=this.getElementSize(),X=this.getComponentType(),Y=this.getArray();if(this.getNormalized())return c0.decodeNormalizedInt(Y[Z*J],X);return Y[Z*J]}setScalar(Z,J){let X=this.getElementSize(),Y=this.getComponentType(),$=this.getArray();if(this.getNormalized())$[Z*X]=c0.encodeNormalizedInt(J,Y);else $[Z*X]=J;return this}getElement(Z,J){let X=this.getNormalized(),Y=this.getElementSize(),$=this.getComponentType(),Q=this.getArray();for(let W=0;W<Y;W++)if(X)J[W]=c0.decodeNormalizedInt(Q[Z*Y+W],$);else J[W]=Q[Z*Y+W];return J}setElement(Z,J){let X=this.getNormalized(),Y=this.getElementSize(),$=this.getComponentType(),Q=this.getArray();for(let W=0;W<Y;W++)if(X)Q[Z*Y+W]=c0.encodeNormalizedInt(J[W],$);else Q[Z*Y+W]=J[W];return this}getSparse(){return this.get("sparse")}setSparse(Z){return this.set("sparse",Z)}getBuffer(){return this.getRef("buffer")}setBuffer(Z){return this.setRef("buffer",Z)}getArray(){return this.get("array")}setArray(Z){return this.set("componentType",Z?Yq1(Z):v0.ComponentType.FLOAT),this.set("array",Z),this}getByteLength(){let Z=this.get("array");return Z?Z.byteLength:0}}v0.Type={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};v0.ComponentType={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,FLOAT:5126};function Yq1(Z){switch(Z.constructor){case Float32Array:return v0.ComponentType.FLOAT;case Uint32Array:return v0.ComponentType.UNSIGNED_INT;case Uint16Array:return v0.ComponentType.UNSIGNED_SHORT;case Uint8Array:return v0.ComponentType.UNSIGNED_BYTE;case Int16Array:return v0.ComponentType.SHORT;case Int8Array:return v0.ComponentType.BYTE;default:throw new Error("Unknown accessor componentType.")}}class CD extends T6{init(){this.propertyType=a.ANIMATION}getDefaults(){return Object.assign(super.getDefaults(),{channels:new P0,samplers:new P0})}addChannel(Z){return this.addRef("channels",Z)}removeChannel(Z){return this.removeRef("channels",Z)}listChannels(){return this.listRefs("channels")}addSampler(Z){return this.addRef("samplers",Z)}removeSampler(Z){return this.removeRef("samplers",Z)}listSamplers(){return this.listRefs("samplers")}}class tX extends T6{init(){this.propertyType=a.ANIMATION_CHANNEL}getDefaults(){return Object.assign(super.getDefaults(),{targetPath:null,targetNode:null,sampler:null})}getTargetPath(){return this.get("targetPath")}setTargetPath(Z){return this.set("targetPath",Z)}getTargetNode(){return this.getRef("targetNode")}setTargetNode(Z){return this.setRef("targetNode",Z)}getSampler(){return this.getRef("sampler")}setSampler(Z){return this.setRef("sampler",Z)}}tX.TargetPath={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"};class EQ extends T6{init(){this.propertyType=a.ANIMATION_SAMPLER}getDefaultAttributes(){return Object.assign(super.getDefaults(),{interpolation:EQ.Interpolation.LINEAR,input:null,output:null})}getInterpolation(){return this.get("interpolation")}setInterpolation(Z){return this.set("interpolation",Z)}getInput(){return this.getRef("input")}setInput(Z){return this.setRef("input",Z,{usage:c5.OTHER})}getOutput(){return this.getRef("output")}setOutput(Z){return this.setRef("output",Z,{usage:c5.OTHER})}}EQ.Interpolation={LINEAR:"LINEAR",STEP:"STEP",CUBICSPLINE:"CUBICSPLINE"};class TD extends T6{init(){this.propertyType=a.BUFFER}getDefaults(){return Object.assign(super.getDefaults(),{uri:""})}getURI(){return this.get("uri")}setURI(Z){return this.set("uri",Z)}}class eX extends T6{init(){this.propertyType=a.CAMERA}getDefaults(){return Object.assign(super.getDefaults(),{type:eX.Type.PERSPECTIVE,znear:0.1,zfar:100,aspectRatio:null,yfov:Math.PI*2*50/360,xmag:1,ymag:1})}getType(){return this.get("type")}setType(Z){return this.set("type",Z)}getZNear(){return this.get("znear")}setZNear(Z){return this.set("znear",Z)}getZFar(){return this.get("zfar")}setZFar(Z){return this.set("zfar",Z)}getAspectRatio(){return this.get("aspectRatio")}setAspectRatio(Z){return this.set("aspectRatio",Z)}getYFov(){return this.get("yfov")}setYFov(Z){return this.set("yfov",Z)}getXMag(){return this.get("xmag")}setXMag(Z){return this.set("xmag",Z)}getYMag(){return this.get("ymag")}setYMag(Z){return this.set("ymag",Z)}}eX.Type={PERSPECTIVE:"perspective",ORTHOGRAPHIC:"orthographic"};class IQ extends dU{_validateParent(Z){if(!this.parentTypes.includes(Z.propertyType))throw new Error(`Parent "${Z.propertyType}" invalid for child "${this.propertyType}".`)}}IQ.EXTENSION_NAME=void 0;class B5 extends T6{init(){this.propertyType=a.TEXTURE_INFO}getDefaults(){return Object.assign(super.getDefaults(),{texCoord:0,magFilter:null,minFilter:null,wrapS:B5.WrapMode.REPEAT,wrapT:B5.WrapMode.REPEAT})}getTexCoord(){return this.get("texCoord")}setTexCoord(Z){return this.set("texCoord",Z)}getMagFilter(){return this.get("magFilter")}setMagFilter(Z){return this.set("magFilter",Z)}getMinFilter(){return this.get("minFilter")}setMinFilter(Z){return this.set("minFilter",Z)}getWrapS(){return this.get("wrapS")}setWrapS(Z){return this.set("wrapS",Z)}getWrapT(){return this.get("wrapT")}setWrapT(Z){return this.set("wrapT",Z)}}B5.WrapMode={CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497};B5.MagFilter={NEAREST:9728,LINEAR:9729};B5.MinFilter={NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987};var{R:SU,G:_U,B:AU,A:$q1}=yU;class J7 extends T6{init(){this.propertyType=a.MATERIAL}getDefaults(){return Object.assign(super.getDefaults(),{alphaMode:J7.AlphaMode.OPAQUE,alphaCutoff:0.5,doubleSided:!1,baseColorFactor:[1,1,1,1],baseColorTexture:null,baseColorTextureInfo:new B5(this.graph,"baseColorTextureInfo"),emissiveFactor:[0,0,0],emissiveTexture:null,emissiveTextureInfo:new B5(this.graph,"emissiveTextureInfo"),normalScale:1,normalTexture:null,normalTextureInfo:new B5(this.graph,"normalTextureInfo"),occlusionStrength:1,occlusionTexture:null,occlusionTextureInfo:new B5(this.graph,"occlusionTextureInfo"),roughnessFactor:1,metallicFactor:1,metallicRoughnessTexture:null,metallicRoughnessTextureInfo:new B5(this.graph,"metallicRoughnessTextureInfo")})}getDoubleSided(){return this.get("doubleSided")}setDoubleSided(Z){return this.set("doubleSided",Z)}getAlpha(){return this.get("baseColorFactor")[3]}setAlpha(Z){let J=this.get("baseColorFactor").slice();return J[3]=Z,this.set("baseColorFactor",J)}getAlphaMode(){return this.get("alphaMode")}setAlphaMode(Z){return this.set("alphaMode",Z)}getAlphaCutoff(){return this.get("alphaCutoff")}setAlphaCutoff(Z){return this.set("alphaCutoff",Z)}getBaseColorFactor(){return this.get("baseColorFactor")}setBaseColorFactor(Z){return this.set("baseColorFactor",Z)}getBaseColorTexture(){return this.getRef("baseColorTexture")}getBaseColorTextureInfo(){return this.getRef("baseColorTexture")?this.getRef("baseColorTextureInfo"):null}setBaseColorTexture(Z){return this.setRef("baseColorTexture",Z,{channels:SU|_U|AU|$q1,isColor:!0})}getEmissiveFactor(){return this.get("emissiveFactor")}setEmissiveFactor(Z){return this.set("emissiveFactor",Z)}getEmissiveTexture(){return this.getRef("emissiveTexture")}getEmissiveTextureInfo(){return this.getRef("emissiveTexture")?this.getRef("emissiveTextureInfo"):null}setEmissiveTexture(Z){return this.setRef("emissiveTexture",Z,{channels:SU|_U|AU,isColor:!0})}getNormalScale(){return this.get("normalScale")}setNormalScale(Z){return this.set("normalScale",Z)}getNormalTexture(){return this.getRef("normalTexture")}getNormalTextureInfo(){return this.getRef("normalTexture")?this.getRef("normalTextureInfo"):null}setNormalTexture(Z){return this.setRef("normalTexture",Z,{channels:SU|_U|AU})}getOcclusionStrength(){return this.get("occlusionStrength")}setOcclusionStrength(Z){return this.set("occlusionStrength",Z)}getOcclusionTexture(){return this.getRef("occlusionTexture")}getOcclusionTextureInfo(){return this.getRef("occlusionTexture")?this.getRef("occlusionTextureInfo"):null}setOcclusionTexture(Z){return this.setRef("occlusionTexture",Z,{channels:SU})}getRoughnessFactor(){return this.get("roughnessFactor")}setRoughnessFactor(Z){return this.set("roughnessFactor",Z)}getMetallicFactor(){return this.get("metallicFactor")}setMetallicFactor(Z){return this.set("metallicFactor",Z)}getMetallicRoughnessTexture(){return this.getRef("metallicRoughnessTexture")}getMetallicRoughnessTextureInfo(){return this.getRef("metallicRoughnessTexture")?this.getRef("metallicRoughnessTextureInfo"):null}setMetallicRoughnessTexture(Z){return this.setRef("metallicRoughnessTexture",Z,{channels:_U|AU})}}J7.AlphaMode={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};class XG extends T6{init(){this.propertyType=a.MESH}getDefaults(){return Object.assign(super.getDefaults(),{weights:[],primitives:new P0})}addPrimitive(Z){return this.addRef("primitives",Z)}removePrimitive(Z){return this.removeRef("primitives",Z)}listPrimitives(){return this.listRefs("primitives")}getWeights(){return this.get("weights")}setWeights(Z){return this.set("weights",Z)}}class cU extends T6{init(){this.propertyType=a.NODE}getDefaults(){return Object.assign(super.getDefaults(),{translation:[0,0,0],rotation:[0,0,0,1],scale:[1,1,1],weights:[],camera:null,mesh:null,skin:null,children:new P0})}copy(Z,J=zJ){if(J===zJ)throw new Error("Node cannot be copied.");return super.copy(Z,J)}getTranslation(){return this.get("translation")}getRotation(){return this.get("rotation")}getScale(){return this.get("scale")}setTranslation(Z){return this.set("translation",Z)}setRotation(Z){return this.set("rotation",Z)}setScale(Z){return this.set("scale",Z)}getMatrix(){return c0.compose(this.get("translation"),this.get("rotation"),this.get("scale"),[])}setMatrix(Z){let J=this.get("translation").slice(),X=this.get("rotation").slice(),Y=this.get("scale").slice();return c0.decompose(Z,J,X,Y),this.set("translation",J).set("rotation",X).set("scale",Y)}getWorldTranslation(){let Z=[0,0,0];return c0.decompose(this.getWorldMatrix(),Z,[0,0,0,1],[1,1,1]),Z}getWorldRotation(){let Z=[0,0,0,1];return c0.decompose(this.getWorldMatrix(),[0,0,0],Z,[1,1,1]),Z}getWorldScale(){let Z=[1,1,1];return c0.decompose(this.getWorldMatrix(),[0,0,0],[0,0,0,1],Z),Z}getWorldMatrix(){let Z=[];for(let Y=this;Y!=null;Y=Y.getParentNode())Z.push(Y);let J,X=Z.pop().getMatrix();while(J=Z.pop())nz1(X,X,J.getMatrix());return X}addChild(Z){let J=Z.getParentNode();if(J)J.removeChild(Z);for(let X of Z.listParents())if(X.propertyType===a.SCENE)X.removeChild(Z);return this.addRef("children",Z)}removeChild(Z){return this.removeRef("children",Z)}listChildren(){return this.listRefs("children")}getParentNode(){for(let Z of this.listParents())if(Z.propertyType===a.NODE)return Z;return null}getMesh(){return this.getRef("mesh")}setMesh(Z){return this.setRef("mesh",Z)}getCamera(){return this.getRef("camera")}setCamera(Z){return this.setRef("camera",Z)}getSkin(){return this.getRef("skin")}setSkin(Z){return this.setRef("skin",Z)}getWeights(){return this.get("weights")}setWeights(Z){return this.set("weights",Z)}traverse(Z){Z(this);for(let J of this.listChildren())J.traverse(Z);return this}}class M8 extends T6{init(){this.propertyType=a.PRIMITIVE}getDefaults(){return Object.assign(super.getDefaults(),{mode:M8.Mode.TRIANGLES,material:null,indices:null,attributes:new r1,targets:new P0})}getIndices(){return this.getRef("indices")}setIndices(Z){return this.setRef("indices",Z,{usage:c5.ELEMENT_ARRAY_BUFFER})}getAttribute(Z){return this.getRefMap("attributes",Z)}setAttribute(Z,J){return this.setRefMap("attributes",Z,J,{usage:c5.ARRAY_BUFFER})}listAttributes(){return this.listRefMapValues("attributes")}listSemantics(){return this.listRefMapKeys("attributes")}getMaterial(){return this.getRef("material")}setMaterial(Z){return this.setRef("material",Z)}getMode(){return this.get("mode")}setMode(Z){return this.set("mode",Z)}listTargets(){return this.listRefs("targets")}addTarget(Z){return this.addRef("targets",Z)}removeTarget(Z){return this.removeRef("targets",Z)}}M8.Mode={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class kD extends dU{init(){this.propertyType=a.PRIMITIVE_TARGET}getDefaults(){return Object.assign(super.getDefaults(),{attributes:new r1})}getAttribute(Z){return this.getRefMap("attributes",Z)}setAttribute(Z,J){return this.setRefMap("attributes",Z,J,{usage:c5.ARRAY_BUFFER})}listAttributes(){return this.listRefMapValues("attributes")}listSemantics(){return this.listRefMapKeys("attributes")}}function c6(){return c6=Object.assign?Object.assign.bind():function(Z){for(var J=1;J<arguments.length;J++){var X=arguments[J];for(var Y in X)({}).hasOwnProperty.call(X,Y)&&(Z[Y]=X[Y])}return Z},c6.apply(null,arguments)}class vQ extends T6{init(){this.propertyType=a.SCENE}getDefaults(){return Object.assign(super.getDefaults(),{children:new P0})}copy(Z,J=zJ){if(J===zJ)throw new Error("Scene cannot be copied.");return super.copy(Z,J)}addChild(Z){let J=Z.getParentNode();if(J)J.removeChild(Z);return this.addRef("children",Z)}removeChild(Z){return this.removeRef("children",Z)}listChildren(){return this.listRefs("children")}traverse(Z){for(let J of this.listChildren())J.traverse(Z);return this}}class ED extends T6{init(){this.propertyType=a.SKIN}getDefaults(){return Object.assign(super.getDefaults(),{skeleton:null,inverseBindMatrices:null,joints:new P0})}getSkeleton(){return this.getRef("skeleton")}setSkeleton(Z){return this.setRef("skeleton",Z)}getInverseBindMatrices(){return this.getRef("inverseBindMatrices")}setInverseBindMatrices(Z){return this.setRef("inverseBindMatrices",Z,{usage:c5.INVERSE_BIND_MATRICES})}addJoint(Z){return this.addRef("joints",Z)}removeJoint(Z){return this.removeRef("joints",Z)}listJoints(){return this.listRefs("joints")}}class ZY extends T6{init(){this.propertyType=a.TEXTURE}getDefaults(){return Object.assign(super.getDefaults(),{image:null,mimeType:"",uri:""})}getMimeType(){return this.get("mimeType")||HZ.extensionToMimeType(zZ.extension(this.get("uri")))}setMimeType(Z){return this.set("mimeType",Z)}getURI(){return this.get("uri")}setURI(Z){this.set("uri",Z);let J=HZ.extensionToMimeType(zZ.extension(Z));if(J)this.set("mimeType",J);return this}getImage(){return this.get("image")}setImage(Z){return this.set("image",n0.assertView(Z))}getSize(){let Z=this.get("image");if(!Z)return null;return HZ.getSize(Z,this.getMimeType())}}class JY extends T6{init(){this.propertyType=a.ROOT}getDefaults(){return Object.assign(super.getDefaults(),{asset:{generator:`glTF-Transform ${Tc}`,version:"2.0"},defaultScene:null,accessors:new P0,animations:new P0,buffers:new P0,cameras:new P0,materials:new P0,meshes:new P0,nodes:new P0,scenes:new P0,skins:new P0,textures:new P0})}constructor(Z){super(Z);this._extensions=new Set,Z.addEventListener("node:create",(J)=>{this._addChildOfRoot(J.target)})}clone(){throw new Error("Root cannot be cloned.")}copy(Z,J=zJ){if(J===zJ)throw new Error("Root cannot be copied.");this.set("asset",c6({},Z.get("asset"))),this.setName(Z.getName()),this.setExtras(c6({},Z.getExtras())),this.setDefaultScene(Z.getDefaultScene()?J(Z.getDefaultScene()):null);for(let X of Z.listRefMapKeys("extensions")){let Y=Z.getExtension(X);this.setExtension(X,J(Y))}return this}_addChildOfRoot(Z){if(Z instanceof vQ)this.addRef("scenes",Z);else if(Z instanceof cU)this.addRef("nodes",Z);else if(Z instanceof eX)this.addRef("cameras",Z);else if(Z instanceof ED)this.addRef("skins",Z);else if(Z instanceof XG)this.addRef("meshes",Z);else if(Z instanceof J7)this.addRef("materials",Z);else if(Z instanceof ZY)this.addRef("textures",Z);else if(Z instanceof CD)this.addRef("animations",Z);else if(Z instanceof v0)this.addRef("accessors",Z);else if(Z instanceof TD)this.addRef("buffers",Z);return this}getAsset(){return this.get("asset")}listExtensionsUsed(){return Array.from(this._extensions)}listExtensionsRequired(){return this.listExtensionsUsed().filter((Z)=>Z.isRequired())}_enableExtension(Z){return this._extensions.add(Z),this}_disableExtension(Z){return this._extensions.delete(Z),this}listScenes(){return this.listRefs("scenes")}setDefaultScene(Z){return this.setRef("defaultScene",Z)}getDefaultScene(){return this.getRef("defaultScene")}listNodes(){return this.listRefs("nodes")}listCameras(){return this.listRefs("cameras")}listSkins(){return this.listRefs("skins")}listMeshes(){return this.listRefs("meshes")}listMaterials(){return this.listRefs("materials")}listTextures(){return this.listRefs("textures")}listAnimations(){return this.listRefs("animations")}listAccessors(){return this.listRefs("accessors")}listBuffers(){return this.listRefs("buffers")}}class C6{static fromGraph(Z){return C6._GRAPH_DOCUMENTS.get(Z)||null}constructor(){this._graph=new TQ,this._root=new JY(this._graph),this._logger=O5.DEFAULT_INSTANCE,C6._GRAPH_DOCUMENTS.set(this._graph,this)}getRoot(){return this._root}getGraph(){return this._graph}getLogger(){return this._logger}setLogger(Z){return this._logger=Z,this}clone(){throw new Error("Use 'cloneDocument(source)' from '@gltf-transform/functions'.")}merge(Z){throw new Error("Use 'mergeDocuments(target, source)' from '@gltf-transform/functions'.")}async transform(...Z){let J=Z.map((X)=>X.name);for(let X of Z)await X(this,{stack:J});return this}createExtension(Z){let J=Z.EXTENSION_NAME;return this.getRoot().listExtensionsUsed().find((Y)=>Y.extensionName===J)||new Z(this)}createScene(Z=""){return new vQ(this._graph,Z)}createNode(Z=""){return new cU(this._graph,Z)}createCamera(Z=""){return new eX(this._graph,Z)}createSkin(Z=""){return new ED(this._graph,Z)}createMesh(Z=""){return new XG(this._graph,Z)}createPrimitive(){return new M8(this._graph)}createPrimitiveTarget(Z=""){return new kD(this._graph,Z)}createMaterial(Z=""){return new J7(this._graph,Z)}createTexture(Z=""){return new ZY(this._graph,Z)}createAnimation(Z=""){return new CD(this._graph,Z)}createAnimationChannel(Z=""){return new tX(this._graph,Z)}createAnimationSampler(Z=""){return new EQ(this._graph,Z)}createAccessor(Z="",J=null){if(!J)J=this.getRoot().listBuffers()[0];return new v0(this._graph,Z).setBuffer(J)}createBuffer(Z=""){return new TD(this._graph,Z)}}C6._GRAPH_DOCUMENTS=new WeakMap;class _c{constructor(Z){this.extensionName="",this.prereadTypes=[],this.prewriteTypes=[],this.readDependencies=[],this.writeDependencies=[],this.document=void 0,this.required=!1,this.properties=new Set,this._listener=void 0,this.document=Z,Z.getRoot()._enableExtension(this),this._listener=(X)=>{let Y=X,$=Y.target;if($ instanceof IQ&&$.extensionName===this.extensionName){if(Y.type==="node:create")this._addExtensionProperty($);if(Y.type==="node:dispose")this._removeExtensionProperty($)}};let J=Z.getGraph();J.addEventListener("node:create",this._listener),J.addEventListener("node:dispose",this._listener)}dispose(){this.document.getRoot()._disableExtension(this);let Z=this.document.getGraph();Z.removeEventListener("node:create",this._listener),Z.removeEventListener("node:dispose",this._listener);for(let J of this.properties)J.dispose()}static register(){}isRequired(){return this.required}setRequired(Z){return this.required=Z,this}listProperties(){return Array.from(this.properties)}_addExtensionProperty(Z){return this.properties.add(Z),this}_removeExtensionProperty(Z){return this.properties.delete(Z),this}install(Z,J){return this}preread(Z,J){return this}prewrite(Z,J){return this}}_c.EXTENSION_NAME=void 0;class Ac{constructor(Z){this.jsonDoc=void 0,this.buffers=[],this.bufferViews=[],this.bufferViewBuffers=[],this.accessors=[],this.textures=[],this.textureInfos=new Map,this.materials=[],this.meshes=[],this.cameras=[],this.nodes=[],this.skins=[],this.animations=[],this.scenes=[],this.jsonDoc=Z}setTextureInfo(Z,J){if(this.textureInfos.set(Z,J),J.texCoord!==void 0)Z.setTexCoord(J.texCoord);if(J.extras!==void 0)Z.setExtras(J.extras);let X=this.jsonDoc.json.textures[J.index];if(X.sampler===void 0)return;let Y=this.jsonDoc.json.samplers[X.sampler];if(Y.magFilter!==void 0)Z.setMagFilter(Y.magFilter);if(Y.minFilter!==void 0)Z.setMinFilter(Y.minFilter);if(Y.wrapS!==void 0)Z.setWrapS(Y.wrapS);if(Y.wrapT!==void 0)Z.setWrapT(Y.wrapT)}}var Pc={logger:O5.DEFAULT_INSTANCE,extensions:[],dependencies:{}},Qq1=new Set([a.BUFFER,a.TEXTURE,a.MATERIAL,a.MESH,a.PRIMITIVE,a.NODE,a.SCENE]);class xc{static read(Z,J=Pc){let X=c6({},Pc,J),{json:Y}=Z,$=new C6().setLogger(X.logger);this.validate(Z,X);let Q=new Ac(Z),W=Y.asset,K=$.getRoot().getAsset();if(W.copyright)K.copyright=W.copyright;if(W.extras)K.extras=W.extras;if(Y.extras!==void 0)$.getRoot().setExtras(c6({},Y.extras));let G=Y.extensionsUsed||[],H=Y.extensionsRequired||[];X.extensions.sort((D,C)=>D.EXTENSION_NAME>C.EXTENSION_NAME?1:-1);for(let D of X.extensions)if(G.includes(D.EXTENSION_NAME)){let C=$.createExtension(D).setRequired(H.includes(D.EXTENSION_NAME)),k=C.prereadTypes.filter((T)=>!Qq1.has(T));if(k.length)X.logger.warn(`Preread hooks for some types (${k.join()}), requested by extension ${C.extensionName}, are unsupported. Please file an issue or a PR.`);for(let T of C.readDependencies)C.install(T,X.dependencies[T])}let z=Y.buffers||[];$.getRoot().listExtensionsUsed().filter((D)=>D.prereadTypes.includes(a.BUFFER)).forEach((D)=>D.preread(Q,a.BUFFER)),Q.buffers=z.map((D)=>{let C=$.createBuffer(D.name);if(D.extras)C.setExtras(D.extras);if(D.uri&&D.uri.indexOf("__")!==0)C.setURI(D.uri);return C});let q=Y.bufferViews||[];Q.bufferViewBuffers=q.map((D,C)=>{if(!Q.bufferViews[C]){let k=Z.json.buffers[D.buffer],T=k.uri?Z.resources[k.uri]:Z.resources[fU],x=D.byteOffset||0;Q.bufferViews[C]=n0.toView(T,x,D.byteLength)}return Q.buffers[D.buffer]});let V=Y.accessors||[];Q.accessors=V.map((D)=>{let C=Q.bufferViewBuffers[D.bufferView],k=$.createAccessor(D.name,C).setType(D.type);if(D.extras)k.setExtras(D.extras);if(D.normalized!==void 0)k.setNormalized(D.normalized);if(D.bufferView===void 0)return k;return k.setArray(hU(D,Q)),k});let F=Y.images||[],U=Y.textures||[];$.getRoot().listExtensionsUsed().filter((D)=>D.prereadTypes.includes(a.TEXTURE)).forEach((D)=>D.preread(Q,a.TEXTURE)),Q.textures=F.map((D)=>{let C=$.createTexture(D.name);if(D.extras)C.setExtras(D.extras);if(D.bufferView!==void 0){let k=Y.bufferViews[D.bufferView],T=Z.json.buffers[k.buffer],x=T.uri?Z.resources[T.uri]:Z.resources[fU],S=k.byteOffset||0,h=k.byteLength,I=x.slice(S,S+h);C.setImage(I)}else if(D.uri!==void 0){if(C.setImage(Z.resources[D.uri]),D.uri.indexOf("__")!==0)C.setURI(D.uri)}if(D.mimeType!==void 0)C.setMimeType(D.mimeType);else if(D.uri){let k=zZ.extension(D.uri);C.setMimeType(HZ.extensionToMimeType(k))}return C}),$.getRoot().listExtensionsUsed().filter((D)=>D.prereadTypes.includes(a.MATERIAL)).forEach((D)=>D.preread(Q,a.MATERIAL));let w=Y.materials||[];Q.materials=w.map((D)=>{let C=$.createMaterial(D.name);if(D.extras)C.setExtras(D.extras);if(D.alphaMode!==void 0)C.setAlphaMode(D.alphaMode);if(D.alphaCutoff!==void 0)C.setAlphaCutoff(D.alphaCutoff);if(D.doubleSided!==void 0)C.setDoubleSided(D.doubleSided);let k=D.pbrMetallicRoughness||{};if(k.baseColorFactor!==void 0)C.setBaseColorFactor(k.baseColorFactor);if(D.emissiveFactor!==void 0)C.setEmissiveFactor(D.emissiveFactor);if(k.metallicFactor!==void 0)C.setMetallicFactor(k.metallicFactor);if(k.roughnessFactor!==void 0)C.setRoughnessFactor(k.roughnessFactor);if(k.baseColorTexture!==void 0){let T=k.baseColorTexture,x=Q.textures[U[T.index].source];C.setBaseColorTexture(x),Q.setTextureInfo(C.getBaseColorTextureInfo(),T)}if(D.emissiveTexture!==void 0){let T=D.emissiveTexture,x=Q.textures[U[T.index].source];C.setEmissiveTexture(x),Q.setTextureInfo(C.getEmissiveTextureInfo(),T)}if(D.normalTexture!==void 0){let T=D.normalTexture,x=Q.textures[U[T.index].source];if(C.setNormalTexture(x),Q.setTextureInfo(C.getNormalTextureInfo(),T),D.normalTexture.scale!==void 0)C.setNormalScale(D.normalTexture.scale)}if(D.occlusionTexture!==void 0){let T=D.occlusionTexture,x=Q.textures[U[T.index].source];if(C.setOcclusionTexture(x),Q.setTextureInfo(C.getOcclusionTextureInfo(),T),D.occlusionTexture.strength!==void 0)C.setOcclusionStrength(D.occlusionTexture.strength)}if(k.metallicRoughnessTexture!==void 0){let T=k.metallicRoughnessTexture,x=Q.textures[U[T.index].source];C.setMetallicRoughnessTexture(x),Q.setTextureInfo(C.getMetallicRoughnessTextureInfo(),T)}return C}),$.getRoot().listExtensionsUsed().filter((D)=>D.prereadTypes.includes(a.MESH)).forEach((D)=>D.preread(Q,a.MESH));let L=Y.meshes||[];$.getRoot().listExtensionsUsed().filter((D)=>D.prereadTypes.includes(a.PRIMITIVE)).forEach((D)=>D.preread(Q,a.PRIMITIVE)),Q.meshes=L.map((D)=>{let C=$.createMesh(D.name);if(D.extras)C.setExtras(D.extras);if(D.weights!==void 0)C.setWeights(D.weights);return(D.primitives||[]).forEach((T)=>{let x=$.createPrimitive();if(T.extras)x.setExtras(T.extras);if(T.material!==void 0)x.setMaterial(Q.materials[T.material]);if(T.mode!==void 0)x.setMode(T.mode);for(let[I,v]of Object.entries(T.attributes||{}))x.setAttribute(I,Q.accessors[v]);if(T.indices!==void 0)x.setIndices(Q.accessors[T.indices]);let S=D.extras&&D.extras.targetNames||[];(T.targets||[]).forEach((I,v)=>{let A=S[v]||v.toString(),p=$.createPrimitiveTarget(A);for(let[n,o]of Object.entries(I))p.setAttribute(n,Q.accessors[o]);x.addTarget(p)}),C.addPrimitive(x)}),C});let O=Y.cameras||[];Q.cameras=O.map((D)=>{let C=$.createCamera(D.name).setType(D.type);if(D.extras)C.setExtras(D.extras);if(D.type===eX.Type.PERSPECTIVE){let k=D.perspective;if(C.setYFov(k.yfov),C.setZNear(k.znear),k.zfar!==void 0)C.setZFar(k.zfar);if(k.aspectRatio!==void 0)C.setAspectRatio(k.aspectRatio)}else{let k=D.orthographic;C.setZNear(k.znear).setZFar(k.zfar).setXMag(k.xmag).setYMag(k.ymag)}return C});let N=Y.nodes||[];$.getRoot().listExtensionsUsed().filter((D)=>D.prereadTypes.includes(a.NODE)).forEach((D)=>D.preread(Q,a.NODE)),Q.nodes=N.map((D)=>{let C=$.createNode(D.name);if(D.extras)C.setExtras(D.extras);if(D.translation!==void 0)C.setTranslation(D.translation);if(D.rotation!==void 0)C.setRotation(D.rotation);if(D.scale!==void 0)C.setScale(D.scale);if(D.matrix!==void 0){let k=[0,0,0],T=[0,0,0,1],x=[1,1,1];c0.decompose(D.matrix,k,T,x),C.setTranslation(k),C.setRotation(T),C.setScale(x)}if(D.weights!==void 0)C.setWeights(D.weights);return C});let M=Y.skins||[];Q.skins=M.map((D)=>{let C=$.createSkin(D.name);if(D.extras)C.setExtras(D.extras);if(D.inverseBindMatrices!==void 0)C.setInverseBindMatrices(Q.accessors[D.inverseBindMatrices]);if(D.skeleton!==void 0)C.setSkeleton(Q.nodes[D.skeleton]);for(let k of D.joints)C.addJoint(Q.nodes[k]);return C}),N.map((D,C)=>{let k=Q.nodes[C];if((D.children||[]).forEach((x)=>k.addChild(Q.nodes[x])),D.mesh!==void 0)k.setMesh(Q.meshes[D.mesh]);if(D.camera!==void 0)k.setCamera(Q.cameras[D.camera]);if(D.skin!==void 0)k.setSkin(Q.skins[D.skin])});let j=Y.animations||[];Q.animations=j.map((D)=>{let C=$.createAnimation(D.name);if(D.extras)C.setExtras(D.extras);let T=(D.samplers||[]).map((S)=>{let h=$.createAnimationSampler().setInput(Q.accessors[S.input]).setOutput(Q.accessors[S.output]).setInterpolation(S.interpolation||EQ.Interpolation.LINEAR);if(S.extras)h.setExtras(S.extras);return C.addSampler(h),h});return(D.channels||[]).forEach((S)=>{let h=$.createAnimationChannel().setSampler(T[S.sampler]).setTargetPath(S.target.path);if(S.target.node!==void 0)h.setTargetNode(Q.nodes[S.target.node]);if(S.extras)h.setExtras(S.extras);C.addChannel(h)}),C});let P=Y.scenes||[];if($.getRoot().listExtensionsUsed().filter((D)=>D.prereadTypes.includes(a.SCENE)).forEach((D)=>D.preread(Q,a.SCENE)),Q.scenes=P.map((D)=>{let C=$.createScene(D.name);if(D.extras)C.setExtras(D.extras);return(D.nodes||[]).map((T)=>Q.nodes[T]).forEach((T)=>C.addChild(T)),C}),Y.scene!==void 0)$.getRoot().setDefaultScene(Q.scenes[Y.scene]);return $.getRoot().listExtensionsUsed().forEach((D)=>D.read(Q)),V.forEach((D,C)=>{let k=Q.accessors[C],T=!!D.sparse,x=!D.bufferView&&!k.getArray();if(T||x)k.setSparse(!0).setArray(Kq1(D,Q))}),$}static validate(Z,J){let X=Z.json;if(X.asset.version!=="2.0")throw new Error(`Unsupported glTF version, "${X.asset.version}".`);if(X.extensionsRequired){for(let Y of X.extensionsRequired)if(!J.extensions.find(($)=>$.EXTENSION_NAME===Y))throw new Error(`Missing required extension, "${Y}".`)}if(X.extensionsUsed){for(let Y of X.extensionsUsed)if(!J.extensions.find(($)=>$.EXTENSION_NAME===Y))J.logger.warn(`Missing optional extension, "${Y}".`)}}}function Wq1(Z,J){let X=J.jsonDoc,Y=J.bufferViews[Z.bufferView],$=X.json.bufferViews[Z.bufferView],Q=qJ[Z.componentType],W=v0.getElementSize(Z.type),K=Q.BYTES_PER_ELEMENT,G=Z.byteOffset||0,H=new Q(Z.count*W),z=new DataView(Y.buffer,Y.byteOffset,Y.byteLength),q=$.byteStride;for(let V=0;V<Z.count;V++)for(let F=0;F<W;F++){let U=G+V*q+F*K,w;switch(Z.componentType){case v0.ComponentType.FLOAT:w=z.getFloat32(U,!0);break;case v0.ComponentType.UNSIGNED_INT:w=z.getUint32(U,!0);break;case v0.ComponentType.UNSIGNED_SHORT:w=z.getUint16(U,!0);break;case v0.ComponentType.UNSIGNED_BYTE:w=z.getUint8(U);break;case v0.ComponentType.SHORT:w=z.getInt16(U,!0);break;case v0.ComponentType.BYTE:w=z.getInt8(U);break;default:throw new Error(`Unexpected componentType "${Z.componentType}".`)}H[V*W+F]=w}return H}function hU(Z,J){let X=J.jsonDoc,Y=J.bufferViews[Z.bufferView],$=X.json.bufferViews[Z.bufferView],Q=qJ[Z.componentType],W=v0.getElementSize(Z.type),K=Q.BYTES_PER_ELEMENT,G=W*K;if($.byteStride!==void 0&&$.byteStride!==G)return Wq1(Z,J);let H=Y.byteOffset+(Z.byteOffset||0),z=Z.count*W*K;return new Q(Y.buffer.slice(H,H+z))}function Kq1(Z,J){let X=qJ[Z.componentType],Y=v0.getElementSize(Z.type),$;if(Z.bufferView!==void 0)$=hU(Z,J);else $=new X(Z.count*Y);let Q=Z.sparse;if(!Q)return $;let W=Q.count,K=c6({},Z,Q.indices,{count:W,type:"SCALAR"}),G=c6({},Z,Q.values,{count:W}),H=hU(K,J),z=hU(G,J);for(let q=0;q<K.count;q++)for(let V=0;V<Y;V++)$[H[q]*Y+V]=z[q*Y+V];return $}var JG;(function(Z){Z[Z.ARRAY_BUFFER=34962]="ARRAY_BUFFER",Z[Z.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER"})(JG||(JG={}));class HJ{constructor(Z,J,X){this._doc=void 0,this.jsonDoc=void 0,this.options=void 0,this.accessorIndexMap=new Map,this.animationIndexMap=new Map,this.bufferIndexMap=new Map,this.cameraIndexMap=new Map,this.skinIndexMap=new Map,this.materialIndexMap=new Map,this.meshIndexMap=new Map,this.nodeIndexMap=new Map,this.imageIndexMap=new Map,this.textureDefIndexMap=new Map,this.textureInfoDefMap=new Map,this.samplerDefIndexMap=new Map,this.sceneIndexMap=new Map,this.imageBufferViews=[],this.otherBufferViews=new Map,this.otherBufferViewsIndexMap=new Map,this.extensionData={},this.bufferURIGenerator=void 0,this.imageURIGenerator=void 0,this.logger=void 0,this._accessorUsageMap=new Map,this.accessorUsageGroupedByParent=new Set(["ARRAY_BUFFER"]),this.accessorParents=new Map,this._doc=Z,this.jsonDoc=J,this.options=X;let Y=Z.getRoot(),$=Y.listBuffers().length,Q=Y.listTextures().length;this.bufferURIGenerator=new ND($>1,()=>X.basename||"buffer"),this.imageURIGenerator=new ND(Q>1,(W)=>Gq1(Z,W)||X.basename||"texture"),this.logger=Z.getLogger()}createTextureInfoDef(Z,J){let X={magFilter:J.getMagFilter()||void 0,minFilter:J.getMinFilter()||void 0,wrapS:J.getWrapS(),wrapT:J.getWrapT()},Y=JSON.stringify(X);if(!this.samplerDefIndexMap.has(Y))this.samplerDefIndexMap.set(Y,this.jsonDoc.json.samplers.length),this.jsonDoc.json.samplers.push(X);let $={source:this.imageIndexMap.get(Z),sampler:this.samplerDefIndexMap.get(Y)},Q=JSON.stringify($);if(!this.textureDefIndexMap.has(Q))this.textureDefIndexMap.set(Q,this.jsonDoc.json.textures.length),this.jsonDoc.json.textures.push($);let W={index:this.textureDefIndexMap.get(Q)};if(J.getTexCoord()!==0)W.texCoord=J.getTexCoord();if(Object.keys(J.getExtras()).length>0)W.extras=J.getExtras();return this.textureInfoDefMap.set(J,W),W}createPropertyDef(Z){let J={};if(Z.getName())J.name=Z.getName();if(Object.keys(Z.getExtras()).length>0)J.extras=Z.getExtras();return J}createAccessorDef(Z){let J=this.createPropertyDef(Z);if(J.type=Z.getType(),J.componentType=Z.getComponentType(),J.count=Z.getCount(),this._doc.getGraph().listParentEdges(Z).some((Y)=>Y.getName()==="attributes"&&Y.getAttributes().key==="POSITION"||Y.getName()==="input"))J.max=Z.getMax([]).map(Math.fround),J.min=Z.getMin([]).map(Math.fround);if(Z.getNormalized())J.normalized=Z.getNormalized();return J}createImageData(Z,J,X){if(this.options.format===GZ.GLB)this.imageBufferViews.push(J),Z.bufferView=this.jsonDoc.json.bufferViews.length,this.jsonDoc.json.bufferViews.push({buffer:0,byteOffset:-1,byteLength:J.byteLength});else{let Y=HZ.mimeTypeToExtension(X.getMimeType());Z.uri=this.imageURIGenerator.createURI(X,Y),this.assignResourceURI(Z.uri,J,!1)}}assignResourceURI(Z,J,X){let Y=this.jsonDoc.resources;if(!(Z in Y)){Y[Z]=J;return}if(J===Y[Z]){this.logger.warn(`Duplicate resource URI, "${Z}".`);return}let $=`Resource URI "${Z}" already assigned to different data.`;if(!X){this.logger.warn($);return}throw new Error($)}getAccessorUsage(Z){let J=this._accessorUsageMap.get(Z);if(J)return J;if(Z.getSparse())return c5.SPARSE;for(let X of this._doc.getGraph().listParentEdges(Z)){let{usage:Y}=X.getAttributes();if(Y)return Y;if(X.getParent().propertyType!==a.ROOT)this.logger.warn(`Missing attribute ".usage" on edge, "${X.getName()}".`)}return c5.OTHER}addAccessorToUsageGroup(Z,J){let X=this._accessorUsageMap.get(Z);if(X&&X!==J)throw new Error(`Accessor with usage "${X}" cannot be reused as "${J}".`);return this._accessorUsageMap.set(Z,J),this}}HJ.BufferViewTarget=JG;HJ.BufferViewUsage=c5;HJ.USAGE_TO_TARGET={[c5.ARRAY_BUFFER]:JG.ARRAY_BUFFER,[c5.ELEMENT_ARRAY_BUFFER]:JG.ELEMENT_ARRAY_BUFFER};class ND{constructor(Z,J){this.multiple=void 0,this.basename=void 0,this.counter={},this.multiple=Z,this.basename=J}createURI(Z,J){if(Z.getURI())return Z.getURI();else if(!this.multiple)return`${this.basename(Z)}.${J}`;else{let X=this.basename(Z);return this.counter[X]=this.counter[X]||1,`${X}_${this.counter[X]++}.${J}`}}}function Gq1(Z,J){let X=Z.getGraph().listParentEdges(J).find((Y)=>Y.getParent()!==Z.getRoot());return X?X.getName().replace(/texture$/i,""):""}var{BufferViewUsage:xU}=HJ,{UNSIGNED_INT:Hq1,UNSIGNED_SHORT:zq1,UNSIGNED_BYTE:qq1}=v0.ComponentType,Vq1=new Set([a.ACCESSOR,a.BUFFER,a.MATERIAL,a.MESH]);class hc{static write(Z,J){let X=Z.getGraph(),Y=Z.getRoot(),$={asset:c6({generator:`glTF-Transform ${Tc}`},Y.getAsset()),extras:c6({},Y.getExtras())},Q={json:$,resources:{}},W=new HJ(Z,Q,J),K=J.logger||O5.DEFAULT_INSTANCE,G=new Set(J.extensions.map((L)=>L.EXTENSION_NAME)),H=Z.getRoot().listExtensionsUsed().filter((L)=>G.has(L.extensionName)).sort((L,O)=>L.extensionName>O.extensionName?1:-1),z=Z.getRoot().listExtensionsRequired().filter((L)=>G.has(L.extensionName)).sort((L,O)=>L.extensionName>O.extensionName?1:-1);if(H.length<Z.getRoot().listExtensionsUsed().length)K.warn("Some extensions were not registered for I/O, and will not be written.");for(let L of H){let O=L.prewriteTypes.filter((N)=>!Vq1.has(N));if(O.length)K.warn(`Prewrite hooks for some types (${O.join()}), requested by extension ${L.extensionName}, are unsupported. Please file an issue or a PR.`);for(let N of L.writeDependencies)L.install(N,J.dependencies[N])}function q(L,O,N,M){let j=[],P=0;for(let k of L){let T=W.createAccessorDef(k);T.bufferView=$.bufferViews.length;let x=k.getArray(),S=n0.pad(n0.toView(x));T.byteOffset=P,P+=S.byteLength,j.push(S),W.accessorIndexMap.set(k,$.accessors.length),$.accessors.push(T)}let D=n0.concat(j),C={buffer:O,byteOffset:N,byteLength:D.byteLength};if(M)C.target=M;return $.bufferViews.push(C),{buffers:j,byteLength:P}}function V(L,O,N){let M=L[0].getCount(),j=0;for(let T of L){let x=W.createAccessorDef(T);x.bufferView=$.bufferViews.length,x.byteOffset=j;let S=T.getElementSize(),h=T.getComponentSize();j+=n0.padNumber(S*h),W.accessorIndexMap.set(T,$.accessors.length),$.accessors.push(x)}let P=M*j,D=new ArrayBuffer(P),C=new DataView(D);for(let T=0;T<M;T++){let x=0;for(let S of L){let h=S.getElementSize(),I=S.getComponentSize(),v=S.getComponentType(),A=S.getArray();for(let p=0;p<h;p++){let n=T*j+x+p*I,o=A[T*h+p];switch(v){case v0.ComponentType.FLOAT:C.setFloat32(n,o,!0);break;case v0.ComponentType.BYTE:C.setInt8(n,o);break;case v0.ComponentType.SHORT:C.setInt16(n,o,!0);break;case v0.ComponentType.UNSIGNED_BYTE:C.setUint8(n,o);break;case v0.ComponentType.UNSIGNED_SHORT:C.setUint16(n,o,!0);break;case v0.ComponentType.UNSIGNED_INT:C.setUint32(n,o,!0);break;default:throw new Error("Unexpected component type: "+v)}}x+=n0.padNumber(h*I)}}let k={buffer:O,byteOffset:N,byteLength:P,byteStride:j,target:HJ.BufferViewTarget.ARRAY_BUFFER};return $.bufferViews.push(k),{byteLength:P,buffers:[new Uint8Array(D)]}}function F(L,O,N){let M=[],j=0,P=new Map,D=-1/0,C=!1;for(let v of L){let A=W.createAccessorDef(v);$.accessors.push(A),W.accessorIndexMap.set(v,$.accessors.length-1);let p=[],n=[],o=[],X0=new Array(v.getElementSize()).fill(0);for(let a0=0,I8=v.getCount();a0<I8;a0++){if(v.getElement(a0,o),c0.eq(o,X0,0))continue;D=Math.max(a0,D),p.push(a0);for(let s1=0;s1<o.length;s1++)n.push(o[s1])}let Q0=p.length,E0={accessorDef:A,count:Q0};if(P.set(v,E0),Q0===0)continue;if(Q0>v.getCount()/2)C=!0;let I0=qJ[v.getComponentType()];E0.indices=p,E0.values=new I0(n)}if(!Number.isFinite(D))return{buffers:M,byteLength:j};if(C)K.warn("Some sparse accessors have >50% non-zero elements, which may increase file size.");let k=D<255?Uint8Array:D<65535?Uint16Array:Uint32Array,T=D<255?qq1:D<65535?zq1:Hq1,x={buffer:O,byteOffset:N+j,byteLength:0};for(let v of L){let A=P.get(v);if(A.count===0)continue;A.indicesByteOffset=x.byteLength;let p=n0.pad(n0.toView(new k(A.indices)));M.push(p),j+=p.byteLength,x.byteLength+=p.byteLength}$.bufferViews.push(x);let S=$.bufferViews.length-1,h={buffer:O,byteOffset:N+j,byteLength:0};for(let v of L){let A=P.get(v);if(A.count===0)continue;A.valuesByteOffset=h.byteLength;let p=n0.pad(n0.toView(A.values));M.push(p),j+=p.byteLength,h.byteLength+=p.byteLength}$.bufferViews.push(h);let I=$.bufferViews.length-1;for(let v of L){let A=P.get(v);if(A.count===0)continue;A.accessorDef.sparse={count:A.count,indices:{bufferView:S,byteOffset:A.indicesByteOffset,componentType:T},values:{bufferView:I,byteOffset:A.valuesByteOffset}}}return{buffers:M,byteLength:j}}if($.accessors=[],$.bufferViews=[],$.samplers=[],$.textures=[],$.images=Y.listTextures().map((L,O)=>{let N=W.createPropertyDef(L);if(L.getMimeType())N.mimeType=L.getMimeType();let M=L.getImage();if(M)W.createImageData(N,M,L);return W.imageIndexMap.set(L,O),N}),H.filter((L)=>L.prewriteTypes.includes(a.ACCESSOR)).forEach((L)=>L.prewrite(W,a.ACCESSOR)),Y.listAccessors().forEach((L)=>{let{accessorUsageGroupedByParent:O,accessorParents:N}=W;if(W.accessorIndexMap.has(L))return;let M=W.getAccessorUsage(L);if(W.addAccessorToUsageGroup(L,M),O.has(M)){let j=X.listParents(L).find((P)=>P.propertyType!==a.ROOT);N.set(L,j)}}),H.filter((L)=>L.prewriteTypes.includes(a.BUFFER)).forEach((L)=>L.prewrite(W,a.BUFFER)),(Y.listAccessors().length>0||W.otherBufferViews.size>0||Y.listTextures().length>0&&J.format===GZ.GLB)&&Y.listBuffers().length===0)throw new Error("Buffer required for Document resources, but none was found.");if($.buffers=[],Y.listBuffers().forEach((L,O)=>{let N=W.createPropertyDef(L),M=W.accessorUsageGroupedByParent,j=L.listParents().filter((h)=>h instanceof v0),P=new Set(j.map((h)=>W.accessorParents.get(h))),D=new Map(Array.from(P).map((h,I)=>[h,I])),C={};for(let h of j){var k;if(W.accessorIndexMap.has(h))continue;let I=W.getAccessorUsage(h),v=I;if(M.has(I)){let A=W.accessorParents.get(h);v+=`:${D.get(A)}`}C[k=v]||(C[k]={usage:I,accessors:[]}),C[v].accessors.push(h)}let T=[],x=$.buffers.length,S=0;for(let{usage:h,accessors:I}of Object.values(C))if(h===xU.ARRAY_BUFFER&&J.vertexLayout===bU.INTERLEAVED){let v=V(I,x,S);S+=v.byteLength;for(let A of v.buffers)T.push(A)}else if(h===xU.ARRAY_BUFFER)for(let v of I){let A=V([v],x,S);S+=A.byteLength;for(let p of A.buffers)T.push(p)}else if(h===xU.SPARSE){let v=F(I,x,S);S+=v.byteLength;for(let A of v.buffers)T.push(A)}else if(h===xU.ELEMENT_ARRAY_BUFFER){let v=HJ.BufferViewTarget.ELEMENT_ARRAY_BUFFER,A=q(I,x,S,v);S+=A.byteLength;for(let p of A.buffers)T.push(p)}else{let v=q(I,x,S);S+=v.byteLength;for(let A of v.buffers)T.push(A)}if(W.imageBufferViews.length&&O===0){for(let h=0;h<W.imageBufferViews.length;h++)if($.bufferViews[$.images[h].bufferView].byteOffset=S,S+=W.imageBufferViews[h].byteLength,T.push(W.imageBufferViews[h]),S%8){let I=8-S%8;S+=I,T.push(new Uint8Array(I))}}if(W.otherBufferViews.has(L))for(let h of W.otherBufferViews.get(L))$.bufferViews.push({buffer:x,byteOffset:S,byteLength:h.byteLength}),W.otherBufferViewsIndexMap.set(h,$.bufferViews.length-1),S+=h.byteLength,T.push(h);if(S){let h;if(J.format===GZ.GLB)h=fU;else h=W.bufferURIGenerator.createURI(L,"bin"),N.uri=h;N.byteLength=S,W.assignResourceURI(h,n0.concat(T),!0)}$.buffers.push(N),W.bufferIndexMap.set(L,O)}),Y.listAccessors().find((L)=>!L.getBuffer()))K.warn("Skipped writing one or more Accessors: no Buffer assigned.");H.filter((L)=>L.prewriteTypes.includes(a.MATERIAL)).forEach((L)=>L.prewrite(W,a.MATERIAL)),$.materials=Y.listMaterials().map((L,O)=>{let N=W.createPropertyDef(L);if(L.getAlphaMode()!==J7.AlphaMode.OPAQUE)N.alphaMode=L.getAlphaMode();if(L.getAlphaMode()===J7.AlphaMode.MASK)N.alphaCutoff=L.getAlphaCutoff();if(L.getDoubleSided())N.doubleSided=!0;if(N.pbrMetallicRoughness={},!c0.eq(L.getBaseColorFactor(),[1,1,1,1]))N.pbrMetallicRoughness.baseColorFactor=L.getBaseColorFactor();if(!c0.eq(L.getEmissiveFactor(),[0,0,0]))N.emissiveFactor=L.getEmissiveFactor();if(L.getRoughnessFactor()!==1)N.pbrMetallicRoughness.roughnessFactor=L.getRoughnessFactor();if(L.getMetallicFactor()!==1)N.pbrMetallicRoughness.metallicFactor=L.getMetallicFactor();if(L.getBaseColorTexture()){let M=L.getBaseColorTexture(),j=L.getBaseColorTextureInfo();N.pbrMetallicRoughness.baseColorTexture=W.createTextureInfoDef(M,j)}if(L.getEmissiveTexture()){let M=L.getEmissiveTexture(),j=L.getEmissiveTextureInfo();N.emissiveTexture=W.createTextureInfoDef(M,j)}if(L.getNormalTexture()){let M=L.getNormalTexture(),j=L.getNormalTextureInfo(),P=W.createTextureInfoDef(M,j);if(L.getNormalScale()!==1)P.scale=L.getNormalScale();N.normalTexture=P}if(L.getOcclusionTexture()){let M=L.getOcclusionTexture(),j=L.getOcclusionTextureInfo(),P=W.createTextureInfoDef(M,j);if(L.getOcclusionStrength()!==1)P.strength=L.getOcclusionStrength();N.occlusionTexture=P}if(L.getMetallicRoughnessTexture()){let M=L.getMetallicRoughnessTexture(),j=L.getMetallicRoughnessTextureInfo();N.pbrMetallicRoughness.metallicRoughnessTexture=W.createTextureInfoDef(M,j)}return W.materialIndexMap.set(L,O),N}),H.filter((L)=>L.prewriteTypes.includes(a.MESH)).forEach((L)=>L.prewrite(W,a.MESH)),$.meshes=Y.listMeshes().map((L,O)=>{let N=W.createPropertyDef(L),M=null;if(N.primitives=L.listPrimitives().map((j)=>{let P={attributes:{}};P.mode=j.getMode();let D=j.getMaterial();if(D)P.material=W.materialIndexMap.get(D);if(Object.keys(j.getExtras()).length)P.extras=j.getExtras();let C=j.getIndices();if(C)P.indices=W.accessorIndexMap.get(C);for(let k of j.listSemantics())P.attributes[k]=W.accessorIndexMap.get(j.getAttribute(k));for(let k of j.listTargets()){let T={};for(let x of k.listSemantics())T[x]=W.accessorIndexMap.get(k.getAttribute(x));P.targets=P.targets||[],P.targets.push(T)}if(j.listTargets().length&&!M)M=j.listTargets().map((k)=>k.getName());return P}),L.getWeights().length)N.weights=L.getWeights();if(M)N.extras=N.extras||{},N.extras.targetNames=M;return W.meshIndexMap.set(L,O),N}),$.cameras=Y.listCameras().map((L,O)=>{let N=W.createPropertyDef(L);if(N.type=L.getType(),N.type===eX.Type.PERSPECTIVE){N.perspective={znear:L.getZNear(),zfar:L.getZFar(),yfov:L.getYFov()};let M=L.getAspectRatio();if(M!==null)N.perspective.aspectRatio=M}else N.orthographic={znear:L.getZNear(),zfar:L.getZFar(),xmag:L.getXMag(),ymag:L.getYMag()};return W.cameraIndexMap.set(L,O),N}),$.nodes=Y.listNodes().map((L,O)=>{let N=W.createPropertyDef(L);if(!c0.eq(L.getTranslation(),[0,0,0]))N.translation=L.getTranslation();if(!c0.eq(L.getRotation(),[0,0,0,1]))N.rotation=L.getRotation();if(!c0.eq(L.getScale(),[1,1,1]))N.scale=L.getScale();if(L.getWeights().length)N.weights=L.getWeights();return W.nodeIndexMap.set(L,O),N}),$.skins=Y.listSkins().map((L,O)=>{let N=W.createPropertyDef(L),M=L.getInverseBindMatrices();if(M)N.inverseBindMatrices=W.accessorIndexMap.get(M);let j=L.getSkeleton();if(j)N.skeleton=W.nodeIndexMap.get(j);return N.joints=L.listJoints().map((P)=>W.nodeIndexMap.get(P)),W.skinIndexMap.set(L,O),N}),Y.listNodes().forEach((L,O)=>{let N=$.nodes[O],M=L.getMesh();if(M)N.mesh=W.meshIndexMap.get(M);let j=L.getCamera();if(j)N.camera=W.cameraIndexMap.get(j);let P=L.getSkin();if(P)N.skin=W.skinIndexMap.get(P);if(L.listChildren().length>0)N.children=L.listChildren().map((D)=>W.nodeIndexMap.get(D))}),$.animations=Y.listAnimations().map((L,O)=>{let N=W.createPropertyDef(L),M=new Map;return N.samplers=L.listSamplers().map((j,P)=>{let D=W.createPropertyDef(j);return D.input=W.accessorIndexMap.get(j.getInput()),D.output=W.accessorIndexMap.get(j.getOutput()),D.interpolation=j.getInterpolation(),M.set(j,P),D}),N.channels=L.listChannels().map((j)=>{let P=W.createPropertyDef(j);return P.sampler=M.get(j.getSampler()),P.target={node:W.nodeIndexMap.get(j.getTargetNode()),path:j.getTargetPath()},P}),W.animationIndexMap.set(L,O),N}),$.scenes=Y.listScenes().map((L,O)=>{let N=W.createPropertyDef(L);return N.nodes=L.listChildren().map((M)=>W.nodeIndexMap.get(M)),W.sceneIndexMap.set(L,O),N});let w=Y.getDefaultScene();if(w)$.scene=Y.listScenes().indexOf(w);return $.extensionsUsed=H.map((L)=>L.extensionName),$.extensionsRequired=z.map((L)=>L.extensionName),H.forEach((L)=>L.write(W)),Fq1($),Q}}function Fq1(Z){let J=[];for(let X in Z){let Y=Z[X];if(Array.isArray(Y)&&Y.length===0)J.push(X);else if(Y===null||Y==="")J.push(X);else if(Y&&typeof Y==="object"&&Object.keys(Y).length===0)J.push(X)}for(let X of J)delete Z[X]}var mU;(function(Z){Z[Z.JSON=1313821514]="JSON",Z[Z.BIN=5130562]="BIN"})(mU||(mU={}));class fc{constructor(){this._logger=O5.DEFAULT_INSTANCE,this._extensions=new Set,this._dependencies={},this._vertexLayout=bU.INTERLEAVED,this.lastReadBytes=0,this.lastWriteBytes=0}setLogger(Z){return this._logger=Z,this}registerExtensions(Z){for(let J of Z)this._extensions.add(J),J.register();return this}registerDependencies(Z){return Object.assign(this._dependencies,Z),this}setVertexLayout(Z){return this._vertexLayout=Z,this}async read(Z){return await this.readJSON(await this.readAsJSON(Z))}async readAsJSON(Z){let J=await this.readURI(Z,"view");this.lastReadBytes=J.byteLength;let X=Cc(J)?this._binaryToJSON(J):{json:JSON.parse(n0.decodeText(J)),resources:{}};return await this._readResourcesExternal(X,this.dirname(Z)),this._readResourcesInternal(X),X}async readJSON(Z){return Z=this._copyJSON(Z),this._readResourcesInternal(Z),xc.read(Z,{extensions:Array.from(this._extensions),dependencies:this._dependencies,logger:this._logger})}async binaryToJSON(Z){let J=this._binaryToJSON(n0.assertView(Z));this._readResourcesInternal(J);let X=J.json;if(X.buffers&&X.buffers.some((Y)=>Uq1(J,Y)))throw new Error("Cannot resolve external buffers with binaryToJSON().");else if(X.images&&X.images.some((Y)=>Lq1(J,Y)))throw new Error("Cannot resolve external images with binaryToJSON().");return J}async readBinary(Z){return this.readJSON(await this.binaryToJSON(n0.assertView(Z)))}async writeJSON(Z,J={}){if(J.format===GZ.GLB&&Z.getRoot().listBuffers().length>1)throw new Error("GLB must have 0\u20131 buffers.");return hc.write(Z,{format:J.format||GZ.GLTF,basename:J.basename||"",logger:this._logger,vertexLayout:this._vertexLayout,dependencies:c6({},this._dependencies),extensions:Array.from(this._extensions)})}async writeBinary(Z){let{json:J,resources:X}=await this.writeJSON(Z,{format:GZ.GLB}),Y=new Uint32Array([1179937895,2,12]),$=JSON.stringify(J),Q=n0.pad(n0.encodeText($),32),W=n0.toView(new Uint32Array([Q.byteLength,1313821514])),K=n0.concat([W,Q]);Y[Y.length-1]+=K.byteLength;let G=Object.values(X)[0];if(!G||!G.byteLength)return n0.concat([n0.toView(Y),K]);let H=n0.pad(G,0),z=n0.toView(new Uint32Array([H.byteLength,5130562])),q=n0.concat([z,H]);return Y[Y.length-1]+=q.byteLength,n0.concat([n0.toView(Y),K,q])}async _readResourcesExternal(Z,J){var X=this;let Y=Z.json.images||[],$=Z.json.buffers||[],Q=[...Y,...$].map(async function(W){let K=W.uri;if(!K||K.match(/data:/))return Promise.resolve();Z.resources[K]=await X.readURI(X.resolve(J,K),"view"),X.lastReadBytes+=Z.resources[K].byteLength});await Promise.all(Q)}_readResourcesInternal(Z){function J($){if(!$.uri)return;if($.uri in Z.resources){n0.assertView(Z.resources[$.uri]);return}if($.uri.match(/data:/)){let Q=`__${Sc()}.${zZ.extension($.uri)}`;Z.resources[Q]=n0.createBufferFromDataURI($.uri),$.uri=Q}}(Z.json.images||[]).forEach(($)=>{if($.bufferView===void 0&&$.uri===void 0)throw new Error("Missing resource URI or buffer view.");J($)}),(Z.json.buffers||[]).forEach(J)}_copyJSON(Z){let{images:J,buffers:X}=Z.json;if(Z={json:c6({},Z.json),resources:c6({},Z.resources)},J)Z.json.images=J.map((Y)=>c6({},Y));if(X)Z.json.buffers=X.map((Y)=>c6({},Y));return Z}_binaryToJSON(Z){if(!Cc(Z))throw new Error("Invalid glTF 2.0 binary.");let J=new Uint32Array(Z.buffer,Z.byteOffset+12,2);if(J[1]!==mU.JSON)throw new Error("Missing required GLB JSON chunk.");let X=20,Y=J[0],$=n0.decodeText(n0.toView(Z,X,Y)),Q=JSON.parse($),W=X+Y;if(Z.byteLength<=W)return{json:Q,resources:{}};let K=new Uint32Array(Z.buffer,Z.byteOffset+W,2);if(K[1]!==mU.BIN)return{json:Q,resources:{}};let G=K[0],H=n0.toView(Z,W+8,G);return{json:Q,resources:{[fU]:H}}}}function Uq1(Z,J){return J.uri!==void 0&&!(J.uri in Z.resources)}function Lq1(Z,J){return J.uri!==void 0&&!(J.uri in Z.resources)&&J.bufferView===void 0}function Cc(Z){if(Z.byteLength<3*Uint32Array.BYTES_PER_ELEMENT)return!1;let J=new Uint32Array(Z.buffer,Z.byteOffset,3);return J[0]===1179937895&&J[1]===2}class ID extends fc{constructor(Z=null,J=R9.DEFAULT_INIT){super();this._fetch=void 0,this._fetchConfig=void 0,this._init=void 0,this._fetchEnabled=!1,this._fetch=Z,this._fetchConfig=J,this._init=this.init()}async init(){if(this._init)return this._init;return Promise.all([import("fs"),import("path")]).then(([Z,J])=>{this._fs=Z.promises,this._path=J})}setAllowNetwork(Z){if(Z&&!this._fetch)throw new Error("NodeIO requires a Fetch API implementation for HTTP requests.");return this._fetchEnabled=Z,this}async readURI(Z,J){if(await this.init(),R9.isAbsoluteURL(Z)){if(!this._fetchEnabled||!this._fetch)throw new Error("Network request blocked. Allow HTTP requests explicitly, if needed.");let X=await this._fetch(Z,this._fetchConfig);switch(J){case"view":return new Uint8Array(await X.arrayBuffer());case"text":return X.text()}}else switch(J){case"view":return this._fs.readFile(Z);case"text":return this._fs.readFile(Z,"utf8")}}resolve(Z,J){if(R9.isAbsoluteURL(Z)||R9.isAbsoluteURL(J))return R9.resolve(Z,J);return this._path.resolve(Z,decodeURIComponent(J))}dirname(Z){if(R9.isAbsoluteURL(Z))return R9.dirname(Z);return this._path.dirname(Z)}async write(Z,J){await this.init(),await(!!Z.match(/\.glb$/)?this._writeGLB(Z,J):this._writeGLTF(Z,J))}async _writeGLTF(Z,J){var X=this;this.lastWriteBytes=0;let{json:Y,resources:$}=await this.writeJSON(J,{format:GZ.GLTF,basename:zZ.basename(Z)}),{_fs:Q,_path:W}=this,K=W.dirname(Z),G=JSON.stringify(Y,null,2);await Q.writeFile(Z,G),this.lastWriteBytes+=G.length;for(let H of wq1(Object.keys($),10))await Promise.all(H.map(async function(z){if(R9.isAbsoluteURL(z)){if(R9.extension(z)==="bin")throw new Error(`Cannot write buffer to path "${z}".`);return}let q=W.join(K,decodeURIComponent(z));await Q.mkdir(W.dirname(q),{recursive:!0}),await Q.writeFile(q,$[z]),X.lastWriteBytes+=$[z].byteLength}))}async _writeGLB(Z,J){let X=await this.writeBinary(J);await this._fs.writeFile(Z,X),this.lastWriteBytes=X.byteLength}}function wq1(Z,J){let X=[];for(let Y=0,$=Z.length;Y<$;Y+=J){let Q=[];for(let W=0;W<J&&Y+W<$;W++)Q.push(Z[Y+W]);X.push(Q)}return X}var _i=t(vD(),1),Ai=t(Li(),1),KL1=t(Si(),1);async function GL1(Z,J){if(!(Z instanceof Uint8Array))throw new Error("[ndarray-pixels] Input must be Uint8Array or Buffer.");let{data:X,info:Y}=await Ai.default(Z).ensureAlpha().raw().toBuffer({resolveWithObject:!0});return _i.default(new Uint8Array(X),[Y.width,Y.height,4],[4,4*Y.width|0,1],0)}async function xi(Z,J){return GL1(Z)}var HL1="v4.1.3",GP="@glb.bin",s;(function(Z){Z.ACCESSOR="Accessor",Z.ANIMATION="Animation",Z.ANIMATION_CHANNEL="AnimationChannel",Z.ANIMATION_SAMPLER="AnimationSampler",Z.BUFFER="Buffer",Z.CAMERA="Camera",Z.MATERIAL="Material",Z.MESH="Mesh",Z.PRIMITIVE="Primitive",Z.PRIMITIVE_TARGET="PrimitiveTarget",Z.NODE="Node",Z.ROOT="Root",Z.SCENE="Scene",Z.SKIN="Skin",Z.TEXTURE="Texture",Z.TEXTURE_INFO="TextureInfo"})(s||(s={}));var hi;(function(Z){Z.INTERLEAVED="interleaved",Z.SEPARATE="separate"})(hi||(hi={}));var i5;(function(Z){Z.ARRAY_BUFFER="ARRAY_BUFFER",Z.ELEMENT_ARRAY_BUFFER="ELEMENT_ARRAY_BUFFER",Z.INVERSE_BIND_MATRICES="INVERSE_BIND_MATRICES",Z.OTHER="OTHER",Z.SPARSE="SPARSE"})(i5||(i5={}));var n5;(function(Z){Z[Z.R=4096]="R",Z[Z.G=256]="G",Z[Z.B=16]="B",Z[Z.A=1]="A"})(n5||(n5={}));var XP;(function(Z){Z.GLTF="GLTF",Z.GLB="GLB"})(XP||(XP={}));var YP=typeof Float32Array!=="undefined"?Float32Array:Array;if(!Math.hypot)Math.hypot=function(){var Z=0,J=arguments.length;while(J--)Z+=arguments[J]*arguments[J];return Math.sqrt(Z)};function zL1(){var Z=new YP(3);if(YP!=Float32Array)Z[0]=0,Z[1]=0,Z[2]=0;return Z}function JP(Z){var J=Z[0],X=Z[1],Y=Z[2];return Math.hypot(J,X,Y)}function qL1(Z,J,X){var Y=J[0],$=J[1],Q=J[2],W=X[3]*Y+X[7]*$+X[11]*Q+X[15];return W=W||1,Z[0]=(X[0]*Y+X[4]*$+X[8]*Q+X[12])/W,Z[1]=(X[1]*Y+X[5]*$+X[9]*Q+X[13])/W,Z[2]=(X[2]*Y+X[6]*$+X[10]*Q+X[14])/W,Z}(function(){var Z=zL1();return function(J,X,Y,$,Q,W){var K,G;if(!X)X=3;if(!Y)Y=0;if($)G=Math.min($*X+Y,J.length);else G=J.length;for(K=Y;K<G;K+=X)Z[0]=J[K],Z[1]=J[K+1],Z[2]=J[K+2],Q(Z,Z,W),J[K]=Z[0],J[K+1]=Z[1],J[K+2]=Z[2];return J}})();function gi(Z){let J=mi(),X=Z.propertyType===s.NODE?[Z]:Z.listChildren();for(let Y of X)Y.traverse(($)=>{let Q=$.getMesh();if(!Q)return;let W=VL1(Q,$.getWorldMatrix());if(W.min.every(isFinite)&&W.max.every(isFinite))$P(W.min,J),$P(W.max,J)});return J}function VL1(Z,J){let X=mi();for(let Y of Z.listPrimitives()){let $=Y.getAttribute("POSITION"),Q=Y.getIndices();if(!$)continue;let W=[0,0,0],K=[0,0,0];for(let G=0,H=Q?Q.getCount():$.getCount();G<H;G++){let z=Q?Q.getScalar(G):G;W=$.getElement(z,W),K=qL1(K,W,J),$P(K,X)}}return X}function $P(Z,J){for(let X=0;X<3;X++)J.min[X]=Math.min(Z[X],J.min[X]),J.max[X]=Math.max(Z[X],J.max[X])}function mi(){return{min:[1/0,1/0,1/0],max:[-1/0,-1/0,-1/0]}}class k6{static createBufferFromDataURI(Z){if(typeof Buffer==="undefined"){let J=atob(Z.split(",")[1]),X=new Uint8Array(J.length);for(let Y=0;Y<J.length;Y++)X[Y]=J.charCodeAt(Y);return X}else{let J=Z.split(",")[1],X=Z.indexOf("base64")>=0;return Buffer.from(J,X?"base64":"utf8")}}static encodeText(Z){return new TextEncoder().encode(Z)}static decodeText(Z){return new TextDecoder().decode(Z)}static concat(Z){let J=0;for(let $ of Z)J+=$.byteLength;let X=new Uint8Array(J),Y=0;for(let $ of Z)X.set($,Y),Y+=$.byteLength;return X}static pad(Z,J=0){let X=this.padNumber(Z.byteLength);if(X===Z.byteLength)return Z;let Y=new Uint8Array(X);if(Y.set(Z),J!==0)for(let $=Z.byteLength;$<X;$++)Y[$]=J;return Y}static padNumber(Z){return Math.ceil(Z/4)*4}static equals(Z,J){if(Z===J)return!0;if(Z.byteLength!==J.byteLength)return!1;let X=Z.byteLength;while(X--)if(Z[X]!==J[X])return!1;return!0}static toView(Z,J=0,X=1/0){return new Uint8Array(Z.buffer,Z.byteOffset+J,Math.min(Z.byteLength,X))}static assertView(Z){if(Z&&!ArrayBuffer.isView(Z))throw new Error(`Method requires Uint8Array parameter; received "${typeof Z}".`);return Z}}class ui{match(Z){return Z.length>=3&&Z[0]===255&&Z[1]===216&&Z[2]===255}getSize(Z){let J=new DataView(Z.buffer,Z.byteOffset+4),X,Y;while(J.byteLength){if(X=J.getUint16(0,!1),FL1(J,X),Y=J.getUint8(X+1),Y===192||Y===193||Y===194)return[J.getUint16(X+7,!1),J.getUint16(X+5,!1)];J=new DataView(Z.buffer,J.byteOffset+X+2)}throw new TypeError("Invalid JPG, no size found")}getChannels(Z){return 3}}class O2{match(Z){return Z.length>=8&&Z[0]===137&&Z[1]===80&&Z[2]===78&&Z[3]===71&&Z[4]===13&&Z[5]===10&&Z[6]===26&&Z[7]===10}getSize(Z){let J=new DataView(Z.buffer,Z.byteOffset);if(k6.decodeText(Z.slice(12,16))===O2.PNG_FRIED_CHUNK_NAME)return[J.getUint32(32,!1),J.getUint32(36,!1)];return[J.getUint32(16,!1),J.getUint32(20,!1)]}getChannels(Z){return 4}}O2.PNG_FRIED_CHUNK_NAME="CgBI";class V4{static registerFormat(Z,J){this.impls[Z]=J}static getMimeType(Z){for(let J in this.impls)if(this.impls[J].match(Z))return J;return null}static getSize(Z,J){if(!this.impls[J])return null;return this.impls[J].getSize(Z)}static getChannels(Z,J){if(!this.impls[J])return null;return this.impls[J].getChannels(Z)}static getVRAMByteLength(Z,J){if(!this.impls[J])return null;if(this.impls[J].getVRAMByteLength)return this.impls[J].getVRAMByteLength(Z);let X=0,Y=4,$=this.getSize(Z,J);if(!$)return null;while($[0]>1||$[1]>1)X+=$[0]*$[1]*Y,$[0]=Math.max(Math.floor($[0]/2),1),$[1]=Math.max(Math.floor($[1]/2),1);return X+=1*Y,X}static mimeTypeToExtension(Z){if(Z==="image/jpeg")return"jpg";return Z.split("/").pop()}static extensionToMimeType(Z){if(Z==="jpg")return"image/jpeg";if(!Z)return"";return`image/${Z}`}}V4.impls={"image/jpeg":new ui,"image/png":new O2};function FL1(Z,J){if(J>Z.byteLength)throw new TypeError("Corrupt JPG, exceeded buffer limits");if(Z.getUint8(J)!==255)throw new TypeError("Invalid JPG, marker table corrupted");return Z}class VG{static basename(Z){let J=Z.split(/[\\/]/).pop();return J.substring(0,J.lastIndexOf("."))}static extension(Z){if(Z.startsWith("data:image/")){let J=Z.match(/data:(image\/\w+)/)[1];return V4.mimeTypeToExtension(J)}else if(Z.startsWith("data:model/gltf+json"))return"gltf";else if(Z.startsWith("data:model/gltf-binary"))return"glb";else if(Z.startsWith("data:application/"))return"bin";return Z.split(/[\\/]/).pop().split(/[.]/).pop()}}function fi(Z){return Object.prototype.toString.call(Z)==="[object Object]"}function QY(Z){if(fi(Z)===!1)return!1;let J=Z.constructor;if(J===void 0)return!0;let X=J.prototype;if(fi(X)===!1)return!1;if(Object.prototype.hasOwnProperty.call(X,"isPrototypeOf")===!1)return!1;return!0}var QP,WP;(function(Z){Z[Z.SILENT=4]="SILENT",Z[Z.ERROR=3]="ERROR",Z[Z.WARN=2]="WARN",Z[Z.INFO=1]="INFO",Z[Z.DEBUG=0]="DEBUG"})(WP||(WP={}));class K7{constructor(Z){this.verbosity=void 0,this.verbosity=Z}debug(Z){if(this.verbosity<=K7.Verbosity.DEBUG)console.debug(Z)}info(Z){if(this.verbosity<=K7.Verbosity.INFO)console.info(Z)}warn(Z){if(this.verbosity<=K7.Verbosity.WARN)console.warn(Z)}error(Z){if(this.verbosity<=K7.Verbosity.ERROR)console.error(Z)}}QP=K7;K7.Verbosity=WP;K7.DEFAULT_INSTANCE=new QP(QP.Verbosity.INFO);function UL1(Z){var J=Z[0],X=Z[1],Y=Z[2],$=Z[3],Q=Z[4],W=Z[5],K=Z[6],G=Z[7],H=Z[8],z=Z[9],q=Z[10],V=Z[11],F=Z[12],U=Z[13],w=Z[14],L=Z[15],O=J*W-X*Q,N=J*K-Y*Q,M=J*G-$*Q,j=X*K-Y*W,P=X*G-$*W,D=Y*G-$*K,C=H*U-z*F,k=H*w-q*F,T=H*L-V*F,x=z*w-q*U,S=z*L-V*U,h=q*L-V*w;return O*h-N*S+M*x+j*T-P*k+D*C}function LL1(Z,J,X){var Y=J[0],$=J[1],Q=J[2],W=J[3],K=J[4],G=J[5],H=J[6],z=J[7],q=J[8],V=J[9],F=J[10],U=J[11],w=J[12],L=J[13],O=J[14],N=J[15],M=X[0],j=X[1],P=X[2],D=X[3];return Z[0]=M*Y+j*K+P*q+D*w,Z[1]=M*$+j*G+P*V+D*L,Z[2]=M*Q+j*H+P*F+D*O,Z[3]=M*W+j*z+P*U+D*N,M=X[4],j=X[5],P=X[6],D=X[7],Z[4]=M*Y+j*K+P*q+D*w,Z[5]=M*$+j*G+P*V+D*L,Z[6]=M*Q+j*H+P*F+D*O,Z[7]=M*W+j*z+P*U+D*N,M=X[8],j=X[9],P=X[10],D=X[11],Z[8]=M*Y+j*K+P*q+D*w,Z[9]=M*$+j*G+P*V+D*L,Z[10]=M*Q+j*H+P*F+D*O,Z[11]=M*W+j*z+P*U+D*N,M=X[12],j=X[13],P=X[14],D=X[15],Z[12]=M*Y+j*K+P*q+D*w,Z[13]=M*$+j*G+P*V+D*L,Z[14]=M*Q+j*H+P*F+D*O,Z[15]=M*W+j*z+P*U+D*N,Z}function wL1(Z,J){var X=J[0],Y=J[1],$=J[2],Q=J[4],W=J[5],K=J[6],G=J[8],H=J[9],z=J[10];return Z[0]=Math.hypot(X,Y,$),Z[1]=Math.hypot(Q,W,K),Z[2]=Math.hypot(G,H,z),Z}function BL1(Z,J){var X=new YP(3);wL1(X,J);var Y=1/X[0],$=1/X[1],Q=1/X[2],W=J[0]*Y,K=J[1]*$,G=J[2]*Q,H=J[4]*Y,z=J[5]*$,q=J[6]*Q,V=J[8]*Y,F=J[9]*$,U=J[10]*Q,w=W+z+U,L=0;if(w>0)L=Math.sqrt(w+1)*2,Z[3]=0.25*L,Z[0]=(q-F)/L,Z[1]=(V-G)/L,Z[2]=(K-H)/L;else if(W>z&&W>U)L=Math.sqrt(1+W-z-U)*2,Z[3]=(q-F)/L,Z[0]=0.25*L,Z[1]=(K+H)/L,Z[2]=(V+G)/L;else if(z>U)L=Math.sqrt(1+z-W-U)*2,Z[3]=(V-G)/L,Z[0]=(K+H)/L,Z[1]=0.25*L,Z[2]=(q+F)/L;else L=Math.sqrt(1+U-W-z)*2,Z[3]=(K-H)/L,Z[0]=(V+G)/L,Z[1]=(q+F)/L,Z[2]=0.25*L;return Z}class K8{static identity(Z){return Z}static eq(Z,J,X=0.00001){if(Z.length!==J.length)return!1;for(let Y=0;Y<Z.length;Y++)if(Math.abs(Z[Y]-J[Y])>X)return!1;return!0}static clamp(Z,J,X){if(Z<J)return J;if(Z>X)return X;return Z}static decodeNormalizedInt(Z,J){switch(J){case 5126:return Z;case 5123:return Z/65535;case 5121:return Z/255;case 5122:return Math.max(Z/32767,-1);case 5120:return Math.max(Z/127,-1);default:throw new Error("Invalid component type.")}}static encodeNormalizedInt(Z,J){switch(J){case 5126:return Z;case 5123:return Math.round(K8.clamp(Z,0,1)*65535);case 5121:return Math.round(K8.clamp(Z,0,1)*255);case 5122:return Math.round(K8.clamp(Z,-1,1)*32767);case 5120:return Math.round(K8.clamp(Z,-1,1)*127);default:throw new Error("Invalid component type.")}}static decompose(Z,J,X,Y){let $=JP([Z[0],Z[1],Z[2]]),Q=JP([Z[4],Z[5],Z[6]]),W=JP([Z[8],Z[9],Z[10]]);if(UL1(Z)<0)$=-$;J[0]=Z[12],J[1]=Z[13],J[2]=Z[14];let G=Z.slice(),H=1/$,z=1/Q,q=1/W;G[0]*=H,G[1]*=H,G[2]*=H,G[4]*=z,G[5]*=z,G[6]*=z,G[8]*=q,G[9]*=q,G[10]*=q,BL1(X,G),Y[0]=$,Y[1]=Q,Y[2]=W}static compose(Z,J,X,Y){let $=Y,Q=J[0],W=J[1],K=J[2],G=J[3],H=Q+Q,z=W+W,q=K+K,V=Q*H,F=Q*z,U=Q*q,w=W*z,L=W*q,O=K*q,N=G*H,M=G*z,j=G*q,P=X[0],D=X[1],C=X[2];return $[0]=(1-(w+O))*P,$[1]=(F+j)*P,$[2]=(U-M)*P,$[3]=0,$[4]=(F-j)*D,$[5]=(1-(V+O))*D,$[6]=(L+N)*D,$[7]=0,$[8]=(U+M)*C,$[9]=(L-N)*C,$[10]=(1-(V+w))*C,$[11]=0,$[12]=Z[0],$[13]=Z[1],$[14]=Z[2],$[15]=1,$}}function OL1(Z,J){if(!!Z!==!!J)return!1;let X=Z.getChild(),Y=J.getChild();return X===Y||X.equals(Y)}function jL1(Z,J){if(!!Z!==!!J)return!1;let X=Z.values(),Y=J.values();if(X.length!==Y.length)return!1;for(let $=0;$<X.length;$++){let Q=X[$],W=Y[$];if(Q.getChild()===W.getChild())continue;if(!Q.getChild().equals(W.getChild()))return!1}return!0}function ML1(Z,J){if(!!Z!==!!J)return!1;let X=Z.keys(),Y=J.keys();if(X.length!==Y.length)return!1;for(let $ of X){let Q=Z.get($),W=J.get($);if(!!Q!==!!W)return!1;let K=Q.getChild(),G=W.getChild();if(K===G)continue;if(!K.equals(G))return!1}return!0}function di(Z,J){if(Z===J)return!0;if(!!Z!==!!J||!Z||!J)return!1;if(Z.length!==J.length)return!1;for(let X=0;X<Z.length;X++)if(Z[X]!==J[X])return!1;return!0}function ci(Z,J){if(Z===J)return!0;if(!!Z!==!!J)return!1;if(!QY(Z)||!QY(J))return Z===J;let X=Z,Y=J,$=0,Q=0,W;for(W in X)$++;for(W in Y)Q++;if($!==Q)return!1;for(W in X){let K=X[W],G=Y[W];if(L2(K)&&L2(G)){if(!di(K,G))return!1}else if(QY(K)&&QY(G)){if(!ci(K,G))return!1}else if(K!==G)return!1}return!0}function L2(Z){return Array.isArray(Z)||ArrayBuffer.isView(Z)}var bi="https://null.example";class HP{static dirname(Z){let J=Z.lastIndexOf("/");if(J===-1)return"./";return Z.substring(0,J+1)}static basename(Z){return VG.basename(new URL(Z,bi).pathname)}static extension(Z){return VG.extension(new URL(Z,bi).pathname)}static resolve(Z,J){if(!this.isRelativePath(J))return J;let X=Z.split("/"),Y=J.split("/");X.pop();for(let $=0;$<Y.length;$++){if(Y[$]===".")continue;if(Y[$]==="..")X.pop();else X.push(Y[$])}return X.join("/")}static isAbsoluteURL(Z){return this.PROTOCOL_REGEXP.test(Z)}static isRelativePath(Z){return!/^(?:[a-zA-Z]+:)?\//.test(Z)}}HP.DEFAULT_INIT={};HP.PROTOCOL_REGEXP=/^[a-zA-Z]+:\/\//;var BJ=(Z)=>Z,RL1=new Set;class j2 extends kQ{constructor(Z,J=""){super(Z);this[h0].name=J,this.init(),this.dispatchEvent({type:"create"})}getGraph(){return this.graph}getDefaults(){return Object.assign(super.getDefaults(),{name:"",extras:{}})}set(Z,J){if(Array.isArray(J))J=J.slice();return super.set(Z,J)}getName(){return this.get("name")}setName(Z){return this.set("name",Z)}getExtras(){return this.get("extras")}setExtras(Z){return this.set("extras",Z)}clone(){return new this.constructor(this.graph).copy(this,BJ)}copy(Z,J=BJ){for(let X in this[h0]){let Y=this[h0][X];if(Y instanceof w5){if(!this[z4].has(X))Y.dispose()}else if(Y instanceof P6||Y instanceof P0)for(let $ of Y.values())$.dispose();else if(Y instanceof r1)for(let $ of Y.values())$.dispose()}for(let X in Z[h0]){let Y=this[h0][X],$=Z[h0][X];if($ instanceof w5)if(this[z4].has(X))Y.getChild().copy(J($.getChild()),J);else this.setRef(X,J($.getChild()),$.getAttributes());else if($ instanceof P0||$ instanceof P6)for(let Q of $.values())this.addRef(X,J(Q.getChild()),Q.getAttributes());else if($ instanceof r1)for(let Q of $.keys()){let W=$.get(Q);this.setRefMap(X,Q,J(W.getChild()),W.getAttributes())}else if(QY($))this[h0][X]=JSON.parse(JSON.stringify($));else if(Array.isArray($)||$ instanceof ArrayBuffer||ArrayBuffer.isView($))this[h0][X]=$.slice();else this[h0][X]=$}return this}equals(Z,J=RL1){if(this===Z)return!0;if(this.propertyType!==Z.propertyType)return!1;for(let X in this[h0]){if(J.has(X))continue;let Y=this[h0][X],$=Z[h0][X];if(Y instanceof w5||$ instanceof w5){if(!OL1(Y,$))return!1}else if(Y instanceof P0||$ instanceof P0||Y instanceof P6||$ instanceof P6){if(!jL1(Y,$))return!1}else if(Y instanceof r1||$ instanceof r1){if(!ML1(Y,$))return!1}else if(QY(Y)||QY($)){if(!ci(Y,$))return!1}else if(L2(Y)||L2($)){if(!di(Y,$))return!1}else if(Y!==$)return!1}return!0}detach(){return this.graph.disconnectParents(this,(Z)=>Z.propertyType!=="Root"),this}listParents(){return this.graph.listParents(this)}}class E6 extends j2{getDefaults(){return Object.assign(super.getDefaults(),{extensions:new r1})}getExtension(Z){return this.getRefMap("extensions",Z)}setExtension(Z,J){if(J)J._validateParent(this);return this.setRefMap("extensions",Z,J)}listExtensions(){return this.listRefMapValues("extensions")}}class R0 extends E6{init(){this.propertyType=s.ACCESSOR}getDefaults(){return Object.assign(super.getDefaults(),{array:null,type:R0.Type.SCALAR,componentType:R0.ComponentType.FLOAT,normalized:!1,sparse:!1,buffer:null})}static getElementSize(Z){switch(Z){case R0.Type.SCALAR:return 1;case R0.Type.VEC2:return 2;case R0.Type.VEC3:return 3;case R0.Type.VEC4:return 4;case R0.Type.MAT2:return 4;case R0.Type.MAT3:return 9;case R0.Type.MAT4:return 16;default:throw new Error("Unexpected type: "+Z)}}static getComponentSize(Z){switch(Z){case R0.ComponentType.BYTE:return 1;case R0.ComponentType.UNSIGNED_BYTE:return 1;case R0.ComponentType.SHORT:return 2;case R0.ComponentType.UNSIGNED_SHORT:return 2;case R0.ComponentType.UNSIGNED_INT:return 4;case R0.ComponentType.FLOAT:return 4;default:throw new Error("Unexpected component type: "+Z)}}getMinNormalized(Z){let J=this.getNormalized(),X=this.getElementSize(),Y=this.getComponentType();if(this.getMin(Z),J)for(let $=0;$<X;$++)Z[$]=K8.decodeNormalizedInt(Z[$],Y);return Z}getMin(Z){let J=this.getArray(),X=this.getCount(),Y=this.getElementSize();for(let $=0;$<Y;$++)Z[$]=1/0;for(let $=0;$<X*Y;$+=Y)for(let Q=0;Q<Y;Q++){let W=J[$+Q];if(Number.isFinite(W))Z[Q]=Math.min(Z[Q],W)}return Z}getMaxNormalized(Z){let J=this.getNormalized(),X=this.getElementSize(),Y=this.getComponentType();if(this.getMax(Z),J)for(let $=0;$<X;$++)Z[$]=K8.decodeNormalizedInt(Z[$],Y);return Z}getMax(Z){let J=this.get("array"),X=this.getCount(),Y=this.getElementSize();for(let $=0;$<Y;$++)Z[$]=-1/0;for(let $=0;$<X*Y;$+=Y)for(let Q=0;Q<Y;Q++){let W=J[$+Q];if(Number.isFinite(W))Z[Q]=Math.max(Z[Q],W)}return Z}getCount(){let Z=this.get("array");return Z?Z.length/this.getElementSize():0}getType(){return this.get("type")}setType(Z){return this.set("type",Z)}getElementSize(){return R0.getElementSize(this.get("type"))}getComponentSize(){return this.get("array").BYTES_PER_ELEMENT}getComponentType(){return this.get("componentType")}getNormalized(){return this.get("normalized")}setNormalized(Z){return this.set("normalized",Z)}getScalar(Z){let J=this.getElementSize(),X=this.getComponentType(),Y=this.getArray();if(this.getNormalized())return K8.decodeNormalizedInt(Y[Z*J],X);return Y[Z*J]}setScalar(Z,J){let X=this.getElementSize(),Y=this.getComponentType(),$=this.getArray();if(this.getNormalized())$[Z*X]=K8.encodeNormalizedInt(J,Y);else $[Z*X]=J;return this}getElement(Z,J){let X=this.getNormalized(),Y=this.getElementSize(),$=this.getComponentType(),Q=this.getArray();for(let W=0;W<Y;W++)if(X)J[W]=K8.decodeNormalizedInt(Q[Z*Y+W],$);else J[W]=Q[Z*Y+W];return J}setElement(Z,J){let X=this.getNormalized(),Y=this.getElementSize(),$=this.getComponentType(),Q=this.getArray();for(let W=0;W<Y;W++)if(X)Q[Z*Y+W]=K8.encodeNormalizedInt(J[W],$);else Q[Z*Y+W]=J[W];return this}getSparse(){return this.get("sparse")}setSparse(Z){return this.set("sparse",Z)}getBuffer(){return this.getRef("buffer")}setBuffer(Z){return this.setRef("buffer",Z)}getArray(){return this.get("array")}setArray(Z){return this.set("componentType",Z?NL1(Z):R0.ComponentType.FLOAT),this.set("array",Z),this}getByteLength(){let Z=this.get("array");return Z?Z.byteLength:0}}R0.Type={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};R0.ComponentType={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,FLOAT:5126};function NL1(Z){switch(Z.constructor){case Float32Array:return R0.ComponentType.FLOAT;case Uint32Array:return R0.ComponentType.UNSIGNED_INT;case Uint16Array:return R0.ComponentType.UNSIGNED_SHORT;case Uint8Array:return R0.ComponentType.UNSIGNED_BYTE;case Int16Array:return R0.ComponentType.SHORT;case Int8Array:return R0.ComponentType.BYTE;default:throw new Error("Unknown accessor componentType.")}}class zP extends E6{init(){this.propertyType=s.ANIMATION}getDefaults(){return Object.assign(super.getDefaults(),{channels:new P0,samplers:new P0})}addChannel(Z){return this.addRef("channels",Z)}removeChannel(Z){return this.removeRef("channels",Z)}listChannels(){return this.listRefs("channels")}addSampler(Z){return this.addRef("samplers",Z)}removeSampler(Z){return this.removeRef("samplers",Z)}listSamplers(){return this.listRefs("samplers")}}class UG extends E6{init(){this.propertyType=s.ANIMATION_CHANNEL}getDefaults(){return Object.assign(super.getDefaults(),{targetPath:null,targetNode:null,sampler:null})}getTargetPath(){return this.get("targetPath")}setTargetPath(Z){return this.set("targetPath",Z)}getTargetNode(){return this.getRef("targetNode")}setTargetNode(Z){return this.setRef("targetNode",Z)}getSampler(){return this.getRef("sampler")}setSampler(Z){return this.setRef("sampler",Z)}}UG.TargetPath={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"};class mQ extends E6{init(){this.propertyType=s.ANIMATION_SAMPLER}getDefaultAttributes(){return Object.assign(super.getDefaults(),{interpolation:mQ.Interpolation.LINEAR,input:null,output:null})}getInterpolation(){return this.get("interpolation")}setInterpolation(Z){return this.set("interpolation",Z)}getInput(){return this.getRef("input")}setInput(Z){return this.setRef("input",Z,{usage:i5.OTHER})}getOutput(){return this.getRef("output")}setOutput(Z){return this.setRef("output",Z,{usage:i5.OTHER})}}mQ.Interpolation={LINEAR:"LINEAR",STEP:"STEP",CUBICSPLINE:"CUBICSPLINE"};class qP extends E6{init(){this.propertyType=s.BUFFER}getDefaults(){return Object.assign(super.getDefaults(),{uri:""})}getURI(){return this.get("uri")}setURI(Z){return this.set("uri",Z)}}class LG extends E6{init(){this.propertyType=s.CAMERA}getDefaults(){return Object.assign(super.getDefaults(),{type:LG.Type.PERSPECTIVE,znear:0.1,zfar:100,aspectRatio:null,yfov:Math.PI*2*50/360,xmag:1,ymag:1})}getType(){return this.get("type")}setType(Z){return this.set("type",Z)}getZNear(){return this.get("znear")}setZNear(Z){return this.set("znear",Z)}getZFar(){return this.get("zfar")}setZFar(Z){return this.set("zfar",Z)}getAspectRatio(){return this.get("aspectRatio")}setAspectRatio(Z){return this.set("aspectRatio",Z)}getYFov(){return this.get("yfov")}setYFov(Z){return this.set("yfov",Z)}getXMag(){return this.get("xmag")}setXMag(Z){return this.set("xmag",Z)}getYMag(){return this.get("ymag")}setYMag(Z){return this.set("ymag",Z)}}LG.Type={PERSPECTIVE:"perspective",ORTHOGRAPHIC:"orthographic"};class n1 extends j2{_validateParent(Z){if(!this.parentTypes.includes(Z.propertyType))throw new Error(`Parent "${Z.propertyType}" invalid for child "${this.propertyType}".`)}}n1.EXTENSION_NAME=void 0;class T1 extends E6{init(){this.propertyType=s.TEXTURE_INFO}getDefaults(){return Object.assign(super.getDefaults(),{texCoord:0,magFilter:null,minFilter:null,wrapS:T1.WrapMode.REPEAT,wrapT:T1.WrapMode.REPEAT})}getTexCoord(){return this.get("texCoord")}setTexCoord(Z){return this.set("texCoord",Z)}getMagFilter(){return this.get("magFilter")}setMagFilter(Z){return this.set("magFilter",Z)}getMinFilter(){return this.get("minFilter")}setMinFilter(Z){return this.set("minFilter",Z)}getWrapS(){return this.get("wrapS")}setWrapS(Z){return this.set("wrapS",Z)}getWrapT(){return this.get("wrapT")}setWrapT(Z){return this.set("wrapT",Z)}}T1.WrapMode={CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497};T1.MagFilter={NEAREST:9728,LINEAR:9729};T1.MinFilter={NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987};var{R:V2,G:F2,B:U2,A:DL1}=n5;class wG extends E6{init(){this.propertyType=s.MATERIAL}getDefaults(){return Object.assign(super.getDefaults(),{alphaMode:wG.AlphaMode.OPAQUE,alphaCutoff:0.5,doubleSided:!1,baseColorFactor:[1,1,1,1],baseColorTexture:null,baseColorTextureInfo:new T1(this.graph,"baseColorTextureInfo"),emissiveFactor:[0,0,0],emissiveTexture:null,emissiveTextureInfo:new T1(this.graph,"emissiveTextureInfo"),normalScale:1,normalTexture:null,normalTextureInfo:new T1(this.graph,"normalTextureInfo"),occlusionStrength:1,occlusionTexture:null,occlusionTextureInfo:new T1(this.graph,"occlusionTextureInfo"),roughnessFactor:1,metallicFactor:1,metallicRoughnessTexture:null,metallicRoughnessTextureInfo:new T1(this.graph,"metallicRoughnessTextureInfo")})}getDoubleSided(){return this.get("doubleSided")}setDoubleSided(Z){return this.set("doubleSided",Z)}getAlpha(){return this.get("baseColorFactor")[3]}setAlpha(Z){let J=this.get("baseColorFactor").slice();return J[3]=Z,this.set("baseColorFactor",J)}getAlphaMode(){return this.get("alphaMode")}setAlphaMode(Z){return this.set("alphaMode",Z)}getAlphaCutoff(){return this.get("alphaCutoff")}setAlphaCutoff(Z){return this.set("alphaCutoff",Z)}getBaseColorFactor(){return this.get("baseColorFactor")}setBaseColorFactor(Z){return this.set("baseColorFactor",Z)}getBaseColorTexture(){return this.getRef("baseColorTexture")}getBaseColorTextureInfo(){return this.getRef("baseColorTexture")?this.getRef("baseColorTextureInfo"):null}setBaseColorTexture(Z){return this.setRef("baseColorTexture",Z,{channels:V2|F2|U2|DL1,isColor:!0})}getEmissiveFactor(){return this.get("emissiveFactor")}setEmissiveFactor(Z){return this.set("emissiveFactor",Z)}getEmissiveTexture(){return this.getRef("emissiveTexture")}getEmissiveTextureInfo(){return this.getRef("emissiveTexture")?this.getRef("emissiveTextureInfo"):null}setEmissiveTexture(Z){return this.setRef("emissiveTexture",Z,{channels:V2|F2|U2,isColor:!0})}getNormalScale(){return this.get("normalScale")}setNormalScale(Z){return this.set("normalScale",Z)}getNormalTexture(){return this.getRef("normalTexture")}getNormalTextureInfo(){return this.getRef("normalTexture")?this.getRef("normalTextureInfo"):null}setNormalTexture(Z){return this.setRef("normalTexture",Z,{channels:V2|F2|U2})}getOcclusionStrength(){return this.get("occlusionStrength")}setOcclusionStrength(Z){return this.set("occlusionStrength",Z)}getOcclusionTexture(){return this.getRef("occlusionTexture")}getOcclusionTextureInfo(){return this.getRef("occlusionTexture")?this.getRef("occlusionTextureInfo"):null}setOcclusionTexture(Z){return this.setRef("occlusionTexture",Z,{channels:V2})}getRoughnessFactor(){return this.get("roughnessFactor")}setRoughnessFactor(Z){return this.set("roughnessFactor",Z)}getMetallicFactor(){return this.get("metallicFactor")}setMetallicFactor(Z){return this.set("metallicFactor",Z)}getMetallicRoughnessTexture(){return this.getRef("metallicRoughnessTexture")}getMetallicRoughnessTextureInfo(){return this.getRef("metallicRoughnessTexture")?this.getRef("metallicRoughnessTextureInfo"):null}setMetallicRoughnessTexture(Z){return this.setRef("metallicRoughnessTexture",Z,{channels:F2|U2})}}wG.AlphaMode={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};class VP extends E6{init(){this.propertyType=s.MESH}getDefaults(){return Object.assign(super.getDefaults(),{weights:[],primitives:new P0})}addPrimitive(Z){return this.addRef("primitives",Z)}removePrimitive(Z){return this.removeRef("primitives",Z)}listPrimitives(){return this.listRefs("primitives")}getWeights(){return this.get("weights")}setWeights(Z){return this.set("weights",Z)}}class FP extends E6{init(){this.propertyType=s.NODE}getDefaults(){return Object.assign(super.getDefaults(),{translation:[0,0,0],rotation:[0,0,0,1],scale:[1,1,1],weights:[],camera:null,mesh:null,skin:null,children:new P0})}copy(Z,J=BJ){if(J===BJ)throw new Error("Node cannot be copied.");return super.copy(Z,J)}getTranslation(){return this.get("translation")}getRotation(){return this.get("rotation")}getScale(){return this.get("scale")}setTranslation(Z){return this.set("translation",Z)}setRotation(Z){return this.set("rotation",Z)}setScale(Z){return this.set("scale",Z)}getMatrix(){return K8.compose(this.get("translation"),this.get("rotation"),this.get("scale"),[])}setMatrix(Z){let J=this.get("translation").slice(),X=this.get("rotation").slice(),Y=this.get("scale").slice();return K8.decompose(Z,J,X,Y),this.set("translation",J).set("rotation",X).set("scale",Y)}getWorldTranslation(){let Z=[0,0,0];return K8.decompose(this.getWorldMatrix(),Z,[0,0,0,1],[1,1,1]),Z}getWorldRotation(){let Z=[0,0,0,1];return K8.decompose(this.getWorldMatrix(),[0,0,0],Z,[1,1,1]),Z}getWorldScale(){let Z=[1,1,1];return K8.decompose(this.getWorldMatrix(),[0,0,0],[0,0,0,1],Z),Z}getWorldMatrix(){let Z=[];for(let Y=this;Y!=null;Y=Y.getParentNode())Z.push(Y);let J,X=Z.pop().getMatrix();while(J=Z.pop())LL1(X,X,J.getMatrix());return X}addChild(Z){let J=Z.getParentNode();if(J)J.removeChild(Z);for(let X of Z.listParents())if(X.propertyType===s.SCENE)X.removeChild(Z);return this.addRef("children",Z)}removeChild(Z){return this.removeRef("children",Z)}listChildren(){return this.listRefs("children")}getParentNode(){for(let Z of this.listParents())if(Z.propertyType===s.NODE)return Z;return null}getMesh(){return this.getRef("mesh")}setMesh(Z){return this.setRef("mesh",Z)}getCamera(){return this.getRef("camera")}setCamera(Z){return this.setRef("camera",Z)}getSkin(){return this.getRef("skin")}setSkin(Z){return this.setRef("skin",Z)}getWeights(){return this.get("weights")}setWeights(Z){return this.set("weights",Z)}traverse(Z){Z(this);for(let J of this.listChildren())J.traverse(Z);return this}}class OJ extends E6{init(){this.propertyType=s.PRIMITIVE}getDefaults(){return Object.assign(super.getDefaults(),{mode:OJ.Mode.TRIANGLES,material:null,indices:null,attributes:new r1,targets:new P0})}getIndices(){return this.getRef("indices")}setIndices(Z){return this.setRef("indices",Z,{usage:i5.ELEMENT_ARRAY_BUFFER})}getAttribute(Z){return this.getRefMap("attributes",Z)}setAttribute(Z,J){return this.setRefMap("attributes",Z,J,{usage:i5.ARRAY_BUFFER})}listAttributes(){return this.listRefMapValues("attributes")}listSemantics(){return this.listRefMapKeys("attributes")}getMaterial(){return this.getRef("material")}setMaterial(Z){return this.setRef("material",Z)}getMode(){return this.get("mode")}setMode(Z){return this.set("mode",Z)}listTargets(){return this.listRefs("targets")}addTarget(Z){return this.addRef("targets",Z)}removeTarget(Z){return this.removeRef("targets",Z)}}OJ.Mode={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class li extends j2{init(){this.propertyType=s.PRIMITIVE_TARGET}getDefaults(){return Object.assign(super.getDefaults(),{attributes:new r1})}getAttribute(Z){return this.getRefMap("attributes",Z)}setAttribute(Z,J){return this.setRefMap("attributes",Z,J,{usage:i5.ARRAY_BUFFER})}listAttributes(){return this.listRefMapValues("attributes")}listSemantics(){return this.listRefMapKeys("attributes")}}function w2(){return w2=Object.assign?Object.assign.bind():function(Z){for(var J=1;J<arguments.length;J++){var X=arguments[J];for(var Y in X)({}).hasOwnProperty.call(X,Y)&&(Z[Y]=X[Y])}return Z},w2.apply(null,arguments)}class UP extends E6{init(){this.propertyType=s.SCENE}getDefaults(){return Object.assign(super.getDefaults(),{children:new P0})}copy(Z,J=BJ){if(J===BJ)throw new Error("Scene cannot be copied.");return super.copy(Z,J)}addChild(Z){let J=Z.getParentNode();if(J)J.removeChild(Z);return this.addRef("children",Z)}removeChild(Z){return this.removeRef("children",Z)}listChildren(){return this.listRefs("children")}traverse(Z){for(let J of this.listChildren())J.traverse(Z);return this}}class LP extends E6{init(){this.propertyType=s.SKIN}getDefaults(){return Object.assign(super.getDefaults(),{skeleton:null,inverseBindMatrices:null,joints:new P0})}getSkeleton(){return this.getRef("skeleton")}setSkeleton(Z){return this.setRef("skeleton",Z)}getInverseBindMatrices(){return this.getRef("inverseBindMatrices")}setInverseBindMatrices(Z){return this.setRef("inverseBindMatrices",Z,{usage:i5.INVERSE_BIND_MATRICES})}addJoint(Z){return this.addRef("joints",Z)}removeJoint(Z){return this.removeRef("joints",Z)}listJoints(){return this.listRefs("joints")}}class wP extends E6{init(){this.propertyType=s.TEXTURE}getDefaults(){return Object.assign(super.getDefaults(),{image:null,mimeType:"",uri:""})}getMimeType(){return this.get("mimeType")||V4.extensionToMimeType(VG.extension(this.get("uri")))}setMimeType(Z){return this.set("mimeType",Z)}getURI(){return this.get("uri")}setURI(Z){this.set("uri",Z);let J=V4.extensionToMimeType(VG.extension(Z));if(J)this.set("mimeType",J);return this}getImage(){return this.get("image")}setImage(Z){return this.set("image",k6.assertView(Z))}getSize(){let Z=this.get("image");if(!Z)return null;return V4.getSize(Z,this.getMimeType())}}class M2 extends E6{init(){this.propertyType=s.ROOT}getDefaults(){return Object.assign(super.getDefaults(),{asset:{generator:`glTF-Transform ${HL1}`,version:"2.0"},defaultScene:null,accessors:new P0,animations:new P0,buffers:new P0,cameras:new P0,materials:new P0,meshes:new P0,nodes:new P0,scenes:new P0,skins:new P0,textures:new P0})}constructor(Z){super(Z);this._extensions=new Set,Z.addEventListener("node:create",(J)=>{this._addChildOfRoot(J.target)})}clone(){throw new Error("Root cannot be cloned.")}copy(Z,J=BJ){if(J===BJ)throw new Error("Root cannot be copied.");this.set("asset",w2({},Z.get("asset"))),this.setName(Z.getName()),this.setExtras(w2({},Z.getExtras())),this.setDefaultScene(Z.getDefaultScene()?J(Z.getDefaultScene()):null);for(let X of Z.listRefMapKeys("extensions")){let Y=Z.getExtension(X);this.setExtension(X,J(Y))}return this}_addChildOfRoot(Z){if(Z instanceof UP)this.addRef("scenes",Z);else if(Z instanceof FP)this.addRef("nodes",Z);else if(Z instanceof LG)this.addRef("cameras",Z);else if(Z instanceof LP)this.addRef("skins",Z);else if(Z instanceof VP)this.addRef("meshes",Z);else if(Z instanceof wG)this.addRef("materials",Z);else if(Z instanceof wP)this.addRef("textures",Z);else if(Z instanceof zP)this.addRef("animations",Z);else if(Z instanceof R0)this.addRef("accessors",Z);else if(Z instanceof qP)this.addRef("buffers",Z);return this}getAsset(){return this.get("asset")}listExtensionsUsed(){return Array.from(this._extensions)}listExtensionsRequired(){return this.listExtensionsUsed().filter((Z)=>Z.isRequired())}_enableExtension(Z){return this._extensions.add(Z),this}_disableExtension(Z){return this._extensions.delete(Z),this}listScenes(){return this.listRefs("scenes")}setDefaultScene(Z){return this.setRef("defaultScene",Z)}getDefaultScene(){return this.getRef("defaultScene")}listNodes(){return this.listRefs("nodes")}listCameras(){return this.listRefs("cameras")}listSkins(){return this.listRefs("skins")}listMeshes(){return this.listRefs("meshes")}listMaterials(){return this.listRefs("materials")}listTextures(){return this.listRefs("textures")}listAnimations(){return this.listRefs("animations")}listAccessors(){return this.listRefs("accessors")}listBuffers(){return this.listRefs("buffers")}}class B2{static fromGraph(Z){return B2._GRAPH_DOCUMENTS.get(Z)||null}constructor(){this._graph=new TQ,this._root=new M2(this._graph),this._logger=K7.DEFAULT_INSTANCE,B2._GRAPH_DOCUMENTS.set(this._graph,this)}getRoot(){return this._root}getGraph(){return this._graph}getLogger(){return this._logger}setLogger(Z){return this._logger=Z,this}clone(){throw new Error("Use 'cloneDocument(source)' from '@gltf-transform/functions'.")}merge(Z){throw new Error("Use 'mergeDocuments(target, source)' from '@gltf-transform/functions'.")}async transform(...Z){let J=Z.map((X)=>X.name);for(let X of Z)await X(this,{stack:J});return this}createExtension(Z){let J=Z.EXTENSION_NAME;return this.getRoot().listExtensionsUsed().find((Y)=>Y.extensionName===J)||new Z(this)}createScene(Z=""){return new UP(this._graph,Z)}createNode(Z=""){return new FP(this._graph,Z)}createCamera(Z=""){return new LG(this._graph,Z)}createSkin(Z=""){return new LP(this._graph,Z)}createMesh(Z=""){return new VP(this._graph,Z)}createPrimitive(){return new OJ(this._graph)}createPrimitiveTarget(Z=""){return new li(this._graph,Z)}createMaterial(Z=""){return new wG(this._graph,Z)}createTexture(Z=""){return new wP(this._graph,Z)}createAnimation(Z=""){return new zP(this._graph,Z)}createAnimationChannel(Z=""){return new UG(this._graph,Z)}createAnimationSampler(Z=""){return new mQ(this._graph,Z)}createAccessor(Z="",J=null){if(!J)J=this.getRoot().listBuffers()[0];return new R0(this._graph,Z).setBuffer(J)}createBuffer(Z=""){return new qP(this._graph,Z)}}B2._GRAPH_DOCUMENTS=new WeakMap;class I1{constructor(Z){this.extensionName="",this.prereadTypes=[],this.prewriteTypes=[],this.readDependencies=[],this.writeDependencies=[],this.document=void 0,this.required=!1,this.properties=new Set,this._listener=void 0,this.document=Z,Z.getRoot()._enableExtension(this),this._listener=(X)=>{let Y=X,$=Y.target;if($ instanceof n1&&$.extensionName===this.extensionName){if(Y.type==="node:create")this._addExtensionProperty($);if(Y.type==="node:dispose")this._removeExtensionProperty($)}};let J=Z.getGraph();J.addEventListener("node:create",this._listener),J.addEventListener("node:dispose",this._listener)}dispose(){this.document.getRoot()._disableExtension(this);let Z=this.document.getGraph();Z.removeEventListener("node:create",this._listener),Z.removeEventListener("node:dispose",this._listener);for(let J of this.properties)J.dispose()}static register(){}isRequired(){return this.required}setRequired(Z){return this.required=Z,this}listProperties(){return Array.from(this.properties)}_addExtensionProperty(Z){return this.properties.add(Z),this}_removeExtensionProperty(Z){return this.properties.delete(Z),this}install(Z,J){return this}preread(Z,J){return this}prewrite(Z,J){return this}}I1.EXTENSION_NAME=void 0;var lH6={logger:K7.DEFAULT_INSTANCE,extensions:[],dependencies:{}},pH6=new Set([s.BUFFER,s.TEXTURE,s.MATERIAL,s.MESH,s.PRIMITIVE,s.NODE,s.SCENE]);var FG;(function(Z){Z[Z.ARRAY_BUFFER=34962]="ARRAY_BUFFER",Z[Z.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER"})(FG||(FG={}));class jJ{constructor(Z,J,X){this._doc=void 0,this.jsonDoc=void 0,this.options=void 0,this.accessorIndexMap=new Map,this.animationIndexMap=new Map,this.bufferIndexMap=new Map,this.cameraIndexMap=new Map,this.skinIndexMap=new Map,this.materialIndexMap=new Map,this.meshIndexMap=new Map,this.nodeIndexMap=new Map,this.imageIndexMap=new Map,this.textureDefIndexMap=new Map,this.textureInfoDefMap=new Map,this.samplerDefIndexMap=new Map,this.sceneIndexMap=new Map,this.imageBufferViews=[],this.otherBufferViews=new Map,this.otherBufferViewsIndexMap=new Map,this.extensionData={},this.bufferURIGenerator=void 0,this.imageURIGenerator=void 0,this.logger=void 0,this._accessorUsageMap=new Map,this.accessorUsageGroupedByParent=new Set(["ARRAY_BUFFER"]),this.accessorParents=new Map,this._doc=Z,this.jsonDoc=J,this.options=X;let Y=Z.getRoot(),$=Y.listBuffers().length,Q=Y.listTextures().length;this.bufferURIGenerator=new KP($>1,()=>X.basename||"buffer"),this.imageURIGenerator=new KP(Q>1,(W)=>PL1(Z,W)||X.basename||"texture"),this.logger=Z.getLogger()}createTextureInfoDef(Z,J){let X={magFilter:J.getMagFilter()||void 0,minFilter:J.getMinFilter()||void 0,wrapS:J.getWrapS(),wrapT:J.getWrapT()},Y=JSON.stringify(X);if(!this.samplerDefIndexMap.has(Y))this.samplerDefIndexMap.set(Y,this.jsonDoc.json.samplers.length),this.jsonDoc.json.samplers.push(X);let $={source:this.imageIndexMap.get(Z),sampler:this.samplerDefIndexMap.get(Y)},Q=JSON.stringify($);if(!this.textureDefIndexMap.has(Q))this.textureDefIndexMap.set(Q,this.jsonDoc.json.textures.length),this.jsonDoc.json.textures.push($);let W={index:this.textureDefIndexMap.get(Q)};if(J.getTexCoord()!==0)W.texCoord=J.getTexCoord();if(Object.keys(J.getExtras()).length>0)W.extras=J.getExtras();return this.textureInfoDefMap.set(J,W),W}createPropertyDef(Z){let J={};if(Z.getName())J.name=Z.getName();if(Object.keys(Z.getExtras()).length>0)J.extras=Z.getExtras();return J}createAccessorDef(Z){let J=this.createPropertyDef(Z);if(J.type=Z.getType(),J.componentType=Z.getComponentType(),J.count=Z.getCount(),this._doc.getGraph().listParentEdges(Z).some((Y)=>Y.getName()==="attributes"&&Y.getAttributes().key==="POSITION"||Y.getName()==="input"))J.max=Z.getMax([]).map(Math.fround),J.min=Z.getMin([]).map(Math.fround);if(Z.getNormalized())J.normalized=Z.getNormalized();return J}createImageData(Z,J,X){if(this.options.format===XP.GLB)this.imageBufferViews.push(J),Z.bufferView=this.jsonDoc.json.bufferViews.length,this.jsonDoc.json.bufferViews.push({buffer:0,byteOffset:-1,byteLength:J.byteLength});else{let Y=V4.mimeTypeToExtension(X.getMimeType());Z.uri=this.imageURIGenerator.createURI(X,Y),this.assignResourceURI(Z.uri,J,!1)}}assignResourceURI(Z,J,X){let Y=this.jsonDoc.resources;if(!(Z in Y)){Y[Z]=J;return}if(J===Y[Z]){this.logger.warn(`Duplicate resource URI, "${Z}".`);return}let $=`Resource URI "${Z}" already assigned to different data.`;if(!X){this.logger.warn($);return}throw new Error($)}getAccessorUsage(Z){let J=this._accessorUsageMap.get(Z);if(J)return J;if(Z.getSparse())return i5.SPARSE;for(let X of this._doc.getGraph().listParentEdges(Z)){let{usage:Y}=X.getAttributes();if(Y)return Y;if(X.getParent().propertyType!==s.ROOT)this.logger.warn(`Missing attribute ".usage" on edge, "${X.getName()}".`)}return i5.OTHER}addAccessorToUsageGroup(Z,J){let X=this._accessorUsageMap.get(Z);if(X&&X!==J)throw new Error(`Accessor with usage "${X}" cannot be reused as "${J}".`);return this._accessorUsageMap.set(Z,J),this}}jJ.BufferViewTarget=FG;jJ.BufferViewUsage=i5;jJ.USAGE_TO_TARGET={[i5.ARRAY_BUFFER]:FG.ARRAY_BUFFER,[i5.ELEMENT_ARRAY_BUFFER]:FG.ELEMENT_ARRAY_BUFFER};class KP{constructor(Z,J){this.multiple=void 0,this.basename=void 0,this.counter={},this.multiple=Z,this.basename=J}createURI(Z,J){if(Z.getURI())return Z.getURI();else if(!this.multiple)return`${this.basename(Z)}.${J}`;else{let X=this.basename(Z);return this.counter[X]=this.counter[X]||1,`${X}_${this.counter[X]++}.${J}`}}}function PL1(Z,J){let X=Z.getGraph().listParentEdges(J).find((Y)=>Y.getParent()!==Z.getRoot());return X?X.getName().replace(/texture$/i,""):""}var{UNSIGNED_INT:iH6,UNSIGNED_SHORT:nH6,UNSIGNED_BYTE:aH6}=R0.ComponentType,sH6=new Set([s.ACCESSOR,s.BUFFER,s.MATERIAL,s.MESH]);var yi;(function(Z){Z[Z.JSON=1313821514]="JSON",Z[Z.BIN=5130562]="BIN"})(yi||(yi={}));var ii=163,ni=166;function CL1(){return{vkFormat:0,typeSize:1,pixelWidth:0,pixelHeight:0,pixelDepth:0,layerCount:0,faceCount:1,supercompressionScheme:0,levels:[],dataFormatDescriptor:[{vendorId:0,descriptorType:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],keyValue:{},globalData:null}}class uQ{constructor(Z,J,X,Y){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(Z.buffer,Z.byteOffset+J,X),this._littleEndian=Y,this._offset=0}_nextUint8(){let Z=this._dataView.getUint8(this._offset);return this._offset+=1,Z}_nextUint16(){let Z=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,Z}_nextUint32(){let Z=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,Z}_nextUint64(){let Z=this._dataView.getUint32(this._offset,this._littleEndian),J=this._dataView.getUint32(this._offset+4,this._littleEndian),X=Z+4294967296*J;return this._offset+=8,X}_nextInt32(){let Z=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,Z}_nextUint8Array(Z){let J=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._offset,Z);return this._offset+=Z,J}_skip(Z){return this._offset+=Z,this}_scan(Z,J=0){let X=this._offset,Y=0;while(this._dataView.getUint8(this._offset)!==J&&Y<Z)Y++,this._offset++;if(Y<Z)this._offset++;return new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+X,Y)}}var tH6=new Uint8Array([0]),n6=[171,75,84,88,32,50,48,187,13,10,26,10];function pi(Z){return new TextDecoder().decode(Z)}function R2(Z){let J=new Uint8Array(Z.buffer,Z.byteOffset,n6.length);if(J[0]!==n6[0]||J[1]!==n6[1]||J[2]!==n6[2]||J[3]!==n6[3]||J[4]!==n6[4]||J[5]!==n6[5]||J[6]!==n6[6]||J[7]!==n6[7]||J[8]!==n6[8]||J[9]!==n6[9]||J[10]!==n6[10]||J[11]!==n6[11])throw new Error("Missing KTX 2.0 identifier.");let X=CL1(),Y=17*Uint32Array.BYTES_PER_ELEMENT,$=new uQ(Z,n6.length,Y,!0);X.vkFormat=$._nextUint32(),X.typeSize=$._nextUint32(),X.pixelWidth=$._nextUint32(),X.pixelHeight=$._nextUint32(),X.pixelDepth=$._nextUint32(),X.layerCount=$._nextUint32(),X.faceCount=$._nextUint32();let Q=$._nextUint32();X.supercompressionScheme=$._nextUint32();let W=$._nextUint32(),K=$._nextUint32(),G=$._nextUint32(),H=$._nextUint32(),z=$._nextUint64(),q=$._nextUint64(),V=Q*3*8,F=new uQ(Z,n6.length+Y,V,!0);for(let V6=0;V6<Q;V6++)X.levels.push({levelData:new Uint8Array(Z.buffer,Z.byteOffset+F._nextUint64(),F._nextUint64()),uncompressedByteLength:F._nextUint64()});let U=new uQ(Z,W,K,!0);U._skip(4);let w=U._nextUint16(),L=U._nextUint16(),O=U._nextUint16(),N=U._nextUint16(),M=U._nextUint8(),j=U._nextUint8(),P=U._nextUint8(),D=U._nextUint8(),C=[U._nextUint8(),U._nextUint8(),U._nextUint8(),U._nextUint8()],k=[U._nextUint8(),U._nextUint8(),U._nextUint8(),U._nextUint8(),U._nextUint8(),U._nextUint8(),U._nextUint8(),U._nextUint8()],x={vendorId:w,descriptorType:L,versionNumber:O,colorModel:M,colorPrimaries:j,transferFunction:P,flags:D,texelBlockDimension:C,bytesPlane:k,samples:[]},S=6,h=4,I=(N/4-S)/h;for(let V6=0;V6<I;V6++){let s7={bitOffset:U._nextUint16(),bitLength:U._nextUint8(),channelType:U._nextUint8(),samplePosition:[U._nextUint8(),U._nextUint8(),U._nextUint8(),U._nextUint8()],sampleLower:Number.NEGATIVE_INFINITY,sampleUpper:Number.POSITIVE_INFINITY};if(s7.channelType&64)s7.sampleLower=U._nextInt32(),s7.sampleUpper=U._nextInt32();else s7.sampleLower=U._nextUint32(),s7.sampleUpper=U._nextUint32();x.samples[V6]=s7}X.dataFormatDescriptor.length=0,X.dataFormatDescriptor.push(x);let v=new uQ(Z,G,H,!0);while(v._offset<H){let V6=v._nextUint32(),s7=v._scan(V6),MV=pi(s7);if(X.keyValue[MV]=v._nextUint8Array(V6-s7.byteLength-1),MV.match(/^ktx/i)){let Of=pi(X.keyValue[MV]);X.keyValue[MV]=Of.substring(0,Of.lastIndexOf("\x00"))}let EX1=V6%4?4-V6%4:0;v._skip(EX1)}if(q<=0)return X;let A=new uQ(Z,z,q,!0),p=A._nextUint16(),n=A._nextUint16(),o=A._nextUint32(),X0=A._nextUint32(),Q0=A._nextUint32(),E0=A._nextUint32(),I0=[];for(let V6=0;V6<Q;V6++)I0.push({imageFlags:A._nextUint32(),rgbSliceByteOffset:A._nextUint32(),rgbSliceByteLength:A._nextUint32(),alphaSliceByteOffset:A._nextUint32(),alphaSliceByteLength:A._nextUint32()});let a0=z+A._offset,I8=a0+o,s1=I8+X0,l4=s1+Q0,e9=new Uint8Array(Z.buffer,Z.byteOffset+a0,o),e$=new Uint8Array(Z.buffer,Z.byteOffset+I8,X0),ZQ=new Uint8Array(Z.buffer,Z.byteOffset+s1,Q0),fX=new Uint8Array(Z.buffer,Z.byteOffset+l4,E0);return X.globalData={endpointCount:p,selectorCount:n,imageDescs:I0,endpointsData:e9,selectorsData:e$,tablesData:ZQ,extendedData:fX},X}var RP="EXT_mesh_gpu_instancing",OP="EXT_meshopt_compression",TL1="EXT_texture_webp",kL1="EXT_texture_avif",Kn="KHR_draco_mesh_compression",NP="KHR_lights_punctual",DP="KHR_materials_anisotropy",PP="KHR_materials_clearcoat",CP="KHR_materials_diffuse_transmission",TP="KHR_materials_dispersion",kP="KHR_materials_emissive_strength",EP="KHR_materials_ior",IP="KHR_materials_iridescence",vP="KHR_materials_pbrSpecularGlossiness",SP="KHR_materials_sheen",_P="KHR_materials_specular",AP="KHR_materials_transmission",xP="KHR_materials_unlit",hP="KHR_materials_volume",MY="KHR_materials_variants",EL1="KHR_mesh_quantization",IL1="KHR_texture_basisu",fP="KHR_texture_transform",N2="KHR_xmp_json_ld",jP="INSTANCE_ATTRIBUTE";class bP extends n1{init(){this.extensionName=RP,this.propertyType="InstancedMesh",this.parentTypes=[s.NODE]}getDefaults(){return Object.assign(super.getDefaults(),{attributes:new r1})}getAttribute(Z){return this.getRefMap("attributes",Z)}setAttribute(Z,J){return this.setRefMap("attributes",Z,J,{usage:jP})}listAttributes(){return this.listRefMapValues("attributes")}listSemantics(){return this.listRefMapKeys("attributes")}}bP.EXTENSION_NAME=RP;var WY=RP;class C2 extends I1{constructor(...Z){super(...Z);this.extensionName=WY,this.provideTypes=[s.NODE],this.prewriteTypes=[s.ACCESSOR]}createInstancedMesh(){return new bP(this.document.getGraph())}read(Z){return(Z.jsonDoc.json.nodes||[]).forEach((Y,$)=>{if(!Y.extensions||!Y.extensions[WY])return;let Q=Y.extensions[WY],W=this.createInstancedMesh();for(let K in Q.attributes)W.setAttribute(K,Z.accessors[Q.attributes[K]]);Z.nodes[$].setExtension(WY,W)}),this}prewrite(Z){Z.accessorUsageGroupedByParent.add(jP);for(let J of this.properties)for(let X of J.listAttributes())Z.addAccessorToUsageGroup(X,jP);return this}write(Z){let J=Z.jsonDoc;return this.document.getRoot().listNodes().forEach((X)=>{let Y=X.getExtension(WY);if(Y){let $=Z.nodeIndexMap.get(X),Q=J.json.nodes[$],W={attributes:{}};Y.listSemantics().forEach((K)=>{let G=Y.getAttribute(K);W.attributes[K]=Z.accessorIndexMap.get(G)}),Q.extensions=Q.extensions||{},Q.extensions[WY]=W}}),this}}C2.EXTENSION_NAME=WY;function UZ(){return UZ=Object.assign?Object.assign.bind():function(Z){for(var J=1;J<arguments.length;J++){var X=arguments[J];for(var Y in X)({}).hasOwnProperty.call(X,Y)&&(Z[Y]=X[Y])}return Z},UZ.apply(null,arguments)}var MG;(function(Z){Z.QUANTIZE="quantize",Z.FILTER="filter"})(MG||(MG={}));var cQ;(function(Z){Z.ATTRIBUTES="ATTRIBUTES",Z.TRIANGLES="TRIANGLES",Z.INDICES="INDICES"})(cQ||(cQ={}));var G8;(function(Z){Z.NONE="NONE",Z.OCTAHEDRAL="OCTAHEDRAL",Z.QUATERNION="QUATERNION",Z.EXPONENTIAL="EXPONENTIAL"})(G8||(G8={}));var{BYTE:vL1,SHORT:ai,FLOAT:SL1}=R0.ComponentType,{encodeNormalizedInt:si,decodeNormalizedInt:MP}=K8;function _L1(Z,J,X,Y){let{filter:$,bits:Q}=Y,W={array:Z.getArray(),byteStride:Z.getElementSize()*Z.getComponentSize(),componentType:Z.getComponentType(),normalized:Z.getNormalized()};if(X!==cQ.ATTRIBUTES)return W;if($!==G8.NONE){let K=Z.getNormalized()?AL1(Z):new Float32Array(W.array);switch($){case G8.EXPONENTIAL:W.byteStride=Z.getElementSize()*4,W.componentType=SL1,W.normalized=!1,W.array=J.encodeFilterExp(K,Z.getCount(),W.byteStride,Q);break;case G8.OCTAHEDRAL:W.byteStride=Q>8?8:4,W.componentType=Q>8?ai:vL1,W.normalized=!0,K=Z.getElementSize()===3?hL1(K):K,W.array=J.encodeFilterOct(K,Z.getCount(),W.byteStride,Q);break;case G8.QUATERNION:W.byteStride=8,W.componentType=ai,W.normalized=!0,W.array=J.encodeFilterQuat(K,Z.getCount(),W.byteStride,Q);break;default:throw new Error("Invalid filter.")}if(W.min=Z.getMin([]),W.max=Z.getMax([]),Z.getNormalized())W.min=W.min.map((G)=>MP(G,Z.getComponentType())),W.max=W.max.map((G)=>MP(G,Z.getComponentType()));if(W.normalized)W.min=W.min.map((G)=>si(G,W.componentType)),W.max=W.max.map((G)=>si(G,W.componentType))}else if(W.byteStride%4)W.array=xL1(W.array,Z.getElementSize()),W.byteStride=W.array.byteLength/Z.getCount();return W}function AL1(Z){let J=Z.getComponentType(),X=Z.getArray(),Y=new Float32Array(X.length);for(let $=0;$<X.length;$++)Y[$]=MP(X[$],J);return Y}function xL1(Z,J){let Y=k6.padNumber(Z.BYTES_PER_ELEMENT*J)/Z.BYTES_PER_ELEMENT,$=Z.length/J,Q=new Z.constructor($*Y);for(let W=0;W*J<Z.length;W++)for(let K=0;K<J;K++)Q[W*Y+K]=Z[W*J+K];return Q}function hL1(Z){let J=new Float32Array(Z.length*4/3);for(let X=0,Y=Z.length/3;X<Y;X++)J[X*4]=Z[X*3],J[X*4+1]=Z[X*3+1],J[X*4+2]=Z[X*3+2];return J}function fL1(Z,J){if(J===jJ.BufferViewUsage.ELEMENT_ARRAY_BUFFER)return Z.listParents().some((Y)=>{return Y instanceof OJ&&Y.getMode()===OJ.Mode.TRIANGLES})?cQ.TRIANGLES:cQ.INDICES;return cQ.ATTRIBUTES}function bL1(Z,J){let X=J.getGraph().listParentEdges(Z).filter((Y)=>!(Y.getParent()instanceof M2));for(let Y of X){let $=Y.getName(),Q=Y.getAttributes().key||"",W=Y.getParent().propertyType===s.PRIMITIVE_TARGET;if($==="indices")return{filter:G8.NONE};if($==="attributes"){if(Q==="POSITION")return{filter:G8.NONE};if(Q==="TEXCOORD_0")return{filter:G8.NONE};if(Q.startsWith("JOINTS_"))return{filter:G8.NONE};if(Q.startsWith("WEIGHTS_"))return{filter:G8.NONE};if(Q==="NORMAL"||Q==="TANGENT")return W?{filter:G8.NONE}:{filter:G8.OCTAHEDRAL,bits:8}}if($==="output"){let K=Gn(Z);if(K==="rotation")return{filter:G8.QUATERNION,bits:16};if(K==="translation")return{filter:G8.EXPONENTIAL,bits:12};if(K==="scale")return{filter:G8.EXPONENTIAL,bits:12};return{filter:G8.NONE}}if($==="input")return{filter:G8.NONE};if($==="inverseBindMatrices")return{filter:G8.NONE}}return{filter:G8.NONE}}function Gn(Z){for(let J of Z.listParents()){if(!(J instanceof mQ))continue;for(let X of J.listParents()){if(!(X instanceof UG))continue;return X.getTargetPath()}}return null}function yL1(Z){if(!Z.extensions||!Z.extensions[OP])return!1;return!!Z.extensions[OP].fallback}var a6=OP,oi={method:MG.QUANTIZE};class NG extends I1{constructor(...Z){super(...Z);this.extensionName=a6,this.prereadTypes=[s.BUFFER,s.PRIMITIVE],this.prewriteTypes=[s.BUFFER,s.ACCESSOR],this.readDependencies=["meshopt.decoder"],this.writeDependencies=["meshopt.encoder"],this._decoder=null,this._decoderFallbackBufferMap=new Map,this._encoder=null,this._encoderOptions=oi,this._encoderFallbackBuffer=null,this._encoderBufferViews={},this._encoderBufferViewData={},this._encoderBufferViewAccessors={}}install(Z,J){if(Z==="meshopt.decoder")this._decoder=J;if(Z==="meshopt.encoder")this._encoder=J;return this}setEncoderOptions(Z){return this._encoderOptions=UZ({},oi,Z),this}preread(Z,J){if(!this._decoder){if(!this.isRequired())return this;throw new Error(`[${a6}] Please install extension dependency, "meshopt.decoder".`)}if(!this._decoder.supported){if(!this.isRequired())return this;throw new Error(`[${a6}]: Missing WASM support.`)}if(J===s.BUFFER)this._prereadBuffers(Z);else if(J===s.PRIMITIVE)this._prereadPrimitives(Z);return this}_prereadBuffers(Z){let J=Z.jsonDoc;(J.json.bufferViews||[]).forEach((Y,$)=>{if(!Y.extensions||!Y.extensions[a6])return;let Q=Y.extensions[a6],W=Q.byteOffset||0,K=Q.byteLength||0,G=Q.count,H=Q.byteStride,z=new Uint8Array(G*H),q=J.json.buffers[Q.buffer],V=q.uri?J.resources[q.uri]:J.resources[GP],F=k6.toView(V,W,K);this._decoder.decodeGltfBuffer(z,G,H,F,Q.mode,Q.filter),Z.bufferViews[$]=z})}_prereadPrimitives(Z){let J=Z.jsonDoc;(J.json.bufferViews||[]).forEach((Y)=>{if(!Y.extensions||!Y.extensions[a6])return;let $=Y.extensions[a6],Q=Z.buffers[$.buffer],W=Z.buffers[Y.buffer],K=J.json.buffers[Y.buffer];if(yL1(K))this._decoderFallbackBufferMap.set(W,Q)})}read(Z){if(!this.isRequired())return this;for(let[J,X]of this._decoderFallbackBufferMap){for(let Y of J.listParents())if(Y instanceof R0)Y.swap(J,X);J.dispose()}return this}prewrite(Z,J){if(J===s.ACCESSOR)this._prewriteAccessors(Z);else if(J===s.BUFFER)this._prewriteBuffers(Z);return this}_prewriteAccessors(Z){let J=Z.jsonDoc.json,X=this._encoder,Y=this._encoderOptions,$=this.document.getGraph(),Q=this.document.createBuffer(),W=this.document.getRoot().listBuffers().indexOf(Q),K=1,G=new Map,H=(z)=>{for(let q of $.listParents(z)){if(q.propertyType===s.ROOT)continue;let V=G.get(z);if(V===void 0)G.set(z,V=K++);return V}return-1};this._encoderFallbackBuffer=Q,this._encoderBufferViews={},this._encoderBufferViewData={},this._encoderBufferViewAccessors={};for(let z of this.document.getRoot().listAccessors()){if(Gn(z)==="weights")continue;if(z.getSparse())continue;let q=Z.getAccessorUsage(z),V=Z.accessorUsageGroupedByParent.has(q)?H(z):null,F=fL1(z,q),U=Y.method===MG.FILTER?bL1(z,this.document):{filter:G8.NONE},w=_L1(z,X,F,U),{array:L,byteStride:O}=w,N=z.getBuffer();if(!N)throw new Error(`${a6}: Missing buffer for accessor.`);let M=this.document.getRoot().listBuffers().indexOf(N),j=[q,V,F,U.filter,O,M].join(":"),P=this._encoderBufferViews[j],D=this._encoderBufferViewData[j],C=this._encoderBufferViewAccessors[j];if(!P||!D)C=this._encoderBufferViewAccessors[j]=[],D=this._encoderBufferViewData[j]=[],P=this._encoderBufferViews[j]={buffer:W,target:jJ.USAGE_TO_TARGET[q],byteOffset:0,byteLength:0,byteStride:q===jJ.BufferViewUsage.ARRAY_BUFFER?O:void 0,extensions:{[a6]:{buffer:M,byteOffset:0,byteLength:0,mode:F,filter:U.filter!==G8.NONE?U.filter:void 0,byteStride:O,count:0}}};let k=Z.createAccessorDef(z);if(k.componentType=w.componentType,k.normalized=w.normalized,k.byteOffset=P.byteLength,k.min&&w.min)k.min=w.min;if(k.max&&w.max)k.max=w.max;Z.accessorIndexMap.set(z,J.accessors.length),J.accessors.push(k),C.push(k),D.push(new Uint8Array(L.buffer,L.byteOffset,L.byteLength)),P.byteLength+=L.byteLength,P.extensions.EXT_meshopt_compression.count+=z.getCount()}}_prewriteBuffers(Z){let J=this._encoder;for(let X in this._encoderBufferViews){let Y=this._encoderBufferViews[X],$=this._encoderBufferViewData[X],Q=this.document.getRoot().listBuffers()[Y.extensions[a6].buffer],W=Z.otherBufferViews.get(Q)||[],{count:K,byteStride:G,mode:H}=Y.extensions[a6],z=k6.concat($),q=J.encodeGltfBuffer(z,K,G,H),V=k6.pad(q);Y.extensions[a6].byteLength=q.byteLength,$.length=0,$.push(V),W.push(V),Z.otherBufferViews.set(Q,W)}}write(Z){let J=0;for(let Q in this._encoderBufferViews){let W=this._encoderBufferViews[Q],K=this._encoderBufferViewData[Q][0],G=Z.otherBufferViewsIndexMap.get(K),H=this._encoderBufferViewAccessors[Q];for(let F of H)F.bufferView=G;let z=Z.jsonDoc.json.bufferViews[G],q=z.byteOffset||0;Object.assign(z,W),z.byteOffset=J;let V=z.extensions[a6];V.byteOffset=q,J+=k6.padNumber(W.byteLength)}let X=this._encoderFallbackBuffer,Y=Z.bufferIndexMap.get(X),$=Z.jsonDoc.json.buffers[Y];return $.byteLength=J,$.extensions={[a6]:{fallback:!0}},X.dispose(),this}}NG.EXTENSION_NAME=a6;NG.EncoderMethod=MG;var BG=kL1;class Hn{match(Z){return Z.length>=12&&k6.decodeText(Z.slice(4,12))==="ftypavif"}getSize(Z){if(!this.match(Z))return null;let J=new DataView(Z.buffer,Z.byteOffset,Z.byteLength),X=ri(J,0);if(!X)return null;let Y=X.end;while(X=ri(J,Y))if(X.type==="meta")Y=X.start+4;else if(X.type==="iprp"||X.type==="ipco")Y=X.start;else if(X.type==="ispe")return[J.getUint32(X.start+4),J.getUint32(X.start+8)];else if(X.type==="mdat")break;else Y=X.end;return null}getChannels(Z){return 4}}class T2 extends I1{constructor(...Z){super(...Z);this.extensionName=BG,this.prereadTypes=[s.TEXTURE]}static register(){V4.registerFormat("image/avif",new Hn)}preread(Z){return(Z.jsonDoc.json.textures||[]).forEach((X)=>{if(X.extensions&&X.extensions[BG])X.source=X.extensions[BG].source}),this}read(Z){return this}write(Z){let J=Z.jsonDoc;return this.document.getRoot().listTextures().forEach((X)=>{if(X.getMimeType()==="image/avif"){let Y=Z.imageIndexMap.get(X);(J.json.textures||[]).forEach((Q)=>{if(Q.source===Y)Q.extensions=Q.extensions||{},Q.extensions[BG]={source:Q.source},delete Q.source})}}),this}}T2.EXTENSION_NAME=BG;function ri(Z,J){if(Z.byteLength<4+J)return null;let X=Z.getUint32(J);if(Z.byteLength<X+J||X<8)return null;return{type:k6.decodeText(new Uint8Array(Z.buffer,Z.byteOffset+J+4,4)),start:J+8,end:J+X}}var OG=TL1;class zn{match(Z){return Z.length>=12&&Z[8]===87&&Z[9]===69&&Z[10]===66&&Z[11]===80}getSize(Z){let J=k6.decodeText(Z.slice(0,4)),X=k6.decodeText(Z.slice(8,12));if(J!=="RIFF"||X!=="WEBP")return null;let Y=new DataView(Z.buffer,Z.byteOffset),$=12;while($<Y.byteLength){let Q=k6.decodeText(new Uint8Array([Y.getUint8($),Y.getUint8($+1),Y.getUint8($+2),Y.getUint8($+3)])),W=Y.getUint32($+4,!0);if(Q==="VP8 "){let K=Y.getInt16($+14,!0)&16383,G=Y.getInt16($+16,!0)&16383;return[K,G]}else if(Q==="VP8L"){let K=Y.getUint8($+9),G=Y.getUint8($+10),H=Y.getUint8($+11),z=Y.getUint8($+12),q=1+((G&63)<<8|K),V=1+((z&15)<<10|H<<2|(G&192)>>6);return[q,V]}$+=8+W+W%2}return null}getChannels(Z){return 4}}class k2 extends I1{constructor(...Z){super(...Z);this.extensionName=OG,this.prereadTypes=[s.TEXTURE]}static register(){V4.registerFormat("image/webp",new zn)}preread(Z){return(Z.jsonDoc.json.textures||[]).forEach((X)=>{if(X.extensions&&X.extensions[OG])X.source=X.extensions[OG].source}),this}read(Z){return this}write(Z){let J=Z.jsonDoc;return this.document.getRoot().listTextures().forEach((X)=>{if(X.getMimeType()==="image/webp"){let Y=Z.imageIndexMap.get(X);(J.json.textures||[]).forEach((Q)=>{if(Q.source===Y)Q.extensions=Q.extensions||{},Q.extensions[OG]={source:Q.source},delete Q.source})}}),this}}k2.EXTENSION_NAME=OG;var ti=Kn,d8,qn,Vn;function gL1(Z,J){let X=new d8.DecoderBuffer;try{if(X.Init(J,J.length),Z.GetEncodedGeometryType(X)!==d8.TRIANGULAR_MESH)throw new Error(`[${ti}] Unknown geometry type.`);let $=new d8.Mesh;if(!Z.DecodeBufferToMesh(X,$).ok()||$.ptr===0)throw new Error(`[${ti}] Decoding failure.`);return $}finally{d8.destroy(X)}}function mL1(Z,J){let Y=J.num_faces()*3,$,Q;if(J.num_points()<=65534){let W=Y*Uint16Array.BYTES_PER_ELEMENT;$=d8._malloc(W),Z.GetTrianglesUInt16Array(J,W,$),Q=new Uint16Array(d8.HEAPU16.buffer,$,Y).slice()}else{let W=Y*Uint32Array.BYTES_PER_ELEMENT;$=d8._malloc(W),Z.GetTrianglesUInt32Array(J,W,$),Q=new Uint32Array(d8.HEAPU32.buffer,$,Y).slice()}return d8._free($),Q}function uL1(Z,J,X,Y){let $=Vn[Y.componentType],Q=qn[Y.componentType],W=X.num_components(),G=J.num_points()*W,H=G*Q.BYTES_PER_ELEMENT,z=d8._malloc(H);Z.GetAttributeDataArrayForAllPoints(J,X,$,H,z);let q=new Q(d8.HEAPF32.buffer,z,G).slice();return d8._free(z),q}function dL1(Z){d8=Z,qn={[R0.ComponentType.FLOAT]:Float32Array,[R0.ComponentType.UNSIGNED_INT]:Uint32Array,[R0.ComponentType.UNSIGNED_SHORT]:Uint16Array,[R0.ComponentType.UNSIGNED_BYTE]:Uint8Array,[R0.ComponentType.SHORT]:Int16Array,[R0.ComponentType.BYTE]:Int8Array},Vn={[R0.ComponentType.FLOAT]:d8.DT_FLOAT32,[R0.ComponentType.UNSIGNED_INT]:d8.DT_UINT32,[R0.ComponentType.UNSIGNED_SHORT]:d8.DT_UINT16,[R0.ComponentType.UNSIGNED_BYTE]:d8.DT_UINT8,[R0.ComponentType.SHORT]:d8.DT_INT16,[R0.ComponentType.BYTE]:d8.DT_INT8}}var D9,RG;(function(Z){Z[Z.EDGEBREAKER=1]="EDGEBREAKER",Z[Z.SEQUENTIAL=0]="SEQUENTIAL"})(RG||(RG={}));var P9;(function(Z){Z.POSITION="POSITION",Z.NORMAL="NORMAL",Z.COLOR="COLOR",Z.TEX_COORD="TEX_COORD",Z.GENERIC="GENERIC"})(P9||(P9={}));var Fn={[P9.POSITION]:14,[P9.NORMAL]:10,[P9.COLOR]:8,[P9.TEX_COORD]:12,[P9.GENERIC]:12},ei={decodeSpeed:5,encodeSpeed:5,method:RG.EDGEBREAKER,quantizationBits:Fn,quantizationVolume:"mesh"};function cL1(Z){D9=Z}function lL1(Z,J=ei){let X=UZ({},ei,J);X.quantizationBits=UZ({},Fn,J.quantizationBits);let Y=new D9.MeshBuilder,$=new D9.Mesh,Q=new D9.ExpertEncoder($),W={},K=new D9.DracoInt8Array,G=Z.listTargets().length>0,H=!1;for(let w of Z.listSemantics()){let L=Z.getAttribute(w);if(L.getSparse()){H=!0;continue}let O=pL1(w),N=iL1(Y,L.getComponentType(),$,D9[O],L.getCount(),L.getElementSize(),L.getArray());if(N===-1)throw new Error(`Error compressing "${w}" attribute.`);if(W[w]=N,X.quantizationVolume==="mesh"||w!=="POSITION")Q.SetAttributeQuantization(N,X.quantizationBits[O]);else if(typeof X.quantizationVolume==="object"){let{quantizationVolume:M}=X,j=Math.max(M.max[0]-M.min[0],M.max[1]-M.min[1],M.max[2]-M.min[2]);Q.SetAttributeExplicitQuantization(N,X.quantizationBits[O],L.getElementSize(),M.min,j)}else throw new Error("Invalid quantization volume state.")}let z=Z.getIndices();if(!z)throw new D2("Primitive must have indices.");if(Y.AddFacesToMesh($,z.getCount()/3,z.getArray()),Q.SetSpeedOptions(X.encodeSpeed,X.decodeSpeed),Q.SetTrackEncodedProperties(!0),X.method===RG.SEQUENTIAL||G||H)Q.SetEncodingMethod(D9.MESH_SEQUENTIAL_ENCODING);else Q.SetEncodingMethod(D9.MESH_EDGEBREAKER_ENCODING);let q=Q.EncodeToDracoBuffer(!(G||H),K);if(q<=0)throw new D2("Error applying Draco compression.");let V=new Uint8Array(q);for(let w=0;w<q;++w)V[w]=K.GetValue(w);let F=Q.GetNumberOfEncodedPoints(),U=Q.GetNumberOfEncodedFaces()*3;return D9.destroy(K),D9.destroy($),D9.destroy(Y),D9.destroy(Q),{numVertices:F,numIndices:U,data:V,attributeIDs:W}}function pL1(Z){if(Z==="POSITION")return P9.POSITION;else if(Z==="NORMAL")return P9.NORMAL;else if(Z.startsWith("COLOR_"))return P9.COLOR;else if(Z.startsWith("TEXCOORD_"))return P9.TEX_COORD;return P9.GENERIC}function iL1(Z,J,X,Y,$,Q,W){switch(J){case R0.ComponentType.UNSIGNED_BYTE:return Z.AddUInt8Attribute(X,Y,$,Q,W);case R0.ComponentType.BYTE:return Z.AddInt8Attribute(X,Y,$,Q,W);case R0.ComponentType.UNSIGNED_SHORT:return Z.AddUInt16Attribute(X,Y,$,Q,W);case R0.ComponentType.SHORT:return Z.AddInt16Attribute(X,Y,$,Q,W);case R0.ComponentType.UNSIGNED_INT:return Z.AddUInt32Attribute(X,Y,$,Q,W);case R0.ComponentType.FLOAT:return Z.AddFloatAttribute(X,Y,$,Q,W);default:throw new Error(`Unexpected component type, "${J}".`)}}class D2 extends Error{}var N8=Kn;class DG extends I1{constructor(...Z){super(...Z);this.extensionName=N8,this.prereadTypes=[s.PRIMITIVE],this.prewriteTypes=[s.ACCESSOR],this.readDependencies=["draco3d.decoder"],this.writeDependencies=["draco3d.encoder"],this._decoderModule=null,this._encoderModule=null,this._encoderOptions={}}install(Z,J){if(Z==="draco3d.decoder")this._decoderModule=J,dL1(this._decoderModule);if(Z==="draco3d.encoder")this._encoderModule=J,cL1(this._encoderModule);return this}setEncoderOptions(Z){return this._encoderOptions=Z,this}preread(Z){if(!this._decoderModule)throw new Error(`[${N8}] Please install extension dependency, "draco3d.decoder".`);let J=this.document.getLogger(),X=Z.jsonDoc,Y=new Map;try{let $=X.json.meshes||[];for(let Q of $)for(let W of Q.primitives){if(!W.extensions||!W.extensions[N8])continue;let K=W.extensions[N8],[G,H]=Y.get(K.bufferView)||[];if(!H||!G){let z=X.json.bufferViews[K.bufferView],q=X.json.buffers[z.buffer],V=q.uri?X.resources[q.uri]:X.resources[GP],F=z.byteOffset||0,U=z.byteLength,w=k6.toView(V,F,U);G=new this._decoderModule.Decoder,H=gL1(G,w),Y.set(K.bufferView,[G,H]),J.debug(`[${N8}] Decompressed ${w.byteLength} bytes.`)}for(let z in K.attributes){let q=Z.jsonDoc.json.accessors[W.attributes[z]],V=G.GetAttributeByUniqueId(H,K.attributes[z]),F=uL1(G,H,V,q);Z.accessors[W.attributes[z]].setArray(F)}if(W.indices!==void 0)Z.accessors[W.indices].setArray(mL1(G,H))}}finally{for(let[$,Q]of Array.from(Y.values()))this._decoderModule.destroy($),this._decoderModule.destroy(Q)}return this}read(Z){return this}prewrite(Z,J){if(!this._encoderModule)throw new Error(`[${N8}] Please install extension dependency, "draco3d.encoder".`);let X=this.document.getLogger();X.debug(`[${N8}] Compression options: ${JSON.stringify(this._encoderOptions)}`);let Y=nL1(this.document),$=new Map,Q="mesh";if(this._encoderOptions.quantizationVolume==="scene")if(this.document.getRoot().listScenes().length!==1)X.warn(`[${N8}]: quantizationVolume=scene requires exactly 1 scene.`);else Q=gi(this.document.getRoot().listScenes().pop());for(let W of Array.from(Y.keys())){let K=Y.get(W);if(!K)throw new Error("Unexpected primitive.");if($.has(K)){$.set(K,$.get(K));continue}let G=W.getIndices(),H=Z.jsonDoc.json.accessors,z;try{z=lL1(W,UZ({},this._encoderOptions,{quantizationVolume:Q}))}catch(F){if(F instanceof D2){X.warn(`[${N8}]: ${F.message} Skipping primitive compression.`);continue}throw F}$.set(K,z);let q=Z.createAccessorDef(G);if(q.count=z.numIndices,Z.accessorIndexMap.set(G,H.length),H.push(q),z.numVertices>65534&&R0.getComponentSize(q.componentType)<=2)q.componentType=R0.ComponentType.UNSIGNED_INT;else if(z.numVertices>254&&R0.getComponentSize(q.componentType)<=1)q.componentType=R0.ComponentType.UNSIGNED_SHORT;for(let F of W.listSemantics()){let U=W.getAttribute(F);if(z.attributeIDs[F]===void 0)continue;let w=Z.createAccessorDef(U);w.count=z.numVertices,Z.accessorIndexMap.set(U,H.length),H.push(w)}let V=W.getAttribute("POSITION").getBuffer()||this.document.getRoot().listBuffers()[0];if(!Z.otherBufferViews.has(V))Z.otherBufferViews.set(V,[]);Z.otherBufferViews.get(V).push(z.data)}return X.debug(`[${N8}] Compressed ${Y.size} primitives.`),Z.extensionData[N8]={primitiveHashMap:Y,primitiveEncodingMap:$},this}write(Z){let J=Z.extensionData[N8];for(let X of this.document.getRoot().listMeshes()){let Y=Z.jsonDoc.json.meshes[Z.meshIndexMap.get(X)];for(let $=0;$<X.listPrimitives().length;$++){let Q=X.listPrimitives()[$],W=Y.primitives[$],K=J.primitiveHashMap.get(Q);if(!K)continue;let G=J.primitiveEncodingMap.get(K);if(!G)continue;W.extensions=W.extensions||{},W.extensions[N8]={bufferView:Z.otherBufferViewsIndexMap.get(G.data),attributes:G.attributeIDs}}}if(!J.primitiveHashMap.size){let X=Z.jsonDoc.json;X.extensionsUsed=(X.extensionsUsed||[]).filter((Y)=>Y!==N8),X.extensionsRequired=(X.extensionsRequired||[]).filter((Y)=>Y!==N8)}return this}}DG.EXTENSION_NAME=N8;DG.EncoderMethod=RG;function nL1(Z){let J=Z.getLogger(),X=new Set,Y=new Set,$=0,Q=0;for(let q of Z.getRoot().listMeshes())for(let V of q.listPrimitives())if(!V.getIndices())Y.add(V),$++;else if(V.getMode()!==OJ.Mode.TRIANGLES)Y.add(V),Q++;else X.add(V);if($>0)J.warn(`[${N8}] Skipping Draco compression of ${$} non-indexed primitives.`);if(Q>0)J.warn(`[${N8}] Skipping Draco compression of ${Q} non-TRIANGLES primitives.`);let W=Z.getRoot().listAccessors(),K=new Map;for(let q=0;q<W.length;q++)K.set(W[q],q);let G=new Map,H=new Set,z=new Map;for(let q of Array.from(X)){let V=Zn(q,K);if(H.has(V)){z.set(q,V);continue}if(G.has(q.getIndices())){let F=q.getIndices(),U=F.clone();K.set(U,Z.getRoot().listAccessors().length-1),q.swap(F,U)}for(let F of q.listAttributes())if(G.has(F)){let U=F.clone();K.set(U,Z.getRoot().listAccessors().length-1),q.swap(F,U)}V=Zn(q,K),H.add(V),z.set(q,V),G.set(q.getIndices(),V);for(let F of q.listAttributes())G.set(F,V)}for(let q of Array.from(G.keys())){let V=new Set(q.listParents().map((F)=>F.propertyType));if(V.size!==2||!V.has(s.PRIMITIVE)||!V.has(s.ROOT))throw new Error(`[${N8}] Compressed accessors must only be used as indices or vertex attributes.`)}for(let q of Array.from(X)){let V=z.get(q),F=q.getIndices();if(G.get(F)!==V||q.listAttributes().some((U)=>G.get(U)!==V))throw new Error(`[${N8}] Draco primitives must share all, or no, accessors.`)}for(let q of Array.from(Y)){let V=q.getIndices();if(G.has(V)||q.listAttributes().some((F)=>G.has(F)))throw new Error(`[${N8}] Accessor cannot be shared by compressed and uncompressed primitives.`)}return z}function Zn(Z,J){let X=[],Y=Z.getIndices();X.push(J.get(Y));for(let $ of Z.listAttributes())X.push(J.get($));return X.sort().join("|")}class lQ extends n1{init(){this.extensionName=NP,this.propertyType="Light",this.parentTypes=[s.NODE]}getDefaults(){return Object.assign(super.getDefaults(),{color:[1,1,1],intensity:1,type:lQ.Type.POINT,range:null,innerConeAngle:0,outerConeAngle:Math.PI/4})}getColor(){return this.get("color")}setColor(Z){return this.set("color",Z)}getIntensity(){return this.get("intensity")}setIntensity(Z){return this.set("intensity",Z)}getType(){return this.get("type")}setType(Z){return this.set("type",Z)}getRange(){return this.get("range")}setRange(Z){return this.set("range",Z)}getInnerConeAngle(){return this.get("innerConeAngle")}setInnerConeAngle(Z){return this.set("innerConeAngle",Z)}getOuterConeAngle(){return this.get("outerConeAngle")}setOuterConeAngle(Z){return this.set("outerConeAngle",Z)}}lQ.EXTENSION_NAME=NP;lQ.Type={POINT:"point",SPOT:"spot",DIRECTIONAL:"directional"};var G7=NP;class yP extends I1{constructor(...Z){super(...Z);this.extensionName=G7}createLight(Z=""){return new lQ(this.document.getGraph(),Z)}read(Z){let J=Z.jsonDoc;if(!J.json.extensions||!J.json.extensions[G7])return this;let $=(J.json.extensions[G7].lights||[]).map((Q)=>{var W,K;let G=this.createLight().setName(Q.name||"").setType(Q.type);if(Q.color!==void 0)G.setColor(Q.color);if(Q.intensity!==void 0)G.setIntensity(Q.intensity);if(Q.range!==void 0)G.setRange(Q.range);if(((W=Q.spot)==null?void 0:W.innerConeAngle)!==void 0)G.setInnerConeAngle(Q.spot.innerConeAngle);if(((K=Q.spot)==null?void 0:K.outerConeAngle)!==void 0)G.setOuterConeAngle(Q.spot.outerConeAngle);return G});return J.json.nodes.forEach((Q,W)=>{if(!Q.extensions||!Q.extensions[G7])return;let K=Q.extensions[G7];Z.nodes[W].setExtension(G7,$[K.light])}),this}write(Z){let J=Z.jsonDoc;if(this.properties.size===0)return this;let X=[],Y=new Map;for(let $ of this.properties){let Q=$,W={type:Q.getType()};if(!K8.eq(Q.getColor(),[1,1,1]))W.color=Q.getColor();if(Q.getIntensity()!==1)W.intensity=Q.getIntensity();if(Q.getRange()!=null)W.range=Q.getRange();if(Q.getName())W.name=Q.getName();if(Q.getType()===lQ.Type.SPOT)W.spot={innerConeAngle:Q.getInnerConeAngle(),outerConeAngle:Q.getOuterConeAngle()};X.push(W),Y.set(Q,X.length-1)}return this.document.getRoot().listNodes().forEach(($)=>{let Q=$.getExtension(G7);if(Q){let W=Z.nodeIndexMap.get($),K=J.json.nodes[W];K.extensions=K.extensions||{},K.extensions[G7]={light:Y.get(Q)}}}),J.json.extensions=J.json.extensions||{},J.json.extensions[G7]={lights:X},this}}yP.EXTENSION_NAME=G7;var{R:aL1,G:sL1,B:oL1}=n5;class gP extends n1{init(){this.extensionName=DP,this.propertyType="Anisotropy",this.parentTypes=[s.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{anisotropyStrength:0,anisotropyRotation:0,anisotropyTexture:null,anisotropyTextureInfo:new T1(this.graph,"anisotropyTextureInfo")})}getAnisotropyStrength(){return this.get("anisotropyStrength")}setAnisotropyStrength(Z){return this.set("anisotropyStrength",Z)}getAnisotropyRotation(){return this.get("anisotropyRotation")}setAnisotropyRotation(Z){return this.set("anisotropyRotation",Z)}getAnisotropyTexture(){return this.getRef("anisotropyTexture")}getAnisotropyTextureInfo(){return this.getRef("anisotropyTexture")?this.getRef("anisotropyTextureInfo"):null}setAnisotropyTexture(Z){return this.setRef("anisotropyTexture",Z,{channels:aL1|sL1|oL1})}}gP.EXTENSION_NAME=DP;var KY=DP;class mP extends I1{constructor(...Z){super(...Z);this.extensionName=KY,this.prereadTypes=[s.MESH],this.prewriteTypes=[s.MESH]}createAnisotropy(){return new gP(this.document.getGraph())}read(Z){return this}write(Z){return this}preread(Z){let J=Z.jsonDoc,X=J.json.materials||[],Y=J.json.textures||[];return X.forEach(($,Q)=>{if($.extensions&&$.extensions[KY]){let W=this.createAnisotropy();Z.materials[Q].setExtension(KY,W);let K=$.extensions[KY];if(K.anisotropyStrength!==void 0)W.setAnisotropyStrength(K.anisotropyStrength);if(K.anisotropyRotation!==void 0)W.setAnisotropyRotation(K.anisotropyRotation);if(K.anisotropyTexture!==void 0){let G=K.anisotropyTexture,H=Z.textures[Y[G.index].source];W.setAnisotropyTexture(H),Z.setTextureInfo(W.getAnisotropyTextureInfo(),G)}}}),this}prewrite(Z){let J=Z.jsonDoc;return this.document.getRoot().listMaterials().forEach((X)=>{let Y=X.getExtension(KY);if(Y){let $=Z.materialIndexMap.get(X),Q=J.json.materials[$];Q.extensions=Q.extensions||{};let W=Q.extensions[KY]={};if(Y.getAnisotropyStrength()>0)W.anisotropyStrength=Y.getAnisotropyStrength();if(Y.getAnisotropyRotation()!==0)W.anisotropyRotation=Y.getAnisotropyRotation();if(Y.getAnisotropyTexture()){let K=Y.getAnisotropyTexture(),G=Y.getAnisotropyTextureInfo();W.anisotropyTexture=Z.createTextureInfoDef(K,G)}}}),this}}mP.EXTENSION_NAME=KY;var{R:Jn,G:Xn,B:rL1}=n5;class uP extends n1{init(){this.extensionName=PP,this.propertyType="Clearcoat",this.parentTypes=[s.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{clearcoatFactor:0,clearcoatTexture:null,clearcoatTextureInfo:new T1(this.graph,"clearcoatTextureInfo"),clearcoatRoughnessFactor:0,clearcoatRoughnessTexture:null,clearcoatRoughnessTextureInfo:new T1(this.graph,"clearcoatRoughnessTextureInfo"),clearcoatNormalScale:1,clearcoatNormalTexture:null,clearcoatNormalTextureInfo:new T1(this.graph,"clearcoatNormalTextureInfo")})}getClearcoatFactor(){return this.get("clearcoatFactor")}setClearcoatFactor(Z){return this.set("clearcoatFactor",Z)}getClearcoatTexture(){return this.getRef("clearcoatTexture")}getClearcoatTextureInfo(){return this.getRef("clearcoatTexture")?this.getRef("clearcoatTextureInfo"):null}setClearcoatTexture(Z){return this.setRef("clearcoatTexture",Z,{channels:Jn})}getClearcoatRoughnessFactor(){return this.get("clearcoatRoughnessFactor")}setClearcoatRoughnessFactor(Z){return this.set("clearcoatRoughnessFactor",Z)}getClearcoatRoughnessTexture(){return this.getRef("clearcoatRoughnessTexture")}getClearcoatRoughnessTextureInfo(){return this.getRef("clearcoatRoughnessTexture")?this.getRef("clearcoatRoughnessTextureInfo"):null}setClearcoatRoughnessTexture(Z){return this.setRef("clearcoatRoughnessTexture",Z,{channels:Xn})}getClearcoatNormalScale(){return this.get("clearcoatNormalScale")}setClearcoatNormalScale(Z){return this.set("clearcoatNormalScale",Z)}getClearcoatNormalTexture(){return this.getRef("clearcoatNormalTexture")}getClearcoatNormalTextureInfo(){return this.getRef("clearcoatNormalTexture")?this.getRef("clearcoatNormalTextureInfo"):null}setClearcoatNormalTexture(Z){return this.setRef("clearcoatNormalTexture",Z,{channels:Jn|Xn|rL1})}}uP.EXTENSION_NAME=PP;var GY=PP;class dP extends I1{constructor(...Z){super(...Z);this.extensionName=GY,this.prereadTypes=[s.MESH],this.prewriteTypes=[s.MESH]}createClearcoat(){return new uP(this.document.getGraph())}read(Z){return this}write(Z){return this}preread(Z){let J=Z.jsonDoc,X=J.json.materials||[],Y=J.json.textures||[];return X.forEach(($,Q)=>{if($.extensions&&$.extensions[GY]){let W=this.createClearcoat();Z.materials[Q].setExtension(GY,W);let K=$.extensions[GY];if(K.clearcoatFactor!==void 0)W.setClearcoatFactor(K.clearcoatFactor);if(K.clearcoatRoughnessFactor!==void 0)W.setClearcoatRoughnessFactor(K.clearcoatRoughnessFactor);if(K.clearcoatTexture!==void 0){let G=K.clearcoatTexture,H=Z.textures[Y[G.index].source];W.setClearcoatTexture(H),Z.setTextureInfo(W.getClearcoatTextureInfo(),G)}if(K.clearcoatRoughnessTexture!==void 0){let G=K.clearcoatRoughnessTexture,H=Z.textures[Y[G.index].source];W.setClearcoatRoughnessTexture(H),Z.setTextureInfo(W.getClearcoatRoughnessTextureInfo(),G)}if(K.clearcoatNormalTexture!==void 0){let G=K.clearcoatNormalTexture,H=Z.textures[Y[G.index].source];if(W.setClearcoatNormalTexture(H),Z.setTextureInfo(W.getClearcoatNormalTextureInfo(),G),G.scale!==void 0)W.setClearcoatNormalScale(G.scale)}}}),this}prewrite(Z){let J=Z.jsonDoc;return this.document.getRoot().listMaterials().forEach((X)=>{let Y=X.getExtension(GY);if(Y){let $=Z.materialIndexMap.get(X),Q=J.json.materials[$];Q.extensions=Q.extensions||{};let W=Q.extensions[GY]={clearcoatFactor:Y.getClearcoatFactor(),clearcoatRoughnessFactor:Y.getClearcoatRoughnessFactor()};if(Y.getClearcoatTexture()){let K=Y.getClearcoatTexture(),G=Y.getClearcoatTextureInfo();W.clearcoatTexture=Z.createTextureInfoDef(K,G)}if(Y.getClearcoatRoughnessTexture()){let K=Y.getClearcoatRoughnessTexture(),G=Y.getClearcoatRoughnessTextureInfo();W.clearcoatRoughnessTexture=Z.createTextureInfoDef(K,G)}if(Y.getClearcoatNormalTexture()){let K=Y.getClearcoatNormalTexture(),G=Y.getClearcoatNormalTextureInfo();if(W.clearcoatNormalTexture=Z.createTextureInfoDef(K,G),Y.getClearcoatNormalScale()!==1)W.clearcoatNormalTexture.scale=Y.getClearcoatNormalScale()}}}),this}}dP.EXTENSION_NAME=GY;var{R:tL1,G:eL1,B:Zw1,A:Jw1}=n5;class cP extends n1{init(){this.extensionName=CP,this.propertyType="DiffuseTransmission",this.parentTypes=[s.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{diffuseTransmissionFactor:0,diffuseTransmissionTexture:null,diffuseTransmissionTextureInfo:new T1(this.graph,"diffuseTransmissionTextureInfo"),diffuseTransmissionColorFactor:[1,1,1],diffuseTransmissionColorTexture:null,diffuseTransmissionColorTextureInfo:new T1(this.graph,"diffuseTransmissionColorTextureInfo")})}getDiffuseTransmissionFactor(){return this.get("diffuseTransmissionFactor")}setDiffuseTransmissionFactor(Z){return this.set("diffuseTransmissionFactor",Z)}getDiffuseTransmissionTexture(){return this.getRef("diffuseTransmissionTexture")}getDiffuseTransmissionTextureInfo(){return this.getRef("diffuseTransmissionTexture")?this.getRef("diffuseTransmissionTextureInfo"):null}setDiffuseTransmissionTexture(Z){return this.setRef("diffuseTransmissionTexture",Z,{channels:Jw1})}getDiffuseTransmissionColorFactor(){return this.get("diffuseTransmissionColorFactor")}setDiffuseTransmissionColorFactor(Z){return this.set("diffuseTransmissionColorFactor",Z)}getDiffuseTransmissionColorTexture(){return this.getRef("diffuseTransmissionColorTexture")}getDiffuseTransmissionColorTextureInfo(){return this.getRef("diffuseTransmissionColorTexture")?this.getRef("diffuseTransmissionColorTextureInfo"):null}setDiffuseTransmissionColorTexture(Z){return this.setRef("diffuseTransmissionColorTexture",Z,{channels:tL1|eL1|Zw1})}}cP.EXTENSION_NAME=CP;var HY=CP;class lP extends I1{constructor(...Z){super(...Z);this.extensionName=HY}createDiffuseTransmission(){return new cP(this.document.getGraph())}read(Z){let J=Z.jsonDoc,X=J.json.materials||[],Y=J.json.textures||[];return X.forEach(($,Q)=>{if($.extensions&&$.extensions[HY]){let W=this.createDiffuseTransmission();Z.materials[Q].setExtension(HY,W);let K=$.extensions[HY];if(K.diffuseTransmissionFactor!==void 0)W.setDiffuseTransmissionFactor(K.diffuseTransmissionFactor);if(K.diffuseTransmissionColorFactor!==void 0)W.setDiffuseTransmissionColorFactor(K.diffuseTransmissionColorFactor);if(K.diffuseTransmissionTexture!==void 0){let G=K.diffuseTransmissionTexture,H=Z.textures[Y[G.index].source];W.setDiffuseTransmissionTexture(H),Z.setTextureInfo(W.getDiffuseTransmissionTextureInfo(),G)}if(K.diffuseTransmissionColorTexture!==void 0){let G=K.diffuseTransmissionColorTexture,H=Z.textures[Y[G.index].source];W.setDiffuseTransmissionColorTexture(H),Z.setTextureInfo(W.getDiffuseTransmissionColorTextureInfo(),G)}}}),this}write(Z){let J=Z.jsonDoc;for(let X of this.document.getRoot().listMaterials()){let Y=X.getExtension(HY);if(!Y)continue;let $=Z.materialIndexMap.get(X),Q=J.json.materials[$];Q.extensions=Q.extensions||{};let W=Q.extensions[HY]={diffuseTransmissionFactor:Y.getDiffuseTransmissionFactor(),diffuseTransmissionColorFactor:Y.getDiffuseTransmissionColorFactor()};if(Y.getDiffuseTransmissionTexture()){let K=Y.getDiffuseTransmissionTexture(),G=Y.getDiffuseTransmissionTextureInfo();W.diffuseTransmissionTexture=Z.createTextureInfoDef(K,G)}if(Y.getDiffuseTransmissionColorTexture()){let K=Y.getDiffuseTransmissionColorTexture(),G=Y.getDiffuseTransmissionColorTextureInfo();W.diffuseTransmissionColorTexture=Z.createTextureInfoDef(K,G)}}return this}}lP.EXTENSION_NAME=HY;class pP extends n1{init(){this.extensionName=TP,this.propertyType="Dispersion",this.parentTypes=[s.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{dispersion:0})}getDispersion(){return this.get("dispersion")}setDispersion(Z){return this.set("dispersion",Z)}}pP.EXTENSION_NAME=TP;var zY=TP;class iP extends I1{constructor(...Z){super(...Z);this.extensionName=zY,this.prereadTypes=[s.MESH],this.prewriteTypes=[s.MESH]}createDispersion(){return new pP(this.document.getGraph())}read(Z){return this}write(Z){return this}preread(Z){return(Z.jsonDoc.json.materials||[]).forEach((Y,$)=>{if(Y.extensions&&Y.extensions[zY]){let Q=this.createDispersion();Z.materials[$].setExtension(zY,Q);let W=Y.extensions[zY];if(W.dispersion!==void 0)Q.setDispersion(W.dispersion)}}),this}prewrite(Z){let J=Z.jsonDoc;return this.document.getRoot().listMaterials().forEach((X)=>{let Y=X.getExtension(zY);if(Y){let $=Z.materialIndexMap.get(X),Q=J.json.materials[$];Q.extensions=Q.extensions||{},Q.extensions[zY]={dispersion:Y.getDispersion()}}}),this}}iP.EXTENSION_NAME=zY;class nP extends n1{init(){this.extensionName=kP,this.propertyType="EmissiveStrength",this.parentTypes=[s.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{emissiveStrength:1})}getEmissiveStrength(){return this.get("emissiveStrength")}setEmissiveStrength(Z){return this.set("emissiveStrength",Z)}}nP.EXTENSION_NAME=kP;var qY=kP;class aP extends I1{constructor(...Z){super(...Z);this.extensionName=qY,this.prereadTypes=[s.MESH],this.prewriteTypes=[s.MESH]}createEmissiveStrength(){return new nP(this.document.getGraph())}read(Z){return this}write(Z){return this}preread(Z){return(Z.jsonDoc.json.materials||[]).forEach((Y,$)=>{if(Y.extensions&&Y.extensions[qY]){let Q=this.createEmissiveStrength();Z.materials[$].setExtension(qY,Q);let W=Y.extensions[qY];if(W.emissiveStrength!==void 0)Q.setEmissiveStrength(W.emissiveStrength)}}),this}prewrite(Z){let J=Z.jsonDoc;return this.document.getRoot().listMaterials().forEach((X)=>{let Y=X.getExtension(qY);if(Y){let $=Z.materialIndexMap.get(X),Q=J.json.materials[$];Q.extensions=Q.extensions||{},Q.extensions[qY]={emissiveStrength:Y.getEmissiveStrength()}}}),this}}aP.EXTENSION_NAME=qY;class sP extends n1{init(){this.extensionName=EP,this.propertyType="IOR",this.parentTypes=[s.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{ior:1.5})}getIOR(){return this.get("ior")}setIOR(Z){return this.set("ior",Z)}}sP.EXTENSION_NAME=EP;var VY=EP;class E2 extends I1{constructor(...Z){super(...Z);this.extensionName=VY,this.prereadTypes=[s.MESH],this.prewriteTypes=[s.MESH]}createIOR(){return new sP(this.document.getGraph())}read(Z){return this}write(Z){return this}preread(Z){return(Z.jsonDoc.json.materials||[]).forEach((Y,$)=>{if(Y.extensions&&Y.extensions[VY]){let Q=this.createIOR();Z.materials[$].setExtension(VY,Q);let W=Y.extensions[VY];if(W.ior!==void 0)Q.setIOR(W.ior)}}),this}prewrite(Z){let J=Z.jsonDoc;return this.document.getRoot().listMaterials().forEach((X)=>{let Y=X.getExtension(VY);if(Y){let $=Z.materialIndexMap.get(X),Q=J.json.materials[$];Q.extensions=Q.extensions||{},Q.extensions[VY]={ior:Y.getIOR()}}}),this}}E2.EXTENSION_NAME=VY;var{R:Xw1,G:Yw1}=n5;class oP extends n1{init(){this.extensionName=IP,this.propertyType="Iridescence",this.parentTypes=[s.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{iridescenceFactor:0,iridescenceTexture:null,iridescenceTextureInfo:new T1(this.graph,"iridescenceTextureInfo"),iridescenceIOR:1.3,iridescenceThicknessMinimum:100,iridescenceThicknessMaximum:400,iridescenceThicknessTexture:null,iridescenceThicknessTextureInfo:new T1(this.graph,"iridescenceThicknessTextureInfo")})}getIridescenceFactor(){return this.get("iridescenceFactor")}setIridescenceFactor(Z){return this.set("iridescenceFactor",Z)}getIridescenceTexture(){return this.getRef("iridescenceTexture")}getIridescenceTextureInfo(){return this.getRef("iridescenceTexture")?this.getRef("iridescenceTextureInfo"):null}setIridescenceTexture(Z){return this.setRef("iridescenceTexture",Z,{channels:Xw1})}getIridescenceIOR(){return this.get("iridescenceIOR")}setIridescenceIOR(Z){return this.set("iridescenceIOR",Z)}getIridescenceThicknessMinimum(){return this.get("iridescenceThicknessMinimum")}setIridescenceThicknessMinimum(Z){return this.set("iridescenceThicknessMinimum",Z)}getIridescenceThicknessMaximum(){return this.get("iridescenceThicknessMaximum")}setIridescenceThicknessMaximum(Z){return this.set("iridescenceThicknessMaximum",Z)}getIridescenceThicknessTexture(){return this.getRef("iridescenceThicknessTexture")}getIridescenceThicknessTextureInfo(){return this.getRef("iridescenceThicknessTexture")?this.getRef("iridescenceThicknessTextureInfo"):null}setIridescenceThicknessTexture(Z){return this.setRef("iridescenceThicknessTexture",Z,{channels:Yw1})}}oP.EXTENSION_NAME=IP;var FY=IP;class rP extends I1{constructor(...Z){super(...Z);this.extensionName=FY,this.prereadTypes=[s.MESH],this.prewriteTypes=[s.MESH]}createIridescence(){return new oP(this.document.getGraph())}read(Z){return this}write(Z){return this}preread(Z){let J=Z.jsonDoc,X=J.json.materials||[],Y=J.json.textures||[];return X.forEach(($,Q)=>{if($.extensions&&$.extensions[FY]){let W=this.createIridescence();Z.materials[Q].setExtension(FY,W);let K=$.extensions[FY];if(K.iridescenceFactor!==void 0)W.setIridescenceFactor(K.iridescenceFactor);if(K.iridescenceIor!==void 0)W.setIridescenceIOR(K.iridescenceIor);if(K.iridescenceThicknessMinimum!==void 0)W.setIridescenceThicknessMinimum(K.iridescenceThicknessMinimum);if(K.iridescenceThicknessMaximum!==void 0)W.setIridescenceThicknessMaximum(K.iridescenceThicknessMaximum);if(K.iridescenceTexture!==void 0){let G=K.iridescenceTexture,H=Z.textures[Y[G.index].source];W.setIridescenceTexture(H),Z.setTextureInfo(W.getIridescenceTextureInfo(),G)}if(K.iridescenceThicknessTexture!==void 0){let G=K.iridescenceThicknessTexture,H=Z.textures[Y[G.index].source];W.setIridescenceThicknessTexture(H),Z.setTextureInfo(W.getIridescenceThicknessTextureInfo(),G)}}}),this}prewrite(Z){let J=Z.jsonDoc;return this.document.getRoot().listMaterials().forEach((X)=>{let Y=X.getExtension(FY);if(Y){let $=Z.materialIndexMap.get(X),Q=J.json.materials[$];Q.extensions=Q.extensions||{};let W=Q.extensions[FY]={};if(Y.getIridescenceFactor()>0)W.iridescenceFactor=Y.getIridescenceFactor();if(Y.getIridescenceIOR()!==1.3)W.iridescenceIor=Y.getIridescenceIOR();if(Y.getIridescenceThicknessMinimum()!==100)W.iridescenceThicknessMinimum=Y.getIridescenceThicknessMinimum();if(Y.getIridescenceThicknessMaximum()!==400)W.iridescenceThicknessMaximum=Y.getIridescenceThicknessMaximum();if(Y.getIridescenceTexture()){let K=Y.getIridescenceTexture(),G=Y.getIridescenceTextureInfo();W.iridescenceTexture=Z.createTextureInfoDef(K,G)}if(Y.getIridescenceThicknessTexture()){let K=Y.getIridescenceThicknessTexture(),G=Y.getIridescenceThicknessTextureInfo();W.iridescenceThicknessTexture=Z.createTextureInfoDef(K,G)}}}),this}}rP.EXTENSION_NAME=FY;var{R:Yn,G:$n,B:Qn,A:Wn}=n5;class tP extends n1{init(){this.extensionName=vP,this.propertyType="PBRSpecularGlossiness",this.parentTypes=[s.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{diffuseFactor:[1,1,1,1],diffuseTexture:null,diffuseTextureInfo:new T1(this.graph,"diffuseTextureInfo"),specularFactor:[1,1,1],glossinessFactor:1,specularGlossinessTexture:null,specularGlossinessTextureInfo:new T1(this.graph,"specularGlossinessTextureInfo")})}getDiffuseFactor(){return this.get("diffuseFactor")}setDiffuseFactor(Z){return this.set("diffuseFactor",Z)}getDiffuseTexture(){return this.getRef("diffuseTexture")}getDiffuseTextureInfo(){return this.getRef("diffuseTexture")?this.getRef("diffuseTextureInfo"):null}setDiffuseTexture(Z){return this.setRef("diffuseTexture",Z,{channels:Yn|$n|Qn|Wn,isColor:!0})}getSpecularFactor(){return this.get("specularFactor")}setSpecularFactor(Z){return this.set("specularFactor",Z)}getGlossinessFactor(){return this.get("glossinessFactor")}setGlossinessFactor(Z){return this.set("glossinessFactor",Z)}getSpecularGlossinessTexture(){return this.getRef("specularGlossinessTexture")}getSpecularGlossinessTextureInfo(){return this.getRef("specularGlossinessTexture")?this.getRef("specularGlossinessTextureInfo"):null}setSpecularGlossinessTexture(Z){return this.setRef("specularGlossinessTexture",Z,{channels:Yn|$n|Qn|Wn})}}tP.EXTENSION_NAME=vP;var UY=vP;class I2 extends I1{constructor(...Z){super(...Z);this.extensionName=UY,this.prereadTypes=[s.MESH],this.prewriteTypes=[s.MESH]}createPBRSpecularGlossiness(){return new tP(this.document.getGraph())}read(Z){return this}write(Z){return this}preread(Z){let J=Z.jsonDoc,X=J.json.materials||[],Y=J.json.textures||[];return X.forEach(($,Q)=>{if($.extensions&&$.extensions[UY]){let W=this.createPBRSpecularGlossiness();Z.materials[Q].setExtension(UY,W);let K=$.extensions[UY];if(K.diffuseFactor!==void 0)W.setDiffuseFactor(K.diffuseFactor);if(K.specularFactor!==void 0)W.setSpecularFactor(K.specularFactor);if(K.glossinessFactor!==void 0)W.setGlossinessFactor(K.glossinessFactor);if(K.diffuseTexture!==void 0){let G=K.diffuseTexture,H=Z.textures[Y[G.index].source];W.setDiffuseTexture(H),Z.setTextureInfo(W.getDiffuseTextureInfo(),G)}if(K.specularGlossinessTexture!==void 0){let G=K.specularGlossinessTexture,H=Z.textures[Y[G.index].source];W.setSpecularGlossinessTexture(H),Z.setTextureInfo(W.getSpecularGlossinessTextureInfo(),G)}}}),this}prewrite(Z){let J=Z.jsonDoc;return this.document.getRoot().listMaterials().forEach((X)=>{let Y=X.getExtension(UY);if(Y){let $=Z.materialIndexMap.get(X),Q=J.json.materials[$];Q.extensions=Q.extensions||{};let W=Q.extensions[UY]={diffuseFactor:Y.getDiffuseFactor(),specularFactor:Y.getSpecularFactor(),glossinessFactor:Y.getGlossinessFactor()};if(Y.getDiffuseTexture()){let K=Y.getDiffuseTexture(),G=Y.getDiffuseTextureInfo();W.diffuseTexture=Z.createTextureInfoDef(K,G)}if(Y.getSpecularGlossinessTexture()){let K=Y.getSpecularGlossinessTexture(),G=Y.getSpecularGlossinessTextureInfo();W.specularGlossinessTexture=Z.createTextureInfoDef(K,G)}}}),this}}I2.EXTENSION_NAME=UY;var{R:$w1,G:Qw1,B:Ww1,A:Kw1}=n5;class eP extends n1{init(){this.extensionName=SP,this.propertyType="Sheen",this.parentTypes=[s.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{sheenColorFactor:[0,0,0],sheenColorTexture:null,sheenColorTextureInfo:new T1(this.graph,"sheenColorTextureInfo"),sheenRoughnessFactor:0,sheenRoughnessTexture:null,sheenRoughnessTextureInfo:new T1(this.graph,"sheenRoughnessTextureInfo")})}getSheenColorFactor(){return this.get("sheenColorFactor")}setSheenColorFactor(Z){return this.set("sheenColorFactor",Z)}getSheenColorTexture(){return this.getRef("sheenColorTexture")}getSheenColorTextureInfo(){return this.getRef("sheenColorTexture")?this.getRef("sheenColorTextureInfo"):null}setSheenColorTexture(Z){return this.setRef("sheenColorTexture",Z,{channels:$w1|Qw1|Ww1,isColor:!0})}getSheenRoughnessFactor(){return this.get("sheenRoughnessFactor")}setSheenRoughnessFactor(Z){return this.set("sheenRoughnessFactor",Z)}getSheenRoughnessTexture(){return this.getRef("sheenRoughnessTexture")}getSheenRoughnessTextureInfo(){return this.getRef("sheenRoughnessTexture")?this.getRef("sheenRoughnessTextureInfo"):null}setSheenRoughnessTexture(Z){return this.setRef("sheenRoughnessTexture",Z,{channels:Kw1})}}eP.EXTENSION_NAME=SP;var LY=SP;class ZC extends I1{constructor(...Z){super(...Z);this.extensionName=LY,this.prereadTypes=[s.MESH],this.prewriteTypes=[s.MESH]}createSheen(){return new eP(this.document.getGraph())}read(Z){return this}write(Z){return this}preread(Z){let J=Z.jsonDoc,X=J.json.materials||[],Y=J.json.textures||[];return X.forEach(($,Q)=>{if($.extensions&&$.extensions[LY]){let W=this.createSheen();Z.materials[Q].setExtension(LY,W);let K=$.extensions[LY];if(K.sheenColorFactor!==void 0)W.setSheenColorFactor(K.sheenColorFactor);if(K.sheenRoughnessFactor!==void 0)W.setSheenRoughnessFactor(K.sheenRoughnessFactor);if(K.sheenColorTexture!==void 0){let G=K.sheenColorTexture,H=Z.textures[Y[G.index].source];W.setSheenColorTexture(H),Z.setTextureInfo(W.getSheenColorTextureInfo(),G)}if(K.sheenRoughnessTexture!==void 0){let G=K.sheenRoughnessTexture,H=Z.textures[Y[G.index].source];W.setSheenRoughnessTexture(H),Z.setTextureInfo(W.getSheenRoughnessTextureInfo(),G)}}}),this}prewrite(Z){let J=Z.jsonDoc;return this.document.getRoot().listMaterials().forEach((X)=>{let Y=X.getExtension(LY);if(Y){let $=Z.materialIndexMap.get(X),Q=J.json.materials[$];Q.extensions=Q.extensions||{};let W=Q.extensions[LY]={sheenColorFactor:Y.getSheenColorFactor(),sheenRoughnessFactor:Y.getSheenRoughnessFactor()};if(Y.getSheenColorTexture()){let K=Y.getSheenColorTexture(),G=Y.getSheenColorTextureInfo();W.sheenColorTexture=Z.createTextureInfoDef(K,G)}if(Y.getSheenRoughnessTexture()){let K=Y.getSheenRoughnessTexture(),G=Y.getSheenRoughnessTextureInfo();W.sheenRoughnessTexture=Z.createTextureInfoDef(K,G)}}}),this}}ZC.EXTENSION_NAME=LY;var{R:Gw1,G:Hw1,B:zw1,A:qw1}=n5;class JC extends n1{init(){this.extensionName=_P,this.propertyType="Specular",this.parentTypes=[s.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{specularFactor:1,specularTexture:null,specularTextureInfo:new T1(this.graph,"specularTextureInfo"),specularColorFactor:[1,1,1],specularColorTexture:null,specularColorTextureInfo:new T1(this.graph,"specularColorTextureInfo")})}getSpecularFactor(){return this.get("specularFactor")}setSpecularFactor(Z){return this.set("specularFactor",Z)}getSpecularColorFactor(){return this.get("specularColorFactor")}setSpecularColorFactor(Z){return this.set("specularColorFactor",Z)}getSpecularTexture(){return this.getRef("specularTexture")}getSpecularTextureInfo(){return this.getRef("specularTexture")?this.getRef("specularTextureInfo"):null}setSpecularTexture(Z){return this.setRef("specularTexture",Z,{channels:qw1})}getSpecularColorTexture(){return this.getRef("specularColorTexture")}getSpecularColorTextureInfo(){return this.getRef("specularColorTexture")?this.getRef("specularColorTextureInfo"):null}setSpecularColorTexture(Z){return this.setRef("specularColorTexture",Z,{channels:Gw1|Hw1|zw1,isColor:!0})}}JC.EXTENSION_NAME=_P;var wY=_P;class v2 extends I1{constructor(...Z){super(...Z);this.extensionName=wY,this.prereadTypes=[s.MESH],this.prewriteTypes=[s.MESH]}createSpecular(){return new JC(this.document.getGraph())}read(Z){return this}write(Z){return this}preread(Z){let J=Z.jsonDoc,X=J.json.materials||[],Y=J.json.textures||[];return X.forEach(($,Q)=>{if($.extensions&&$.extensions[wY]){let W=this.createSpecular();Z.materials[Q].setExtension(wY,W);let K=$.extensions[wY];if(K.specularFactor!==void 0)W.setSpecularFactor(K.specularFactor);if(K.specularColorFactor!==void 0)W.setSpecularColorFactor(K.specularColorFactor);if(K.specularTexture!==void 0){let G=K.specularTexture,H=Z.textures[Y[G.index].source];W.setSpecularTexture(H),Z.setTextureInfo(W.getSpecularTextureInfo(),G)}if(K.specularColorTexture!==void 0){let G=K.specularColorTexture,H=Z.textures[Y[G.index].source];W.setSpecularColorTexture(H),Z.setTextureInfo(W.getSpecularColorTextureInfo(),G)}}}),this}prewrite(Z){let J=Z.jsonDoc;return this.document.getRoot().listMaterials().forEach((X)=>{let Y=X.getExtension(wY);if(Y){let $=Z.materialIndexMap.get(X),Q=J.json.materials[$];Q.extensions=Q.extensions||{};let W=Q.extensions[wY]={};if(Y.getSpecularFactor()!==1)W.specularFactor=Y.getSpecularFactor();if(!K8.eq(Y.getSpecularColorFactor(),[1,1,1]))W.specularColorFactor=Y.getSpecularColorFactor();if(Y.getSpecularTexture()){let K=Y.getSpecularTexture(),G=Y.getSpecularTextureInfo();W.specularTexture=Z.createTextureInfoDef(K,G)}if(Y.getSpecularColorTexture()){let K=Y.getSpecularColorTexture(),G=Y.getSpecularColorTextureInfo();W.specularColorTexture=Z.createTextureInfoDef(K,G)}}}),this}}v2.EXTENSION_NAME=wY;var{R:Vw1}=n5;class XC extends n1{init(){this.extensionName=AP,this.propertyType="Transmission",this.parentTypes=[s.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{transmissionFactor:0,transmissionTexture:null,transmissionTextureInfo:new T1(this.graph,"transmissionTextureInfo")})}getTransmissionFactor(){return this.get("transmissionFactor")}setTransmissionFactor(Z){return this.set("transmissionFactor",Z)}getTransmissionTexture(){return this.getRef("transmissionTexture")}getTransmissionTextureInfo(){return this.getRef("transmissionTexture")?this.getRef("transmissionTextureInfo"):null}setTransmissionTexture(Z){return this.setRef("transmissionTexture",Z,{channels:Vw1})}}XC.EXTENSION_NAME=AP;var BY=AP;class YC extends I1{constructor(...Z){super(...Z);this.extensionName=BY,this.prereadTypes=[s.MESH],this.prewriteTypes=[s.MESH]}createTransmission(){return new XC(this.document.getGraph())}read(Z){return this}write(Z){return this}preread(Z){let J=Z.jsonDoc,X=J.json.materials||[],Y=J.json.textures||[];return X.forEach(($,Q)=>{if($.extensions&&$.extensions[BY]){let W=this.createTransmission();Z.materials[Q].setExtension(BY,W);let K=$.extensions[BY];if(K.transmissionFactor!==void 0)W.setTransmissionFactor(K.transmissionFactor);if(K.transmissionTexture!==void 0){let G=K.transmissionTexture,H=Z.textures[Y[G.index].source];W.setTransmissionTexture(H),Z.setTextureInfo(W.getTransmissionTextureInfo(),G)}}}),this}prewrite(Z){let J=Z.jsonDoc;return this.document.getRoot().listMaterials().forEach((X)=>{let Y=X.getExtension(BY);if(Y){let $=Z.materialIndexMap.get(X),Q=J.json.materials[$];Q.extensions=Q.extensions||{};let W=Q.extensions[BY]={transmissionFactor:Y.getTransmissionFactor()};if(Y.getTransmissionTexture()){let K=Y.getTransmissionTexture(),G=Y.getTransmissionTextureInfo();W.transmissionTexture=Z.createTextureInfoDef(K,G)}}}),this}}YC.EXTENSION_NAME=BY;class $C extends n1{init(){this.extensionName=xP,this.propertyType="Unlit",this.parentTypes=[s.MATERIAL]}}$C.EXTENSION_NAME=xP;var dQ=xP;class S2 extends I1{constructor(...Z){super(...Z);this.extensionName=dQ,this.prereadTypes=[s.MESH],this.prewriteTypes=[s.MESH]}createUnlit(){return new $C(this.document.getGraph())}read(Z){return this}write(Z){return this}preread(Z){return(Z.jsonDoc.json.materials||[]).forEach((X,Y)=>{if(X.extensions&&X.extensions[dQ])Z.materials[Y].setExtension(dQ,this.createUnlit())}),this}prewrite(Z){let J=Z.jsonDoc;return this.document.getRoot().listMaterials().forEach((X)=>{if(X.getExtension(dQ)){let Y=Z.materialIndexMap.get(X),$=J.json.materials[Y];$.extensions=$.extensions||{},$.extensions[dQ]={}}}),this}}S2.EXTENSION_NAME=dQ;class QC extends n1{init(){this.extensionName=MY,this.propertyType="Mapping",this.parentTypes=["MappingList"]}getDefaults(){return Object.assign(super.getDefaults(),{material:null,variants:new P0})}getMaterial(){return this.getRef("material")}setMaterial(Z){return this.setRef("material",Z)}addVariant(Z){return this.addRef("variants",Z)}removeVariant(Z){return this.removeRef("variants",Z)}listVariants(){return this.listRefs("variants")}}QC.EXTENSION_NAME=MY;class WC extends n1{init(){this.extensionName=MY,this.propertyType="MappingList",this.parentTypes=[s.PRIMITIVE]}getDefaults(){return Object.assign(super.getDefaults(),{mappings:new P0})}addMapping(Z){return this.addRef("mappings",Z)}removeMapping(Z){return this.removeRef("mappings",Z)}listMappings(){return this.listRefs("mappings")}}WC.EXTENSION_NAME=MY;class P2 extends n1{init(){this.extensionName=MY,this.propertyType="Variant",this.parentTypes=["MappingList"]}}P2.EXTENSION_NAME=MY;var H7=MY;class KC extends I1{constructor(...Z){super(...Z);this.extensionName=H7}createMappingList(){return new WC(this.document.getGraph())}createVariant(Z=""){return new P2(this.document.getGraph(),Z)}createMapping(){return new QC(this.document.getGraph())}listVariants(){return Array.from(this.properties).filter((Z)=>Z instanceof P2)}read(Z){let J=Z.jsonDoc;if(!J.json.extensions||!J.json.extensions[H7])return this;let $=(J.json.extensions[H7].variants||[]).map((W)=>this.createVariant().setName(W.name||""));return(J.json.meshes||[]).forEach((W,K)=>{let G=Z.meshes[K];(W.primitives||[]).forEach((z,q)=>{if(!z.extensions||!z.extensions[H7])return;let V=this.createMappingList(),F=z.extensions[H7];for(let U of F.mappings){let w=this.createMapping();if(U.material!==void 0)w.setMaterial(Z.materials[U.material]);for(let L of U.variants||[])w.addVariant($[L]);V.addMapping(w)}G.listPrimitives()[q].setExtension(H7,V)})}),this}write(Z){let J=Z.jsonDoc,X=this.listVariants();if(!X.length)return this;let Y=[],$=new Map;for(let Q of X)$.set(Q,Y.length),Y.push(Z.createPropertyDef(Q));for(let Q of this.document.getRoot().listMeshes()){let W=Z.meshIndexMap.get(Q);Q.listPrimitives().forEach((K,G)=>{let H=K.getExtension(H7);if(!H)return;let z=Z.jsonDoc.json.meshes[W].primitives[G],q=H.listMappings().map((V)=>{let F=Z.createPropertyDef(V),U=V.getMaterial();if(U)F.material=Z.materialIndexMap.get(U);return F.variants=V.listVariants().map((w)=>$.get(w)),F});z.extensions=z.extensions||{},z.extensions[H7]={mappings:q}})}return J.json.extensions=J.json.extensions||{},J.json.extensions[H7]={variants:Y},this}}KC.EXTENSION_NAME=H7;var{G:Fw1}=n5;class GC extends n1{init(){this.extensionName=hP,this.propertyType="Volume",this.parentTypes=[s.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{thicknessFactor:0,thicknessTexture:null,thicknessTextureInfo:new T1(this.graph,"thicknessTexture"),attenuationDistance:1/0,attenuationColor:[1,1,1]})}getThicknessFactor(){return this.get("thicknessFactor")}setThicknessFactor(Z){return this.set("thicknessFactor",Z)}getThicknessTexture(){return this.getRef("thicknessTexture")}getThicknessTextureInfo(){return this.getRef("thicknessTexture")?this.getRef("thicknessTextureInfo"):null}setThicknessTexture(Z){return this.setRef("thicknessTexture",Z,{channels:Fw1})}getAttenuationDistance(){return this.get("attenuationDistance")}setAttenuationDistance(Z){return this.set("attenuationDistance",Z)}getAttenuationColor(){return this.get("attenuationColor")}setAttenuationColor(Z){return this.set("attenuationColor",Z)}}GC.EXTENSION_NAME=hP;var OY=hP;class HC extends I1{constructor(...Z){super(...Z);this.extensionName=OY,this.prereadTypes=[s.MESH],this.prewriteTypes=[s.MESH]}createVolume(){return new GC(this.document.getGraph())}read(Z){return this}write(Z){return this}preread(Z){let J=Z.jsonDoc,X=J.json.materials||[],Y=J.json.textures||[];return X.forEach(($,Q)=>{if($.extensions&&$.extensions[OY]){let W=this.createVolume();Z.materials[Q].setExtension(OY,W);let K=$.extensions[OY];if(K.thicknessFactor!==void 0)W.setThicknessFactor(K.thicknessFactor);if(K.attenuationDistance!==void 0)W.setAttenuationDistance(K.attenuationDistance);if(K.attenuationColor!==void 0)W.setAttenuationColor(K.attenuationColor);if(K.thicknessTexture!==void 0){let G=K.thicknessTexture,H=Z.textures[Y[G.index].source];W.setThicknessTexture(H),Z.setTextureInfo(W.getThicknessTextureInfo(),G)}}}),this}prewrite(Z){let J=Z.jsonDoc;return this.document.getRoot().listMaterials().forEach((X)=>{let Y=X.getExtension(OY);if(Y){let $=Z.materialIndexMap.get(X),Q=J.json.materials[$];Q.extensions=Q.extensions||{};let W=Q.extensions[OY]={};if(Y.getThicknessFactor()>0)W.thicknessFactor=Y.getThicknessFactor();if(Number.isFinite(Y.getAttenuationDistance()))W.attenuationDistance=Y.getAttenuationDistance();if(!K8.eq(Y.getAttenuationColor(),[1,1,1]))W.attenuationColor=Y.getAttenuationColor();if(Y.getThicknessTexture()){let K=Y.getThicknessTexture(),G=Y.getThicknessTextureInfo();W.thicknessTexture=Z.createTextureInfoDef(K,G)}}}),this}}HC.EXTENSION_NAME=OY;var Un=EL1;class PG extends I1{constructor(...Z){super(...Z);this.extensionName=Un}read(Z){return this}write(Z){return this}}PG.EXTENSION_NAME=Un;var jG=IL1;class Ln{match(Z){return Z[0]===171&&Z[1]===75&&Z[2]===84&&Z[3]===88&&Z[4]===32&&Z[5]===50&&Z[6]===48&&Z[7]===187&&Z[8]===13&&Z[9]===10&&Z[10]===26&&Z[11]===10}getSize(Z){let J=R2(Z);return[J.pixelWidth,J.pixelHeight]}getChannels(Z){let X=R2(Z).dataFormatDescriptor[0];if(X.colorModel===ii)return X.samples.length===2&&(X.samples[1].channelType&15)===15?4:3;else if(X.colorModel===ni)return(X.samples[0].channelType&15)===3?4:3;throw new Error(`Unexpected KTX2 colorModel, "${X.colorModel}".`)}getVRAMByteLength(Z){let J=R2(Z),X=this.getChannels(Z)>3,Y=0;for(let $=0;$<J.levels.length;$++){let Q=J.levels[$];if(Q.uncompressedByteLength)Y+=Q.uncompressedByteLength;else{let W=Math.max(1,Math.floor(J.pixelWidth/Math.pow(2,$))),K=Math.max(1,Math.floor(J.pixelHeight/Math.pow(2,$))),G=X?16:8;Y+=W/4*(K/4)*G}}return Y}}class zC extends I1{constructor(...Z){super(...Z);this.extensionName=jG,this.prereadTypes=[s.TEXTURE]}static register(){V4.registerFormat("image/ktx2",new Ln)}preread(Z){return Z.jsonDoc.json.textures.forEach((J)=>{if(J.extensions&&J.extensions[jG]){let X=J.extensions[jG];J.source=X.source}}),this}read(Z){return this}write(Z){let J=Z.jsonDoc;return this.document.getRoot().listTextures().forEach((X)=>{if(X.getMimeType()==="image/ktx2"){let Y=Z.imageIndexMap.get(X);J.json.textures.forEach(($)=>{if($.source===Y)$.extensions=$.extensions||{},$.extensions[jG]={source:$.source},delete $.source})}}),this}}zC.EXTENSION_NAME=jG;class qC extends n1{init(){this.extensionName=fP,this.propertyType="Transform",this.parentTypes=[s.TEXTURE_INFO]}getDefaults(){return Object.assign(super.getDefaults(),{offset:[0,0],rotation:0,scale:[1,1],texCoord:null})}getOffset(){return this.get("offset")}setOffset(Z){return this.set("offset",Z)}getRotation(){return this.get("rotation")}setRotation(Z){return this.set("rotation",Z)}getScale(){return this.get("scale")}setScale(Z){return this.set("scale",Z)}getTexCoord(){return this.get("texCoord")}setTexCoord(Z){return this.set("texCoord",Z)}}qC.EXTENSION_NAME=fP;var jY=fP;class VC extends I1{constructor(...Z){super(...Z);this.extensionName=jY}createTransform(){return new qC(this.document.getGraph())}read(Z){for(let[J,X]of Array.from(Z.textureInfos.entries())){if(!X.extensions||!X.extensions[jY])continue;let Y=this.createTransform(),$=X.extensions[jY];if($.offset!==void 0)Y.setOffset($.offset);if($.rotation!==void 0)Y.setRotation($.rotation);if($.scale!==void 0)Y.setScale($.scale);if($.texCoord!==void 0)Y.setTexCoord($.texCoord);J.setExtension(jY,Y)}return this}write(Z){let J=Array.from(Z.textureInfoDefMap.entries());for(let[X,Y]of J){let $=X.getExtension(jY);if(!$)continue;Y.extensions=Y.extensions||{};let Q={},W=K8.eq;if(!W($.getOffset(),[0,0]))Q.offset=$.getOffset();if($.getRotation()!==0)Q.rotation=$.getRotation();if(!W($.getScale(),[1,1]))Q.scale=$.getScale();if($.getTexCoord()!=null)Q.texCoord=$.getTexCoord();Y.extensions[jY]=Q}return this}}VC.EXTENSION_NAME=jY;var Uw1=[s.ROOT,s.SCENE,s.NODE,s.MESH,s.MATERIAL,s.TEXTURE,s.ANIMATION];class FC extends n1{init(){this.extensionName=N2,this.propertyType="Packet",this.parentTypes=Uw1}getDefaults(){return Object.assign(super.getDefaults(),{context:{},properties:{}})}getContext(){return this.get("context")}setContext(Z){return this.set("context",UZ({},Z))}listProperties(){return Object.keys(this.get("properties"))}getProperty(Z){let J=this.get("properties");return Z in J?J[Z]:null}setProperty(Z,J){this._assertContext(Z);let X=UZ({},this.get("properties"));if(J)X[Z]=J;else delete X[Z];return this.set("properties",X)}toJSONLD(){let Z=BP(this.get("context")),J=BP(this.get("properties"));return UZ({"@context":Z},J)}fromJSONLD(Z){Z=BP(Z);let J=Z["@context"];if(J)this.set("context",J);return delete Z["@context"],this.set("properties",Z)}_assertContext(Z){if(!(Z.split(":")[0]in this.get("context")))throw new Error(`${N2}: Missing context for term, "${Z}".`)}}FC.EXTENSION_NAME=N2;function BP(Z){return JSON.parse(JSON.stringify(Z))}var FZ=N2;class UC extends I1{constructor(...Z){super(...Z);this.extensionName=FZ}createPacket(){return new FC(this.document.getGraph())}listPackets(){return Array.from(this.properties)}read(Z){var J;let X=(J=Z.jsonDoc.json.extensions)==null?void 0:J[FZ];if(!X||!X.packets)return this;let Y=Z.jsonDoc.json,$=this.document.getRoot(),Q=X.packets.map((G)=>this.createPacket().fromJSONLD(G)),W=[[Y.asset],Y.scenes,Y.nodes,Y.meshes,Y.materials,Y.images,Y.animations],K=[[$],$.listScenes(),$.listNodes(),$.listMeshes(),$.listMaterials(),$.listTextures(),$.listAnimations()];for(let G=0;G<W.length;G++){let H=W[G]||[];for(let z=0;z<H.length;z++){let q=H[z];if(q.extensions&&q.extensions[FZ]){let V=q.extensions[FZ];K[G][z].setExtension(FZ,Q[V.packet])}}}return this}write(Z){let{json:J}=Z.jsonDoc,X=[];for(let Y of this.properties){X.push(Y.toJSONLD());for(let $ of Y.listParents()){let Q;switch($.propertyType){case s.ROOT:Q=J.asset;break;case s.SCENE:Q=J.scenes[Z.sceneIndexMap.get($)];break;case s.NODE:Q=J.nodes[Z.nodeIndexMap.get($)];break;case s.MESH:Q=J.meshes[Z.meshIndexMap.get($)];break;case s.MATERIAL:Q=J.materials[Z.materialIndexMap.get($)];break;case s.TEXTURE:Q=J.images[Z.imageIndexMap.get($)];break;case s.ANIMATION:Q=J.animations[Z.animationIndexMap.get($)];break;default:Q=null,this.document.getLogger().warn(`[${FZ}]: Unsupported parent property, "${$.propertyType}"`);break}if(!Q)continue;Q.extensions=Q.extensions||{},Q.extensions[FZ]={packet:X.length-1}}}if(X.length>0)J.extensions=J.extensions||{},J.extensions[FZ]={packets:X};return this}}UC.EXTENSION_NAME=FZ;var Lw1=[DG,yP,mP,dP,lP,iP,aP,E2,rP,I2,v2,ZC,YC,S2,KC,HC,PG,zC,VC,UC],Xz6=[C2,NG,T2,k2,...Lw1];var ww1=t(vD(),1);function nQ(){return nQ=Object.assign?Object.assign.bind():function(Z){for(var J=1;J<arguments.length;J++){var X=arguments[J];for(var Y in X)({}).hasOwnProperty.call(X,Y)&&(Z[Y]=X[Y])}return Z},nQ.apply(null,arguments)}var{POINTS:wn,LINES:_2,LINE_STRIP:Bw1,LINE_LOOP:Ow1,TRIANGLES:A2,TRIANGLE_STRIP:jw1,TRIANGLE_FAN:Mw1}=M8.Mode;function DJ(Z,J){return Object.defineProperty(J,"name",{value:Z}),J}function z7(Z,J){let X=nQ({},Z);for(let Y in J)if(J[Y]!==void 0)X[Y]=J[Y];return X}function fn(Z){let J=Z.getIndices(),X=Z.getAttribute("POSITION");switch(Z.getMode()){case M8.Mode.POINTS:return J?J.getCount():X.getCount();case M8.Mode.LINES:return J?J.getCount()/2:X.getCount()/2;case M8.Mode.LINE_LOOP:return J?J.getCount():X.getCount();case M8.Mode.LINE_STRIP:return J?J.getCount()-1:X.getCount()-1;case M8.Mode.TRIANGLES:return J?J.getCount()/3:X.getCount()/3;case M8.Mode.TRIANGLE_STRIP:case M8.Mode.TRIANGLE_FAN:return J?J.getCount()-2:X.getCount()-2;default:throw new Error("Unexpected mode: "+Z.getMode())}}var Rw1=new Intl.NumberFormat(void 0,{maximumFractionDigits:0});function OC(Z){return Rw1.format(Z)}function Nw1(Z,J,X=2){let Y=Z>J?"\u2013":"+",$="%";return Y+(Math.abs(Z-J)/Z*100).toFixed(X)+"%"}function y2(Z,J){return`${OC(Z)} \u2192 ${OC(J)} (${Nw1(Z,J)})`}function CC(Z){let J=[];for(let X of Z.listAttributes())J.push(X);for(let X of Z.listTargets())for(let Y of X.listAttributes())J.push(Y);return Array.from(new Set(J))}function Dw1(Z,J,X){Z.swap(J,X);for(let Y of Z.listTargets())Y.swap(J,X)}function Pw1(Z,J){if(Z==null&&J==null)return!0;if(Z==null||J==null)return!1;if(Z.length!==J.length)return!1;for(let X=0;X<Z.length;X++)if(Z[X]!==J[X])return!1;return!0}function LZ(Z,J){return Z.createAccessor(J.getName()).setArray(J.getArray()).setType(J.getType()).setBuffer(J.getBuffer()).setNormalized(J.getNormalized()).setSparse(J.getSparse())}function Cw1(Z,J=Z){let X=TC(Z,J);for(let Y=0;Y<X.length;Y++)X[Y]=Y;return X}function TC(Z,J=Z){return J<=65534?new Uint16Array(Z):new Uint32Array(Z)}function Tw1(Z){return Z.listParents().some((J)=>J.propertyType!==a.ROOT)}function bn(Z){for(let J in Z)return!1;return!0}function yn(Z){let J=C6.fromGraph(Z.getGraph()),X=Z.getMaterial(),Y=J.getRoot().listMaterials().indexOf(X),$=Ew1[Z.getMode()],Q=!!Z.getIndices(),W=Z.listSemantics().sort().map((G)=>{let H=Z.getAttribute(G),z=H.getElementSize(),q=H.getComponentType();return`${G}:${z}:${q}`}).join("+"),K=Z.listTargets().map((G)=>{return G.listSemantics().sort().map((H)=>{let z=Z.getAttribute(H),q=z.getElementSize(),V=z.getComponentType();return`${H}:${q}:${V}`}).join("+")}).join("~");return`${Y}|${$}|${Q}|${W}|${K}`}function kw1(Z){return Math.pow(2,Math.ceil(Math.log(Z)/Math.LN2))}var Ew1={[wn]:wn,[_2]:_2,[Bw1]:_2,[Ow1]:_2,[A2]:A2,[jw1]:A2,[Mw1]:A2},pQ="center",Bn={pivot:"center"};function gn(Z=Bn){let J=z7(Bn,Z);return DJ(pQ,(X)=>{let Y=X.getLogger(),$=X.getRoot(),Q=$.listAnimations().length>0||$.listSkins().length>0;X.getRoot().listScenes().forEach((W,K)=>{Y.debug(`${pQ}: Scene ${K+1} / ${$.listScenes().length}.`);let G;if(typeof J.pivot==="string"){let z=DD(W);if(G=[(z.max[0]-z.min[0])/2+z.min[0],(z.max[1]-z.min[1])/2+z.min[1],(z.max[2]-z.min[2])/2+z.min[2]],J.pivot==="above")G[1]=z.max[1];if(J.pivot==="below")G[1]=z.min[1]}else G=J.pivot;Y.debug(`${pQ}: Pivot "${G.join(", ")}".`);let H=[-1*G[0],-1*G[1],-1*G[2]];if(Q){Y.debug(`${pQ}: Model contains animation or skin. Adding a wrapper node.`);let z=X.createNode("Pivot").setTranslation(H);W.listChildren().forEach((q)=>z.addChild(q)),W.addChild(z)}else Y.debug(`${pQ}: Skipping wrapper, offsetting all root nodes.`),W.listChildren().forEach((z)=>{let q=z.getTranslation();z.setTranslation([q[0]+H[0],q[1]+H[1],q[2]+H[2]])})}),Y.debug(`${pQ}: Complete.`)})}function Iw1(Z){let J=new Set,X=Z,Y;while(Y=X.getParentNode()){if(J.has(Y))throw new Error("Circular dependency in scene graph.");J.add(Y),X=Y}return X.listParents().filter(($)=>$ instanceof vQ)}function vw1(Z){let J=Iw1(Z),X=Z.getParentNode();if(!X)return Z;Z.setMatrix(Z.getWorldMatrix()),X.removeChild(Z);for(let Y of J)Y.addChild(Z);return Z}var aQ=typeof Float32Array!=="undefined"?Float32Array:Array;if(!Math.hypot)Math.hypot=function(){var Z=0,J=arguments.length;while(J--)Z+=arguments[J]*arguments[J];return Math.sqrt(Z)};function Sw1(Z,J){var X=J[0],Y=J[1],$=J[2],Q=J[3],W=J[4],K=J[5],G=J[6],H=J[7],z=J[8],q=J[9],V=J[10],F=J[11],U=J[12],w=J[13],L=J[14],O=J[15],N=X*K-Y*W,M=X*G-$*W,j=X*H-Q*W,P=Y*G-$*K,D=Y*H-Q*K,C=$*H-Q*G,k=z*w-q*U,T=z*L-V*U,x=z*O-F*U,S=q*L-V*w,h=q*O-F*w,I=V*O-F*L,v=N*I-M*h+j*S+P*x-D*T+C*k;if(!v)return null;return v=1/v,Z[0]=(K*I-G*h+H*S)*v,Z[1]=($*h-Y*I-Q*S)*v,Z[2]=(w*C-L*D+O*P)*v,Z[3]=(V*D-q*C-F*P)*v,Z[4]=(G*x-W*I-H*T)*v,Z[5]=(X*I-$*x+Q*T)*v,Z[6]=(L*j-U*C-O*M)*v,Z[7]=(z*C-V*j+F*M)*v,Z[8]=(W*h-K*x+H*k)*v,Z[9]=(Y*x-X*h-Q*k)*v,Z[10]=(U*D-w*j+O*N)*v,Z[11]=(q*j-z*D-F*N)*v,Z[12]=(K*T-W*S-G*k)*v,Z[13]=(X*S-Y*T+$*k)*v,Z[14]=(w*M-U*P-L*N)*v,Z[15]=(z*P-q*M+V*N)*v,Z}function _w1(Z){var J=Z[0],X=Z[1],Y=Z[2],$=Z[3],Q=Z[4],W=Z[5],K=Z[6],G=Z[7],H=Z[8],z=Z[9],q=Z[10],V=Z[11],F=Z[12],U=Z[13],w=Z[14],L=Z[15],O=J*W-X*Q,N=J*K-Y*Q,M=J*G-$*Q,j=X*K-Y*W,P=X*G-$*W,D=Y*G-$*K,C=H*U-z*F,k=H*w-q*F,T=H*L-V*F,x=z*w-q*U,S=z*L-V*U,h=q*L-V*w;return O*h-N*S+M*x+j*T-P*k+D*C}function mn(Z,J,X){var Y=J[0],$=J[1],Q=J[2],W=J[3],K=J[4],G=J[5],H=J[6],z=J[7],q=J[8],V=J[9],F=J[10],U=J[11],w=J[12],L=J[13],O=J[14],N=J[15],M=X[0],j=X[1],P=X[2],D=X[3];return Z[0]=M*Y+j*K+P*q+D*w,Z[1]=M*$+j*G+P*V+D*L,Z[2]=M*Q+j*H+P*F+D*O,Z[3]=M*W+j*z+P*U+D*N,M=X[4],j=X[5],P=X[6],D=X[7],Z[4]=M*Y+j*K+P*q+D*w,Z[5]=M*$+j*G+P*V+D*L,Z[6]=M*Q+j*H+P*F+D*O,Z[7]=M*W+j*z+P*U+D*N,M=X[8],j=X[9],P=X[10],D=X[11],Z[8]=M*Y+j*K+P*q+D*w,Z[9]=M*$+j*G+P*V+D*L,Z[10]=M*Q+j*H+P*F+D*O,Z[11]=M*W+j*z+P*U+D*N,M=X[12],j=X[13],P=X[14],D=X[15],Z[12]=M*Y+j*K+P*q+D*w,Z[13]=M*$+j*G+P*V+D*L,Z[14]=M*Q+j*H+P*F+D*O,Z[15]=M*W+j*z+P*U+D*N,Z}function Aw1(){var Z=new aQ(9);if(aQ!=Float32Array)Z[1]=0,Z[2]=0,Z[3]=0,Z[5]=0,Z[6]=0,Z[7]=0;return Z[0]=1,Z[4]=1,Z[8]=1,Z}function xw1(Z,J){return Z[0]=J[0],Z[1]=J[1],Z[2]=J[2],Z[3]=J[4],Z[4]=J[5],Z[5]=J[6],Z[6]=J[8],Z[7]=J[9],Z[8]=J[10],Z}function hw1(Z,J){if(Z===J){var X=J[1],Y=J[2],$=J[5];Z[1]=J[3],Z[2]=J[6],Z[3]=X,Z[5]=J[7],Z[6]=Y,Z[7]=$}else Z[0]=J[0],Z[1]=J[3],Z[2]=J[6],Z[3]=J[1],Z[4]=J[4],Z[5]=J[7],Z[6]=J[2],Z[7]=J[5],Z[8]=J[8];return Z}function fw1(Z,J){var X=J[0],Y=J[1],$=J[2],Q=J[3],W=J[4],K=J[5],G=J[6],H=J[7],z=J[8],q=z*W-K*H,V=-z*Q+K*G,F=H*Q-W*G,U=X*q+Y*V+$*F;if(!U)return null;return U=1/U,Z[0]=q*U,Z[1]=(-z*Y+$*H)*U,Z[2]=(K*Y-$*W)*U,Z[3]=V*U,Z[4]=(z*X-$*G)*U,Z[5]=(-K*X+$*Q)*U,Z[6]=F*U,Z[7]=(-H*X+Y*G)*U,Z[8]=(W*X-Y*Q)*U,Z}function g2(){var Z=new aQ(3);if(aQ!=Float32Array)Z[0]=0,Z[1]=0,Z[2]=0;return Z}function bw1(Z,J,X){return Z[0]=J[0]*X[0],Z[1]=J[1]*X[1],Z[2]=J[2]*X[2],Z}function un(Z,J){var X=J[0],Y=J[1],$=J[2],Q=X*X+Y*Y+$*$;if(Q>0)Q=1/Math.sqrt(Q);return Z[0]=J[0]*Q,Z[1]=J[1]*Q,Z[2]=J[2]*Q,Z}function yw1(Z,J,X){var Y=J[0],$=J[1],Q=J[2],W=X[3]*Y+X[7]*$+X[11]*Q+X[15];return W=W||1,Z[0]=(X[0]*Y+X[4]*$+X[8]*Q+X[12])/W,Z[1]=(X[1]*Y+X[5]*$+X[9]*Q+X[13])/W,Z[2]=(X[2]*Y+X[6]*$+X[10]*Q+X[14])/W,Z}function gw1(Z,J,X){var Y=J[0],$=J[1],Q=J[2];return Z[0]=Y*X[0]+$*X[3]+Q*X[6],Z[1]=Y*X[1]+$*X[4]+Q*X[7],Z[2]=Y*X[2]+$*X[5]+Q*X[8],Z}var mw1=bw1;(function(){var Z=g2();return function(J,X,Y,$,Q,W){var K,G;if(!X)X=3;if(!Y)Y=0;if($)G=Math.min($*X+Y,J.length);else G=J.length;for(K=Y;K<G;K+=X)Z[0]=J[K],Z[1]=J[K+1],Z[2]=J[K+2],Q(Z,Z,W),J[K]=Z[0],J[K+1]=Z[1],J[K+2]=Z[2];return J}})();var RJ="dedup",LC={keepUniqueNames:!1,propertyTypes:[a.ACCESSOR,a.MESH,a.TEXTURE,a.MATERIAL,a.SKIN]};function dn(Z=LC){let J=z7(LC,Z),X=new Set(J.propertyTypes);for(let Y of J.propertyTypes)if(!LC.propertyTypes.includes(Y))throw new Error(`${RJ}: Unsupported deduplication on type "${Y}".`);return DJ(RJ,(Y)=>{let $=Y.getLogger();if(X.has(a.ACCESSOR))uw1(Y);if(X.has(a.TEXTURE))cw1(Y,J);if(X.has(a.MATERIAL))lw1(Y,J);if(X.has(a.MESH))dw1(Y,J);if(X.has(a.SKIN))pw1(Y,J);$.debug(`${RJ}: Complete.`)})}function uw1(Z){let J=Z.getLogger(),X=new Map,Y=new Map,$=new Map,Q=new Map,W=Z.getRoot().listMeshes();W.forEach((q)=>{q.listPrimitives().forEach((V)=>{V.listAttributes().forEach((F)=>K(F,Y)),K(V.getIndices(),X)})});for(let q of Z.getRoot().listAnimations())for(let V of q.listSamplers())K(V.getInput(),$),K(V.getOutput(),Q);function K(q,V){if(!q)return;let F=[q.getCount(),q.getType(),q.getComponentType(),q.getNormalized(),q.getSparse()].join(":"),U=V.get(F);if(!U)V.set(F,U=new Set);U.add(q)}function G(q,V){for(let F=0;F<q.length;F++){let U=q[F],w=n0.toView(U.getArray());if(V.has(U))continue;for(let L=F+1;L<q.length;L++){let O=q[L];if(V.has(O))continue;if(n0.equals(w,n0.toView(O.getArray())))V.set(O,U)}}}let H=0,z=new Map;for(let q of[Y,X,$,Q])for(let V of q.values())H+=V.size,G(Array.from(V),z);J.debug(`${RJ}: Merged ${z.size} of ${H} accessors.`),W.forEach((q)=>{q.listPrimitives().forEach((V)=>{V.listAttributes().forEach((U)=>{if(z.has(U))V.swap(U,z.get(U))});let F=V.getIndices();if(F&&z.has(F))V.swap(F,z.get(F))})});for(let q of Z.getRoot().listAnimations())for(let V of q.listSamplers()){let F=V.getInput(),U=V.getOutput();if(F&&z.has(F))V.swap(F,z.get(F));if(U&&z.has(U))V.swap(U,z.get(U))}Array.from(z.keys()).forEach((q)=>q.dispose())}function dw1(Z,J){let X=Z.getLogger(),Y=Z.getRoot(),$=new Map;Y.listAccessors().forEach((K,G)=>$.set(K,G)),Y.listMaterials().forEach((K,G)=>$.set(K,G));let Q=Y.listMeshes().length,W=new Map;for(let K of Y.listMeshes()){let G=[];for(let z of K.listPrimitives())G.push(cn(z,$));let H="";if(J.keepUniqueNames)H+=K.getName()+";";if(H+=G.join(";"),W.has(H)){let z=W.get(H);K.listParents().forEach((q)=>{if(q.propertyType!==a.ROOT)q.swap(K,z)}),K.dispose()}else W.set(H,K)}X.debug(`${RJ}: Merged ${Q-W.size} of ${Q} meshes.`)}function cw1(Z,J){let X=Z.getLogger(),Y=Z.getRoot(),$=Y.listTextures(),Q=new Map;for(let W=0;W<$.length;W++){let K=$[W],G=K.getImage();if(Q.has(K))continue;for(let H=W+1;H<$.length;H++){let z=$[H],q=z.getImage();if(Q.has(z))continue;if(K.getMimeType()!==z.getMimeType())continue;if(J.keepUniqueNames&&K.getName()!==z.getName())continue;let V=K.getSize(),F=z.getSize();if(!V||!F)continue;if(V[0]!==F[0])continue;if(V[1]!==F[1])continue;if(!G||!q)continue;if(n0.equals(G,q))Q.set(z,K)}}X.debug(`${RJ}: Merged ${Q.size} of ${Y.listTextures().length} textures.`),Array.from(Q.entries()).forEach(([W,K])=>{W.listParents().forEach((G)=>{if(!(G instanceof JY))G.swap(W,K)}),W.dispose()})}function lw1(Z,J){let X=Z.getLogger(),$=Z.getRoot().listMaterials(),Q=new Map,W=new Map,K=new Set;if(!J.keepUniqueNames)K.add("name");for(let G=0;G<$.length;G++){let H=$[G];if(Q.has(H))continue;if(On(H,W))continue;for(let z=G+1;z<$.length;z++){let q=$[z];if(Q.has(q))continue;if(On(q,W))continue;if(H.equals(q,K))Q.set(q,H)}}X.debug(`${RJ}: Merged ${Q.size} of ${$.length} materials.`),Array.from(Q.entries()).forEach(([G,H])=>{G.listParents().forEach((z)=>{if(!(z instanceof JY))z.swap(G,H)}),G.dispose()})}function pw1(Z,J){let X=Z.getLogger(),$=Z.getRoot().listSkins(),Q=new Map,W=new Set(["joints"]);if(!J.keepUniqueNames)W.add("name");for(let K=0;K<$.length;K++){let G=$[K];if(Q.has(G))continue;for(let H=K+1;H<$.length;H++){let z=$[H];if(Q.has(z))continue;if(G.equals(z,W)&&Pw1(G.listJoints(),z.listJoints()))Q.set(z,G)}}X.debug(`${RJ}: Merged ${Q.size} of ${$.length} skins.`),Array.from(Q.entries()).forEach(([K,G])=>{K.listParents().forEach((H)=>{if(!(H instanceof JY))H.swap(K,G)}),K.dispose()})}function cn(Z,J){let X=[];for(let Y of Z.listSemantics()){let $=Z.getAttribute(Y);X.push(Y+":"+J.get($))}if(Z instanceof M8){let Y=Z.getIndices();if(Y)X.push("indices:"+J.get(Y));let $=Z.getMaterial();if($)X.push("material:"+J.get($));X.push("mode:"+Z.getMode());for(let Q of Z.listTargets())X.push("target:"+cn(Q,J))}return X.join(",")}function On(Z,J){if(J.has(Z))return J.get(Z);let X=Z.getGraph(),Y=new Set,$=X.listParentEdges(Z);while($.length>0){let Q=$.pop();if(Q.getAttributes().modifyChild===!0)return J.set(Z,!0),!0;let W=Q.getChild();if(Y.has(W))continue;for(let K of X.listChildEdges(W))$.push(K)}return J.set(Z,!1),!1}function ln(){var Z=new aQ(4);if(aQ!=Float32Array)Z[0]=0,Z[1]=0,Z[2]=0,Z[3]=0;return Z}function iw1(Z,J,X){return Z[0]=J[0]+X[0],Z[1]=J[1]+X[1],Z[2]=J[2]+X[2],Z[3]=J[3]+X[3],Z}function nw1(Z,J,X){return Z[0]=J[0]-X[0],Z[1]=J[1]-X[1],Z[2]=J[2]-X[2],Z[3]=J[3]-X[3],Z}function aw1(Z,J,X){return Z[0]=J[0]*X[0],Z[1]=J[1]*X[1],Z[2]=J[2]*X[2],Z[3]=J[3]*X[3],Z}function sw1(Z,J,X){return Z[0]=J[0]*X,Z[1]=J[1]*X,Z[2]=J[2]*X,Z[3]=J[3]*X,Z}function ow1(Z){var J=Z[0],X=Z[1],Y=Z[2],$=Z[3];return Math.hypot(J,X,Y,$)}var pn=nw1,rw1=aw1,nn=ow1;(function(){var Z=ln();return function(J,X,Y,$,Q,W){var K,G;if(!X)X=4;if(!Y)Y=0;if($)G=Math.min($*X+Y,J.length);else G=J.length;for(K=Y;K<G;K+=X)Z[0]=J[K],Z[1]=J[K+1],Z[2]=J[K+2],Z[3]=J[K+3],Q(Z,Z,W),J[K]=Z[0],J[K+1]=Z[1],J[K+2]=Z[2],J[K+3]=Z[3];return J}})();var tw1=/color|emissive|diffuse/i;function ew1(Z){return Z.getGraph().listParentEdges(Z).some(($)=>{return $.getAttributes().isColor||tw1.test($.getName())})?"srgb":null}function ZB1(Z){let J=Z.getGraph(),X=new Set,Y=new Set;function $(Q){let W=new Set;for(let K of J.listChildEdges(Q))if(K.getChild()instanceof ZY)W.add(K.getName()+"Info");for(let K of J.listChildEdges(Q)){let G=K.getChild();if(X.has(G))continue;if(X.add(G),G instanceof B5&&W.has(K.getName()))Y.add(G);else if(G instanceof IQ)$(G)}}return $(Z),Array.from(Y)}function JB1(Z){let X=C6.fromGraph(Z.getGraph()).getRoot(),Y=Z.getGraph().listParentEdges(Z).filter(($)=>$.getParent()!==X).map(($)=>$.getName());return Array.from(new Set(Y))}var iQ="prune",jC=0.011764705882352941,jn={propertyTypes:[a.NODE,a.SKIN,a.MESH,a.CAMERA,a.PRIMITIVE,a.PRIMITIVE_TARGET,a.ANIMATION,a.MATERIAL,a.TEXTURE,a.ACCESSOR,a.BUFFER],keepLeaves:!1,keepAttributes:!1,keepIndices:!1,keepSolidTextures:!1,keepExtras:!1};function m2(Z=jn){let J=z7(jn,Z),X=new Set(J.propertyTypes),Y=J.keepExtras;return DJ(iQ,async($)=>{let Q=$.getLogger(),W=$.getRoot(),K=$.getGraph(),G=new an,H=(z)=>G.dispose(z.target);if(K.addEventListener("node:dispose",H),X.has(a.MESH))for(let z of W.listMeshes()){if(z.listPrimitives().length>0)continue;z.dispose()}if(X.has(a.NODE)){if(!J.keepLeaves)for(let z of W.listScenes())sn(K,z,Y);for(let z of W.listNodes())C9(z,Y)}if(X.has(a.SKIN))for(let z of W.listSkins())C9(z,Y);if(X.has(a.MESH))for(let z of W.listMeshes())C9(z,Y);if(X.has(a.CAMERA))for(let z of W.listCameras())C9(z,Y);if(X.has(a.PRIMITIVE))Mn(K,a.PRIMITIVE,Y);if(X.has(a.PRIMITIVE_TARGET))Mn(K,a.PRIMITIVE_TARGET,Y);if(!J.keepAttributes&&X.has(a.ACCESSOR)){let z=new Map;for(let q of W.listMeshes())for(let V of q.listPrimitives()){let F=V.getMaterial();if(!F)continue;let U=on($,V,F),w=YB1(V,U);Rn(V,w),V.listTargets().forEach((L)=>Rn(L,w)),z.has(F)?z.get(F).add(V):z.set(F,new Set([V]))}for(let[q,V]of z)$B1(q,Array.from(V))}if(!J.keepIndices&&X.has(a.ACCESSOR))for(let z of W.listMeshes())for(let q of z.listPrimitives())XB1(q);if(X.has(a.ANIMATION))for(let z of W.listAnimations()){for(let q of z.listChannels())if(!q.getTargetNode())q.dispose();if(!z.listChannels().length){let q=z.listSamplers();C9(z,Y),q.forEach((V)=>C9(V,Y))}else z.listSamplers().forEach((q)=>C9(q,Y))}if(X.has(a.MATERIAL))W.listMaterials().forEach((z)=>C9(z,Y));if(X.has(a.TEXTURE)){if(W.listTextures().forEach((z)=>C9(z,Y)),!J.keepSolidTextures)await QB1($)}if(X.has(a.ACCESSOR))W.listAccessors().forEach((z)=>C9(z,Y));if(X.has(a.BUFFER))W.listBuffers().forEach((z)=>C9(z,Y));if(K.removeEventListener("node:dispose",H),!G.empty()){let z=G.entries().map(([q,V])=>`${q} (${V})`).join(", ");Q.info(`${iQ}: Removed types... ${z}`)}else Q.debug(`${iQ}: No unused properties found.`);Q.debug(`${iQ}: Complete.`)})}class an{constructor(){this.disposed={}}empty(){for(let Z in this.disposed)return!1;return!0}entries(){return Object.entries(this.disposed)}dispose(Z){this.disposed[Z.propertyType]=this.disposed[Z.propertyType]||0,this.disposed[Z.propertyType]++}}function C9(Z,J){let X=Z.listParents().filter(($)=>!($ instanceof JY||$ instanceof tX)),Y=J&&!bn(Z.getExtras());if(!X.length&&!Y)Z.dispose()}function Mn(Z,J,X){for(let Y of Z.listEdges()){let $=Y.getParent();if($.propertyType===J)C9($,X)}}function sn(Z,J,X){if(J.listChildren().forEach((W)=>sn(Z,W,X)),J instanceof vQ)return;let Y=Z.listParentEdges(J).some((W)=>{let K=W.getParent().propertyType;return K!==a.ROOT&&K!==a.SCENE&&K!==a.NODE}),$=Z.listChildren(J).length===0,Q=X&&!bn(J.getExtras());if($&&!Y&&!Q)J.dispose()}function Rn(Z,J){for(let X of J)Z.setAttribute(X,null)}function XB1(Z){let J=Z.getIndices(),X=J&&J.getArray(),Y=Z.listAttributes()[0];if(!X||!Y)return;if(J.getCount()!==Y.getCount())return;for(let $=0,Q=X.length;$<Q;$++)if($!==X[$])return;Z.setIndices(null)}function YB1(Z,J){let X=[];for(let Y of Z.listSemantics())if(Y==="NORMAL"&&!J.has(Y))X.push(Y);else if(Y==="TANGENT"&&!J.has(Y))X.push(Y);else if(Y.startsWith("TEXCOORD_")&&!J.has(Y))X.push(Y);else if(Y.startsWith("COLOR_")&&Y!=="COLOR_0")X.push(Y);return X}function on(Z,J,X,Y=new Set){let Q=Z.getGraph().listChildEdges(X),W=new Set;for(let H of Q)if(H.getChild()instanceof ZY)W.add(H.getName());for(let H of Q){let z=H.getName(),q=H.getChild();if(q instanceof B5){if(W.has(z.replace(/Info$/,"")))Y.add(`TEXCOORD_${q.getTexCoord()}`)}if(q instanceof ZY&&z.match(/normalTexture/i))Y.add("TANGENT");if(q instanceof IQ)on(Z,J,q,Y)}let K=X instanceof J7&&!X.getExtension("KHR_materials_unlit"),G=J.getMode()===M8.Mode.POINTS;if(K&&!G)Y.add("NORMAL");return Y}function $B1(Z,J){let X=ZB1(Z),Y=new Set(X.map((G)=>G.getTexCoord())),$=Array.from(Y).sort(),Q=new Map($.map((G,H)=>[G,H])),W=new Map($.map((G,H)=>[`TEXCOORD_${G}`,`TEXCOORD_${H}`]));for(let G of X){let H=G.getTexCoord();G.setTexCoord(Q.get(H))}for(let G of J){let H=G.listSemantics().filter((z)=>z.startsWith("TEXCOORD_")).sort();K(G,H),G.listTargets().forEach((z)=>K(z,H))}function K(G,H){for(let z of H){let q=G.getAttribute(z);if(!q)continue;let V=W.get(z);if(V===z)continue;G.setAttribute(V,q),G.setAttribute(z,null)}}}async function QB1(Z){let J=Z.getRoot(),X=Z.getGraph(),Y=Z.getLogger(),Q=J.listTextures().map(async(W)=>{var K;let G=await KB1(W);if(!G)return;if(ew1(W)==="srgb")PD.convertSRGBToLinear(G,G);let H=W.getName()||W.getURI(),z=(K=W.getSize())==null?void 0:K.join("x"),q=JB1(W);for(let V of X.listParentEdges(W)){let F=V.getParent();if(F!==J&&WB1(F,G,V.getName(),Y))V.dispose()}if(W.listParents().length===1)W.dispose(),Y.debug(`${iQ}: Removed solid-color texture "${H}" (${z}px ${q.join(", ")})`)});await Promise.all(Q)}function WB1(Z,J,X,Y){if(Z instanceof J7)switch(X){case"baseColorTexture":return Z.setBaseColorFactor(rw1(J,J,Z.getBaseColorFactor())),!0;case"emissiveTexture":return Z.setEmissiveFactor(mw1([0,0,0],J.slice(0,3),Z.getEmissiveFactor())),!0;case"occlusionTexture":return Math.abs(J[0]-1)<=jC;case"metallicRoughnessTexture":return Z.setRoughnessFactor(J[1]*Z.getRoughnessFactor()),Z.setMetallicFactor(J[2]*Z.getMetallicFactor()),!0;case"normalTexture":return nn(pn(ln(),J,[0.5,0.5,1,1]))<=jC}return Y.warn(`${iQ}: Detected single-color ${X} texture. Pruning ${X} not yet supported.`),!1}async function KB1(Z){let J=await GB1(Z);if(!J)return null;let X=[1/0,1/0,1/0,1/0],Y=[-1/0,-1/0,-1/0,-1/0],$=[0,0,0,0],[Q,W]=J.shape;for(let K=0;K<Q;K++){for(let G=0;G<W;G++)for(let H=0;H<4;H++)X[H]=Math.min(X[H],J.get(K,G,H)),Y[H]=Math.max(Y[H],J.get(K,G,H));if(nn(pn($,Y,X))/255>jC)return null}return sw1($,iw1($,Y,X),0.00196078431372549)}async function GB1(Z){try{return await xi(Z.getImage(),Z.getMimeType())}catch(J){return null}}var MJ=4294967295;class rn{constructor(Z){this.attributes=[],this.u8=void 0,this.u32=void 0;let J=0;for(let X of CC(Z))J+=this._initAttribute(X);this.u8=new Uint8Array(J),this.u32=new Uint32Array(this.u8.buffer)}_initAttribute(Z){let J=Z.getArray(),X=new Uint8Array(J.buffer,J.byteOffset,J.byteLength),Y=Z.getElementSize()*Z.getComponentSize(),$=n0.padNumber(Y);return this.attributes.push({u8:X,byteStride:Y,paddedByteStride:$}),$}hash(Z){let J=0;for(let{u8:X,byteStride:Y,paddedByteStride:$}of this.attributes){for(let Q=0;Q<$;Q++)if(Q<Y)this.u8[J+Q]=X[Z*Y+Q];else this.u8[J+Q]=0;J+=$}return HB1(0,this.u32)}equal(Z,J){for(let{u8:X,byteStride:Y}of this.attributes)for(let $=0;$<Y;$++)if(X[Z*Y+$]!==X[J*Y+$])return!1;return!0}}function HB1(Z,J){for(let $=0,Q=J.length;$<Q;$++){let W=J[$];W=Math.imul(W,1540483477)>>>0,W=(W^W>>24)>>>0,W=Math.imul(W,1540483477)>>>0,Z=Math.imul(Z,1540483477)>>>0,Z=(Z^W)>>>0}return Z}function zB1(Z,J,X,Y,$=MJ){let Q=J-1,K=X.hash(Y)&Q;for(let G=0;G<=Q;G++){let H=Z[K];if(H===$||X.equal(H,Y))return K;K=K+G+1&Q}throw new Error("Hash table full.")}var w6;(function(Z){Z.RENDER="render",Z.RENDER_CACHED="render-cached",Z.UPLOAD="upload",Z.UPLOAD_NAIVE="upload-naive",Z.DISTINCT="distinct",Z.DISTINCT_POSITION="distinct-position",Z.UNUSED="unused"})(w6||(w6={}));function NJ(Z,J){let X=Z.getAttribute("POSITION"),Y=Z.getIndices();switch(J){case w6.RENDER:return Y?Y.getCount():X.getCount();case w6.RENDER_CACHED:return Y?new Set(Y.getArray()).size:X.getCount();case w6.UPLOAD_NAIVE:case w6.UPLOAD:return X.getCount();case w6.DISTINCT:case w6.DISTINCT_POSITION:return qB1(J);case w6.UNUSED:return Y?X.getCount()-new Set(Y.getArray()).size:0;default:return VB1(J)}}function qB1(Z){throw new Error(`Not implemented: ${Z}`)}function VB1(Z){throw new Error(`Unexpected value: ${Z}`)}function TG(Z,J,X){let Y=C6.fromGraph(Z.getGraph());if(!J||!X)[J,X]=FB1(Z);let $=Z.getIndices(),Q=$?$.getArray():null,W=NJ(Z,w6.RENDER),K=Y.createAccessor(),G=W,H=TC(G,X);for(let q=0;q<G;q++)H[q]=J[Q?Q[q]:q];Z.setIndices(K.setArray(H));let z=CC(Z);for(let q of Z.listAttributes()){let V=LZ(Y,q);MC(q,$,J,V,X),Z.swap(q,V)}for(let q of Z.listTargets())for(let V of q.listAttributes()){let F=LZ(Y,V);MC(V,$,J,F,X),q.swap(V,F)}if($&&$.listParents().length===1)$.dispose();for(let q of z)if(q.listParents().length===1)q.dispose();return Z}function MC(Z,J,X,Y,$){let Q=Z.getElementSize(),W=Z.getArray(),K=J?J.getArray():null,G=J?J.getCount():Z.getCount(),H=new W.constructor($*Q),z=new Uint8Array($);for(let q=0;q<G;q++){let V=K?K[q]:q,F=X[V];if(z[F])continue;for(let U=0;U<Q;U++)H[F*Q+U]=W[V*Q+U];z[F]=1}return Y.setArray(H)}function FB1(Z){let J=NJ(Z,w6.UPLOAD),X=Z.getIndices(),Y=X?X.getArray():null;if(!X||!Y)return[Cw1(J,1e6),J];let $=new Uint32Array(J).fill(MJ),Q=0;for(let W=0;W<Y.length;W++){let K=Y[W];if($[K]===MJ)$[K]=Q++}return[$,Q]}var RC="weld",h2={overwrite:!0,cleanup:!0};function kC(Z=h2){let J=z7(h2,Z);return DJ(RC,async(X)=>{let Y=X.getLogger();for(let $ of X.getRoot().listMeshes()){for(let Q of $.listPrimitives())if(u2(Q,J),NJ(Q,w6.RENDER)===0)Q.dispose();if($.listPrimitives().length===0)$.dispose()}if(J.cleanup)await X.transform(m2({propertyTypes:[a.ACCESSOR,a.NODE],keepAttributes:!0,keepIndices:!0,keepLeaves:!1}),dn({propertyTypes:[a.ACCESSOR]}));Y.debug(`${RC}: Complete.`)})}function u2(Z,J=h2){let X=Z.getGraph(),$=C6.fromGraph(X).getLogger(),Q=nQ({},h2,J);if(Z.getIndices()&&!Q.overwrite)return;if(Z.getMode()===M8.Mode.POINTS)return;let W=Z.getAttribute("POSITION").getCount(),K=Z.getIndices(),G=K==null?void 0:K.getArray(),H=K?K.getCount():W,z=new rn(Z),q=kw1(W+W/4),V=new Uint32Array(q).fill(MJ),F=new Uint32Array(W).fill(MJ),U=0;for(let w=0;w<H;w++){let L=G?G[w]:w;if(F[L]!==MJ)continue;let O=zB1(V,q,z,L,MJ),N=V[O];if(N===MJ)V[O]=L,F[L]=U++;else F[L]=F[N]}$.debug(`${RC}: ${y2(W,U)} vertices.`),TG(Z,F,U)}var{FLOAT:UB1}=v0.ComponentType;function tn(Z,J){let X=Z.getAttribute("POSITION");if(X)Nn(J,X);let Y=Z.getAttribute("NORMAL");if(Y)Dn(J,Y);let $=Z.getAttribute("TANGENT");if($)Pn(J,$);for(let Q of Z.listTargets()){let W=Q.getAttribute("POSITION");if(W)Nn(J,W);let K=Q.getAttribute("NORMAL");if(K)Dn(J,K);let G=Q.getAttribute("TANGENT");if(G)Pn(J,G)}if(_w1(J)<0)LB1(Z)}function Nn(Z,J){let X=J.getComponentType(),Y=J.getNormalized(),$=J.getArray(),Q=X===UB1?$:new Float32Array($.length),W=g2();for(let K=0,G=J.getCount();K<G;K++){if(Y)W[0]=c0.decodeNormalizedInt($[K*3],X),W[1]=c0.decodeNormalizedInt($[K*3+1],X),W[2]=c0.decodeNormalizedInt($[K*3+2],X);else W[0]=$[K*3],W[1]=$[K*3+1],W[2]=$[K*3+2];yw1(W,W,Z),Q[K*3]=W[0],Q[K*3+1]=W[1],Q[K*3+2]=W[2]}J.setArray(Q).setNormalized(!1)}function Dn(Z,J){let X=J.getArray(),Y=J.getNormalized(),$=J.getComponentType(),Q=Aw1();xw1(Q,Z),fw1(Q,Q),hw1(Q,Q);let W=g2();for(let K=0,G=J.getCount();K<G;K++){if(Y)W[0]=c0.decodeNormalizedInt(X[K*3],$),W[1]=c0.decodeNormalizedInt(X[K*3+1],$),W[2]=c0.decodeNormalizedInt(X[K*3+2],$);else W[0]=X[K*3],W[1]=X[K*3+1],W[2]=X[K*3+2];if(gw1(W,W,Q),un(W,W),Y)X[K*3]=c0.decodeNormalizedInt(W[0],$),X[K*3+1]=c0.decodeNormalizedInt(W[1],$),X[K*3+2]=c0.decodeNormalizedInt(W[2],$);else X[K*3]=W[0],X[K*3+1]=W[1],X[K*3+2]=W[2]}}function Pn(Z,J){let X=J.getArray(),Y=J.getNormalized(),$=J.getComponentType(),Q=g2();for(let W=0,K=J.getCount();W<K;W++){if(Y)Q[0]=c0.decodeNormalizedInt(X[W*4],$),Q[1]=c0.decodeNormalizedInt(X[W*4+1],$),Q[2]=c0.decodeNormalizedInt(X[W*4+2],$);else Q[0]=X[W*4],Q[1]=X[W*4+1],Q[2]=X[W*4+2];if(Q[0]=Z[0]*Q[0]+Z[4]*Q[1]+Z[8]*Q[2],Q[1]=Z[1]*Q[0]+Z[5]*Q[1]+Z[9]*Q[2],Q[2]=Z[2]*Q[0]+Z[6]*Q[1]+Z[10]*Q[2],un(Q,Q),Y)X[W*4]=c0.decodeNormalizedInt(Q[0],$),X[W*4+1]=c0.decodeNormalizedInt(Q[1],$),X[W*4+2]=c0.decodeNormalizedInt(Q[2],$);else X[W*4]=Q[0],X[W*4+1]=Q[1],X[W*4+2]=Q[2]}}function LB1(Z){if(Z.getMode()!==M8.Mode.TRIANGLES)return;if(!Z.getIndices())u2(Z);let J=Z.getIndices();for(let X=0,Y=J.getCount();X<Y;X+=3){let $=J.getScalar(X),Q=J.getScalar(X+2);J.setScalar(X,Q),J.setScalar(X+2,$)}}function wB1(Z,J){for(let X of Z.listPrimitives()){let Y=BB1(X,Z);if(X!==Y)Z.removePrimitive(X).addPrimitive(Y)}for(let X of Z.listPrimitives())TG(X),tn(X,J)}function BB1(Z,J){if(Z.listParents().some((Y)=>Y instanceof XG&&Y!==J))Z=Z.clone();for(let Y of Z.listTargets())if(Y.listParents().some((Q)=>Q instanceof M8&&Q!==Z))Z.removeTarget(Y).addTarget(Y.clone());return Z}var Cn=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function en(Z){let J=Z.getMesh(),X=Z.getMatrix();if(J&&!c0.eq(X,Cn))wB1(J,X);for(let Y of Z.listChildren()){let $=Y.getMatrix();mn($,$,X),Y.setMatrix($)}return Z.setMatrix(Cn)}var{LINES:OB1,LINE_STRIP:jB1,LINE_LOOP:MB1,TRIANGLES:RB1,TRIANGLE_STRIP:NB1,TRIANGLE_FAN:DB1}=M8.Mode;function PB1(Z){let J=Z.getGraph(),X=C6.fromGraph(J);if(!Z.getIndices())u2(Z);let Y=Z.getIndices(),$=Y.getArray(),Q=fn(Z),K=new qJ[Y.getComponentType()](Q*2),G=Z.getMode();if(G===jB1)for(let z=0;z<Q;z++)K[z*2]=$[z],K[z*2+1]=$[z+1];else if(G===MB1)for(let z=0;z<Q;z++)if(z<Q-1)K[z*2]=$[z],K[z*2+1]=$[z+1];else K[z*2]=$[z],K[z*2+1]=$[0];else throw new Error("Only LINE_STRIP and LINE_LOOP may be converted to LINES.");Z.setMode(OB1);let H=X.getRoot();if(Y.listParents().some((z)=>z!==H&&z!==Z))Z.setIndices(LZ(X,Y).setArray(K));else Y.setArray(K)}function Za(Z){let J=Z.getGraph(),X=C6.fromGraph(J);if(!Z.getIndices())u2(Z);let Y=Z.getIndices(),$=Y.getArray(),Q=fn(Z),K=new qJ[Y.getComponentType()](Q*3),G=Z.getMode();if(G===NB1)for(let z=0,q=$.length;z<q-2;z++)if(z%2)K[z*3]=$[z+1],K[z*3+1]=$[z],K[z*3+2]=$[z+2];else K[z*3]=$[z],K[z*3+1]=$[z+1],K[z*3+2]=$[z+2];else if(G===DB1)for(let z=0;z<Q;z++)K[z*3]=$[0],K[z*3+1]=$[z+1],K[z*3+2]=$[z+2];else throw new Error("Only TRIANGLE_STRIP and TRIANGLE_FAN may be converted to TRIANGLES.");Z.setMode(RB1);let H=X.getRoot();if(Y.listParents().some((z)=>z!==H&&z!==Z))Z.setIndices(LZ(X,Y).setArray(K));else Y.setArray(K)}var Tn="dequantize",f2={pattern:/^((?!JOINTS_).)*$/};function Ja(Z=f2){let J=z7(f2,Z);return DJ(Tn,(X)=>{let Y=X.getLogger();for(let $ of X.getRoot().listMeshes())for(let Q of $.listPrimitives())CB1(Q,J);X.createExtension(PG).dispose(),Y.debug(`${Tn}: Complete.`)})}function CB1(Z,J=f2){let X=z7(f2,J);for(let Y of Z.listSemantics())if(X.pattern.test(Y))NC(Z.getAttribute(Y));for(let Y of Z.listTargets())for(let $ of Y.listSemantics())if(X.pattern.test($))NC(Y.getAttribute($))}function NC(Z){let J=Z.getArray();if(!J)return;let X=b2(J,Z.getComponentType(),Z.getNormalized());Z.setArray(X).setNormalized(!1)}function b2(Z,J,X){let Y=new Float32Array(Z.length);for(let $=0,Q=Z.length;$<Q;$++)if(X)Y[$]=c0.decodeNormalizedInt(Z[$],J);else Y[$]=Z[$];return Y}var{TEXTURE_INFO:Xa,ROOT:Gz6}=a;function Ya(Z){let J=new C6().setLogger(Z.getLogger()),X=EC(J,Z);return TB1(J,Z,X),J.getRoot().copy(Z.getRoot(),X),J}function TB1(Z,J,X){X||(X=EC(Z,J));for(let Y of J.getRoot().listExtensionsUsed()){let $=Z.createExtension(Y.constructor);if(Y.isRequired())$.setRequired(!0)}return kB1(Z,J,EB1(J),X)}function kB1(Z,J,X,Y){Y||(Y=EC(Z,J));let $=new Map;for(let Q of X)if(!$.has(Q)&&Q.propertyType!==Xa)$.set(Q,Y(Q));for(let[Q,W]of $.entries())W.copy(Q,Y);return $}function EC(Z,J){let X=new Map([[J.getRoot(),Z.getRoot()]]);return(Y)=>{if(Y.propertyType===Xa)return Y;let $=X.get(Y);if(!$)$=new Y.constructor(Z.getGraph()),X.set(Y,$);return $}}function EB1(Z){let J=new Set;for(let X of Z.getGraph().listEdges())J.add(X.getChild());return Array.from(J)}var wC="flatten",kn={cleanup:!0};function $a(Z=kn){let J=z7(kn,Z);return DJ(wC,async(X)=>{let Y=X.getRoot(),$=X.getLogger(),Q=new Set;for(let H of Y.listSkins())for(let z of H.listJoints())Q.add(z);let W=new Set;for(let H of Y.listAnimations())for(let z of H.listChannels()){let q=z.getTargetNode();if(q&&z.getTargetPath()!=="weights")W.add(q)}let K=new Set,G=new Set;for(let H of Y.listScenes())H.traverse((z)=>{let q=z.getParentNode();if(!q)return;if(Q.has(q)||K.has(q))K.add(z);if(W.has(q)||G.has(q))G.add(z)});for(let H of Y.listScenes())H.traverse((z)=>{if(W.has(z))return;if(K.has(z))return;if(G.has(z))return;vw1(z)});if(W.size)$.debug(`${wC}: Flattening node hierarchies with TRS animation not yet supported.`);if(J.cleanup)await X.transform(m2({propertyTypes:[a.NODE],keepLeaves:!1}));$.debug(`${wC}: Complete.`)})}function Qa(Z){return DD(Z)}var IB1={skipValidation:!1},En=4294967295,{LINE_STRIP:vB1,LINE_LOOP:SB1,TRIANGLE_STRIP:_B1,TRIANGLE_FAN:AB1}=M8.Mode;function xB1(Z,J={}){let X=z7(IB1,J),Y=Z[0],$=C6.fromGraph(Y.getGraph());if(!X.skipValidation&&new Set(Z.map(yn)).size>1)throw new Error("Requires >=2 Primitives, sharing the same Material and Mode, with compatible vertex attributes and indices.");for(let F of Z)switch(F.getMode()){case vB1:case SB1:PB1(F);break;case _B1:case AB1:Za(F);break}let Q=[],W=new Uint32Array(Z.length),K=0,G=0;for(let F=0;F<Z.length;F++){let U=Z[F],w=U.getIndices(),L=U.getAttribute("POSITION").getCount(),O=w?w.getArray():null,N=w?w.getCount():L,M=new Uint32Array(L).fill(En);for(let j=0;j<N;j++){let P=O?O[j]:j;if(M[P]===En)M[P]=K++,W[F]++}Q.push(M),G+=N}let H=$.createPrimitive().setMode(Y.getMode()).setMaterial(Y.getMaterial());for(let F of Y.listSemantics()){let U=Y.getAttribute(F),w=qJ[U.getComponentType()],L=LZ($,U).setArray(new w(K*U.getElementSize()));H.setAttribute(F,L)}let z=Y.getIndices(),q=z?LZ($,z).setArray(TC(G,K)):null;H.setIndices(q);let V=0;for(let F=0;F<Q.length;F++){let U=Z[F],w=U.getIndices(),L=w?w.getCount():-1,O=Q[F];if(w&&q)fB1(w,O,q,V),V+=L;for(let N of H.listSemantics()){let M=U.getAttribute(N),j=H.getAttribute(N);hB1(M,w,O,j)}}return H}function hB1(Z,J,X,Y){let $=Z.getElementSize(),Q=J?J.getArray():null,W=Z.getCount(),K=Z.getArray(),G=Y.getArray(),H=new Uint8Array(Z.getCount());for(let z=0,q=J?J.getCount():W;z<q;z++){let V=Q?Q[z]:z,F=X[V];if(H[F])continue;for(let U=0;U<$;U++)G[F*$+U]=K[V*$+U];H[F]=1}}function fB1(Z,J,X,Y){let $=Z.getCount(),Q=Z.getArray(),W=X.getArray();for(let K=0;K<$;K++){let G=Q[K],H=J[G];W[Y+K]=H}}var DC="join",{ROOT:bB1,NODE:yB1,MESH:gB1,PRIMITIVE:mB1,ACCESSOR:uB1}=a,BC=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],In={keepMeshes:!1,keepNamed:!1,cleanup:!0};function Wa(Z=In){let J=z7(In,Z);return DJ(DC,async(X)=>{let Y=X.getRoot(),$=X.getLogger();for(let Q of Y.listScenes())vn(X,Q,J),Q.traverse((W)=>vn(X,W,J));if(J.cleanup)await X.transform(m2({propertyTypes:[yB1,gB1,mB1,uB1],keepAttributes:!0,keepIndices:!0,keepLeaves:!1}));$.debug(`${DC}: Complete.`)})}function vn(Z,J,X){let Y=Z.getLogger(),$={},Q=J.listChildren();for(let G=0;G<Q.length;G++){let H=Q[G];if(H.listParents().some((V)=>V instanceof tX))continue;let q=H.getMesh();if(!q)continue;if(H.getExtension("EXT_mesh_gpu_instancing"))continue;if(H.getSkin())continue;for(let V of q.listPrimitives()){if(V.listTargets().length>0)continue;let F=V.getMaterial();if(F&&F.getExtension("KHR_materials_volume"))continue;TG(V),cB1(V);let U=yn(V),w=q.getName()||H.getName();if(X.keepMeshes||X.keepNamed&&w)U+=`|${G}`;if(!(U in $))$[U]={prims:[],primMeshes:[],primNodes:[],dstNode:H,dstMesh:void 0};let L=$[U];L.prims.push(V),L.primNodes.push(H)}}let W=Object.values($).filter(({prims:G})=>G.length>1),K=new Set(W.flatMap((G)=>G.primNodes));for(let G of K){let H=G.getMesh();if(H.listParents().some((q)=>{return q.propertyType!==bB1&&G!==q}))G.setMesh(H.clone())}for(let G of W){let{dstNode:H,primNodes:z}=G;G.dstMesh=H.getMesh(),G.primMeshes=z.map((q)=>q.getMesh())}for(let G of W){let{prims:H,primNodes:z,primMeshes:q,dstNode:V,dstMesh:F}=G,U=V.getMatrix();for(let O=0;O<H.length;O++){let N=z[O],M=q[O],j=H[O];if(M.removePrimitive(j),Tw1(j))j=H[O]=dB1(H[O]);if(N!==V)mn(BC,Sw1(BC,U),N.getMatrix()),tn(j,BC)}let w=xB1(H),L=w.listAttributes()[0].getCount();F.addPrimitive(w),Y.debug(`${DC}: Joined Primitives (${H.length}) containing ${OC(L)} vertices under Node "${V.getName()}".`)}}function dB1(Z){let J=Z.clone();for(let Y of J.listSemantics())J.setAttribute(Y,J.getAttribute(Y).clone());let X=J.getIndices();if(X)J.setIndices(X.clone());return J}function cB1(Z){for(let J of["POSITION","NORMAL","TANGENT"]){let X=Z.getAttribute(J);if(X)NC(X)}}var{TRANSLATION:Hz6,ROTATION:zz6,SCALE:qz6,WEIGHTS:Vz6}=tX.TargetPath;var lB1={pattern:/.*/,quantizationVolume:"mesh",quantizePosition:14,quantizeNormal:10,quantizeTexcoord:12,quantizeColor:8,quantizeWeight:8,quantizeGeneric:12,normalizeWeights:!0,cleanup:!0};var Fz6=nQ({level:"high"},lB1);var pB1="unweld";function iB1(Z,J=new Map){let X=Z.getIndices();if(!X)return;let Y=Z.getGraph(),$=C6.fromGraph(Y),Q=$.getLogger(),W=Z.getAttribute("POSITION").getCount();for(let G of Z.listAttributes())if(Z.swap(G,Sn($,G,X,J)),G.listParents().length===1)G.dispose();for(let G of Z.listTargets())for(let H of G.listAttributes())if(G.swap(H,Sn($,H,X,J)),H.listParents().length===1)H.dispose();let K=Z.getAttribute("POSITION").getCount();if(Q.debug(`${pB1}: ${y2(W,K)} vertices.`),Z.setIndices(null),X.listParents().length===1)X.dispose()}function Sn(Z,J,X,Y){if(Y.has(J)&&Y.get(J).has(X))return Y.get(J).get(X);let $=J.getArray(),W=new $.constructor(X.getCount()*J.getElementSize()),K=X.getArray(),G=J.getElementSize();for(let z=0,q=X.getCount();z<q;z++)for(let V=0;V<G;V++)W[z*G+V]=$[K[z]*G+V];if(!Y.has(J))Y.set(J,new Map);let H=LZ(Z,J).setArray(W);return Y.get(J).set(X,H),H}var _n;(function(Z){Z[Z.STEP=0]="STEP",Z[Z.LERP=1]="LERP",Z[Z.SLERP=2]="SLERP"})(_n||(_n={}));var nB1=0.000001;function aB1(Z,J,X,Y=0.0001){let $=J.length/Z.length,Q=new Array($).fill(0),W=new Array($).fill(0),K=new Array($).fill(0),G=new Array($).fill(0),H=Z.length-1,z=1;for(let q=1;q<H;++q){let V=Z[z-1],F=Z[q],U=Z[q+1],w=(F-V)/(U-V),L=!1;if(F!==U&&(q!==1||F!==Z[0])){if(CG(J,z-1,G),CG(J,q,W),CG(J,q+1,K),X==="slerp"){let O=rB1(Q,G,K,w),N=xn(G,W)+xn(W,K);L=!x2(W,O,Y)||N+Number.EPSILON>=Math.PI}else if(X==="lerp"){let O=oB1(Q,G,K,w);L=!x2(W,O,Y)}else if(X==="step")L=!x2(W,G)||!x2(W,K)}if(L){if(q!==z)Z[z]=Z[q],An(J,z,CG(J,q,Q));z++}}if(H>0)Z[z]=Z[H],An(J,z,CG(J,H,Q)),z++;return z}function CG(Z,J,X){for(let Y=0,$=X.length;Y<$;Y++)X[Y]=Z[J*$+Y];return X}function An(Z,J,X){for(let Y=0,$=X.length;Y<$;Y++)Z[J*$+Y]=X[Y]}function x2(Z,J,X=0){if(Z.length!==J.length)return!1;for(let Y=0;Y<Z.length;Y++)if(Math.abs(Z[Y]-J[Y])>X)return!1;return!0}function sB1(Z,J,X){return Z*(1-X)+J*X}function oB1(Z,J,X,Y){for(let $=0;$<J.length;$++)Z[$]=sB1(J[$],X[$],Y);return Z}function rB1(Z,J,X,Y){let $=J[0],Q=J[1],W=J[2],K=J[3],G=X[0],H=X[1],z=X[2],q=X[3],V,F,U,w,L;if(F=$*G+Q*H+W*z+K*q,F<0)F=-F,G=-G,H=-H,z=-z,q=-q;if(1-F>nB1)V=Math.acos(F),U=Math.sin(V),w=Math.sin((1-Y)*V)/U,L=Math.sin(Y*V)/U;else w=1-Y,L=Y;return Z[0]=w*$+L*G,Z[1]=w*Q+L*H,Z[2]=w*W+L*z,Z[3]=w*K+L*q,Z}function xn(Z,J){let X=tB1(Z,J);return Math.acos(2*X*X-1)}function tB1(Z,J){return Z[0]*J[0]+Z[1]*J[1]+Z[2]*J[2]+Z[3]*J[3]}var Uz6=new Float32Array(0),Lz6={ready:Promise.resolve(),resample:aB1,tolerance:0.0001,cleanup:!0};var RY="simplify",{POINTS:Ka,LINES:eB1,LINE_STRIP:ZO1,LINE_LOOP:JO1,TRIANGLES:XO1,TRIANGLE_STRIP:Ga,TRIANGLE_FAN:Ha}=M8.Mode,za={ratio:0,error:0.0001,lockBorder:!1,cleanup:!0};function qa(Z){let J=z7(za,Z),X=J.simplifier;if(!X)throw new Error(`${RY}: simplifier dependency required \u2014 install "meshoptimizer".`);return DJ(RY,async(Y)=>{let $=Y.getLogger();await X.ready,await Y.transform(kC({overwrite:!1,cleanup:J.cleanup}));let Q=0;for(let W of Y.getRoot().listMeshes()){for(let K of W.listPrimitives()){let G=K.getMode();if(G===XO1||G===Ga||G===Ha){if(hn(K,J),NJ(K,w6.RENDER)===0)K.dispose()}else if(K.getMode()===Ka&&!!X.simplifyPoints){if(hn(K,J),NJ(K,w6.RENDER)===0)K.dispose()}else Q++}if(W.listPrimitives().length===0)W.dispose()}if(Q>0)$.warn(`${RY}: Skipping simplification of ${Q} primitives: Unsupported draw mode.`);if(J.cleanup)await Y.transform(m2({propertyTypes:[a.ACCESSOR,a.NODE],keepAttributes:!0,keepIndices:!0,keepLeaves:!1}),dn({propertyTypes:[a.ACCESSOR]}));$.debug(`${RY}: Complete.`)})}function hn(Z,J){let X=nQ({},za,J),Y=X.simplifier,$=Z.getGraph(),Q=C6.fromGraph($),W=Q.getLogger();switch(Z.getMode()){case Ka:return YO1(Q,Z,X);case eB1:case ZO1:case JO1:return W.warn(`${RY}: Skipping primitive simplification: Unsupported draw mode.`),Z;case Ga:case Ha:Za(Z);break}let K=NJ(Z,w6.UPLOAD),G=NJ(Z,w6.RENDER);if(G<K/2)TG(Z);let H=Z.getAttribute("POSITION"),z=Z.getIndices(),q=H.getArray(),V=z.getArray();if(!(q instanceof Float32Array))q=b2(q,H.getComponentType(),H.getNormalized());if(!(V instanceof Uint32Array))V=new Uint32Array(V);let F=Math.floor(X.ratio*G/3)*3,U=X.lockBorder?["LockBorder"]:[],[w,L]=Y.simplify(V,q,3,F,X.error,U);if(Z.setIndices(LZ(Q,z).setArray(w)),z.listParents().length===1)z.dispose();TG(Z);let O=NJ(Z,w6.UPLOAD);if(O<=65534)Z.getIndices().setArray(new Uint16Array(Z.getIndices().getArray()));return W.debug(`${RY}: ${y2(K,O)} vertices, error: ${L.toFixed(4)}.`),Z}function YO1(Z,J,X){let Y=X.simplifier,$=Z.getLogger();if(J.getIndices())iB1(J);let W=J.getAttribute("POSITION"),K=J.getAttribute("COLOR_0"),G=W.getCount(),H=W.getArray(),z=K?K.getArray():void 0,q=K?K.getComponentSize():void 0;if(!(H instanceof Float32Array))H=b2(H,W.getComponentType(),W.getNormalized());if(z&&!(z instanceof Float32Array))z=b2(z,W.getComponentType(),W.getNormalized());Y.useExperimentalFeatures=!0;let V=Math.floor(X.ratio*G),F=Y.simplifyPoints(H,3,V,z,q);Y.useExperimentalFeatures=!1;let[U,w]=Y.compactMesh(F);$.debug(`${RY}: ${y2(W.getCount(),w)} vertices.`);for(let L of CC(J)){let O=LZ(Z,L);if(MC(L,null,U,O,w),Dw1(J,L,O),L.listParents().length===1)L.dispose()}return J}var PC;(function(Z){Z.LANCZOS3="lanczos3",Z.LANCZOS2="lanczos2"})(PC||(PC={}));var wz6={resizeFilter:PC.LANCZOS3,pattern:void 0,formats:void 0,slots:void 0,quality:void 0,effort:void 0,lossless:!1,nearLossless:!1,limitInputPixels:!0};var Oz6=function(){var Z="b9H79TebbbeJq9Geueu9Geub9Gbb9Gvuuuuueu9Gduueu9Gluuuueu9Gvuuuuub9Gouuuuuub9Gluuuub9GiuuueuiKLdilevlevlooroowwvwbDDbelve9Weiiviebeoweuec:G:Qdkr;RiOo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWVbe8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9c9V919U9KbdE9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949wWV79P9V9UbiY9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWVbl8E9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWV9c9V919U9Kbv8A9TW79O9V9Wt9FW9U9J9V9KW69U9KW949wWV79P9V9UboE9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JWbra9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JW9c9V919U9KbwL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9p9JtbDK9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9r919HtbqL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVT949WbkE9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OWbPa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OW9ttV9P9Wbsa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9WbzK9TW79O9V9Wt9F79W9Ht9P9H29t9VVt9sW9T9H9WbHl79IV9RbODwebcekdQXq;A9pLdbk;QqeKu8Jjjjjbcjo9Rgv8Kjjjjbcbhodnalcefae0mbabcbRbN:kjjbc:GeV86bbavcjdfcbcjdzNjjjb8AdnaiTmbavcjdfadalz:tjjjb8Akabaefhrabcefhwavalfcbcbcjdal9RalcFe0EzNjjjb8Aavavcjdfalz:tjjjbhDcj;abal9Uc;WFbGgecjdaecjd6Ehqcbhkindndnaiak9nmbaDcjlfcbcjdzNjjjb8Aaqaiak9Rakaqfai6Egxcsfgecl4cifcd4hmadakal2fhPdndndnaec9WGgsTmbcbhzaPhHawhOxekdnaxmbalheinaraw9Ram6miawcbamzNjjjbamfhwaecufgembxvkkcbhAaPhOinaDaAfRbbhCaDcjlfheaOhoaxhXinaeaoRbbgQaC9RgCcetaCcKtcK91cr4786bbaoalfhoaecefheaQhCaXcufgXmbkaraw9Ram6mdaOcefhOawcbamzNjjjbamfhwaAcefgAal9hmbxlkkindnaxTmbaDazfRbbhCaDcjlfheaHhoaxhXinaeaoRbbgQaC9RgCcetaCcKtcK91cr4786bbaoalfhoaecefheaQhCaXcufgXmbkkaraO9Ram6mearaOcbamzNjjjbgLamfgw9RcK6mecbhKaDcjlfhOinaDcjlfaKfhYcwhAczhQceheindndnaegXce9hmbcuhoaYRbbmecbhodninaogecsSmeaecefhoaOaefcefRbbTmbkkcucbaecs6EhoxekaXcethocuaXtc;:bGcFb7hCcbheinaoaCaOaefRbb9nfhoaecefgecz9hmbkkaoaQaoaQ6geEhQaXaAaeEhAaXcetheaXcl6mbkdndndndnaAcufPdiebkaLaKco4fgeaeRbbcdciaAclSEaKci4coGtV86bbaAcw9hmeawaY8Pbb83bbawcwfaYcwf8Pbb83bbawczfhwxdkaLaKco4fgeaeRbbceaKci4coGtV86bbkdncwaA9Tg8Ambinawcb86bbawcefhwxbkkcuaAtcu7hYcbhEaOh3ina3hea8AhCcbhoinaeRbbgQaYcFeGgXaQaX6EaoaAtVhoaecefheaCcufgCmbkawao86bba3a8Afh3awcefhwaEa8AfgEcz6mbkcbheindnaOaefRbbgoaX6mbawao86bbawcefhwkaecefgecz9hmbkkdnaKczfgKas9pmbaOczfhOaraw9RcL0mekkaKas6meawTmeaHcefhHawhOazcefgzalSmixbkkcbhoxikcbhoaraw9Ralcaalca0E6mddnalc8F0mbawcbcaal9RgezNjjjbaefhwkawaDcjdfalz:tjjjbalfab9RhoxdkaDaPaxcufal2falz:tjjjb8Aaxakfhkawmbkcbhokavcjof8Kjjjjbaok9heeuaecaaeca0Eabcj;abae9Uc;WFbGgdcjdadcjd6Egdfcufad9Uae2adcl4cifcd4adV2fcefkmbcbabBdN:kjjbk:zse5u8Jjjjjbc;ae9Rgl8Kjjjjbcbhvdnaici9UgocHfae0mbabcbyd:e:kjjbgrc;GeV86bbalc;abfcFecjezNjjjb8AalcUfgw9cu83ibalc8WfgD9cu83ibalcyfgq9cu83ibalcafgk9cu83ibalcKfgx9cu83ibalczfgm9cu83ibal9cu83iwal9cu83ibabaefc9WfhPabcefgsaofhednaiTmbcmcsarcb9kgzEhHcbhOcbhAcbhCcbhXcbhQindnaeaP9nmbcbhvxikaQcufhvadaCcdtfgLydbhKaLcwfydbhYaLclfydbh8AcbhEdndndninalc;abfavcsGcitfgoydlh3dndndnaoydbgoaK9hmba3a8ASmekdnaoa8A9hmba3aY9hmbaEcefhExekaoaY9hmea3aK9hmeaEcdfhEkaEc870mdaXcufhvaLaEciGcx2goc:y1jjbfydbcdtfydbh3aLaocN1jjbfydbcdtfydbh8AaLaoc:q1jjbfydbcdtfydbhKcbhodnindnalavcsGcdtfydba39hmbaohYxdkcuhYavcufhvaocefgocz9hmbkkaOa3aOSgvaYce9iaYaH9oVgoGfhOdndndncbcsavEaYaoEgvcs9hmbarce9imba3a3aAa3cefaASgvEgAcefSmecmcsavEhvkasavaEcdtc;WeGV86bbavcs9hmea3aA9Rgvcetavc8F917hvinaeavcFb0crtavcFbGV86bbaecefheavcje6hoavcr4hvaoTmbka3hAxvkcPhvasaEcdtcPV86bba3hAkavTmiavaH9omicdhocehEaQhYxlkavcufhvaEclfgEc;ab9hmbkkdnaLceaYaOSceta8AaOSEcx2gvc:q1jjbfydbcdtfydbgKTaLavcN1jjbfydbcdtfydbg8AceSGaLavc:y1jjbfydbcdtfydbg3cdSGaOcb9hGazGg5ce9hmbaw9cu83ibaD9cu83ibaq9cu83ibak9cu83ibax9cu83ibam9cu83ibal9cu83iwal9cu83ibcbhOkcbhEaXcufgvhodnindnalaocsGcdtfydba8A9hmbaEhYxdkcuhYaocufhoaEcefgEcz9hmbkkcbhodnindnalavcsGcdtfydba39hmbaohExdkcuhEavcufhvaocefgocz9hmbkkaOaKaOSg8EfhLdndnaYcm0mbaYcefhYxekcbcsa8AaLSgvEhYaLavfhLkdndnaEcm0mbaEcefhExekcbcsa3aLSgvEhEaLavfhLkc9:cua8EEh8FcbhvaEaYcltVgacFeGhodndndninavcj1jjbfRbbaoSmeavcefgvcz9hmbxdkka5aKaO9havcm0VVmbasavc;WeV86bbxekasa8F86bbaeaa86bbaecefhekdna8EmbaKaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombkaKhAkdnaYcs9hmba8AaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombka8AhAkdnaEcs9hmba3aA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombka3hAkalaXcdtfaKBdbaXcefcsGhvdndnaYPzbeeeeeeeeeeeeeebekalavcdtfa8ABdbaXcdfcsGhvkdndnaEPzbeeeeeeeeeeeeeebekalavcdtfa3BdbavcefcsGhvkcihoalc;abfaQcitfgEaKBdlaEa8ABdbaQcefcsGhYcdhEavhXaLhOxekcdhoalaXcdtfa3BdbcehEaXcefcsGhXaQhYkalc;abfaYcitfgva8ABdlava3Bdbalc;abfaQaEfcsGcitfgva3BdlavaKBdbascefhsaQaofcsGhQaCcifgCai6mbkkcbhvaeaP0mbcbhvinaeavfavcj1jjbfRbb86bbavcefgvcz9hmbkaeab9Ravfhvkalc;aef8KjjjjbavkZeeucbhddninadcefgdc8F0meceadtae6mbkkadcrfcFeGcr9Uci2cdfabci9U2cHfkmbcbabBd:e:kjjbk:ydewu8Jjjjjbcz9Rhlcbhvdnaicvfae0mbcbhvabcbRb:e:kjjbc;qeV86bbal9cb83iwabcefhoabaefc98fhrdnaiTmbcbhwcbhDindnaoar6mbcbskadaDcdtfydbgqalcwfawaqav9Rgvavc8F91gv7av9Rc507gwcdtfgkydb9Rgvc8E91c9:Gavcdt7awVhvinaoavcFb0gecrtavcFbGV86bbavcr4hvaocefhoaembkakaqBdbaqhvaDcefgDai9hmbkkcbhvaoar0mbaocbBbbaoab9RclfhvkavkBeeucbhddninadcefgdc8F0meceadtae6mbkkadcwfcFeGcr9Uab2cvfk:bvli99dui99ludnaeTmbcuadcetcuftcu7:Yhvdndncuaicuftcu7:YgoJbbbZMgr:lJbbb9p9DTmbar:Ohwxekcjjjj94hwkcbhicbhDinalclfIdbgrJbbbbJbbjZalIdbgq:lar:lMalcwfIdbgk:lMgr:varJbbbb9BEgrNhxaqarNhrdndnakJbbbb9GTmbaxhqxekJbbjZar:l:tgqaq:maxJbbbb9GEhqJbbjZax:l:tgxax:marJbbbb9GEhrkdndnalcxfIdbgxJbbj:;axJbbj:;9GEgkJbbjZakJbbjZ9FEavNJbbbZJbbb:;axJbbbb9GEMgx:lJbbb9p9DTmbax:Ohmxekcjjjj94hmkdndnaqJbbj:;aqJbbj:;9GEgxJbbjZaxJbbjZ9FEaoNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:OhPxekcjjjj94hPkdndnarJbbj:;arJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;arJbbbb9GEMgr:lJbbb9p9DTmbar:Ohsxekcjjjj94hskdndnadcl9hmbabaifgzas86bbazcifam86bbazcdfaw86bbazcefaP86bbxekabaDfgzas87ebazcofam87ebazclfaw87ebazcdfaP87ebkalczfhlaiclfhiaDcwfhDaecufgembkkk;hlld99eud99eudnaeTmbdndncuaicuftcu7:YgvJbbbZMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikaic;8FiGhrinabcofcicdalclfIdb:lalIdb:l9EgialcwfIdb:lalaicdtfIdb:l9EEgialcxfIdb:lalaicdtfIdb:l9EEgiarV87ebdndnJbbj:;JbbjZalaicdtfIdbJbbbb9DEgoalaicd7cdtfIdbJ;Zl:1ZNNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabcdfaq87ebdndnalaicefciGcdtfIdbJ;Zl:1ZNaoNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabaq87ebdndnaoalaicufciGcdtfIdbJ;Zl:1ZNNgoJbbj:;aoJbbj:;9GEgwJbbjZawJbbjZ9FEavNJbbbZJbbb:;aoJbbbb9GEMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikabclfai87ebabcwfhbalczfhlaecufgembkkk;3viDue99eu8Jjjjjbcjd9Rgo8Kjjjjbadcd4hrdndndndnavcd9hmbadcl6meaohwarhDinawc:CuBdbawclfhwaDcufgDmbkaeTmiadcl6mdarcdthqalhkcbhxinaohwakhDarhminawawydbgPcbaDIdbgs:8cL4cFeGc:cufasJbbbb9BEgzaPaz9kEBdbaDclfhDawclfhwamcufgmmbkakaqfhkaxcefgxaeSmixbkkaeTmdxekaeTmekarcdthkavce9hhqadcl6hdcbhxindndndnaqmbadmdc:CuhDalhwarhminaDcbawIdbgs:8cL4cFeGc:cufasJbbbb9BEgPaDaP9kEhDawclfhwamcufgmmbxdkkc:CuhDdndnavPleddbdkadmdaohwalhmarhPinawcbamIdbgs:8cL4cFeGgzc;:bazc;:b9kEc:cufasJbbbb9BEBdbamclfhmawclfhwaPcufgPmbxdkkadmecbhwarhminaoawfcbalawfIdbgs:8cL4cFeGgPc8AaPc8A9kEc:cufasJbbbb9BEBdbawclfhwamcufgmmbkkadmbcbhwarhPinaDhmdnavceSmbaoawfydbhmkdndnalawfIdbgscjjj;8iamai9RcefgmcLt9R::NJbbbZJbbb:;asJbbbb9GEMgs:lJbbb9p9DTmbas:Ohzxekcjjjj94hzkabawfazcFFFrGamcKtVBdbawclfhwaPcufgPmbkkabakfhbalakfhlaxcefgxae9hmbkkaocjdf8Kjjjjbk;HqdCui998Jjjjjbc:qd9Rgv8Kjjjjbavc:Sefcbc;KbzNjjjb8AcbhodnadTmbcbhoaiTmbdnabae9hmbavcuadcdtgradcFFFFi0Ecbyd:m:kjjbHjjjjbbgeBd:SeavceBd:mdaeabarz:tjjjb8Akavc:GefcwfcbBdbav9cb83i:Geavc:Gefaeadaiavc:Sefz:njjjbavyd:Gehwadci9UgDcbyd:m:kjjbHjjjjbbhravc:Sefavyd:mdgqcdtfarBdbavaqcefgkBd:mdarcbaDzNjjjbhxavc:SefakcdtfcuaicdtaicFFFFi0Ecbyd:m:kjjbHjjjjbbgmBdbavaqcdfgPBd:mdawhramhkinakalIdbalarydbgscwascw6Ecdtfc;ebfIdbMUdbarclfhrakclfhkaicufgimbkavc:SefaPcdtfcuaDcdtadcFFFF970Ecbyd:m:kjjbHjjjjbbgPBdbdnadci6mbaehraPhkaDhiinakamarydbcdtfIdbamarclfydbcdtfIdbMamarcwfydbcdtfIdbMUdbarcxfhrakclfhkaicufgimbkkaqcifhoavc;qbfhzavhravyd:KehHavyd:OehOcbhscbhkcbhAcehCinarhXcihQaeakci2gLcdtfgrydbhdarclfydbhqabaAcx2fgicwfarcwfydbgKBdbaiclfaqBdbaiadBdbaxakfce86bbazaKBdwazaqBdlazadBdbaPakcdtfcbBdbdnasTmbcihQaXhiinazaQcdtfaiydbgrBdbaQaraK9harad9haraq9hGGfhQaiclfhiascufgsmbkkaAcefhAcbhsinaOaHaeasaLfcdtfydbcdtgifydbcdtfgKhrawaifgqydbgdhidnadTmbdninarydbakSmearclfhraicufgiTmdxbkkaraKadcdtfc98fydbBdbaqaqydbcufBdbkascefgsci9hmbkdndnaQTmbcuhkJbbbbhYcbhqavyd:KehKavyd:OehLindndnawazaqcdtfydbcdtgsfydbgrmbaqcefhqxekaqcs0hiamasfgdIdbh8AadalcbaqcefgqaiEcdtfIdbalarcwarcw6Ecdtfc;ebfIdbMgEUdbaEa8A:thEarcdthiaLaKasfydbcdtfhrinaParydbgscdtfgdaEadIdbMg8AUdba8AaYaYa8A9DgdEhYasakadEhkarclfhraic98fgimbkkaqaQ9hmbkakcu9hmekaCaD9pmdindnaxaCfRbbmbaChkxdkaDaCcefgC9hmbxikkaQczaQcz6EhsazhraXhzakcu9hmbkkaocdtavc:Seffc98fhrdninaoTmearydbcbyd1:kjjbH:bjjjbbarc98fhraocufhoxbkkavc:qdf8Kjjjjbk;IlevucuaicdtgvaicFFFFi0Egocbyd:m:kjjbHjjjjbbhralalyd9GgwcdtfarBdbalawcefBd9GabarBdbaocbyd:m:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdlcuadcdtadcFFFFi0Ecbyd:m:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdwabydbcbavzNjjjb8Aadci9UhDdnadTmbabydbhoaehladhrinaoalydbcdtfgvavydbcefBdbalclfhlarcufgrmbkkdnaiTmbabydbhlabydlhrcbhvaihoinaravBdbarclfhralydbavfhvalclfhlaocufgombkkdnadci6mbabydlhrabydwhvcbhlinaecwfydbhoaeclfydbhdaraeydbcdtfgwawydbgwcefBdbavawcdtfalBdbaradcdtfgdadydbgdcefBdbavadcdtfalBdbaraocdtfgoaoydbgocefBdbavaocdtfalBdbaecxfheaDalcefgl9hmbkkdnaiTmbabydlheabydbhlinaeaeydbalydb9RBdbalclfhlaeclfheaicufgimbkkkQbabaeadaic:01jjbz:mjjjbkQbabaeadaic:C:jjjbz:mjjjbk9DeeuabcFeaicdtzNjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk;Wkivuo99lu8Jjjjjbc;W;Gb9Rgl8Kjjjjbcbhvalcj;Gbfcbc;KbzNjjjb8AalcuadcdtadcFFFFi0Egocbyd:m:kjjbHjjjjbbgrBdj9GalceBd;G9GalcFFF;7rBdwal9cFFF;7;3FF:;Fb83dbalcFFF97Bd;S9Gal9cFFF;7FFF:;u83d;K9Gaicd4hwdndnadmbJFFuFhDJFFuuhqJFFuuhkJFFuFhxJFFuuhmJFFuFhPxekawcdthsaehzincbhiinalaifgHazaifIdbgDaHIdbgxaxaD9EEUdbalc;K;GbfaifgHaDaHIdbgxaxaD9DEUdbaiclfgicx9hmbkazasfhzavcefgvad9hmbkalIdwhqalId;S9GhDalIdlhkalId;O9GhxalIdbhmalId;K9GhPkdndnadTmbJbbbbJbbjZJbbbbaPam:tgPaPJbbbb9DEgPaxak:tgxaxaP9DEgxaDaq:tgDaDax9DEgD:vaDJbbbb9BEhDawcdthsarhHadhzindndnaDaeIdbam:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcv2c;j:KM;jbGhvdndnaDaeclfIdbak:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcq2cM;j:KMeGavVhvdndnaDaecwfIdbaq:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaHavaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcC2c:KM;j:KdGVBdbaeasfheaHclfhHazcufgzmbkalcbcj;GbzNjjjbhiarhHadheinaiaHydbgzcFrGcx2fgvavydbcefBdbaiazcq4cFrGcx2fgvavydlcefBdlaiazcC4cFrGcx2fgzazydwcefBdwaHclfhHaecufgembxdkkalcbcj;GbzNjjjb8AkcbhHcbhzcbhecbhvinalaHfgiydbhsaiazBdbaicwfgwydbhOawavBdbaiclfgiydbhwaiaeBdbasazfhzaOavfhvawaefheaHcxfgHcj;Gb9hmbkcbhHalaocbyd:m:kjjbHjjjjbbgiBd:e9GdnadTmbabhzinazaHBdbazclfhzadaHcefgH9hmbkabhHadhzinalaraHydbgecdtfydbcFrGcx2fgvavydbgvcefBdbaiavcdtfaeBdbaHclfhHazcufgzmbkaihHadhzinalaraHydbgecdtfydbcq4cFrGcx2fgvavydlgvcefBdlabavcdtfaeBdbaHclfhHazcufgzmbkabhHadhzinalaraHydbgecdtfydbcC4cFrGcx2fgvavydwgvcefBdwaiavcdtfaeBdbaHclfhHazcufgzmbkcbhHinabaiydbcdtfaHBdbaiclfhiadaHcefgH9hmbkkclhidninaic98Smealcj;Gbfaifydbcbyd1:kjjbH:bjjjbbaic98fhixbkkalc;W;Gbf8Kjjjjbk9teiucbcbyd:q:kjjbgeabcifc98GfgbBd:q:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:q:kjjbgeabcrfc94GfgbBd:q:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd:q:kjjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd:q:kjjbfgdBd:q:kjjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akkk:Iddbcjwk:edb4:h9w9N94:P:gW:j9O:ye9Pbbbbbbebbbdbbbebbbdbbbbbbbdbbbbbbbebbbbbbb:l29hZ;69:9kZ;N;76Z;rg97Z;z;o9xZ8J;B85Z;:;u9yZ;b;k9HZ:2;Z9DZ9e:l9mZ59A8KZ:r;T3Z:A:zYZ79OHZ;j4::8::Y:D9V8:bbbb9s:49:Z8R:hBZ9M9M;M8:L;z;o8:;8:PG89q;x:J878R:hQ8::M:B;e87bbbbbbjZbbjZbbjZ:E;V;N8::Y:DsZ9i;H;68:xd;R8:;h0838:;W:NoZbbbb:WV9O8:uf888:9i;H;68:9c9G;L89;n;m9m89;D8Ko8:bbbbf:8tZ9m836ZS:2AZL;zPZZ818EZ9e:lxZ;U98F8:819E;68:bc:eqkzebbbebbbdbbba:vbb",J=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!=="object")return{supported:!1};var X,Y=WebAssembly.instantiate($(Z),{}).then(function(F){X=F.instance,X.exports.__wasm_call_ctors(),X.exports.meshopt_encodeVertexVersion(0),X.exports.meshopt_encodeIndexVersion(1)});function $(F){var U=new Uint8Array(F.length);for(var w=0;w<F.length;++w){var L=F.charCodeAt(w);U[w]=L>96?L-97:L>64?L-39:L+4}var O=0;for(var w=0;w<F.length;++w)U[O++]=U[w]<60?J[U[w]]:(U[w]-60)*64+U[++w];return U.buffer.slice(0,O)}function Q(F){if(!F)throw new Error("Assertion failed")}function W(F){return new Uint8Array(F.buffer,F.byteOffset,F.byteLength)}function K(F,U,w,L){var O=X.exports.sbrk,N=O(U.length*4),M=O(w*4),j=new Uint8Array(X.exports.memory.buffer),P=W(U);if(j.set(P,N),L)L(N,N,U.length,w);var D=F(M,N,U.length,w);j=new Uint8Array(X.exports.memory.buffer);var C=new Uint32Array(w);new Uint8Array(C.buffer).set(j.subarray(M,M+w*4)),P.set(j.subarray(N,N+U.length*4)),O(N-O(0));for(var k=0;k<U.length;++k)U[k]=C[U[k]];return[C,D]}function G(F,U,w,L){var O=X.exports.sbrk,N=O(w*4),M=O(w*L),j=new Uint8Array(X.exports.memory.buffer);j.set(W(U),M),F(N,M,w,L),j=new Uint8Array(X.exports.memory.buffer);var P=new Uint32Array(w);return new Uint8Array(P.buffer).set(j.subarray(N,N+w*4)),O(N-O(0)),P}function H(F,U,w,L,O){var N=X.exports.sbrk,M=N(U),j=N(L*O),P=new Uint8Array(X.exports.memory.buffer);P.set(W(w),j);var D=F(M,U,j,L,O),C=new Uint8Array(D);return C.set(P.subarray(M,M+D)),N(M-N(0)),C}function z(F){var U=0;for(var w=0;w<F.length;++w){var L=F[w];U=U<L?L:U}return U}function q(F,U){if(Q(U==2||U==4),U==4)return new Uint32Array(F.buffer,F.byteOffset,F.byteLength/4);else{var w=new Uint16Array(F.buffer,F.byteOffset,F.byteLength/2);return new Uint32Array(w)}}function V(F,U,w,L,O,N,M){var j=X.exports.sbrk,P=j(w*L),D=j(w*N),C=new Uint8Array(X.exports.memory.buffer);C.set(W(U),D),F(P,w,L,O,D,M);var k=new Uint8Array(w*L);return k.set(C.subarray(P,P+w*L)),j(P-j(0)),k}return{ready:Y,supported:!0,reorderMesh:function(F,U,w){var L=U?w?X.exports.meshopt_optimizeVertexCacheStrip:X.exports.meshopt_optimizeVertexCache:void 0;return K(X.exports.meshopt_optimizeVertexFetchRemap,F,z(F)+1,L)},reorderPoints:function(F,U){return Q(F instanceof Float32Array),Q(F.length%U==0),Q(U>=3),G(X.exports.meshopt_spatialSortRemap,F,F.length/U,U*4)},encodeVertexBuffer:function(F,U,w){Q(w>0&&w<=256),Q(w%4==0);var L=X.exports.meshopt_encodeVertexBufferBound(U,w);return H(X.exports.meshopt_encodeVertexBuffer,L,F,U,w)},encodeIndexBuffer:function(F,U,w){Q(w==2||w==4),Q(U%3==0);var L=q(F,w),O=X.exports.meshopt_encodeIndexBufferBound(U,z(L)+1);return H(X.exports.meshopt_encodeIndexBuffer,O,L,U,4)},encodeIndexSequence:function(F,U,w){Q(w==2||w==4);var L=q(F,w),O=X.exports.meshopt_encodeIndexSequenceBound(U,z(L)+1);return H(X.exports.meshopt_encodeIndexSequence,O,L,U,4)},encodeGltfBuffer:function(F,U,w,L){var O={ATTRIBUTES:this.encodeVertexBuffer,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return Q(O[L]),O[L](F,U,w)},encodeFilterOct:function(F,U,w,L){return Q(w==4||w==8),Q(L>=1&&L<=16),V(X.exports.meshopt_encodeFilterOct,F,U,w,L,16)},encodeFilterQuat:function(F,U,w,L){return Q(w==8),Q(L>=4&&L<=16),V(X.exports.meshopt_encodeFilterQuat,F,U,w,L,16)},encodeFilterExp:function(F,U,w,L,O){Q(w>0&&w%4==0),Q(L>=1&&L<=24);var N={Separate:0,SharedVector:1,SharedComponent:2,Clamped:3};return V(X.exports.meshopt_encodeFilterExp,F,U,w,L,w,O?N[O]:1)}}}();var Mz6=function(){var Z="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q:Odkr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq;w8Wqdbk;esezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9Uc;WFbGgocjdaocjd6EhDaicefhocbhqdnindndndnaeaq9nmbaDaeaq9RaqaDfae6Egkcsfglcl4cifcd4hxalc9WGgmTmecbhPawcjdfhsaohzinaraz9Rax6mvarazaxfgo9RcK6mvczhlcbhHinalgic9WfgOawcj;cbffhldndndndndnazaOco4fRbbaHcoG4ciGPlbedibkal9cb83ibalcwf9cb83ibxikalaoRblaoRbbgOco4gAaAciSgAE86bbawcj;cbfaifglcGfaoclfaAfgARbbaOcl4ciGgCaCciSgCE86bbalcVfaAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc7faAaCfgARbbaOciGgOaOciSgOE86bbalctfaAaOfgARbbaoRbegOco4gCaCciSgCE86bbalc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc93faAaCfgARbbaOciGgOaOciSgOE86bbalc94faAaOfgARbbaoRbdgOco4gCaCciSgCE86bbalc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc97faAaCfgARbbaOciGgOaOciSgOE86bbalc98faAaOfgORbbaoRbigoco4gAaAciSgAE86bbalc99faOaAfgORbbaocl4ciGgAaAciSgAE86bbalc9:faOaAfgORbbaocd4ciGgAaAciSgAE86bbalcufaOaAfglRbbaociGgoaociSgoE86bbalaofhoxdkalaoRbwaoRbbgOcl4gAaAcsSgAE86bbawcj;cbfaifglcGfaocwfaAfgARbbaOcsGgOaOcsSgOE86bbalcVfaAaOfgORbbaoRbegAcl4gCaCcsSgCE86bbalc7faOaCfgORbbaAcsGgAaAcsSgAE86bbalctfaOaAfgORbbaoRbdgAcl4gCaCcsSgCE86bbalc91faOaCfgORbbaAcsGgAaAcsSgAE86bbalc4faOaAfgORbbaoRbigAcl4gCaCcsSgCE86bbalc93faOaCfgORbbaAcsGgAaAcsSgAE86bbalc94faOaAfgORbbaoRblgAcl4gCaCcsSgCE86bbalc95faOaCfgORbbaAcsGgAaAcsSgAE86bbalc96faOaAfgORbbaoRbvgAcl4gCaCcsSgCE86bbalc97faOaCfgORbbaAcsGgAaAcsSgAE86bbalc98faOaAfgORbbaoRbogAcl4gCaCcsSgCE86bbalc99faOaCfgORbbaAcsGgAaAcsSgAE86bbalc9:faOaAfgORbbaoRbrgocl4gAaAcsSgAE86bbalcufaOaAfglRbbaocsGgoaocsSgoE86bbalaofhoxekalao8Pbb83bbalcwfaocwf8Pbb83bbaoczfhokdnaiam9pmbaHcdfhHaiczfhlarao9RcL0mekkaiam6mvaoTmvdnakTmbawaPfRbbhHawcj;cbfhlashiakhOinaialRbbgzce4cbazceG9R7aHfgH86bbaiadfhialcefhlaOcufgOmbkkascefhsaohzaPcefgPad9hmbxikkcbc99arao9Radcaadca0ESEhoxlkaoaxad2fhCdnakmbadhlinaoTmlarao9Rax6mlaoaxfhoalcufglmbkaChoxekcbhmawcjdfhAinarao9Rax6miawamfRbbhHawcj;cbfhlaAhiakhOinaialRbbgzce4cbazceG9R7aHfgH86bbaiadfhialcefhlaOcufgOmbkaAcefhAaoaxfhoamcefgmad9hmbkaChokabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqaombkc9:hoxekc9:hokavcj;ebf8Kjjjjbaok;cseHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;oiliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabaiavcefciGfcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavciGfgkcd7cetfaD87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavcufciGfcetfaD87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohvxekcjjjj94hvkabakcetfav87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklzNbb",J="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q:6dkr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq:p9sqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk:N8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhlaicefhodnaeTmbadTmbalc;WFbGglcjdalcjd6EhwcbhDinawaeaD9RaDawfae6Egqcsfglc9WGgkci2hxakcethmalcl4cifcd4hPabaDad2fhsakc;ab6hzcbhHincbhOaohAdndninaraA9RaP6meavcj;cbfaOak2fhCaAaPfhocbhidnazmbarao9Rc;Gb6mbcbhlinaCalfhidndndndndnaAalco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklbaoczfhokdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklzaoczfhokdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklaaoczfhokdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WaoclfaYpQbfaXc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WaocwfaYpQbfaXc:q:yjjbfRbbfhoxekaiaopbbbpkl8Waoczfhokalc;abfhialcjefak0meaihlarao9Rc;Fb0mbkkdnaiak9pmbaici4hlinarao9RcK6miaCaifhXdndndndndnaAaico4fRbbalcoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpkbbxikaXaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkbbaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaXaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkbbaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaXaopbbbpkbbaoczfhokalcdfhlaiczfgiak6mbkkaoTmeaohAaOcefgOclSmdxbkkc9:hoxlkdnakTmbavcjdfaHfhiavaHfpbdbhYcbhXinaiavcj;cbfaXfglpblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLalakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEalamfpblbg3cep9Ta3aQp9op9Hp9rg3alaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfhiaXczfgXak6mbkkaHclfgHad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfgDae6mbkkcbc99arao9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk::seHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:wPliuo97eue978Jjjjjbca9Rhiaec98Ghldndnadcl9hmbdnalTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalaeSmeaipxbbbbbbbbbbbbbbbbgqpklbaiabalcdtfgdaeciGglcdtgv;8qbbdnalTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDaqp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkadaiav;8qbbskdnalTmbcbhvabhdinadczfgxaxpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oaoarpmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgval6mbkkalaeSmbaiaeciGgvcitgdfcbcaad9R;8kbaiabalcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oaoarpmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalaeSmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbheabhdinadadpbbbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbadczfhdaeclfgeav6mbkkdnavalSmbaialciGgecdtgdVcbc;abad9R;8kbaiabavcdtfgvad;8qbbdnaeTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepklbkavaiad;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz:Dbb",X=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),Y=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!=="object")return{supported:!1};var $=WebAssembly.validate(X)?K(J):K(Z),Q,W=WebAssembly.instantiate($,{}).then(function(O){Q=O.instance,Q.exports.__wasm_call_ctors()});function K(O){var N=new Uint8Array(O.length);for(var M=0;M<O.length;++M){var j=O.charCodeAt(M);N[M]=j>96?j-97:j>64?j-39:j+4}var P=0;for(var M=0;M<O.length;++M)N[P++]=N[M]<60?Y[N[M]]:(N[M]-60)*64+N[++M];return N.buffer.slice(0,P)}function G(O,N,M,j,P,D,C){var k=O.exports.sbrk,T=j+3&-4,x=k(T*P),S=k(D.length),h=new Uint8Array(O.exports.memory.buffer);h.set(D,S);var I=N(x,j,P,S,D.length);if(I==0&&C)C(x,T,P);if(M.set(h.subarray(x,x+j*P)),k(x-k(0)),I!=0)throw new Error("Malformed buffer data: "+I)}var H={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},z={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},q=[],V=0;function F(O){var N={object:new Worker(O),pending:0,requests:{}};return N.object.onmessage=function(M){var j=M.data;N.pending-=j.count,N.requests[j.id][j.action](j.value),delete N.requests[j.id]},N}function U(O){var N="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array($)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+L.name+";"+G.toString()+L.toString(),M=new Blob([N],{type:"text/javascript"}),j=URL.createObjectURL(M);for(var P=q.length;P<O;++P)q[P]=F(j);for(var P=O;P<q.length;++P)q[P].object.postMessage({});q.length=O,URL.revokeObjectURL(j)}function w(O,N,M,j,P){var D=q[0];for(var C=1;C<q.length;++C)if(q[C].pending<D.pending)D=q[C];return new Promise(function(k,T){var x=new Uint8Array(M),S=++V;D.pending+=O,D.requests[S]={resolve:k,reject:T},D.object.postMessage({id:S,count:O,size:N,source:x,mode:j,filter:P},[x.buffer])})}function L(O){var N=O.data;if(!N.id)return self.close();self.ready.then(function(M){try{var j=new Uint8Array(N.count*N.size);G(M,M.exports[N.mode],j,N.count,N.size,N.source,M.exports[N.filter]),self.postMessage({id:N.id,count:N.count,action:"resolve",value:j},[j.buffer])}catch(P){self.postMessage({id:N.id,count:N.count,action:"reject",value:P})}})}return{ready:W,supported:!0,useWorkers:function(O){U(O)},decodeVertexBuffer:function(O,N,M,j,P){G(Q,Q.exports.meshopt_decodeVertexBuffer,O,N,M,j,Q.exports[H[P]])},decodeIndexBuffer:function(O,N,M,j){G(Q,Q.exports.meshopt_decodeIndexBuffer,O,N,M,j)},decodeIndexSequence:function(O,N,M,j){G(Q,Q.exports.meshopt_decodeIndexSequence,O,N,M,j)},decodeGltfBuffer:function(O,N,M,j,P,D){G(Q,Q.exports[z[P]],O,N,M,j,Q.exports[H[D]])},decodeGltfBufferAsync:function(O,N,M,j,P){if(q.length>0)return w(O,N,M,z[j],H[P]);return W.then(function(){var D=new Uint8Array(O*N);return G(Q,Q.exports[z[j]],D,O,N,M,Q.exports[H[P]]),D})}}}();var Va=function(){var Z="b9H79Tebbbe9Hk9Geueu9Geub9Gbb9Gsuuuuuuuuuuuu99uueu9Gvuuuuub9Gvuuuuue999Gquuuuuuu99uueu9Gwuuuuuu99ueu9Giuuue999Gluuuueu9GiuuueuizsdilvoirwDbqqbeqlve9Weiiviebeoweuecj:Pdkr:Tewo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbz9TW79O9V9Wt9F79P9T9W29P9M95bl8E9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9OcttV9P9I91tW7bvQ9TW79O9V9Wt9F79P9T9W29P9M959q9V9P9Ut7boX9TW79O9V9Wt9F79P9T9W29P9M959t9J9H2Wbra9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9Wbwl79IV9RbDDwebcekdmxq;UMesdbk:kfvKue99euY99Qu8Jjjjjbc;W;qb9Rgs8Kjjjjbcbhzascxfcbc;Kbz:ljjjb8AdnabaeSmbabaeadcdtz:kjjjb8AkdnamcdGTmbalcrfci4gHcbyd;S1jjbHjjjjbbheascxfasyd2gOcdtfaeBdbasaOcefBd2aecbaHz:ljjjbhAcbhlcbhednadTmbcbhlabheadhHinaAaeydbgOci4fgCaCRbbgCceaOcrGgOtV86bbaCcu7aO4ceGalfhlaeclfheaHcufgHmbkcualcdtalcFFFFi0Ehekaecbyd;S1jjbHjjjjbbhzascxfasyd2gecdtfazBdbasaecefBd2alcd4alfhOcehHinaHgecethHaeaO6mbkcbhXcuaecdtgOaecFFFFi0Ecbyd;S1jjbHjjjjbbhHascxfasyd2gCcdtfaHBdbasaCcefBd2aHcFeaOz:ljjjbhQdnadTmbaecufhCcbhLinabaXcdtfgKydbgAc:v;t;h;Ev2hOcbhedndninaQaOaCGgOcdtfgYydbgHcuSmeazaHcdtfydbaASmdaecefgeaOfhOaeaC9nmbxdkkazaLcdtfaABdbaYaLBdbaLhHaLcefhLkaKaHBdbaXcefgXad9hmbkkaQcbyd;O1jjbH:bjjjbbasasyd2cufBd2kcualcefgecdtaecFFFFi0Ecbyd;S1jjbHjjjjbbh8Aascxfasyd2gecdtfa8ABdbasa8ABdlasaecefBd2cuadcitadcFFFFe0Ecbyd;S1jjbHjjjjbbhEascxfasyd2gecdtfaEBdbasaEBdwasaecefBd2asclfabadalcbz:cjjjbcualcdtg3alcFFFFi0Eg5cbyd;S1jjbHjjjjbbhQascxfasyd2gecdtfaQBdbasaecefBd2a5cbyd;S1jjbHjjjjbbh8Eascxfasyd2gecdtfa8EBdbasaecefBd2alcd4alfhOcehHinaHgecethHaeaO6mbkcbhLcuaecdtgOaecFFFFi0Ecbyd;S1jjbHjjjjbbhHascxfasyd2gCcdtfaHBdbasaCcefBd2aHcFeaOz:ljjjbhXdnalTmbavcd4hCaecufhHinaLhednazTmbazaLcdtfydbhekaiaeaC2cdtfgeydlgOcH4aO7c:F:b:DD2aeydbgOcH4aO7c;D;O:B8J27aeydwgecH4ae7c:3F;N8N27aHGheaLcdth8FdndndndndnazTmbaza8FfhKcbhOinaXaecdtfgYydbgAcuSmlaiazaAcdtfydbaC2cdtfaiaKydbaC2cdtfcxz:ojjjbTmiaOcefgOaefaHGheaOaH9nmbxdkkaiaLaC2cdtfhKcbhOinaXaecdtfgYydbgAcuSmiaiaAaC2cdtfaKcxz:ojjjbTmdaOcefgOaefaHGheaOaH9nmbkkcbhYkaYydbgecu9hmekaYaLBdbaLhekaQa8FfaeBdbaLcefgLal9hmbkcbhea8EhHinaHaeBdbaHclfhHalaecefge9hmbkcbheaQhHa8EhOindnaeaHydbgCSmbaOa8EaCcdtfgCydbBdbaCaeBdbkaHclfhHaOclfhOalaecefge9hmbkkcbhaaXcbyd;O1jjbH:bjjjbbasasyd2cufBd2alcbyd;S1jjbHjjjjbbhXascxfasyd2gecdtfaXBdbasaecefBd2a5cbyd;S1jjbHjjjjbbheascxfasyd2gHcdtfaeBdbasaHcefBd2a5cbyd;S1jjbHjjjjbbhHascxfasyd2gOcdtfaHBdbasaOcefBd2aecFea3z:ljjjbhhaHcFea3z:ljjjbhgdnalTmbaEcwfh8Jindna8AaagOcefgacdtfydbgCa8AaOcdtgefydbgHSmbaCaH9Rh8FaEaHcitfh3agaefh8KahaefhLcbhAindndna3aAcitfydbgYaO9hmbaLaOBdba8KaOBdbxekdna8AaYcdtg8LfgeclfydbgHaeydbgeSmbaEaecitgCfydbaOSmeaHae9Rh8Maecu7aHfhKa8JaCfhHcbheinaKaeSmeaecefheaHydbhCaHcwfhHaCaO9hmbkaea8M6mekaga8LfgeaOaYaeydbcuSEBdbaLaYaOaLydbcuSEBdbkaAcefgAa8F9hmbkkaaal9hmbkaQhHa8EhOaghCahhAcbheindndnaeaHydbgY9hmbdnaeaOydbgY9hmbaAydbhYdnaCydbgKcu9hmbaYcu9hmbaXaefcb86bbxikaXaefhLdnaeaKSmbaeaYSmbaLce86bbxikaLcl86bbxdkdnaea8EaYcdtgKfydb9hmbdnaCydbgLcuSmbaeaLSmbaAydbg8FcuSmbaea8FSmbagaKfydbg3cuSmba3aYSmbahaKfydbgKcuSmbaKaYSmbdnaQaLcdtfydbgYaQaKcdtfydb9hmbaYaQa8FcdtfydbgKSmbaKaQa3cdtfydb9hmbaXaefcd86bbxlkaXaefcl86bbxikaXaefcl86bbxdkaXaefcl86bbxekaXaefaXaYfRbb86bbkaHclfhHaOclfhOaCclfhCaAclfhAalaecefge9hmbkdnaqTmbdndnazTmbazheaQhHalhOindnaqaeydbfRbbTmbaXaHydbfcl86bbkaeclfheaHclfhHaOcufgOmbxdkkaQhealhHindnaqRbbTmbaXaeydbfcl86bbkaqcefhqaeclfheaHcufgHmbkkaQhealhOaXhHindnaXaeydbfRbbcl9hmbaHcl86bbkaeclfheaHcefhHaOcufgOmbkkamceGTmbaXhealhHindnaeRbbce9hmbaecl86bbkaecefheaHcufgHmbkkcualcx2alc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbhaascxfasyd2gecdtfaaBdbasaecefBd2aaaialavazz:djjjbh8NdndnaDmbcbhycbh8Jxekcbh8JawhecbhHindnaeIdbJbbbb9ETmbasc;Wbfa8JcdtfaHBdba8Jcefh8JkaeclfheaDaHcefgH9hmbkcua8Jal2gecdtaecFFFFi0Ecbyd;S1jjbHjjjjbbhyascxfasyd2gecdtfayBdbasaecefBd2alTmba8JTmbarcd4hLdnazTmba8JcdthicbhYayhKinaoazaYcdtfydbaL2cdtfhAasc;WbfheaKhHa8JhOinaHaAaeydbcdtgCfIdbawaCfIdbNUdbaeclfheaHclfhHaOcufgOmbkaKaifhKaYcefgYal9hmbxdkka8JcdthicbhYayhKinaoaYaL2cdtfhAasc;WbfheaKhHa8JhOinaHaAaeydbcdtgCfIdbawaCfIdbNUdbaeclfheaHclfhHaOcufgOmbkaKaifhKaYcefgYal9hmbkkcualc8S2gHalc;D;O;f8U0EgCcbyd;S1jjbHjjjjbbheascxfasyd2gOcdtfaeBdbasaOcefBd2aecbaHz:ljjjbhqdndndndna8JTmbaCcbyd;S1jjbHjjjjbbhvascxfasyd2gecdtfavBdbcehOasaecefBd2avcbaHz:ljjjb8Acua8Jal2gecltgHaecFFFFb0Ecbyd;S1jjbHjjjjbbhrascxfasyd2gecdtfarBdbasaecefBd2arcbaHz:ljjjb8AadmexikcbhvadTmecbhrkcbhAabhHindnaaaHclfydbgYcx2fgeIdbaaaHydbgKcx2fgOIdbg8P:tgIaaaHcwfydbgLcx2fgCIdlaOIdlg8R:tg8SNaCIdba8P:tgRaeIdla8R:tg8UN:tg8Va8VNa8UaCIdwaOIdwg8W:tg8XNa8SaeIdwa8W:tg8UN:tg8Sa8SNa8UaRNa8XaIN:tgIaINMM:rgRJbbbb9ETmba8VaR:vh8VaIaR:vhIa8SaR:vh8SkaqaQaKcdtfydbc8S2fgea8SaR:rgRa8SNNg8UaeIdbMUdbaeaIaRaINg8YNg8XaeIdlMUdlaea8VaRa8VNg8ZNg80aeIdwMUdwaea8Ya8SNg8YaeIdxMUdxaea8Za8SNg81aeIdzMUdzaea8ZaINg8ZaeIdCMUdCaea8SaRa8Va8WNa8Sa8PNa8RaINMM:mg8RNg8PNg8SaeIdKMUdKaeaIa8PNgIaeId3MUd3aea8Va8PNg8VaeIdaMUdaaea8Pa8RNg8PaeId8KMUd8KaeaRaeIdyMUdyaqaQaYcdtfydbc8S2fgea8UaeIdbMUdbaea8XaeIdlMUdlaea80aeIdwMUdwaea8YaeIdxMUdxaea81aeIdzMUdzaea8ZaeIdCMUdCaea8SaeIdKMUdKaeaIaeId3MUd3aea8VaeIdaMUdaaea8PaeId8KMUd8KaeaRaeIdyMUdyaqaQaLcdtfydbc8S2fgea8UaeIdbMUdbaea8XaeIdlMUdlaea80aeIdwMUdwaea8YaeIdxMUdxaea81aeIdzMUdzaea8ZaeIdCMUdCaea8SaeIdKMUdKaeaIaeId3MUd3aea8VaeIdaMUdaaea8PaeId8KMUd8KaeaRaeIdyMUdyaHcxfhHaAcifgAad6mbkcbhiabhKinabaicdtfhYcbhHinaXaYaHc:G1jjbfydbcdtfydbgOfRbbhedndnaXaKaHfydbgCfRbbgAc99fcFeGcpe0mbaeceSmbaecd9hmekdnaAcufcFeGce0mbahaCcdtfydbaO9hmekdnaecufcFeGce0mbagaOcdtfydbaC9hmekdnaAcv2aefcj1jjbfRbbTmbaQaOcdtfydbaQaCcdtfydb0mekJbbacJbbacJbbjZaeceSEaAceSEh8ZdnaaaYaHc:K1jjbfydbcdtfydbcx2fgeIdwaaaCcx2fgAIdwg8R:tg8VaaaOcx2fgLIdwa8R:tg8Sa8SNaLIdbaAIdbg8W:tgIaINaLIdlaAIdlg8U:tgRaRNMMg8PNa8Va8SNaeIdba8W:tg80aINaRaeIdla8U:tg8YNMMg8Xa8SN:tg8Va8VNa80a8PNa8XaIN:tg8Sa8SNa8Ya8PNa8XaRN:tgIaINMM:rgRJbbbb9ETmba8VaR:vh8VaIaR:vhIa8SaR:vh8SkaqaQaCcdtfydbc8S2fgea8Sa8Za8P:rNgRa8SNNg8XaeIdbMUdbaeaIaRaINg8ZNg80aeIdlMUdlaea8VaRa8VNg8PNg8YaeIdwMUdwaea8Za8SNg8ZaeIdxMUdxaea8Pa8SNg81aeIdzMUdzaea8PaINgBaeIdCMUdCaea8SaRa8Va8RNa8Sa8WNa8UaINMM:mg8RNg8PNg8SaeIdKMUdKaeaIa8PNgIaeId3MUd3aea8Va8PNg8VaeIdaMUdaaea8Pa8RNg8PaeId8KMUd8KaeaRaeIdyMUdyaqaQaOcdtfydbc8S2fgea8XaeIdbMUdbaea80aeIdlMUdlaea8YaeIdwMUdwaea8ZaeIdxMUdxaea81aeIdzMUdzaeaBaeIdCMUdCaea8SaeIdKMUdKaeaIaeId3MUd3aea8VaeIdaMUdaaea8PaeId8KMUd8KaeaRaeIdyMUdykaHclfgHcx9hmbkaKcxfhKaicifgiad6mbkdna8JTmbcbhKinJbbbbh8WaaabaKcdtfgeclfydbgLcx2fgHIdwaaaeydbgicx2fgOIdwg8Y:tgIaINaHIdbaOIdbg81:tg8Va8VNaHIdlaOIdlgB:tgRaRNMMg8Zaaaecwfydbg8Fcx2fgeIdwa8Y:tg8PNaIaIa8PNa8VaeIdba81:tg8RNaRaeIdlaB:tg8UNMMg8SN:tJbbbbJbbjZa8Za8Pa8PNa8Ra8RNa8Ua8UNMMg80Na8Sa8SN:tg8X:va8XJbbbb9BEg8XNh83a80aINa8Pa8SN:ta8XNhUa8Za8UNaRa8SN:ta8XNh85a80aRNa8Ua8SN:ta8XNh86a8Za8RNa8Va8SN:ta8XNh87a80a8VNa8Ra8SN:ta8XNh88a8Va8UNa8RaRN:tg8Sa8SNaRa8PNa8UaIN:tg8Sa8SNaIa8RNa8Pa8VN:tg8Sa8SNMM:rJbbbZNh8Sayaia8J2g3cdtfhHaya8Fa8J2gwcdtfhOayaLa8J2g8LcdtfhCa8Y:mh89aB:mh8:a81:mhZcbhAa8JhYJbbbbh8UJbbbbh8XJbbbbh8ZJbbbbh80Jbbbbh8YJbbbbh81JbbbbhBJbbbbhnJbbbbhcinasc;WbfaAfgecwfa8SaUaCIdbaHIdbg8P:tgRNa83aOIdba8P:tg8RNMgINUdbaeclfa8Sa86aRNa85a8RNMg8VNUdbaea8Sa88aRNa87a8RNMgRNUdbaecxfa8Sa89aINa8:a8VNa8PaZaRNMMMg8PNUdba8SaIa8VNNa80Mh80a8SaIaRNNa8YMh8Ya8Sa8VaRNNa81Mh81a8Sa8Pa8PNNa8WMh8Wa8SaIa8PNNa8UMh8Ua8Sa8Va8PNNa8XMh8Xa8SaRa8PNNa8ZMh8Za8SaIaINNaBMhBa8Sa8Va8VNNanMhna8SaRaRNNacMhcaHclfhHaCclfhCaOclfhOaAczfhAaYcufgYmbkavaic8S2fgeacaeIdbMUdbaeanaeIdlMUdlaeaBaeIdwMUdwaea81aeIdxMUdxaea8YaeIdzMUdzaea80aeIdCMUdCaea8ZaeIdKMUdKaea8XaeId3MUd3aea8UaeIdaMUdaaea8WaeId8KMUd8Kaea8SaeIdyMUdyavaLc8S2fgeacaeIdbMUdbaeanaeIdlMUdlaeaBaeIdwMUdwaea81aeIdxMUdxaea8YaeIdzMUdzaea80aeIdCMUdCaea8ZaeIdKMUdKaea8XaeId3MUd3aea8UaeIdaMUdaaea8WaeId8KMUd8Kaea8SaeIdyMUdyava8Fc8S2fgeacaeIdbMUdbaeanaeIdlMUdlaeaBaeIdwMUdwaea81aeIdxMUdxaea8YaeIdzMUdzaea80aeIdCMUdCaea8ZaeIdKMUdKaea8XaeId3MUd3aea8UaeIdaMUdaaea8WaeId8KMUd8Kaea8SaeIdyMUdyara3cltfhYcbhHa8JhCinaYaHfgeasc;WbfaHfgOIdbaeIdbMUdbaeclfgAaOclfIdbaAIdbMUdbaecwfgAaOcwfIdbaAIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaCcufgCmbkara8LcltfhYcbhHa8JhCinaYaHfgeasc;WbfaHfgOIdbaeIdbMUdbaeclfgAaOclfIdbaAIdbMUdbaecwfgAaOcwfIdbaAIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaCcufgCmbkarawcltfhYcbhHa8JhCinaYaHfgeasc;WbfaHfgOIdbaeIdbMUdbaeclfgAaOclfIdbaAIdbMUdbaecwfgAaOcwfIdbaAIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaCcufgCmbkaKcifgKad6mbkkcbhOxekcehOcbhrkcbh8FdndnamcwGg9cmbJbbbbh8ZcbhJcbhocbhCxekcbhea5cbyd;S1jjbHjjjjbbhCascxfasyd2gHcdtfaCBdbasaHcefBd2dnalTmbaChHinaHaeBdbaHclfhHalaecefge9hmbkkdnaOmbcbhiinabaicdtfhLcbhKinaQaLaKcdtgec:G1jjbfydbcdtfydbcdtfydbhHdnaCaQaLaefydbcdtfydbgOcdtfgAydbgeaOSmbinaAaCaegOcdtfgYydbgeBdbaYhAaOae9hmbkkdnaCaHcdtfgAydbgeaHSmbinaAaCaegHcdtfgYydbgeBdbaYhAaHae9hmbkkdnaOaHSmbaCaOaHaOaH0EcdtfaOaHaOaH6EBdbkaKcefgKci9hmbkaicifgiad6mbkkcbhJdnalTmbcbhYindnaQaYcdtgefydbaY9hmbaYhHdnaCaefgKydbgeaYSmbaKhOinaOaCaegHcdtfgAydbgeBdbaAhOaHae9hmbkkaKaHBdbkaYcefgYal9hmbkcbheaQhOaChHcbhJindndnaeaOydbgA9hmbdnaeaHydbgA9hmbaHaJBdbaJcefhJxdkaHaCaAcdtfydbBdbxekaHaCaAcdtfydbBdbkaOclfhOaHclfhHalaecefge9hmbkkcuaJcltgeaJcjjjjiGEcbyd;S1jjbHjjjjbbhoascxfasyd2gHcdtfaoBdbasaHcefBd2aocbaez:ljjjbhAdnalTmbaChOaahealhYinaecwfIdbh8SaeclfIdbhIaAaOydbcltfgHaeIdbaHIdbMUdbaHclfgKaIaKIdbMUdbaHcwfgKa8SaKIdbMUdbaHcxfgHaHIdbJbbjZMUdbaOclfhOaecxfheaYcufgYmbkkdnaJTmbaAheaJhHinaecxfgOIdbh8SaOcbBdbaeaeIdbJbbbbJbbjZa8S:va8SJbbbb9BEg8SNUdbaeclfgOa8SaOIdbNUdbaecwfgOa8SaOIdbNUdbaeczfheaHcufgHmbkkdnalTmbaChOaahealhYinaAaOydbcltfgHcxfgKaecwfIdbaHcwfIdb:tg8Sa8SNaeIdbaHIdb:tg8Sa8SNaeclfIdbaHclfIdb:tg8Sa8SNMMg8SaKIdbgIaIa8S9DEUdbaOclfhOaecxfheaYcufgYmbkkdnaJmbcbhJJFFuuh8ZxekaAcxfheaAhHaJhOinaHaeIdbUdbaeczfheaHclfhHaOcufgOmbkJFFuuh8ZaAheaJhHinaeIdbg8Sa8Za8Za8S9EEh8ZaeclfheaHcufgHmbkkasydlh9ednalTmba9eclfhea9eydbhAaXhHalhYcbhOincbaeydbgKaA9RaHRbbcpeGEaOfhOaHcefhHaeclfheaKhAaYcufgYmbkaOce4h8Fkcuada8F9RcifgTcx2aTc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbhDascxfasyd2gecdtfaDBdbasaecefBd2cuaTcdtaTcFFFFi0Ecbyd;S1jjbHjjjjbbhSascxfasyd2gecdtfaSBdbasaecefBd2a5cbyd;S1jjbHjjjjbbh8Mascxfasyd2gecdtfa8MBdbasaecefBd2alcbyd;S1jjbHjjjjbbh9hascxfasyd2gecdtfa9hBdbasaecefBd2axaxNa8NJbbjZamclGEg83a83N:vhcJbbbbhndnadak9nmbdnaTci6mba8Jclth9iaDcwfh6JbbbbhBJbbbbhninasclfabadalaQz:cjjjbabh8FcbhEcbh5inaba5cdtfh3cbheindnaQa8FaefydbgOcdtgifydbgYaQa3aec:W1jjbfydbcdtfydbgHcdtgwfydbgKSmbaXaHfRbbgLcv2aXaOfRbbgAfc;a1jjbfRbbg8AaAcv2aLfg8Lc;a1jjbfRbbg8KVcFeGTmbdnaKaY9nmba8Lcj1jjbfRbbcFeGmekaAcufhYdnaAaL9hmbaYcFeGce0mbahaifydbaH9hmekdndnaAclSmbaLcl9hmekdnaYcFeGce0mbahaifydbaH9hmdkaLcufcFeGce0mbagawfydbaO9hmekaDaEcx2fgAaHaOa8KcFeGgYEBdlaAaOaHaYEBdbaAaYa8AGcb9hBdwaEcefhEkaeclfgecx9hmbkdna5cifg5ad9pmba8Fcxfh8FaEcifaT9nmekkaETmdcbhiinJbbbbJbbjZaqaQaDaicx2fgAydlgKaAydbgYaAydwgHEgLcdtfydbc8S2fgeIdyg8S:va8SJbbbb9BEaeIdwaaaYaKaHEg8Fcx2fgHIdwgRNaeIdzaHIdbg8PNaeIdaMg8Sa8SMMaRNaeIdlaHIdlg8RNaeIdCaRNaeId3Mg8Sa8SMMa8RNaeIdba8PNaeIdxa8RNaeIdKMg8Sa8SMMa8PNaeId8KMMM:lNh80JbbbbJbbjZaqaQaYcdtfydbc8S2fgeIdyg8S:va8SJbbbb9BEaeIdwaaaKcx2fgHIdwg8VNaeIdzaHIdbg8WNaeIdaMg8Sa8SMMa8VNaeIdlaHIdlg8UNaeIdCa8VNaeId3Mg8Sa8SMMa8UNaeIdba8WNaeIdxa8UNaeIdKMg8Sa8SMMa8WNaeId8KMMM:lNh8YaAcwfh3aAclfhwdna8JTmbavaYc8S2fgOIdwa8VNaOIdza8WNaOIdaMg8Sa8SMMa8VNaOIdla8UNaOIdCa8VNaOId3Mg8Sa8SMMa8UNaOIdba8WNaOIdxa8UNaOIdKMg8Sa8SMMa8WNaOId8KMMMh8SayaKa8J2cdtfhHaraYa8J2cltfheaOIdyh8Xa8JhOinaHIdbgIaIa8XNaecxfIdba8VaecwfIdbNa8WaeIdbNa8UaeclfIdbNMMMgIaIM:tNa8SMh8SaHclfhHaeczfheaOcufgOmbkavaLc8S2fgOIdwaRNaOIdza8PNaOIdaMgIaIMMaRNaOIdla8RNaOIdCaRNaOId3MgIaIMMa8RNaOIdba8PNaOIdxa8RNaOIdKMgIaIMMa8PNaOId8KMMMhIaya8Fa8J2cdtfhHaraLa8J2cltfheaOIdyh8Wa8JhOinaHIdbg8Va8Va8WNaecxfIdbaRaecwfIdbNa8PaeIdbNa8RaeclfIdbNMMMg8Va8VM:tNaIMhIaHclfhHaeczfheaOcufgOmbka80aI:lMh80a8Ya8S:lMh8YkawaKa8Fa8Ya809FgeEBdbaAaYaLaeEBdba3a8Ya80aeEUdbaicefgiaE9hmbkasc;Wbfcbcj;qbz:ljjjb8Aa6heaEhHinasc;WbfaeydbcA4cF8FGgOcFAaOcFA6EcdtfgOaOydbcefBdbaecxfheaHcufgHmbkcbhecbhHinasc;WbfaefgOydbhAaOaHBdbaAaHfhHaeclfgecj;qb9hmbkcbhea6hHinasc;WbfaHydbcA4cF8FGgOcFAaOcFA6EcdtfgOaOydbgOcefBdbaSaOcdtfaeBdbaHcxfhHaEaecefge9hmbkadak9RgOci9Uh9kdnalTmbcbhea8MhHinaHaeBdbaHclfhHalaecefge9hmbkkcbh0a9hcbalz:ljjjbh9maOcO9Uh9na9kce4h9oasydwh9pcbh8KcbhwdninaDaSawcdtfydbcx2fg3Idwg8Sac9Emea8Ka9k9pmeJFFuuhIdna9oaE9pmbaDaSa9ocdtfydbcx2fIdwJbb;aZNhIkdna8SaI9ETmba8San9ETmba8Ka9n0mdkdna9maQa3ydlgicdtg9qfydbgAfg9rRbba9maQa3ydbgLcdtg9sfydbgHfg9tRbbVmbaXaLfRbbh9udna9eaHcdtfgeclfydbgOaeydbgeSmbaOae9RhKa9paecitfheaaaAcx2fg8Lcwfh5a8Lclfh9vaaaHcx2fg8Acwfh9wa8Aclfh9xcbhHceh8Fdnindna8MaeydbcdtfydbgOaASmba8MaeclfydbcdtfydbgYaASmbaOaYSmbaaaYcx2fgYIdbaaaOcx2fgOIdbg8V:tg8Sa9xIdbaOIdlgR:tg8WNa8AIdba8V:tg8UaYIdlaR:tgIN:tg8Pa8Sa9vIdbaR:tg8XNa8LIdba8V:tg80aIN:tgRNaIa9wIdbaOIdwg8R:tg8YNa8WaYIdwa8R:tg8VN:tg8WaIa5Idba8R:tg81Na8Xa8VN:tgINa8Va8UNa8Ya8SN:tg8Ra8Va80Na81a8SN:tg8SNMMa8Pa8PNa8Wa8WNa8Ra8RNMMaRaRNaIaINa8Sa8SNMMN:rJbbj8:N9FmdkaecwfheaHcefgHaK6h8FaKaH9hmbkka8FceGTmba9ocefh9oxeka3cwfhHdndndndna9uc9:fPdebdkaLheina8MaecdtgefaiBdba8EaefydbgeaL9hmbxikkdnagahaha9sfydbaiSEa8Ea9sfydbgLcdtfydbgecu9hmba8Ea9qfydbheka8Ma9sfaiBdbaehika8MaLcdtfaiBdbka9tce86bba9rce86bbaHIdbg8Sanana8S9DEhna0cefh0cecda9uceSEa8Kfh8KkawcefgwaE9hmbkka0TmddnalTmbcbhKcbhiindna8MaicdtgefydbgOaiSmbaQaOcdtfydbh8FdnaiaQaefydb9hg3mbaqa8Fc8S2fgeaqaic8S2fgHIdbaeIdbMUdbaeaHIdlaeIdlMUdlaeaHIdwaeIdwMUdwaeaHIdxaeIdxMUdxaeaHIdzaeIdzMUdzaeaHIdCaeIdCMUdCaeaHIdKaeIdKMUdKaeaHId3aeId3MUd3aeaHIdaaeIdaMUdaaeaHId8KaeId8KMUd8KaeaHIdyaeIdyMUdyka8JTmbavaOc8S2fgeavaic8S2gwfgHIdbaeIdbMUdbaeaHIdlaeIdlMUdlaeaHIdwaeIdwMUdwaeaHIdxaeIdxMUdxaeaHIdzaeIdzMUdzaeaHIdCaeIdCMUdCaeaHIdKaeIdKMUdKaeaHId3aeId3MUd3aeaHIdaaeIdaMUdaaeaHId8KaeId8KMUd8KaeaHIdyaeIdyMUdya9iaO2hLarhHa8JhAinaHaLfgeaHaKfgOIdbaeIdbMUdbaeclfgYaOclfIdbaYIdbMUdbaecwfgYaOcwfIdbaYIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaAcufgAmbka3mbJbbbbJbbjZaqawfgeIdyg8S:va8SJbbbb9BEaeIdwaaa8Fcx2fgHIdwg8SNaeIdzaHIdbgINaeIdaMg8Va8VMMa8SNaeIdlaHIdlg8VNaeIdCa8SNaeId3Mg8Sa8SMMa8VNaeIdbaINaeIdxa8VNaeIdKMg8Sa8SMMaINaeId8KMMM:lNg8SaBaBa8S9DEhBkaKa9ifhKaicefgial9hmbkcbhHahheindnaeydbgOcuSmbdnaHa8MaOcdtgAfydbgO9hmbcuhOahaAfydbgAcuSmba8MaAcdtfydbhOkaeaOBdbkaeclfhealaHcefgH9hmbkcbhHagheindnaeydbgOcuSmbdnaHa8MaOcdtgAfydbgO9hmbcuhOagaAfydbgAcuSmba8MaAcdtfydbhOkaeaOBdbkaeclfhealaHcefgH9hmbkkaBana8JEhBcbhYabhecbhKindna8MaeydbcdtfydbgHa8MaeclfydbcdtfydbgOSmbaHa8MaecwfydbcdtfydbgASmbaOaASmbabaYcdtfgLaHBdbaLcwfaABdbaLclfaOBdbaYcifhYkaecxfheaKcifgKad6mbkdndna9cTmbaYak9nmba8ZaB9FTmbcbhdabhecbhHindnaoaCaeydbgOcdtfydbcdtfIdbaB9ETmbabadcdtfgAaOBdbaAclfaeclfydbBdbaAcwfaecwfydbBdbadcifhdkaecxfheaHcifgHaY6mbkJFFuuh8ZaJTmeaoheaJhHJFFuuh8SinaeIdbgIa8Sa8SaI9EEg8Va8SaIaB9EgOEh8Sa8Va8ZaOEh8ZaeclfheaHcufgHmbxdkkaYhdkadak0mbxdkkasclfabadalaQz:cjjjbkdndnadak0mbadhOxekdna9cmbadhOxekdna8Zac9FmbadhOxekina8ZJbb;aZNg8Saca8Sac9DEh8VJbbbbh8SdnaJTmbaoheaJhHinaeIdbgIa8SaIa8V9FEa8SaIa8S9EEh8SaeclfheaHcufgHmbkkcbhOabhecbhHindnaoaCaeydbgAcdtfydbcdtfIdba8V9ETmbabaOcdtfgYaABdbaYclfaeclfydbBdbaYcwfaecwfydbBdbaOcifhOkaecxfheaHcifgHad6mbkJFFuuh8ZdnaJTmbaoheaJhHJFFuuhIinaeIdbgRaIaIaR9EEg8PaIaRa8V9EgAEhIa8Pa8ZaAEh8ZaeclfheaHcufgHmbkkdnaOad9hmbadhOxdka8Sanana8S9DEhnaOak9nmeaOhda8Zac9FmbkkdnamcjjjjlGTmbazmbaOTmbcbhQabheinaXaeydbgAfRbbc3thKaecwfgLydbhHdndnahaAcdtg8FfydbaeclfgiydbgCSmbcbhYagaCcdtfydbaA9hmekcjjjj94hYkaeaKaYVaAVBdbaXaCfRbbc3thKdndnahaCcdtfydbaHSmbcbhYagaHcdtfydbaC9hmekcjjjj94hYkaiaKaYVaCVBdbaXaHfRbbc3thYdndnahaHcdtfydbaASmbcbhCaga8FfydbaH9hmekcjjjj94hCkaLaYaCVaHVBdbaecxfheaQcifgQaO6mbkkdnazTmbaOTmbaOheinabazabydbcdtfydbBdbabclfhbaecufgembkkdnaPTmbaPa83an:rNUdbkasyd2gecdtascxffc98fhHdninaeTmeaHydbcbyd;O1jjbH:bjjjbbaHc98fhHaecufhexbkkasc;W;qbf8KjjjjbaOk;Yieouabydlhvabydbclfcbaicdtz:ljjjbhoadci9UhrdnadTmbdnalTmbaehwadhDinaoalawydbcdtfydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbxdkkaehwadhDinaoawydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbkkdnaiTmbcbhDaohwinawydbhqawaDBdbawclfhwaqaDfhDaicufgimbkkdnadci6mbinaecwfydbhwaeclfydbhDaeydbhidnalTmbalawcdtfydbhwalaDcdtfydbhDalaicdtfydbhikavaoaicdtfgqydbcitfaDBdbavaqydbcitfawBdlaqaqydbcefBdbavaoaDcdtfgqydbcitfawBdbavaqydbcitfaiBdlaqaqydbcefBdbavaoawcdtfgwydbcitfaiBdbavawydbcitfaDBdlawawydbcefBdbaecxfhearcufgrmbkkabydbcbBdbk;Podvuv998Jjjjjbca9RgvcFFF;7rBd3av9cFFF;7;3FF:;Fb83dCavcFFF97Bdzav9cFFF;7FFF:;u83dwdnadTmbaicd4hodnabmbdnalTmbcbhrinaealarcdtfydbao2cdtfhwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkarcefgrad9hmbxikkaocdthrcbhwincbhiinavcCfaifgDaeaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkaearfheawcefgwad9hmbxdkkdnalTmbcbhrinabarcx2fgiaealarcdtfydbao2cdtfgwIdbUdbaiawIdlUdlaiawIdwUdwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkarcefgrad9hmbxdkkaocdthlcbhraehwinabarcx2fgiaearao2cdtfgDIdbUdbaiaDIdlUdlaiaDIdwUdwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkawalfhwarcefgrad9hmbkkJbbbbavIdwavIdCgk:tgqaqJbbbb9DEgqavIdxavIdKgx:tgmamaq9DEgqavIdzavId3gm:tgPaPaq9DEhPdnabTmbadTmbJbbbbJbbjZaP:vaPJbbbb9BEhqinabaqabIdbak:tNUdbabclfgvaqavIdbax:tNUdbabcwfgvaqavIdbam:tNUdbabcxfhbadcufgdmbkkaPk8MbabaeadaialavcbcbcbcbcbaoarawaDz:bjjjbk8MbabaeadaialavaoarawaDaqakaxamaPz:bjjjbk:nCoDud99rue99lul998Jjjjjbc;Wb9Rgw8KjjjjbdndnarmbcbhDxekawcxfcbc;Kbz:ljjjb8Aawcuadcx2adc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbgqBdxawceBd2aqaeadaicbz:djjjb8AawcuadcdtadcFFFFi0Egkcbyd;S1jjbHjjjjbbgxBdzawcdBd2adcd4adfhmceheinaegicetheaiam6mbkcbhPawcuaicdtgsaicFFFFi0Ecbyd;S1jjbHjjjjbbgzBdCawciBd2dndnar:ZgH:rJbbbZMgO:lJbbb9p9DTmbaO:Ohexekcjjjj94hekaicufhAc:bwhmcbhCadhXcbhQinaChLaeamgKcufaeaK9iEaPgDcefaeaD9kEhYdndnadTmbaYcuf:YhOaqhiaxheadhmindndnaiIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhCxekcjjjj94hCkaCcCthCdndnaiclfIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhExekcjjjj94hEkaEcqtaCVhCdndnaicwfIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhExekcjjjj94hEkaeaCaEVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:ljjjbh3cbh5cbh8Eindna3axa8EcdtfydbgCcm4aC7c:v;t;h;Ev2gics4ai7aAGgmcdtfgEydbgecuSmbaeaCSmbcehiina3amaifaAGgmcdtfgEydbgecuSmeaicefhiaeaC9hmbkkaEaCBdba5aecuSfh5a8Ecefg8Ead9hmbxdkkazcFeasz:ljjjb8Acbh5kaDaYa5ar0giEhPaLa5aiEhCdna5arSmbaYaKaiEgmaP9Rcd9imbdndnaQcl0mbdnaX:ZgOaL:Zg8A:taY:Yg8FaD:Y:tgaa8FaK:Y:tgha5:ZggaH:tNNNaOaH:tahNa8Aag:tNa8AaH:taaNagaO:tNM:va8FMJbbbZMgO:lJbbb9p9DTmbaO:Ohexdkcjjjj94hexekaPamfcd9Theka5aXaiEhXaQcefgQcs9hmekkdndnaCmbcihicbhDxekcbhiawakcbyd;S1jjbHjjjjbbg8EBdKawclBd2aPcuf:Yh8AdndnadTmbaqhiaxheadhmindndnaiIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhCxekcjjjj94hCkaCcCthCdndnaiclfIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhExekcjjjj94hEkaEcqtaCVhCdndnaicwfIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhExekcjjjj94hEkaeaCaEVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:ljjjbh3cbhDcbh5inaxa5cdtgYfydbgCcm4aC7c:v;t;h;Ev2gics4ai7hecbhidndnina3aeaAGgmcdtfgEydbgecuSmednaxaecdtgEfydbaCSmbaicefgiamfheaiaA9nmekka8EaEfydbhixekaEa5BdbaDhiaDcefhDka8EaYfaiBdba5cefg5ad9hmbkcuaDc32giaDc;j:KM;jb0EhexekazcFeasz:ljjjb8AcbhDcbhekawaecbyd;S1jjbHjjjjbbgeBd3awcvBd2aecbaiz:ljjjbhEavcd4hxdnadTmbdnalTmbaxcdth3a8EhCalheaqhmadhAinaEaCydbc32fgiamIdbaiIdbMUdbaiamclfIdbaiIdlMUdlaiamcwfIdbaiIdwMUdwaiaeIdbaiIdxMUdxaiaeclfIdbaiIdzMUdzaiaecwfIdbaiIdCMUdCaiaiIdKJbbjZMUdKaCclfhCaea3fheamcxfhmaAcufgAmbxdkka8EhmaqheadhCinaEamydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiaiIdxJbbbbMUdxaiaiIdzJbbbbMUdzaiaiIdCJbbbbMUdCaiaiIdKJbbjZMUdKamclfhmaecxfheaCcufgCmbkkdnaDTmbaEhiaDheinaiaiIdbJbbbbJbbjZaicKfIdbgO:vaOJbbbb9BEgONUdbaiclfgmaOamIdbNUdbaicwfgmaOamIdbNUdbaicxfgmaOamIdbNUdbaiczfgmaOamIdbNUdbaicCfgmaOamIdbNUdbaic3fhiaecufgembkkcbhCawcuaDcdtgYaDcFFFFi0Egicbyd;S1jjbHjjjjbbgeBdaawcoBd2awaicbyd;S1jjbHjjjjbbg3Bd8KaecFeaYz:ljjjbh5dnadTmbJbbjZJbbjZa8A:vaPceSEaoNgOaONh8Aaxcdthxalheina8Aaec;C1jjbalEgmIdwaEa8EydbgAc32fgiIdC:tgOaONamIdbaiIdx:tgOaONamIdlaiIdz:tgOaONMMNaqcwfIdbaiIdw:tgOaONaqIdbaiIdb:tgOaONaqclfIdbaiIdl:tgOaONMMMhOdndna5aAcdtgifgmydbcuSmba3aifIdbaO9ETmekamaCBdba3aifaOUdbka8Eclfh8EaeaxfheaqcxfhqadaCcefgC9hmbkkaba5aYz:kjjjb8AcrhikaicdthiinaiTmeaic98fgiawcxffydbcbyd;O1jjbH:bjjjbbxbkkawc;Wbf8KjjjjbaDk:Odieui99iu8Jjjjjbca9RgicFFF;7rBd3ai9cFFF;7;3FF:;Fb83dCaicFFF97Bdzai9cFFF;7FFF:;u83dwdndnaembJbbjFhlJbbjFhvJbbjFhoxekadcd4cdthrcbhwincbhdinaicCfadfgDabadfIdbglaDIdbgvaval9EEUdbaicwfadfgDalaDIdbgvaval9DEUdbadclfgdcx9hmbkabarfhbawcefgwae9hmbkaiIdzaiId3:thoaiIdxaiIdK:thvaiIdwaiIdC:thlkJbbbbalalJbbbb9DEglavaval9DEglaoaoal9DEk9DeeuabcFeaicdtz:ljjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk9teiucbcbyd;W1jjbgeabcifc98GfgbBd;W1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;W1jjbgeabcrfc94GfgbBd;W1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd;W1jjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd;W1jjbfgdBd;W1jjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akk6eiucbhidnadTmbdninabRbbglaeRbbgv9hmeaecefheabcefhbadcufgdmbxdkkalav9Rhikaikk:bedbcjwk9Oeeebeebebbeeebebbbbbebebbbbbbbbbebbbdbbbbbbbebbbebbbdbbbbbbbbbbbeeeeebebbebbebebbbeebbbbbbbbbbbbbbbbbbbbbc;OwkxebbbdbbbjNbb",J=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!=="object")return{supported:!1};var X,Y=WebAssembly.instantiate($(Z),{}).then(function(U){X=U.instance,X.exports.__wasm_call_ctors()});function $(U){var w=new Uint8Array(U.length);for(var L=0;L<U.length;++L){var O=U.charCodeAt(L);w[L]=O>96?O-97:O>64?O-39:O+4}var N=0;for(var L=0;L<U.length;++L)w[N++]=w[L]<60?J[w[L]]:(w[L]-60)*64+w[++L];return w.buffer.slice(0,N)}function Q(U){if(!U)throw new Error("Assertion failed")}function W(U){return new Uint8Array(U.buffer,U.byteOffset,U.byteLength)}function K(U,w,L){var O=X.exports.sbrk,N=O(w.length*4),M=O(L*4),j=new Uint8Array(X.exports.memory.buffer),P=W(w);j.set(P,N);var D=U(M,N,w.length,L);j=new Uint8Array(X.exports.memory.buffer);var C=new Uint32Array(L);new Uint8Array(C.buffer).set(j.subarray(M,M+L*4)),P.set(j.subarray(N,N+w.length*4)),O(N-O(0));for(var k=0;k<w.length;++k)w[k]=C[w[k]];return[C,D]}function G(U){var w=0;for(var L=0;L<U.length;++L){var O=U[L];w=w<O?O:w}return w}function H(U,w,L,O,N,M,j,P,D){var C=X.exports.sbrk,k=C(4),T=C(L*4),x=C(N*M),S=C(L*4),h=new Uint8Array(X.exports.memory.buffer);h.set(W(O),x),h.set(W(w),S);var I=U(T,S,L,x,N,M,j,P,D,k);h=new Uint8Array(X.exports.memory.buffer);var v=new Uint32Array(I);W(v).set(h.subarray(T,T+I*4));var A=new Float32Array(1);return W(A).set(h.subarray(k,k+4)),C(k-C(0)),[v,A[0]]}function z(U,w,L,O,N,M,j,P,D,C,k,T,x){var S=X.exports.sbrk,h=S(4),I=S(L*4),v=S(N*M),A=S(N*P),p=S(D.length*4),n=S(L*4),o=C?S(N):0,X0=new Uint8Array(X.exports.memory.buffer);if(X0.set(W(O),v),X0.set(W(j),A),X0.set(W(D),p),X0.set(W(w),n),C)X0.set(W(C),o);var Q0=U(I,n,L,v,N,M,A,P,p,D.length,o,k,T,x,h);X0=new Uint8Array(X.exports.memory.buffer);var E0=new Uint32Array(Q0);W(E0).set(X0.subarray(I,I+Q0*4));var I0=new Float32Array(1);return W(I0).set(X0.subarray(h,h+4)),S(h-S(0)),[E0,I0[0]]}function q(U,w,L,O){var N=X.exports.sbrk,M=N(L*O),j=new Uint8Array(X.exports.memory.buffer);j.set(W(w),M);var P=U(M,L,O);return N(M-N(0)),P}function V(U,w,L,O,N,M,j,P){var D=X.exports.sbrk,C=D(P*4),k=D(L*O),T=D(L*M),x=new Uint8Array(X.exports.memory.buffer);if(x.set(W(w),k),N)x.set(W(N),T);var S=U(C,k,L,O,T,M,j,P);x=new Uint8Array(X.exports.memory.buffer);var h=new Uint32Array(S);return W(h).set(x.subarray(C,C+S*4)),D(C-D(0)),h}var F={LockBorder:1,Sparse:2,ErrorAbsolute:4,Prune:8,_InternalDebug:1073741824};return{ready:Y,supported:!0,useExperimentalFeatures:!1,compactMesh:function(U){Q(U instanceof Uint32Array||U instanceof Int32Array||U instanceof Uint16Array||U instanceof Int16Array),Q(U.length%3==0);var w=U.BYTES_PER_ELEMENT==4?U:new Uint32Array(U);return K(X.exports.meshopt_optimizeVertexFetchRemap,w,G(U)+1)},simplify:function(U,w,L,O,N,M){Q(U instanceof Uint32Array||U instanceof Int32Array||U instanceof Uint16Array||U instanceof Int16Array),Q(U.length%3==0),Q(w instanceof Float32Array),Q(w.length%L==0),Q(L>=3),Q(O>=0&&O<=U.length),Q(O%3==0),Q(N>=0);var j=0;for(var P=0;P<(M?M.length:0);++P)Q(M[P]in F),Q(this.useExperimentalFeatures||M[P]!="Prune"),j|=F[M[P]];var D=U.BYTES_PER_ELEMENT==4?U:new Uint32Array(U),C=H(X.exports.meshopt_simplify,D,U.length,w,w.length/L,L*4,O,N,j);return C[0]=U instanceof Uint32Array?C[0]:new U.constructor(C[0]),C},simplifyWithAttributes:function(U,w,L,O,N,M,j,P,D,C){Q(this.useExperimentalFeatures),Q(U instanceof Uint32Array||U instanceof Int32Array||U instanceof Uint16Array||U instanceof Int16Array),Q(U.length%3==0),Q(w instanceof Float32Array),Q(w.length%L==0),Q(L>=3),Q(O instanceof Float32Array),Q(O.length%N==0),Q(N>=0),Q(j==null||j instanceof Uint8Array),Q(j==null||j.length==w.length/L),Q(P>=0&&P<=U.length),Q(P%3==0),Q(D>=0),Q(Array.isArray(M)),Q(N>=M.length),Q(M.length<=32);for(var k=0;k<M.length;++k)Q(M[k]>=0);var T=0;for(var k=0;k<(C?C.length:0);++k)Q(C[k]in F),T|=F[C[k]];var x=U.BYTES_PER_ELEMENT==4?U:new Uint32Array(U),S=z(X.exports.meshopt_simplifyWithAttributes,x,U.length,w,w.length/L,L*4,O,N*4,new Float32Array(M),j?new Uint8Array(j):null,P,D,T);return S[0]=U instanceof Uint32Array?S[0]:new U.constructor(S[0]),S},getScale:function(U,w){return Q(U instanceof Float32Array),Q(U.length%w==0),Q(w>=3),q(X.exports.meshopt_simplifyScale,U,U.length/w,w*4)},simplifyPoints:function(U,w,L,O,N,M){if(Q(this.useExperimentalFeatures),Q(U instanceof Float32Array),Q(U.length%w==0),Q(w>=3),Q(L>=0&&L<=U.length/w),O)return Q(O instanceof Float32Array),Q(O.length%N==0),Q(N>=3),Q(U.length/w==O.length/N),V(X.exports.meshopt_simplifyPoints,U,U.length/w,w*4,O,N*4,M,L);else return V(X.exports.meshopt_simplifyPoints,U,U.length/w,w*4,void 0,0,0,L)}}}();var Dz6=function(){var Z="b9H79Tebbbefx9Geueu9Geub9Gbb9Giuuueu9Gkuuuuuuuuuu99eu9Gvuuuuueu9Gkuuuuuuuuu9999eu9Gruuuuuuub9Gkuuuuuuuuuuueu9Gouuuuuub9Giuuub9GluuuubiOHdilvorwDqrkbiibeilve9Weiiviebeoweuec:q:Odkr:Yewo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9I919P29K9nW79O2Wt79c9V919U9KbeX9TW79O9V9Wt9F9I919P29K9nW79O2Wt7bd39TW79O9V9Wt9F9J9V9T9W91tWJ2917tWV9c9V919U9K7br39TW79O9V9Wt9F9J9V9T9W91tW9nW79O2Wt9c9V919U9K7bDL9TW79O9V9Wt9F9V9Wt9P9T9P96W9nW79O2Wtbql79IV9RbkDwebcekdsPq;L9kHdbkIbabaec9:fgefcufae9Ugeabci9Uadfcufad9Ugbaeab0Ek:oAlPue99eux998Jjjjjbc:We9Rgk8Kjjjjbakc;mbfcbc;Kbz:njjjb8AakcuaocdtgxaocFFFFi0Egmcbyd:e1jjbHjjjjbbgPBd9makceBd:SeakaPBdnakamcbyd:e1jjbHjjjjbbgsBd9qakcdBd:SeakasBd9eakcualcdtalcFFFFi0Ecbyd:e1jjbHjjjjbbgzBd9uakazBd9iakciBd:SeaPcbaxz:njjjbhHalci9UhOdnalTmbaihPalhAinaHaPydbcdtfgCaCydbcefBdbaPclfhPaAcufgAmbkkdnaoTmbcbhPashAaHhCaohXinaAaPBdbaAclfhAaCydbaPfhPaCclfhCaXcufgXmbkkdnalci6mbcbhPaihAinaAcwfydbhCaAclfydbhXasaAydbcdtfgQaQydbgQcefBdbazaQcdtfaPBdbasaXcdtfgXaXydbgXcefBdbazaXcdtfaPBdbasaCcdtfgCaCydbgCcefBdbazaCcdtfaPBdbaAcxfhAaOaPcefgP9hmbkkdnaoTmbaHhAashPaohCinaPaPydbaAydb9RBdbaAclfhAaPclfhPaCcufgCmbkkakamcbyd:e1jjbHjjjjbbgPBd9yakclBd:SeaPaHaxz:mjjjbhmakaOcbyd:e1jjbHjjjjbbgPBd9CakcvBd:SeaPcbaOz:njjjbhLakcuaOcK2alcjjjjd0Ecbyd:e1jjbHjjjjbbgKBd9GakcoBd:SeJbbbbhYdnalci6g8Ambarcd4hxaihAaKhPaOhrJbbbbhEinavaAclfydbax2cdtfgCIdlh3avaAydbax2cdtfgXIdlhYavaAcwfydbax2cdtfgQIdlh5aCIdwh8EaXIdwh8FaQIdwhaaPaCIdbghaXIdbggMaQIdbg8JMJbbnn:vUdbaPclfaXIdlaCIdlMaQIdlMJbbnn:vUdbaQIdwh8KaCIdwh8LaXIdwh8MaPcxfa3aY:tg3aaa8F:tgaNa5aY:tg5a8Ea8F:tg8EN:tgYJbbbbJbbjZahag:tgha5Na8Jag:tgga3N:tg8Fa8FNaYaYNa8EagNaaahN:tgYaYNMM:rgg:vagJbbbb9BEg3NUdbaPczfaYa3NUdbaPcCfa8Fa3NUdbaPcwfa8Ka8Ma8LMMJbbnn:vUdbaEagMhEaAcxfhAaPcKfhParcufgrmbkaEaO:Z:vJbbbZNhYkakcuaOcdtalcFFFF970Ecbyd:e1jjbHjjjjbbgCBd9KakcrBd:SeaYaD:ZN:rhYdna8AmbcbhPaChAinaAaPBdbaAclfhAaOaPcefgP9hmbkkaYJbbbZNh8MakcuaOcltalcFFFFd0Ecbyd:e1jjbHjjjjbbg8ABd9OakcwBd:Secba8AaKaCaOz:djjjb8Aakaocbyd:e1jjbHjjjjbbgPBd2aPcFeaoz:njjjbhrakc8Wfcwf9cb83ibak9cb83i8WcbhPJbbbbhEJbbbbh5Jbbbbh8EJbbbbhYJbbbbh8FJbbbbhgcbhlinJbbbbh3dnaPTmbJbbjZaP:Z:vh3kaka8Ea3NgaUdaaka5a3NghUd3akaEa3Ng8JUdKJbbbbh3dnagagNaYaYNa8Fa8FNMMg8KJbbbb9BmbJbbjZa8K:r:vh3kakaga3NUd8Saka8Fa3NUdyakaYa3NUd8Kdndndnakyd8WgQakydUgAakcKfaeaiakc;abfaKamara8Maqz:ejjjbgCcuSmbdnaPaD9pmbaAaraiaCcx2fgXydbfRbbcFeSfaraXclfydbfRbbcFeSfaraXcwfydbfRbbcFeSfaw9nmdkaQaAcbaeaiakc;abfaKamara8MJbbbbz:ejjjbgCcu9hmekakaaUdCakahUdzaka8JUdxakcuBdwakcFFF;7rBdla8AcbaKaLakcxfakcwfakclfz:fjjjbakydwgCcuSmekdnakc8WfaiaCcx2fgOydbgPaOclfydbgAaOcwfydbgXarabaeadalawaDz:gjjjbTmbalcefhlJbbbbhEJbbbbh5Jbbbbh8EJbbbbhYJbbbbh8FJbbbbhgkamaPcdtfgPaPydbcufBdbamaAcdtfgPaPydbcufBdbamaXcdtfgPaPydbcufBdbcbhXinazasaOaXcdtfydbcdtgAfydbcdtfgxhPaHaAfgvydbgQhAdnaQTmbdninaPydbaCSmeaPclfhPaAcufgATmdxbkkaPaxaQcdtfc98fydbBdbavavydbcufBdbkaXcefgXci9hmbkaKaCcK2fgPIdbh3aPIdlhaaPIdwhhaPIdxh8JaPIdzh8KaPIdCh8LaLaCfce86bbaga8LMhga8Fa8KMh8FaYa8JMhYa8EahMh8Ea5aaMh5aEa3MhEakyd88hPxekkdnaPTmbdnakyd80gAaPci2fgCciGTmbadaCfcbaPaAcu7fciGcefz:njjjb8AkabalcltfgPak8Pi8W83dbaPcwfakc8Wfcwf8Pib83dbalcefhlkcahPdninaPc98Smeakc;mbfaPfydbcbydj1jjbH:bjjjbbaPc98fhPxbkkakc:Wef8Kjjjjbalk;3vivuv99lu8Jjjjjbca9Rgv8Kjjjjbdndnalcw0mbaiydbhoaeabcitfgralcdtcufBdlaraoBdbdnalcd6mbaiclfhoalcufhwarcxfhrinaoydbhDarcuBdbarc98faDBdbarcwfhraoclfhoawcufgwmbkkalabfhrxekcbhDavczfcwfcbBdbav9cb83izavcwfcbBdbav9cb83ibJbbjZhqJbbjZhkinadaiaDcdtfydbcK2fhwcbhrinavczfarfgoawarfIdbgxaoIdbgm:tgPakNamMgmUdbavarfgoaPaxam:tNaoIdbMUdbarclfgrcx9hmbkJbbjZaqJbbjZMgq:vhkaDcefgDal9hmbkcbhoadcbcecdavIdlgxavIdwgm9GEgravIdbgPam9GEaraPax9GEgscdtgrfhzavczfarfIdbhxaihralhwinaiaocdtfgDydbhHaDarydbgOBdbaraHBdbarclfhraoazaOcK2fIdbax9Dfhoawcufgwmbkaeabcitfhrdndnaocv6mbaoalc98f6mekaraiydbBdbaralcdtcufBdlaiclfhoalcufhwarcxfhrinaoydbhDarcuBdbarc98faDBdbarcwfhraoclfhoawcufgwmbkalabfhrxekaraxUdbaeabcitfgrarydlc98GasVBdlabcefaeadaiaoz:djjjbhwararydlciGawabcu7fcdtVBdlawaeadaiaocdtfalao9Rz:djjjbhrkavcaf8Kjjjjbark;Bloeue99vue99Due99dndnaembcuhkxekJbbjZaq:thxaiabcdtfhmavydbhPavydlhsavydwhzcbhHJFFuuhOcvhbcuhkindnaPamaHcdtfydbcdtgvfydbgATmbazasavfydbcdtfhiindndnawalaiydbgCcx2fgvclfydbgXfRbbcFeSawavydbgQfRbbcFeSfawavcwfydbgLfRbbcFeSfgKmbcbhvxekcehvaraQcdtfydbgYceSmbcehvaraXcdtfydbg8AceSmbcehvaraLcdtfydbgEceSmbdna8AcdSaYcdSfaEcdSfcd6mbaKcefhvxekaKcdfhvkdnavab9kmbdndnadTmbaoaCcK2fgQIdwadIdw:tg3a3NaQIdbadIdb:tg3a3NaQIdladIdl:tg3a3NMM:raD:vaxNJbbjZMJ9VO:d86JbbjZaQIdCadIdCNaQIdxadIdxNaQIdzadIdzNMMaqN:tg3a3J9VO:d869DENh3xekaraQcdtfydbaraXcdtfydbfaraLcdtfydbfc99f:Zh3kaCakavab6a3aO9DVgQEhkavabaQEhba3aOaQEhOkaiclfhiaAcufgAmbkkaHcefgHae9hmbkkakk;bddlue99dndndnabaecitfgrydlgwciGgDci9hmbarclfhqxekinabcbawcd4gwalaDcdtfIdbabaecitfIdb:tgkJbbbb9FEgDaecefgefadaialavaoz:fjjjbak:laoIdb9FTmdabaDaw7aefgecitfgrydlgwciGgDci9hmbkarclfhqkabaecitfhecuhbindnaiaeydbgDfRbbmbadaDcK2fgrIdwalIdw:tgkakNarIdbalIdb:tgkakNarIdlalIdl:tgkakNMM:rgkaoIdb9DTmbaoakUdbavaDBdbaqydbhwkaecwfheabcefgbawcd46mbkkk;yleoudnaladfgkRbbcFeSalaefgxRbbgmcFeSfabydwgPfalaifgsRbbcFeSfaD0abydxaq9pVgzce9hmbavawcltfgmab8Pdb83dbamcwfabcwfgm8Pdb83dbdndnamydbmbcbhqxekcbhDaohminalamabydbcdtfydbfcFe86bbamclfhmaDcefgDabydwgq6mbkkdnabydxglci2gDabydlgmfgPciGTmbaraPfcbalamcu7fciGcefz:njjjb8Aabydxci2hDabydlhmabydwhqkab9cb83dwababydbaqfBdbabaDcifc98GamfBdlaxRbbhmcbhPkdnamcFeGcFe9hmbaxaP86bbababydwgmcefBdwaoabydbcdtfamcdtfaeBdbkdnakRbbcFe9hmbakabydw86bbababydwgmcefBdwaoabydbcdtfamcdtfadBdbkdnasRbbcFe9hmbasabydw86bbababydwgmcefBdwaoabydbcdtfamcdtfaiBdbkarabydlfabydxci2faxRbb86bbarabydlfabydxci2fcefakRbb86bbarabydlfabydxci2fcdfasRbb86bbababydxcefBdxazk;Ckovud99euv99eul998Jjjjjbc:G;ae9Rgo8KjjjjbdndnadTmbavcd4hrcbhwcbhDindnaiaeclfydbar2cdtfgvIdbaiaeydbar2cdtfgqIdbgk:tgxaiaecwfydbar2cdtfgmIdlaqIdlgP:tgsNamIdbak:tgzavIdlaP:tgPN:tgkakNaPamIdwaqIdwgH:tgONasavIdwaH:tgHN:tgPaPNaHazNaOaxN:tgxaxNMM:rgsJbbbb9Bmbaoc:G:qefawcx2fgAakas:vUdwaAaxas:vUdlaAaPas:vUdbaocafawc8K2fgAaq8Pdb83dbaAav8Pdb83dxaAam8Pdb83dKaAcwfaqcwfydbBdbaAcCfavcwfydbBdbaAcafamcwfydbBdbawcefhwkaecxfheaDcifgDad6mbkab9cb83dbabcyf9cb83dbabcaf9cb83dbabcKf9cb83dbabczf9cb83dbabcwf9cb83dbawTmeao9cb83iKao9cb83izaoczfaocafawci2z1jjjbaoIdKhCaoIdChXaoIdzhQao9cb83iwao9cb83ibaoaoc:G:qefawz1jjjbJbbjZhkaoIdwgPJbbbbJbbjZaPaPNaoIdbgPaPNaoIdlgsasNMM:rgx:vaxJbbbb9BEgzNhxasazNhsaPazNhzaoc:G:qefheawhvinaecwfIdbaxNaeIdbazNasaeclfIdbNMMgPakaPak9DEhkaecxfheavcufgvmbkabaCUdwabaXUdlabaQUdbabaoId3UdxdndnakJ;n;m;m899FmbJbbbbhPaoc:G:qefheaocafhvinaCavcwfIdb:taecwfIdbgHNaQavIdb:taeIdbgONaXavclfIdb:taeclfIdbgLNMMaxaHNazaONasaLNMM:vgHaPaHaP9EEhPavc8KfhvaecxfheawcufgwmbkabazUd3abc8KfaxUdbabcafasUdbabcKfaCaxaPN:tUdbabcCfaXasaPN:tUdbabaQazaPN:tUdzabJbbjZakakN:t:rgkUdydndnaxJbbj:;axJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;axJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohexekcjjjj94hekabc8Ufae86bbdndnasJbbj:;asJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;asJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohvxekcjjjj94hvkabcRfav86bbdndnazJbbj:;azJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;azJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohqxekcjjjj94hqkabaq86b8SdndnaecKtcK91:YJbb;:9c:vax:t:lavcKtcK91:YJbb;:9c:vas:t:laqcKtcK91:YJbb;:9c:vaz:t:lakMMMJbb;:9cNJbbjZMgk:lJbbb9p9DTmbak:Ohexekcjjjj94hekaecFbaecFb9iEhexekabcjjj;8iBdycFbhekabae86b8Vxekab9cb83dbabcyf9cb83dbabcaf9cb83dbabcKf9cb83dbabczf9cb83dbabcwf9cb83dbkaoc:G;aef8Kjjjjbk:mvdouq99cbhi8Jjjjjbca9RglczfcwfcbBdbal9cb83izalcwfcbBdbal9cb83ibdnadTmbcbhvinaeaifhocbhrinalczfarfgwavawydbgwaoarfIdbgDaearawcx2ffIdb9DEBdbalarfgwavawydbgwaDaearawcx2ffIdb9EEBdbarclfgrcx9hmbkaicxfhiavcefgvad9hmbkkJbbbbhDcbhrcbhicbhvinaealarfydbcx2fgwIdwaealczfarfydbcx2fgoIdw:tgqaqNawIdbaoIdb:tgqaqNawIdlaoIdl:tgqaqNMMgqaDaqaD9EgwEhDavaiawEhiarclfhravcefgvci9hmbkaealczfaicdtgvfydbcx2fgrIdwaealavfydbcx2fglIdwMJbbbZNhqarIdlalIdlMJbbbZNhkarIdbalIdbMJbbbZNhxaD:rJbbbZNhDdnadTmbindnaecwfIdbgmaq:tgPaPNaeIdbgsax:tgPaPNaeclfIdbgzak:tgPaPNMMgPaDaDN9ETmbaqaDaP:rgH:vJbbbZNJbbbZMgPNamJbbjZaP:tgONMhqakaPNazaONMhkaxaPNasaONMhxaDaHMJbbbZNhDkaecxfheadcufgdmbkkabaDUdxabaqUdwabakUdlabaxUdbkjeeiu8Jjjjjbcj8W9Rgr8Kjjjjbaici2hwdnaiTmbawceawce0EhDarhiinaiaeadRbbcdtfydbBdbadcefhdaiclfhiaDcufgDmbkkabarawaladaoz:hjjjbarcj8Wf8Kjjjjbk:Ylequ8Jjjjjbcjx9Rgl8Kjjjjbcbhvalcjqfcbaiz:njjjb8AdndnadTmbcjehoaehrincuhwarhDcuhqavhkdninawakaoalcjqfaDcefRbbfRbb9RcFeGci6aoalcjqfaDRbbfRbb9RcFeGci6faoalcjqfaDcdfRbbfRbb9RcFeGci6fgxaq9mgmEhwdnammbaxce0mdkaxaqaxaq9kEhqaDcifhDadakcefgk9hmbkkaeawci2fgDcdfRbbhqaDcefRbbhxaDRbbhkaeavci2fgDcifaDawav9Rci2z:qjjjb8Aakalcjqffaocefgo86bbaxalcjqffao86bbaDcdfaq86bbaDcefax86bbaDak86bbaqalcjqffao86bbarcifhravcefgvad9hmbkalcFeaiz:njjjbhoadci2gDceaDce0EhqcbhxindnaoaeRbbgkfgwRbbgDcFe9hmbawax86bbaocjdfaxcdtfabakcdtfydbBdbaxhDaxcefhxkaeaD86bbaecefheaqcufgqmbkaxcdthDxekcbhDkabalcjdfaDz:mjjjb8Aalcjxf8Kjjjjbk9teiucbcbyd11jjbgeabcifc98GfgbBd11jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd11jjbgeabcrfc94GfgbBd11jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd11jjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd11jjbfgdBd11jjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akk:;Deludndndnadch9pmbabaeSmdaeabadfgi9Rcbadcet9R0mekabaead;8qbbxekaeab7ciGhldndndnabae9pmbdnalTmbadhvabhixikdnabciGmbadhvabhixdkadTmiabaeRbb86bbadcufhvdnabcefgiciGmbaecefhexdkavTmiabaeRbe86beadc9:fhvdnabcdfgiciGmbaecdfhexdkavTmiabaeRbd86bdadc99fhvdnabcifgiciGmbaecifhexdkavTmiabaeRbi86biabclfhiaeclfheadc98fhvxekdnalmbdnaiciGTmbadTmlabadcufgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc9:fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc99fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc98fgdfaeadfRbb86bbkadcl6mbdnadc98fgocd4cefciGgiTmbaec98fhlabc98fhvinavadfaladfydbBdbadc98fhdaicufgimbkkaocx6mbaec9Wfhvabc9WfhoinaoadfgicxfavadfglcxfydbBdbaicwfalcwfydbBdbaiclfalclfydbBdbaialydbBdbadc9Wfgdci0mbkkadTmdadhidnadciGglTmbaecufhvabcufhoadhiinaoaifavaifRbb86bbaicufhialcufglmbkkadcl6mdaec98fhlabc98fhvinavaifgecifalaifgdcifRbb86bbaecdfadcdfRbb86bbaecefadcefRbb86bbaeadRbb86bbaic98fgimbxikkavcl6mbdnavc98fglcd4cefcrGgdTmbavadcdt9RhvinaiaeydbBdbaeclfheaiclfhiadcufgdmbkkalc36mbinaiaeydbBdbaiaeydlBdlaiaeydwBdwaiaeydxBdxaiaeydzBdzaiaeydCBdCaiaeydKBdKaiaeyd3Bd3aecafheaicafhiavc9Gfgvci0mbkkavTmbdndnavcrGgdmbavhlxekavc94GhlinaiaeRbb86bbaicefhiaecefheadcufgdmbkkavcw6mbinaiaeRbb86bbaiaeRbe86beaiaeRbd86bdaiaeRbi86biaiaeRbl86blaiaeRbv86bvaiaeRbo86boaiaeRbr86braicwfhiaecwfhealc94fglmbkkabkkAebcjwkxebbbdbbbzNbb",J=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!=="object")return{supported:!1};var X,Y=WebAssembly.instantiate($(Z),{}).then(function(U){X=U.instance,X.exports.__wasm_call_ctors()});function $(U){var w=new Uint8Array(U.length);for(var L=0;L<U.length;++L){var O=U.charCodeAt(L);w[L]=O>96?O-97:O>64?O-39:O+4}var N=0;for(var L=0;L<U.length;++L)w[N++]=w[L]<60?J[w[L]]:(w[L]-60)*64+w[++L];return w.buffer.slice(0,N)}function Q(U){if(!U)throw new Error("Assertion failed")}function W(U){return new Uint8Array(U.buffer,U.byteOffset,U.byteLength)}var K=48,G=16;function H(U,w){var L=U.meshlets[w*4+0],O=U.meshlets[w*4+1],N=U.meshlets[w*4+2],M=U.meshlets[w*4+3];return{vertices:U.vertices.subarray(L,L+N),triangles:U.triangles.subarray(O,O+M*3)}}function z(U,w,L,O,N,M,j){var P=X.exports.sbrk,D=X.exports.meshopt_buildMeshletsBound(U.length,N,M),C=P(D*G),k=P(D*N*4),T=P(D*M*3),x=P(U.byteLength),S=P(w.byteLength),h=new Uint8Array(X.exports.memory.buffer);h.set(W(U),x),h.set(W(w),S);var I=X.exports.meshopt_buildMeshlets(C,k,T,x,U.length,S,L,O,N,M,j);h=new Uint8Array(X.exports.memory.buffer);var v=h.subarray(C,C+I*G),A=new Uint32Array(v.buffer,v.byteOffset,v.byteLength/4).slice();for(var p=0;p<I;++p){var n=A[p*4+0],o=A[p*4+1],L=A[p*4+2],X0=A[p*4+3];X.exports.meshopt_optimizeMeshlet(k+n*4,T+o,X0,L)}var Q0=A[(I-1)*4+0],E0=A[(I-1)*4+1],I0=A[(I-1)*4+2],a0=A[(I-1)*4+3],I8=Q0+I0,s1=E0+(a0*3+3&-4),l4={meshlets:A,vertices:new Uint32Array(h.buffer,k,I8).slice(),triangles:new Uint8Array(h.buffer,T,s1*3).slice(),meshletCount:I};return P(C-P(0)),l4}function q(U){var w=new Float32Array(X.exports.memory.buffer,U,K/4);return{centerX:w[0],centerY:w[1],centerZ:w[2],radius:w[3],coneApexX:w[4],coneApexY:w[5],coneApexZ:w[6],coneAxisX:w[7],coneAxisY:w[8],coneAxisZ:w[9],coneCutoff:w[10]}}function V(U,w,L,O){var N=X.exports.sbrk,M=[],j=N(w.byteLength),P=N(U.vertices.byteLength),D=N(U.triangles.byteLength),C=N(K),k=new Uint8Array(X.exports.memory.buffer);k.set(W(w),j),k.set(W(U.vertices),P),k.set(W(U.triangles),D);for(var T=0;T<U.meshletCount;++T){var x=U.meshlets[T*4+0],S=U.meshlets[T*4+0+1],h=U.meshlets[T*4+0+3];X.exports.meshopt_computeMeshletBounds(C,P+x*4,D+S,h,j,L,O),M.push(q(C))}return N(j-N(0)),M}function F(U,w,L,O){var N=X.exports.sbrk,M=N(K),j=N(U.byteLength),P=N(w.byteLength),D=new Uint8Array(X.exports.memory.buffer);D.set(W(U),j),D.set(W(w),P),X.exports.meshopt_computeClusterBounds(M,j,U.length,P,L,O);var C=q(M);return N(M-N(0)),C}return{ready:Y,supported:!0,buildMeshlets:function(U,w,L,O,N,M){Q(U.length%3==0),Q(w instanceof Float32Array),Q(w.length%L==0),Q(L>=3),Q(O<=255||O>0),Q(N<=512),Q(N%4==0),M=M||0;var j=U.BYTES_PER_ELEMENT==4?U:new Uint32Array(U);return z(j,w,w.length/L,L*4,O,N,M)},computeClusterBounds:function(U,w,L){Q(U.length%3==0),Q(U.length/3<=512),Q(w instanceof Float32Array),Q(w.length%L==0),Q(L>=3);var O=U.BYTES_PER_ELEMENT==4?U:new Uint32Array(U);return F(O,w,w.length/L,L*4)},computeMeshletBounds:function(U,w,L){return Q(U.meshletCount!=0),Q(w instanceof Float32Array),Q(w.length%L==0),Q(L>=3),V(U,w,w.length/L,L*4)},extractMeshlet:function(U,w){return Q(w>=0&&w<U.meshletCount),H(U,w)}}}();var sQ={OPTIMIZED_DIR:".optimized",CHECKSUM_EXT:".md5",DIRECTORIES:[(()=>{try{return a5.dirname(u.resolve("/Users/arkdev/Desktop/HYTOPIA/hytopia/assets/release/index.js"))}catch{return null}})(),a5.resolve(process.cwd(),"assets")].filter(Boolean),OPTIMIZER_RUNS:[{suffix:"",options:["--compress","false","--instance","false","--simplify","false"]},{suffix:"-named-nodes",options:["--compress","false","--instance","false","--simplify","false","--join","true","--join-named","false"]}]};class R5{static instance=new R5;optimize=!0;optimizeEveryStart=!1;_modelUriDocuments=new Map;_modelUriBoundingBoxes=new Map;_modelUriNodeNames=new Map;_modelUriTrimeshes=new Map;constructor(){}async preloadModels(){let Z=await this._getAbsoluteModelPaths();console.log(`ModelRegistry.preloadModels(): Preloading ${Z.length} models...`);for(let J of Z){if(this.optimize)await this._resolveOptimizedModelPath(J);await this._loadModelData(J)}console.log(`ModelRegistry.preloadModels(): Preloaded ${Z.length} models!`)}getAnimationNames(Z){let J=this._modelUriDocuments.get(Z);if(!J)m.fatalError(`ModelRegistry.getAnimationNames(): Model ${Z} not found!`);return J.getRoot().listAnimations().map((Y)=>Y.getName())}getBoundingBox(Z){let J=this._modelUriBoundingBoxes.get(Z);if(!J)m.fatalError(`ModelRegistry.getBoundingBox(): Model ${Z} not found!`);return J}getDepth(Z){let J=this.getBoundingBox(Z);return J.max.z-J.min.z}getHeight(Z){let J=this.getBoundingBox(Z);return J.max.y-J.min.y}getNodeNames(Z){let J=this._modelUriNodeNames.get(Z);if(!J)m.fatalError(`ModelRegistry.getNodeNames(): Model ${Z} not found!`);return J}getTrimesh(Z,J=1){let X=this._modelUriTrimeshes.get(Z);if(!X){m.error(`ModelRegistry.getTrimesh(): Model ${Z} not found!`);return}let Y=X.vertices;if(J!==1){Y=new Float32Array(Y.length);for(let $=0;$<Y.length;$++)Y[$]=X.vertices[$]*J}return{vertices:Y,indices:X.indices}}getWidth(Z){let J=this.getBoundingBox(Z);return J.max.x-J.min.x}modelHasNode(Z,J){let X=this._modelUriNodeNames.get(Z);if(!X)m.fatalError(`ModelRegistry.modelHasNode(): Model ${Z} not found!`);return X.includes(J)}_absoluteModelPathToModelUri(Z){let J=a5.normalize(Z);for(let X of sQ.DIRECTORIES){let Y=a5.normalize(X);if(J.startsWith(Y))return a5.relative(Y,J).replace(/\\/g,"/")}return a5.basename(J)}async _getAbsoluteModelPaths(){let Z=[];for(let J of sQ.DIRECTORIES){let X=a5.resolve(process.cwd(),J);if(!PJ.existsSync(X))continue;let Y=await EU("**/*.{gltf,glb}",{cwd:X,follow:!0});for(let $ of Y)Z.push(a5.join(X,$))}return Z}async _loadModelData(Z){let J=await new ID().read(Z),X=Qa(J.getRoot().listScenes()[0]),Y=J.getRoot().listNodes().map((Q)=>Q.getName()),$=this._absoluteModelPathToModelUri(Z);this._modelUriDocuments.set($,J),this._modelUriBoundingBoxes.set($,{min:{x:X.min[0],y:X.min[1],z:X.min[2]},max:{x:X.max[0],y:X.max[1],z:X.max[2]}}),this._modelUriNodeNames.set($,Y),this._modelUriTrimeshes.set($,await this._buildTrimesh($))}async _resolveOptimizedModelPath(Z){let J=this._buildOptimizedModelPath(Z);if(!this.optimizeEveryStart&&this._isOptimizedVersionValid(Z))return J;return await this._optimizeModel(Z,J)}_isOptimizedVersionValid(Z){let J=`${this._buildOptimizedModelPath(Z)}${sQ.CHECKSUM_EXT}`;if(!PJ.existsSync(J))return!1;let X=this._calculateChecksum(Z),Y=PJ.readFileSync(J,"utf8");return X===Y}_calculateChecksum(Z){if(!PJ.existsSync(Z))return"";let J=PJ.readFileSync(Z);return $O1.createHash("sha256").update(J.toString("base64")).digest("hex")}_buildOptimizedModelPath(Z){let J=a5.basename(Z),X=J.replace(/\.[^/.]+$/,""),Y=a5.dirname(Z),$=a5.join(Y,sQ.OPTIMIZED_DIR,X);return a5.join($,J)}async _buildTrimesh(Z,J=1,X=0.001){let Y=this._modelUriDocuments.get(Z);if(!Y)m.fatalError(`ModelRegistry._buildTrimesh(): Model ${Z} not found!`);let $=Ya(Y);$.setLogger(new O5(ZG.WARN)),await $.transform(gn({pivot:"center"}),$a(),Wa(),kC(),qa({simplifier:Va,ratio:J,error:X}),Ja());for(let H of $.getRoot().listScenes())for(let z of H.listChildren())en(z);let Q=$.getRoot().listMeshes()[0];if(!Q){m.error(`ModelRegistry._buildTrimesh(): Model ${Z} has no root mesh!`);return}let W=Q.listPrimitives()[0];if(!W){m.error(`ModelRegistry._buildTrimesh(): Model ${Z} has no root primitive!`);return}let K=W.getAttribute("POSITION"),G=W.getIndices();if(!K||!G){m.error(`ModelRegistry._buildTrimesh(): Model ${Z} missing required geometry data!`);return}return{vertices:K.getArray(),indices:G.getArray()}}async _optimizeModel(Z,J){let X=a5.dirname(J);PJ.rmSync(X,{recursive:!0,force:!0}),PJ.mkdirSync(X,{recursive:!0}),console.log(`ModelRegistry: Optimizing model ${this._absoluteModelPathToModelUri(Z)}...`);for(let Y of sQ.OPTIMIZER_RUNS){let $=J.replace(/(\.[^/.]+)$/,`${Y.suffix}$1`),{stderr:Q}=await jd("npx",["gltf-transform","optimize",Z,$,...Y.options]);if(Q)return m.warning(`ModelRegistry._optimizeModel(): Error optimizing model ${this._absoluteModelPathToModelUri(Z)}, defaulting to unoptimized model. Error: ${Q}`),Z}return PJ.writeFileSync(`${J}${sQ.CHECKSUM_EXT}`,this._calculateChecksum(Z)),J}}var kG;(($)=>{$.DYNAMIC="dynamic";$.FIXED="fixed";$.KINEMATIC_POSITION="kinematic_position";$.KINEMATIC_VELOCITY="kinematic_velocity"})(kG||={});var IC=0.001,Fa="dynamic";class NY extends w0{_additionalMass=0;_colliders=new Set;_explicitSleep=!1;_enabledPositions={x:!0,y:!0,z:!0};_enabledRotations={x:!0,y:!0,z:!0};_rigidBody;_rigidBodyDesc;_rigidBodyType;_simulation;constructor(Z){super();Z.type??=Fa,this._rigidBodyDesc=this._createRigidBodyDesc(Z),this._rigidBodyType=Z.type,this._applyRigidBodyOptions(Z),this._autoAddToSimulation(Z)}get additionalMass(){if(!this._requireNotRemoved("additionalMass"))return 0;return this._additionalMass}get additionalSolverIterations(){if(!this._requireNotRemoved("additionalSolverIterations"))return 0;return this._rigidBody?this._rigidBody.additionalSolverIterations():this._rigidBodyDesc.additionalSolverIterations}get angularDamping(){if(!this._requireNotRemoved("angularDamping"))return 0;return this._rigidBody?this._rigidBody.angularDamping():this._rigidBodyDesc.angularDamping}get angularVelocity(){if(!this._requireNotRemoved("angularVelocity"))return{x:0,y:0,z:0};return this._rigidBody?this._rigidBody.angvel():this._rigidBodyDesc.angvel}get colliders(){return this._colliders}get dominanceGroup(){if(!this._requireNotRemoved("dominanceGroup"))return 0;return this._rigidBody?this._rigidBody.dominanceGroup():this._rigidBodyDesc.dominanceGroup}get directionFromRotation(){let{x:Z,y:J,z:X,w:Y}=this.rotation;return{x:-2*(Z*X+Y*J),y:-2*(J*X-Y*Z),z:-(1-2*(Z*Z+J*J))}}get effectiveAngularInertia(){if(!this._requireNotRemoved("effectiveAngularInertia"))return;return this._rigidBody?this._rigidBody.effectiveAngularInertia():void 0}get effectiveInverseMass(){if(!this._requireNotRemoved("effectiveInverseMass"))return;return this._rigidBody?this._rigidBody.effectiveInvMass():void 0}get effectiveWorldInversePrincipalAngularInertiaSqrt(){if(!this._requireNotRemoved("effectiveWorldInversePrincipalAngularInertiaSqrt"))return;return this._rigidBody?this._rigidBody.effectiveWorldInvInertiaSqrt():void 0}get enabledRotations(){if(!this._requireNotRemoved("enabledRotations"))return{x:!0,y:!0,z:!0};return this._enabledRotations}get enabledPositions(){if(!this._requireNotRemoved("enabledPositions"))return{x:!0,y:!0,z:!0};return this._enabledPositions}get gravityScale(){if(!this._requireNotRemoved("gravityScale"))return 0;return this._rigidBody?this._rigidBody.gravityScale():this._rigidBodyDesc.gravityScale}get inverseMass(){if(!this._requireNotRemoved("inverseMass"))return;return this._rigidBody?this._rigidBody.invMass():void 0}get inversePrincipalAngularInertiaSqrt(){if(!this._requireNotRemoved("inversePrincipalAngularInertiaSqrt"))return;return this._rigidBody?this._rigidBody.invPrincipalInertiaSqrt():void 0}get isCcdEnabled(){if(!this._requireNotRemoved("isCcdEnabled"))return!1;return this._rigidBody?this._rigidBody.isCcdEnabled():this._rigidBodyDesc.ccdEnabled}get isDynamic(){if(!this._requireNotRemoved("isDynamic"))return!1;return this._rigidBodyType==="dynamic"}get isEnabled(){if(!this._requireNotRemoved("isEnabled"))return!1;return this._rigidBody?this._rigidBody.isEnabled():this._rigidBodyDesc.enabled}get isFixed(){if(!this._requireNotRemoved("isFixed"))return!1;return this._rigidBodyType==="fixed"}get isKinematic(){if(!this._requireNotRemoved("isKinematic"))return!1;return["kinematic_position","kinematic_velocity"].includes(this._rigidBodyType)}get isKinematicPositionBased(){if(!this._requireNotRemoved("isKinematicPositionBased"))return!1;return this._rigidBodyType==="kinematic_position"}get isKinematicVelocityBased(){if(!this._requireNotRemoved("isKinematicVelocityBased"))return!1;return this._rigidBodyType==="kinematic_velocity"}get isMoving(){if(!this._requireNotRemoved("isMoving"))return!1;return this._rigidBody?this._rigidBody.isMoving():!1}get isRemoved(){return!this._rigidBody&&!this._rigidBodyDesc}get isSimulated(){if(!this._requireNotRemoved("isSimulated"))return!1;return this._rigidBody?!0:!1}get isSleeping(){if(!this._requireNotRemoved("isSleeping"))return!1;return this._rigidBody?this._rigidBody.isSleeping():this._rigidBodyDesc.sleeping}get linearDamping(){if(!this._requireNotRemoved("linearDamping"))return 0;return this._rigidBody?this._rigidBody.linearDamping():this._rigidBodyDesc.linearDamping}get linearVelocity(){if(!this._requireNotRemoved("linearVelocity"))return{x:0,y:0,z:0};return this._rigidBody?this._rigidBody.linvel():this._rigidBodyDesc.linvel}get localCenterOfMass(){if(!this._requireNotRemoved("localCenterOfMass"))return{x:0,y:0,z:0};return this._rigidBody?this._rigidBody.localCom():this._rigidBodyDesc.centerOfMass}get mass(){if(!this._requireNotRemoved("mass"))return 0;return this._rigidBody?this._rigidBody.mass():this._rigidBodyDesc.mass}get nextKinematicRotation(){if(!this._requireNotRemoved("nextKinematicRotation"))return{x:0,y:0,z:0,w:1};return this._rigidBody?this._rigidBody.nextRotation():this._rigidBodyDesc.rotation}get nextKinematicPosition(){if(!this._requireNotRemoved("nextKinematicPosition"))return{x:0,y:0,z:0};return this._rigidBody?this._rigidBody.nextTranslation():this._rigidBodyDesc.translation}get numColliders(){return this._colliders.size}get principalAngularInertia(){if(!this._requireNotRemoved("principalAngularInertia"))return{x:0,y:0,z:0};return this._rigidBody?this._rigidBody.principalInertia():this._rigidBodyDesc.principalAngularInertia}get principalAngularInertiaLocalFrame(){if(!this._requireNotRemoved("principalAngularInertiaLocalFrame"))return;return this._rigidBody?this._rigidBody.principalInertiaLocalFrame():void 0}get position(){if(!this._requireNotRemoved("position"))return{x:0,y:0,z:0};return this._rigidBody?this._rigidBody.translation():this._rigidBodyDesc.translation}get rawRigidBody(){if(!this._requireNotRemoved("rawRigidBody"))return;return this._rigidBody}get rotation(){if(!this._requireNotRemoved("rotation"))return{x:0,y:0,z:0,w:1};return this._rigidBody?this._rigidBody.rotation():this._rigidBodyDesc.rotation}get softCcdPrediction(){if(!this._requireNotRemoved("softCcdPrediction"))return 0;return this._rigidBody?this._rigidBody.softCcdPrediction():this._rigidBodyDesc.softCcdPrediction}get type(){if(!this._requireNotRemoved("type"))return"dynamic";return this._rigidBodyType}get worldCenterOfMass(){if(!this._requireNotRemoved("worldCenterOfMass"))return;return this._rigidBody?this._rigidBody.worldCom():void 0}setAdditionalMass(Z){if(!this._requireDynamic("setAdditionalMass"))return;if(!this._requireNotRemoved("setAdditionalMass"))return;this._rigidBody?this._rigidBody.setAdditionalMass(Z,!this._explicitSleep):this._rigidBodyDesc.setAdditionalMass(Z)}setAdditionalMassProperties(Z){if(!this._requireDynamic("setAdditionalMassProperties"))return;if(!this._requireNotRemoved("setAdditionalMassProperties"))return;let{additionalMass:J,centerOfMass:X,principalAngularInertia:Y,principalAngularInertiaLocalFrame:$}=Z;this._rigidBody?this._rigidBody.setAdditionalMassProperties(J,X,Y,$,!this._explicitSleep):this._rigidBodyDesc.setAdditionalMassProperties(J,X,Y,$)}setAdditionalSolverIterations(Z){if(!this._requireDynamic("setAdditionalSolverIterations"))return;if(!this._requireNotRemoved("setAdditionalSolverIterations"))return;this._rigidBody?this._rigidBody.setAdditionalSolverIterations(Z):this._rigidBodyDesc.setAdditionalSolverIterations(Z)}setAngularDamping(Z){if(!this._requireDynamic("setAngularDamping"))return;if(!this._requireNotRemoved("setAngularDamping"))return;this._rigidBody?this._rigidBody.setAngularDamping(Z):this._rigidBodyDesc.setAngularDamping(Z)}setAngularVelocity(Z){if(!this._requireNotKinematicPositionBased("setAngularVelocity"))return;if(!this._requireNotRemoved("setAngularVelocity"))return;this._rigidBody?this._rigidBody.setAngvel(Z,!this._explicitSleep):this._rigidBodyDesc.setAngvel(Z)}setCcdEnabled(Z){if(!this._requireDynamic("setCcdEnabled"))return;if(!this._requireNotRemoved("setCcdEnabled"))return;this._rigidBody?this._rigidBody.enableCcd(Z):this._rigidBodyDesc.setCcdEnabled(Z)}setDominanceGroup(Z){if(!this._requireDynamic("setDominanceGroup"))return;if(!this._requireNotRemoved("setDominanceGroup"))return;this._rigidBody?this._rigidBody.setDominanceGroup(Z):this._rigidBodyDesc.setDominanceGroup(Z)}setEnabled(Z){if(!this._requireNotRemoved("setEnabled"))return;this._rigidBody?this._rigidBody.setEnabled(Z):this._rigidBodyDesc.setEnabled(Z)}setEnabledPositions(Z){if(!this._requireDynamic("setEnabledPositions"))return;if(!this._requireNotRemoved("setEnabledPositions"))return;this._rigidBody?this._rigidBody.setEnabledTranslations(Z.x,Z.y,Z.z,!this._explicitSleep):this._rigidBodyDesc.enabledTranslations(Z.x,Z.y,Z.z),this._enabledPositions=Z}setEnabledRotations(Z){if(!this._requireDynamic("setEnabledRotations"))return;if(!this._requireNotRemoved("setEnabledRotations"))return;this._rigidBody?this._rigidBody.setEnabledRotations(Z.x,Z.y,Z.z,!this._explicitSleep):this._rigidBodyDesc.enabledRotations(Z.x,Z.y,Z.z),this._enabledRotations=Z}setGravityScale(Z){if(!this._requireDynamic("setGravityScale"))return;if(!this._requireNotRemoved("setGravityScale"))return;this._rigidBody?this._rigidBody.setGravityScale(Z,!this._explicitSleep):this._rigidBodyDesc.setGravityScale(Z)}setLinearDamping(Z){if(!this._requireDynamic("setLinearDamping"))return;if(!this._requireNotRemoved("setLinearDamping"))return;this._rigidBody?this._rigidBody.setLinearDamping(Z):this._rigidBodyDesc.setLinearDamping(Z)}setLinearVelocity(Z){if(!this._requireNotKinematicPositionBased("setLinearVelocity"))return;if(!this._requireNotRemoved("setLinearVelocity"))return;this._rigidBody?this._rigidBody.setLinvel(Z,!this._explicitSleep):this._rigidBodyDesc.setLinvel(Z.x,Z.y,Z.z)}setNextKinematicRotation(Z){if(!this._requireKinematic("setNextKinematicRotation"))return;if(!this._requireNotRemoved("setNextKinematicRotation"))return;this._rigidBody?this._rigidBody.setNextKinematicRotation(Z):this._rigidBodyDesc.setRotation(Z)}setNextKinematicPosition(Z){if(!this._requireKinematic("setNextKinematicPosition"))return;if(!this._requireNotRemoved("setNextKinematicPosition"))return;this._rigidBody?this._rigidBody.setNextKinematicTranslation(Z):this._rigidBodyDesc.setTranslation(Z.x,Z.y,Z.z)}setPosition(Z){if(!this._requireNotRemoved("setPosition"))return;this._rigidBody?this._rigidBody.setTranslation(Z,!this._explicitSleep):this._rigidBodyDesc.setTranslation(Z.x,Z.y,Z.z)}setRotation(Z){if(!this._requireNotRemoved("setRotation"))return;this._rigidBody?this._rigidBody.setRotation(Z,!this._explicitSleep):this._rigidBodyDesc.setRotation(Z)}setSleeping(Z){if(!this._requireDynamic("setSleeping"))return;if(!this._requireNotRemoved("setSleeping"))return;this._rigidBody?Z?this._rigidBody.sleep():this._rigidBody.wakeUp():this._rigidBodyDesc.sleeping=Z,this._explicitSleep=Z}setSoftCcdPrediction(Z){if(!this._requireDynamic("setSoftCcdPrediction"))return;if(!this._requireNotRemoved("setSoftCcdPrediction"))return;this._rigidBody?this._rigidBody.setSoftCcdPrediction(Z):this._rigidBodyDesc.setSoftCcdPrediction(Z)}setCollisionGroupsForSolidColliders(Z){if(!this._requireNotRemoved("setCollisionGroupsForSolidColliders"))return;this._colliders.forEach((J)=>{if(J.isSensor)return;J.setCollisionGroups(Z)})}setCollisionGroupsForSensorColliders(Z){if(!this._requireNotRemoved("setCollisionGroupsForSensorColliders"))return;this._colliders.forEach((J)=>{if(!J.isSensor)return;J.setCollisionGroups(Z)})}setType(Z){if(!this._requireNotRemoved("setType"))return;let X={["dynamic"]:J1.RigidBodyType.Dynamic,["fixed"]:J1.RigidBodyType.Fixed,["kinematic_position"]:J1.RigidBodyType.KinematicPositionBased,["kinematic_velocity"]:J1.RigidBodyType.KinematicVelocityBased}[Z];if(X===void 0)return m.error(`Invalid RigidBodyType: ${Z}`);this._rigidBody?this._rigidBody.setBodyType(X,!this._explicitSleep):this._rigidBodyDesc.status=X,this._rigidBodyType=Z}addForce(Z){if(!this._requireNotRemoved("addForce"))return;if(!this._requireCreated("addForce"))return;if(!this._requireDynamic("addForce"))return;if(this._isNegligibleVector(Z))return;this._rigidBody.addForce(Z,!this._explicitSleep)}addTorque(Z){if(!this._requireNotRemoved("addTorque"))return;if(!this._requireCreated("addTorque"))return;if(!this._requireDynamic("addTorque"))return;if(this._isNegligibleVector(Z))return;this._rigidBody.addTorque(Z,!this._explicitSleep)}addChildColliderToSimulation(Z){if(!this._requireNotRemoved("addChildColliderToSimulation"))return;if(!this._requireCreated("addChildColliderToSimulation"))return;Z.addToSimulation(this._simulation,this)}addToSimulation(Z){if(!this._requireNotRemoved("addToSimulation"))return;if(this._rigidBody)return m.error("RigidBody.addToSimulation(): Rigid body already exists in the simulation!");this._simulation=Z,this._rigidBody=this._simulation.createRawRigidBody(this._rigidBodyDesc),this._colliders.forEach((J)=>{if(!J.isSimulated)J.addToSimulation(Z,this)})}applyImpulse(Z){if(!this._requireNotRemoved("applyImpulse"))return;if(!this._requireCreated("applyImpulse"))return;if(!this._requireDynamic("applyImpulse"))return;if(this._isNegligibleVector(Z))return;this._rigidBody.applyImpulse(Z,!this._explicitSleep)}applyImpulseAtPoint(Z,J){if(!this._requireNotRemoved("applyImpulseAtPoint"))return;if(!this._requireCreated("applyImpulseAtPoint"))return;if(!this._requireDynamic("applyImpulseAtPoint"))return;if(this._isNegligibleVector(Z))return;this._rigidBody.applyImpulseAtPoint(Z,J,!this._explicitSleep)}applyTorqueImpulse(Z){if(!this._requireNotRemoved("applyTorqueImpulse"))return;if(!this._requireCreated("applyTorqueImpulse"))return;if(!this._requireDynamic("applyTorqueImpulse"))return;this._rigidBody.applyTorqueImpulse(Z,!this._explicitSleep)}createAndAddChildCollider(Z){if(!this._requireNotRemoved("createAndAddChildCollider"))return null;return this._simulation?new s5({...Z,parentRigidBody:this,simulation:this._simulation}):this._createAndAddPendingChildCollider(Z)}createAndAddChildColliders(Z){let J=[];return Z.forEach((X)=>{let Y=this.createAndAddChildCollider(X);if(Y)J.push(Y)}),J}getCollidersByTag(Z){let J=[];for(let X of this._colliders)if(X.tag===Z)J.push(X);return J}linkCollider(Z){if(!this._requireNotRemoved("linkCollider"))return;if(Z.parentRigidBody!==this)return m.error("RigidBody.linkCollider(): Collider cannot be linked because it is not a child of this rigid body!");this._colliders.add(Z)}lockAllRotations(){if(!this._requireNotRemoved("lockAllRotations"))return;this.setEnabledRotations({x:!1,y:!1,z:!1})}lockAllPositions(){if(!this._requireNotRemoved("lockAllPositions"))return;this.setEnabledPositions({x:!1,y:!1,z:!1})}removeFromSimulation(){if(!this._requireNotRemoved("removeFromSimulation"))return;if(!this._rigidBody)return m.error("RigidBody.removeFromSimulation(): Rigid body does not exist in the simulation!");this._colliders.forEach((Z)=>{Z.removeFromSimulation()}),this._simulation.removeRawRigidBody(this._rigidBody),this._simulation=void 0,this._rigidBody=void 0}unlinkCollider(Z){if(!this._requireNotRemoved("unlinkCollider"))return;if(!Z.isRemoved)return m.error("RigidBody.unlinkCollider(): Collider is still simulated and therefore cannot be unlinked from this rigid body!");this._colliders.delete(Z)}resetAngularVelocity(){if(!this._requireNotRemoved("resetAngularVelocity"))return;if(!this._requireCreated("resetAngularVelocity"))return;this.setAngularVelocity({x:0,y:0,z:0})}resetForces(){if(!this._requireNotRemoved("resetForces"))return;if(!this._requireCreated("resetForces"))return;this._rigidBody.resetForces(!this._explicitSleep)}resetLinearVelocity(){if(!this._requireNotRemoved("resetLinearVelocity"))return;if(!this._requireCreated("resetLinearVelocity"))return;this.setLinearVelocity({x:0,y:0,z:0})}resetTorques(){if(!this._requireNotRemoved("resetTorques"))return;if(!this._requireCreated("resetTorques"))return;this._rigidBody.resetTorques(!this._explicitSleep)}sleep(){if(!this._requireNotRemoved("sleep"))return;this.setSleeping(!0)}wakeUp(){if(!this._requireNotRemoved("wakeUp"))return;this.setSleeping(!1)}_applyRigidBodyOptions(Z){[["additionalMass",this.setAdditionalMass.bind(this)],["additionalMassProperties",this.setAdditionalMassProperties.bind(this)],["additionalSolverIterations",this.setAdditionalSolverIterations.bind(this)],["angularDamping",this.setAngularDamping.bind(this)],["angularVelocity",this.setAngularVelocity.bind(this)],["dominanceGroup",this.setDominanceGroup.bind(this)],["ccdEnabled",this.setCcdEnabled.bind(this)],["enabled",this.setEnabled.bind(this)],["enabledPositions",this.setEnabledPositions.bind(this)],["enabledRotations",this.setEnabledRotations.bind(this)],["gravityScale",this.setGravityScale.bind(this)],["linearDamping",this.setLinearDamping.bind(this)],["linearVelocity",this.setLinearVelocity.bind(this)],["position",this.setPosition.bind(this)],["rotation",this.setRotation.bind(this)],["sleeping",this.setSleeping.bind(this)],["softCcdPrediction",this.setSoftCcdPrediction.bind(this)]].forEach(([X,Y])=>{if(X in Z)Y(Z[X])})}_autoAddToSimulation(Z){if(Z.colliders)this._createAndAddPendingChildColliders(Z.colliders);if(Z.simulation)this.addToSimulation(Z.simulation)}_createAndAddPendingChildCollider(Z){if(!this._requireNotRemoved("createAndAddPendingChildCollider"))return null;if(!this._requireNotSimulated("createAndAddPendingChildCollider"))return null;let J=new s5(Z);return this._colliders.add(J),J}_createAndAddPendingChildColliders(Z){let J=[];return Z.forEach((X)=>{let Y=this._createAndAddPendingChildCollider(X);if(Y)J.push(Y)}),J}_createRigidBodyDesc(Z){let J=Z.type??Fa;return{["dynamic"]:()=>J1.RigidBodyDesc.dynamic(),["fixed"]:()=>J1.RigidBodyDesc.fixed(),["kinematic_position"]:()=>J1.RigidBodyDesc.kinematicPositionBased(),["kinematic_velocity"]:()=>J1.RigidBodyDesc.kinematicVelocityBased()}[J]()}_requireCreated(Z){if(!this._rigidBody||!this._simulation)m.error(`RigidBody._requireCreated(): Rigid body has not been created and therefore does not support the invoked method: ${Z}()`);return!!this._rigidBody&&!!this._simulation}_requireDynamic(Z){if(!this.isDynamic)m.error(`RigidBody._requireDynamic(): Rigid body is not dynamic and therefore does not support the invoked method: ${Z}()`);return this.isDynamic}_requireKinematic(Z){if(!this.isKinematic)m.error(`RigidBody._requireKinematic(): Rigid body is not kinematic and therefore does not support the invoked method: ${Z}()`);return this.isKinematic}_requireNotKinematicPositionBased(Z){if(this.isKinematicPositionBased)m.error(`RigidBody._requireNotKinematicPositionBased(): Rigid body is kinematic position based and therefore does not support the invoked method: ${Z}()`);return!this.isKinematicPositionBased}_requireNotRemoved(Z){if(!this._rigidBody&&!this._rigidBodyDesc)m.error(`RigidBody._requireNotRemoved(): Rigid body has been removed and therefore does not support the invoked method: ${Z}()`);return!!this._rigidBody||!!this._rigidBodyDesc}_requireNotSimulated(Z){if(this.isSimulated)m.error(`RigidBody._requireNotSimulated(): Rigid body is simulated and therefore does not support the invoked method: ${Z}()`);return!this.isSimulated}_isNegligibleVector(Z){return Math.abs(Z.x)<IC&&Math.abs(Z.y)<IC&&Math.abs(Z.z)<IC}}var vC;(($)=>{$[$.Average=0]="Average";$[$.Min=1]="Min";$[$.Multiply=2]="Multiply";$[$.Max=3]="Max"})(vC||={});var EG;((z)=>{z.NONE="none";z.BALL="ball";z.BLOCK="block";z.CAPSULE="capsule";z.CONE="cone";z.CYLINDER="cylinder";z.ROUND_CYLINDER="round-cylinder";z.TRIMESH="trimesh";z.VOXELS="voxels";z.WEDGE="wedge"})(EG||={});class s5 extends w0{_collider;_colliderDesc;_onCollision;_parentRigidBody;_relativePosition={x:0,y:0,z:0};_relativeRotation={x:0,y:0,z:0,w:1};_shape;_simulation;_tag;constructor(Z){super();this._colliderDesc=this._createColliderDesc(Z),this._shape=Z.shape,this._applyColliderOptions(Z),this._autoAddToSimulation(Z)}static optionsFromBlockHalfExtents(Z){return{shape:"block",halfExtents:Z}}static optionsFromModelUri(Z,J=1,X){let Y=R5.instance.getBoundingBox(Z),$=Y.max.x-Y.min.x,Q=Y.max.y-Y.min.y,W=Y.max.z-Y.min.z,K=Math.max($,W),G=Math.min($,W),H=K/G,z=K/Q,q=K*J/2,V=(N)=>Math.max(0.01,N),F=()=>({shape:"block",halfExtents:{x:V($*J/2),y:V(Q*J/2),z:V(W*J/2)}}),U=()=>({shape:"round-cylinder",radius:V(q),halfHeight:V(Q*J/2),borderRadius:V(q*0.1)}),w=()=>{let N=R5.instance.getTrimesh(Z,J);if(!N)return;return{shape:"trimesh",vertices:N.vertices,indices:N.indices}},L=()=>({shape:"wedge",extents:{x:$*J,y:Q*J,z:W*J}}),O=()=>({shape:"capsule",radius:V(q),halfHeight:V(Q*J/2-q)});if(X)switch(X){case"block":return F();case"capsule":return O();case"round-cylinder":return U();case"trimesh":{let N=w();if(!N){m.error(`Collider.optionsFromModelUri(): Failed to create trimesh options for model ${Z}, falling back to generic shape!`);break}return N}case"wedge":return L();default:m.warning(`Collider.optionsFromModelUri(): Preferred shape ${X} is not yet supported with Collider.optionsFromModelUri(), defaulting to generic shape!`)}if(H>2)return F();if(z>1.5)return U();return O()}get bounciness(){if(!this._requireNotRemoved("bounciness"))return 0;return this._collider?this._collider.restitution():this._colliderDesc.restitution}get bouncinessCombineRule(){if(!this._requireNotRemoved("bouncinessCombineRule"))return 0;return this._collider?this._collider.restitutionCombineRule():this._colliderDesc.restitutionCombineRule}get collisionGroups(){if(!this._requireNotRemoved("collisionGroups"))return{belongsTo:[],collidesWith:[]};return this._collider?Y4.decodeRawCollisionGroups(this._collider.collisionGroups()):Y4.decodeRawCollisionGroups(this._colliderDesc.collisionGroups)}get friction(){if(!this._requireNotRemoved("friction"))return 0;return this._collider?this._collider.friction():this._colliderDesc.friction}get frictionCombineRule(){if(!this._requireNotRemoved("frictionCombineRule"))return 0;return this._collider?this._collider.frictionCombineRule():this._colliderDesc.frictionCombineRule}get isEnabled(){if(!this._requireNotRemoved("isEnabled"))return!1;return this._collider?this._collider.isEnabled():this._colliderDesc.enabled}get isRemoved(){return!this._collider&&!this._colliderDesc}get isSensor(){if(!this._requireNotRemoved("isSensor"))return!1;return this._collider?this._collider.isSensor():this._colliderDesc.isSensor}get isSimulated(){if(!this._requireNotRemoved("isSimulated"))return!1;return!!this._collider}get parentRigidBody(){if(!this._requireNotRemoved("parentRigidBody"))return;return this._parentRigidBody}get rawCollider(){if(!this._requireNotRemoved("rawCollider"))return;return this._collider}get rawShape(){if(!this._requireNotRemoved("rawShape"))return;return this._collider?this._collider.shape:this._colliderDesc.shape}get relativePosition(){if(!this._requireNotRemoved("relativePosition"))return{x:0,y:0,z:0};return this._relativePosition}get relativeRotation(){if(!this._requireNotRemoved("relativeRotation"))return{x:0,y:0,z:0,w:1};return this._relativeRotation}get shape(){if(!this._requireNotRemoved("shape"))return"none";return this._shape}get tag(){if(!this._requireNotRemoved("tag"))return;return this._tag}setBounciness(Z){if(!this._requireNotRemoved("setBounciness"))return;this._collider?this._collider.setRestitution(Z):this._colliderDesc.setRestitution(Z)}setBouncinessCombineRule(Z){if(!this._requireNotRemoved("setBouncinessCombineRule"))return;this._collider?this._collider.setRestitutionCombineRule(Z):this._colliderDesc.setRestitutionCombineRule(Z)}setCollisionGroups(Z){if(!this._requireNotRemoved("setCollisionGroups"))return;let J=Y4.buildRawCollisionGroups(Z);this._collider?this._collider.setCollisionGroups(J):this._colliderDesc.setCollisionGroups(J)}setEnabled(Z){if(!this._requireNotRemoved("setEnabled"))return;this._collider?this._collider.setEnabled(Z):this._colliderDesc.setEnabled(Z)}setFriction(Z){if(!this._requireNotRemoved("setFriction"))return;this._collider?this._collider.setFriction(Z):this._colliderDesc.setFriction(Z)}setFrictionCombineRule(Z){if(!this._requireNotRemoved("setFrictionCombineRule"))return;this._collider?this._collider.setFrictionCombineRule(Z):this._colliderDesc.setFrictionCombineRule(Z)}setMass(Z){if(!this._requireNotRemoved("setMass"))return;this._collider?this._collider.setMass(Z):this._colliderDesc.setMass(Z)}setOnCollision(Z){if(!this._requireNotRemoved("setOnCollision"))return;if(this._onCollision=Z,this.isSimulated)if(this.enableCollisionEvents(!!Z),Z)this._simulation.colliderMap.setColliderCollisionCallback(this,Z);else this._simulation.colliderMap.removeColliderCollisionCallback(this)}setRelativeRotation(Z){if(!this._requireNotRemoved("setRelativeRotation"))return;this._relativeRotation=Z,this._collider?this._collider.parent()?this._collider.setRotationWrtParent(Z):this._collider.setRotation(Z):this._colliderDesc.setRotation(Z)}setRelativePosition(Z){if(!this._requireNotRemoved("setRelativePosition"))return;this._relativePosition=Z,this._collider?this._collider.parent()?this._collider.setTranslationWrtParent(Z):this._collider.setTranslation(Z):this._colliderDesc.setTranslation(Z.x,Z.y,Z.z)}setSensor(Z){if(!this._requireNotRemoved("setSensor"))return;this._collider?this._collider.setSensor(Z):this._colliderDesc.setSensor(Z)}setTag(Z){if(!this._requireNotRemoved("setTag"))return;this._tag=Z}setVoxel(Z,J){if(!this._requireNotRemoved("setVoxel"))return;if(!this._requireSimulated("setVoxel"))return;if(this.shape!=="voxels")return m.error("Collider.setVoxel(): Collider is not a voxels collider!");this._collider.setVoxel(Z.x,Z.y,Z.z,J)}addToSimulation(Z,J){if(!this._requireNotRemoved("addToSimulation"))return;if(!this._requireUnsimulated("addToSimulation"))return;if(J){if(!J.isSimulated)return m.error("Collider.addToSimulation(): Rigid body must be simulated before adding a collider to it!");if(J.type==="dynamic"&&this.shape==="trimesh")m.warning("Collider.addToSimulation(): Trimesh colliders are strongly discouraged to be used with dynamic rigid bodies, they will not contribute any mass!")}if(this._simulation=Z,this._parentRigidBody=J,this._collider=this._simulation.createRawCollider(this._colliderDesc,J?.rawRigidBody),this._colliderDesc=void 0,J)J.linkCollider(this);if(this._onCollision)this.setOnCollision(this._onCollision)}combineVoxelStates(Z){if(!this._requireNotRemoved("combineVoxelStates"))return;if(!this._requireSimulated("combineVoxelStates"))return;if(!Z.isSimulated)return m.error("Collider.combineVoxelStates(): Other collider is not simulated!");if(this.shape!=="voxels")return m.error("Collider.combineVoxelStates(): Collider is not a voxels collider!");if(Z.shape!=="voxels")return m.error("Collider.combineVoxelStates(): Other collider is not a voxels collider!");this._collider.combineVoxelStates(Z.rawCollider,0,0,0)}enableCollisionEvents(Z){if(!this._requireNotRemoved("enableCollisionEvents"))return;let J=this._collider?this._collider.activeEvents():this._colliderDesc.activeEvents,X=Z?J|J1.ActiveEvents.COLLISION_EVENTS:J&~J1.ActiveEvents.COLLISION_EVENTS;(this._collider??this._colliderDesc).setActiveEvents(X),this._setActiveCollisionTypes()}enableContactForceEvents(Z){if(!this._requireNotRemoved("enableContactForceEvents"))return;let J=this._collider?this._collider.activeEvents():this._colliderDesc.activeEvents,X=Z?J|J1.ActiveEvents.CONTACT_FORCE_EVENTS:J&~J1.ActiveEvents.CONTACT_FORCE_EVENTS;(this._collider??this._colliderDesc).setActiveEvents(X),this._setActiveCollisionTypes()}propagateVoxelChange(Z,J){if(!this._requireNotRemoved("propagateVoxelChange"))return;if(!this._requireSimulated("propagateVoxelChange"))return;if(!Z.isSimulated)return m.error("Collider.propagateVoxelChange(): Other collider is not simulated!");if(this.shape!=="voxels")return m.error("Collider.propagateVoxelChange(): Collider is not a voxels collider!");if(Z.shape!=="voxels")return m.error("Collider.propagateVoxelChange(): Other collider is not a voxels collider!");this._collider.propagateVoxelChange(Z.rawCollider,J.x,J.y,J.z,0,0,0)}removeFromSimulation(){if(!this._requireNotRemoved("removeFromSimulation"))return;if(!this._requireSimulated("removeFromSimulation"))return;if(this._simulation.removeRawCollider(this._collider),this._simulation=void 0,this._collider=void 0,this._parentRigidBody)this._parentRigidBody.unlinkCollider(this);this._parentRigidBody=void 0}scale(Z){if(!this._requireNotRemoved("scale"))return;switch(this.setRelativePosition({x:this.relativePosition.x*Z,y:this.relativePosition.y*Z,z:this.relativePosition.z*Z}),this._shape){case"ball":{if(this._collider)this._collider.setRadius(this._collider.radius()*Z);else this._colliderDesc.shape.radius*=Z;return}case"block":{if(this._collider){let J=this._collider.halfExtents();this._collider.setHalfExtents({x:J.x*Z,y:J.y*Z,z:J.z*Z})}else this._colliderDesc.shape.halfExtents.x*=Z,this._colliderDesc.shape.halfExtents.y*=Z,this._colliderDesc.shape.halfExtents.z*=Z;return}case"capsule":{if(this._collider)this._collider.setHalfHeight(this._collider.halfHeight()*Z),this._collider.setRadius(this._collider.radius()*Z);else this._colliderDesc.shape.halfHeight*=Z,this._colliderDesc.shape.radius*=Z;return}case"cone":{if(this._collider)this._collider.setHalfHeight(this._collider.halfHeight()*Z),this._collider.setRadius(this._collider.radius()*Z);else this._colliderDesc.shape.halfHeight*=Z,this._colliderDesc.shape.radius*=Z;return}case"cylinder":{if(this._collider)this._collider.setHalfHeight(this._collider.halfHeight()*Z),this._collider.setRadius(this._collider.radius()*Z);else this._colliderDesc.shape.halfHeight*=Z,this._colliderDesc.shape.radius*=Z;return}case"round-cylinder":{if(this._collider)this._collider.setHalfHeight(this._collider.halfHeight()*Z),this._collider.setRoundRadius(this._collider.roundRadius()*Z),this._collider.setRadius(this._collider.radius()*Z);else this._colliderDesc.shape.halfHeight=this._colliderDesc.shape.halfHeight*Z,this._colliderDesc.shape.borderRadius=this._colliderDesc.shape.borderRadius*Z,this._colliderDesc.shape.radius=this._colliderDesc.shape.radius*Z;return}case"trimesh":{m.error("Collider.setScale(): Trimesh colliders cannot be scaled!");return}case"voxels":{m.error("Collider.setScale(): Voxels colliders cannot be scaled!");return}case"wedge":{m.error("Collider.setScale(): Wedge colliders cannot be scaled!");return}default:m.fatalError(`Collider.setScale(): ${this._shape} is not a valid collider shape!`)}}_applyColliderOptions(Z){[["bounciness",this.setBounciness.bind(this)],["bouncinessCombineRule",this.setBouncinessCombineRule.bind(this)],["collisionGroups",this.setCollisionGroups.bind(this)],["enabled",this.setEnabled.bind(this)],["friction",this.setFriction.bind(this)],["frictionCombineRule",this.setFrictionCombineRule.bind(this)],["isSensor",this.setSensor.bind(this)],["mass",this.setMass.bind(this)],["onCollision",this.setOnCollision.bind(this)],["relativePosition",this.setRelativePosition.bind(this)],["relativeRotation",this.setRelativeRotation.bind(this)],["tag",this.setTag.bind(this)]].forEach(([X,Y])=>{if(Z[X]!==void 0)Y.call(this,Z[X])})}_autoAddToSimulation(Z){if(Z.simulation)this.addToSimulation(Z.simulation,Z.parentRigidBody)}_buildWedgeConvexHullVertices(Z){let{x:J,y:X,z:Y}=Z,$=J/2,Q=Y/2,W=X/2;return new Float32Array([-$,0-W,-Q,$,0-W,-Q,$,0-W,Q,-$,0-W,Q,-$,X-W,-Q,$,X-W,-Q])}_createColliderDesc(Z){let{shape:J,flags:X}=Z;switch(J){case"ball":{if(!Z.radius)m.fatalError("Ball collider must have a radius!");return J1.ColliderDesc.ball(Z.radius)}case"block":{if(!Z.halfExtents)m.fatalError("Block collider must have halfExtents!");return J1.ColliderDesc.cuboid(Z.halfExtents.x,Z.halfExtents.y,Z.halfExtents.z)}case"capsule":{if(!Z.halfHeight||!Z.radius)m.fatalError("Capsule collider must have halfHeight and radius!");return J1.ColliderDesc.capsule(Z.halfHeight,Z.radius)}case"cone":{if(!Z.radius||!Z.halfHeight)m.fatalError("Cone collider must have radius and halfHeight!");return J1.ColliderDesc.cone(Z.halfHeight,Z.radius)}case"cylinder":{if(!Z.radius||!Z.halfHeight)m.fatalError("Cylinder collider must have radius and halfHeight!");return J1.ColliderDesc.cylinder(Z.halfHeight,Z.radius)}case"round-cylinder":{if(!Z.radius||!Z.halfHeight||!Z.borderRadius)m.fatalError("Round cylinder collider must have radius, halfHeight, and borderRadius!");return J1.ColliderDesc.roundCylinder(Z.halfHeight,Z.radius,Z.borderRadius)}case"trimesh":{if(!Z.indices||!Z.vertices)m.fatalError("Trimesh collider must have vertices and indices!");return J1.ColliderDesc.trimesh(Z.vertices,Z.indices,X)}case"voxels":{if(!Z.coordinates||!Z.size)m.fatalError("Voxels collider must have coordinates and size!");return J1.ColliderDesc.voxels(this._coordinatesToInt32Array(Z.coordinates),Z.size)}case"wedge":{if(!Z.extents)m.fatalError("Wedge collider must have extents!");let Y=this._buildWedgeConvexHullVertices(Z.extents),$=J1.ColliderDesc.convexHull(Y);if(!$)throw m.fatalError("Failed to create convex hull for wedge collider!"),new Error("Convex hull creation failed");return $}default:m.fatalError(`Collider._createColliderDesc(): ${J} is not a valid collider shape!`)}}_requireSimulated(Z){if(!this.isSimulated)m.error(`Collider._requireSimulated(): Collider is not simulated, invoked method: ${Z}()`);return this.isSimulated}_requireUnsimulated(Z){if(this.isSimulated)m.error(`Collider._requireUnsimulated(): Collider is already simulated, invoked method: ${Z}()`);return!this.isSimulated}_requireNotRemoved(Z){if(this.isRemoved)m.error(`Collider._requireNotRemoved(): Collider is removed, invoked method: ${Z}()`);return!this.isRemoved}_setActiveCollisionTypes(){(this._collider??this._colliderDesc).setActiveCollisionTypes(J1.ActiveCollisionTypes.DYNAMIC_DYNAMIC|J1.ActiveCollisionTypes.DYNAMIC_KINEMATIC|J1.ActiveCollisionTypes.DYNAMIC_FIXED|J1.ActiveCollisionTypes.KINEMATIC_KINEMATIC|J1.ActiveCollisionTypes.KINEMATIC_FIXED)}_coordinatesToInt32Array(Z){let J=new Int32Array(Z.length*3);for(let X=0;X<Z.length;X++){let Y=Z[X],$=X*3;J[$]=Math.floor(Y.x),J[$+1]=Math.floor(Y.y),J[$+2]=Math.floor(Y.z)}return J}}var QO1={shape:"voxels"},SC;((X)=>{X.ENTITY_COLLISION="BLOCK_TYPE.ENTITY_COLLISION";X.ENTITY_CONTACT_FORCE="BLOCK_TYPE.ENTITY_CONTACT_FORCE"})(SC||={});class o5 extends w0{_id;_blockTypeRegistry;_customColliderOptions;_halfExtents;_isLiquid;_name;_textureUri;constructor(Z,J={id:-1,textureUri:"textures/missing.png",name:"Unknown"}){if(J.id<0)m.fatalError("BlockType.constructor(): BlockType id not set.");super();this._id=J.id,this._blockTypeRegistry=Z,this._customColliderOptions=J.customColliderOptions,this._halfExtents=J.halfExtents??{x:0.5,y:0.5,z:0.5},this._isLiquid=J.isLiquid??!1,this._name=J.name,this._textureUri=J.textureUri}get id(){return this._id}get blockTypeRegistry(){return this._blockTypeRegistry}get colliderOptions(){return{...this._customColliderOptions,...QO1}}get halfExtents(){return this._halfExtents}get isLiquid(){return this._isLiquid}get isMeshable(){return!this._customColliderOptions}get name(){return this._name}get size(){return{x:this._halfExtents.x*2,y:this._halfExtents.y*2,z:this._halfExtents.z*2}}get textureUri(){return this._textureUri}createCollider(Z){let J=new s5({...this.colliderOptions,coordinates:Z,size:this.size});if(this.isLiquid)J.setSensor(!0);if(this.hasListeners("BLOCK_TYPE.ENTITY_COLLISION")||this.isLiquid)J.enableCollisionEvents(!0);if(this.hasListeners("BLOCK_TYPE.ENTITY_CONTACT_FORCE"))J.enableContactForceEvents(!0);if(Y4.isDefaultCollisionGroups(J.collisionGroups))J.setCollisionGroups({belongsTo:[1],collidesWith:[65535&~1]});return J}serialize(){return j0.serializeBlockType(this,this._blockTypeRegistry.world.tickAllocator)}}var _C;((J)=>J.REGISTER_BLOCK_TYPE="BLOCK_TYPE_REGISTRY.REGISTER_BLOCK_TYPE")(_C||={});class IG extends w0{_blockTypes=new Map;_world;constructor(Z){super();this._world=Z}get world(){return this._world}getAllBlockTypes(Z=!1){return Z?this._world.tickAllocator.getArray(this._blockTypes.values()):Array.from(this._blockTypes.values())}getBlockType(Z){let J=this._blockTypes.get(Z);if(!J)m.fatalError(`BlockTypeRegistry.getBlockType(): BlockType with id ${Z} not found.`);return J}registerGenericBlockType(Z){let X=new class extends o5{constructor(Y,$){super(Y,$)}}(this,Z);return this.registerBlockType(X),X}registerBlockType(Z){this._blockTypes.set(Z.id,Z),this.emitWithWorld(this._world,"BLOCK_TYPE_REGISTRY.REGISTER_BLOCK_TYPE",{blockTypeRegistry:this,id:Z.id,blockType:Z})}serialize(){return j0.serializeBlockTypeRegistry(this,this._world.tickAllocator)}}var Hk={};p4(Hk,{worldSchema:()=>Gk,worldPacketDefinition:()=>Ke,vectorSchema:()=>W1,vectorBooleanSchema:()=>YT1,uiSchema:()=>Wk,uiPacketDefinition:()=>Qe,uiDatasSchema:()=>Kk,uiDatasPacketDefinition:()=>We,uiDataSendPacketDefinition:()=>lt,uiDataSchema:()=>eG,syncResponseSchema:()=>Qk,syncResponsePacketDefinition:()=>$e,syncRequestSchema:()=>AT,syncRequestPacketDefinition:()=>ct,stateRequestSchema:()=>_T,stateRequestPacketDefinition:()=>dt,sceneUIsSchema:()=>$k,sceneUIsPacketDefinition:()=>Ye,sceneUISchema:()=>Yk,rgbColorSchema:()=>v6,registeredPackets:()=>kL,quaternionSchema:()=>pT,playersSchema:()=>Xk,playersPacketDefinition:()=>Xe,playerSchema:()=>Jk,physicsDebugRenderSchema:()=>Zk,physicsDebugRenderPacketDefinition:()=>Ze,physicsDebugRaycastsSchema:()=>eT,physicsDebugRaycastsPacketDefinition:()=>Je,physicsDebugRaycastSchema:()=>tT,particleEmittersSchema:()=>rT,particleEmittersPacketDefinition:()=>et,particleEmitterSchema:()=>oT,outboundPackets:()=>TL,modelNodeOverrideSchema:()=>lT,lightsSchema:()=>sT,lightsPacketDefinition:()=>tt,lightSchema:()=>aT,isValidPacket:()=>QT1,inputSchema:()=>ST,inputPacketDefinition:()=>ut,inboundPackets:()=>CL,hexColorSchema:()=>IT,heartbeatSchema:()=>ET,heartbeatPacketDefinition:()=>yt,entitySchema:()=>iT,entitiesSchema:()=>nT,entitiesPacketDefinition:()=>rt,definePacket:()=>T0,debugConfigSchema:()=>vT,debugConfigPacketDefinition:()=>mt,createPacket:()=>nC1,connectionSchema:()=>kT,connectionPacketDefinition:()=>bt,chunksSchema:()=>cT,chunksPacketDefinition:()=>ot,chunkSchema:()=>dT,chatMessagesSchema:()=>uT,chatMessagesPacketDefinition:()=>st,chatMessageSendPacketDefinition:()=>gt,chatMessageSchema:()=>tG,cameraSchema:()=>mT,cameraPacketDefinition:()=>at,blocksSchema:()=>bT,blocksPacketDefinition:()=>it,blockTypesSchema:()=>gT,blockTypesPacketDefinition:()=>nt,blockTypeSchema:()=>yT,blockSchema:()=>fT,bidirectionalPackets:()=>PL,audiosSchema:()=>hT,audiosPacketDefinition:()=>pt,audioSchema:()=>xT,PacketId:()=>S1});var PL={};p4(PL,{heartbeatPacketDefinition:()=>yt,connectionPacketDefinition:()=>bt});var CT=t(ht(),1);class TT extends CT.default{static instance=new CT.default}var S1;((T)=>{T[T.SYNC_REQUEST=0]="SYNC_REQUEST";T[T.INPUT=1]="INPUT";T[T.STATE_REQUEST=2]="STATE_REQUEST";T[T.CHAT_MESSAGE_SEND=3]="CHAT_MESSAGE_SEND";T[T.UI_DATA_SEND=4]="UI_DATA_SEND";T[T.SYNC_RESPONSE=32]="SYNC_RESPONSE";T[T.AUDIOS=33]="AUDIOS";T[T.BLOCKS=34]="BLOCKS";T[T.BLOCK_TYPES=35]="BLOCK_TYPES";T[T.CHAT_MESSAGES=36]="CHAT_MESSAGES";T[T.CHUNKS=37]="CHUNKS";T[T.ENTITIES=38]="ENTITIES";T[T.WORLD=39]="WORLD";T[T.CAMERA=40]="CAMERA";T[T.UI=41]="UI";T[T.UI_DATAS=42]="UI_DATAS";T[T.SCENE_UIS=43]="SCENE_UIS";T[T.LIGHTS=44]="LIGHTS";T[T.PLAYERS=45]="PLAYERS";T[T.PARTICLE_EMITTERS=46]="PARTICLE_EMITTERS";T[T.CONNECTION=116]="CONNECTION";T[T.HEARTBEAT=117]="HEARTBEAT";T[T.DEBUG_CONFIG=128]="DEBUG_CONFIG";T[T.PHYSICS_DEBUG_RENDER=192]="PHYSICS_DEBUG_RENDER";T[T.PHYSICS_DEBUG_RAYCASTS=193]="PHYSICS_DEBUG_RAYCASTS"})(S1||={});function nC1(Z,J,X,Y){if(!Z.validate(J))throw new Error(`Invalid payload for packet with id ${Z.id}. Error: ${TT.instance.errorsText(Z.validate.errors)}`);let $=Y??[];if($[0]=Z.id,$[1]=J,typeof X==="number")$.push(X);return $}function T0(Z,J){return{id:Z,schema:J,validate:TT.instance.compile(J)}}var aC1={type:"object",properties:{i:{type:"string"}},required:["i"],additionalProperties:!1},ft={type:"object",properties:{role:{type:"string",enum:["auto","client","server"],nullable:!0},fingerprints:{type:"array",items:{type:"object",properties:{algorithm:{type:"string",enum:["sha-1","sha-224","sha-256","sha-384","sha-512"]},value:{type:"string"}},required:["algorithm","value"]}}},required:["fingerprints"],additionalProperties:!1},sC1={type:"object",properties:{foundation:{type:"string"},priority:{type:"number"},ip:{type:"string"},address:{type:"string"},protocol:{type:"string",enum:["udp","tcp"]},port:{type:"number"},type:{type:"string",enum:["host"]},tcpType:{type:"string",enum:["passive"],nullable:!0}},required:["foundation","priority","ip","address","protocol","port","type"],additionalProperties:!1},oC1={type:"object",properties:{usernameFragment:{type:"string"},password:{type:"string"},iceLite:{type:"boolean",nullable:!0}},required:["usernameFragment","password"],additionalProperties:!1},rC1={type:"object",properties:{i:{type:"string"},l:{type:"string"}},required:["i","l"],additionalProperties:!1},tC1={type:"object",properties:{port:{type:"number"},OS:{type:"number"},MIS:{type:"number"},maxMessageSize:{type:"number"}},required:["port","OS","MIS","maxMessageSize"],additionalProperties:!0},eC1={type:"object",properties:{streamId:{type:"number"},ordered:{type:"boolean",nullable:!0},maxPacketLifeTime:{type:"number",nullable:!0},maxRetransmits:{type:"number",nullable:!0}},required:["streamId"],additionalProperties:!1},ZT1={type:"object",properties:{i:{type:"string"},f:{type:"string",enum:["cs","sc"]},ip:oC1,ic:{type:"array",items:sC1},d:ft,s:tC1},required:["i","f","ip","ic","d","s"],additionalProperties:!1},JT1={type:"object",properties:{i:{type:"string"},d:ft},required:["i","d"],additionalProperties:!1},XT1={type:"object",properties:{i:{type:"string",nullable:!0},pi:{type:"string",nullable:!0},l:{type:"string"},s:eC1},required:["l","s"],additionalProperties:!1},kT={type:"object",properties:{i:{type:"string",nullable:!0},k:{type:"boolean",nullable:!0},c:{...JT1,nullable:!0},ca:{...aC1,nullable:!0},d:{type:"array",items:{...XT1},nullable:!0},pa:{...rC1,nullable:!0},t:{type:"array",items:{...ZT1},nullable:!0}},additionalProperties:!1};var bt=T0(116,kT);var ET={type:"null",nullable:!0};var yt=T0(117,ET);var CL={};p4(CL,{uiDataSendPacketDefinition:()=>lt,syncRequestPacketDefinition:()=>ct,stateRequestPacketDefinition:()=>dt,inputPacketDefinition:()=>ut,debugConfigPacketDefinition:()=>mt,chatMessageSendPacketDefinition:()=>gt});var IT={type:"string",pattern:"^[0-9A-Fa-f]{6}$"};var tG={type:"object",properties:{m:{type:"string"},c:{...IT,nullable:!0},p:{type:"string",nullable:!0}},required:["m"],additionalProperties:!1};var gt=T0(3,tG);var vT={type:"object",properties:{pdr:{type:"boolean",nullable:!0}},additionalProperties:!1};var mt=T0(128,vT);var ST={type:"object",properties:{"1":{type:"boolean",nullable:!0},"2":{type:"boolean",nullable:!0},"3":{type:"boolean",nullable:!0},"4":{type:"boolean",nullable:!0},"5":{type:"boolean",nullable:!0},"6":{type:"boolean",nullable:!0},"7":{type:"boolean",nullable:!0},"8":{type:"boolean",nullable:!0},"9":{type:"boolean",nullable:!0},"0":{type:"boolean",nullable:!0},w:{type:"boolean",nullable:!0},a:{type:"boolean",nullable:!0},s:{type:"boolean",nullable:!0},d:{type:"boolean",nullable:!0},q:{type:"boolean",nullable:!0},e:{type:"boolean",nullable:!0},r:{type:"boolean",nullable:!0},f:{type:"boolean",nullable:!0},z:{type:"boolean",nullable:!0},x:{type:"boolean",nullable:!0},c:{type:"boolean",nullable:!0},v:{type:"boolean",nullable:!0},u:{type:"boolean",nullable:!0},i:{type:"boolean",nullable:!0},o:{type:"boolean",nullable:!0},j:{type:"boolean",nullable:!0},k:{type:"boolean",nullable:!0},l:{type:"boolean",nullable:!0},n:{type:"boolean",nullable:!0},m:{type:"boolean",nullable:!0},sp:{type:"boolean",nullable:!0},sh:{type:"boolean",nullable:!0},tb:{type:"boolean",nullable:!0},ml:{type:"boolean",nullable:!0},mr:{type:"boolean",nullable:!0},cp:{type:"number",nullable:!0},cy:{type:"number",nullable:!0},sq:{type:"number",nullable:!0}},additionalProperties:!1};var ut=T0(1,ST);var _T={type:"object",properties:{},additionalProperties:!1};var dt=T0(2,_T);var AT={type:"null",nullable:!0};var ct=T0(0,AT);var eG={type:"object",properties:{},additionalProperties:!0};var lt=T0(4,eG);var TL={};p4(TL,{worldPacketDefinition:()=>Ke,uiPacketDefinition:()=>Qe,uiDatasPacketDefinition:()=>We,syncResponsePacketDefinition:()=>$e,sceneUIsPacketDefinition:()=>Ye,playersPacketDefinition:()=>Xe,physicsDebugRenderPacketDefinition:()=>Ze,physicsDebugRaycastsPacketDefinition:()=>Je,particleEmittersPacketDefinition:()=>et,lightsPacketDefinition:()=>tt,entitiesPacketDefinition:()=>rt,chunksPacketDefinition:()=>ot,chatMessagesPacketDefinition:()=>st,cameraPacketDefinition:()=>at,blocksPacketDefinition:()=>it,blockTypesPacketDefinition:()=>nt,audiosPacketDefinition:()=>pt});var W1={type:"array",items:[{type:"number"},{type:"number"},{type:"number"}],minItems:3,maxItems:3};var xT={type:"object",properties:{i:{type:"number"},a:{type:"string",nullable:!0},cd:{type:"number",nullable:!0},d:{type:"number",nullable:!0},de:{type:"number",nullable:!0},di:{type:"number",minimum:0,nullable:!0},e:{type:"number",nullable:!0},l:{type:"boolean",nullable:!0},o:{type:"number",nullable:!0},p:{...W1,nullable:!0},pa:{type:"boolean",nullable:!0},pl:{type:"boolean",nullable:!0},pr:{type:"number",minimum:0,nullable:!0},r:{type:"boolean",nullable:!0},rd:{type:"number",nullable:!0},s:{type:"number",nullable:!0},v:{type:"number",minimum:0,maximum:1,nullable:!0}},required:["i"],additionalProperties:!1};var hT={type:"array",items:{...xT}};var pt=T0(33,hT);var fT={type:"object",properties:{i:{type:"number"},c:W1},required:["i","c"],additionalProperties:!1};var bT={type:"array",items:{...fT}};var it=T0(34,bT);var yT={type:"object",properties:{i:{type:"number"},l:{type:"boolean",nullable:!0},n:{type:"string",nullable:!0},t:{type:"string",nullable:!0}},required:["i"],additionalProperties:!1};var gT={type:"array",items:{...yT}};var nt=T0(35,gT);var mT={type:"object",properties:{m:{type:"number",nullable:!0},e:{type:"number",nullable:!0},et:{type:"number",nullable:!0},fo:{type:"number",nullable:!0},ffo:{type:"number",nullable:!0},fv:{type:"number",nullable:!0},h:{type:"array",items:{type:"string"},nullable:!0},o:{...W1,nullable:!0},p:{...W1,nullable:!0},pt:{...W1,nullable:!0},pl:{...W1,nullable:!0},s:{type:"array",items:{type:"string"},nullable:!0},sa:{type:"number",nullable:!0},z:{type:"number",nullable:!0}},additionalProperties:!1};var uT={type:"array",items:{...tG}};var dT={type:"object",properties:{c:W1,b:{type:"array",items:{type:"number",minimum:0,maximum:255},minItems:4096,maxItems:4096,nullable:!0},rm:{type:"boolean",nullable:!0}},required:["c"],additionalProperties:!1};var cT={type:"array",items:{...dT}};var v6={type:"array",items:[{type:"number",minimum:0,maximum:255},{type:"number",minimum:0,maximum:255},{type:"number",minimum:0,maximum:255}],minItems:3,maxItems:3};var lT={type:"object",properties:{n:{type:"string"},h:{type:"boolean",nullable:!0},o:{type:"number",minimum:0,maximum:1,nullable:!0},r:{type:"boolean",nullable:!0},s:{type:"number",nullable:!0},t:{...v6,nullable:!0}},required:["n"],additionalProperties:!1};var pT={type:"array",items:[{type:"number"},{type:"number"},{type:"number"},{type:"number"}],minItems:4,maxItems:4};var iT={type:"object",properties:{i:{type:"number"},al:{type:"array",items:{type:"string"},nullable:!0},ao:{type:"array",items:{type:"string"},nullable:!0},ap:{type:"number",nullable:!0},as:{type:"array",items:{type:"string"},nullable:!0},bh:{...W1,nullable:!0},bt:{type:"string",nullable:!0},h:{type:"array",items:{type:"string"},nullable:!0},m:{type:"string",nullable:!0},mo:{type:"array",items:{...lT},nullable:!0},mt:{type:"string",nullable:!0},n:{type:"string",nullable:!0},o:{type:"number",nullable:!0},p:{...W1,nullable:!0},pe:{type:"number",nullable:!0},pn:{type:"string",nullable:!0},r:{...pT,nullable:!0},rm:{type:"boolean",nullable:!0},s:{type:"number",nullable:!0},sn:{type:"array",items:{type:"string"},nullable:!0},t:{...v6,nullable:!0}},required:["i"],additionalProperties:!1};var nT={type:"array",items:{...iT}};var aT={type:"object",properties:{i:{type:"number"},a:{type:"number",nullable:!0},e:{type:"number",nullable:!0},c:{...v6,nullable:!0},d:{type:"number",nullable:!0},n:{type:"number",nullable:!0},o:{...W1,nullable:!0},p:{...W1,nullable:!0},pe:{type:"number",minimum:0,maximum:1,nullable:!0},rm:{type:"boolean",nullable:!0},t:{type:"number",nullable:!0},te:{type:"number",nullable:!0},tp:{...W1,nullable:!0}},required:["i"],additionalProperties:!1};var sT={type:"array",items:{...aT}};var oT={type:"object",properties:{i:{type:"number"},at:{type:"number",nullable:!0},ce:{...v6,nullable:!0},cev:{...v6,nullable:!0},cs:{...v6,nullable:!0},csv:{...v6,nullable:!0},e:{type:"number",nullable:!0},en:{type:"string",nullable:!0},g:{...W1,nullable:!0},l:{type:"number",nullable:!0},lv:{type:"number",nullable:!0},mp:{type:"number",nullable:!0},o:{...W1,nullable:!0},oe:{type:"number",nullable:!0},oev:{type:"number",nullable:!0},os:{type:"number",nullable:!0},osv:{type:"number",nullable:!0},p:{...W1,nullable:!0},pa:{type:"boolean",nullable:!0},pv:{...W1,nullable:!0},r:{type:"number",nullable:!0},rv:{type:"number",nullable:!0},rm:{type:"boolean",nullable:!0},se:{type:"number",nullable:!0},sev:{type:"number",nullable:!0},ss:{type:"number",nullable:!0},ssv:{type:"number",nullable:!0},t:{type:"boolean",nullable:!0},tu:{type:"string",nullable:!0},v:{...W1,nullable:!0},vv:{...W1,nullable:!0}},required:["i"],additionalProperties:!1};var rT={type:"array",items:{...oT}};var tT={type:"object",properties:{o:{...W1},d:{...W1},l:{type:"number"},h:{type:"boolean"}},required:["o","d","l","h"],additionalProperties:!1};var eT={type:"array",items:{...tT}};var Zk={type:"object",properties:{v:{type:"array",items:{type:"number"}},c:{type:"array",items:{type:"number"}}},required:["v","c"],additionalProperties:!1};var Jk={type:"object",properties:{i:{type:"string"},p:{type:"string",nullable:!0},rm:{type:"boolean",nullable:!0},u:{type:"string",nullable:!0}},required:["i"],additionalProperties:!1};var Xk={type:"array",items:{...Jk}};var Yk={type:"object",properties:{i:{type:"number"},e:{type:"number",nullable:!0},o:{...W1,nullable:!0},p:{...W1,nullable:!0},rm:{type:"boolean",nullable:!0},s:{type:"object",nullable:!0},t:{type:"string",nullable:!0},v:{type:"number",nullable:!0}},required:["i"],additionalProperties:!1};var $k={type:"array",items:{...Yk}};var Qk={type:"object",properties:{r:{type:"number"},s:{type:"number"},p:{type:"number"},n:{type:"number"}},required:["r","s","p","n"],additionalProperties:!1};var Wk={type:"object",properties:{p:{type:"boolean",nullable:!0},u:{type:"string",nullable:!0}},additionalProperties:!1};var Kk={type:"array",items:{...eG}};var YT1={type:"array",items:[{type:"boolean"},{type:"boolean"},{type:"boolean"}],minItems:3,maxItems:3};var Gk={type:"object",properties:{i:{type:"number"},ac:{...v6,nullable:!0},ai:{type:"number",nullable:!0},dc:{...v6,nullable:!0},di:{type:"number",nullable:!0},dp:{...W1,nullable:!0},fc:{...v6,nullable:!0},ff:{type:"number",nullable:!0},fn:{type:"number",nullable:!0},n:{type:"string",nullable:!0},s:{type:"string",nullable:!0},si:{type:"number",nullable:!0},t:{type:"number",nullable:!0}},required:["i"],additionalProperties:!1};var at=T0(40,mT);var st=T0(36,uT);var ot=T0(37,cT);var rt=T0(38,nT);var tt=T0(44,sT);var et=T0(46,rT);var Ze=T0(192,Zk);var Je=T0(193,eT);var Xe=T0(45,Xk);var Ye=T0(43,$k);var $e=T0(32,Qk);var Qe=T0(41,Wk);var We=T0(42,Kk);var Ke=T0(39,Gk);var kL=new Map,$T1={...PL,...CL,...TL};for(let Z of Object.values($T1))if("id"in Z&&"schema"in Z){let J=Z;if(kL.has(J.id))throw new Error(`Packet with id ${J.id} is already registered.`);kL.set(J.id,J)}function QT1(Z){if(typeof Z!=="object"||Z===null||typeof Z[0]!=="number"||Z[0]<0||Z[1]===void 0||Z[2]!==void 0&&(typeof Z[2]!=="number"||Z[2]<0))return!1;let J=kL.get(Z[0]);return!!J&&J.validate(Z[1])}var Z0=Hk;var _e=t(ve(),1);import IY from"fs";import Se from"path";var JH="./dev/persistence";class F7{static instance=new F7;gameId=process.env.HYTOPIA_GAME_ID;lobbyId=process.env.HYTOPIA_LOBBY_ID;_creativeGateway;constructor(){try{this._creativeGateway=new _e.CreativeGateway}catch{console.warn(["\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501","\uD83D\uDEA8 HYTOPIA PLATFORM GATEWAY IS NOT INITIALIZED \uD83D\uDEA8","","\uD83D\uDD27 Local development is still possible, but these features will be disabled:"," \u2022 \uD83D\uDC64 Player Accounts"," \u2022 \uD83C\uDFAD Player Cosmetics"," \u2022 \uD83D\uDC1B Crash Analytics & Debug Logs","","\uD83D\uDCA1 These features will be enabled but modified:"," \u2022 \uD83D\uDCBE Player & Global Persisted Data - Data will be persisted"," locally in the ./dev/persistence directory of your project."," Player ids for data persistence will begin at 1 for the first "," player to join your local server, and increments for each"," additional player. This means that if you restart your"," server, the first player id will be 1 again. This is to ensure"," that data persistence across server restarts can be easily"," tested and debugged in local development.","","To enable the HYTOPIA Platform Gateway locally:"," 1. Set these environment variables:"," HYTOPIA_API_KEY, HYTOPIA_GAME_ID, HYTOPIA_LOBBY_ID"," 2. You can find these values at: https://create.hytopia.com","","Note: In production, these environment variables will be auto-populated ","& the HYTOPIA Platform Gateway will automatically be initialized \uD83D\uDE80","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",""].join(`
|
|
407
407
|
`))}}get isGatewayAvailable(){return!!this._creativeGateway}async getData(Z){if(!this._creativeGateway&&process.env.NODE_ENV==="production")return m.warning("PlatformGateway.getData(): You are running in production mode, but the Platform Gateway is not initialized! No data will be returned.");return this._creativeGateway?await this._creativeGateway.kv.get(Z):this._readDevDataLocally(Z)}async getPlayerLoadout(Z){if(!this._creativeGateway)return;return await this._creativeGateway.getLoadout(Z)}async getPlayerSession(Z){if(!this._creativeGateway)return;return await this._creativeGateway.getSession(Z)}async setData(Z,J){if(J.error)return m.warning("PlatformGateway.setData(): Cannot set data with an error property.");if(!this._creativeGateway&&process.env.NODE_ENV==="production")return m.warning("PlatformGateway.setData(): You are running in production mode, but the Platform Gateway is not initialized! No data will be set.");return this._creativeGateway?await this._creativeGateway.kv.set(Z,J):this._writeDevDataLocally(Z,J)}_readDevDataLocally(Z){try{if(!IY.existsSync(JH))return;let J=Se.join(JH,`${Z}.json`);return JSON.parse(IY.readFileSync(J,"utf8"))}catch(J){m.warning(`PlatformGateway._readDevDataLocally(): Failed to read data for key "${Z}": ${J}`)}}_writeDevDataLocally(Z,J){try{if(!IY.existsSync(JH))IY.mkdirSync(JH,{recursive:!0});let X=Se.join(JH,`${Z}.json`),Y={};if(IY.existsSync(X))Y=JSON.parse(IY.readFileSync(X,"utf8"));let $={...Y,...J};IY.writeFileSync(X,JSON.stringify($,null,2),"utf8")}catch(X){m.warning(`PlatformGateway._writeDevDataLocally(): Failed to write data for key "${Z}": ${X}`)}}}class vY{static instance=new vY;constructor(){}async getGlobalData(Z){let J=await F7.instance.getData(Z);if(!J||J.error){if(J?.error)m.warning(`PersistenceManager.getGlobalData(): ${J.error.message}`);return}return J}async getPlayerData(Z){let J=await F7.instance.getData(this._getPlayerKey(Z));if(!J||J.error){if(J?.error)m.warning(`PersistenceManager.getPlayerData(): ${J.error.message}`);return}return J}async setGlobalData(Z,J){let X=await F7.instance.setData(Z,J);if(!X||X.error){if(X?.error)m.warning(`PersistenceManager.setGlobalData(): ${X.error.message}`);return}return X}async setPlayerData(Z,J){let X=await F7.instance.setData(this._getPlayerKey(Z),J);if(!X||X.error){if(X?.error)m.warning(`PersistenceManager.setPlayerData(): ${X.error.message}`);return}return X}_getPlayerKey(Z){return`player-${Z.id}`}}var Ae;((Y)=>{Y[Y.FIRST_PERSON=0]="FIRST_PERSON";Y[Y.THIRD_PERSON=1]="THIRD_PERSON";Y[Y.SPECTATOR=2]="SPECTATOR"})(Ae||={});var qk;((w)=>{w.LOOK_AT_ENTITY="PLAYER_CAMERA.LOOK_AT_ENTITY";w.LOOK_AT_POSITION="PLAYER_CAMERA.LOOK_AT_POSITION";w.SET_ATTACHED_TO_ENTITY="PLAYER_CAMERA.SET_ATTACHED_TO_ENTITY";w.SET_ATTACHED_TO_POSITION="PLAYER_CAMERA.SET_ATTACHED_TO_POSITION";w.SET_FILM_OFFSET="PLAYER_CAMERA.SET_FILM_OFFSET";w.SET_FORWARD_OFFSET="PLAYER_CAMERA.SET_FORWARD_OFFSET";w.SET_FOV="PLAYER_CAMERA.SET_FOV";w.SET_MODEL_HIDDEN_NODES="PLAYER_CAMERA.SET_MODEL_HIDDEN_NODES";w.SET_MODEL_SHOWN_NODES="PLAYER_CAMERA.SET_MODEL_SHOWN_NODES";w.SET_MODE="PLAYER_CAMERA.SET_MODE";w.SET_OFFSET="PLAYER_CAMERA.SET_OFFSET";w.SET_SHOULDER_ANGLE="PLAYER_CAMERA.SET_SHOULDER_ANGLE";w.SET_TRACKED_ENTITY="PLAYER_CAMERA.SET_TRACKED_ENTITY";w.SET_TRACKED_POSITION="PLAYER_CAMERA.SET_TRACKED_POSITION";w.SET_ZOOM="PLAYER_CAMERA.SET_ZOOM"})(qk||={});class XH extends w0{player;_attachedToEntity;_attachedToPosition;_filmOffset=0;_forwardOffset=0;_fov=75;_modelHiddenNodes=new Set;_modelShownNodes=new Set;_mode=1;_offset={x:0,y:0,z:0};_orientation={pitch:0,yaw:0};_shoulderAngle=0;_trackedEntity;_trackedPosition;_zoom=1;constructor(Z){super();this.player=Z}get attachedToEntity(){return this._attachedToEntity}get attachedToPosition(){return this._attachedToPosition}get facingDirection(){return{x:-Math.sin(this._orientation.yaw)*Math.cos(this._orientation.pitch),y:Math.sin(this._orientation.pitch),z:-Math.cos(this._orientation.yaw)*Math.cos(this._orientation.pitch)}}get facingQuaternion(){let Z=this._orientation.pitch*0.5,J=this._orientation.yaw*0.5,X=Math.cos(Z),Y=Math.sin(Z),$=Math.cos(J),Q=Math.sin(J);return{x:Y*$,y:X*Q,z:-Y*Q,w:X*$}}get filmOffset(){return this._filmOffset}get forwardOffset(){return this._forwardOffset}get fov(){return this._fov}get modelHiddenNodes(){return this._modelHiddenNodes}get modelShownNodes(){return this._modelShownNodes}get mode(){return this._mode}get offset(){return this._offset}get orientation(){return this._orientation}get shoulderAngle(){return this._shoulderAngle}get trackedEntity(){return this._trackedEntity}get trackedPosition(){return this._trackedPosition}get zoom(){return this._zoom}lookAtEntity(Z){if(!this._requirePlayerWorld("lookAtEntity"))return;this.emitWithWorld(this.player.world,"PLAYER_CAMERA.LOOK_AT_ENTITY",{playerCamera:this,entity:Z})}lookAtPosition(Z){if(!this._requirePlayerWorld("lookAtPosition"))return;this.emitWithWorld(this.player.world,"PLAYER_CAMERA.LOOK_AT_POSITION",{playerCamera:this,position:Z})}reset(){this._attachedToEntity=void 0,this._attachedToPosition=void 0,this._orientation={pitch:0,yaw:0},this._trackedEntity=void 0,this._trackedPosition=void 0}setAttachedToEntity(Z){if(!this._requirePlayerWorld("setAttachedToEntity"))return;if(!Z.isSpawned)return m.error(`PlayerCamera.setAttachedToEntity(): Entity ${Z.id} is not spawned!`);this._attachedToEntity=Z,this.emitWithWorld(this.player.world,"PLAYER_CAMERA.SET_ATTACHED_TO_ENTITY",{playerCamera:this,entity:Z})}setAttachedToPosition(Z){if(!this._requirePlayerWorld("setAttachedToPosition"))return;this._attachedToPosition=Z,this.emitWithWorld(this.player.world,"PLAYER_CAMERA.SET_ATTACHED_TO_POSITION",{playerCamera:this,position:Z})}setFilmOffset(Z){if(!this._requirePlayerWorld("setFilmOffset"))return;this._filmOffset=Z,this.emitWithWorld(this.player.world,"PLAYER_CAMERA.SET_FILM_OFFSET",{playerCamera:this,filmOffset:Z})}setForwardOffset(Z){if(!this._requirePlayerWorld("setForwardOffset"))return;this._forwardOffset=Z,this.emitWithWorld(this.player.world,"PLAYER_CAMERA.SET_FORWARD_OFFSET",{playerCamera:this,forwardOffset:Z})}setFov(Z){if(!this._requirePlayerWorld("setFov"))return;this._fov=Z,this.emitWithWorld(this.player.world,"PLAYER_CAMERA.SET_FOV",{playerCamera:this,fov:Z})}setModelHiddenNodes(Z){if(!this._requirePlayerWorld("setModelHiddenNodes"))return;this._modelHiddenNodes=new Set(Z.map((J)=>J.toLowerCase())),this.emitWithWorld(this.player.world,"PLAYER_CAMERA.SET_MODEL_HIDDEN_NODES",{playerCamera:this,modelHiddenNodes:this._modelHiddenNodes})}setModelShownNodes(Z){if(!this._requirePlayerWorld("setModelShownNodes"))return;this._modelShownNodes=new Set(Z.map((J)=>J.toLowerCase())),this.emitWithWorld(this.player.world,"PLAYER_CAMERA.SET_MODEL_SHOWN_NODES",{playerCamera:this,modelShownNodes:this._modelShownNodes})}setMode(Z){if(!this._requirePlayerWorld("setMode"))return;this._mode=Z,this.emitWithWorld(this.player.world,"PLAYER_CAMERA.SET_MODE",{playerCamera:this,mode:Z})}setOffset(Z){if(!this._requirePlayerWorld("setOffset"))return;this._offset=Z,this.emitWithWorld(this.player.world,"PLAYER_CAMERA.SET_OFFSET",{playerCamera:this,offset:Z})}setOrientationPitch(Z){this._orientation.pitch=Z}setOrientationYaw(Z){this._orientation.yaw=Z}setShoulderAngle(Z){if(!this._requirePlayerWorld("setShoulderAngle"))return;this._shoulderAngle=Z,this.emitWithWorld(this.player.world,"PLAYER_CAMERA.SET_SHOULDER_ANGLE",{playerCamera:this,shoulderAngle:Z})}setTrackedEntity(Z){if(!this._requirePlayerWorld("setTrackedEntity"))return;this._trackedEntity=Z,this.emitWithWorld(this.player.world,"PLAYER_CAMERA.SET_TRACKED_ENTITY",{playerCamera:this,entity:Z})}setTrackedPosition(Z){if(!this._requirePlayerWorld("setTrackedPosition"))return;this._trackedPosition=Z,this.emitWithWorld(this.player.world,"PLAYER_CAMERA.SET_TRACKED_POSITION",{playerCamera:this,position:Z})}setZoom(Z){if(!this._requirePlayerWorld("setZoom"))return;this._zoom=Z,this.emitWithWorld(this.player.world,"PLAYER_CAMERA.SET_ZOOM",{playerCamera:this,zoom:Z})}serialize(){if(!this.player.world)m.fatalError("PlayerCamera.serialize(): PlayerCamera player is not in a world and cannot be serialized!");return j0.serializePlayerCamera(this,this.player.world.tickAllocator)}_requirePlayerWorld(Z){if(!this.player.world)m.error(`PlayerCamera._requirePlayerWorld(): Player ${this.player.id} is not in a world, invoked method: ${Z}()`);return!!this.player.world}}var IL;(($)=>{$.DATA="PLAYER_UI.DATA";$.LOAD="PLAYER_UI.LOAD";$.LOCK_POINTER="PLAYER_UI.LOCK_POINTER";$.SEND_DATA="PLAYER_UI.SEND_DATA"})(IL||={});class YH extends w0{player;constructor(Z){super();this.player=Z}load(Z){if(!this.player.world)return;this.emitWithWorld(this.player.world,"PLAYER_UI.LOAD",{playerUI:this,htmlUri:Z})}lockPointer(Z){if(!this.player.world)return;this.emitWithWorld(this.player.world,"PLAYER_UI.LOCK_POINTER",{playerUI:this,lock:Z})}sendData(Z){if(!this.player.world)return;this.emitWithWorld(this.player.world,"PLAYER_UI.SEND_DATA",{playerUI:this,data:Z})}}var xe=["w","a","s","d","sp","sh","tb","ml","mr","q","e","r","f","z","x","c","v","u","i","o","j","k","l","n","m","1","2","3","4","5","6","7","8","9","0"],$H;((Q)=>{Q.CHAT_MESSAGE_SEND="PLAYER.CHAT_MESSAGE_SEND";Q.JOINED_WORLD="PLAYER.JOINED_WORLD";Q.LEFT_WORLD="PLAYER.LEFT_WORLD";Q.RECONNECTED_WORLD="PLAYER.RECONNECTED_WORLD";Q.REQUEST_SYNC="PLAYER.REQUEST_SYNC"})($H||={});class WW extends w0{static _devNextPlayerId=1;id;username;profilePictureUrl;camera;connection;ui;_input={};_lastUnreliableInputSequenceNumber=0;_persistedData;_world;_worldSwitched=!1;constructor(Z,J){super();this.id=J?.user.id??`player-${WW._devNextPlayerId++}`,this.username=J?.user.username??this.id,this.profilePictureUrl=J?.user.profilePictureURL??void 0,this.camera=new XH(this),this.connection=Z,this.ui=new YH(this),Z.onPacket(Z0.PacketId.CHAT_MESSAGE_SEND,this._onChatMessageSendPacket),Z.onPacket(Z0.PacketId.DEBUG_CONFIG,this._onDebugConfigPacket),Z.onPacket(Z0.PacketId.INPUT,this._onInputPacket),Z.onPacket(Z0.PacketId.SYNC_REQUEST,this._onSyncRequestPacket),Z.onPacket(Z0.PacketId.UI_DATA_SEND,this._onUIDataSendPacket)}get input(){return this._input}get world(){return this._world}disconnect(){this._leaveWorld(),this.connection.disconnect()}getPersistedData(){return this._persistedData}joinWorld(Z){if(this._world===Z)return;if(!this._world)this._world=Z,this.emitWithWorld(this._world,"PLAYER.JOINED_WORLD",{player:this,world:this._world});else{for(let J of this._world.entityManager.getPlayerEntitiesByPlayer(this))if(J.isSpawned)J.despawn();this.disconnect(),this._world=Z,this._worldSwitched=!0}}async loadInitialPersistedData(){if(this._persistedData)return;this._persistedData=await vY.instance.getPlayerData(this)??void 0}reconnected(){if(!this._world)return;if(this._lastUnreliableInputSequenceNumber=0,!this._worldSwitched)this.emitWithWorld(this._world,"PLAYER.RECONNECTED_WORLD",{player:this,world:this._world});else this._worldSwitched=!1,this.emitWithWorld(this._world,"PLAYER.JOINED_WORLD",{player:this,world:this._world})}resetInputs(){this._input={}}setPersistedData(Z){return this._persistedData={...this._persistedData,...Z},vY.instance.setPlayerData(this,Z).catch((J)=>{}),this._persistedData}serialize(){if(!this._world)m.fatalError("Player.serialize(): Player is not in a world and cannot be serialized!");return j0.serializePlayer(this,this._world.tickAllocator)}_leaveWorld(){if(!this._world)return;this.emitWithWorld(this._world,"PLAYER.LEFT_WORLD",{player:this,world:this._world}),this._world=void 0}_onChatMessageSendPacket=(Z)=>{if(this._world)this.emitWithWorld(this._world,"PLAYER.CHAT_MESSAGE_SEND",{player:this,message:Z[1].m})};_onDebugConfigPacket=(Z)=>{console.log(Z)};_onInputPacket=(Z)=>{let J=Z[1];if(J.sq!==void 0){if(J.sq<this._lastUnreliableInputSequenceNumber)return;this._lastUnreliableInputSequenceNumber=J.sq}if(xe.forEach((X)=>{let Y=X;if(J[Y]!==void 0)this._input[Y]=Boolean(J[Y])}),J.cp!==void 0)this.camera.setOrientationPitch(J.cp);if(J.cy!==void 0)this.camera.setOrientationYaw(J.cy)};_onSyncRequestPacket=()=>{if(this._world)this.emitWithWorld(this._world,"PLAYER.REQUEST_SYNC",{player:this,receivedAt:Date.now(),receivedAtMs:performance.now()})};_onUIDataSendPacket=(Z)=>{this.ui.emit("PLAYER_UI.DATA",{playerUI:this.ui,data:Z[1]})}}var Vk;((X)=>{X.BROADCAST_MESSAGE="CHAT.BROADCAST_MESSAGE";X.PLAYER_MESSAGE="CHAT.PLAYER_MESSAGE"})(Vk||={});class QH extends w0{_commandCallbacks={};_world;constructor(Z){super();this._world=Z,this._subscribeToPlayerEvents()}registerCommand(Z,J){this._commandCallbacks[Z]=J}unregisterCommand(Z){delete this._commandCallbacks[Z]}sendBroadcastMessage(Z,J){this._sendBroadcastMessage(void 0,Z,J)}sendPlayerMessage(Z,J,X){this.emitWithWorld(this._world,"CHAT.PLAYER_MESSAGE",{player:Z,message:J,color:X})}_subscribeToPlayerEvents(){this._world.on("PLAYER.CHAT_MESSAGE_SEND",(Z)=>{let{player:J,message:X}=Z,[Y,...$]=X.split(" "),Q=this._commandCallbacks[Y];if(Q){Q(J,$,X);return}this._sendBroadcastMessage(J,X)})}_sendBroadcastMessage(Z,J,X){this.emitWithWorld(this._world,"CHAT.BROADCAST_MESSAGE",{player:Z,message:J,color:X})}}var r5=16,Fk=r5-1,vT1=r5**3;class t5{_blocks;_chunkLattice;_originCoordinate;constructor(Z,J){this._blocks=new Uint8Array(vT1),this._chunkLattice=Z,this._originCoordinate=J}get blocks(){return this._blocks}get chunkLattice(){return this._chunkLattice}get originCoordinate(){return this._originCoordinate}static blockIndexToLocalCoordinate(Z){return{x:Z%r5,y:(Z/r5|0)%r5,z:Z/(r5*r5)|0}}static globalCoordinateToLocalCoordinate(Z){return{x:Z.x&r5-1,y:Z.y&r5-1,z:Z.z&r5-1}}static globalCoordinateToOriginCoordinate(Z){return{x:Z.x&~(r5-1),y:Z.y&~(r5-1),z:Z.z&~(r5-1)}}getBlockId(Z){return this._blocks[this._getIndex(Z)]}hasBlock(Z){return this._blocks[this._getIndex(Z)]!==0}setBlock(Z,J){if(!this._isValidLocalCoordinate(Z))return m.error("Chunk.setBlock(): Block local coordinate is out of bounds");let X=this._getIndex(Z);this._blocks[X]=J}serialize(){return j0.serializeChunk(this,this._chunkLattice.world.tickAllocator)}_getIndex(Z){return Z.x+(Z.y<<4)+(Z.z<<8)}_isValidLocalCoordinate(Z){return Z.x>=0&&Z.x<=Fk&&Z.y>=0&&Z.y<=Fk&&Z.z>=0&&Z.z<=Fk}}var Uk;((X)=>{X.REMOVE_CHUNK="CHUNK_LATTICE.REMOVE_CHUNK";X.SET_BLOCK="CHUNK_LATTICE.SET_BLOCK"})(Uk||={});class WH extends w0{_blockTypeColliders=new Map;_blockTypeCounts=new Map;_chunks=new Map;_rigidBody;_world;constructor(Z){super();this._world=Z}get chunkCount(){return this._chunks.size}get world(){return this._world}clear(){for(let Z of this._blockTypeColliders.values())this._world.simulation.colliderMap.removeColliderBlockType(Z),Z.removeFromSimulation();this._chunks.forEach((Z)=>{this.emitWithWorld(this._world,"CHUNK_LATTICE.REMOVE_CHUNK",{chunkLattice:this,chunk:Z})}),this._blockTypeColliders.clear(),this._blockTypeCounts.clear(),this._chunks.clear()}getBlockId(Z){let J=this.getChunk(t5.globalCoordinateToOriginCoordinate(Z));if(!J)return 0;return J.getBlockId(t5.globalCoordinateToLocalCoordinate(Z))}getBlockTypeCollider(Z){return this._blockTypeColliders.get(Z)}getBlockType(Z){let J=this.getBlockId(Z);return J?this._world.blockTypeRegistry.getBlockType(J):null}getBlockTypeCount(Z){return this._blockTypeCounts.get(Z)??0}getChunk(Z){return this._chunks.get(this._getChunkKey(t5.globalCoordinateToOriginCoordinate(Z)))}getOrCreateBlockTypeCollider(Z,J){let X=this._blockTypeColliders.get(Z);if(X)return X;let $=this._world.blockTypeRegistry.getBlockType(Z).createCollider(J);return this._blockTypeColliders.set(Z,$),$}getOrCreateChunk(Z){let J=t5.globalCoordinateToOriginCoordinate(Z),X=this._chunks.get(this._getChunkKey(J));if(X)return X;return X=new t5(this,J),this._chunks.set(this._getChunkKey(J),X),X}getAllChunks(Z=!1){return Z?this._world.tickAllocator.getArray(this._chunks.values()):Array.from(this._chunks.values())}hasBlock(Z){let J=this.getChunk(t5.globalCoordinateToOriginCoordinate(Z));if(!J)return!1;return J.hasBlock(t5.globalCoordinateToLocalCoordinate(Z))}hasChunk(Z){let J=t5.globalCoordinateToOriginCoordinate(Z);return this._chunks.has(this._getChunkKey(J))}setBlock(Z,J){let X=t5.globalCoordinateToLocalCoordinate(Z),Y=this.getOrCreateChunk(Z),$=Y.getBlockId(X);if($===J)return;if(Y.setBlock(X,J),!this._rigidBody)this._rigidBody=new NY({type:"fixed"}),this._rigidBody.addToSimulation(this._world.simulation);if($!==0){let Q=Math.max(0,(this._blockTypeCounts.get($)??0)-1),W=this.getBlockTypeCollider($);if(W)if(Q===0)this._world.simulation.colliderMap.removeColliderBlockType(W),W.removeFromSimulation(),this._blockTypeColliders.delete($);else W.setVoxel(Z,!1),this._propagateVoxelChange(W,Z);this._blockTypeCounts.set($,Q)}if(J!==0){let Q=(this._blockTypeCounts.get(J)??0)+1,W=this.getOrCreateBlockTypeCollider(J,[Z]);if(Q===1){let K=this._world.blockTypeRegistry.getBlockType(J);W.addToSimulation(this._world.simulation,this._rigidBody),this._world.simulation.colliderMap.setColliderBlockType(W,K),this._combineVoxelStates(W)}else W.setVoxel(Z,!0),this._propagateVoxelChange(W,Z);this._blockTypeCounts.set(J,Q)}this.emitWithWorld(this._world,"CHUNK_LATTICE.SET_BLOCK",{chunkLattice:this,chunk:Y,globalCoordinate:Z,localCoordinate:X,blockTypeId:J})}_combineVoxelStates(Z){if(Z.isSensor)return;for(let J of this._blockTypeColliders.values()){if(J===Z||J.isSensor)continue;Z.combineVoxelStates(J)}}_getChunkKey(Z){return`${Z.x},${Z.y},${Z.z}`}_propagateVoxelChange(Z,J){if(Z.isSensor)return;for(let X of this._blockTypeColliders.values()){if(X===Z||X.isSensor)continue;Z.propagateVoxelChange(X,J)}}}class KH{_colliderHandleBlockTypeMap=new Map;_colliderHandleCollisionCallbackMap=new Map;_colliderHandleEntityMap=new Map;_cleanupBlockTypeColliderHandles=new Set;_pendingCleanupBlockTypeColliderHandles=new Set;_cleanupCollisionCallbackColliderHandles=new Set;_pendingCleanupCollisionCallbackColliderHandles=new Set;_cleanupEntityColliderHandles=new Set;_pendingCleanupEntityColliderHandles=new Set;getColliderBlockType(Z){if(!this._requireSimulatedCollider(Z))return;return this._colliderHandleBlockTypeMap.get(Z.rawCollider.handle)}getColliderCollisionCallback(Z){if(!this._requireSimulatedCollider(Z))return;return this._colliderHandleCollisionCallbackMap.get(Z.rawCollider.handle)}getColliderEntity(Z){if(!this._requireSimulatedCollider(Z))return;return this._colliderHandleEntityMap.get(Z.rawCollider.handle)}getColliderHandleBlockType(Z){return this._colliderHandleBlockTypeMap.get(Z)}getColliderHandleCollisionCallback(Z){return this._colliderHandleCollisionCallbackMap.get(Z)}getColliderHandleEntity(Z){return this._colliderHandleEntityMap.get(Z)}removeColliderBlockType(Z){if(!this._requireSimulatedCollider(Z))return;this.removeColliderHandleBlockType(Z.rawCollider.handle)}removeColliderCollisionCallback(Z){if(!this._requireSimulatedCollider(Z))return;this.removeColliderHandleCollisionCallback(Z.rawCollider.handle)}removeColliderEntity(Z){if(!this._requireSimulatedCollider(Z))return;this.removeColliderHandleEntity(Z.rawCollider.handle)}removeColliderHandleBlockType(Z){this._colliderHandleBlockTypeMap.delete(Z)}removeColliderHandleCollisionCallback(Z){this._colliderHandleCollisionCallbackMap.delete(Z)}removeColliderHandleEntity(Z){this._colliderHandleEntityMap.delete(Z)}setColliderBlockType(Z,J){if(!this._requireSimulatedCollider(Z))return;this.setColliderHandleBlockType(Z.rawCollider.handle,J)}setColliderCollisionCallback(Z,J){if(!this._requireSimulatedCollider(Z))return;this.setColliderHandleCollisionCallback(Z.rawCollider.handle,J)}setColliderEntity(Z,J){if(!this._requireSimulatedCollider(Z))return;this.setColliderHandleEntity(Z.rawCollider.handle,J)}setColliderHandleBlockType(Z,J){this._colliderHandleBlockTypeMap.set(Z,J),this._cleanupBlockTypeColliderHandles.delete(Z),this._pendingCleanupBlockTypeColliderHandles.delete(Z)}setColliderHandleCollisionCallback(Z,J){this._colliderHandleCollisionCallbackMap.set(Z,J),this._cleanupCollisionCallbackColliderHandles.delete(Z),this._pendingCleanupCollisionCallbackColliderHandles.delete(Z)}setColliderHandleEntity(Z,J){this._colliderHandleEntityMap.set(Z,J),this._cleanupEntityColliderHandles.delete(Z),this._pendingCleanupEntityColliderHandles.delete(Z)}queueColliderHandleForCleanup(Z){if(this._colliderHandleBlockTypeMap.has(Z))this._pendingCleanupBlockTypeColliderHandles.add(Z);if(this._colliderHandleCollisionCallbackMap.has(Z))this._pendingCleanupCollisionCallbackColliderHandles.add(Z);if(this._colliderHandleEntityMap.has(Z))this._pendingCleanupEntityColliderHandles.add(Z)}cleanup(){for(let Z of this._cleanupBlockTypeColliderHandles)this._colliderHandleBlockTypeMap.delete(Z);if(this._cleanupBlockTypeColliderHandles.size>0)this._cleanupBlockTypeColliderHandles.clear();for(let Z of this._cleanupCollisionCallbackColliderHandles)this._colliderHandleCollisionCallbackMap.delete(Z);if(this._cleanupCollisionCallbackColliderHandles.size>0)this._cleanupCollisionCallbackColliderHandles.clear();for(let Z of this._cleanupEntityColliderHandles)this._colliderHandleEntityMap.delete(Z);if(this._cleanupEntityColliderHandles.size>0)this._cleanupEntityColliderHandles.clear();for(let Z of this._pendingCleanupBlockTypeColliderHandles)this._cleanupBlockTypeColliderHandles.add(Z);if(this._pendingCleanupBlockTypeColliderHandles.size>0)this._pendingCleanupBlockTypeColliderHandles.clear();for(let Z of this._pendingCleanupCollisionCallbackColliderHandles)this._cleanupCollisionCallbackColliderHandles.add(Z);if(this._pendingCleanupCollisionCallbackColliderHandles.size>0)this._pendingCleanupCollisionCallbackColliderHandles.clear();for(let Z of this._pendingCleanupEntityColliderHandles)this._cleanupEntityColliderHandles.add(Z);if(this._pendingCleanupEntityColliderHandles.size>0)this._pendingCleanupEntityColliderHandles.clear()}_requireSimulatedCollider(Z){if(!Z.rawCollider)m.error("ColliderMap._requireSimulatedCollider(): Collider is not in the simulation.");return!!Z.rawCollider}}var he={type:"dynamic",softCcdPrediction:1},fe=0.015625,be=Math.cos(0.026),GH;((j)=>{j.BLOCK_COLLISION="ENTITY.BLOCK_COLLISION";j.BLOCK_CONTACT_FORCE="ENTITY.BLOCK_CONTACT_FORCE";j.DESPAWN="ENTITY.DESPAWN";j.ENTITY_COLLISION="ENTITY.ENTITY_COLLISION";j.ENTITY_CONTACT_FORCE="ENTITY.ENTITY_CONTACT_FORCE";j.SET_MODEL_ANIMATIONS_PLAYBACK_RATE="ENTITY.SET_MODEL_ANIMATIONS_PLAYBACK_RATE";j.SET_MODEL_HIDDEN_NODES="ENTITY.SET_MODEL_HIDDEN_NODES";j.SET_MODEL_SCALE="ENTITY.SET_MODEL_SCALE";j.SET_MODEL_SHOWN_NODES="ENTITY.SET_MODEL_SHOWN_NODES";j.SET_MODEL_TEXTURE_URI="ENTITY.SET_MODEL_TEXTURE_URI";j.SET_OPACITY="ENTITY.SET_OPACITY";j.SET_PARENT="ENTITY.SET_PARENT";j.SET_TINT_COLOR="ENTITY.SET_TINT_COLOR";j.SPAWN="ENTITY.SPAWN";j.START_MODEL_LOOPED_ANIMATIONS="ENTITY.START_MODEL_LOOPED_ANIMATIONS";j.START_MODEL_ONESHOT_ANIMATIONS="ENTITY.START_MODEL_ONESHOT_ANIMATIONS";j.STOP_MODEL_ANIMATIONS="ENTITY.STOP_MODEL_ANIMATIONS";j.TICK="ENTITY.TICK";j.UPDATE_POSITION="ENTITY.UPDATE_POSITION";j.UPDATE_ROTATION="ENTITY.UPDATE_ROTATION"})(GH||={});class c8 extends NY{_id;_blockHalfExtents;_blockTextureUri;_controller;_isEnvironmental=!1;_modelAnimationsPlaybackRate=1;_modelHiddenNodes=new Set;_modelLoopedAnimations=new Set;_modelOneshotAnimations=new Set;_modelPreferredShape;_modelScale=1;_modelShownNodes=new Set;_modelTextureUri;_modelUri;_name;_opacity;_parent;_parentNodeName;_tag;_tintColor;_lastUpdatedPosition={x:0,y:0,z:0};_lastUpdatedRotation={x:0,y:0,z:0,w:1};_lastParentlessType="dynamic";_world;_positionUpdateThresholdSq;_rotationUpdateThreshold;constructor(Z){let J="blockTextureUri"in Z,X="modelUri"in Z;if(!J===!X)m.fatalError("Entity.constructor(): Entity data must include a blockTextureUri or modelUri, but not both.");if(J&&!Z.blockHalfExtents)m.fatalError("Entity.constructor(): Block entity must have blockHalfExtents!");if(Z.parent&&!Z.parent.isSpawned)m.fatalError("Entity.constructor(): Parent entity must be spawned before child entity!");if(Z.parent?.modelUri&&Z.parentNodeName&&!R5.instance.modelHasNode(Z.parent.modelUri,Z.parentNodeName))m.fatalError(`Entity.constructor(): Parent node name ${Z.parentNodeName} not found in parent model ${Z.parent.modelUri}!`);super(Z.rigidBodyOptions??he);if(J)this._blockHalfExtents=Z.blockHalfExtents,this._blockTextureUri=Z.blockTextureUri;if(X)this._modelAnimationsPlaybackRate=Z.modelAnimationsPlaybackRate??1,this._modelPreferredShape=Z.modelPreferredShape,this._modelScale=Z.modelScale??1,this._modelTextureUri=Z.modelTextureUri,this._modelUri=Z.modelUri,Z.modelHiddenNodes?.forEach((Y)=>this._modelHiddenNodes.add(Y.toLowerCase())),Z.modelLoopedAnimations?.forEach((Y)=>this._modelLoopedAnimations.add(Y)),Z.modelShownNodes?.forEach((Y)=>this._modelShownNodes.add(Y.toLowerCase()));if(this._isEnvironmental=Z.isEnvironmental??!1,this._name=Z.name??"Nameless",this._opacity=Z.opacity??1,this._parent=Z.parent,this._parentNodeName=Z.parentNodeName,this._tag=Z.tag,this._tintColor=Z.tintColor,this._positionUpdateThresholdSq=fe,this._rotationUpdateThreshold=be,Z.controller)this.setController(Z.controller)}get id(){return this._id}get blockHalfExtents(){return this._blockHalfExtents}get blockTextureUri(){return this._blockTextureUri}get controller(){return this._controller}get depth(){return this.isModelEntity?R5.instance.getDepth(this._modelUri)*(this._modelScale??1):this._blockHalfExtents.z*2}get height(){return this.isModelEntity?R5.instance.getHeight(this._modelUri)*(this._modelScale??1):this._blockHalfExtents.y*2}get modelAnimationsPlaybackRate(){return this._modelAnimationsPlaybackRate}get modelHiddenNodes(){return this._modelHiddenNodes}get modelLoopedAnimations(){return this._modelLoopedAnimations}get modelPreferredShape(){return this._modelPreferredShape}get modelScale(){return this._modelScale}get modelShownNodes(){return this._modelShownNodes}get modelTextureUri(){return this._modelTextureUri}get modelUri(){return this._modelUri}get name(){return this._name}get opacity(){return this._opacity}get parent(){return this._parent}get parentNodeName(){return this._parentNodeName}get tag(){return this._tag}get tintColor(){return this._tintColor}get isBlockEntity(){return!!this._blockTextureUri}get isEnvironmental(){return this._isEnvironmental}get isModelEntity(){return!!this._modelUri}get isSpawned(){return!!this._world}get width(){return this.isModelEntity?R5.instance.getWidth(this._modelUri)*(this._modelScale??1):this._blockHalfExtents.x*2}get world(){return this._world}spawn(Z,J,X){if(this.isSpawned)return m.error(`Entity.spawn(): Entity ${this._name} is already spawned with id ${this._id}!`);if(!this.isSimulated)this.addToSimulation(Z.simulation);if(this._blockTextureUri&&this._blockHalfExtents&&this.numColliders===0)this.addChildColliderToSimulation(new s5(s5.optionsFromBlockHalfExtents(this._blockHalfExtents)));if(this._modelUri&&this.numColliders===0&&this._modelPreferredShape!=="none")this.addChildColliderToSimulation(new s5(s5.optionsFromModelUri(this._modelUri,this._modelScale,this._modelPreferredShape)));if(this.colliders.forEach((Y)=>{if(this.hasListeners("ENTITY.BLOCK_COLLISION")||this.hasListeners("ENTITY.ENTITY_COLLISION"))Y.enableCollisionEvents(!0);if(this.hasListeners("ENTITY.BLOCK_CONTACT_FORCE")||this.hasListeners("ENTITY.ENTITY_CONTACT_FORCE"))Y.enableContactForceEvents(!0);if(Y4.isDefaultCollisionGroups(Y.collisionGroups))Y.setCollisionGroups({belongsTo:[Y.isSensor?4:2],collidesWith:[65535]})}),this.setPosition(J),X)this.setRotation(X);if(this._id=Z.entityManager.registerEntity(this),this._world=Z,this._controller)this._controller.spawn(this);if(this._parent)this.setParent(this._parent,this._parentNodeName,J,X);this.colliders.forEach((Y)=>{Z.simulation.colliderMap.setColliderEntity(Y,this)}),this.emitWithWorld(Z,"ENTITY.SPAWN",{entity:this})}despawn(){if(!this._requireSpawned("despawn"))return;if(this._world.entityManager.getEntityChildren(this).forEach((Z)=>{Z.despawn()}),this._controller)this._controller.detach(this),this._controller.despawn(this);if(this.emitWithWorld(this._world,"ENTITY.DESPAWN",{entity:this}),this.isSimulated)this.removeFromSimulation();this._world.entityManager.unregisterEntity(this),this._world.audioManager.unregisterEntityAttachedAudios(this),this._world.lightManager.despawnEntityAttachedLights(this),this._world.particleEmitterManager.despawnEntityAttachedParticleEmitters(this),this._world.sceneUIManager.unloadEntityAttachedSceneUIs(this),this._id=void 0,this._world=void 0}setController(Z){if(this._controller===Z)return;if(this._controller)this._controller.detach(this);if(this._controller=Z,this._controller)this._controller.attach(this)}setModelAnimationsPlaybackRate(Z){if(!this._requireSpawned("setModelAnimationsPlaybackRate"))return;if(!this.isModelEntity||this._modelAnimationsPlaybackRate===Z)return;this._modelAnimationsPlaybackRate=Z,this.emitWithWorld(this._world,"ENTITY.SET_MODEL_ANIMATIONS_PLAYBACK_RATE",{entity:this,playbackRate:Z})}setModelHiddenNodes(Z){if(!this._requireSpawned("setModelHiddenNodes"))return;if(!this.isModelEntity)return;this._modelHiddenNodes=new Set(Z.map((J)=>J.toLowerCase())),this.emitWithWorld(this._world,"ENTITY.SET_MODEL_HIDDEN_NODES",{entity:this,modelHiddenNodes:this._modelHiddenNodes})}setModelScale(Z){if(!this._requireSpawned("setModelScale"))return;if(!this.isModelEntity||this._modelScale===Z)return;let J=Z/this._modelScale;this._modelScale=Z,this.colliders.forEach((X)=>X.scale(J)),this.emitWithWorld(this._world,"ENTITY.SET_MODEL_SCALE",{entity:this,modelScale:Z})}setModelShownNodes(Z){if(!this._requireSpawned("setModelShownNodes"))return;if(!this.isModelEntity)return;this._modelShownNodes=new Set(Z.map((J)=>J.toLowerCase())),this.emitWithWorld(this._world,"ENTITY.SET_MODEL_SHOWN_NODES",{entity:this,modelShownNodes:this._modelShownNodes})}setModelTextureUri(Z){if(!this._requireSpawned("setModelTextureUri"))return;if(!this.isModelEntity||this._modelTextureUri===Z)return;this._modelTextureUri=Z,this.emitWithWorld(this._world,"ENTITY.SET_MODEL_TEXTURE_URI",{entity:this,modelTextureUri:Z})}setOpacity(Z){if(!this._requireSpawned("setOpacity"))return;if(this._opacity===Z)return;this._opacity=Z,this.emitWithWorld(this._world,"ENTITY.SET_OPACITY",{entity:this,opacity:Z})}setParent(Z,J,X,Y){if(!this._requireSpawned("setParent"))return;if(Z&&!Z.isSpawned)return m.error("Entity.setParent(): Parent entity is not spawned, cannot set parent!");if(!this._parent&&Z)this._lastParentlessType=this.type;if(this._parent=Z,this._parentNodeName=J,this.colliders.forEach(($)=>$.setEnabled(!Z)),this.setType(!Z?this._lastParentlessType:"kinematic_velocity"),this.setPosition(X??{x:0,y:0,z:0}),this.setRotation(Y??{x:0,y:0,z:0,w:1}),!this.isKinematicPositionBased)this.resetAngularVelocity(),this.resetForces(),this.resetLinearVelocity(),this.resetTorques();this.emitWithWorld(this._world,"ENTITY.SET_PARENT",{entity:this,parent:Z,parentNodeName:J})}setTintColor(Z){if(!this._requireSpawned("setTintColor"))return;if(!Z&&!this._tintColor||Z&&this._tintColor&&Z.r===this._tintColor.r&&Z.g===this._tintColor.g&&Z.b===this._tintColor.b)return;this._tintColor=Z,this.emitWithWorld(this._world,"ENTITY.SET_TINT_COLOR",{entity:this,tintColor:Z})}startModelLoopedAnimations(Z){if(!this._requireSpawned("startModelLoopedAnimations"))return;if(!this.isModelEntity||!Z.length)return;if(!Z.some((J)=>!this._modelLoopedAnimations.has(J)))return;Z.forEach((J)=>{this._modelLoopedAnimations.add(J)}),this.emitWithWorld(this._world,"ENTITY.START_MODEL_LOOPED_ANIMATIONS",{entity:this,animations:new Set(Z)})}startModelOneshotAnimations(Z){if(!this._requireSpawned("startModelOneshotAnimations"))return;if(!this.isModelEntity||!Z.length)return;Z.forEach((J)=>{this._modelOneshotAnimations.add(J)}),this.emitWithWorld(this._world,"ENTITY.START_MODEL_ONESHOT_ANIMATIONS",{entity:this,animations:new Set(Z)})}stopAllModelAnimations(Z=[]){if(!this._requireSpawned("stopAllModelAnimations"))return;this._stopAnimationsFromSets([this._modelLoopedAnimations,this._modelOneshotAnimations],Z)}stopAllModelLoopedAnimations(Z=[]){if(!this._requireSpawned("stopAllModelLoopedAnimations"))return;this._stopAnimationsFromSets([this._modelLoopedAnimations],Z)}stopAllModelOneshotAnimations(Z=[]){if(!this._requireSpawned("stopAllModelOneshotAnimations"))return;this._stopAnimationsFromSets([this._modelOneshotAnimations],Z)}stopModelAnimations(Z){if(!this._requireSpawned("stopModelAnimations"))return;if(!this.isModelEntity||!Z.length)return;if(!Z.some((J)=>this._modelLoopedAnimations.has(J))&&!Z.some((J)=>this._modelOneshotAnimations.has(J)))return;Z.forEach((J)=>{this._modelLoopedAnimations.delete(J),this._modelOneshotAnimations.delete(J)}),this.emitWithWorld(this._world,"ENTITY.STOP_MODEL_ANIMATIONS",{entity:this,animations:new Set(Z)})}serialize(){if(!this._world)m.fatalError("Entity.serialize(): Entity is not in a world and cannot be serialized!");return j0.serializeEntity(this,this._world.tickAllocator)}tick(Z){if(this.emit("ENTITY.TICK",{entity:this,tickDeltaMs:Z}),this._controller)this._controller.tick(this,Z)}checkAndEmitUpdates(){if(!this._requireSpawned("checkAndEmitUpdates"))return;let Z=this.position,J=this.rotation;if(this._rotationExceedsThreshold(J,this._lastUpdatedRotation)){this._lastUpdatedRotation=J;let X=this._world.tickAllocator.getObject();X.entity=this,X.rotation=J,this.emitWithWorld(this._world,"ENTITY.UPDATE_ROTATION",X)}if(this._positionExceedsThreshold(Z,this._lastUpdatedPosition)){this._lastUpdatedPosition=Z;let X=this._world.tickAllocator.getObject();X.entity=this,X.position=Z,this.emitWithWorld(this._world,"ENTITY.UPDATE_POSITION",X)}}_positionExceedsThreshold(Z,J){let X=Z.x-J.x,Y=Z.y-J.y,$=Z.z-J.z;return X*X+Y*Y+$*$>this._positionUpdateThresholdSq}_requireSpawned(Z){if(!this.isSpawned)m.error(`Entity._requireSpawned(): Entity ${this._name} is not spawned, cannot invoke ${Z}()!`);return this.isSpawned}_rotationExceedsThreshold(Z,J){return Math.abs(Z.x*J.x+Z.y*J.y+Z.z*J.z+Z.w*J.w)<this._rotationUpdateThreshold}_stopAnimationsFromSets(Z,J=[]){if(!this.isModelEntity)return;let X=new Set(J),Y=[];for(let $ of Z)for(let Q of $)if(!X.has(Q))Y.push(Q);if(Y.length>0)this.stopModelAnimations(Y)}}class f1 extends bX{static BASE_ENTITY_HEIGHT=1.5;static GROUND_SENSOR_HEIGHT_SCALE=0.125;static GROUND_SENSOR_RADIUS_SCALE=0.23;static JUMP_LAND_HEAVY_VELOCITY_THRESHOLD=-12;static WALL_COLLIDER_HEIGHT_SCALE=0.33;static WALL_COLLIDER_RADIUS_SCALE=0.4;static MOVEMENT_ROTATIONS={wa:Math.PI/4,wd:-Math.PI/4,sa:Math.PI-Math.PI/4,sd:Math.PI+Math.PI/4,s:Math.PI,asd:Math.PI,a:Math.PI/2,d:-Math.PI/2};static EXTERNAL_IMPULSE_DECAY_RATE=0.253;static SWIM_UPWARD_COOLDOWN_MS=600;static SWIMMING_DRAG_FACTOR=0.05;static WATER_ENTRY_SINKING_FACTOR=0.8;static WATER_ENTRY_SINKING_MS=250;applyDirectionalMovementRotations=!0;autoCancelMouseLeftClick=!0;canJump=()=>!0;canRun=()=>!0;canSwim=()=>!0;canWalk=()=>!0;faceForwardOnStop=!0;idleLoopedAnimations=["idle-upper","idle-lower"];interactOneshotAnimations=["simple-interact"];jumpLandHeavyOneshotAnimations=["jump-post-heavy"];jumpLandLightOneshotAnimations=["jump-post-light"];jumpOneshotAnimations=["jump-loop"];jumpVelocity=10;runLoopedAnimations=["run-upper","run-lower"];runVelocity=8;sticksToPlatforms=!0;swimFastVelocity=5;swimGravity=0;swimIdleLoopedAnimations=["swim-idle"];swimLoopedAnimations=["swim-forward"];swimMaxGravityVelocity=-1;swimSlowVelocity=3;swimUpwardVelocity=2;walkLoopedAnimations=["walk-upper","walk-lower"];walkVelocity=4;_externalVelocity={x:0,y:0,z:0};_magnitudeYTracker=0;_groundContactCount=0;_internalApplyImpulse=()=>{};_isActivelyMoving=!1;_isFullySubmerged=!1;_justSubmergedUntil=0;_liquidContactCount=0;_platform;_reusableImpulse={x:0,y:0,z:0};_reusablePlatformVelocity={x:0,y:0,z:0};_reusableTargetVelocities={x:0,y:0,z:0};_reusableVelocityClamp={x:0,y:0,z:0};_stepAudio;_swimUpwardCooldownAt=0;constructor(Z={}){super();this.applyDirectionalMovementRotations=Z.applyDirectionalMovementRotations??this.applyDirectionalMovementRotations,this.autoCancelMouseLeftClick=Z.autoCancelMouseLeftClick??this.autoCancelMouseLeftClick,this.faceForwardOnStop=Z.faceForwardOnStop??this.faceForwardOnStop,this.sticksToPlatforms=Z.sticksToPlatforms??this.sticksToPlatforms,this.canJump=Z.canJump??this.canJump,this.canRun=Z.canRun??this.canRun,this.canSwim=Z.canSwim??this.canSwim,this.canWalk=Z.canWalk??this.canWalk,this.jumpVelocity=Z.jumpVelocity??this.jumpVelocity,this.runVelocity=Z.runVelocity??this.runVelocity,this.walkVelocity=Z.walkVelocity??this.walkVelocity,this.swimFastVelocity=Z.swimFastVelocity??this.swimFastVelocity,this.swimSlowVelocity=Z.swimSlowVelocity??this.swimSlowVelocity,this.swimUpwardVelocity=Z.swimUpwardVelocity??this.swimUpwardVelocity,this.swimGravity=Z.swimGravity??this.swimGravity,this.swimMaxGravityVelocity=Z.swimMaxGravityVelocity??this.swimMaxGravityVelocity,this.idleLoopedAnimations=Z.idleLoopedAnimations??this.idleLoopedAnimations,this.interactOneshotAnimations=Z.interactOneshotAnimations??this.interactOneshotAnimations,this.jumpOneshotAnimations=Z.jumpOneshotAnimations??this.jumpOneshotAnimations,this.jumpLandHeavyOneshotAnimations=Z.jumpLandHeavyOneshotAnimations??this.jumpLandHeavyOneshotAnimations,this.jumpLandLightOneshotAnimations=Z.jumpLandLightOneshotAnimations??this.jumpLandLightOneshotAnimations,this.runLoopedAnimations=Z.runLoopedAnimations??this.runLoopedAnimations,this.swimLoopedAnimations=Z.swimLoopedAnimations??this.swimLoopedAnimations,this.swimIdleLoopedAnimations=Z.swimIdleLoopedAnimations??this.swimIdleLoopedAnimations,this.walkLoopedAnimations=Z.walkLoopedAnimations??this.walkLoopedAnimations}get isActivelyMoving(){return this._isActivelyMoving}get isGrounded(){return this._groundContactCount>0}get isOnPlatform(){return!!this._platform}get isSwimming(){return this._liquidContactCount>0}get platform(){return this._platform}attach(Z){super.attach(Z),this._internalApplyImpulse=Z.applyImpulse.bind(Z),Z.applyImpulse=(J)=>{let X=Z.mass||1;this._externalVelocity.x+=J.x/X,this._externalVelocity.y+=J.y/X,this._externalVelocity.z+=J.z/X},this._stepAudio=new X3({uri:"audio/sfx/step/stone/stone-step-04.mp3",loop:!0,volume:0.1,referenceDistance:2,cutoffDistance:15,attachedToEntity:Z}),Z.setCcdEnabled(!0),Z.lockAllRotations(),Z.on("ENTITY.BLOCK_COLLISION",({blockType:J,started:X})=>{if(!J.isLiquid||!this.canSwim(this))return;if(this._liquidContactCount<=0&&X){let Y=Z.linearVelocity;Z.setLinearVelocity({x:Y.x*this.swimGravity,y:Y.y*this.swimGravity,z:Y.z*this.swimGravity})}if(this._liquidContactCount+=X?1:-1,this._liquidContactCount>0)Z.setGravityScale(this.swimGravity),Z.stopAllModelLoopedAnimations(this.swimLoopedAnimations),this._swimUpwardCooldownAt=performance.now()+f1.SWIM_UPWARD_COOLDOWN_MS;else Z.setGravityScale(1),Z.stopModelAnimations(this.swimLoopedAnimations)})}spawn(Z){if(!Z.isSpawned)return m.error("DefaultPlayerEntityController.spawn(): Entity is not spawned!");Z.createAndAddChildCollider({shape:"cylinder",radius:f1.GROUND_SENSOR_RADIUS_SCALE*(Z.height/f1.BASE_ENTITY_HEIGHT),halfHeight:f1.GROUND_SENSOR_HEIGHT_SCALE*(Z.height/f1.BASE_ENTITY_HEIGHT),collisionGroups:{belongsTo:[4],collidesWith:[1,2]},isSensor:!0,relativePosition:{x:0,y:-Z.height/2,z:0},tag:"groundSensor",onCollision:(J,X)=>{if(!Z.isSpawned)return;if(!(J instanceof o5)||!J.isLiquid){if(X&&this._groundContactCount===0&&Z.linearVelocity.y<-1)if(Z.linearVelocity.y<f1.JUMP_LAND_HEAVY_VELOCITY_THRESHOLD)Z.startModelOneshotAnimations(this.jumpLandHeavyOneshotAnimations);else Z.startModelOneshotAnimations(this.jumpLandLightOneshotAnimations);this._groundContactCount+=X?1:-1}if(!this._groundContactCount&&!this.isSwimming)Z.startModelOneshotAnimations(this.jumpOneshotAnimations);else Z.stopModelAnimations(this.jumpOneshotAnimations);if(!(J instanceof c8))return;if(X&&this.sticksToPlatforms)this._platform=J;else if(J===this._platform&&!X)this._platform=void 0}}),Z.createAndAddChildCollider({shape:"capsule",halfHeight:f1.WALL_COLLIDER_HEIGHT_SCALE*(Z.height/f1.BASE_ENTITY_HEIGHT),radius:f1.WALL_COLLIDER_RADIUS_SCALE*(Z.height/f1.BASE_ENTITY_HEIGHT),collisionGroups:{belongsTo:[4],collidesWith:[1,2]},friction:0,frictionCombineRule:1,tag:"wallCollider"})}tickWithPlayerInput(Z,J,X,Y){if(!Z.isSpawned||!Z.world)return;if(super.tickWithPlayerInput(Z,J,X,Y),Z.parent)return;let{w:$,a:Q,s:W,d:K,c:G,sp:H,sh:z,ml:q}=J,{yaw:V}=X,F=Z.linearVelocity;this._reusableTargetVelocities.x=0,this._reusableTargetVelocities.y=0,this._reusableTargetVelocities.z=0,this._isActivelyMoving=!!($||Q||W||K);let U=z,w=Q&&K&&!$&&!W||$&&W&&!Q&&!K,L=U&&this.canRun(this)||!U&&this.canWalk(this);if(this.isSwimming&&!this._isFullySubmerged)this._isFullySubmerged=!0,this._justSubmergedUntil=performance.now()+f1.WATER_ENTRY_SINKING_MS;else if(!this.isSwimming)this._isFullySubmerged=!1,this._justSubmergedUntil=0;if(this.isGrounded&&!this.isSwimming&&this._isActivelyMoving&&!w&&L){let D=U?this.runLoopedAnimations:this.walkLoopedAnimations;Z.stopAllModelLoopedAnimations(D),Z.startModelLoopedAnimations(D),this._stepAudio?.setPlaybackRate(U?0.75:0.51),this._stepAudio?.play(Z.world,!this._stepAudio?.isPlaying)}else if(this._isFullySubmerged&&this.canSwim(this))if(this._stepAudio?.pause(),this._isActivelyMoving)Z.stopAllModelLoopedAnimations(this.swimLoopedAnimations),Z.startModelLoopedAnimations(this.swimLoopedAnimations);else Z.stopAllModelLoopedAnimations(this.swimIdleLoopedAnimations),Z.startModelLoopedAnimations(this.swimIdleLoopedAnimations);else this._stepAudio?.pause(),Z.stopAllModelLoopedAnimations(this.idleLoopedAnimations),Z.startModelLoopedAnimations(this.idleLoopedAnimations);let O;if(this.applyDirectionalMovementRotations&&L){if($&&Q&&!K&&!W)O=f1.MOVEMENT_ROTATIONS.wa;else if($&&K&&!Q&&!W)O=f1.MOVEMENT_ROTATIONS.wd;else if(W&&Q&&!$&&!K)O=f1.MOVEMENT_ROTATIONS.sa;else if(W&&K&&!$&&!Q)O=f1.MOVEMENT_ROTATIONS.sd;else if(W&&!$&&!Q&&!K||Q&&W&&K&&!$)O=f1.MOVEMENT_ROTATIONS.s;else if(Q&&!$&&!W&&!K)O=f1.MOVEMENT_ROTATIONS.a;else if(K&&!$&&!Q&&!W)O=f1.MOVEMENT_ROTATIONS.d}if(q)Z.startModelOneshotAnimations(this.interactOneshotAnimations),J.ml=!this.autoCancelMouseLeftClick;if(L){let D=!this.isSwimming?U?this.runVelocity:this.walkVelocity:U?this.swimFastVelocity:this.swimSlowVelocity,C=Math.sin(V),k=Math.cos(V);if($)this._reusableTargetVelocities.x-=D*C,this._reusableTargetVelocities.z-=D*k;if(W)this._reusableTargetVelocities.x+=D*C,this._reusableTargetVelocities.z+=D*k;if(Q)this._reusableTargetVelocities.x-=D*k,this._reusableTargetVelocities.z+=D*C;if(K)this._reusableTargetVelocities.x+=D*k,this._reusableTargetVelocities.z-=D*C;let T=Math.sqrt(this._reusableTargetVelocities.x*this._reusableTargetVelocities.x+this._reusableTargetVelocities.z*this._reusableTargetVelocities.z);if(T>D){let x=D/T;this._reusableTargetVelocities.x*=x,this._reusableTargetVelocities.z*=x}}if(this.isSwimming){if(F.y<this.swimMaxGravityVelocity)this._reusableVelocityClamp.x=F.x,this._reusableVelocityClamp.y=this.swimMaxGravityVelocity,this._reusableVelocityClamp.z=F.z,Z.setLinearVelocity(this._reusableVelocityClamp);if(F.y>this.swimUpwardVelocity*2)this._reusableVelocityClamp.x=F.x,this._reusableVelocityClamp.y=this.swimUpwardVelocity*2,this._reusableVelocityClamp.z=F.z,Z.setLinearVelocity(this._reusableVelocityClamp);if(G)this._reusableTargetVelocities.y=-this.swimUpwardVelocity;else if(performance.now()<this._justSubmergedUntil)this._reusableTargetVelocities.y=-this.swimUpwardVelocity*f1.WATER_ENTRY_SINKING_FACTOR;else if(!H)this._reusableTargetVelocities.y=-F.y*f1.SWIMMING_DRAG_FACTOR}if(H&&this.canJump(this)){if(this.isGrounded&&!this.isSwimming&&F.y>-0.001&&F.y<=3)this._reusableTargetVelocities.y=this.jumpVelocity;else if(this.isSwimming&&performance.now()>this._swimUpwardCooldownAt)this._reusableTargetVelocities.y=this.swimUpwardVelocity}let N=this._platform?.linearVelocity??this._reusablePlatformVelocity;if(this._externalVelocity.y!==0)this._magnitudeYTracker+=this._externalVelocity.y;if(this._externalVelocity.x!==0||this._externalVelocity.y!==0||this._externalVelocity.z!==0){if(this.isGrounded){let D=Math.sqrt(this._externalVelocity.x*this._externalVelocity.x+this._magnitudeYTracker*this._magnitudeYTracker+this._externalVelocity.z*this._externalVelocity.z);if(D>0.01){let k=Math.max(0,D-f1.EXTERNAL_IMPULSE_DECAY_RATE)/D;this._externalVelocity.x*=k,this._magnitudeYTracker*=k,this._externalVelocity.z*=k}else this._externalVelocity.x=0,this._externalVelocity.y=0,this._magnitudeYTracker=0,this._externalVelocity.z=0}}let M=this._reusableTargetVelocities.x+this._externalVelocity.x-F.x+N.x,j=this._reusableTargetVelocities.y+this._externalVelocity.y+N.y,P=this._reusableTargetVelocities.z+this._externalVelocity.z-F.z+N.z;if(this._externalVelocity.y=0,M!==0||j!==0||P!==0){let D=Z.mass;this._reusableImpulse.x=M*D,this._reusableImpulse.y=j*D,this._reusableImpulse.z=P*D,this._internalApplyImpulse(this._reusableImpulse)}if(V!==void 0&&(this.faceForwardOnStop||this.isActivelyMoving)){let C=(O!==void 0?V+O:V)*0.5;Z.setRotation({x:0,y:Math.sin(C),z:0,w:Math.cos(C)})}}}var Lk;((K)=>{K.LOAD="SCENE_UI.LOAD";K.SET_ATTACHED_TO_ENTITY="SCENE_UI.SET_ATTACHED_TO_ENTITY";K.SET_OFFSET="SCENE_UI.SET_OFFSET";K.SET_POSITION="SCENE_UI.SET_POSITION";K.SET_STATE="SCENE_UI.SET_STATE";K.SET_VIEW_DISTANCE="SCENE_UI.SET_VIEW_DISTANCE";K.UNLOAD="SCENE_UI.UNLOAD"})(Lk||={});class HH extends w0{_id;_attachedToEntity;_offset;_position;_state={};_templateId;_viewDistance;_world;constructor(Z){if(!!Z.attachedToEntity===!!Z.position)m.fatalError("Either attachedToEntity or position must be set, but not both");super();this._attachedToEntity=Z.attachedToEntity,this._offset=Z.offset,this._position=Z.position,this._state=Z.state??{},this._templateId=Z.templateId,this._viewDistance=Z.viewDistance}get id(){return this._id}get attachedToEntity(){return this._attachedToEntity}get isLoaded(){return this._id!==void 0}get offset(){return this._offset}get position(){return this._position}get state(){return this._state}get templateId(){return this._templateId}get viewDistance(){return this._viewDistance}get world(){return this._world}load(Z){if(this.isLoaded)return;if(this._attachedToEntity&&!this._attachedToEntity.isSpawned)return m.error(`SceneUI.load(): Attached entity ${this._attachedToEntity.id} must be spawned before loading SceneUI!`);this._id=Z.sceneUIManager.registerSceneUI(this),this._world=Z,this.emitWithWorld(Z,"SCENE_UI.LOAD",{sceneUI:this})}setAttachedToEntity(Z){if(!Z.isSpawned)return m.error(`SceneUI.setAttachedToEntity(): Entity ${Z.id} is not spawned!`);if(this._attachedToEntity===Z)return;if(this._attachedToEntity=Z,this._position=void 0,this.isLoaded)this.emitWithWorld(this._world,"SCENE_UI.SET_ATTACHED_TO_ENTITY",{sceneUI:this,entity:Z})}setOffset(Z){if(this._offset===Z)return;if(this._offset=Z,this.isLoaded)this.emitWithWorld(this._world,"SCENE_UI.SET_OFFSET",{sceneUI:this,offset:Z})}setPosition(Z){if(this._position===Z)return;if(this._attachedToEntity=void 0,this._position=Z,this.isLoaded)this.emitWithWorld(this._world,"SCENE_UI.SET_POSITION",{sceneUI:this,position:Z})}setState(Z){if(this._state={...this._state,...Z},this.isLoaded)this.emitWithWorld(this._world,"SCENE_UI.SET_STATE",{sceneUI:this,state:this._state})}setViewDistance(Z){if(this._viewDistance=Z,this.isLoaded)this.emitWithWorld(this._world,"SCENE_UI.SET_VIEW_DISTANCE",{sceneUI:this,viewDistance:Z})}unload(){if(!this.isLoaded||!this._world)return;this._world.sceneUIManager.unregisterSceneUI(this),this.emitWithWorld(this._world,"SCENE_UI.UNLOAD",{sceneUI:this}),this._id=void 0,this._world=void 0}serialize(){if(!this._world)m.fatalError("SceneUI.serialize(): SceneUI is not in a world and cannot be serialized!");return j0.serializeSceneUI(this,this._world.tickAllocator)}}var ye=0.010000000000000002,ge=Math.cos(0.026);class U7 extends c8{player;nametagSceneUI;constructor(Z){super(Z);this._positionUpdateThresholdSq=ye,this._rotationUpdateThreshold=ge,this.player=Z.player,this.nametagSceneUI=new HH({templateId:"hytopia:nametag",attachedToEntity:this,offset:{x:0,y:1,z:0},viewDistance:15,state:{username:this.player.username,profilePictureUrl:this.player.profilePictureUrl}})}spawn(Z,J,X){super.spawn(Z,J,X),this.nametagSceneUI.load(Z),this.player.on("PLAYER.CHAT_MESSAGE_SEND",({message:Y})=>{this.nametagSceneUI.setState({chat:Y})})}tick(Z){if(!this.isSpawned||!this.world)return;if(!this.controller)return m.error(`PlayerEntity.tick(): PlayerEntity "${this.name}" must have a controller.`);let{input:J,camera:X}=this.player;this.controller.tickWithPlayerInput(this,J,X.orientation,Z),super.tick(Z)}}class wk extends U7{constructor(Z){super({modelUri:"models/players/player.gltf",modelLoopedAnimations:["idle_lower","idle_upper"],modelHiddenNodes:["hair-"],modelShownNodes:["hair-0003"],...Z});if(!Z.controller)this.setController(new f1)}}class zH{_activeEntities=new Set;_entities=new Map;_nextEntityId=1;_world;constructor(Z){this._world=Z}get entityCount(){return this._entities.size}get world(){return this._world}registerEntity(Z){if(Z.id!==void 0)m.fatalError(`EntityManager.registerEntity(): Entity ${Z.name} is already assigned the id ${Z.id}!`);let J=this._nextEntityId;if(this._entities.set(J,Z),this._nextEntityId++,!Z.isEnvironmental)this._activeEntities.add(Z);return J}unregisterEntity(Z){if(Z.id===void 0)return m.error(`EntityManager.unregisterEntity(): Entity ${Z.name} is not assigned an id!`);if(this._entities.delete(Z.id),!Z.isEnvironmental)this._activeEntities.delete(Z)}getAllEntities(Z=!1){return Z?this._world.tickAllocator.getArray(this._entities.values()):Array.from(this._entities.values())}getAllPlayerEntities(){let Z=[];return this._entities.forEach((J)=>{if(J instanceof U7)Z.push(J)}),Z}getPlayerEntitiesByPlayer(Z){let J=[];return this._entities.forEach((X)=>{if(X instanceof U7&&X.player===Z)J.push(X)}),J}getEntity(Z){return this._entities.get(Z)}getEntitiesByTag(Z){let J=[];return this._entities.forEach((X)=>{if(X.tag===Z)J.push(X)}),J}getEntitiesByTagSubstring(Z){let J=[];return this._entities.forEach((X)=>{if(X.tag?.includes(Z))J.push(X)}),J}getEntityChildren(Z){let J=[];return this._entities.forEach((X)=>{if(X.parent===Z)J.push(X)}),J}tickEntities(Z){for(let J of this._activeEntities)J.tick(Z)}checkAndEmitUpdates(){for(let Z of this._activeEntities)Z.checkAndEmitUpdates()}}import{WebSocket as C16}from"ws";var r6=t(c00(),1),zO6=r6.default.v1,qO6=r6.default.v1ToV6,VO6=r6.default.v3,l00=r6.default.v4,FO6=r6.default.v5,UO6=r6.default.v6,LO6=r6.default.v6ToV1,wO6=r6.default.v7,BO6=r6.default.NIL,OO6=r6.default.MAX,jO6=r6.default.version,MO6=r6.default.validate,RO6=r6.default.stringify,NO6=r6.default.parse;var Pk;try{Pk=new TextDecoder}catch(Z){}var e,Z9,y=0;var Ek=[],_Y=Ek,FH=0,_1={},Y1,NZ,e5=0,E9=0,l8,DZ,k5=[],e0,p00={useRecords:!1,mapsAsObjects:!0};class bL{}var Ik=new bL;Ik.name="MessagePack 0xC1";var SJ=!1,e00=2,Ck,Tk,kk;try{new Function("")}catch(Z){e00=1/0}class PZ{constructor(Z){if(Z){if(Z.useRecords===!1&&Z.mapsAsObjects===void 0)Z.mapsAsObjects=!0;if(Z.sequential&&Z.trusted!==!1){if(Z.trusted=!0,!Z.structures&&Z.useRecords!=!1){if(Z.structures=[],!Z.maxSharedStructures)Z.maxSharedStructures=0}}if(Z.structures)Z.structures.sharedLength=Z.structures.length;else if(Z.getStructures)(Z.structures=[]).uninitialized=!0,Z.structures.sharedLength=0;if(Z.int64AsNumber)Z.int64AsType="number"}Object.assign(this,Z)}unpack(Z,J){if(e)return z10(()=>{return fL(),this?this.unpack(Z,J):PZ.prototype.unpack.call(p00,Z,J)});if(!Z.buffer&&Z.constructor===ArrayBuffer)Z=typeof Buffer!=="undefined"?Buffer.from(Z):new Uint8Array(Z);if(typeof J==="object")Z9=J.end||Z.length,y=J.start||0;else y=0,Z9=J>-1?J:Z.length;FH=0,E9=0,NZ=null,_Y=Ek,l8=null,e=Z;try{e0=Z.dataView||(Z.dataView=new DataView(Z.buffer,Z.byteOffset,Z.byteLength))}catch(X){if(e=null,Z instanceof Uint8Array)throw X;throw new Error("Source must be a Uint8Array or Buffer but was a "+(Z&&typeof Z=="object"?Z.constructor.name:typeof Z))}if(this instanceof PZ){if(_1=this,this.structures)return Y1=this.structures,xL(J);else if(!Y1||Y1.length>0)Y1=[]}else if(_1=p00,!Y1||Y1.length>0)Y1=[];return xL(J)}unpackMultiple(Z,J){let X,Y=0;try{SJ=!0;let $=Z.length,Q=this?this.unpack(Z,$):yL.unpack(Z,$);if(J){if(J(Q,Y,y)===!1)return;while(y<$)if(Y=y,J(xL(),Y,y)===!1)return}else{X=[Q];while(y<$)Y=y,X.push(xL());return X}}catch($){throw $.lastPosition=Y,$.values=X,$}finally{SJ=!1,fL()}}_mergeStructures(Z,J){if(Tk)Z=Tk.call(this,Z);if(Z=Z||[],Object.isFrozen(Z))Z=Z.map((X)=>X.slice(0));for(let X=0,Y=Z.length;X<Y;X++){let $=Z[X];if($){if($.isShared=!0,X>=32)$.highByte=X-32>>5}}Z.sharedLength=Z.length;for(let X in J||[])if(X>=0){let Y=Z[X],$=J[X];if($){if(Y)(Z.restoreStructures||(Z.restoreStructures=[]))[X]=Y;Z[X]=$}}return this.structures=Z}decode(Z,J){return this.unpack(Z,J)}}function xL(Z){try{if(!_1.trusted&&!SJ){let X=Y1.sharedLength||0;if(X<Y1.length)Y1.length=X}let J;if(_1.randomAccessStructure&&e[y]<64&&e[y]>=32&&Ck){if(J=Ck(e,y,Z9,_1),e=null,!(Z&&Z.lazy)&&J)J=J.toJSON();y=Z9}else J=P8();if(l8)y=l8.postBundlePosition,l8=null;if(SJ)Y1.restoreStructures=null;if(y==Z9){if(Y1&&Y1.restoreStructures)i00();if(Y1=null,e=null,DZ)DZ=null}else if(y>Z9)throw new Error("Unexpected end of MessagePack data");else if(!SJ){let X;try{X=JSON.stringify(J,(Y,$)=>typeof $==="bigint"?`${$}n`:$).slice(0,100)}catch(Y){X="(JSON view not available "+Y+")"}throw new Error("Data read, but end of buffer not reached "+X)}return J}catch(J){if(Y1&&Y1.restoreStructures)i00();if(fL(),J instanceof RangeError||J.message.startsWith("Unexpected end of buffer")||y>Z9)J.incomplete=!0;throw J}}function i00(){for(let Z in Y1.restoreStructures)Y1[Z]=Y1.restoreStructures[Z];Y1.restoreStructures=null}function P8(){let Z=e[y++];if(Z<160)if(Z<128)if(Z<64)return Z;else{let J=Y1[Z&63]||_1.getStructures&&Z10()[Z&63];if(J){if(!J.read)J.read=vk(J,Z&63);return J.read()}else return Z}else if(Z<144)if(Z-=128,_1.mapsAsObjects){let J={};for(let X=0;X<Z;X++){let Y=G10();if(Y==="__proto__")Y="__proto_";J[Y]=P8()}return J}else{let J=new Map;for(let X=0;X<Z;X++)J.set(P8(),P8());return J}else{Z-=144;let J=new Array(Z);for(let X=0;X<Z;X++)J[X]=P8();if(_1.freezeData)return Object.freeze(J);return J}else if(Z<192){let J=Z-160;if(E9>=y)return NZ.slice(y-e5,(y+=J)-e5);if(E9==0&&Z9<140){let X=J<16?Sk(J):K10(J);if(X!=null)return X}return hL(J)}else{let J;switch(Z){case 192:return null;case 193:if(l8)if(J=P8(),J>0)return l8[1].slice(l8.position1,l8.position1+=J);else return l8[0].slice(l8.position0,l8.position0-=J);return Ik;case 194:return!1;case 195:return!0;case 196:if(J=e[y++],J===void 0)throw new Error("Unexpected end of buffer");return Dk(J);case 197:return J=e0.getUint16(y),y+=2,Dk(J);case 198:return J=e0.getUint32(y),y+=4,Dk(J);case 199:return SY(e[y++]);case 200:return J=e0.getUint16(y),y+=2,SY(J);case 201:return J=e0.getUint32(y),y+=4,SY(J);case 202:if(J=e0.getFloat32(y),_1.useFloat32>2){let X=xY[(e[y]&127)<<1|e[y+1]>>7];return y+=4,(X*J+(J>0?0.5:-0.5)>>0)/X}return y+=4,J;case 203:return J=e0.getFloat64(y),y+=8,J;case 204:return e[y++];case 205:return J=e0.getUint16(y),y+=2,J;case 206:return J=e0.getUint32(y),y+=4,J;case 207:if(_1.int64AsType==="number")J=e0.getUint32(y)*4294967296,J+=e0.getUint32(y+4);else if(_1.int64AsType==="string")J=e0.getBigUint64(y).toString();else if(_1.int64AsType==="auto"){if(J=e0.getBigUint64(y),J<=BigInt(2)<<BigInt(52))J=Number(J)}else J=e0.getBigUint64(y);return y+=8,J;case 208:return e0.getInt8(y++);case 209:return J=e0.getInt16(y),y+=2,J;case 210:return J=e0.getInt32(y),y+=4,J;case 211:if(_1.int64AsType==="number")J=e0.getInt32(y)*4294967296,J+=e0.getUint32(y+4);else if(_1.int64AsType==="string")J=e0.getBigInt64(y).toString();else if(_1.int64AsType==="auto"){if(J=e0.getBigInt64(y),J>=BigInt(-2)<<BigInt(52)&&J<=BigInt(2)<<BigInt(52))J=Number(J)}else J=e0.getBigInt64(y);return y+=8,J;case 212:if(J=e[y++],J==114)return t00(e[y++]&63);else{let X=k5[J];if(X)if(X.read)return y++,X.read(P8());else if(X.noBuffer)return y++,X();else return X(e.subarray(y,++y));else throw new Error("Unknown extension "+J)}case 213:if(J=e[y],J==114)return y++,t00(e[y++]&63,e[y++]);else return SY(2);case 214:return SY(4);case 215:return SY(8);case 216:return SY(16);case 217:if(J=e[y++],E9>=y)return NZ.slice(y-e5,(y+=J)-e5);return J10(J);case 218:if(J=e0.getUint16(y),y+=2,E9>=y)return NZ.slice(y-e5,(y+=J)-e5);return X10(J);case 219:if(J=e0.getUint32(y),y+=4,E9>=y)return NZ.slice(y-e5,(y+=J)-e5);return Y10(J);case 220:return J=e0.getUint16(y),y+=2,a00(J);case 221:return J=e0.getUint32(y),y+=4,a00(J);case 222:return J=e0.getUint16(y),y+=2,s00(J);case 223:return J=e0.getUint32(y),y+=4,s00(J);default:if(Z>=224)return Z-256;if(Z===void 0){let X=new Error("Unexpected end of MessagePack data");throw X.incomplete=!0,X}throw new Error("Unknown MessagePack token "+Z)}}}var QE1=/^[a-zA-Z_$][a-zA-Z\d_$]*$/;function vk(Z,J){function X(){if(X.count++>e00){let $=Z.read=new Function("r","return function(){return "+(_1.freezeData?"Object.freeze":"")+"({"+Z.map((Q)=>Q==="__proto__"?"__proto_:r()":QE1.test(Q)?Q+":r()":"["+JSON.stringify(Q)+"]:r()").join(",")+"})}")(P8);if(Z.highByte===0)Z.read=n00(J,Z.read);return $()}let Y={};for(let $=0,Q=Z.length;$<Q;$++){let W=Z[$];if(W==="__proto__")W="__proto_";Y[W]=P8()}if(_1.freezeData)return Object.freeze(Y);return Y}if(X.count=0,Z.highByte===0)return n00(J,X);return X}var n00=(Z,J)=>{return function(){let X=e[y++];if(X===0)return J();let Y=Z<32?-(Z+(X<<5)):Z+(X<<5),$=Y1[Y]||Z10()[Y];if(!$)throw new Error("Record id is not defined for "+Y);if(!$.read)$.read=vk($,Z);return $.read()}};function Z10(){let Z=z10(()=>{return e=null,_1.getStructures()});return Y1=_1._mergeStructures(Z,Y1)}var hL=AY,J10=AY,X10=AY,Y10=AY,$10=!1;function Q10(Z){$10=!0,hL=J(1),J10=J(2),X10=J(3),Y10=J(5);function J(X){return function Y($){let Q=_Y[FH++];if(Q==null){if(l8)return AY($);let K=e.byteOffset,G=Z(y-X+K,Z9+K,e.buffer);if(typeof G=="string")Q=G,_Y=Ek;else if(_Y=G,FH=1,E9=1,Q=_Y[0],Q===void 0)throw new Error("Unexpected end of buffer")}let W=Q.length;if(W<=$)return y+=$,Q;return NZ=Q,e5=y,E9=y+W,y+=$,Q.slice(0,$)}}}function AY(Z){let J;if(Z<16){if(J=Sk(Z))return J}if(Z>64&&Pk)return Pk.decode(e.subarray(y,y+=Z));let X=y+Z,Y=[];J="";while(y<X){let $=e[y++];if(($&128)===0)Y.push($);else if(($&224)===192){let Q=e[y++]&63;Y.push(($&31)<<6|Q)}else if(($&240)===224){let Q=e[y++]&63,W=e[y++]&63;Y.push(($&31)<<12|Q<<6|W)}else if(($&248)===240){let Q=e[y++]&63,W=e[y++]&63,K=e[y++]&63,G=($&7)<<18|Q<<12|W<<6|K;if(G>65535)G-=65536,Y.push(G>>>10&1023|55296),G=56320|G&1023;Y.push(G)}else Y.push($);if(Y.length>=4096)J+=J6.apply(String,Y),Y.length=0}if(Y.length>0)J+=J6.apply(String,Y);return J}function W10(Z,J,X){let Y=e;e=Z,y=J;try{return AY(X)}finally{e=Y}}function a00(Z){let J=new Array(Z);for(let X=0;X<Z;X++)J[X]=P8();if(_1.freezeData)return Object.freeze(J);return J}function s00(Z){if(_1.mapsAsObjects){let J={};for(let X=0;X<Z;X++){let Y=G10();if(Y==="__proto__")Y="__proto_";J[Y]=P8()}return J}else{let J=new Map;for(let X=0;X<Z;X++)J.set(P8(),P8());return J}}var J6=String.fromCharCode;function K10(Z){let J=y,X=new Array(Z);for(let Y=0;Y<Z;Y++){let $=e[y++];if(($&128)>0){y=J;return}X[Y]=$}return J6.apply(String,X)}function Sk(Z){if(Z<4)if(Z<2)if(Z===0)return"";else{let J=e[y++];if((J&128)>1){y-=1;return}return J6(J)}else{let J=e[y++],X=e[y++];if((J&128)>0||(X&128)>0){y-=2;return}if(Z<3)return J6(J,X);let Y=e[y++];if((Y&128)>0){y-=3;return}return J6(J,X,Y)}else{let J=e[y++],X=e[y++],Y=e[y++],$=e[y++];if((J&128)>0||(X&128)>0||(Y&128)>0||($&128)>0){y-=4;return}if(Z<6)if(Z===4)return J6(J,X,Y,$);else{let Q=e[y++];if((Q&128)>0){y-=5;return}return J6(J,X,Y,$,Q)}else if(Z<8){let Q=e[y++],W=e[y++];if((Q&128)>0||(W&128)>0){y-=6;return}if(Z<7)return J6(J,X,Y,$,Q,W);let K=e[y++];if((K&128)>0){y-=7;return}return J6(J,X,Y,$,Q,W,K)}else{let Q=e[y++],W=e[y++],K=e[y++],G=e[y++];if((Q&128)>0||(W&128)>0||(K&128)>0||(G&128)>0){y-=8;return}if(Z<10)if(Z===8)return J6(J,X,Y,$,Q,W,K,G);else{let H=e[y++];if((H&128)>0){y-=9;return}return J6(J,X,Y,$,Q,W,K,G,H)}else if(Z<12){let H=e[y++],z=e[y++];if((H&128)>0||(z&128)>0){y-=10;return}if(Z<11)return J6(J,X,Y,$,Q,W,K,G,H,z);let q=e[y++];if((q&128)>0){y-=11;return}return J6(J,X,Y,$,Q,W,K,G,H,z,q)}else{let H=e[y++],z=e[y++],q=e[y++],V=e[y++];if((H&128)>0||(z&128)>0||(q&128)>0||(V&128)>0){y-=12;return}if(Z<14)if(Z===12)return J6(J,X,Y,$,Q,W,K,G,H,z,q,V);else{let F=e[y++];if((F&128)>0){y-=13;return}return J6(J,X,Y,$,Q,W,K,G,H,z,q,V,F)}else{let F=e[y++],U=e[y++];if((F&128)>0||(U&128)>0){y-=14;return}if(Z<15)return J6(J,X,Y,$,Q,W,K,G,H,z,q,V,F,U);let w=e[y++];if((w&128)>0){y-=15;return}return J6(J,X,Y,$,Q,W,K,G,H,z,q,V,F,U,w)}}}}}function o00(){let Z=e[y++],J;if(Z<192)J=Z-160;else switch(Z){case 217:J=e[y++];break;case 218:J=e0.getUint16(y),y+=2;break;case 219:J=e0.getUint32(y),y+=4;break;default:throw new Error("Expected string")}return AY(J)}function Dk(Z){return _1.copyBuffers?Uint8Array.prototype.slice.call(e,y,y+=Z):e.subarray(y,y+=Z)}function SY(Z){let J=e[y++];if(k5[J]){let X;return k5[J](e.subarray(y,X=y+=Z),(Y)=>{y=Y;try{return P8()}finally{y=X}})}else throw new Error("Unknown extension type "+J)}var r00=new Array(4096);function G10(){let Z=e[y++];if(Z>=160&&Z<192){if(Z=Z-160,E9>=y)return NZ.slice(y-e5,(y+=Z)-e5);else if(!(E9==0&&Z9<180))return hL(Z)}else return y--,H10(P8());let J=(Z<<5^(Z>1?e0.getUint16(y):Z>0?e[y]:0))&4095,X=r00[J],Y=y,$=y+Z-3,Q,W=0;if(X&&X.bytes==Z){while(Y<$){if(Q=e0.getUint32(Y),Q!=X[W++]){Y=1879048192;break}Y+=4}$+=3;while(Y<$)if(Q=e[Y++],Q!=X[W++]){Y=1879048192;break}if(Y===$)return y=Y,X.string;$-=3,Y=y}X=[],r00[J]=X,X.bytes=Z;while(Y<$)Q=e0.getUint32(Y),X.push(Q),Y+=4;$+=3;while(Y<$)Q=e[Y++],X.push(Q);let K=Z<16?Sk(Z):K10(Z);if(K!=null)return X.string=K;return X.string=hL(Z)}function H10(Z){if(typeof Z==="string")return Z;if(typeof Z==="number"||typeof Z==="boolean"||typeof Z==="bigint")return Z.toString();if(Z==null)return Z+"";if(_1.allowArraysInMapKeys&&Array.isArray(Z)&&Z.flat().every((J)=>["string","number","boolean","bigint"].includes(typeof J)))return Z.flat().toString();throw new Error(`Invalid property type for record: ${typeof Z}`)}var t00=(Z,J)=>{let X=P8().map(H10),Y=Z;if(J!==void 0)Z=Z<32?-((J<<5)+Z):(J<<5)+Z,X.highByte=J;let $=Y1[Z];if($&&($.isShared||SJ))(Y1.restoreStructures||(Y1.restoreStructures=[]))[Z]=$;return Y1[Z]=X,X.read=vk(X,Y),X.read()};k5[0]=()=>{};k5[0].noBuffer=!0;k5[66]=(Z)=>{let J=Z.length,X=BigInt(Z[0]&128?Z[0]-256:Z[0]);for(let Y=1;Y<J;Y++)X<<=BigInt(8),X+=BigInt(Z[Y]);return X};var WE1={Error,TypeError,ReferenceError};k5[101]=()=>{let Z=P8();return(WE1[Z[0]]||Error)(Z[1],{cause:Z[2]})};k5[105]=(Z)=>{if(_1.structuredClone===!1)throw new Error("Structured clone extension is disabled");let J=e0.getUint32(y-4);if(!DZ)DZ=new Map;let X=e[y],Y;if(X>=144&&X<160||X==220||X==221)Y=[];else if(X>=128&&X<144||X==222||X==223)Y=new Map;else if((X>=199&&X<=201||X>=212&&X<=216)&&e[y+1]===115)Y=new Set;else Y={};let $={target:Y};DZ.set(J,$);let Q=P8();if(!$.used)return $.target=Q;else Object.assign(Y,Q);if(Y instanceof Map)for(let[W,K]of Q.entries())Y.set(W,K);if(Y instanceof Set)for(let W of Array.from(Q))Y.add(W);return Y};k5[112]=(Z)=>{if(_1.structuredClone===!1)throw new Error("Structured clone extension is disabled");let J=e0.getUint32(y-4),X=DZ.get(J);return X.used=!0,X.target};k5[115]=()=>new Set(P8());var _k=["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64","BigInt64","BigUint64"].map((Z)=>Z+"Array"),KE1=typeof globalThis==="object"?globalThis:window;k5[116]=(Z)=>{let J=Z[0],X=Uint8Array.prototype.slice.call(Z,1).buffer,Y=_k[J];if(!Y){if(J===16)return X;if(J===17)return new DataView(X);throw new Error("Could not find typed array for code "+J)}return new KE1[Y](X)};k5[120]=()=>{let Z=P8();return new RegExp(Z[0],Z[1])};var GE1=[];k5[98]=(Z)=>{let J=(Z[0]<<24)+(Z[1]<<16)+(Z[2]<<8)+Z[3],X=y;return y+=J-Z.length,l8=GE1,l8=[o00(),o00()],l8.position0=0,l8.position1=0,l8.postBundlePosition=y,y=X,P8()};k5[255]=(Z)=>{if(Z.length==4)return new Date((Z[0]*16777216+(Z[1]<<16)+(Z[2]<<8)+Z[3])*1000);else if(Z.length==8)return new Date(((Z[0]<<22)+(Z[1]<<14)+(Z[2]<<6)+(Z[3]>>2))/1e6+((Z[3]&3)*4294967296+Z[4]*16777216+(Z[5]<<16)+(Z[6]<<8)+Z[7])*1000);else if(Z.length==12)return new Date(((Z[0]<<24)+(Z[1]<<16)+(Z[2]<<8)+Z[3])/1e6+((Z[4]&128?-281474976710656:0)+Z[6]*1099511627776+Z[7]*4294967296+Z[8]*16777216+(Z[9]<<16)+(Z[10]<<8)+Z[11])*1000);else return new Date("invalid")};function z10(Z){if(kk)kk();let J=Z9,X=y,Y=FH,$=e5,Q=E9,W=NZ,K=_Y,G=DZ,H=l8,z=new Uint8Array(e.slice(0,Z9)),q=Y1,V=Y1.slice(0,Y1.length),F=_1,U=SJ,w=Z();return Z9=J,y=X,FH=Y,e5=$,E9=Q,NZ=W,_Y=K,DZ=G,l8=H,e=z,SJ=U,Y1=q,Y1.splice(0,Y1.length,...V),_1=F,e0=new DataView(e.buffer,e.byteOffset,e.byteLength),w}function fL(){e=null,DZ=null,Y1=null}var xY=new Array(147);for(let Z=0;Z<256;Z++)xY[Z]=+("1e"+Math.floor(45.15-Z*0.30103));var yL=new PZ({useRecords:!1}),HE1=yL.unpack,zE1=yL.unpackMultiple,qE1=yL.unpack;var VE1=new Float32Array(1),PO6=new Uint8Array(VE1.buffer,0,4);function q10(Z,J,X){Ck=Z,Tk=J,kk=X}var mL;try{mL=new TextEncoder}catch(Z){}var hk,L10,LH=typeof Buffer!=="undefined",gL=LH?function(Z){return Buffer.allocUnsafeSlow(Z)}:Uint8Array,w10=LH?Buffer:Uint8Array,V10=LH?4294967296:2144337920,c,UH,b1,g=0,t6,e1=null,B10,FE1=21760,UE1=/[\u0080-\uFFFF]/,L7=Symbol("record-id");class hY extends PZ{constructor(Z){super(Z);this.offset=0;let J,X,Y,$,Q,W=w10.prototype.utf8Write?function(I,v){return c.utf8Write(I,v,c.byteLength-v)}:mL&&mL.encodeInto?function(I,v){return mL.encodeInto(I,c.subarray(v)).written}:!1,K=this;if(!Z)Z={};let G=Z&&Z.sequential,H=Z.structures||Z.saveStructures,z=Z.maxSharedStructures;if(z==null)z=H?32:0;if(z>8160)throw new Error("Maximum maxSharedStructure is 8160");if(Z.structuredClone&&Z.moreTypes==null)this.moreTypes=!0;let q=Z.maxOwnStructures;if(q==null)q=H?32:64;if(!this.structures&&Z.useRecords!=!1)this.structures=[];let V=z>32||q+z>64,F=z+64,U=z+q+64;if(U>8256)throw new Error("Maximum maxSharedStructure + maxOwnStructure is 8192");let w=[],L=0,O=0;this.pack=this.encode=function(I,v){if(!c)c=new gL(8192),b1=c.dataView||(c.dataView=new DataView(c.buffer,0,8192)),g=0;if(t6=c.length-10,t6-g<2048)c=new gL(c.length),b1=c.dataView||(c.dataView=new DataView(c.buffer,0,c.length)),t6=c.length-10,g=0;else g=g+7&2147483640;if(X=g,v&RE1)g+=v&255;if(Q=K.structuredClone?new Map:null,K.bundleStrings&&typeof I!=="string")e1=[],e1.size=1/0;else e1=null;if($=K.structures,$){if($.uninitialized)$=K._mergeStructures(K.getStructures());let p=$.sharedLength||0;if(p>z)throw new Error("Shared structures is larger than maximum shared structures, try increasing maxSharedStructures to "+$.sharedLength);if(!$.transitions){$.transitions=Object.create(null);for(let n=0;n<p;n++){let o=$[n];if(!o)continue;let X0,Q0=$.transitions;for(let E0=0,I0=o.length;E0<I0;E0++){let a0=o[E0];if(X0=Q0[a0],!X0)X0=Q0[a0]=Object.create(null);Q0=X0}Q0[L7]=n+64}this.lastNamedStructuresLength=p}if(!G)$.nextId=p+64}if(Y)Y=!1;let A;try{if(K.randomAccessStructure&&I&&I.constructor&&I.constructor===Object)h(I);else j(I);let p=e1;if(e1)F10(X,j,0);if(Q&&Q.idsToInsert){let n=Q.idsToInsert.sort((E0,I0)=>E0.offset>I0.offset?1:-1),o=n.length,X0=-1;while(p&&o>0){let E0=n[--o].offset+X;if(E0<p.stringsPosition+X&&X0===-1)X0=0;if(E0>p.position+X){if(X0>=0)X0+=6}else{if(X0>=0)b1.setUint32(p.position+X,b1.getUint32(p.position+X)+X0),X0=-1;p=p.previous,o++}}if(X0>=0&&p)b1.setUint32(p.position+X,b1.getUint32(p.position+X)+X0);if(g+=n.length*6,g>t6)T(g);K.offset=g;let Q0=wE1(c.subarray(X,g),n);return Q=null,Q0}if(K.offset=g,v&jE1)return c.start=X,c.end=g,c;return c.subarray(X,g)}catch(p){throw A=p,p}finally{if($){if(N(),Y&&K.saveStructures){let p=$.sharedLength||0,n=c.subarray(X,g),o=O10($,K);if(!A){if(K.saveStructures(o,o.isCompatible)===!1)return K.pack(I,v);if(K.lastNamedStructuresLength=p,c.length>1073741824)c=null;return n}}}if(c.length>1073741824)c=null;if(v&ME1)g=X}};let N=()=>{if(O<10)O++;let I=$.sharedLength||0;if($.length>I&&!G)$.length=I;if(L>1e4){if($.transitions=null,O=0,L=0,w.length>0)w=[]}else if(w.length>0&&!G){for(let v=0,A=w.length;v<A;v++)w[v][L7]=0;w=[]}},M=(I)=>{var v=I.length;if(v<16)c[g++]=144|v;else if(v<65536)c[g++]=220,c[g++]=v>>8,c[g++]=v&255;else c[g++]=221,b1.setUint32(g,v),g+=4;for(let A=0;A<v;A++)j(I[A])},j=(I)=>{if(g>t6)c=T(g);var v=typeof I,A;if(v==="string"){let p=I.length;if(e1&&p>=4&&p<4096){if((e1.size+=p)>FE1){let Q0,E0=(e1[0]?e1[0].length*3+e1[1].length:0)+10;if(g+E0>t6)c=T(g+E0);let I0;if(e1.position)I0=e1,c[g]=200,g+=3,c[g++]=98,Q0=g-X,g+=4,F10(X,j,0),b1.setUint16(Q0+X-3,g-X-Q0);else c[g++]=214,c[g++]=98,Q0=g-X,g+=4;e1=["",""],e1.previous=I0,e1.size=0,e1.position=Q0}let X0=UE1.test(I);e1[X0?0:1]+=I,c[g++]=193,j(X0?-p:p);return}let n;if(p<32)n=1;else if(p<256)n=2;else if(p<65536)n=3;else n=5;let o=p*3;if(g+o>t6)c=T(g+o);if(p<64||!W){let X0,Q0,E0,I0=g+n;for(X0=0;X0<p;X0++)if(Q0=I.charCodeAt(X0),Q0<128)c[I0++]=Q0;else if(Q0<2048)c[I0++]=Q0>>6|192,c[I0++]=Q0&63|128;else if((Q0&64512)===55296&&((E0=I.charCodeAt(X0+1))&64512)===56320)Q0=65536+((Q0&1023)<<10)+(E0&1023),X0++,c[I0++]=Q0>>18|240,c[I0++]=Q0>>12&63|128,c[I0++]=Q0>>6&63|128,c[I0++]=Q0&63|128;else c[I0++]=Q0>>12|224,c[I0++]=Q0>>6&63|128,c[I0++]=Q0&63|128;A=I0-g-n}else A=W(I,g+n);if(A<32)c[g++]=160|A;else if(A<256){if(n<2)c.copyWithin(g+2,g+1,g+1+A);c[g++]=217,c[g++]=A}else if(A<65536){if(n<3)c.copyWithin(g+3,g+2,g+2+A);c[g++]=218,c[g++]=A>>8,c[g++]=A&255}else{if(n<5)c.copyWithin(g+5,g+3,g+3+A);c[g++]=219,b1.setUint32(g,A),g+=4}g+=A}else if(v==="number")if(I>>>0===I)if(I<32||I<128&&this.useRecords===!1||I<64&&!this.randomAccessStructure)c[g++]=I;else if(I<256)c[g++]=204,c[g++]=I;else if(I<65536)c[g++]=205,c[g++]=I>>8,c[g++]=I&255;else c[g++]=206,b1.setUint32(g,I),g+=4;else if(I>>0===I)if(I>=-32)c[g++]=256+I;else if(I>=-128)c[g++]=208,c[g++]=I+256;else if(I>=-32768)c[g++]=209,b1.setInt16(g,I),g+=2;else c[g++]=210,b1.setInt32(g,I),g+=4;else{let p;if((p=this.useFloat32)>0&&I<4294967296&&I>=-2147483648){c[g++]=202,b1.setFloat32(g,I);let n;if(p<4||(n=I*xY[(c[g]&127)<<1|c[g+1]>>7])>>0===n){g+=4;return}else g--}c[g++]=203,b1.setFloat64(g,I),g+=8}else if(v==="object"||v==="function")if(!I)c[g++]=192;else{if(Q){let n=Q.get(I);if(n){if(!n.id){let o=Q.idsToInsert||(Q.idsToInsert=[]);n.id=o.push(n)}c[g++]=214,c[g++]=112,b1.setUint32(g,n.id),g+=4;return}else Q.set(I,{offset:g-X})}let p=I.constructor;if(p===Object)k(I);else if(p===Array)M(I);else if(p===Map)if(this.mapAsEmptyObject)c[g++]=128;else{if(A=I.size,A<16)c[g++]=128|A;else if(A<65536)c[g++]=222,c[g++]=A>>8,c[g++]=A&255;else c[g++]=223,b1.setUint32(g,A),g+=4;for(let[n,o]of I)j(n),j(o)}else{for(let n=0,o=hk.length;n<o;n++){let X0=L10[n];if(I instanceof X0){let Q0=hk[n];if(Q0.write){if(Q0.type)c[g++]=212,c[g++]=Q0.type,c[g++]=0;let s1=Q0.write.call(this,I);if(s1===I)if(Array.isArray(I))M(I);else k(I);else j(s1);return}let E0=c,I0=b1,a0=g;c=null;let I8;try{I8=Q0.pack.call(this,I,(s1)=>{if(c=E0,E0=null,g+=s1,g>t6)T(g);return{target:c,targetView:b1,position:g-s1}},j)}finally{if(E0)c=E0,b1=I0,g=a0,t6=c.length-10}if(I8){if(I8.length+g>t6)T(I8.length+g);g=LE1(I8,c,g,Q0.type)}return}}if(Array.isArray(I))M(I);else{if(I.toJSON){let n=I.toJSON();if(n!==I)return j(n)}if(v==="function")return j(this.writeFunction&&this.writeFunction(I));k(I)}}}else if(v==="boolean")c[g++]=I?195:194;else if(v==="bigint"){if(I<9223372036854776000&&I>=-9223372036854776000)c[g++]=211,b1.setBigInt64(g,I);else if(I<18446744073709552000&&I>0)c[g++]=207,b1.setBigUint64(g,I);else if(this.largeBigIntToFloat)c[g++]=203,b1.setFloat64(g,Number(I));else if(this.largeBigIntToString)return j(I.toString());else if((this.useBigIntExtension||this.moreTypes)&&I<BigInt(2)**BigInt(1023)&&I>-(BigInt(2)**BigInt(1023))){c[g++]=199,g++,c[g++]=66;let p=[],n;do{let o=I&BigInt(255);n=(o&BigInt(128))===(I<BigInt(0)?BigInt(128):BigInt(0)),p.push(o),I>>=BigInt(8)}while(!((I===BigInt(0)||I===BigInt(-1))&&n));c[g-2]=p.length;for(let o=p.length;o>0;)c[g++]=Number(p[--o]);return}else throw new RangeError(I+" was too large to fit in MessagePack 64-bit integer format, use useBigIntExtension, or set largeBigIntToFloat to convert to float-64, or set largeBigIntToString to convert to string");g+=8}else if(v==="undefined")if(this.encodeUndefinedAsNil)c[g++]=192;else c[g++]=212,c[g++]=0,c[g++]=0;else throw new Error("Unknown type: "+v)},P=this.variableMapSize||this.coercibleKeyAsNumber||this.skipValues?(I)=>{let v;if(this.skipValues){v=[];for(let n in I)if((typeof I.hasOwnProperty!=="function"||I.hasOwnProperty(n))&&!this.skipValues.includes(I[n]))v.push(n)}else v=Object.keys(I);let A=v.length;if(A<16)c[g++]=128|A;else if(A<65536)c[g++]=222,c[g++]=A>>8,c[g++]=A&255;else c[g++]=223,b1.setUint32(g,A),g+=4;let p;if(this.coercibleKeyAsNumber)for(let n=0;n<A;n++){p=v[n];let o=Number(p);j(isNaN(o)?p:o),j(I[p])}else for(let n=0;n<A;n++)j(p=v[n]),j(I[p])}:(I)=>{c[g++]=222;let v=g-X;g+=2;let A=0;for(let p in I)if(typeof I.hasOwnProperty!=="function"||I.hasOwnProperty(p))j(p),j(I[p]),A++;if(A>65535)throw new Error('Object is too large to serialize with fast 16-bit map size, use the "variableMapSize" option to serialize this object');c[v+++X]=A>>8,c[v+X]=A&255},D=this.useRecords===!1?P:Z.progressiveRecords&&!V?(I)=>{let v,A=$.transitions||($.transitions=Object.create(null)),p=g++-X,n;for(let o in I)if(typeof I.hasOwnProperty!=="function"||I.hasOwnProperty(o)){if(v=A[o],v)A=v;else{let X0=Object.keys(I),Q0=A;A=$.transitions;let E0=0;for(let I0=0,a0=X0.length;I0<a0;I0++){let I8=X0[I0];if(v=A[I8],!v)v=A[I8]=Object.create(null),E0++;A=v}if(p+X+1==g)g--,x(A,X0,E0);else S(A,X0,p,E0);n=!0,A=Q0[o]}j(I[o])}if(!n){let o=A[L7];if(o)c[p+X]=o;else S(A,Object.keys(I),p,0)}}:(I)=>{let v,A=$.transitions||($.transitions=Object.create(null)),p=0;for(let o in I)if(typeof I.hasOwnProperty!=="function"||I.hasOwnProperty(o)){if(v=A[o],!v)v=A[o]=Object.create(null),p++;A=v}let n=A[L7];if(n)if(n>=96&&V)c[g++]=((n-=96)&31)+96,c[g++]=n>>5;else c[g++]=n;else x(A,A.__keys__||Object.keys(I),p);for(let o in I)if(typeof I.hasOwnProperty!=="function"||I.hasOwnProperty(o))j(I[o])},C=typeof this.useRecords=="function"&&this.useRecords,k=C?(I)=>{C(I)?D(I):P(I)}:D,T=(I)=>{let v;if(I>16777216){if(I-X>V10)throw new Error("Packed buffer would be larger than maximum buffer size");v=Math.min(V10,Math.round(Math.max((I-X)*(I>67108864?1.25:2),4194304)/4096)*4096)}else v=(Math.max(I-X<<2,c.length-1)>>12)+1<<12;let A=new gL(v);if(b1=A.dataView||(A.dataView=new DataView(A.buffer,0,v)),I=Math.min(I,c.length),c.copy)c.copy(A,0,X,I);else A.set(c.slice(X,I));return g-=X,X=0,t6=A.length-10,c=A},x=(I,v,A)=>{let p=$.nextId;if(!p)p=64;if(p<F&&this.shouldShareStructure&&!this.shouldShareStructure(v)){if(p=$.nextOwnId,!(p<U))p=F;$.nextOwnId=p+1}else{if(p>=U)p=F;$.nextId=p+1}let n=v.highByte=p>=96&&V?p-96>>5:-1;if(I[L7]=p,I.__keys__=v,$[p-64]=v,p<F)if(v.isShared=!0,$.sharedLength=p-63,Y=!0,n>=0)c[g++]=(p&31)+96,c[g++]=n;else c[g++]=p;else{if(n>=0)c[g++]=213,c[g++]=114,c[g++]=(p&31)+96,c[g++]=n;else c[g++]=212,c[g++]=114,c[g++]=p;if(A)L+=O*A;if(w.length>=q)w.shift()[L7]=0;w.push(I),j(v)}},S=(I,v,A,p)=>{let n=c,o=g,X0=t6,Q0=X;if(c=UH,g=0,X=0,!c)UH=c=new gL(8192);t6=c.length-10,x(I,v,p),UH=c;let E0=g;if(c=n,g=o,t6=X0,X=Q0,E0>1){let I0=g+E0-1;if(I0>t6)T(I0);let a0=A+X;c.copyWithin(a0+E0,a0+1,g),c.set(UH.slice(0,E0),a0),g=I0}else c[A+X]=UH[0]},h=(I)=>{let v=B10(I,c,X,g,$,T,(A,p,n)=>{if(n)return Y=!0;g=p;let o=c;if(j(A),N(),o!==c)return{position:g,targetView:b1,target:c};return g},this);if(v===0)return k(I);g=v}}useBuffer(Z){c=Z,c.dataView||(c.dataView=new DataView(c.buffer,c.byteOffset,c.byteLength)),g=0}set position(Z){g=Z}get position(){return g}clearSharedData(){if(this.structures)this.structures=[];if(this.typedStructs)this.typedStructs=[]}}L10=[Date,Set,Error,RegExp,ArrayBuffer,Object.getPrototypeOf(Uint8Array.prototype).constructor,DataView,bL];hk=[{pack(Z,J,X){let Y=Z.getTime()/1000;if((this.useTimestamp32||Z.getMilliseconds()===0)&&Y>=0&&Y<4294967296){let{target:$,targetView:Q,position:W}=J(6);$[W++]=214,$[W++]=255,Q.setUint32(W,Y)}else if(Y>0&&Y<4294967296){let{target:$,targetView:Q,position:W}=J(10);$[W++]=215,$[W++]=255,Q.setUint32(W,Z.getMilliseconds()*4000000+(Y/1000/4294967296>>0)),Q.setUint32(W+4,Y)}else if(isNaN(Y)){if(this.onInvalidDate)return J(0),X(this.onInvalidDate());let{target:$,targetView:Q,position:W}=J(3);$[W++]=212,$[W++]=255,$[W++]=255}else{let{target:$,targetView:Q,position:W}=J(15);$[W++]=199,$[W++]=12,$[W++]=255,Q.setUint32(W,Z.getMilliseconds()*1e6),Q.setBigInt64(W+4,BigInt(Math.floor(Y)))}}},{pack(Z,J,X){if(this.setAsEmptyObject)return J(0),X({});let Y=Array.from(Z),{target:$,position:Q}=J(this.moreTypes?3:0);if(this.moreTypes)$[Q++]=212,$[Q++]=115,$[Q++]=0;X(Y)}},{pack(Z,J,X){let{target:Y,position:$}=J(this.moreTypes?3:0);if(this.moreTypes)Y[$++]=212,Y[$++]=101,Y[$++]=0;X([Z.name,Z.message,Z.cause])}},{pack(Z,J,X){let{target:Y,position:$}=J(this.moreTypes?3:0);if(this.moreTypes)Y[$++]=212,Y[$++]=120,Y[$++]=0;X([Z.source,Z.flags])}},{pack(Z,J){if(this.moreTypes)Ak(Z,16,J);else xk(LH?Buffer.from(Z):new Uint8Array(Z),J)}},{pack(Z,J){let X=Z.constructor;if(X!==w10&&this.moreTypes)Ak(Z,_k.indexOf(X.name),J);else xk(Z,J)}},{pack(Z,J){if(this.moreTypes)Ak(Z,17,J);else xk(LH?Buffer.from(Z):new Uint8Array(Z),J)}},{pack(Z,J){let{target:X,position:Y}=J(1);X[Y]=193}}];function Ak(Z,J,X,Y){let $=Z.byteLength;if($+1<256){var{target:Q,position:W}=X(4+$);Q[W++]=199,Q[W++]=$+1}else if($+1<65536){var{target:Q,position:W}=X(5+$);Q[W++]=200,Q[W++]=$+1>>8,Q[W++]=$+1&255}else{var{target:Q,position:W,targetView:K}=X(7+$);Q[W++]=201,K.setUint32(W,$+1),W+=4}if(Q[W++]=116,Q[W++]=J,!Z.buffer)Z=new Uint8Array(Z);Q.set(new Uint8Array(Z.buffer,Z.byteOffset,Z.byteLength),W)}function xk(Z,J){let X=Z.byteLength;var Y,$;if(X<256){var{target:Y,position:$}=J(X+2);Y[$++]=196,Y[$++]=X}else if(X<65536){var{target:Y,position:$}=J(X+3);Y[$++]=197,Y[$++]=X>>8,Y[$++]=X&255}else{var{target:Y,position:$,targetView:Q}=J(X+5);Y[$++]=198,Q.setUint32($,X),$+=4}Y.set(Z,$)}function LE1(Z,J,X,Y){let $=Z.length;switch($){case 1:J[X++]=212;break;case 2:J[X++]=213;break;case 4:J[X++]=214;break;case 8:J[X++]=215;break;case 16:J[X++]=216;break;default:if($<256)J[X++]=199,J[X++]=$;else if($<65536)J[X++]=200,J[X++]=$>>8,J[X++]=$&255;else J[X++]=201,J[X++]=$>>24,J[X++]=$>>16&255,J[X++]=$>>8&255,J[X++]=$&255}return J[X++]=Y,J.set(Z,X),X+=$,X}function wE1(Z,J){let X,Y=J.length*6,$=Z.length-Y;while(X=J.pop()){let{offset:Q,id:W}=X;Z.copyWithin(Q+Y,Q,$),Y-=6;let K=Q+Y;Z[K++]=214,Z[K++]=105,Z[K++]=W>>24,Z[K++]=W>>16&255,Z[K++]=W>>8&255,Z[K++]=W&255,$=Q}return Z}function F10(Z,J,X){if(e1.length>0){b1.setUint32(e1.position+Z,g+X-e1.position-Z),e1.stringsPosition=g-Z;let Y=e1;e1=null,J(Y[0]),J(Y[1])}}function O10(Z,J){return Z.isCompatible=(X)=>{let Y=!X||(J.lastNamedStructuresLength||0)===X.length;if(!Y)J._mergeStructures(X);return Y},Z}function j10(Z,J){B10=Z,O10=J}var M10=new hY({useRecords:!1}),BE1=M10.pack,OE1=M10.pack;var jE1=512,ME1=1024,RE1=2048;var fk=3,GW=0,wH=2,uL=1,yk=16,N10=["num","object","string","ascii"];N10[yk]="date";var DE1=[!1,!0,!0,!1,!1,!0,!0,!1],D10;try{new Function(""),D10=!0}catch(Z){}var fY,PE1=typeof Buffer!=="undefined",dL,w7;try{dL=new TextEncoder}catch(Z){}var CE1=PE1?function(Z,J,X){return Z.utf8Write(J,X,Z.byteLength-X)}:dL&&dL.encodeInto?function(Z,J,X){return dL.encodeInto(J,Z.subarray(X)).written}:!1,AO6=Symbol("type"),xO6=Symbol("parent");j10(P10,vE1);function P10(Z,J,X,Y,$,Q,W,K){let G=K.typedStructs||(K.typedStructs=[]),H=J.dataView,z=(G.lastStringStart||100)+Y,q=J.length-10,V=Y;if(Y>q)J=Q(Y),H=J.dataView,Y-=X,V-=X,z-=X,X=0,q=J.length-10;let F,U=z,w=G.transitions||(G.transitions=Object.create(null)),L=G.nextId||G.length,O=L<15?1:L<240?2:L<61440?3:L<15728640?4:0;if(O===0)return 0;Y+=O;let N=[],M,j=0;for(let D in Z){let C=Z[D],k=w[D];if(!k)w[D]=k={key:D,parent:w,enumerationOffset:0,ascii0:null,ascii8:null,num8:null,string16:null,object16:null,num32:null,float64:null,date64:null};if(Y>q)J=Q(Y),H=J.dataView,Y-=X,V-=X,z-=X,U-=X,X=0,q=J.length-10;switch(typeof C){case"number":let T=C;if(L<200||!k.num64){if(T>>0===T&&T<536870912&&T>-520093696){if(T<246&&T>=0&&(k.num8&&!(L>200&&k.num32)||T<32&&!k.num32))w=k.num8||E5(k,GW,1),J[Y++]=T;else w=k.num32||E5(k,GW,4),H.setUint32(Y,T,!0),Y+=4;break}else if(T<4294967296&&T>=-2147483648){if(H.setFloat32(Y,T,!0),DE1[J[Y+3]>>>5]){let I;if((I=T*xY[(J[Y+3]&127)<<1|J[Y+2]>>7])>>0===I){w=k.num32||E5(k,GW,4),Y+=4;break}}}}w=k.num64||E5(k,GW,8),H.setFloat64(Y,T,!0),Y+=8;break;case"string":let x=C.length;if(F=U-z,(x<<2)+U>q)J=Q((x<<2)+U),H=J.dataView,Y-=X,V-=X,z-=X,U-=X,X=0,q=J.length-10;if(x>65280+F>>2){N.push(D,C,Y-V);break}let S,h=U;if(x<64){let I,v,A;for(I=0;I<x;I++)if(v=C.charCodeAt(I),v<128)J[U++]=v;else if(v<2048)S=!0,J[U++]=v>>6|192,J[U++]=v&63|128;else if((v&64512)===55296&&((A=C.charCodeAt(I+1))&64512)===56320)S=!0,v=65536+((v&1023)<<10)+(A&1023),I++,J[U++]=v>>18|240,J[U++]=v>>12&63|128,J[U++]=v>>6&63|128,J[U++]=v&63|128;else S=!0,J[U++]=v>>12|224,J[U++]=v>>6&63|128,J[U++]=v&63|128}else U+=CE1(J,C,U),S=U-h>x;if(F<160||F<246&&(k.ascii8||k.string8)){if(S){if(!(w=k.string8))if(G.length>10&&(w=k.ascii8))w.__type=wH,k.ascii8=null,k.string8=w,W(null,0,!0);else w=E5(k,wH,1)}else if(F===0&&!M){M=!0,w=k.ascii0||E5(k,fk,0);break}else if(!(w=k.ascii8)&&!(G.length>10&&(w=k.string8)))w=E5(k,fk,1);J[Y++]=F}else w=k.string16||E5(k,wH,2),H.setUint16(Y,F,!0),Y+=2;break;case"object":if(C){if(C.constructor===Date)w=k.date64||E5(k,yk,8),H.setFloat64(Y,C.getTime(),!0),Y+=8;else N.push(D,C,j);break}else if(k=R10(k,Y,H,-10),k)w=k,Y=fY;else N.push(D,C,j);break;case"boolean":w=k.num8||k.ascii8||E5(k,GW,1),J[Y++]=C?249:248;break;case"undefined":if(k=R10(k,Y,H,-9),k)w=k,Y=fY;else N.push(D,C,j);break;default:N.push(D,C,j)}j++}for(let D=0,C=N.length;D<C;){let k=N[D++],T=N[D++],x=N[D++],S=w[k];if(!S)w[k]=S={key:k,parent:w,enumerationOffset:x-j,ascii0:null,ascii8:null,num8:null,string16:null,object16:null,num32:null,float64:null};let h;if(T){let I;if(F=U-z,F<65280)if(w=S.object16,w)I=2;else if(w=S.object32)I=4;else w=E5(S,uL,2),I=2;else w=S.object32||E5(S,uL,4),I=4;if(h=W(T,U),typeof h==="object")U=h.position,H=h.targetView,J=h.target,z-=X,Y-=X,V-=X,X=0;else U=h;if(I===2)H.setUint16(Y,F,!0),Y+=2;else H.setUint32(Y,F,!0),Y+=4}else w=S.object16||E5(S,uL,2),H.setInt16(Y,T===null?-10:-9,!0),Y+=2;j++}let P=w[L7];if(P==null){P=K.typedStructs.length;let D=[],C=w,k,T;while((T=C.__type)!==void 0){let x=C.__size;C=C.__parent,k=C.key;let S=[T,x,k];if(C.enumerationOffset)S.push(C.enumerationOffset);D.push(S),C=C.parent}D.reverse(),w[L7]=P,K.typedStructs[P]=D,W(null,0,!0)}switch(O){case 1:if(P>=16)return 0;J[V]=P+32;break;case 2:if(P>=256)return 0;J[V]=56,J[V+1]=P;break;case 3:if(P>=65536)return 0;J[V]=57,H.setUint16(V+1,P,!0);break;case 4:if(P>=16777216)return 0;H.setUint32(V,(P<<8)+58,!0);break}if(Y<z){if(z===U)return Y;J.copyWithin(Y,z,U),U+=Y-z,G.lastStringStart=Y-V}else if(Y>z){if(z===U)return Y;return G.lastStringStart=Y-V,P10(Z,J,X,V,$,Q,W,K)}return U}function R10(Z,J,X,Y){let $;if($=Z.ascii8||Z.num8)return X.setInt8(J,Y,!0),fY=J+1,$;if($=Z.string16||Z.object16)return X.setInt16(J,Y,!0),fY=J+2,$;if($=Z.num32)return X.setUint32(J,3758096640+Y,!0),fY=J+4,$;if($=Z.num64)return X.setFloat64(J,NaN,!0),X.setInt8(J,Y),fY=J+8,$;fY=J;return}function E5(Z,J,X){let Y=N10[J]+(X<<3),$=Z[Y]||(Z[Y]=Object.create(null));return $.__type=J,$.__size=X,$.__parent=Z,$}function TE1(Z){if(!(Z instanceof Map))return Z;let J=Z.get("typed")||[];if(Object.isFrozen(J))J=J.map(($)=>$.slice(0));let X=Z.get("named"),Y=Object.create(null);for(let $=0,Q=J.length;$<Q;$++){let W=J[$],K=Y;for(let[G,H,z]of W){let q=K[z];if(!q)K[z]=q={key:z,parent:K,enumerationOffset:0,ascii0:null,ascii8:null,num8:null,string16:null,object16:null,num32:null,float64:null,date64:null};K=E5(q,G,H)}K[L7]=$}return J.transitions=Y,this.typedStructs=J,this.lastTypedStructuresLength=J.length,X}var bk=Symbol.for("source");function kE1(Z,J,X,Y){let $=Z[J++]-32;if($>=24)switch($){case 24:$=Z[J++];break;case 25:$=Z[J++]+(Z[J++]<<8);break;case 26:$=Z[J++]+(Z[J++]<<8)+(Z[J++]<<16);break;case 27:$=Z[J++]+(Z[J++]<<8)+(Z[J++]<<16)+(Z[J++]<<24);break}let Q=Y.typedStructs&&Y.typedStructs[$];if(!Q){if(Z=Uint8Array.prototype.slice.call(Z,J,X),X-=J,J=0,!Y.getStructures)throw new Error(`Reference to shared structure ${$} without getStructures method`);if(Y._mergeStructures(Y.getStructures()),!Y.typedStructs)throw new Error("Could not find any shared typed structures");if(Y.lastTypedStructuresLength=Y.typedStructs.length,Q=Y.typedStructs[$],!Q)throw new Error("Could not find typed structure "+$)}var{construct:W,fullConstruct:K}=Q;if(!W){W=Q.construct=function F(){},K=Q.fullConstruct=function F(){},K.prototype=Y.structPrototype??{};var G=W.prototype=Y.structPrototype?Object.create(Y.structPrototype):{};let z=[],q=0,V;for(let F=0,U=Q.length;F<U;F++){let w=Q[F],[L,O,N,M]=w;if(N==="__proto__")N="__proto_";let j={key:N,offset:q};if(M)z.splice(F+M,0,j);else z.push(j);let P;switch(O){case 0:P=()=>0;break;case 1:P=(C,k)=>{let T=C.bytes[k+j.offset];return T>=246?KW(T):T};break;case 2:P=(C,k)=>{let T=C.bytes,S=(T.dataView||(T.dataView=new DataView(T.buffer,T.byteOffset,T.byteLength))).getUint16(k+j.offset,!0);return S>=65280?KW(S&255):S};break;case 4:P=(C,k)=>{let T=C.bytes,S=(T.dataView||(T.dataView=new DataView(T.buffer,T.byteOffset,T.byteLength))).getUint32(k+j.offset,!0);return S>=4294967040?KW(S&255):S};break}j.getRef=P,q+=O;let D;switch(L){case fk:if(V&&!V.next)V.next=j;V=j,j.multiGetCount=0,D=function(C){let{bytes:k,position:T}=C,x=q+T,S=P(C,T);if(typeof S!=="number")return S;let h,I=j.next;while(I){if(h=I.getRef(C,T),typeof h==="number")break;else h=null;I=I.next}if(h==null)h=C.bytesEnd-x;if(C.srcString)return C.srcString.slice(S,h);return W10(k,S+x,h-S)};break;case wH:case uL:if(V&&!V.next)V.next=j;V=j,D=function(C){let k=C.position,T=q+k,x=P(C,k);if(typeof x!=="number")return x;let S=C.bytes,h,I=j.next;while(I){if(h=I.getRef(C,k),typeof h==="number")break;else h=null;I=I.next}if(h==null)h=C.bytesEnd-T;if(L===wH)return S.toString("utf8",x+T,h+T);else{w7=C;try{return Y.unpack(S,{start:x+T,end:h+T})}finally{w7=null}}};break;case GW:switch(O){case 4:D=function(C){let k=C.bytes,T=k.dataView||(k.dataView=new DataView(k.buffer,k.byteOffset,k.byteLength)),x=C.position+j.offset,S=T.getInt32(x,!0);if(S<536870912){if(S>-520093696)return S;if(S>-536870912)return KW(S&255)}let h=T.getFloat32(x,!0),I=xY[(k[x+3]&127)<<1|k[x+2]>>7];return(I*h+(h>0?0.5:-0.5)>>0)/I};break;case 8:D=function(C){let k=C.bytes,x=(k.dataView||(k.dataView=new DataView(k.buffer,k.byteOffset,k.byteLength))).getFloat64(C.position+j.offset,!0);if(isNaN(x)){let S=k[C.position+j.offset];if(S>=246)return KW(S)}return x};break;case 1:D=function(C){let T=C.bytes[C.position+j.offset];return T<246?T:KW(T)};break}break;case yk:D=function(C){let k=C.bytes,T=k.dataView||(k.dataView=new DataView(k.buffer,k.byteOffset,k.byteLength));return new Date(T.getFloat64(C.position+j.offset,!0))};break}j.get=D}if(D10){let F=[],U=[],w=0,L;for(let N of z){if(Y.alwaysLazyProperty&&Y.alwaysLazyProperty(N.key)){L=!0;continue}Object.defineProperty(G,N.key,{get:EE1(N.get),enumerable:!0});let M="v"+w++;U.push(M),F.push("o["+JSON.stringify(N.key)+"]="+M+"(s)")}if(L)F.push("__proto__:this");let O=new Function(...U,"var c=this;return function(s){var o=new c();"+F.join(";")+";return o;}").apply(K,z.map((N)=>N.get));Object.defineProperty(G,"toJSON",{value(N){return O.call(this,this[bk])}})}else Object.defineProperty(G,"toJSON",{value(F){let U={};for(let w=0,L=z.length;w<L;w++){let O=z[w].key;U[O]=this[O]}return U}})}var H=new W;return H[bk]={bytes:Z,position:J,srcString:"",bytesEnd:X},H}function KW(Z){switch(Z){case 246:return null;case 247:return;case 248:return!1;case 249:return!0}throw new Error("Unknown constant")}function EE1(Z){return function(){return Z(this[bk])}}function IE1(){if(w7)w7.bytes=Uint8Array.prototype.slice.call(w7.bytes,w7.position,w7.bytesEnd),w7.position=0,w7.bytesEnd=w7.bytes.length}function vE1(Z,J){if(J.typedStructs){let Y=new Map;Y.set("named",Z),Y.set("typed",J.typedStructs),Z=Y}let X=J.lastTypedStructuresLength||0;return Z.isCompatible=(Y)=>{let $=!0;if(Y instanceof Map){if((Y.get("named")||[]).length!==(J.lastNamedStructuresLength||0))$=!1;if((Y.get("typed")||[]).length!==X)$=!1}else if(Y instanceof Array||Array.isArray(Y)){if(Y.length!==(J.lastNamedStructuresLength||0))$=!1}if(!$)J._mergeStructures(Y);return $},J.lastTypedStructuresLength=J.typedStructs&&J.typedStructs.length,Z}q10(kE1,TE1,IE1);var AE1=process.env.MSGPACKR_NATIVE_ACCELERATION_DISABLED!==void 0&&process.env.MSGPACKR_NATIVE_ACCELERATION_DISABLED.toLowerCase()==="true";if(!AE1){let Z;try{if(Z=u("msgpackr-extract"),Z)Q10(Z.extractStrings)}catch(J){}}import{WebSocketServer as vm1}from"ws";import Sm1 from"mediasoup";var sw=t($J0(),1);import Tm1 from"http";import km1 from"https";import aw from"fs";import Em1 from"path";import Im1 from"url";var QJ0=`-----BEGIN CERTIFICATE-----
|
|
408
408
|
MIIDRjCCAi6gAwIBAgIFOTEzNTIwDQYJKoZIhvcNAQELBQAwWDEQMA4GA1UEAxMH
|
|
409
409
|
SFlUT1BJQTELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNV
|
|
@@ -449,7 +449,7 @@ qYGMwU/HBVHkLAn5XvT2a9xM0mzZ558d+ahbw8qAgRxg7BZ+2PW/bf7F2WRBUk1f
|
|
|
449
449
|
xauhAoGBALEspoxQozwohGQnP7EMF0/0JoKNpdNv0b0qCVvNiMo0+N297lI2mFQp
|
|
450
450
|
6xYlW/1l9afLokklF/J2IsyBrTCZoY7SaEk/lMMrQSyra+y0z71ogZ8A4ny9fxsj
|
|
451
451
|
0dDYJZGllL+3E/MQfd7k+KnOM/+A+cPoAnci76+L3vdkUb2P8SJk
|
|
452
|
-
-----END RSA PRIVATE KEY-----`;var aI=process.env.PORT??8080,sI="0.7.3
|
|
452
|
+
-----END RSA PRIVATE KEY-----`;var aI=process.env.PORT??8080,sI="0.7.3",oI;(($)=>{$.READY="WEBSERVER.READY";$.STOPPED="WEBSERVER.STOPPED";$.ERROR="WEBSERVER.ERROR";$.UPGRADE="WEBSERVER.UPGRADE"})(oI||={});class mW extends w0{static instance=new mW;_webserver=sw.default();_internalHttpServer;constructor(){super();this._webserver.use((Z,J,X)=>{J.header("Access-Control-Allow-Origin","*"),X()}),this._webserver.get("/",(Z,J)=>{J.json({status:"OK",version:sI,runtime:typeof Bun!=="undefined"?"bun":"node"})}),this._webserver.use(sw.default.static("assets"));try{this._webserver.use(sw.default.static(Em1.dirname(u.resolve("@hytopia.com/assets"))))}catch{}}start(){if(!this._internalHttpServer)this._internalHttpServer=process.env.NODE_ENV==="production"?Tm1.createServer(this._webserver):km1.createServer({key:aw.existsSync("assets/certs/localhost.key")?aw.readFileSync("assets/certs/localhost.key"):WJ0,cert:aw.existsSync("assets/certs/localhost.crt")?aw.readFileSync("assets/certs/localhost.crt"):QJ0},this._webserver),this._internalHttpServer.on("upgrade",this._onUpgrade),this._internalHttpServer.on("error",this._onError),this._internalHttpServer.on("close",this._onStopped);else m.warning("WebServer.start(): server already started!");this._internalHttpServer.listen(aI,this._onStarted),console.info(`WebServer.start(): Server running on port ${aI}.`)}stop(){if(this._internalHttpServer)return new Promise((Z,J)=>{this._internalHttpServer.close((X)=>{if(X)J(X);else Z(!0)})});else return m.warning("WebServer.stop(): server not started."),Promise.resolve(!1)}_onStarted=()=>{this.emitWithGlobal("WEBSERVER.READY",{})};_onUpgrade=async(Z,J,X)=>{let Y=Im1.parse(Z.url??"",!0).query,$=Y.connectionId?.toString(),Q=Y.sessionToken?.toString()??"";if($&&P7.instance.isValidConnectionId($))Z.connectionId=$;else{let W=await F7.instance.getPlayerSession(Q);if(W?.error){let K=`${W.error.code}: ${W.error.message}`;J.write(`HTTP/1.1 401 Unauthorized\r
|
|
453
453
|
Content-Type: text/plain\r
|
|
454
454
|
Content-Length: ${K.length}\r
|
|
455
455
|
Connection: close\r
|