hytopia 0.5.3 → 0.5.4
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.lock +2 -1
- package/package.json +3 -2
- package/server.js +1 -1
package/bun.lock
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "hytopia",
|
3
|
-
"version": "0.5.
|
3
|
+
"version": "0.5.4",
|
4
4
|
"description": "The HYTOPIA SDK makes it easy for developers to create massively multiplayer games using JavaScript or TypeScript.",
|
5
5
|
"main": "server.js",
|
6
6
|
"bin": {
|
@@ -48,9 +48,10 @@
|
|
48
48
|
},
|
49
49
|
"homepage": "https://github.com/hytopiagg/sdk#readme",
|
50
50
|
"dependencies": {
|
51
|
+
"@gltf-transform/cli": "4.1.1",
|
51
52
|
"archiver": "^7.0.1",
|
52
53
|
"mediasoup": "3.15.7",
|
53
|
-
"
|
54
|
+
"sharp": "0.33.5"
|
54
55
|
},
|
55
56
|
"trustedDependencies": [
|
56
57
|
"mediasoup",
|
package/server.js
CHANGED
@@ -402,7 +402,7 @@ For example, you can use the \`pathToFileURL()\` method of the \`url\` core modu
|
|
402
402
|
`,concatBytes:yM},M$1=(J,Z)=>{let X=new Uint8Array(J.length+Z.length);return X.set(J,0),X.set(Z,J.length),X},R$1={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:M$1};import{Buffer as N$1}from"buffer";var Kg=(J,Z)=>J?void 0:P$1.bind(void 0,Z),P$1=function*(J,Z){if(typeof Z!=="string"&&!C8(Z)&&!N$1.isBuffer(Z))throw new TypeError(`The \`${J}\` option's transform must use "objectMode: true" to receive as input: ${typeof Z}.`);yield Z},Gg=(J,Z)=>J?D$1.bind(void 0,Z):C$1.bind(void 0,Z),D$1=function*(J,Z){zg(J,Z),yield Z},C$1=function*(J,Z){if(zg(J,Z),typeof Z!=="string"&&!C8(Z))throw new TypeError(`The \`${J}\` option's function must yield a string or an Uint8Array, not ${typeof Z}.`);yield Z},zg=(J,Z)=>{if(Z===null||Z===void 0)throw new TypeError(`The \`${J}\` option's function must not call \`yield ${Z}\`.
|
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 T$1}from"buffer";import{StringDecoder as k$1}from"string_decoder";var ZV=(J,Z,X)=>{if(X)return;if(J)return{transform:E$1.bind(void 0,new TextEncoder)};let Y=new k$1(Z);return{transform:I$1.bind(void 0,Y),final:v$1.bind(void 0,Y)}},E$1=function*(J,Z){if(T$1.isBuffer(Z))yield Q7(Z);else if(typeof Z==="string")yield J.encode(Z);else yield Z},I$1=function*(J,Z){yield C8(Z)?J.write(Z):Z},v$1=function*(J){let Z=J.end();if(Z!=="")yield Z};import{callbackify as Fg}from"util";var bM=Fg(async(J,Z,X,Y)=>{Z.currentIterable=J(...X);try{for await(let $ of Z.currentIterable)Y.push($)}finally{delete Z.currentIterable}}),XV=async function*(J,Z,X){if(X===Z.length){yield J;return}let{transform:Y=_$1}=Z[X];for await(let $ of Y(J))yield*XV($,Z,X+1)},Hg=async function*(J){for(let[Z,{final:X}]of Object.entries(J))yield*S$1(X,Number(Z),J)},S$1=async function*(J,Z,X){if(J===void 0)return;for await(let Y of J())yield*XV(Y,X,Z+1)},qg=Fg(async({currentIterable:J},Z)=>{if(J!==void 0){await(Z?J.throw(Z):J.return());return}if(Z)throw Z}),_$1=function*(J){yield J};var gM=(J,Z,X,Y)=>{try{for(let $ of J(...Z))X.push($);Y()}catch($){Y($)}},Vg=(J,Z)=>[...Z.flatMap((X)=>[...sZ(X,J,0)]),...cK(J)],sZ=function*(J,Z,X){if(X===Z.length){yield J;return}let{transform:Y=A$1}=Z[X];for(let $ of Y(J))yield*sZ($,Z,X+1)},cK=function*(J){for(let[Z,{final:X}]of Object.entries(J))yield*x$1(X,Number(Z),J)},x$1=function*(J,Z,X){if(J===void 0)return;for(let Y of J())yield*sZ(Y,X,Z+1)},A$1=function*(J){yield J};var mM=({value:J,value:{transform:Z,final:X,writableObjectMode:Y,readableObjectMode:$},optionName:W},{encoding:Q})=>{let K={},G=wg(J,Q,W),z=aZ(Z),F=aZ(X),H=z?bM.bind(void 0,XV,K):gM.bind(void 0,sZ),q=z||F?bM.bind(void 0,Hg,K):gM.bind(void 0,cK),V=z||F?qg.bind(void 0,K):void 0;return{stream:new h$1({writableObjectMode:Y,writableHighWaterMark:Ug(Y),readableObjectMode:$,readableHighWaterMark:Ug($),transform(L,w,j){H([L,G,0],this,j)},flush(L){q([G],this,L)},destroy:V})}},YV=(J,Z,X,Y)=>{let $=Z.filter(({type:Q})=>Q==="generator"),W=Y?$.reverse():$;for(let{value:Q,optionName:K}of W){let G=wg(Q,X,K);J=Vg(G,J)}return J},wg=({transform:J,final:Z,binary:X,writableObjectMode:Y,readableObjectMode:$,preserveNewlines:W},Q,K)=>{let G={};return[{transform:Kg(Y,K)},ZV(X,Q,Y),JV(X,W,Y,G),{transform:J,final:Z},{transform:Gg($,K)},Qg({binary:X,preserveNewlines:W,readableObjectMode:$,state:G})].filter(Boolean)};var Lg=(J,Z)=>{for(let X of y$1(J))f$1(J,X,Z)},y$1=(J)=>new Set(Object.entries(J).filter(([,{direction:Z}])=>Z==="input").map(([Z])=>Number(Z))),f$1=(J,Z,X)=>{let{stdioItems:Y}=J[Z],$=Y.filter(({contents:K})=>K!==void 0);if($.length===0)return;if(Z!==0){let[{type:K,optionName:G}]=$;throw new TypeError(`Only the \`stdin\` option, not \`${G}\`, can be ${KJ[K]} with synchronous methods.`)}let Q=$.map(({contents:K})=>K).map((K)=>b$1(K,Y));X.input=hK(Q)},b$1=(J,Z)=>{let X=YV(J,Z,"utf8",!0);return g$1(X),hK(X)},g$1=(J)=>{let Z=J.find((X)=>typeof X!=="string"&&!C8(X));if(Z!==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: ${Z}.`)};import{writeFileSync as c$1,appendFileSync as l$1}from"fs";var $V=({stdioItems:J,encoding:Z,verboseInfo:X,fdNumber:Y})=>Y!=="all"&&L$(X,Y)&&!U5.has(Z)&&m$1(Y)&&(J.some(({type:$,value:W})=>$==="native"&&d$1.has(W))||J.every(({type:$})=>A5.has($))),m$1=(J)=>J===1||J===2,d$1=new Set(["pipe","overlapped"]),Bg=async(J,Z,X,Y)=>{for await(let $ of J)if(!u$1(Z))Og($,X,Y)},jg=(J,Z,X)=>{for(let Y of J)Og(Y,Z,X)},u$1=(J)=>J._readableState.pipes.length>0,Og=(J,Z,X)=>{let Y=wq(J);$4({type:"output",verboseMessage:Y,fdNumber:Z,verboseInfo:X})};var Mg=({fileDescriptors:J,syncResult:{output:Z},options:X,isMaxBuffer:Y,verboseInfo:$})=>{if(Z===null)return{output:Array.from({length:3})};let W={},Q=new Set([]);return{output:Z.map((G,z)=>p$1({result:G,fileDescriptors:J,fdNumber:z,state:W,outputFiles:Q,isMaxBuffer:Y,verboseInfo:$},X)),...W}},p$1=({result:J,fileDescriptors:Z,fdNumber:X,state:Y,outputFiles:$,isMaxBuffer:W,verboseInfo:Q},{buffer:K,encoding:G,lines:z,stripFinalNewline:F,maxBuffer:H})=>{if(J===null)return;let q=Rb(J,W,H),V=Q7(q),{stdioItems:U,objectMode:L}=Z[X],w=i$1([V],U,G,Y),{serializedResult:j,finalResult:M=j}=n$1({chunks:w,objectMode:L,encoding:G,lines:z,stripFinalNewline:F,fdNumber:X});a$1({serializedResult:j,fdNumber:X,state:Y,verboseInfo:Q,encoding:G,stdioItems:U,objectMode:L});let R=K[X]?M:void 0;try{if(Y.error===void 0)s$1(j,U,$);return R}catch(N){return Y.error=N,R}},i$1=(J,Z,X,Y)=>{try{return YV(J,Z,X,!1)}catch($){return Y.error=$,J}},n$1=({chunks:J,objectMode:Z,encoding:X,lines:Y,stripFinalNewline:$,fdNumber:W})=>{if(Z)return{serializedResult:J};if(X==="buffer")return{serializedResult:hK(J)};let Q=Ah(J,X);if(Y[W])return{serializedResult:Q,finalResult:fM(Q,!$[W],Z)};return{serializedResult:Q}},a$1=({serializedResult:J,fdNumber:Z,state:X,verboseInfo:Y,encoding:$,stdioItems:W,objectMode:Q})=>{if(!$V({stdioItems:W,encoding:$,verboseInfo:Y,fdNumber:Z}))return;let K=fM(J,!1,Q);try{jg(K,Z,Y)}catch(G){X.error??=G}},s$1=(J,Z,X)=>{for(let{path:Y,append:$}of Z.filter(({type:W})=>tq.has(W))){let W=typeof Y==="string"?Y:Y.toString();if($||X.has(W))l$1(Y,J);else X.add(W),c$1(Y,J)}};var Rg=([,J,Z],X)=>{if(!X.all)return;if(J===void 0)return Z;if(Z===void 0)return J;if(Array.isArray(J))return Array.isArray(Z)?[...J,...Z]:[...J,F7(Z,X,"all")];if(Array.isArray(Z))return[F7(J,X,"all"),...Z];if(C8(J)&&C8(Z))return iO([J,Z]);return`${J}${Z}`};import{once as dM}from"events";var Ng=async(J,Z)=>{let[X,Y]=await o$1(J);return Z.isForcefullyTerminated??=!1,[X,Y]},o$1=async(J)=>{let[Z,X]=await Promise.allSettled([dM(J,"spawn"),dM(J,"exit")]);if(Z.status==="rejected")return[];return X.status==="rejected"?Pg(J):X.value},Pg=async(J)=>{try{return await dM(J,"exit")}catch{return Pg(J)}},Dg=async(J)=>{let[Z,X]=await J;if(!r$1(Z,X)&&uM(Z,X))throw new W4;return[Z,X]},r$1=(J,Z)=>J===void 0&&Z===void 0,uM=(J,Z)=>J!==0||Z!==null;var Cg=({error:J,status:Z,signal:X,output:Y},{maxBuffer:$})=>{let W=t$1(J,Z,X),Q=W?.code==="ETIMEDOUT",K=Mb(W,Y,$);return{resultError:W,exitCode:Z,signal:X,timedOut:Q,isMaxBuffer:K}},t$1=(J,Z,X)=>{if(J!==void 0)return J;return uM(Z,X)?new W4:void 0};var Tg=(J,Z,X)=>{let{file:Y,commandArguments:$,command:W,escapedCommand:Q,startTime:K,verboseInfo:G,options:z,fileDescriptors:F}=JW1(J,Z,X),H=YW1({file:Y,commandArguments:$,options:z,command:W,escapedCommand:Q,verboseInfo:G,fileDescriptors:F,startTime:K});return C$(H,G,z)},JW1=(J,Z,X)=>{let{command:Y,escapedCommand:$,startTime:W,verboseInfo:Q}=Bq(J,Z,X),K=ZW1(X),{file:G,commandArguments:z,options:F}=mq(J,Z,K);XW1(F);let H=Xg(F,Q);return{file:G,commandArguments:z,command:Y,escapedCommand:$,startTime:W,verboseInfo:Q,options:F,fileDescriptors:H}},ZW1=(J)=>J.node&&!J.ipc?{...J,ipc:!1}:J,XW1=({ipc:J,ipcInput:Z,detached:X,cancelSignal:Y})=>{if(Z)WV("ipcInput");if(J)WV("ipc: true");if(X)WV("detached: true");if(Y)WV("cancelSignal")},WV=(J)=>{throw new TypeError(`The "${J}" option cannot be used with synchronous methods.`)},YW1=({file:J,commandArguments:Z,options:X,command:Y,escapedCommand:$,verboseInfo:W,fileDescriptors:Q,startTime:K})=>{let G=$W1({file:J,commandArguments:Z,options:X,command:Y,escapedCommand:$,fileDescriptors:Q,startTime:K});if(G.failed)return G;let{resultError:z,exitCode:F,signal:H,timedOut:q,isMaxBuffer:V}=Cg(G,X),{output:U,error:L=z}=Mg({fileDescriptors:Q,syncResult:G,options:X,isMaxBuffer:V,verboseInfo:W}),w=U.map((M,R)=>F7(M,X,R)),j=F7(Rg(U,X),X,"all");return QW1({error:L,exitCode:F,signal:H,timedOut:q,isMaxBuffer:V,stdio:w,all:j,options:X,command:Y,escapedCommand:$,startTime:K})},$W1=({file:J,commandArguments:Z,options:X,command:Y,escapedCommand:$,fileDescriptors:W,startTime:Q})=>{try{Lg(W,X);let K=WW1(X);return e$1(J,Z,K)}catch(K){return D$({error:K,command:Y,escapedCommand:$,fileDescriptors:W,options:X,startTime:Q,isSync:!0})}},WW1=({encoding:J,maxBuffer:Z,...X})=>({...X,encoding:"buffer",maxBuffer:aq(Z)}),QW1=({error:J,exitCode:Z,signal:X,timedOut:Y,isMaxBuffer:$,stdio:W,all:Q,options:K,command:G,escapedCommand:z,startTime:F})=>J===void 0?sq({command:G,escapedCommand:z,stdio:W,all:Q,ipcOutput:[],options:K,startTime:F}):uK({error:J,command:G,escapedCommand:z,timedOut:Y,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:$,isForcefullyTerminated:!1,exitCode:Z,signal:X,stdio:W,all:Q,ipcOutput:[],options:K,startTime:F,isSync:!0});import{setMaxListeners as nQ1}from"events";import{spawn as aQ1}from"child_process";import Sg from"process";import{once as cM,on as KW1}from"events";var kg=({anyProcess:J,channel:Z,isSubprocess:X,ipc:Y},{reference:$=!0,filter:W}={})=>{return O$({methodName:"getOneMessage",isSubprocess:X,ipc:Y,isConnected:Aq(J)}),GW1({anyProcess:J,channel:Z,isSubprocess:X,filter:W,reference:$})},GW1=async({anyProcess:J,channel:Z,isSubprocess:X,filter:Y,reference:$})=>{vq(Z,$);let W=QJ(J,Z,X),Q=new AbortController;try{return await Promise.race([zW1(W,Y,Q),FW1(W,X,Q),HW1(W,X,Q)])}catch(K){throw M$(J),K}finally{Q.abort(),Sq(Z,$)}},zW1=async(J,Z,{signal:X})=>{if(Z===void 0){let[Y]=await cM(J,"message",{signal:X});return Y}for await(let[Y]of KW1(J,"message",{signal:X}))if(Z(Y))return Y},FW1=async(J,Z,{signal:X})=>{await cM(J,"disconnect",{signal:X}),Hf(Z)},HW1=async(J,Z,{signal:X})=>{let[Y]=await cM(J,"strict:error",{signal:X});throw kq(Y,Z)};import{once as Ig,on as qW1}from"events";var vg=({anyProcess:J,channel:Z,isSubprocess:X,ipc:Y},{reference:$=!0}={})=>lM({anyProcess:J,channel:Z,isSubprocess:X,ipc:Y,shouldAwait:!X,reference:$}),lM=({anyProcess:J,channel:Z,isSubprocess:X,ipc:Y,shouldAwait:$,reference:W})=>{O$({methodName:"getEachMessage",isSubprocess:X,ipc:Y,isConnected:Aq(J)}),vq(Z,W);let Q=QJ(J,Z,X),K=new AbortController,G={};return VW1(J,Q,K),UW1({ipcEmitter:Q,isSubprocess:X,controller:K,state:G}),wW1({anyProcess:J,channel:Z,ipcEmitter:Q,isSubprocess:X,shouldAwait:$,controller:K,state:G,reference:W})},VW1=async(J,Z,X)=>{try{await Ig(Z,"disconnect",{signal:X.signal}),X.abort()}catch{}},UW1=async({ipcEmitter:J,isSubprocess:Z,controller:X,state:Y})=>{try{let[$]=await Ig(J,"strict:error",{signal:X.signal});Y.error=kq($,Z),X.abort()}catch{}},wW1=async function*({anyProcess:J,channel:Z,ipcEmitter:X,isSubprocess:Y,shouldAwait:$,controller:W,state:Q,reference:K}){try{for await(let[G]of qW1(X,"message",{signal:W.signal}))Eg(Q),yield G}catch{Eg(Q)}finally{if(W.abort(),Sq(Z,K),!Y)M$(J);if($)await J}},Eg=({error:J})=>{if(J)throw J};var _g=(J,{ipc:Z})=>{Object.assign(J,Ag(J,!1,Z))},xg=()=>{let J=Sg,Z=!0,X=Sg.channel!==void 0;return{...Ag(J,!0,X),getCancelSignal:bf.bind(void 0,{anyProcess:J,channel:J.channel,isSubprocess:!0,ipc:X})}},Ag=(J,Z,X)=>({sendMessage:bq.bind(void 0,{anyProcess:J,channel:J.channel,isSubprocess:Z,ipc:X}),getOneMessage:kg.bind(void 0,{anyProcess:J,channel:J.channel,isSubprocess:Z,ipc:X}),getEachMessage:vg.bind(void 0,{anyProcess:J,channel:J.channel,isSubprocess:Z,ipc:X})});import{ChildProcess as LW1}from"child_process";import{PassThrough as BW1,Readable as jW1,Writable as OW1,Duplex as MW1}from"stream";var hg=({error:J,command:Z,escapedCommand:X,fileDescriptors:Y,options:$,startTime:W,verboseInfo:Q})=>{AM(Y);let K=new LW1;RW1(K,Y),Object.assign(K,{readable:NW1,writable:PW1,duplex:DW1});let G=D$({error:J,command:Z,escapedCommand:X,fileDescriptors:Y,options:$,startTime:W,isSync:!1}),z=CW1(G,Q,$);return{subprocess:K,promise:z}},RW1=(J,Z)=>{let X=lK(),Y=lK(),$=lK(),W=Array.from({length:Z.length-3},lK),Q=lK(),K=[X,Y,$,...W];Object.assign(J,{stdin:X,stdout:Y,stderr:$,all:Q,stdio:K})},lK=()=>{let J=new BW1;return J.end(),J},NW1=()=>new jW1({read(){}}),PW1=()=>new OW1({write(){}}),DW1=()=>new MW1({read(){},write(){}}),CW1=async(J,Z,X)=>C$(J,Z,X);import{createReadStream as yg,createWriteStream as fg}from"fs";import{Buffer as TW1}from"buffer";import{Readable as pK,Writable as kW1,Duplex as EW1}from"stream";var gg=(J,Z)=>eq(IW1,J,Z,!1),iK=({type:J,optionName:Z})=>{throw new TypeError(`The \`${Z}\` option cannot be ${KJ[J]}.`)},bg={fileNumber:iK,generator:mM,asyncGenerator:mM,nodeStream:({value:J})=>({stream:J}),webTransform({value:{transform:J,writableObjectMode:Z,readableObjectMode:X}}){let Y=Z||X;return{stream:EW1.fromWeb(J,{objectMode:Y})}},duplex:({value:{transform:J}})=>({stream:J}),native(){}},IW1={input:{...bg,fileUrl:({value:J})=>({stream:yg(J)}),filePath:({value:{file:J}})=>({stream:yg(J)}),webStream:({value:J})=>({stream:pK.fromWeb(J)}),iterable:({value:J})=>({stream:pK.from(J)}),asyncIterable:({value:J})=>({stream:pK.from(J)}),string:({value:J})=>({stream:pK.from(J)}),uint8Array:({value:J})=>({stream:pK.from(TW1.from(J))})},output:{...bg,fileUrl:({value:J})=>({stream:fg(J)}),filePath:({value:{file:J,append:Z}})=>({stream:fg(J,Z?{flags:"a"}:{})}),webStream:({value:J})=>({stream:kW1.fromWeb(J)}),iterable:iK,asyncIterable:iK,string:iK,uint8Array:iK}};import{on as vW1,once as mg}from"events";import{PassThrough as SW1,getDefaultHighWaterMark as _W1}from"stream";import{finished as cg}from"stream/promises";function oZ(J){if(!Array.isArray(J))throw new TypeError(`Expected an array, got \`${typeof J}\`.`);for(let $ of J)pM($);let Z=J.some(({readableObjectMode:$})=>$),X=xW1(J,Z),Y=new lg({objectMode:Z,writableHighWaterMark:X,readableHighWaterMark:X});for(let $ of J)Y.add($);return Y}var xW1=(J,Z)=>{if(J.length===0)return _W1(Z);let X=J.filter(({readableObjectMode:Y})=>Y===Z).map(({readableHighWaterMark:Y})=>Y);return Math.max(...X)};class lg extends SW1{#X=new Set([]);#Y=new Set([]);#Z=new Set([]);#J;#$=Symbol("unpipe");#W=new WeakMap;add(J){if(pM(J),this.#X.has(J))return;this.#X.add(J),this.#J??=AW1(this,this.#X,this.#$);let Z=fW1({passThroughStream:this,stream:J,streams:this.#X,ended:this.#Y,aborted:this.#Z,onFinished:this.#J,unpipeEvent:this.#$});this.#W.set(J,Z),J.pipe(this,{end:!1})}async remove(J){if(pM(J),!this.#X.has(J))return!1;let Z=this.#W.get(J);if(Z===void 0)return!1;return this.#W.delete(J),J.unpipe(this),await Z,!0}}var AW1=async(J,Z,X)=>{QV(J,dg);let Y=new AbortController;try{await Promise.race([hW1(J,Y),yW1(J,Z,X,Y)])}finally{Y.abort(),QV(J,-dg)}},hW1=async(J,{signal:Z})=>{try{await cg(J,{signal:Z,cleanup:!0})}catch(X){throw pg(J,X),X}},yW1=async(J,Z,X,{signal:Y})=>{for await(let[$]of vW1(J,"unpipe",{signal:Y}))if(Z.has($))$.emit(X)},pM=(J)=>{if(typeof J?.pipe!=="function")throw new TypeError(`Expected a readable stream, got: \`${typeof J}\`.`)},fW1=async({passThroughStream:J,stream:Z,streams:X,ended:Y,aborted:$,onFinished:W,unpipeEvent:Q})=>{QV(J,ug);let K=new AbortController;try{await Promise.race([bW1(W,Z,K),gW1({passThroughStream:J,stream:Z,streams:X,ended:Y,aborted:$,controller:K}),mW1({stream:Z,streams:X,ended:Y,aborted:$,unpipeEvent:Q,controller:K})])}finally{K.abort(),QV(J,-ug)}if(X.size>0&&X.size===Y.size+$.size)if(Y.size===0&&$.size>0)iM(J);else dW1(J)},bW1=async(J,Z,{signal:X})=>{try{if(await J,!X.aborted)iM(Z)}catch(Y){if(!X.aborted)pg(Z,Y)}},gW1=async({passThroughStream:J,stream:Z,streams:X,ended:Y,aborted:$,controller:{signal:W}})=>{try{if(await cg(Z,{signal:W,cleanup:!0,readable:!0,writable:!1}),X.has(Z))Y.add(Z)}catch(Q){if(W.aborted||!X.has(Z))return;if(ig(Q))$.add(Z);else ng(J,Q)}},mW1=async({stream:J,streams:Z,ended:X,aborted:Y,unpipeEvent:$,controller:{signal:W}})=>{if(await mg(J,$,{signal:W}),!J.readable)return mg(W,"abort",{signal:W});Z.delete(J),X.delete(J),Y.delete(J)},dW1=(J)=>{if(J.writable)J.end()},pg=(J,Z)=>{if(ig(Z))iM(J);else ng(J,Z)},ig=(J)=>J?.code==="ERR_STREAM_PREMATURE_CLOSE",iM=(J)=>{if(J.readable||J.writable)J.destroy()},ng=(J,Z)=>{if(!J.destroyed)J.once("error",uW1),J.destroy(Z)},uW1=()=>{},QV=(J,Z)=>{let X=J.getMaxListeners();if(X!==0&&X!==Number.POSITIVE_INFINITY)J.setMaxListeners(X+Z)},dg=2,ug=1;import{finished as ag}from"stream/promises";var k$=(J,Z)=>{J.pipe(Z),cW1(J,Z),lW1(J,Z)},cW1=async(J,Z)=>{if(D9(J)||D9(Z))return;try{await ag(J,{cleanup:!0,readable:!0,writable:!1})}catch{}nM(Z)},nM=(J)=>{if(J.writable)J.end()},lW1=async(J,Z)=>{if(D9(J)||D9(Z))return;try{await ag(Z,{cleanup:!0,readable:!1,writable:!0})}catch{}aM(J)},aM=(J)=>{if(J.readable)J.destroy()};var sg=(J,Z,X)=>{let Y=new Map;for(let[$,{stdioItems:W,direction:Q}]of Object.entries(Z)){for(let{stream:K}of W.filter(({type:G})=>A5.has(G)))pW1(J,K,Q,$);for(let{stream:K}of W.filter(({type:G})=>!A5.has(G)))nW1({subprocess:J,stream:K,direction:Q,fdNumber:$,pipeGroups:Y,controller:X})}for(let[$,W]of Y.entries()){let Q=W.length===1?W[0]:oZ(W);k$(Q,$)}},pW1=(J,Z,X,Y)=>{if(X==="output")k$(J.stdio[Y],Z);else k$(Z,J.stdio[Y]);let $=iW1[Y];if($!==void 0)J[$]=Z;J.stdio[Y]=Z},iW1=["stdin","stdout","stderr"],nW1=({subprocess:J,stream:Z,direction:X,fdNumber:Y,pipeGroups:$,controller:W})=>{if(Z===void 0)return;aW1(Z,W);let[Q,K]=X==="output"?[Z,J.stdio[Y]]:[J.stdio[Y],Z],G=$.get(Q)??[];$.set(Q,[...G,K])},aW1=(J,{signal:Z})=>{if(D9(J))iZ(J,sW1,Z)},sW1=2;import{addAbortListener as tW1}from"events";var rZ=[];rZ.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")rZ.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")rZ.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var KV=(J)=>!!J&&typeof J==="object"&&typeof J.removeListener==="function"&&typeof J.emit==="function"&&typeof J.reallyExit==="function"&&typeof J.listeners==="function"&&typeof J.kill==="function"&&typeof J.pid==="number"&&typeof J.on==="function",sM=Symbol.for("signal-exit emitter"),oM=globalThis,oW1=Object.defineProperty.bind(Object);class og{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(oM[sM])return oM[sM];oW1(oM,sM,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(J,Z){this.listeners[J].push(Z)}removeListener(J,Z){let X=this.listeners[J],Y=X.indexOf(Z);if(Y===-1)return;if(Y===0&&X.length===1)X.length=0;else X.splice(Y,1)}emit(J,Z,X){if(this.emitted[J])return!1;this.emitted[J]=!0;let Y=!1;for(let $ of this.listeners[J])Y=$(Z,X)===!0||Y;if(J==="exit")Y=this.emit("afterExit",Z,X)||Y;return Y}}class tM{}var rW1=(J)=>{return{onExit(Z,X){return J.onExit(Z,X)},load(){return J.load()},unload(){return J.unload()}}};class rg extends tM{onExit(){return()=>{}}load(){}unload(){}}class tg extends tM{#X=rM.platform==="win32"?"SIGINT":"SIGHUP";#Y=new og;#Z;#J;#$;#W={};#Q=!1;constructor(J){super();this.#Z=J,this.#W={};for(let Z of rZ)this.#W[Z]=()=>{let X=this.#Z.listeners(Z),{count:Y}=this.#Y,$=J;if(typeof $.__signal_exit_emitter__==="object"&&typeof $.__signal_exit_emitter__.count==="number")Y+=$.__signal_exit_emitter__.count;if(X.length===Y){this.unload();let W=this.#Y.emit("exit",null,Z),Q=Z==="SIGHUP"?this.#X:Z;if(!W)J.kill(J.pid,Q)}};this.#$=J.reallyExit,this.#J=J.emit}onExit(J,Z){if(!KV(this.#Z))return()=>{};if(this.#Q===!1)this.load();let X=Z?.alwaysLast?"afterExit":"exit";return this.#Y.on(X,J),()=>{if(this.#Y.removeListener(X,J),this.#Y.listeners.exit.length===0&&this.#Y.listeners.afterExit.length===0)this.unload()}}load(){if(this.#Q)return;this.#Q=!0,this.#Y.count+=1;for(let J of rZ)try{let Z=this.#W[J];if(Z)this.#Z.on(J,Z)}catch(Z){}this.#Z.emit=(J,...Z)=>{return this.#K(J,...Z)},this.#Z.reallyExit=(J)=>{return this.#G(J)}}unload(){if(!this.#Q)return;this.#Q=!1,rZ.forEach((J)=>{let Z=this.#W[J];if(!Z)throw new Error("Listener not defined for signal: "+J);try{this.#Z.removeListener(J,Z)}catch(X){}}),this.#Z.emit=this.#J,this.#Z.reallyExit=this.#$,this.#Y.count-=1}#G(J){if(!KV(this.#Z))return 0;return this.#Z.exitCode=J||0,this.#Y.emit("exit",this.#Z.exitCode,null),this.#$.call(this.#Z,this.#Z.exitCode)}#K(J,...Z){let X=this.#J;if(J==="exit"&&KV(this.#Z)){if(typeof Z[0]==="number")this.#Z.exitCode=Z[0];let Y=X.call(this.#Z,J,...Z);return this.#Y.emit("exit",this.#Z.exitCode,null),Y}else return X.call(this.#Z,J,...Z)}}var rM=globalThis.process,{onExit:eg,load:AZ6,unload:hZ6}=rW1(KV(rM)?new tg(rM):new rg);var Jm=(J,{cleanup:Z,detached:X},{signal:Y})=>{if(!Z||X)return;let $=eg(()=>{J.kill()});tW1(Y,()=>{$()})};var Xm=({source:J,sourcePromise:Z,boundOptions:X,createNested:Y},...$)=>{let W=Lq(),{destination:Q,destinationStream:K,destinationError:G,from:z,unpipeSignal:F}=eW1(X,Y,$),{sourceStream:H,sourceError:q}=ZQ1(J,z),{options:V,fileDescriptors:U}=K4.get(J);return{sourcePromise:Z,sourceStream:H,sourceOptions:V,sourceError:q,destination:Q,destinationStream:K,destinationError:G,unpipeSignal:F,fileDescriptors:U,startTime:W}},eW1=(J,Z,X)=>{try{let{destination:Y,pipeOptions:{from:$,to:W,unpipeSignal:Q}={}}=JQ1(J,Z,...X),K=Iq(Y,W);return{destination:Y,destinationStream:K,from:$,unpipeSignal:Q}}catch(Y){return{destinationError:Y}}},JQ1=(J,Z,X,...Y)=>{if(Array.isArray(X))return{destination:Z(Zm,J)(X,...Y),pipeOptions:J};if(typeof X==="string"||X instanceof URL||lO(X)){if(Object.keys(J).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[$,W,Q]=Qq(X,...Y);return{destination:Z(Zm)($,W,Q),pipeOptions:Q}}if(K4.has(X)){if(Object.keys(J).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}`)},Zm=({options:J})=>({options:{...J,stdin:"pipe",piped:!0}}),ZQ1=(J,Z)=>{try{return{sourceStream:R$(J,Z)}}catch(X){return{sourceError:X}}};var $m=({sourceStream:J,sourceError:Z,destinationStream:X,destinationError:Y,fileDescriptors:$,sourceOptions:W,startTime:Q})=>{let K=XQ1({sourceStream:J,sourceError:Z,destinationStream:X,destinationError:Y});if(K!==void 0)throw eM({error:K,fileDescriptors:$,sourceOptions:W,startTime:Q})},XQ1=({sourceStream:J,sourceError:Z,destinationStream:X,destinationError:Y})=>{if(Z!==void 0&&Y!==void 0)return Y;if(Y!==void 0)return aM(J),Y;if(Z!==void 0)return nM(X),Z},eM=({error:J,fileDescriptors:Z,sourceOptions:X,startTime:Y})=>D$({error:J,command:Ym,escapedCommand:Ym,fileDescriptors:Z,options:X,startTime:Y,isSync:!1}),Ym="source.pipe(destination)";var Wm=async(J)=>{let[{status:Z,reason:X,value:Y=X},{status:$,reason:W,value:Q=W}]=await J;if(!Q.pipedFrom.includes(Y))Q.pipedFrom.push(Y);if($==="rejected")throw Q;if(Z==="rejected")throw Y;return Q};import{finished as YQ1}from"stream/promises";var Qm=(J,Z,X)=>{let Y=GV.has(Z)?WQ1(J,Z):$Q1(J,Z);return iZ(J,KQ1,X.signal),iZ(Z,GQ1,X.signal),QQ1(Z),Y},$Q1=(J,Z)=>{let X=oZ([J]);return k$(X,Z),GV.set(Z,X),X},WQ1=(J,Z)=>{let X=GV.get(Z);return X.add(J),X},QQ1=async(J)=>{try{await YQ1(J,{cleanup:!0,readable:!1,writable:!0})}catch{}GV.delete(J)},GV=new WeakMap,KQ1=2,GQ1=1;import{aborted as zQ1}from"util";var Km=(J,Z)=>J===void 0?[]:[FQ1(J,Z)],FQ1=async(J,{sourceStream:Z,mergedStream:X,fileDescriptors:Y,sourceOptions:$,startTime:W})=>{await zQ1(J,Z),await X.remove(Z);let Q=new Error("Pipe canceled by `unpipeSignal` option.");throw eM({error:Q,fileDescriptors:Y,sourceOptions:$,startTime:W})};var zV=(J,...Z)=>{if(Q8(Z[0]))return zV.bind(void 0,{...J,boundOptions:{...J.boundOptions,...Z[0]}});let{destination:X,...Y}=Xm(J,...Z),$=HQ1({...Y,destination:X});return $.pipe=zV.bind(void 0,{...J,source:X,sourcePromise:$,boundOptions:{}}),$},HQ1=async({sourcePromise:J,sourceStream:Z,sourceOptions:X,sourceError:Y,destination:$,destinationStream:W,destinationError:Q,unpipeSignal:K,fileDescriptors:G,startTime:z})=>{let F=qQ1(J,$);$m({sourceStream:Z,sourceError:Y,destinationStream:W,destinationError:Q,fileDescriptors:G,sourceOptions:X,startTime:z});let H=new AbortController;try{let q=Qm(Z,W,H);return await Promise.race([Wm(F),...Km(K,{sourceStream:Z,mergedStream:q,sourceOptions:X,fileDescriptors:G,startTime:z})])}finally{H.abort()}},qQ1=(J,Z)=>Promise.allSettled([J,Z]);import{setImmediate as OQ1}from"timers/promises";import{on as VQ1}from"events";import{getDefaultHighWaterMark as UQ1}from"stream";var FV=({subprocessStdout:J,subprocess:Z,binary:X,shouldEncode:Y,encoding:$,preserveNewlines:W})=>{let Q=new AbortController;return wQ1(Z,Q),zm({stream:J,controller:Q,binary:X,shouldEncode:!J.readableObjectMode&&Y,encoding:$,shouldSplit:!J.readableObjectMode,preserveNewlines:W})},wQ1=async(J,Z)=>{try{await J}catch{}finally{Z.abort()}},JR=({stream:J,onStreamEnd:Z,lines:X,encoding:Y,stripFinalNewline:$,allMixed:W})=>{let Q=new AbortController;LQ1(Z,Q,J);let K=J.readableObjectMode&&!W;return zm({stream:J,controller:Q,binary:Y==="buffer",shouldEncode:!K,encoding:Y,shouldSplit:!K&&X,preserveNewlines:!$})},LQ1=async(J,Z,X)=>{try{await J}catch{X.destroy()}finally{Z.abort()}},zm=({stream:J,controller:Z,binary:X,shouldEncode:Y,encoding:$,shouldSplit:W,preserveNewlines:Q})=>{let K=VQ1(J,"data",{signal:Z.signal,highWaterMark:Gm,highWatermark:Gm});return BQ1({onStdoutChunk:K,controller:Z,binary:X,shouldEncode:Y,encoding:$,shouldSplit:W,preserveNewlines:Q})},ZR=UQ1(!0),Gm=ZR,BQ1=async function*({onStdoutChunk:J,controller:Z,binary:X,shouldEncode:Y,encoding:$,shouldSplit:W,preserveNewlines:Q}){let K=jQ1({binary:X,shouldEncode:Y,encoding:$,shouldSplit:W,preserveNewlines:Q});try{for await(let[G]of J)yield*sZ(G,K,0)}catch(G){if(!Z.signal.aborted)throw G}finally{yield*cK(K)}},jQ1=({binary:J,shouldEncode:Z,encoding:X,shouldSplit:Y,preserveNewlines:$})=>[ZV(J,X,!Z),JV(J,$,!Y,{})].filter(Boolean);var Fm=async({stream:J,onStreamEnd:Z,fdNumber:X,encoding:Y,buffer:$,maxBuffer:W,lines:Q,allMixed:K,stripFinalNewline:G,verboseInfo:z,streamInfo:F})=>{let H=MQ1({stream:J,onStreamEnd:Z,fdNumber:X,encoding:Y,allMixed:K,verboseInfo:z,streamInfo:F});if(!$){await Promise.all([RQ1(J),H]);return}let q=hM(G,X),V=JR({stream:J,onStreamEnd:Z,lines:Q,encoding:Y,stripFinalNewline:q,allMixed:K}),[U]=await Promise.all([NQ1({stream:J,iterable:V,fdNumber:X,encoding:Y,maxBuffer:W,lines:Q}),H]);return U},MQ1=async({stream:J,onStreamEnd:Z,fdNumber:X,encoding:Y,allMixed:$,verboseInfo:W,streamInfo:{fileDescriptors:Q}})=>{if(!$V({stdioItems:Q[X]?.stdioItems,encoding:Y,verboseInfo:W,fdNumber:X}))return;let K=JR({stream:J,onStreamEnd:Z,lines:!0,encoding:Y,stripFinalNewline:!0,allMixed:$});await Bg(K,J,X,W)},RQ1=async(J)=>{if(await OQ1(),J.readableFlowing===null)J.resume()},NQ1=async({stream:J,stream:{readableObjectMode:Z},iterable:X,fdNumber:Y,encoding:$,maxBuffer:W,lines:Q})=>{try{if(Z||Q)return await lq(X,{maxBuffer:W});if($==="buffer")return new Uint8Array(await pq(X,{maxBuffer:W}));return await nq(X,{maxBuffer:W})}catch(K){return Hm(Bb({error:K,stream:J,readableObjectMode:Z,lines:Q,encoding:$,fdNumber:Y}))}},XR=async(J)=>{try{return await J}catch(Z){return Hm(Z)}},Hm=({bufferedData:J})=>_h(J)?new Uint8Array(J):J;import{finished as PQ1}from"stream/promises";var nK=async(J,Z,X,{isSameDirection:Y,stopOnExit:$=!1}={})=>{let W=DQ1(J,X),Q=new AbortController;try{await Promise.race([...$?[X.exitPromise]:[],PQ1(J,{cleanup:!0,signal:Q.signal})])}catch(K){if(!W.stdinCleanedUp)kQ1(K,Z,X,Y)}finally{Q.abort()}},DQ1=(J,{originalStreams:[Z],subprocess:X})=>{let Y={stdinCleanedUp:!1};if(J===Z)CQ1(J,X,Y);return Y},CQ1=(J,Z,X)=>{let{_destroy:Y}=J;J._destroy=(...$)=>{TQ1(Z,X),Y.call(J,...$)}},TQ1=({exitCode:J,signalCode:Z},X)=>{if(J!==null||Z!==null)X.stdinCleanedUp=!0},kQ1=(J,Z,X,Y)=>{if(!EQ1(J,Z,X,Y))throw J},EQ1=(J,Z,X,Y=!0)=>{if(X.propagating)return qm(J)||HV(J);return X.propagating=!0,YR(X,Z)===Y?qm(J):HV(J)},YR=({fileDescriptors:J},Z)=>Z!=="all"&&J[Z].direction==="input",HV=(J)=>J?.code==="ERR_STREAM_PREMATURE_CLOSE",qm=(J)=>J?.code==="EPIPE";var Vm=({subprocess:J,encoding:Z,buffer:X,maxBuffer:Y,lines:$,stripFinalNewline:W,verboseInfo:Q,streamInfo:K})=>J.stdio.map((G,z)=>$R({stream:G,fdNumber:z,encoding:Z,buffer:X[z],maxBuffer:Y[z],lines:$[z],allMixed:!1,stripFinalNewline:W,verboseInfo:Q,streamInfo:K})),$R=async({stream:J,fdNumber:Z,encoding:X,buffer:Y,maxBuffer:$,lines:W,allMixed:Q,stripFinalNewline:K,verboseInfo:G,streamInfo:z})=>{if(!J)return;let F=nK(J,Z,z);if(YR(z,Z)){await F;return}let[H]=await Promise.all([Fm({stream:J,onStreamEnd:F,fdNumber:Z,encoding:X,buffer:Y,maxBuffer:$,lines:W,allMixed:Q,stripFinalNewline:K,verboseInfo:G,streamInfo:z}),F]);return H};var Um=({stdout:J,stderr:Z},{all:X})=>X&&(J||Z)?oZ([J,Z].filter(Boolean)):void 0,wm=({subprocess:J,encoding:Z,buffer:X,maxBuffer:Y,lines:$,stripFinalNewline:W,verboseInfo:Q,streamInfo:K})=>$R({...IQ1(J,X),fdNumber:"all",encoding:Z,maxBuffer:Y[1]+Y[2],lines:$[1]||$[2],allMixed:vQ1(J),stripFinalNewline:W,verboseInfo:Q,streamInfo:K}),IQ1=({stdout:J,stderr:Z,all:X},[,Y,$])=>{let W=Y||$;if(!W)return{stream:X,buffer:W};if(!Y)return{stream:Z,buffer:W};if(!$)return{stream:J,buffer:W};return{stream:X,buffer:W}},vQ1=({all:J,stdout:Z,stderr:X})=>J&&Z&&X&&Z.readableObjectMode!==X.readableObjectMode;import{once as SQ1}from"events";var Lm=(J)=>L$(J,"ipc"),Bm=(J,Z)=>{let X=wq(J);$4({type:"ipc",verboseMessage:X,fdNumber:"ipc",verboseInfo:Z})};var jm=async({subprocess:J,buffer:Z,maxBuffer:X,ipc:Y,ipcOutput:$,verboseInfo:W})=>{if(!Y)return $;let Q=Lm(W),K=K7(Z,"ipc"),G=K7(X,"ipc");for await(let z of lM({anyProcess:J,channel:J.channel,isSubprocess:!1,ipc:Y,shouldAwait:!1,reference:!0})){if(K)jb(J,$,G),$.push(z);if(Q)Bm(z,W)}return $},Om=async(J,Z)=>{return await Promise.allSettled([J]),Z};var Mm=async({subprocess:J,options:{encoding:Z,buffer:X,maxBuffer:Y,lines:$,timeoutDuration:W,cancelSignal:Q,gracefulCancel:K,forceKillAfterDelay:G,stripFinalNewline:z,ipc:F,ipcInput:H},context:q,verboseInfo:V,fileDescriptors:U,originalStreams:L,onInternalError:w,controller:j})=>{let M=Ng(J,q),R={originalStreams:L,fileDescriptors:U,subprocess:J,exitPromise:M,propagating:!1},N=Vm({subprocess:J,encoding:Z,buffer:X,maxBuffer:Y,lines:$,stripFinalNewline:z,verboseInfo:V,streamInfo:R}),D=wm({subprocess:J,encoding:Z,buffer:X,maxBuffer:Y,lines:$,stripFinalNewline:z,verboseInfo:V,streamInfo:R}),P=[],C=jm({subprocess:J,buffer:X,maxBuffer:Y,ipc:F,ipcOutput:P,verboseInfo:V}),k=_Q1(L,J,R),I=xQ1(U,R);try{return await Promise.race([Promise.all([{},Dg(M),Promise.all(N),D,C,sf(J,H),...k,...I]),w,AQ1(J,j),...cf(J,W,q,j),...Ff({subprocess:J,cancelSignal:Q,gracefulCancel:K,context:q,controller:j}),...df({subprocess:J,cancelSignal:Q,gracefulCancel:K,forceKillAfterDelay:G,context:q,controller:j})])}catch(A){return q.terminationReason??="other",Promise.all([{error:A},M,Promise.all(N.map((v)=>XR(v))),XR(D),Om(C,P),Promise.allSettled(k),Promise.allSettled(I)])}},_Q1=(J,Z,X)=>J.map((Y,$)=>Y===Z.stdio[$]?void 0:nK(Y,$,X)),xQ1=(J,Z)=>J.flatMap(({stdioItems:X},Y)=>X.filter(({value:$,stream:W=$})=>T9(W,{checkOpen:!1})&&!D9(W)).map(({type:$,value:W,stream:Q=W})=>nK(Q,Y,Z,{isSameDirection:A5.has($),stopOnExit:$==="native"}))),AQ1=async(J,{signal:Z})=>{let[X]=await SQ1(J,"error",{signal:Z});throw X};var Rm=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),aK=(J,Z,X)=>{let Y=J[X];if(!Y.has(Z))Y.set(Z,[]);let $=Y.get(Z),W=Q4();return $.push(W),{resolve:W.resolve.bind(W),promises:$}},E$=async({resolve:J,promises:Z},X)=>{J();let[Y]=await Promise.race([Promise.allSettled([!0,X]),Promise.all([!1,...Z])]);return!Y};import{Readable as hQ1}from"stream";import{callbackify as yQ1}from"util";import{finished as Nm}from"stream/promises";var WR=async(J)=>{if(J===void 0)return;try{await QR(J)}catch{}},Pm=async(J)=>{if(J===void 0)return;try{await KR(J)}catch{}},QR=async(J)=>{await Nm(J,{cleanup:!0,readable:!1,writable:!0})},KR=async(J)=>{await Nm(J,{cleanup:!0,readable:!0,writable:!1})},qV=async(J,Z)=>{if(await J,Z)throw Z},VV=(J,Z,X)=>{if(X&&!HV(X))J.destroy(X);else if(Z)J.destroy()};var Dm=({subprocess:J,concurrentStreams:Z,encoding:X},{from:Y,binary:$=!0,preserveNewlines:W=!0}={})=>{let Q=$||U5.has(X),{subprocessStdout:K,waitReadableDestroy:G}=GR(J,Y,Z),{readableEncoding:z,readableObjectMode:F,readableHighWaterMark:H}=zR(K,Q),{read:q,onStdoutDataDone:V}=FR({subprocessStdout:K,subprocess:J,binary:Q,encoding:X,preserveNewlines:W}),U=new hQ1({read:q,destroy:yQ1(qR.bind(void 0,{subprocessStdout:K,subprocess:J,waitReadableDestroy:G})),highWaterMark:H,objectMode:F,encoding:z});return HR({subprocessStdout:K,onStdoutDataDone:V,readable:U,subprocess:J}),U},GR=(J,Z,X)=>{let Y=R$(J,Z),$=aK(X,Y,"readableDestroy");return{subprocessStdout:Y,waitReadableDestroy:$}},zR=({readableEncoding:J,readableObjectMode:Z,readableHighWaterMark:X},Y)=>Y?{readableEncoding:J,readableObjectMode:Z,readableHighWaterMark:X}:{readableEncoding:J,readableObjectMode:!0,readableHighWaterMark:ZR},FR=({subprocessStdout:J,subprocess:Z,binary:X,encoding:Y,preserveNewlines:$})=>{let W=Q4(),Q=FV({subprocessStdout:J,subprocess:Z,binary:X,shouldEncode:!X,encoding:Y,preserveNewlines:$});return{read(){fQ1(this,Q,W)},onStdoutDataDone:W}},fQ1=async(J,Z,X)=>{try{let{value:Y,done:$}=await Z.next();if($)X.resolve();else J.push(Y)}catch{}},HR=async({subprocessStdout:J,onStdoutDataDone:Z,readable:X,subprocess:Y,subprocessStdin:$})=>{try{if(await KR(J),await Y,await WR($),await Z,X.readable)X.push(null)}catch(W){await WR($),Cm(X,W)}},qR=async({subprocessStdout:J,subprocess:Z,waitReadableDestroy:X},Y)=>{if(await E$(X,Z))Cm(J,Y),await qV(Z,Y)},Cm=(J,Z)=>{VV(J,J.readable,Z)};import{Writable as bQ1}from"stream";import{callbackify as Tm}from"util";var km=({subprocess:J,concurrentStreams:Z},{to:X}={})=>{let{subprocessStdin:Y,waitWritableFinal:$,waitWritableDestroy:W}=VR(J,X,Z),Q=new bQ1({...UR(Y,J,$),destroy:Tm(LR.bind(void 0,{subprocessStdin:Y,subprocess:J,waitWritableFinal:$,waitWritableDestroy:W})),highWaterMark:Y.writableHighWaterMark,objectMode:Y.writableObjectMode});return wR(Y,Q),Q},VR=(J,Z,X)=>{let Y=Iq(J,Z),$=aK(X,Y,"writableFinal"),W=aK(X,Y,"writableDestroy");return{subprocessStdin:Y,waitWritableFinal:$,waitWritableDestroy:W}},UR=(J,Z,X)=>({write:gQ1.bind(void 0,J),final:Tm(mQ1.bind(void 0,J,Z,X))}),gQ1=(J,Z,X,Y)=>{if(J.write(Z,X))Y();else J.once("drain",Y)},mQ1=async(J,Z,X)=>{if(await E$(X,Z)){if(J.writable)J.end();await Z}},wR=async(J,Z,X)=>{try{if(await QR(J),Z.writable)Z.end()}catch(Y){await Pm(X),Em(Z,Y)}},LR=async({subprocessStdin:J,subprocess:Z,waitWritableFinal:X,waitWritableDestroy:Y},$)=>{if(await E$(X,Z),await E$(Y,Z))Em(J,$),await qV(Z,$)},Em=(J,Z)=>{VV(J,J.writable,Z)};import{Duplex as dQ1}from"stream";import{callbackify as uQ1}from"util";var Im=({subprocess:J,concurrentStreams:Z,encoding:X},{from:Y,to:$,binary:W=!0,preserveNewlines:Q=!0}={})=>{let K=W||U5.has(X),{subprocessStdout:G,waitReadableDestroy:z}=GR(J,Y,Z),{subprocessStdin:F,waitWritableFinal:H,waitWritableDestroy:q}=VR(J,$,Z),{readableEncoding:V,readableObjectMode:U,readableHighWaterMark:L}=zR(G,K),{read:w,onStdoutDataDone:j}=FR({subprocessStdout:G,subprocess:J,binary:K,encoding:X,preserveNewlines:Q}),M=new dQ1({read:w,...UR(F,J,H),destroy:uQ1(cQ1.bind(void 0,{subprocessStdout:G,subprocessStdin:F,subprocess:J,waitReadableDestroy:z,waitWritableFinal:H,waitWritableDestroy:q})),readableHighWaterMark:L,writableHighWaterMark:F.writableHighWaterMark,readableObjectMode:U,writableObjectMode:F.writableObjectMode,encoding:V});return HR({subprocessStdout:G,onStdoutDataDone:j,readable:M,subprocess:J,subprocessStdin:F}),wR(F,M,G),M},cQ1=async({subprocessStdout:J,subprocessStdin:Z,subprocess:X,waitReadableDestroy:Y,waitWritableFinal:$,waitWritableDestroy:W},Q)=>{await Promise.all([qR({subprocessStdout:J,subprocess:X,waitReadableDestroy:Y},Q),LR({subprocessStdin:Z,subprocess:X,waitWritableFinal:$,waitWritableDestroy:W},Q)])};var BR=(J,Z,{from:X,binary:Y=!1,preserveNewlines:$=!1}={})=>{let W=Y||U5.has(Z),Q=R$(J,X),K=FV({subprocessStdout:Q,subprocess:J,binary:W,shouldEncode:!0,encoding:Z,preserveNewlines:$});return lQ1(K,Q,J)},lQ1=async function*(J,Z,X){try{yield*J}finally{if(Z.readable)Z.destroy();await X}};var vm=(J,{encoding:Z})=>{let X=Rm();J.readable=Dm.bind(void 0,{subprocess:J,concurrentStreams:X,encoding:Z}),J.writable=km.bind(void 0,{subprocess:J,concurrentStreams:X}),J.duplex=Im.bind(void 0,{subprocess:J,concurrentStreams:X,encoding:Z}),J.iterable=BR.bind(void 0,J,Z),J[Symbol.asyncIterator]=BR.bind(void 0,J,Z,{})};var Sm=(J,Z)=>{for(let[X,Y]of iQ1){let $=Y.value.bind(Z);Reflect.defineProperty(J,X,{...Y,value:$})}},pQ1=(async()=>{})().constructor.prototype,iQ1=["then","catch","finally"].map((J)=>[J,Reflect.getOwnPropertyDescriptor(pQ1,J)]);var _m=(J,Z,X,Y)=>{let{file:$,commandArguments:W,command:Q,escapedCommand:K,startTime:G,verboseInfo:z,options:F,fileDescriptors:H}=sQ1(J,Z,X),{subprocess:q,promise:V}=rQ1({file:$,commandArguments:W,options:F,startTime:G,verboseInfo:z,command:Q,escapedCommand:K,fileDescriptors:H});return q.pipe=zV.bind(void 0,{source:q,sourcePromise:V,boundOptions:{},createNested:Y}),Sm(q,V),K4.set(q,{options:F,fileDescriptors:H}),q},sQ1=(J,Z,X)=>{let{command:Y,escapedCommand:$,startTime:W,verboseInfo:Q}=Bq(J,Z,X),{file:K,commandArguments:G,options:z}=mq(J,Z,X),F=oQ1(z),H=gg(F,Q);return{file:K,commandArguments:G,command:Y,escapedCommand:$,startTime:W,verboseInfo:Q,options:F,fileDescriptors:H}},oQ1=({timeout:J,signal:Z,...X})=>{if(Z!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...X,timeoutDuration:J}},rQ1=({file:J,commandArguments:Z,options:X,startTime:Y,verboseInfo:$,command:W,escapedCommand:Q,fileDescriptors:K})=>{let G;try{G=aQ1(J,Z,X)}catch(U){return hg({error:U,command:W,escapedCommand:Q,fileDescriptors:K,options:X,startTime:Y,verboseInfo:$})}let z=new AbortController;nQ1(Number.POSITIVE_INFINITY,z.signal);let F=[...G.stdio];sg(G,K,z),Jm(G,X,z);let H={},q=Q4();G.kill=Gf.bind(void 0,{kill:G.kill.bind(G),options:X,onInternalError:q,context:H,controller:z}),G.all=Um(G,X),vm(G,X),_g(G,X);let V=tQ1({subprocess:G,options:X,startTime:Y,verboseInfo:$,fileDescriptors:K,originalStreams:F,command:W,escapedCommand:Q,context:H,onInternalError:q,controller:z});return{subprocess:G,promise:V}},tQ1=async({subprocess:J,options:Z,startTime:X,verboseInfo:Y,fileDescriptors:$,originalStreams:W,command:Q,escapedCommand:K,context:G,onInternalError:z,controller:F})=>{let[H,[q,V],U,L,w]=await Mm({subprocess:J,options:Z,context:G,verboseInfo:Y,fileDescriptors:$,originalStreams:W,onInternalError:z,controller:F});F.abort(),z.resolve();let j=U.map((N,D)=>F7(N,Z,D)),M=F7(L,Z,"all"),R=eQ1({errorInfo:H,exitCode:q,signal:V,stdio:j,all:M,ipcOutput:w,context:G,options:Z,command:Q,escapedCommand:K,startTime:X});return C$(R,Y,Z)},eQ1=({errorInfo:J,exitCode:Z,signal:X,stdio:Y,all:$,ipcOutput:W,context:Q,options:K,command:G,escapedCommand:z,startTime:F})=>("error"in J)?uK({error:J.error,command:G,escapedCommand:z,timedOut:Q.terminationReason==="timeout",isCanceled:Q.terminationReason==="cancel"||Q.terminationReason==="gracefulCancel",isGracefullyCanceled:Q.terminationReason==="gracefulCancel",isMaxBuffer:J.error instanceof G7,isForcefullyTerminated:Q.isForcefullyTerminated,exitCode:Z,signal:X,stdio:Y,all:$,ipcOutput:W,options:K,startTime:F,isSync:!1}):sq({command:G,escapedCommand:z,stdio:Y,all:$,ipcOutput:W,options:K,startTime:F});var UV=(J,Z)=>{let X=Object.fromEntries(Object.entries(Z).map(([Y,$])=>[Y,JK1(Y,J[Y],$)]));return{...J,...X}},JK1=(J,Z,X)=>{if(ZK1.has(J)&&Q8(Z)&&Q8(X))return{...Z,...X};return X},ZK1=new Set(["env",...oO]);var GJ=(J,Z,X,Y)=>{let $=(Q,K,G)=>GJ(Q,K,X,G),W=(...Q)=>XK1({mapArguments:J,deepOptions:X,boundOptions:Z,setBoundExeca:Y,createNested:$},...Q);if(Y!==void 0)Y(W,$,Z);return W},XK1=({mapArguments:J,deepOptions:Z={},boundOptions:X={},setBoundExeca:Y,createNested:$},W,...Q)=>{if(Q8(W))return $(J,UV(X,W),Y);let{file:K,commandArguments:G,options:z,isSync:F}=YK1({mapArguments:J,firstArgument:W,nextArguments:Q,deepOptions:Z,boundOptions:X});return F?Tg(K,G,z):_m(K,G,z,$)},YK1=({mapArguments:J,firstArgument:Z,nextArguments:X,deepOptions:Y,boundOptions:$})=>{let W=bh(Z)?gh(Z,X):[Z,...X],[Q,K,G]=Qq(...W),z=UV(UV(Y,$),G),{file:F=Q,commandArguments:H=K,options:q=z,isSync:V=!1}=J({file:Q,commandArguments:K,options:z});return{file:F,commandArguments:H,options:q,isSync:V}};var xm=({file:J,commandArguments:Z})=>hm(J,Z),Am=({file:J,commandArguments:Z})=>({...hm(J,Z),isSync:!0}),hm=(J,Z)=>{if(Z.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${J} ${Z}.`);let[X,...Y]=$K1(J);return{file:X,commandArguments:Y}},$K1=(J)=>{if(typeof J!=="string")throw new TypeError(`The command must be a string: ${String(J)}.`);let Z=J.trim();if(Z==="")return[];let X=[];for(let Y of Z.split(WK1)){let $=X.at(-1);if($&&$.endsWith("\\"))X[X.length-1]=`${$.slice(0,-1)} ${Y}`;else X.push(Y)}return X},WK1=/ +/g;var ym=(J,Z,X)=>{J.sync=Z(QK1,X),J.s=J.sync},fm=({options:J})=>bm(J),QK1=({options:J})=>({...bm(J),isSync:!0}),bm=(J)=>({options:{...KK1(J),...J}}),KK1=({input:J,inputFile:Z,stdio:X})=>J===void 0&&Z===void 0&&X===void 0?{stdin:"inherit"}:{},gm={preferLocal:!0};var mm=GJ(()=>({})),P$6=GJ(()=>({isSync:!0})),D$6=GJ(xm),C$6=GJ(Am),T$6=GJ(pf),k$6=GJ(fm,{},gm,ym),{sendMessage:E$6,getOneMessage:I$6,getEachMessage:v$6,getCancelSignal:S$6}=xg();var{Glob:CU1}=globalThis.Bun;class jR{constructor(){this._listeners={}}addEventListener(J,Z){let X=this._listeners;if(X[J]===void 0)X[J]=[];if(X[J].indexOf(Z)===-1)X[J].push(Z);return this}removeEventListener(J,Z){let Y=this._listeners[J];if(Y!==void 0){let $=Y.indexOf(Z);if($!==-1)Y.splice($,1)}return this}dispatchEvent(J){let X=this._listeners[J.type];if(X!==void 0){let Y=X.slice(0);for(let $=0,W=Y.length;$<W;$++)Y[$].call(this,J)}return this}dispose(){for(let J in this._listeners)delete this._listeners[J]}}class p6{constructor(J,Z,X,Y={}){if(this._name=void 0,this._parent=void 0,this._child=void 0,this._attributes=void 0,this._disposed=!1,this._name=J,this._parent=Z,this._child=X,this._attributes=Y,!Z.isOnGraph(X))throw new Error("Cannot connect disconnected graphs.")}getName(){return this._name}getParent(){return this._parent}getChild(){return this._child}setChild(J){return this._child=J,this}getAttributes(){return this._attributes}dispose(){if(this._disposed)return;this._parent._destroyRef(this),this._disposed=!0}isDisposed(){return this._disposed}}class I$ extends jR{constructor(...J){super(...J);this._emptySet=new Set,this._edges=new Set,this._parentEdges=new Map,this._childEdges=new Map}listEdges(){return Array.from(this._edges)}listParentEdges(J){return Array.from(this._childEdges.get(J)||this._emptySet)}listParents(J){let Z=new Set;for(let X of this.listParentEdges(J))Z.add(X.getParent());return Array.from(Z)}listChildEdges(J){return Array.from(this._parentEdges.get(J)||this._emptySet)}listChildren(J){let Z=new Set;for(let X of this.listChildEdges(J))Z.add(X.getChild());return Array.from(Z)}disconnectParents(J,Z){for(let X of this.listParentEdges(J))if(!Z||Z(X.getParent()))X.dispose();return this}_createEdge(J,Z,X,Y){let $=new p6(J,Z,X,Y);this._edges.add($);let W=$.getParent();if(!this._parentEdges.has(W))this._parentEdges.set(W,new Set);this._parentEdges.get(W).add($);let Q=$.getChild();if(!this._childEdges.has(Q))this._childEdges.set(Q,new Set);return this._childEdges.get(Q).add($),$}_destroyEdge(J){return this._edges.delete(J),this._parentEdges.get(J.getParent()).delete(J),this._childEdges.get(J.getChild()).delete(J),this}}function sK(){return sK=Object.assign||function(J){for(var Z=1;Z<arguments.length;Z++){var X=arguments[Z];for(var Y in X)if(Object.prototype.hasOwnProperty.call(X,Y))J[Y]=X[Y]}return J},sK.apply(this,arguments)}class J6{constructor(J){if(this.list=[],J)for(let Z of J)this.list.push(Z)}add(J){this.list.push(J)}remove(J){let Z=this.list.indexOf(J);if(Z>=0)this.list.splice(Z,1)}removeChild(J){let Z=[];for(let X of this.list)if(X.getChild()===J)Z.push(X);for(let X of Z)this.remove(X);return Z}listRefsByChild(J){let Z=[];for(let X of this.list)if(X.getChild()===J)Z.push(X);return Z}values(){return this.list}}class w0{constructor(J){if(this.set=new Set,this.map=new Map,J)for(let Z of J)this.add(Z)}add(J){let Z=J.getChild();this.removeChild(Z),this.set.add(J),this.map.set(Z,J)}remove(J){this.set.delete(J),this.map.delete(J.getChild())}removeChild(J){let Z=this.map.get(J)||null;if(Z)this.remove(Z);return Z}getRefByChild(J){return this.map.get(J)||null}values(){return Array.from(this.set)}}class d1{constructor(J){if(this.map={},J)Object.assign(this.map,J)}set(J,Z){this.map[J]=Z}delete(J){delete this.map[J]}get(J){return this.map[J]||null}keys(){return Object.keys(this.map)}values(){return Object.values(this.map)}}var C0=Symbol("attributes"),k9=Symbol("immutableKeys");class v$ extends jR{constructor(J){super();this._disposed=!1,this.graph=void 0,this[C0]=void 0,this[k9]=void 0,this.graph=J,this[k9]=new Set,this[C0]=this._createAttributes()}getDefaults(){return{}}_createAttributes(){let J=this.getDefaults(),Z={};for(let X in J){let Y=J[X];if(Y instanceof v$){let $=this.graph._createEdge(X,this,Y);this[k9].add(X),Z[X]=$}else Z[X]=Y}return Z}isOnGraph(J){return this.graph===J.graph}isDisposed(){return this._disposed}dispose(){if(this._disposed)return;this.graph.listChildEdges(this).forEach((J)=>J.dispose()),this.graph.disconnectParents(this),this._disposed=!0,this.dispatchEvent({type:"dispose"})}detach(){return this.graph.disconnectParents(this),this}swap(J,Z){for(let X in this[C0]){let Y=this[C0][X];if(Y instanceof p6){let $=Y;if($.getChild()===J)this.setRef(X,Z,$.getAttributes())}else if(Y instanceof J6)for(let $ of Y.listRefsByChild(J)){let W=$.getAttributes();this.removeRef(X,J),this.addRef(X,Z,W)}else if(Y instanceof w0){let $=Y.getRefByChild(J);if($){let W=$.getAttributes();this.removeRef(X,J),this.addRef(X,Z,W)}}else if(Y instanceof d1)for(let $ of Y.keys()){let W=Y.get($);if(W.getChild()===J)this.setRefMap(X,$,Z,W.getAttributes())}}return this}get(J){return this[C0][J]}set(J,Z){return this[C0][J]=Z,this.dispatchEvent({type:"change",attribute:J})}getRef(J){let Z=this[C0][J];return Z?Z.getChild():null}setRef(J,Z,X){if(this[k9].has(J))throw new Error(`Cannot overwrite immutable attribute, "${J}".`);let Y=this[C0][J];if(Y)Y.dispose();if(!Z)return this;let $=this.graph._createEdge(J,this,Z,X);return this[C0][J]=$,this.dispatchEvent({type:"change",attribute:J})}listRefs(J){return this.assertRefList(J).values().map((X)=>X.getChild())}addRef(J,Z,X){let Y=this.graph._createEdge(J,this,Z,X);return this.assertRefList(J).add(Y),this.dispatchEvent({type:"change",attribute:J})}removeRef(J,Z){let X=this.assertRefList(J);if(X instanceof J6)for(let Y of X.listRefsByChild(Z))Y.dispose();else{let Y=X.getRefByChild(Z);if(Y)Y.dispose()}return this}assertRefList(J){let Z=this[C0][J];if(Z instanceof J6||Z instanceof w0)return Z;throw new Error(`Expected RefList or RefSet for attribute "${J}"`)}listRefMapKeys(J){return this.assertRefMap(J).keys()}listRefMapValues(J){return this.assertRefMap(J).values().map((Z)=>Z.getChild())}getRefMap(J,Z){let Y=this.assertRefMap(J).get(Z);return Y?Y.getChild():null}setRefMap(J,Z,X,Y){let $=this.assertRefMap(J),W=$.get(Z);if(W)W.dispose();if(!X)return this;Y=Object.assign(Y||{},{key:Z});let Q=this.graph._createEdge(J,this,X,sK({},Y,{key:Z}));return $.set(Z,Q),this.dispatchEvent({type:"change",attribute:J,key:Z})}assertRefMap(J){let Z=this[C0][J];if(Z instanceof d1)return Z;throw new Error(`Expected RefMap for attribute "${J}"`)}dispatchEvent(J){return super.dispatchEvent(sK({},J,{target:this})),this.graph.dispatchEvent(sK({},J,{target:this,type:`node:${J.type}`})),this}_destroyRef(J){let Z=J.getName();if(this[C0][Z]===J){if(this[C0][Z]=null,this[k9].has(Z))J.getChild().dispose()}else if(this[C0][Z]instanceof J6)this[C0][Z].remove(J);else if(this[C0][Z]instanceof w0)this[C0][Z].remove(J);else if(this[C0][Z]instanceof d1){let X=this[C0][Z];for(let Y of X.keys())if(X.get(Y)===J)X.delete(Y)}else return;this.graph._destroyEdge(J),this.dispatchEvent({type:"change",attribute:Z})}}var nm="v4.1.1",MV="@glb.bin",c;(function(J){J.ACCESSOR="Accessor",J.ANIMATION="Animation",J.ANIMATION_CHANNEL="AnimationChannel",J.ANIMATION_SAMPLER="AnimationSampler",J.BUFFER="Buffer",J.CAMERA="Camera",J.MATERIAL="Material",J.MESH="Mesh",J.PRIMITIVE="Primitive",J.PRIMITIVE_TARGET="PrimitiveTarget",J.NODE="Node",J.ROOT="Root",J.SCENE="Scene",J.SKIN="Skin",J.TEXTURE="Texture",J.TEXTURE_INFO="TextureInfo"})(c||(c={}));var RV;(function(J){J.INTERLEAVED="interleaved",J.SEPARATE="separate"})(RV||(RV={}));var w5;(function(J){J.ARRAY_BUFFER="ARRAY_BUFFER",J.ELEMENT_ARRAY_BUFFER="ELEMENT_ARRAY_BUFFER",J.INVERSE_BIND_MATRICES="INVERSE_BIND_MATRICES",J.OTHER="OTHER",J.SPARSE="SPARSE"})(w5||(w5={}));var NV;(function(J){J[J.R=4096]="R",J[J.G=256]="G",J[J.B=16]="B",J[J.A=1]="A"})(NV||(NV={}));var H7;(function(J){J.GLTF="GLTF",J.GLB="GLB"})(H7||(H7={}));var HJ={"5120":Int8Array,"5121":Uint8Array,"5122":Int16Array,"5123":Uint16Array,"5125":Uint32Array,"5126":Float32Array},MR=typeof Float32Array!=="undefined"?Float32Array:Array;if(!Math.hypot)Math.hypot=function(){var J=0,Z=arguments.length;while(Z--)J+=arguments[Z]*arguments[Z];return Math.sqrt(J)};function GK1(){var J=new MR(3);if(MR!=Float32Array)J[0]=0,J[1]=0,J[2]=0;return J}function OR(J){var Z=J[0],X=J[1],Y=J[2];return Math.hypot(Z,X,Y)}function zK1(J,Z,X){var Y=Z[0],$=Z[1],W=Z[2],Q=X[3]*Y+X[7]*$+X[11]*W+X[15];return Q=Q||1,J[0]=(X[0]*Y+X[4]*$+X[8]*W+X[12])/Q,J[1]=(X[1]*Y+X[5]*$+X[9]*W+X[13])/Q,J[2]=(X[2]*Y+X[6]*$+X[10]*W+X[14])/Q,J}(function(){var J=GK1();return function(Z,X,Y,$,W,Q){var K,G;if(!X)X=3;if(!Y)Y=0;if($)G=Math.min($*X+Y,Z.length);else G=Z.length;for(K=Y;K<G;K+=X)J[0]=Z[K],J[1]=Z[K+1],J[2]=Z[K+2],W(J,J,Q),Z[K]=J[0],Z[K+1]=J[1],Z[K+2]=J[2];return Z}})();function DR(J){let Z=am(),X=J.propertyType===c.NODE?[J]:J.listChildren();for(let Y of X)Y.traverse(($)=>{let W=$.getMesh();if(!W)return;let Q=FK1(W,$.getWorldMatrix());if(Q.min.every(isFinite)&&Q.max.every(isFinite))RR(Q.min,Z),RR(Q.max,Z)});return Z}function FK1(J,Z){let X=am();for(let Y of J.listPrimitives()){let $=Y.getAttribute("POSITION"),W=Y.getIndices();if(!$)continue;let Q=[0,0,0],K=[0,0,0];for(let G=0,z=W?W.getCount():$.getCount();G<z;G++){let F=W?W.getScalar(G):G;Q=$.getElement(F,Q),K=zK1(K,Q,Z),RR(K,X)}}return X}function RR(J,Z){for(let X=0;X<3;X++)Z.min[X]=Math.min(J[X],Z.min[X]),Z.max[X]=Math.max(J[X],Z.max[X])}function am(){return{min:[1/0,1/0,1/0],max:[-1/0,-1/0,-1/0]}}class m0{static createBufferFromDataURI(J){if(typeof Buffer==="undefined"){let Z=atob(J.split(",")[1]),X=new Uint8Array(Z.length);for(let Y=0;Y<Z.length;Y++)X[Y]=Z.charCodeAt(Y);return X}else{let Z=J.split(",")[1],X=J.indexOf("base64")>=0;return Buffer.from(Z,X?"base64":"utf8")}}static encodeText(J){return new TextEncoder().encode(J)}static decodeText(J){return new TextDecoder().decode(J)}static concat(J){let Z=0;for(let $ of J)Z+=$.byteLength;let X=new Uint8Array(Z),Y=0;for(let $ of J)X.set($,Y),Y+=$.byteLength;return X}static pad(J,Z=0){let X=this.padNumber(J.byteLength);if(X===J.byteLength)return J;let Y=new Uint8Array(X);if(Y.set(J),Z!==0)for(let $=J.byteLength;$<X;$++)Y[$]=Z;return Y}static padNumber(J){return Math.ceil(J/4)*4}static equals(J,Z){if(J===Z)return!0;if(J.byteLength!==Z.byteLength)return!1;let X=J.byteLength;while(X--)if(J[X]!==Z[X])return!1;return!0}static toView(J,Z=0,X=1/0){return new Uint8Array(J.buffer,J.byteOffset+Z,Math.min(J.byteLength,X))}static assertView(J){if(J&&!ArrayBuffer.isView(J))throw new Error(`Method requires Uint8Array parameter; received "${typeof J}".`);return J}}class CR{static hexToFactor(J,Z){J=Math.floor(J);let X=Z;return X[0]=(J>>16&255)/255,X[1]=(J>>8&255)/255,X[2]=(J&255)/255,this.convertSRGBToLinear(Z,Z)}static factorToHex(J){let Z=[...J],[X,Y,$]=this.convertLinearToSRGB(J,Z);return X*255<<16^Y*255<<8^$*255<<0}static convertSRGBToLinear(J,Z){let X=J,Y=Z;for(let $=0;$<3;$++)Y[$]=X[$]<0.04045?X[$]*0.0773993808:Math.pow(X[$]*0.9478672986+0.0521327014,2.4);return Z}static convertLinearToSRGB(J,Z){let X=J,Y=Z;for(let $=0;$<3;$++)Y[$]=X[$]<0.0031308?X[$]*12.92:1.055*Math.pow(X[$],0.41666)-0.055;return Z}}class sm{match(J){return J.length>=3&&J[0]===255&&J[1]===216&&J[2]===255}getSize(J){let Z=new DataView(J.buffer,J.byteOffset+4),X,Y;while(Z.byteLength){if(X=Z.getUint16(0,!1),HK1(Z,X),Y=Z.getUint8(X+1),Y===192||Y===193||Y===194)return[Z.getUint16(X+7,!1),Z.getUint16(X+5,!1)];Z=new DataView(J.buffer,Z.byteOffset+X+2)}throw new TypeError("Invalid JPG, no size found")}getChannels(J){return 3}}class CV{match(J){return J.length>=8&&J[0]===137&&J[1]===80&&J[2]===78&&J[3]===71&&J[4]===13&&J[5]===10&&J[6]===26&&J[7]===10}getSize(J){let Z=new DataView(J.buffer,J.byteOffset);if(m0.decodeText(J.slice(12,16))===CV.PNG_FRIED_CHUNK_NAME)return[Z.getUint32(32,!1),Z.getUint32(36,!1)];return[Z.getUint32(16,!1),Z.getUint32(20,!1)]}getChannels(J){return 4}}CV.PNG_FRIED_CHUNK_NAME="CgBI";class q7{static registerFormat(J,Z){this.impls[J]=Z}static getMimeType(J){for(let Z in this.impls)if(this.impls[Z].match(J))return Z;return null}static getSize(J,Z){if(!this.impls[Z])return null;return this.impls[Z].getSize(J)}static getChannels(J,Z){if(!this.impls[Z])return null;return this.impls[Z].getChannels(J)}static getVRAMByteLength(J,Z){if(!this.impls[Z])return null;if(this.impls[Z].getVRAMByteLength)return this.impls[Z].getVRAMByteLength(J);let X=0,Y=4,$=this.getSize(J,Z);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(J){if(J==="image/jpeg")return"jpg";return J.split("/").pop()}static extensionToMimeType(J){if(J==="jpg")return"image/jpeg";if(!J)return"";return`image/${J}`}}q7.impls={"image/jpeg":new sm,"image/png":new CV};function HK1(J,Z){if(Z>J.byteLength)throw new TypeError("Corrupt JPG, exceeded buffer limits");if(J.getUint8(Z)!==255)throw new TypeError("Invalid JPG, marker table corrupted");return J}class V7{static basename(J){let Z=J.split(/[\\/]/).pop();return Z.substring(0,Z.lastIndexOf("."))}static extension(J){if(J.startsWith("data:image/")){let Z=J.match(/data:(image\/\w+)/)[1];return q7.mimeTypeToExtension(Z)}else if(J.startsWith("data:model/gltf+json"))return"gltf";else if(J.startsWith("data:model/gltf-binary"))return"glb";else if(J.startsWith("data:application/"))return"bin";return J.split(/[\\/]/).pop().split(/[.]/).pop()}}function dm(J){return Object.prototype.toString.call(J)==="[object Object]"}function tZ(J){if(dm(J)===!1)return!1;let Z=J.constructor;if(Z===void 0)return!0;let X=Z.prototype;if(dm(X)===!1)return!1;if(Object.prototype.hasOwnProperty.call(X,"isPrototypeOf")===!1)return!1;return!0}var NR,oK;(function(J){J[J.SILENT=4]="SILENT",J[J.ERROR=3]="ERROR",J[J.WARN=2]="WARN",J[J.INFO=1]="INFO",J[J.DEBUG=0]="DEBUG"})(oK||(oK={}));class n6{constructor(J){this.verbosity=void 0,this.verbosity=J}debug(J){if(this.verbosity<=n6.Verbosity.DEBUG)console.debug(J)}info(J){if(this.verbosity<=n6.Verbosity.INFO)console.info(J)}warn(J){if(this.verbosity<=n6.Verbosity.WARN)console.warn(J)}error(J){if(this.verbosity<=n6.Verbosity.ERROR)console.error(J)}}NR=n6;n6.Verbosity=oK;n6.DEFAULT_INSTANCE=new NR(NR.Verbosity.INFO);function qK1(J){var Z=J[0],X=J[1],Y=J[2],$=J[3],W=J[4],Q=J[5],K=J[6],G=J[7],z=J[8],F=J[9],H=J[10],q=J[11],V=J[12],U=J[13],L=J[14],w=J[15],j=Z*Q-X*W,M=Z*K-Y*W,R=Z*G-$*W,N=X*K-Y*Q,D=X*G-$*Q,P=Y*G-$*K,C=z*U-F*V,k=z*L-H*V,I=z*w-q*V,A=F*L-H*U,v=F*w-q*U,x=H*w-q*L;return j*x-M*v+R*A+N*I-D*k+P*C}function VK1(J,Z,X){var Y=Z[0],$=Z[1],W=Z[2],Q=Z[3],K=Z[4],G=Z[5],z=Z[6],F=Z[7],H=Z[8],q=Z[9],V=Z[10],U=Z[11],L=Z[12],w=Z[13],j=Z[14],M=Z[15],R=X[0],N=X[1],D=X[2],P=X[3];return J[0]=R*Y+N*K+D*H+P*L,J[1]=R*$+N*G+D*q+P*w,J[2]=R*W+N*z+D*V+P*j,J[3]=R*Q+N*F+D*U+P*M,R=X[4],N=X[5],D=X[6],P=X[7],J[4]=R*Y+N*K+D*H+P*L,J[5]=R*$+N*G+D*q+P*w,J[6]=R*W+N*z+D*V+P*j,J[7]=R*Q+N*F+D*U+P*M,R=X[8],N=X[9],D=X[10],P=X[11],J[8]=R*Y+N*K+D*H+P*L,J[9]=R*$+N*G+D*q+P*w,J[10]=R*W+N*z+D*V+P*j,J[11]=R*Q+N*F+D*U+P*M,R=X[12],N=X[13],D=X[14],P=X[15],J[12]=R*Y+N*K+D*H+P*L,J[13]=R*$+N*G+D*q+P*w,J[14]=R*W+N*z+D*V+P*j,J[15]=R*Q+N*F+D*U+P*M,J}function UK1(J,Z){var X=Z[0],Y=Z[1],$=Z[2],W=Z[4],Q=Z[5],K=Z[6],G=Z[8],z=Z[9],F=Z[10];return J[0]=Math.hypot(X,Y,$),J[1]=Math.hypot(W,Q,K),J[2]=Math.hypot(G,z,F),J}function wK1(J,Z){var X=new MR(3);UK1(X,Z);var Y=1/X[0],$=1/X[1],W=1/X[2],Q=Z[0]*Y,K=Z[1]*$,G=Z[2]*W,z=Z[4]*Y,F=Z[5]*$,H=Z[6]*W,q=Z[8]*Y,V=Z[9]*$,U=Z[10]*W,L=Q+F+U,w=0;if(L>0)w=Math.sqrt(L+1)*2,J[3]=0.25*w,J[0]=(H-V)/w,J[1]=(q-G)/w,J[2]=(K-z)/w;else if(Q>F&&Q>U)w=Math.sqrt(1+Q-F-U)*2,J[3]=(H-V)/w,J[0]=0.25*w,J[1]=(K+z)/w,J[2]=(q+G)/w;else if(F>U)w=Math.sqrt(1+F-Q-U)*2,J[3]=(q-G)/w,J[0]=(K+z)/w,J[1]=0.25*w,J[2]=(H+V)/w;else w=Math.sqrt(1+U-Q-F)*2,J[3]=(K-z)/w,J[0]=(q+G)/w,J[1]=(H+V)/w,J[2]=0.25*w;return J}class A0{static identity(J){return J}static eq(J,Z,X=0.00001){if(J.length!==Z.length)return!1;for(let Y=0;Y<J.length;Y++)if(Math.abs(J[Y]-Z[Y])>X)return!1;return!0}static clamp(J,Z,X){if(J<Z)return Z;if(J>X)return X;return J}static decodeNormalizedInt(J,Z){switch(Z){case 5126:return J;case 5123:return J/65535;case 5121:return J/255;case 5122:return Math.max(J/32767,-1);case 5120:return Math.max(J/127,-1);default:throw new Error("Invalid component type.")}}static encodeNormalizedInt(J,Z){switch(Z){case 5126:return J;case 5123:return Math.round(A0.clamp(J,0,1)*65535);case 5121:return Math.round(A0.clamp(J,0,1)*255);case 5122:return Math.round(A0.clamp(J,-1,1)*32767);case 5120:return Math.round(A0.clamp(J,-1,1)*127);default:throw new Error("Invalid component type.")}}static decompose(J,Z,X,Y){let $=OR([J[0],J[1],J[2]]),W=OR([J[4],J[5],J[6]]),Q=OR([J[8],J[9],J[10]]);if(qK1(J)<0)$=-$;Z[0]=J[12],Z[1]=J[13],Z[2]=J[14];let G=J.slice(),z=1/$,F=1/W,H=1/Q;G[0]*=z,G[1]*=z,G[2]*=z,G[4]*=F,G[5]*=F,G[6]*=F,G[8]*=H,G[9]*=H,G[10]*=H,wK1(X,G),Y[0]=$,Y[1]=W,Y[2]=Q}static compose(J,Z,X,Y){let $=Y,W=Z[0],Q=Z[1],K=Z[2],G=Z[3],z=W+W,F=Q+Q,H=K+K,q=W*z,V=W*F,U=W*H,L=Q*F,w=Q*H,j=K*H,M=G*z,R=G*F,N=G*H,D=X[0],P=X[1],C=X[2];return $[0]=(1-(L+j))*D,$[1]=(V+N)*D,$[2]=(U-R)*D,$[3]=0,$[4]=(V-N)*P,$[5]=(1-(q+j))*P,$[6]=(w+M)*P,$[7]=0,$[8]=(U+R)*C,$[9]=(w-M)*C,$[10]=(1-(q+L))*C,$[11]=0,$[12]=J[0],$[13]=J[1],$[14]=J[2],$[15]=1,$}}function LK1(J,Z){if(!!J!==!!Z)return!1;let X=J.getChild(),Y=Z.getChild();return X===Y||X.equals(Y)}function BK1(J,Z){if(!!J!==!!Z)return!1;let X=J.values(),Y=Z.values();if(X.length!==Y.length)return!1;for(let $=0;$<X.length;$++){let W=X[$],Q=Y[$];if(W.getChild()===Q.getChild())continue;if(!W.getChild().equals(Q.getChild()))return!1}return!0}function jK1(J,Z){if(!!J!==!!Z)return!1;let X=J.keys(),Y=Z.keys();if(X.length!==Y.length)return!1;for(let $ of X){let W=J.get($),Q=Z.get($);if(!!W!==!!Q)return!1;let K=W.getChild(),G=Q.getChild();if(K===G)continue;if(!K.equals(G))return!1}return!0}function om(J,Z){if(J===Z)return!0;if(!!J!==!!Z||!J||!Z)return!1;if(J.length!==Z.length)return!1;for(let X=0;X<J.length;X++)if(J[X]!==Z[X])return!1;return!0}function rm(J,Z){if(J===Z)return!0;if(!!J!==!!Z)return!1;if(!tZ(J)||!tZ(Z))return J===Z;let X=J,Y=Z,$=0,W=0,Q;for(Q in X)$++;for(Q in Y)W++;if($!==W)return!1;for(Q in X){let K=X[Q],G=Y[Q];if(PV(K)&&PV(G)){if(!om(K,G))return!1}else if(tZ(K)&&tZ(G)){if(!rm(K,G))return!1}else if(K!==G)return!1}return!0}function PV(J){return Array.isArray(J)||ArrayBuffer.isView(J)}var um="23456789abdegjkmnpqrvwxyzABDEGJKMNPQRVWXYZ",OK1=999,MK1=6,cm=new Set,RK1=function J(){let Z="";for(let X=0;X<MK1;X++)Z+=um.charAt(Math.floor(Math.random()*um.length));return Z},tm=function J(){for(let Z=0;Z<OK1;Z++){let X=RK1();if(!cm.has(X))return cm.add(X),X}return""},lm="https://null.example";class h5{static dirname(J){let Z=J.lastIndexOf("/");if(Z===-1)return"./";return J.substring(0,Z+1)}static basename(J){return V7.basename(new URL(J,lm).pathname)}static extension(J){return V7.extension(new URL(J,lm).pathname)}static resolve(J,Z){if(!this.isRelativePath(Z))return Z;let X=J.split("/"),Y=Z.split("/");X.pop();for(let $=0;$<Y.length;$++){if(Y[$]===".")continue;if(Y[$]==="..")X.pop();else X.push(Y[$])}return X.join("/")}static isAbsoluteURL(J){return this.PROTOCOL_REGEXP.test(J)}static isRelativePath(J){return!/^(?:[a-zA-Z]+:)?\//.test(J)}}h5.DEFAULT_INIT={};h5.PROTOCOL_REGEXP=/^[a-zA-Z]+:\/\//;var FJ=(J)=>J,NK1=new Set;class TV extends v${constructor(J,Z=""){super(J);this[C0].name=Z,this.init(),this.dispatchEvent({type:"create"})}getGraph(){return this.graph}getDefaults(){return Object.assign(super.getDefaults(),{name:"",extras:{}})}set(J,Z){if(Array.isArray(Z))Z=Z.slice();return super.set(J,Z)}getName(){return this.get("name")}setName(J){return this.set("name",J)}getExtras(){return this.get("extras")}setExtras(J){return this.set("extras",J)}clone(){return new this.constructor(this.graph).copy(this,FJ)}copy(J,Z=FJ){for(let X in this[C0]){let Y=this[C0][X];if(Y instanceof p6){if(!this[k9].has(X))Y.dispose()}else if(Y instanceof J6||Y instanceof w0)for(let $ of Y.values())$.dispose();else if(Y instanceof d1)for(let $ of Y.values())$.dispose()}for(let X in J[C0]){let Y=this[C0][X],$=J[C0][X];if($ instanceof p6)if(this[k9].has(X))Y.getChild().copy(Z($.getChild()),Z);else this.setRef(X,Z($.getChild()),$.getAttributes());else if($ instanceof w0||$ instanceof J6)for(let W of $.values())this.addRef(X,Z(W.getChild()),W.getAttributes());else if($ instanceof d1)for(let W of $.keys()){let Q=$.get(W);this.setRefMap(X,W,Z(Q.getChild()),Q.getAttributes())}else if(tZ($))this[C0][X]=JSON.parse(JSON.stringify($));else if(Array.isArray($)||$ instanceof ArrayBuffer||ArrayBuffer.isView($))this[C0][X]=$.slice();else this[C0][X]=$}return this}equals(J,Z=NK1){if(this===J)return!0;if(this.propertyType!==J.propertyType)return!1;for(let X in this[C0]){if(Z.has(X))continue;let Y=this[C0][X],$=J[C0][X];if(Y instanceof p6||$ instanceof p6){if(!LK1(Y,$))return!1}else if(Y instanceof w0||$ instanceof w0||Y instanceof J6||$ instanceof J6){if(!BK1(Y,$))return!1}else if(Y instanceof d1||$ instanceof d1){if(!jK1(Y,$))return!1}else if(tZ(Y)||tZ($)){if(!rm(Y,$))return!1}else if(PV(Y)||PV($)){if(!om(Y,$))return!1}else if(Y!==$)return!1}return!0}detach(){return this.graph.disconnectParents(this,(J)=>J.propertyType!=="Root"),this}listParents(){return this.graph.listParents(this)}}class X6 extends TV{getDefaults(){return Object.assign(super.getDefaults(),{extensions:new d1})}getExtension(J){return this.getRefMap("extensions",J)}setExtension(J,Z){if(Z)Z._validateParent(this);return this.setRefMap("extensions",J,Z)}listExtensions(){return this.listRefMapValues("extensions")}}class R0 extends X6{init(){this.propertyType=c.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(J){switch(J){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: "+J)}}static getComponentSize(J){switch(J){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: "+J)}}getMinNormalized(J){let Z=this.getNormalized(),X=this.getElementSize(),Y=this.getComponentType();if(this.getMin(J),Z)for(let $=0;$<X;$++)J[$]=A0.decodeNormalizedInt(J[$],Y);return J}getMin(J){let Z=this.getArray(),X=this.getCount(),Y=this.getElementSize();for(let $=0;$<Y;$++)J[$]=1/0;for(let $=0;$<X*Y;$+=Y)for(let W=0;W<Y;W++){let Q=Z[$+W];if(Number.isFinite(Q))J[W]=Math.min(J[W],Q)}return J}getMaxNormalized(J){let Z=this.getNormalized(),X=this.getElementSize(),Y=this.getComponentType();if(this.getMax(J),Z)for(let $=0;$<X;$++)J[$]=A0.decodeNormalizedInt(J[$],Y);return J}getMax(J){let Z=this.get("array"),X=this.getCount(),Y=this.getElementSize();for(let $=0;$<Y;$++)J[$]=-1/0;for(let $=0;$<X*Y;$+=Y)for(let W=0;W<Y;W++){let Q=Z[$+W];if(Number.isFinite(Q))J[W]=Math.max(J[W],Q)}return J}getCount(){let J=this.get("array");return J?J.length/this.getElementSize():0}getType(){return this.get("type")}setType(J){return this.set("type",J)}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(J){return this.set("normalized",J)}getScalar(J){let Z=this.getElementSize(),X=this.getComponentType(),Y=this.getArray();if(this.getNormalized())return A0.decodeNormalizedInt(Y[J*Z],X);return Y[J*Z]}setScalar(J,Z){let X=this.getElementSize(),Y=this.getComponentType(),$=this.getArray();if(this.getNormalized())$[J*X]=A0.encodeNormalizedInt(Z,Y);else $[J*X]=Z;return this}getElement(J,Z){let X=this.getNormalized(),Y=this.getElementSize(),$=this.getComponentType(),W=this.getArray();for(let Q=0;Q<Y;Q++)if(X)Z[Q]=A0.decodeNormalizedInt(W[J*Y+Q],$);else Z[Q]=W[J*Y+Q];return Z}setElement(J,Z){let X=this.getNormalized(),Y=this.getElementSize(),$=this.getComponentType(),W=this.getArray();for(let Q=0;Q<Y;Q++)if(X)W[J*Y+Q]=A0.encodeNormalizedInt(Z[Q],$);else W[J*Y+Q]=Z[Q];return this}getSparse(){return this.get("sparse")}setSparse(J){return this.set("sparse",J)}getBuffer(){return this.getRef("buffer")}setBuffer(J){return this.setRef("buffer",J)}getArray(){return this.get("array")}setArray(J){return this.set("componentType",J?PK1(J):R0.ComponentType.FLOAT),this.set("array",J),this}getByteLength(){let J=this.get("array");return J?J.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 PK1(J){switch(J.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 TR extends X6{init(){this.propertyType=c.ANIMATION}getDefaults(){return Object.assign(super.getDefaults(),{channels:new w0,samplers:new w0})}addChannel(J){return this.addRef("channels",J)}removeChannel(J){return this.removeRef("channels",J)}listChannels(){return this.listRefs("channels")}addSampler(J){return this.addRef("samplers",J)}removeSampler(J){return this.removeRef("samplers",J)}listSamplers(){return this.listRefs("samplers")}}class eZ extends X6{init(){this.propertyType=c.ANIMATION_CHANNEL}getDefaults(){return Object.assign(super.getDefaults(),{targetPath:null,targetNode:null,sampler:null})}getTargetPath(){return this.get("targetPath")}setTargetPath(J){return this.set("targetPath",J)}getTargetNode(){return this.getRef("targetNode")}setTargetNode(J){return this.setRef("targetNode",J)}getSampler(){return this.getRef("sampler")}setSampler(J){return this.setRef("sampler",J)}}eZ.TargetPath={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"};class S$ extends X6{init(){this.propertyType=c.ANIMATION_SAMPLER}getDefaultAttributes(){return Object.assign(super.getDefaults(),{interpolation:S$.Interpolation.LINEAR,input:null,output:null})}getInterpolation(){return this.get("interpolation")}setInterpolation(J){return this.set("interpolation",J)}getInput(){return this.getRef("input")}setInput(J){return this.setRef("input",J,{usage:w5.OTHER})}getOutput(){return this.getRef("output")}setOutput(J){return this.setRef("output",J,{usage:w5.OTHER})}}S$.Interpolation={LINEAR:"LINEAR",STEP:"STEP",CUBICSPLINE:"CUBICSPLINE"};class kR extends X6{init(){this.propertyType=c.BUFFER}getDefaults(){return Object.assign(super.getDefaults(),{uri:""})}getURI(){return this.get("uri")}setURI(J){return this.set("uri",J)}}class JX extends X6{init(){this.propertyType=c.CAMERA}getDefaults(){return Object.assign(super.getDefaults(),{type:JX.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(J){return this.set("type",J)}getZNear(){return this.get("znear")}setZNear(J){return this.set("znear",J)}getZFar(){return this.get("zfar")}setZFar(J){return this.set("zfar",J)}getAspectRatio(){return this.get("aspectRatio")}setAspectRatio(J){return this.set("aspectRatio",J)}getYFov(){return this.get("yfov")}setYFov(J){return this.set("yfov",J)}getXMag(){return this.get("xmag")}setXMag(J){return this.set("xmag",J)}getYMag(){return this.get("ymag")}setYMag(J){return this.set("ymag",J)}}JX.Type={PERSPECTIVE:"perspective",ORTHOGRAPHIC:"orthographic"};class _$ extends TV{_validateParent(J){if(!this.parentTypes.includes(J.propertyType))throw new Error(`Parent "${J.propertyType}" invalid for child "${this.propertyType}".`)}}_$.EXTENSION_NAME=void 0;class i6 extends X6{init(){this.propertyType=c.TEXTURE_INFO}getDefaults(){return Object.assign(super.getDefaults(),{texCoord:0,magFilter:null,minFilter:null,wrapS:i6.WrapMode.REPEAT,wrapT:i6.WrapMode.REPEAT})}getTexCoord(){return this.get("texCoord")}setTexCoord(J){return this.set("texCoord",J)}getMagFilter(){return this.get("magFilter")}setMagFilter(J){return this.set("magFilter",J)}getMinFilter(){return this.get("minFilter")}setMinFilter(J){return this.set("minFilter",J)}getWrapS(){return this.get("wrapS")}setWrapS(J){return this.set("wrapS",J)}getWrapT(){return this.get("wrapT")}setWrapT(J){return this.set("wrapT",J)}}i6.WrapMode={CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497};i6.MagFilter={NEAREST:9728,LINEAR:9729};i6.MinFilter={NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987};var{R:wV,G:LV,B:BV,A:DK1}=NV;class z4 extends X6{init(){this.propertyType=c.MATERIAL}getDefaults(){return Object.assign(super.getDefaults(),{alphaMode:z4.AlphaMode.OPAQUE,alphaCutoff:0.5,doubleSided:!1,baseColorFactor:[1,1,1,1],baseColorTexture:null,baseColorTextureInfo:new i6(this.graph,"baseColorTextureInfo"),emissiveFactor:[0,0,0],emissiveTexture:null,emissiveTextureInfo:new i6(this.graph,"emissiveTextureInfo"),normalScale:1,normalTexture:null,normalTextureInfo:new i6(this.graph,"normalTextureInfo"),occlusionStrength:1,occlusionTexture:null,occlusionTextureInfo:new i6(this.graph,"occlusionTextureInfo"),roughnessFactor:1,metallicFactor:1,metallicRoughnessTexture:null,metallicRoughnessTextureInfo:new i6(this.graph,"metallicRoughnessTextureInfo")})}getDoubleSided(){return this.get("doubleSided")}setDoubleSided(J){return this.set("doubleSided",J)}getAlpha(){return this.get("baseColorFactor")[3]}setAlpha(J){let Z=this.get("baseColorFactor").slice();return Z[3]=J,this.set("baseColorFactor",Z)}getAlphaMode(){return this.get("alphaMode")}setAlphaMode(J){return this.set("alphaMode",J)}getAlphaCutoff(){return this.get("alphaCutoff")}setAlphaCutoff(J){return this.set("alphaCutoff",J)}getBaseColorFactor(){return this.get("baseColorFactor")}setBaseColorFactor(J){return this.set("baseColorFactor",J)}getBaseColorTexture(){return this.getRef("baseColorTexture")}getBaseColorTextureInfo(){return this.getRef("baseColorTexture")?this.getRef("baseColorTextureInfo"):null}setBaseColorTexture(J){return this.setRef("baseColorTexture",J,{channels:wV|LV|BV|DK1,isColor:!0})}getEmissiveFactor(){return this.get("emissiveFactor")}setEmissiveFactor(J){return this.set("emissiveFactor",J)}getEmissiveTexture(){return this.getRef("emissiveTexture")}getEmissiveTextureInfo(){return this.getRef("emissiveTexture")?this.getRef("emissiveTextureInfo"):null}setEmissiveTexture(J){return this.setRef("emissiveTexture",J,{channels:wV|LV|BV,isColor:!0})}getNormalScale(){return this.get("normalScale")}setNormalScale(J){return this.set("normalScale",J)}getNormalTexture(){return this.getRef("normalTexture")}getNormalTextureInfo(){return this.getRef("normalTexture")?this.getRef("normalTextureInfo"):null}setNormalTexture(J){return this.setRef("normalTexture",J,{channels:wV|LV|BV})}getOcclusionStrength(){return this.get("occlusionStrength")}setOcclusionStrength(J){return this.set("occlusionStrength",J)}getOcclusionTexture(){return this.getRef("occlusionTexture")}getOcclusionTextureInfo(){return this.getRef("occlusionTexture")?this.getRef("occlusionTextureInfo"):null}setOcclusionTexture(J){return this.setRef("occlusionTexture",J,{channels:wV})}getRoughnessFactor(){return this.get("roughnessFactor")}setRoughnessFactor(J){return this.set("roughnessFactor",J)}getMetallicFactor(){return this.get("metallicFactor")}setMetallicFactor(J){return this.set("metallicFactor",J)}getMetallicRoughnessTexture(){return this.getRef("metallicRoughnessTexture")}getMetallicRoughnessTextureInfo(){return this.getRef("metallicRoughnessTexture")?this.getRef("metallicRoughnessTextureInfo"):null}setMetallicRoughnessTexture(J){return this.setRef("metallicRoughnessTexture",J,{channels:LV|BV})}}z4.AlphaMode={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};class tK extends X6{init(){this.propertyType=c.MESH}getDefaults(){return Object.assign(super.getDefaults(),{weights:[],primitives:new w0})}addPrimitive(J){return this.addRef("primitives",J)}removePrimitive(J){return this.removeRef("primitives",J)}listPrimitives(){return this.listRefs("primitives")}getWeights(){return this.get("weights")}setWeights(J){return this.set("weights",J)}}class kV extends X6{init(){this.propertyType=c.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 w0})}copy(J,Z=FJ){if(Z===FJ)throw new Error("Node cannot be copied.");return super.copy(J,Z)}getTranslation(){return this.get("translation")}getRotation(){return this.get("rotation")}getScale(){return this.get("scale")}setTranslation(J){return this.set("translation",J)}setRotation(J){return this.set("rotation",J)}setScale(J){return this.set("scale",J)}getMatrix(){return A0.compose(this.get("translation"),this.get("rotation"),this.get("scale"),[])}setMatrix(J){let Z=this.get("translation").slice(),X=this.get("rotation").slice(),Y=this.get("scale").slice();return A0.decompose(J,Z,X,Y),this.set("translation",Z).set("rotation",X).set("scale",Y)}getWorldTranslation(){let J=[0,0,0];return A0.decompose(this.getWorldMatrix(),J,[0,0,0,1],[1,1,1]),J}getWorldRotation(){let J=[0,0,0,1];return A0.decompose(this.getWorldMatrix(),[0,0,0],J,[1,1,1]),J}getWorldScale(){let J=[1,1,1];return A0.decompose(this.getWorldMatrix(),[0,0,0],[0,0,0,1],J),J}getWorldMatrix(){let J=[];for(let Y=this;Y!=null;Y=Y.getParentNode())J.push(Y);let Z,X=J.pop().getMatrix();while(Z=J.pop())VK1(X,X,Z.getMatrix());return X}addChild(J){let Z=J.getParentNode();if(Z)Z.removeChild(J);for(let X of J.listParents())if(X.propertyType===c.SCENE)X.removeChild(J);return this.addRef("children",J)}removeChild(J){return this.removeRef("children",J)}listChildren(){return this.listRefs("children")}getParentNode(){for(let J of this.listParents())if(J.propertyType===c.NODE)return J;return null}getMesh(){return this.getRef("mesh")}setMesh(J){return this.setRef("mesh",J)}getCamera(){return this.getRef("camera")}setCamera(J){return this.setRef("camera",J)}getSkin(){return this.getRef("skin")}setSkin(J){return this.setRef("skin",J)}getWeights(){return this.get("weights")}setWeights(J){return this.set("weights",J)}traverse(J){J(this);for(let Z of this.listChildren())Z.traverse(J);return this}}class K8 extends X6{init(){this.propertyType=c.PRIMITIVE}getDefaults(){return Object.assign(super.getDefaults(),{mode:K8.Mode.TRIANGLES,material:null,indices:null,attributes:new d1,targets:new w0})}getIndices(){return this.getRef("indices")}setIndices(J){return this.setRef("indices",J,{usage:w5.ELEMENT_ARRAY_BUFFER})}getAttribute(J){return this.getRefMap("attributes",J)}setAttribute(J,Z){return this.setRefMap("attributes",J,Z,{usage:w5.ARRAY_BUFFER})}listAttributes(){return this.listRefMapValues("attributes")}listSemantics(){return this.listRefMapKeys("attributes")}getMaterial(){return this.getRef("material")}setMaterial(J){return this.setRef("material",J)}getMode(){return this.get("mode")}setMode(J){return this.set("mode",J)}listTargets(){return this.listRefs("targets")}addTarget(J){return this.addRef("targets",J)}removeTarget(J){return this.removeRef("targets",J)}}K8.Mode={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class ER extends TV{init(){this.propertyType=c.PRIMITIVE_TARGET}getDefaults(){return Object.assign(super.getDefaults(),{attributes:new d1})}getAttribute(J){return this.getRefMap("attributes",J)}setAttribute(J,Z){return this.setRefMap("attributes",J,Z,{usage:w5.ARRAY_BUFFER})}listAttributes(){return this.listRefMapValues("attributes")}listSemantics(){return this.listRefMapKeys("attributes")}}function j6(){return j6=Object.assign?Object.assign.bind():function(J){for(var Z=1;Z<arguments.length;Z++){var X=arguments[Z];for(var Y in X)({}).hasOwnProperty.call(X,Y)&&(J[Y]=X[Y])}return J},j6.apply(null,arguments)}class x$ extends X6{init(){this.propertyType=c.SCENE}getDefaults(){return Object.assign(super.getDefaults(),{children:new w0})}copy(J,Z=FJ){if(Z===FJ)throw new Error("Scene cannot be copied.");return super.copy(J,Z)}addChild(J){let Z=J.getParentNode();if(Z)Z.removeChild(J);return this.addRef("children",J)}removeChild(J){return this.removeRef("children",J)}listChildren(){return this.listRefs("children")}traverse(J){for(let Z of this.listChildren())Z.traverse(J);return this}}class IR extends X6{init(){this.propertyType=c.SKIN}getDefaults(){return Object.assign(super.getDefaults(),{skeleton:null,inverseBindMatrices:null,joints:new w0})}getSkeleton(){return this.getRef("skeleton")}setSkeleton(J){return this.setRef("skeleton",J)}getInverseBindMatrices(){return this.getRef("inverseBindMatrices")}setInverseBindMatrices(J){return this.setRef("inverseBindMatrices",J,{usage:w5.INVERSE_BIND_MATRICES})}addJoint(J){return this.addRef("joints",J)}removeJoint(J){return this.removeRef("joints",J)}listJoints(){return this.listRefs("joints")}}class ZX extends X6{init(){this.propertyType=c.TEXTURE}getDefaults(){return Object.assign(super.getDefaults(),{image:null,mimeType:"",uri:""})}getMimeType(){return this.get("mimeType")||q7.extensionToMimeType(V7.extension(this.get("uri")))}setMimeType(J){return this.set("mimeType",J)}getURI(){return this.get("uri")}setURI(J){this.set("uri",J);let Z=q7.extensionToMimeType(V7.extension(J));if(Z)this.set("mimeType",Z);return this}getImage(){return this.get("image")}setImage(J){return this.set("image",m0.assertView(J))}getSize(){let J=this.get("image");if(!J)return null;return q7.getSize(J,this.getMimeType())}}class XX extends X6{init(){this.propertyType=c.ROOT}getDefaults(){return Object.assign(super.getDefaults(),{asset:{generator:`glTF-Transform ${nm}`,version:"2.0"},defaultScene:null,accessors:new w0,animations:new w0,buffers:new w0,cameras:new w0,materials:new w0,meshes:new w0,nodes:new w0,scenes:new w0,skins:new w0,textures:new w0})}constructor(J){super(J);this._extensions=new Set,J.addEventListener("node:create",(Z)=>{this._addChildOfRoot(Z.target)})}clone(){throw new Error("Root cannot be cloned.")}copy(J,Z=FJ){if(Z===FJ)throw new Error("Root cannot be copied.");this.set("asset",j6({},J.get("asset"))),this.setName(J.getName()),this.setExtras(j6({},J.getExtras())),this.setDefaultScene(J.getDefaultScene()?Z(J.getDefaultScene()):null);for(let X of J.listRefMapKeys("extensions")){let Y=J.getExtension(X);this.setExtension(X,Z(Y))}return this}_addChildOfRoot(J){if(J instanceof x$)this.addRef("scenes",J);else if(J instanceof kV)this.addRef("nodes",J);else if(J instanceof JX)this.addRef("cameras",J);else if(J instanceof IR)this.addRef("skins",J);else if(J instanceof tK)this.addRef("meshes",J);else if(J instanceof z4)this.addRef("materials",J);else if(J instanceof ZX)this.addRef("textures",J);else if(J instanceof TR)this.addRef("animations",J);else if(J instanceof R0)this.addRef("accessors",J);else if(J instanceof kR)this.addRef("buffers",J);return this}getAsset(){return this.get("asset")}listExtensionsUsed(){return Array.from(this._extensions)}listExtensionsRequired(){return this.listExtensionsUsed().filter((J)=>J.isRequired())}_enableExtension(J){return this._extensions.add(J),this}_disableExtension(J){return this._extensions.delete(J),this}listScenes(){return this.listRefs("scenes")}setDefaultScene(J){return this.setRef("defaultScene",J)}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 Z6{static fromGraph(J){return Z6._GRAPH_DOCUMENTS.get(J)||null}constructor(){this._graph=new I$,this._root=new XX(this._graph),this._logger=n6.DEFAULT_INSTANCE,Z6._GRAPH_DOCUMENTS.set(this._graph,this)}getRoot(){return this._root}getGraph(){return this._graph}getLogger(){return this._logger}setLogger(J){return this._logger=J,this}clone(){throw new Error("Use 'cloneDocument(source)' from '@gltf-transform/functions'.")}merge(J){throw new Error("Use 'mergeDocuments(target, source)' from '@gltf-transform/functions'.")}async transform(...J){let Z=J.map((X)=>X.name);for(let X of J)await X(this,{stack:Z});return this}createExtension(J){let Z=J.EXTENSION_NAME;return this.getRoot().listExtensionsUsed().find((Y)=>Y.extensionName===Z)||new J(this)}createScene(J=""){return new x$(this._graph,J)}createNode(J=""){return new kV(this._graph,J)}createCamera(J=""){return new JX(this._graph,J)}createSkin(J=""){return new IR(this._graph,J)}createMesh(J=""){return new tK(this._graph,J)}createPrimitive(){return new K8(this._graph)}createPrimitiveTarget(J=""){return new ER(this._graph,J)}createMaterial(J=""){return new z4(this._graph,J)}createTexture(J=""){return new ZX(this._graph,J)}createAnimation(J=""){return new TR(this._graph,J)}createAnimationChannel(J=""){return new eZ(this._graph,J)}createAnimationSampler(J=""){return new S$(this._graph,J)}createAccessor(J="",Z=null){if(!Z)Z=this.getRoot().listBuffers()[0];return new R0(this._graph,J).setBuffer(Z)}createBuffer(J=""){return new kR(this._graph,J)}}Z6._GRAPH_DOCUMENTS=new WeakMap;class em{constructor(J){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=J,J.getRoot()._enableExtension(this),this._listener=(X)=>{let Y=X,$=Y.target;if($ instanceof _$&&$.extensionName===this.extensionName){if(Y.type==="node:create")this._addExtensionProperty($);if(Y.type==="node:dispose")this._removeExtensionProperty($)}};let Z=J.getGraph();Z.addEventListener("node:create",this._listener),Z.addEventListener("node:dispose",this._listener)}dispose(){this.document.getRoot()._disableExtension(this);let J=this.document.getGraph();J.removeEventListener("node:create",this._listener),J.removeEventListener("node:dispose",this._listener);for(let Z of this.properties)Z.dispose()}static register(){}isRequired(){return this.required}setRequired(J){return this.required=J,this}listProperties(){return Array.from(this.properties)}_addExtensionProperty(J){return this.properties.add(J),this}_removeExtensionProperty(J){return this.properties.delete(J),this}install(J,Z){return this}preread(J,Z){return this}prewrite(J,Z){return this}}em.EXTENSION_NAME=void 0;class Jd{constructor(J){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=J}setTextureInfo(J,Z){if(this.textureInfos.set(J,Z),Z.texCoord!==void 0)J.setTexCoord(Z.texCoord);if(Z.extras!==void 0)J.setExtras(Z.extras);let X=this.jsonDoc.json.textures[Z.index];if(X.sampler===void 0)return;let Y=this.jsonDoc.json.samplers[X.sampler];if(Y.magFilter!==void 0)J.setMagFilter(Y.magFilter);if(Y.minFilter!==void 0)J.setMinFilter(Y.minFilter);if(Y.wrapS!==void 0)J.setWrapS(Y.wrapS);if(Y.wrapT!==void 0)J.setWrapT(Y.wrapT)}}var pm={logger:n6.DEFAULT_INSTANCE,extensions:[],dependencies:{}},CK1=new Set([c.BUFFER,c.TEXTURE,c.MATERIAL,c.MESH,c.PRIMITIVE,c.NODE,c.SCENE]);class Zd{static read(J,Z=pm){let X=j6({},pm,Z),{json:Y}=J,$=new Z6().setLogger(X.logger);this.validate(J,X);let W=new Jd(J),Q=Y.asset,K=$.getRoot().getAsset();if(Q.copyright)K.copyright=Q.copyright;if(Q.extras)K.extras=Q.extras;if(Y.extras!==void 0)$.getRoot().setExtras(j6({},Y.extras));let G=Y.extensionsUsed||[],z=Y.extensionsRequired||[];X.extensions.sort((P,C)=>P.EXTENSION_NAME>C.EXTENSION_NAME?1:-1);for(let P of X.extensions)if(G.includes(P.EXTENSION_NAME)){let C=$.createExtension(P).setRequired(z.includes(P.EXTENSION_NAME)),k=C.prereadTypes.filter((I)=>!CK1.has(I));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 I of C.readDependencies)C.install(I,X.dependencies[I])}let F=Y.buffers||[];$.getRoot().listExtensionsUsed().filter((P)=>P.prereadTypes.includes(c.BUFFER)).forEach((P)=>P.preread(W,c.BUFFER)),W.buffers=F.map((P)=>{let C=$.createBuffer(P.name);if(P.extras)C.setExtras(P.extras);if(P.uri&&P.uri.indexOf("__")!==0)C.setURI(P.uri);return C});let H=Y.bufferViews||[];W.bufferViewBuffers=H.map((P,C)=>{if(!W.bufferViews[C]){let k=J.json.buffers[P.buffer],I=k.uri?J.resources[k.uri]:J.resources[MV],A=P.byteOffset||0;W.bufferViews[C]=m0.toView(I,A,P.byteLength)}return W.buffers[P.buffer]});let q=Y.accessors||[];W.accessors=q.map((P)=>{let C=W.bufferViewBuffers[P.bufferView],k=$.createAccessor(P.name,C).setType(P.type);if(P.extras)k.setExtras(P.extras);if(P.normalized!==void 0)k.setNormalized(P.normalized);if(P.bufferView===void 0)return k;return k.setArray(OV(P,W)),k});let V=Y.images||[],U=Y.textures||[];$.getRoot().listExtensionsUsed().filter((P)=>P.prereadTypes.includes(c.TEXTURE)).forEach((P)=>P.preread(W,c.TEXTURE)),W.textures=V.map((P)=>{let C=$.createTexture(P.name);if(P.extras)C.setExtras(P.extras);if(P.bufferView!==void 0){let k=Y.bufferViews[P.bufferView],I=J.json.buffers[k.buffer],A=I.uri?J.resources[I.uri]:J.resources[MV],v=k.byteOffset||0,x=k.byteLength,d=A.slice(v,v+x);C.setImage(d)}else if(P.uri!==void 0){if(C.setImage(J.resources[P.uri]),P.uri.indexOf("__")!==0)C.setURI(P.uri)}if(P.mimeType!==void 0)C.setMimeType(P.mimeType);else if(P.uri){let k=V7.extension(P.uri);C.setMimeType(q7.extensionToMimeType(k))}return C}),$.getRoot().listExtensionsUsed().filter((P)=>P.prereadTypes.includes(c.MATERIAL)).forEach((P)=>P.preread(W,c.MATERIAL));let L=Y.materials||[];W.materials=L.map((P)=>{let C=$.createMaterial(P.name);if(P.extras)C.setExtras(P.extras);if(P.alphaMode!==void 0)C.setAlphaMode(P.alphaMode);if(P.alphaCutoff!==void 0)C.setAlphaCutoff(P.alphaCutoff);if(P.doubleSided!==void 0)C.setDoubleSided(P.doubleSided);let k=P.pbrMetallicRoughness||{};if(k.baseColorFactor!==void 0)C.setBaseColorFactor(k.baseColorFactor);if(P.emissiveFactor!==void 0)C.setEmissiveFactor(P.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 I=k.baseColorTexture,A=W.textures[U[I.index].source];C.setBaseColorTexture(A),W.setTextureInfo(C.getBaseColorTextureInfo(),I)}if(P.emissiveTexture!==void 0){let I=P.emissiveTexture,A=W.textures[U[I.index].source];C.setEmissiveTexture(A),W.setTextureInfo(C.getEmissiveTextureInfo(),I)}if(P.normalTexture!==void 0){let I=P.normalTexture,A=W.textures[U[I.index].source];if(C.setNormalTexture(A),W.setTextureInfo(C.getNormalTextureInfo(),I),P.normalTexture.scale!==void 0)C.setNormalScale(P.normalTexture.scale)}if(P.occlusionTexture!==void 0){let I=P.occlusionTexture,A=W.textures[U[I.index].source];if(C.setOcclusionTexture(A),W.setTextureInfo(C.getOcclusionTextureInfo(),I),P.occlusionTexture.strength!==void 0)C.setOcclusionStrength(P.occlusionTexture.strength)}if(k.metallicRoughnessTexture!==void 0){let I=k.metallicRoughnessTexture,A=W.textures[U[I.index].source];C.setMetallicRoughnessTexture(A),W.setTextureInfo(C.getMetallicRoughnessTextureInfo(),I)}return C}),$.getRoot().listExtensionsUsed().filter((P)=>P.prereadTypes.includes(c.MESH)).forEach((P)=>P.preread(W,c.MESH));let w=Y.meshes||[];$.getRoot().listExtensionsUsed().filter((P)=>P.prereadTypes.includes(c.PRIMITIVE)).forEach((P)=>P.preread(W,c.PRIMITIVE)),W.meshes=w.map((P)=>{let C=$.createMesh(P.name);if(P.extras)C.setExtras(P.extras);if(P.weights!==void 0)C.setWeights(P.weights);return(P.primitives||[]).forEach((I)=>{let A=$.createPrimitive();if(I.extras)A.setExtras(I.extras);if(I.material!==void 0)A.setMaterial(W.materials[I.material]);if(I.mode!==void 0)A.setMode(I.mode);for(let[d,h]of Object.entries(I.attributes||{}))A.setAttribute(d,W.accessors[h]);if(I.indices!==void 0)A.setIndices(W.accessors[I.indices]);let v=P.extras&&P.extras.targetNames||[];(I.targets||[]).forEach((d,h)=>{let u=v[h]||h.toString(),$0=$.createPrimitiveTarget(u);for(let[U0,B0]of Object.entries(d))$0.setAttribute(U0,W.accessors[B0]);A.addTarget($0)}),C.addPrimitive(A)}),C});let j=Y.cameras||[];W.cameras=j.map((P)=>{let C=$.createCamera(P.name).setType(P.type);if(P.extras)C.setExtras(P.extras);if(P.type===JX.Type.PERSPECTIVE){let k=P.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=P.orthographic;C.setZNear(k.znear).setZFar(k.zfar).setXMag(k.xmag).setYMag(k.ymag)}return C});let M=Y.nodes||[];$.getRoot().listExtensionsUsed().filter((P)=>P.prereadTypes.includes(c.NODE)).forEach((P)=>P.preread(W,c.NODE)),W.nodes=M.map((P)=>{let C=$.createNode(P.name);if(P.extras)C.setExtras(P.extras);if(P.translation!==void 0)C.setTranslation(P.translation);if(P.rotation!==void 0)C.setRotation(P.rotation);if(P.scale!==void 0)C.setScale(P.scale);if(P.matrix!==void 0){let k=[0,0,0],I=[0,0,0,1],A=[1,1,1];A0.decompose(P.matrix,k,I,A),C.setTranslation(k),C.setRotation(I),C.setScale(A)}if(P.weights!==void 0)C.setWeights(P.weights);return C});let R=Y.skins||[];W.skins=R.map((P)=>{let C=$.createSkin(P.name);if(P.extras)C.setExtras(P.extras);if(P.inverseBindMatrices!==void 0)C.setInverseBindMatrices(W.accessors[P.inverseBindMatrices]);if(P.skeleton!==void 0)C.setSkeleton(W.nodes[P.skeleton]);for(let k of P.joints)C.addJoint(W.nodes[k]);return C}),M.map((P,C)=>{let k=W.nodes[C];if((P.children||[]).forEach((A)=>k.addChild(W.nodes[A])),P.mesh!==void 0)k.setMesh(W.meshes[P.mesh]);if(P.camera!==void 0)k.setCamera(W.cameras[P.camera]);if(P.skin!==void 0)k.setSkin(W.skins[P.skin])});let N=Y.animations||[];W.animations=N.map((P)=>{let C=$.createAnimation(P.name);if(P.extras)C.setExtras(P.extras);let I=(P.samplers||[]).map((v)=>{let x=$.createAnimationSampler().setInput(W.accessors[v.input]).setOutput(W.accessors[v.output]).setInterpolation(v.interpolation||S$.Interpolation.LINEAR);if(v.extras)x.setExtras(v.extras);return C.addSampler(x),x});return(P.channels||[]).forEach((v)=>{let x=$.createAnimationChannel().setSampler(I[v.sampler]).setTargetPath(v.target.path);if(v.target.node!==void 0)x.setTargetNode(W.nodes[v.target.node]);if(v.extras)x.setExtras(v.extras);C.addChannel(x)}),C});let D=Y.scenes||[];if($.getRoot().listExtensionsUsed().filter((P)=>P.prereadTypes.includes(c.SCENE)).forEach((P)=>P.preread(W,c.SCENE)),W.scenes=D.map((P)=>{let C=$.createScene(P.name);if(P.extras)C.setExtras(P.extras);return(P.nodes||[]).map((I)=>W.nodes[I]).forEach((I)=>C.addChild(I)),C}),Y.scene!==void 0)$.getRoot().setDefaultScene(W.scenes[Y.scene]);return $.getRoot().listExtensionsUsed().forEach((P)=>P.read(W)),q.forEach((P,C)=>{let k=W.accessors[C],I=!!P.sparse,A=!P.bufferView&&!k.getArray();if(I||A)k.setSparse(!0).setArray(kK1(P,W))}),$}static validate(J,Z){let X=J.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(!Z.extensions.find(($)=>$.EXTENSION_NAME===Y))throw new Error(`Missing required extension, "${Y}".`)}if(X.extensionsUsed){for(let Y of X.extensionsUsed)if(!Z.extensions.find(($)=>$.EXTENSION_NAME===Y))Z.logger.warn(`Missing optional extension, "${Y}".`)}}}function TK1(J,Z){let X=Z.jsonDoc,Y=Z.bufferViews[J.bufferView],$=X.json.bufferViews[J.bufferView],W=HJ[J.componentType],Q=R0.getElementSize(J.type),K=W.BYTES_PER_ELEMENT,G=J.byteOffset||0,z=new W(J.count*Q),F=new DataView(Y.buffer,Y.byteOffset,Y.byteLength),H=$.byteStride;for(let q=0;q<J.count;q++)for(let V=0;V<Q;V++){let U=G+q*H+V*K,L;switch(J.componentType){case R0.ComponentType.FLOAT:L=F.getFloat32(U,!0);break;case R0.ComponentType.UNSIGNED_INT:L=F.getUint32(U,!0);break;case R0.ComponentType.UNSIGNED_SHORT:L=F.getUint16(U,!0);break;case R0.ComponentType.UNSIGNED_BYTE:L=F.getUint8(U);break;case R0.ComponentType.SHORT:L=F.getInt16(U,!0);break;case R0.ComponentType.BYTE:L=F.getInt8(U);break;default:throw new Error(`Unexpected componentType "${J.componentType}".`)}z[q*Q+V]=L}return z}function OV(J,Z){let X=Z.jsonDoc,Y=Z.bufferViews[J.bufferView],$=X.json.bufferViews[J.bufferView],W=HJ[J.componentType],Q=R0.getElementSize(J.type),K=W.BYTES_PER_ELEMENT,G=Q*K;if($.byteStride!==void 0&&$.byteStride!==G)return TK1(J,Z);let z=Y.byteOffset+(J.byteOffset||0),F=J.count*Q*K;return new W(Y.buffer.slice(z,z+F))}function kK1(J,Z){let X=HJ[J.componentType],Y=R0.getElementSize(J.type),$;if(J.bufferView!==void 0)$=OV(J,Z);else $=new X(J.count*Y);let W=J.sparse;if(!W)return $;let Q=W.count,K=j6({},J,W.indices,{count:Q,type:"SCALAR"}),G=j6({},J,W.values,{count:Q}),z=OV(K,Z),F=OV(G,Z);for(let H=0;H<K.count;H++)for(let q=0;q<Y;q++)$[z[H]*Y+q]=F[H*Y+q];return $}var rK;(function(J){J[J.ARRAY_BUFFER=34962]="ARRAY_BUFFER",J[J.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER"})(rK||(rK={}));class zJ{constructor(J,Z,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=J,this.jsonDoc=Z,this.options=X;let Y=J.getRoot(),$=Y.listBuffers().length,W=Y.listTextures().length;this.bufferURIGenerator=new PR($>1,()=>X.basename||"buffer"),this.imageURIGenerator=new PR(W>1,(Q)=>EK1(J,Q)||X.basename||"texture"),this.logger=J.getLogger()}createTextureInfoDef(J,Z){let X={magFilter:Z.getMagFilter()||void 0,minFilter:Z.getMinFilter()||void 0,wrapS:Z.getWrapS(),wrapT:Z.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(J),sampler:this.samplerDefIndexMap.get(Y)},W=JSON.stringify($);if(!this.textureDefIndexMap.has(W))this.textureDefIndexMap.set(W,this.jsonDoc.json.textures.length),this.jsonDoc.json.textures.push($);let Q={index:this.textureDefIndexMap.get(W)};if(Z.getTexCoord()!==0)Q.texCoord=Z.getTexCoord();if(Object.keys(Z.getExtras()).length>0)Q.extras=Z.getExtras();return this.textureInfoDefMap.set(Z,Q),Q}createPropertyDef(J){let Z={};if(J.getName())Z.name=J.getName();if(Object.keys(J.getExtras()).length>0)Z.extras=J.getExtras();return Z}createAccessorDef(J){let Z=this.createPropertyDef(J);if(Z.type=J.getType(),Z.componentType=J.getComponentType(),Z.count=J.getCount(),this._doc.getGraph().listParentEdges(J).some((Y)=>Y.getName()==="attributes"&&Y.getAttributes().key==="POSITION"||Y.getName()==="input"))Z.max=J.getMax([]).map(Math.fround),Z.min=J.getMin([]).map(Math.fround);if(J.getNormalized())Z.normalized=J.getNormalized();return Z}createImageData(J,Z,X){if(this.options.format===H7.GLB)this.imageBufferViews.push(Z),J.bufferView=this.jsonDoc.json.bufferViews.length,this.jsonDoc.json.bufferViews.push({buffer:0,byteOffset:-1,byteLength:Z.byteLength});else{let Y=q7.mimeTypeToExtension(X.getMimeType());J.uri=this.imageURIGenerator.createURI(X,Y),this.assignResourceURI(J.uri,Z,!1)}}assignResourceURI(J,Z,X){let Y=this.jsonDoc.resources;if(!(J in Y)){Y[J]=Z;return}if(Z===Y[J]){this.logger.warn(`Duplicate resource URI, "${J}".`);return}let $=`Resource URI "${J}" already assigned to different data.`;if(!X){this.logger.warn($);return}throw new Error($)}getAccessorUsage(J){let Z=this._accessorUsageMap.get(J);if(Z)return Z;if(J.getSparse())return w5.SPARSE;for(let X of this._doc.getGraph().listParentEdges(J)){let{usage:Y}=X.getAttributes();if(Y)return Y;if(X.getParent().propertyType!==c.ROOT)this.logger.warn(`Missing attribute ".usage" on edge, "${X.getName()}".`)}return w5.OTHER}addAccessorToUsageGroup(J,Z){let X=this._accessorUsageMap.get(J);if(X&&X!==Z)throw new Error(`Accessor with usage "${X}" cannot be reused as "${Z}".`);return this._accessorUsageMap.set(J,Z),this}}zJ.BufferViewTarget=rK;zJ.BufferViewUsage=w5;zJ.USAGE_TO_TARGET={[w5.ARRAY_BUFFER]:rK.ARRAY_BUFFER,[w5.ELEMENT_ARRAY_BUFFER]:rK.ELEMENT_ARRAY_BUFFER};class PR{constructor(J,Z){this.multiple=void 0,this.basename=void 0,this.counter={},this.multiple=J,this.basename=Z}createURI(J,Z){if(J.getURI())return J.getURI();else if(!this.multiple)return`${this.basename(J)}.${Z}`;else{let X=this.basename(J);return this.counter[X]=this.counter[X]||1,`${X}_${this.counter[X]++}.${Z}`}}}function EK1(J,Z){let X=J.getGraph().listParentEdges(Z).find((Y)=>Y.getParent()!==J.getRoot());return X?X.getName().replace(/texture$/i,""):""}var{BufferViewUsage:jV}=zJ,{UNSIGNED_INT:IK1,UNSIGNED_SHORT:vK1,UNSIGNED_BYTE:SK1}=R0.ComponentType,_K1=new Set([c.ACCESSOR,c.BUFFER,c.MATERIAL,c.MESH]);class Xd{static write(J,Z){let X=J.getGraph(),Y=J.getRoot(),$={asset:j6({generator:`glTF-Transform ${nm}`},Y.getAsset()),extras:j6({},Y.getExtras())},W={json:$,resources:{}},Q=new zJ(J,W,Z),K=Z.logger||n6.DEFAULT_INSTANCE,G=new Set(Z.extensions.map((w)=>w.EXTENSION_NAME)),z=J.getRoot().listExtensionsUsed().filter((w)=>G.has(w.extensionName)).sort((w,j)=>w.extensionName>j.extensionName?1:-1),F=J.getRoot().listExtensionsRequired().filter((w)=>G.has(w.extensionName)).sort((w,j)=>w.extensionName>j.extensionName?1:-1);if(z.length<J.getRoot().listExtensionsUsed().length)K.warn("Some extensions were not registered for I/O, and will not be written.");for(let w of z){let j=w.prewriteTypes.filter((M)=>!_K1.has(M));if(j.length)K.warn(`Prewrite hooks for some types (${j.join()}), requested by extension ${w.extensionName}, are unsupported. Please file an issue or a PR.`);for(let M of w.writeDependencies)w.install(M,Z.dependencies[M])}function H(w,j,M,R){let N=[],D=0;for(let k of w){let I=Q.createAccessorDef(k);I.bufferView=$.bufferViews.length;let A=k.getArray(),v=m0.pad(m0.toView(A));I.byteOffset=D,D+=v.byteLength,N.push(v),Q.accessorIndexMap.set(k,$.accessors.length),$.accessors.push(I)}let P=m0.concat(N),C={buffer:j,byteOffset:M,byteLength:P.byteLength};if(R)C.target=R;return $.bufferViews.push(C),{buffers:N,byteLength:D}}function q(w,j,M){let R=w[0].getCount(),N=0;for(let I of w){let A=Q.createAccessorDef(I);A.bufferView=$.bufferViews.length,A.byteOffset=N;let v=I.getElementSize(),x=I.getComponentSize();N+=m0.padNumber(v*x),Q.accessorIndexMap.set(I,$.accessors.length),$.accessors.push(A)}let D=R*N,P=new ArrayBuffer(D),C=new DataView(P);for(let I=0;I<R;I++){let A=0;for(let v of w){let x=v.getElementSize(),d=v.getComponentSize(),h=v.getComponentType(),u=v.getArray();for(let $0=0;$0<x;$0++){let U0=I*N+A+$0*d,B0=u[I*x+$0];switch(h){case R0.ComponentType.FLOAT:C.setFloat32(U0,B0,!0);break;case R0.ComponentType.BYTE:C.setInt8(U0,B0);break;case R0.ComponentType.SHORT:C.setInt16(U0,B0,!0);break;case R0.ComponentType.UNSIGNED_BYTE:C.setUint8(U0,B0);break;case R0.ComponentType.UNSIGNED_SHORT:C.setUint16(U0,B0,!0);break;case R0.ComponentType.UNSIGNED_INT:C.setUint32(U0,B0,!0);break;default:throw new Error("Unexpected component type: "+h)}}A+=m0.padNumber(x*d)}}let k={buffer:j,byteOffset:M,byteLength:D,byteStride:N,target:zJ.BufferViewTarget.ARRAY_BUFFER};return $.bufferViews.push(k),{byteLength:D,buffers:[new Uint8Array(P)]}}function V(w,j,M){let R=[],N=0,D=new Map,P=-1/0,C=!1;for(let h of w){let u=Q.createAccessorDef(h);$.accessors.push(u),Q.accessorIndexMap.set(h,$.accessors.length-1);let $0=[],U0=[],B0=[],f0=new Array(h.getElementSize()).fill(0);for(let j1=0,B9=h.getCount();j1<B9;j1++){if(h.getElement(j1,B0),A0.eq(B0,f0,0))continue;P=Math.max(j1,P),$0.push(j1);for(let l8=0;l8<B0.length;l8++)U0.push(B0[l8])}let B1=$0.length,L8={accessorDef:u,count:B1};if(D.set(h,L8),B1===0)continue;if(B1>h.getCount()/2)C=!0;let B8=HJ[h.getComponentType()];L8.indices=$0,L8.values=new B8(U0)}if(!Number.isFinite(P))return{buffers:R,byteLength:N};if(C)K.warn("Some sparse accessors have >50% non-zero elements, which may increase file size.");let k=P<255?Uint8Array:P<65535?Uint16Array:Uint32Array,I=P<255?SK1:P<65535?vK1:IK1,A={buffer:j,byteOffset:M+N,byteLength:0};for(let h of w){let u=D.get(h);if(u.count===0)continue;u.indicesByteOffset=A.byteLength;let $0=m0.pad(m0.toView(new k(u.indices)));R.push($0),N+=$0.byteLength,A.byteLength+=$0.byteLength}$.bufferViews.push(A);let v=$.bufferViews.length-1,x={buffer:j,byteOffset:M+N,byteLength:0};for(let h of w){let u=D.get(h);if(u.count===0)continue;u.valuesByteOffset=x.byteLength;let $0=m0.pad(m0.toView(u.values));R.push($0),N+=$0.byteLength,x.byteLength+=$0.byteLength}$.bufferViews.push(x);let d=$.bufferViews.length-1;for(let h of w){let u=D.get(h);if(u.count===0)continue;u.accessorDef.sparse={count:u.count,indices:{bufferView:v,byteOffset:u.indicesByteOffset,componentType:I},values:{bufferView:d,byteOffset:u.valuesByteOffset}}}return{buffers:R,byteLength:N}}if($.accessors=[],$.bufferViews=[],$.samplers=[],$.textures=[],$.images=Y.listTextures().map((w,j)=>{let M=Q.createPropertyDef(w);if(w.getMimeType())M.mimeType=w.getMimeType();let R=w.getImage();if(R)Q.createImageData(M,R,w);return Q.imageIndexMap.set(w,j),M}),z.filter((w)=>w.prewriteTypes.includes(c.ACCESSOR)).forEach((w)=>w.prewrite(Q,c.ACCESSOR)),Y.listAccessors().forEach((w)=>{let{accessorUsageGroupedByParent:j,accessorParents:M}=Q;if(Q.accessorIndexMap.has(w))return;let R=Q.getAccessorUsage(w);if(Q.addAccessorToUsageGroup(w,R),j.has(R)){let N=X.listParents(w).find((D)=>D.propertyType!==c.ROOT);M.set(w,N)}}),z.filter((w)=>w.prewriteTypes.includes(c.BUFFER)).forEach((w)=>w.prewrite(Q,c.BUFFER)),(Y.listAccessors().length>0||Q.otherBufferViews.size>0||Y.listTextures().length>0&&Z.format===H7.GLB)&&Y.listBuffers().length===0)throw new Error("Buffer required for Document resources, but none was found.");if($.buffers=[],Y.listBuffers().forEach((w,j)=>{let M=Q.createPropertyDef(w),R=Q.accessorUsageGroupedByParent,N=w.listParents().filter((x)=>x instanceof R0),D=new Set(N.map((x)=>Q.accessorParents.get(x))),P=new Map(Array.from(D).map((x,d)=>[x,d])),C={};for(let x of N){var k;if(Q.accessorIndexMap.has(x))continue;let d=Q.getAccessorUsage(x),h=d;if(R.has(d)){let u=Q.accessorParents.get(x);h+=`:${P.get(u)}`}C[k=h]||(C[k]={usage:d,accessors:[]}),C[h].accessors.push(x)}let I=[],A=$.buffers.length,v=0;for(let{usage:x,accessors:d}of Object.values(C))if(x===jV.ARRAY_BUFFER&&Z.vertexLayout===RV.INTERLEAVED){let h=q(d,A,v);v+=h.byteLength;for(let u of h.buffers)I.push(u)}else if(x===jV.ARRAY_BUFFER)for(let h of d){let u=q([h],A,v);v+=u.byteLength;for(let $0 of u.buffers)I.push($0)}else if(x===jV.SPARSE){let h=V(d,A,v);v+=h.byteLength;for(let u of h.buffers)I.push(u)}else if(x===jV.ELEMENT_ARRAY_BUFFER){let h=zJ.BufferViewTarget.ELEMENT_ARRAY_BUFFER,u=H(d,A,v,h);v+=u.byteLength;for(let $0 of u.buffers)I.push($0)}else{let h=H(d,A,v);v+=h.byteLength;for(let u of h.buffers)I.push(u)}if(Q.imageBufferViews.length&&j===0){for(let x=0;x<Q.imageBufferViews.length;x++)if($.bufferViews[$.images[x].bufferView].byteOffset=v,v+=Q.imageBufferViews[x].byteLength,I.push(Q.imageBufferViews[x]),v%8){let d=8-v%8;v+=d,I.push(new Uint8Array(d))}}if(Q.otherBufferViews.has(w))for(let x of Q.otherBufferViews.get(w))$.bufferViews.push({buffer:A,byteOffset:v,byteLength:x.byteLength}),Q.otherBufferViewsIndexMap.set(x,$.bufferViews.length-1),v+=x.byteLength,I.push(x);if(v){let x;if(Z.format===H7.GLB)x=MV;else x=Q.bufferURIGenerator.createURI(w,"bin"),M.uri=x;M.byteLength=v,Q.assignResourceURI(x,m0.concat(I),!0)}$.buffers.push(M),Q.bufferIndexMap.set(w,j)}),Y.listAccessors().find((w)=>!w.getBuffer()))K.warn("Skipped writing one or more Accessors: no Buffer assigned.");z.filter((w)=>w.prewriteTypes.includes(c.MATERIAL)).forEach((w)=>w.prewrite(Q,c.MATERIAL)),$.materials=Y.listMaterials().map((w,j)=>{let M=Q.createPropertyDef(w);if(w.getAlphaMode()!==z4.AlphaMode.OPAQUE)M.alphaMode=w.getAlphaMode();if(w.getAlphaMode()===z4.AlphaMode.MASK)M.alphaCutoff=w.getAlphaCutoff();if(w.getDoubleSided())M.doubleSided=!0;if(M.pbrMetallicRoughness={},!A0.eq(w.getBaseColorFactor(),[1,1,1,1]))M.pbrMetallicRoughness.baseColorFactor=w.getBaseColorFactor();if(!A0.eq(w.getEmissiveFactor(),[0,0,0]))M.emissiveFactor=w.getEmissiveFactor();if(w.getRoughnessFactor()!==1)M.pbrMetallicRoughness.roughnessFactor=w.getRoughnessFactor();if(w.getMetallicFactor()!==1)M.pbrMetallicRoughness.metallicFactor=w.getMetallicFactor();if(w.getBaseColorTexture()){let R=w.getBaseColorTexture(),N=w.getBaseColorTextureInfo();M.pbrMetallicRoughness.baseColorTexture=Q.createTextureInfoDef(R,N)}if(w.getEmissiveTexture()){let R=w.getEmissiveTexture(),N=w.getEmissiveTextureInfo();M.emissiveTexture=Q.createTextureInfoDef(R,N)}if(w.getNormalTexture()){let R=w.getNormalTexture(),N=w.getNormalTextureInfo(),D=Q.createTextureInfoDef(R,N);if(w.getNormalScale()!==1)D.scale=w.getNormalScale();M.normalTexture=D}if(w.getOcclusionTexture()){let R=w.getOcclusionTexture(),N=w.getOcclusionTextureInfo(),D=Q.createTextureInfoDef(R,N);if(w.getOcclusionStrength()!==1)D.strength=w.getOcclusionStrength();M.occlusionTexture=D}if(w.getMetallicRoughnessTexture()){let R=w.getMetallicRoughnessTexture(),N=w.getMetallicRoughnessTextureInfo();M.pbrMetallicRoughness.metallicRoughnessTexture=Q.createTextureInfoDef(R,N)}return Q.materialIndexMap.set(w,j),M}),z.filter((w)=>w.prewriteTypes.includes(c.MESH)).forEach((w)=>w.prewrite(Q,c.MESH)),$.meshes=Y.listMeshes().map((w,j)=>{let M=Q.createPropertyDef(w),R=null;if(M.primitives=w.listPrimitives().map((N)=>{let D={attributes:{}};D.mode=N.getMode();let P=N.getMaterial();if(P)D.material=Q.materialIndexMap.get(P);if(Object.keys(N.getExtras()).length)D.extras=N.getExtras();let C=N.getIndices();if(C)D.indices=Q.accessorIndexMap.get(C);for(let k of N.listSemantics())D.attributes[k]=Q.accessorIndexMap.get(N.getAttribute(k));for(let k of N.listTargets()){let I={};for(let A of k.listSemantics())I[A]=Q.accessorIndexMap.get(k.getAttribute(A));D.targets=D.targets||[],D.targets.push(I)}if(N.listTargets().length&&!R)R=N.listTargets().map((k)=>k.getName());return D}),w.getWeights().length)M.weights=w.getWeights();if(R)M.extras=M.extras||{},M.extras.targetNames=R;return Q.meshIndexMap.set(w,j),M}),$.cameras=Y.listCameras().map((w,j)=>{let M=Q.createPropertyDef(w);if(M.type=w.getType(),M.type===JX.Type.PERSPECTIVE){M.perspective={znear:w.getZNear(),zfar:w.getZFar(),yfov:w.getYFov()};let R=w.getAspectRatio();if(R!==null)M.perspective.aspectRatio=R}else M.orthographic={znear:w.getZNear(),zfar:w.getZFar(),xmag:w.getXMag(),ymag:w.getYMag()};return Q.cameraIndexMap.set(w,j),M}),$.nodes=Y.listNodes().map((w,j)=>{let M=Q.createPropertyDef(w);if(!A0.eq(w.getTranslation(),[0,0,0]))M.translation=w.getTranslation();if(!A0.eq(w.getRotation(),[0,0,0,1]))M.rotation=w.getRotation();if(!A0.eq(w.getScale(),[1,1,1]))M.scale=w.getScale();if(w.getWeights().length)M.weights=w.getWeights();return Q.nodeIndexMap.set(w,j),M}),$.skins=Y.listSkins().map((w,j)=>{let M=Q.createPropertyDef(w),R=w.getInverseBindMatrices();if(R)M.inverseBindMatrices=Q.accessorIndexMap.get(R);let N=w.getSkeleton();if(N)M.skeleton=Q.nodeIndexMap.get(N);return M.joints=w.listJoints().map((D)=>Q.nodeIndexMap.get(D)),Q.skinIndexMap.set(w,j),M}),Y.listNodes().forEach((w,j)=>{let M=$.nodes[j],R=w.getMesh();if(R)M.mesh=Q.meshIndexMap.get(R);let N=w.getCamera();if(N)M.camera=Q.cameraIndexMap.get(N);let D=w.getSkin();if(D)M.skin=Q.skinIndexMap.get(D);if(w.listChildren().length>0)M.children=w.listChildren().map((P)=>Q.nodeIndexMap.get(P))}),$.animations=Y.listAnimations().map((w,j)=>{let M=Q.createPropertyDef(w),R=new Map;return M.samplers=w.listSamplers().map((N,D)=>{let P=Q.createPropertyDef(N);return P.input=Q.accessorIndexMap.get(N.getInput()),P.output=Q.accessorIndexMap.get(N.getOutput()),P.interpolation=N.getInterpolation(),R.set(N,D),P}),M.channels=w.listChannels().map((N)=>{let D=Q.createPropertyDef(N);return D.sampler=R.get(N.getSampler()),D.target={node:Q.nodeIndexMap.get(N.getTargetNode()),path:N.getTargetPath()},D}),Q.animationIndexMap.set(w,j),M}),$.scenes=Y.listScenes().map((w,j)=>{let M=Q.createPropertyDef(w);return M.nodes=w.listChildren().map((R)=>Q.nodeIndexMap.get(R)),Q.sceneIndexMap.set(w,j),M});let L=Y.getDefaultScene();if(L)$.scene=Y.listScenes().indexOf(L);return $.extensionsUsed=z.map((w)=>w.extensionName),$.extensionsRequired=F.map((w)=>w.extensionName),z.forEach((w)=>w.write(Q)),xK1($),W}}function xK1(J){let Z=[];for(let X in J){let Y=J[X];if(Array.isArray(Y)&&Y.length===0)Z.push(X);else if(Y===null||Y==="")Z.push(X);else if(Y&&typeof Y==="object"&&Object.keys(Y).length===0)Z.push(X)}for(let X of Z)delete J[X]}var DV;(function(J){J[J.JSON=1313821514]="JSON",J[J.BIN=5130562]="BIN"})(DV||(DV={}));class Yd{constructor(){this._logger=n6.DEFAULT_INSTANCE,this._extensions=new Set,this._dependencies={},this._vertexLayout=RV.INTERLEAVED,this.lastReadBytes=0,this.lastWriteBytes=0}setLogger(J){return this._logger=J,this}registerExtensions(J){for(let Z of J)this._extensions.add(Z),Z.register();return this}registerDependencies(J){return Object.assign(this._dependencies,J),this}setVertexLayout(J){return this._vertexLayout=J,this}async read(J){return await this.readJSON(await this.readAsJSON(J))}async readAsJSON(J){let Z=await this.readURI(J,"view");this.lastReadBytes=Z.byteLength;let X=im(Z)?this._binaryToJSON(Z):{json:JSON.parse(m0.decodeText(Z)),resources:{}};return await this._readResourcesExternal(X,this.dirname(J)),this._readResourcesInternal(X),X}async readJSON(J){return J=this._copyJSON(J),this._readResourcesInternal(J),Zd.read(J,{extensions:Array.from(this._extensions),dependencies:this._dependencies,logger:this._logger})}async binaryToJSON(J){let Z=this._binaryToJSON(m0.assertView(J));this._readResourcesInternal(Z);let X=Z.json;if(X.buffers&&X.buffers.some((Y)=>AK1(Z,Y)))throw new Error("Cannot resolve external buffers with binaryToJSON().");else if(X.images&&X.images.some((Y)=>hK1(Z,Y)))throw new Error("Cannot resolve external images with binaryToJSON().");return Z}async readBinary(J){return this.readJSON(await this.binaryToJSON(m0.assertView(J)))}async writeJSON(J,Z={}){if(Z.format===H7.GLB&&J.getRoot().listBuffers().length>1)throw new Error("GLB must have 0\u20131 buffers.");return Xd.write(J,{format:Z.format||H7.GLTF,basename:Z.basename||"",logger:this._logger,vertexLayout:this._vertexLayout,dependencies:j6({},this._dependencies),extensions:Array.from(this._extensions)})}async writeBinary(J){let{json:Z,resources:X}=await this.writeJSON(J,{format:H7.GLB}),Y=new Uint32Array([1179937895,2,12]),$=JSON.stringify(Z),W=m0.pad(m0.encodeText($),32),Q=m0.toView(new Uint32Array([W.byteLength,1313821514])),K=m0.concat([Q,W]);Y[Y.length-1]+=K.byteLength;let G=Object.values(X)[0];if(!G||!G.byteLength)return m0.concat([m0.toView(Y),K]);let z=m0.pad(G,0),F=m0.toView(new Uint32Array([z.byteLength,5130562])),H=m0.concat([F,z]);return Y[Y.length-1]+=H.byteLength,m0.concat([m0.toView(Y),K,H])}async _readResourcesExternal(J,Z){var X=this;let Y=J.json.images||[],$=J.json.buffers||[],W=[...Y,...$].map(async function(Q){let K=Q.uri;if(!K||K.match(/data:/))return Promise.resolve();J.resources[K]=await X.readURI(X.resolve(Z,K),"view"),X.lastReadBytes+=J.resources[K].byteLength});await Promise.all(W)}_readResourcesInternal(J){function Z($){if(!$.uri)return;if($.uri in J.resources){m0.assertView(J.resources[$.uri]);return}if($.uri.match(/data:/)){let W=`__${tm()}.${V7.extension($.uri)}`;J.resources[W]=m0.createBufferFromDataURI($.uri),$.uri=W}}(J.json.images||[]).forEach(($)=>{if($.bufferView===void 0&&$.uri===void 0)throw new Error("Missing resource URI or buffer view.");Z($)}),(J.json.buffers||[]).forEach(Z)}_copyJSON(J){let{images:Z,buffers:X}=J.json;if(J={json:j6({},J.json),resources:j6({},J.resources)},Z)J.json.images=Z.map((Y)=>j6({},Y));if(X)J.json.buffers=X.map((Y)=>j6({},Y));return J}_binaryToJSON(J){if(!im(J))throw new Error("Invalid glTF 2.0 binary.");let Z=new Uint32Array(J.buffer,J.byteOffset+12,2);if(Z[1]!==DV.JSON)throw new Error("Missing required GLB JSON chunk.");let X=20,Y=Z[0],$=m0.decodeText(m0.toView(J,X,Y)),W=JSON.parse($),Q=X+Y;if(J.byteLength<=Q)return{json:W,resources:{}};let K=new Uint32Array(J.buffer,J.byteOffset+Q,2);if(K[1]!==DV.BIN)return{json:W,resources:{}};let G=K[0],z=m0.toView(J,Q+8,G);return{json:W,resources:{[MV]:z}}}}function AK1(J,Z){return Z.uri!==void 0&&!(Z.uri in J.resources)}function hK1(J,Z){return Z.uri!==void 0&&!(Z.uri in J.resources)&&Z.bufferView===void 0}function im(J){if(J.byteLength<3*Uint32Array.BYTES_PER_ELEMENT)return!1;let Z=new Uint32Array(J.buffer,J.byteOffset,3);return Z[0]===1179937895&&Z[1]===2}class vR extends Yd{constructor(J=null,Z=h5.DEFAULT_INIT){super();this._fetch=void 0,this._fetchConfig=void 0,this._init=void 0,this._fetchEnabled=!1,this._fetch=J,this._fetchConfig=Z,this._init=this.init()}async init(){if(this._init)return this._init;return Promise.all([import("fs"),import("path")]).then(([J,Z])=>{this._fs=J.promises,this._path=Z})}setAllowNetwork(J){if(J&&!this._fetch)throw new Error("NodeIO requires a Fetch API implementation for HTTP requests.");return this._fetchEnabled=J,this}async readURI(J,Z){if(await this.init(),h5.isAbsoluteURL(J)){if(!this._fetchEnabled||!this._fetch)throw new Error("Network request blocked. Allow HTTP requests explicitly, if needed.");let X=await this._fetch(J,this._fetchConfig);switch(Z){case"view":return new Uint8Array(await X.arrayBuffer());case"text":return X.text()}}else switch(Z){case"view":return this._fs.readFile(J);case"text":return this._fs.readFile(J,"utf8")}}resolve(J,Z){if(h5.isAbsoluteURL(J)||h5.isAbsoluteURL(Z))return h5.resolve(J,Z);return this._path.resolve(J,decodeURIComponent(Z))}dirname(J){if(h5.isAbsoluteURL(J))return h5.dirname(J);return this._path.dirname(J)}async write(J,Z){await this.init(),await(!!J.match(/\.glb$/)?this._writeGLB(J,Z):this._writeGLTF(J,Z))}async _writeGLTF(J,Z){var X=this;this.lastWriteBytes=0;let{json:Y,resources:$}=await this.writeJSON(Z,{format:H7.GLTF,basename:V7.basename(J)}),{_fs:W,_path:Q}=this,K=Q.dirname(J),G=JSON.stringify(Y,null,2);await W.writeFile(J,G),this.lastWriteBytes+=G.length;for(let z of yK1(Object.keys($),10))await Promise.all(z.map(async function(F){if(h5.isAbsoluteURL(F)){if(h5.extension(F)==="bin")throw new Error(`Cannot write buffer to path "${F}".`);return}let H=Q.join(K,decodeURIComponent(F));await W.mkdir(Q.dirname(H),{recursive:!0}),await W.writeFile(H,$[F]),X.lastWriteBytes+=$[F].byteLength}))}async _writeGLB(J,Z){let X=await this.writeBinary(Z);await this._fs.writeFile(J,X),this.lastWriteBytes=X.byteLength}}function yK1(J,Z){let X=[];for(let Y=0,$=J.length;Y<$;Y+=Z){let W=[];for(let Q=0;Q<Z&&Y+Q<$;Q++)W.push(J[Y+Q]);X.push(W)}return X}var ec=i(SR(),1),Jl=i(yc(),1),kH1=i(tc(),1);async function EH1(J,Z){if(!(J instanceof Uint8Array))throw new Error("[ndarray-pixels] Input must be Uint8Array or Buffer.");let{data:X,info:Y}=await Jl.default(J).ensureAlpha().raw().toBuffer({resolveWithObject:!0});return ec.default(new Uint8Array(X),[Y.width,Y.height,4],[4,4*Y.width|0,1],0)}async function Zl(J,Z){return EH1(J)}var IH1="v4.1.3",zN="@glb.bin",l;(function(J){J.ACCESSOR="Accessor",J.ANIMATION="Animation",J.ANIMATION_CHANNEL="AnimationChannel",J.ANIMATION_SAMPLER="AnimationSampler",J.BUFFER="Buffer",J.CAMERA="Camera",J.MATERIAL="Material",J.MESH="Mesh",J.PRIMITIVE="Primitive",J.PRIMITIVE_TARGET="PrimitiveTarget",J.NODE="Node",J.ROOT="Root",J.SCENE="Scene",J.SKIN="Skin",J.TEXTURE="Texture",J.TEXTURE_INFO="TextureInfo"})(l||(l={}));var Xl;(function(J){J.INTERLEAVED="interleaved",J.SEPARATE="separate"})(Xl||(Xl={}));var j5;(function(J){J.ARRAY_BUFFER="ARRAY_BUFFER",J.ELEMENT_ARRAY_BUFFER="ELEMENT_ARRAY_BUFFER",J.INVERSE_BIND_MATRICES="INVERSE_BIND_MATRICES",J.OTHER="OTHER",J.SPARSE="SPARSE"})(j5||(j5={}));var O5;(function(J){J[J.R=4096]="R",J[J.G=256]="G",J[J.B=16]="B",J[J.A=1]="A"})(O5||(O5={}));var YN;(function(J){J.GLTF="GLTF",J.GLB="GLB"})(YN||(YN={}));var $N=typeof Float32Array!=="undefined"?Float32Array:Array;if(!Math.hypot)Math.hypot=function(){var J=0,Z=arguments.length;while(Z--)J+=arguments[Z]*arguments[Z];return Math.sqrt(J)};function vH1(){var J=new $N(3);if($N!=Float32Array)J[0]=0,J[1]=0,J[2]=0;return J}function XN(J){var Z=J[0],X=J[1],Y=J[2];return Math.hypot(Z,X,Y)}function SH1(J,Z,X){var Y=Z[0],$=Z[1],W=Z[2],Q=X[3]*Y+X[7]*$+X[11]*W+X[15];return Q=Q||1,J[0]=(X[0]*Y+X[4]*$+X[8]*W+X[12])/Q,J[1]=(X[1]*Y+X[5]*$+X[9]*W+X[13])/Q,J[2]=(X[2]*Y+X[6]*$+X[10]*W+X[14])/Q,J}(function(){var J=vH1();return function(Z,X,Y,$,W,Q){var K,G;if(!X)X=3;if(!Y)Y=0;if($)G=Math.min($*X+Y,Z.length);else G=Z.length;for(K=Y;K<G;K+=X)J[0]=Z[K],J[1]=Z[K+1],J[2]=Z[K+2],W(J,J,Q),Z[K]=J[0],Z[K+1]=J[1],Z[K+2]=J[2];return Z}})();function Ql(J){let Z=Kl(),X=J.propertyType===l.NODE?[J]:J.listChildren();for(let Y of X)Y.traverse(($)=>{let W=$.getMesh();if(!W)return;let Q=_H1(W,$.getWorldMatrix());if(Q.min.every(isFinite)&&Q.max.every(isFinite))WN(Q.min,Z),WN(Q.max,Z)});return Z}function _H1(J,Z){let X=Kl();for(let Y of J.listPrimitives()){let $=Y.getAttribute("POSITION"),W=Y.getIndices();if(!$)continue;let Q=[0,0,0],K=[0,0,0];for(let G=0,z=W?W.getCount():$.getCount();G<z;G++){let F=W?W.getScalar(G):G;Q=$.getElement(F,Q),K=SH1(K,Q,Z),WN(K,X)}}return X}function WN(J,Z){for(let X=0;X<3;X++)Z.min[X]=Math.min(J[X],Z.min[X]),Z.max[X]=Math.max(J[X],Z.max[X])}function Kl(){return{min:[1/0,1/0,1/0],max:[-1/0,-1/0,-1/0]}}class Y6{static createBufferFromDataURI(J){if(typeof Buffer==="undefined"){let Z=atob(J.split(",")[1]),X=new Uint8Array(Z.length);for(let Y=0;Y<Z.length;Y++)X[Y]=Z.charCodeAt(Y);return X}else{let Z=J.split(",")[1],X=J.indexOf("base64")>=0;return Buffer.from(Z,X?"base64":"utf8")}}static encodeText(J){return new TextEncoder().encode(J)}static decodeText(J){return new TextDecoder().decode(J)}static concat(J){let Z=0;for(let $ of J)Z+=$.byteLength;let X=new Uint8Array(Z),Y=0;for(let $ of J)X.set($,Y),Y+=$.byteLength;return X}static pad(J,Z=0){let X=this.padNumber(J.byteLength);if(X===J.byteLength)return J;let Y=new Uint8Array(X);if(Y.set(J),Z!==0)for(let $=J.byteLength;$<X;$++)Y[$]=Z;return Y}static padNumber(J){return Math.ceil(J/4)*4}static equals(J,Z){if(J===Z)return!0;if(J.byteLength!==Z.byteLength)return!1;let X=J.byteLength;while(X--)if(J[X]!==Z[X])return!1;return!0}static toView(J,Z=0,X=1/0){return new Uint8Array(J.buffer,J.byteOffset+Z,Math.min(J.byteLength,X))}static assertView(J){if(J&&!ArrayBuffer.isView(J))throw new Error(`Method requires Uint8Array parameter; received "${typeof J}".`);return J}}class Gl{match(J){return J.length>=3&&J[0]===255&&J[1]===216&&J[2]===255}getSize(J){let Z=new DataView(J.buffer,J.byteOffset+4),X,Y;while(Z.byteLength){if(X=Z.getUint16(0,!1),xH1(Z,X),Y=Z.getUint8(X+1),Y===192||Y===193||Y===194)return[Z.getUint16(X+7,!1),Z.getUint16(X+5,!1)];Z=new DataView(J.buffer,Z.byteOffset+X+2)}throw new TypeError("Invalid JPG, no size found")}getChannels(J){return 3}}class XU{match(J){return J.length>=8&&J[0]===137&&J[1]===80&&J[2]===78&&J[3]===71&&J[4]===13&&J[5]===10&&J[6]===26&&J[7]===10}getSize(J){let Z=new DataView(J.buffer,J.byteOffset);if(Y6.decodeText(J.slice(12,16))===XU.PNG_FRIED_CHUNK_NAME)return[Z.getUint32(32,!1),Z.getUint32(36,!1)];return[Z.getUint32(16,!1),Z.getUint32(20,!1)]}getChannels(J){return 4}}XU.PNG_FRIED_CHUNK_NAME="CgBI";class I9{static registerFormat(J,Z){this.impls[J]=Z}static getMimeType(J){for(let Z in this.impls)if(this.impls[Z].match(J))return Z;return null}static getSize(J,Z){if(!this.impls[Z])return null;return this.impls[Z].getSize(J)}static getChannels(J,Z){if(!this.impls[Z])return null;return this.impls[Z].getChannels(J)}static getVRAMByteLength(J,Z){if(!this.impls[Z])return null;if(this.impls[Z].getVRAMByteLength)return this.impls[Z].getVRAMByteLength(J);let X=0,Y=4,$=this.getSize(J,Z);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(J){if(J==="image/jpeg")return"jpg";return J.split("/").pop()}static extensionToMimeType(J){if(J==="jpg")return"image/jpeg";if(!J)return"";return`image/${J}`}}I9.impls={"image/jpeg":new Gl,"image/png":new XU};function xH1(J,Z){if(Z>J.byteLength)throw new TypeError("Corrupt JPG, exceeded buffer limits");if(J.getUint8(Z)!==255)throw new TypeError("Invalid JPG, marker table corrupted");return J}class GG{static basename(J){let Z=J.split(/[\\/]/).pop();return Z.substring(0,Z.lastIndexOf("."))}static extension(J){if(J.startsWith("data:image/")){let Z=J.match(/data:(image\/\w+)/)[1];return I9.mimeTypeToExtension(Z)}else if(J.startsWith("data:model/gltf+json"))return"gltf";else if(J.startsWith("data:model/gltf-binary"))return"glb";else if(J.startsWith("data:application/"))return"bin";return J.split(/[\\/]/).pop().split(/[.]/).pop()}}function Yl(J){return Object.prototype.toString.call(J)==="[object Object]"}function QX(J){if(Yl(J)===!1)return!1;let Z=J.constructor;if(Z===void 0)return!0;let X=Z.prototype;if(Yl(X)===!1)return!1;if(Object.prototype.hasOwnProperty.call(X,"isPrototypeOf")===!1)return!1;return!0}var QN,KN;(function(J){J[J.SILENT=4]="SILENT",J[J.ERROR=3]="ERROR",J[J.WARN=2]="WARN",J[J.INFO=1]="INFO",J[J.DEBUG=0]="DEBUG"})(KN||(KN={}));class w4{constructor(J){this.verbosity=void 0,this.verbosity=J}debug(J){if(this.verbosity<=w4.Verbosity.DEBUG)console.debug(J)}info(J){if(this.verbosity<=w4.Verbosity.INFO)console.info(J)}warn(J){if(this.verbosity<=w4.Verbosity.WARN)console.warn(J)}error(J){if(this.verbosity<=w4.Verbosity.ERROR)console.error(J)}}QN=w4;w4.Verbosity=KN;w4.DEFAULT_INSTANCE=new QN(QN.Verbosity.INFO);function AH1(J){var Z=J[0],X=J[1],Y=J[2],$=J[3],W=J[4],Q=J[5],K=J[6],G=J[7],z=J[8],F=J[9],H=J[10],q=J[11],V=J[12],U=J[13],L=J[14],w=J[15],j=Z*Q-X*W,M=Z*K-Y*W,R=Z*G-$*W,N=X*K-Y*Q,D=X*G-$*Q,P=Y*G-$*K,C=z*U-F*V,k=z*L-H*V,I=z*w-q*V,A=F*L-H*U,v=F*w-q*U,x=H*w-q*L;return j*x-M*v+R*A+N*I-D*k+P*C}function hH1(J,Z,X){var Y=Z[0],$=Z[1],W=Z[2],Q=Z[3],K=Z[4],G=Z[5],z=Z[6],F=Z[7],H=Z[8],q=Z[9],V=Z[10],U=Z[11],L=Z[12],w=Z[13],j=Z[14],M=Z[15],R=X[0],N=X[1],D=X[2],P=X[3];return J[0]=R*Y+N*K+D*H+P*L,J[1]=R*$+N*G+D*q+P*w,J[2]=R*W+N*z+D*V+P*j,J[3]=R*Q+N*F+D*U+P*M,R=X[4],N=X[5],D=X[6],P=X[7],J[4]=R*Y+N*K+D*H+P*L,J[5]=R*$+N*G+D*q+P*w,J[6]=R*W+N*z+D*V+P*j,J[7]=R*Q+N*F+D*U+P*M,R=X[8],N=X[9],D=X[10],P=X[11],J[8]=R*Y+N*K+D*H+P*L,J[9]=R*$+N*G+D*q+P*w,J[10]=R*W+N*z+D*V+P*j,J[11]=R*Q+N*F+D*U+P*M,R=X[12],N=X[13],D=X[14],P=X[15],J[12]=R*Y+N*K+D*H+P*L,J[13]=R*$+N*G+D*q+P*w,J[14]=R*W+N*z+D*V+P*j,J[15]=R*Q+N*F+D*U+P*M,J}function yH1(J,Z){var X=Z[0],Y=Z[1],$=Z[2],W=Z[4],Q=Z[5],K=Z[6],G=Z[8],z=Z[9],F=Z[10];return J[0]=Math.hypot(X,Y,$),J[1]=Math.hypot(W,Q,K),J[2]=Math.hypot(G,z,F),J}function fH1(J,Z){var X=new $N(3);yH1(X,Z);var Y=1/X[0],$=1/X[1],W=1/X[2],Q=Z[0]*Y,K=Z[1]*$,G=Z[2]*W,z=Z[4]*Y,F=Z[5]*$,H=Z[6]*W,q=Z[8]*Y,V=Z[9]*$,U=Z[10]*W,L=Q+F+U,w=0;if(L>0)w=Math.sqrt(L+1)*2,J[3]=0.25*w,J[0]=(H-V)/w,J[1]=(q-G)/w,J[2]=(K-z)/w;else if(Q>F&&Q>U)w=Math.sqrt(1+Q-F-U)*2,J[3]=(H-V)/w,J[0]=0.25*w,J[1]=(K+z)/w,J[2]=(q+G)/w;else if(F>U)w=Math.sqrt(1+F-Q-U)*2,J[3]=(q-G)/w,J[0]=(K+z)/w,J[1]=0.25*w,J[2]=(H+V)/w;else w=Math.sqrt(1+U-Q-F)*2,J[3]=(K-z)/w,J[0]=(q+G)/w,J[1]=(H+V)/w,J[2]=0.25*w;return J}class s1{static identity(J){return J}static eq(J,Z,X=0.00001){if(J.length!==Z.length)return!1;for(let Y=0;Y<J.length;Y++)if(Math.abs(J[Y]-Z[Y])>X)return!1;return!0}static clamp(J,Z,X){if(J<Z)return Z;if(J>X)return X;return J}static decodeNormalizedInt(J,Z){switch(Z){case 5126:return J;case 5123:return J/65535;case 5121:return J/255;case 5122:return Math.max(J/32767,-1);case 5120:return Math.max(J/127,-1);default:throw new Error("Invalid component type.")}}static encodeNormalizedInt(J,Z){switch(Z){case 5126:return J;case 5123:return Math.round(s1.clamp(J,0,1)*65535);case 5121:return Math.round(s1.clamp(J,0,1)*255);case 5122:return Math.round(s1.clamp(J,-1,1)*32767);case 5120:return Math.round(s1.clamp(J,-1,1)*127);default:throw new Error("Invalid component type.")}}static decompose(J,Z,X,Y){let $=XN([J[0],J[1],J[2]]),W=XN([J[4],J[5],J[6]]),Q=XN([J[8],J[9],J[10]]);if(AH1(J)<0)$=-$;Z[0]=J[12],Z[1]=J[13],Z[2]=J[14];let G=J.slice(),z=1/$,F=1/W,H=1/Q;G[0]*=z,G[1]*=z,G[2]*=z,G[4]*=F,G[5]*=F,G[6]*=F,G[8]*=H,G[9]*=H,G[10]*=H,fH1(X,G),Y[0]=$,Y[1]=W,Y[2]=Q}static compose(J,Z,X,Y){let $=Y,W=Z[0],Q=Z[1],K=Z[2],G=Z[3],z=W+W,F=Q+Q,H=K+K,q=W*z,V=W*F,U=W*H,L=Q*F,w=Q*H,j=K*H,M=G*z,R=G*F,N=G*H,D=X[0],P=X[1],C=X[2];return $[0]=(1-(L+j))*D,$[1]=(V+N)*D,$[2]=(U-R)*D,$[3]=0,$[4]=(V-N)*P,$[5]=(1-(q+j))*P,$[6]=(w+M)*P,$[7]=0,$[8]=(U+R)*C,$[9]=(w-M)*C,$[10]=(1-(q+L))*C,$[11]=0,$[12]=J[0],$[13]=J[1],$[14]=J[2],$[15]=1,$}}function bH1(J,Z){if(!!J!==!!Z)return!1;let X=J.getChild(),Y=Z.getChild();return X===Y||X.equals(Y)}function gH1(J,Z){if(!!J!==!!Z)return!1;let X=J.values(),Y=Z.values();if(X.length!==Y.length)return!1;for(let $=0;$<X.length;$++){let W=X[$],Q=Y[$];if(W.getChild()===Q.getChild())continue;if(!W.getChild().equals(Q.getChild()))return!1}return!0}function mH1(J,Z){if(!!J!==!!Z)return!1;let X=J.keys(),Y=Z.keys();if(X.length!==Y.length)return!1;for(let $ of X){let W=J.get($),Q=Z.get($);if(!!W!==!!Q)return!1;let K=W.getChild(),G=Q.getChild();if(K===G)continue;if(!K.equals(G))return!1}return!0}function zl(J,Z){if(J===Z)return!0;if(!!J!==!!Z||!J||!Z)return!1;if(J.length!==Z.length)return!1;for(let X=0;X<J.length;X++)if(J[X]!==Z[X])return!1;return!0}function Fl(J,Z){if(J===Z)return!0;if(!!J!==!!Z)return!1;if(!QX(J)||!QX(Z))return J===Z;let X=J,Y=Z,$=0,W=0,Q;for(Q in X)$++;for(Q in Y)W++;if($!==W)return!1;for(Q in X){let K=X[Q],G=Y[Q];if(eV(K)&&eV(G)){if(!zl(K,G))return!1}else if(QX(K)&&QX(G)){if(!Fl(K,G))return!1}else if(K!==G)return!1}return!0}function eV(J){return Array.isArray(J)||ArrayBuffer.isView(J)}var $l="https://null.example";class FN{static dirname(J){let Z=J.lastIndexOf("/");if(Z===-1)return"./";return J.substring(0,Z+1)}static basename(J){return GG.basename(new URL(J,$l).pathname)}static extension(J){return GG.extension(new URL(J,$l).pathname)}static resolve(J,Z){if(!this.isRelativePath(Z))return Z;let X=J.split("/"),Y=Z.split("/");X.pop();for(let $=0;$<Y.length;$++){if(Y[$]===".")continue;if(Y[$]==="..")X.pop();else X.push(Y[$])}return X.join("/")}static isAbsoluteURL(J){return this.PROTOCOL_REGEXP.test(J)}static isRelativePath(J){return!/^(?:[a-zA-Z]+:)?\//.test(J)}}FN.DEFAULT_INIT={};FN.PROTOCOL_REGEXP=/^[a-zA-Z]+:\/\//;var BJ=(J)=>J,dH1=new Set;class YU extends v${constructor(J,Z=""){super(J);this[C0].name=Z,this.init(),this.dispatchEvent({type:"create"})}getGraph(){return this.graph}getDefaults(){return Object.assign(super.getDefaults(),{name:"",extras:{}})}set(J,Z){if(Array.isArray(Z))Z=Z.slice();return super.set(J,Z)}getName(){return this.get("name")}setName(J){return this.set("name",J)}getExtras(){return this.get("extras")}setExtras(J){return this.set("extras",J)}clone(){return new this.constructor(this.graph).copy(this,BJ)}copy(J,Z=BJ){for(let X in this[C0]){let Y=this[C0][X];if(Y instanceof p6){if(!this[k9].has(X))Y.dispose()}else if(Y instanceof J6||Y instanceof w0)for(let $ of Y.values())$.dispose();else if(Y instanceof d1)for(let $ of Y.values())$.dispose()}for(let X in J[C0]){let Y=this[C0][X],$=J[C0][X];if($ instanceof p6)if(this[k9].has(X))Y.getChild().copy(Z($.getChild()),Z);else this.setRef(X,Z($.getChild()),$.getAttributes());else if($ instanceof w0||$ instanceof J6)for(let W of $.values())this.addRef(X,Z(W.getChild()),W.getAttributes());else if($ instanceof d1)for(let W of $.keys()){let Q=$.get(W);this.setRefMap(X,W,Z(Q.getChild()),Q.getAttributes())}else if(QX($))this[C0][X]=JSON.parse(JSON.stringify($));else if(Array.isArray($)||$ instanceof ArrayBuffer||ArrayBuffer.isView($))this[C0][X]=$.slice();else this[C0][X]=$}return this}equals(J,Z=dH1){if(this===J)return!0;if(this.propertyType!==J.propertyType)return!1;for(let X in this[C0]){if(Z.has(X))continue;let Y=this[C0][X],$=J[C0][X];if(Y instanceof p6||$ instanceof p6){if(!bH1(Y,$))return!1}else if(Y instanceof w0||$ instanceof w0||Y instanceof J6||$ instanceof J6){if(!gH1(Y,$))return!1}else if(Y instanceof d1||$ instanceof d1){if(!mH1(Y,$))return!1}else if(QX(Y)||QX($)){if(!Fl(Y,$))return!1}else if(eV(Y)||eV($)){if(!zl(Y,$))return!1}else if(Y!==$)return!1}return!0}detach(){return this.graph.disconnectParents(this,(J)=>J.propertyType!=="Root"),this}listParents(){return this.graph.listParents(this)}}class $6 extends YU{getDefaults(){return Object.assign(super.getDefaults(),{extensions:new d1})}getExtension(J){return this.getRefMap("extensions",J)}setExtension(J,Z){if(Z)Z._validateParent(this);return this.setRefMap("extensions",J,Z)}listExtensions(){return this.listRefMapValues("extensions")}}class q0 extends $6{init(){this.propertyType=l.ACCESSOR}getDefaults(){return Object.assign(super.getDefaults(),{array:null,type:q0.Type.SCALAR,componentType:q0.ComponentType.FLOAT,normalized:!1,sparse:!1,buffer:null})}static getElementSize(J){switch(J){case q0.Type.SCALAR:return 1;case q0.Type.VEC2:return 2;case q0.Type.VEC3:return 3;case q0.Type.VEC4:return 4;case q0.Type.MAT2:return 4;case q0.Type.MAT3:return 9;case q0.Type.MAT4:return 16;default:throw new Error("Unexpected type: "+J)}}static getComponentSize(J){switch(J){case q0.ComponentType.BYTE:return 1;case q0.ComponentType.UNSIGNED_BYTE:return 1;case q0.ComponentType.SHORT:return 2;case q0.ComponentType.UNSIGNED_SHORT:return 2;case q0.ComponentType.UNSIGNED_INT:return 4;case q0.ComponentType.FLOAT:return 4;default:throw new Error("Unexpected component type: "+J)}}getMinNormalized(J){let Z=this.getNormalized(),X=this.getElementSize(),Y=this.getComponentType();if(this.getMin(J),Z)for(let $=0;$<X;$++)J[$]=s1.decodeNormalizedInt(J[$],Y);return J}getMin(J){let Z=this.getArray(),X=this.getCount(),Y=this.getElementSize();for(let $=0;$<Y;$++)J[$]=1/0;for(let $=0;$<X*Y;$+=Y)for(let W=0;W<Y;W++){let Q=Z[$+W];if(Number.isFinite(Q))J[W]=Math.min(J[W],Q)}return J}getMaxNormalized(J){let Z=this.getNormalized(),X=this.getElementSize(),Y=this.getComponentType();if(this.getMax(J),Z)for(let $=0;$<X;$++)J[$]=s1.decodeNormalizedInt(J[$],Y);return J}getMax(J){let Z=this.get("array"),X=this.getCount(),Y=this.getElementSize();for(let $=0;$<Y;$++)J[$]=-1/0;for(let $=0;$<X*Y;$+=Y)for(let W=0;W<Y;W++){let Q=Z[$+W];if(Number.isFinite(Q))J[W]=Math.max(J[W],Q)}return J}getCount(){let J=this.get("array");return J?J.length/this.getElementSize():0}getType(){return this.get("type")}setType(J){return this.set("type",J)}getElementSize(){return q0.getElementSize(this.get("type"))}getComponentSize(){return this.get("array").BYTES_PER_ELEMENT}getComponentType(){return this.get("componentType")}getNormalized(){return this.get("normalized")}setNormalized(J){return this.set("normalized",J)}getScalar(J){let Z=this.getElementSize(),X=this.getComponentType(),Y=this.getArray();if(this.getNormalized())return s1.decodeNormalizedInt(Y[J*Z],X);return Y[J*Z]}setScalar(J,Z){let X=this.getElementSize(),Y=this.getComponentType(),$=this.getArray();if(this.getNormalized())$[J*X]=s1.encodeNormalizedInt(Z,Y);else $[J*X]=Z;return this}getElement(J,Z){let X=this.getNormalized(),Y=this.getElementSize(),$=this.getComponentType(),W=this.getArray();for(let Q=0;Q<Y;Q++)if(X)Z[Q]=s1.decodeNormalizedInt(W[J*Y+Q],$);else Z[Q]=W[J*Y+Q];return Z}setElement(J,Z){let X=this.getNormalized(),Y=this.getElementSize(),$=this.getComponentType(),W=this.getArray();for(let Q=0;Q<Y;Q++)if(X)W[J*Y+Q]=s1.encodeNormalizedInt(Z[Q],$);else W[J*Y+Q]=Z[Q];return this}getSparse(){return this.get("sparse")}setSparse(J){return this.set("sparse",J)}getBuffer(){return this.getRef("buffer")}setBuffer(J){return this.setRef("buffer",J)}getArray(){return this.get("array")}setArray(J){return this.set("componentType",J?uH1(J):q0.ComponentType.FLOAT),this.set("array",J),this}getByteLength(){let J=this.get("array");return J?J.byteLength:0}}q0.Type={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};q0.ComponentType={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,FLOAT:5126};function uH1(J){switch(J.constructor){case Float32Array:return q0.ComponentType.FLOAT;case Uint32Array:return q0.ComponentType.UNSIGNED_INT;case Uint16Array:return q0.ComponentType.UNSIGNED_SHORT;case Uint8Array:return q0.ComponentType.UNSIGNED_BYTE;case Int16Array:return q0.ComponentType.SHORT;case Int8Array:return q0.ComponentType.BYTE;default:throw new Error("Unknown accessor componentType.")}}class HN extends $6{init(){this.propertyType=l.ANIMATION}getDefaults(){return Object.assign(super.getDefaults(),{channels:new w0,samplers:new w0})}addChannel(J){return this.addRef("channels",J)}removeChannel(J){return this.removeRef("channels",J)}listChannels(){return this.listRefs("channels")}addSampler(J){return this.addRef("samplers",J)}removeSampler(J){return this.removeRef("samplers",J)}listSamplers(){return this.listRefs("samplers")}}class FG extends $6{init(){this.propertyType=l.ANIMATION_CHANNEL}getDefaults(){return Object.assign(super.getDefaults(),{targetPath:null,targetNode:null,sampler:null})}getTargetPath(){return this.get("targetPath")}setTargetPath(J){return this.set("targetPath",J)}getTargetNode(){return this.getRef("targetNode")}setTargetNode(J){return this.setRef("targetNode",J)}getSampler(){return this.getRef("sampler")}setSampler(J){return this.setRef("sampler",J)}}FG.TargetPath={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"};class c$ extends $6{init(){this.propertyType=l.ANIMATION_SAMPLER}getDefaultAttributes(){return Object.assign(super.getDefaults(),{interpolation:c$.Interpolation.LINEAR,input:null,output:null})}getInterpolation(){return this.get("interpolation")}setInterpolation(J){return this.set("interpolation",J)}getInput(){return this.getRef("input")}setInput(J){return this.setRef("input",J,{usage:j5.OTHER})}getOutput(){return this.getRef("output")}setOutput(J){return this.setRef("output",J,{usage:j5.OTHER})}}c$.Interpolation={LINEAR:"LINEAR",STEP:"STEP",CUBICSPLINE:"CUBICSPLINE"};class qN extends $6{init(){this.propertyType=l.BUFFER}getDefaults(){return Object.assign(super.getDefaults(),{uri:""})}getURI(){return this.get("uri")}setURI(J){return this.set("uri",J)}}class HG extends $6{init(){this.propertyType=l.CAMERA}getDefaults(){return Object.assign(super.getDefaults(),{type:HG.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(J){return this.set("type",J)}getZNear(){return this.get("znear")}setZNear(J){return this.set("znear",J)}getZFar(){return this.get("zfar")}setZFar(J){return this.set("zfar",J)}getAspectRatio(){return this.get("aspectRatio")}setAspectRatio(J){return this.set("aspectRatio",J)}getYFov(){return this.get("yfov")}setYFov(J){return this.set("yfov",J)}getXMag(){return this.get("xmag")}setXMag(J){return this.set("xmag",J)}getYMag(){return this.get("ymag")}setYMag(J){return this.set("ymag",J)}}HG.Type={PERSPECTIVE:"perspective",ORTHOGRAPHIC:"orthographic"};class y1 extends YU{_validateParent(J){if(!this.parentTypes.includes(J.propertyType))throw new Error(`Parent "${J.propertyType}" invalid for child "${this.propertyType}".`)}}y1.EXTENSION_NAME=void 0;class U1 extends $6{init(){this.propertyType=l.TEXTURE_INFO}getDefaults(){return Object.assign(super.getDefaults(),{texCoord:0,magFilter:null,minFilter:null,wrapS:U1.WrapMode.REPEAT,wrapT:U1.WrapMode.REPEAT})}getTexCoord(){return this.get("texCoord")}setTexCoord(J){return this.set("texCoord",J)}getMagFilter(){return this.get("magFilter")}setMagFilter(J){return this.set("magFilter",J)}getMinFilter(){return this.get("minFilter")}setMinFilter(J){return this.set("minFilter",J)}getWrapS(){return this.get("wrapS")}setWrapS(J){return this.set("wrapS",J)}getWrapT(){return this.get("wrapT")}setWrapT(J){return this.set("wrapT",J)}}U1.WrapMode={CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497};U1.MagFilter={NEAREST:9728,LINEAR:9729};U1.MinFilter={NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987};var{R:oV,G:rV,B:tV,A:cH1}=O5;class qG extends $6{init(){this.propertyType=l.MATERIAL}getDefaults(){return Object.assign(super.getDefaults(),{alphaMode:qG.AlphaMode.OPAQUE,alphaCutoff:0.5,doubleSided:!1,baseColorFactor:[1,1,1,1],baseColorTexture:null,baseColorTextureInfo:new U1(this.graph,"baseColorTextureInfo"),emissiveFactor:[0,0,0],emissiveTexture:null,emissiveTextureInfo:new U1(this.graph,"emissiveTextureInfo"),normalScale:1,normalTexture:null,normalTextureInfo:new U1(this.graph,"normalTextureInfo"),occlusionStrength:1,occlusionTexture:null,occlusionTextureInfo:new U1(this.graph,"occlusionTextureInfo"),roughnessFactor:1,metallicFactor:1,metallicRoughnessTexture:null,metallicRoughnessTextureInfo:new U1(this.graph,"metallicRoughnessTextureInfo")})}getDoubleSided(){return this.get("doubleSided")}setDoubleSided(J){return this.set("doubleSided",J)}getAlpha(){return this.get("baseColorFactor")[3]}setAlpha(J){let Z=this.get("baseColorFactor").slice();return Z[3]=J,this.set("baseColorFactor",Z)}getAlphaMode(){return this.get("alphaMode")}setAlphaMode(J){return this.set("alphaMode",J)}getAlphaCutoff(){return this.get("alphaCutoff")}setAlphaCutoff(J){return this.set("alphaCutoff",J)}getBaseColorFactor(){return this.get("baseColorFactor")}setBaseColorFactor(J){return this.set("baseColorFactor",J)}getBaseColorTexture(){return this.getRef("baseColorTexture")}getBaseColorTextureInfo(){return this.getRef("baseColorTexture")?this.getRef("baseColorTextureInfo"):null}setBaseColorTexture(J){return this.setRef("baseColorTexture",J,{channels:oV|rV|tV|cH1,isColor:!0})}getEmissiveFactor(){return this.get("emissiveFactor")}setEmissiveFactor(J){return this.set("emissiveFactor",J)}getEmissiveTexture(){return this.getRef("emissiveTexture")}getEmissiveTextureInfo(){return this.getRef("emissiveTexture")?this.getRef("emissiveTextureInfo"):null}setEmissiveTexture(J){return this.setRef("emissiveTexture",J,{channels:oV|rV|tV,isColor:!0})}getNormalScale(){return this.get("normalScale")}setNormalScale(J){return this.set("normalScale",J)}getNormalTexture(){return this.getRef("normalTexture")}getNormalTextureInfo(){return this.getRef("normalTexture")?this.getRef("normalTextureInfo"):null}setNormalTexture(J){return this.setRef("normalTexture",J,{channels:oV|rV|tV})}getOcclusionStrength(){return this.get("occlusionStrength")}setOcclusionStrength(J){return this.set("occlusionStrength",J)}getOcclusionTexture(){return this.getRef("occlusionTexture")}getOcclusionTextureInfo(){return this.getRef("occlusionTexture")?this.getRef("occlusionTextureInfo"):null}setOcclusionTexture(J){return this.setRef("occlusionTexture",J,{channels:oV})}getRoughnessFactor(){return this.get("roughnessFactor")}setRoughnessFactor(J){return this.set("roughnessFactor",J)}getMetallicFactor(){return this.get("metallicFactor")}setMetallicFactor(J){return this.set("metallicFactor",J)}getMetallicRoughnessTexture(){return this.getRef("metallicRoughnessTexture")}getMetallicRoughnessTextureInfo(){return this.getRef("metallicRoughnessTexture")?this.getRef("metallicRoughnessTextureInfo"):null}setMetallicRoughnessTexture(J){return this.setRef("metallicRoughnessTexture",J,{channels:rV|tV})}}qG.AlphaMode={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};class VN extends $6{init(){this.propertyType=l.MESH}getDefaults(){return Object.assign(super.getDefaults(),{weights:[],primitives:new w0})}addPrimitive(J){return this.addRef("primitives",J)}removePrimitive(J){return this.removeRef("primitives",J)}listPrimitives(){return this.listRefs("primitives")}getWeights(){return this.get("weights")}setWeights(J){return this.set("weights",J)}}class UN extends $6{init(){this.propertyType=l.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 w0})}copy(J,Z=BJ){if(Z===BJ)throw new Error("Node cannot be copied.");return super.copy(J,Z)}getTranslation(){return this.get("translation")}getRotation(){return this.get("rotation")}getScale(){return this.get("scale")}setTranslation(J){return this.set("translation",J)}setRotation(J){return this.set("rotation",J)}setScale(J){return this.set("scale",J)}getMatrix(){return s1.compose(this.get("translation"),this.get("rotation"),this.get("scale"),[])}setMatrix(J){let Z=this.get("translation").slice(),X=this.get("rotation").slice(),Y=this.get("scale").slice();return s1.decompose(J,Z,X,Y),this.set("translation",Z).set("rotation",X).set("scale",Y)}getWorldTranslation(){let J=[0,0,0];return s1.decompose(this.getWorldMatrix(),J,[0,0,0,1],[1,1,1]),J}getWorldRotation(){let J=[0,0,0,1];return s1.decompose(this.getWorldMatrix(),[0,0,0],J,[1,1,1]),J}getWorldScale(){let J=[1,1,1];return s1.decompose(this.getWorldMatrix(),[0,0,0],[0,0,0,1],J),J}getWorldMatrix(){let J=[];for(let Y=this;Y!=null;Y=Y.getParentNode())J.push(Y);let Z,X=J.pop().getMatrix();while(Z=J.pop())hH1(X,X,Z.getMatrix());return X}addChild(J){let Z=J.getParentNode();if(Z)Z.removeChild(J);for(let X of J.listParents())if(X.propertyType===l.SCENE)X.removeChild(J);return this.addRef("children",J)}removeChild(J){return this.removeRef("children",J)}listChildren(){return this.listRefs("children")}getParentNode(){for(let J of this.listParents())if(J.propertyType===l.NODE)return J;return null}getMesh(){return this.getRef("mesh")}setMesh(J){return this.setRef("mesh",J)}getCamera(){return this.getRef("camera")}setCamera(J){return this.setRef("camera",J)}getSkin(){return this.getRef("skin")}setSkin(J){return this.setRef("skin",J)}getWeights(){return this.get("weights")}setWeights(J){return this.set("weights",J)}traverse(J){J(this);for(let Z of this.listChildren())Z.traverse(J);return this}}class jJ extends $6{init(){this.propertyType=l.PRIMITIVE}getDefaults(){return Object.assign(super.getDefaults(),{mode:jJ.Mode.TRIANGLES,material:null,indices:null,attributes:new d1,targets:new w0})}getIndices(){return this.getRef("indices")}setIndices(J){return this.setRef("indices",J,{usage:j5.ELEMENT_ARRAY_BUFFER})}getAttribute(J){return this.getRefMap("attributes",J)}setAttribute(J,Z){return this.setRefMap("attributes",J,Z,{usage:j5.ARRAY_BUFFER})}listAttributes(){return this.listRefMapValues("attributes")}listSemantics(){return this.listRefMapKeys("attributes")}getMaterial(){return this.getRef("material")}setMaterial(J){return this.setRef("material",J)}getMode(){return this.get("mode")}setMode(J){return this.set("mode",J)}listTargets(){return this.listRefs("targets")}addTarget(J){return this.addRef("targets",J)}removeTarget(J){return this.removeRef("targets",J)}}jJ.Mode={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class Hl extends YU{init(){this.propertyType=l.PRIMITIVE_TARGET}getDefaults(){return Object.assign(super.getDefaults(),{attributes:new d1})}getAttribute(J){return this.getRefMap("attributes",J)}setAttribute(J,Z){return this.setRefMap("attributes",J,Z,{usage:j5.ARRAY_BUFFER})}listAttributes(){return this.listRefMapValues("attributes")}listSemantics(){return this.listRefMapKeys("attributes")}}function JU(){return JU=Object.assign?Object.assign.bind():function(J){for(var Z=1;Z<arguments.length;Z++){var X=arguments[Z];for(var Y in X)({}).hasOwnProperty.call(X,Y)&&(J[Y]=X[Y])}return J},JU.apply(null,arguments)}class wN extends $6{init(){this.propertyType=l.SCENE}getDefaults(){return Object.assign(super.getDefaults(),{children:new w0})}copy(J,Z=BJ){if(Z===BJ)throw new Error("Scene cannot be copied.");return super.copy(J,Z)}addChild(J){let Z=J.getParentNode();if(Z)Z.removeChild(J);return this.addRef("children",J)}removeChild(J){return this.removeRef("children",J)}listChildren(){return this.listRefs("children")}traverse(J){for(let Z of this.listChildren())Z.traverse(J);return this}}class LN extends $6{init(){this.propertyType=l.SKIN}getDefaults(){return Object.assign(super.getDefaults(),{skeleton:null,inverseBindMatrices:null,joints:new w0})}getSkeleton(){return this.getRef("skeleton")}setSkeleton(J){return this.setRef("skeleton",J)}getInverseBindMatrices(){return this.getRef("inverseBindMatrices")}setInverseBindMatrices(J){return this.setRef("inverseBindMatrices",J,{usage:j5.INVERSE_BIND_MATRICES})}addJoint(J){return this.addRef("joints",J)}removeJoint(J){return this.removeRef("joints",J)}listJoints(){return this.listRefs("joints")}}class BN extends $6{init(){this.propertyType=l.TEXTURE}getDefaults(){return Object.assign(super.getDefaults(),{image:null,mimeType:"",uri:""})}getMimeType(){return this.get("mimeType")||I9.extensionToMimeType(GG.extension(this.get("uri")))}setMimeType(J){return this.set("mimeType",J)}getURI(){return this.get("uri")}setURI(J){this.set("uri",J);let Z=I9.extensionToMimeType(GG.extension(J));if(Z)this.set("mimeType",Z);return this}getImage(){return this.get("image")}setImage(J){return this.set("image",Y6.assertView(J))}getSize(){let J=this.get("image");if(!J)return null;return I9.getSize(J,this.getMimeType())}}class $U extends $6{init(){this.propertyType=l.ROOT}getDefaults(){return Object.assign(super.getDefaults(),{asset:{generator:`glTF-Transform ${IH1}`,version:"2.0"},defaultScene:null,accessors:new w0,animations:new w0,buffers:new w0,cameras:new w0,materials:new w0,meshes:new w0,nodes:new w0,scenes:new w0,skins:new w0,textures:new w0})}constructor(J){super(J);this._extensions=new Set,J.addEventListener("node:create",(Z)=>{this._addChildOfRoot(Z.target)})}clone(){throw new Error("Root cannot be cloned.")}copy(J,Z=BJ){if(Z===BJ)throw new Error("Root cannot be copied.");this.set("asset",JU({},J.get("asset"))),this.setName(J.getName()),this.setExtras(JU({},J.getExtras())),this.setDefaultScene(J.getDefaultScene()?Z(J.getDefaultScene()):null);for(let X of J.listRefMapKeys("extensions")){let Y=J.getExtension(X);this.setExtension(X,Z(Y))}return this}_addChildOfRoot(J){if(J instanceof wN)this.addRef("scenes",J);else if(J instanceof UN)this.addRef("nodes",J);else if(J instanceof HG)this.addRef("cameras",J);else if(J instanceof LN)this.addRef("skins",J);else if(J instanceof VN)this.addRef("meshes",J);else if(J instanceof qG)this.addRef("materials",J);else if(J instanceof BN)this.addRef("textures",J);else if(J instanceof HN)this.addRef("animations",J);else if(J instanceof q0)this.addRef("accessors",J);else if(J instanceof qN)this.addRef("buffers",J);return this}getAsset(){return this.get("asset")}listExtensionsUsed(){return Array.from(this._extensions)}listExtensionsRequired(){return this.listExtensionsUsed().filter((J)=>J.isRequired())}_enableExtension(J){return this._extensions.add(J),this}_disableExtension(J){return this._extensions.delete(J),this}listScenes(){return this.listRefs("scenes")}setDefaultScene(J){return this.setRef("defaultScene",J)}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 ZU{static fromGraph(J){return ZU._GRAPH_DOCUMENTS.get(J)||null}constructor(){this._graph=new I$,this._root=new $U(this._graph),this._logger=w4.DEFAULT_INSTANCE,ZU._GRAPH_DOCUMENTS.set(this._graph,this)}getRoot(){return this._root}getGraph(){return this._graph}getLogger(){return this._logger}setLogger(J){return this._logger=J,this}clone(){throw new Error("Use 'cloneDocument(source)' from '@gltf-transform/functions'.")}merge(J){throw new Error("Use 'mergeDocuments(target, source)' from '@gltf-transform/functions'.")}async transform(...J){let Z=J.map((X)=>X.name);for(let X of J)await X(this,{stack:Z});return this}createExtension(J){let Z=J.EXTENSION_NAME;return this.getRoot().listExtensionsUsed().find((Y)=>Y.extensionName===Z)||new J(this)}createScene(J=""){return new wN(this._graph,J)}createNode(J=""){return new UN(this._graph,J)}createCamera(J=""){return new HG(this._graph,J)}createSkin(J=""){return new LN(this._graph,J)}createMesh(J=""){return new VN(this._graph,J)}createPrimitive(){return new jJ(this._graph)}createPrimitiveTarget(J=""){return new Hl(this._graph,J)}createMaterial(J=""){return new qG(this._graph,J)}createTexture(J=""){return new BN(this._graph,J)}createAnimation(J=""){return new HN(this._graph,J)}createAnimationChannel(J=""){return new FG(this._graph,J)}createAnimationSampler(J=""){return new c$(this._graph,J)}createAccessor(J="",Z=null){if(!Z)Z=this.getRoot().listBuffers()[0];return new q0(this._graph,J).setBuffer(Z)}createBuffer(J=""){return new qN(this._graph,J)}}ZU._GRAPH_DOCUMENTS=new WeakMap;class M1{constructor(J){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=J,J.getRoot()._enableExtension(this),this._listener=(X)=>{let Y=X,$=Y.target;if($ instanceof y1&&$.extensionName===this.extensionName){if(Y.type==="node:create")this._addExtensionProperty($);if(Y.type==="node:dispose")this._removeExtensionProperty($)}};let Z=J.getGraph();Z.addEventListener("node:create",this._listener),Z.addEventListener("node:dispose",this._listener)}dispose(){this.document.getRoot()._disableExtension(this);let J=this.document.getGraph();J.removeEventListener("node:create",this._listener),J.removeEventListener("node:dispose",this._listener);for(let Z of this.properties)Z.dispose()}static register(){}isRequired(){return this.required}setRequired(J){return this.required=J,this}listProperties(){return Array.from(this.properties)}_addExtensionProperty(J){return this.properties.add(J),this}_removeExtensionProperty(J){return this.properties.delete(J),this}install(J,Z){return this}preread(J,Z){return this}prewrite(J,Z){return this}}M1.EXTENSION_NAME=void 0;var gW6={logger:w4.DEFAULT_INSTANCE,extensions:[],dependencies:{}},mW6=new Set([l.BUFFER,l.TEXTURE,l.MATERIAL,l.MESH,l.PRIMITIVE,l.NODE,l.SCENE]);var zG;(function(J){J[J.ARRAY_BUFFER=34962]="ARRAY_BUFFER",J[J.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER"})(zG||(zG={}));class OJ{constructor(J,Z,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=J,this.jsonDoc=Z,this.options=X;let Y=J.getRoot(),$=Y.listBuffers().length,W=Y.listTextures().length;this.bufferURIGenerator=new GN($>1,()=>X.basename||"buffer"),this.imageURIGenerator=new GN(W>1,(Q)=>lH1(J,Q)||X.basename||"texture"),this.logger=J.getLogger()}createTextureInfoDef(J,Z){let X={magFilter:Z.getMagFilter()||void 0,minFilter:Z.getMinFilter()||void 0,wrapS:Z.getWrapS(),wrapT:Z.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(J),sampler:this.samplerDefIndexMap.get(Y)},W=JSON.stringify($);if(!this.textureDefIndexMap.has(W))this.textureDefIndexMap.set(W,this.jsonDoc.json.textures.length),this.jsonDoc.json.textures.push($);let Q={index:this.textureDefIndexMap.get(W)};if(Z.getTexCoord()!==0)Q.texCoord=Z.getTexCoord();if(Object.keys(Z.getExtras()).length>0)Q.extras=Z.getExtras();return this.textureInfoDefMap.set(Z,Q),Q}createPropertyDef(J){let Z={};if(J.getName())Z.name=J.getName();if(Object.keys(J.getExtras()).length>0)Z.extras=J.getExtras();return Z}createAccessorDef(J){let Z=this.createPropertyDef(J);if(Z.type=J.getType(),Z.componentType=J.getComponentType(),Z.count=J.getCount(),this._doc.getGraph().listParentEdges(J).some((Y)=>Y.getName()==="attributes"&&Y.getAttributes().key==="POSITION"||Y.getName()==="input"))Z.max=J.getMax([]).map(Math.fround),Z.min=J.getMin([]).map(Math.fround);if(J.getNormalized())Z.normalized=J.getNormalized();return Z}createImageData(J,Z,X){if(this.options.format===YN.GLB)this.imageBufferViews.push(Z),J.bufferView=this.jsonDoc.json.bufferViews.length,this.jsonDoc.json.bufferViews.push({buffer:0,byteOffset:-1,byteLength:Z.byteLength});else{let Y=I9.mimeTypeToExtension(X.getMimeType());J.uri=this.imageURIGenerator.createURI(X,Y),this.assignResourceURI(J.uri,Z,!1)}}assignResourceURI(J,Z,X){let Y=this.jsonDoc.resources;if(!(J in Y)){Y[J]=Z;return}if(Z===Y[J]){this.logger.warn(`Duplicate resource URI, "${J}".`);return}let $=`Resource URI "${J}" already assigned to different data.`;if(!X){this.logger.warn($);return}throw new Error($)}getAccessorUsage(J){let Z=this._accessorUsageMap.get(J);if(Z)return Z;if(J.getSparse())return j5.SPARSE;for(let X of this._doc.getGraph().listParentEdges(J)){let{usage:Y}=X.getAttributes();if(Y)return Y;if(X.getParent().propertyType!==l.ROOT)this.logger.warn(`Missing attribute ".usage" on edge, "${X.getName()}".`)}return j5.OTHER}addAccessorToUsageGroup(J,Z){let X=this._accessorUsageMap.get(J);if(X&&X!==Z)throw new Error(`Accessor with usage "${X}" cannot be reused as "${Z}".`);return this._accessorUsageMap.set(J,Z),this}}OJ.BufferViewTarget=zG;OJ.BufferViewUsage=j5;OJ.USAGE_TO_TARGET={[j5.ARRAY_BUFFER]:zG.ARRAY_BUFFER,[j5.ELEMENT_ARRAY_BUFFER]:zG.ELEMENT_ARRAY_BUFFER};class GN{constructor(J,Z){this.multiple=void 0,this.basename=void 0,this.counter={},this.multiple=J,this.basename=Z}createURI(J,Z){if(J.getURI())return J.getURI();else if(!this.multiple)return`${this.basename(J)}.${Z}`;else{let X=this.basename(J);return this.counter[X]=this.counter[X]||1,`${X}_${this.counter[X]++}.${Z}`}}}function lH1(J,Z){let X=J.getGraph().listParentEdges(Z).find((Y)=>Y.getParent()!==J.getRoot());return X?X.getName().replace(/texture$/i,""):""}var{UNSIGNED_INT:dW6,UNSIGNED_SHORT:uW6,UNSIGNED_BYTE:cW6}=q0.ComponentType,lW6=new Set([l.ACCESSOR,l.BUFFER,l.MATERIAL,l.MESH]);var Wl;(function(J){J[J.JSON=1313821514]="JSON",J[J.BIN=5130562]="BIN"})(Wl||(Wl={}));var Vl=163,Ul=166;function pH1(){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 l${constructor(J,Z,X,Y){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(J.buffer,J.byteOffset+Z,X),this._littleEndian=Y,this._offset=0}_nextUint8(){let J=this._dataView.getUint8(this._offset);return this._offset+=1,J}_nextUint16(){let J=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,J}_nextUint32(){let J=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,J}_nextUint64(){let J=this._dataView.getUint32(this._offset,this._littleEndian),Z=this._dataView.getUint32(this._offset+4,this._littleEndian),X=J+4294967296*Z;return this._offset+=8,X}_nextInt32(){let J=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,J}_nextUint8Array(J){let Z=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._offset,J);return this._offset+=J,Z}_skip(J){return this._offset+=J,this}_scan(J,Z=0){let X=this._offset,Y=0;while(this._dataView.getUint8(this._offset)!==Z&&Y<J)Y++,this._offset++;if(Y<J)this._offset++;return new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+X,Y)}}var nW6=new Uint8Array([0]),N6=[171,75,84,88,32,50,48,187,13,10,26,10];function ql(J){return new TextDecoder().decode(J)}function WU(J){let Z=new Uint8Array(J.buffer,J.byteOffset,N6.length);if(Z[0]!==N6[0]||Z[1]!==N6[1]||Z[2]!==N6[2]||Z[3]!==N6[3]||Z[4]!==N6[4]||Z[5]!==N6[5]||Z[6]!==N6[6]||Z[7]!==N6[7]||Z[8]!==N6[8]||Z[9]!==N6[9]||Z[10]!==N6[10]||Z[11]!==N6[11])throw new Error("Missing KTX 2.0 identifier.");let X=pH1(),Y=17*Uint32Array.BYTES_PER_ELEMENT,$=new l$(J,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 W=$._nextUint32();X.supercompressionScheme=$._nextUint32();let Q=$._nextUint32(),K=$._nextUint32(),G=$._nextUint32(),z=$._nextUint32(),F=$._nextUint64(),H=$._nextUint64(),q=W*3*8,V=new l$(J,N6.length+Y,q,!0);for(let p8=0;p8<W;p8++)X.levels.push({levelData:new Uint8Array(J.buffer,J.byteOffset+V._nextUint64(),V._nextUint64()),uncompressedByteLength:V._nextUint64()});let U=new l$(J,Q,K,!0);U._skip(4);let L=U._nextUint16(),w=U._nextUint16(),j=U._nextUint16(),M=U._nextUint16(),R=U._nextUint8(),N=U._nextUint8(),D=U._nextUint8(),P=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()],A={vendorId:L,descriptorType:w,versionNumber:j,colorModel:R,colorPrimaries:N,transferFunction:D,flags:P,texelBlockDimension:C,bytesPlane:k,samples:[]},v=6,x=4,d=(M/4-v)/x;for(let p8=0;p8<d;p8++){let Z7={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(Z7.channelType&64)Z7.sampleLower=U._nextInt32(),Z7.sampleUpper=U._nextInt32();else Z7.sampleLower=U._nextUint32(),Z7.sampleUpper=U._nextUint32();A.samples[p8]=Z7}X.dataFormatDescriptor.length=0,X.dataFormatDescriptor.push(A);let h=new l$(J,G,z,!0);while(h._offset<z){let p8=h._nextUint32(),Z7=h._scan(p8),RH=ql(Z7);if(X.keyValue[RH]=h._nextUint8Array(p8-Z7.byteLength-1),RH.match(/^ktx/i)){let hA=ql(X.keyValue[RH]);X.keyValue[RH]=hA.substring(0,hA.lastIndexOf("\x00"))}let M71=p8%4?4-p8%4:0;h._skip(M71)}if(H<=0)return X;let u=new l$(J,F,H,!0),$0=u._nextUint16(),U0=u._nextUint16(),B0=u._nextUint32(),f0=u._nextUint32(),B1=u._nextUint32(),L8=u._nextUint32(),B8=[];for(let p8=0;p8<W;p8++)B8.push({imageFlags:u._nextUint32(),rgbSliceByteOffset:u._nextUint32(),rgbSliceByteLength:u._nextUint32(),alphaSliceByteOffset:u._nextUint32(),alphaSliceByteLength:u._nextUint32()});let j1=F+u._offset,B9=j1+B0,l8=B9+f0,X4=l8+B1,j9=new Uint8Array(J.buffer,J.byteOffset+j1,B0),G$=new Uint8Array(J.buffer,J.byteOffset+B9,f0),z$=new Uint8Array(J.buffer,J.byteOffset+l8,B1),bZ=new Uint8Array(J.buffer,J.byteOffset+X4,L8);return X.globalData={endpointCount:$0,selectorCount:U0,imageDescs:B8,endpointsData:j9,selectorsData:G$,tablesData:z$,extendedData:bZ},X}var NN="EXT_mesh_gpu_instancing",ON="EXT_meshopt_compression",iH1="EXT_texture_webp",nH1="EXT_texture_avif",El="KHR_draco_mesh_compression",PN="KHR_lights_punctual",DN="KHR_materials_anisotropy",CN="KHR_materials_clearcoat",TN="KHR_materials_diffuse_transmission",kN="KHR_materials_dispersion",EN="KHR_materials_emissive_strength",IN="KHR_materials_ior",vN="KHR_materials_iridescence",SN="KHR_materials_pbrSpecularGlossiness",_N="KHR_materials_sheen",xN="KHR_materials_specular",AN="KHR_materials_transmission",hN="KHR_materials_unlit",yN="KHR_materials_volume",RX="KHR_materials_variants",aH1="KHR_mesh_quantization",sH1="KHR_texture_basisu",fN="KHR_texture_transform",QU="KHR_xmp_json_ld",MN="INSTANCE_ATTRIBUTE";class bN extends y1{init(){this.extensionName=NN,this.propertyType="InstancedMesh",this.parentTypes=[l.NODE]}getDefaults(){return Object.assign(super.getDefaults(),{attributes:new d1})}getAttribute(J){return this.getRefMap("attributes",J)}setAttribute(J,Z){return this.setRefMap("attributes",J,Z,{usage:MN})}listAttributes(){return this.listRefMapValues("attributes")}listSemantics(){return this.listRefMapKeys("attributes")}}bN.EXTENSION_NAME=NN;var KX=NN;class zU extends M1{constructor(...J){super(...J);this.extensionName=KX,this.provideTypes=[l.NODE],this.prewriteTypes=[l.ACCESSOR]}createInstancedMesh(){return new bN(this.document.getGraph())}read(J){return(J.jsonDoc.json.nodes||[]).forEach((Y,$)=>{if(!Y.extensions||!Y.extensions[KX])return;let W=Y.extensions[KX],Q=this.createInstancedMesh();for(let K in W.attributes)Q.setAttribute(K,J.accessors[W.attributes[K]]);J.nodes[$].setExtension(KX,Q)}),this}prewrite(J){J.accessorUsageGroupedByParent.add(MN);for(let Z of this.properties)for(let X of Z.listAttributes())J.addAccessorToUsageGroup(X,MN);return this}write(J){let Z=J.jsonDoc;return this.document.getRoot().listNodes().forEach((X)=>{let Y=X.getExtension(KX);if(Y){let $=J.nodeIndexMap.get(X),W=Z.json.nodes[$],Q={attributes:{}};Y.listSemantics().forEach((K)=>{let G=Y.getAttribute(K);Q.attributes[K]=J.accessorIndexMap.get(G)}),W.extensions=W.extensions||{},W.extensions[KX]=Q}}),this}}zU.EXTENSION_NAME=KX;function B7(){return B7=Object.assign?Object.assign.bind():function(J){for(var Z=1;Z<arguments.length;Z++){var X=arguments[Z];for(var Y in X)({}).hasOwnProperty.call(X,Y)&&(J[Y]=X[Y])}return J},B7.apply(null,arguments)}var LG;(function(J){J.QUANTIZE="quantize",J.FILTER="filter"})(LG||(LG={}));var i$;(function(J){J.ATTRIBUTES="ATTRIBUTES",J.TRIANGLES="TRIANGLES",J.INDICES="INDICES"})(i$||(i$={}));var o1;(function(J){J.NONE="NONE",J.OCTAHEDRAL="OCTAHEDRAL",J.QUATERNION="QUATERNION",J.EXPONENTIAL="EXPONENTIAL"})(o1||(o1={}));var{BYTE:oH1,SHORT:wl,FLOAT:rH1}=q0.ComponentType,{encodeNormalizedInt:Ll,decodeNormalizedInt:RN}=s1;function tH1(J,Z,X,Y){let{filter:$,bits:W}=Y,Q={array:J.getArray(),byteStride:J.getElementSize()*J.getComponentSize(),componentType:J.getComponentType(),normalized:J.getNormalized()};if(X!==i$.ATTRIBUTES)return Q;if($!==o1.NONE){let K=J.getNormalized()?eH1(J):new Float32Array(Q.array);switch($){case o1.EXPONENTIAL:Q.byteStride=J.getElementSize()*4,Q.componentType=rH1,Q.normalized=!1,Q.array=Z.encodeFilterExp(K,J.getCount(),Q.byteStride,W);break;case o1.OCTAHEDRAL:Q.byteStride=W>8?8:4,Q.componentType=W>8?wl:oH1,Q.normalized=!0,K=J.getElementSize()===3?Zq1(K):K,Q.array=Z.encodeFilterOct(K,J.getCount(),Q.byteStride,W);break;case o1.QUATERNION:Q.byteStride=8,Q.componentType=wl,Q.normalized=!0,Q.array=Z.encodeFilterQuat(K,J.getCount(),Q.byteStride,W);break;default:throw new Error("Invalid filter.")}if(Q.min=J.getMin([]),Q.max=J.getMax([]),J.getNormalized())Q.min=Q.min.map((G)=>RN(G,J.getComponentType())),Q.max=Q.max.map((G)=>RN(G,J.getComponentType()));if(Q.normalized)Q.min=Q.min.map((G)=>Ll(G,Q.componentType)),Q.max=Q.max.map((G)=>Ll(G,Q.componentType))}else if(Q.byteStride%4)Q.array=Jq1(Q.array,J.getElementSize()),Q.byteStride=Q.array.byteLength/J.getCount();return Q}function eH1(J){let Z=J.getComponentType(),X=J.getArray(),Y=new Float32Array(X.length);for(let $=0;$<X.length;$++)Y[$]=RN(X[$],Z);return Y}function Jq1(J,Z){let Y=Y6.padNumber(J.BYTES_PER_ELEMENT*Z)/J.BYTES_PER_ELEMENT,$=J.length/Z,W=new J.constructor($*Y);for(let Q=0;Q*Z<J.length;Q++)for(let K=0;K<Z;K++)W[Q*Y+K]=J[Q*Z+K];return W}function Zq1(J){let Z=new Float32Array(J.length*4/3);for(let X=0,Y=J.length/3;X<Y;X++)Z[X*4]=J[X*3],Z[X*4+1]=J[X*3+1],Z[X*4+2]=J[X*3+2];return Z}function Xq1(J,Z){if(Z===OJ.BufferViewUsage.ELEMENT_ARRAY_BUFFER)return J.listParents().some((Y)=>{return Y instanceof jJ&&Y.getMode()===jJ.Mode.TRIANGLES})?i$.TRIANGLES:i$.INDICES;return i$.ATTRIBUTES}function Yq1(J,Z){let X=Z.getGraph().listParentEdges(J).filter((Y)=>!(Y.getParent()instanceof $U));for(let Y of X){let $=Y.getName(),W=Y.getAttributes().key||"",Q=Y.getParent().propertyType===l.PRIMITIVE_TARGET;if($==="indices")return{filter:o1.NONE};if($==="attributes"){if(W==="POSITION")return{filter:o1.NONE};if(W==="TEXCOORD_0")return{filter:o1.NONE};if(W.startsWith("JOINTS_"))return{filter:o1.NONE};if(W.startsWith("WEIGHTS_"))return{filter:o1.NONE};if(W==="NORMAL"||W==="TANGENT")return Q?{filter:o1.NONE}:{filter:o1.OCTAHEDRAL,bits:8}}if($==="output"){let K=Il(J);if(K==="rotation")return{filter:o1.QUATERNION,bits:16};if(K==="translation")return{filter:o1.EXPONENTIAL,bits:12};if(K==="scale")return{filter:o1.EXPONENTIAL,bits:12};return{filter:o1.NONE}}if($==="input")return{filter:o1.NONE};if($==="inverseBindMatrices")return{filter:o1.NONE}}return{filter:o1.NONE}}function Il(J){for(let Z of J.listParents()){if(!(Z instanceof c$))continue;for(let X of Z.listParents()){if(!(X instanceof FG))continue;return X.getTargetPath()}}return null}function $q1(J){if(!J.extensions||!J.extensions[ON])return!1;return!!J.extensions[ON].fallback}var P6=ON,Bl={method:LG.QUANTIZE};class jG extends M1{constructor(...J){super(...J);this.extensionName=P6,this.prereadTypes=[l.BUFFER,l.PRIMITIVE],this.prewriteTypes=[l.BUFFER,l.ACCESSOR],this.readDependencies=["meshopt.decoder"],this.writeDependencies=["meshopt.encoder"],this._decoder=null,this._decoderFallbackBufferMap=new Map,this._encoder=null,this._encoderOptions=Bl,this._encoderFallbackBuffer=null,this._encoderBufferViews={},this._encoderBufferViewData={},this._encoderBufferViewAccessors={}}install(J,Z){if(J==="meshopt.decoder")this._decoder=Z;if(J==="meshopt.encoder")this._encoder=Z;return this}setEncoderOptions(J){return this._encoderOptions=B7({},Bl,J),this}preread(J,Z){if(!this._decoder){if(!this.isRequired())return this;throw new Error(`[${P6}] Please install extension dependency, "meshopt.decoder".`)}if(!this._decoder.supported){if(!this.isRequired())return this;throw new Error(`[${P6}]: Missing WASM support.`)}if(Z===l.BUFFER)this._prereadBuffers(J);else if(Z===l.PRIMITIVE)this._prereadPrimitives(J);return this}_prereadBuffers(J){let Z=J.jsonDoc;(Z.json.bufferViews||[]).forEach((Y,$)=>{if(!Y.extensions||!Y.extensions[P6])return;let W=Y.extensions[P6],Q=W.byteOffset||0,K=W.byteLength||0,G=W.count,z=W.byteStride,F=new Uint8Array(G*z),H=Z.json.buffers[W.buffer],q=H.uri?Z.resources[H.uri]:Z.resources[zN],V=Y6.toView(q,Q,K);this._decoder.decodeGltfBuffer(F,G,z,V,W.mode,W.filter),J.bufferViews[$]=F})}_prereadPrimitives(J){let Z=J.jsonDoc;(Z.json.bufferViews||[]).forEach((Y)=>{if(!Y.extensions||!Y.extensions[P6])return;let $=Y.extensions[P6],W=J.buffers[$.buffer],Q=J.buffers[Y.buffer],K=Z.json.buffers[Y.buffer];if($q1(K))this._decoderFallbackBufferMap.set(Q,W)})}read(J){if(!this.isRequired())return this;for(let[Z,X]of this._decoderFallbackBufferMap){for(let Y of Z.listParents())if(Y instanceof q0)Y.swap(Z,X);Z.dispose()}return this}prewrite(J,Z){if(Z===l.ACCESSOR)this._prewriteAccessors(J);else if(Z===l.BUFFER)this._prewriteBuffers(J);return this}_prewriteAccessors(J){let Z=J.jsonDoc.json,X=this._encoder,Y=this._encoderOptions,$=this.document.getGraph(),W=this.document.createBuffer(),Q=this.document.getRoot().listBuffers().indexOf(W),K=1,G=new Map,z=(F)=>{for(let H of $.listParents(F)){if(H.propertyType===l.ROOT)continue;let q=G.get(F);if(q===void 0)G.set(F,q=K++);return q}return-1};this._encoderFallbackBuffer=W,this._encoderBufferViews={},this._encoderBufferViewData={},this._encoderBufferViewAccessors={};for(let F of this.document.getRoot().listAccessors()){if(Il(F)==="weights")continue;if(F.getSparse())continue;let H=J.getAccessorUsage(F),q=J.accessorUsageGroupedByParent.has(H)?z(F):null,V=Xq1(F,H),U=Y.method===LG.FILTER?Yq1(F,this.document):{filter:o1.NONE},L=tH1(F,X,V,U),{array:w,byteStride:j}=L,M=F.getBuffer();if(!M)throw new Error(`${P6}: Missing buffer for accessor.`);let R=this.document.getRoot().listBuffers().indexOf(M),N=[H,q,V,U.filter,j,R].join(":"),D=this._encoderBufferViews[N],P=this._encoderBufferViewData[N],C=this._encoderBufferViewAccessors[N];if(!D||!P)C=this._encoderBufferViewAccessors[N]=[],P=this._encoderBufferViewData[N]=[],D=this._encoderBufferViews[N]={buffer:Q,target:OJ.USAGE_TO_TARGET[H],byteOffset:0,byteLength:0,byteStride:H===OJ.BufferViewUsage.ARRAY_BUFFER?j:void 0,extensions:{[P6]:{buffer:R,byteOffset:0,byteLength:0,mode:V,filter:U.filter!==o1.NONE?U.filter:void 0,byteStride:j,count:0}}};let k=J.createAccessorDef(F);if(k.componentType=L.componentType,k.normalized=L.normalized,k.byteOffset=D.byteLength,k.min&&L.min)k.min=L.min;if(k.max&&L.max)k.max=L.max;J.accessorIndexMap.set(F,Z.accessors.length),Z.accessors.push(k),C.push(k),P.push(new Uint8Array(w.buffer,w.byteOffset,w.byteLength)),D.byteLength+=w.byteLength,D.extensions.EXT_meshopt_compression.count+=F.getCount()}}_prewriteBuffers(J){let Z=this._encoder;for(let X in this._encoderBufferViews){let Y=this._encoderBufferViews[X],$=this._encoderBufferViewData[X],W=this.document.getRoot().listBuffers()[Y.extensions[P6].buffer],Q=J.otherBufferViews.get(W)||[],{count:K,byteStride:G,mode:z}=Y.extensions[P6],F=Y6.concat($),H=Z.encodeGltfBuffer(F,K,G,z),q=Y6.pad(H);Y.extensions[P6].byteLength=H.byteLength,$.length=0,$.push(q),Q.push(q),J.otherBufferViews.set(W,Q)}}write(J){let Z=0;for(let W in this._encoderBufferViews){let Q=this._encoderBufferViews[W],K=this._encoderBufferViewData[W][0],G=J.otherBufferViewsIndexMap.get(K),z=this._encoderBufferViewAccessors[W];for(let V of z)V.bufferView=G;let F=J.jsonDoc.json.bufferViews[G],H=F.byteOffset||0;Object.assign(F,Q),F.byteOffset=Z;let q=F.extensions[P6];q.byteOffset=H,Z+=Y6.padNumber(Q.byteLength)}let X=this._encoderFallbackBuffer,Y=J.bufferIndexMap.get(X),$=J.jsonDoc.json.buffers[Y];return $.byteLength=Z,$.extensions={[P6]:{fallback:!0}},X.dispose(),this}}jG.EXTENSION_NAME=P6;jG.EncoderMethod=LG;var VG=nH1;class vl{match(J){return J.length>=12&&Y6.decodeText(J.slice(4,12))==="ftypavif"}getSize(J){if(!this.match(J))return null;let Z=new DataView(J.buffer,J.byteOffset,J.byteLength),X=jl(Z,0);if(!X)return null;let Y=X.end;while(X=jl(Z,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[Z.getUint32(X.start+4),Z.getUint32(X.start+8)];else if(X.type==="mdat")break;else Y=X.end;return null}getChannels(J){return 4}}class FU extends M1{constructor(...J){super(...J);this.extensionName=VG,this.prereadTypes=[l.TEXTURE]}static register(){I9.registerFormat("image/avif",new vl)}preread(J){return(J.jsonDoc.json.textures||[]).forEach((X)=>{if(X.extensions&&X.extensions[VG])X.source=X.extensions[VG].source}),this}read(J){return this}write(J){let Z=J.jsonDoc;return this.document.getRoot().listTextures().forEach((X)=>{if(X.getMimeType()==="image/avif"){let Y=J.imageIndexMap.get(X);(Z.json.textures||[]).forEach((W)=>{if(W.source===Y)W.extensions=W.extensions||{},W.extensions[VG]={source:W.source},delete W.source})}}),this}}FU.EXTENSION_NAME=VG;function jl(J,Z){if(J.byteLength<4+Z)return null;let X=J.getUint32(Z);if(J.byteLength<X+Z||X<8)return null;return{type:Y6.decodeText(new Uint8Array(J.buffer,J.byteOffset+Z+4,4)),start:Z+8,end:Z+X}}var UG=iH1;class Sl{match(J){return J.length>=12&&J[8]===87&&J[9]===69&&J[10]===66&&J[11]===80}getSize(J){let Z=Y6.decodeText(J.slice(0,4)),X=Y6.decodeText(J.slice(8,12));if(Z!=="RIFF"||X!=="WEBP")return null;let Y=new DataView(J.buffer,J.byteOffset),$=12;while($<Y.byteLength){let W=Y6.decodeText(new Uint8Array([Y.getUint8($),Y.getUint8($+1),Y.getUint8($+2),Y.getUint8($+3)])),Q=Y.getUint32($+4,!0);if(W==="VP8 "){let K=Y.getInt16($+14,!0)&16383,G=Y.getInt16($+16,!0)&16383;return[K,G]}else if(W==="VP8L"){let K=Y.getUint8($+9),G=Y.getUint8($+10),z=Y.getUint8($+11),F=Y.getUint8($+12),H=1+((G&63)<<8|K),q=1+((F&15)<<10|z<<2|(G&192)>>6);return[H,q]}$+=8+Q+Q%2}return null}getChannels(J){return 4}}class HU extends M1{constructor(...J){super(...J);this.extensionName=UG,this.prereadTypes=[l.TEXTURE]}static register(){I9.registerFormat("image/webp",new Sl)}preread(J){return(J.jsonDoc.json.textures||[]).forEach((X)=>{if(X.extensions&&X.extensions[UG])X.source=X.extensions[UG].source}),this}read(J){return this}write(J){let Z=J.jsonDoc;return this.document.getRoot().listTextures().forEach((X)=>{if(X.getMimeType()==="image/webp"){let Y=J.imageIndexMap.get(X);(Z.json.textures||[]).forEach((W)=>{if(W.source===Y)W.extensions=W.extensions||{},W.extensions[UG]={source:W.source},delete W.source})}}),this}}HU.EXTENSION_NAME=UG;var Ol=El,k8,_l,xl;function Wq1(J,Z){let X=new k8.DecoderBuffer;try{if(X.Init(Z,Z.length),J.GetEncodedGeometryType(X)!==k8.TRIANGULAR_MESH)throw new Error(`[${Ol}] Unknown geometry type.`);let $=new k8.Mesh;if(!J.DecodeBufferToMesh(X,$).ok()||$.ptr===0)throw new Error(`[${Ol}] Decoding failure.`);return $}finally{k8.destroy(X)}}function Qq1(J,Z){let Y=Z.num_faces()*3,$,W;if(Z.num_points()<=65534){let Q=Y*Uint16Array.BYTES_PER_ELEMENT;$=k8._malloc(Q),J.GetTrianglesUInt16Array(Z,Q,$),W=new Uint16Array(k8.HEAPU16.buffer,$,Y).slice()}else{let Q=Y*Uint32Array.BYTES_PER_ELEMENT;$=k8._malloc(Q),J.GetTrianglesUInt32Array(Z,Q,$),W=new Uint32Array(k8.HEAPU32.buffer,$,Y).slice()}return k8._free($),W}function Kq1(J,Z,X,Y){let $=xl[Y.componentType],W=_l[Y.componentType],Q=X.num_components(),G=Z.num_points()*Q,z=G*W.BYTES_PER_ELEMENT,F=k8._malloc(z);J.GetAttributeDataArrayForAllPoints(Z,X,$,z,F);let H=new W(k8.HEAPF32.buffer,F,G).slice();return k8._free(F),H}function Gq1(J){k8=J,_l={[q0.ComponentType.FLOAT]:Float32Array,[q0.ComponentType.UNSIGNED_INT]:Uint32Array,[q0.ComponentType.UNSIGNED_SHORT]:Uint16Array,[q0.ComponentType.UNSIGNED_BYTE]:Uint8Array,[q0.ComponentType.SHORT]:Int16Array,[q0.ComponentType.BYTE]:Int8Array},xl={[q0.ComponentType.FLOAT]:k8.DT_FLOAT32,[q0.ComponentType.UNSIGNED_INT]:k8.DT_UINT32,[q0.ComponentType.UNSIGNED_SHORT]:k8.DT_UINT16,[q0.ComponentType.UNSIGNED_BYTE]:k8.DT_UINT8,[q0.ComponentType.SHORT]:k8.DT_INT16,[q0.ComponentType.BYTE]:k8.DT_INT8}}var f5,BG;(function(J){J[J.EDGEBREAKER=1]="EDGEBREAKER",J[J.SEQUENTIAL=0]="SEQUENTIAL"})(BG||(BG={}));var b5;(function(J){J.POSITION="POSITION",J.NORMAL="NORMAL",J.COLOR="COLOR",J.TEX_COORD="TEX_COORD",J.GENERIC="GENERIC"})(b5||(b5={}));var Al={[b5.POSITION]:14,[b5.NORMAL]:10,[b5.COLOR]:8,[b5.TEX_COORD]:12,[b5.GENERIC]:12},Ml={decodeSpeed:5,encodeSpeed:5,method:BG.EDGEBREAKER,quantizationBits:Al,quantizationVolume:"mesh"};function zq1(J){f5=J}function Fq1(J,Z=Ml){let X=B7({},Ml,Z);X.quantizationBits=B7({},Al,Z.quantizationBits);let Y=new f5.MeshBuilder,$=new f5.Mesh,W=new f5.ExpertEncoder($),Q={},K=new f5.DracoInt8Array,G=J.listTargets().length>0,z=!1;for(let L of J.listSemantics()){let w=J.getAttribute(L);if(w.getSparse()){z=!0;continue}let j=Hq1(L),M=qq1(Y,w.getComponentType(),$,f5[j],w.getCount(),w.getElementSize(),w.getArray());if(M===-1)throw new Error(`Error compressing "${L}" attribute.`);if(Q[L]=M,X.quantizationVolume==="mesh"||L!=="POSITION")W.SetAttributeQuantization(M,X.quantizationBits[j]);else if(typeof X.quantizationVolume==="object"){let{quantizationVolume:R}=X,N=Math.max(R.max[0]-R.min[0],R.max[1]-R.min[1],R.max[2]-R.min[2]);W.SetAttributeExplicitQuantization(M,X.quantizationBits[j],w.getElementSize(),R.min,N)}else throw new Error("Invalid quantization volume state.")}let F=J.getIndices();if(!F)throw new KU("Primitive must have indices.");if(Y.AddFacesToMesh($,F.getCount()/3,F.getArray()),W.SetSpeedOptions(X.encodeSpeed,X.decodeSpeed),W.SetTrackEncodedProperties(!0),X.method===BG.SEQUENTIAL||G||z)W.SetEncodingMethod(f5.MESH_SEQUENTIAL_ENCODING);else W.SetEncodingMethod(f5.MESH_EDGEBREAKER_ENCODING);let H=W.EncodeToDracoBuffer(!(G||z),K);if(H<=0)throw new KU("Error applying Draco compression.");let q=new Uint8Array(H);for(let L=0;L<H;++L)q[L]=K.GetValue(L);let V=W.GetNumberOfEncodedPoints(),U=W.GetNumberOfEncodedFaces()*3;return f5.destroy(K),f5.destroy($),f5.destroy(Y),f5.destroy(W),{numVertices:V,numIndices:U,data:q,attributeIDs:Q}}function Hq1(J){if(J==="POSITION")return b5.POSITION;else if(J==="NORMAL")return b5.NORMAL;else if(J.startsWith("COLOR_"))return b5.COLOR;else if(J.startsWith("TEXCOORD_"))return b5.TEX_COORD;return b5.GENERIC}function qq1(J,Z,X,Y,$,W,Q){switch(Z){case q0.ComponentType.UNSIGNED_BYTE:return J.AddUInt8Attribute(X,Y,$,W,Q);case q0.ComponentType.BYTE:return J.AddInt8Attribute(X,Y,$,W,Q);case q0.ComponentType.UNSIGNED_SHORT:return J.AddUInt16Attribute(X,Y,$,W,Q);case q0.ComponentType.SHORT:return J.AddInt16Attribute(X,Y,$,W,Q);case q0.ComponentType.UNSIGNED_INT:return J.AddUInt32Attribute(X,Y,$,W,Q);case q0.ComponentType.FLOAT:return J.AddFloatAttribute(X,Y,$,W,Q);default:throw new Error(`Unexpected component type, "${Z}".`)}}class KU extends Error{}var z8=El;class OG extends M1{constructor(...J){super(...J);this.extensionName=z8,this.prereadTypes=[l.PRIMITIVE],this.prewriteTypes=[l.ACCESSOR],this.readDependencies=["draco3d.decoder"],this.writeDependencies=["draco3d.encoder"],this._decoderModule=null,this._encoderModule=null,this._encoderOptions={}}install(J,Z){if(J==="draco3d.decoder")this._decoderModule=Z,Gq1(this._decoderModule);if(J==="draco3d.encoder")this._encoderModule=Z,zq1(this._encoderModule);return this}setEncoderOptions(J){return this._encoderOptions=J,this}preread(J){if(!this._decoderModule)throw new Error(`[${z8}] Please install extension dependency, "draco3d.decoder".`);let Z=this.document.getLogger(),X=J.jsonDoc,Y=new Map;try{let $=X.json.meshes||[];for(let W of $)for(let Q of W.primitives){if(!Q.extensions||!Q.extensions[z8])continue;let K=Q.extensions[z8],[G,z]=Y.get(K.bufferView)||[];if(!z||!G){let F=X.json.bufferViews[K.bufferView],H=X.json.buffers[F.buffer],q=H.uri?X.resources[H.uri]:X.resources[zN],V=F.byteOffset||0,U=F.byteLength,L=Y6.toView(q,V,U);G=new this._decoderModule.Decoder,z=Wq1(G,L),Y.set(K.bufferView,[G,z]),Z.debug(`[${z8}] Decompressed ${L.byteLength} bytes.`)}for(let F in K.attributes){let H=J.jsonDoc.json.accessors[Q.attributes[F]],q=G.GetAttributeByUniqueId(z,K.attributes[F]),V=Kq1(G,z,q,H);J.accessors[Q.attributes[F]].setArray(V)}if(Q.indices!==void 0)J.accessors[Q.indices].setArray(Qq1(G,z))}}finally{for(let[$,W]of Array.from(Y.values()))this._decoderModule.destroy($),this._decoderModule.destroy(W)}return this}read(J){return this}prewrite(J,Z){if(!this._encoderModule)throw new Error(`[${z8}] Please install extension dependency, "draco3d.encoder".`);let X=this.document.getLogger();X.debug(`[${z8}] Compression options: ${JSON.stringify(this._encoderOptions)}`);let Y=Vq1(this.document),$=new Map,W="mesh";if(this._encoderOptions.quantizationVolume==="scene")if(this.document.getRoot().listScenes().length!==1)X.warn(`[${z8}]: quantizationVolume=scene requires exactly 1 scene.`);else W=Ql(this.document.getRoot().listScenes().pop());for(let Q of Array.from(Y.keys())){let K=Y.get(Q);if(!K)throw new Error("Unexpected primitive.");if($.has(K)){$.set(K,$.get(K));continue}let G=Q.getIndices(),z=J.jsonDoc.json.accessors,F;try{F=Fq1(Q,B7({},this._encoderOptions,{quantizationVolume:W}))}catch(V){if(V instanceof KU){X.warn(`[${z8}]: ${V.message} Skipping primitive compression.`);continue}throw V}$.set(K,F);let H=J.createAccessorDef(G);if(H.count=F.numIndices,J.accessorIndexMap.set(G,z.length),z.push(H),F.numVertices>65534&&q0.getComponentSize(H.componentType)<=2)H.componentType=q0.ComponentType.UNSIGNED_INT;else if(F.numVertices>254&&q0.getComponentSize(H.componentType)<=1)H.componentType=q0.ComponentType.UNSIGNED_SHORT;for(let V of Q.listSemantics()){let U=Q.getAttribute(V);if(F.attributeIDs[V]===void 0)continue;let L=J.createAccessorDef(U);L.count=F.numVertices,J.accessorIndexMap.set(U,z.length),z.push(L)}let q=Q.getAttribute("POSITION").getBuffer()||this.document.getRoot().listBuffers()[0];if(!J.otherBufferViews.has(q))J.otherBufferViews.set(q,[]);J.otherBufferViews.get(q).push(F.data)}return X.debug(`[${z8}] Compressed ${Y.size} primitives.`),J.extensionData[z8]={primitiveHashMap:Y,primitiveEncodingMap:$},this}write(J){let Z=J.extensionData[z8];for(let X of this.document.getRoot().listMeshes()){let Y=J.jsonDoc.json.meshes[J.meshIndexMap.get(X)];for(let $=0;$<X.listPrimitives().length;$++){let W=X.listPrimitives()[$],Q=Y.primitives[$],K=Z.primitiveHashMap.get(W);if(!K)continue;let G=Z.primitiveEncodingMap.get(K);if(!G)continue;Q.extensions=Q.extensions||{},Q.extensions[z8]={bufferView:J.otherBufferViewsIndexMap.get(G.data),attributes:G.attributeIDs}}}if(!Z.primitiveHashMap.size){let X=J.jsonDoc.json;X.extensionsUsed=(X.extensionsUsed||[]).filter((Y)=>Y!==z8),X.extensionsRequired=(X.extensionsRequired||[]).filter((Y)=>Y!==z8)}return this}}OG.EXTENSION_NAME=z8;OG.EncoderMethod=BG;function Vq1(J){let Z=J.getLogger(),X=new Set,Y=new Set,$=0,W=0;for(let H of J.getRoot().listMeshes())for(let q of H.listPrimitives())if(!q.getIndices())Y.add(q),$++;else if(q.getMode()!==jJ.Mode.TRIANGLES)Y.add(q),W++;else X.add(q);if($>0)Z.warn(`[${z8}] Skipping Draco compression of ${$} non-indexed primitives.`);if(W>0)Z.warn(`[${z8}] Skipping Draco compression of ${W} non-TRIANGLES primitives.`);let Q=J.getRoot().listAccessors(),K=new Map;for(let H=0;H<Q.length;H++)K.set(Q[H],H);let G=new Map,z=new Set,F=new Map;for(let H of Array.from(X)){let q=Rl(H,K);if(z.has(q)){F.set(H,q);continue}if(G.has(H.getIndices())){let V=H.getIndices(),U=V.clone();K.set(U,J.getRoot().listAccessors().length-1),H.swap(V,U)}for(let V of H.listAttributes())if(G.has(V)){let U=V.clone();K.set(U,J.getRoot().listAccessors().length-1),H.swap(V,U)}q=Rl(H,K),z.add(q),F.set(H,q),G.set(H.getIndices(),q);for(let V of H.listAttributes())G.set(V,q)}for(let H of Array.from(G.keys())){let q=new Set(H.listParents().map((V)=>V.propertyType));if(q.size!==2||!q.has(l.PRIMITIVE)||!q.has(l.ROOT))throw new Error(`[${z8}] Compressed accessors must only be used as indices or vertex attributes.`)}for(let H of Array.from(X)){let q=F.get(H),V=H.getIndices();if(G.get(V)!==q||H.listAttributes().some((U)=>G.get(U)!==q))throw new Error(`[${z8}] Draco primitives must share all, or no, accessors.`)}for(let H of Array.from(Y)){let q=H.getIndices();if(G.has(q)||H.listAttributes().some((V)=>G.has(V)))throw new Error(`[${z8}] Accessor cannot be shared by compressed and uncompressed primitives.`)}return F}function Rl(J,Z){let X=[],Y=J.getIndices();X.push(Z.get(Y));for(let $ of J.listAttributes())X.push(Z.get($));return X.sort().join("|")}class n$ extends y1{init(){this.extensionName=PN,this.propertyType="Light",this.parentTypes=[l.NODE]}getDefaults(){return Object.assign(super.getDefaults(),{color:[1,1,1],intensity:1,type:n$.Type.POINT,range:null,innerConeAngle:0,outerConeAngle:Math.PI/4})}getColor(){return this.get("color")}setColor(J){return this.set("color",J)}getIntensity(){return this.get("intensity")}setIntensity(J){return this.set("intensity",J)}getType(){return this.get("type")}setType(J){return this.set("type",J)}getRange(){return this.get("range")}setRange(J){return this.set("range",J)}getInnerConeAngle(){return this.get("innerConeAngle")}setInnerConeAngle(J){return this.set("innerConeAngle",J)}getOuterConeAngle(){return this.get("outerConeAngle")}setOuterConeAngle(J){return this.set("outerConeAngle",J)}}n$.EXTENSION_NAME=PN;n$.Type={POINT:"point",SPOT:"spot",DIRECTIONAL:"directional"};var L4=PN;class gN extends M1{constructor(...J){super(...J);this.extensionName=L4}createLight(J=""){return new n$(this.document.getGraph(),J)}read(J){let Z=J.jsonDoc;if(!Z.json.extensions||!Z.json.extensions[L4])return this;let $=(Z.json.extensions[L4].lights||[]).map((W)=>{var Q,K;let G=this.createLight().setName(W.name||"").setType(W.type);if(W.color!==void 0)G.setColor(W.color);if(W.intensity!==void 0)G.setIntensity(W.intensity);if(W.range!==void 0)G.setRange(W.range);if(((Q=W.spot)==null?void 0:Q.innerConeAngle)!==void 0)G.setInnerConeAngle(W.spot.innerConeAngle);if(((K=W.spot)==null?void 0:K.outerConeAngle)!==void 0)G.setOuterConeAngle(W.spot.outerConeAngle);return G});return Z.json.nodes.forEach((W,Q)=>{if(!W.extensions||!W.extensions[L4])return;let K=W.extensions[L4];J.nodes[Q].setExtension(L4,$[K.light])}),this}write(J){let Z=J.jsonDoc;if(this.properties.size===0)return this;let X=[],Y=new Map;for(let $ of this.properties){let W=$,Q={type:W.getType()};if(!s1.eq(W.getColor(),[1,1,1]))Q.color=W.getColor();if(W.getIntensity()!==1)Q.intensity=W.getIntensity();if(W.getRange()!=null)Q.range=W.getRange();if(W.getName())Q.name=W.getName();if(W.getType()===n$.Type.SPOT)Q.spot={innerConeAngle:W.getInnerConeAngle(),outerConeAngle:W.getOuterConeAngle()};X.push(Q),Y.set(W,X.length-1)}return this.document.getRoot().listNodes().forEach(($)=>{let W=$.getExtension(L4);if(W){let Q=J.nodeIndexMap.get($),K=Z.json.nodes[Q];K.extensions=K.extensions||{},K.extensions[L4]={light:Y.get(W)}}}),Z.json.extensions=Z.json.extensions||{},Z.json.extensions[L4]={lights:X},this}}gN.EXTENSION_NAME=L4;var{R:Uq1,G:wq1,B:Lq1}=O5;class mN extends y1{init(){this.extensionName=DN,this.propertyType="Anisotropy",this.parentTypes=[l.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{anisotropyStrength:0,anisotropyRotation:0,anisotropyTexture:null,anisotropyTextureInfo:new U1(this.graph,"anisotropyTextureInfo")})}getAnisotropyStrength(){return this.get("anisotropyStrength")}setAnisotropyStrength(J){return this.set("anisotropyStrength",J)}getAnisotropyRotation(){return this.get("anisotropyRotation")}setAnisotropyRotation(J){return this.set("anisotropyRotation",J)}getAnisotropyTexture(){return this.getRef("anisotropyTexture")}getAnisotropyTextureInfo(){return this.getRef("anisotropyTexture")?this.getRef("anisotropyTextureInfo"):null}setAnisotropyTexture(J){return this.setRef("anisotropyTexture",J,{channels:Uq1|wq1|Lq1})}}mN.EXTENSION_NAME=DN;var GX=DN;class dN extends M1{constructor(...J){super(...J);this.extensionName=GX,this.prereadTypes=[l.MESH],this.prewriteTypes=[l.MESH]}createAnisotropy(){return new mN(this.document.getGraph())}read(J){return this}write(J){return this}preread(J){let Z=J.jsonDoc,X=Z.json.materials||[],Y=Z.json.textures||[];return X.forEach(($,W)=>{if($.extensions&&$.extensions[GX]){let Q=this.createAnisotropy();J.materials[W].setExtension(GX,Q);let K=$.extensions[GX];if(K.anisotropyStrength!==void 0)Q.setAnisotropyStrength(K.anisotropyStrength);if(K.anisotropyRotation!==void 0)Q.setAnisotropyRotation(K.anisotropyRotation);if(K.anisotropyTexture!==void 0){let G=K.anisotropyTexture,z=J.textures[Y[G.index].source];Q.setAnisotropyTexture(z),J.setTextureInfo(Q.getAnisotropyTextureInfo(),G)}}}),this}prewrite(J){let Z=J.jsonDoc;return this.document.getRoot().listMaterials().forEach((X)=>{let Y=X.getExtension(GX);if(Y){let $=J.materialIndexMap.get(X),W=Z.json.materials[$];W.extensions=W.extensions||{};let Q=W.extensions[GX]={};if(Y.getAnisotropyStrength()>0)Q.anisotropyStrength=Y.getAnisotropyStrength();if(Y.getAnisotropyRotation()!==0)Q.anisotropyRotation=Y.getAnisotropyRotation();if(Y.getAnisotropyTexture()){let K=Y.getAnisotropyTexture(),G=Y.getAnisotropyTextureInfo();Q.anisotropyTexture=J.createTextureInfoDef(K,G)}}}),this}}dN.EXTENSION_NAME=GX;var{R:Nl,G:Pl,B:Bq1}=O5;class uN extends y1{init(){this.extensionName=CN,this.propertyType="Clearcoat",this.parentTypes=[l.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{clearcoatFactor:0,clearcoatTexture:null,clearcoatTextureInfo:new U1(this.graph,"clearcoatTextureInfo"),clearcoatRoughnessFactor:0,clearcoatRoughnessTexture:null,clearcoatRoughnessTextureInfo:new U1(this.graph,"clearcoatRoughnessTextureInfo"),clearcoatNormalScale:1,clearcoatNormalTexture:null,clearcoatNormalTextureInfo:new U1(this.graph,"clearcoatNormalTextureInfo")})}getClearcoatFactor(){return this.get("clearcoatFactor")}setClearcoatFactor(J){return this.set("clearcoatFactor",J)}getClearcoatTexture(){return this.getRef("clearcoatTexture")}getClearcoatTextureInfo(){return this.getRef("clearcoatTexture")?this.getRef("clearcoatTextureInfo"):null}setClearcoatTexture(J){return this.setRef("clearcoatTexture",J,{channels:Nl})}getClearcoatRoughnessFactor(){return this.get("clearcoatRoughnessFactor")}setClearcoatRoughnessFactor(J){return this.set("clearcoatRoughnessFactor",J)}getClearcoatRoughnessTexture(){return this.getRef("clearcoatRoughnessTexture")}getClearcoatRoughnessTextureInfo(){return this.getRef("clearcoatRoughnessTexture")?this.getRef("clearcoatRoughnessTextureInfo"):null}setClearcoatRoughnessTexture(J){return this.setRef("clearcoatRoughnessTexture",J,{channels:Pl})}getClearcoatNormalScale(){return this.get("clearcoatNormalScale")}setClearcoatNormalScale(J){return this.set("clearcoatNormalScale",J)}getClearcoatNormalTexture(){return this.getRef("clearcoatNormalTexture")}getClearcoatNormalTextureInfo(){return this.getRef("clearcoatNormalTexture")?this.getRef("clearcoatNormalTextureInfo"):null}setClearcoatNormalTexture(J){return this.setRef("clearcoatNormalTexture",J,{channels:Nl|Pl|Bq1})}}uN.EXTENSION_NAME=CN;var zX=CN;class cN extends M1{constructor(...J){super(...J);this.extensionName=zX,this.prereadTypes=[l.MESH],this.prewriteTypes=[l.MESH]}createClearcoat(){return new uN(this.document.getGraph())}read(J){return this}write(J){return this}preread(J){let Z=J.jsonDoc,X=Z.json.materials||[],Y=Z.json.textures||[];return X.forEach(($,W)=>{if($.extensions&&$.extensions[zX]){let Q=this.createClearcoat();J.materials[W].setExtension(zX,Q);let K=$.extensions[zX];if(K.clearcoatFactor!==void 0)Q.setClearcoatFactor(K.clearcoatFactor);if(K.clearcoatRoughnessFactor!==void 0)Q.setClearcoatRoughnessFactor(K.clearcoatRoughnessFactor);if(K.clearcoatTexture!==void 0){let G=K.clearcoatTexture,z=J.textures[Y[G.index].source];Q.setClearcoatTexture(z),J.setTextureInfo(Q.getClearcoatTextureInfo(),G)}if(K.clearcoatRoughnessTexture!==void 0){let G=K.clearcoatRoughnessTexture,z=J.textures[Y[G.index].source];Q.setClearcoatRoughnessTexture(z),J.setTextureInfo(Q.getClearcoatRoughnessTextureInfo(),G)}if(K.clearcoatNormalTexture!==void 0){let G=K.clearcoatNormalTexture,z=J.textures[Y[G.index].source];if(Q.setClearcoatNormalTexture(z),J.setTextureInfo(Q.getClearcoatNormalTextureInfo(),G),G.scale!==void 0)Q.setClearcoatNormalScale(G.scale)}}}),this}prewrite(J){let Z=J.jsonDoc;return this.document.getRoot().listMaterials().forEach((X)=>{let Y=X.getExtension(zX);if(Y){let $=J.materialIndexMap.get(X),W=Z.json.materials[$];W.extensions=W.extensions||{};let Q=W.extensions[zX]={clearcoatFactor:Y.getClearcoatFactor(),clearcoatRoughnessFactor:Y.getClearcoatRoughnessFactor()};if(Y.getClearcoatTexture()){let K=Y.getClearcoatTexture(),G=Y.getClearcoatTextureInfo();Q.clearcoatTexture=J.createTextureInfoDef(K,G)}if(Y.getClearcoatRoughnessTexture()){let K=Y.getClearcoatRoughnessTexture(),G=Y.getClearcoatRoughnessTextureInfo();Q.clearcoatRoughnessTexture=J.createTextureInfoDef(K,G)}if(Y.getClearcoatNormalTexture()){let K=Y.getClearcoatNormalTexture(),G=Y.getClearcoatNormalTextureInfo();if(Q.clearcoatNormalTexture=J.createTextureInfoDef(K,G),Y.getClearcoatNormalScale()!==1)Q.clearcoatNormalTexture.scale=Y.getClearcoatNormalScale()}}}),this}}cN.EXTENSION_NAME=zX;var{R:jq1,G:Oq1,B:Mq1,A:Rq1}=O5;class lN extends y1{init(){this.extensionName=TN,this.propertyType="DiffuseTransmission",this.parentTypes=[l.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{diffuseTransmissionFactor:0,diffuseTransmissionTexture:null,diffuseTransmissionTextureInfo:new U1(this.graph,"diffuseTransmissionTextureInfo"),diffuseTransmissionColorFactor:[1,1,1],diffuseTransmissionColorTexture:null,diffuseTransmissionColorTextureInfo:new U1(this.graph,"diffuseTransmissionColorTextureInfo")})}getDiffuseTransmissionFactor(){return this.get("diffuseTransmissionFactor")}setDiffuseTransmissionFactor(J){return this.set("diffuseTransmissionFactor",J)}getDiffuseTransmissionTexture(){return this.getRef("diffuseTransmissionTexture")}getDiffuseTransmissionTextureInfo(){return this.getRef("diffuseTransmissionTexture")?this.getRef("diffuseTransmissionTextureInfo"):null}setDiffuseTransmissionTexture(J){return this.setRef("diffuseTransmissionTexture",J,{channels:Rq1})}getDiffuseTransmissionColorFactor(){return this.get("diffuseTransmissionColorFactor")}setDiffuseTransmissionColorFactor(J){return this.set("diffuseTransmissionColorFactor",J)}getDiffuseTransmissionColorTexture(){return this.getRef("diffuseTransmissionColorTexture")}getDiffuseTransmissionColorTextureInfo(){return this.getRef("diffuseTransmissionColorTexture")?this.getRef("diffuseTransmissionColorTextureInfo"):null}setDiffuseTransmissionColorTexture(J){return this.setRef("diffuseTransmissionColorTexture",J,{channels:jq1|Oq1|Mq1})}}lN.EXTENSION_NAME=TN;var FX=TN;class pN extends M1{constructor(...J){super(...J);this.extensionName=FX}createDiffuseTransmission(){return new lN(this.document.getGraph())}read(J){let Z=J.jsonDoc,X=Z.json.materials||[],Y=Z.json.textures||[];return X.forEach(($,W)=>{if($.extensions&&$.extensions[FX]){let Q=this.createDiffuseTransmission();J.materials[W].setExtension(FX,Q);let K=$.extensions[FX];if(K.diffuseTransmissionFactor!==void 0)Q.setDiffuseTransmissionFactor(K.diffuseTransmissionFactor);if(K.diffuseTransmissionColorFactor!==void 0)Q.setDiffuseTransmissionColorFactor(K.diffuseTransmissionColorFactor);if(K.diffuseTransmissionTexture!==void 0){let G=K.diffuseTransmissionTexture,z=J.textures[Y[G.index].source];Q.setDiffuseTransmissionTexture(z),J.setTextureInfo(Q.getDiffuseTransmissionTextureInfo(),G)}if(K.diffuseTransmissionColorTexture!==void 0){let G=K.diffuseTransmissionColorTexture,z=J.textures[Y[G.index].source];Q.setDiffuseTransmissionColorTexture(z),J.setTextureInfo(Q.getDiffuseTransmissionColorTextureInfo(),G)}}}),this}write(J){let Z=J.jsonDoc;for(let X of this.document.getRoot().listMaterials()){let Y=X.getExtension(FX);if(!Y)continue;let $=J.materialIndexMap.get(X),W=Z.json.materials[$];W.extensions=W.extensions||{};let Q=W.extensions[FX]={diffuseTransmissionFactor:Y.getDiffuseTransmissionFactor(),diffuseTransmissionColorFactor:Y.getDiffuseTransmissionColorFactor()};if(Y.getDiffuseTransmissionTexture()){let K=Y.getDiffuseTransmissionTexture(),G=Y.getDiffuseTransmissionTextureInfo();Q.diffuseTransmissionTexture=J.createTextureInfoDef(K,G)}if(Y.getDiffuseTransmissionColorTexture()){let K=Y.getDiffuseTransmissionColorTexture(),G=Y.getDiffuseTransmissionColorTextureInfo();Q.diffuseTransmissionColorTexture=J.createTextureInfoDef(K,G)}}return this}}pN.EXTENSION_NAME=FX;class iN extends y1{init(){this.extensionName=kN,this.propertyType="Dispersion",this.parentTypes=[l.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{dispersion:0})}getDispersion(){return this.get("dispersion")}setDispersion(J){return this.set("dispersion",J)}}iN.EXTENSION_NAME=kN;var HX=kN;class nN extends M1{constructor(...J){super(...J);this.extensionName=HX,this.prereadTypes=[l.MESH],this.prewriteTypes=[l.MESH]}createDispersion(){return new iN(this.document.getGraph())}read(J){return this}write(J){return this}preread(J){return(J.jsonDoc.json.materials||[]).forEach((Y,$)=>{if(Y.extensions&&Y.extensions[HX]){let W=this.createDispersion();J.materials[$].setExtension(HX,W);let Q=Y.extensions[HX];if(Q.dispersion!==void 0)W.setDispersion(Q.dispersion)}}),this}prewrite(J){let Z=J.jsonDoc;return this.document.getRoot().listMaterials().forEach((X)=>{let Y=X.getExtension(HX);if(Y){let $=J.materialIndexMap.get(X),W=Z.json.materials[$];W.extensions=W.extensions||{},W.extensions[HX]={dispersion:Y.getDispersion()}}}),this}}nN.EXTENSION_NAME=HX;class aN extends y1{init(){this.extensionName=EN,this.propertyType="EmissiveStrength",this.parentTypes=[l.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{emissiveStrength:1})}getEmissiveStrength(){return this.get("emissiveStrength")}setEmissiveStrength(J){return this.set("emissiveStrength",J)}}aN.EXTENSION_NAME=EN;var qX=EN;class sN extends M1{constructor(...J){super(...J);this.extensionName=qX,this.prereadTypes=[l.MESH],this.prewriteTypes=[l.MESH]}createEmissiveStrength(){return new aN(this.document.getGraph())}read(J){return this}write(J){return this}preread(J){return(J.jsonDoc.json.materials||[]).forEach((Y,$)=>{if(Y.extensions&&Y.extensions[qX]){let W=this.createEmissiveStrength();J.materials[$].setExtension(qX,W);let Q=Y.extensions[qX];if(Q.emissiveStrength!==void 0)W.setEmissiveStrength(Q.emissiveStrength)}}),this}prewrite(J){let Z=J.jsonDoc;return this.document.getRoot().listMaterials().forEach((X)=>{let Y=X.getExtension(qX);if(Y){let $=J.materialIndexMap.get(X),W=Z.json.materials[$];W.extensions=W.extensions||{},W.extensions[qX]={emissiveStrength:Y.getEmissiveStrength()}}}),this}}sN.EXTENSION_NAME=qX;class oN extends y1{init(){this.extensionName=IN,this.propertyType="IOR",this.parentTypes=[l.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{ior:1.5})}getIOR(){return this.get("ior")}setIOR(J){return this.set("ior",J)}}oN.EXTENSION_NAME=IN;var VX=IN;class qU extends M1{constructor(...J){super(...J);this.extensionName=VX,this.prereadTypes=[l.MESH],this.prewriteTypes=[l.MESH]}createIOR(){return new oN(this.document.getGraph())}read(J){return this}write(J){return this}preread(J){return(J.jsonDoc.json.materials||[]).forEach((Y,$)=>{if(Y.extensions&&Y.extensions[VX]){let W=this.createIOR();J.materials[$].setExtension(VX,W);let Q=Y.extensions[VX];if(Q.ior!==void 0)W.setIOR(Q.ior)}}),this}prewrite(J){let Z=J.jsonDoc;return this.document.getRoot().listMaterials().forEach((X)=>{let Y=X.getExtension(VX);if(Y){let $=J.materialIndexMap.get(X),W=Z.json.materials[$];W.extensions=W.extensions||{},W.extensions[VX]={ior:Y.getIOR()}}}),this}}qU.EXTENSION_NAME=VX;var{R:Nq1,G:Pq1}=O5;class rN extends y1{init(){this.extensionName=vN,this.propertyType="Iridescence",this.parentTypes=[l.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{iridescenceFactor:0,iridescenceTexture:null,iridescenceTextureInfo:new U1(this.graph,"iridescenceTextureInfo"),iridescenceIOR:1.3,iridescenceThicknessMinimum:100,iridescenceThicknessMaximum:400,iridescenceThicknessTexture:null,iridescenceThicknessTextureInfo:new U1(this.graph,"iridescenceThicknessTextureInfo")})}getIridescenceFactor(){return this.get("iridescenceFactor")}setIridescenceFactor(J){return this.set("iridescenceFactor",J)}getIridescenceTexture(){return this.getRef("iridescenceTexture")}getIridescenceTextureInfo(){return this.getRef("iridescenceTexture")?this.getRef("iridescenceTextureInfo"):null}setIridescenceTexture(J){return this.setRef("iridescenceTexture",J,{channels:Nq1})}getIridescenceIOR(){return this.get("iridescenceIOR")}setIridescenceIOR(J){return this.set("iridescenceIOR",J)}getIridescenceThicknessMinimum(){return this.get("iridescenceThicknessMinimum")}setIridescenceThicknessMinimum(J){return this.set("iridescenceThicknessMinimum",J)}getIridescenceThicknessMaximum(){return this.get("iridescenceThicknessMaximum")}setIridescenceThicknessMaximum(J){return this.set("iridescenceThicknessMaximum",J)}getIridescenceThicknessTexture(){return this.getRef("iridescenceThicknessTexture")}getIridescenceThicknessTextureInfo(){return this.getRef("iridescenceThicknessTexture")?this.getRef("iridescenceThicknessTextureInfo"):null}setIridescenceThicknessTexture(J){return this.setRef("iridescenceThicknessTexture",J,{channels:Pq1})}}rN.EXTENSION_NAME=vN;var UX=vN;class tN extends M1{constructor(...J){super(...J);this.extensionName=UX,this.prereadTypes=[l.MESH],this.prewriteTypes=[l.MESH]}createIridescence(){return new rN(this.document.getGraph())}read(J){return this}write(J){return this}preread(J){let Z=J.jsonDoc,X=Z.json.materials||[],Y=Z.json.textures||[];return X.forEach(($,W)=>{if($.extensions&&$.extensions[UX]){let Q=this.createIridescence();J.materials[W].setExtension(UX,Q);let K=$.extensions[UX];if(K.iridescenceFactor!==void 0)Q.setIridescenceFactor(K.iridescenceFactor);if(K.iridescenceIor!==void 0)Q.setIridescenceIOR(K.iridescenceIor);if(K.iridescenceThicknessMinimum!==void 0)Q.setIridescenceThicknessMinimum(K.iridescenceThicknessMinimum);if(K.iridescenceThicknessMaximum!==void 0)Q.setIridescenceThicknessMaximum(K.iridescenceThicknessMaximum);if(K.iridescenceTexture!==void 0){let G=K.iridescenceTexture,z=J.textures[Y[G.index].source];Q.setIridescenceTexture(z),J.setTextureInfo(Q.getIridescenceTextureInfo(),G)}if(K.iridescenceThicknessTexture!==void 0){let G=K.iridescenceThicknessTexture,z=J.textures[Y[G.index].source];Q.setIridescenceThicknessTexture(z),J.setTextureInfo(Q.getIridescenceThicknessTextureInfo(),G)}}}),this}prewrite(J){let Z=J.jsonDoc;return this.document.getRoot().listMaterials().forEach((X)=>{let Y=X.getExtension(UX);if(Y){let $=J.materialIndexMap.get(X),W=Z.json.materials[$];W.extensions=W.extensions||{};let Q=W.extensions[UX]={};if(Y.getIridescenceFactor()>0)Q.iridescenceFactor=Y.getIridescenceFactor();if(Y.getIridescenceIOR()!==1.3)Q.iridescenceIor=Y.getIridescenceIOR();if(Y.getIridescenceThicknessMinimum()!==100)Q.iridescenceThicknessMinimum=Y.getIridescenceThicknessMinimum();if(Y.getIridescenceThicknessMaximum()!==400)Q.iridescenceThicknessMaximum=Y.getIridescenceThicknessMaximum();if(Y.getIridescenceTexture()){let K=Y.getIridescenceTexture(),G=Y.getIridescenceTextureInfo();Q.iridescenceTexture=J.createTextureInfoDef(K,G)}if(Y.getIridescenceThicknessTexture()){let K=Y.getIridescenceThicknessTexture(),G=Y.getIridescenceThicknessTextureInfo();Q.iridescenceThicknessTexture=J.createTextureInfoDef(K,G)}}}),this}}tN.EXTENSION_NAME=UX;var{R:Dl,G:Cl,B:Tl,A:kl}=O5;class eN extends y1{init(){this.extensionName=SN,this.propertyType="PBRSpecularGlossiness",this.parentTypes=[l.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{diffuseFactor:[1,1,1,1],diffuseTexture:null,diffuseTextureInfo:new U1(this.graph,"diffuseTextureInfo"),specularFactor:[1,1,1],glossinessFactor:1,specularGlossinessTexture:null,specularGlossinessTextureInfo:new U1(this.graph,"specularGlossinessTextureInfo")})}getDiffuseFactor(){return this.get("diffuseFactor")}setDiffuseFactor(J){return this.set("diffuseFactor",J)}getDiffuseTexture(){return this.getRef("diffuseTexture")}getDiffuseTextureInfo(){return this.getRef("diffuseTexture")?this.getRef("diffuseTextureInfo"):null}setDiffuseTexture(J){return this.setRef("diffuseTexture",J,{channels:Dl|Cl|Tl|kl,isColor:!0})}getSpecularFactor(){return this.get("specularFactor")}setSpecularFactor(J){return this.set("specularFactor",J)}getGlossinessFactor(){return this.get("glossinessFactor")}setGlossinessFactor(J){return this.set("glossinessFactor",J)}getSpecularGlossinessTexture(){return this.getRef("specularGlossinessTexture")}getSpecularGlossinessTextureInfo(){return this.getRef("specularGlossinessTexture")?this.getRef("specularGlossinessTextureInfo"):null}setSpecularGlossinessTexture(J){return this.setRef("specularGlossinessTexture",J,{channels:Dl|Cl|Tl|kl})}}eN.EXTENSION_NAME=SN;var wX=SN;class VU extends M1{constructor(...J){super(...J);this.extensionName=wX,this.prereadTypes=[l.MESH],this.prewriteTypes=[l.MESH]}createPBRSpecularGlossiness(){return new eN(this.document.getGraph())}read(J){return this}write(J){return this}preread(J){let Z=J.jsonDoc,X=Z.json.materials||[],Y=Z.json.textures||[];return X.forEach(($,W)=>{if($.extensions&&$.extensions[wX]){let Q=this.createPBRSpecularGlossiness();J.materials[W].setExtension(wX,Q);let K=$.extensions[wX];if(K.diffuseFactor!==void 0)Q.setDiffuseFactor(K.diffuseFactor);if(K.specularFactor!==void 0)Q.setSpecularFactor(K.specularFactor);if(K.glossinessFactor!==void 0)Q.setGlossinessFactor(K.glossinessFactor);if(K.diffuseTexture!==void 0){let G=K.diffuseTexture,z=J.textures[Y[G.index].source];Q.setDiffuseTexture(z),J.setTextureInfo(Q.getDiffuseTextureInfo(),G)}if(K.specularGlossinessTexture!==void 0){let G=K.specularGlossinessTexture,z=J.textures[Y[G.index].source];Q.setSpecularGlossinessTexture(z),J.setTextureInfo(Q.getSpecularGlossinessTextureInfo(),G)}}}),this}prewrite(J){let Z=J.jsonDoc;return this.document.getRoot().listMaterials().forEach((X)=>{let Y=X.getExtension(wX);if(Y){let $=J.materialIndexMap.get(X),W=Z.json.materials[$];W.extensions=W.extensions||{};let Q=W.extensions[wX]={diffuseFactor:Y.getDiffuseFactor(),specularFactor:Y.getSpecularFactor(),glossinessFactor:Y.getGlossinessFactor()};if(Y.getDiffuseTexture()){let K=Y.getDiffuseTexture(),G=Y.getDiffuseTextureInfo();Q.diffuseTexture=J.createTextureInfoDef(K,G)}if(Y.getSpecularGlossinessTexture()){let K=Y.getSpecularGlossinessTexture(),G=Y.getSpecularGlossinessTextureInfo();Q.specularGlossinessTexture=J.createTextureInfoDef(K,G)}}}),this}}VU.EXTENSION_NAME=wX;var{R:Dq1,G:Cq1,B:Tq1,A:kq1}=O5;class JP extends y1{init(){this.extensionName=_N,this.propertyType="Sheen",this.parentTypes=[l.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{sheenColorFactor:[0,0,0],sheenColorTexture:null,sheenColorTextureInfo:new U1(this.graph,"sheenColorTextureInfo"),sheenRoughnessFactor:0,sheenRoughnessTexture:null,sheenRoughnessTextureInfo:new U1(this.graph,"sheenRoughnessTextureInfo")})}getSheenColorFactor(){return this.get("sheenColorFactor")}setSheenColorFactor(J){return this.set("sheenColorFactor",J)}getSheenColorTexture(){return this.getRef("sheenColorTexture")}getSheenColorTextureInfo(){return this.getRef("sheenColorTexture")?this.getRef("sheenColorTextureInfo"):null}setSheenColorTexture(J){return this.setRef("sheenColorTexture",J,{channels:Dq1|Cq1|Tq1,isColor:!0})}getSheenRoughnessFactor(){return this.get("sheenRoughnessFactor")}setSheenRoughnessFactor(J){return this.set("sheenRoughnessFactor",J)}getSheenRoughnessTexture(){return this.getRef("sheenRoughnessTexture")}getSheenRoughnessTextureInfo(){return this.getRef("sheenRoughnessTexture")?this.getRef("sheenRoughnessTextureInfo"):null}setSheenRoughnessTexture(J){return this.setRef("sheenRoughnessTexture",J,{channels:kq1})}}JP.EXTENSION_NAME=_N;var LX=_N;class ZP extends M1{constructor(...J){super(...J);this.extensionName=LX,this.prereadTypes=[l.MESH],this.prewriteTypes=[l.MESH]}createSheen(){return new JP(this.document.getGraph())}read(J){return this}write(J){return this}preread(J){let Z=J.jsonDoc,X=Z.json.materials||[],Y=Z.json.textures||[];return X.forEach(($,W)=>{if($.extensions&&$.extensions[LX]){let Q=this.createSheen();J.materials[W].setExtension(LX,Q);let K=$.extensions[LX];if(K.sheenColorFactor!==void 0)Q.setSheenColorFactor(K.sheenColorFactor);if(K.sheenRoughnessFactor!==void 0)Q.setSheenRoughnessFactor(K.sheenRoughnessFactor);if(K.sheenColorTexture!==void 0){let G=K.sheenColorTexture,z=J.textures[Y[G.index].source];Q.setSheenColorTexture(z),J.setTextureInfo(Q.getSheenColorTextureInfo(),G)}if(K.sheenRoughnessTexture!==void 0){let G=K.sheenRoughnessTexture,z=J.textures[Y[G.index].source];Q.setSheenRoughnessTexture(z),J.setTextureInfo(Q.getSheenRoughnessTextureInfo(),G)}}}),this}prewrite(J){let Z=J.jsonDoc;return this.document.getRoot().listMaterials().forEach((X)=>{let Y=X.getExtension(LX);if(Y){let $=J.materialIndexMap.get(X),W=Z.json.materials[$];W.extensions=W.extensions||{};let Q=W.extensions[LX]={sheenColorFactor:Y.getSheenColorFactor(),sheenRoughnessFactor:Y.getSheenRoughnessFactor()};if(Y.getSheenColorTexture()){let K=Y.getSheenColorTexture(),G=Y.getSheenColorTextureInfo();Q.sheenColorTexture=J.createTextureInfoDef(K,G)}if(Y.getSheenRoughnessTexture()){let K=Y.getSheenRoughnessTexture(),G=Y.getSheenRoughnessTextureInfo();Q.sheenRoughnessTexture=J.createTextureInfoDef(K,G)}}}),this}}ZP.EXTENSION_NAME=LX;var{R:Eq1,G:Iq1,B:vq1,A:Sq1}=O5;class XP extends y1{init(){this.extensionName=xN,this.propertyType="Specular",this.parentTypes=[l.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{specularFactor:1,specularTexture:null,specularTextureInfo:new U1(this.graph,"specularTextureInfo"),specularColorFactor:[1,1,1],specularColorTexture:null,specularColorTextureInfo:new U1(this.graph,"specularColorTextureInfo")})}getSpecularFactor(){return this.get("specularFactor")}setSpecularFactor(J){return this.set("specularFactor",J)}getSpecularColorFactor(){return this.get("specularColorFactor")}setSpecularColorFactor(J){return this.set("specularColorFactor",J)}getSpecularTexture(){return this.getRef("specularTexture")}getSpecularTextureInfo(){return this.getRef("specularTexture")?this.getRef("specularTextureInfo"):null}setSpecularTexture(J){return this.setRef("specularTexture",J,{channels:Sq1})}getSpecularColorTexture(){return this.getRef("specularColorTexture")}getSpecularColorTextureInfo(){return this.getRef("specularColorTexture")?this.getRef("specularColorTextureInfo"):null}setSpecularColorTexture(J){return this.setRef("specularColorTexture",J,{channels:Eq1|Iq1|vq1,isColor:!0})}}XP.EXTENSION_NAME=xN;var BX=xN;class UU extends M1{constructor(...J){super(...J);this.extensionName=BX,this.prereadTypes=[l.MESH],this.prewriteTypes=[l.MESH]}createSpecular(){return new XP(this.document.getGraph())}read(J){return this}write(J){return this}preread(J){let Z=J.jsonDoc,X=Z.json.materials||[],Y=Z.json.textures||[];return X.forEach(($,W)=>{if($.extensions&&$.extensions[BX]){let Q=this.createSpecular();J.materials[W].setExtension(BX,Q);let K=$.extensions[BX];if(K.specularFactor!==void 0)Q.setSpecularFactor(K.specularFactor);if(K.specularColorFactor!==void 0)Q.setSpecularColorFactor(K.specularColorFactor);if(K.specularTexture!==void 0){let G=K.specularTexture,z=J.textures[Y[G.index].source];Q.setSpecularTexture(z),J.setTextureInfo(Q.getSpecularTextureInfo(),G)}if(K.specularColorTexture!==void 0){let G=K.specularColorTexture,z=J.textures[Y[G.index].source];Q.setSpecularColorTexture(z),J.setTextureInfo(Q.getSpecularColorTextureInfo(),G)}}}),this}prewrite(J){let Z=J.jsonDoc;return this.document.getRoot().listMaterials().forEach((X)=>{let Y=X.getExtension(BX);if(Y){let $=J.materialIndexMap.get(X),W=Z.json.materials[$];W.extensions=W.extensions||{};let Q=W.extensions[BX]={};if(Y.getSpecularFactor()!==1)Q.specularFactor=Y.getSpecularFactor();if(!s1.eq(Y.getSpecularColorFactor(),[1,1,1]))Q.specularColorFactor=Y.getSpecularColorFactor();if(Y.getSpecularTexture()){let K=Y.getSpecularTexture(),G=Y.getSpecularTextureInfo();Q.specularTexture=J.createTextureInfoDef(K,G)}if(Y.getSpecularColorTexture()){let K=Y.getSpecularColorTexture(),G=Y.getSpecularColorTextureInfo();Q.specularColorTexture=J.createTextureInfoDef(K,G)}}}),this}}UU.EXTENSION_NAME=BX;var{R:_q1}=O5;class YP extends y1{init(){this.extensionName=AN,this.propertyType="Transmission",this.parentTypes=[l.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{transmissionFactor:0,transmissionTexture:null,transmissionTextureInfo:new U1(this.graph,"transmissionTextureInfo")})}getTransmissionFactor(){return this.get("transmissionFactor")}setTransmissionFactor(J){return this.set("transmissionFactor",J)}getTransmissionTexture(){return this.getRef("transmissionTexture")}getTransmissionTextureInfo(){return this.getRef("transmissionTexture")?this.getRef("transmissionTextureInfo"):null}setTransmissionTexture(J){return this.setRef("transmissionTexture",J,{channels:_q1})}}YP.EXTENSION_NAME=AN;var jX=AN;class $P extends M1{constructor(...J){super(...J);this.extensionName=jX,this.prereadTypes=[l.MESH],this.prewriteTypes=[l.MESH]}createTransmission(){return new YP(this.document.getGraph())}read(J){return this}write(J){return this}preread(J){let Z=J.jsonDoc,X=Z.json.materials||[],Y=Z.json.textures||[];return X.forEach(($,W)=>{if($.extensions&&$.extensions[jX]){let Q=this.createTransmission();J.materials[W].setExtension(jX,Q);let K=$.extensions[jX];if(K.transmissionFactor!==void 0)Q.setTransmissionFactor(K.transmissionFactor);if(K.transmissionTexture!==void 0){let G=K.transmissionTexture,z=J.textures[Y[G.index].source];Q.setTransmissionTexture(z),J.setTextureInfo(Q.getTransmissionTextureInfo(),G)}}}),this}prewrite(J){let Z=J.jsonDoc;return this.document.getRoot().listMaterials().forEach((X)=>{let Y=X.getExtension(jX);if(Y){let $=J.materialIndexMap.get(X),W=Z.json.materials[$];W.extensions=W.extensions||{};let Q=W.extensions[jX]={transmissionFactor:Y.getTransmissionFactor()};if(Y.getTransmissionTexture()){let K=Y.getTransmissionTexture(),G=Y.getTransmissionTextureInfo();Q.transmissionTexture=J.createTextureInfoDef(K,G)}}}),this}}$P.EXTENSION_NAME=jX;class WP extends y1{init(){this.extensionName=hN,this.propertyType="Unlit",this.parentTypes=[l.MATERIAL]}}WP.EXTENSION_NAME=hN;var p$=hN;class wU extends M1{constructor(...J){super(...J);this.extensionName=p$,this.prereadTypes=[l.MESH],this.prewriteTypes=[l.MESH]}createUnlit(){return new WP(this.document.getGraph())}read(J){return this}write(J){return this}preread(J){return(J.jsonDoc.json.materials||[]).forEach((X,Y)=>{if(X.extensions&&X.extensions[p$])J.materials[Y].setExtension(p$,this.createUnlit())}),this}prewrite(J){let Z=J.jsonDoc;return this.document.getRoot().listMaterials().forEach((X)=>{if(X.getExtension(p$)){let Y=J.materialIndexMap.get(X),$=Z.json.materials[Y];$.extensions=$.extensions||{},$.extensions[p$]={}}}),this}}wU.EXTENSION_NAME=p$;class QP extends y1{init(){this.extensionName=RX,this.propertyType="Mapping",this.parentTypes=["MappingList"]}getDefaults(){return Object.assign(super.getDefaults(),{material:null,variants:new w0})}getMaterial(){return this.getRef("material")}setMaterial(J){return this.setRef("material",J)}addVariant(J){return this.addRef("variants",J)}removeVariant(J){return this.removeRef("variants",J)}listVariants(){return this.listRefs("variants")}}QP.EXTENSION_NAME=RX;class KP extends y1{init(){this.extensionName=RX,this.propertyType="MappingList",this.parentTypes=[l.PRIMITIVE]}getDefaults(){return Object.assign(super.getDefaults(),{mappings:new w0})}addMapping(J){return this.addRef("mappings",J)}removeMapping(J){return this.removeRef("mappings",J)}listMappings(){return this.listRefs("mappings")}}KP.EXTENSION_NAME=RX;class GU extends y1{init(){this.extensionName=RX,this.propertyType="Variant",this.parentTypes=["MappingList"]}}GU.EXTENSION_NAME=RX;var B4=RX;class GP extends M1{constructor(...J){super(...J);this.extensionName=B4}createMappingList(){return new KP(this.document.getGraph())}createVariant(J=""){return new GU(this.document.getGraph(),J)}createMapping(){return new QP(this.document.getGraph())}listVariants(){return Array.from(this.properties).filter((J)=>J instanceof GU)}read(J){let Z=J.jsonDoc;if(!Z.json.extensions||!Z.json.extensions[B4])return this;let $=(Z.json.extensions[B4].variants||[]).map((Q)=>this.createVariant().setName(Q.name||""));return(Z.json.meshes||[]).forEach((Q,K)=>{let G=J.meshes[K];(Q.primitives||[]).forEach((F,H)=>{if(!F.extensions||!F.extensions[B4])return;let q=this.createMappingList(),V=F.extensions[B4];for(let U of V.mappings){let L=this.createMapping();if(U.material!==void 0)L.setMaterial(J.materials[U.material]);for(let w of U.variants||[])L.addVariant($[w]);q.addMapping(L)}G.listPrimitives()[H].setExtension(B4,q)})}),this}write(J){let Z=J.jsonDoc,X=this.listVariants();if(!X.length)return this;let Y=[],$=new Map;for(let W of X)$.set(W,Y.length),Y.push(J.createPropertyDef(W));for(let W of this.document.getRoot().listMeshes()){let Q=J.meshIndexMap.get(W);W.listPrimitives().forEach((K,G)=>{let z=K.getExtension(B4);if(!z)return;let F=J.jsonDoc.json.meshes[Q].primitives[G],H=z.listMappings().map((q)=>{let V=J.createPropertyDef(q),U=q.getMaterial();if(U)V.material=J.materialIndexMap.get(U);return V.variants=q.listVariants().map((L)=>$.get(L)),V});F.extensions=F.extensions||{},F.extensions[B4]={mappings:H}})}return Z.json.extensions=Z.json.extensions||{},Z.json.extensions[B4]={variants:Y},this}}GP.EXTENSION_NAME=B4;var{G:xq1}=O5;class zP extends y1{init(){this.extensionName=yN,this.propertyType="Volume",this.parentTypes=[l.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{thicknessFactor:0,thicknessTexture:null,thicknessTextureInfo:new U1(this.graph,"thicknessTexture"),attenuationDistance:1/0,attenuationColor:[1,1,1]})}getThicknessFactor(){return this.get("thicknessFactor")}setThicknessFactor(J){return this.set("thicknessFactor",J)}getThicknessTexture(){return this.getRef("thicknessTexture")}getThicknessTextureInfo(){return this.getRef("thicknessTexture")?this.getRef("thicknessTextureInfo"):null}setThicknessTexture(J){return this.setRef("thicknessTexture",J,{channels:xq1})}getAttenuationDistance(){return this.get("attenuationDistance")}setAttenuationDistance(J){return this.set("attenuationDistance",J)}getAttenuationColor(){return this.get("attenuationColor")}setAttenuationColor(J){return this.set("attenuationColor",J)}}zP.EXTENSION_NAME=yN;var OX=yN;class FP extends M1{constructor(...J){super(...J);this.extensionName=OX,this.prereadTypes=[l.MESH],this.prewriteTypes=[l.MESH]}createVolume(){return new zP(this.document.getGraph())}read(J){return this}write(J){return this}preread(J){let Z=J.jsonDoc,X=Z.json.materials||[],Y=Z.json.textures||[];return X.forEach(($,W)=>{if($.extensions&&$.extensions[OX]){let Q=this.createVolume();J.materials[W].setExtension(OX,Q);let K=$.extensions[OX];if(K.thicknessFactor!==void 0)Q.setThicknessFactor(K.thicknessFactor);if(K.attenuationDistance!==void 0)Q.setAttenuationDistance(K.attenuationDistance);if(K.attenuationColor!==void 0)Q.setAttenuationColor(K.attenuationColor);if(K.thicknessTexture!==void 0){let G=K.thicknessTexture,z=J.textures[Y[G.index].source];Q.setThicknessTexture(z),J.setTextureInfo(Q.getThicknessTextureInfo(),G)}}}),this}prewrite(J){let Z=J.jsonDoc;return this.document.getRoot().listMaterials().forEach((X)=>{let Y=X.getExtension(OX);if(Y){let $=J.materialIndexMap.get(X),W=Z.json.materials[$];W.extensions=W.extensions||{};let Q=W.extensions[OX]={};if(Y.getThicknessFactor()>0)Q.thicknessFactor=Y.getThicknessFactor();if(Number.isFinite(Y.getAttenuationDistance()))Q.attenuationDistance=Y.getAttenuationDistance();if(!s1.eq(Y.getAttenuationColor(),[1,1,1]))Q.attenuationColor=Y.getAttenuationColor();if(Y.getThicknessTexture()){let K=Y.getThicknessTexture(),G=Y.getThicknessTextureInfo();Q.thicknessTexture=J.createTextureInfoDef(K,G)}}}),this}}FP.EXTENSION_NAME=OX;var hl=aH1;class MG extends M1{constructor(...J){super(...J);this.extensionName=hl}read(J){return this}write(J){return this}}MG.EXTENSION_NAME=hl;var wG=sH1;class yl{match(J){return J[0]===171&&J[1]===75&&J[2]===84&&J[3]===88&&J[4]===32&&J[5]===50&&J[6]===48&&J[7]===187&&J[8]===13&&J[9]===10&&J[10]===26&&J[11]===10}getSize(J){let Z=WU(J);return[Z.pixelWidth,Z.pixelHeight]}getChannels(J){let X=WU(J).dataFormatDescriptor[0];if(X.colorModel===Vl)return X.samples.length===2&&(X.samples[1].channelType&15)===15?4:3;else if(X.colorModel===Ul)return(X.samples[0].channelType&15)===3?4:3;throw new Error(`Unexpected KTX2 colorModel, "${X.colorModel}".`)}getVRAMByteLength(J){let Z=WU(J),X=this.getChannels(J)>3,Y=0;for(let $=0;$<Z.levels.length;$++){let W=Z.levels[$];if(W.uncompressedByteLength)Y+=W.uncompressedByteLength;else{let Q=Math.max(1,Math.floor(Z.pixelWidth/Math.pow(2,$))),K=Math.max(1,Math.floor(Z.pixelHeight/Math.pow(2,$))),G=X?16:8;Y+=Q/4*(K/4)*G}}return Y}}class HP extends M1{constructor(...J){super(...J);this.extensionName=wG,this.prereadTypes=[l.TEXTURE]}static register(){I9.registerFormat("image/ktx2",new yl)}preread(J){return J.jsonDoc.json.textures.forEach((Z)=>{if(Z.extensions&&Z.extensions[wG]){let X=Z.extensions[wG];Z.source=X.source}}),this}read(J){return this}write(J){let Z=J.jsonDoc;return this.document.getRoot().listTextures().forEach((X)=>{if(X.getMimeType()==="image/ktx2"){let Y=J.imageIndexMap.get(X);Z.json.textures.forEach(($)=>{if($.source===Y)$.extensions=$.extensions||{},$.extensions[wG]={source:$.source},delete $.source})}}),this}}HP.EXTENSION_NAME=wG;class qP extends y1{init(){this.extensionName=fN,this.propertyType="Transform",this.parentTypes=[l.TEXTURE_INFO]}getDefaults(){return Object.assign(super.getDefaults(),{offset:[0,0],rotation:0,scale:[1,1],texCoord:null})}getOffset(){return this.get("offset")}setOffset(J){return this.set("offset",J)}getRotation(){return this.get("rotation")}setRotation(J){return this.set("rotation",J)}getScale(){return this.get("scale")}setScale(J){return this.set("scale",J)}getTexCoord(){return this.get("texCoord")}setTexCoord(J){return this.set("texCoord",J)}}qP.EXTENSION_NAME=fN;var MX=fN;class VP extends M1{constructor(...J){super(...J);this.extensionName=MX}createTransform(){return new qP(this.document.getGraph())}read(J){for(let[Z,X]of Array.from(J.textureInfos.entries())){if(!X.extensions||!X.extensions[MX])continue;let Y=this.createTransform(),$=X.extensions[MX];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);Z.setExtension(MX,Y)}return this}write(J){let Z=Array.from(J.textureInfoDefMap.entries());for(let[X,Y]of Z){let $=X.getExtension(MX);if(!$)continue;Y.extensions=Y.extensions||{};let W={},Q=s1.eq;if(!Q($.getOffset(),[0,0]))W.offset=$.getOffset();if($.getRotation()!==0)W.rotation=$.getRotation();if(!Q($.getScale(),[1,1]))W.scale=$.getScale();if($.getTexCoord()!=null)W.texCoord=$.getTexCoord();Y.extensions[MX]=W}return this}}VP.EXTENSION_NAME=MX;var Aq1=[l.ROOT,l.SCENE,l.NODE,l.MESH,l.MATERIAL,l.TEXTURE,l.ANIMATION];class UP extends y1{init(){this.extensionName=QU,this.propertyType="Packet",this.parentTypes=Aq1}getDefaults(){return Object.assign(super.getDefaults(),{context:{},properties:{}})}getContext(){return this.get("context")}setContext(J){return this.set("context",B7({},J))}listProperties(){return Object.keys(this.get("properties"))}getProperty(J){let Z=this.get("properties");return J in Z?Z[J]:null}setProperty(J,Z){this._assertContext(J);let X=B7({},this.get("properties"));if(Z)X[J]=Z;else delete X[J];return this.set("properties",X)}toJSONLD(){let J=jN(this.get("context")),Z=jN(this.get("properties"));return B7({"@context":J},Z)}fromJSONLD(J){J=jN(J);let Z=J["@context"];if(Z)this.set("context",Z);return delete J["@context"],this.set("properties",J)}_assertContext(J){if(!(J.split(":")[0]in this.get("context")))throw new Error(`${QU}: Missing context for term, "${J}".`)}}UP.EXTENSION_NAME=QU;function jN(J){return JSON.parse(JSON.stringify(J))}var L7=QU;class wP extends M1{constructor(...J){super(...J);this.extensionName=L7}createPacket(){return new UP(this.document.getGraph())}listPackets(){return Array.from(this.properties)}read(J){var Z;let X=(Z=J.jsonDoc.json.extensions)==null?void 0:Z[L7];if(!X||!X.packets)return this;let Y=J.jsonDoc.json,$=this.document.getRoot(),W=X.packets.map((G)=>this.createPacket().fromJSONLD(G)),Q=[[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<Q.length;G++){let z=Q[G]||[];for(let F=0;F<z.length;F++){let H=z[F];if(H.extensions&&H.extensions[L7]){let q=H.extensions[L7];K[G][F].setExtension(L7,W[q.packet])}}}return this}write(J){let{json:Z}=J.jsonDoc,X=[];for(let Y of this.properties){X.push(Y.toJSONLD());for(let $ of Y.listParents()){let W;switch($.propertyType){case l.ROOT:W=Z.asset;break;case l.SCENE:W=Z.scenes[J.sceneIndexMap.get($)];break;case l.NODE:W=Z.nodes[J.nodeIndexMap.get($)];break;case l.MESH:W=Z.meshes[J.meshIndexMap.get($)];break;case l.MATERIAL:W=Z.materials[J.materialIndexMap.get($)];break;case l.TEXTURE:W=Z.images[J.imageIndexMap.get($)];break;case l.ANIMATION:W=Z.animations[J.animationIndexMap.get($)];break;default:W=null,this.document.getLogger().warn(`[${L7}]: Unsupported parent property, "${$.propertyType}"`);break}if(!W)continue;W.extensions=W.extensions||{},W.extensions[L7]={packet:X.length-1}}}if(X.length>0)Z.extensions=Z.extensions||{},Z.extensions[L7]={packets:X};return this}}wP.EXTENSION_NAME=L7;var hq1=[OG,gN,dN,cN,pN,nN,sN,qU,tN,VU,UU,ZP,$P,wU,GP,FP,MG,HP,VP,wP],rW6=[zU,jG,FU,HU,...hq1];var yq1=i(SR(),1);function o$(){return o$=Object.assign?Object.assign.bind():function(J){for(var Z=1;Z<arguments.length;Z++){var X=arguments[Z];for(var Y in X)({}).hasOwnProperty.call(X,Y)&&(J[Y]=X[Y])}return J},o$.apply(null,arguments)}var{POINTS:fl,LINES:LU,LINE_STRIP:fq1,LINE_LOOP:bq1,TRIANGLES:BU,TRIANGLE_STRIP:gq1,TRIANGLE_FAN:mq1}=K8.Mode;function PJ(J,Z){return Object.defineProperty(Z,"name",{value:J}),Z}function j4(J,Z){let X=o$({},J);for(let Y in Z)if(Z[Y]!==void 0)X[Y]=Z[Y];return X}function Yp(J){let Z=J.getIndices(),X=J.getAttribute("POSITION");switch(J.getMode()){case K8.Mode.POINTS:return Z?Z.getCount():X.getCount();case K8.Mode.LINES:return Z?Z.getCount()/2:X.getCount()/2;case K8.Mode.LINE_LOOP:return Z?Z.getCount():X.getCount();case K8.Mode.LINE_STRIP:return Z?Z.getCount()-1:X.getCount()-1;case K8.Mode.TRIANGLES:return Z?Z.getCount()/3:X.getCount()/3;case K8.Mode.TRIANGLE_STRIP:case K8.Mode.TRIANGLE_FAN:return Z?Z.getCount()-2:X.getCount()-2;default:throw new Error("Unexpected mode: "+J.getMode())}}var dq1=new Intl.NumberFormat(void 0,{maximumFractionDigits:0});function OP(J){return dq1.format(J)}function uq1(J,Z,X=2){let Y=J>Z?"\u2013":"+",$="%";return Y+(Math.abs(J-Z)/J*100).toFixed(X)+"%"}function NU(J,Z){return`${OP(J)} \u2192 ${OP(Z)} (${uq1(J,Z)})`}function TP(J){let Z=[];for(let X of J.listAttributes())Z.push(X);for(let X of J.listTargets())for(let Y of X.listAttributes())Z.push(Y);return Array.from(new Set(Z))}function cq1(J,Z,X){J.swap(Z,X);for(let Y of J.listTargets())Y.swap(Z,X)}function lq1(J,Z){if(J==null&&Z==null)return!0;if(J==null||Z==null)return!1;if(J.length!==Z.length)return!1;for(let X=0;X<J.length;X++)if(J[X]!==Z[X])return!1;return!0}function j7(J,Z){return J.createAccessor(Z.getName()).setArray(Z.getArray()).setType(Z.getType()).setBuffer(Z.getBuffer()).setNormalized(Z.getNormalized()).setSparse(Z.getSparse())}function pq1(J,Z=J){let X=kP(J,Z);for(let Y=0;Y<X.length;Y++)X[Y]=Y;return X}function kP(J,Z=J){return Z<=65534?new Uint16Array(J):new Uint32Array(J)}function iq1(J){return J.listParents().some((Z)=>Z.propertyType!==c.ROOT)}function $p(J){for(let Z in J)return!1;return!0}function Wp(J){let Z=Z6.fromGraph(J.getGraph()),X=J.getMaterial(),Y=Z.getRoot().listMaterials().indexOf(X),$=aq1[J.getMode()],W=!!J.getIndices(),Q=J.listSemantics().sort().map((G)=>{let z=J.getAttribute(G),F=z.getElementSize(),H=z.getComponentType();return`${G}:${F}:${H}`}).join("+"),K=J.listTargets().map((G)=>{return G.listSemantics().sort().map((z)=>{let F=J.getAttribute(z),H=F.getElementSize(),q=F.getComponentType();return`${z}:${H}:${q}`}).join("+")}).join("~");return`${Y}|${$}|${W}|${Q}|${K}`}function nq1(J){return Math.pow(2,Math.ceil(Math.log(J)/Math.LN2))}var aq1={[fl]:fl,[LU]:LU,[fq1]:LU,[bq1]:LU,[BU]:BU,[gq1]:BU,[mq1]:BU},a$="center",bl={pivot:"center"};function Qp(J=bl){let Z=j4(bl,J);return PJ(a$,(X)=>{let Y=X.getLogger(),$=X.getRoot(),W=$.listAnimations().length>0||$.listSkins().length>0;X.getRoot().listScenes().forEach((Q,K)=>{Y.debug(`${a$}: Scene ${K+1} / ${$.listScenes().length}.`);let G;if(typeof Z.pivot==="string"){let F=DR(Q);if(G=[(F.max[0]-F.min[0])/2+F.min[0],(F.max[1]-F.min[1])/2+F.min[1],(F.max[2]-F.min[2])/2+F.min[2]],Z.pivot==="above")G[1]=F.max[1];if(Z.pivot==="below")G[1]=F.min[1]}else G=Z.pivot;Y.debug(`${a$}: Pivot "${G.join(", ")}".`);let z=[-1*G[0],-1*G[1],-1*G[2]];if(W){Y.debug(`${a$}: Model contains animation or skin. Adding a wrapper node.`);let F=X.createNode("Pivot").setTranslation(z);Q.listChildren().forEach((H)=>F.addChild(H)),Q.addChild(F)}else Y.debug(`${a$}: Skipping wrapper, offsetting all root nodes.`),Q.listChildren().forEach((F)=>{let H=F.getTranslation();F.setTranslation([H[0]+z[0],H[1]+z[1],H[2]+z[2]])})}),Y.debug(`${a$}: Complete.`)})}function sq1(J){let Z=new Set,X=J,Y;while(Y=X.getParentNode()){if(Z.has(Y))throw new Error("Circular dependency in scene graph.");Z.add(Y),X=Y}return X.listParents().filter(($)=>$ instanceof x$)}function oq1(J){let Z=sq1(J),X=J.getParentNode();if(!X)return J;J.setMatrix(J.getWorldMatrix()),X.removeChild(J);for(let Y of Z)Y.addChild(J);return J}var r$=typeof Float32Array!=="undefined"?Float32Array:Array;if(!Math.hypot)Math.hypot=function(){var J=0,Z=arguments.length;while(Z--)J+=arguments[Z]*arguments[Z];return Math.sqrt(J)};function rq1(J,Z){var X=Z[0],Y=Z[1],$=Z[2],W=Z[3],Q=Z[4],K=Z[5],G=Z[6],z=Z[7],F=Z[8],H=Z[9],q=Z[10],V=Z[11],U=Z[12],L=Z[13],w=Z[14],j=Z[15],M=X*K-Y*Q,R=X*G-$*Q,N=X*z-W*Q,D=Y*G-$*K,P=Y*z-W*K,C=$*z-W*G,k=F*L-H*U,I=F*w-q*U,A=F*j-V*U,v=H*w-q*L,x=H*j-V*L,d=q*j-V*w,h=M*d-R*x+N*v+D*A-P*I+C*k;if(!h)return null;return h=1/h,J[0]=(K*d-G*x+z*v)*h,J[1]=($*x-Y*d-W*v)*h,J[2]=(L*C-w*P+j*D)*h,J[3]=(q*P-H*C-V*D)*h,J[4]=(G*A-Q*d-z*I)*h,J[5]=(X*d-$*A+W*I)*h,J[6]=(w*N-U*C-j*R)*h,J[7]=(F*C-q*N+V*R)*h,J[8]=(Q*x-K*A+z*k)*h,J[9]=(Y*A-X*x-W*k)*h,J[10]=(U*P-L*N+j*M)*h,J[11]=(H*N-F*P-V*M)*h,J[12]=(K*I-Q*v-G*k)*h,J[13]=(X*v-Y*I+$*k)*h,J[14]=(L*R-U*D-w*M)*h,J[15]=(F*D-H*R+q*M)*h,J}function tq1(J){var Z=J[0],X=J[1],Y=J[2],$=J[3],W=J[4],Q=J[5],K=J[6],G=J[7],z=J[8],F=J[9],H=J[10],q=J[11],V=J[12],U=J[13],L=J[14],w=J[15],j=Z*Q-X*W,M=Z*K-Y*W,R=Z*G-$*W,N=X*K-Y*Q,D=X*G-$*Q,P=Y*G-$*K,C=z*U-F*V,k=z*L-H*V,I=z*w-q*V,A=F*L-H*U,v=F*w-q*U,x=H*w-q*L;return j*x-M*v+R*A+N*I-D*k+P*C}function Kp(J,Z,X){var Y=Z[0],$=Z[1],W=Z[2],Q=Z[3],K=Z[4],G=Z[5],z=Z[6],F=Z[7],H=Z[8],q=Z[9],V=Z[10],U=Z[11],L=Z[12],w=Z[13],j=Z[14],M=Z[15],R=X[0],N=X[1],D=X[2],P=X[3];return J[0]=R*Y+N*K+D*H+P*L,J[1]=R*$+N*G+D*q+P*w,J[2]=R*W+N*z+D*V+P*j,J[3]=R*Q+N*F+D*U+P*M,R=X[4],N=X[5],D=X[6],P=X[7],J[4]=R*Y+N*K+D*H+P*L,J[5]=R*$+N*G+D*q+P*w,J[6]=R*W+N*z+D*V+P*j,J[7]=R*Q+N*F+D*U+P*M,R=X[8],N=X[9],D=X[10],P=X[11],J[8]=R*Y+N*K+D*H+P*L,J[9]=R*$+N*G+D*q+P*w,J[10]=R*W+N*z+D*V+P*j,J[11]=R*Q+N*F+D*U+P*M,R=X[12],N=X[13],D=X[14],P=X[15],J[12]=R*Y+N*K+D*H+P*L,J[13]=R*$+N*G+D*q+P*w,J[14]=R*W+N*z+D*V+P*j,J[15]=R*Q+N*F+D*U+P*M,J}function eq1(){var J=new r$(9);if(r$!=Float32Array)J[1]=0,J[2]=0,J[3]=0,J[5]=0,J[6]=0,J[7]=0;return J[0]=1,J[4]=1,J[8]=1,J}function JV1(J,Z){return J[0]=Z[0],J[1]=Z[1],J[2]=Z[2],J[3]=Z[4],J[4]=Z[5],J[5]=Z[6],J[6]=Z[8],J[7]=Z[9],J[8]=Z[10],J}function ZV1(J,Z){if(J===Z){var X=Z[1],Y=Z[2],$=Z[5];J[1]=Z[3],J[2]=Z[6],J[3]=X,J[5]=Z[7],J[6]=Y,J[7]=$}else J[0]=Z[0],J[1]=Z[3],J[2]=Z[6],J[3]=Z[1],J[4]=Z[4],J[5]=Z[7],J[6]=Z[2],J[7]=Z[5],J[8]=Z[8];return J}function XV1(J,Z){var X=Z[0],Y=Z[1],$=Z[2],W=Z[3],Q=Z[4],K=Z[5],G=Z[6],z=Z[7],F=Z[8],H=F*Q-K*z,q=-F*W+K*G,V=z*W-Q*G,U=X*H+Y*q+$*V;if(!U)return null;return U=1/U,J[0]=H*U,J[1]=(-F*Y+$*z)*U,J[2]=(K*Y-$*Q)*U,J[3]=q*U,J[4]=(F*X-$*G)*U,J[5]=(-K*X+$*W)*U,J[6]=V*U,J[7]=(-z*X+Y*G)*U,J[8]=(Q*X-Y*W)*U,J}function PU(){var J=new r$(3);if(r$!=Float32Array)J[0]=0,J[1]=0,J[2]=0;return J}function YV1(J,Z,X){return J[0]=Z[0]*X[0],J[1]=Z[1]*X[1],J[2]=Z[2]*X[2],J}function Gp(J,Z){var X=Z[0],Y=Z[1],$=Z[2],W=X*X+Y*Y+$*$;if(W>0)W=1/Math.sqrt(W);return J[0]=Z[0]*W,J[1]=Z[1]*W,J[2]=Z[2]*W,J}function $V1(J,Z,X){var Y=Z[0],$=Z[1],W=Z[2],Q=X[3]*Y+X[7]*$+X[11]*W+X[15];return Q=Q||1,J[0]=(X[0]*Y+X[4]*$+X[8]*W+X[12])/Q,J[1]=(X[1]*Y+X[5]*$+X[9]*W+X[13])/Q,J[2]=(X[2]*Y+X[6]*$+X[10]*W+X[14])/Q,J}function WV1(J,Z,X){var Y=Z[0],$=Z[1],W=Z[2];return J[0]=Y*X[0]+$*X[3]+W*X[6],J[1]=Y*X[1]+$*X[4]+W*X[7],J[2]=Y*X[2]+$*X[5]+W*X[8],J}var QV1=YV1;(function(){var J=PU();return function(Z,X,Y,$,W,Q){var K,G;if(!X)X=3;if(!Y)Y=0;if($)G=Math.min($*X+Y,Z.length);else G=Z.length;for(K=Y;K<G;K+=X)J[0]=Z[K],J[1]=Z[K+1],J[2]=Z[K+2],W(J,J,Q),Z[K]=J[0],Z[K+1]=J[1],Z[K+2]=J[2];return Z}})();var RJ="dedup",LP={keepUniqueNames:!1,propertyTypes:[c.ACCESSOR,c.MESH,c.TEXTURE,c.MATERIAL,c.SKIN]};function zp(J=LP){let Z=j4(LP,J),X=new Set(Z.propertyTypes);for(let Y of Z.propertyTypes)if(!LP.propertyTypes.includes(Y))throw new Error(`${RJ}: Unsupported deduplication on type "${Y}".`);return PJ(RJ,(Y)=>{let $=Y.getLogger();if(X.has(c.ACCESSOR))KV1(Y);if(X.has(c.TEXTURE))zV1(Y,Z);if(X.has(c.MATERIAL))FV1(Y,Z);if(X.has(c.MESH))GV1(Y,Z);if(X.has(c.SKIN))HV1(Y,Z);$.debug(`${RJ}: Complete.`)})}function KV1(J){let Z=J.getLogger(),X=new Map,Y=new Map,$=new Map,W=new Map,Q=J.getRoot().listMeshes();Q.forEach((H)=>{H.listPrimitives().forEach((q)=>{q.listAttributes().forEach((V)=>K(V,Y)),K(q.getIndices(),X)})});for(let H of J.getRoot().listAnimations())for(let q of H.listSamplers())K(q.getInput(),$),K(q.getOutput(),W);function K(H,q){if(!H)return;let V=[H.getCount(),H.getType(),H.getComponentType(),H.getNormalized(),H.getSparse()].join(":"),U=q.get(V);if(!U)q.set(V,U=new Set);U.add(H)}function G(H,q){for(let V=0;V<H.length;V++){let U=H[V],L=m0.toView(U.getArray());if(q.has(U))continue;for(let w=V+1;w<H.length;w++){let j=H[w];if(q.has(j))continue;if(m0.equals(L,m0.toView(j.getArray())))q.set(j,U)}}}let z=0,F=new Map;for(let H of[Y,X,$,W])for(let q of H.values())z+=q.size,G(Array.from(q),F);Z.debug(`${RJ}: Merged ${F.size} of ${z} accessors.`),Q.forEach((H)=>{H.listPrimitives().forEach((q)=>{q.listAttributes().forEach((U)=>{if(F.has(U))q.swap(U,F.get(U))});let V=q.getIndices();if(V&&F.has(V))q.swap(V,F.get(V))})});for(let H of J.getRoot().listAnimations())for(let q of H.listSamplers()){let V=q.getInput(),U=q.getOutput();if(V&&F.has(V))q.swap(V,F.get(V));if(U&&F.has(U))q.swap(U,F.get(U))}Array.from(F.keys()).forEach((H)=>H.dispose())}function GV1(J,Z){let X=J.getLogger(),Y=J.getRoot(),$=new Map;Y.listAccessors().forEach((K,G)=>$.set(K,G)),Y.listMaterials().forEach((K,G)=>$.set(K,G));let W=Y.listMeshes().length,Q=new Map;for(let K of Y.listMeshes()){let G=[];for(let F of K.listPrimitives())G.push(Fp(F,$));let z="";if(Z.keepUniqueNames)z+=K.getName()+";";if(z+=G.join(";"),Q.has(z)){let F=Q.get(z);K.listParents().forEach((H)=>{if(H.propertyType!==c.ROOT)H.swap(K,F)}),K.dispose()}else Q.set(z,K)}X.debug(`${RJ}: Merged ${W-Q.size} of ${W} meshes.`)}function zV1(J,Z){let X=J.getLogger(),Y=J.getRoot(),$=Y.listTextures(),W=new Map;for(let Q=0;Q<$.length;Q++){let K=$[Q],G=K.getImage();if(W.has(K))continue;for(let z=Q+1;z<$.length;z++){let F=$[z],H=F.getImage();if(W.has(F))continue;if(K.getMimeType()!==F.getMimeType())continue;if(Z.keepUniqueNames&&K.getName()!==F.getName())continue;let q=K.getSize(),V=F.getSize();if(!q||!V)continue;if(q[0]!==V[0])continue;if(q[1]!==V[1])continue;if(!G||!H)continue;if(m0.equals(G,H))W.set(F,K)}}X.debug(`${RJ}: Merged ${W.size} of ${Y.listTextures().length} textures.`),Array.from(W.entries()).forEach(([Q,K])=>{Q.listParents().forEach((G)=>{if(!(G instanceof XX))G.swap(Q,K)}),Q.dispose()})}function FV1(J,Z){let X=J.getLogger(),$=J.getRoot().listMaterials(),W=new Map,Q=new Map,K=new Set;if(!Z.keepUniqueNames)K.add("name");for(let G=0;G<$.length;G++){let z=$[G];if(W.has(z))continue;if(gl(z,Q))continue;for(let F=G+1;F<$.length;F++){let H=$[F];if(W.has(H))continue;if(gl(H,Q))continue;if(z.equals(H,K))W.set(H,z)}}X.debug(`${RJ}: Merged ${W.size} of ${$.length} materials.`),Array.from(W.entries()).forEach(([G,z])=>{G.listParents().forEach((F)=>{if(!(F instanceof XX))F.swap(G,z)}),G.dispose()})}function HV1(J,Z){let X=J.getLogger(),$=J.getRoot().listSkins(),W=new Map,Q=new Set(["joints"]);if(!Z.keepUniqueNames)Q.add("name");for(let K=0;K<$.length;K++){let G=$[K];if(W.has(G))continue;for(let z=K+1;z<$.length;z++){let F=$[z];if(W.has(F))continue;if(G.equals(F,Q)&&lq1(G.listJoints(),F.listJoints()))W.set(F,G)}}X.debug(`${RJ}: Merged ${W.size} of ${$.length} skins.`),Array.from(W.entries()).forEach(([K,G])=>{K.listParents().forEach((z)=>{if(!(z instanceof XX))z.swap(K,G)}),K.dispose()})}function Fp(J,Z){let X=[];for(let Y of J.listSemantics()){let $=J.getAttribute(Y);X.push(Y+":"+Z.get($))}if(J instanceof K8){let Y=J.getIndices();if(Y)X.push("indices:"+Z.get(Y));let $=J.getMaterial();if($)X.push("material:"+Z.get($));X.push("mode:"+J.getMode());for(let W of J.listTargets())X.push("target:"+Fp(W,Z))}return X.join(",")}function gl(J,Z){if(Z.has(J))return Z.get(J);let X=J.getGraph(),Y=new Set,$=X.listParentEdges(J);while($.length>0){let W=$.pop();if(W.getAttributes().modifyChild===!0)return Z.set(J,!0),!0;let Q=W.getChild();if(Y.has(Q))continue;for(let K of X.listChildEdges(Q))$.push(K)}return Z.set(J,!1),!1}function Hp(){var J=new r$(4);if(r$!=Float32Array)J[0]=0,J[1]=0,J[2]=0,J[3]=0;return J}function qV1(J,Z,X){return J[0]=Z[0]+X[0],J[1]=Z[1]+X[1],J[2]=Z[2]+X[2],J[3]=Z[3]+X[3],J}function VV1(J,Z,X){return J[0]=Z[0]-X[0],J[1]=Z[1]-X[1],J[2]=Z[2]-X[2],J[3]=Z[3]-X[3],J}function UV1(J,Z,X){return J[0]=Z[0]*X[0],J[1]=Z[1]*X[1],J[2]=Z[2]*X[2],J[3]=Z[3]*X[3],J}function wV1(J,Z,X){return J[0]=Z[0]*X,J[1]=Z[1]*X,J[2]=Z[2]*X,J[3]=Z[3]*X,J}function LV1(J){var Z=J[0],X=J[1],Y=J[2],$=J[3];return Math.hypot(Z,X,Y,$)}var qp=VV1,BV1=UV1,Vp=LV1;(function(){var J=Hp();return function(Z,X,Y,$,W,Q){var K,G;if(!X)X=4;if(!Y)Y=0;if($)G=Math.min($*X+Y,Z.length);else G=Z.length;for(K=Y;K<G;K+=X)J[0]=Z[K],J[1]=Z[K+1],J[2]=Z[K+2],J[3]=Z[K+3],W(J,J,Q),Z[K]=J[0],Z[K+1]=J[1],Z[K+2]=J[2],Z[K+3]=J[3];return Z}})();var jV1=/color|emissive|diffuse/i;function OV1(J){return J.getGraph().listParentEdges(J).some(($)=>{return $.getAttributes().isColor||jV1.test($.getName())})?"srgb":null}function MV1(J){let Z=J.getGraph(),X=new Set,Y=new Set;function $(W){let Q=new Set;for(let K of Z.listChildEdges(W))if(K.getChild()instanceof ZX)Q.add(K.getName()+"Info");for(let K of Z.listChildEdges(W)){let G=K.getChild();if(X.has(G))continue;if(X.add(G),G instanceof i6&&Q.has(K.getName()))Y.add(G);else if(G instanceof _$)$(G)}}return $(J),Array.from(Y)}function RV1(J){let X=Z6.fromGraph(J.getGraph()).getRoot(),Y=J.getGraph().listParentEdges(J).filter(($)=>$.getParent()!==X).map(($)=>$.getName());return Array.from(new Set(Y))}var s$="prune",MP=0.011764705882352941,ml={propertyTypes:[c.NODE,c.SKIN,c.MESH,c.CAMERA,c.PRIMITIVE,c.PRIMITIVE_TARGET,c.ANIMATION,c.MATERIAL,c.TEXTURE,c.ACCESSOR,c.BUFFER],keepLeaves:!1,keepAttributes:!1,keepIndices:!1,keepSolidTextures:!1,keepExtras:!1};function DU(J=ml){let Z=j4(ml,J),X=new Set(Z.propertyTypes),Y=Z.keepExtras;return PJ(s$,async($)=>{let W=$.getLogger(),Q=$.getRoot(),K=$.getGraph(),G=new Up,z=(F)=>G.dispose(F.target);if(K.addEventListener("node:dispose",z),X.has(c.MESH))for(let F of Q.listMeshes()){if(F.listPrimitives().length>0)continue;F.dispose()}if(X.has(c.NODE)){if(!Z.keepLeaves)for(let F of Q.listScenes())wp(K,F,Y);for(let F of Q.listNodes())g5(F,Y)}if(X.has(c.SKIN))for(let F of Q.listSkins())g5(F,Y);if(X.has(c.MESH))for(let F of Q.listMeshes())g5(F,Y);if(X.has(c.CAMERA))for(let F of Q.listCameras())g5(F,Y);if(X.has(c.PRIMITIVE))dl(K,c.PRIMITIVE,Y);if(X.has(c.PRIMITIVE_TARGET))dl(K,c.PRIMITIVE_TARGET,Y);if(!Z.keepAttributes&&X.has(c.ACCESSOR)){let F=new Map;for(let H of Q.listMeshes())for(let q of H.listPrimitives()){let V=q.getMaterial();if(!V)continue;let U=Lp($,q,V),L=PV1(q,U);ul(q,L),q.listTargets().forEach((w)=>ul(w,L)),F.has(V)?F.get(V).add(q):F.set(V,new Set([q]))}for(let[H,q]of F)DV1(H,Array.from(q))}if(!Z.keepIndices&&X.has(c.ACCESSOR))for(let F of Q.listMeshes())for(let H of F.listPrimitives())NV1(H);if(X.has(c.ANIMATION))for(let F of Q.listAnimations()){for(let H of F.listChannels())if(!H.getTargetNode())H.dispose();if(!F.listChannels().length){let H=F.listSamplers();g5(F,Y),H.forEach((q)=>g5(q,Y))}else F.listSamplers().forEach((H)=>g5(H,Y))}if(X.has(c.MATERIAL))Q.listMaterials().forEach((F)=>g5(F,Y));if(X.has(c.TEXTURE)){if(Q.listTextures().forEach((F)=>g5(F,Y)),!Z.keepSolidTextures)await CV1($)}if(X.has(c.ACCESSOR))Q.listAccessors().forEach((F)=>g5(F,Y));if(X.has(c.BUFFER))Q.listBuffers().forEach((F)=>g5(F,Y));if(K.removeEventListener("node:dispose",z),!G.empty()){let F=G.entries().map(([H,q])=>`${H} (${q})`).join(", ");W.info(`${s$}: Removed types... ${F}`)}else W.debug(`${s$}: No unused properties found.`);W.debug(`${s$}: Complete.`)})}class Up{constructor(){this.disposed={}}empty(){for(let J in this.disposed)return!1;return!0}entries(){return Object.entries(this.disposed)}dispose(J){this.disposed[J.propertyType]=this.disposed[J.propertyType]||0,this.disposed[J.propertyType]++}}function g5(J,Z){let X=J.listParents().filter(($)=>!($ instanceof XX||$ instanceof eZ)),Y=Z&&!$p(J.getExtras());if(!X.length&&!Y)J.dispose()}function dl(J,Z,X){for(let Y of J.listEdges()){let $=Y.getParent();if($.propertyType===Z)g5($,X)}}function wp(J,Z,X){if(Z.listChildren().forEach((Q)=>wp(J,Q,X)),Z instanceof x$)return;let Y=J.listParentEdges(Z).some((Q)=>{let K=Q.getParent().propertyType;return K!==c.ROOT&&K!==c.SCENE&&K!==c.NODE}),$=J.listChildren(Z).length===0,W=X&&!$p(Z.getExtras());if($&&!Y&&!W)Z.dispose()}function ul(J,Z){for(let X of Z)J.setAttribute(X,null)}function NV1(J){let Z=J.getIndices(),X=Z&&Z.getArray(),Y=J.listAttributes()[0];if(!X||!Y)return;if(Z.getCount()!==Y.getCount())return;for(let $=0,W=X.length;$<W;$++)if($!==X[$])return;J.setIndices(null)}function PV1(J,Z){let X=[];for(let Y of J.listSemantics())if(Y==="NORMAL"&&!Z.has(Y))X.push(Y);else if(Y==="TANGENT"&&!Z.has(Y))X.push(Y);else if(Y.startsWith("TEXCOORD_")&&!Z.has(Y))X.push(Y);else if(Y.startsWith("COLOR_")&&Y!=="COLOR_0")X.push(Y);return X}function Lp(J,Z,X,Y=new Set){let W=J.getGraph().listChildEdges(X),Q=new Set;for(let z of W)if(z.getChild()instanceof ZX)Q.add(z.getName());for(let z of W){let F=z.getName(),H=z.getChild();if(H instanceof i6){if(Q.has(F.replace(/Info$/,"")))Y.add(`TEXCOORD_${H.getTexCoord()}`)}if(H instanceof ZX&&F.match(/normalTexture/i))Y.add("TANGENT");if(H instanceof _$)Lp(J,Z,H,Y)}let K=X instanceof z4&&!X.getExtension("KHR_materials_unlit"),G=Z.getMode()===K8.Mode.POINTS;if(K&&!G)Y.add("NORMAL");return Y}function DV1(J,Z){let X=MV1(J),Y=new Set(X.map((G)=>G.getTexCoord())),$=Array.from(Y).sort(),W=new Map($.map((G,z)=>[G,z])),Q=new Map($.map((G,z)=>[`TEXCOORD_${G}`,`TEXCOORD_${z}`]));for(let G of X){let z=G.getTexCoord();G.setTexCoord(W.get(z))}for(let G of Z){let z=G.listSemantics().filter((F)=>F.startsWith("TEXCOORD_")).sort();K(G,z),G.listTargets().forEach((F)=>K(F,z))}function K(G,z){for(let F of z){let H=G.getAttribute(F);if(!H)continue;let q=Q.get(F);if(q===F)continue;G.setAttribute(q,H),G.setAttribute(F,null)}}}async function CV1(J){let Z=J.getRoot(),X=J.getGraph(),Y=J.getLogger(),W=Z.listTextures().map(async(Q)=>{var K;let G=await kV1(Q);if(!G)return;if(OV1(Q)==="srgb")CR.convertSRGBToLinear(G,G);let z=Q.getName()||Q.getURI(),F=(K=Q.getSize())==null?void 0:K.join("x"),H=RV1(Q);for(let q of X.listParentEdges(Q)){let V=q.getParent();if(V!==Z&&TV1(V,G,q.getName(),Y))q.dispose()}if(Q.listParents().length===1)Q.dispose(),Y.debug(`${s$}: Removed solid-color texture "${z}" (${F}px ${H.join(", ")})`)});await Promise.all(W)}function TV1(J,Z,X,Y){if(J instanceof z4)switch(X){case"baseColorTexture":return J.setBaseColorFactor(BV1(Z,Z,J.getBaseColorFactor())),!0;case"emissiveTexture":return J.setEmissiveFactor(QV1([0,0,0],Z.slice(0,3),J.getEmissiveFactor())),!0;case"occlusionTexture":return Math.abs(Z[0]-1)<=MP;case"metallicRoughnessTexture":return J.setRoughnessFactor(Z[1]*J.getRoughnessFactor()),J.setMetallicFactor(Z[2]*J.getMetallicFactor()),!0;case"normalTexture":return Vp(qp(Hp(),Z,[0.5,0.5,1,1]))<=MP}return Y.warn(`${s$}: Detected single-color ${X} texture. Pruning ${X} not yet supported.`),!1}async function kV1(J){let Z=await EV1(J);if(!Z)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],[W,Q]=Z.shape;for(let K=0;K<W;K++){for(let G=0;G<Q;G++)for(let z=0;z<4;z++)X[z]=Math.min(X[z],Z.get(K,G,z)),Y[z]=Math.max(Y[z],Z.get(K,G,z));if(Vp(qp($,Y,X))/255>MP)return null}return wV1($,qV1($,Y,X),0.00196078431372549)}async function EV1(J){try{return await Zl(J.getImage(),J.getMimeType())}catch(Z){return null}}var MJ=4294967295;class Bp{constructor(J){this.attributes=[],this.u8=void 0,this.u32=void 0;let Z=0;for(let X of TP(J))Z+=this._initAttribute(X);this.u8=new Uint8Array(Z),this.u32=new Uint32Array(this.u8.buffer)}_initAttribute(J){let Z=J.getArray(),X=new Uint8Array(Z.buffer,Z.byteOffset,Z.byteLength),Y=J.getElementSize()*J.getComponentSize(),$=m0.padNumber(Y);return this.attributes.push({u8:X,byteStride:Y,paddedByteStride:$}),$}hash(J){let Z=0;for(let{u8:X,byteStride:Y,paddedByteStride:$}of this.attributes){for(let W=0;W<$;W++)if(W<Y)this.u8[Z+W]=X[J*Y+W];else this.u8[Z+W]=0;Z+=$}return IV1(0,this.u32)}equal(J,Z){for(let{u8:X,byteStride:Y}of this.attributes)for(let $=0;$<Y;$++)if(X[J*Y+$]!==X[Z*Y+$])return!1;return!0}}function IV1(J,Z){for(let $=0,W=Z.length;$<W;$++){let Q=Z[$];Q=Math.imul(Q,1540483477)>>>0,Q=(Q^Q>>24)>>>0,Q=Math.imul(Q,1540483477)>>>0,J=Math.imul(J,1540483477)>>>0,J=(J^Q)>>>0}return J}function vV1(J,Z,X,Y,$=MJ){let W=Z-1,K=X.hash(Y)&W;for(let G=0;G<=W;G++){let z=J[K];if(z===$||X.equal(z,Y))return K;K=K+G+1&W}throw new Error("Hash table full.")}var a8;(function(J){J.RENDER="render",J.RENDER_CACHED="render-cached",J.UPLOAD="upload",J.UPLOAD_NAIVE="upload-naive",J.DISTINCT="distinct",J.DISTINCT_POSITION="distinct-position",J.UNUSED="unused"})(a8||(a8={}));function NJ(J,Z){let X=J.getAttribute("POSITION"),Y=J.getIndices();switch(Z){case a8.RENDER:return Y?Y.getCount():X.getCount();case a8.RENDER_CACHED:return Y?new Set(Y.getArray()).size:X.getCount();case a8.UPLOAD_NAIVE:case a8.UPLOAD:return X.getCount();case a8.DISTINCT:case a8.DISTINCT_POSITION:return SV1(Z);case a8.UNUSED:return Y?X.getCount()-new Set(Y.getArray()).size:0;default:return _V1(Z)}}function SV1(J){throw new Error(`Not implemented: ${J}`)}function _V1(J){throw new Error(`Unexpected value: ${J}`)}function NG(J,Z,X){let Y=Z6.fromGraph(J.getGraph());if(!Z||!X)[Z,X]=xV1(J);let $=J.getIndices(),W=$?$.getArray():null,Q=NJ(J,a8.RENDER),K=Y.createAccessor(),G=Q,z=kP(G,X);for(let H=0;H<G;H++)z[H]=Z[W?W[H]:H];J.setIndices(K.setArray(z));let F=TP(J);for(let H of J.listAttributes()){let q=j7(Y,H);RP(H,$,Z,q,X),J.swap(H,q)}for(let H of J.listTargets())for(let q of H.listAttributes()){let V=j7(Y,q);RP(q,$,Z,V,X),H.swap(q,V)}if($&&$.listParents().length===1)$.dispose();for(let H of F)if(H.listParents().length===1)H.dispose();return J}function RP(J,Z,X,Y,$){let W=J.getElementSize(),Q=J.getArray(),K=Z?Z.getArray():null,G=Z?Z.getCount():J.getCount(),z=new Q.constructor($*W),F=new Uint8Array($);for(let H=0;H<G;H++){let q=K?K[H]:H,V=X[q];if(F[V])continue;for(let U=0;U<W;U++)z[V*W+U]=Q[q*W+U];F[V]=1}return Y.setArray(z)}function xV1(J){let Z=NJ(J,a8.UPLOAD),X=J.getIndices(),Y=X?X.getArray():null;if(!X||!Y)return[pq1(Z,1e6),Z];let $=new Uint32Array(Z).fill(MJ),W=0;for(let Q=0;Q<Y.length;Q++){let K=Y[Q];if($[K]===MJ)$[K]=W++}return[$,W]}var NP="weld",OU={overwrite:!0,cleanup:!0};function EP(J=OU){let Z=j4(OU,J);return PJ(NP,async(X)=>{let Y=X.getLogger();for(let $ of X.getRoot().listMeshes()){for(let W of $.listPrimitives())if(CU(W,Z),NJ(W,a8.RENDER)===0)W.dispose();if($.listPrimitives().length===0)$.dispose()}if(Z.cleanup)await X.transform(DU({propertyTypes:[c.ACCESSOR,c.NODE],keepAttributes:!0,keepIndices:!0,keepLeaves:!1}),zp({propertyTypes:[c.ACCESSOR]}));Y.debug(`${NP}: Complete.`)})}function CU(J,Z=OU){let X=J.getGraph(),$=Z6.fromGraph(X).getLogger(),W=o$({},OU,Z);if(J.getIndices()&&!W.overwrite)return;if(J.getMode()===K8.Mode.POINTS)return;let Q=J.getAttribute("POSITION").getCount(),K=J.getIndices(),G=K==null?void 0:K.getArray(),z=K?K.getCount():Q,F=new Bp(J),H=nq1(Q+Q/4),q=new Uint32Array(H).fill(MJ),V=new Uint32Array(Q).fill(MJ),U=0;for(let L=0;L<z;L++){let w=G?G[L]:L;if(V[w]!==MJ)continue;let j=vV1(q,H,F,w,MJ),M=q[j];if(M===MJ)q[j]=w,V[w]=U++;else V[w]=V[M]}$.debug(`${NP}: ${NU(Q,U)} vertices.`),NG(J,V,U)}var{FLOAT:AV1}=R0.ComponentType;function jp(J,Z){let X=J.getAttribute("POSITION");if(X)cl(Z,X);let Y=J.getAttribute("NORMAL");if(Y)ll(Z,Y);let $=J.getAttribute("TANGENT");if($)pl(Z,$);for(let W of J.listTargets()){let Q=W.getAttribute("POSITION");if(Q)cl(Z,Q);let K=W.getAttribute("NORMAL");if(K)ll(Z,K);let G=W.getAttribute("TANGENT");if(G)pl(Z,G)}if(tq1(Z)<0)hV1(J)}function cl(J,Z){let X=Z.getComponentType(),Y=Z.getNormalized(),$=Z.getArray(),W=X===AV1?$:new Float32Array($.length),Q=PU();for(let K=0,G=Z.getCount();K<G;K++){if(Y)Q[0]=A0.decodeNormalizedInt($[K*3],X),Q[1]=A0.decodeNormalizedInt($[K*3+1],X),Q[2]=A0.decodeNormalizedInt($[K*3+2],X);else Q[0]=$[K*3],Q[1]=$[K*3+1],Q[2]=$[K*3+2];$V1(Q,Q,J),W[K*3]=Q[0],W[K*3+1]=Q[1],W[K*3+2]=Q[2]}Z.setArray(W).setNormalized(!1)}function ll(J,Z){let X=Z.getArray(),Y=Z.getNormalized(),$=Z.getComponentType(),W=eq1();JV1(W,J),XV1(W,W),ZV1(W,W);let Q=PU();for(let K=0,G=Z.getCount();K<G;K++){if(Y)Q[0]=A0.decodeNormalizedInt(X[K*3],$),Q[1]=A0.decodeNormalizedInt(X[K*3+1],$),Q[2]=A0.decodeNormalizedInt(X[K*3+2],$);else Q[0]=X[K*3],Q[1]=X[K*3+1],Q[2]=X[K*3+2];if(WV1(Q,Q,W),Gp(Q,Q),Y)X[K*3]=A0.decodeNormalizedInt(Q[0],$),X[K*3+1]=A0.decodeNormalizedInt(Q[1],$),X[K*3+2]=A0.decodeNormalizedInt(Q[2],$);else X[K*3]=Q[0],X[K*3+1]=Q[1],X[K*3+2]=Q[2]}}function pl(J,Z){let X=Z.getArray(),Y=Z.getNormalized(),$=Z.getComponentType(),W=PU();for(let Q=0,K=Z.getCount();Q<K;Q++){if(Y)W[0]=A0.decodeNormalizedInt(X[Q*4],$),W[1]=A0.decodeNormalizedInt(X[Q*4+1],$),W[2]=A0.decodeNormalizedInt(X[Q*4+2],$);else W[0]=X[Q*4],W[1]=X[Q*4+1],W[2]=X[Q*4+2];if(W[0]=J[0]*W[0]+J[4]*W[1]+J[8]*W[2],W[1]=J[1]*W[0]+J[5]*W[1]+J[9]*W[2],W[2]=J[2]*W[0]+J[6]*W[1]+J[10]*W[2],Gp(W,W),Y)X[Q*4]=A0.decodeNormalizedInt(W[0],$),X[Q*4+1]=A0.decodeNormalizedInt(W[1],$),X[Q*4+2]=A0.decodeNormalizedInt(W[2],$);else X[Q*4]=W[0],X[Q*4+1]=W[1],X[Q*4+2]=W[2]}}function hV1(J){if(J.getMode()!==K8.Mode.TRIANGLES)return;if(!J.getIndices())CU(J);let Z=J.getIndices();for(let X=0,Y=Z.getCount();X<Y;X+=3){let $=Z.getScalar(X),W=Z.getScalar(X+2);Z.setScalar(X,W),Z.setScalar(X+2,$)}}function yV1(J,Z){for(let X of J.listPrimitives()){let Y=fV1(X,J);if(X!==Y)J.removePrimitive(X).addPrimitive(Y)}for(let X of J.listPrimitives())NG(X),jp(X,Z)}function fV1(J,Z){if(J.listParents().some((Y)=>Y instanceof tK&&Y!==Z))J=J.clone();for(let Y of J.listTargets())if(Y.listParents().some((W)=>W instanceof K8&&W!==J))J.removeTarget(Y).addTarget(Y.clone());return J}var il=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function Op(J){let Z=J.getMesh(),X=J.getMatrix();if(Z&&!A0.eq(X,il))yV1(Z,X);for(let Y of J.listChildren()){let $=Y.getMatrix();Kp($,$,X),Y.setMatrix($)}return J.setMatrix(il)}var{LINES:bV1,LINE_STRIP:gV1,LINE_LOOP:mV1,TRIANGLES:dV1,TRIANGLE_STRIP:uV1,TRIANGLE_FAN:cV1}=K8.Mode;function lV1(J){let Z=J.getGraph(),X=Z6.fromGraph(Z);if(!J.getIndices())CU(J);let Y=J.getIndices(),$=Y.getArray(),W=Yp(J),K=new HJ[Y.getComponentType()](W*2),G=J.getMode();if(G===gV1)for(let F=0;F<W;F++)K[F*2]=$[F],K[F*2+1]=$[F+1];else if(G===mV1)for(let F=0;F<W;F++)if(F<W-1)K[F*2]=$[F],K[F*2+1]=$[F+1];else K[F*2]=$[F],K[F*2+1]=$[0];else throw new Error("Only LINE_STRIP and LINE_LOOP may be converted to LINES.");J.setMode(bV1);let z=X.getRoot();if(Y.listParents().some((F)=>F!==z&&F!==J))J.setIndices(j7(X,Y).setArray(K));else Y.setArray(K)}function Mp(J){let Z=J.getGraph(),X=Z6.fromGraph(Z);if(!J.getIndices())CU(J);let Y=J.getIndices(),$=Y.getArray(),W=Yp(J),K=new HJ[Y.getComponentType()](W*3),G=J.getMode();if(G===uV1)for(let F=0,H=$.length;F<H-2;F++)if(F%2)K[F*3]=$[F+1],K[F*3+1]=$[F],K[F*3+2]=$[F+2];else K[F*3]=$[F],K[F*3+1]=$[F+1],K[F*3+2]=$[F+2];else if(G===cV1)for(let F=0;F<W;F++)K[F*3]=$[0],K[F*3+1]=$[F+1],K[F*3+2]=$[F+2];else throw new Error("Only TRIANGLE_STRIP and TRIANGLE_FAN may be converted to TRIANGLES.");J.setMode(dV1);let z=X.getRoot();if(Y.listParents().some((F)=>F!==z&&F!==J))J.setIndices(j7(X,Y).setArray(K));else Y.setArray(K)}var nl="dequantize",MU={pattern:/^((?!JOINTS_).)*$/};function Rp(J=MU){let Z=j4(MU,J);return PJ(nl,(X)=>{let Y=X.getLogger();for(let $ of X.getRoot().listMeshes())for(let W of $.listPrimitives())pV1(W,Z);X.createExtension(MG).dispose(),Y.debug(`${nl}: Complete.`)})}function pV1(J,Z=MU){let X=j4(MU,Z);for(let Y of J.listSemantics())if(X.pattern.test(Y))PP(J.getAttribute(Y));for(let Y of J.listTargets())for(let $ of Y.listSemantics())if(X.pattern.test($))PP(Y.getAttribute($))}function PP(J){let Z=J.getArray();if(!Z)return;let X=RU(Z,J.getComponentType(),J.getNormalized());J.setArray(X).setNormalized(!1)}function RU(J,Z,X){let Y=new Float32Array(J.length);for(let $=0,W=J.length;$<W;$++)if(X)Y[$]=A0.decodeNormalizedInt(J[$],Z);else Y[$]=J[$];return Y}var{TEXTURE_INFO:Np,ROOT:YQ6}=c;function Pp(J){let Z=new Z6().setLogger(J.getLogger()),X=IP(Z,J);return iV1(Z,J,X),Z.getRoot().copy(J.getRoot(),X),Z}function iV1(J,Z,X){X||(X=IP(J,Z));for(let Y of Z.getRoot().listExtensionsUsed()){let $=J.createExtension(Y.constructor);if(Y.isRequired())$.setRequired(!0)}return nV1(J,Z,aV1(Z),X)}function nV1(J,Z,X,Y){Y||(Y=IP(J,Z));let $=new Map;for(let W of X)if(!$.has(W)&&W.propertyType!==Np)$.set(W,Y(W));for(let[W,Q]of $.entries())Q.copy(W,Y);return $}function IP(J,Z){let X=new Map([[Z.getRoot(),J.getRoot()]]);return(Y)=>{if(Y.propertyType===Np)return Y;let $=X.get(Y);if(!$)$=new Y.constructor(J.getGraph()),X.set(Y,$);return $}}function aV1(J){let Z=new Set;for(let X of J.getGraph().listEdges())Z.add(X.getChild());return Array.from(Z)}var BP="flatten",al={cleanup:!0};function Dp(J=al){let Z=j4(al,J);return PJ(BP,async(X)=>{let Y=X.getRoot(),$=X.getLogger(),W=new Set;for(let z of Y.listSkins())for(let F of z.listJoints())W.add(F);let Q=new Set;for(let z of Y.listAnimations())for(let F of z.listChannels()){let H=F.getTargetNode();if(H&&F.getTargetPath()!=="weights")Q.add(H)}let K=new Set,G=new Set;for(let z of Y.listScenes())z.traverse((F)=>{let H=F.getParentNode();if(!H)return;if(W.has(H)||K.has(H))K.add(F);if(Q.has(H)||G.has(H))G.add(F)});for(let z of Y.listScenes())z.traverse((F)=>{if(Q.has(F))return;if(K.has(F))return;if(G.has(F))return;oq1(F)});if(Q.size)$.debug(`${BP}: Flattening node hierarchies with TRS animation not yet supported.`);if(Z.cleanup)await X.transform(DU({propertyTypes:[c.NODE],keepLeaves:!1}));$.debug(`${BP}: Complete.`)})}function Cp(J){return DR(J)}var sV1={skipValidation:!1},sl=4294967295,{LINE_STRIP:oV1,LINE_LOOP:rV1,TRIANGLE_STRIP:tV1,TRIANGLE_FAN:eV1}=K8.Mode;function JU1(J,Z={}){let X=j4(sV1,Z),Y=J[0],$=Z6.fromGraph(Y.getGraph());if(!X.skipValidation&&new Set(J.map(Wp)).size>1)throw new Error("Requires >=2 Primitives, sharing the same Material and Mode, with compatible vertex attributes and indices.");for(let V of J)switch(V.getMode()){case oV1:case rV1:lV1(V);break;case tV1:case eV1:Mp(V);break}let W=[],Q=new Uint32Array(J.length),K=0,G=0;for(let V=0;V<J.length;V++){let U=J[V],L=U.getIndices(),w=U.getAttribute("POSITION").getCount(),j=L?L.getArray():null,M=L?L.getCount():w,R=new Uint32Array(w).fill(sl);for(let N=0;N<M;N++){let D=j?j[N]:N;if(R[D]===sl)R[D]=K++,Q[V]++}W.push(R),G+=M}let z=$.createPrimitive().setMode(Y.getMode()).setMaterial(Y.getMaterial());for(let V of Y.listSemantics()){let U=Y.getAttribute(V),L=HJ[U.getComponentType()],w=j7($,U).setArray(new L(K*U.getElementSize()));z.setAttribute(V,w)}let F=Y.getIndices(),H=F?j7($,F).setArray(kP(G,K)):null;z.setIndices(H);let q=0;for(let V=0;V<W.length;V++){let U=J[V],L=U.getIndices(),w=L?L.getCount():-1,j=W[V];if(L&&H)XU1(L,j,H,q),q+=w;for(let M of z.listSemantics()){let R=U.getAttribute(M),N=z.getAttribute(M);ZU1(R,L,j,N)}}return z}function ZU1(J,Z,X,Y){let $=J.getElementSize(),W=Z?Z.getArray():null,Q=J.getCount(),K=J.getArray(),G=Y.getArray(),z=new Uint8Array(J.getCount());for(let F=0,H=Z?Z.getCount():Q;F<H;F++){let q=W?W[F]:F,V=X[q];if(z[V])continue;for(let U=0;U<$;U++)G[V*$+U]=K[q*$+U];z[V]=1}}function XU1(J,Z,X,Y){let $=J.getCount(),W=J.getArray(),Q=X.getArray();for(let K=0;K<$;K++){let G=W[K],z=Z[G];Q[Y+K]=z}}var DP="join",{ROOT:YU1,NODE:$U1,MESH:WU1,PRIMITIVE:QU1,ACCESSOR:KU1}=c,jP=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],ol={keepMeshes:!1,keepNamed:!1,cleanup:!0};function Tp(J=ol){let Z=j4(ol,J);return PJ(DP,async(X)=>{let Y=X.getRoot(),$=X.getLogger();for(let W of Y.listScenes())rl(X,W,Z),W.traverse((Q)=>rl(X,Q,Z));if(Z.cleanup)await X.transform(DU({propertyTypes:[$U1,WU1,QU1,KU1],keepAttributes:!0,keepIndices:!0,keepLeaves:!1}));$.debug(`${DP}: Complete.`)})}function rl(J,Z,X){let Y=J.getLogger(),$={},W=Z.listChildren();for(let G=0;G<W.length;G++){let z=W[G];if(z.listParents().some((q)=>q instanceof eZ))continue;let H=z.getMesh();if(!H)continue;if(z.getExtension("EXT_mesh_gpu_instancing"))continue;if(z.getSkin())continue;for(let q of H.listPrimitives()){if(q.listTargets().length>0)continue;let V=q.getMaterial();if(V&&V.getExtension("KHR_materials_volume"))continue;NG(q),zU1(q);let U=Wp(q),L=H.getName()||z.getName();if(X.keepMeshes||X.keepNamed&&L)U+=`|${G}`;if(!(U in $))$[U]={prims:[],primMeshes:[],primNodes:[],dstNode:z,dstMesh:void 0};let w=$[U];w.prims.push(q),w.primNodes.push(z)}}let Q=Object.values($).filter(({prims:G})=>G.length>1),K=new Set(Q.flatMap((G)=>G.primNodes));for(let G of K){let z=G.getMesh();if(z.listParents().some((H)=>{return H.propertyType!==YU1&&G!==H}))G.setMesh(z.clone())}for(let G of Q){let{dstNode:z,primNodes:F}=G;G.dstMesh=z.getMesh(),G.primMeshes=F.map((H)=>H.getMesh())}for(let G of Q){let{prims:z,primNodes:F,primMeshes:H,dstNode:q,dstMesh:V}=G,U=q.getMatrix();for(let j=0;j<z.length;j++){let M=F[j],R=H[j],N=z[j];if(R.removePrimitive(N),iq1(N))N=z[j]=GU1(z[j]);if(M!==q)Kp(jP,rq1(jP,U),M.getMatrix()),jp(N,jP)}let L=JU1(z),w=L.listAttributes()[0].getCount();V.addPrimitive(L),Y.debug(`${DP}: Joined Primitives (${z.length}) containing ${OP(w)} vertices under Node "${q.getName()}".`)}}function GU1(J){let Z=J.clone();for(let Y of Z.listSemantics())Z.setAttribute(Y,Z.getAttribute(Y).clone());let X=Z.getIndices();if(X)Z.setIndices(X.clone());return Z}function zU1(J){for(let Z of["POSITION","NORMAL","TANGENT"]){let X=J.getAttribute(Z);if(X)PP(X)}}var{TRANSLATION:$Q6,ROTATION:WQ6,SCALE:QQ6,WEIGHTS:KQ6}=eZ.TargetPath;var FU1={pattern:/.*/,quantizationVolume:"mesh",quantizePosition:14,quantizeNormal:10,quantizeTexcoord:12,quantizeColor:8,quantizeWeight:8,quantizeGeneric:12,normalizeWeights:!0,cleanup:!0};var GQ6=o$({level:"high"},FU1);var HU1="unweld";function qU1(J,Z=new Map){let X=J.getIndices();if(!X)return;let Y=J.getGraph(),$=Z6.fromGraph(Y),W=$.getLogger(),Q=J.getAttribute("POSITION").getCount();for(let G of J.listAttributes())if(J.swap(G,tl($,G,X,Z)),G.listParents().length===1)G.dispose();for(let G of J.listTargets())for(let z of G.listAttributes())if(G.swap(z,tl($,z,X,Z)),z.listParents().length===1)z.dispose();let K=J.getAttribute("POSITION").getCount();if(W.debug(`${HU1}: ${NU(Q,K)} vertices.`),J.setIndices(null),X.listParents().length===1)X.dispose()}function tl(J,Z,X,Y){if(Y.has(Z)&&Y.get(Z).has(X))return Y.get(Z).get(X);let $=Z.getArray(),Q=new $.constructor(X.getCount()*Z.getElementSize()),K=X.getArray(),G=Z.getElementSize();for(let F=0,H=X.getCount();F<H;F++)for(let q=0;q<G;q++)Q[F*G+q]=$[K[F]*G+q];if(!Y.has(Z))Y.set(Z,new Map);let z=j7(J,Z).setArray(Q);return Y.get(Z).set(X,z),z}var el;(function(J){J[J.STEP=0]="STEP",J[J.LERP=1]="LERP",J[J.SLERP=2]="SLERP"})(el||(el={}));var VU1=0.000001;function UU1(J,Z,X,Y=0.0001){let $=Z.length/J.length,W=new Array($).fill(0),Q=new Array($).fill(0),K=new Array($).fill(0),G=new Array($).fill(0),z=J.length-1,F=1;for(let H=1;H<z;++H){let q=J[F-1],V=J[H],U=J[H+1],L=(V-q)/(U-q),w=!1;if(V!==U&&(H!==1||V!==J[0])){if(RG(Z,F-1,G),RG(Z,H,Q),RG(Z,H+1,K),X==="slerp"){let j=BU1(W,G,K,L),M=Zp(G,Q)+Zp(Q,K);w=!jU(Q,j,Y)||M+Number.EPSILON>=Math.PI}else if(X==="lerp"){let j=LU1(W,G,K,L);w=!jU(Q,j,Y)}else if(X==="step")w=!jU(Q,G)||!jU(Q,K)}if(w){if(H!==F)J[F]=J[H],Jp(Z,F,RG(Z,H,W));F++}}if(z>0)J[F]=J[z],Jp(Z,F,RG(Z,z,W)),F++;return F}function RG(J,Z,X){for(let Y=0,$=X.length;Y<$;Y++)X[Y]=J[Z*$+Y];return X}function Jp(J,Z,X){for(let Y=0,$=X.length;Y<$;Y++)J[Z*$+Y]=X[Y]}function jU(J,Z,X=0){if(J.length!==Z.length)return!1;for(let Y=0;Y<J.length;Y++)if(Math.abs(J[Y]-Z[Y])>X)return!1;return!0}function wU1(J,Z,X){return J*(1-X)+Z*X}function LU1(J,Z,X,Y){for(let $=0;$<Z.length;$++)J[$]=wU1(Z[$],X[$],Y);return J}function BU1(J,Z,X,Y){let $=Z[0],W=Z[1],Q=Z[2],K=Z[3],G=X[0],z=X[1],F=X[2],H=X[3],q,V,U,L,w;if(V=$*G+W*z+Q*F+K*H,V<0)V=-V,G=-G,z=-z,F=-F,H=-H;if(1-V>VU1)q=Math.acos(V),U=Math.sin(q),L=Math.sin((1-Y)*q)/U,w=Math.sin(Y*q)/U;else L=1-Y,w=Y;return J[0]=L*$+w*G,J[1]=L*W+w*z,J[2]=L*Q+w*F,J[3]=L*K+w*H,J}function Zp(J,Z){let X=jU1(J,Z);return Math.acos(2*X*X-1)}function jU1(J,Z){return J[0]*Z[0]+J[1]*Z[1]+J[2]*Z[2]+J[3]*Z[3]}var zQ6=new Float32Array(0),FQ6={ready:Promise.resolve(),resample:UU1,tolerance:0.0001,cleanup:!0};var NX="simplify",{POINTS:kp,LINES:OU1,LINE_STRIP:MU1,LINE_LOOP:RU1,TRIANGLES:NU1,TRIANGLE_STRIP:Ep,TRIANGLE_FAN:Ip}=K8.Mode,vp={ratio:0,error:0.0001,lockBorder:!1,cleanup:!0};function Sp(J){let Z=j4(vp,J),X=Z.simplifier;if(!X)throw new Error(`${NX}: simplifier dependency required \u2014 install "meshoptimizer".`);return PJ(NX,async(Y)=>{let $=Y.getLogger();await X.ready,await Y.transform(EP({overwrite:!1,cleanup:Z.cleanup}));let W=0;for(let Q of Y.getRoot().listMeshes()){for(let K of Q.listPrimitives()){let G=K.getMode();if(G===NU1||G===Ep||G===Ip){if(Xp(K,Z),NJ(K,a8.RENDER)===0)K.dispose()}else if(K.getMode()===kp&&!!X.simplifyPoints){if(Xp(K,Z),NJ(K,a8.RENDER)===0)K.dispose()}else W++}if(Q.listPrimitives().length===0)Q.dispose()}if(W>0)$.warn(`${NX}: Skipping simplification of ${W} primitives: Unsupported draw mode.`);if(Z.cleanup)await Y.transform(DU({propertyTypes:[c.ACCESSOR,c.NODE],keepAttributes:!0,keepIndices:!0,keepLeaves:!1}),zp({propertyTypes:[c.ACCESSOR]}));$.debug(`${NX}: Complete.`)})}function Xp(J,Z){let X=o$({},vp,Z),Y=X.simplifier,$=J.getGraph(),W=Z6.fromGraph($),Q=W.getLogger();switch(J.getMode()){case kp:return PU1(W,J,X);case OU1:case MU1:case RU1:return Q.warn(`${NX}: Skipping primitive simplification: Unsupported draw mode.`),J;case Ep:case Ip:Mp(J);break}let K=NJ(J,a8.UPLOAD),G=NJ(J,a8.RENDER);if(G<K/2)NG(J);let z=J.getAttribute("POSITION"),F=J.getIndices(),H=z.getArray(),q=F.getArray();if(!(H instanceof Float32Array))H=RU(H,z.getComponentType(),z.getNormalized());if(!(q instanceof Uint32Array))q=new Uint32Array(q);let V=Math.floor(X.ratio*G/3)*3,U=X.lockBorder?["LockBorder"]:[],[L,w]=Y.simplify(q,H,3,V,X.error,U);if(J.setIndices(j7(W,F).setArray(L)),F.listParents().length===1)F.dispose();NG(J);let j=NJ(J,a8.UPLOAD);if(j<=65534)J.getIndices().setArray(new Uint16Array(J.getIndices().getArray()));return Q.debug(`${NX}: ${NU(K,j)} vertices, error: ${w.toFixed(4)}.`),J}function PU1(J,Z,X){let Y=X.simplifier,$=J.getLogger();if(Z.getIndices())qU1(Z);let Q=Z.getAttribute("POSITION"),K=Z.getAttribute("COLOR_0"),G=Q.getCount(),z=Q.getArray(),F=K?K.getArray():void 0,H=K?K.getComponentSize():void 0;if(!(z instanceof Float32Array))z=RU(z,Q.getComponentType(),Q.getNormalized());if(F&&!(F instanceof Float32Array))F=RU(F,Q.getComponentType(),Q.getNormalized());Y.useExperimentalFeatures=!0;let q=Math.floor(X.ratio*G),V=Y.simplifyPoints(z,3,q,F,H);Y.useExperimentalFeatures=!1;let[U,L]=Y.compactMesh(V);$.debug(`${NX}: ${NU(Q.getCount(),L)} vertices.`);for(let w of TP(Z)){let j=j7(J,w);if(RP(w,null,U,j,L),cq1(Z,w,j),w.listParents().length===1)w.dispose()}return Z}var CP;(function(J){J.LANCZOS3="lanczos3",J.LANCZOS2="lanczos2"})(CP||(CP={}));var HQ6={resizeFilter:CP.LANCZOS3,pattern:void 0,formats:void 0,slots:void 0,quality:void 0,effort:void 0,lossless:!1,nearLossless:!1,limitInputPixels:!0};var VQ6=function(){var J="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",Z=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($(J),{}).then(function(V){X=V.instance,X.exports.__wasm_call_ctors(),X.exports.meshopt_encodeVertexVersion(0),X.exports.meshopt_encodeIndexVersion(1)});function $(V){var U=new Uint8Array(V.length);for(var L=0;L<V.length;++L){var w=V.charCodeAt(L);U[L]=w>96?w-97:w>64?w-39:w+4}var j=0;for(var L=0;L<V.length;++L)U[j++]=U[L]<60?Z[U[L]]:(U[L]-60)*64+U[++L];return U.buffer.slice(0,j)}function W(V){if(!V)throw new Error("Assertion failed")}function Q(V){return new Uint8Array(V.buffer,V.byteOffset,V.byteLength)}function K(V,U,L,w){var j=X.exports.sbrk,M=j(U.length*4),R=j(L*4),N=new Uint8Array(X.exports.memory.buffer),D=Q(U);if(N.set(D,M),w)w(M,M,U.length,L);var P=V(R,M,U.length,L);N=new Uint8Array(X.exports.memory.buffer);var C=new Uint32Array(L);new Uint8Array(C.buffer).set(N.subarray(R,R+L*4)),D.set(N.subarray(M,M+U.length*4)),j(M-j(0));for(var k=0;k<U.length;++k)U[k]=C[U[k]];return[C,P]}function G(V,U,L,w){var j=X.exports.sbrk,M=j(L*4),R=j(L*w),N=new Uint8Array(X.exports.memory.buffer);N.set(Q(U),R),V(M,R,L,w),N=new Uint8Array(X.exports.memory.buffer);var D=new Uint32Array(L);return new Uint8Array(D.buffer).set(N.subarray(M,M+L*4)),j(M-j(0)),D}function z(V,U,L,w,j){var M=X.exports.sbrk,R=M(U),N=M(w*j),D=new Uint8Array(X.exports.memory.buffer);D.set(Q(L),N);var P=V(R,U,N,w,j),C=new Uint8Array(P);return C.set(D.subarray(R,R+P)),M(R-M(0)),C}function F(V){var U=0;for(var L=0;L<V.length;++L){var w=V[L];U=U<w?w:U}return U}function H(V,U){if(W(U==2||U==4),U==4)return new Uint32Array(V.buffer,V.byteOffset,V.byteLength/4);else{var L=new Uint16Array(V.buffer,V.byteOffset,V.byteLength/2);return new Uint32Array(L)}}function q(V,U,L,w,j,M,R){var N=X.exports.sbrk,D=N(L*w),P=N(L*M),C=new Uint8Array(X.exports.memory.buffer);C.set(Q(U),P),V(D,L,w,j,P,R);var k=new Uint8Array(L*w);return k.set(C.subarray(D,D+L*w)),N(D-N(0)),k}return{ready:Y,supported:!0,reorderMesh:function(V,U,L){var w=U?L?X.exports.meshopt_optimizeVertexCacheStrip:X.exports.meshopt_optimizeVertexCache:void 0;return K(X.exports.meshopt_optimizeVertexFetchRemap,V,F(V)+1,w)},reorderPoints:function(V,U){return W(V instanceof Float32Array),W(V.length%U==0),W(U>=3),G(X.exports.meshopt_spatialSortRemap,V,V.length/U,U*4)},encodeVertexBuffer:function(V,U,L){W(L>0&&L<=256),W(L%4==0);var w=X.exports.meshopt_encodeVertexBufferBound(U,L);return z(X.exports.meshopt_encodeVertexBuffer,w,V,U,L)},encodeIndexBuffer:function(V,U,L){W(L==2||L==4),W(U%3==0);var w=H(V,L),j=X.exports.meshopt_encodeIndexBufferBound(U,F(w)+1);return z(X.exports.meshopt_encodeIndexBuffer,j,w,U,4)},encodeIndexSequence:function(V,U,L){W(L==2||L==4);var w=H(V,L),j=X.exports.meshopt_encodeIndexSequenceBound(U,F(w)+1);return z(X.exports.meshopt_encodeIndexSequence,j,w,U,4)},encodeGltfBuffer:function(V,U,L,w){var j={ATTRIBUTES:this.encodeVertexBuffer,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return W(j[w]),j[w](V,U,L)},encodeFilterOct:function(V,U,L,w){return W(L==4||L==8),W(w>=1&&w<=16),q(X.exports.meshopt_encodeFilterOct,V,U,L,w,16)},encodeFilterQuat:function(V,U,L,w){return W(L==8),W(w>=4&&w<=16),q(X.exports.meshopt_encodeFilterQuat,V,U,L,w,16)},encodeFilterExp:function(V,U,L,w,j){W(L>0&&L%4==0),W(w>=1&&w<=24);var M={Separate:0,SharedVector:1,SharedComponent:2,Clamped:3};return q(X.exports.meshopt_encodeFilterExp,V,U,L,w,L,j?M[j]:1)}}}();var wQ6=function(){var J="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",Z="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(Z):K(J),W,Q=WebAssembly.instantiate($,{}).then(function(j){W=j.instance,W.exports.__wasm_call_ctors()});function K(j){var M=new Uint8Array(j.length);for(var R=0;R<j.length;++R){var N=j.charCodeAt(R);M[R]=N>96?N-97:N>64?N-39:N+4}var D=0;for(var R=0;R<j.length;++R)M[D++]=M[R]<60?Y[M[R]]:(M[R]-60)*64+M[++R];return M.buffer.slice(0,D)}function G(j,M,R,N,D,P,C){var k=j.exports.sbrk,I=N+3&-4,A=k(I*D),v=k(P.length),x=new Uint8Array(j.exports.memory.buffer);x.set(P,v);var d=M(A,N,D,v,P.length);if(d==0&&C)C(A,I,D);if(R.set(x.subarray(A,A+N*D)),k(A-k(0)),d!=0)throw new Error("Malformed buffer data: "+d)}var z={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},F={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},H=[],q=0;function V(j){var M={object:new Worker(j),pending:0,requests:{}};return M.object.onmessage=function(R){var N=R.data;M.pending-=N.count,M.requests[N.id][N.action](N.value),delete M.requests[N.id]},M}function U(j){var M="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array($)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+w.name+";"+G.toString()+w.toString(),R=new Blob([M],{type:"text/javascript"}),N=URL.createObjectURL(R);for(var D=H.length;D<j;++D)H[D]=V(N);for(var D=j;D<H.length;++D)H[D].object.postMessage({});H.length=j,URL.revokeObjectURL(N)}function L(j,M,R,N,D){var P=H[0];for(var C=1;C<H.length;++C)if(H[C].pending<P.pending)P=H[C];return new Promise(function(k,I){var A=new Uint8Array(R),v=++q;P.pending+=j,P.requests[v]={resolve:k,reject:I},P.object.postMessage({id:v,count:j,size:M,source:A,mode:N,filter:D},[A.buffer])})}function w(j){var M=j.data;if(!M.id)return self.close();self.ready.then(function(R){try{var N=new Uint8Array(M.count*M.size);G(R,R.exports[M.mode],N,M.count,M.size,M.source,R.exports[M.filter]),self.postMessage({id:M.id,count:M.count,action:"resolve",value:N},[N.buffer])}catch(D){self.postMessage({id:M.id,count:M.count,action:"reject",value:D})}})}return{ready:Q,supported:!0,useWorkers:function(j){U(j)},decodeVertexBuffer:function(j,M,R,N,D){G(W,W.exports.meshopt_decodeVertexBuffer,j,M,R,N,W.exports[z[D]])},decodeIndexBuffer:function(j,M,R,N){G(W,W.exports.meshopt_decodeIndexBuffer,j,M,R,N)},decodeIndexSequence:function(j,M,R,N){G(W,W.exports.meshopt_decodeIndexSequence,j,M,R,N)},decodeGltfBuffer:function(j,M,R,N,D,P){G(W,W.exports[F[D]],j,M,R,N,W.exports[z[P]])},decodeGltfBufferAsync:function(j,M,R,N,D){if(H.length>0)return L(j,M,R,F[N],z[D]);return Q.then(function(){var P=new Uint8Array(j*M);return G(W,W.exports[F[N]],P,j,M,R,W.exports[z[D]]),P})}}}();var _p=function(){var J="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",Z=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($(J),{}).then(function(U){X=U.instance,X.exports.__wasm_call_ctors()});function $(U){var L=new Uint8Array(U.length);for(var w=0;w<U.length;++w){var j=U.charCodeAt(w);L[w]=j>96?j-97:j>64?j-39:j+4}var M=0;for(var w=0;w<U.length;++w)L[M++]=L[w]<60?Z[L[w]]:(L[w]-60)*64+L[++w];return L.buffer.slice(0,M)}function W(U){if(!U)throw new Error("Assertion failed")}function Q(U){return new Uint8Array(U.buffer,U.byteOffset,U.byteLength)}function K(U,L,w){var j=X.exports.sbrk,M=j(L.length*4),R=j(w*4),N=new Uint8Array(X.exports.memory.buffer),D=Q(L);N.set(D,M);var P=U(R,M,L.length,w);N=new Uint8Array(X.exports.memory.buffer);var C=new Uint32Array(w);new Uint8Array(C.buffer).set(N.subarray(R,R+w*4)),D.set(N.subarray(M,M+L.length*4)),j(M-j(0));for(var k=0;k<L.length;++k)L[k]=C[L[k]];return[C,P]}function G(U){var L=0;for(var w=0;w<U.length;++w){var j=U[w];L=L<j?j:L}return L}function z(U,L,w,j,M,R,N,D,P){var C=X.exports.sbrk,k=C(4),I=C(w*4),A=C(M*R),v=C(w*4),x=new Uint8Array(X.exports.memory.buffer);x.set(Q(j),A),x.set(Q(L),v);var d=U(I,v,w,A,M,R,N,D,P,k);x=new Uint8Array(X.exports.memory.buffer);var h=new Uint32Array(d);Q(h).set(x.subarray(I,I+d*4));var u=new Float32Array(1);return Q(u).set(x.subarray(k,k+4)),C(k-C(0)),[h,u[0]]}function F(U,L,w,j,M,R,N,D,P,C,k,I,A){var v=X.exports.sbrk,x=v(4),d=v(w*4),h=v(M*R),u=v(M*D),$0=v(P.length*4),U0=v(w*4),B0=C?v(M):0,f0=new Uint8Array(X.exports.memory.buffer);if(f0.set(Q(j),h),f0.set(Q(N),u),f0.set(Q(P),$0),f0.set(Q(L),U0),C)f0.set(Q(C),B0);var B1=U(d,U0,w,h,M,R,u,D,$0,P.length,B0,k,I,A,x);f0=new Uint8Array(X.exports.memory.buffer);var L8=new Uint32Array(B1);Q(L8).set(f0.subarray(d,d+B1*4));var B8=new Float32Array(1);return Q(B8).set(f0.subarray(x,x+4)),v(x-v(0)),[L8,B8[0]]}function H(U,L,w,j){var M=X.exports.sbrk,R=M(w*j),N=new Uint8Array(X.exports.memory.buffer);N.set(Q(L),R);var D=U(R,w,j);return M(R-M(0)),D}function q(U,L,w,j,M,R,N,D){var P=X.exports.sbrk,C=P(D*4),k=P(w*j),I=P(w*R),A=new Uint8Array(X.exports.memory.buffer);if(A.set(Q(L),k),M)A.set(Q(M),I);var v=U(C,k,w,j,I,R,N,D);A=new Uint8Array(X.exports.memory.buffer);var x=new Uint32Array(v);return Q(x).set(A.subarray(C,C+v*4)),P(C-P(0)),x}var V={LockBorder:1,Sparse:2,ErrorAbsolute:4,Prune:8,_InternalDebug:1073741824};return{ready:Y,supported:!0,useExperimentalFeatures:!1,compactMesh:function(U){W(U instanceof Uint32Array||U instanceof Int32Array||U instanceof Uint16Array||U instanceof Int16Array),W(U.length%3==0);var L=U.BYTES_PER_ELEMENT==4?U:new Uint32Array(U);return K(X.exports.meshopt_optimizeVertexFetchRemap,L,G(U)+1)},simplify:function(U,L,w,j,M,R){W(U instanceof Uint32Array||U instanceof Int32Array||U instanceof Uint16Array||U instanceof Int16Array),W(U.length%3==0),W(L instanceof Float32Array),W(L.length%w==0),W(w>=3),W(j>=0&&j<=U.length),W(j%3==0),W(M>=0);var N=0;for(var D=0;D<(R?R.length:0);++D)W(R[D]in V),W(this.useExperimentalFeatures||R[D]!="Prune"),N|=V[R[D]];var P=U.BYTES_PER_ELEMENT==4?U:new Uint32Array(U),C=z(X.exports.meshopt_simplify,P,U.length,L,L.length/w,w*4,j,M,N);return C[0]=U instanceof Uint32Array?C[0]:new U.constructor(C[0]),C},simplifyWithAttributes:function(U,L,w,j,M,R,N,D,P,C){W(this.useExperimentalFeatures),W(U instanceof Uint32Array||U instanceof Int32Array||U instanceof Uint16Array||U instanceof Int16Array),W(U.length%3==0),W(L instanceof Float32Array),W(L.length%w==0),W(w>=3),W(j instanceof Float32Array),W(j.length%M==0),W(M>=0),W(N==null||N instanceof Uint8Array),W(N==null||N.length==L.length/w),W(D>=0&&D<=U.length),W(D%3==0),W(P>=0),W(Array.isArray(R)),W(M>=R.length),W(R.length<=32);for(var k=0;k<R.length;++k)W(R[k]>=0);var I=0;for(var k=0;k<(C?C.length:0);++k)W(C[k]in V),I|=V[C[k]];var A=U.BYTES_PER_ELEMENT==4?U:new Uint32Array(U),v=F(X.exports.meshopt_simplifyWithAttributes,A,U.length,L,L.length/w,w*4,j,M*4,new Float32Array(R),N?new Uint8Array(N):null,D,P,I);return v[0]=U instanceof Uint32Array?v[0]:new U.constructor(v[0]),v},getScale:function(U,L){return W(U instanceof Float32Array),W(U.length%L==0),W(L>=3),H(X.exports.meshopt_simplifyScale,U,U.length/L,L*4)},simplifyPoints:function(U,L,w,j,M,R){if(W(this.useExperimentalFeatures),W(U instanceof Float32Array),W(U.length%L==0),W(L>=3),W(w>=0&&w<=U.length/L),j)return W(j instanceof Float32Array),W(j.length%M==0),W(M>=3),W(U.length/L==j.length/M),q(X.exports.meshopt_simplifyPoints,U,U.length/L,L*4,j,M*4,R,w);else return q(X.exports.meshopt_simplifyPoints,U,U.length/L,L*4,void 0,0,0,w)}}}();var jQ6=function(){var J="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",Z=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($(J),{}).then(function(U){X=U.instance,X.exports.__wasm_call_ctors()});function $(U){var L=new Uint8Array(U.length);for(var w=0;w<U.length;++w){var j=U.charCodeAt(w);L[w]=j>96?j-97:j>64?j-39:j+4}var M=0;for(var w=0;w<U.length;++w)L[M++]=L[w]<60?Z[L[w]]:(L[w]-60)*64+L[++w];return L.buffer.slice(0,M)}function W(U){if(!U)throw new Error("Assertion failed")}function Q(U){return new Uint8Array(U.buffer,U.byteOffset,U.byteLength)}var K=48,G=16;function z(U,L){var w=U.meshlets[L*4+0],j=U.meshlets[L*4+1],M=U.meshlets[L*4+2],R=U.meshlets[L*4+3];return{vertices:U.vertices.subarray(w,w+M),triangles:U.triangles.subarray(j,j+R*3)}}function F(U,L,w,j,M,R,N){var D=X.exports.sbrk,P=X.exports.meshopt_buildMeshletsBound(U.length,M,R),C=D(P*G),k=D(P*M*4),I=D(P*R*3),A=D(U.byteLength),v=D(L.byteLength),x=new Uint8Array(X.exports.memory.buffer);x.set(Q(U),A),x.set(Q(L),v);var d=X.exports.meshopt_buildMeshlets(C,k,I,A,U.length,v,w,j,M,R,N);x=new Uint8Array(X.exports.memory.buffer);var h=x.subarray(C,C+d*G),u=new Uint32Array(h.buffer,h.byteOffset,h.byteLength/4).slice();for(var $0=0;$0<d;++$0){var U0=u[$0*4+0],B0=u[$0*4+1],w=u[$0*4+2],f0=u[$0*4+3];X.exports.meshopt_optimizeMeshlet(k+U0*4,I+B0,f0,w)}var B1=u[(d-1)*4+0],L8=u[(d-1)*4+1],B8=u[(d-1)*4+2],j1=u[(d-1)*4+3],B9=B1+B8,l8=L8+(j1*3+3&-4),X4={meshlets:u,vertices:new Uint32Array(x.buffer,k,B9).slice(),triangles:new Uint8Array(x.buffer,I,l8*3).slice(),meshletCount:d};return D(C-D(0)),X4}function H(U){var L=new Float32Array(X.exports.memory.buffer,U,K/4);return{centerX:L[0],centerY:L[1],centerZ:L[2],radius:L[3],coneApexX:L[4],coneApexY:L[5],coneApexZ:L[6],coneAxisX:L[7],coneAxisY:L[8],coneAxisZ:L[9],coneCutoff:L[10]}}function q(U,L,w,j){var M=X.exports.sbrk,R=[],N=M(L.byteLength),D=M(U.vertices.byteLength),P=M(U.triangles.byteLength),C=M(K),k=new Uint8Array(X.exports.memory.buffer);k.set(Q(L),N),k.set(Q(U.vertices),D),k.set(Q(U.triangles),P);for(var I=0;I<U.meshletCount;++I){var A=U.meshlets[I*4+0],v=U.meshlets[I*4+0+1],x=U.meshlets[I*4+0+3];X.exports.meshopt_computeMeshletBounds(C,D+A*4,P+v,x,N,w,j),R.push(H(C))}return M(N-M(0)),R}function V(U,L,w,j){var M=X.exports.sbrk,R=M(K),N=M(U.byteLength),D=M(L.byteLength),P=new Uint8Array(X.exports.memory.buffer);P.set(Q(U),N),P.set(Q(L),D),X.exports.meshopt_computeClusterBounds(R,N,U.length,D,w,j);var C=H(R);return M(R-M(0)),C}return{ready:Y,supported:!0,buildMeshlets:function(U,L,w,j,M,R){W(U.length%3==0),W(L instanceof Float32Array),W(L.length%w==0),W(w>=3),W(j<=255||j>0),W(M<=512),W(M%4==0),R=R||0;var N=U.BYTES_PER_ELEMENT==4?U:new Uint32Array(U);return F(N,L,L.length/w,w*4,j,M,R)},computeClusterBounds:function(U,L,w){W(U.length%3==0),W(U.length/3<=512),W(L instanceof Float32Array),W(L.length%w==0),W(w>=3);var j=U.BYTES_PER_ELEMENT==4?U:new Uint32Array(U);return V(j,L,L.length/w,w*4)},computeMeshletBounds:function(U,L,w){return W(U.meshletCount!=0),W(L instanceof Float32Array),W(L.length%w==0),W(w>=3),q(U,L,L.length/w,w*4)},extractMeshlet:function(U,L){return W(L>=0&&L<U.meshletCount),z(U,L)}}}();var t$={OPTIMIZED_DIR:".optimized",CHECKSUM_EXT:".md5",DIRECTORIES:[O7.normalize("node_modules/@hytopia.com/assets"),O7.normalize("assets")],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 m5{static instance=new m5;optimize=!0;optimizeEveryStart=!1;_modelUriDocuments=new Map;_modelUriBoundingBoxes=new Map;_modelUriNodeNames=new Map;_modelUriTrimeshes=new Map;constructor(){}async preloadModels(){let J=await this._getAbsoluteModelPaths();console.log(`ModelRegistry.preloadModels(): Preloading ${J.length} models...`);for(let Z of J){if(this.optimize)await this._resolveOptimizedModelPath(Z);await this._loadModelData(Z)}console.log(`ModelRegistry.preloadModels(): Preloaded ${J.length} models!`)}getBoundingBox(J){let Z=this._modelUriBoundingBoxes.get(J);if(!Z)y.fatalError(`ModelRegistry.getBoundingBox(): Model ${J} not found!`);return Z}getHeight(J){let Z=this.getBoundingBox(J);return Z.max.y-Z.min.y}getNodeNames(J){let Z=this._modelUriNodeNames.get(J);if(!Z)y.fatalError(`ModelRegistry.getNodeNames(): Model ${J} not found!`);return Z}getTrimesh(J,Z=1){let X=this._modelUriTrimeshes.get(J);if(!X){y.error(`ModelRegistry.getTrimesh(): Model ${J} not found!`);return}let Y=X.vertices;if(Z!==1){Y=new Float32Array(Y.length);for(let $=0;$<Y.length;$++)Y[$]=X.vertices[$]*Z}return{vertices:Y,indices:X.indices}}modelHasNode(J,Z){let X=this._modelUriNodeNames.get(J);if(!X)y.fatalError(`ModelRegistry.modelHasNode(): Model ${J} not found!`);return X.includes(Z)}_absoluteModelPathToModelUri(J){let Z=O7.relative(process.cwd(),J),X=t$.DIRECTORIES.find(($)=>Z.startsWith($));return(X?O7.relative(X,Z):Z).split(O7.sep).join("/")}async _getAbsoluteModelPaths(){let J=[],Z=new CU1("**/*.{gltf,glb}");for(let X of t$.DIRECTORIES){let Y=O7.resolve(process.cwd(),X);if(!DJ.existsSync(Y))continue;for await(let $ of Z.scan(Y))J.push(O7.join(Y,$))}return J}async _loadModelData(J){let Z=await new vR().read(J),X=Cp(Z.getRoot().listScenes()[0]),Y=Z.getRoot().listNodes().map((W)=>W.getName()),$=this._absoluteModelPathToModelUri(J);this._modelUriDocuments.set($,Z),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(J){let Z=this._buildOptimizedModelPath(J);if(!this.optimizeEveryStart&&this._isOptimizedVersionValid(J))return Z;return await this._optimizeModel(J,Z)}_isOptimizedVersionValid(J){let Z=`${this._buildOptimizedModelPath(J)}${t$.CHECKSUM_EXT}`;if(!DJ.existsSync(Z))return!1;let X=this._calculateChecksum(J),Y=DJ.readFileSync(Z,"utf8");return X===Y}_calculateChecksum(J){if(!DJ.existsSync(J))return"";let Z=DJ.readFileSync(J);return DU1.createHash("sha256").update(Z.toString("base64")).digest("hex")}_buildOptimizedModelPath(J){let Z=O7.basename(J),X=Z.replace(/\.[^/.]+$/,""),Y=`${t$.OPTIMIZED_DIR}/${X}`;return J.replace(/[^/\\]+$/,`${Y}/${Z}`)}async _buildTrimesh(J,Z=1,X=0.001){let Y=this._modelUriDocuments.get(J);if(!Y)y.fatalError(`ModelRegistry._buildTrimesh(): Model ${J} not found!`);let $=Pp(Y);$.setLogger(new n6(oK.WARN)),await $.transform(Qp({pivot:"center"}),Dp(),Tp(),EP(),Sp({simplifier:_p,ratio:Z,error:X}),Rp());for(let z of $.getRoot().listScenes())for(let F of z.listChildren())Op(F);let W=$.getRoot().listMeshes()[0];if(!W){y.error(`ModelRegistry._buildTrimesh(): Model ${J} has no root mesh!`);return}let Q=W.listPrimitives()[0];if(!Q){y.error(`ModelRegistry._buildTrimesh(): Model ${J} has no root primitive!`);return}let K=Q.getAttribute("POSITION"),G=Q.getIndices();if(!K||!G){y.error(`ModelRegistry._buildTrimesh(): Model ${J} missing required geometry data!`);return}return{vertices:K.getArray(),indices:G.getArray()}}async _optimizeModel(J,Z){let X=O7.dirname(Z);DJ.rmSync(X,{recursive:!0,force:!0}),DJ.mkdirSync(X,{recursive:!0}),console.log(`ModelRegistry: Optimizing model ${this._absoluteModelPathToModelUri(J)}...`);for(let Y of t$.OPTIMIZER_RUNS){let $=Z.replace(/(\.[^/.]+)$/,`${Y.suffix}$1`),{stderr:W}=await mm("bunx",["gltf-transform","optimize",J,$,...Y.options]);if(W)return y.warning(`ModelRegistry._optimizeModel(): Error optimizing model ${this._absoluteModelPathToModelUri(J)}, defaulting to unoptimized model. Error: ${W}`),J}return DJ.writeFileSync(`${Z}${t$.CHECKSUM_EXT}`,this._calculateChecksum(J)),Z}}var PG;(($)=>{$.DYNAMIC="dynamic";$.FIXED="fixed";$.KINEMATIC_POSITION="kinematic_position";$.KINEMATIC_VELOCITY="kinematic_velocity"})(PG||={});var vP=0.001,xp="dynamic";class PX extends S0{_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(J){super();J.type??=xp,this._rigidBodyDesc=this._createRigidBodyDesc(J),this._rigidBodyType=J.type,this._applyRigidBodyOptions(J),this._autoAddToSimulation(J)}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:J,y:Z,z:X,w:Y}=this.rotation;return{x:2*(J*X+Y*Z),y:2*(Z*X-Y*J),z:1-2*(J*J+Z*Z)}}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(J){if(!this._requireDynamic("setAdditionalMass"))return;if(!this._requireNotRemoved("setAdditionalMass"))return;this._rigidBody?this._rigidBody.setAdditionalMass(J,!this._explicitSleep):this._rigidBodyDesc.setAdditionalMass(J)}setAdditionalMassProperties(J){if(!this._requireDynamic("setAdditionalMassProperties"))return;if(!this._requireNotRemoved("setAdditionalMassProperties"))return;let{additionalMass:Z,centerOfMass:X,principalAngularInertia:Y,principalAngularInertiaLocalFrame:$}=J;this._rigidBody?this._rigidBody.setAdditionalMassProperties(Z,X,Y,$,!this._explicitSleep):this._rigidBodyDesc.setAdditionalMassProperties(Z,X,Y,$)}setAdditionalSolverIterations(J){if(!this._requireDynamic("setAdditionalSolverIterations"))return;if(!this._requireNotRemoved("setAdditionalSolverIterations"))return;this._rigidBody?this._rigidBody.setAdditionalSolverIterations(J):this._rigidBodyDesc.setAdditionalSolverIterations(J)}setAngularDamping(J){if(!this._requireDynamic("setAngularDamping"))return;if(!this._requireNotRemoved("setAngularDamping"))return;this._rigidBody?this._rigidBody.setAngularDamping(J):this._rigidBodyDesc.setAngularDamping(J)}setAngularVelocity(J){if(!this._requireNotKinematicPositionBased("setAngularVelocity"))return;if(!this._requireNotRemoved("setAngularVelocity"))return;this._rigidBody?this._rigidBody.setAngvel(J,!this._explicitSleep):this._rigidBodyDesc.setAngvel(J)}setCcdEnabled(J){if(!this._requireDynamic("setCcdEnabled"))return;if(!this._requireNotRemoved("setCcdEnabled"))return;this._rigidBody?this._rigidBody.enableCcd(J):this._rigidBodyDesc.setCcdEnabled(J)}setDominanceGroup(J){if(!this._requireDynamic("setDominanceGroup"))return;if(!this._requireNotRemoved("setDominanceGroup"))return;this._rigidBody?this._rigidBody.setDominanceGroup(J):this._rigidBodyDesc.setDominanceGroup(J)}setEnabled(J){if(!this._requireNotRemoved("setEnabled"))return;this._rigidBody?this._rigidBody.setEnabled(J):this._rigidBodyDesc.setEnabled(J)}setEnabledPositions(J){if(!this._requireDynamic("setEnabledPositions"))return;if(!this._requireNotRemoved("setEnabledPositions"))return;this._rigidBody?this._rigidBody.setEnabledTranslations(J.x,J.y,J.z,!this._explicitSleep):this._rigidBodyDesc.enabledTranslations(J.x,J.y,J.z),this._enabledPositions=J}setEnabledRotations(J){if(!this._requireDynamic("setEnabledRotations"))return;if(!this._requireNotRemoved("setEnabledRotations"))return;this._rigidBody?this._rigidBody.setEnabledRotations(J.x,J.y,J.z,!this._explicitSleep):this._rigidBodyDesc.enabledRotations(J.x,J.y,J.z),this._enabledRotations=J}setGravityScale(J){if(!this._requireDynamic("setGravityScale"))return;if(!this._requireNotRemoved("setGravityScale"))return;this._rigidBody?this._rigidBody.setGravityScale(J,!this._explicitSleep):this._rigidBodyDesc.setGravityScale(J)}setLinearDamping(J){if(!this._requireDynamic("setLinearDamping"))return;if(!this._requireNotRemoved("setLinearDamping"))return;this._rigidBody?this._rigidBody.setLinearDamping(J):this._rigidBodyDesc.setLinearDamping(J)}setLinearVelocity(J){if(!this._requireNotKinematicPositionBased("setLinearVelocity"))return;if(!this._requireNotRemoved("setLinearVelocity"))return;this._rigidBody?this._rigidBody.setLinvel(J,!this._explicitSleep):this._rigidBodyDesc.setLinvel(J.x,J.y,J.z)}setNextKinematicRotation(J){if(!this._requireKinematic("setNextKinematicRotation"))return;if(!this._requireNotRemoved("setNextKinematicRotation"))return;this._rigidBody?this._rigidBody.setNextKinematicRotation(J):this._rigidBodyDesc.setRotation(J)}setNextKinematicPosition(J){if(!this._requireKinematic("setNextKinematicPosition"))return;if(!this._requireNotRemoved("setNextKinematicPosition"))return;this._rigidBody?this._rigidBody.setNextKinematicTranslation(J):this._rigidBodyDesc.setTranslation(J.x,J.y,J.z)}setPosition(J){if(!this._requireNotRemoved("setPosition"))return;this._rigidBody?this._rigidBody.setTranslation(J,!this._explicitSleep):this._rigidBodyDesc.setTranslation(J.x,J.y,J.z)}setRotation(J){if(!this._requireNotRemoved("setRotation"))return;this._rigidBody?this._rigidBody.setRotation(J,!this._explicitSleep):this._rigidBodyDesc.setRotation(J)}setSleeping(J){if(!this._requireDynamic("setSleeping"))return;if(!this._requireNotRemoved("setSleeping"))return;this._rigidBody?J?this._rigidBody.sleep():this._rigidBody.wakeUp():this._rigidBodyDesc.sleeping=J,this._explicitSleep=J}setSoftCcdPrediction(J){if(!this._requireDynamic("setSoftCcdPrediction"))return;if(!this._requireNotRemoved("setSoftCcdPrediction"))return;this._rigidBody?this._rigidBody.setSoftCcdPrediction(J):this._rigidBodyDesc.setSoftCcdPrediction(J)}setCollisionGroupsForSolidColliders(J){if(!this._requireNotRemoved("setCollisionGroupsForSolidColliders"))return;this._colliders.forEach((Z)=>{if(Z.isSensor)return;Z.setCollisionGroups(J)})}setCollisionGroupsForSensorColliders(J){if(!this._requireNotRemoved("setCollisionGroupsForSensorColliders"))return;this._colliders.forEach((Z)=>{if(!Z.isSensor)return;Z.setCollisionGroups(J)})}setType(J){if(!this._requireNotRemoved("setType"))return;let X={["dynamic"]:r0.RigidBodyType.Dynamic,["fixed"]:r0.RigidBodyType.Fixed,["kinematic_position"]:r0.RigidBodyType.KinematicPositionBased,["kinematic_velocity"]:r0.RigidBodyType.KinematicVelocityBased}[J];if(X===void 0)return y.error(`Invalid RigidBodyType: ${J}`);this._rigidBody?this._rigidBody.setBodyType(X,!this._explicitSleep):this._rigidBodyDesc.status=X,this._rigidBodyType=J}addForce(J){if(!this._requireNotRemoved("addForce"))return;if(!this._requireCreated("addForce"))return;if(!this._requireDynamic("addForce"))return;if(this._isNegligibleVector(J))return;this._rigidBody.addForce(J,!this._explicitSleep)}addTorque(J){if(!this._requireNotRemoved("addTorque"))return;if(!this._requireCreated("addTorque"))return;if(!this._requireDynamic("addTorque"))return;if(this._isNegligibleVector(J))return;this._rigidBody.addTorque(J,!this._explicitSleep)}addChildColliderToSimulation(J){if(!this._requireNotRemoved("addChildColliderToSimulation"))return;if(!this._requireCreated("addChildColliderToSimulation"))return;J.addToSimulation(this._simulation,this)}addToSimulation(J){if(!this._requireNotRemoved("addToSimulation"))return;if(this._rigidBody)return y.error("RigidBody.addToSimulation(): Rigid body already exists in the simulation!");this._simulation=J,this._rigidBody=this._simulation.createRawRigidBody(this._rigidBodyDesc),this._colliders.forEach((Z)=>{if(!Z.isSimulated)Z.addToSimulation(J,this)})}applyImpulse(J){if(!this._requireNotRemoved("applyImpulse"))return;if(!this._requireCreated("applyImpulse"))return;if(!this._requireDynamic("applyImpulse"))return;if(this._isNegligibleVector(J))return;this._rigidBody.applyImpulse(J,!this._explicitSleep)}applyImpulseAtPoint(J,Z){if(!this._requireNotRemoved("applyImpulseAtPoint"))return;if(!this._requireCreated("applyImpulseAtPoint"))return;if(!this._requireDynamic("applyImpulseAtPoint"))return;if(this._isNegligibleVector(J))return;this._rigidBody.applyImpulseAtPoint(J,Z,!this._explicitSleep)}applyTorqueImpulse(J){if(!this._requireNotRemoved("applyTorqueImpulse"))return;if(!this._requireCreated("applyTorqueImpulse"))return;if(!this._requireDynamic("applyTorqueImpulse"))return;this._rigidBody.applyTorqueImpulse(J,!this._explicitSleep)}createAndAddChildCollider(J){if(!this._requireNotRemoved("createAndAddChildCollider"))return null;return this._simulation?new M5({...J,parentRigidBody:this,simulation:this._simulation}):this._createAndAddPendingChildCollider(J)}createAndAddChildCollidersToSimulation(J){let Z=[];return J.forEach((X)=>{let Y=this.createAndAddChildCollider(X);if(Y)Z.push(Y)}),Z}getCollidersByTag(J){let Z=[];for(let X of this._colliders)if(X.tag===J)Z.push(X);return Z}linkCollider(J){if(!this._requireNotRemoved("linkCollider"))return;if(J.parentRigidBody!==this)return y.error("RigidBody.linkCollider(): Collider cannot be linked because it is not a child of this rigid body!");this._colliders.add(J)}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 y.error("RigidBody.removeFromSimulation(): Rigid body does not exist in the simulation!");this._colliders.forEach((J)=>{J.removeFromSimulation()}),this._simulation.removeRawRigidBody(this._rigidBody),this._simulation=void 0,this._rigidBody=void 0}unlinkCollider(J){if(!this._requireNotRemoved("unlinkCollider"))return;if(!J.isRemoved)return y.error("RigidBody.unlinkCollider(): Collider is still simulated and therefore cannot be unlinked from this rigid body!");this._colliders.delete(J)}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(J){[["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 J)Y(J[X])})}_autoAddToSimulation(J){if(J.colliders)this._createAndAddPendingChildColliders(J.colliders);if(J.simulation)this.addToSimulation(J.simulation)}_createAndAddPendingChildCollider(J){if(!this._requireNotRemoved("createAndAddPendingChildCollider"))return null;if(!this._requireNotSimulated("createAndAddPendingChildCollider"))return null;let Z=new M5(J);return this._colliders.add(Z),Z}_createAndAddPendingChildColliders(J){let Z=[];return J.forEach((X)=>{let Y=this._createAndAddPendingChildCollider(X);if(Y)Z.push(Y)}),Z}_createRigidBodyDesc(J){let Z=J.type??xp;return{["dynamic"]:()=>r0.RigidBodyDesc.dynamic(),["fixed"]:()=>r0.RigidBodyDesc.fixed(),["kinematic_position"]:()=>r0.RigidBodyDesc.kinematicPositionBased(),["kinematic_velocity"]:()=>r0.RigidBodyDesc.kinematicVelocityBased()}[Z]()}_requireCreated(J){if(!this._rigidBody||!this._simulation)y.error(`RigidBody._requireCreated(): Rigid body has not been created and therefore does not support the invoked method: ${J}()`);return!!this._rigidBody&&!!this._simulation}_requireDynamic(J){if(!this.isDynamic)y.error(`RigidBody._requireDynamic(): Rigid body is not dynamic and therefore does not support the invoked method: ${J}()`);return this.isDynamic}_requireKinematic(J){if(!this.isKinematic)y.error(`RigidBody._requireKinematic(): Rigid body is not kinematic and therefore does not support the invoked method: ${J}()`);return this.isKinematic}_requireNotKinematicPositionBased(J){if(this.isKinematicPositionBased)y.error(`RigidBody._requireNotKinematicPositionBased(): Rigid body is kinematic position based and therefore does not support the invoked method: ${J}()`);return!this.isKinematicPositionBased}_requireNotRemoved(J){if(!this._rigidBody&&!this._rigidBodyDesc)y.error(`RigidBody._requireNotRemoved(): Rigid body has been removed and therefore does not support the invoked method: ${J}()`);return!!this._rigidBody||!!this._rigidBodyDesc}_requireNotSimulated(J){if(this.isSimulated)y.error(`RigidBody._requireNotSimulated(): Rigid body is simulated and therefore does not support the invoked method: ${J}()`);return!this.isSimulated}_isNegligibleVector(J){return Math.abs(J.x)<vP&&Math.abs(J.y)<vP&&Math.abs(J.z)<vP}}var SP;(($)=>{$[$.Average=0]="Average";$[$.Min=1]="Min";$[$.Multiply=2]="Multiply";$[$.Max=3]="Max"})(SP||={});var TU;((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.WEDGE="wedge"})(TU||={});class M5 extends S0{_collider;_colliderDesc;_onCollision;_parentRigidBody;_shape;_simulation;_tag;constructor(J){super();this._colliderDesc=this._createColliderDesc(J),this._shape=J.shape,this._applyColliderOptions(J),this._autoAddToSimulation(J)}static optionsFromBlockHalfExtents(J){return{shape:"block",halfExtents:J}}static optionsFromModelUri(J,Z=1,X){let Y=m5.instance.getBoundingBox(J),$=Y.max.x-Y.min.x,W=Y.max.y-Y.min.y,Q=Y.max.z-Y.min.z,K=Math.max($,Q),G=Math.min($,Q),z=K/G,F=K/W,H=K*Z/2,q=(M)=>Math.max(0.01,M),V=()=>({shape:"block",halfExtents:{x:q($*Z/2),y:q(W*Z/2),z:q(Q*Z/2)}}),U=()=>({shape:"round-cylinder",radius:q(H),halfHeight:q(W*Z/2),borderRadius:q(H*0.1)}),L=()=>{let M=m5.instance.getTrimesh(J,Z);if(!M)return;return{shape:"trimesh",vertices:M.vertices,indices:M.indices}},w=()=>({shape:"wedge",extents:{x:$*Z,y:W*Z,z:Q*Z}}),j=()=>({shape:"capsule",radius:q(H),halfHeight:q(W*Z/2-H)});if(X)switch(X){case"block":return V();case"capsule":return j();case"round-cylinder":return U();case"trimesh":{let M=L();if(!M){y.error(`Collider.optionsFromModelUri(): Failed to create trimesh options for model ${J}, falling back to generic shape!`);break}return M}case"wedge":return w();default:y.warning(`Collider.optionsFromModelUri(): Preferred shape ${X} is not yet supported with Collider.optionsFromModelUri(), defaulting to generic shape!`)}if(z>2)return V();if(F>1.5)return U();return j()}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?P9.decodeRawCollisionGroups(this._collider.collisionGroups()):P9.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 relativePosition(){if(!this._requireNotRemoved("relativePosition"))return{x:0,y:0,z:0};return this._collider?this._collider.translation():this._colliderDesc.translation}get relativeRotation(){if(!this._requireNotRemoved("relativeRotation"))return{x:0,y:0,z:0,w:1};return this._collider?this._collider.rotation():this._colliderDesc.rotation}get shape(){if(!this._requireNotRemoved("shape"))return"none";return this._shape}get tag(){if(!this._requireNotRemoved("tag"))return;return this._tag}setBounciness(J){if(!this._requireNotRemoved("setBounciness"))return;this._collider?this._collider.setRestitution(J):this._colliderDesc.setRestitution(J)}setBouncinessCombineRule(J){if(!this._requireNotRemoved("setBouncinessCombineRule"))return;this._collider?this._collider.setRestitutionCombineRule(J):this._colliderDesc.setRestitutionCombineRule(J)}setCollisionGroups(J){if(!this._requireNotRemoved("setCollisionGroups"))return;let Z=P9.buildRawCollisionGroups(J);this._collider?this._collider.setCollisionGroups(Z):this._colliderDesc.setCollisionGroups(Z)}setEnabled(J){if(!this._requireNotRemoved("setEnabled"))return;this._collider?this._collider.setEnabled(J):this._colliderDesc.setEnabled(J)}setFriction(J){if(!this._requireNotRemoved("setFriction"))return;this._collider?this._collider.setFriction(J):this._colliderDesc.setFriction(J)}setFrictionCombineRule(J){if(!this._requireNotRemoved("setFrictionCombineRule"))return;this._collider?this._collider.setFrictionCombineRule(J):this._colliderDesc.setFrictionCombineRule(J)}setMass(J){if(!this._requireNotRemoved("setMass"))return;this._collider?this._collider.setMass(J):this._colliderDesc.setMass(J)}setOnCollision(J){if(!this._requireNotRemoved("setOnCollision"))return;if(this._onCollision=J,this.isSimulated)if(this.enableCollisionEvents(!!J),J)this._simulation.colliderMap.setColliderCollisionCallback(this,J);else this._simulation.colliderMap.removeColliderCollisionCallback(this)}setRelativeRotation(J){if(!this._requireNotRemoved("setRelativeRotation"))return;this._collider?this._collider.setRotation(J):this._colliderDesc.setRotation(J)}setRelativePosition(J){if(!this._requireNotRemoved("setRelativePosition"))return;this._collider?this._collider.setTranslation(J):this._colliderDesc.setTranslation(J.x,J.y,J.z)}setSensor(J){if(!this._requireNotRemoved("setSensor"))return;this._collider?this._collider.setSensor(J):this._colliderDesc.setSensor(J)}setTag(J){if(!this._requireNotRemoved("setTag"))return;this._tag=J}addToSimulation(J,Z){if(!this._requireNotRemoved("addToSimulation"))return;if(!this._requireUnsimulated("addToSimulation"))return;if(Z){if(!Z.isSimulated)return y.error("Collider.addToSimulation(): Rigid body must be simulated before adding a collider to it!");if(Z.type==="dynamic"&&this.shape==="trimesh")y.warning("Collider.addToSimulation(): Trimesh colliders are strongly discouraged to be used with dynamic rigid bodies, they will not contribute any mass!")}if(this._simulation=J,this._parentRigidBody=Z,this._collider=this._simulation.createRawCollider(this._colliderDesc,Z?.rawRigidBody),this._colliderDesc=void 0,Z)Z.linkCollider(this);if(this._onCollision)this.setOnCollision(this._onCollision)}enableCollisionEvents(J){if(!this._requireNotRemoved("enableCollisionEvents"))return;let Z=this._collider?this._collider.activeEvents():this._colliderDesc.activeEvents,X=J?Z|r0.ActiveEvents.COLLISION_EVENTS:Z&~r0.ActiveEvents.COLLISION_EVENTS;(this._collider??this._colliderDesc).setActiveEvents(X),this._setActiveCollisionTypes()}enableContactForceEvents(J){if(!this._requireNotRemoved("enableContactForceEvents"))return;let Z=this._collider?this._collider.activeEvents():this._colliderDesc.activeEvents,X=J?Z|r0.ActiveEvents.CONTACT_FORCE_EVENTS:Z&~r0.ActiveEvents.CONTACT_FORCE_EVENTS;(this._collider??this._colliderDesc).setActiveEvents(X),this._setActiveCollisionTypes()}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}_applyColliderOptions(J){[["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(J[X]!==void 0)Y.call(this,J[X])})}_autoAddToSimulation(J){if(J.simulation)this.addToSimulation(J.simulation,J.parentRigidBody)}_buildWedgeConvexHullVertices(J){let{x:Z,y:X,z:Y}=J,$=Z/2,W=Y/2,Q=X/2;return new Float32Array([-$,0-Q,-W,$,0-Q,-W,$,0-Q,W,-$,0-Q,W,-$,X-Q,-W,$,X-Q,-W])}_createColliderDesc(J){let{shape:Z,flags:X}=J;switch(Z){case"ball":{if(!J.radius)y.fatalError("Ball collider must have a radius!");return r0.ColliderDesc.ball(J.radius)}case"block":{if(!J.halfExtents)y.fatalError("Block collider must have halfExtents!");return r0.ColliderDesc.cuboid(J.halfExtents.x,J.halfExtents.y,J.halfExtents.z)}case"capsule":{if(!J.halfHeight||!J.radius)y.fatalError("Capsule collider must have halfHeight and radius!");return r0.ColliderDesc.capsule(J.halfHeight,J.radius)}case"cone":{if(!J.radius||!J.halfHeight)y.fatalError("Cone collider must have radius and halfHeight!");return r0.ColliderDesc.cone(J.halfHeight,J.radius)}case"cylinder":{if(!J.radius||!J.halfHeight)y.fatalError("Cylinder collider must have radius and halfHeight!");return r0.ColliderDesc.cylinder(J.halfHeight,J.radius)}case"round-cylinder":{if(!J.radius||!J.halfHeight||!J.borderRadius)y.fatalError("Round cylinder collider must have radius, halfHeight, and borderRadius!");return r0.ColliderDesc.roundCylinder(J.halfHeight,J.radius,J.borderRadius)}case"trimesh":{if(!J.indices||!J.vertices)y.fatalError("Trimesh collider must have vertices and indices!");return r0.ColliderDesc.trimesh(J.vertices,J.indices,X)}case"wedge":{if(!J.extents)y.fatalError("Wedge collider must have extents!");let Y=this._buildWedgeConvexHullVertices(J.extents),$=r0.ColliderDesc.convexHull(Y);if(!$)throw y.fatalError("Failed to create convex hull for wedge collider!"),new Error("Convex hull creation failed");return $}default:y.fatalError(`Collider._createColliderDesc(): ${Z} is not a valid collider shape!`)}}_requireSimulated(J){if(!this.isSimulated)y.error(`Collider._requireSimulated(): Collider is not simulated, invoked method: ${J}()`);return this.isSimulated}_requireUnsimulated(J){if(this.isSimulated)y.error(`Collider._requireUnsimulated(): Collider is already simulated, invoked method: ${J}()`);return!this.isSimulated}_requireNotRemoved(J){if(this.isRemoved)y.error(`Collider._requireNotRemoved(): Collider is removed, invoked method: ${J}()`);return!this.isRemoved}_setActiveCollisionTypes(){(this._collider??this._colliderDesc).setActiveCollisionTypes(r0.ActiveCollisionTypes.DYNAMIC_DYNAMIC|r0.ActiveCollisionTypes.DYNAMIC_KINEMATIC|r0.ActiveCollisionTypes.DYNAMIC_FIXED|r0.ActiveCollisionTypes.KINEMATIC_KINEMATIC|r0.ActiveCollisionTypes.KINEMATIC_FIXED)}}var TU1={shape:"trimesh",flags:TK.FIX_INTERNAL_EDGES},kU1=new Uint32Array([0,1,2,2,3,0,4,5,6,6,7,4,8,9,10,10,11,8,12,13,14,14,15,12,16,17,18,18,19,16,20,21,22,22,23,20]),EU1=new Float32Array([-0.5,-0.5,0.5,0.5,-0.5,0.5,0.5,0.5,0.5,-0.5,0.5,0.5,-0.5,-0.5,-0.5,0.5,-0.5,-0.5,0.5,0.5,-0.5,-0.5,0.5,-0.5,-0.5,0.5,-0.5,0.5,0.5,-0.5,0.5,0.5,0.5,-0.5,0.5,0.5,-0.5,-0.5,-0.5,0.5,-0.5,-0.5,0.5,-0.5,0.5,-0.5,-0.5,0.5,0.5,-0.5,-0.5,0.5,0.5,-0.5,0.5,0.5,0.5,0.5,-0.5,0.5,-0.5,-0.5,-0.5,-0.5,0.5,-0.5,-0.5,0.5,0.5,-0.5,-0.5,0.5]),_P;((X)=>{X.ENTITY_COLLISION="BLOCK_TYPE.ENTITY_COLLISION";X.ENTITY_CONTACT_FORCE="BLOCK_TYPE.ENTITY_CONTACT_FORCE"})(_P||={});class R5 extends S0{_id;_customColliderOptions;_isLiquid;_name;_textureUri;constructor(J={id:-1,textureUri:"textures/missing.png",name:"Unknown"}){if(J.id<0)y.fatalError("BlockType.constructor(): BlockType id not set.");super();this._id=J.id,this._customColliderOptions=J.customColliderOptions,this._isLiquid=J.isLiquid??!1,this._name=J.name,this._textureUri=J.textureUri}get id(){return this._id}get colliderOptions(){return{...this._customColliderOptions,...TU1}}get isLiquid(){return this._isLiquid}get isMeshable(){return!this._customColliderOptions}get name(){return this._name}get textureUri(){return this._textureUri}createCollider(J=kU1,Z=EU1){let X=new M5({...this.colliderOptions,indices:J,vertices:Z});if(this.isLiquid)X.setSensor(!0);if(this.hasListeners("BLOCK_TYPE.ENTITY_COLLISION")||this.isLiquid)X.enableCollisionEvents(!0);if(this.hasListeners("BLOCK_TYPE.ENTITY_CONTACT_FORCE"))X.enableContactForceEvents(!0);if(P9.isDefaultCollisionGroups(X.collisionGroups))X.setCollisionGroups({belongsTo:[1],collidesWith:[65535&~1]});return X}serialize(){return b0.serializeBlockType(this)}}var xP;((Z)=>Z.REGISTER_BLOCK_TYPE="BLOCK_TYPE_REGISTRY.REGISTER_BLOCK_TYPE")(xP||={});class DG extends S0{_blockTypes=new Map;_world;constructor(J){super();this._world=J}get world(){return this._world}getAllBlockTypes(){return Array.from(this._blockTypes.values())}getBlockType(J){let Z=this._blockTypes.get(J);if(!Z)y.fatalError(`BlockTypeRegistry.getBlockType(): BlockType with id ${J} not found.`);return Z}registerGenericBlockType(J){let X=new class extends R5{constructor(Y=J){super(Y)}};return this.registerBlockType(X),X}registerBlockType(J){this._blockTypes.set(J.id,J),this.emitWithWorld(this._world,"BLOCK_TYPE_REGISTRY.REGISTER_BLOCK_TYPE",{blockTypeRegistry:this,id:J.id,blockType:J})}serialize(){return b0.serializeBlockTypeRegistry(this)}}var GC={};O9(GC,{worldSchema:()=>KC,worldPacketDefinition:()=>To,vectorSchema:()=>N1,vectorBooleanSchema:()=>TR1,uiSchema:()=>WC,uiPacketDefinition:()=>Do,uiDatasSchema:()=>QC,uiDatasPacketDefinition:()=>Co,uiDataSendPacketDefinition:()=>Fo,uiDataSchema:()=>aG,syncResponseSchema:()=>$C,syncResponsePacketDefinition:()=>Po,syncRequestSchema:()=>AD,syncRequestPacketDefinition:()=>zo,stateRequestSchema:()=>xD,stateRequestPacketDefinition:()=>Go,sceneUIsSchema:()=>YC,sceneUIsPacketDefinition:()=>No,sceneUISchema:()=>XC,rgbColorSchema:()=>R4,registeredPackets:()=>qw,quaternionSchema:()=>iD,playersSchema:()=>ZC,playersPacketDefinition:()=>Ro,playerSchema:()=>JC,physicsDebugRenderSchema:()=>eD,physicsDebugRenderPacketDefinition:()=>Oo,physicsDebugRaycastsSchema:()=>tD,physicsDebugRaycastsPacketDefinition:()=>Mo,physicsDebugRaycastSchema:()=>rD,outboundPackets:()=>Hw,modelNodeOverrideSchema:()=>pD,lightsSchema:()=>oD,lightsPacketDefinition:()=>jo,lightSchema:()=>sD,isValidPacket:()=>ER1,inputSchema:()=>_D,inputPacketDefinition:()=>Ko,inboundPackets:()=>Fw,hexColorSchema:()=>vD,heartbeatSchema:()=>ID,heartbeatPacketDefinition:()=>$o,entitySchema:()=>nD,entitiesSchema:()=>aD,entitiesPacketDefinition:()=>Bo,definePacket:()=>O0,debugConfigSchema:()=>SD,debugConfigPacketDefinition:()=>Qo,createPacket:()=>LR1,connectionSchema:()=>ED,connectionPacketDefinition:()=>Yo,chunksSchema:()=>lD,chunksPacketDefinition:()=>Lo,chunkSchema:()=>cD,chatMessagesSchema:()=>uD,chatMessagesPacketDefinition:()=>wo,chatMessageSendPacketDefinition:()=>Wo,chatMessageSchema:()=>nG,cameraSchema:()=>dD,cameraPacketDefinition:()=>Uo,blocksSchema:()=>bD,blocksPacketDefinition:()=>qo,blockTypesSchema:()=>mD,blockTypesPacketDefinition:()=>Vo,blockTypeSchema:()=>gD,blockSchema:()=>fD,bidirectionalPackets:()=>zw,audiosSchema:()=>yD,audiosPacketDefinition:()=>Ho,audioSchema:()=>hD,PacketId:()=>C1});var zw={};O9(zw,{heartbeatPacketDefinition:()=>$o,connectionPacketDefinition:()=>Yo});var TD=i(Zo(),1);class kD extends TD.default{static instance=new TD.default}var C1;((k)=>{k[k.SYNC_REQUEST=0]="SYNC_REQUEST";k[k.INPUT=1]="INPUT";k[k.STATE_REQUEST=2]="STATE_REQUEST";k[k.CHAT_MESSAGE_SEND=3]="CHAT_MESSAGE_SEND";k[k.UI_DATA_SEND=4]="UI_DATA_SEND";k[k.SYNC_RESPONSE=32]="SYNC_RESPONSE";k[k.AUDIOS=33]="AUDIOS";k[k.BLOCKS=34]="BLOCKS";k[k.BLOCK_TYPES=35]="BLOCK_TYPES";k[k.CHAT_MESSAGES=36]="CHAT_MESSAGES";k[k.CHUNKS=37]="CHUNKS";k[k.ENTITIES=38]="ENTITIES";k[k.WORLD=39]="WORLD";k[k.CAMERA=40]="CAMERA";k[k.UI=41]="UI";k[k.UI_DATAS=42]="UI_DATAS";k[k.SCENE_UIS=43]="SCENE_UIS";k[k.LIGHTS=44]="LIGHTS";k[k.PLAYERS=45]="PLAYERS";k[k.CONNECTION=116]="CONNECTION";k[k.HEARTBEAT=117]="HEARTBEAT";k[k.DEBUG_CONFIG=128]="DEBUG_CONFIG";k[k.PHYSICS_DEBUG_RENDER=192]="PHYSICS_DEBUG_RENDER";k[k.PHYSICS_DEBUG_RAYCASTS=193]="PHYSICS_DEBUG_RAYCASTS"})(C1||={});function LR1(J,Z,X){if(!J.validate(Z))throw new Error(`Invalid payload for packet with id ${J.id}. Error: ${kD.instance.errorsText(J.validate.errors)}`);let Y=[J.id,Z];if(typeof X==="number")Y.push(X);return Y}function O0(J,Z){return{id:J,schema:Z,validate:kD.instance.compile(Z)}}var BR1={type:"object",properties:{i:{type:"string"}},required:["i"],additionalProperties:!1},Xo={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},jR1={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},OR1={type:"object",properties:{usernameFragment:{type:"string"},password:{type:"string"},iceLite:{type:"boolean",nullable:!0}},required:["usernameFragment","password"],additionalProperties:!1},MR1={type:"object",properties:{i:{type:"string"},l:{type:"string"}},required:["i","l"],additionalProperties:!1},RR1={type:"object",properties:{port:{type:"number"},OS:{type:"number"},MIS:{type:"number"},maxMessageSize:{type:"number"}},required:["port","OS","MIS","maxMessageSize"],additionalProperties:!0},NR1={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},PR1={type:"object",properties:{i:{type:"string"},f:{type:"string",enum:["cs","sc"]},ip:OR1,ic:{type:"array",items:jR1},d:Xo,s:RR1},required:["i","f","ip","ic","d","s"],additionalProperties:!1},DR1={type:"object",properties:{i:{type:"string"},d:Xo},required:["i","d"],additionalProperties:!1},CR1={type:"object",properties:{i:{type:"string",nullable:!0},pi:{type:"string",nullable:!0},l:{type:"string"},s:NR1},required:["l","s"],additionalProperties:!1},ED={type:"object",properties:{i:{type:"string",nullable:!0},c:{...DR1,nullable:!0},ca:{...BR1,nullable:!0},d:{type:"array",items:{...CR1},nullable:!0},pa:{...MR1,nullable:!0},t:{type:"array",items:{...PR1},nullable:!0}},additionalProperties:!1};var Yo=O0(116,ED);var ID={type:"null",nullable:!0};var $o=O0(117,ID);var Fw={};O9(Fw,{uiDataSendPacketDefinition:()=>Fo,syncRequestPacketDefinition:()=>zo,stateRequestPacketDefinition:()=>Go,inputPacketDefinition:()=>Ko,debugConfigPacketDefinition:()=>Qo,chatMessageSendPacketDefinition:()=>Wo});var vD={type:"string",pattern:"^[0-9A-Fa-f]{6}$"};var nG={type:"object",properties:{m:{type:"string"},c:{...vD,nullable:!0},p:{type:"string",nullable:!0}},required:["m"],additionalProperties:!1};var Wo=O0(3,nG);var SD={type:"object",properties:{pdr:{type:"boolean",nullable:!0}},additionalProperties:!1};var Qo=O0(128,SD);var _D={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},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 Ko=O0(1,_D);var xD={type:"object",properties:{},additionalProperties:!1};var Go=O0(2,xD);var AD={type:"null",nullable:!0};var zo=O0(0,AD);var aG={type:"object",properties:{},additionalProperties:!0};var Fo=O0(4,aG);var Hw={};O9(Hw,{worldPacketDefinition:()=>To,uiPacketDefinition:()=>Do,uiDatasPacketDefinition:()=>Co,syncResponsePacketDefinition:()=>Po,sceneUIsPacketDefinition:()=>No,playersPacketDefinition:()=>Ro,physicsDebugRenderPacketDefinition:()=>Oo,physicsDebugRaycastsPacketDefinition:()=>Mo,lightsPacketDefinition:()=>jo,entitiesPacketDefinition:()=>Bo,chunksPacketDefinition:()=>Lo,chatMessagesPacketDefinition:()=>wo,cameraPacketDefinition:()=>Uo,blocksPacketDefinition:()=>qo,blockTypesPacketDefinition:()=>Vo,audiosPacketDefinition:()=>Ho});var N1={type:"array",items:[{type:"number"},{type:"number"},{type:"number"}],minItems:3,maxItems:3};var hD={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:{...N1,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 yD={type:"array",items:{...hD}};var Ho=O0(33,yD);var fD={type:"object",properties:{i:{type:"number"},c:N1},required:["i","c"],additionalProperties:!1};var bD={type:"array",items:{...fD}};var qo=O0(34,bD);var gD={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 mD={type:"array",items:{...gD}};var Vo=O0(35,mD);var dD={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},p:{...N1,nullable:!0},pt:{...N1,nullable:!0},pl:{...N1,nullable:!0},h:{type:"array",items:{type:"string"},nullable:!0},o:{...N1,nullable:!0},z:{type:"number",nullable:!0}},additionalProperties:!1};var uD={type:"array",items:{...nG}};var cD={type:"object",properties:{c:N1,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 lD={type:"array",items:{...cD}};var R4={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 pD={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:{...R4,nullable:!0}},required:["n"],additionalProperties:!1};var iD={type:"array",items:[{type:"number"},{type:"number"},{type:"number"},{type:"number"}],minItems:4,maxItems:4};var nD={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:{...N1,nullable:!0},bt:{type:"string",nullable:!0},h:{type:"array",items:{type:"string"},nullable:!0},m:{type:"string",nullable:!0},mo:{type:"array",items:{...pD},nullable:!0},n:{type:"string",nullable:!0},o:{type:"number",nullable:!0},p:{...N1,nullable:!0},pe:{type:"number",nullable:!0},pn:{type:"string",nullable:!0},r:{...iD,nullable:!0},rm:{type:"boolean",nullable:!0},s:{type:"number",nullable:!0},t:{...R4,nullable:!0}},required:["i"],additionalProperties:!1};var aD={type:"array",items:{...nD}};var sD={type:"object",properties:{i:{type:"number"},a:{type:"number",nullable:!0},e:{type:"number",nullable:!0},c:{...R4,nullable:!0},d:{type:"number",nullable:!0},n:{type:"number",nullable:!0},o:{...N1,nullable:!0},p:{...N1,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:{...N1,nullable:!0}},required:["i"],additionalProperties:!1};var oD={type:"array",items:{...sD}};var rD={type:"object",properties:{o:{...N1},d:{...N1},l:{type:"number"},h:{type:"boolean"}},required:["o","d","l","h"],additionalProperties:!1};var tD={type:"array",items:{...rD}};var eD={type:"object",properties:{v:{type:"array",items:{type:"number"}},c:{type:"array",items:{type:"number"}}},required:["v","c"],additionalProperties:!1};var JC={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 ZC={type:"array",items:{...JC}};var XC={type:"object",properties:{i:{type:"number"},e:{type:"number",nullable:!0},o:{...N1,nullable:!0},p:{...N1,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 YC={type:"array",items:{...XC}};var $C={type:"object",properties:{r:{type:"number"},s:{type:"number"},p:{type:"number"},n:{type:"number"}},required:["r","s","p","n"],additionalProperties:!1};var WC={type:"object",properties:{p:{type:"boolean",nullable:!0},u:{type:"string",nullable:!0}},additionalProperties:!1};var QC={type:"array",items:{...aG}};var TR1={type:"array",items:[{type:"boolean"},{type:"boolean"},{type:"boolean"}],minItems:3,maxItems:3};var KC={type:"object",properties:{i:{type:"number"},ac:{...R4,nullable:!0},ai:{type:"number",nullable:!0},dc:{...R4,nullable:!0},di:{type:"number",nullable:!0},dp:{...N1,nullable:!0},n:{type:"string",nullable:!0},s:{type:"string",nullable:!0},t:{type:"number",nullable:!0}},required:["i"],additionalProperties:!1};var Uo=O0(40,dD);var wo=O0(36,uD);var Lo=O0(37,lD);var Bo=O0(38,aD);var jo=O0(44,oD);var Oo=O0(192,eD);var Mo=O0(193,tD);var Ro=O0(45,ZC);var No=O0(43,YC);var Po=O0(32,$C);var Do=O0(41,WC);var Co=O0(42,QC);var To=O0(39,KC);var qw=new Map,kR1={...zw,...Fw,...Hw};for(let J of Object.values(kR1))if("id"in J&&"schema"in J){let Z=J;if(qw.has(Z.id))throw new Error(`Packet with id ${Z.id} is already registered.`);qw.set(Z.id,Z)}function ER1(J){if(typeof J!=="object"||J===null||typeof J[0]!=="number"||J[0]<0||J[1]===void 0||J[2]!==void 0&&(typeof J[2]!=="number"||J[2]<0))return!1;let Z=qw.get(J[0]);return!!Z&&Z.validate(J[1])}var s=GC;import{WebSocket as sh1}from"ws";var T6=i(Sr(),1),kq6=T6.default.v1,Eq6=T6.default.v1ToV6,Iq6=T6.default.v3,_r=T6.default.v4,vq6=T6.default.v5,Sq6=T6.default.v6,_q6=T6.default.v6ToV1,xq6=T6.default.v7,Aq6=T6.default.NIL,hq6=T6.default.MAX,yq6=T6.default.version,fq6=T6.default.validate,bq6=T6.default.stringify,gq6=T6.default.parse;function xr(J){let Z=J.length,X=0,Y=0;while(Y<Z){let $=J.charCodeAt(Y++);if(($&4294967168)===0){X++;continue}else if(($&4294965248)===0)X+=2;else{if($>=55296&&$<=56319){if(Y<Z){let W=J.charCodeAt(Y);if((W&64512)===56320)++Y,$=(($&1023)<<10)+(W&1023)+65536}}if(($&4294901760)===0)X+=3;else X+=4}}return X}function YP1(J,Z,X){let Y=J.length,$=X,W=0;while(W<Y){let Q=J.charCodeAt(W++);if((Q&4294967168)===0){Z[$++]=Q;continue}else if((Q&4294965248)===0)Z[$++]=Q>>6&31|192;else{if(Q>=55296&&Q<=56319){if(W<Y){let K=J.charCodeAt(W);if((K&64512)===56320)++W,Q=((Q&1023)<<10)+(K&1023)+65536}}if((Q&4294901760)===0)Z[$++]=Q>>12&15|224,Z[$++]=Q>>6&63|128;else Z[$++]=Q>>18&7|240,Z[$++]=Q>>12&63|128,Z[$++]=Q>>6&63|128}Z[$++]=Q&63|128}}var $P1=new TextEncoder,WP1=50;function QP1(J,Z,X){$P1.encodeInto(J,Z.subarray(X))}function Ar(J,Z,X){if(J.length>WP1)QP1(J,Z,X);else YP1(J,Z,X)}var KP1=4096;function wC(J,Z,X){let Y=Z,$=Y+X,W=[],Q="";while(Y<$){let K=J[Y++];if((K&128)===0)W.push(K);else if((K&224)===192){let G=J[Y++]&63;W.push((K&31)<<6|G)}else if((K&240)===224){let G=J[Y++]&63,z=J[Y++]&63;W.push((K&31)<<12|G<<6|z)}else if((K&248)===240){let G=J[Y++]&63,z=J[Y++]&63,F=J[Y++]&63,H=(K&7)<<18|G<<12|z<<6|F;if(H>65535)H-=65536,W.push(H>>>10&1023|55296),H=56320|H&1023;W.push(H)}else W.push(K);if(W.length>=KP1)Q+=String.fromCharCode(...W),W.length=0}if(W.length>0)Q+=String.fromCharCode(...W);return Q}var GP1=new TextDecoder,zP1=200;function FP1(J,Z,X){let Y=J.subarray(Z,Z+X);return GP1.decode(Y)}function hr(J,Z,X){if(X>zP1)return FP1(J,Z,X);else return wC(J,Z,X)}class zW{constructor(J,Z){this.type=J,this.data=Z}}class k6 extends Error{constructor(J){super(J);let Z=Object.create(k6.prototype);Object.setPrototypeOf(this,Z),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:k6.name})}}var FW=4294967295;function yr(J,Z,X){let Y=X/4294967296,$=X;J.setUint32(Z,Y),J.setUint32(Z+4,$)}function Bw(J,Z,X){let Y=Math.floor(X/4294967296),$=X;J.setUint32(Z,Y),J.setUint32(Z+4,$)}function jw(J,Z){let X=J.getInt32(Z),Y=J.getUint32(Z+4);return X*4294967296+Y}function fr(J,Z){let X=J.getUint32(Z),Y=J.getUint32(Z+4);return X*4294967296+Y}var HP1=-1,qP1=4294967295,VP1=17179869183;function UP1({sec:J,nsec:Z}){if(J>=0&&Z>=0&&J<=VP1)if(Z===0&&J<=qP1){let X=new Uint8Array(4);return new DataView(X.buffer).setUint32(0,J),X}else{let X=J/4294967296,Y=J&4294967295,$=new Uint8Array(8),W=new DataView($.buffer);return W.setUint32(0,Z<<2|X&3),W.setUint32(4,Y),$}else{let X=new Uint8Array(12),Y=new DataView(X.buffer);return Y.setUint32(0,Z),Bw(Y,4,J),X}}function wP1(J){let Z=J.getTime(),X=Math.floor(Z/1000),Y=(Z-X*1000)*1e6,$=Math.floor(Y/1e9);return{sec:X+$,nsec:Y-$*1e9}}function LP1(J){if(J instanceof Date){let Z=wP1(J);return UP1(Z)}else return null}function BP1(J){let Z=new DataView(J.buffer,J.byteOffset,J.byteLength);switch(J.byteLength){case 4:{let X=Z.getUint32(0),Y=0;return{sec:X,nsec:0}}case 8:{let X=Z.getUint32(0),Y=Z.getUint32(4),$=(X&3)*4294967296+Y,W=X>>>2;return{sec:$,nsec:W}}case 12:{let X=jw(Z,4),Y=Z.getUint32(0);return{sec:X,nsec:Y}}default:throw new k6(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${J.length}`)}}function jP1(J){let Z=BP1(J);return new Date(Z.sec*1000+Z.nsec/1e6)}var br={type:HP1,encode:LP1,decode:jP1};class vX{constructor(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(br)}register({type:J,encode:Z,decode:X}){if(J>=0)this.encoders[J]=Z,this.decoders[J]=X;else{let Y=-1-J;this.builtInEncoders[Y]=Z,this.builtInDecoders[Y]=X}}tryToEncode(J,Z){for(let X=0;X<this.builtInEncoders.length;X++){let Y=this.builtInEncoders[X];if(Y!=null){let $=Y(J,Z);if($!=null){let W=-1-X;return new zW(W,$)}}}for(let X=0;X<this.encoders.length;X++){let Y=this.encoders[X];if(Y!=null){let $=Y(J,Z);if($!=null)return new zW(X,$)}}if(J instanceof zW)return J;return null}decode(J,Z,X){let Y=Z<0?this.builtInDecoders[-1-Z]:this.decoders[Z];if(Y)return Y(J,Z,X);else return new zW(Z,J)}}vX.defaultCodec=new vX;function OP1(J){return J instanceof ArrayBuffer||typeof SharedArrayBuffer!=="undefined"&&J instanceof SharedArrayBuffer}function rG(J){if(J instanceof Uint8Array)return J;else if(ArrayBuffer.isView(J))return new Uint8Array(J.buffer,J.byteOffset,J.byteLength);else if(OP1(J))return new Uint8Array(J);else return Uint8Array.from(J)}var MP1=100,RP1=2048;class Ow{constructor(J){this.entered=!1,this.extensionCodec=J?.extensionCodec??vX.defaultCodec,this.context=J?.context,this.useBigInt64=J?.useBigInt64??!1,this.maxDepth=J?.maxDepth??MP1,this.initialBufferSize=J?.initialBufferSize??RP1,this.sortKeys=J?.sortKeys??!1,this.forceFloat32=J?.forceFloat32??!1,this.ignoreUndefined=J?.ignoreUndefined??!1,this.forceIntegerToFloat=J?.forceIntegerToFloat??!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}clone(){return new Ow({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,maxDepth:this.maxDepth,initialBufferSize:this.initialBufferSize,sortKeys:this.sortKeys,forceFloat32:this.forceFloat32,ignoreUndefined:this.ignoreUndefined,forceIntegerToFloat:this.forceIntegerToFloat})}reinitializeState(){this.pos=0}encodeSharedRef(J){if(this.entered)return this.clone().encodeSharedRef(J);try{return this.entered=!0,this.reinitializeState(),this.doEncode(J,1),this.bytes.subarray(0,this.pos)}finally{this.entered=!1}}encode(J){if(this.entered)return this.clone().encode(J);try{return this.entered=!0,this.reinitializeState(),this.doEncode(J,1),this.bytes.slice(0,this.pos)}finally{this.entered=!1}}doEncode(J,Z){if(Z>this.maxDepth)throw new Error(`Too deep objects in depth ${Z}`);if(J==null)this.encodeNil();else if(typeof J==="boolean")this.encodeBoolean(J);else if(typeof J==="number")if(!this.forceIntegerToFloat)this.encodeNumber(J);else this.encodeNumberAsFloat(J);else if(typeof J==="string")this.encodeString(J);else if(this.useBigInt64&&typeof J==="bigint")this.encodeBigInt64(J);else this.encodeObject(J,Z)}ensureBufferSizeToWrite(J){let Z=this.pos+J;if(this.view.byteLength<Z)this.resizeBuffer(Z*2)}resizeBuffer(J){let Z=new ArrayBuffer(J),X=new Uint8Array(Z),Y=new DataView(Z);X.set(this.bytes),this.view=Y,this.bytes=X}encodeNil(){this.writeU8(192)}encodeBoolean(J){if(J===!1)this.writeU8(194);else this.writeU8(195)}encodeNumber(J){if(!this.forceIntegerToFloat&&Number.isSafeInteger(J))if(J>=0)if(J<128)this.writeU8(J);else if(J<256)this.writeU8(204),this.writeU8(J);else if(J<65536)this.writeU8(205),this.writeU16(J);else if(J<4294967296)this.writeU8(206),this.writeU32(J);else if(!this.useBigInt64)this.writeU8(207),this.writeU64(J);else this.encodeNumberAsFloat(J);else if(J>=-32)this.writeU8(224|J+32);else if(J>=-128)this.writeU8(208),this.writeI8(J);else if(J>=-32768)this.writeU8(209),this.writeI16(J);else if(J>=-2147483648)this.writeU8(210),this.writeI32(J);else if(!this.useBigInt64)this.writeU8(211),this.writeI64(J);else this.encodeNumberAsFloat(J);else this.encodeNumberAsFloat(J)}encodeNumberAsFloat(J){if(this.forceFloat32)this.writeU8(202),this.writeF32(J);else this.writeU8(203),this.writeF64(J)}encodeBigInt64(J){if(J>=BigInt(0))this.writeU8(207),this.writeBigUint64(J);else this.writeU8(211),this.writeBigInt64(J)}writeStringHeader(J){if(J<32)this.writeU8(160+J);else if(J<256)this.writeU8(217),this.writeU8(J);else if(J<65536)this.writeU8(218),this.writeU16(J);else if(J<4294967296)this.writeU8(219),this.writeU32(J);else throw new Error(`Too long string: ${J} bytes in UTF-8`)}encodeString(J){let X=xr(J);this.ensureBufferSizeToWrite(5+X),this.writeStringHeader(X),Ar(J,this.bytes,this.pos),this.pos+=X}encodeObject(J,Z){let X=this.extensionCodec.tryToEncode(J,this.context);if(X!=null)this.encodeExtension(X);else if(Array.isArray(J))this.encodeArray(J,Z);else if(ArrayBuffer.isView(J))this.encodeBinary(J);else if(typeof J==="object")this.encodeMap(J,Z);else throw new Error(`Unrecognized object: ${Object.prototype.toString.apply(J)}`)}encodeBinary(J){let Z=J.byteLength;if(Z<256)this.writeU8(196),this.writeU8(Z);else if(Z<65536)this.writeU8(197),this.writeU16(Z);else if(Z<4294967296)this.writeU8(198),this.writeU32(Z);else throw new Error(`Too large binary: ${Z}`);let X=rG(J);this.writeU8a(X)}encodeArray(J,Z){let X=J.length;if(X<16)this.writeU8(144+X);else if(X<65536)this.writeU8(220),this.writeU16(X);else if(X<4294967296)this.writeU8(221),this.writeU32(X);else throw new Error(`Too large array: ${X}`);for(let Y of J)this.doEncode(Y,Z+1)}countWithoutUndefined(J,Z){let X=0;for(let Y of Z)if(J[Y]!==void 0)X++;return X}encodeMap(J,Z){let X=Object.keys(J);if(this.sortKeys)X.sort();let Y=this.ignoreUndefined?this.countWithoutUndefined(J,X):X.length;if(Y<16)this.writeU8(128+Y);else if(Y<65536)this.writeU8(222),this.writeU16(Y);else if(Y<4294967296)this.writeU8(223),this.writeU32(Y);else throw new Error(`Too large map object: ${Y}`);for(let $ of X){let W=J[$];if(!(this.ignoreUndefined&&W===void 0))this.encodeString($),this.doEncode(W,Z+1)}}encodeExtension(J){if(typeof J.data==="function"){let X=J.data(this.pos+6),Y=X.length;if(Y>=4294967296)throw new Error(`Too large extension object: ${Y}`);this.writeU8(201),this.writeU32(Y),this.writeI8(J.type),this.writeU8a(X);return}let Z=J.data.length;if(Z===1)this.writeU8(212);else if(Z===2)this.writeU8(213);else if(Z===4)this.writeU8(214);else if(Z===8)this.writeU8(215);else if(Z===16)this.writeU8(216);else if(Z<256)this.writeU8(199),this.writeU8(Z);else if(Z<65536)this.writeU8(200),this.writeU16(Z);else if(Z<4294967296)this.writeU8(201),this.writeU32(Z);else throw new Error(`Too large extension object: ${Z}`);this.writeI8(J.type),this.writeU8a(J.data)}writeU8(J){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,J),this.pos++}writeU8a(J){let Z=J.length;this.ensureBufferSizeToWrite(Z),this.bytes.set(J,this.pos),this.pos+=Z}writeI8(J){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,J),this.pos++}writeU16(J){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,J),this.pos+=2}writeI16(J){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,J),this.pos+=2}writeU32(J){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,J),this.pos+=4}writeI32(J){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,J),this.pos+=4}writeF32(J){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,J),this.pos+=4}writeF64(J){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,J),this.pos+=8}writeU64(J){this.ensureBufferSizeToWrite(8),yr(this.view,this.pos,J),this.pos+=8}writeI64(J){this.ensureBufferSizeToWrite(8),Bw(this.view,this.pos,J),this.pos+=8}writeBigUint64(J){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,J),this.pos+=8}writeBigInt64(J){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,J),this.pos+=8}}function LC(J,Z){return new Ow(Z).encodeSharedRef(J)}function Mw(J){return`${J<0?"-":""}0x${Math.abs(J).toString(16).padStart(2,"0")}`}var NP1=16,PP1=16;class BC{constructor(J=NP1,Z=PP1){this.hit=0,this.miss=0,this.maxKeyLength=J,this.maxLengthPerKey=Z,this.caches=[];for(let X=0;X<this.maxKeyLength;X++)this.caches.push([])}canBeCached(J){return J>0&&J<=this.maxKeyLength}find(J,Z,X){let Y=this.caches[X-1];J:for(let $ of Y){let W=$.bytes;for(let Q=0;Q<X;Q++)if(W[Q]!==J[Z+Q])continue J;return $.str}return null}store(J,Z){let X=this.caches[J.length-1],Y={bytes:J,str:Z};if(X.length>=this.maxLengthPerKey)X[Math.random()*X.length|0]=Y;else X.push(Y)}decode(J,Z,X){let Y=this.find(J,Z,X);if(Y!=null)return this.hit++,Y;this.miss++;let $=wC(J,Z,X),W=Uint8Array.prototype.slice.call(J,Z,Z+X);return this.store(W,$),$}}var jC="array",eG="map_key",mr="map_value",DP1=(J)=>{if(typeof J==="string"||typeof J==="number")return J;throw new k6("The type of key must be string or number but "+typeof J)};class dr{constructor(){this.stack=[],this.stackHeadPosition=-1}get length(){return this.stackHeadPosition+1}top(){return this.stack[this.stackHeadPosition]}pushArrayState(J){let Z=this.getUninitializedStateFromPool();Z.type=jC,Z.position=0,Z.size=J,Z.array=new Array(J)}pushMapState(J){let Z=this.getUninitializedStateFromPool();Z.type=eG,Z.readCount=0,Z.size=J,Z.map={}}getUninitializedStateFromPool(){if(this.stackHeadPosition++,this.stackHeadPosition===this.stack.length){let J={type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null};this.stack.push(J)}return this.stack[this.stackHeadPosition]}release(J){if(this.stack[this.stackHeadPosition]!==J)throw new Error("Invalid stack state. Released state is not on top of the stack.");if(J.type===jC){let X=J;X.size=0,X.array=void 0,X.position=0,X.type=void 0}if(J.type===eG||J.type===mr){let X=J;X.size=0,X.map=void 0,X.readCount=0,X.type=void 0}this.stackHeadPosition--}reset(){this.stack.length=0,this.stackHeadPosition=-1}}var tG=-1,OC=new DataView(new ArrayBuffer(0)),CP1=new Uint8Array(OC.buffer);try{OC.getInt8(0)}catch(J){if(!(J instanceof RangeError))throw new Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}var gr=new RangeError("Insufficient data"),TP1=new BC;class Rw{constructor(J){this.totalPos=0,this.pos=0,this.view=OC,this.bytes=CP1,this.headByte=tG,this.stack=new dr,this.entered=!1,this.extensionCodec=J?.extensionCodec??vX.defaultCodec,this.context=J?.context,this.useBigInt64=J?.useBigInt64??!1,this.rawStrings=J?.rawStrings??!1,this.maxStrLength=J?.maxStrLength??FW,this.maxBinLength=J?.maxBinLength??FW,this.maxArrayLength=J?.maxArrayLength??FW,this.maxMapLength=J?.maxMapLength??FW,this.maxExtLength=J?.maxExtLength??FW,this.keyDecoder=J?.keyDecoder!==void 0?J.keyDecoder:TP1,this.mapKeyConverter=J?.mapKeyConverter??DP1}clone(){return new Rw({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,rawStrings:this.rawStrings,maxStrLength:this.maxStrLength,maxBinLength:this.maxBinLength,maxArrayLength:this.maxArrayLength,maxMapLength:this.maxMapLength,maxExtLength:this.maxExtLength,keyDecoder:this.keyDecoder})}reinitializeState(){this.totalPos=0,this.headByte=tG,this.stack.reset()}setBuffer(J){let Z=rG(J);this.bytes=Z,this.view=new DataView(Z.buffer,Z.byteOffset,Z.byteLength),this.pos=0}appendBuffer(J){if(this.headByte===tG&&!this.hasRemaining(1))this.setBuffer(J);else{let Z=this.bytes.subarray(this.pos),X=rG(J),Y=new Uint8Array(Z.length+X.length);Y.set(Z),Y.set(X,Z.length),this.setBuffer(Y)}}hasRemaining(J){return this.view.byteLength-this.pos>=J}createExtraByteError(J){let{view:Z,pos:X}=this;return new RangeError(`Extra ${Z.byteLength-X} of ${Z.byteLength} byte(s) found at buffer[${J}]`)}decode(J){if(this.entered)return this.clone().decode(J);try{this.entered=!0,this.reinitializeState(),this.setBuffer(J);let Z=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return Z}finally{this.entered=!1}}*decodeMulti(J){if(this.entered){yield*this.clone().decodeMulti(J);return}try{this.entered=!0,this.reinitializeState(),this.setBuffer(J);while(this.hasRemaining(1))yield this.doDecodeSync()}finally{this.entered=!1}}async decodeAsync(J){if(this.entered)return this.clone().decodeAsync(J);try{this.entered=!0;let Z=!1,X;for await(let Q of J){if(Z)throw this.entered=!1,this.createExtraByteError(this.totalPos);this.appendBuffer(Q);try{X=this.doDecodeSync(),Z=!0}catch(K){if(!(K instanceof RangeError))throw K}this.totalPos+=this.pos}if(Z){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return X}let{headByte:Y,pos:$,totalPos:W}=this;throw new RangeError(`Insufficient data in parsing ${Mw(Y)} at ${W} (${$} in the current buffer)`)}finally{this.entered=!1}}decodeArrayStream(J){return this.decodeMultiAsync(J,!0)}decodeStream(J){return this.decodeMultiAsync(J,!1)}async*decodeMultiAsync(J,Z){if(this.entered){yield*this.clone().decodeMultiAsync(J,Z);return}try{this.entered=!0;let X=Z,Y=-1;for await(let $ of J){if(Z&&Y===0)throw this.createExtraByteError(this.totalPos);if(this.appendBuffer($),X)Y=this.readArraySize(),X=!1,this.complete();try{while(!0)if(yield this.doDecodeSync(),--Y===0)break}catch(W){if(!(W instanceof RangeError))throw W}this.totalPos+=this.pos}}finally{this.entered=!1}}doDecodeSync(){J:while(!0){let J=this.readHeadByte(),Z;if(J>=224)Z=J-256;else if(J<192)if(J<128)Z=J;else if(J<144){let Y=J-128;if(Y!==0){this.pushMapState(Y),this.complete();continue J}else Z={}}else if(J<160){let Y=J-144;if(Y!==0){this.pushArrayState(Y),this.complete();continue J}else Z=[]}else{let Y=J-160;Z=this.decodeString(Y,0)}else if(J===192)Z=null;else if(J===194)Z=!1;else if(J===195)Z=!0;else if(J===202)Z=this.readF32();else if(J===203)Z=this.readF64();else if(J===204)Z=this.readU8();else if(J===205)Z=this.readU16();else if(J===206)Z=this.readU32();else if(J===207)if(this.useBigInt64)Z=this.readU64AsBigInt();else Z=this.readU64();else if(J===208)Z=this.readI8();else if(J===209)Z=this.readI16();else if(J===210)Z=this.readI32();else if(J===211)if(this.useBigInt64)Z=this.readI64AsBigInt();else Z=this.readI64();else if(J===217){let Y=this.lookU8();Z=this.decodeString(Y,1)}else if(J===218){let Y=this.lookU16();Z=this.decodeString(Y,2)}else if(J===219){let Y=this.lookU32();Z=this.decodeString(Y,4)}else if(J===220){let Y=this.readU16();if(Y!==0){this.pushArrayState(Y),this.complete();continue J}else Z=[]}else if(J===221){let Y=this.readU32();if(Y!==0){this.pushArrayState(Y),this.complete();continue J}else Z=[]}else if(J===222){let Y=this.readU16();if(Y!==0){this.pushMapState(Y),this.complete();continue J}else Z={}}else if(J===223){let Y=this.readU32();if(Y!==0){this.pushMapState(Y),this.complete();continue J}else Z={}}else if(J===196){let Y=this.lookU8();Z=this.decodeBinary(Y,1)}else if(J===197){let Y=this.lookU16();Z=this.decodeBinary(Y,2)}else if(J===198){let Y=this.lookU32();Z=this.decodeBinary(Y,4)}else if(J===212)Z=this.decodeExtension(1,0);else if(J===213)Z=this.decodeExtension(2,0);else if(J===214)Z=this.decodeExtension(4,0);else if(J===215)Z=this.decodeExtension(8,0);else if(J===216)Z=this.decodeExtension(16,0);else if(J===199){let Y=this.lookU8();Z=this.decodeExtension(Y,1)}else if(J===200){let Y=this.lookU16();Z=this.decodeExtension(Y,2)}else if(J===201){let Y=this.lookU32();Z=this.decodeExtension(Y,4)}else throw new k6(`Unrecognized type byte: ${Mw(J)}`);this.complete();let X=this.stack;while(X.length>0){let Y=X.top();if(Y.type===jC)if(Y.array[Y.position]=Z,Y.position++,Y.position===Y.size)Z=Y.array,X.release(Y);else continue J;else if(Y.type===eG){if(Z==="__proto__")throw new k6("The key __proto__ is not allowed");Y.key=this.mapKeyConverter(Z),Y.type=mr;continue J}else if(Y.map[Y.key]=Z,Y.readCount++,Y.readCount===Y.size)Z=Y.map,X.release(Y);else{Y.key=null,Y.type=eG;continue J}}return Z}}readHeadByte(){if(this.headByte===tG)this.headByte=this.readU8();return this.headByte}complete(){this.headByte=tG}readArraySize(){let J=this.readHeadByte();switch(J){case 220:return this.readU16();case 221:return this.readU32();default:if(J<160)return J-144;else throw new k6(`Unrecognized array type byte: ${Mw(J)}`)}}pushMapState(J){if(J>this.maxMapLength)throw new k6(`Max length exceeded: map length (${J}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.pushMapState(J)}pushArrayState(J){if(J>this.maxArrayLength)throw new k6(`Max length exceeded: array length (${J}) > maxArrayLength (${this.maxArrayLength})`);this.stack.pushArrayState(J)}decodeString(J,Z){if(!this.rawStrings||this.stateIsMapKey())return this.decodeUtf8String(J,Z);return this.decodeBinary(J,Z)}decodeUtf8String(J,Z){if(J>this.maxStrLength)throw new k6(`Max length exceeded: UTF-8 byte length (${J}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+Z+J)throw gr;let X=this.pos+Z,Y;if(this.stateIsMapKey()&&this.keyDecoder?.canBeCached(J))Y=this.keyDecoder.decode(this.bytes,X,J);else Y=hr(this.bytes,X,J);return this.pos+=Z+J,Y}stateIsMapKey(){if(this.stack.length>0)return this.stack.top().type===eG;return!1}decodeBinary(J,Z){if(J>this.maxBinLength)throw new k6(`Max length exceeded: bin length (${J}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(J+Z))throw gr;let X=this.pos+Z,Y=this.bytes.subarray(X,X+J);return this.pos+=Z+J,Y}decodeExtension(J,Z){if(J>this.maxExtLength)throw new k6(`Max length exceeded: ext length (${J}) > maxExtLength (${this.maxExtLength})`);let X=this.view.getInt8(this.pos+Z),Y=this.decodeBinary(J,Z+1);return this.extensionCodec.decode(Y,X,this.context)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){let J=this.view.getUint8(this.pos);return this.pos++,J}readI8(){let J=this.view.getInt8(this.pos);return this.pos++,J}readU16(){let J=this.view.getUint16(this.pos);return this.pos+=2,J}readI16(){let J=this.view.getInt16(this.pos);return this.pos+=2,J}readU32(){let J=this.view.getUint32(this.pos);return this.pos+=4,J}readI32(){let J=this.view.getInt32(this.pos);return this.pos+=4,J}readU64(){let J=fr(this.view,this.pos);return this.pos+=8,J}readI64(){let J=jw(this.view,this.pos);return this.pos+=8,J}readU64AsBigInt(){let J=this.view.getBigUint64(this.pos);return this.pos+=8,J}readI64AsBigInt(){let J=this.view.getBigInt64(this.pos);return this.pos+=8,J}readF32(){let J=this.view.getFloat32(this.pos);return this.pos+=4,J}readF64(){let J=this.view.getFloat64(this.pos);return this.pos+=8,J}}function MC(J,Z){return new Rw(Z).decode(J)}import{WebSocketServer as ih1}from"ws";import nh1 from"mediasoup";var E2=i(R90(),1);import ch1 from"http";import lh1 from"https";import uW from"fs";import ph1 from"url";var i90=i(l90(),1);import nX from"fs";import p90 from"path";var e3="./dev/persistence";class I4{static instance=new I4;gameId=process.env.HYTOPIA_GAME_ID;lobbyId=process.env.HYTOPIA_LOBBY_ID;_creativeGateway;constructor(){try{this._creativeGateway=new i90.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(`
|
405
|
-
`))}}get isGatewayAvailable(){return!!this._creativeGateway}async getData(J){if(!this._creativeGateway&&process.env.NODE_ENV==="production")return y.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(J):this._readDevDataLocally(J)}async getPlayerLoadout(J){if(!this._creativeGateway)return;return await this._creativeGateway.getLoadout(J)}async getPlayerSession(J){if(!this._creativeGateway)return;return await this._creativeGateway.getSession(J)}async setData(J,Z){if(Z.error)return y.warning("PlatformGateway.setData(): Cannot set data with an error property.");if(!this._creativeGateway&&process.env.NODE_ENV==="production")return y.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(J,Z):this._writeDevDataLocally(J,Z)}_readDevDataLocally(J){try{if(!nX.existsSync(e3))return;let Z=p90.join(e3,`${J}.json`);return JSON.parse(nX.readFileSync(Z,"utf8"))}catch(Z){y.warning(`PlatformGateway._readDevDataLocally(): Failed to read data for key "${J}": ${Z}`)}}_writeDevDataLocally(J,Z){try{if(!nX.existsSync(e3))nX.mkdirSync(e3,{recursive:!0});let X=p90.join(e3,`${J}.json`),Y={};if(nX.existsSync(X))Y=JSON.parse(nX.readFileSync(X,"utf8"));let $={...Y,...Z};nX.writeFileSync(X,JSON.stringify($,null,2),"utf8")}catch(X){y.warning(`PlatformGateway._writeDevDataLocally(): Failed to write data for key "${J}": ${X}`)}}}var Sk=process.env.PORT??8080,_k="0.5.
|
405
|
+
`))}}get isGatewayAvailable(){return!!this._creativeGateway}async getData(J){if(!this._creativeGateway&&process.env.NODE_ENV==="production")return y.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(J):this._readDevDataLocally(J)}async getPlayerLoadout(J){if(!this._creativeGateway)return;return await this._creativeGateway.getLoadout(J)}async getPlayerSession(J){if(!this._creativeGateway)return;return await this._creativeGateway.getSession(J)}async setData(J,Z){if(Z.error)return y.warning("PlatformGateway.setData(): Cannot set data with an error property.");if(!this._creativeGateway&&process.env.NODE_ENV==="production")return y.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(J,Z):this._writeDevDataLocally(J,Z)}_readDevDataLocally(J){try{if(!nX.existsSync(e3))return;let Z=p90.join(e3,`${J}.json`);return JSON.parse(nX.readFileSync(Z,"utf8"))}catch(Z){y.warning(`PlatformGateway._readDevDataLocally(): Failed to read data for key "${J}": ${Z}`)}}_writeDevDataLocally(J,Z){try{if(!nX.existsSync(e3))nX.mkdirSync(e3,{recursive:!0});let X=p90.join(e3,`${J}.json`),Y={};if(nX.existsSync(X))Y=JSON.parse(nX.readFileSync(X,"utf8"));let $={...Y,...Z};nX.writeFileSync(X,JSON.stringify($,null,2),"utf8")}catch(X){y.warning(`PlatformGateway._writeDevDataLocally(): Failed to write data for key "${J}": ${X}`)}}}var Sk=process.env.PORT??8080,_k="0.5.4",xk;(($)=>{$.READY="WEBSERVER.READY";$.STOPPED="WEBSERVER.STOPPED";$.ERROR="WEBSERVER.ERROR";$.UPGRADE="WEBSERVER.UPGRADE"})(xk||={});class cW extends S0{static instance=new cW;_webserver=E2.default();_internalHttpServer;constructor(){super();this._webserver.use((J,Z,X)=>{Z.header("Access-Control-Allow-Origin","*"),X()}),this._webserver.get("/",(J,Z)=>{Z.json({status:"OK",version:_k})}),this._webserver.use(E2.default.static("assets")),this._webserver.use(E2.default.static("node_modules/@hytopia.com/assets"))}start(){if(!this._internalHttpServer)this._internalHttpServer=process.env.NODE_ENV==="production"?ch1.createServer(this._webserver):lh1.createServer({key:uW.existsSync("assets/certs/localhost.key")?uW.readFileSync("assets/certs/localhost.key"):uW.readFileSync("node_modules/@hytopia.com/assets/certs/localhost.key"),cert:uW.existsSync("assets/certs/localhost.crt")?uW.readFileSync("assets/certs/localhost.crt"):uW.readFileSync("node_modules/@hytopia.com/assets/certs/localhost.crt")},this._webserver),this._internalHttpServer.on("upgrade",this._onUpgrade),this._internalHttpServer.on("error",this._onError),this._internalHttpServer.on("close",this._onStopped);else y.warning("WebServer.start(): server already started!");this._internalHttpServer.listen(Sk,this._onStarted),console.info(`WebServer.start(): Server running on port ${Sk}.`)}stop(){if(this._internalHttpServer)return new Promise((J,Z)=>{this._internalHttpServer.close((X)=>{if(X)Z(X);else J(!0)})});else return y.warning("WebServer.stop(): server not started."),Promise.resolve(!1)}_onStarted=()=>{this.emitWithGlobal("WEBSERVER.READY",{})};_onUpgrade=async(J,Z,X)=>{let Y=ph1.parse(J.url??"",!0).query,$=Y.connectionId?.toString()??void 0,W=Y.sessionToken?.toString()??"",Q=await I4.instance.getPlayerSession(W);if($)J.connectionId=$;if(Q)if(!Q.error)J.session=Q;else{let K=`${Q.error.code}: ${Q.error.message}`;Z.write(`HTTP/1.1 401 Unauthorized\r
|
406
406
|
`),Z.write(`Content-Type: text/plain\r
|
407
407
|
`),Z.write(`Content-Length: ${K.length}\r
|
408
408
|
`),Z.write(`Connection: close\r
|