@dcl/playground-assets 7.1.18-5149174868.commit-b3b683f → 7.1.18-5157707330.commit-091fce4

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ Error generating stack: `+m.message+`
8
8
  `+(l.join(" > ")+`
9
9
 
10
10
  No matching component was found for:
11
- `)+t.join(" > ")}return null},a.getPublicRootInstance=function(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return xe(t.child.stateNode);default:return t.child.stateNode}},a.injectIntoDevTools=function(t){if(t={bundleType:t.bundleType,version:t.version,rendererPackageName:t.rendererPackageName,rendererConfig:t.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:f.ReactCurrentDispatcher,findHostInstanceByFiber:Fy,findFiberByHostInstance:t.findFiberByHostInstance||Ly,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")t=!1;else{var n=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(n.isDisabled||!n.supportsFiber)t=!0;else{try{Hu=n.inject(t),sr=n}catch{}t=!!n.checkDCE}}return t},a.isAlreadyRendering=function(){return!1},a.observeVisibleRects=function(t,n,s,l){if(!kr)throw Error(p(363));t=pl(t,n);var d=Ri(t,s,l).disconnect;return{disconnect:function(){d()}}},a.registerMutableSourceForHydration=function(t,n){var s=n._getVersion;s=s(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s)},a.runWithPriority=function(t,n){var s=He;try{return He=t,n()}finally{He=s}},a.shouldError=function(){return null},a.shouldSuspend=function(){return!1},a.updateContainer=function(t,n,s,l){var d=n.current,m=tn(),g=Kr(d);return s=k0(s),n.context===null?n.context=s:n.pendingContext=s,n=Cr(m,g),n.payload={element:t},l=l===void 0?null:l,l!==null&&(n.callback=l),t=Qr(d,n,g),t!==null&&(Mn(t,d,g,m),Zu(t,d,g)),g},a}});var _1=lt((Xw,x1)=>{"use strict";x1.exports=g1()});var kx={};b0(kx,{AMOUNT_VERSION_AVAILABLE:()=>E3,Animator:()=>Ag,AppendValueOperation:()=>Wo,AudioSource:()=>M3,AudioStream:()=>F3,AvatarAnchorPointType:()=>Ms,AvatarAttach:()=>L3,AvatarModifierArea:()=>D3,AvatarModifierType:()=>Ls,AvatarShape:()=>W3,AvatarTexture:()=>pu,BackgroundTextureMode:()=>ac,Billboard:()=>H3,BillboardMode:()=>Hs,BorderRect:()=>Wr,Button:()=>C1,CRDT_MESSAGE_HEADER_LENGTH:()=>kn,CameraMode:()=>V3,CameraModeArea:()=>j3,CameraType:()=>Sd,ColliderLayer:()=>Qs,Color3:()=>Nl,Color4:()=>su,ComponentType:()=>pd,Composite:()=>Gr,CrdtMessageProtocol:()=>Rn,CrdtMessageType:()=>Ne,DEG2RAD:()=>Hi,DeleteComponent:()=>Vr,DeleteEntity:()=>Ta,Dropdown:()=>z1,Engine:()=>md,EngineInfo:()=>G3,EntityContainer:()=>sd,EntityMappingMode:()=>yi,EntityState:()=>on,EntityUtils:()=>tr,Epsilon:()=>bl,Font:()=>Rd,GltfContainer:()=>Y3,GltfContainerLoadingState:()=>q3,Input:()=>P1,InputAction:()=>Ed,Label:()=>O1,LoadingState:()=>vd,MAX_ENTITY_NUMBER:()=>ud,MAX_U16:()=>Do,Material:()=>Ig,MaterialTransparencyMode:()=>Js,Matrix:()=>Ln,MeshCollider:()=>Pg,MeshRenderer:()=>zg,MessageBus:()=>Jd,NftFrameType:()=>Xs,NftShape:()=>J3,Observable:()=>Vt,Observer:()=>Cu,ObserverEventState:()=>Ou,PBAnimationState:()=>Gi,PBAnimator:()=>io,PBAudioSource:()=>ao,PBAudioStream:()=>uo,PBAvatarAttach:()=>so,PBAvatarModifierArea:()=>co,PBAvatarShape:()=>fo,PBBillboard:()=>lo,PBCameraMode:()=>po,PBCameraModeArea:()=>mo,PBEngineInfo:()=>ho,PBGltfContainer:()=>yo,PBGltfContainerLoadingState:()=>go,PBMaterial:()=>xo,PBMaterial_PbrMaterial:()=>Qi,PBMaterial_UnlitMaterial:()=>Ji,PBMeshCollider:()=>_o,PBMeshCollider_BoxMesh:()=>Zi,PBMeshCollider_CylinderMesh:()=>Xi,PBMeshCollider_PlaneMesh:()=>Ki,PBMeshCollider_SphereMesh:()=>$i,PBMeshRenderer:()=>So,PBMeshRenderer_BoxMesh:()=>ea,PBMeshRenderer_CylinderMesh:()=>ta,PBMeshRenderer_PlaneMesh:()=>na,PBMeshRenderer_SphereMesh:()=>ra,PBNftShape:()=>Eo,PBPointerEvents:()=>To,PBPointerEventsResult:()=>vo,PBPointerEvents_Entry:()=>ia,PBPointerEvents_Info:()=>oa,PBPointerLock:()=>ko,PBRaycast:()=>Ro,PBRaycastResult:()=>wo,PBTextShape:()=>bo,PBUiBackground:()=>No,PBUiCanvasInformation:()=>Ao,PBUiDropdown:()=>Io,PBUiDropdownResult:()=>zo,PBUiInput:()=>Po,PBUiInputResult:()=>Oo,PBUiText:()=>Co,PBUiTransform:()=>Uo,PBVideoEvent:()=>Bo,PBVideoPlayer:()=>Mo,PBVisibilityComponent:()=>Fo,Plane:()=>uu,PointerEventType:()=>Td,PointerEvents:()=>Q3,PointerEventsResult:()=>Z3,PointerLock:()=>X3,ProcessMessageResultType:()=>xn,PutComponentOperation:()=>jr,Quaternion:()=>Jt,RAD2DEG:()=>Vi,RESERVED_STATIC_ENTITIES:()=>Nu,Raycast:()=>K3,RaycastHit:()=>Dr,RaycastQueryType:()=>nc,RaycastResult:()=>$3,ReactEcs:()=>V1,ReactEcsRenderer:()=>gx,Rect:()=>ql,Scalar:()=>nt,Schemas:()=>yn,TextAlignMode:()=>kd,TextShape:()=>eg,Texture:()=>du,TextureFilterMode:()=>Yl,TextureUnion:()=>Qt,TextureWrapMode:()=>Gl,ToGammaSpace:()=>Fr,ToLinearSpace:()=>Lr,Transform:()=>Ng,UiBackground:()=>tg,UiCanvasInformation:()=>ng,UiDropdown:()=>rg,UiDropdownResult:()=>og,UiEntity:()=>hx,UiInput:()=>ig,UiInputResult:()=>ag,UiText:()=>ug,UiTransform:()=>sg,Vector3:()=>ie,VideoEvent:()=>cg,VideoPlayer:()=>fg,VideoState:()=>kc,VideoTexture:()=>mu,VisibilityComponent:()=>lg,YGAlign:()=>hc,YGDisplay:()=>Ec,YGEdge:()=>Tc,YGFlexDirection:()=>gc,YGJustify:()=>_c,YGOverflow:()=>Sc,YGPositionType:()=>mc,YGUnit:()=>yc,YGWrap:()=>xc,componentDefinitionByName:()=>hu,components:()=>er,createEthereumProvider:()=>Ex,createInputSystem:()=>dd,createPointerEventsSystem:()=>yd,createRaycastSystem:()=>gd,createReactBasedUiSystem:()=>jd,createTaskSystem:()=>hd,createVideoEventsSystem:()=>xd,cyclicParentingChecker:()=>Mh,deepReadonly:()=>Kc,engine:()=>Re,executeTask:()=>U3,getComponentEntityTree:()=>Bh,getCompositeRootComponent:()=>$c,inputSystem:()=>Ch,isListener:()=>Na,onCommsMessage:()=>Uu,onEnterScene:()=>xx,onEnterSceneObservable:()=>Gd,onLeaveScene:()=>_x,onLeaveSceneObservable:()=>Yd,onPlayerClickedObservable:()=>$1,onPlayerConnectedObservable:()=>Z1,onPlayerDisconnectedObservable:()=>X1,onPlayerExpressionObservable:()=>q1,onProfileChanged:()=>Q1,onRealmChangedObservable:()=>K1,onSceneReadyObservable:()=>Y1,onStart:()=>vx,onUpdate:()=>Tx,onVideoEvent:()=>J1,pointerEventsSystem:()=>_d,pollEvents:()=>qd,raycastSystem:()=>O3,removeEntityWithChildren:()=>B3,rendererTransport:()=>gf,setSubscribeFunction:()=>Sx,videoEventsSystem:()=>C3});module.exports=Yy(kx);var Fr=.45454545454545453,Lr=2.2,bl=1e-6,Hi=Math.PI/180,Vi=360/(Math.PI*2);var nt;(function(e){e.TwoPi=Math.PI*2;function r(q,J,ae=1401298e-51){let ge=q-J;return-ae<=ge&&ge<=ae}e.withinEpsilon=r;function a(q){let J=q.toString(16);return q<=15?("0"+J).toUpperCase():J.toUpperCase()}e.toHex=a;function o(q){let J=+q;return J===0||isNaN(J)?J:J>0?1:-1}e.sign=o;function u(q,J=0,ae=1){return Math.min(ae,Math.max(J,q))}e.clamp=u;function i(q){return Math.log(q)*Math.LOG2E}e.log2=i;function p(q,J){return q-Math.floor(q/J)*J}e.repeat=p;function f(q,J,ae){return(q-J)/(ae-J)}e.normalize=f;function c(q,J,ae){return q*(ae-J)+J}e.denormalize=c;function y(q,J){let ae=p(J-q,360);return ae>180&&(ae-=360),ae}e.deltaAngle=y;function R(q,J){let ae=p(q,J*2);return J-Math.abs(ae-J)}e.pingPong=R;function T(q,J,ae){let ge=u(ae);return ge=-2*ge*ge*ge+3*ge*ge,J*ge+q*(1-ge)}e.smoothStep=T;function w(q,J,ae){let ge=0;return Math.abs(J-q)<=ae?ge=J:ge=q+o(J-q)*ae,ge}e.moveTowards=w;function D(q,J,ae){let ge=y(q,J),Z=0;return-ae<ge&&ge<ae?Z=J:Z=w(q,q+ge,ae),Z}e.moveTowardsAngle=D;function B(q,J,ae){return q+(J-q)*ae}e.lerp=B;function P(q,J,ae){let ge=p(J-q,360);return ge>180&&(ge-=360),q+ge*u(ae)}e.lerpAngle=P;function Y(q,J,ae){let ge=0;return q!==J?ge=u((ae-q)/(J-q)):ge=0,ge}e.inverseLerp=Y;function W(q,J,ae,ge,Z){let v=Z*Z,z=Z*v,V=2*z-3*v+1,X=-2*z+3*v,ue=z-2*v+Z,xe=z-v;return q*V+ae*X+J*ue+ge*xe}e.hermite=W;function Q(q,J){return q===J?q:Math.random()*(J-q)+q}e.randomRange=Q;function ce(q,J,ae){return(q-J)/(ae-J)}e.rangeToPercent=ce;function $(q,J,ae){return(ae-J)*q+J}e.percentToRange=$;function ye(q){return q-e.TwoPi*Math.floor((q+Math.PI)/e.TwoPi)}e.normalizeRadians=ye})(nt||(nt={}));var ie;(function(e){function r(_){let k=Math.abs(_.x),C=Math.abs(_.y);if(k!==C)return!0;let oe=Math.abs(_.z);return k!==oe}e.isNonUniform=r;function a(_=0,k=0,C=0){return{x:_,y:k,z:C}}e.create=a;function o(_,k){return{x:_.x+k.x,y:_.y+k.y,z:_.z+k.z}}e.add=o;function u(_,k,C){C.x=_.x+k.x,C.y=_.y+k.y,C.z=_.z+k.z}e.addToRef=u;function i(_,k){return{x:_.x-k.x,y:_.y-k.y,z:_.z-k.z}}e.subtract=i;function p(_,k,C){C.x=_.x-k.x,C.y=_.y-k.y,C.z=_.z-k.z}e.subtractToRef=p;function f(_,k,C,oe,te){te.x=_.x-k,te.y=_.y-C,te.z=_.z-oe}e.subtractFromFloatsToRef=f;function c(_){return{x:-_.x,y:-_.y,z:-_.z}}e.negate=c;function y(_,k){k.x=_.x,k.y=_.y,k.z=_.z}e.copyFrom=y;function R(_,k,C,oe){oe.x=_,oe.y=k,oe.z=C}e.copyFromFloats=R;function T(_){return a(_.x,_.y,_.z)}e.clone=T;function w(_,k,C,oe){let te=Z(_,C)-oe,de=Z(k,C)-oe;return te/(te-de)}e.getClipFactor=w;function D(_,k,C){let oe=ae(_),te=ae(k),de=Z(oe,te),ve=a();return Fe(oe,te,ve),Z(ve,C)>0?Math.acos(de):-Math.acos(de)}e.getAngleBetweenVectors=D;function B(_,k=0){return a(_[k],_[k+1],_[k+2])}e.fromArray=B;function P(_,k){return B(_,k)}e.fromFloatArray=P;function Y(_,k,C){C.x=_[k],C.y=_[k+1],C.z=_[k+2]}e.fromArrayToRef=Y;function W(_,k,C){return Y(_,k,C)}e.fromFloatArrayToRef=W;function Q(_){return Math.sqrt(_.x*_.x+_.y*_.y+_.z*_.z)}e.length=Q;function ce(_){return _.x*_.x+_.y*_.y+_.z*_.z}e.lengthSquared=ce;function $(_,k,C){C.x=_.x*k,C.y=_.y*k,C.z=_.z*k}e.scaleToRef=$;function ye(_,k){return a(_.x*k,_.y*k,_.z*k)}e.scale=ye;function q(_,k){let C=a(0,0,0);return J(_,k,C),C}e.normalizeFromLength=q;function J(_,k,C){if(k===0||k===1){y(_,C);return}$(_,1/k,C)}e.normalizeFromLengthToRef=J;function ae(_){return q(_,Q(_))}e.normalize=ae;function ge(_,k){J(_,Q(_),k)}e.normalizeToRef=ge;function Z(_,k){return _.x*k.x+_.y*k.y+_.z*k.z}e.dot=Z;function v(_,k){let C=T(_);return z(_,k,C),C}e.applyMatrix4=v;function z(_,k,C){let{x:oe,y:te,z:de}=_,ve=k._m,dt=1/(ve[3]*oe+ve[7]*te+ve[11]*de+ve[15]);C.x=(ve[0]*oe+ve[4]*te+ve[8]*de+ve[12])*dt,C.y=(ve[1]*oe+ve[5]*te+ve[9]*de+ve[13])*dt,C.z=(ve[2]*oe+ve[6]*te+ve[10]*de+ve[14])*dt}e.applyMatrix4ToRef=z;function V(_,k){let C=a();return X(_,k,C),C}e.rotate=V;function X(_,k,C){let{x:oe,y:te,z:de}=_,{x:ve,y:dt,z:It,w:pt}=k,Gn=pt*oe+dt*de-It*te,br=pt*te+It*oe-ve*de,or=pt*de+ve*te-dt*oe,ir=-ve*oe-dt*te-It*de;C.x=Gn*pt+ir*-ve+br*-It-or*-dt,C.y=br*pt+ir*-dt+or*-ve-Gn*-It,C.z=or*pt+ir*-It+Gn*-dt-br*-ve}e.rotateToRef=X;function ue(_,k,C){let oe=a(0,0,0);return xe(_,k,C,oe),oe}e.lerp=ue;function xe(_,k,C,oe){oe.x=_.x+(k.x-_.x)*C,oe.y=_.y+(k.y-_.y)*C,oe.z=_.z+(k.z-_.z)*C}e.lerpToRef=xe;function Pe(_,k){let C=wr();return Fe(_,k,C),C}e.cross=Pe;function Fe(_,k,C){C.x=_.y*k.z-_.z*k.y,C.y=_.z*k.x-_.x*k.z,C.z=_.x*k.y-_.y*k.x}e.crossToRef=Fe;function We(_,k){let C=wr();return Le(_,k,C),C}e.transformCoordinates=We;function Le(_,k,C){return Ze(_.x,_.y,_.z,k,C)}e.transformCoordinatesToRef=Le;function Ze(_,k,C,oe,te){let de=oe._m,ve=_*de[0]+k*de[4]+C*de[8]+de[12],dt=_*de[1]+k*de[5]+C*de[9]+de[13],It=_*de[2]+k*de[6]+C*de[10]+de[14],pt=1/(_*de[3]+k*de[7]+C*de[11]+de[15]);te.x=ve*pt,te.y=dt*pt,te.z=It*pt}e.transformCoordinatesFromFloatsToRef=Ze;function Ve(_,k){let C=wr();return rt(_,k,C),C}e.transformNormal=Ve;function rt(_,k,C){Ce(_.x,_.y,_.z,k,C)}e.transformNormalToRef=rt;function Ce(_,k,C,oe,te){let de=oe._m;te.x=_*de[0]+k*de[4]+C*de[8],te.y=_*de[1]+k*de[5]+C*de[9],te.z=_*de[2]+k*de[6]+C*de[10]}e.transformNormalFromFloatsToRef=Ce;function jt(_,k,C,oe,te){let de=te*te,ve=te*de,dt=.5*(2*k.x+(-_.x+C.x)*te+(2*_.x-5*k.x+4*C.x-oe.x)*de+(-_.x+3*k.x-3*C.x+oe.x)*ve),It=.5*(2*k.y+(-_.y+C.y)*te+(2*_.y-5*k.y+4*C.y-oe.y)*de+(-_.y+3*k.y-3*C.y+oe.y)*ve),pt=.5*(2*k.z+(-_.z+C.z)*te+(2*_.z-5*k.z+4*C.z-oe.z)*de+(-_.z+3*k.z-3*C.z+oe.z)*ve);return a(dt,It,pt)}e.catmullRom=jt;function O(_,k,C){let oe=a();return j(_,k,C,oe),oe}e.clamp=O;function j(_,k,C,oe){let te=_.x;te=te>C.x?C.x:te,te=te<k.x?k.x:te;let de=_.y;de=de>C.y?C.y:de,de=de<k.y?k.y:de;let ve=_.z;ve=ve>C.z?C.z:ve,ve=ve<k.z?k.z:ve,R(te,de,ve,oe)}e.clampToRef=j;function re(_,k,C,oe,te){let de=te*te,ve=te*de,dt=2*ve-3*de+1,It=-2*ve+3*de,pt=ve-2*de+te,Gn=ve-de,br=_.x*dt+C.x*It+k.x*pt+oe.x*Gn,or=_.y*dt+C.y*It+k.y*pt+oe.y*Gn,ir=_.z*dt+C.z*It+k.z*pt+oe.z*Gn;return a(br,or,ir)}e.hermite=re;function A(_,k){let C=a();return wi(k,_.x,_.y,_.z,C),C}e.minimize=A;function F(_,k){let C=a();return Ri(_,k.x,k.y,k.z,C),C}e.maximize=F;function le(_,k){return Math.sqrt(Ye(_,k))}e.distance=le;function Ye(_,k){let C=_.x-k.x,oe=_.y-k.y,te=_.z-k.z;return C*C+oe*oe+te*te}e.distanceSquared=Ye;function Zt(_,k){let C=o(_,k);return $(C,.5,C),C}e.center=Zt;function Ia(_,k,C){let oe=wr();return Ei(_,k,C,oe),oe}e.rotationFromAxis=Ia;function Ei(_,k,C,oe){let te=Jt.create();Jt.fromAxisToRotationQuaternionToRef(_,k,C,te),y(Jt.toEulerAngles(te),oe)}e.rotationFromAxisToRef=Ei;function za(_){return`(${_.x}, ${_.y}, ${_.z})`}e.toString=za;function Yo(_){let k=_.x||0;return k=k*397^(_.y||0),k=k*397^(_.z||0),k}e.getHashCode=Yo;function Pa(_,k){return _.x===k.x&&_.y===k.y&&_.z===k.z}e.equals=Pa;function Ti(_,k,C=bl){return nt.withinEpsilon(_.x,k.x,C)&&nt.withinEpsilon(_.y,k.y,C)&&nt.withinEpsilon(_.z,k.z,C)}e.equalsWithEpsilon=Ti;function kr(_,k,C,oe){return _.x===k&&_.y===C&&_.z===oe}e.equalsToFloats=kr;function qo(_,k){let C=a();return st(_,k,C),C}e.multiply=qo;function st(_,k,C){C.x=_.x*k.x,C.y=_.y*k.y,C.z=_.z*k.z}e.multiplyToRef=st;function vi(_,k,C,oe,te){te.x=_.x*k,te.y=_.y*C,te.z=_.z*oe}e.multiplyByFloatsToRef=vi;function Rr(_,k,C,oe){let te=a();return vi(_,k,C,oe,te),te}e.multiplyByFloats=Rr;function ki(_,k){return{x:_.x/k.x,y:_.y/k.y,z:_.z/k.z}}e.divide=ki;function Oa(_,k,C){C.x=_.x/k.x,C.y=_.y/k.y,C.z=_.z/k.z}e.divideToRef=Oa;function Ri(_,k,C,oe,te){k>_.x?te.x=k:te.x=_.x,C>_.y?te.y=C:te.y=_.y,oe>_.z?te.z=oe:te.z=_.z}e.maximizeInPlaceFromFloatsToRef=Ri;function wi(_,k,C,oe,te){k<_.x?te.x=k:te.x=_.x,C<_.y?te.y=C:te.y=_.y,oe<_.z?te.z=oe:te.z=_.z}e.minimizeInPlaceFromFloatsToRef=wi;function Ca(_){return a(Math.floor(_.x),Math.floor(_.y),Math.floor(_.z))}e.floor=Ca;function bi(_){return a(_.x-Math.floor(_.x),_.y-Math.floor(_.y),_.z-Math.floor(_.z))}e.fract=bi;function wr(){return a(0,0,0)}e.Zero=wr;function Ua(){return a(1,1,1)}e.One=Ua;function Jo(){return a(0,1,0)}e.Up=Jo;function Ba(){return a(0,-1,0)}e.Down=Ba;function Ma(){return a(0,0,1)}e.Forward=Ma;function Ni(){return a(0,0,-1)}e.Backward=Ni;function Qo(){return a(1,0,0)}e.Right=Qo;function Fa(){return a(-1,0,0)}e.Left=Fa;function La(){return a(Math.random(),Math.random(),Math.random())}e.Random=La})(ie||(ie={}));var uu;(function(e){function r(P,Y,W,Q){return{normal:ie.create(P,Y,W),d:Q}}e.create=r;function a(P){return r(P[0],P[1],P[2],P[3])}e.fromArray=a;function o(P,Y,W){return r(0,0,0,0)}e.fromPoints=o;function u(P,Y){let W=r(0,0,0,0);return W.normal=ie.normalize(Y),W.d=-(Y.x*P.x+Y.y*P.y+Y.z*P.z),W}e.romPositionAndNormal=u;function i(P,Y,W){let Q=-(Y.x*P.x+Y.y*P.y+Y.z*P.z);return ie.dot(W,Y)+Q}e.signedDistanceToPlaneFromPositionAndNormal=i;function p(P){return[P.normal.x,P.normal.y,P.normal.z,P.d]}e.asArray=p;function f(P){return r(P.normal.x,P.normal.y,P.normal.z,P.d)}e.clone=f;function c(P){return 0}e.getHashCode=c;function y(P){let Y=r(0,0,0,0),W=Math.sqrt(P.normal.x*P.normal.x+P.normal.y*P.normal.y+P.normal.z*P.normal.z),Q=0;return W!==0&&(Q=1/W),Y.normal.x=P.normal.x*Q,Y.normal.y=P.normal.y*Q,Y.normal.z=P.normal.z*Q,Y.d*=Q,P}e.normalize=y;function R(P,Y){let W=Ln.create();Ln.transposeToRef(Y,W);let Q=W._m,ce=P.normal.x,$=P.normal.y,ye=P.normal.z,q=P.d,J=ce*Q[0]+$*Q[1]+ye*Q[2]+q*Q[3],ae=ce*Q[4]+$*Q[5]+ye*Q[6]+q*Q[7],ge=ce*Q[8]+$*Q[9]+ye*Q[10]+q*Q[11],Z=ce*Q[12]+$*Q[13]+ye*Q[14]+q*Q[15];return r(J,ae,ge,Z)}e.transform=R;function T(P,Y){return P.normal.x*Y.x+P.normal.y*Y.y+P.normal.z*Y.z+P.d}e.dotCoordinate=T;function w(P,Y,W){let Q=Y.x-P.x,ce=Y.y-P.y,$=Y.z-P.z,ye=W.x-P.x,q=W.y-P.y,J=W.z-P.z,ae=ce*J-$*q,ge=$*ye-Q*J,Z=Q*q-ce*ye,v=Math.sqrt(ae*ae+ge*ge+Z*Z),z;v!==0?z=1/v:z=0;let V=ie.create(ae*z,ge*z,Z*z);return{normal:V,d:-(V.x*P.x+V.y*P.y+V.z*P.z)}}e.copyFromPoints=w;function D(P,Y,W){return ie.dot(P.normal,Y)<=W}e.isFrontFacingTo=D;function B(P,Y){return ie.dot(Y,P.normal)+P.d}e.signedDistanceTo=B})(uu||(uu={}));var Ln;(function(e){function r(h){return h._m}e.m=r;let a=0,o={};function u(){return o}e.IdentityReadonly=u;function i(){let h={updateFlag:0,isIdentity:!1,isIdentity3x2:!0,_isIdentityDirty:!0,_isIdentity3x2Dirty:!0,_m:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]};return zt(h,!1),h}e.create=i;function p(h,x=0){let S=i();return f(h,x,S),S}e.fromArray=p;function f(h,x,S){for(let E=0;E<16;E++)S._m[E]=h[E+x];st(S)}e.fromArrayToRef=f;function c(h,x,S,E){for(let N=0;N<16;N++)E._m[N]=h[N+x]*S;st(E)}e.fromFloatArrayToRefScaled=c;function y(h,x,S,E,N,G,H,ee,me,Te,we,je,ke,et,ct,St,mt){let Se=mt._m;Se[0]=h,Se[1]=x,Se[2]=S,Se[3]=E,Se[4]=N,Se[5]=G,Se[6]=H,Se[7]=ee,Se[8]=me,Se[9]=Te,Se[10]=we,Se[11]=je,Se[12]=ke,Se[13]=et,Se[14]=ct,Se[15]=St,st(mt)}e.fromValuesToRef=y;function R(h,x,S,E,N,G,H,ee,me,Te,we,je,ke,et,ct,St){let mt=i(),Se=mt._m;return Se[0]=h,Se[1]=x,Se[2]=S,Se[3]=E,Se[4]=N,Se[5]=G,Se[6]=H,Se[7]=ee,Se[8]=me,Se[9]=Te,Se[10]=we,Se[11]=je,Se[12]=ke,Se[13]=et,Se[14]=ct,Se[15]=St,st(mt),mt}e.fromValues=R;function T(h,x,S){let E=i();return w(h,x,S,E),E}e.compose=T;function w(h,x,S,E){let N=[i(),i(),i()];v(h.x,h.y,h.z,N[1]),qo(x,N[0]),te(N[1],N[0],E),Qo(E,S)}e.composeToRef=w;function D(){let h=R(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return zt(h,!0),h}e.Identity=D;function B(h){y(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,h),zt(h,!0)}e.IdentityToRef=B;function P(){let h=R(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);return zt(h,!1),h}e.Zero=P;function Y(h){let x=i();return W(h,x),x}e.RotationX=Y;function W(h,x){let S=Math.sin(h),E=Math.cos(h);y(1,0,0,0,0,E,S,0,0,-S,E,0,0,0,0,1,x),zt(x,E===1&&S===0)}e.rotationXToRef=W;function Q(h){let x=i();return ce(h,x),x}e.rotationY=Q;function ce(h,x){let S=Math.sin(h),E=Math.cos(h);y(E,0,-S,0,0,1,0,0,S,0,E,0,0,0,0,1,x),zt(x,E===1&&S===0)}e.rotationYToRef=ce;function $(h){let x=i();return ye(h,x),x}e.rotationZ=$;function ye(h,x){let S=Math.sin(h),E=Math.cos(h);y(E,S,0,0,-S,E,0,0,0,0,1,0,0,0,0,1,x),zt(x,E===1&&S===0)}e.rotationZToRef=ye;function q(h,x){let S=i();return J(h,x,S),S}e.rotationAxis=q;function J(h,x,S){let E=Math.sin(-x),N=Math.cos(-x),G=1-N,H=ie.normalize(h),ee=S._m;ee[0]=H.x*H.x*G+N,ee[1]=H.x*H.y*G-H.z*E,ee[2]=H.x*H.z*G+H.y*E,ee[3]=0,ee[4]=H.y*H.x*G+H.z*E,ee[5]=H.y*H.y*G+N,ee[6]=H.y*H.z*G-H.x*E,ee[7]=0,ee[8]=H.z*H.x*G-H.y*E,ee[9]=H.z*H.y*G+H.x*E,ee[10]=H.z*H.z*G+N,ee[11]=0,ee[12]=0,ee[13]=0,ee[14]=0,ee[15]=1,st(S)}e.rotationAxisToRef=J;function ae(h,x,S){let E=i();return ge(h,x,S,E),E}e.rotationYawPitchRoll=ae;function ge(h,x,S,E){let N=Jt.Zero();Jt.fromRotationYawPitchRollToRef(h,x,S,N),qo(N,E)}e.rotationYawPitchRollToRef=ge;function Z(h,x,S){let E=i();return v(h,x,S,E),E}e.scaling=Z;function v(h,x,S,E){y(h,0,0,0,0,x,0,0,0,0,S,0,0,0,0,1,E),zt(E,h===1&&x===1&&S===1)}e.scalingToRef=v;function z(h,x,S){let E=i();return V(h,x,S,E),E}e.translation=z;function V(h,x,S,E){y(1,0,0,0,0,1,0,0,0,0,1,0,h,x,S,1,E),zt(E,h===0&&x===0&&S===0)}e.translationToRef=V;function X(h,x,S){let E=i();return ue(h,x,S,E),E}e.lerp=X;function ue(h,x,S,E){for(let N=0;N<16;N++)E._m[N]=h._m[N]*(1-S)+x._m[N]*S;st(E)}e.lerpToRef=ue;function xe(h,x,S){let E=i();return Pe(h,x,S,E),E}e.decomposeLerp=xe;function Pe(h,x,S,E){let N=ie.Zero(),G=Jt.Zero(),H=ie.Zero();pt(h,N,G,H);let ee=ie.Zero(),me=Jt.Zero(),Te=ie.Zero();pt(x,ee,me,Te);let we=ie.Zero();ie.lerpToRef(N,ee,S,we);let je=Jt.Zero();Jt.slerpToRef(G,me,S,je);let ke=ie.Zero();ie.lerpToRef(H,Te,S,ke),w(we,je,ke,E)}e.decomposeLerpToRef=Pe;function Fe(h,x,S){let E=i();return We(h,x,S,E),E}e.LookAtLH=Fe;function We(h,x,S,E){let N=ie.Zero(),G=ie.Zero(),H=ie.Zero();ie.subtractToRef(x,h,H),ie.normalizeToRef(H,H),ie.crossToRef(S,H,N);let ee=ie.lengthSquared(N);ee===0?N.x=1:ie.normalizeFromLengthToRef(N,Math.sqrt(ee),N),ie.crossToRef(H,N,G),ie.normalizeToRef(G,G);let me=-ie.dot(N,h),Te=-ie.dot(G,h),we=-ie.dot(H,h);y(N.x,G.x,H.x,0,N.y,G.y,H.y,0,N.z,G.z,H.z,0,me,Te,we,1,E)}e.lookAtLHToRef=We;function Le(h,x,S){let E=i();return Ze(h,x,S,E),E}e.lookAtRH=Le;function Ze(h,x,S,E){let N=ie.Zero(),G=ie.Zero(),H=ie.Zero();ie.subtractToRef(h,x,H),ie.normalizeToRef(H,H),ie.crossToRef(S,H,N);let ee=ie.lengthSquared(N);ee===0?N.x=1:ie.normalizeFromLengthToRef(N,Math.sqrt(ee),N),ie.crossToRef(H,N,G),ie.normalizeToRef(G,G);let me=-ie.dot(N,h),Te=-ie.dot(G,h),we=-ie.dot(H,h);y(N.x,G.x,H.x,0,N.y,G.y,H.y,0,N.z,G.z,H.z,0,me,Te,we,1,E)}e.lookAtRHToRef=Ze;function Ve(h,x,S,E){let N=i();return rt(h,x,S,E,N),N}e.orthoLH=Ve;function rt(h,x,S,E,N){let G=S,H=E,ee=2/h,me=2/x,Te=2/(H-G),we=-(H+G)/(H-G);y(ee,0,0,0,0,me,0,0,0,0,Te,0,0,0,we,1,N),zt(N,ee===1&&me===1&&Te===1&&we===0)}e.orthoLHToRef=rt;function Ce(h,x,S,E,N,G){let H=i();return jt(h,x,S,E,N,G,H),H}e.OrthoOffCenterLH=Ce;function jt(h,x,S,E,N,G,H){let ee=N,me=G,Te=2/(x-h),we=2/(E-S),je=2/(me-ee),ke=-(me+ee)/(me-ee),et=(h+x)/(h-x),ct=(E+S)/(S-E);y(Te,0,0,0,0,we,0,0,0,0,je,0,et,ct,ke,1,H),st(H)}e.orthoOffCenterLHToRef=jt;function O(h,x,S,E,N,G){let H=i();return j(h,x,S,E,N,G,H),H}e.orthoOffCenterRH=O;function j(h,x,S,E,N,G,H){jt(h,x,S,E,N,G,H),H._m[10]*=-1}e.orthoOffCenterRHToRef=j;function re(h,x,S,E){let N=i(),G=S,H=E,ee=2*G/h,me=2*G/x,Te=(H+G)/(H-G),we=-2*H*G/(H-G);return y(ee,0,0,0,0,me,0,0,0,0,Te,1,0,0,we,0,N),zt(N,!1),N}e.perspectiveLH=re;function A(h,x,S,E){let N=i();return F(h,x,S,E,N),N}e.perspectiveFovLH=A;function F(h,x,S,E,N,G=!0){let H=S,ee=E,me=1/Math.tan(h*.5),Te=G?me/x:me,we=G?me:me*x,je=(ee+H)/(ee-H),ke=-2*ee*H/(ee-H);y(Te,0,0,0,0,we,0,0,0,0,je,1,0,0,ke,0,N),zt(N,!1)}e.perspectiveFovLHToRef=F;function le(h,x,S,E){let N=i();return Ye(h,x,S,E,N),N}e.PerspectiveFovRH=le;function Ye(h,x,S,E,N,G=!0){let H=S,ee=E,me=1/Math.tan(h*.5),Te=G?me/x:me,we=G?me:me*x,je=-(ee+H)/(ee-H),ke=-2*ee*H/(ee-H);y(Te,0,0,0,0,we,0,0,0,0,je,-1,0,0,ke,0,N),zt(N,!1)}e.perspectiveFovRHToRef=Ye;function Zt(h,x,S,E,N=!1){let G=N?-1:1,H=Math.tan(h.upDegrees*Math.PI/180),ee=Math.tan(h.downDegrees*Math.PI/180),me=Math.tan(h.leftDegrees*Math.PI/180),Te=Math.tan(h.rightDegrees*Math.PI/180),we=2/(me+Te),je=2/(H+ee),ke=E._m;ke[0]=we,ke[1]=ke[2]=ke[3]=ke[4]=0,ke[5]=je,ke[6]=ke[7]=0,ke[8]=(me-Te)*we*.5,ke[9]=-((H-ee)*je*.5),ke[10]=-S/(x-S),ke[11]=1*G,ke[12]=ke[13]=ke[15]=0,ke[14]=-(2*S*x)/(S-x),st(E)}e.perspectiveFovWebVRToRef=Zt;function Ia(h){return[h._m[0],h._m[1],h._m[4],h._m[5]]}e.GetAsMatrix2x2=Ia;function Ei(h){return[h._m[0],h._m[1],h._m[2],h._m[4],h._m[5],h._m[6],h._m[8],h._m[9],h._m[10]]}e.GetAsMatrix3x3=Ei;function za(h){let x=i();return Yo(h,x),x}e.transpose=za;function Yo(h,x){let S=x._m,E=h._m;S[0]=E[0],S[1]=E[4],S[2]=E[8],S[3]=E[12],S[4]=E[1],S[5]=E[5],S[6]=E[9],S[7]=E[13],S[8]=E[2],S[9]=E[6],S[10]=E[10],S[11]=E[14],S[12]=E[3],S[13]=E[7],S[14]=E[11],S[15]=E[15],zt(x,h.isIdentity,h._isIdentityDirty)}e.transposeToRef=Yo;function Pa(h){let x=i();return Ti(h,x),x}e.reflection=Pa;function Ti(h,x){let S=uu.normalize(h),E=S.normal.x,N=S.normal.y,G=S.normal.z,H=-2*E,ee=-2*N,me=-2*G;y(H*E+1,ee*E,me*E,0,H*N,ee*N+1,me*N,0,H*G,ee*G,me*G+1,0,H*S.d,ee*S.d,me*S.d,1,x)}e.reflectionToRef=Ti;function kr(h,x,S,E){y(h.x,h.y,h.z,0,x.x,x.y,x.z,0,S.x,S.y,S.z,0,0,0,0,1,E)}e.fromXYZAxesToRef=kr;function qo(h,x){let S=h.x*h.x,E=h.y*h.y,N=h.z*h.z,G=h.x*h.y,H=h.z*h.w,ee=h.z*h.x,me=h.y*h.w,Te=h.y*h.z,we=h.x*h.w;x._m[0]=1-2*(E+N),x._m[1]=2*(G+H),x._m[2]=2*(ee-me),x._m[3]=0,x._m[4]=2*(G-H),x._m[5]=1-2*(N+S),x._m[6]=2*(Te+we),x._m[7]=0,x._m[8]=2*(ee+me),x._m[9]=2*(Te-we),x._m[10]=1-2*(E+S),x._m[11]=0,x._m[12]=0,x._m[13]=0,x._m[14]=0,x._m[15]=1,st(x)}e.fromQuaternionToRef=qo;function st(h){h.updateFlag=a++,h.isIdentity=!1,h.isIdentity3x2=!1,h._isIdentityDirty=!0,h._isIdentity3x2Dirty=!0}function vi(h){if(h._isIdentityDirty){h._isIdentityDirty=!1;let x=h._m;h.isIdentity=x[0]===1&&x[1]===0&&x[2]===0&&x[3]===0&&x[4]===0&&x[5]===1&&x[6]===0&&x[7]===0&&x[8]===0&&x[9]===0&&x[10]===1&&x[11]===0&&x[12]===0&&x[13]===0&&x[14]===0&&x[15]===1}return h.isIdentity}e.isIdentityUpdate=vi;function Rr(h){return h._isIdentity3x2Dirty&&(h._isIdentity3x2Dirty=!1,h._m[0]!==1||h._m[5]!==1||h._m[15]!==1||h._m[1]!==0||h._m[2]!==0||h._m[3]!==0||h._m[4]!==0||h._m[6]!==0||h._m[7]!==0||h._m[8]!==0||h._m[9]!==0||h._m[10]!==0||h._m[11]!==0||h._m[12]!==0||h._m[13]!==0||h._m[14]!==0?h.isIdentity3x2=!1:h.isIdentity3x2=!0),h.isIdentity3x2}e.isIdentityAs3x2Update=Rr;function ki(h){if(h.isIdentity===!0)return 1;let x=h._m,S=x[0],E=x[1],N=x[2],G=x[3],H=x[4],ee=x[5],me=x[6],Te=x[7],we=x[8],je=x[9],ke=x[10],et=x[11],ct=x[12],St=x[13],mt=x[14],Se=x[15],kt=ke*Se-mt*et,Rt=je*Se-St*et,Be=je*mt-St*ke,Ue=we*Se-ct*et,wt=we*mt-ke*ct,$e=we*St-ct*je,ot=+(ee*kt-me*Rt+Te*Be),Gt=-(H*kt-me*Ue+Te*wt),Xt=+(H*Rt-ee*Ue+Te*$e),ht=-(H*Be-ee*wt+me*$e);return S*ot+E*Gt+N*Xt+G*ht}e.determinant=ki;function Oa(h){return h._m}e.toArray=Oa;function Ri(h){return h._m}e.asArray=Ri;function wi(h){y(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,h),zt(h,!1)}e.reset=wi;function Ca(h,x){let S=i();return bi(h,x,S),S}e.add=Ca;function bi(h,x,S){for(let E=0;E<16;E++)S._m[E]=h._m[E]+x._m[E];st(S)}e.addToRef=bi;function wr(h,x){for(let S=0;S<16;S++)h._m[S]+=x._m[S];st(h)}e.addToSelf=wr;function Ua(h){let x=i();return Jo(h,x),x}e.invert=Ua;function Jo(h,x){if(h.isIdentity===!0){C(h,x);return}let S=h._m,E=S[0],N=S[1],G=S[2],H=S[3],ee=S[4],me=S[5],Te=S[6],we=S[7],je=S[8],ke=S[9],et=S[10],ct=S[11],St=S[12],mt=S[13],Se=S[14],kt=S[15],Rt=et*kt-Se*ct,Be=ke*kt-mt*ct,Ue=ke*Se-mt*et,wt=je*kt-St*ct,$e=je*Se-et*St,ot=je*mt-St*ke,Gt=+(me*Rt-Te*Be+we*Ue),Xt=-(ee*Rt-Te*wt+we*$e),ht=+(ee*Be-me*wt+we*ot),Nn=-(ee*Ue-me*$e+Te*ot),ar=E*Gt+N*Xt+G*ht+H*Nn;if(ar===0){C(h,x);return}let yt=1/ar,An=Te*kt-Se*we,ur=me*kt-mt*we,Pt=me*Se-mt*Te,Nr=ee*kt-St*we,Ar=ee*Se-St*Te,Ir=ee*mt-St*me,In=Te*ct-et*we,Zo=me*ct-ke*we,qr=me*et-ke*Te,Xo=ee*ct-je*we,Mu=ee*et-je*Te,Fu=ee*ke-je*me,Wa=-(N*Rt-G*Be+H*Ue),Lu=+(E*Rt-G*wt+H*$e),Ha=-(E*Be-N*wt+H*ot),Ko=+(E*Ue-N*$e+G*ot),Sf=+(N*An-G*ur+H*Pt),Va=-(E*An-G*Nr+H*Ar),He=+(E*ur-N*Nr+H*Ir),Du=-(E*Pt-N*Ar+G*Ir),ja=-(N*In-G*Zo+H*qr),Wu=+(E*In-G*Xo+H*Mu),Ef=-(E*Zo-N*Xo+H*Fu),Tf=+(E*qr-N*Mu+G*Fu);y(Gt*yt,Wa*yt,Sf*yt,ja*yt,Xt*yt,Lu*yt,Va*yt,Wu*yt,ht*yt,Ha*yt,He*yt,Ef*yt,Nn*yt,Ko*yt,Du*yt,Tf*yt,x)}e.invertToRef=Jo;function Ba(h,x,S){h._m[x]+=S,st(h)}e.addAtIndex=Ba;function Ma(h,x,S){return h._m[x]*=S,st(h),h}e.multiplyAtIndex=Ma;function Ni(h,x,S,E){h._m[12]=x,h._m[13]=S,h._m[14]=E,st(h)}e.setTranslationFromFloats=Ni;function Qo(h,x){Ni(h,x.x,x.y,x.z)}e.setTranslation=Qo;function Fa(h){return ie.create(h._m[12],h._m[13],h._m[14])}e.getTranslation=Fa;function La(h,x){x.x=h._m[12],x.y=h._m[13],x.z=h._m[14]}e.getTranslationToRef=La;function _(h){let x=h._m;return y(1,0,0,0,0,1,0,0,0,0,1,0,x[12],x[13],x[14],x[15],h),zt(h,x[12]===0&&x[13]===0&&x[14]===0&&x[15]===1),h}e.removeRotationAndScaling=_;function k(h,x){let S=i();return te(h,x,S),S}e.multiply=k;function C(h,x){oe(h,x._m),zt(x,h.isIdentity,h._isIdentityDirty,h.isIdentity3x2,h._isIdentity3x2Dirty)}e.copy=C;function oe(h,x,S=0){for(let E=0;E<16;E++)x[S+E]=h._m[E]}e.copyToArray=oe;function te(h,x,S){if(h.isIdentity){C(x,S);return}if(x.isIdentity){C(h,S);return}de(h,x,S._m,0),st(S)}e.multiplyToRef=te;function de(h,x,S,E){let N=h._m,G=x._m,H=N[0],ee=N[1],me=N[2],Te=N[3],we=N[4],je=N[5],ke=N[6],et=N[7],ct=N[8],St=N[9],mt=N[10],Se=N[11],kt=N[12],Rt=N[13],Be=N[14],Ue=N[15],wt=G[0],$e=G[1],ot=G[2],Gt=G[3],Xt=G[4],ht=G[5],Nn=G[6],ar=G[7],yt=G[8],An=G[9],ur=G[10],Pt=G[11],Nr=G[12],Ar=G[13],Ir=G[14],In=G[15];S[E]=H*wt+ee*Xt+me*yt+Te*Nr,S[E+1]=H*$e+ee*ht+me*An+Te*Ar,S[E+2]=H*ot+ee*Nn+me*ur+Te*Ir,S[E+3]=H*Gt+ee*ar+me*Pt+Te*In,S[E+4]=we*wt+je*Xt+ke*yt+et*Nr,S[E+5]=we*$e+je*ht+ke*An+et*Ar,S[E+6]=we*ot+je*Nn+ke*ur+et*Ir,S[E+7]=we*Gt+je*ar+ke*Pt+et*In,S[E+8]=ct*wt+St*Xt+mt*yt+Se*Nr,S[E+9]=ct*$e+St*ht+mt*An+Se*Ar,S[E+10]=ct*ot+St*Nn+mt*ur+Se*Ir,S[E+11]=ct*Gt+St*ar+mt*Pt+Se*In,S[E+12]=kt*wt+Rt*Xt+Be*yt+Ue*Nr,S[E+13]=kt*$e+Rt*ht+Be*An+Ue*Ar,S[E+14]=kt*ot+Rt*Nn+Be*ur+Ue*Ir,S[E+15]=kt*Gt+Rt*ar+Be*Pt+Ue*In}e.multiplyToArray=de;function ve(h,x){let S=x;if(!S)return!1;if((h.isIdentity||S.isIdentity)&&!h._isIdentityDirty&&!S._isIdentityDirty)return h.isIdentity&&S.isIdentity;let E=h._m,N=S._m;return E[0]===N[0]&&E[1]===N[1]&&E[2]===N[2]&&E[3]===N[3]&&E[4]===N[4]&&E[5]===N[5]&&E[6]===N[6]&&E[7]===N[7]&&E[8]===N[8]&&E[9]===N[9]&&E[10]===N[10]&&E[11]===N[11]&&E[12]===N[12]&&E[13]===N[13]&&E[14]===N[14]&&E[15]===N[15]}e.equals=ve;function dt(h){let x=i();return C(h,x),x}e.clone=dt;function It(h){let x=h._m[0]||0;for(let S=1;S<16;S++)x=x*397^(h._m[S]||0);return x}e.getHashCode=It;function pt(h,x,S,E){if(h.isIdentity)return E&&(E=ie.create(0,0,0)),x&&(x=ie.create(0,0,0)),S&&(S=Jt.create(0,0,0,1)),!0;let N=h._m;E&&(E=ie.create(N[12],N[13],N[14]));let G=x||ie.Zero();if(G.x=Math.sqrt(N[0]*N[0]+N[1]*N[1]+N[2]*N[2]),G.y=Math.sqrt(N[4]*N[4]+N[5]*N[5]+N[6]*N[6]),G.z=Math.sqrt(N[8]*N[8]+N[9]*N[9]+N[10]*N[10]),ki(h)<=0&&(G.y*=-1),G.x===0||G.y===0||G.z===0)return S&&(S=Jt.create(0,0,0,1)),!1;if(S){let H=1/G.x,ee=1/G.y,me=1/G.z,Te=i();y(N[0]*H,N[1]*H,N[2]*H,0,N[4]*ee,N[5]*ee,N[6]*ee,0,N[8]*me,N[9]*me,N[10]*me,0,0,0,0,1,Te),Jt.fromRotationMatrixToRef(Te,S)}return!0}e.decompose=pt;function Gn(h,x,S,E,N,G){if(x<0||x>3)return;let H=x*4;h._m[H+0]=S,h._m[H+1]=E,h._m[H+2]=N,h._m[H+3]=G,st(h)}e.setRowFromFloats=Gn;function br(h,x){let S=i();return or(h,x,S),S}e.scale=br;function or(h,x,S){for(let E=0;E<16;E++)S._m[E]=h._m[E]*x;st(S)}e.scaleToRef=or;function ir(h,x,S){for(let E=0;E<16;E++)S._m[E]+=h._m[E]*x;st(S)}e.scaleAndAddToRef=ir;function Da(h,x){let S=i();Jo(h,S),Yo(S,x);let E=x._m;y(E[0],E[1],E[2],0,E[4],E[5],E[6],0,E[8],E[9],E[10],0,0,0,0,1,x)}e.normalMatrixToRef=Da;function xf(h){let x=i();return Bu(h,x),x}e.getRotationMatrix=xf;function Bu(h,x){let S=ie.Zero();if(!pt(h,S)){x=D();return}let E=h._m,N=1/S.x,G=1/S.y,H=1/S.z;y(E[0]*N,E[1]*N,E[2]*N,0,E[4]*G,E[5]*G,E[6]*G,0,E[8]*H,E[9]*H,E[10]*H,0,0,0,0,1,x)}e.getRotationMatrixToRef=Bu;function Ai(h){h._m[2]*=-1,h._m[6]*=-1,h._m[8]*=-1,h._m[9]*=-1,h._m[14]*=-1,st(h)}e.toggleModelMatrixHandInPlace=Ai;function _f(h){h._m[8]*=-1,h._m[9]*=-1,h._m[10]*=-1,h._m[11]*=-1,st(h)}e.toggleProjectionMatrixHandInPlace=_f;function zt(h,x,S=!1,E=!1,N=!0){h.updateFlag=a++,h.isIdentity=x,h.isIdentity3x2=x||E,h._isIdentityDirty=h.isIdentity?!1:S,h._isIdentity3x2Dirty=h.isIdentity3x2?!1:N}})(Ln||(Ln={}));var Jt;(function(e){function r(v=0,z=0,V=0,X=1){return{x:v,y:z,z:V,w:X}}e.create=r;function a(v,z){return{x:v.x+z.x,y:v.y+z.y,z:v.z+z.z,w:v.w+z.w}}e.add=a;function o(v,z,V){let X=z*.5,ue=v*.5,xe=V*.5,Pe=Math.cos(X),Fe=Math.cos(ue),We=Math.cos(xe),Le=Math.sin(X),Ze=Math.sin(ue),Ve=Math.sin(xe);return r(Fe*Le*We+Ze*Pe*Ve,Ze*Pe*We-Fe*Le*Ve,Fe*Pe*Ve-Ze*Le*We,Fe*Pe*We+Ze*Le*Ve)}e.fromRotationYawPitchRoll=o;function u(v,z,V){return o(z*Hi,v*Hi,V*Hi)}e.fromEulerDegrees=u;function i(v){return Math.sqrt(p(v))}e.length=i;function p(v){return v.x*v.x+v.y*v.y+v.z*v.z+v.w*v.w}e.lengthSquared=p;function f(v,z){return v.x*z.x+v.y*z.y+v.z*z.z+v.w*z.w}e.dot=f;function c(v,z){let V=f(v,z);return Math.acos(Math.min(Math.abs(V),1))*2*Vi}e.angle=c;function y(v,z,V){let X=c(v,z);if(X===0)return z;let ue=Math.min(1,V/X);return W(v,z,ue)}e.rotateTowards=y;function R(v,z={x:0,y:1,z:0}){let V=ie.normalize(v),X=ie.normalize(ie.cross(z,V)),ue=ie.cross(V,X),xe=X.x,Pe=X.y,Fe=X.z,We=ue.x,Le=ue.y,Ze=ue.z,Ve=V.x,rt=V.y,Ce=V.z,jt=xe+Le+Ce,O=r();if(jt>0){let A=Math.sqrt(jt+1);return O.w=A*.5,A=.5/A,O.x=(Ze-rt)*A,O.y=(Ve-Fe)*A,O.z=(Pe-We)*A,O}if(xe>=Le&&xe>=Ce){let A=Math.sqrt(1+xe-Le-Ce),F=.5/A;return O.x=.5*A,O.y=(Pe+We)*F,O.z=(Fe+Ve)*F,O.w=(Ze-rt)*F,O}if(Le>Ce){let A=Math.sqrt(1+Le-xe-Ce),F=.5/A;return O.x=(We+Pe)*F,O.y=.5*A,O.z=(rt+Ze)*F,O.w=(Ve-Fe)*F,O}let j=Math.sqrt(1+Ce-xe-Le),re=.5/j;return O.x=(Ve+Fe)*re,O.y=(rt+Ze)*re,O.z=.5*j,O.w=(Pe-We)*re,O}e.lookRotation=R;function T(v){let z=1/i(v);return r(v.x*z,v.y*z,v.z*z,v.w*z)}e.normalize=T;function w(v,z,V=ie.Up()){let X=ie.normalize(v),ue=ie.normalize(z),xe=ie.cross(X,ue),Pe=Math.sqrt(ie.lengthSquared(X)*ie.lengthSquared(ue))+ie.dot(X,ue);return ie.lengthSquared(xe)<1e-4?Math.abs(Pe)<1e-4?T(r(V.x,V.y,V.z,0)):D():T(r(xe.x,xe.y,xe.z,Pe))}e.fromToRotation=w;function D(){return r(0,0,0,1)}e.Identity=D;function B(v){let z=ie.create(),V=v.x*v.x+v.y*v.y+v.z*v.z+v.w*v.w,X=v.x*v.w-v.y*v.z;return X>.4995*V?(z.x=Math.PI/2,z.y=2*Math.atan2(v.y,v.x),z.z=0):X<-.4995*V?(z.x=-Math.PI/2,z.y=-2*Math.atan2(v.y,v.x),z.z=0):(z.x=Math.asin(2*(v.w*v.x-v.y*v.z)),z.y=Math.atan2(2*v.w*v.y+2*v.z*v.x,1-2*(v.x*v.x+v.y*v.y)),z.z=Math.atan2(2*v.w*v.z+2*v.x*v.y,1-2*(v.z*v.z+v.x*v.x))),z.x*=Vi,z.y*=Vi,z.z*=Vi,z.x=nt.repeat(z.x,360),z.y=nt.repeat(z.y,360),z.z=nt.repeat(z.z,360),z}e.toEulerAngles=B;function P(v,z,V,X){let ue=z*.5,xe=v*.5,Pe=V*.5,Fe=Math.cos(ue),We=Math.cos(xe),Le=Math.cos(Pe),Ze=Math.sin(ue),Ve=Math.sin(xe),rt=Math.sin(Pe);X.x=We*Ze*Le+Ve*Fe*rt,X.y=Ve*Fe*Le-We*Ze*rt,X.z=We*Fe*rt-Ve*Ze*Le,X.w=We*Fe*Le+Ve*Ze*rt}e.fromRotationYawPitchRollToRef=P;function Y(v,z){let V=v._m,X=V[0],ue=V[4],xe=V[8],Pe=V[1],Fe=V[5],We=V[9],Le=V[2],Ze=V[6],Ve=V[10],rt=X+Fe+Ve,Ce;rt>0?(Ce=.5/Math.sqrt(rt+1),z.w=.25/Ce,z.x=(Ze-We)*Ce,z.y=(xe-Le)*Ce,z.z=(Pe-ue)*Ce):X>Fe&&X>Ve?(Ce=2*Math.sqrt(1+X-Fe-Ve),z.w=(Ze-We)/Ce,z.x=.25*Ce,z.y=(ue+Pe)/Ce,z.z=(xe+Le)/Ce):Fe>Ve?(Ce=2*Math.sqrt(1+Fe-X-Ve),z.w=(xe-Le)/Ce,z.x=(ue+Pe)/Ce,z.y=.25*Ce,z.z=(We+Ze)/Ce):(Ce=2*Math.sqrt(1+Ve-X-Fe),z.w=(Pe-ue)/Ce,z.x=(xe+Le)/Ce,z.y=(We+Ze)/Ce,z.z=.25*Ce)}e.fromRotationMatrixToRef=Y;function W(v,z,V){let X=e.Identity();return e.slerpToRef(v,z,V,X),X}e.slerp=W;function Q(v,z,V,X){let ue,xe,Pe=v.x*z.x+v.y*z.y+v.z*z.z+v.w*z.w,Fe=!1;if(Pe<0&&(Fe=!0,Pe=-Pe),Pe>.999999)xe=1-V,ue=Fe?-V:V;else{let We=Math.acos(Pe),Le=1/Math.sin(We);xe=Math.sin((1-V)*We)*Le,ue=Fe?-Math.sin(V*We)*Le:Math.sin(V*We)*Le}X.x=xe*v.x+ue*z.x,X.y=xe*v.y+ue*z.y,X.z=xe*v.z+ue*z.z,X.w=xe*v.w+ue*z.w}e.slerpToRef=Q;function ce(v,z){let V=r(0,0,0,1);return $(v,z,V),V}e.multiply=ce;function $(v,z,V){V.x=v.x*z.w+v.y*z.z-v.z*z.y+v.w*z.x,V.y=-v.x*z.z+v.y*z.w+v.z*z.x+v.w*z.y,V.z=v.x*z.y-v.y*z.x+v.z*z.w+v.w*z.z,V.w=-v.x*z.x-v.y*z.y-v.z*z.z+v.w*z.w}e.multiplyToRef=$;function ye(v,z){if(ie.lengthSquared(z)===0)return e.Identity();let V=D(),X=v*Hi;X*=.5;let ue=ie.normalize(z);return ie.scaleToRef(ue,Math.sin(X),ue),V.x=ue.x,V.y=ue.y,V.z=ue.z,V.w=Math.cos(X),T(V)}e.fromAngleAxis=ye;function q(v,z,V){let X=e.create(0,0,0,0);return J(v,z,V,X),X}e.fromAxisToRotationQuaternion=q;function J(v,z,V,X){let ue=Ln.create();Ln.fromXYZAxesToRef(ie.normalize(v),ie.normalize(z),ie.normalize(V),ue),e.fromRotationMatrixToRef(ue,X)}e.fromAxisToRotationQuaternionToRef=J;function ae(){return r(0,0,0,0)}e.Zero=ae;function ge(v,z,V=ie.Up()){let X=e.Identity();return Z(v,z,V,X),X}e.fromLookAt=ge;function Z(v,z,V=ie.Up(),X){let ue=Ln.Identity();Ln.lookAtLHToRef(v,z,V,ue),Ln.invertToRef(ue,ue),e.fromRotationMatrixToRef(ue,X)}e.fromLookAtToRef=Z})(Jt||(Jt={}));var su;(function(e){function r(O=0,j=0,re=0,A=1){return{r:O,g:j,b:re,a:A}}e.create=r;function a(O){if(O.substring(0,1)!=="#"||O.length!==7&&O.length!==9)return r(0,0,0,1);let j=parseInt(O.substring(1,3),16),re=parseInt(O.substring(3,5),16),A=parseInt(O.substring(5,7),16),F=O.substring(7,9),le=F?parseInt(F,16):255;return e.fromInts(j,re,A,le)}e.fromHexString=a;function o(O,j,re){let A=r(0,0,0,0);return e.lerpToRef(O,j,re,A),A}e.lerp=o;function u(O,j,re,A){A.r=O.r+(j.r-O.r)*re,A.g=O.g+(j.g-O.g)*re,A.b=O.b+(j.b-O.b)*re,A.a=O.a+(j.a-O.a)*re}e.lerpToRef=u;function i(){return r(1,0,0,1)}e.Red=i;function p(){return r(0,1,0,1)}e.Green=p;function f(){return r(0,0,1,1)}e.Blue=f;function c(){return r(0,0,0,1)}e.Black=c;function y(){return r(1,1,1,1)}e.White=y;function R(){return r(.5,0,.5,1)}e.Purple=R;function T(){return r(1,0,1,1)}e.Magenta=T;function w(){return r(1,1,0,1)}e.Yellow=w;function D(){return r(.5,.5,.5,1)}e.Gray=D;function B(){return r(0,1,1,1)}e.Teal=B;function P(){return r(0,0,0,0)}e.Clear=P;function Y(O,j=1){return r(O.r,O.g,O.b,j)}e.fromColor3=Y;function W(O,j=0){return r(O[j],O[j+1],O[j+2],O[j+3])}e.fromArray=W;function Q(O,j,re,A){return r(O/255,j/255,re/255,A/255)}e.fromInts=Q;function ce(O,j){if(O.length===j*3){let re=[];for(let A=0;A<O.length;A+=3){let F=A/3*4;re[F]=O[A],re[F+1]=O[A+1],re[F+2]=O[A+2],re[F+3]=1}return re}return O}e.checkColors4=ce;function $(O,j,re){re.r=O.r+j.r,re.g=O.g+j.g,re.b=O.b+j.b,re.a=O.a+j.a}e.addToRef=$;function ye(O,j,re=0){j[re]=O.r,j[re+1]=O.g,j[re+2]=O.b,j[re+3]=O.a}e.toArray=ye;function q(O,j){let re=P();return $(O,j,re),re}e.add=q;function J(O,j){let re=P();return ae(O,j,re),re}e.subtract=J;function ae(O,j,re){re.r=O.r-j.r,re.g=O.g-j.g,re.b=O.b-j.b,re.a=O.a-j.a}e.subtractToRef=ae;function ge(O,j){return r(O.r*j,O.g*j,O.b*j,O.a*j)}e.scale=ge;function Z(O,j,re){re.r=O.r*j,re.g=O.g*j,re.b=O.b*j,re.a=O.a*j}e.scaleToRef=Z;function v(O,j,re){re.r+=O.r*j,re.g+=O.g*j,re.b+=O.b*j,re.a+=O.a*j}e.scaleAndAddToRef=v;function z(O,j=0,re=1,A){A.r=nt.clamp(O.r,j,re),A.g=nt.clamp(O.g,j,re),A.b=nt.clamp(O.b,j,re),A.a=nt.clamp(O.a,j,re)}e.clampToRef=z;function V(O,j){return r(O.r*j.r,O.g*j.g,O.b*j.b,O.a*j.a)}e.multiply=V;function X(O,j,re){re.r=O.r*j.r,re.g=O.g*j.g,re.b=O.b*j.b,re.a=O.a*j.a}e.multiplyToRef=X;function ue(O){return"{R: "+O.r+" G:"+O.g+" B:"+O.b+" A:"+O.a+"}"}e.toString=ue;function xe(O){let j=O.r||0;return j=j*397^(O.g||0),j=j*397^(O.b||0),j=j*397^(O.a||0),j}e.getHashCode=xe;function Pe(O){return r(O.r,O.g,O.b,O.a)}e.clone=Pe;function Fe(O,j){j.r=O.r,j.g=O.g,j.b=O.b,j.a=O.a}e.copyFrom=Fe;function We(O,j,re,A,F){F.r=O,F.g=j,F.b=re,F.a=A}e.copyFromFloats=We;function Le(O,j,re,A,F){F.r=O,F.g=j,F.b=re,F.a=A}e.set=Le;function Ze(O){let j=O.r*255|0,re=O.g*255|0,A=O.b*255|0,F=O.a*255|0;return"#"+nt.toHex(j)+nt.toHex(re)+nt.toHex(A)+nt.toHex(F)}e.toHexString=Ze;function Ve(O){let j=r();return rt(O,j),j}e.toLinearSpace=Ve;function rt(O,j){j.r=Math.pow(O.r,Lr),j.g=Math.pow(O.g,Lr),j.b=Math.pow(O.b,Lr),j.a=O.a}e.toLinearSpaceToRef=rt;function Ce(O){let j=r();return jt(O,j),j}e.toGammaSpace=Ce;function jt(O,j){j.r=Math.pow(O.r,Fr),j.g=Math.pow(O.g,Fr),j.b=Math.pow(O.b,Fr),j.a=O.a}e.toGammaSpaceToRef=jt})(su||(su={}));var Nl;(function(e){function r(A=0,F=0,le=0){return{r:A,g:F,b:le}}e.create=r;function a(A){if(A.substring(0,1)!=="#"||A.length!==7)return r(0,0,0);let F=parseInt(A.substring(1,3),16),le=parseInt(A.substring(3,5),16),Ye=parseInt(A.substring(5,7),16);return u(F,le,Ye)}e.fromHexString=a;function o(A,F=0){return r(A[F],A[F+1],A[F+2])}e.fromArray=o;function u(A,F,le){return r(A/255,F/255,le/255)}e.fromInts=u;function i(A,F,le){let Ye=r(0,0,0);return e.lerpToRef(A,F,le,Ye),Ye}e.lerp=i;function p(A,F,le,Ye){Ye.r=A.r+(F.r-A.r)*le,Ye.g=A.g+(F.g-A.g)*le,Ye.b=A.b+(F.b-A.b)*le}e.lerpToRef=p;function f(){return r(1,0,0)}e.Red=f;function c(){return r(0,1,0)}e.Green=c;function y(){return r(0,0,1)}e.Blue=y;function R(){return r(0,0,0)}e.Black=R;function T(){return r(1,1,1)}e.White=T;function w(){return r(.5,0,.5)}e.Purple=w;function D(){return r(1,0,1)}e.Magenta=D;function B(){return r(1,1,0)}e.Yellow=B;function P(){return r(.5,.5,.5)}e.Gray=P;function Y(){return r(0,1,1)}e.Teal=Y;function W(){return r(Math.random(),Math.random(),Math.random())}e.Random=W;function Q(A){return"{R: "+A.r+" G:"+A.g+" B:"+A.b+"}"}e.toString=Q;function ce(A){let F=A.r||0;return F=F*397^(A.g||0),F=F*397^(A.b||0),F}e.getHashCode=ce;function $(A,F,le=0){F[le]=A.r,F[le+1]=A.g,F[le+2]=A.b}e.toArray=$;function ye(A,F=1){return su.create(A.r,A.g,A.b,F)}e.toColor4=ye;function q(A){let F=new Array;return $(A,F,0),F}e.asArray=q;function J(A){return A.r*.3+A.g*.59+A.b*.11}e.toLuminance=J;function ae(A,F){return r(A.r*F.r,A.g*F.g,A.b*F.b)}e.multiply=ae;function ge(A,F,le){le.r=A.r*F.r,le.g=A.g*F.g,le.b=A.b*F.b}e.multiplyToRef=ge;function Z(A,F){return F&&A.r===F.r&&A.g===F.g&&A.b===F.b}e.equals=Z;function v(A,F,le,Ye){return A.r===F&&A.g===le&&A.b===Ye}e.equalsFloats=v;function z(A,F){return r(A.r*F,A.g*F,A.b*F)}e.scale=z;function V(A,F,le){le.r=A.r*F,le.g=A.g*F,le.b=A.b*F}e.scaleToRef=V;function X(A,F,le){le.r+=A.r*F,le.g+=A.g*F,le.b+=A.b*F}e.scaleAndAddToRef=X;function ue(A,F=0,le=1,Ye){Ye.r=nt.clamp(A.r,F,le),Ye.g=nt.clamp(A.g,F,le),Ye.b=nt.clamp(A.b,F,le)}e.clampToRef=ue;function xe(A,F=0,le=1){let Ye=e.Black();return ue(A,F,le,Ye),Ye}e.clamp=xe;function Pe(A,F){return r(A.r+F.r,A.g+F.g,A.b+F.b)}e.add=Pe;function Fe(A,F,le){le.r=A.r+F.r,le.g=A.g+F.g,le.b=A.b+F.b}e.addToRef=Fe;function We(A,F){return r(A.r-F.r,A.g-F.g,A.b-F.b)}e.subtract=We;function Le(A,F,le){le.r=A.r-F.r,le.g=A.g-F.g,le.b=A.b-F.b}e.subtractToRef=Le;function Ze(A){return r(A.r,A.g,A.b)}e.clone=Ze;function Ve(A,F){F.r=A.r,F.g=A.g,F.b=A.b}e.copyFrom=Ve;function rt(A,F,le,Ye){A.r=F,A.g=le,A.b=Ye}e.set=rt;function Ce(A){let F=A.r*255|0,le=A.g*255|0,Ye=A.b*255|0;return"#"+nt.toHex(F)+nt.toHex(le)+nt.toHex(Ye)}e.toHexString=Ce;function jt(A){let F=r();return O(A,F),F}e.toLinearSpace=jt;function O(A,F){F.r=Math.pow(A.r,Lr),F.g=Math.pow(A.g,Lr),F.b=Math.pow(A.b,Lr)}e.toLinearSpaceToRef=O;function j(A){let F=r();return re(A,F),F}e.toGammaSpace=j;function re(A,F){F.r=Math.pow(A.r,Fr),F.g=Math.pow(A.g,Fr),F.b=Math.pow(A.b,Fr)}e.toGammaSpaceToRef=re})(Nl||(Nl={}));var er={};b0(er,{Animator:()=>ed,AudioSource:()=>bc,AudioStream:()=>Nc,AvatarAnchorPointType:()=>Ms,AvatarAttach:()=>Ac,AvatarModifierArea:()=>Ic,AvatarModifierType:()=>Ls,AvatarShape:()=>zc,BackgroundTextureMode:()=>ac,Billboard:()=>Pc,BillboardMode:()=>Hs,CameraMode:()=>Oc,CameraModeArea:()=>Cc,ColliderLayer:()=>Qs,EngineInfo:()=>Uc,GltfContainer:()=>Bc,GltfContainerLoadingState:()=>Mc,Material:()=>$l,MaterialTransparencyMode:()=>Js,MeshCollider:()=>nd,MeshRenderer:()=>td,NftFrameType:()=>Xs,NftShape:()=>Fc,PBAnimationState:()=>Gi,PBAnimator:()=>io,PBAudioSource:()=>ao,PBAudioStream:()=>uo,PBAvatarAttach:()=>so,PBAvatarModifierArea:()=>co,PBAvatarShape:()=>fo,PBBillboard:()=>lo,PBCameraMode:()=>po,PBCameraModeArea:()=>mo,PBEngineInfo:()=>ho,PBGltfContainer:()=>yo,PBGltfContainerLoadingState:()=>go,PBMaterial:()=>xo,PBMaterial_PbrMaterial:()=>Qi,PBMaterial_UnlitMaterial:()=>Ji,PBMeshCollider:()=>_o,PBMeshCollider_BoxMesh:()=>Zi,PBMeshCollider_CylinderMesh:()=>Xi,PBMeshCollider_PlaneMesh:()=>Ki,PBMeshCollider_SphereMesh:()=>$i,PBMeshRenderer:()=>So,PBMeshRenderer_BoxMesh:()=>ea,PBMeshRenderer_CylinderMesh:()=>ta,PBMeshRenderer_PlaneMesh:()=>na,PBMeshRenderer_SphereMesh:()=>ra,PBNftShape:()=>Eo,PBPointerEvents:()=>To,PBPointerEventsResult:()=>vo,PBPointerEvents_Entry:()=>ia,PBPointerEvents_Info:()=>oa,PBPointerLock:()=>ko,PBRaycast:()=>Ro,PBRaycastResult:()=>wo,PBTextShape:()=>bo,PBUiBackground:()=>No,PBUiCanvasInformation:()=>Ao,PBUiDropdown:()=>Io,PBUiDropdownResult:()=>zo,PBUiInput:()=>Po,PBUiInputResult:()=>Oo,PBUiText:()=>Co,PBUiTransform:()=>Uo,PBVideoEvent:()=>Bo,PBVideoPlayer:()=>Mo,PBVisibilityComponent:()=>Fo,PointerEvents:()=>aa,PointerEventsResult:()=>ua,PointerLock:()=>Lc,Raycast:()=>sa,RaycastQueryType:()=>nc,RaycastResult:()=>ca,TextShape:()=>Dc,Transform:()=>Hr,UiBackground:()=>fa,UiCanvasInformation:()=>Wc,UiDropdown:()=>la,UiDropdownResult:()=>da,UiInput:()=>pa,UiInputResult:()=>ma,UiText:()=>ha,UiTransform:()=>ya,VideoEvent:()=>ga,VideoPlayer:()=>xa,VideoState:()=>kc,VisibilityComponent:()=>Hc,YGAlign:()=>hc,YGDisplay:()=>Ec,YGEdge:()=>Tc,YGFlexDirection:()=>gc,YGJustify:()=>_c,YGOverflow:()=>Sc,YGPositionType:()=>mc,YGUnit:()=>yc,YGWrap:()=>xc,componentDefinitionByName:()=>hu});var fi=be(ze());function n2(){return{states:[]}}var io;(function(e){function r(o,u=fi.default.Writer.create()){for(let i of o.states)Gi.encode(i,u.uint32(10).fork()).ldelim();return u}e.encode=r;function a(o,u){let i=o instanceof fi.default.Reader?o:fi.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=n2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==10)break;f.states.push(Gi.decode(i,i.uint32()));continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(io||(io={}));function r2(){return{name:"",clip:"",playing:void 0,weight:void 0,speed:void 0,loop:void 0,shouldReset:void 0}}var Gi;(function(e){function r(o,u=fi.default.Writer.create()){return o.name!==""&&u.uint32(10).string(o.name),o.clip!==""&&u.uint32(18).string(o.clip),o.playing!==void 0&&u.uint32(24).bool(o.playing),o.weight!==void 0&&u.uint32(37).float(o.weight),o.speed!==void 0&&u.uint32(45).float(o.speed),o.loop!==void 0&&u.uint32(48).bool(o.loop),o.shouldReset!==void 0&&u.uint32(56).bool(o.shouldReset),u}e.encode=r;function a(o,u){let i=o instanceof fi.default.Reader?o:fi.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=r2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==10)break;f.name=i.string();continue;case 2:if(c!==18)break;f.clip=i.string();continue;case 3:if(c!==24)break;f.playing=i.bool();continue;case 4:if(c!==37)break;f.weight=i.float();continue;case 5:if(c!==45)break;f.speed=i.float();continue;case 6:if(c!==48)break;f.loop=i.bool();continue;case 7:if(c!==56)break;f.shouldReset=i.bool();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Gi||(Gi={}));var km={COMPONENT_ID:1042,serialize(e,r){let a=io.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return io.decode(e.buffer(),e.remainingBytes())},create(){return io.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBAnimator"}};var Cs=be(ze());function o2(){return{playing:void 0,volume:void 0,loop:void 0,pitch:void 0,audioClipUrl:""}}var ao;(function(e){function r(o,u=Cs.default.Writer.create()){return o.playing!==void 0&&u.uint32(8).bool(o.playing),o.volume!==void 0&&u.uint32(21).float(o.volume),o.loop!==void 0&&u.uint32(24).bool(o.loop),o.pitch!==void 0&&u.uint32(37).float(o.pitch),o.audioClipUrl!==""&&u.uint32(42).string(o.audioClipUrl),u}e.encode=r;function a(o,u){let i=o instanceof Cs.default.Reader?o:Cs.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=o2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==8)break;f.playing=i.bool();continue;case 2:if(c!==21)break;f.volume=i.float();continue;case 3:if(c!==24)break;f.loop=i.bool();continue;case 4:if(c!==37)break;f.pitch=i.float();continue;case 5:if(c!==42)break;f.audioClipUrl=i.string();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(ao||(ao={}));var Rm={COMPONENT_ID:1020,serialize(e,r){let a=ao.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return ao.decode(e.buffer(),e.remainingBytes())},create(){return ao.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBAudioSource"}};var Us=be(ze());function i2(){return{playing:void 0,volume:void 0,url:""}}var uo;(function(e){function r(o,u=Us.default.Writer.create()){return o.playing!==void 0&&u.uint32(8).bool(o.playing),o.volume!==void 0&&u.uint32(21).float(o.volume),o.url!==""&&u.uint32(26).string(o.url),u}e.encode=r;function a(o,u){let i=o instanceof Us.default.Reader?o:Us.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=i2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==8)break;f.playing=i.bool();continue;case 2:if(c!==21)break;f.volume=i.float();continue;case 3:if(c!==26)break;f.url=i.string();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(uo||(uo={}));var wm={COMPONENT_ID:1021,serialize(e,r){let a=uo.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return uo.decode(e.buffer(),e.remainingBytes())},create(){return uo.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBAudioStream"}};var Bs=be(ze());var Ms;(function(e){e[e.AAPT_POSITION=0]="AAPT_POSITION",e[e.AAPT_NAME_TAG=1]="AAPT_NAME_TAG",e[e.AAPT_LEFT_HAND=2]="AAPT_LEFT_HAND",e[e.AAPT_RIGHT_HAND=3]="AAPT_RIGHT_HAND"})(Ms||(Ms={}));function a2(){return{avatarId:void 0,anchorPointId:0}}var so;(function(e){function r(o,u=Bs.default.Writer.create()){return o.avatarId!==void 0&&u.uint32(10).string(o.avatarId),o.anchorPointId!==0&&u.uint32(16).int32(o.anchorPointId),u}e.encode=r;function a(o,u){let i=o instanceof Bs.default.Reader?o:Bs.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=a2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==10)break;f.avatarId=i.string();continue;case 2:if(c!==16)break;f.anchorPointId=i.int32();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(so||(so={}));var bm={COMPONENT_ID:1073,serialize(e,r){let a=so.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return so.decode(e.buffer(),e.remainingBytes())},create(){return so.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBAvatarAttach"}};var Fs=be(ze());var Tn=be(ze());function u2(){return{x:0,y:0,z:0}}var Nm;(function(e){function r(o,u=Tn.default.Writer.create()){return o.x!==0&&u.uint32(13).float(o.x),o.y!==0&&u.uint32(21).float(o.y),o.z!==0&&u.uint32(29).float(o.z),u}e.encode=r;function a(o,u){let i=o instanceof Tn.default.Reader?o:Tn.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=u2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==13)break;f.x=i.float();continue;case 2:if(c!==21)break;f.y=i.float();continue;case 3:if(c!==29)break;f.z=i.float();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Nm||(Nm={}));function s2(){return{x:0,y:0,z:0}}var Xe;(function(e){function r(o,u=Tn.default.Writer.create()){return o.x!==0&&u.uint32(13).float(o.x),o.y!==0&&u.uint32(21).float(o.y),o.z!==0&&u.uint32(29).float(o.z),u}e.encode=r;function a(o,u){let i=o instanceof Tn.default.Reader?o:Tn.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=s2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==13)break;f.x=i.float();continue;case 2:if(c!==21)break;f.y=i.float();continue;case 3:if(c!==29)break;f.z=i.float();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Xe||(Xe={}));function c2(){return{x:0,y:0}}var Am;(function(e){function r(o,u=Tn.default.Writer.create()){return o.x!==0&&u.uint32(13).float(o.x),o.y!==0&&u.uint32(21).float(o.y),u}e.encode=r;function a(o,u){let i=o instanceof Tn.default.Reader?o:Tn.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=c2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==13)break;f.x=i.float();continue;case 2:if(c!==21)break;f.y=i.float();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Am||(Am={}));function f2(){return{x:0,y:0,z:0,w:0}}var Im;(function(e){function r(o,u=Tn.default.Writer.create()){return o.x!==0&&u.uint32(13).float(o.x),o.y!==0&&u.uint32(21).float(o.y),o.z!==0&&u.uint32(29).float(o.z),o.w!==0&&u.uint32(37).float(o.w),u}e.encode=r;function a(o,u){let i=o instanceof Tn.default.Reader?o:Tn.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=f2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==13)break;f.x=i.float();continue;case 2:if(c!==21)break;f.y=i.float();continue;case 3:if(c!==29)break;f.z=i.float();continue;case 4:if(c!==37)break;f.w=i.float();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Im||(Im={}));var Ls;(function(e){e[e.AMT_HIDE_AVATARS=0]="AMT_HIDE_AVATARS",e[e.AMT_DISABLE_PASSPORTS=1]="AMT_DISABLE_PASSPORTS"})(Ls||(Ls={}));function l2(){return{area:void 0,excludeIds:[],modifiers:[]}}var co;(function(e){function r(o,u=Fs.default.Writer.create()){o.area!==void 0&&Xe.encode(o.area,u.uint32(10).fork()).ldelim();for(let i of o.excludeIds)u.uint32(18).string(i);u.uint32(26).fork();for(let i of o.modifiers)u.int32(i);return u.ldelim(),u}e.encode=r;function a(o,u){let i=o instanceof Fs.default.Reader?o:Fs.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=l2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==10)break;f.area=Xe.decode(i,i.uint32());continue;case 2:if(c!==18)break;f.excludeIds.push(i.string());continue;case 3:if(c===24){f.modifiers.push(i.int32());continue}if(c===26){let y=i.uint32()+i.pos;for(;i.pos<y;)f.modifiers.push(i.int32());continue}break}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(co||(co={}));var zm={COMPONENT_ID:1070,serialize(e,r){let a=co.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return co.decode(e.buffer(),e.remainingBytes())},create(){return co.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBAvatarModifierArea"}};var jl=be(Hm()),mi=be(ze());var pi=be(ze());function p2(){return{r:0,g:0,b:0}}var vt;(function(e){function r(o,u=pi.default.Writer.create()){return o.r!==0&&u.uint32(13).float(o.r),o.g!==0&&u.uint32(21).float(o.g),o.b!==0&&u.uint32(29).float(o.b),u}e.encode=r;function a(o,u){let i=o instanceof pi.default.Reader?o:pi.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=p2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==13)break;f.r=i.float();continue;case 2:if(c!==21)break;f.g=i.float();continue;case 3:if(c!==29)break;f.b=i.float();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(vt||(vt={}));function m2(){return{r:0,g:0,b:0,a:0}}var _t;(function(e){function r(o,u=pi.default.Writer.create()){return o.r!==0&&u.uint32(13).float(o.r),o.g!==0&&u.uint32(21).float(o.g),o.b!==0&&u.uint32(29).float(o.b),o.a!==0&&u.uint32(37).float(o.a),u}e.encode=r;function a(o,u){let i=o instanceof pi.default.Reader?o:pi.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=m2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==13)break;f.r=i.float();continue;case 2:if(c!==21)break;f.g=i.float();continue;case 3:if(c!==29)break;f.b=i.float();continue;case 4:if(c!==37)break;f.a=i.float();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(_t||(_t={}));function h2(){return{id:"",name:void 0,bodyShape:void 0,skinColor:void 0,hairColor:void 0,eyeColor:void 0,expressionTriggerId:void 0,expressionTriggerTimestamp:void 0,talking:void 0,wearables:[],emotes:[]}}var fo;(function(e){function r(o,u=mi.default.Writer.create()){o.id!==""&&u.uint32(10).string(o.id),o.name!==void 0&&u.uint32(18).string(o.name),o.bodyShape!==void 0&&u.uint32(26).string(o.bodyShape),o.skinColor!==void 0&&vt.encode(o.skinColor,u.uint32(34).fork()).ldelim(),o.hairColor!==void 0&&vt.encode(o.hairColor,u.uint32(42).fork()).ldelim(),o.eyeColor!==void 0&&vt.encode(o.eyeColor,u.uint32(50).fork()).ldelim(),o.expressionTriggerId!==void 0&&u.uint32(58).string(o.expressionTriggerId),o.expressionTriggerTimestamp!==void 0&&u.uint32(64).int64(o.expressionTriggerTimestamp),o.talking!==void 0&&u.uint32(72).bool(o.talking);for(let i of o.wearables)u.uint32(82).string(i);for(let i of o.emotes)u.uint32(90).string(i);return u}e.encode=r;function a(o,u){let i=o instanceof mi.default.Reader?o:mi.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=h2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==10)break;f.id=i.string();continue;case 2:if(c!==18)break;f.name=i.string();continue;case 3:if(c!==26)break;f.bodyShape=i.string();continue;case 4:if(c!==34)break;f.skinColor=vt.decode(i,i.uint32());continue;case 5:if(c!==42)break;f.hairColor=vt.decode(i,i.uint32());continue;case 6:if(c!==50)break;f.eyeColor=vt.decode(i,i.uint32());continue;case 7:if(c!==58)break;f.expressionTriggerId=i.string();continue;case 8:if(c!==64)break;f.expressionTriggerTimestamp=g2(i.int64());continue;case 9:if(c!==72)break;f.talking=i.bool();continue;case 10:if(c!==82)break;f.wearables.push(i.string());continue;case 11:if(c!==90)break;f.emotes.push(i.string());continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(fo||(fo={}));var y2=(()=>{if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof global<"u")return global;throw"Unable to locate global object"})();function g2(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new y2.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}mi.default.util.Long!==jl.default&&(mi.default.util.Long=jl.default,mi.default.configure());var Vm={COMPONENT_ID:1080,serialize(e,r){let a=fo.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return fo.decode(e.buffer(),e.remainingBytes())},create(){return fo.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBAvatarShape"}};var Ws=be(ze());var Hs;(function(e){e[e.BM_NONE=0]="BM_NONE",e[e.BM_X=1]="BM_X",e[e.BM_Y=2]="BM_Y",e[e.BM_Z=4]="BM_Z",e[e.BM_ALL=7]="BM_ALL"})(Hs||(Hs={}));function x2(){return{billboardMode:void 0}}var lo;(function(e){function r(o,u=Ws.default.Writer.create()){return o.billboardMode!==void 0&&u.uint32(8).int32(o.billboardMode),u}e.encode=r;function a(o,u){let i=o instanceof Ws.default.Reader?o:Ws.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=x2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==8)break;f.billboardMode=i.int32();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(lo||(lo={}));var jm={COMPONENT_ID:1090,serialize(e,r){let a=lo.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return lo.decode(e.buffer(),e.remainingBytes())},create(){return lo.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBBillboard"}};var Vs=be(ze());function _2(){return{mode:0}}var po;(function(e){function r(o,u=Vs.default.Writer.create()){return o.mode!==0&&u.uint32(8).int32(o.mode),u}e.encode=r;function a(o,u){let i=o instanceof Vs.default.Reader?o:Vs.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=_2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==8)break;f.mode=i.int32();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(po||(po={}));var Gm={COMPONENT_ID:1072,serialize(e,r){let a=po.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return po.decode(e.buffer(),e.remainingBytes())},create(){return po.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBCameraMode"}};var js=be(ze());function S2(){return{area:void 0,mode:0}}var mo;(function(e){function r(o,u=js.default.Writer.create()){return o.area!==void 0&&Xe.encode(o.area,u.uint32(10).fork()).ldelim(),o.mode!==0&&u.uint32(16).int32(o.mode),u}e.encode=r;function a(o,u){let i=o instanceof js.default.Reader?o:js.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=S2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==10)break;f.area=Xe.decode(i,i.uint32());continue;case 2:if(c!==16)break;f.mode=i.int32();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(mo||(mo={}));var Ym={COMPONENT_ID:1071,serialize(e,r){let a=mo.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return mo.decode(e.buffer(),e.remainingBytes())},create(){return mo.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBCameraModeArea"}};var Gs=be(ze());function E2(){return{frameNumber:0,totalRuntime:0,tickNumber:0}}var ho;(function(e){function r(o,u=Gs.default.Writer.create()){return o.frameNumber!==0&&u.uint32(8).uint32(o.frameNumber),o.totalRuntime!==0&&u.uint32(21).float(o.totalRuntime),o.tickNumber!==0&&u.uint32(24).uint32(o.tickNumber),u}e.encode=r;function a(o,u){let i=o instanceof Gs.default.Reader?o:Gs.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=E2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==8)break;f.frameNumber=i.uint32();continue;case 2:if(c!==21)break;f.totalRuntime=i.float();continue;case 3:if(c!==24)break;f.tickNumber=i.uint32();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(ho||(ho={}));var qm={COMPONENT_ID:1048,serialize(e,r){let a=ho.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return ho.decode(e.buffer(),e.remainingBytes())},create(){return ho.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBEngineInfo"}};var Ys=be(ze());function T2(){return{src:"",visibleMeshesCollisionMask:void 0,invisibleMeshesCollisionMask:void 0}}var yo;(function(e){function r(o,u=Ys.default.Writer.create()){return o.src!==""&&u.uint32(10).string(o.src),o.visibleMeshesCollisionMask!==void 0&&u.uint32(32).uint32(o.visibleMeshesCollisionMask),o.invisibleMeshesCollisionMask!==void 0&&u.uint32(40).uint32(o.invisibleMeshesCollisionMask),u}e.encode=r;function a(o,u){let i=o instanceof Ys.default.Reader?o:Ys.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=T2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==10)break;f.src=i.string();continue;case 4:if(c!==32)break;f.visibleMeshesCollisionMask=i.uint32();continue;case 5:if(c!==40)break;f.invisibleMeshesCollisionMask=i.uint32();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(yo||(yo={}));var Jm={COMPONENT_ID:1041,serialize(e,r){let a=yo.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return yo.decode(e.buffer(),e.remainingBytes())},create(){return yo.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBGltfContainer"}};var qs=be(ze());function v2(){return{currentState:0}}var go;(function(e){function r(o,u=qs.default.Writer.create()){return o.currentState!==0&&u.uint32(8).int32(o.currentState),u}e.encode=r;function a(o,u){let i=o instanceof qs.default.Reader?o:qs.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=v2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==8)break;f.currentState=i.int32();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(go||(go={}));var Qm={COMPONENT_ID:1049,serialize(e,r){let a=go.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return go.decode(e.buffer(),e.remainingBytes())},create(){return go.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBGltfContainerLoadingState"}};var xr=be(ze());var vn=be(ze());var Gl;(function(e){e[e.TWM_REPEAT=0]="TWM_REPEAT",e[e.TWM_CLAMP=1]="TWM_CLAMP",e[e.TWM_MIRROR=2]="TWM_MIRROR"})(Gl||(Gl={}));var Yl;(function(e){e[e.TFM_POINT=0]="TFM_POINT",e[e.TFM_BILINEAR=1]="TFM_BILINEAR",e[e.TFM_TRILINEAR=2]="TFM_TRILINEAR"})(Yl||(Yl={}));function k2(){return{src:"",wrapMode:void 0,filterMode:void 0}}var du;(function(e){function r(o,u=vn.default.Writer.create()){return o.src!==""&&u.uint32(10).string(o.src),o.wrapMode!==void 0&&u.uint32(16).int32(o.wrapMode),o.filterMode!==void 0&&u.uint32(24).int32(o.filterMode),u}e.encode=r;function a(o,u){let i=o instanceof vn.default.Reader?o:vn.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=k2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==10)break;f.src=i.string();continue;case 2:if(c!==16)break;f.wrapMode=i.int32();continue;case 3:if(c!==24)break;f.filterMode=i.int32();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(du||(du={}));function R2(){return{userId:"",wrapMode:void 0,filterMode:void 0}}var pu;(function(e){function r(o,u=vn.default.Writer.create()){return o.userId!==""&&u.uint32(10).string(o.userId),o.wrapMode!==void 0&&u.uint32(16).int32(o.wrapMode),o.filterMode!==void 0&&u.uint32(24).int32(o.filterMode),u}e.encode=r;function a(o,u){let i=o instanceof vn.default.Reader?o:vn.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=R2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==10)break;f.userId=i.string();continue;case 2:if(c!==16)break;f.wrapMode=i.int32();continue;case 3:if(c!==24)break;f.filterMode=i.int32();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(pu||(pu={}));function w2(){return{videoPlayerEntity:0,wrapMode:void 0,filterMode:void 0}}var mu;(function(e){function r(o,u=vn.default.Writer.create()){return o.videoPlayerEntity!==0&&u.uint32(8).uint32(o.videoPlayerEntity),o.wrapMode!==void 0&&u.uint32(16).int32(o.wrapMode),o.filterMode!==void 0&&u.uint32(24).int32(o.filterMode),u}e.encode=r;function a(o,u){let i=o instanceof vn.default.Reader?o:vn.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=w2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==8)break;f.videoPlayerEntity=i.uint32();continue;case 2:if(c!==16)break;f.wrapMode=i.int32();continue;case 3:if(c!==24)break;f.filterMode=i.int32();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(mu||(mu={}));function b2(){return{tex:void 0}}var Qt;(function(e){function r(o,u=vn.default.Writer.create()){switch(o.tex?.$case){case"texture":du.encode(o.tex.texture,u.uint32(10).fork()).ldelim();break;case"avatarTexture":pu.encode(o.tex.avatarTexture,u.uint32(18).fork()).ldelim();break;case"videoTexture":mu.encode(o.tex.videoTexture,u.uint32(26).fork()).ldelim();break}return u}e.encode=r;function a(o,u){let i=o instanceof vn.default.Reader?o:vn.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=b2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==10)break;f.tex={$case:"texture",texture:du.decode(i,i.uint32())};continue;case 2:if(c!==18)break;f.tex={$case:"avatarTexture",avatarTexture:pu.decode(i,i.uint32())};continue;case 3:if(c!==26)break;f.tex={$case:"videoTexture",videoTexture:mu.decode(i,i.uint32())};continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Qt||(Qt={}));var Js;(function(e){e[e.MTM_OPAQUE=0]="MTM_OPAQUE",e[e.MTM_ALPHA_TEST=1]="MTM_ALPHA_TEST",e[e.MTM_ALPHA_BLEND=2]="MTM_ALPHA_BLEND",e[e.MTM_ALPHA_TEST_AND_ALPHA_BLEND=3]="MTM_ALPHA_TEST_AND_ALPHA_BLEND",e[e.MTM_AUTO=4]="MTM_AUTO"})(Js||(Js={}));function N2(){return{material:void 0}}var xo;(function(e){function r(o,u=xr.default.Writer.create()){switch(o.material?.$case){case"unlit":Ji.encode(o.material.unlit,u.uint32(10).fork()).ldelim();break;case"pbr":Qi.encode(o.material.pbr,u.uint32(18).fork()).ldelim();break}return u}e.encode=r;function a(o,u){let i=o instanceof xr.default.Reader?o:xr.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=N2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==10)break;f.material={$case:"unlit",unlit:Ji.decode(i,i.uint32())};continue;case 2:if(c!==18)break;f.material={$case:"pbr",pbr:Qi.decode(i,i.uint32())};continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(xo||(xo={}));function A2(){return{texture:void 0,alphaTest:void 0,castShadows:void 0,diffuseColor:void 0}}var Ji;(function(e){function r(o,u=xr.default.Writer.create()){return o.texture!==void 0&&Qt.encode(o.texture,u.uint32(10).fork()).ldelim(),o.alphaTest!==void 0&&u.uint32(21).float(o.alphaTest),o.castShadows!==void 0&&u.uint32(24).bool(o.castShadows),o.diffuseColor!==void 0&&_t.encode(o.diffuseColor,u.uint32(34).fork()).ldelim(),u}e.encode=r;function a(o,u){let i=o instanceof xr.default.Reader?o:xr.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=A2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==10)break;f.texture=Qt.decode(i,i.uint32());continue;case 2:if(c!==21)break;f.alphaTest=i.float();continue;case 3:if(c!==24)break;f.castShadows=i.bool();continue;case 4:if(c!==34)break;f.diffuseColor=_t.decode(i,i.uint32());continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Ji||(Ji={}));function I2(){return{texture:void 0,alphaTest:void 0,castShadows:void 0,alphaTexture:void 0,emissiveTexture:void 0,bumpTexture:void 0,albedoColor:void 0,emissiveColor:void 0,reflectivityColor:void 0,transparencyMode:void 0,metallic:void 0,roughness:void 0,glossiness:void 0,specularIntensity:void 0,emissiveIntensity:void 0,directIntensity:void 0}}var Qi;(function(e){function r(o,u=xr.default.Writer.create()){return o.texture!==void 0&&Qt.encode(o.texture,u.uint32(10).fork()).ldelim(),o.alphaTest!==void 0&&u.uint32(21).float(o.alphaTest),o.castShadows!==void 0&&u.uint32(24).bool(o.castShadows),o.alphaTexture!==void 0&&Qt.encode(o.alphaTexture,u.uint32(34).fork()).ldelim(),o.emissiveTexture!==void 0&&Qt.encode(o.emissiveTexture,u.uint32(42).fork()).ldelim(),o.bumpTexture!==void 0&&Qt.encode(o.bumpTexture,u.uint32(50).fork()).ldelim(),o.albedoColor!==void 0&&_t.encode(o.albedoColor,u.uint32(58).fork()).ldelim(),o.emissiveColor!==void 0&&vt.encode(o.emissiveColor,u.uint32(66).fork()).ldelim(),o.reflectivityColor!==void 0&&vt.encode(o.reflectivityColor,u.uint32(74).fork()).ldelim(),o.transparencyMode!==void 0&&u.uint32(80).int32(o.transparencyMode),o.metallic!==void 0&&u.uint32(93).float(o.metallic),o.roughness!==void 0&&u.uint32(101).float(o.roughness),o.glossiness!==void 0&&u.uint32(109).float(o.glossiness),o.specularIntensity!==void 0&&u.uint32(117).float(o.specularIntensity),o.emissiveIntensity!==void 0&&u.uint32(125).float(o.emissiveIntensity),o.directIntensity!==void 0&&u.uint32(133).float(o.directIntensity),u}e.encode=r;function a(o,u){let i=o instanceof xr.default.Reader?o:xr.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=I2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==10)break;f.texture=Qt.decode(i,i.uint32());continue;case 2:if(c!==21)break;f.alphaTest=i.float();continue;case 3:if(c!==24)break;f.castShadows=i.bool();continue;case 4:if(c!==34)break;f.alphaTexture=Qt.decode(i,i.uint32());continue;case 5:if(c!==42)break;f.emissiveTexture=Qt.decode(i,i.uint32());continue;case 6:if(c!==50)break;f.bumpTexture=Qt.decode(i,i.uint32());continue;case 7:if(c!==58)break;f.albedoColor=_t.decode(i,i.uint32());continue;case 8:if(c!==66)break;f.emissiveColor=vt.decode(i,i.uint32());continue;case 9:if(c!==74)break;f.reflectivityColor=vt.decode(i,i.uint32());continue;case 10:if(c!==80)break;f.transparencyMode=i.int32();continue;case 11:if(c!==93)break;f.metallic=i.float();continue;case 12:if(c!==101)break;f.roughness=i.float();continue;case 13:if(c!==109)break;f.glossiness=i.float();continue;case 14:if(c!==117)break;f.specularIntensity=i.float();continue;case 15:if(c!==125)break;f.emissiveIntensity=i.float();continue;case 16:if(c!==133)break;f.directIntensity=i.float();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Qi||(Qi={}));var Zm={COMPONENT_ID:1017,serialize(e,r){let a=xo.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return xo.decode(e.buffer(),e.remainingBytes())},create(){return xo.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBMaterial"}};var nn=be(ze());var Qs;(function(e){e[e.CL_NONE=0]="CL_NONE",e[e.CL_POINTER=1]="CL_POINTER",e[e.CL_PHYSICS=2]="CL_PHYSICS",e[e.CL_RESERVED1=4]="CL_RESERVED1",e[e.CL_RESERVED2=8]="CL_RESERVED2",e[e.CL_RESERVED3=16]="CL_RESERVED3",e[e.CL_RESERVED4=32]="CL_RESERVED4",e[e.CL_RESERVED5=64]="CL_RESERVED5",e[e.CL_RESERVED6=128]="CL_RESERVED6",e[e.CL_CUSTOM1=256]="CL_CUSTOM1",e[e.CL_CUSTOM2=512]="CL_CUSTOM2",e[e.CL_CUSTOM3=1024]="CL_CUSTOM3",e[e.CL_CUSTOM4=2048]="CL_CUSTOM4",e[e.CL_CUSTOM5=4096]="CL_CUSTOM5",e[e.CL_CUSTOM6=8192]="CL_CUSTOM6",e[e.CL_CUSTOM7=16384]="CL_CUSTOM7",e[e.CL_CUSTOM8=32768]="CL_CUSTOM8"})(Qs||(Qs={}));function z2(){return{collisionMask:void 0,mesh:void 0}}var _o;(function(e){function r(o,u=nn.default.Writer.create()){switch(o.collisionMask!==void 0&&u.uint32(8).uint32(o.collisionMask),o.mesh?.$case){case"box":Zi.encode(o.mesh.box,u.uint32(18).fork()).ldelim();break;case"sphere":$i.encode(o.mesh.sphere,u.uint32(26).fork()).ldelim();break;case"cylinder":Xi.encode(o.mesh.cylinder,u.uint32(34).fork()).ldelim();break;case"plane":Ki.encode(o.mesh.plane,u.uint32(42).fork()).ldelim();break}return u}e.encode=r;function a(o,u){let i=o instanceof nn.default.Reader?o:nn.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=z2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==8)break;f.collisionMask=i.uint32();continue;case 2:if(c!==18)break;f.mesh={$case:"box",box:Zi.decode(i,i.uint32())};continue;case 3:if(c!==26)break;f.mesh={$case:"sphere",sphere:$i.decode(i,i.uint32())};continue;case 4:if(c!==34)break;f.mesh={$case:"cylinder",cylinder:Xi.decode(i,i.uint32())};continue;case 5:if(c!==42)break;f.mesh={$case:"plane",plane:Ki.decode(i,i.uint32())};continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(_o||(_o={}));function P2(){return{}}var Zi;(function(e){function r(o,u=nn.default.Writer.create()){return u}e.encode=r;function a(o,u){let i=o instanceof nn.default.Reader?o:nn.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=P2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Zi||(Zi={}));function O2(){return{radiusTop:void 0,radiusBottom:void 0}}var Xi;(function(e){function r(o,u=nn.default.Writer.create()){return o.radiusTop!==void 0&&u.uint32(13).float(o.radiusTop),o.radiusBottom!==void 0&&u.uint32(21).float(o.radiusBottom),u}e.encode=r;function a(o,u){let i=o instanceof nn.default.Reader?o:nn.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=O2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==13)break;f.radiusTop=i.float();continue;case 2:if(c!==21)break;f.radiusBottom=i.float();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Xi||(Xi={}));function C2(){return{}}var Ki;(function(e){function r(o,u=nn.default.Writer.create()){return u}e.encode=r;function a(o,u){let i=o instanceof nn.default.Reader?o:nn.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=C2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Ki||(Ki={}));function U2(){return{}}var $i;(function(e){function r(o,u=nn.default.Writer.create()){return u}e.encode=r;function a(o,u){let i=o instanceof nn.default.Reader?o:nn.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=U2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})($i||($i={}));var Xm={COMPONENT_ID:1019,serialize(e,r){let a=_o.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return _o.decode(e.buffer(),e.remainingBytes())},create(){return _o.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBMeshCollider"}};var rn=be(ze());function B2(){return{mesh:void 0}}var So;(function(e){function r(o,u=rn.default.Writer.create()){switch(o.mesh?.$case){case"box":ea.encode(o.mesh.box,u.uint32(10).fork()).ldelim();break;case"sphere":ra.encode(o.mesh.sphere,u.uint32(18).fork()).ldelim();break;case"cylinder":ta.encode(o.mesh.cylinder,u.uint32(26).fork()).ldelim();break;case"plane":na.encode(o.mesh.plane,u.uint32(34).fork()).ldelim();break}return u}e.encode=r;function a(o,u){let i=o instanceof rn.default.Reader?o:rn.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=B2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==10)break;f.mesh={$case:"box",box:ea.decode(i,i.uint32())};continue;case 2:if(c!==18)break;f.mesh={$case:"sphere",sphere:ra.decode(i,i.uint32())};continue;case 3:if(c!==26)break;f.mesh={$case:"cylinder",cylinder:ta.decode(i,i.uint32())};continue;case 4:if(c!==34)break;f.mesh={$case:"plane",plane:na.decode(i,i.uint32())};continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(So||(So={}));function M2(){return{uvs:[]}}var ea;(function(e){function r(o,u=rn.default.Writer.create()){u.uint32(10).fork();for(let i of o.uvs)u.float(i);return u.ldelim(),u}e.encode=r;function a(o,u){let i=o instanceof rn.default.Reader?o:rn.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=M2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c===13){f.uvs.push(i.float());continue}if(c===10){let y=i.uint32()+i.pos;for(;i.pos<y;)f.uvs.push(i.float());continue}break}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(ea||(ea={}));function F2(){return{radiusTop:void 0,radiusBottom:void 0}}var ta;(function(e){function r(o,u=rn.default.Writer.create()){return o.radiusTop!==void 0&&u.uint32(13).float(o.radiusTop),o.radiusBottom!==void 0&&u.uint32(21).float(o.radiusBottom),u}e.encode=r;function a(o,u){let i=o instanceof rn.default.Reader?o:rn.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=F2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==13)break;f.radiusTop=i.float();continue;case 2:if(c!==21)break;f.radiusBottom=i.float();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(ta||(ta={}));function L2(){return{uvs:[]}}var na;(function(e){function r(o,u=rn.default.Writer.create()){u.uint32(10).fork();for(let i of o.uvs)u.float(i);return u.ldelim(),u}e.encode=r;function a(o,u){let i=o instanceof rn.default.Reader?o:rn.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=L2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c===13){f.uvs.push(i.float());continue}if(c===10){let y=i.uint32()+i.pos;for(;i.pos<y;)f.uvs.push(i.float());continue}break}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(na||(na={}));function D2(){return{}}var ra;(function(e){function r(o,u=rn.default.Writer.create()){return u}e.encode=r;function a(o,u){let i=o instanceof rn.default.Reader?o:rn.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=D2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(ra||(ra={}));var Km={COMPONENT_ID:1018,serialize(e,r){let a=So.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return So.decode(e.buffer(),e.remainingBytes())},create(){return So.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBMeshRenderer"}};var Zs=be(ze());var Xs;(function(e){e[e.NFT_CLASSIC=0]="NFT_CLASSIC",e[e.NFT_BAROQUE_ORNAMENT=1]="NFT_BAROQUE_ORNAMENT",e[e.NFT_DIAMOND_ORNAMENT=2]="NFT_DIAMOND_ORNAMENT",e[e.NFT_MINIMAL_WIDE=3]="NFT_MINIMAL_WIDE",e[e.NFT_MINIMAL_GREY=4]="NFT_MINIMAL_GREY",e[e.NFT_BLOCKY=5]="NFT_BLOCKY",e[e.NFT_GOLD_EDGES=6]="NFT_GOLD_EDGES",e[e.NFT_GOLD_CARVED=7]="NFT_GOLD_CARVED",e[e.NFT_GOLD_WIDE=8]="NFT_GOLD_WIDE",e[e.NFT_GOLD_ROUNDED=9]="NFT_GOLD_ROUNDED",e[e.NFT_METAL_MEDIUM=10]="NFT_METAL_MEDIUM",e[e.NFT_METAL_WIDE=11]="NFT_METAL_WIDE",e[e.NFT_METAL_SLIM=12]="NFT_METAL_SLIM",e[e.NFT_METAL_ROUNDED=13]="NFT_METAL_ROUNDED",e[e.NFT_PINS=14]="NFT_PINS",e[e.NFT_MINIMAL_BLACK=15]="NFT_MINIMAL_BLACK",e[e.NFT_MINIMAL_WHITE=16]="NFT_MINIMAL_WHITE",e[e.NFT_TAPE=17]="NFT_TAPE",e[e.NFT_WOOD_SLIM=18]="NFT_WOOD_SLIM",e[e.NFT_WOOD_WIDE=19]="NFT_WOOD_WIDE",e[e.NFT_WOOD_TWIGS=20]="NFT_WOOD_TWIGS",e[e.NFT_CANVAS=21]="NFT_CANVAS",e[e.NFT_NONE=22]="NFT_NONE"})(Xs||(Xs={}));function W2(){return{urn:"",style:void 0,color:void 0}}var Eo;(function(e){function r(o,u=Zs.default.Writer.create()){return o.urn!==""&&u.uint32(10).string(o.urn),o.style!==void 0&&u.uint32(16).int32(o.style),o.color!==void 0&&vt.encode(o.color,u.uint32(26).fork()).ldelim(),u}e.encode=r;function a(o,u){let i=o instanceof Zs.default.Reader?o:Zs.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=W2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==10)break;f.urn=i.string();continue;case 2:if(c!==16)break;f.style=i.int32();continue;case 3:if(c!==26)break;f.color=vt.decode(i,i.uint32());continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Eo||(Eo={}));var $m={COMPONENT_ID:1040,serialize(e,r){let a=Eo.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return Eo.decode(e.buffer(),e.remainingBytes())},create(){return Eo.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBNftShape"}};var _r=be(ze());function H2(){return{pointerEvents:[]}}var To;(function(e){function r(o,u=_r.default.Writer.create()){for(let i of o.pointerEvents)ia.encode(i,u.uint32(10).fork()).ldelim();return u}e.encode=r;function a(o,u){let i=o instanceof _r.default.Reader?o:_r.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=H2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==10)break;f.pointerEvents.push(ia.decode(i,i.uint32()));continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(To||(To={}));function V2(){return{button:void 0,hoverText:void 0,maxDistance:void 0,showFeedback:void 0}}var oa;(function(e){function r(o,u=_r.default.Writer.create()){return o.button!==void 0&&u.uint32(8).int32(o.button),o.hoverText!==void 0&&u.uint32(18).string(o.hoverText),o.maxDistance!==void 0&&u.uint32(29).float(o.maxDistance),o.showFeedback!==void 0&&u.uint32(32).bool(o.showFeedback),u}e.encode=r;function a(o,u){let i=o instanceof _r.default.Reader?o:_r.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=V2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==8)break;f.button=i.int32();continue;case 2:if(c!==18)break;f.hoverText=i.string();continue;case 3:if(c!==29)break;f.maxDistance=i.float();continue;case 4:if(c!==32)break;f.showFeedback=i.bool();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(oa||(oa={}));function j2(){return{eventType:0,eventInfo:void 0}}var ia;(function(e){function r(o,u=_r.default.Writer.create()){return o.eventType!==0&&u.uint32(8).int32(o.eventType),o.eventInfo!==void 0&&oa.encode(o.eventInfo,u.uint32(18).fork()).ldelim(),u}e.encode=r;function a(o,u){let i=o instanceof _r.default.Reader?o:_r.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=j2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==8)break;f.eventType=i.int32();continue;case 2:if(c!==18)break;f.eventInfo=oa.decode(i,i.uint32());continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(ia||(ia={}));var eh={COMPONENT_ID:1062,serialize(e,r){let a=To.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return To.decode(e.buffer(),e.remainingBytes())},create(){return To.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBPointerEvents"}};var $s=be(ze());var Ks=be(ze());function G2(){return{position:void 0,globalOrigin:void 0,direction:void 0,normalHit:void 0,length:0,meshName:void 0,entityId:void 0}}var Dr;(function(e){function r(o,u=Ks.default.Writer.create()){return o.position!==void 0&&Xe.encode(o.position,u.uint32(10).fork()).ldelim(),o.globalOrigin!==void 0&&Xe.encode(o.globalOrigin,u.uint32(18).fork()).ldelim(),o.direction!==void 0&&Xe.encode(o.direction,u.uint32(26).fork()).ldelim(),o.normalHit!==void 0&&Xe.encode(o.normalHit,u.uint32(34).fork()).ldelim(),o.length!==0&&u.uint32(45).float(o.length),o.meshName!==void 0&&u.uint32(50).string(o.meshName),o.entityId!==void 0&&u.uint32(56).uint32(o.entityId),u}e.encode=r;function a(o,u){let i=o instanceof Ks.default.Reader?o:Ks.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=G2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==10)break;f.position=Xe.decode(i,i.uint32());continue;case 2:if(c!==18)break;f.globalOrigin=Xe.decode(i,i.uint32());continue;case 3:if(c!==26)break;f.direction=Xe.decode(i,i.uint32());continue;case 4:if(c!==34)break;f.normalHit=Xe.decode(i,i.uint32());continue;case 5:if(c!==45)break;f.length=i.float();continue;case 6:if(c!==50)break;f.meshName=i.string();continue;case 7:if(c!==56)break;f.entityId=i.uint32();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Dr||(Dr={}));function Y2(){return{button:0,hit:void 0,state:0,timestamp:0,analog:void 0,tickNumber:0}}var vo;(function(e){function r(o,u=$s.default.Writer.create()){return o.button!==0&&u.uint32(8).int32(o.button),o.hit!==void 0&&Dr.encode(o.hit,u.uint32(18).fork()).ldelim(),o.state!==0&&u.uint32(32).int32(o.state),o.timestamp!==0&&u.uint32(40).uint32(o.timestamp),o.analog!==void 0&&u.uint32(53).float(o.analog),o.tickNumber!==0&&u.uint32(56).uint32(o.tickNumber),u}e.encode=r;function a(o,u){let i=o instanceof $s.default.Reader?o:$s.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=Y2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==8)break;f.button=i.int32();continue;case 2:if(c!==18)break;f.hit=Dr.decode(i,i.uint32());continue;case 4:if(c!==32)break;f.state=i.int32();continue;case 5:if(c!==40)break;f.timestamp=i.uint32();continue;case 6:if(c!==53)break;f.analog=i.float();continue;case 7:if(c!==56)break;f.tickNumber=i.uint32();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(vo||(vo={}));var th={COMPONENT_ID:1063,serialize(e,r){let a=vo.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return vo.decode(e.buffer(),e.remainingBytes())},create(){return vo.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBPointerEventsResult"}};var ec=be(ze());function q2(){return{isPointerLocked:!1}}var ko;(function(e){function r(o,u=ec.default.Writer.create()){return o.isPointerLocked===!0&&u.uint32(8).bool(o.isPointerLocked),u}e.encode=r;function a(o,u){let i=o instanceof ec.default.Reader?o:ec.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=q2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==8)break;f.isPointerLocked=i.bool();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(ko||(ko={}));var nh={COMPONENT_ID:1074,serialize(e,r){let a=ko.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return ko.decode(e.buffer(),e.remainingBytes())},create(){return ko.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBPointerLock"}};var tc=be(ze());var nc;(function(e){e[e.RQT_HIT_FIRST=0]="RQT_HIT_FIRST",e[e.RQT_QUERY_ALL=1]="RQT_QUERY_ALL",e[e.RQT_NONE=2]="RQT_NONE"})(nc||(nc={}));function J2(){return{timestamp:void 0,originOffset:void 0,direction:void 0,maxDistance:0,queryType:0,continuous:void 0,collisionMask:void 0}}var Ro;(function(e){function r(o,u=tc.default.Writer.create()){switch(o.timestamp!==void 0&&u.uint32(8).uint32(o.timestamp),o.originOffset!==void 0&&Xe.encode(o.originOffset,u.uint32(18).fork()).ldelim(),o.direction?.$case){case"localDirection":Xe.encode(o.direction.localDirection,u.uint32(50).fork()).ldelim();break;case"globalDirection":Xe.encode(o.direction.globalDirection,u.uint32(26).fork()).ldelim();break;case"globalTarget":Xe.encode(o.direction.globalTarget,u.uint32(58).fork()).ldelim();break;case"targetEntity":u.uint32(80).uint32(o.direction.targetEntity);break}return o.maxDistance!==0&&u.uint32(37).float(o.maxDistance),o.queryType!==0&&u.uint32(40).int32(o.queryType),o.continuous!==void 0&&u.uint32(64).bool(o.continuous),o.collisionMask!==void 0&&u.uint32(72).uint32(o.collisionMask),u}e.encode=r;function a(o,u){let i=o instanceof tc.default.Reader?o:tc.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=J2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==8)break;f.timestamp=i.uint32();continue;case 2:if(c!==18)break;f.originOffset=Xe.decode(i,i.uint32());continue;case 6:if(c!==50)break;f.direction={$case:"localDirection",localDirection:Xe.decode(i,i.uint32())};continue;case 3:if(c!==26)break;f.direction={$case:"globalDirection",globalDirection:Xe.decode(i,i.uint32())};continue;case 7:if(c!==58)break;f.direction={$case:"globalTarget",globalTarget:Xe.decode(i,i.uint32())};continue;case 10:if(c!==80)break;f.direction={$case:"targetEntity",targetEntity:i.uint32()};continue;case 4:if(c!==37)break;f.maxDistance=i.float();continue;case 5:if(c!==40)break;f.queryType=i.int32();continue;case 8:if(c!==64)break;f.continuous=i.bool();continue;case 9:if(c!==72)break;f.collisionMask=i.uint32();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Ro||(Ro={}));var rh={COMPONENT_ID:1067,serialize(e,r){let a=Ro.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return Ro.decode(e.buffer(),e.remainingBytes())},create(){return Ro.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBRaycast"}};var rc=be(ze());function Q2(){return{timestamp:void 0,globalOrigin:void 0,direction:void 0,hits:[],tickNumber:0}}var wo;(function(e){function r(o,u=rc.default.Writer.create()){o.timestamp!==void 0&&u.uint32(8).uint32(o.timestamp),o.globalOrigin!==void 0&&Xe.encode(o.globalOrigin,u.uint32(18).fork()).ldelim(),o.direction!==void 0&&Xe.encode(o.direction,u.uint32(26).fork()).ldelim();for(let i of o.hits)Dr.encode(i,u.uint32(34).fork()).ldelim();return o.tickNumber!==0&&u.uint32(40).uint32(o.tickNumber),u}e.encode=r;function a(o,u){let i=o instanceof rc.default.Reader?o:rc.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=Q2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==8)break;f.timestamp=i.uint32();continue;case 2:if(c!==18)break;f.globalOrigin=Xe.decode(i,i.uint32());continue;case 3:if(c!==26)break;f.direction=Xe.decode(i,i.uint32());continue;case 4:if(c!==34)break;f.hits.push(Dr.decode(i,i.uint32()));continue;case 5:if(c!==40)break;f.tickNumber=i.uint32();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(wo||(wo={}));var oh={COMPONENT_ID:1068,serialize(e,r){let a=wo.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return wo.decode(e.buffer(),e.remainingBytes())},create(){return wo.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBRaycastResult"}};var oc=be(ze());function Z2(){return{text:"",font:void 0,fontSize:void 0,fontAutoSize:void 0,textAlign:void 0,width:void 0,height:void 0,paddingTop:void 0,paddingRight:void 0,paddingBottom:void 0,paddingLeft:void 0,lineSpacing:void 0,lineCount:void 0,textWrapping:void 0,shadowBlur:void 0,shadowOffsetX:void 0,shadowOffsetY:void 0,outlineWidth:void 0,shadowColor:void 0,outlineColor:void 0,textColor:void 0}}var bo;(function(e){function r(o,u=oc.default.Writer.create()){return o.text!==""&&u.uint32(10).string(o.text),o.font!==void 0&&u.uint32(16).int32(o.font),o.fontSize!==void 0&&u.uint32(29).float(o.fontSize),o.fontAutoSize!==void 0&&u.uint32(32).bool(o.fontAutoSize),o.textAlign!==void 0&&u.uint32(40).int32(o.textAlign),o.width!==void 0&&u.uint32(53).float(o.width),o.height!==void 0&&u.uint32(61).float(o.height),o.paddingTop!==void 0&&u.uint32(69).float(o.paddingTop),o.paddingRight!==void 0&&u.uint32(77).float(o.paddingRight),o.paddingBottom!==void 0&&u.uint32(85).float(o.paddingBottom),o.paddingLeft!==void 0&&u.uint32(93).float(o.paddingLeft),o.lineSpacing!==void 0&&u.uint32(101).float(o.lineSpacing),o.lineCount!==void 0&&u.uint32(104).int32(o.lineCount),o.textWrapping!==void 0&&u.uint32(112).bool(o.textWrapping),o.shadowBlur!==void 0&&u.uint32(125).float(o.shadowBlur),o.shadowOffsetX!==void 0&&u.uint32(133).float(o.shadowOffsetX),o.shadowOffsetY!==void 0&&u.uint32(141).float(o.shadowOffsetY),o.outlineWidth!==void 0&&u.uint32(149).float(o.outlineWidth),o.shadowColor!==void 0&&vt.encode(o.shadowColor,u.uint32(154).fork()).ldelim(),o.outlineColor!==void 0&&vt.encode(o.outlineColor,u.uint32(162).fork()).ldelim(),o.textColor!==void 0&&_t.encode(o.textColor,u.uint32(170).fork()).ldelim(),u}e.encode=r;function a(o,u){let i=o instanceof oc.default.Reader?o:oc.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=Z2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==10)break;f.text=i.string();continue;case 2:if(c!==16)break;f.font=i.int32();continue;case 3:if(c!==29)break;f.fontSize=i.float();continue;case 4:if(c!==32)break;f.fontAutoSize=i.bool();continue;case 5:if(c!==40)break;f.textAlign=i.int32();continue;case 6:if(c!==53)break;f.width=i.float();continue;case 7:if(c!==61)break;f.height=i.float();continue;case 8:if(c!==69)break;f.paddingTop=i.float();continue;case 9:if(c!==77)break;f.paddingRight=i.float();continue;case 10:if(c!==85)break;f.paddingBottom=i.float();continue;case 11:if(c!==93)break;f.paddingLeft=i.float();continue;case 12:if(c!==101)break;f.lineSpacing=i.float();continue;case 13:if(c!==104)break;f.lineCount=i.int32();continue;case 14:if(c!==112)break;f.textWrapping=i.bool();continue;case 15:if(c!==125)break;f.shadowBlur=i.float();continue;case 16:if(c!==133)break;f.shadowOffsetX=i.float();continue;case 17:if(c!==141)break;f.shadowOffsetY=i.float();continue;case 18:if(c!==149)break;f.outlineWidth=i.float();continue;case 19:if(c!==154)break;f.shadowColor=vt.decode(i,i.uint32());continue;case 20:if(c!==162)break;f.outlineColor=vt.decode(i,i.uint32());continue;case 21:if(c!==170)break;f.textColor=_t.decode(i,i.uint32());continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(bo||(bo={}));var ih={COMPONENT_ID:1030,serialize(e,r){let a=bo.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return bo.decode(e.buffer(),e.remainingBytes())},create(){return bo.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBTextShape"}};var ic=be(ze());var hi=be(ze());function X2(){return{top:0,left:0,right:0,bottom:0}}var Wr;(function(e){function r(o,u=hi.default.Writer.create()){return o.top!==0&&u.uint32(13).float(o.top),o.left!==0&&u.uint32(21).float(o.left),o.right!==0&&u.uint32(29).float(o.right),o.bottom!==0&&u.uint32(37).float(o.bottom),u}e.encode=r;function a(o,u){let i=o instanceof hi.default.Reader?o:hi.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=X2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==13)break;f.top=i.float();continue;case 2:if(c!==21)break;f.left=i.float();continue;case 3:if(c!==29)break;f.right=i.float();continue;case 4:if(c!==37)break;f.bottom=i.float();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Wr||(Wr={}));function K2(){return{x:0,y:0,width:0,height:0}}var ql;(function(e){function r(o,u=hi.default.Writer.create()){return o.x!==0&&u.uint32(13).float(o.x),o.y!==0&&u.uint32(21).float(o.y),o.width!==0&&u.uint32(29).float(o.width),o.height!==0&&u.uint32(37).float(o.height),u}e.encode=r;function a(o,u){let i=o instanceof hi.default.Reader?o:hi.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=K2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==13)break;f.x=i.float();continue;case 2:if(c!==21)break;f.y=i.float();continue;case 3:if(c!==29)break;f.width=i.float();continue;case 4:if(c!==37)break;f.height=i.float();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(ql||(ql={}));var ac;(function(e){e[e.NINE_SLICES=0]="NINE_SLICES",e[e.CENTER=1]="CENTER",e[e.STRETCH=2]="STRETCH"})(ac||(ac={}));function $2(){return{color:void 0,texture:void 0,textureMode:0,textureSlices:void 0,uvs:[]}}var No;(function(e){function r(o,u=ic.default.Writer.create()){o.color!==void 0&&_t.encode(o.color,u.uint32(10).fork()).ldelim(),o.texture!==void 0&&Qt.encode(o.texture,u.uint32(18).fork()).ldelim(),o.textureMode!==0&&u.uint32(24).int32(o.textureMode),o.textureSlices!==void 0&&Wr.encode(o.textureSlices,u.uint32(34).fork()).ldelim(),u.uint32(42).fork();for(let i of o.uvs)u.float(i);return u.ldelim(),u}e.encode=r;function a(o,u){let i=o instanceof ic.default.Reader?o:ic.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=$2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==10)break;f.color=_t.decode(i,i.uint32());continue;case 2:if(c!==18)break;f.texture=Qt.decode(i,i.uint32());continue;case 3:if(c!==24)break;f.textureMode=i.int32();continue;case 4:if(c!==34)break;f.textureSlices=Wr.decode(i,i.uint32());continue;case 5:if(c===45){f.uvs.push(i.float());continue}if(c===42){let y=i.uint32()+i.pos;for(;i.pos<y;)f.uvs.push(i.float());continue}break}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(No||(No={}));var ah={COMPONENT_ID:1053,serialize(e,r){let a=No.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return No.decode(e.buffer(),e.remainingBytes())},create(){return No.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBUiBackground"}};var uc=be(ze());function e3(){return{devicePixelRatio:0,width:0,height:0,interactableArea:void 0}}var Ao;(function(e){function r(o,u=uc.default.Writer.create()){return o.devicePixelRatio!==0&&u.uint32(13).float(o.devicePixelRatio),o.width!==0&&u.uint32(16).int32(o.width),o.height!==0&&u.uint32(24).int32(o.height),o.interactableArea!==void 0&&Wr.encode(o.interactableArea,u.uint32(34).fork()).ldelim(),u}e.encode=r;function a(o,u){let i=o instanceof uc.default.Reader?o:uc.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=e3();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==13)break;f.devicePixelRatio=i.float();continue;case 2:if(c!==16)break;f.width=i.int32();continue;case 3:if(c!==24)break;f.height=i.int32();continue;case 4:if(c!==34)break;f.interactableArea=Wr.decode(i,i.uint32());continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Ao||(Ao={}));var uh={COMPONENT_ID:1054,serialize(e,r){let a=Ao.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return Ao.decode(e.buffer(),e.remainingBytes())},create(){return Ao.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBUiCanvasInformation"}};var sc=be(ze());function t3(){return{acceptEmpty:!1,emptyLabel:void 0,options:[],selectedIndex:void 0,disabled:!1,color:void 0,textAlign:void 0,font:void 0,fontSize:void 0}}var Io;(function(e){function r(o,u=sc.default.Writer.create()){o.acceptEmpty===!0&&u.uint32(8).bool(o.acceptEmpty),o.emptyLabel!==void 0&&u.uint32(18).string(o.emptyLabel);for(let i of o.options)u.uint32(26).string(i);return o.selectedIndex!==void 0&&u.uint32(32).int32(o.selectedIndex),o.disabled===!0&&u.uint32(40).bool(o.disabled),o.color!==void 0&&_t.encode(o.color,u.uint32(50).fork()).ldelim(),o.textAlign!==void 0&&u.uint32(80).int32(o.textAlign),o.font!==void 0&&u.uint32(88).int32(o.font),o.fontSize!==void 0&&u.uint32(96).int32(o.fontSize),u}e.encode=r;function a(o,u){let i=o instanceof sc.default.Reader?o:sc.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=t3();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==8)break;f.acceptEmpty=i.bool();continue;case 2:if(c!==18)break;f.emptyLabel=i.string();continue;case 3:if(c!==26)break;f.options.push(i.string());continue;case 4:if(c!==32)break;f.selectedIndex=i.int32();continue;case 5:if(c!==40)break;f.disabled=i.bool();continue;case 6:if(c!==50)break;f.color=_t.decode(i,i.uint32());continue;case 10:if(c!==80)break;f.textAlign=i.int32();continue;case 11:if(c!==88)break;f.font=i.int32();continue;case 12:if(c!==96)break;f.fontSize=i.int32();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Io||(Io={}));var sh={COMPONENT_ID:1094,serialize(e,r){let a=Io.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return Io.decode(e.buffer(),e.remainingBytes())},create(){return Io.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBUiDropdown"}};var cc=be(ze());function n3(){return{value:0}}var zo;(function(e){function r(o,u=cc.default.Writer.create()){return o.value!==0&&u.uint32(8).int32(o.value),u}e.encode=r;function a(o,u){let i=o instanceof cc.default.Reader?o:cc.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=n3();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==8)break;f.value=i.int32();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(zo||(zo={}));var ch={COMPONENT_ID:1096,serialize(e,r){let a=zo.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return zo.decode(e.buffer(),e.remainingBytes())},create(){return zo.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBUiDropdownResult"}};var fc=be(ze());function r3(){return{placeholder:"",color:void 0,placeholderColor:void 0,disabled:!1,textAlign:void 0,font:void 0,fontSize:void 0,value:void 0}}var Po;(function(e){function r(o,u=fc.default.Writer.create()){return o.placeholder!==""&&u.uint32(10).string(o.placeholder),o.color!==void 0&&_t.encode(o.color,u.uint32(18).fork()).ldelim(),o.placeholderColor!==void 0&&_t.encode(o.placeholderColor,u.uint32(26).fork()).ldelim(),o.disabled===!0&&u.uint32(32).bool(o.disabled),o.textAlign!==void 0&&u.uint32(80).int32(o.textAlign),o.font!==void 0&&u.uint32(88).int32(o.font),o.fontSize!==void 0&&u.uint32(96).int32(o.fontSize),o.value!==void 0&&u.uint32(106).string(o.value),u}e.encode=r;function a(o,u){let i=o instanceof fc.default.Reader?o:fc.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=r3();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==10)break;f.placeholder=i.string();continue;case 2:if(c!==18)break;f.color=_t.decode(i,i.uint32());continue;case 3:if(c!==26)break;f.placeholderColor=_t.decode(i,i.uint32());continue;case 4:if(c!==32)break;f.disabled=i.bool();continue;case 10:if(c!==80)break;f.textAlign=i.int32();continue;case 11:if(c!==88)break;f.font=i.int32();continue;case 12:if(c!==96)break;f.fontSize=i.int32();continue;case 13:if(c!==106)break;f.value=i.string();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Po||(Po={}));var fh={COMPONENT_ID:1093,serialize(e,r){let a=Po.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return Po.decode(e.buffer(),e.remainingBytes())},create(){return Po.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBUiInput"}};var lc=be(ze());function o3(){return{value:""}}var Oo;(function(e){function r(o,u=lc.default.Writer.create()){return o.value!==""&&u.uint32(10).string(o.value),u}e.encode=r;function a(o,u){let i=o instanceof lc.default.Reader?o:lc.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=o3();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==10)break;f.value=i.string();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Oo||(Oo={}));var lh={COMPONENT_ID:1095,serialize(e,r){let a=Oo.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return Oo.decode(e.buffer(),e.remainingBytes())},create(){return Oo.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBUiInputResult"}};var dc=be(ze());function i3(){return{value:"",color:void 0,textAlign:void 0,font:void 0,fontSize:void 0}}var Co;(function(e){function r(o,u=dc.default.Writer.create()){return o.value!==""&&u.uint32(10).string(o.value),o.color!==void 0&&_t.encode(o.color,u.uint32(18).fork()).ldelim(),o.textAlign!==void 0&&u.uint32(24).int32(o.textAlign),o.font!==void 0&&u.uint32(32).int32(o.font),o.fontSize!==void 0&&u.uint32(40).int32(o.fontSize),u}e.encode=r;function a(o,u){let i=o instanceof dc.default.Reader?o:dc.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=i3();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==10)break;f.value=i.string();continue;case 2:if(c!==18)break;f.color=_t.decode(i,i.uint32());continue;case 3:if(c!==24)break;f.textAlign=i.int32();continue;case 4:if(c!==32)break;f.font=i.int32();continue;case 5:if(c!==40)break;f.fontSize=i.int32();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Co||(Co={}));var dh={COMPONENT_ID:1052,serialize(e,r){let a=Co.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return Co.decode(e.buffer(),e.remainingBytes())},create(){return Co.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBUiText"}};var pc=be(ze());var mc;(function(e){e[e.YGPT_RELATIVE=0]="YGPT_RELATIVE",e[e.YGPT_ABSOLUTE=1]="YGPT_ABSOLUTE"})(mc||(mc={}));var hc;(function(e){e[e.YGA_AUTO=0]="YGA_AUTO",e[e.YGA_FLEX_START=1]="YGA_FLEX_START",e[e.YGA_CENTER=2]="YGA_CENTER",e[e.YGA_FLEX_END=3]="YGA_FLEX_END",e[e.YGA_STRETCH=4]="YGA_STRETCH",e[e.YGA_BASELINE=5]="YGA_BASELINE",e[e.YGA_SPACE_BETWEEN=6]="YGA_SPACE_BETWEEN",e[e.YGA_SPACE_AROUND=7]="YGA_SPACE_AROUND"})(hc||(hc={}));var yc;(function(e){e[e.YGU_UNDEFINED=0]="YGU_UNDEFINED",e[e.YGU_POINT=1]="YGU_POINT",e[e.YGU_PERCENT=2]="YGU_PERCENT",e[e.YGU_AUTO=3]="YGU_AUTO"})(yc||(yc={}));var gc;(function(e){e[e.YGFD_ROW=0]="YGFD_ROW",e[e.YGFD_COLUMN=1]="YGFD_COLUMN",e[e.YGFD_COLUMN_REVERSE=2]="YGFD_COLUMN_REVERSE",e[e.YGFD_ROW_REVERSE=3]="YGFD_ROW_REVERSE"})(gc||(gc={}));var xc;(function(e){e[e.YGW_NO_WRAP=0]="YGW_NO_WRAP",e[e.YGW_WRAP=1]="YGW_WRAP",e[e.YGW_WRAP_REVERSE=2]="YGW_WRAP_REVERSE"})(xc||(xc={}));var _c;(function(e){e[e.YGJ_FLEX_START=0]="YGJ_FLEX_START",e[e.YGJ_CENTER=1]="YGJ_CENTER",e[e.YGJ_FLEX_END=2]="YGJ_FLEX_END",e[e.YGJ_SPACE_BETWEEN=3]="YGJ_SPACE_BETWEEN",e[e.YGJ_SPACE_AROUND=4]="YGJ_SPACE_AROUND",e[e.YGJ_SPACE_EVENLY=5]="YGJ_SPACE_EVENLY"})(_c||(_c={}));var Sc;(function(e){e[e.YGO_VISIBLE=0]="YGO_VISIBLE",e[e.YGO_HIDDEN=1]="YGO_HIDDEN",e[e.YGO_SCROLL=2]="YGO_SCROLL"})(Sc||(Sc={}));var Ec;(function(e){e[e.YGD_FLEX=0]="YGD_FLEX",e[e.YGD_NONE=1]="YGD_NONE"})(Ec||(Ec={}));var Tc;(function(e){e[e.YGE_LEFT=0]="YGE_LEFT",e[e.YGE_TOP=1]="YGE_TOP",e[e.YGE_RIGHT=2]="YGE_RIGHT",e[e.YGE_BOTTOM=3]="YGE_BOTTOM",e[e.YGE_START=4]="YGE_START",e[e.YGE_END=5]="YGE_END",e[e.YGE_HORIZONTAL=6]="YGE_HORIZONTAL",e[e.YGE_VERTICAL=7]="YGE_VERTICAL",e[e.YGE_ALL=8]="YGE_ALL"})(Tc||(Tc={}));function a3(){return{parent:0,rightOf:0,alignContent:void 0,alignItems:void 0,flexWrap:void 0,flexShrink:void 0,positionType:0,alignSelf:0,flexDirection:0,justifyContent:0,overflow:0,display:0,flexBasisUnit:0,flexBasis:0,flexGrow:0,widthUnit:0,width:0,heightUnit:0,height:0,minWidthUnit:0,minWidth:0,minHeightUnit:0,minHeight:0,maxWidthUnit:0,maxWidth:0,maxHeightUnit:0,maxHeight:0,positionLeftUnit:0,positionLeft:0,positionTopUnit:0,positionTop:0,positionRightUnit:0,positionRight:0,positionBottomUnit:0,positionBottom:0,marginLeftUnit:0,marginLeft:0,marginTopUnit:0,marginTop:0,marginRightUnit:0,marginRight:0,marginBottomUnit:0,marginBottom:0,paddingLeftUnit:0,paddingLeft:0,paddingTopUnit:0,paddingTop:0,paddingRightUnit:0,paddingRight:0,paddingBottomUnit:0,paddingBottom:0}}var Uo;(function(e){function r(o,u=pc.default.Writer.create()){return o.parent!==0&&u.uint32(8).int32(o.parent),o.rightOf!==0&&u.uint32(16).int32(o.rightOf),o.alignContent!==void 0&&u.uint32(24).int32(o.alignContent),o.alignItems!==void 0&&u.uint32(32).int32(o.alignItems),o.flexWrap!==void 0&&u.uint32(40).int32(o.flexWrap),o.flexShrink!==void 0&&u.uint32(53).float(o.flexShrink),o.positionType!==0&&u.uint32(56).int32(o.positionType),o.alignSelf!==0&&u.uint32(64).int32(o.alignSelf),o.flexDirection!==0&&u.uint32(72).int32(o.flexDirection),o.justifyContent!==0&&u.uint32(80).int32(o.justifyContent),o.overflow!==0&&u.uint32(88).int32(o.overflow),o.display!==0&&u.uint32(96).int32(o.display),o.flexBasisUnit!==0&&u.uint32(104).int32(o.flexBasisUnit),o.flexBasis!==0&&u.uint32(117).float(o.flexBasis),o.flexGrow!==0&&u.uint32(125).float(o.flexGrow),o.widthUnit!==0&&u.uint32(128).int32(o.widthUnit),o.width!==0&&u.uint32(141).float(o.width),o.heightUnit!==0&&u.uint32(144).int32(o.heightUnit),o.height!==0&&u.uint32(157).float(o.height),o.minWidthUnit!==0&&u.uint32(160).int32(o.minWidthUnit),o.minWidth!==0&&u.uint32(173).float(o.minWidth),o.minHeightUnit!==0&&u.uint32(176).int32(o.minHeightUnit),o.minHeight!==0&&u.uint32(189).float(o.minHeight),o.maxWidthUnit!==0&&u.uint32(192).int32(o.maxWidthUnit),o.maxWidth!==0&&u.uint32(205).float(o.maxWidth),o.maxHeightUnit!==0&&u.uint32(208).int32(o.maxHeightUnit),o.maxHeight!==0&&u.uint32(221).float(o.maxHeight),o.positionLeftUnit!==0&&u.uint32(224).int32(o.positionLeftUnit),o.positionLeft!==0&&u.uint32(237).float(o.positionLeft),o.positionTopUnit!==0&&u.uint32(240).int32(o.positionTopUnit),o.positionTop!==0&&u.uint32(253).float(o.positionTop),o.positionRightUnit!==0&&u.uint32(256).int32(o.positionRightUnit),o.positionRight!==0&&u.uint32(269).float(o.positionRight),o.positionBottomUnit!==0&&u.uint32(272).int32(o.positionBottomUnit),o.positionBottom!==0&&u.uint32(285).float(o.positionBottom),o.marginLeftUnit!==0&&u.uint32(288).int32(o.marginLeftUnit),o.marginLeft!==0&&u.uint32(301).float(o.marginLeft),o.marginTopUnit!==0&&u.uint32(304).int32(o.marginTopUnit),o.marginTop!==0&&u.uint32(317).float(o.marginTop),o.marginRightUnit!==0&&u.uint32(320).int32(o.marginRightUnit),o.marginRight!==0&&u.uint32(333).float(o.marginRight),o.marginBottomUnit!==0&&u.uint32(336).int32(o.marginBottomUnit),o.marginBottom!==0&&u.uint32(349).float(o.marginBottom),o.paddingLeftUnit!==0&&u.uint32(352).int32(o.paddingLeftUnit),o.paddingLeft!==0&&u.uint32(365).float(o.paddingLeft),o.paddingTopUnit!==0&&u.uint32(368).int32(o.paddingTopUnit),o.paddingTop!==0&&u.uint32(381).float(o.paddingTop),o.paddingRightUnit!==0&&u.uint32(384).int32(o.paddingRightUnit),o.paddingRight!==0&&u.uint32(397).float(o.paddingRight),o.paddingBottomUnit!==0&&u.uint32(400).int32(o.paddingBottomUnit),o.paddingBottom!==0&&u.uint32(413).float(o.paddingBottom),u}e.encode=r;function a(o,u){let i=o instanceof pc.default.Reader?o:pc.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=a3();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==8)break;f.parent=i.int32();continue;case 2:if(c!==16)break;f.rightOf=i.int32();continue;case 3:if(c!==24)break;f.alignContent=i.int32();continue;case 4:if(c!==32)break;f.alignItems=i.int32();continue;case 5:if(c!==40)break;f.flexWrap=i.int32();continue;case 6:if(c!==53)break;f.flexShrink=i.float();continue;case 7:if(c!==56)break;f.positionType=i.int32();continue;case 8:if(c!==64)break;f.alignSelf=i.int32();continue;case 9:if(c!==72)break;f.flexDirection=i.int32();continue;case 10:if(c!==80)break;f.justifyContent=i.int32();continue;case 11:if(c!==88)break;f.overflow=i.int32();continue;case 12:if(c!==96)break;f.display=i.int32();continue;case 13:if(c!==104)break;f.flexBasisUnit=i.int32();continue;case 14:if(c!==117)break;f.flexBasis=i.float();continue;case 15:if(c!==125)break;f.flexGrow=i.float();continue;case 16:if(c!==128)break;f.widthUnit=i.int32();continue;case 17:if(c!==141)break;f.width=i.float();continue;case 18:if(c!==144)break;f.heightUnit=i.int32();continue;case 19:if(c!==157)break;f.height=i.float();continue;case 20:if(c!==160)break;f.minWidthUnit=i.int32();continue;case 21:if(c!==173)break;f.minWidth=i.float();continue;case 22:if(c!==176)break;f.minHeightUnit=i.int32();continue;case 23:if(c!==189)break;f.minHeight=i.float();continue;case 24:if(c!==192)break;f.maxWidthUnit=i.int32();continue;case 25:if(c!==205)break;f.maxWidth=i.float();continue;case 26:if(c!==208)break;f.maxHeightUnit=i.int32();continue;case 27:if(c!==221)break;f.maxHeight=i.float();continue;case 28:if(c!==224)break;f.positionLeftUnit=i.int32();continue;case 29:if(c!==237)break;f.positionLeft=i.float();continue;case 30:if(c!==240)break;f.positionTopUnit=i.int32();continue;case 31:if(c!==253)break;f.positionTop=i.float();continue;case 32:if(c!==256)break;f.positionRightUnit=i.int32();continue;case 33:if(c!==269)break;f.positionRight=i.float();continue;case 34:if(c!==272)break;f.positionBottomUnit=i.int32();continue;case 35:if(c!==285)break;f.positionBottom=i.float();continue;case 36:if(c!==288)break;f.marginLeftUnit=i.int32();continue;case 37:if(c!==301)break;f.marginLeft=i.float();continue;case 38:if(c!==304)break;f.marginTopUnit=i.int32();continue;case 39:if(c!==317)break;f.marginTop=i.float();continue;case 40:if(c!==320)break;f.marginRightUnit=i.int32();continue;case 41:if(c!==333)break;f.marginRight=i.float();continue;case 42:if(c!==336)break;f.marginBottomUnit=i.int32();continue;case 43:if(c!==349)break;f.marginBottom=i.float();continue;case 44:if(c!==352)break;f.paddingLeftUnit=i.int32();continue;case 45:if(c!==365)break;f.paddingLeft=i.float();continue;case 46:if(c!==368)break;f.paddingTopUnit=i.int32();continue;case 47:if(c!==381)break;f.paddingTop=i.float();continue;case 48:if(c!==384)break;f.paddingRightUnit=i.int32();continue;case 49:if(c!==397)break;f.paddingRight=i.float();continue;case 50:if(c!==400)break;f.paddingBottomUnit=i.int32();continue;case 51:if(c!==413)break;f.paddingBottom=i.float();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Uo||(Uo={}));var ph={COMPONENT_ID:1050,serialize(e,r){let a=Uo.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return Uo.decode(e.buffer(),e.remainingBytes())},create(){return Uo.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBUiTransform"}};var vc=be(ze());var kc;(function(e){e[e.VS_NONE=0]="VS_NONE",e[e.VS_ERROR=1]="VS_ERROR",e[e.VS_LOADING=2]="VS_LOADING",e[e.VS_READY=3]="VS_READY",e[e.VS_PLAYING=4]="VS_PLAYING",e[e.VS_BUFFERING=5]="VS_BUFFERING",e[e.VS_SEEKING=6]="VS_SEEKING",e[e.VS_PAUSED=7]="VS_PAUSED"})(kc||(kc={}));function u3(){return{timestamp:0,tickNumber:0,currentOffset:0,videoLength:0,state:0}}var Bo;(function(e){function r(o,u=vc.default.Writer.create()){return o.timestamp!==0&&u.uint32(8).uint32(o.timestamp),o.tickNumber!==0&&u.uint32(16).uint32(o.tickNumber),o.currentOffset!==0&&u.uint32(29).float(o.currentOffset),o.videoLength!==0&&u.uint32(37).float(o.videoLength),o.state!==0&&u.uint32(40).int32(o.state),u}e.encode=r;function a(o,u){let i=o instanceof vc.default.Reader?o:vc.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=u3();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==8)break;f.timestamp=i.uint32();continue;case 2:if(c!==16)break;f.tickNumber=i.uint32();continue;case 3:if(c!==29)break;f.currentOffset=i.float();continue;case 4:if(c!==37)break;f.videoLength=i.float();continue;case 5:if(c!==40)break;f.state=i.int32();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Bo||(Bo={}));var mh={COMPONENT_ID:1044,serialize(e,r){let a=Bo.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return Bo.decode(e.buffer(),e.remainingBytes())},create(){return Bo.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBVideoEvent"}};var Rc=be(ze());function s3(){return{src:"",playing:void 0,position:void 0,volume:void 0,playbackRate:void 0,loop:void 0}}var Mo;(function(e){function r(o,u=Rc.default.Writer.create()){return o.src!==""&&u.uint32(10).string(o.src),o.playing!==void 0&&u.uint32(16).bool(o.playing),o.position!==void 0&&u.uint32(29).float(o.position),o.volume!==void 0&&u.uint32(37).float(o.volume),o.playbackRate!==void 0&&u.uint32(45).float(o.playbackRate),o.loop!==void 0&&u.uint32(48).bool(o.loop),u}e.encode=r;function a(o,u){let i=o instanceof Rc.default.Reader?o:Rc.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=s3();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==10)break;f.src=i.string();continue;case 2:if(c!==16)break;f.playing=i.bool();continue;case 3:if(c!==29)break;f.position=i.float();continue;case 4:if(c!==37)break;f.volume=i.float();continue;case 5:if(c!==45)break;f.playbackRate=i.float();continue;case 6:if(c!==48)break;f.loop=i.bool();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Mo||(Mo={}));var hh={COMPONENT_ID:1043,serialize(e,r){let a=Mo.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return Mo.decode(e.buffer(),e.remainingBytes())},create(){return Mo.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBVideoPlayer"}};var wc=be(ze());function c3(){return{visible:void 0}}var Fo;(function(e){function r(o,u=wc.default.Writer.create()){return o.visible!==void 0&&u.uint32(8).bool(o.visible),u}e.encode=r;function a(o,u){let i=o instanceof wc.default.Reader?o:wc.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=c3();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==8)break;f.visible=i.bool();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Fo||(Fo={}));var yh={COMPONENT_ID:1081,serialize(e,r){let a=Fo.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return Fo.decode(e.buffer(),e.remainingBytes())},create(){return Fo.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBVisibilityComponent"}};var Jl=e=>e.defineComponentFromSchema("core::Animator",km),bc=e=>e.defineComponentFromSchema("core::AudioSource",Rm),Nc=e=>e.defineComponentFromSchema("core::AudioStream",wm),Ac=e=>e.defineComponentFromSchema("core::AvatarAttach",bm),Ic=e=>e.defineComponentFromSchema("core::AvatarModifierArea",zm),zc=e=>e.defineComponentFromSchema("core::AvatarShape",Vm),Pc=e=>e.defineComponentFromSchema("core::Billboard",jm),Oc=e=>e.defineComponentFromSchema("core::CameraMode",Gm),Cc=e=>e.defineComponentFromSchema("core::CameraModeArea",Ym),Uc=e=>e.defineComponentFromSchema("core::EngineInfo",qm),Bc=e=>e.defineComponentFromSchema("core::GltfContainer",Jm),Mc=e=>e.defineComponentFromSchema("core::GltfContainerLoadingState",Qm),Ql=e=>e.defineComponentFromSchema("core::Material",Zm),Zl=e=>e.defineComponentFromSchema("core::MeshCollider",Xm),Xl=e=>e.defineComponentFromSchema("core::MeshRenderer",Km),Fc=e=>e.defineComponentFromSchema("core::NftShape",$m),aa=e=>e.defineComponentFromSchema("core::PointerEvents",eh),ua=e=>e.defineValueSetComponentFromSchema("core::PointerEventsResult",th,{timestampFunction:r=>r.timestamp,maxElements:100}),Lc=e=>e.defineComponentFromSchema("core::PointerLock",nh),sa=e=>e.defineComponentFromSchema("core::Raycast",rh),ca=e=>e.defineComponentFromSchema("core::RaycastResult",oh),Dc=e=>e.defineComponentFromSchema("core::TextShape",ih),fa=e=>e.defineComponentFromSchema("core::UiBackground",ah),Wc=e=>e.defineComponentFromSchema("core::UiCanvasInformation",uh),la=e=>e.defineComponentFromSchema("core::UiDropdown",sh),da=e=>e.defineComponentFromSchema("core::UiDropdownResult",ch),pa=e=>e.defineComponentFromSchema("core::UiInput",fh),ma=e=>e.defineComponentFromSchema("core::UiInputResult",lh),ha=e=>e.defineComponentFromSchema("core::UiText",dh),ya=e=>e.defineComponentFromSchema("core::UiTransform",ph),ga=e=>e.defineValueSetComponentFromSchema("core::VideoEvent",mh,{timestampFunction:r=>r.timestamp,maxElements:100}),xa=e=>e.defineComponentFromSchema("core::VideoPlayer",hh),Hc=e=>e.defineComponentFromSchema("core::VisibilityComponent",yh),hu={"core::Animator":Jl,"core::AudioSource":bc,"core::AudioStream":Nc,"core::AvatarAttach":Ac,"core::AvatarModifierArea":Ic,"core::AvatarShape":zc,"core::Billboard":Pc,"core::CameraMode":Oc,"core::CameraModeArea":Cc,"core::EngineInfo":Uc,"core::GltfContainer":Bc,"core::GltfContainerLoadingState":Mc,"core::Material":Ql,"core::MeshCollider":Zl,"core::MeshRenderer":Xl,"core::NftShape":Fc,"core::PointerEvents":aa,"core::PointerEventsResult":ua,"core::PointerLock":Lc,"core::Raycast":sa,"core::RaycastResult":ca,"core::TextShape":Dc,"core::UiBackground":fa,"core::UiCanvasInformation":Wc,"core::UiDropdown":la,"core::UiDropdownResult":da,"core::UiInput":pa,"core::UiInputResult":ma,"core::UiText":ha,"core::UiTransform":ya,"core::VideoEvent":ga,"core::VideoPlayer":xa,"core::VisibilityComponent":Hc};function gh(e){let r=Jl(e);function a(o,u){let i=r.getMutableOrNull(o);if(!i)return[null,null];let p=i.states.find(f=>f.name===u||f.clip===u);return p?[i,p]:[i,null]}return{...r,getClipOrNull(o,u){let[i,p]=a(o,u);return p},getClip(o,u){let[i,p]=a(o,u);if(!i)throw new Error(`There is no Animator found in the entity ${o}`);if(!p)throw new Error(`The Animator component of ${o} has no the state ${u}`);return p},playSingleAnimation(o,u,i=!0){let[p,f]=a(o,u);if(!p||!f)return!1;for(let c of p.states)c.playing=!1,c.shouldReset=!0;return f.playing=!0,f.shouldReset=i,!0},stopAllAnimations(o,u=!0){let i=r.getMutableOrNull(o);if(!i)return!1;for(let p of i.states)p.playing=!1,p.shouldReset=u;return!0}}}var l3={Common(e){return{tex:{$case:"texture",texture:e}}},Avatar(e){return{tex:{$case:"avatarTexture",avatarTexture:e}}},Video(e){return{tex:{$case:"videoTexture",videoTexture:e}}}};function xh(e){let r=Ql(e);return{...r,Texture:l3,setBasicMaterial(a,o){r.createOrReplace(a,{material:{$case:"unlit",unlit:o}})},setPbrMaterial(a,o){r.createOrReplace(a,{material:{$case:"pbr",pbr:o}})}}}function _h(e){let r=Zl(e);function a(o){if(Array.isArray(o))return o.map(u=>u).reduce((u,i)=>u|i,0);if(o)return o}return{...r,setBox(o,u){r.createOrReplace(o,{mesh:{$case:"box",box:{}},collisionMask:a(u)})},setPlane(o,u){r.createOrReplace(o,{mesh:{$case:"plane",plane:{}},collisionMask:a(u)})},setCylinder(o,u,i,p){r.createOrReplace(o,{mesh:{$case:"cylinder",cylinder:{radiusBottom:u,radiusTop:i}},collisionMask:a(p)})},setSphere(o,u){r.createOrReplace(o,{mesh:{$case:"sphere",sphere:{}},collisionMask:a(u)})}}}function Sh(e){let r=Xl(e);return{...r,setBox(a,o){r.createOrReplace(a,{mesh:{$case:"box",box:{uvs:o||[]}}})},setPlane(a,o){r.createOrReplace(a,{mesh:{$case:"plane",plane:{uvs:o||[]}}})},setCylinder(a,o,u){r.createOrReplace(a,{mesh:{$case:"cylinder",cylinder:{radiusBottom:o,radiusTop:u}}})},setSphere(a){r.createOrReplace(a,{mesh:{$case:"sphere",sphere:{}}})}}}var Kl={serialize(e,r){let a=r.incrementWriteOffset(44);r.setFloat32(a,e.position.x),r.setFloat32(a+4,e.position.y),r.setFloat32(a+8,e.position.z),r.setFloat32(a+12,e.rotation.x),r.setFloat32(a+16,e.rotation.y),r.setFloat32(a+20,e.rotation.z),r.setFloat32(a+24,e.rotation.w),r.setFloat32(a+28,e.scale.x),r.setFloat32(a+32,e.scale.y),r.setFloat32(a+36,e.scale.z),r.setUint32(a+40,e.parent||0)},deserialize(e){let r=e.incrementReadOffset(44);return{position:{x:e.getFloat32(r),y:e.getFloat32(r+4),z:e.getFloat32(r+8)},rotation:{x:e.getFloat32(r+12),y:e.getFloat32(r+16),z:e.getFloat32(r+20),w:e.getFloat32(r+24)},scale:{x:e.getFloat32(r+28),y:e.getFloat32(r+32),z:e.getFloat32(r+36)},parent:e.getUint32(r+40)}},create(){return{position:{x:0,y:0,z:0},scale:{x:1,y:1,z:1},rotation:{x:0,y:0,z:0,w:1},parent:0}},extend(e){return{position:{x:0,y:0,z:0},scale:{x:1,y:1,z:1},rotation:{x:0,y:0,z:0,w:1},parent:0,...e}},jsonSchema:{type:"object",properties:{position:{type:"object",properties:{x:{type:"number"},y:{type:"number"},z:{type:"number"}}},scale:{type:"object",properties:{x:{type:"number"},y:{type:"number"},z:{type:"number"}}},rotation:{type:"object",properties:{x:{type:"number"},y:{type:"number"},z:{type:"number"},w:{type:"number"}}},parent:{type:"integer"}},serializationType:"transform"}};function Eh(e){let r=e.defineComponentFromSchema("core::Transform",Kl);return{...r,create(a,o){return r.create(a,Kl.extend(o))},createOrReplace(a,o){return r.createOrReplace(a,Kl.extend(o))}}}var Hr=e=>Eh(e),$l=e=>xh(e),ed=e=>gh(e),td=e=>Sh(e),nd=e=>_h(e);var rd={"core::Transform":1,"core::Animator":1042,"core::AudioSource":1020,"core::AudioStream":1021,"core::AvatarAttach":1073,"core::AvatarModifierArea":1070,"core::AvatarShape":1080,"core::Billboard":1090,"core::CameraMode":1072,"core::CameraModeArea":1071,"core::EngineInfo":1048,"core::GltfContainer":1041,"core::GltfContainerLoadingState":1049,"core::Material":1017,"core::MeshCollider":1019,"core::MeshRenderer":1018,"core::NftShape":1040,"core::PointerEvents":1062,"core::PointerEventsResult":1063,"core::PointerLock":1074,"core::Raycast":1067,"core::RaycastResult":1068,"core::TextShape":1030,"core::UiBackground":1053,"core::UiCanvasInformation":1054,"core::UiDropdown":1094,"core::UiDropdownResult":1096,"core::UiInput":1093,"core::UiInputResult":1095,"core::UiText":1052,"core::UiTransform":1050,"core::VideoEvent":1044,"core::VideoPlayer":1043,"core::VisibilityComponent":1081};var vh=be(zs());var d3=new Int32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]);function p3(e,r){let a=~~r^-1;for(let o=0;o<e.length;o++)a=d3[(a^e[o])&255]^a>>>8;return a^-1}function Th(e,r=0){return p3(e,r)>>>0}var od=1<<11;function Sr(e){if(rd[e])return rd[e];let r=new Uint8Array(128);return vh.write(e,r,0),(Th(r)+od&4294967295)>>>0}var id=typeof process=="object"&&!1||!1;function yu(e,r){if(id&&e&&typeof e=="object"&&typeof e.then=="function")throw new Error(r);return e}var Vc=e=>({serialize(r,a){a.writeUint32(r.length);for(let o of r)e.serialize(o,a)},deserialize(r){let a=[],o=r.readUint32();for(let u=0;u<o;u++)a.push(e.deserialize(r));return a},create(){return[]},jsonSchema:{type:"array",items:e.jsonSchema,serializationType:"array"}});var gu={serialize(e,r){r.writeInt8(e?1:0)},deserialize(e){return e.readInt8()===1},create(){return!1},jsonSchema:{type:"boolean",serializationType:"boolean"}};var xu={serialize(e,r){r.writeInt64(BigInt(e))},deserialize(e){return Number(e.readInt64())},create(){return 0},jsonSchema:{type:"integer",serializationType:"int64"}},Lo={serialize(e,r){r.writeInt32(e)},deserialize(e){return e.readInt32()},create(){return 0},jsonSchema:{type:"integer",serializationType:"int32"}},_u={serialize(e,r){r.writeInt16(e)},deserialize(e){return e.readInt16()},create(){return 0},jsonSchema:{type:"integer",serializationType:"int16"}},Su={serialize(e,r){r.writeInt8(e)},deserialize(e){return e.readInt8()},create(){return 0},jsonSchema:{type:"integer",serializationType:"int8"}};var jc={serialize(e,r){r.writeUtf8String(e)},deserialize(e){return e.readUtf8String()},create(){return""},jsonSchema:{type:"string",serializationType:"utf8-string"}},Eu=jc;function m3(e){let o=0,u=0;for(let i in e){if(typeof e[i]=="number"){if(e[i]>2147483647||e[i]<-2147483648)throw new Error("Enum member values must be numbers within the range of -2147483648 to 2147483647.");o++}u++}if(u!==o*2)throw new Error("All enum member values must be of numeric type.")}function h3(e){for(let r in e)if(typeof e[r]!="string")throw new Error("All enum member values must be of string type.")}var y3="enum-int",Gc=(e,r)=>(m3(e),{serialize(a,o){Lo.serialize(a,o)},deserialize(a){return Lo.deserialize(a)},create(){return r},jsonSchema:{type:"integer",enum:Object.values(e).filter(a=>Number.isInteger(a)),default:r,serializationType:y3,enumObject:e}}),g3="enum-string",Yc=(e,r)=>(h3(e),{serialize(a,o){jc.serialize(a,o)},deserialize(a){return jc.deserialize(a)},create(){return r},jsonSchema:{type:"string",enum:Object.values(e),default:r,serializationType:g3,enumObject:e}});var _a={serialize(e,r){r.writeFloat32(e)},deserialize(e){return e.readFloat32()},create(){return 0},jsonSchema:{type:"number",serializationType:"float32"}},Tu={serialize(e,r){r.writeFloat64(e)},deserialize(e){return e.readFloat64()},create(){return 0},jsonSchema:{type:"number",serializationType:"float64"}};var vu={serialize(e,r){r.writeFloat32(e.r),r.writeFloat32(e.g),r.writeFloat32(e.b)},deserialize(e){return{r:e.readFloat32(),g:e.readFloat32(),b:e.readFloat32()}},create(){return{r:0,g:0,b:0}},jsonSchema:{type:"object",properties:{r:{type:"number"},g:{type:"number"},b:{type:"number"}},serializationType:"color3"}};var ku={serialize(e,r){r.writeFloat32(e.r),r.writeFloat32(e.g),r.writeFloat32(e.b),r.writeFloat32(e.a)},deserialize(e){return{r:e.readFloat32(),g:e.readFloat32(),b:e.readFloat32(),a:e.readFloat32()}},create(){return{r:0,g:0,b:0,a:0}},jsonSchema:{type:"object",properties:{r:{type:"number"},g:{type:"number"},b:{type:"number"},a:{type:"number"}},serializationType:"color4"}};var Ru={serialize(e,r){r.writeInt32(e)},deserialize(e){return e.readInt32()},create(){return 0},jsonSchema:{type:"integer",serializationType:"entity"}};var wu={serialize(e,r){r.writeFloat32(e.x),r.writeFloat32(e.y),r.writeFloat32(e.z),r.writeFloat32(e.w)},deserialize(e){return{x:e.readFloat32(),y:e.readFloat32(),z:e.readFloat32(),w:e.readFloat32()}},create(){return{x:0,y:0,z:0,w:0}},jsonSchema:{type:"object",properties:{x:{type:"number"},y:{type:"number"},z:{type:"number"},w:{type:"number"}},serializationType:"quaternion"}};var bu={serialize(e,r){r.writeFloat32(e.x),r.writeFloat32(e.y),r.writeFloat32(e.z)},deserialize(e){return{x:e.readFloat32(),y:e.readFloat32(),z:e.readFloat32()}},create(){return{x:0,y:0,z:0}},jsonSchema:{type:"object",properties:{x:{type:"number"},y:{type:"number"},z:{type:"number"},w:{type:"number"}},serializationType:"vector3"}};var qc=(e,r)=>{let a=Object.keys(e).reduce((o,u)=>(o[u]=e[u].jsonSchema,o),{});return{serialize(o,u){for(let i in e)e[i].serialize(o[i],u)},deserialize(o){let u={};for(let i in e)u[i]=e[i].deserialize(o);return u},create(){let o={};for(let u in e)o[u]=e[u].create();return{...o,...r}},extend:o=>{let u={};for(let i in e)u[i]=e[i].create();return{...u,...r,...o}},jsonSchema:{type:"object",properties:a,serializationType:"map"}}};var Jc=e=>({serialize(r,a){r?(a.writeInt8(1),e.serialize(r,a)):a.writeInt8(0)},deserialize(r){if(r.readInt8())return e.deserialize(r)},create(){},jsonSchema:{type:e.jsonSchema.type,serializationType:"optional",optionalJsonSchema:e.jsonSchema}});var Qc=e=>{let r=Object.keys(e),a=r.reduce((u,i,p)=>(u[i]=p,u),{}),o=r.reduce((u,i)=>(u[i]=e[i].jsonSchema,u),{});return{serialize({$case:u,value:i},p){let f=a[u.toString()]+1;p.writeUint8(f),e[u].serialize(i,p)},deserialize(u){let i=r[u.readInt8()-1],p=e[i].deserialize(u);return{$case:i,value:p}},create(){return{}},jsonSchema:{type:"object",properties:o,serializationType:"one-of"}}};var kh=(e,r)=>r.includes(e.serializationType),x3=e=>kh(e,["one-of"]),_3=()=>({type:{type:"object",serializationType:"unknown"},value:void 0}),Zc=e=>kh(e,["array","map"]),ad=(e,r,a)=>{let o=e[a],u=r[a];if(x3(o)){let i=u;if(!i.$case)return _3();let p=o.properties[i.$case];return Zc(p)&&(r[a]={[i.$case]:i.value}),{type:p,value:i.value}}return{type:o,value:u}};var Rh={[gu.jsonSchema.serializationType]:gu,[Eu.jsonSchema.serializationType]:Eu,[_a.jsonSchema.serializationType]:_a,[Tu.jsonSchema.serializationType]:Tu,[Su.jsonSchema.serializationType]:Su,[_u.jsonSchema.serializationType]:_u,[Lo.jsonSchema.serializationType]:Lo,[xu.jsonSchema.serializationType]:xu,[bu.jsonSchema.serializationType]:bu,[wu.jsonSchema.serializationType]:wu,[vu.jsonSchema.serializationType]:vu,[ku.jsonSchema.serializationType]:ku,[Ru.jsonSchema.serializationType]:Ru};function Sa(e){if(Rh[e.serializationType])return Rh[e.serializationType];if(e.serializationType==="map"){let r=e,a={};for(let o in r.properties)a[o]=Sa(r.properties[o]);return qc(a)}if(e.serializationType==="optional")return Jc(Sa(e.optionalJsonSchema));if(e.serializationType==="array")return Vc(Sa(e.items));if(e.serializationType==="enum-int"){let r=e;return Gc(r.enumObject,r.default)}if(e.serializationType==="enum-string"){let r=e;return Yc(r.enumObject,r.default)}if(e.serializationType==="one-of"){let r=e,a={};for(let o in r.properties)a[o]=Sa(r.properties[o]);return Qc(a)}throw new Error(`${e.serializationType} is not supported as reverse schema generation.`)}function Xc(e,r,a){if(e.serializationType==="map"){let{properties:o}=e,u=r;for(let i in o){let{type:p,value:f}=ad(o,u,i);if(p.serializationType!=="unknown")if(Zc(p))Xc(p,f,a);else{let c=a(f,p);c.changed&&(u[i]=c.value)}}}else if(e.serializationType==="array"){let{items:o}=e,u=r;for(let i=0,p=u.length;i<p;i++){let{type:f,value:c}=ad({items:o},{items:u[i]},"items");if(Zc(f))Xc(f,c,a);else{let y=a(c,f);y.changed&&(u[i]=y.value)}}}}var yn;(function(e){e.Boolean=gu,e.String=Eu,e.Float=_a,e.Double=Tu,e.Byte=Su,e.Short=_u,e.Int=Lo,e.Int64=xu,e.Number=_a,e.Vector3=bu,e.Quaternion=wu,e.Color3=vu,e.Color4=ku,e.Entity=Ru,e.EnumNumber=Gc,e.EnumString=Yc,e.Array=Vc,e.Map=qc,e.Optional=Jc,e.OneOf=Qc,e.fromJson=Sa,e.mutateNestedValues=Xc})(yn||(yn={}));function wh(){let e=new Map;return{addTo(r,a){if(a<0)return!1;let o=e.get(r);return o!==void 0&&o>=a||e.set(r,a),!0},has(r,a){let o=e.get(r);return o!==void 0&&o>=a},getMap(){return e}}}var Do=65535,S3=4294901760,E3=Do+1,Nu=512,ud=Do,tr;(function(e){function r(o){return[(o&Do)>>>0,((o&S3)>>16&Do)>>>0]}e.fromEntityId=r;function a(o,u){return(o&Do|(u&Do)<<16)>>>0}e.toEntityId=a})(tr||(tr={}));var on;(function(e){e[e.Unknown=0]="Unknown",e[e.UsedEntity=1]="UsedEntity",e[e.Removed=2]="Removed",e[e.Reserved=3]="Reserved"})(on||(on={}));function sd(){let e=Nu,r=new Set,a=[],o=wh();function u(){if(e>ud-1)throw new Error(`It fails trying to generate an entity out of range ${ud}.`);let T=e++,w=o.getMap().has(T)?o.getMap().get(T)+1:0,D=tr.toEntityId(T,w);return r.has(D)?u():(r.add(D),D)}function i(){if(r.size+Nu>=e)return u();for(let[T,w]of o.getMap())if(w<Do){let D=tr.toEntityId(T,w+1);if(!r.has(D)&&!a.includes(D))return r.add(D),D}return u()}function p(T){return T<Nu?!1:(r.has(T)?(r.delete(T),a.push(T)):c(T),!0)}function f(){let T=a;if(T.length){a=[];for(let w of T){let[D,B]=tr.fromEntityId(w);o.addTo(D,B)}}return T}function c(T){let[w,D]=tr.fromEntityId(T);o.addTo(w,D);for(let B=0;B<=D;B++)r.delete(tr.toEntityId(w,B));return!0}function y(T){let[w,D]=tr.fromEntityId(T);if(o.has(w,D))return!1;if(D>0){for(let B=0;B<=D-1;B++)r.delete(tr.toEntityId(w,B));o.addTo(w,D-1)}return r.add(T),!0}function R(T){let[w,D]=tr.fromEntityId(T);if(w<Nu)return on.Reserved;if(r.has(T))return on.UsedEntity;let B=o.getMap().get(w);return B!==void 0&&B>=D?on.Removed:on.Unknown}return{generateEntity:i,removeEntity:p,getExistingEntities(){return new Set(r)},getEntityState:R,releaseRemovedEntities:f,updateRemovedEntity:c,updateUsedEntity:y}}var Ea=be(zs()),Ke=function(e,r,a,o){if(a==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof r=="function"?e!==r||!o:!r.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return a==="m"?o:a==="a"?o.call(e):o?o.value:r.get(e)},Qe,gn,Ht;function T3(e,r){let a=Math.max(e,r)+1024;return Math.ceil(a/1024)*1024}var v3=10240,Ut=class{constructor(r,a,o){Qe.add(this),this._buffer=r||new Uint8Array(v3),this.view=new DataView(this._buffer.buffer,this._buffer.byteOffset),this.woffset=o??(r?this._buffer.length:null)??0,this.roffset=a??0}buffer(){return this._buffer}bufferLength(){return this._buffer.length}resetBuffer(){this.roffset=0,this.woffset=0}currentReadOffset(){return this.roffset}currentWriteOffset(){return this.woffset}incrementReadOffset(r){return Ke(this,Qe,"m",Ht).call(this,r)}remainingBytes(){return this.woffset-this.roffset}readFloat32(){return this.view.getFloat32(Ke(this,Qe,"m",Ht).call(this,4),!0)}readFloat64(){return this.view.getFloat64(Ke(this,Qe,"m",Ht).call(this,8),!0)}readInt8(){return this.view.getInt8(Ke(this,Qe,"m",Ht).call(this,1))}readInt16(){return this.view.getInt16(Ke(this,Qe,"m",Ht).call(this,2),!0)}readInt32(){return this.view.getInt32(Ke(this,Qe,"m",Ht).call(this,4),!0)}readInt64(){return this.view.getBigInt64(Ke(this,Qe,"m",Ht).call(this,8),!0)}readUint8(){return this.view.getUint8(Ke(this,Qe,"m",Ht).call(this,1))}readUint16(){return this.view.getUint16(Ke(this,Qe,"m",Ht).call(this,2),!0)}readUint32(){return this.view.getUint32(Ke(this,Qe,"m",Ht).call(this,4),!0)}readUint64(){return this.view.getBigUint64(Ke(this,Qe,"m",Ht).call(this,8),!0)}readBuffer(){let r=this.view.getUint32(Ke(this,Qe,"m",Ht).call(this,4),!0);return this._buffer.subarray(Ke(this,Qe,"m",Ht).call(this,r),Ke(this,Qe,"m",Ht).call(this,0))}readUtf8String(){let r=this.view.getUint32(Ke(this,Qe,"m",Ht).call(this,4),!0);return Ea.read(this._buffer,Ke(this,Qe,"m",Ht).call(this,r),Ke(this,Qe,"m",Ht).call(this,0))}incrementWriteOffset(r){return Ke(this,Qe,"m",gn).call(this,r)}toBinary(){return this._buffer.subarray(0,this.woffset)}toCopiedBinary(){return new Uint8Array(this.toBinary())}writeBuffer(r,a=!0){a&&this.writeUint32(r.byteLength);let o=Ke(this,Qe,"m",gn).call(this,r.byteLength);this._buffer.set(r,o)}writeUtf8String(r,a=!0){let o=Ea.length(r);a&&this.writeUint32(o);let u=Ke(this,Qe,"m",gn).call(this,o);Ea.write(r,this._buffer,u)}writeFloat32(r){let a=Ke(this,Qe,"m",gn).call(this,4);this.view.setFloat32(a,r,!0)}writeFloat64(r){let a=Ke(this,Qe,"m",gn).call(this,8);this.view.setFloat64(a,r,!0)}writeInt8(r){let a=Ke(this,Qe,"m",gn).call(this,1);this.view.setInt8(a,r)}writeInt16(r){let a=Ke(this,Qe,"m",gn).call(this,2);this.view.setInt16(a,r,!0)}writeInt32(r){let a=Ke(this,Qe,"m",gn).call(this,4);this.view.setInt32(a,r,!0)}writeInt64(r){let a=Ke(this,Qe,"m",gn).call(this,8);this.view.setBigInt64(a,r,!0)}writeUint8(r){let a=Ke(this,Qe,"m",gn).call(this,1);this.view.setUint8(a,r)}writeUint16(r){let a=Ke(this,Qe,"m",gn).call(this,2);this.view.setUint16(a,r,!0)}writeUint32(r){let a=Ke(this,Qe,"m",gn).call(this,4);this.view.setUint32(a,r,!0)}writeUint64(r){let a=Ke(this,Qe,"m",gn).call(this,8);this.view.setBigUint64(a,r,!0)}getFloat32(r){return this.view.getFloat32(r,!0)}getFloat64(r){return this.view.getFloat64(r,!0)}getInt8(r){return this.view.getInt8(r)}getInt16(r){return this.view.getInt16(r,!0)}getInt32(r){return this.view.getInt32(r,!0)}getInt64(r){return this.view.getBigInt64(r,!0)}getUint8(r){return this.view.getUint8(r)}getUint16(r){return this.view.getUint16(r,!0)}getUint32(r){return this.view.getUint32(r,!0)}getUint64(r){return this.view.getBigUint64(r,!0)}setFloat32(r,a){this.view.setFloat32(r,a,!0)}setFloat64(r,a){this.view.setFloat64(r,a,!0)}setInt8(r,a){this.view.setInt8(r,a)}setInt16(r,a){this.view.setInt16(r,a,!0)}setInt32(r,a){this.view.setInt32(r,a,!0)}setInt64(r,a){this.view.setBigInt64(r,a,!0)}setUint8(r,a){this.view.setUint8(r,a)}setUint16(r,a){this.view.setUint16(r,a,!0)}setUint32(r,a){this.view.setUint32(r,a,!0)}setUint64(r,a){this.view.setBigUint64(r,a,!0)}};Qe=new WeakSet,gn=function(r){if(this.woffset+r>this._buffer.byteLength){let a=T3(this._buffer.byteLength,this.woffset+r),o=new Uint8Array(a);o.set(this._buffer);let u=this._buffer.byteOffset;this._buffer=o,this.view=new DataView(this._buffer.buffer,u)}return this.woffset+=r,this.woffset-r},Ht=function(r){if(this.roffset+r>this.woffset)throw new Error("Outside of the bounds of writen data.");return this.roffset+=r,this.roffset-r};var Ne;(function(e){e[e.RESERVED=0]="RESERVED",e[e.PUT_COMPONENT=1]="PUT_COMPONENT",e[e.DELETE_COMPONENT=2]="DELETE_COMPONENT",e[e.DELETE_ENTITY=3]="DELETE_ENTITY",e[e.APPEND_VALUE=4]="APPEND_VALUE",e[e.MAX_MESSAGE_TYPE=5]="MAX_MESSAGE_TYPE"})(Ne||(Ne={}));var kn=8,xn;(function(e){e[e.StateUpdatedTimestamp=1]="StateUpdatedTimestamp",e[e.StateOutdatedTimestamp=2]="StateOutdatedTimestamp",e[e.NoChanges=3]="NoChanges",e[e.StateOutdatedData=4]="StateOutdatedData",e[e.StateUpdatedData=5]="StateUpdatedData",e[e.EntityWasDeleted=6]="EntityWasDeleted",e[e.EntityDeleted=7]="EntityDeleted"})(xn||(xn={}));var Rn;(function(e){function r(i){let p=i.remainingBytes();if(p<kn)return!1;let f=i.getUint32(i.currentReadOffset());return!(p<f)}e.validate=r;function a(i){return r(i)?{length:i.readUint32(),type:i.readUint32()}:null}e.readHeader=a;function o(i){if(!r(i))return null;let p=i.currentReadOffset();return{length:i.getUint32(p),type:i.getUint32(p+4)}}e.getHeader=o;function u(i){let p=o(i);return p?(i.incrementReadOffset(p.length),!0):!1}e.consumeMessage=u})(Rn||(Rn={}));var Vr;(function(e){e.MESSAGE_HEADER_LENGTH=12;function r(o,u,i,p){let f=kn+e.MESSAGE_HEADER_LENGTH,c=p.incrementWriteOffset(f);p.setUint32(c,f),p.setUint32(c+4,Ne.DELETE_COMPONENT),p.setUint32(c+8,o),p.setUint32(c+12,u),p.setUint32(c+16,i)}e.write=r;function a(o){let u=Rn.readHeader(o);if(!u)return null;if(u.type!==Ne.DELETE_COMPONENT)throw new Error("DeleteComponentOperation tried to read another message type.");return{...u,entityId:o.readUint32(),componentId:o.readUint32(),timestamp:o.readUint32()}}e.read=a})(Vr||(Vr={}));var Wo;(function(e){e.MESSAGE_HEADER_LENGTH=16;function r(o,u,i,p,f){let c=f.incrementWriteOffset(kn+e.MESSAGE_HEADER_LENGTH);f.writeBuffer(p,!1);let y=f.currentWriteOffset()-c;f.setUint32(c,y),f.setUint32(c+4,Ne.APPEND_VALUE),f.setUint32(c+8,o),f.setUint32(c+12,i),f.setUint32(c+16,u);let R=y-e.MESSAGE_HEADER_LENGTH-kn;f.setUint32(c+20,R)}e.write=r;function a(o){let u=Rn.readHeader(o);if(!u)return null;if(u.type!==Ne.APPEND_VALUE)throw new Error("AppendValueOperation tried to read another message type.");return{...u,entityId:o.readUint32(),componentId:o.readUint32(),timestamp:o.readUint32(),data:o.readBuffer()}}e.read=a})(Wo||(Wo={}));var Ta;(function(e){e.MESSAGE_HEADER_LENGTH=4;function r(o,u){u.writeUint32(kn+4),u.writeUint32(Ne.DELETE_ENTITY),u.writeUint32(o)}e.write=r;function a(o){let u=Rn.readHeader(o);if(!u)return null;if(u.type!==Ne.DELETE_ENTITY)throw new Error("DeleteEntity tried to read another message type.");return{...u,entityId:o.readUint32()}}e.read=a})(Ta||(Ta={}));var jr;(function(e){e.MESSAGE_HEADER_LENGTH=16;function r(o,u,i,p,f){let c=f.incrementWriteOffset(kn+e.MESSAGE_HEADER_LENGTH);f.writeBuffer(p,!1);let y=f.currentWriteOffset()-c;f.setUint32(c,y),f.setUint32(c+4,Ne.PUT_COMPONENT),f.setUint32(c+8,o),f.setUint32(c+12,i),f.setUint32(c+16,u);let R=y-e.MESSAGE_HEADER_LENGTH-kn;f.setUint32(c+20,R)}e.write=r;function a(o){let u=Rn.readHeader(o);if(!u)return null;if(u.type!==Ne.PUT_COMPONENT)throw new Error("PutComponentOperation tried to read another message type.");return{...u,entityId:o.readUint32(),componentId:o.readUint32(),timestamp:o.readUint32(),data:o.readBuffer()}}e.read=a})(jr||(jr={}));function bh(e,r){let a=[],o=[],u=[],i=[];function p(T){return function(D){let B=new Ut(D),P;for(;P=Rn.getHeader(B);){let Y=B.currentReadOffset();if(P.type===Ne.DELETE_COMPONENT){let W=Vr.read(B);o.push({...W,transportId:T,messageBuffer:B.buffer().subarray(Y,B.currentReadOffset())})}else if(P.type===Ne.PUT_COMPONENT){let W=jr.read(B);o.push({...W,transportId:T,messageBuffer:B.buffer().subarray(Y,B.currentReadOffset())})}else if(P.type===Ne.DELETE_ENTITY){let W=Ta.read(B);o.push({...W,transportId:T,messageBuffer:B.buffer().subarray(Y,B.currentReadOffset())})}else if(P.type===Ne.APPEND_VALUE){let W=Wo.read(B);o.push({...W,transportId:T,messageBuffer:B.buffer().subarray(Y,B.currentReadOffset())})}else B.incrementReadOffset(P.length)}}}function f(T){return T.splice(0,T.length)}async function c(){let T=f(o),w=new Ut,D=[];for(let B of T)if(B.type===Ne.DELETE_ENTITY)D.push(B.entityId);else{let P=e.entityContainer.getEntityState(B.entityId);if(P===on.Removed)continue;P===on.Unknown&&e.entityContainer.updateUsedEntity(B.entityId);let Y=e.getComponentOrNull(B.componentId);if(Y){let[W,Q]=Y.updateFromCrdt(B);if(W){let ce=w.currentWriteOffset();W.type===Ne.PUT_COMPONENT?jr.write(B.entityId,W.timestamp,W.componentId,W.data,w):W.type===Ne.DELETE_COMPONENT&&Vr.write(B.entityId,Y.componentId,W.timestamp,w),i.push({...B,messageBuffer:w.buffer().subarray(ce,w.currentWriteOffset())})}else u.push(B),r&&r(B.entityId,B.type,Y,Q)}else u.push(B)}for(let B of D){for(let P=i.length-1;P>=0;P--)i[P].entityId===B&&i[P].type!==Ne.DELETE_ENTITY&&i.splice(P,1);for(let P of e.componentsIter())P.entityDeleted(B,!1);e.entityContainer.updateRemovedEntity(B),r&&r(B,Ne.DELETE_ENTITY)}}async function y(T){let w=f(u),D=f(i),B=new Ut;for(let Y of e.componentsIter())for(let W of Y.getCrdtUpdates()){let Q=B.currentWriteOffset();if(a.some(ce=>ce.filter(W))&&(W.type===Ne.PUT_COMPONENT?jr.write(W.entityId,W.timestamp,W.componentId,W.data,B):W.type===Ne.DELETE_COMPONENT?Vr.write(W.entityId,Y.componentId,W.timestamp,B):W.type===Ne.APPEND_VALUE&&Wo.write(W.entityId,W.timestamp,W.componentId,W.data,B),w.push({...W,messageBuffer:B.buffer().subarray(Q,B.currentWriteOffset())}),r)){let ce=W.type===Ne.PUT_COMPONENT||W.type===Ne.APPEND_VALUE?Y.get(W.entityId):void 0;r(W.entityId,W.type,Y,ce)}}for(let Y of T){let W=B.currentWriteOffset();Ta.write(Y,B),w.push({type:Ne.DELETE_ENTITY,entityId:Y,messageBuffer:B.buffer().subarray(W,B.currentWriteOffset())}),r&&r(Y,Ne.DELETE_ENTITY)}let P=new Ut;for(let Y in a){let W=Number(Y),Q=a[W];P.resetBuffer();for(let $ of D)$.transportId===W&&!w.find(ye=>ye.entityId===$.entityId&&ye.componentId&&ye.componentId===$.componentId)&&P.writeBuffer($.messageBuffer,!1);for(let $ of w)$.transportId!==W&&Q.filter($)&&P.writeBuffer($.messageBuffer,!1);let ce=P.currentWriteOffset()?P.toBinary():new Uint8Array([]);await Q.send(ce)}}function R(T){let w=a.push(T)-1;T.onmessage=p(w)}return{sendMessages:y,receiveMessages:c,addTransport:R}}var Nh;(function(e){let r;(function(a){a[a.NETWORKED=0]="NETWORKED",a[a.RENDERER=1]="RENDERER"})(r=e.SynchronizedEntityType||(e.SynchronizedEntityType={}))})(Nh||(Nh={}));function cd(e,r){if(e===r)return 0;if(e===null&&r!==null)return-1;if(e!==null&&r===null)return 1;if(e instanceof Uint8Array&&r instanceof Uint8Array){let a=e.byteLength-r.byteLength;if(a!==0)return a>0?1:-1;let o;for(let u=0,i=e.byteLength;u<i;u++)if(o=e[u]-r[u],o!==0)return o>0?1:-1;return 0}if(typeof e=="string"){let a=e.length-r.length;return a!==0?a>0?1:-1:e.localeCompare(r)}return e>r?1:-1}function Kc(e){return Object.freeze({...e})}function k3(e,r){let a=(r.get(e)||0)+1;return r.set(e,a),a}function R3(e,r,a,o){return function(i){for(let[p,f]of r)if(o.has(p)){let c=o.get(p),y=new Ut;a.serialize(c,y),jr.write(p,f,e,y.toBinary(),i)}else Vr.write(p,e,f,i)}}function w3(e,r,a,o){function u(i){let{entityId:p,timestamp:f}=i,c=r.get(p);if(c===void 0||c<f)return xn.StateUpdatedTimestamp;if(c>f)return xn.StateOutdatedTimestamp;if(i.type===Ne.DELETE_COMPONENT&&!o.has(p))return xn.NoChanges;let y=0;if(o.has(p)){let R=new Ut;a.serialize(o.get(p),R),y=cd(R.toBinary(),i.data||null)}else y=cd(null,i.data);return y===0?xn.NoChanges:y>0?xn.StateOutdatedData:xn.StateUpdatedData}return i=>{if(i.type!==Ne.PUT_COMPONENT&&i.type!==Ne.DELETE_COMPONENT)return[null,o.get(i.entityId)];let p=u(i),f=i.entityId;switch(p){case xn.StateUpdatedData:case xn.StateUpdatedTimestamp:{if(r.set(f,i.timestamp),i.type===Ne.PUT_COMPONENT){let c=new Ut(i.data);o.set(f,a.deserialize(c))}else o.delete(f);return[null,o.get(f)]}case xn.StateOutdatedTimestamp:case xn.StateOutdatedData:if(o.has(f)){let c=new Ut;return a.serialize(o.get(f),c),[{type:Ne.PUT_COMPONENT,componentId:e,data:c.toBinary(),entityId:f,timestamp:r.get(f)},o.get(f)]}else return[{type:Ne.DELETE_COMPONENT,componentId:e,entityId:f,timestamp:r.get(f)},void 0]}return[null,o.get(f)]}}function b3(e,r,a,o,u){return function*(){for(let i of a){let p=k3(i,r);if(u.has(i)){let f=new Ut;o.serialize(u.get(i),f),yield{type:Ne.PUT_COMPONENT,componentId:e,entityId:i,data:f.toBinary(),timestamp:p}}else yield{type:Ne.DELETE_COMPONENT,componentId:e,entityId:i,timestamp:p}}a.clear()}}function fd(e,r,a){let o=new Map,u=new Set,i=new Map;return{get componentId(){return r},get componentName(){return e},get componentType(){return 0},schema:a,has(p){return o.has(p)},deleteFrom(p,f=!0){let c=o.get(p);return o.delete(p)&&f&&u.add(p),c||null},entityDeleted(p,f){o.delete(p)&&f&&u.add(p)},getOrNull(p){let f=o.get(p);return f?Kc(f):null},get(p){let f=o.get(p);if(!f)throw new Error(`[getFrom] Component ${e} for entity #${p} not found`);return Kc(f)},create(p,f){if(o.get(p))throw new Error(`[create] Component ${e} for ${p} already exists`);let y=f===void 0?a.create():a.extend?a.extend(f):f;return o.set(p,y),u.add(p),y},createOrReplace(p,f){let c=f===void 0?a.create():a.extend?a.extend(f):f;return o.set(p,c),u.add(p),c},getMutableOrNull(p){let f=o.get(p);return f?(u.add(p),f):null},getOrCreateMutable(p,f){let c=o.get(p);return c?(u.add(p),c):this.create(p,f)},getMutable(p){let f=this.getMutableOrNull(p);if(f===null)throw new Error(`[mutable] Component ${e} for ${p} not found`);return f},*iterator(){for(let[p,f]of o)yield[p,f]},*dirtyIterator(){for(let p of u)yield p},getCrdtUpdates:b3(r,i,u,a,o),updateFromCrdt:w3(r,i,a,o),dumpCrdtStateToBuffer:R3(r,i,a,o)}}function Ah(){let e=[];function r(){e.sort((u,i)=>i.priority-u.priority)}function a(u,i,p){let f=p??u.name;if(e.find(c=>c.fn===u))throw new Error(`System ${JSON.stringify(f)} already added to the engine`);e.push({fn:u,priority:i,name:f}),r()}function o(u){let i=-1;return typeof u=="string"?i=e.findIndex(p=>p.name===u):i=e.findIndex(p=>p.fn===u),i===-1?!1:(e.splice(i,1),r(),!0)}return{add:a,remove:o,getSystems(){return e}}}var ld=zh(new Set);function Ih(){throw new Error("The set is frozen")}function zh(e){return e.add=Ih,e.clear=Ih,e}function N3(e,r){return e.timestamp>r.timestamp?1:-1}function Ph(e,r,a,o){let u=new Map,i=new Set,p=[];function f(T){let w=T.raw.length;return w>1&&T.raw[w-1].timestamp<=T.raw[w-2].timestamp}function c(T){let w=u.get(T);if(w){for(f(w)&&w.raw.sort(N3);w.raw.length>o.maxElements;)w.raw.shift();let D=zh(new Set(w?.raw.map(B=>B.value)));return w.frozenSet=D,D}else return ld}function y(T,w){let D=u.get(T);D||(D={raw:[],frozenSet:ld},u.set(T,D));let B=a.extend?a.extend(w):w,P=o.timestampFunction(B);return id&&Object.freeze(B),D.raw.push({value:B,timestamp:P}),{set:c(T),value:B}}return{get componentId(){return r},get componentName(){return e},get componentType(){return 1},schema:a,has(T){return u.has(T)},entityDeleted(T){u.delete(T)},get(T){let w=u.get(T);return w?w.frozenSet:ld},addValue(T,w){let{set:D,value:B}=y(T,w);i.add(T);let P=new Ut;return a.serialize(B,P),p.push({componentId:r,data:P.toBinary(),entityId:T,timestamp:0,type:Ne.APPEND_VALUE}),D},*iterator(){for(let[T,w]of u)yield[T,w.frozenSet]},*dirtyIterator(){for(let T of i)yield T},getCrdtUpdates(){return i.clear(),p.splice(0,p.length)},updateFromCrdt(T){if(T.type===Ne.APPEND_VALUE){let w=new Ut(T.data);y(T.entityId,a.deserialize(w))}return[null,void 0]},dumpCrdtStateToBuffer:function(T){for(let[w,{raw:D}]of u)for(let B of D){let P=new Ut;a.serialize(B.value,P),Wo.write(w,0,r,P.toBinary(),T)}}}}var Oh=[0,1,2,4,5,6,7,8,9,10,11,12,13],A3=1<<20;function dd(e){let r=ua(e),a={previousFrameMaxTimestamp:0,currentFrameMaxTimestamp:0,buttonState:new Map,thisFrameCommands:[]};function o(P,Y,W){let Q=r.get(W);for(let ce of Array.from(Q).reverse())if(ce.button===Y&&ce.state===P)return ce}function*u(P,Y){let W=r.get(Y);for(let Q of Array.from(W).reverse())Q.button===P&&(yield Q)}function i(){let P=a.currentFrameMaxTimestamp;a.previousFrameMaxTimestamp=P,a.thisFrameCommands.length&&(a.thisFrameCommands=[]);for(let[,Y]of e.getEntitiesWith(r)){let W=Array.from(Y);for(let Q=W.length-1;Q>=0;Q--){let ce=W[Q];if(ce.timestamp>P&&(P=ce.timestamp),ce.timestamp>a.previousFrameMaxTimestamp&&a.thisFrameCommands.push(ce),ce.state===0||ce.state===1){let $=a.buttonState.get(ce.button);if(!$||ce.timestamp>$.timestamp)a.buttonState.set(ce.button,ce);else break}}}a.currentFrameMaxTimestamp=P}e.addSystem(i,A3,"@dcl/ecs#inputSystem");function p(P){return P>a.previousFrameMaxTimestamp&&P<=a.currentFrameMaxTimestamp}function f(P,Y){if(P!==3)return c(P,Y);for(let W of Oh){let Q=c(W,Y);if(Q)return Q}return null}function c(P,Y){let W=null,Q=null;for(let ce of u(P,Y))if(Q){if(!W&&ce.state===1){W=ce;break}}else if(ce.state===0){Q=ce;continue}return!Q||!W?null:W.timestamp<Q.timestamp&&p(Q.timestamp)?{up:Q,down:W}:null}function y(P,Y,W){if(P!==3)return T(P,Y,W);for(let Q of Oh){let ce=T(Q,Y,W);if(ce)return ce}return null}function R(P,Y,W){if(W)return y(P,Y,W);for(let Q of a.thisFrameCommands)if(Q.button===P&&Q.state===Y)return Q;return null}function T(P,Y,W){let Q=o(Y,P,W);return Q&&p(Q.timestamp)?Q:null}function w(P,Y){return f(P,Y)!==null}function D(P,Y,W){if(W){let Q=o(Y,P,W);return Q&&p(Q.timestamp)||!1}else{for(let Q of a.thisFrameCommands)if(Q.button===P&&Q.state===Y)return!0;return!1}}function B(P){return a.buttonState.get(P)?.state===1}return{isPressed:B,getClick:f,getInputCommand:R,isClicked:w,isTriggered:D}}var pd;(function(e){e[e.LastWriteWinElementSet=0]="LastWriteWinElementSet",e[e.GrowOnlyValueSet=1]="GrowOnlyValueSet"})(pd||(pd={}));function z3(){let e=sd(),r=new Map,a=Ah(),o=!1;function u($,ye=1e5,q){a.add($,ye,q)}function i($){return a.remove($)}function p(){return e.generateEntity()}function f($){for(let[,ye]of r)ye.entityDeleted($,!0);return e.removeEntity($)}function c($,ye){if(o)throw new Error("Engine is already sealed. No components can be added at this stage");let q=Sr($);if(r.get(q))throw new Error(`Component number ${q} was already registered.`);if(ye.componentName!==$)throw new Error(`Component name doesn't match componentDefinition.componentName ${$} != ${ye.componentName}`);if(ye.componentId!==q)throw new Error(`Component number doesn't match componentDefinition.componentId ${q} != ${ye.componentId}`);return r.set(q,ye),ye}function y($,ye){if(o)throw new Error("Engine is already sealed. No components can be added at this stage");let q=Sr($),J=r.get(q);if(J)return J;let ae=fd($,q,ye);return r.set(q,ae),ae}function R($,ye,q){if(o)throw new Error("Engine is already sealed. No components can be added at this stage");let J=Sr($),ae=r.get(J);if(ae)return ae;let ge=Ph($,J,ye,q);return r.set(J,ge),ge}function T($,ye,q){if(o)throw new Error("Engine is already sealed. No components can be added at this stage");let J=Sr($),ae=r.get(J);if(ae)return ae;let ge=yn.Map(ye,q),Z=fd($,J,ge),v={...Z,create(z,V){return Z.create(z,V)},createOrReplace(z,V){return Z.createOrReplace(z,V)}};return r.set(J,v),v}function w($){let ye=typeof $=="number"?$:Sr($),q=r.get(ye);if(!q)throw new Error(`Component ${ye} not found. You need to declare the components at the beginnig of the engine declaration`);return q}function D($){let ye=typeof $=="number"?$:Sr($);return r.get(ye)??null}function*B(...$){for(let[ye,...q]of P(...$))yield[ye,...q.map(J=>J.get(ye))]}function*P(...$){let[ye,...q]=$;for(let[J]of ye.iterator()){let ae=!0;for(let ge of q)if(!ge.has(J)){ae=!1;break}ae&&(yield[J,...$])}}function Y(){return a.getSystems()}function W(){return r.values()}function Q($){if(o)throw new Error("Engine is already sealed. No components can be removed at this stage");let ye=typeof $=="number"?$:Sr($);r.delete(ye)}Hr({defineComponentFromSchema:y});function ce(){o||(o=!0)}return{addEntity:p,removeEntity:f,addSystem:u,getSystems:Y,removeSystem:i,defineComponent:T,defineComponentFromSchema:y,defineValueSetComponentFromSchema:R,getEntitiesWith:B,getComponent:w,getComponentOrNull:D,removeComponentDefinition:Q,registerComponentDefinition:c,entityContainer:e,componentsIter:W,seal:ce}}function md(e){let r=z3(),a=bh(r,e?.onChangeFunction||null);async function o(u){await a.receiveMessages();for(let p of r.getSystems()){let f=p.fn(u);yu(f,`A system (${p.name||"anonymous"}) returned a thenable. Systems cannot be async functions. Documentation: https://dcl.gg/sdk/sync-systems`)}let i=r.entityContainer.releaseRemovedEntities();await a.sendMessages(i)}return{addEntity:r.addEntity,removeEntity:r.removeEntity,addSystem:r.addSystem,removeSystem:r.removeSystem,defineComponent:r.defineComponent,defineComponentFromSchema:r.defineComponentFromSchema,defineValueSetComponentFromSchema:r.defineValueSetComponentFromSchema,registerComponentDefinition:r.registerComponentDefinition,getEntitiesWith:r.getEntitiesWith,getComponent:r.getComponent,getComponentOrNull:r.getComponentOrNull,removeComponentDefinition:r.removeComponentDefinition,componentsIter:r.componentsIter,seal:r.seal,update:o,RootEntity:0,PlayerEntity:1,CameraEntity:2,getEntityState:r.entityContainer.getEntityState,addTransport:a.addTransport,entityContainer:r.entityContainer}}function P3(e){let r=Array.from(e);return e.length=0,r}function hd(e){let r=[];async function a(u){try{return await u()}catch(i){console.error(i)}}function o(){for(let u of P3(r))a(u).catch(console.error)}return e.addSystem(o),function(u){r.push(u)}}function yd(e,r){let a=aa(e),o;(function(T){T[T.Click=0]="Click",T[T.Down=1]="Down",T[T.Up=2]="Up"})(o||(o={}));let u=(T={})=>({button:3,...T}),i=new Map;function p(T){return i.get(T)||i.set(T,new Map).get(T)}function f(T,w,D){(D.hoverText||D.showFeedback)&&(a.getMutableOrNull(T)||a.create(T)).pointerEvents.push({eventType:w,eventInfo:{button:D.button,showFeedback:D.showFeedback,hoverText:D.hoverText,maxDistance:D.maxDistance}})}function c(T,w,D){let B=a.getMutableOrNull(T);B&&(B.pointerEvents=B.pointerEvents.filter(P=>!(P.eventInfo?.button===D&&P.eventType===w)))}function y(T){return T===o.Up?0:1}function R(T,w){let D=p(T),B=D.get(w);B?.opts.hoverText&&c(T,y(w),B.opts.button),D.delete(w)}return e.addSystem(function(){for(let[w,D]of i){if(e.getEntityState(w)===on.Removed){i.delete(w);continue}for(let[B,{cb:P,opts:Y}]of D){if(B===o.Click){let W=r.getClick(Y.button,w);W&&yu(P(W.up),"Click event returned a thenable. Only synchronous functions are allowed")}if(B===o.Down||B===o.Up){let W=r.getInputCommand(Y.button,y(B),w);W&&yu(P(W),"Event handler returned a thenable. Only synchronous functions are allowed")}}}}),{removeOnClick(T){R(T,o.Click)},removeOnPointerDown(T){R(T,o.Down)},removeOnPointerUp(T){R(T,o.Up)},onClick(T,w,D){let B=u(D);R(T,o.Click),p(T).set(o.Click,{cb:w,opts:B}),f(T,1,B)},onPointerDown(T,w,D){let B=u(D);R(T,o.Down),p(T).set(o.Down,{cb:w,opts:B}),f(T,1,B)},onPointerUp(T,w,D){let B=u(D);R(T,o.Up),p(T).set(o.Up,{cb:w,opts:B}),f(T,0,B)}}}function gd(e){let r=sa(e),a=ca(e),o=new Map,u={maxDistance:16,queryType:0,continuous:!1,originOffset:{x:0,y:0,z:0},collisionMask:2},i=(T={})=>({...u,...T,directionRawValue:{$case:"localDirection",localDirection:T.direction||{x:0,y:0,z:1}}}),p=(T={})=>({...u,...T,directionRawValue:{$case:"globalDirection",globalDirection:T.direction||{x:0,y:0,z:1}}}),f=(T={})=>({...u,...T,directionRawValue:{$case:"globalTarget",globalTarget:T.target||{x:0,y:0,z:0}}}),c=(T={})=>({...u,...T,directionRawValue:{$case:"targetEntity",targetEntity:T.targetEntity||0}});function y(T,w,D){let B=r.getOrCreateMutable(T);B.maxDistance=D.maxDistance,B.originOffset=D.originOffset,B.collisionMask=D.collisionMask,B.direction=D.directionRawValue,B.continuous=D.continuous,B.queryType=D.queryType,o.set(T,{callback:w})}function R(T){r.deleteFrom(T),a.deleteFrom(T),o.delete(T)}return e.addSystem(function(){for(let[w,D]of o){let B=r.getOrNull(w);if(e.getEntityState(w)===on.Removed||!B){o.delete(w);continue}let P=a.getOrNull(w);P&&(D.callback(P),B.continuous||R(w))}}),{removeRaycasterEntity(T){R(T)},registerLocalDirectionRaycast(T,w,D){y(T,w,i(D))},registerGlobalDirectionRaycast(T,w,D){y(T,w,p(D))},registerGlobalTargetRaycast(T,w,D){y(T,w,f(D))},registerTargetEntityRaycast(T,w,D){y(T,w,c(D))}}}function xd(e){let r=xa(e),a=ga(e),o=new Map;function u(f,c){o.set(f,{callback:c})}function i(f){o.delete(f)}function p(f){return o.has(f)}return e.addSystem(function(){for(let[c,y]of o){let R=r.getOrNull(c);if(e.getEntityState(c)===on.Removed||!R){i(c);continue}let T=a.get(c),w=T.values(),D=T.size,B,P=0;for(let Y of w)P===D-1&&(B=Y),P++;B===void 0||y.lastVideoState!==void 0&&y.lastVideoState===B.state||(y.callback(B),o.set(c,{callback:y.callback,lastVideoState:B.state}))}}),{removeVideoEventsEntity(f){i(f)},registerVideoEventsEntity(f,c){u(f,c)},hasVideoEventsEntity(f){return p(f)}}}var Re=md(),Ch=dd(Re),_d=yd(Re,Ch),O3=gd(Re),C3=xd(Re),U3=hd(Re);function*Uh(e,r){if(r.has(e)){r.delete(e);for(let[a,o]of r)o.parent===e&&(yield*Uh(a,r));yield e}}function Bh(e,r,a){let o=new Map(e.getEntitiesWith(a));return Uh(r,o)}function B3(e,r){let a=Hr(e);for(let o of Bh(e,r,a))e.removeEntity(o)}function Mh(e){let r=Hr(e);return()=>{for(let a of r.dirtyIterator()){let o=r.getOrNull(a);for(;o&&o.parent;)if(o.parent===a){console.error(`There is a cyclic parent with entity ${a}`);break}else o=r.getOrNull(o.parent)}}}var M3=bc(Re),F3=Nc(Re),L3=Ac(Re),D3=Ic(Re),W3=zc(Re),H3=Pc(Re),V3=Oc(Re),j3=Cc(Re),G3=Uc(Re),Y3=Bc(Re),q3=Mc(Re),J3=Fc(Re),Q3=aa(Re),Z3=ua(Re),X3=Lc(Re),K3=sa(Re),$3=ca(Re),eg=Dc(Re),tg=fa(Re),ng=Wc(Re),rg=la(Re),og=da(Re),ig=pa(Re),ag=ma(Re),ug=ha(Re),sg=ya(Re),cg=ga(Re),fg=xa(Re),lg=Hc(Re);var Sd;(function(e){e[e.CT_FIRST_PERSON=0]="CT_FIRST_PERSON",e[e.CT_THIRD_PERSON=1]="CT_THIRD_PERSON",e[e.CT_CINEMATIC=2]="CT_CINEMATIC"})(Sd||(Sd={}));var Ed;(function(e){e[e.IA_POINTER=0]="IA_POINTER",e[e.IA_PRIMARY=1]="IA_PRIMARY",e[e.IA_SECONDARY=2]="IA_SECONDARY",e[e.IA_ANY=3]="IA_ANY",e[e.IA_FORWARD=4]="IA_FORWARD",e[e.IA_BACKWARD=5]="IA_BACKWARD",e[e.IA_RIGHT=6]="IA_RIGHT",e[e.IA_LEFT=7]="IA_LEFT",e[e.IA_JUMP=8]="IA_JUMP",e[e.IA_WALK=9]="IA_WALK",e[e.IA_ACTION_3=10]="IA_ACTION_3",e[e.IA_ACTION_4=11]="IA_ACTION_4",e[e.IA_ACTION_5=12]="IA_ACTION_5",e[e.IA_ACTION_6=13]="IA_ACTION_6"})(Ed||(Ed={}));var Td;(function(e){e[e.PET_UP=0]="PET_UP",e[e.PET_DOWN=1]="PET_DOWN",e[e.PET_HOVER_ENTER=2]="PET_HOVER_ENTER",e[e.PET_HOVER_LEAVE=3]="PET_HOVER_LEAVE"})(Td||(Td={}));var vd;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.LOADING=1]="LOADING",e[e.NOT_FOUND=2]="NOT_FOUND",e[e.FINISHED_WITH_ERROR=3]="FINISHED_WITH_ERROR",e[e.FINISHED=4]="FINISHED"})(vd||(vd={}));var kd;(function(e){e[e.TAM_TOP_LEFT=0]="TAM_TOP_LEFT",e[e.TAM_TOP_CENTER=1]="TAM_TOP_CENTER",e[e.TAM_TOP_RIGHT=2]="TAM_TOP_RIGHT",e[e.TAM_MIDDLE_LEFT=3]="TAM_MIDDLE_LEFT",e[e.TAM_MIDDLE_CENTER=4]="TAM_MIDDLE_CENTER",e[e.TAM_MIDDLE_RIGHT=5]="TAM_MIDDLE_RIGHT",e[e.TAM_BOTTOM_LEFT=6]="TAM_BOTTOM_LEFT",e[e.TAM_BOTTOM_CENTER=7]="TAM_BOTTOM_CENTER",e[e.TAM_BOTTOM_RIGHT=8]="TAM_BOTTOM_RIGHT"})(kd||(kd={}));var Rd;(function(e){e[e.F_SANS_SERIF=0]="F_SANS_SERIF",e[e.F_SERIF=1]="F_SERIF",e[e.F_MONOSPACE=2]="F_MONOSPACE"})(Rd||(Rd={}));function $c(e){let r=e.getComponentOrNull("composite::root");return r||e.defineComponent("composite::root",{src:yn.String,entities:yn.Array(yn.Map({src:yn.Entity,dest:yn.Entity}))})}var dg="/";function pg(e,r=!1){let a="",o=0,u=-1,i=0,p;for(let f=0;f<=e.length;++f){if(f<e.length)p=e.charCodeAt(f);else{if(p===47)break;p=47}if(p===47){if(!(u===f-1||i===1))if(u!==f-1&&i===2){if(a.length<2||o!==2||a.charCodeAt(a.length-1)!==46||a.charCodeAt(a.length-2)!==46){if(a.length>2){let c=a.lastIndexOf("/");if(c!==a.length-1){c===-1?(a="",o=0):(a=a.slice(0,c),o=a.length-1-a.lastIndexOf("/")),u=f,i=0;continue}}else if(a.length===2||a.length===1){a="",o=0,u=f,i=0;continue}}r&&(a.length>0?a+="/..":a="..",o=2)}else a.length>0?a+="/"+e.slice(u+1,f):a=e.slice(u+1,f),o=f-u-1;u=f,i=0}else p===46&&i!==-1?++i:i=-1}return a}function ef(...e){let r="",a=!1,o;for(let u=e.length-1;u>=-1&&!a;u--){let i;u>=0?i=e[u]:(o===void 0&&(o=dg),i=o),i.length!==0&&(r=i+"/"+r,a=i.charCodeAt(0)===47)}return r=pg(r,!a),a?r.length>0?"/"+r:"/":r.length>0?r:"."}function Fh(e){if(e.length===0)return".";let r=e.charCodeAt(0),a=r===47,o=-1,u=!0;for(let i=e.length-1;i>=1;--i)if(r=e.charCodeAt(i),r===47){if(!u){o=i;break}}else u=!1;return o===-1?a?"/":".":a&&o===1?"//":e.slice(0,o)}function tf(e,r){return(e.startsWith(".")?ef(r,e):ef(e)).substring(1)}var yi;(function(e){e[e.EMM_NONE=0]="EMM_NONE",e[e.EMM_NEXT_AVAILABLE=1]="EMM_NEXT_AVAILABLE",e[e.EMM_DIRECT_MAPPING=2]="EMM_DIRECT_MAPPING"})(yi||(yi={}));function Lh(e,r){return r.data?.$case==="json"?r.data.json:e.schema.deserialize(new Ut(r.data?.binary))}function hg(e,r){let a=e.getComponentOrNull(r.name);if(a)return a;if(r.name.startsWith("core::")){if(r.name in hu)return hu[r.name](e);throw new Error(`The core component ${r.name} was not found.`)}else{if(r.jsonSchema)return e.defineComponentFromSchema(r.name,yn.fromJson(r.jsonSchema));throw new Error(`${r.name} is not defined and there is no schema to define it.`)}}function yg(e,r,a,{entityMapping:o}){let u=a.get(r);if(u)return u;if(o?.type===yi.EMM_DIRECT_MAPPING){let p=o.getCompositeEntity(r);return a.set(r,p),p}let i=o?.type===yi.EMM_NEXT_AVAILABLE?o.getNextAvailableEntity():e.addEntity();if(i===null)throw new Error("There is no more entities to allocate");return a.set(r,i),i}function wd(e,r,a,o){let{rootEntity:u,alreadyRequestedSrc:i,entityMapping:p}=o,f=i||new Set,c=Fh(ef(r.src)),y=Sr("core::Transform"),R=$c(e),T=new Map,w=Y=>yg(e,Y,T,o),D=u??w(0);u&&T.set(0,u);let B=r.composite.components.find(Y=>Y.name===R.componentName);if(B)for(let[Y,W]of B.data){let Q=Lh(R,W),ce=tf(Q.src,c),$=a.getCompositeOrNull(ce),ye=w(Y);if($){if(f.has($.src)||$.src===r.src)throw new Error(`Composite ${r.src} has a recursive instanciation while try to instance ${$.src}. Previous instances: ${f.toString()}`);wd(e,$,a,{rootEntity:ye,alreadyRequestedSrc:new Set(f).add($.src),entityMapping:p?.type===yi.EMM_NEXT_AVAILABLE?p:void 0})}}for(let Y of r.composite.components){if(Y.name===R.componentName)continue;let W=hg(e,Y);for(let[Q,ce]of Y.data){let $=Lh(W,ce),ye=w(Q),q=W.create(ye,$);if(W.componentId===y){let J=q;J.parent?J.parent=w(J.parent):J.parent=w(0)}else yn.mutateNestedValues(W.schema.jsonSchema,q,(J,ae)=>ae.serializationType==="entity"?{changed:!0,value:w(J)}:{changed:!1})}}let P=R.getMutableOrNull(D)||R.create(D);for(let[Y,W]of T)P.entities.push({src:Y,dest:W});return P.src=r.src,D}var bn=be(ze());var wn=be(ze());var Dh;(function(e){e[e.NULL_VALUE=0]="NULL_VALUE"})(Dh||(Dh={}));function gg(e){switch(e){case 0:case"NULL_VALUE":return 0;default:throw new jh.Error("Unrecognized enum value "+e+" for enum NullValue")}}function xg(e){switch(e){case 0:return"NULL_VALUE";default:throw new jh.Error("Unrecognized enum value "+e+" for enum NullValue")}}function Wh(){return{fields:new Map}}var va;(function(e){function r(f,c=wn.default.Writer.create()){return f.fields.forEach((y,R)=>{y!==void 0&&nf.encode({key:R,value:y},c.uint32(10).fork()).ldelim()}),c}e.encode=r;function a(f,c){let y=f instanceof wn.default.Reader?f:wn.default.Reader.create(f),R=c===void 0?y.len:y.pos+c,T=Wh();for(;y.pos<R;){let w=y.uint32();switch(w>>>3){case 1:if(w!==10)break;let D=nf.decode(y,y.uint32());D.value!==void 0&&T.fields.set(D.key,D.value);continue}if((w&7)===4||w===0)break;y.skipType(w&7)}return T}e.decode=a;function o(f){return{fields:Sg(f.fields)?Object.entries(f.fields).reduce((c,[y,R])=>(c.set(y,R),c),new Map):new Map}}e.fromJSON=o;function u(f){let c={};return c.fields={},f.fields&&f.fields.forEach((y,R)=>{c.fields[R]=y}),c}e.toJSON=u;function i(f){let c=Wh();return f!==void 0&&Object.keys(f).forEach(y=>{c.fields.set(y,f[y])}),c}e.wrap=i;function p(f){let c={};return[...f.fields.keys()].forEach(y=>{c[y]=f.fields.get(y)}),c}e.unwrap=p})(va||(va={}));function _g(){return{key:"",value:void 0}}var nf;(function(e){function r(i,p=wn.default.Writer.create()){return i.key!==""&&p.uint32(10).string(i.key),i.value!==void 0&&Bt.encode(Bt.wrap(i.value),p.uint32(18).fork()).ldelim(),p}e.encode=r;function a(i,p){let f=i instanceof wn.default.Reader?i:wn.default.Reader.create(i),c=p===void 0?f.len:f.pos+p,y=_g();for(;f.pos<c;){let R=f.uint32();switch(R>>>3){case 1:if(R!==10)break;y.key=f.string();continue;case 2:if(R!==18)break;y.value=Bt.unwrap(Bt.decode(f,f.uint32()));continue}if((R&7)===4||R===0)break;f.skipType(R&7)}return y}e.decode=a;function o(i){return{key:Ho(i.key)?String(i.key):"",value:Ho(i?.value)?i.value:void 0}}e.fromJSON=o;function u(i){let p={};return i.key!==void 0&&(p.key=i.key),i.value!==void 0&&(p.value=i.value),p}e.toJSON=u})(nf||(nf={}));function Hh(){return{kind:void 0}}var Bt;(function(e){function r(f,c=wn.default.Writer.create()){switch(f.kind?.$case){case"nullValue":c.uint32(8).int32(f.kind.nullValue);break;case"numberValue":c.uint32(17).double(f.kind.numberValue);break;case"stringValue":c.uint32(26).string(f.kind.stringValue);break;case"boolValue":c.uint32(32).bool(f.kind.boolValue);break;case"structValue":va.encode(va.wrap(f.kind.structValue),c.uint32(42).fork()).ldelim();break;case"listValue":ka.encode(ka.wrap(f.kind.listValue),c.uint32(50).fork()).ldelim();break}return c}e.encode=r;function a(f,c){let y=f instanceof wn.default.Reader?f:wn.default.Reader.create(f),R=c===void 0?y.len:y.pos+c,T=Hh();for(;y.pos<R;){let w=y.uint32();switch(w>>>3){case 1:if(w!==8)break;T.kind={$case:"nullValue",nullValue:y.int32()};continue;case 2:if(w!==17)break;T.kind={$case:"numberValue",numberValue:y.double()};continue;case 3:if(w!==26)break;T.kind={$case:"stringValue",stringValue:y.string()};continue;case 4:if(w!==32)break;T.kind={$case:"boolValue",boolValue:y.bool()};continue;case 5:if(w!==42)break;T.kind={$case:"structValue",structValue:va.unwrap(va.decode(y,y.uint32()))};continue;case 6:if(w!==50)break;T.kind={$case:"listValue",listValue:ka.unwrap(ka.decode(y,y.uint32()))};continue}if((w&7)===4||w===0)break;y.skipType(w&7)}return T}e.decode=a;function o(f){return{kind:Ho(f.nullValue)?{$case:"nullValue",nullValue:gg(f.nullValue)}:Ho(f.numberValue)?{$case:"numberValue",numberValue:Number(f.numberValue)}:Ho(f.stringValue)?{$case:"stringValue",stringValue:String(f.stringValue)}:Ho(f.boolValue)?{$case:"boolValue",boolValue:!!f.boolValue}:Ho(f.structValue)?{$case:"structValue",structValue:f.structValue}:Ho(f.listValue)?{$case:"listValue",listValue:[...f.listValue]}:void 0}}e.fromJSON=o;function u(f){let c={};return f.kind?.$case==="nullValue"&&(c.nullValue=f.kind?.nullValue!==void 0?xg(f.kind?.nullValue):void 0),f.kind?.$case==="numberValue"&&(c.numberValue=f.kind?.numberValue),f.kind?.$case==="stringValue"&&(c.stringValue=f.kind?.stringValue),f.kind?.$case==="boolValue"&&(c.boolValue=f.kind?.boolValue),f.kind?.$case==="structValue"&&(c.structValue=f.kind?.structValue),f.kind?.$case==="listValue"&&(c.listValue=f.kind?.listValue),c}e.toJSON=u;function i(f){let c=Hh();if(f===null)c.kind={$case:"nullValue",nullValue:0};else if(typeof f=="boolean")c.kind={$case:"boolValue",boolValue:f};else if(typeof f=="number")c.kind={$case:"numberValue",numberValue:f};else if(typeof f=="string")c.kind={$case:"stringValue",stringValue:f};else if(Array.isArray(f))c.kind={$case:"listValue",listValue:f};else if(typeof f=="object")c.kind={$case:"structValue",structValue:f};else if(typeof f<"u")throw new Error("Unsupported any value type: "+typeof f);return c}e.wrap=i;function p(f){return f.kind?.$case==="nullValue"?null:f.kind?.$case==="numberValue"?f.kind?.numberValue:f.kind?.$case==="stringValue"?f.kind?.stringValue:f.kind?.$case==="boolValue"?f.kind?.boolValue:f.kind?.$case==="structValue"?f.kind?.structValue:f.kind?.$case==="listValue"?f.kind?.listValue:void 0}e.unwrap=p})(Bt||(Bt={}));function Vh(){return{values:[]}}var ka;(function(e){function r(f,c=wn.default.Writer.create()){for(let y of f.values)Bt.encode(Bt.wrap(y),c.uint32(10).fork()).ldelim();return c}e.encode=r;function a(f,c){let y=f instanceof wn.default.Reader?f:wn.default.Reader.create(f),R=c===void 0?y.len:y.pos+c,T=Vh();for(;y.pos<R;){let w=y.uint32();switch(w>>>3){case 1:if(w!==10)break;T.values.push(Bt.unwrap(Bt.decode(y,y.uint32())));continue}if((w&7)===4||w===0)break;y.skipType(w&7)}return T}e.decode=a;function o(f){return{values:Array.isArray(f?.values)?[...f.values]:[]}}e.fromJSON=o;function u(f){let c={};return f.values?c.values=f.values.map(y=>y):c.values=[],c}e.toJSON=u;function i(f){let c=Vh();return c.values=f??[],c}e.wrap=i;function p(f){return f?.hasOwnProperty("values")&&Array.isArray(f.values)?f.values:f}e.unwrap=p})(ka||(ka={}));var jh=(()=>{if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof global<"u")return global;throw"Unable to locate global object"})();function Sg(e){return typeof e=="object"&&e!==null}function Ho(e){return e!=null}function Eg(){return{data:void 0}}var Vo;(function(e){function r(i,p=bn.default.Writer.create()){switch(i.data?.$case){case"json":Bt.encode(Bt.wrap(i.data.json),p.uint32(10).fork()).ldelim();break;case"binary":p.uint32(18).bytes(i.data.binary);break}return p}e.encode=r;function a(i,p){let f=i instanceof bn.default.Reader?i:bn.default.Reader.create(i),c=p===void 0?f.len:f.pos+p,y=Eg();for(;f.pos<c;){let R=f.uint32();switch(R>>>3){case 1:if(R!==10)break;y.data={$case:"json",json:Bt.unwrap(Bt.decode(f,f.uint32()))};continue;case 2:if(R!==18)break;y.data={$case:"binary",binary:f.bytes()};continue}if((R&7)===4||R===0)break;f.skipType(R&7)}return y}e.decode=a;function o(i){return{data:xi(i.json)?{$case:"json",json:i.json}:xi(i.binary)?{$case:"binary",binary:Rg(i.binary)}:void 0}}e.fromJSON=o;function u(i){let p={};return i.data?.$case==="json"&&(p.json=i.data?.json),i.data?.$case==="binary"&&(p.binary=i.data?.binary!==void 0?wg(i.data?.binary):void 0),p}e.toJSON=u})(Vo||(Vo={}));function Tg(){return{name:"",jsonSchema:void 0,data:new Map}}var Ra;(function(e){function r(i,p=bn.default.Writer.create()){return i.name!==""&&p.uint32(10).string(i.name),i.jsonSchema!==void 0&&Bt.encode(Bt.wrap(i.jsonSchema),p.uint32(18).fork()).ldelim(),i.data.forEach((f,c)=>{rf.encode({key:c,value:f},p.uint32(26).fork()).ldelim()}),p}e.encode=r;function a(i,p){let f=i instanceof bn.default.Reader?i:bn.default.Reader.create(i),c=p===void 0?f.len:f.pos+p,y=Tg();for(;f.pos<c;){let R=f.uint32();switch(R>>>3){case 1:if(R!==10)break;y.name=f.string();continue;case 2:if(R!==18)break;y.jsonSchema=Bt.unwrap(Bt.decode(f,f.uint32()));continue;case 3:if(R!==26)break;let T=rf.decode(f,f.uint32());T.value!==void 0&&y.data.set(T.key,T.value);continue}if((R&7)===4||R===0)break;f.skipType(R&7)}return y}e.decode=a;function o(i){return{name:xi(i.name)?String(i.name):"",jsonSchema:xi(i?.jsonSchema)?i.jsonSchema:void 0,data:bg(i.data)?Object.entries(i.data).reduce((p,[f,c])=>(p.set(Number(f),Vo.fromJSON(c)),p),new Map):new Map}}e.fromJSON=o;function u(i){let p={};return i.name!==void 0&&(p.name=i.name),i.jsonSchema!==void 0&&(p.jsonSchema=i.jsonSchema),p.data={},i.data&&i.data.forEach((f,c)=>{p.data[c]=Vo.toJSON(f)}),p}e.toJSON=u})(Ra||(Ra={}));function vg(){return{key:0,value:void 0}}var rf;(function(e){function r(i,p=bn.default.Writer.create()){return i.key!==0&&p.uint32(8).int32(i.key),i.value!==void 0&&Vo.encode(i.value,p.uint32(18).fork()).ldelim(),p}e.encode=r;function a(i,p){let f=i instanceof bn.default.Reader?i:bn.default.Reader.create(i),c=p===void 0?f.len:f.pos+p,y=vg();for(;f.pos<c;){let R=f.uint32();switch(R>>>3){case 1:if(R!==8)break;y.key=f.int32();continue;case 2:if(R!==18)break;y.value=Vo.decode(f,f.uint32());continue}if((R&7)===4||R===0)break;f.skipType(R&7)}return y}e.decode=a;function o(i){return{key:xi(i.key)?Number(i.key):0,value:xi(i.value)?Vo.fromJSON(i.value):void 0}}e.fromJSON=o;function u(i){let p={};return i.key!==void 0&&(p.key=Math.round(i.key)),i.value!==void 0&&(p.value=i.value?Vo.toJSON(i.value):void 0),p}e.toJSON=u})(rf||(rf={}));function kg(){return{version:0,components:[]}}var gi;(function(e){function r(i,p=bn.default.Writer.create()){i.version!==0&&p.uint32(8).int32(i.version);for(let f of i.components)Ra.encode(f,p.uint32(18).fork()).ldelim();return p}e.encode=r;function a(i,p){let f=i instanceof bn.default.Reader?i:bn.default.Reader.create(i),c=p===void 0?f.len:f.pos+p,y=kg();for(;f.pos<c;){let R=f.uint32();switch(R>>>3){case 1:if(R!==8)break;y.version=f.int32();continue;case 2:if(R!==18)break;y.components.push(Ra.decode(f,f.uint32()));continue}if((R&7)===4||R===0)break;f.skipType(R&7)}return y}e.decode=a;function o(i){return{version:xi(i.version)?Number(i.version):0,components:Array.isArray(i?.components)?i.components.map(p=>Ra.fromJSON(p)):[]}}e.fromJSON=o;function u(i){let p={};return i.version!==void 0&&(p.version=Math.round(i.version)),i.components?p.components=i.components.map(f=>f?Ra.toJSON(f):void 0):p.components=[],p}e.toJSON=u})(gi||(gi={}));var wa=(()=>{if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof global<"u")return global;throw"Unable to locate global object"})();function Rg(e){if(wa.Buffer)return Uint8Array.from(wa.Buffer.from(e,"base64"));{let r=wa.atob(e),a=new Uint8Array(r.length);for(let o=0;o<r.length;++o)a[o]=r.charCodeAt(o);return a}}function wg(e){if(wa.Buffer)return wa.Buffer.from(e).toString("base64");{let r=[];return e.forEach(a=>{r.push(String.fromCharCode(a))}),wa.btoa(r.join(""))}}function bg(e){return typeof e=="object"&&e!==null}function xi(e){return e!=null}var Gr;(function(e){function r(f){return gi.fromJSON(f)}e.fromJson=r;function a(f){return gi.decode(f)}e.fromBinary=a;function o(f){return gi.toJSON(f)}e.toJson=o;function u(f){return gi.encode(f).finish()}e.toBinary=u;function i(f,c,y,R={}){wd(f,c,y,R)}e.instance=i;function p(f,c="/"){return tf(f,c)}e.resolveAndNormalizePath=p})(Gr||(Gr={}));var Ng=Hr(Re),Ag=ed(Re),Ig=$l(Re),zg=td(Re),Pg=nd(Re);var r1=be(Pd()),_n;(function(e){e.createElement=r1.default.createElement})(_n||(_n={}));var D1=be(_1());var Qg={"sans-serif":0,serif:1,monospace:2};function Tr(e){if(e)return{font:Qg[e]}}var Zg={"top-left":0,"top-center":1,"top-right":2,"middle-left":3,"middle-center":4,"middle-right":5,"bottom-left":6,"bottom-center":7,"bottom-right":8};function vr(e){if(e)return{textAlign:Zg[e]}}var Xg={"nine-slices":0,center:1,stretch:2};function E1(e){return{textureMode:e?Xg[e]:1}}function T1(e){if(e.texture)return{tex:{$case:"texture",texture:S1(e.texture)}};if(e.avatarTexture)return{tex:{$case:"avatarTexture",avatarTexture:S1(e.avatarTexture)}}}function S1(e){return{...e,wrapMode:e.wrapMode?Kg[e.wrapMode]:void 0,filterMode:e.filterMode?$g[e.filterMode]:void 0}}var Kg={repeat:0,clamp:1,mirror:2},$g={point:0,"bi-linear":1,"tri-linear":2};function pf(e){if(!e||!Object.keys(e).length)return;let r=T1(e);return{...e,...E1(e.textureMode),uvs:e.uvs??[],texture:r}}function v1(e){return`${e[0].toUpperCase()}${e.slice(1,e.length)}`}function ex(e){return typeof e=="string"&&e.endsWith("%")}function tx(e){return typeof e=="string"&&e.endsWith("px")}function k1(e){function r(a,o){return Number(o.slice(0,o.indexOf(a)))}return e==null?[void 0,0]:typeof e=="number"||typeof e=="string"&&!isNaN(Number(e))?[Number(e),1]:ex(e)?[r("%",e),2]:tx(e)?[r("px",e),1]:[void 0,0]}function Yr(e={},r){if(typeof e=="object"){let f={};for(let c in e){let y=c,R=`${r}${v1(y)}`,T=`${r}${v1(y)}Unit`,[w,D]=k1(e[y]);w!==void 0&&(f[T]=D,f[R]=w)}return f}if(typeof e=="number")return Yr({top:e,left:e,right:e,bottom:e},r);let a=e.split(" ").filter(f=>f!=="");if(a.length===1){let[f]=a;return Yr({top:f,left:f,right:f,bottom:f},r)}if(a.length===2){let[f,c]=a;return Yr({top:f,left:c,right:c,bottom:f},r)}if(a.length===3){let[f,c,y]=a;return Yr({top:f,left:c,right:c,bottom:y},r)}let[o,u,i,p]=a;return Yr({top:o,right:u,bottom:i,left:p},r)}function Si(e,r){let a=`${r}Unit`,[o,u]=k1(e);return o===void 0?{}:{[r]:o,[a]:u}}function R1(e){return{display:e?nx[e]:0}}var nx={flex:0,none:1};function w1(e){return{justifyContent:e?rx[e]:0}}var rx={center:1,"flex-end":2,"flex-start":0,"space-around":4,"space-between":3,"space-evenly":5};function mf(e,r){let a=ox[r];return{[e]:a}}var ox={auto:0,baseline:5,center:2,"flex-end":3,"flex-start":1,stretch:4,"space-between":6,"space-around":7};function b1(e){return{flexDirection:e?ix[e]:0}}var ix={row:0,column:1,"row-reverse":3,"column-reverse":2};function N1(e){return{flexWrap:ax[e]}}var ax={wrap:1,nowrap:0,"wrap-reverse":2};function A1(e){return{overflow:e?ux[e]:0}}var ux={visible:0,scroll:2,hidden:1};function I1(e){return{positionType:e?sx[e]:0}}var sx={relative:0,absolute:1};var Hd=0,cx={overflow:0,display:0,justifyContent:0,alignSelf:0,flexDirection:0,positionType:0,parent:Hd,rightOf:0,flexBasis:0,width:0,height:0,minWidth:0,minHeight:0,maxWidth:0,maxHeight:0,flexGrow:0,marginBottom:0,marginBottomUnit:0,marginLeft:0,marginLeftUnit:0,marginRight:0,marginRightUnit:0,marginTop:0,marginTopUnit:0,maxHeightUnit:0,maxWidthUnit:0,minHeightUnit:0,minWidthUnit:0,paddingBottom:0,paddingBottomUnit:0,paddingLeft:0,paddingLeftUnit:0,paddingTopUnit:0,paddingRight:0,paddingRightUnit:0,paddingTop:0,positionBottom:0,positionBottomUnit:0,positionLeft:0,positionLeftUnit:0,positionRight:0,positionRightUnit:0,positionTop:0,positionTopUnit:0,flexBasisUnit:0,widthUnit:0,heightUnit:0};function hf(e={}){let{height:r,minHeight:a,maxHeight:o,width:u,minWidth:i,maxWidth:p,alignItems:f,alignContent:c,flexWrap:y,...R}=e;return{...cx,...R,...Yr(e.position,"position"),...Yr(e.margin,"margin"),...Yr(e.padding,"padding"),...Si(e.height,"height"),...Si(e.minHeight,"minHeight"),...Si(e.maxHeight,"maxHeight"),...Si(e.width,"width"),...Si(e.minWidth,"minWidth"),...Si(e.maxWidth,"maxWidth"),...R1(e.display),...mf("alignSelf",e.alignSelf??"auto"),...w1(e.justifyContent),...b1(e.flexDirection),...A1(e.overflow),...I1(e.positionType),...c&&mf("alignContent",c),...f&&mf("alignItems",f),...y&&N1(y)}}function Go(e){let{uiTransform:r,uiBackground:a,...o}=e,u=hf(r),i=a?{uiBackground:pf(a)}:void 0;return{...o,uiTransform:u,...i}}var fx={onMouseDown:void 0,onMouseUp:void 0},lx=Object.keys(fx),Na=e=>lx.includes(e);function dx(e){let{textAlign:r,font:a,...o}=e;return{acceptEmpty:!1,options:[],selectedIndex:e.acceptEmpty?-1:0,disabled:!1,...o,...vr(r),...Tr(a)}}function z1(e){let{uiTransform:r,uiBackground:a,onMouseDown:o,onMouseUp:u,...i}=e,p=dx(i),f=Go({uiTransform:r,uiBackground:a,onMouseDown:o,onMouseUp:u});return _n.createElement("entity",{...f,uiDropdown:p})}function px(e){let{textAlign:r,font:a,...o}=e;return{disabled:!1,placeholder:"",...o,...vr(r),...Tr(a)}}function P1(e){let{uiTransform:r,uiBackground:a,onMouseDown:o,onMouseUp:u,...i}=e,p=px(i),f=Go({uiTransform:r,uiBackground:a,onMouseDown:o,onMouseUp:u});return _n.createElement("entity",{...f,uiInput:p})}function O1(e){let{uiTransform:r,uiBackground:a,onMouseDown:o,onMouseUp:u,...i}=e,p=Go({uiTransform:r,uiBackground:a,onMouseDown:o,onMouseUp:u}),{font:f,textAlign:c,...y}=i,R={...y,...Tr(f),...vr(c)};return _n.createElement("entity",{...p,uiText:R})}function mx(e){return e.variant==="secondary"?{uiBackground:{color:{r:1,g:1,b:1,a:1}},uiText:{color:{r:.98,g:.17,b:.33,a:1}}}:{uiBackground:{color:{r:.98,g:.17,b:.33,a:1}},uiText:{color:{r:1,g:1,b:1,a:1}}}}function C1(e){let{uiTransform:r,uiBackground:a,onMouseDown:o,onMouseUp:u,...i}=e,p=mx(e),f=pf({...p.uiBackground,...a}),{font:c,textAlign:y,...R}=i,T={...p.uiText,...R,...Tr(c),...vr(y)},w=hf({height:36,...r});return e.disabled&&(T.color&&(T.color.a/=2),f&&f.color&&(f.color.a/=2)),_n.createElement("entity",{onMouseDown:e.disabled?void 0:o,onMouseUp:e.disabled?void 0:u,uiTransform:w,uiText:T,uiBackground:f})}function hx(e){let r=e.uiText&&{uiText:{...e.uiText,...Tr(e.uiText.font),...vr(e.uiText.textAlign)}};return _n.createElement("entity",{...Go(e),...r})}function U1(e,r,a){if(r&&!a)return{type:"delete",component:e};if(!a)return;if(!r&&a)return{type:"add",props:a,component:e};if(Na(e)&&!Vd(r,a))return{type:"put",component:e,props:a};let o={};for(let u in r){let i=u;Vd(r[i],a[i])||(o[i]=a[i])}if(Object.keys(o).length)return{type:"put",props:o,component:e}}var yx={uiText:void 0,uiBackground:void 0,uiTransform:void 0,onMouseDown:void 0,onMouseUp:void 0,uiInput:void 0,uiDropdown:void 0},B1=Object.keys(yx);function Vd(e,r){if(!e&&!r)return!0;if(!e||!r)return e===r;if(e===r)return!0;if(typeof e!=typeof r)return!1;if(typeof e!="object")return e===r;if(Array.isArray(e)&&Array.isArray(r)&&e.length!==r.length||Object.keys(e).length!==Object.keys(r).length)return!1;if(JSON.stringify(e)===JSON.stringify(r))return!0;for(let a in e)if(!Vd(e[a],r[a]))return!1;return!0}var M1=e=>!!e,F1={supportsMutation:!0,supportsPersistence:!1,noTimeout:-1,isPrimaryRenderer:!0,supportsHydration:!1,insertInContainerBefore(e,r,a){},detachDeletedInstance(e){},hideInstance(e){},hideTextInstance(e){},unhideInstance(e,r){},unhideTextInstance(e,r){},clearContainer(e){},getCurrentEventPriority(){return 0},getInstanceFromNode(e){return null},beforeActiveInstanceBlur(){},afterActiveInstanceBlur(){},prepareScopeUpdate(){},getInstanceFromScope(){return null},commitMount(e,r,a,o){},resetTextContent(e){},commitTextUpdate(e,r,a){},prepareForCommit(e){return null},resetAfterCommit(e){},preparePortalMount(e){},createTextInstance(e,r,a,o){return{}},scheduleTimeout(e,r){},cancelTimeout(e){},shouldSetTextContent(e,r){return!1},getRootHostContext(e){return null},getChildHostContext(e,r,a){return null},getPublicInstance(e){return e},finalizeInitialChildren(e,r,a,o,u){return!1}};function L1(e){return{onMouseDown:1,onMouseUp:0}[e]}function W1(e,r){let a=new Set,o=new Map,u=new Map,i=ya(e),p=ha(e),f=fa(e),c=pa(e),y=ma(e),R=la(e),T=da(e),w={uiTransform:i.componentId,uiText:p.componentId,uiBackground:f.componentId,uiInput:c.componentId,uiDropdown:R.componentId};function D(Z,v){let z=u.get(Z)?.get(v);z&&z()}function B(Z,v){W(Z,v,"uiTransform")}function P(Z,v){if(v.type==="delete"||!v.props){u.get(Z.entity)?.delete(L1(v.component)),v.component==="onMouseDown"?r.removeOnPointerDown(Z.entity):v.component==="onMouseUp"&&r.removeOnPointerUp(Z.entity);return}if(v.props){let z=L1(v.component),V=u.get(Z.entity)||u.set(Z.entity,new Map).get(Z.entity),X=V.get(z);if(V.set(z,v.props),X)return;(v.component==="onMouseDown"?r.onPointerDown:r.onPointerUp)(Z.entity,()=>D(Z.entity,z),{button:0,showFeedback:!0})}}function Y(Z,v){let z=w[v];e.getComponent(z).deleteFrom(Z.entity)}function W(Z,v={},z){let V=w[z];if("onChange"in v){let xe=v.onChange;ye(Z.entity,V,{fn:xe}),delete v.onChange}if(!Object.keys(v).length)return;let X=e.getComponent(V),ue=X.getMutableOrNull(Z.entity)||X.create(Z.entity);for(let xe in v){let Pe=xe;ue[Pe]=v[Pe]}}function Q(Z){o.delete(Z.entity),e.removeEntity(Z.entity);for(let v of Z._child)Q(v)}function ce(Z,v){if(!v||!Object.keys(Z).length)return;if(Z._child.find(V=>V.entity===v.entity)){let V=Z._child.find(X=>X.rightOf===v.entity);V&&(V.rightOf=v.rightOf,Z._child=Z._child.filter(X=>X.entity!==v.entity),Z._child.push(v),B(V,{rightOf:V.rightOf})),v.rightOf=Z._child[Z._child.length-2]?.entity}else v.rightOf=Z._child[Z._child.length-1]?.entity,Z._child.push(v);v.parent=Z.entity,B(v,{rightOf:v.rightOf,parent:Z.entity})}function $(Z,v){let z=Z._child.findIndex(X=>X.entity===v.entity),V=Z._child[z+1];V&&(V.rightOf=v.rightOf,B(V,{rightOf:v.rightOf})),Z._child.splice(z,1),Q(v)}function ye(Z,v,z){let V=o.get(Z)||o.set(Z,new Map).get(Z),X=V.get(v),ue=z?.fn,xe=z?.value??X?.value;V.set(v,{fn:ue,value:xe})}let q={...F1,createInstance(Z,v){let z=e.addEntity();a.add(z);let V={entity:z,_child:[],parent:Hd,rightOf:void 0};for(let X in v){let ue=X;ue==="children"||ue==="key"||(Na(ue)?P(V,{type:"add",props:v[ue],component:ue}):W(V,v[ue],ue))}return V},appendChild:ce,appendChildToContainer:ce,appendInitialChild:ce,removeChild:$,prepareUpdate(Z,v,z,V){return B1.map(X=>U1(X,z[X],V[X])).filter(M1)},commitUpdate(Z,v,z,V,X,ue){for(let xe of v){if(Na(xe.component)){P(Z,xe);continue}xe.type==="delete"?Y(Z,xe.component):xe.props&&W(Z,xe.props,xe.component)}},insertBefore(Z,v,z){let V=Z._child.findIndex(X=>X.entity===z.entity);Z._child=[...Z._child.slice(0,V),v,...Z._child.slice(V)],v.rightOf=z.rightOf,z.rightOf=v.entity,v.parent=Z.entity,B(v,{rightOf:v.rightOf,parent:v.parent}),B(z,{rightOf:z.rightOf})},removeChildFromContainer(Z,v){Q(v)}},J=(0,D1.default)(q),ae=J.createContainer({},0,null,!1,null,"",function(){},null);function ge(Z,v){for(let[z,V]of e.getEntitiesWith(v)){let X=o.get(z)?.get(Z);X?.fn&&V.value!==X.value&&(X.fn(V.value),ye(z,Z,{fn:X.fn,value:V.value}))}}return{update:function(Z){return o.size&&(ge(c.componentId,y),ge(R.componentId,T)),J.updateContainer(Z,ae,null)},getEntities:()=>Array.from(a)}}function jd(e,r){let a=W1(e,r),o;function u(){o&&a.update(o())}return e.addSystem(u,1e5,"@dcl/react-ecs"),{destroy(){e.removeSystem(u);for(let i of a.getEntities())e.removeEntity(i)},setUiRenderer(i){o=i}}}var gx=jd(Re,_d),H1=_n;var V1=H1;var Ou=class{constructor(r,a=!1,o,u){this.initalize(r,a,o,u)}initalize(r,a=!1,o,u){return this.mask=r,this.skipNextObservers=a,this.target=o,this.currentTarget=u,this}},Cu=class{constructor(r,a,o=null){this.callback=r,this.mask=a,this.scope=o,this.unregisterOnNextCall=!1,this._willBeUnregistered=!1}},Vt=class{constructor(r){this._observers=new Array,this._onObserverAdded=null,this._eventState=new Ou(0),r&&(this._onObserverAdded=r)}add(r,a=-1,o=!1,u=null,i=!1){if(!r)return null;let p=new Cu(r,a,u);return p.unregisterOnNextCall=i,o?this._observers.unshift(p):this._observers.push(p),this._onObserverAdded&&this._onObserverAdded(p),p}addOnce(r){return this.add(r,void 0,void 0,void 0,!0)}remove(r){return r&&this._observers.indexOf(r)!==-1?(this._deferUnregister(r),!0):!1}removeCallback(r,a){for(let o=0;o<this._observers.length;o++)if(this._observers[o].callback===r&&(!a||a===this._observers[o].scope))return this._deferUnregister(this._observers[o]),!0;return!1}notifyObservers(r,a=-1,o,u){if(!this._observers.length)return!0;let i=this._eventState;i.mask=a,i.target=o,i.currentTarget=u,i.skipNextObservers=!1,i.lastReturnValue=r;for(let p of this._observers)if(!p._willBeUnregistered&&(p.mask&a&&(p.scope?i.lastReturnValue=p.callback.apply(p.scope,[r,i]):i.lastReturnValue=p.callback(r,i),p.unregisterOnNextCall&&this._deferUnregister(p)),i.skipNextObservers))return!1;return!0}notifyObserversWithPromise(r,a=-1,o,u){let i=Promise.resolve(r);if(!this._observers.length)return i;let p=this._eventState;return p.mask=a,p.target=o,p.currentTarget=u,p.skipNextObservers=!1,this._observers.forEach(f=>{p.skipNextObservers||f._willBeUnregistered||f.mask&a&&(f.scope?i=i.then(c=>(p.lastReturnValue=c,f.callback.apply(f.scope,[r,p]))):i=i.then(c=>(p.lastReturnValue=c,f.callback(r,p))),f.unregisterOnNextCall&&this._deferUnregister(f))}),i.then(()=>r)}notifyObserver(r,a,o=-1){let u=this._eventState;u.mask=o,u.skipNextObservers=!1,r.callback(a,u)}hasObservers(){return this._observers.length>0}clear(){this._observers=new Array,this._onObserverAdded=null}clone(){let r=new Vt;return r._observers=this._observers.slice(0),r}hasSpecificMask(r=-1){for(let a of this._observers)if(a.mask&r||a.mask===r)return!0;return!1}_deferUnregister(r){r.unregisterOnNextCall=!1,r._willBeUnregistered=!0,Promise.resolve().then.bind(Promise.resolve())(async()=>this._remove(r)).catch(console.error)}_remove(r){if(!r)return!1;let a=this._observers.indexOf(r);return a!==-1?(this._observers.splice(a,1),!0):!1}};var j1=require("~system/EngineApi"),G1=j1.subscribe;function rr(e){return()=>{G1({eventId:e}).catch(console.error)}}var Gd=new Vt(rr("onEnterScene")),xx=Gd,Yd=new Vt(rr("onLeaveScene")),_x=Yd,Y1=new Vt(rr("sceneStart")),q1=new Vt(rr("playerExpression")),J1=new Vt(rr("videoEvent")),Q1=new Vt(rr("profileChanged")),Z1=new Vt(rr("playerConnected")),X1=new Vt(rr("playerDisconnected")),K1=new Vt(rr("onRealmChanged")),$1=new Vt(rr("playerClicked")),Uu=new Vt(rr("comms"));function Sx(e){G1=e}async function qd(e){let{events:r}=await e({actions:[]});for(let a of r)if(a.generic){let o=JSON.parse(a.generic.eventData);switch(a.generic.eventId){case"onEnterScene":{Gd.notifyObservers(o);break}case"onLeaveScene":{Yd.notifyObservers(o);break}case"sceneStart":{Y1.notifyObservers(o);break}case"playerExpression":{q1.notifyObservers(o);break}case"videoEvent":{let u=o;J1.notifyObservers(u);break}case"profileChanged":{Q1.notifyObservers(o);break}case"playerConnected":{Z1.notifyObservers(o);break}case"playerDisconnected":{X1.notifyObservers(o);break}case"onRealmChanged":{K1.notifyObservers(o);break}case"playerClicked":{$1.notifyObservers(o);break}case"comms":{Uu.notifyObservers(o);break}}}}var ey=be(require("~system/CommunicationsController")),Jd=class{constructor(){this.messageQueue=[],this.flushing=!1}on(r,a){return Uu.add(o=>{let u=JSON.parse(o.message);u.message===r&&a(u.payload,o.sender)})}sendRaw(r){this.messageQueue.push(r),this.flush()}emit(r,a){let o=JSON.stringify({message:r,payload:a});this.sendRaw(o),Uu.notifyObservers({message:o,sender:"self"})}flush(){if(this.messageQueue.length===0||this.flushing)return;let r=this.messageQueue.shift();this.flushing=!0,ey.send({message:r}).then(a=>{this.flushing=!1,this.flush()},a=>{this.flushing=!1})}};var ny=require("~system/EthereumController");function ty(e){async function r(a){let o=await e({id:a.id,method:a.method,jsonParams:JSON.stringify(a.params)});return JSON.parse(o.jsonAnyResponse)}return{send(a,o){if(a&&o&&o instanceof Function)r(a).then(u=>o(null,u)).catch(o);else throw new Error("Decentraland provider only allows async calls")},sendAsync(a,o){r(a).then(u=>o(null,u)).catch(o)}}}function Ex(){return ty(ny.sendAsync)}var Aa=require("~system/EngineApi");function ry(e){async function r(o){let u=await e.crdtSendToRenderer({data:new Uint8Array(o)});if(u&&u.data&&u.data.length&&a.onmessage)for(let i of u.data)a.onmessage(i)}let a={async send(o){try{await r(o)}catch(u){console.error(u);debugger}},filter(o){return o.componentId>od?!1:!!o}};return a}var Qd={};var yf=[],Zd={getCompositeOrNull(e,r){let a=Qd[e];if(a){try{if(a instanceof Uint8Array){let o=Gr.fromBinary(a);yf.push({src:e,composite:o})}else if(typeof a=="string"){let o=Gr.fromJson(JSON.parse(a));yf.push({src:e,composite:o})}else if(typeof a=="object"){let o=Gr.fromJson(a);yf.push({src:e,composite:o})}}catch(o){console.error(o)}delete Qd[e]}return yf.find(o=>o.src===e)||null}};var gf=ry({crdtSendToRenderer:Aa.crdtSendToRenderer});Re.addTransport(gf);async function Tx(e){Re.seal(),await Re.update(e),await qd(Aa.sendBatch)}async function vx(){let e=await(0,Aa.crdtGetState)({data:new Uint8Array});if(!e.hasEntities){let r=Zd.getCompositeOrNull("main.composite");if(r)try{Gr.instance(Re,r,Zd)}catch(a){console.log("Warning: main.composite couldn't be instanced."),console.error(a)}}if(gf.onmessage&&e&&e.data&&e.data.length)for(let r of e.data)gf.onmessage(r)}
11
+ `)+t.join(" > ")}return null},a.getPublicRootInstance=function(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return xe(t.child.stateNode);default:return t.child.stateNode}},a.injectIntoDevTools=function(t){if(t={bundleType:t.bundleType,version:t.version,rendererPackageName:t.rendererPackageName,rendererConfig:t.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:f.ReactCurrentDispatcher,findHostInstanceByFiber:Fy,findFiberByHostInstance:t.findFiberByHostInstance||Ly,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")t=!1;else{var n=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(n.isDisabled||!n.supportsFiber)t=!0;else{try{Hu=n.inject(t),sr=n}catch{}t=!!n.checkDCE}}return t},a.isAlreadyRendering=function(){return!1},a.observeVisibleRects=function(t,n,s,l){if(!kr)throw Error(p(363));t=pl(t,n);var d=Ri(t,s,l).disconnect;return{disconnect:function(){d()}}},a.registerMutableSourceForHydration=function(t,n){var s=n._getVersion;s=s(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s)},a.runWithPriority=function(t,n){var s=He;try{return He=t,n()}finally{He=s}},a.shouldError=function(){return null},a.shouldSuspend=function(){return!1},a.updateContainer=function(t,n,s,l){var d=n.current,m=tn(),g=Kr(d);return s=k0(s),n.context===null?n.context=s:n.pendingContext=s,n=Cr(m,g),n.payload={element:t},l=l===void 0?null:l,l!==null&&(n.callback=l),t=Qr(d,n,g),t!==null&&(Mn(t,d,g,m),Zu(t,d,g)),g},a}});var _1=lt((Xw,x1)=>{"use strict";x1.exports=g1()});var kx={};b0(kx,{AMOUNT_VERSION_AVAILABLE:()=>E3,Animator:()=>Ag,AppendValueOperation:()=>Wo,AudioSource:()=>M3,AudioStream:()=>F3,AvatarAnchorPointType:()=>Ms,AvatarAttach:()=>L3,AvatarModifierArea:()=>D3,AvatarModifierType:()=>Ls,AvatarShape:()=>W3,AvatarTexture:()=>pu,BackgroundTextureMode:()=>ac,Billboard:()=>H3,BillboardMode:()=>Hs,BorderRect:()=>Wr,Button:()=>C1,CRDT_MESSAGE_HEADER_LENGTH:()=>kn,CameraMode:()=>V3,CameraModeArea:()=>j3,CameraType:()=>Sd,ColliderLayer:()=>Qs,Color3:()=>Nl,Color4:()=>su,ComponentType:()=>pd,Composite:()=>Gr,CrdtMessageProtocol:()=>Rn,CrdtMessageType:()=>Ne,DEG2RAD:()=>Hi,DeleteComponent:()=>Vr,DeleteEntity:()=>Ta,Dropdown:()=>z1,Engine:()=>md,EngineInfo:()=>G3,EntityContainer:()=>sd,EntityMappingMode:()=>yi,EntityState:()=>on,EntityUtils:()=>tr,Epsilon:()=>bl,Font:()=>Rd,GltfContainer:()=>Y3,GltfContainerLoadingState:()=>q3,Input:()=>P1,InputAction:()=>Ed,Label:()=>O1,LoadingState:()=>vd,MAX_ENTITY_NUMBER:()=>ud,MAX_U16:()=>Do,Material:()=>Ig,MaterialTransparencyMode:()=>Js,Matrix:()=>Ln,MeshCollider:()=>Pg,MeshRenderer:()=>zg,MessageBus:()=>Jd,NftFrameType:()=>Xs,NftShape:()=>J3,Observable:()=>Vt,Observer:()=>Cu,ObserverEventState:()=>Ou,PBAnimationState:()=>Gi,PBAnimator:()=>io,PBAudioSource:()=>ao,PBAudioStream:()=>uo,PBAvatarAttach:()=>so,PBAvatarModifierArea:()=>co,PBAvatarShape:()=>fo,PBBillboard:()=>lo,PBCameraMode:()=>po,PBCameraModeArea:()=>mo,PBEngineInfo:()=>ho,PBGltfContainer:()=>yo,PBGltfContainerLoadingState:()=>go,PBMaterial:()=>xo,PBMaterial_PbrMaterial:()=>Qi,PBMaterial_UnlitMaterial:()=>Ji,PBMeshCollider:()=>_o,PBMeshCollider_BoxMesh:()=>Zi,PBMeshCollider_CylinderMesh:()=>Xi,PBMeshCollider_PlaneMesh:()=>Ki,PBMeshCollider_SphereMesh:()=>$i,PBMeshRenderer:()=>So,PBMeshRenderer_BoxMesh:()=>ea,PBMeshRenderer_CylinderMesh:()=>ta,PBMeshRenderer_PlaneMesh:()=>na,PBMeshRenderer_SphereMesh:()=>ra,PBNftShape:()=>Eo,PBPointerEvents:()=>To,PBPointerEventsResult:()=>vo,PBPointerEvents_Entry:()=>ia,PBPointerEvents_Info:()=>oa,PBPointerLock:()=>ko,PBRaycast:()=>Ro,PBRaycastResult:()=>wo,PBTextShape:()=>bo,PBUiBackground:()=>No,PBUiCanvasInformation:()=>Ao,PBUiDropdown:()=>Io,PBUiDropdownResult:()=>zo,PBUiInput:()=>Po,PBUiInputResult:()=>Oo,PBUiText:()=>Co,PBUiTransform:()=>Uo,PBVideoEvent:()=>Bo,PBVideoPlayer:()=>Mo,PBVisibilityComponent:()=>Fo,Plane:()=>uu,PointerEventType:()=>Td,PointerEvents:()=>Q3,PointerEventsResult:()=>Z3,PointerLock:()=>X3,ProcessMessageResultType:()=>xn,PutComponentOperation:()=>jr,Quaternion:()=>Jt,RAD2DEG:()=>Vi,RESERVED_STATIC_ENTITIES:()=>Nu,Raycast:()=>K3,RaycastHit:()=>Dr,RaycastQueryType:()=>nc,RaycastResult:()=>$3,ReactEcs:()=>V1,ReactEcsRenderer:()=>gx,Rect:()=>ql,Scalar:()=>nt,Schemas:()=>yn,TextAlignMode:()=>kd,TextShape:()=>eg,Texture:()=>du,TextureFilterMode:()=>Yl,TextureUnion:()=>Qt,TextureWrapMode:()=>Gl,ToGammaSpace:()=>Fr,ToLinearSpace:()=>Lr,Transform:()=>Ng,UiBackground:()=>tg,UiCanvasInformation:()=>ng,UiDropdown:()=>rg,UiDropdownResult:()=>og,UiEntity:()=>hx,UiInput:()=>ig,UiInputResult:()=>ag,UiText:()=>ug,UiTransform:()=>sg,Vector3:()=>ie,VideoEvent:()=>cg,VideoPlayer:()=>fg,VideoState:()=>kc,VideoTexture:()=>mu,VisibilityComponent:()=>lg,YGAlign:()=>hc,YGDisplay:()=>Ec,YGEdge:()=>Tc,YGFlexDirection:()=>gc,YGJustify:()=>_c,YGOverflow:()=>Sc,YGPositionType:()=>mc,YGUnit:()=>yc,YGWrap:()=>xc,componentDefinitionByName:()=>hu,components:()=>er,createEthereumProvider:()=>Ex,createInputSystem:()=>dd,createPointerEventsSystem:()=>yd,createRaycastSystem:()=>gd,createReactBasedUiSystem:()=>jd,createTaskSystem:()=>hd,createVideoEventsSystem:()=>xd,cyclicParentingChecker:()=>Mh,deepReadonly:()=>Kc,engine:()=>Re,executeTask:()=>U3,getComponentEntityTree:()=>Bh,getCompositeRootComponent:()=>$c,inputSystem:()=>Ch,isListener:()=>Na,onCommsMessage:()=>Uu,onEnterScene:()=>xx,onEnterSceneObservable:()=>Gd,onLeaveScene:()=>_x,onLeaveSceneObservable:()=>Yd,onPlayerClickedObservable:()=>$1,onPlayerConnectedObservable:()=>Z1,onPlayerDisconnectedObservable:()=>X1,onPlayerExpressionObservable:()=>q1,onProfileChanged:()=>Q1,onRealmChangedObservable:()=>K1,onSceneReadyObservable:()=>Y1,onStart:()=>vx,onUpdate:()=>Tx,onVideoEvent:()=>J1,pointerEventsSystem:()=>_d,pollEvents:()=>qd,raycastSystem:()=>O3,removeEntityWithChildren:()=>B3,rendererTransport:()=>gf,setSubscribeFunction:()=>Sx,videoEventsSystem:()=>C3});module.exports=Yy(kx);var Fr=.45454545454545453,Lr=2.2,bl=1e-6,Hi=Math.PI/180,Vi=360/(Math.PI*2);var nt;(function(e){e.TwoPi=Math.PI*2;function r(q,J,ae=1401298e-51){let ge=q-J;return-ae<=ge&&ge<=ae}e.withinEpsilon=r;function a(q){let J=q.toString(16);return q<=15?("0"+J).toUpperCase():J.toUpperCase()}e.toHex=a;function o(q){let J=+q;return J===0||isNaN(J)?J:J>0?1:-1}e.sign=o;function u(q,J=0,ae=1){return Math.min(ae,Math.max(J,q))}e.clamp=u;function i(q){return Math.log(q)*Math.LOG2E}e.log2=i;function p(q,J){return q-Math.floor(q/J)*J}e.repeat=p;function f(q,J,ae){return(q-J)/(ae-J)}e.normalize=f;function c(q,J,ae){return q*(ae-J)+J}e.denormalize=c;function y(q,J){let ae=p(J-q,360);return ae>180&&(ae-=360),ae}e.deltaAngle=y;function R(q,J){let ae=p(q,J*2);return J-Math.abs(ae-J)}e.pingPong=R;function T(q,J,ae){let ge=u(ae);return ge=-2*ge*ge*ge+3*ge*ge,J*ge+q*(1-ge)}e.smoothStep=T;function w(q,J,ae){let ge=0;return Math.abs(J-q)<=ae?ge=J:ge=q+o(J-q)*ae,ge}e.moveTowards=w;function D(q,J,ae){let ge=y(q,J),Z=0;return-ae<ge&&ge<ae?Z=J:Z=w(q,q+ge,ae),Z}e.moveTowardsAngle=D;function B(q,J,ae){return q+(J-q)*ae}e.lerp=B;function P(q,J,ae){let ge=p(J-q,360);return ge>180&&(ge-=360),q+ge*u(ae)}e.lerpAngle=P;function Y(q,J,ae){let ge=0;return q!==J?ge=u((ae-q)/(J-q)):ge=0,ge}e.inverseLerp=Y;function W(q,J,ae,ge,Z){let v=Z*Z,z=Z*v,V=2*z-3*v+1,X=-2*z+3*v,ue=z-2*v+Z,xe=z-v;return q*V+ae*X+J*ue+ge*xe}e.hermite=W;function Q(q,J){return q===J?q:Math.random()*(J-q)+q}e.randomRange=Q;function ce(q,J,ae){return(q-J)/(ae-J)}e.rangeToPercent=ce;function $(q,J,ae){return(ae-J)*q+J}e.percentToRange=$;function ye(q){return q-e.TwoPi*Math.floor((q+Math.PI)/e.TwoPi)}e.normalizeRadians=ye})(nt||(nt={}));var ie;(function(e){function r(_){let k=Math.abs(_.x),C=Math.abs(_.y);if(k!==C)return!0;let oe=Math.abs(_.z);return k!==oe}e.isNonUniform=r;function a(_=0,k=0,C=0){return{x:_,y:k,z:C}}e.create=a;function o(_,k){return{x:_.x+k.x,y:_.y+k.y,z:_.z+k.z}}e.add=o;function u(_,k,C){C.x=_.x+k.x,C.y=_.y+k.y,C.z=_.z+k.z}e.addToRef=u;function i(_,k){return{x:_.x-k.x,y:_.y-k.y,z:_.z-k.z}}e.subtract=i;function p(_,k,C){C.x=_.x-k.x,C.y=_.y-k.y,C.z=_.z-k.z}e.subtractToRef=p;function f(_,k,C,oe,te){te.x=_.x-k,te.y=_.y-C,te.z=_.z-oe}e.subtractFromFloatsToRef=f;function c(_){return{x:-_.x,y:-_.y,z:-_.z}}e.negate=c;function y(_,k){k.x=_.x,k.y=_.y,k.z=_.z}e.copyFrom=y;function R(_,k,C,oe){oe.x=_,oe.y=k,oe.z=C}e.copyFromFloats=R;function T(_){return a(_.x,_.y,_.z)}e.clone=T;function w(_,k,C,oe){let te=Z(_,C)-oe,de=Z(k,C)-oe;return te/(te-de)}e.getClipFactor=w;function D(_,k,C){let oe=ae(_),te=ae(k),de=Z(oe,te),ve=a();return Fe(oe,te,ve),Z(ve,C)>0?Math.acos(de):-Math.acos(de)}e.getAngleBetweenVectors=D;function B(_,k=0){return a(_[k],_[k+1],_[k+2])}e.fromArray=B;function P(_,k){return B(_,k)}e.fromFloatArray=P;function Y(_,k,C){C.x=_[k],C.y=_[k+1],C.z=_[k+2]}e.fromArrayToRef=Y;function W(_,k,C){return Y(_,k,C)}e.fromFloatArrayToRef=W;function Q(_){return Math.sqrt(_.x*_.x+_.y*_.y+_.z*_.z)}e.length=Q;function ce(_){return _.x*_.x+_.y*_.y+_.z*_.z}e.lengthSquared=ce;function $(_,k,C){C.x=_.x*k,C.y=_.y*k,C.z=_.z*k}e.scaleToRef=$;function ye(_,k){return a(_.x*k,_.y*k,_.z*k)}e.scale=ye;function q(_,k){let C=a(0,0,0);return J(_,k,C),C}e.normalizeFromLength=q;function J(_,k,C){if(k===0||k===1){y(_,C);return}$(_,1/k,C)}e.normalizeFromLengthToRef=J;function ae(_){return q(_,Q(_))}e.normalize=ae;function ge(_,k){J(_,Q(_),k)}e.normalizeToRef=ge;function Z(_,k){return _.x*k.x+_.y*k.y+_.z*k.z}e.dot=Z;function v(_,k){let C=T(_);return z(_,k,C),C}e.applyMatrix4=v;function z(_,k,C){let{x:oe,y:te,z:de}=_,ve=k._m,dt=1/(ve[3]*oe+ve[7]*te+ve[11]*de+ve[15]);C.x=(ve[0]*oe+ve[4]*te+ve[8]*de+ve[12])*dt,C.y=(ve[1]*oe+ve[5]*te+ve[9]*de+ve[13])*dt,C.z=(ve[2]*oe+ve[6]*te+ve[10]*de+ve[14])*dt}e.applyMatrix4ToRef=z;function V(_,k){let C=a();return X(_,k,C),C}e.rotate=V;function X(_,k,C){let{x:oe,y:te,z:de}=_,{x:ve,y:dt,z:It,w:pt}=k,Gn=pt*oe+dt*de-It*te,br=pt*te+It*oe-ve*de,or=pt*de+ve*te-dt*oe,ir=-ve*oe-dt*te-It*de;C.x=Gn*pt+ir*-ve+br*-It-or*-dt,C.y=br*pt+ir*-dt+or*-ve-Gn*-It,C.z=or*pt+ir*-It+Gn*-dt-br*-ve}e.rotateToRef=X;function ue(_,k,C){let oe=a(0,0,0);return xe(_,k,C,oe),oe}e.lerp=ue;function xe(_,k,C,oe){oe.x=_.x+(k.x-_.x)*C,oe.y=_.y+(k.y-_.y)*C,oe.z=_.z+(k.z-_.z)*C}e.lerpToRef=xe;function Pe(_,k){let C=wr();return Fe(_,k,C),C}e.cross=Pe;function Fe(_,k,C){C.x=_.y*k.z-_.z*k.y,C.y=_.z*k.x-_.x*k.z,C.z=_.x*k.y-_.y*k.x}e.crossToRef=Fe;function We(_,k){let C=wr();return Le(_,k,C),C}e.transformCoordinates=We;function Le(_,k,C){return Ze(_.x,_.y,_.z,k,C)}e.transformCoordinatesToRef=Le;function Ze(_,k,C,oe,te){let de=oe._m,ve=_*de[0]+k*de[4]+C*de[8]+de[12],dt=_*de[1]+k*de[5]+C*de[9]+de[13],It=_*de[2]+k*de[6]+C*de[10]+de[14],pt=1/(_*de[3]+k*de[7]+C*de[11]+de[15]);te.x=ve*pt,te.y=dt*pt,te.z=It*pt}e.transformCoordinatesFromFloatsToRef=Ze;function Ve(_,k){let C=wr();return rt(_,k,C),C}e.transformNormal=Ve;function rt(_,k,C){Ce(_.x,_.y,_.z,k,C)}e.transformNormalToRef=rt;function Ce(_,k,C,oe,te){let de=oe._m;te.x=_*de[0]+k*de[4]+C*de[8],te.y=_*de[1]+k*de[5]+C*de[9],te.z=_*de[2]+k*de[6]+C*de[10]}e.transformNormalFromFloatsToRef=Ce;function jt(_,k,C,oe,te){let de=te*te,ve=te*de,dt=.5*(2*k.x+(-_.x+C.x)*te+(2*_.x-5*k.x+4*C.x-oe.x)*de+(-_.x+3*k.x-3*C.x+oe.x)*ve),It=.5*(2*k.y+(-_.y+C.y)*te+(2*_.y-5*k.y+4*C.y-oe.y)*de+(-_.y+3*k.y-3*C.y+oe.y)*ve),pt=.5*(2*k.z+(-_.z+C.z)*te+(2*_.z-5*k.z+4*C.z-oe.z)*de+(-_.z+3*k.z-3*C.z+oe.z)*ve);return a(dt,It,pt)}e.catmullRom=jt;function O(_,k,C){let oe=a();return j(_,k,C,oe),oe}e.clamp=O;function j(_,k,C,oe){let te=_.x;te=te>C.x?C.x:te,te=te<k.x?k.x:te;let de=_.y;de=de>C.y?C.y:de,de=de<k.y?k.y:de;let ve=_.z;ve=ve>C.z?C.z:ve,ve=ve<k.z?k.z:ve,R(te,de,ve,oe)}e.clampToRef=j;function re(_,k,C,oe,te){let de=te*te,ve=te*de,dt=2*ve-3*de+1,It=-2*ve+3*de,pt=ve-2*de+te,Gn=ve-de,br=_.x*dt+C.x*It+k.x*pt+oe.x*Gn,or=_.y*dt+C.y*It+k.y*pt+oe.y*Gn,ir=_.z*dt+C.z*It+k.z*pt+oe.z*Gn;return a(br,or,ir)}e.hermite=re;function A(_,k){let C=a();return wi(k,_.x,_.y,_.z,C),C}e.minimize=A;function F(_,k){let C=a();return Ri(_,k.x,k.y,k.z,C),C}e.maximize=F;function le(_,k){return Math.sqrt(Ye(_,k))}e.distance=le;function Ye(_,k){let C=_.x-k.x,oe=_.y-k.y,te=_.z-k.z;return C*C+oe*oe+te*te}e.distanceSquared=Ye;function Zt(_,k){let C=o(_,k);return $(C,.5,C),C}e.center=Zt;function Ia(_,k,C){let oe=wr();return Ei(_,k,C,oe),oe}e.rotationFromAxis=Ia;function Ei(_,k,C,oe){let te=Jt.create();Jt.fromAxisToRotationQuaternionToRef(_,k,C,te),y(Jt.toEulerAngles(te),oe)}e.rotationFromAxisToRef=Ei;function za(_){return`(${_.x}, ${_.y}, ${_.z})`}e.toString=za;function Yo(_){let k=_.x||0;return k=k*397^(_.y||0),k=k*397^(_.z||0),k}e.getHashCode=Yo;function Pa(_,k){return _.x===k.x&&_.y===k.y&&_.z===k.z}e.equals=Pa;function Ti(_,k,C=bl){return nt.withinEpsilon(_.x,k.x,C)&&nt.withinEpsilon(_.y,k.y,C)&&nt.withinEpsilon(_.z,k.z,C)}e.equalsWithEpsilon=Ti;function kr(_,k,C,oe){return _.x===k&&_.y===C&&_.z===oe}e.equalsToFloats=kr;function qo(_,k){let C=a();return st(_,k,C),C}e.multiply=qo;function st(_,k,C){C.x=_.x*k.x,C.y=_.y*k.y,C.z=_.z*k.z}e.multiplyToRef=st;function vi(_,k,C,oe,te){te.x=_.x*k,te.y=_.y*C,te.z=_.z*oe}e.multiplyByFloatsToRef=vi;function Rr(_,k,C,oe){let te=a();return vi(_,k,C,oe,te),te}e.multiplyByFloats=Rr;function ki(_,k){return{x:_.x/k.x,y:_.y/k.y,z:_.z/k.z}}e.divide=ki;function Oa(_,k,C){C.x=_.x/k.x,C.y=_.y/k.y,C.z=_.z/k.z}e.divideToRef=Oa;function Ri(_,k,C,oe,te){k>_.x?te.x=k:te.x=_.x,C>_.y?te.y=C:te.y=_.y,oe>_.z?te.z=oe:te.z=_.z}e.maximizeInPlaceFromFloatsToRef=Ri;function wi(_,k,C,oe,te){k<_.x?te.x=k:te.x=_.x,C<_.y?te.y=C:te.y=_.y,oe<_.z?te.z=oe:te.z=_.z}e.minimizeInPlaceFromFloatsToRef=wi;function Ca(_){return a(Math.floor(_.x),Math.floor(_.y),Math.floor(_.z))}e.floor=Ca;function bi(_){return a(_.x-Math.floor(_.x),_.y-Math.floor(_.y),_.z-Math.floor(_.z))}e.fract=bi;function wr(){return a(0,0,0)}e.Zero=wr;function Ua(){return a(1,1,1)}e.One=Ua;function Jo(){return a(0,1,0)}e.Up=Jo;function Ba(){return a(0,-1,0)}e.Down=Ba;function Ma(){return a(0,0,1)}e.Forward=Ma;function Ni(){return a(0,0,-1)}e.Backward=Ni;function Qo(){return a(1,0,0)}e.Right=Qo;function Fa(){return a(-1,0,0)}e.Left=Fa;function La(){return a(Math.random(),Math.random(),Math.random())}e.Random=La})(ie||(ie={}));var uu;(function(e){function r(P,Y,W,Q){return{normal:ie.create(P,Y,W),d:Q}}e.create=r;function a(P){return r(P[0],P[1],P[2],P[3])}e.fromArray=a;function o(P,Y,W){return r(0,0,0,0)}e.fromPoints=o;function u(P,Y){let W=r(0,0,0,0);return W.normal=ie.normalize(Y),W.d=-(Y.x*P.x+Y.y*P.y+Y.z*P.z),W}e.romPositionAndNormal=u;function i(P,Y,W){let Q=-(Y.x*P.x+Y.y*P.y+Y.z*P.z);return ie.dot(W,Y)+Q}e.signedDistanceToPlaneFromPositionAndNormal=i;function p(P){return[P.normal.x,P.normal.y,P.normal.z,P.d]}e.asArray=p;function f(P){return r(P.normal.x,P.normal.y,P.normal.z,P.d)}e.clone=f;function c(P){return 0}e.getHashCode=c;function y(P){let Y=r(0,0,0,0),W=Math.sqrt(P.normal.x*P.normal.x+P.normal.y*P.normal.y+P.normal.z*P.normal.z),Q=0;return W!==0&&(Q=1/W),Y.normal.x=P.normal.x*Q,Y.normal.y=P.normal.y*Q,Y.normal.z=P.normal.z*Q,Y.d*=Q,P}e.normalize=y;function R(P,Y){let W=Ln.create();Ln.transposeToRef(Y,W);let Q=W._m,ce=P.normal.x,$=P.normal.y,ye=P.normal.z,q=P.d,J=ce*Q[0]+$*Q[1]+ye*Q[2]+q*Q[3],ae=ce*Q[4]+$*Q[5]+ye*Q[6]+q*Q[7],ge=ce*Q[8]+$*Q[9]+ye*Q[10]+q*Q[11],Z=ce*Q[12]+$*Q[13]+ye*Q[14]+q*Q[15];return r(J,ae,ge,Z)}e.transform=R;function T(P,Y){return P.normal.x*Y.x+P.normal.y*Y.y+P.normal.z*Y.z+P.d}e.dotCoordinate=T;function w(P,Y,W){let Q=Y.x-P.x,ce=Y.y-P.y,$=Y.z-P.z,ye=W.x-P.x,q=W.y-P.y,J=W.z-P.z,ae=ce*J-$*q,ge=$*ye-Q*J,Z=Q*q-ce*ye,v=Math.sqrt(ae*ae+ge*ge+Z*Z),z;v!==0?z=1/v:z=0;let V=ie.create(ae*z,ge*z,Z*z);return{normal:V,d:-(V.x*P.x+V.y*P.y+V.z*P.z)}}e.copyFromPoints=w;function D(P,Y,W){return ie.dot(P.normal,Y)<=W}e.isFrontFacingTo=D;function B(P,Y){return ie.dot(Y,P.normal)+P.d}e.signedDistanceTo=B})(uu||(uu={}));var Ln;(function(e){function r(h){return h._m}e.m=r;let a=0,o={};function u(){return o}e.IdentityReadonly=u;function i(){let h={updateFlag:0,isIdentity:!1,isIdentity3x2:!0,_isIdentityDirty:!0,_isIdentity3x2Dirty:!0,_m:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]};return zt(h,!1),h}e.create=i;function p(h,x=0){let S=i();return f(h,x,S),S}e.fromArray=p;function f(h,x,S){for(let E=0;E<16;E++)S._m[E]=h[E+x];st(S)}e.fromArrayToRef=f;function c(h,x,S,E){for(let N=0;N<16;N++)E._m[N]=h[N+x]*S;st(E)}e.fromFloatArrayToRefScaled=c;function y(h,x,S,E,N,G,H,ee,me,Te,we,je,ke,et,ct,St,mt){let Se=mt._m;Se[0]=h,Se[1]=x,Se[2]=S,Se[3]=E,Se[4]=N,Se[5]=G,Se[6]=H,Se[7]=ee,Se[8]=me,Se[9]=Te,Se[10]=we,Se[11]=je,Se[12]=ke,Se[13]=et,Se[14]=ct,Se[15]=St,st(mt)}e.fromValuesToRef=y;function R(h,x,S,E,N,G,H,ee,me,Te,we,je,ke,et,ct,St){let mt=i(),Se=mt._m;return Se[0]=h,Se[1]=x,Se[2]=S,Se[3]=E,Se[4]=N,Se[5]=G,Se[6]=H,Se[7]=ee,Se[8]=me,Se[9]=Te,Se[10]=we,Se[11]=je,Se[12]=ke,Se[13]=et,Se[14]=ct,Se[15]=St,st(mt),mt}e.fromValues=R;function T(h,x,S){let E=i();return w(h,x,S,E),E}e.compose=T;function w(h,x,S,E){let N=[i(),i(),i()];v(h.x,h.y,h.z,N[1]),qo(x,N[0]),te(N[1],N[0],E),Qo(E,S)}e.composeToRef=w;function D(){let h=R(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return zt(h,!0),h}e.Identity=D;function B(h){y(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,h),zt(h,!0)}e.IdentityToRef=B;function P(){let h=R(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);return zt(h,!1),h}e.Zero=P;function Y(h){let x=i();return W(h,x),x}e.RotationX=Y;function W(h,x){let S=Math.sin(h),E=Math.cos(h);y(1,0,0,0,0,E,S,0,0,-S,E,0,0,0,0,1,x),zt(x,E===1&&S===0)}e.rotationXToRef=W;function Q(h){let x=i();return ce(h,x),x}e.rotationY=Q;function ce(h,x){let S=Math.sin(h),E=Math.cos(h);y(E,0,-S,0,0,1,0,0,S,0,E,0,0,0,0,1,x),zt(x,E===1&&S===0)}e.rotationYToRef=ce;function $(h){let x=i();return ye(h,x),x}e.rotationZ=$;function ye(h,x){let S=Math.sin(h),E=Math.cos(h);y(E,S,0,0,-S,E,0,0,0,0,1,0,0,0,0,1,x),zt(x,E===1&&S===0)}e.rotationZToRef=ye;function q(h,x){let S=i();return J(h,x,S),S}e.rotationAxis=q;function J(h,x,S){let E=Math.sin(-x),N=Math.cos(-x),G=1-N,H=ie.normalize(h),ee=S._m;ee[0]=H.x*H.x*G+N,ee[1]=H.x*H.y*G-H.z*E,ee[2]=H.x*H.z*G+H.y*E,ee[3]=0,ee[4]=H.y*H.x*G+H.z*E,ee[5]=H.y*H.y*G+N,ee[6]=H.y*H.z*G-H.x*E,ee[7]=0,ee[8]=H.z*H.x*G-H.y*E,ee[9]=H.z*H.y*G+H.x*E,ee[10]=H.z*H.z*G+N,ee[11]=0,ee[12]=0,ee[13]=0,ee[14]=0,ee[15]=1,st(S)}e.rotationAxisToRef=J;function ae(h,x,S){let E=i();return ge(h,x,S,E),E}e.rotationYawPitchRoll=ae;function ge(h,x,S,E){let N=Jt.Zero();Jt.fromRotationYawPitchRollToRef(h,x,S,N),qo(N,E)}e.rotationYawPitchRollToRef=ge;function Z(h,x,S){let E=i();return v(h,x,S,E),E}e.scaling=Z;function v(h,x,S,E){y(h,0,0,0,0,x,0,0,0,0,S,0,0,0,0,1,E),zt(E,h===1&&x===1&&S===1)}e.scalingToRef=v;function z(h,x,S){let E=i();return V(h,x,S,E),E}e.translation=z;function V(h,x,S,E){y(1,0,0,0,0,1,0,0,0,0,1,0,h,x,S,1,E),zt(E,h===0&&x===0&&S===0)}e.translationToRef=V;function X(h,x,S){let E=i();return ue(h,x,S,E),E}e.lerp=X;function ue(h,x,S,E){for(let N=0;N<16;N++)E._m[N]=h._m[N]*(1-S)+x._m[N]*S;st(E)}e.lerpToRef=ue;function xe(h,x,S){let E=i();return Pe(h,x,S,E),E}e.decomposeLerp=xe;function Pe(h,x,S,E){let N=ie.Zero(),G=Jt.Zero(),H=ie.Zero();pt(h,N,G,H);let ee=ie.Zero(),me=Jt.Zero(),Te=ie.Zero();pt(x,ee,me,Te);let we=ie.Zero();ie.lerpToRef(N,ee,S,we);let je=Jt.Zero();Jt.slerpToRef(G,me,S,je);let ke=ie.Zero();ie.lerpToRef(H,Te,S,ke),w(we,je,ke,E)}e.decomposeLerpToRef=Pe;function Fe(h,x,S){let E=i();return We(h,x,S,E),E}e.LookAtLH=Fe;function We(h,x,S,E){let N=ie.Zero(),G=ie.Zero(),H=ie.Zero();ie.subtractToRef(x,h,H),ie.normalizeToRef(H,H),ie.crossToRef(S,H,N);let ee=ie.lengthSquared(N);ee===0?N.x=1:ie.normalizeFromLengthToRef(N,Math.sqrt(ee),N),ie.crossToRef(H,N,G),ie.normalizeToRef(G,G);let me=-ie.dot(N,h),Te=-ie.dot(G,h),we=-ie.dot(H,h);y(N.x,G.x,H.x,0,N.y,G.y,H.y,0,N.z,G.z,H.z,0,me,Te,we,1,E)}e.lookAtLHToRef=We;function Le(h,x,S){let E=i();return Ze(h,x,S,E),E}e.lookAtRH=Le;function Ze(h,x,S,E){let N=ie.Zero(),G=ie.Zero(),H=ie.Zero();ie.subtractToRef(h,x,H),ie.normalizeToRef(H,H),ie.crossToRef(S,H,N);let ee=ie.lengthSquared(N);ee===0?N.x=1:ie.normalizeFromLengthToRef(N,Math.sqrt(ee),N),ie.crossToRef(H,N,G),ie.normalizeToRef(G,G);let me=-ie.dot(N,h),Te=-ie.dot(G,h),we=-ie.dot(H,h);y(N.x,G.x,H.x,0,N.y,G.y,H.y,0,N.z,G.z,H.z,0,me,Te,we,1,E)}e.lookAtRHToRef=Ze;function Ve(h,x,S,E){let N=i();return rt(h,x,S,E,N),N}e.orthoLH=Ve;function rt(h,x,S,E,N){let G=S,H=E,ee=2/h,me=2/x,Te=2/(H-G),we=-(H+G)/(H-G);y(ee,0,0,0,0,me,0,0,0,0,Te,0,0,0,we,1,N),zt(N,ee===1&&me===1&&Te===1&&we===0)}e.orthoLHToRef=rt;function Ce(h,x,S,E,N,G){let H=i();return jt(h,x,S,E,N,G,H),H}e.OrthoOffCenterLH=Ce;function jt(h,x,S,E,N,G,H){let ee=N,me=G,Te=2/(x-h),we=2/(E-S),je=2/(me-ee),ke=-(me+ee)/(me-ee),et=(h+x)/(h-x),ct=(E+S)/(S-E);y(Te,0,0,0,0,we,0,0,0,0,je,0,et,ct,ke,1,H),st(H)}e.orthoOffCenterLHToRef=jt;function O(h,x,S,E,N,G){let H=i();return j(h,x,S,E,N,G,H),H}e.orthoOffCenterRH=O;function j(h,x,S,E,N,G,H){jt(h,x,S,E,N,G,H),H._m[10]*=-1}e.orthoOffCenterRHToRef=j;function re(h,x,S,E){let N=i(),G=S,H=E,ee=2*G/h,me=2*G/x,Te=(H+G)/(H-G),we=-2*H*G/(H-G);return y(ee,0,0,0,0,me,0,0,0,0,Te,1,0,0,we,0,N),zt(N,!1),N}e.perspectiveLH=re;function A(h,x,S,E){let N=i();return F(h,x,S,E,N),N}e.perspectiveFovLH=A;function F(h,x,S,E,N,G=!0){let H=S,ee=E,me=1/Math.tan(h*.5),Te=G?me/x:me,we=G?me:me*x,je=(ee+H)/(ee-H),ke=-2*ee*H/(ee-H);y(Te,0,0,0,0,we,0,0,0,0,je,1,0,0,ke,0,N),zt(N,!1)}e.perspectiveFovLHToRef=F;function le(h,x,S,E){let N=i();return Ye(h,x,S,E,N),N}e.PerspectiveFovRH=le;function Ye(h,x,S,E,N,G=!0){let H=S,ee=E,me=1/Math.tan(h*.5),Te=G?me/x:me,we=G?me:me*x,je=-(ee+H)/(ee-H),ke=-2*ee*H/(ee-H);y(Te,0,0,0,0,we,0,0,0,0,je,-1,0,0,ke,0,N),zt(N,!1)}e.perspectiveFovRHToRef=Ye;function Zt(h,x,S,E,N=!1){let G=N?-1:1,H=Math.tan(h.upDegrees*Math.PI/180),ee=Math.tan(h.downDegrees*Math.PI/180),me=Math.tan(h.leftDegrees*Math.PI/180),Te=Math.tan(h.rightDegrees*Math.PI/180),we=2/(me+Te),je=2/(H+ee),ke=E._m;ke[0]=we,ke[1]=ke[2]=ke[3]=ke[4]=0,ke[5]=je,ke[6]=ke[7]=0,ke[8]=(me-Te)*we*.5,ke[9]=-((H-ee)*je*.5),ke[10]=-S/(x-S),ke[11]=1*G,ke[12]=ke[13]=ke[15]=0,ke[14]=-(2*S*x)/(S-x),st(E)}e.perspectiveFovWebVRToRef=Zt;function Ia(h){return[h._m[0],h._m[1],h._m[4],h._m[5]]}e.GetAsMatrix2x2=Ia;function Ei(h){return[h._m[0],h._m[1],h._m[2],h._m[4],h._m[5],h._m[6],h._m[8],h._m[9],h._m[10]]}e.GetAsMatrix3x3=Ei;function za(h){let x=i();return Yo(h,x),x}e.transpose=za;function Yo(h,x){let S=x._m,E=h._m;S[0]=E[0],S[1]=E[4],S[2]=E[8],S[3]=E[12],S[4]=E[1],S[5]=E[5],S[6]=E[9],S[7]=E[13],S[8]=E[2],S[9]=E[6],S[10]=E[10],S[11]=E[14],S[12]=E[3],S[13]=E[7],S[14]=E[11],S[15]=E[15],zt(x,h.isIdentity,h._isIdentityDirty)}e.transposeToRef=Yo;function Pa(h){let x=i();return Ti(h,x),x}e.reflection=Pa;function Ti(h,x){let S=uu.normalize(h),E=S.normal.x,N=S.normal.y,G=S.normal.z,H=-2*E,ee=-2*N,me=-2*G;y(H*E+1,ee*E,me*E,0,H*N,ee*N+1,me*N,0,H*G,ee*G,me*G+1,0,H*S.d,ee*S.d,me*S.d,1,x)}e.reflectionToRef=Ti;function kr(h,x,S,E){y(h.x,h.y,h.z,0,x.x,x.y,x.z,0,S.x,S.y,S.z,0,0,0,0,1,E)}e.fromXYZAxesToRef=kr;function qo(h,x){let S=h.x*h.x,E=h.y*h.y,N=h.z*h.z,G=h.x*h.y,H=h.z*h.w,ee=h.z*h.x,me=h.y*h.w,Te=h.y*h.z,we=h.x*h.w;x._m[0]=1-2*(E+N),x._m[1]=2*(G+H),x._m[2]=2*(ee-me),x._m[3]=0,x._m[4]=2*(G-H),x._m[5]=1-2*(N+S),x._m[6]=2*(Te+we),x._m[7]=0,x._m[8]=2*(ee+me),x._m[9]=2*(Te-we),x._m[10]=1-2*(E+S),x._m[11]=0,x._m[12]=0,x._m[13]=0,x._m[14]=0,x._m[15]=1,st(x)}e.fromQuaternionToRef=qo;function st(h){h.updateFlag=a++,h.isIdentity=!1,h.isIdentity3x2=!1,h._isIdentityDirty=!0,h._isIdentity3x2Dirty=!0}function vi(h){if(h._isIdentityDirty){h._isIdentityDirty=!1;let x=h._m;h.isIdentity=x[0]===1&&x[1]===0&&x[2]===0&&x[3]===0&&x[4]===0&&x[5]===1&&x[6]===0&&x[7]===0&&x[8]===0&&x[9]===0&&x[10]===1&&x[11]===0&&x[12]===0&&x[13]===0&&x[14]===0&&x[15]===1}return h.isIdentity}e.isIdentityUpdate=vi;function Rr(h){return h._isIdentity3x2Dirty&&(h._isIdentity3x2Dirty=!1,h._m[0]!==1||h._m[5]!==1||h._m[15]!==1||h._m[1]!==0||h._m[2]!==0||h._m[3]!==0||h._m[4]!==0||h._m[6]!==0||h._m[7]!==0||h._m[8]!==0||h._m[9]!==0||h._m[10]!==0||h._m[11]!==0||h._m[12]!==0||h._m[13]!==0||h._m[14]!==0?h.isIdentity3x2=!1:h.isIdentity3x2=!0),h.isIdentity3x2}e.isIdentityAs3x2Update=Rr;function ki(h){if(h.isIdentity===!0)return 1;let x=h._m,S=x[0],E=x[1],N=x[2],G=x[3],H=x[4],ee=x[5],me=x[6],Te=x[7],we=x[8],je=x[9],ke=x[10],et=x[11],ct=x[12],St=x[13],mt=x[14],Se=x[15],kt=ke*Se-mt*et,Rt=je*Se-St*et,Be=je*mt-St*ke,Ue=we*Se-ct*et,wt=we*mt-ke*ct,$e=we*St-ct*je,ot=+(ee*kt-me*Rt+Te*Be),Gt=-(H*kt-me*Ue+Te*wt),Xt=+(H*Rt-ee*Ue+Te*$e),ht=-(H*Be-ee*wt+me*$e);return S*ot+E*Gt+N*Xt+G*ht}e.determinant=ki;function Oa(h){return h._m}e.toArray=Oa;function Ri(h){return h._m}e.asArray=Ri;function wi(h){y(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,h),zt(h,!1)}e.reset=wi;function Ca(h,x){let S=i();return bi(h,x,S),S}e.add=Ca;function bi(h,x,S){for(let E=0;E<16;E++)S._m[E]=h._m[E]+x._m[E];st(S)}e.addToRef=bi;function wr(h,x){for(let S=0;S<16;S++)h._m[S]+=x._m[S];st(h)}e.addToSelf=wr;function Ua(h){let x=i();return Jo(h,x),x}e.invert=Ua;function Jo(h,x){if(h.isIdentity===!0){C(h,x);return}let S=h._m,E=S[0],N=S[1],G=S[2],H=S[3],ee=S[4],me=S[5],Te=S[6],we=S[7],je=S[8],ke=S[9],et=S[10],ct=S[11],St=S[12],mt=S[13],Se=S[14],kt=S[15],Rt=et*kt-Se*ct,Be=ke*kt-mt*ct,Ue=ke*Se-mt*et,wt=je*kt-St*ct,$e=je*Se-et*St,ot=je*mt-St*ke,Gt=+(me*Rt-Te*Be+we*Ue),Xt=-(ee*Rt-Te*wt+we*$e),ht=+(ee*Be-me*wt+we*ot),Nn=-(ee*Ue-me*$e+Te*ot),ar=E*Gt+N*Xt+G*ht+H*Nn;if(ar===0){C(h,x);return}let yt=1/ar,An=Te*kt-Se*we,ur=me*kt-mt*we,Pt=me*Se-mt*Te,Nr=ee*kt-St*we,Ar=ee*Se-St*Te,Ir=ee*mt-St*me,In=Te*ct-et*we,Zo=me*ct-ke*we,qr=me*et-ke*Te,Xo=ee*ct-je*we,Mu=ee*et-je*Te,Fu=ee*ke-je*me,Wa=-(N*Rt-G*Be+H*Ue),Lu=+(E*Rt-G*wt+H*$e),Ha=-(E*Be-N*wt+H*ot),Ko=+(E*Ue-N*$e+G*ot),Sf=+(N*An-G*ur+H*Pt),Va=-(E*An-G*Nr+H*Ar),He=+(E*ur-N*Nr+H*Ir),Du=-(E*Pt-N*Ar+G*Ir),ja=-(N*In-G*Zo+H*qr),Wu=+(E*In-G*Xo+H*Mu),Ef=-(E*Zo-N*Xo+H*Fu),Tf=+(E*qr-N*Mu+G*Fu);y(Gt*yt,Wa*yt,Sf*yt,ja*yt,Xt*yt,Lu*yt,Va*yt,Wu*yt,ht*yt,Ha*yt,He*yt,Ef*yt,Nn*yt,Ko*yt,Du*yt,Tf*yt,x)}e.invertToRef=Jo;function Ba(h,x,S){h._m[x]+=S,st(h)}e.addAtIndex=Ba;function Ma(h,x,S){return h._m[x]*=S,st(h),h}e.multiplyAtIndex=Ma;function Ni(h,x,S,E){h._m[12]=x,h._m[13]=S,h._m[14]=E,st(h)}e.setTranslationFromFloats=Ni;function Qo(h,x){Ni(h,x.x,x.y,x.z)}e.setTranslation=Qo;function Fa(h){return ie.create(h._m[12],h._m[13],h._m[14])}e.getTranslation=Fa;function La(h,x){x.x=h._m[12],x.y=h._m[13],x.z=h._m[14]}e.getTranslationToRef=La;function _(h){let x=h._m;return y(1,0,0,0,0,1,0,0,0,0,1,0,x[12],x[13],x[14],x[15],h),zt(h,x[12]===0&&x[13]===0&&x[14]===0&&x[15]===1),h}e.removeRotationAndScaling=_;function k(h,x){let S=i();return te(h,x,S),S}e.multiply=k;function C(h,x){oe(h,x._m),zt(x,h.isIdentity,h._isIdentityDirty,h.isIdentity3x2,h._isIdentity3x2Dirty)}e.copy=C;function oe(h,x,S=0){for(let E=0;E<16;E++)x[S+E]=h._m[E]}e.copyToArray=oe;function te(h,x,S){if(h.isIdentity){C(x,S);return}if(x.isIdentity){C(h,S);return}de(h,x,S._m,0),st(S)}e.multiplyToRef=te;function de(h,x,S,E){let N=h._m,G=x._m,H=N[0],ee=N[1],me=N[2],Te=N[3],we=N[4],je=N[5],ke=N[6],et=N[7],ct=N[8],St=N[9],mt=N[10],Se=N[11],kt=N[12],Rt=N[13],Be=N[14],Ue=N[15],wt=G[0],$e=G[1],ot=G[2],Gt=G[3],Xt=G[4],ht=G[5],Nn=G[6],ar=G[7],yt=G[8],An=G[9],ur=G[10],Pt=G[11],Nr=G[12],Ar=G[13],Ir=G[14],In=G[15];S[E]=H*wt+ee*Xt+me*yt+Te*Nr,S[E+1]=H*$e+ee*ht+me*An+Te*Ar,S[E+2]=H*ot+ee*Nn+me*ur+Te*Ir,S[E+3]=H*Gt+ee*ar+me*Pt+Te*In,S[E+4]=we*wt+je*Xt+ke*yt+et*Nr,S[E+5]=we*$e+je*ht+ke*An+et*Ar,S[E+6]=we*ot+je*Nn+ke*ur+et*Ir,S[E+7]=we*Gt+je*ar+ke*Pt+et*In,S[E+8]=ct*wt+St*Xt+mt*yt+Se*Nr,S[E+9]=ct*$e+St*ht+mt*An+Se*Ar,S[E+10]=ct*ot+St*Nn+mt*ur+Se*Ir,S[E+11]=ct*Gt+St*ar+mt*Pt+Se*In,S[E+12]=kt*wt+Rt*Xt+Be*yt+Ue*Nr,S[E+13]=kt*$e+Rt*ht+Be*An+Ue*Ar,S[E+14]=kt*ot+Rt*Nn+Be*ur+Ue*Ir,S[E+15]=kt*Gt+Rt*ar+Be*Pt+Ue*In}e.multiplyToArray=de;function ve(h,x){let S=x;if(!S)return!1;if((h.isIdentity||S.isIdentity)&&!h._isIdentityDirty&&!S._isIdentityDirty)return h.isIdentity&&S.isIdentity;let E=h._m,N=S._m;return E[0]===N[0]&&E[1]===N[1]&&E[2]===N[2]&&E[3]===N[3]&&E[4]===N[4]&&E[5]===N[5]&&E[6]===N[6]&&E[7]===N[7]&&E[8]===N[8]&&E[9]===N[9]&&E[10]===N[10]&&E[11]===N[11]&&E[12]===N[12]&&E[13]===N[13]&&E[14]===N[14]&&E[15]===N[15]}e.equals=ve;function dt(h){let x=i();return C(h,x),x}e.clone=dt;function It(h){let x=h._m[0]||0;for(let S=1;S<16;S++)x=x*397^(h._m[S]||0);return x}e.getHashCode=It;function pt(h,x,S,E){if(h.isIdentity)return E&&(E=ie.create(0,0,0)),x&&(x=ie.create(0,0,0)),S&&(S=Jt.create(0,0,0,1)),!0;let N=h._m;E&&(E=ie.create(N[12],N[13],N[14]));let G=x||ie.Zero();if(G.x=Math.sqrt(N[0]*N[0]+N[1]*N[1]+N[2]*N[2]),G.y=Math.sqrt(N[4]*N[4]+N[5]*N[5]+N[6]*N[6]),G.z=Math.sqrt(N[8]*N[8]+N[9]*N[9]+N[10]*N[10]),ki(h)<=0&&(G.y*=-1),G.x===0||G.y===0||G.z===0)return S&&(S=Jt.create(0,0,0,1)),!1;if(S){let H=1/G.x,ee=1/G.y,me=1/G.z,Te=i();y(N[0]*H,N[1]*H,N[2]*H,0,N[4]*ee,N[5]*ee,N[6]*ee,0,N[8]*me,N[9]*me,N[10]*me,0,0,0,0,1,Te),Jt.fromRotationMatrixToRef(Te,S)}return!0}e.decompose=pt;function Gn(h,x,S,E,N,G){if(x<0||x>3)return;let H=x*4;h._m[H+0]=S,h._m[H+1]=E,h._m[H+2]=N,h._m[H+3]=G,st(h)}e.setRowFromFloats=Gn;function br(h,x){let S=i();return or(h,x,S),S}e.scale=br;function or(h,x,S){for(let E=0;E<16;E++)S._m[E]=h._m[E]*x;st(S)}e.scaleToRef=or;function ir(h,x,S){for(let E=0;E<16;E++)S._m[E]+=h._m[E]*x;st(S)}e.scaleAndAddToRef=ir;function Da(h,x){let S=i();Jo(h,S),Yo(S,x);let E=x._m;y(E[0],E[1],E[2],0,E[4],E[5],E[6],0,E[8],E[9],E[10],0,0,0,0,1,x)}e.normalMatrixToRef=Da;function xf(h){let x=i();return Bu(h,x),x}e.getRotationMatrix=xf;function Bu(h,x){let S=ie.Zero();if(!pt(h,S)){x=D();return}let E=h._m,N=1/S.x,G=1/S.y,H=1/S.z;y(E[0]*N,E[1]*N,E[2]*N,0,E[4]*G,E[5]*G,E[6]*G,0,E[8]*H,E[9]*H,E[10]*H,0,0,0,0,1,x)}e.getRotationMatrixToRef=Bu;function Ai(h){h._m[2]*=-1,h._m[6]*=-1,h._m[8]*=-1,h._m[9]*=-1,h._m[14]*=-1,st(h)}e.toggleModelMatrixHandInPlace=Ai;function _f(h){h._m[8]*=-1,h._m[9]*=-1,h._m[10]*=-1,h._m[11]*=-1,st(h)}e.toggleProjectionMatrixHandInPlace=_f;function zt(h,x,S=!1,E=!1,N=!0){h.updateFlag=a++,h.isIdentity=x,h.isIdentity3x2=x||E,h._isIdentityDirty=h.isIdentity?!1:S,h._isIdentity3x2Dirty=h.isIdentity3x2?!1:N}})(Ln||(Ln={}));var Jt;(function(e){function r(v=0,z=0,V=0,X=1){return{x:v,y:z,z:V,w:X}}e.create=r;function a(v,z){return{x:v.x+z.x,y:v.y+z.y,z:v.z+z.z,w:v.w+z.w}}e.add=a;function o(v,z,V){let X=z*.5,ue=v*.5,xe=V*.5,Pe=Math.cos(X),Fe=Math.cos(ue),We=Math.cos(xe),Le=Math.sin(X),Ze=Math.sin(ue),Ve=Math.sin(xe);return r(Fe*Le*We+Ze*Pe*Ve,Ze*Pe*We-Fe*Le*Ve,Fe*Pe*Ve-Ze*Le*We,Fe*Pe*We+Ze*Le*Ve)}e.fromRotationYawPitchRoll=o;function u(v,z,V){return o(z*Hi,v*Hi,V*Hi)}e.fromEulerDegrees=u;function i(v){return Math.sqrt(p(v))}e.length=i;function p(v){return v.x*v.x+v.y*v.y+v.z*v.z+v.w*v.w}e.lengthSquared=p;function f(v,z){return v.x*z.x+v.y*z.y+v.z*z.z+v.w*z.w}e.dot=f;function c(v,z){let V=f(v,z);return Math.acos(Math.min(Math.abs(V),1))*2*Vi}e.angle=c;function y(v,z,V){let X=c(v,z);if(X===0)return z;let ue=Math.min(1,V/X);return W(v,z,ue)}e.rotateTowards=y;function R(v,z={x:0,y:1,z:0}){let V=ie.normalize(v),X=ie.normalize(ie.cross(z,V)),ue=ie.cross(V,X),xe=X.x,Pe=X.y,Fe=X.z,We=ue.x,Le=ue.y,Ze=ue.z,Ve=V.x,rt=V.y,Ce=V.z,jt=xe+Le+Ce,O=r();if(jt>0){let A=Math.sqrt(jt+1);return O.w=A*.5,A=.5/A,O.x=(Ze-rt)*A,O.y=(Ve-Fe)*A,O.z=(Pe-We)*A,O}if(xe>=Le&&xe>=Ce){let A=Math.sqrt(1+xe-Le-Ce),F=.5/A;return O.x=.5*A,O.y=(Pe+We)*F,O.z=(Fe+Ve)*F,O.w=(Ze-rt)*F,O}if(Le>Ce){let A=Math.sqrt(1+Le-xe-Ce),F=.5/A;return O.x=(We+Pe)*F,O.y=.5*A,O.z=(rt+Ze)*F,O.w=(Ve-Fe)*F,O}let j=Math.sqrt(1+Ce-xe-Le),re=.5/j;return O.x=(Ve+Fe)*re,O.y=(rt+Ze)*re,O.z=.5*j,O.w=(Pe-We)*re,O}e.lookRotation=R;function T(v){let z=1/i(v);return r(v.x*z,v.y*z,v.z*z,v.w*z)}e.normalize=T;function w(v,z,V=ie.Up()){let X=ie.normalize(v),ue=ie.normalize(z),xe=ie.cross(X,ue),Pe=Math.sqrt(ie.lengthSquared(X)*ie.lengthSquared(ue))+ie.dot(X,ue);return ie.lengthSquared(xe)<1e-4?Math.abs(Pe)<1e-4?T(r(V.x,V.y,V.z,0)):D():T(r(xe.x,xe.y,xe.z,Pe))}e.fromToRotation=w;function D(){return r(0,0,0,1)}e.Identity=D;function B(v){let z=ie.create(),V=v.x*v.x+v.y*v.y+v.z*v.z+v.w*v.w,X=v.x*v.w-v.y*v.z;return X>.4995*V?(z.x=Math.PI/2,z.y=2*Math.atan2(v.y,v.x),z.z=0):X<-.4995*V?(z.x=-Math.PI/2,z.y=-2*Math.atan2(v.y,v.x),z.z=0):(z.x=Math.asin(2*(v.w*v.x-v.y*v.z)),z.y=Math.atan2(2*v.w*v.y+2*v.z*v.x,1-2*(v.x*v.x+v.y*v.y)),z.z=Math.atan2(2*v.w*v.z+2*v.x*v.y,1-2*(v.z*v.z+v.x*v.x))),z.x*=Vi,z.y*=Vi,z.z*=Vi,z.x=nt.repeat(z.x,360),z.y=nt.repeat(z.y,360),z.z=nt.repeat(z.z,360),z}e.toEulerAngles=B;function P(v,z,V,X){let ue=z*.5,xe=v*.5,Pe=V*.5,Fe=Math.cos(ue),We=Math.cos(xe),Le=Math.cos(Pe),Ze=Math.sin(ue),Ve=Math.sin(xe),rt=Math.sin(Pe);X.x=We*Ze*Le+Ve*Fe*rt,X.y=Ve*Fe*Le-We*Ze*rt,X.z=We*Fe*rt-Ve*Ze*Le,X.w=We*Fe*Le+Ve*Ze*rt}e.fromRotationYawPitchRollToRef=P;function Y(v,z){let V=v._m,X=V[0],ue=V[4],xe=V[8],Pe=V[1],Fe=V[5],We=V[9],Le=V[2],Ze=V[6],Ve=V[10],rt=X+Fe+Ve,Ce;rt>0?(Ce=.5/Math.sqrt(rt+1),z.w=.25/Ce,z.x=(Ze-We)*Ce,z.y=(xe-Le)*Ce,z.z=(Pe-ue)*Ce):X>Fe&&X>Ve?(Ce=2*Math.sqrt(1+X-Fe-Ve),z.w=(Ze-We)/Ce,z.x=.25*Ce,z.y=(ue+Pe)/Ce,z.z=(xe+Le)/Ce):Fe>Ve?(Ce=2*Math.sqrt(1+Fe-X-Ve),z.w=(xe-Le)/Ce,z.x=(ue+Pe)/Ce,z.y=.25*Ce,z.z=(We+Ze)/Ce):(Ce=2*Math.sqrt(1+Ve-X-Fe),z.w=(Pe-ue)/Ce,z.x=(xe+Le)/Ce,z.y=(We+Ze)/Ce,z.z=.25*Ce)}e.fromRotationMatrixToRef=Y;function W(v,z,V){let X=e.Identity();return e.slerpToRef(v,z,V,X),X}e.slerp=W;function Q(v,z,V,X){let ue,xe,Pe=v.x*z.x+v.y*z.y+v.z*z.z+v.w*z.w,Fe=!1;if(Pe<0&&(Fe=!0,Pe=-Pe),Pe>.999999)xe=1-V,ue=Fe?-V:V;else{let We=Math.acos(Pe),Le=1/Math.sin(We);xe=Math.sin((1-V)*We)*Le,ue=Fe?-Math.sin(V*We)*Le:Math.sin(V*We)*Le}X.x=xe*v.x+ue*z.x,X.y=xe*v.y+ue*z.y,X.z=xe*v.z+ue*z.z,X.w=xe*v.w+ue*z.w}e.slerpToRef=Q;function ce(v,z){let V=r(0,0,0,1);return $(v,z,V),V}e.multiply=ce;function $(v,z,V){V.x=v.x*z.w+v.y*z.z-v.z*z.y+v.w*z.x,V.y=-v.x*z.z+v.y*z.w+v.z*z.x+v.w*z.y,V.z=v.x*z.y-v.y*z.x+v.z*z.w+v.w*z.z,V.w=-v.x*z.x-v.y*z.y-v.z*z.z+v.w*z.w}e.multiplyToRef=$;function ye(v,z){if(ie.lengthSquared(z)===0)return e.Identity();let V=D(),X=v*Hi;X*=.5;let ue=ie.normalize(z);return ie.scaleToRef(ue,Math.sin(X),ue),V.x=ue.x,V.y=ue.y,V.z=ue.z,V.w=Math.cos(X),T(V)}e.fromAngleAxis=ye;function q(v,z,V){let X=e.create(0,0,0,0);return J(v,z,V,X),X}e.fromAxisToRotationQuaternion=q;function J(v,z,V,X){let ue=Ln.create();Ln.fromXYZAxesToRef(ie.normalize(v),ie.normalize(z),ie.normalize(V),ue),e.fromRotationMatrixToRef(ue,X)}e.fromAxisToRotationQuaternionToRef=J;function ae(){return r(0,0,0,0)}e.Zero=ae;function ge(v,z,V=ie.Up()){let X=e.Identity();return Z(v,z,V,X),X}e.fromLookAt=ge;function Z(v,z,V=ie.Up(),X){let ue=Ln.Identity();Ln.lookAtLHToRef(v,z,V,ue),Ln.invertToRef(ue,ue),e.fromRotationMatrixToRef(ue,X)}e.fromLookAtToRef=Z})(Jt||(Jt={}));var su;(function(e){function r(O=0,j=0,re=0,A=1){return{r:O,g:j,b:re,a:A}}e.create=r;function a(O){if(O.substring(0,1)!=="#"||O.length!==7&&O.length!==9)return r(0,0,0,1);let j=parseInt(O.substring(1,3),16),re=parseInt(O.substring(3,5),16),A=parseInt(O.substring(5,7),16),F=O.substring(7,9),le=F?parseInt(F,16):255;return e.fromInts(j,re,A,le)}e.fromHexString=a;function o(O,j,re){let A=r(0,0,0,0);return e.lerpToRef(O,j,re,A),A}e.lerp=o;function u(O,j,re,A){A.r=O.r+(j.r-O.r)*re,A.g=O.g+(j.g-O.g)*re,A.b=O.b+(j.b-O.b)*re,A.a=O.a+(j.a-O.a)*re}e.lerpToRef=u;function i(){return r(1,0,0,1)}e.Red=i;function p(){return r(0,1,0,1)}e.Green=p;function f(){return r(0,0,1,1)}e.Blue=f;function c(){return r(0,0,0,1)}e.Black=c;function y(){return r(1,1,1,1)}e.White=y;function R(){return r(.5,0,.5,1)}e.Purple=R;function T(){return r(1,0,1,1)}e.Magenta=T;function w(){return r(1,1,0,1)}e.Yellow=w;function D(){return r(.5,.5,.5,1)}e.Gray=D;function B(){return r(0,1,1,1)}e.Teal=B;function P(){return r(0,0,0,0)}e.Clear=P;function Y(O,j=1){return r(O.r,O.g,O.b,j)}e.fromColor3=Y;function W(O,j=0){return r(O[j],O[j+1],O[j+2],O[j+3])}e.fromArray=W;function Q(O,j,re,A){return r(O/255,j/255,re/255,A/255)}e.fromInts=Q;function ce(O,j){if(O.length===j*3){let re=[];for(let A=0;A<O.length;A+=3){let F=A/3*4;re[F]=O[A],re[F+1]=O[A+1],re[F+2]=O[A+2],re[F+3]=1}return re}return O}e.checkColors4=ce;function $(O,j,re){re.r=O.r+j.r,re.g=O.g+j.g,re.b=O.b+j.b,re.a=O.a+j.a}e.addToRef=$;function ye(O,j,re=0){j[re]=O.r,j[re+1]=O.g,j[re+2]=O.b,j[re+3]=O.a}e.toArray=ye;function q(O,j){let re=P();return $(O,j,re),re}e.add=q;function J(O,j){let re=P();return ae(O,j,re),re}e.subtract=J;function ae(O,j,re){re.r=O.r-j.r,re.g=O.g-j.g,re.b=O.b-j.b,re.a=O.a-j.a}e.subtractToRef=ae;function ge(O,j){return r(O.r*j,O.g*j,O.b*j,O.a*j)}e.scale=ge;function Z(O,j,re){re.r=O.r*j,re.g=O.g*j,re.b=O.b*j,re.a=O.a*j}e.scaleToRef=Z;function v(O,j,re){re.r+=O.r*j,re.g+=O.g*j,re.b+=O.b*j,re.a+=O.a*j}e.scaleAndAddToRef=v;function z(O,j=0,re=1,A){A.r=nt.clamp(O.r,j,re),A.g=nt.clamp(O.g,j,re),A.b=nt.clamp(O.b,j,re),A.a=nt.clamp(O.a,j,re)}e.clampToRef=z;function V(O,j){return r(O.r*j.r,O.g*j.g,O.b*j.b,O.a*j.a)}e.multiply=V;function X(O,j,re){re.r=O.r*j.r,re.g=O.g*j.g,re.b=O.b*j.b,re.a=O.a*j.a}e.multiplyToRef=X;function ue(O){return"{R: "+O.r+" G:"+O.g+" B:"+O.b+" A:"+O.a+"}"}e.toString=ue;function xe(O){let j=O.r||0;return j=j*397^(O.g||0),j=j*397^(O.b||0),j=j*397^(O.a||0),j}e.getHashCode=xe;function Pe(O){return r(O.r,O.g,O.b,O.a)}e.clone=Pe;function Fe(O,j){j.r=O.r,j.g=O.g,j.b=O.b,j.a=O.a}e.copyFrom=Fe;function We(O,j,re,A,F){F.r=O,F.g=j,F.b=re,F.a=A}e.copyFromFloats=We;function Le(O,j,re,A,F){F.r=O,F.g=j,F.b=re,F.a=A}e.set=Le;function Ze(O){let j=O.r*255|0,re=O.g*255|0,A=O.b*255|0,F=O.a*255|0;return"#"+nt.toHex(j)+nt.toHex(re)+nt.toHex(A)+nt.toHex(F)}e.toHexString=Ze;function Ve(O){let j=r();return rt(O,j),j}e.toLinearSpace=Ve;function rt(O,j){j.r=Math.pow(O.r,Lr),j.g=Math.pow(O.g,Lr),j.b=Math.pow(O.b,Lr),j.a=O.a}e.toLinearSpaceToRef=rt;function Ce(O){let j=r();return jt(O,j),j}e.toGammaSpace=Ce;function jt(O,j){j.r=Math.pow(O.r,Fr),j.g=Math.pow(O.g,Fr),j.b=Math.pow(O.b,Fr),j.a=O.a}e.toGammaSpaceToRef=jt})(su||(su={}));var Nl;(function(e){function r(A=0,F=0,le=0){return{r:A,g:F,b:le}}e.create=r;function a(A){if(A.substring(0,1)!=="#"||A.length!==7)return r(0,0,0);let F=parseInt(A.substring(1,3),16),le=parseInt(A.substring(3,5),16),Ye=parseInt(A.substring(5,7),16);return u(F,le,Ye)}e.fromHexString=a;function o(A,F=0){return r(A[F],A[F+1],A[F+2])}e.fromArray=o;function u(A,F,le){return r(A/255,F/255,le/255)}e.fromInts=u;function i(A,F,le){let Ye=r(0,0,0);return e.lerpToRef(A,F,le,Ye),Ye}e.lerp=i;function p(A,F,le,Ye){Ye.r=A.r+(F.r-A.r)*le,Ye.g=A.g+(F.g-A.g)*le,Ye.b=A.b+(F.b-A.b)*le}e.lerpToRef=p;function f(){return r(1,0,0)}e.Red=f;function c(){return r(0,1,0)}e.Green=c;function y(){return r(0,0,1)}e.Blue=y;function R(){return r(0,0,0)}e.Black=R;function T(){return r(1,1,1)}e.White=T;function w(){return r(.5,0,.5)}e.Purple=w;function D(){return r(1,0,1)}e.Magenta=D;function B(){return r(1,1,0)}e.Yellow=B;function P(){return r(.5,.5,.5)}e.Gray=P;function Y(){return r(0,1,1)}e.Teal=Y;function W(){return r(Math.random(),Math.random(),Math.random())}e.Random=W;function Q(A){return"{R: "+A.r+" G:"+A.g+" B:"+A.b+"}"}e.toString=Q;function ce(A){let F=A.r||0;return F=F*397^(A.g||0),F=F*397^(A.b||0),F}e.getHashCode=ce;function $(A,F,le=0){F[le]=A.r,F[le+1]=A.g,F[le+2]=A.b}e.toArray=$;function ye(A,F=1){return su.create(A.r,A.g,A.b,F)}e.toColor4=ye;function q(A){let F=new Array;return $(A,F,0),F}e.asArray=q;function J(A){return A.r*.3+A.g*.59+A.b*.11}e.toLuminance=J;function ae(A,F){return r(A.r*F.r,A.g*F.g,A.b*F.b)}e.multiply=ae;function ge(A,F,le){le.r=A.r*F.r,le.g=A.g*F.g,le.b=A.b*F.b}e.multiplyToRef=ge;function Z(A,F){return F&&A.r===F.r&&A.g===F.g&&A.b===F.b}e.equals=Z;function v(A,F,le,Ye){return A.r===F&&A.g===le&&A.b===Ye}e.equalsFloats=v;function z(A,F){return r(A.r*F,A.g*F,A.b*F)}e.scale=z;function V(A,F,le){le.r=A.r*F,le.g=A.g*F,le.b=A.b*F}e.scaleToRef=V;function X(A,F,le){le.r+=A.r*F,le.g+=A.g*F,le.b+=A.b*F}e.scaleAndAddToRef=X;function ue(A,F=0,le=1,Ye){Ye.r=nt.clamp(A.r,F,le),Ye.g=nt.clamp(A.g,F,le),Ye.b=nt.clamp(A.b,F,le)}e.clampToRef=ue;function xe(A,F=0,le=1){let Ye=e.Black();return ue(A,F,le,Ye),Ye}e.clamp=xe;function Pe(A,F){return r(A.r+F.r,A.g+F.g,A.b+F.b)}e.add=Pe;function Fe(A,F,le){le.r=A.r+F.r,le.g=A.g+F.g,le.b=A.b+F.b}e.addToRef=Fe;function We(A,F){return r(A.r-F.r,A.g-F.g,A.b-F.b)}e.subtract=We;function Le(A,F,le){le.r=A.r-F.r,le.g=A.g-F.g,le.b=A.b-F.b}e.subtractToRef=Le;function Ze(A){return r(A.r,A.g,A.b)}e.clone=Ze;function Ve(A,F){F.r=A.r,F.g=A.g,F.b=A.b}e.copyFrom=Ve;function rt(A,F,le,Ye){A.r=F,A.g=le,A.b=Ye}e.set=rt;function Ce(A){let F=A.r*255|0,le=A.g*255|0,Ye=A.b*255|0;return"#"+nt.toHex(F)+nt.toHex(le)+nt.toHex(Ye)}e.toHexString=Ce;function jt(A){let F=r();return O(A,F),F}e.toLinearSpace=jt;function O(A,F){F.r=Math.pow(A.r,Lr),F.g=Math.pow(A.g,Lr),F.b=Math.pow(A.b,Lr)}e.toLinearSpaceToRef=O;function j(A){let F=r();return re(A,F),F}e.toGammaSpace=j;function re(A,F){F.r=Math.pow(A.r,Fr),F.g=Math.pow(A.g,Fr),F.b=Math.pow(A.b,Fr)}e.toGammaSpaceToRef=re})(Nl||(Nl={}));var er={};b0(er,{Animator:()=>ed,AudioSource:()=>bc,AudioStream:()=>Nc,AvatarAnchorPointType:()=>Ms,AvatarAttach:()=>Ac,AvatarModifierArea:()=>Ic,AvatarModifierType:()=>Ls,AvatarShape:()=>zc,BackgroundTextureMode:()=>ac,Billboard:()=>Pc,BillboardMode:()=>Hs,CameraMode:()=>Oc,CameraModeArea:()=>Cc,ColliderLayer:()=>Qs,EngineInfo:()=>Uc,GltfContainer:()=>Bc,GltfContainerLoadingState:()=>Mc,Material:()=>$l,MaterialTransparencyMode:()=>Js,MeshCollider:()=>nd,MeshRenderer:()=>td,NftFrameType:()=>Xs,NftShape:()=>Fc,PBAnimationState:()=>Gi,PBAnimator:()=>io,PBAudioSource:()=>ao,PBAudioStream:()=>uo,PBAvatarAttach:()=>so,PBAvatarModifierArea:()=>co,PBAvatarShape:()=>fo,PBBillboard:()=>lo,PBCameraMode:()=>po,PBCameraModeArea:()=>mo,PBEngineInfo:()=>ho,PBGltfContainer:()=>yo,PBGltfContainerLoadingState:()=>go,PBMaterial:()=>xo,PBMaterial_PbrMaterial:()=>Qi,PBMaterial_UnlitMaterial:()=>Ji,PBMeshCollider:()=>_o,PBMeshCollider_BoxMesh:()=>Zi,PBMeshCollider_CylinderMesh:()=>Xi,PBMeshCollider_PlaneMesh:()=>Ki,PBMeshCollider_SphereMesh:()=>$i,PBMeshRenderer:()=>So,PBMeshRenderer_BoxMesh:()=>ea,PBMeshRenderer_CylinderMesh:()=>ta,PBMeshRenderer_PlaneMesh:()=>na,PBMeshRenderer_SphereMesh:()=>ra,PBNftShape:()=>Eo,PBPointerEvents:()=>To,PBPointerEventsResult:()=>vo,PBPointerEvents_Entry:()=>ia,PBPointerEvents_Info:()=>oa,PBPointerLock:()=>ko,PBRaycast:()=>Ro,PBRaycastResult:()=>wo,PBTextShape:()=>bo,PBUiBackground:()=>No,PBUiCanvasInformation:()=>Ao,PBUiDropdown:()=>Io,PBUiDropdownResult:()=>zo,PBUiInput:()=>Po,PBUiInputResult:()=>Oo,PBUiText:()=>Co,PBUiTransform:()=>Uo,PBVideoEvent:()=>Bo,PBVideoPlayer:()=>Mo,PBVisibilityComponent:()=>Fo,PointerEvents:()=>aa,PointerEventsResult:()=>ua,PointerLock:()=>Lc,Raycast:()=>sa,RaycastQueryType:()=>nc,RaycastResult:()=>ca,TextShape:()=>Dc,Transform:()=>Hr,UiBackground:()=>fa,UiCanvasInformation:()=>Wc,UiDropdown:()=>la,UiDropdownResult:()=>da,UiInput:()=>pa,UiInputResult:()=>ma,UiText:()=>ha,UiTransform:()=>ya,VideoEvent:()=>ga,VideoPlayer:()=>xa,VideoState:()=>kc,VisibilityComponent:()=>Hc,YGAlign:()=>hc,YGDisplay:()=>Ec,YGEdge:()=>Tc,YGFlexDirection:()=>gc,YGJustify:()=>_c,YGOverflow:()=>Sc,YGPositionType:()=>mc,YGUnit:()=>yc,YGWrap:()=>xc,componentDefinitionByName:()=>hu});var fi=be(ze());function n2(){return{states:[]}}var io;(function(e){function r(o,u=fi.default.Writer.create()){for(let i of o.states)Gi.encode(i,u.uint32(10).fork()).ldelim();return u}e.encode=r;function a(o,u){let i=o instanceof fi.default.Reader?o:fi.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=n2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==10)break;f.states.push(Gi.decode(i,i.uint32()));continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(io||(io={}));function r2(){return{name:"",clip:"",playing:void 0,weight:void 0,speed:void 0,loop:void 0,shouldReset:void 0}}var Gi;(function(e){function r(o,u=fi.default.Writer.create()){return o.name!==""&&u.uint32(10).string(o.name),o.clip!==""&&u.uint32(18).string(o.clip),o.playing!==void 0&&u.uint32(24).bool(o.playing),o.weight!==void 0&&u.uint32(37).float(o.weight),o.speed!==void 0&&u.uint32(45).float(o.speed),o.loop!==void 0&&u.uint32(48).bool(o.loop),o.shouldReset!==void 0&&u.uint32(56).bool(o.shouldReset),u}e.encode=r;function a(o,u){let i=o instanceof fi.default.Reader?o:fi.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=r2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==10)break;f.name=i.string();continue;case 2:if(c!==18)break;f.clip=i.string();continue;case 3:if(c!==24)break;f.playing=i.bool();continue;case 4:if(c!==37)break;f.weight=i.float();continue;case 5:if(c!==45)break;f.speed=i.float();continue;case 6:if(c!==48)break;f.loop=i.bool();continue;case 7:if(c!==56)break;f.shouldReset=i.bool();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Gi||(Gi={}));var km={COMPONENT_ID:1042,serialize(e,r){let a=io.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return io.decode(e.buffer(),e.remainingBytes())},create(){return io.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBAnimator"}};var Cs=be(ze());function o2(){return{playing:void 0,volume:void 0,loop:void 0,pitch:void 0,audioClipUrl:""}}var ao;(function(e){function r(o,u=Cs.default.Writer.create()){return o.playing!==void 0&&u.uint32(8).bool(o.playing),o.volume!==void 0&&u.uint32(21).float(o.volume),o.loop!==void 0&&u.uint32(24).bool(o.loop),o.pitch!==void 0&&u.uint32(37).float(o.pitch),o.audioClipUrl!==""&&u.uint32(42).string(o.audioClipUrl),u}e.encode=r;function a(o,u){let i=o instanceof Cs.default.Reader?o:Cs.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=o2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==8)break;f.playing=i.bool();continue;case 2:if(c!==21)break;f.volume=i.float();continue;case 3:if(c!==24)break;f.loop=i.bool();continue;case 4:if(c!==37)break;f.pitch=i.float();continue;case 5:if(c!==42)break;f.audioClipUrl=i.string();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(ao||(ao={}));var Rm={COMPONENT_ID:1020,serialize(e,r){let a=ao.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return ao.decode(e.buffer(),e.remainingBytes())},create(){return ao.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBAudioSource"}};var Us=be(ze());function i2(){return{playing:void 0,volume:void 0,url:""}}var uo;(function(e){function r(o,u=Us.default.Writer.create()){return o.playing!==void 0&&u.uint32(8).bool(o.playing),o.volume!==void 0&&u.uint32(21).float(o.volume),o.url!==""&&u.uint32(26).string(o.url),u}e.encode=r;function a(o,u){let i=o instanceof Us.default.Reader?o:Us.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=i2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==8)break;f.playing=i.bool();continue;case 2:if(c!==21)break;f.volume=i.float();continue;case 3:if(c!==26)break;f.url=i.string();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(uo||(uo={}));var wm={COMPONENT_ID:1021,serialize(e,r){let a=uo.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return uo.decode(e.buffer(),e.remainingBytes())},create(){return uo.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBAudioStream"}};var Bs=be(ze());var Ms;(function(e){e[e.AAPT_POSITION=0]="AAPT_POSITION",e[e.AAPT_NAME_TAG=1]="AAPT_NAME_TAG",e[e.AAPT_LEFT_HAND=2]="AAPT_LEFT_HAND",e[e.AAPT_RIGHT_HAND=3]="AAPT_RIGHT_HAND"})(Ms||(Ms={}));function a2(){return{avatarId:void 0,anchorPointId:0}}var so;(function(e){function r(o,u=Bs.default.Writer.create()){return o.avatarId!==void 0&&u.uint32(10).string(o.avatarId),o.anchorPointId!==0&&u.uint32(16).int32(o.anchorPointId),u}e.encode=r;function a(o,u){let i=o instanceof Bs.default.Reader?o:Bs.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=a2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==10)break;f.avatarId=i.string();continue;case 2:if(c!==16)break;f.anchorPointId=i.int32();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(so||(so={}));var bm={COMPONENT_ID:1073,serialize(e,r){let a=so.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return so.decode(e.buffer(),e.remainingBytes())},create(){return so.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBAvatarAttach"}};var Fs=be(ze());var Tn=be(ze());function u2(){return{x:0,y:0,z:0}}var Nm;(function(e){function r(o,u=Tn.default.Writer.create()){return o.x!==0&&u.uint32(13).float(o.x),o.y!==0&&u.uint32(21).float(o.y),o.z!==0&&u.uint32(29).float(o.z),u}e.encode=r;function a(o,u){let i=o instanceof Tn.default.Reader?o:Tn.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=u2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==13)break;f.x=i.float();continue;case 2:if(c!==21)break;f.y=i.float();continue;case 3:if(c!==29)break;f.z=i.float();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Nm||(Nm={}));function s2(){return{x:0,y:0,z:0}}var Xe;(function(e){function r(o,u=Tn.default.Writer.create()){return o.x!==0&&u.uint32(13).float(o.x),o.y!==0&&u.uint32(21).float(o.y),o.z!==0&&u.uint32(29).float(o.z),u}e.encode=r;function a(o,u){let i=o instanceof Tn.default.Reader?o:Tn.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=s2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==13)break;f.x=i.float();continue;case 2:if(c!==21)break;f.y=i.float();continue;case 3:if(c!==29)break;f.z=i.float();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Xe||(Xe={}));function c2(){return{x:0,y:0}}var Am;(function(e){function r(o,u=Tn.default.Writer.create()){return o.x!==0&&u.uint32(13).float(o.x),o.y!==0&&u.uint32(21).float(o.y),u}e.encode=r;function a(o,u){let i=o instanceof Tn.default.Reader?o:Tn.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=c2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==13)break;f.x=i.float();continue;case 2:if(c!==21)break;f.y=i.float();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Am||(Am={}));function f2(){return{x:0,y:0,z:0,w:0}}var Im;(function(e){function r(o,u=Tn.default.Writer.create()){return o.x!==0&&u.uint32(13).float(o.x),o.y!==0&&u.uint32(21).float(o.y),o.z!==0&&u.uint32(29).float(o.z),o.w!==0&&u.uint32(37).float(o.w),u}e.encode=r;function a(o,u){let i=o instanceof Tn.default.Reader?o:Tn.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=f2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==13)break;f.x=i.float();continue;case 2:if(c!==21)break;f.y=i.float();continue;case 3:if(c!==29)break;f.z=i.float();continue;case 4:if(c!==37)break;f.w=i.float();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Im||(Im={}));var Ls;(function(e){e[e.AMT_HIDE_AVATARS=0]="AMT_HIDE_AVATARS",e[e.AMT_DISABLE_PASSPORTS=1]="AMT_DISABLE_PASSPORTS"})(Ls||(Ls={}));function l2(){return{area:void 0,excludeIds:[],modifiers:[]}}var co;(function(e){function r(o,u=Fs.default.Writer.create()){o.area!==void 0&&Xe.encode(o.area,u.uint32(10).fork()).ldelim();for(let i of o.excludeIds)u.uint32(18).string(i);u.uint32(26).fork();for(let i of o.modifiers)u.int32(i);return u.ldelim(),u}e.encode=r;function a(o,u){let i=o instanceof Fs.default.Reader?o:Fs.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=l2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==10)break;f.area=Xe.decode(i,i.uint32());continue;case 2:if(c!==18)break;f.excludeIds.push(i.string());continue;case 3:if(c===24){f.modifiers.push(i.int32());continue}if(c===26){let y=i.uint32()+i.pos;for(;i.pos<y;)f.modifiers.push(i.int32());continue}break}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(co||(co={}));var zm={COMPONENT_ID:1070,serialize(e,r){let a=co.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return co.decode(e.buffer(),e.remainingBytes())},create(){return co.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBAvatarModifierArea"}};var jl=be(Hm()),mi=be(ze());var pi=be(ze());function p2(){return{r:0,g:0,b:0}}var vt;(function(e){function r(o,u=pi.default.Writer.create()){return o.r!==0&&u.uint32(13).float(o.r),o.g!==0&&u.uint32(21).float(o.g),o.b!==0&&u.uint32(29).float(o.b),u}e.encode=r;function a(o,u){let i=o instanceof pi.default.Reader?o:pi.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=p2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==13)break;f.r=i.float();continue;case 2:if(c!==21)break;f.g=i.float();continue;case 3:if(c!==29)break;f.b=i.float();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(vt||(vt={}));function m2(){return{r:0,g:0,b:0,a:0}}var _t;(function(e){function r(o,u=pi.default.Writer.create()){return o.r!==0&&u.uint32(13).float(o.r),o.g!==0&&u.uint32(21).float(o.g),o.b!==0&&u.uint32(29).float(o.b),o.a!==0&&u.uint32(37).float(o.a),u}e.encode=r;function a(o,u){let i=o instanceof pi.default.Reader?o:pi.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=m2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==13)break;f.r=i.float();continue;case 2:if(c!==21)break;f.g=i.float();continue;case 3:if(c!==29)break;f.b=i.float();continue;case 4:if(c!==37)break;f.a=i.float();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(_t||(_t={}));function h2(){return{id:"",name:void 0,bodyShape:void 0,skinColor:void 0,hairColor:void 0,eyeColor:void 0,expressionTriggerId:void 0,expressionTriggerTimestamp:void 0,talking:void 0,wearables:[],emotes:[]}}var fo;(function(e){function r(o,u=mi.default.Writer.create()){o.id!==""&&u.uint32(10).string(o.id),o.name!==void 0&&u.uint32(18).string(o.name),o.bodyShape!==void 0&&u.uint32(26).string(o.bodyShape),o.skinColor!==void 0&&vt.encode(o.skinColor,u.uint32(34).fork()).ldelim(),o.hairColor!==void 0&&vt.encode(o.hairColor,u.uint32(42).fork()).ldelim(),o.eyeColor!==void 0&&vt.encode(o.eyeColor,u.uint32(50).fork()).ldelim(),o.expressionTriggerId!==void 0&&u.uint32(58).string(o.expressionTriggerId),o.expressionTriggerTimestamp!==void 0&&u.uint32(64).int64(o.expressionTriggerTimestamp),o.talking!==void 0&&u.uint32(72).bool(o.talking);for(let i of o.wearables)u.uint32(82).string(i);for(let i of o.emotes)u.uint32(90).string(i);return u}e.encode=r;function a(o,u){let i=o instanceof mi.default.Reader?o:mi.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=h2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==10)break;f.id=i.string();continue;case 2:if(c!==18)break;f.name=i.string();continue;case 3:if(c!==26)break;f.bodyShape=i.string();continue;case 4:if(c!==34)break;f.skinColor=vt.decode(i,i.uint32());continue;case 5:if(c!==42)break;f.hairColor=vt.decode(i,i.uint32());continue;case 6:if(c!==50)break;f.eyeColor=vt.decode(i,i.uint32());continue;case 7:if(c!==58)break;f.expressionTriggerId=i.string();continue;case 8:if(c!==64)break;f.expressionTriggerTimestamp=g2(i.int64());continue;case 9:if(c!==72)break;f.talking=i.bool();continue;case 10:if(c!==82)break;f.wearables.push(i.string());continue;case 11:if(c!==90)break;f.emotes.push(i.string());continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(fo||(fo={}));var y2=(()=>{if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof global<"u")return global;throw"Unable to locate global object"})();function g2(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new y2.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}mi.default.util.Long!==jl.default&&(mi.default.util.Long=jl.default,mi.default.configure());var Vm={COMPONENT_ID:1080,serialize(e,r){let a=fo.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return fo.decode(e.buffer(),e.remainingBytes())},create(){return fo.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBAvatarShape"}};var Ws=be(ze());var Hs;(function(e){e[e.BM_NONE=0]="BM_NONE",e[e.BM_X=1]="BM_X",e[e.BM_Y=2]="BM_Y",e[e.BM_Z=4]="BM_Z",e[e.BM_ALL=7]="BM_ALL"})(Hs||(Hs={}));function x2(){return{billboardMode:void 0}}var lo;(function(e){function r(o,u=Ws.default.Writer.create()){return o.billboardMode!==void 0&&u.uint32(8).int32(o.billboardMode),u}e.encode=r;function a(o,u){let i=o instanceof Ws.default.Reader?o:Ws.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=x2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==8)break;f.billboardMode=i.int32();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(lo||(lo={}));var jm={COMPONENT_ID:1090,serialize(e,r){let a=lo.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return lo.decode(e.buffer(),e.remainingBytes())},create(){return lo.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBBillboard"}};var Vs=be(ze());function _2(){return{mode:0}}var po;(function(e){function r(o,u=Vs.default.Writer.create()){return o.mode!==0&&u.uint32(8).int32(o.mode),u}e.encode=r;function a(o,u){let i=o instanceof Vs.default.Reader?o:Vs.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=_2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==8)break;f.mode=i.int32();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(po||(po={}));var Gm={COMPONENT_ID:1072,serialize(e,r){let a=po.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return po.decode(e.buffer(),e.remainingBytes())},create(){return po.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBCameraMode"}};var js=be(ze());function S2(){return{area:void 0,mode:0}}var mo;(function(e){function r(o,u=js.default.Writer.create()){return o.area!==void 0&&Xe.encode(o.area,u.uint32(10).fork()).ldelim(),o.mode!==0&&u.uint32(16).int32(o.mode),u}e.encode=r;function a(o,u){let i=o instanceof js.default.Reader?o:js.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=S2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==10)break;f.area=Xe.decode(i,i.uint32());continue;case 2:if(c!==16)break;f.mode=i.int32();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(mo||(mo={}));var Ym={COMPONENT_ID:1071,serialize(e,r){let a=mo.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return mo.decode(e.buffer(),e.remainingBytes())},create(){return mo.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBCameraModeArea"}};var Gs=be(ze());function E2(){return{frameNumber:0,totalRuntime:0,tickNumber:0}}var ho;(function(e){function r(o,u=Gs.default.Writer.create()){return o.frameNumber!==0&&u.uint32(8).uint32(o.frameNumber),o.totalRuntime!==0&&u.uint32(21).float(o.totalRuntime),o.tickNumber!==0&&u.uint32(24).uint32(o.tickNumber),u}e.encode=r;function a(o,u){let i=o instanceof Gs.default.Reader?o:Gs.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=E2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==8)break;f.frameNumber=i.uint32();continue;case 2:if(c!==21)break;f.totalRuntime=i.float();continue;case 3:if(c!==24)break;f.tickNumber=i.uint32();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(ho||(ho={}));var qm={COMPONENT_ID:1048,serialize(e,r){let a=ho.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return ho.decode(e.buffer(),e.remainingBytes())},create(){return ho.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBEngineInfo"}};var Ys=be(ze());function T2(){return{src:"",visibleMeshesCollisionMask:void 0,invisibleMeshesCollisionMask:void 0}}var yo;(function(e){function r(o,u=Ys.default.Writer.create()){return o.src!==""&&u.uint32(10).string(o.src),o.visibleMeshesCollisionMask!==void 0&&u.uint32(32).uint32(o.visibleMeshesCollisionMask),o.invisibleMeshesCollisionMask!==void 0&&u.uint32(40).uint32(o.invisibleMeshesCollisionMask),u}e.encode=r;function a(o,u){let i=o instanceof Ys.default.Reader?o:Ys.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=T2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==10)break;f.src=i.string();continue;case 4:if(c!==32)break;f.visibleMeshesCollisionMask=i.uint32();continue;case 5:if(c!==40)break;f.invisibleMeshesCollisionMask=i.uint32();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(yo||(yo={}));var Jm={COMPONENT_ID:1041,serialize(e,r){let a=yo.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return yo.decode(e.buffer(),e.remainingBytes())},create(){return yo.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBGltfContainer"}};var qs=be(ze());function v2(){return{currentState:0}}var go;(function(e){function r(o,u=qs.default.Writer.create()){return o.currentState!==0&&u.uint32(8).int32(o.currentState),u}e.encode=r;function a(o,u){let i=o instanceof qs.default.Reader?o:qs.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=v2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==8)break;f.currentState=i.int32();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(go||(go={}));var Qm={COMPONENT_ID:1049,serialize(e,r){let a=go.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return go.decode(e.buffer(),e.remainingBytes())},create(){return go.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBGltfContainerLoadingState"}};var xr=be(ze());var vn=be(ze());var Gl;(function(e){e[e.TWM_REPEAT=0]="TWM_REPEAT",e[e.TWM_CLAMP=1]="TWM_CLAMP",e[e.TWM_MIRROR=2]="TWM_MIRROR"})(Gl||(Gl={}));var Yl;(function(e){e[e.TFM_POINT=0]="TFM_POINT",e[e.TFM_BILINEAR=1]="TFM_BILINEAR",e[e.TFM_TRILINEAR=2]="TFM_TRILINEAR"})(Yl||(Yl={}));function k2(){return{src:"",wrapMode:void 0,filterMode:void 0}}var du;(function(e){function r(o,u=vn.default.Writer.create()){return o.src!==""&&u.uint32(10).string(o.src),o.wrapMode!==void 0&&u.uint32(16).int32(o.wrapMode),o.filterMode!==void 0&&u.uint32(24).int32(o.filterMode),u}e.encode=r;function a(o,u){let i=o instanceof vn.default.Reader?o:vn.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=k2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==10)break;f.src=i.string();continue;case 2:if(c!==16)break;f.wrapMode=i.int32();continue;case 3:if(c!==24)break;f.filterMode=i.int32();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(du||(du={}));function R2(){return{userId:"",wrapMode:void 0,filterMode:void 0}}var pu;(function(e){function r(o,u=vn.default.Writer.create()){return o.userId!==""&&u.uint32(10).string(o.userId),o.wrapMode!==void 0&&u.uint32(16).int32(o.wrapMode),o.filterMode!==void 0&&u.uint32(24).int32(o.filterMode),u}e.encode=r;function a(o,u){let i=o instanceof vn.default.Reader?o:vn.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=R2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==10)break;f.userId=i.string();continue;case 2:if(c!==16)break;f.wrapMode=i.int32();continue;case 3:if(c!==24)break;f.filterMode=i.int32();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(pu||(pu={}));function w2(){return{videoPlayerEntity:0,wrapMode:void 0,filterMode:void 0}}var mu;(function(e){function r(o,u=vn.default.Writer.create()){return o.videoPlayerEntity!==0&&u.uint32(8).uint32(o.videoPlayerEntity),o.wrapMode!==void 0&&u.uint32(16).int32(o.wrapMode),o.filterMode!==void 0&&u.uint32(24).int32(o.filterMode),u}e.encode=r;function a(o,u){let i=o instanceof vn.default.Reader?o:vn.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=w2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==8)break;f.videoPlayerEntity=i.uint32();continue;case 2:if(c!==16)break;f.wrapMode=i.int32();continue;case 3:if(c!==24)break;f.filterMode=i.int32();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(mu||(mu={}));function b2(){return{tex:void 0}}var Qt;(function(e){function r(o,u=vn.default.Writer.create()){switch(o.tex?.$case){case"texture":du.encode(o.tex.texture,u.uint32(10).fork()).ldelim();break;case"avatarTexture":pu.encode(o.tex.avatarTexture,u.uint32(18).fork()).ldelim();break;case"videoTexture":mu.encode(o.tex.videoTexture,u.uint32(26).fork()).ldelim();break}return u}e.encode=r;function a(o,u){let i=o instanceof vn.default.Reader?o:vn.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=b2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==10)break;f.tex={$case:"texture",texture:du.decode(i,i.uint32())};continue;case 2:if(c!==18)break;f.tex={$case:"avatarTexture",avatarTexture:pu.decode(i,i.uint32())};continue;case 3:if(c!==26)break;f.tex={$case:"videoTexture",videoTexture:mu.decode(i,i.uint32())};continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Qt||(Qt={}));var Js;(function(e){e[e.MTM_OPAQUE=0]="MTM_OPAQUE",e[e.MTM_ALPHA_TEST=1]="MTM_ALPHA_TEST",e[e.MTM_ALPHA_BLEND=2]="MTM_ALPHA_BLEND",e[e.MTM_ALPHA_TEST_AND_ALPHA_BLEND=3]="MTM_ALPHA_TEST_AND_ALPHA_BLEND",e[e.MTM_AUTO=4]="MTM_AUTO"})(Js||(Js={}));function N2(){return{material:void 0}}var xo;(function(e){function r(o,u=xr.default.Writer.create()){switch(o.material?.$case){case"unlit":Ji.encode(o.material.unlit,u.uint32(10).fork()).ldelim();break;case"pbr":Qi.encode(o.material.pbr,u.uint32(18).fork()).ldelim();break}return u}e.encode=r;function a(o,u){let i=o instanceof xr.default.Reader?o:xr.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=N2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==10)break;f.material={$case:"unlit",unlit:Ji.decode(i,i.uint32())};continue;case 2:if(c!==18)break;f.material={$case:"pbr",pbr:Qi.decode(i,i.uint32())};continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(xo||(xo={}));function A2(){return{texture:void 0,alphaTest:void 0,castShadows:void 0,diffuseColor:void 0}}var Ji;(function(e){function r(o,u=xr.default.Writer.create()){return o.texture!==void 0&&Qt.encode(o.texture,u.uint32(10).fork()).ldelim(),o.alphaTest!==void 0&&u.uint32(21).float(o.alphaTest),o.castShadows!==void 0&&u.uint32(24).bool(o.castShadows),o.diffuseColor!==void 0&&_t.encode(o.diffuseColor,u.uint32(34).fork()).ldelim(),u}e.encode=r;function a(o,u){let i=o instanceof xr.default.Reader?o:xr.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=A2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==10)break;f.texture=Qt.decode(i,i.uint32());continue;case 2:if(c!==21)break;f.alphaTest=i.float();continue;case 3:if(c!==24)break;f.castShadows=i.bool();continue;case 4:if(c!==34)break;f.diffuseColor=_t.decode(i,i.uint32());continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Ji||(Ji={}));function I2(){return{texture:void 0,alphaTest:void 0,castShadows:void 0,alphaTexture:void 0,emissiveTexture:void 0,bumpTexture:void 0,albedoColor:void 0,emissiveColor:void 0,reflectivityColor:void 0,transparencyMode:void 0,metallic:void 0,roughness:void 0,glossiness:void 0,specularIntensity:void 0,emissiveIntensity:void 0,directIntensity:void 0}}var Qi;(function(e){function r(o,u=xr.default.Writer.create()){return o.texture!==void 0&&Qt.encode(o.texture,u.uint32(10).fork()).ldelim(),o.alphaTest!==void 0&&u.uint32(21).float(o.alphaTest),o.castShadows!==void 0&&u.uint32(24).bool(o.castShadows),o.alphaTexture!==void 0&&Qt.encode(o.alphaTexture,u.uint32(34).fork()).ldelim(),o.emissiveTexture!==void 0&&Qt.encode(o.emissiveTexture,u.uint32(42).fork()).ldelim(),o.bumpTexture!==void 0&&Qt.encode(o.bumpTexture,u.uint32(50).fork()).ldelim(),o.albedoColor!==void 0&&_t.encode(o.albedoColor,u.uint32(58).fork()).ldelim(),o.emissiveColor!==void 0&&vt.encode(o.emissiveColor,u.uint32(66).fork()).ldelim(),o.reflectivityColor!==void 0&&vt.encode(o.reflectivityColor,u.uint32(74).fork()).ldelim(),o.transparencyMode!==void 0&&u.uint32(80).int32(o.transparencyMode),o.metallic!==void 0&&u.uint32(93).float(o.metallic),o.roughness!==void 0&&u.uint32(101).float(o.roughness),o.glossiness!==void 0&&u.uint32(109).float(o.glossiness),o.specularIntensity!==void 0&&u.uint32(117).float(o.specularIntensity),o.emissiveIntensity!==void 0&&u.uint32(125).float(o.emissiveIntensity),o.directIntensity!==void 0&&u.uint32(133).float(o.directIntensity),u}e.encode=r;function a(o,u){let i=o instanceof xr.default.Reader?o:xr.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=I2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==10)break;f.texture=Qt.decode(i,i.uint32());continue;case 2:if(c!==21)break;f.alphaTest=i.float();continue;case 3:if(c!==24)break;f.castShadows=i.bool();continue;case 4:if(c!==34)break;f.alphaTexture=Qt.decode(i,i.uint32());continue;case 5:if(c!==42)break;f.emissiveTexture=Qt.decode(i,i.uint32());continue;case 6:if(c!==50)break;f.bumpTexture=Qt.decode(i,i.uint32());continue;case 7:if(c!==58)break;f.albedoColor=_t.decode(i,i.uint32());continue;case 8:if(c!==66)break;f.emissiveColor=vt.decode(i,i.uint32());continue;case 9:if(c!==74)break;f.reflectivityColor=vt.decode(i,i.uint32());continue;case 10:if(c!==80)break;f.transparencyMode=i.int32();continue;case 11:if(c!==93)break;f.metallic=i.float();continue;case 12:if(c!==101)break;f.roughness=i.float();continue;case 13:if(c!==109)break;f.glossiness=i.float();continue;case 14:if(c!==117)break;f.specularIntensity=i.float();continue;case 15:if(c!==125)break;f.emissiveIntensity=i.float();continue;case 16:if(c!==133)break;f.directIntensity=i.float();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Qi||(Qi={}));var Zm={COMPONENT_ID:1017,serialize(e,r){let a=xo.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return xo.decode(e.buffer(),e.remainingBytes())},create(){return xo.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBMaterial"}};var nn=be(ze());var Qs;(function(e){e[e.CL_NONE=0]="CL_NONE",e[e.CL_POINTER=1]="CL_POINTER",e[e.CL_PHYSICS=2]="CL_PHYSICS",e[e.CL_RESERVED1=4]="CL_RESERVED1",e[e.CL_RESERVED2=8]="CL_RESERVED2",e[e.CL_RESERVED3=16]="CL_RESERVED3",e[e.CL_RESERVED4=32]="CL_RESERVED4",e[e.CL_RESERVED5=64]="CL_RESERVED5",e[e.CL_RESERVED6=128]="CL_RESERVED6",e[e.CL_CUSTOM1=256]="CL_CUSTOM1",e[e.CL_CUSTOM2=512]="CL_CUSTOM2",e[e.CL_CUSTOM3=1024]="CL_CUSTOM3",e[e.CL_CUSTOM4=2048]="CL_CUSTOM4",e[e.CL_CUSTOM5=4096]="CL_CUSTOM5",e[e.CL_CUSTOM6=8192]="CL_CUSTOM6",e[e.CL_CUSTOM7=16384]="CL_CUSTOM7",e[e.CL_CUSTOM8=32768]="CL_CUSTOM8"})(Qs||(Qs={}));function z2(){return{collisionMask:void 0,mesh:void 0}}var _o;(function(e){function r(o,u=nn.default.Writer.create()){switch(o.collisionMask!==void 0&&u.uint32(8).uint32(o.collisionMask),o.mesh?.$case){case"box":Zi.encode(o.mesh.box,u.uint32(18).fork()).ldelim();break;case"sphere":$i.encode(o.mesh.sphere,u.uint32(26).fork()).ldelim();break;case"cylinder":Xi.encode(o.mesh.cylinder,u.uint32(34).fork()).ldelim();break;case"plane":Ki.encode(o.mesh.plane,u.uint32(42).fork()).ldelim();break}return u}e.encode=r;function a(o,u){let i=o instanceof nn.default.Reader?o:nn.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=z2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==8)break;f.collisionMask=i.uint32();continue;case 2:if(c!==18)break;f.mesh={$case:"box",box:Zi.decode(i,i.uint32())};continue;case 3:if(c!==26)break;f.mesh={$case:"sphere",sphere:$i.decode(i,i.uint32())};continue;case 4:if(c!==34)break;f.mesh={$case:"cylinder",cylinder:Xi.decode(i,i.uint32())};continue;case 5:if(c!==42)break;f.mesh={$case:"plane",plane:Ki.decode(i,i.uint32())};continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(_o||(_o={}));function P2(){return{}}var Zi;(function(e){function r(o,u=nn.default.Writer.create()){return u}e.encode=r;function a(o,u){let i=o instanceof nn.default.Reader?o:nn.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=P2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Zi||(Zi={}));function O2(){return{radiusTop:void 0,radiusBottom:void 0}}var Xi;(function(e){function r(o,u=nn.default.Writer.create()){return o.radiusTop!==void 0&&u.uint32(13).float(o.radiusTop),o.radiusBottom!==void 0&&u.uint32(21).float(o.radiusBottom),u}e.encode=r;function a(o,u){let i=o instanceof nn.default.Reader?o:nn.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=O2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==13)break;f.radiusTop=i.float();continue;case 2:if(c!==21)break;f.radiusBottom=i.float();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Xi||(Xi={}));function C2(){return{}}var Ki;(function(e){function r(o,u=nn.default.Writer.create()){return u}e.encode=r;function a(o,u){let i=o instanceof nn.default.Reader?o:nn.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=C2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Ki||(Ki={}));function U2(){return{}}var $i;(function(e){function r(o,u=nn.default.Writer.create()){return u}e.encode=r;function a(o,u){let i=o instanceof nn.default.Reader?o:nn.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=U2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})($i||($i={}));var Xm={COMPONENT_ID:1019,serialize(e,r){let a=_o.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return _o.decode(e.buffer(),e.remainingBytes())},create(){return _o.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBMeshCollider"}};var rn=be(ze());function B2(){return{mesh:void 0}}var So;(function(e){function r(o,u=rn.default.Writer.create()){switch(o.mesh?.$case){case"box":ea.encode(o.mesh.box,u.uint32(10).fork()).ldelim();break;case"sphere":ra.encode(o.mesh.sphere,u.uint32(18).fork()).ldelim();break;case"cylinder":ta.encode(o.mesh.cylinder,u.uint32(26).fork()).ldelim();break;case"plane":na.encode(o.mesh.plane,u.uint32(34).fork()).ldelim();break}return u}e.encode=r;function a(o,u){let i=o instanceof rn.default.Reader?o:rn.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=B2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==10)break;f.mesh={$case:"box",box:ea.decode(i,i.uint32())};continue;case 2:if(c!==18)break;f.mesh={$case:"sphere",sphere:ra.decode(i,i.uint32())};continue;case 3:if(c!==26)break;f.mesh={$case:"cylinder",cylinder:ta.decode(i,i.uint32())};continue;case 4:if(c!==34)break;f.mesh={$case:"plane",plane:na.decode(i,i.uint32())};continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(So||(So={}));function M2(){return{uvs:[]}}var ea;(function(e){function r(o,u=rn.default.Writer.create()){u.uint32(10).fork();for(let i of o.uvs)u.float(i);return u.ldelim(),u}e.encode=r;function a(o,u){let i=o instanceof rn.default.Reader?o:rn.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=M2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c===13){f.uvs.push(i.float());continue}if(c===10){let y=i.uint32()+i.pos;for(;i.pos<y;)f.uvs.push(i.float());continue}break}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(ea||(ea={}));function F2(){return{radiusTop:void 0,radiusBottom:void 0}}var ta;(function(e){function r(o,u=rn.default.Writer.create()){return o.radiusTop!==void 0&&u.uint32(13).float(o.radiusTop),o.radiusBottom!==void 0&&u.uint32(21).float(o.radiusBottom),u}e.encode=r;function a(o,u){let i=o instanceof rn.default.Reader?o:rn.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=F2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==13)break;f.radiusTop=i.float();continue;case 2:if(c!==21)break;f.radiusBottom=i.float();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(ta||(ta={}));function L2(){return{uvs:[]}}var na;(function(e){function r(o,u=rn.default.Writer.create()){u.uint32(10).fork();for(let i of o.uvs)u.float(i);return u.ldelim(),u}e.encode=r;function a(o,u){let i=o instanceof rn.default.Reader?o:rn.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=L2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c===13){f.uvs.push(i.float());continue}if(c===10){let y=i.uint32()+i.pos;for(;i.pos<y;)f.uvs.push(i.float());continue}break}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(na||(na={}));function D2(){return{}}var ra;(function(e){function r(o,u=rn.default.Writer.create()){return u}e.encode=r;function a(o,u){let i=o instanceof rn.default.Reader?o:rn.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=D2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(ra||(ra={}));var Km={COMPONENT_ID:1018,serialize(e,r){let a=So.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return So.decode(e.buffer(),e.remainingBytes())},create(){return So.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBMeshRenderer"}};var Zs=be(ze());var Xs;(function(e){e[e.NFT_CLASSIC=0]="NFT_CLASSIC",e[e.NFT_BAROQUE_ORNAMENT=1]="NFT_BAROQUE_ORNAMENT",e[e.NFT_DIAMOND_ORNAMENT=2]="NFT_DIAMOND_ORNAMENT",e[e.NFT_MINIMAL_WIDE=3]="NFT_MINIMAL_WIDE",e[e.NFT_MINIMAL_GREY=4]="NFT_MINIMAL_GREY",e[e.NFT_BLOCKY=5]="NFT_BLOCKY",e[e.NFT_GOLD_EDGES=6]="NFT_GOLD_EDGES",e[e.NFT_GOLD_CARVED=7]="NFT_GOLD_CARVED",e[e.NFT_GOLD_WIDE=8]="NFT_GOLD_WIDE",e[e.NFT_GOLD_ROUNDED=9]="NFT_GOLD_ROUNDED",e[e.NFT_METAL_MEDIUM=10]="NFT_METAL_MEDIUM",e[e.NFT_METAL_WIDE=11]="NFT_METAL_WIDE",e[e.NFT_METAL_SLIM=12]="NFT_METAL_SLIM",e[e.NFT_METAL_ROUNDED=13]="NFT_METAL_ROUNDED",e[e.NFT_PINS=14]="NFT_PINS",e[e.NFT_MINIMAL_BLACK=15]="NFT_MINIMAL_BLACK",e[e.NFT_MINIMAL_WHITE=16]="NFT_MINIMAL_WHITE",e[e.NFT_TAPE=17]="NFT_TAPE",e[e.NFT_WOOD_SLIM=18]="NFT_WOOD_SLIM",e[e.NFT_WOOD_WIDE=19]="NFT_WOOD_WIDE",e[e.NFT_WOOD_TWIGS=20]="NFT_WOOD_TWIGS",e[e.NFT_CANVAS=21]="NFT_CANVAS",e[e.NFT_NONE=22]="NFT_NONE"})(Xs||(Xs={}));function W2(){return{urn:"",style:void 0,color:void 0}}var Eo;(function(e){function r(o,u=Zs.default.Writer.create()){return o.urn!==""&&u.uint32(10).string(o.urn),o.style!==void 0&&u.uint32(16).int32(o.style),o.color!==void 0&&vt.encode(o.color,u.uint32(26).fork()).ldelim(),u}e.encode=r;function a(o,u){let i=o instanceof Zs.default.Reader?o:Zs.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=W2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==10)break;f.urn=i.string();continue;case 2:if(c!==16)break;f.style=i.int32();continue;case 3:if(c!==26)break;f.color=vt.decode(i,i.uint32());continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Eo||(Eo={}));var $m={COMPONENT_ID:1040,serialize(e,r){let a=Eo.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return Eo.decode(e.buffer(),e.remainingBytes())},create(){return Eo.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBNftShape"}};var _r=be(ze());function H2(){return{pointerEvents:[]}}var To;(function(e){function r(o,u=_r.default.Writer.create()){for(let i of o.pointerEvents)ia.encode(i,u.uint32(10).fork()).ldelim();return u}e.encode=r;function a(o,u){let i=o instanceof _r.default.Reader?o:_r.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=H2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==10)break;f.pointerEvents.push(ia.decode(i,i.uint32()));continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(To||(To={}));function V2(){return{button:void 0,hoverText:void 0,maxDistance:void 0,showFeedback:void 0}}var oa;(function(e){function r(o,u=_r.default.Writer.create()){return o.button!==void 0&&u.uint32(8).int32(o.button),o.hoverText!==void 0&&u.uint32(18).string(o.hoverText),o.maxDistance!==void 0&&u.uint32(29).float(o.maxDistance),o.showFeedback!==void 0&&u.uint32(32).bool(o.showFeedback),u}e.encode=r;function a(o,u){let i=o instanceof _r.default.Reader?o:_r.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=V2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==8)break;f.button=i.int32();continue;case 2:if(c!==18)break;f.hoverText=i.string();continue;case 3:if(c!==29)break;f.maxDistance=i.float();continue;case 4:if(c!==32)break;f.showFeedback=i.bool();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(oa||(oa={}));function j2(){return{eventType:0,eventInfo:void 0}}var ia;(function(e){function r(o,u=_r.default.Writer.create()){return o.eventType!==0&&u.uint32(8).int32(o.eventType),o.eventInfo!==void 0&&oa.encode(o.eventInfo,u.uint32(18).fork()).ldelim(),u}e.encode=r;function a(o,u){let i=o instanceof _r.default.Reader?o:_r.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=j2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==8)break;f.eventType=i.int32();continue;case 2:if(c!==18)break;f.eventInfo=oa.decode(i,i.uint32());continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(ia||(ia={}));var eh={COMPONENT_ID:1062,serialize(e,r){let a=To.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return To.decode(e.buffer(),e.remainingBytes())},create(){return To.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBPointerEvents"}};var $s=be(ze());var Ks=be(ze());function G2(){return{position:void 0,globalOrigin:void 0,direction:void 0,normalHit:void 0,length:0,meshName:void 0,entityId:void 0}}var Dr;(function(e){function r(o,u=Ks.default.Writer.create()){return o.position!==void 0&&Xe.encode(o.position,u.uint32(10).fork()).ldelim(),o.globalOrigin!==void 0&&Xe.encode(o.globalOrigin,u.uint32(18).fork()).ldelim(),o.direction!==void 0&&Xe.encode(o.direction,u.uint32(26).fork()).ldelim(),o.normalHit!==void 0&&Xe.encode(o.normalHit,u.uint32(34).fork()).ldelim(),o.length!==0&&u.uint32(45).float(o.length),o.meshName!==void 0&&u.uint32(50).string(o.meshName),o.entityId!==void 0&&u.uint32(56).uint32(o.entityId),u}e.encode=r;function a(o,u){let i=o instanceof Ks.default.Reader?o:Ks.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=G2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==10)break;f.position=Xe.decode(i,i.uint32());continue;case 2:if(c!==18)break;f.globalOrigin=Xe.decode(i,i.uint32());continue;case 3:if(c!==26)break;f.direction=Xe.decode(i,i.uint32());continue;case 4:if(c!==34)break;f.normalHit=Xe.decode(i,i.uint32());continue;case 5:if(c!==45)break;f.length=i.float();continue;case 6:if(c!==50)break;f.meshName=i.string();continue;case 7:if(c!==56)break;f.entityId=i.uint32();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Dr||(Dr={}));function Y2(){return{button:0,hit:void 0,state:0,timestamp:0,analog:void 0,tickNumber:0}}var vo;(function(e){function r(o,u=$s.default.Writer.create()){return o.button!==0&&u.uint32(8).int32(o.button),o.hit!==void 0&&Dr.encode(o.hit,u.uint32(18).fork()).ldelim(),o.state!==0&&u.uint32(32).int32(o.state),o.timestamp!==0&&u.uint32(40).uint32(o.timestamp),o.analog!==void 0&&u.uint32(53).float(o.analog),o.tickNumber!==0&&u.uint32(56).uint32(o.tickNumber),u}e.encode=r;function a(o,u){let i=o instanceof $s.default.Reader?o:$s.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=Y2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==8)break;f.button=i.int32();continue;case 2:if(c!==18)break;f.hit=Dr.decode(i,i.uint32());continue;case 4:if(c!==32)break;f.state=i.int32();continue;case 5:if(c!==40)break;f.timestamp=i.uint32();continue;case 6:if(c!==53)break;f.analog=i.float();continue;case 7:if(c!==56)break;f.tickNumber=i.uint32();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(vo||(vo={}));var th={COMPONENT_ID:1063,serialize(e,r){let a=vo.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return vo.decode(e.buffer(),e.remainingBytes())},create(){return vo.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBPointerEventsResult"}};var ec=be(ze());function q2(){return{isPointerLocked:!1}}var ko;(function(e){function r(o,u=ec.default.Writer.create()){return o.isPointerLocked===!0&&u.uint32(8).bool(o.isPointerLocked),u}e.encode=r;function a(o,u){let i=o instanceof ec.default.Reader?o:ec.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=q2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==8)break;f.isPointerLocked=i.bool();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(ko||(ko={}));var nh={COMPONENT_ID:1074,serialize(e,r){let a=ko.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return ko.decode(e.buffer(),e.remainingBytes())},create(){return ko.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBPointerLock"}};var tc=be(ze());var nc;(function(e){e[e.RQT_HIT_FIRST=0]="RQT_HIT_FIRST",e[e.RQT_QUERY_ALL=1]="RQT_QUERY_ALL",e[e.RQT_NONE=2]="RQT_NONE"})(nc||(nc={}));function J2(){return{timestamp:void 0,originOffset:void 0,direction:void 0,maxDistance:0,queryType:0,continuous:void 0,collisionMask:void 0}}var Ro;(function(e){function r(o,u=tc.default.Writer.create()){switch(o.timestamp!==void 0&&u.uint32(8).uint32(o.timestamp),o.originOffset!==void 0&&Xe.encode(o.originOffset,u.uint32(18).fork()).ldelim(),o.direction?.$case){case"localDirection":Xe.encode(o.direction.localDirection,u.uint32(50).fork()).ldelim();break;case"globalDirection":Xe.encode(o.direction.globalDirection,u.uint32(26).fork()).ldelim();break;case"globalTarget":Xe.encode(o.direction.globalTarget,u.uint32(58).fork()).ldelim();break;case"targetEntity":u.uint32(80).uint32(o.direction.targetEntity);break}return o.maxDistance!==0&&u.uint32(37).float(o.maxDistance),o.queryType!==0&&u.uint32(40).int32(o.queryType),o.continuous!==void 0&&u.uint32(64).bool(o.continuous),o.collisionMask!==void 0&&u.uint32(72).uint32(o.collisionMask),u}e.encode=r;function a(o,u){let i=o instanceof tc.default.Reader?o:tc.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=J2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==8)break;f.timestamp=i.uint32();continue;case 2:if(c!==18)break;f.originOffset=Xe.decode(i,i.uint32());continue;case 6:if(c!==50)break;f.direction={$case:"localDirection",localDirection:Xe.decode(i,i.uint32())};continue;case 3:if(c!==26)break;f.direction={$case:"globalDirection",globalDirection:Xe.decode(i,i.uint32())};continue;case 7:if(c!==58)break;f.direction={$case:"globalTarget",globalTarget:Xe.decode(i,i.uint32())};continue;case 10:if(c!==80)break;f.direction={$case:"targetEntity",targetEntity:i.uint32()};continue;case 4:if(c!==37)break;f.maxDistance=i.float();continue;case 5:if(c!==40)break;f.queryType=i.int32();continue;case 8:if(c!==64)break;f.continuous=i.bool();continue;case 9:if(c!==72)break;f.collisionMask=i.uint32();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Ro||(Ro={}));var rh={COMPONENT_ID:1067,serialize(e,r){let a=Ro.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return Ro.decode(e.buffer(),e.remainingBytes())},create(){return Ro.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBRaycast"}};var rc=be(ze());function Q2(){return{timestamp:void 0,globalOrigin:void 0,direction:void 0,hits:[],tickNumber:0}}var wo;(function(e){function r(o,u=rc.default.Writer.create()){o.timestamp!==void 0&&u.uint32(8).uint32(o.timestamp),o.globalOrigin!==void 0&&Xe.encode(o.globalOrigin,u.uint32(18).fork()).ldelim(),o.direction!==void 0&&Xe.encode(o.direction,u.uint32(26).fork()).ldelim();for(let i of o.hits)Dr.encode(i,u.uint32(34).fork()).ldelim();return o.tickNumber!==0&&u.uint32(40).uint32(o.tickNumber),u}e.encode=r;function a(o,u){let i=o instanceof rc.default.Reader?o:rc.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=Q2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==8)break;f.timestamp=i.uint32();continue;case 2:if(c!==18)break;f.globalOrigin=Xe.decode(i,i.uint32());continue;case 3:if(c!==26)break;f.direction=Xe.decode(i,i.uint32());continue;case 4:if(c!==34)break;f.hits.push(Dr.decode(i,i.uint32()));continue;case 5:if(c!==40)break;f.tickNumber=i.uint32();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(wo||(wo={}));var oh={COMPONENT_ID:1068,serialize(e,r){let a=wo.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return wo.decode(e.buffer(),e.remainingBytes())},create(){return wo.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBRaycastResult"}};var oc=be(ze());function Z2(){return{text:"",font:void 0,fontSize:void 0,fontAutoSize:void 0,textAlign:void 0,width:void 0,height:void 0,paddingTop:void 0,paddingRight:void 0,paddingBottom:void 0,paddingLeft:void 0,lineSpacing:void 0,lineCount:void 0,textWrapping:void 0,shadowBlur:void 0,shadowOffsetX:void 0,shadowOffsetY:void 0,outlineWidth:void 0,shadowColor:void 0,outlineColor:void 0,textColor:void 0}}var bo;(function(e){function r(o,u=oc.default.Writer.create()){return o.text!==""&&u.uint32(10).string(o.text),o.font!==void 0&&u.uint32(16).int32(o.font),o.fontSize!==void 0&&u.uint32(29).float(o.fontSize),o.fontAutoSize!==void 0&&u.uint32(32).bool(o.fontAutoSize),o.textAlign!==void 0&&u.uint32(40).int32(o.textAlign),o.width!==void 0&&u.uint32(53).float(o.width),o.height!==void 0&&u.uint32(61).float(o.height),o.paddingTop!==void 0&&u.uint32(69).float(o.paddingTop),o.paddingRight!==void 0&&u.uint32(77).float(o.paddingRight),o.paddingBottom!==void 0&&u.uint32(85).float(o.paddingBottom),o.paddingLeft!==void 0&&u.uint32(93).float(o.paddingLeft),o.lineSpacing!==void 0&&u.uint32(101).float(o.lineSpacing),o.lineCount!==void 0&&u.uint32(104).int32(o.lineCount),o.textWrapping!==void 0&&u.uint32(112).bool(o.textWrapping),o.shadowBlur!==void 0&&u.uint32(125).float(o.shadowBlur),o.shadowOffsetX!==void 0&&u.uint32(133).float(o.shadowOffsetX),o.shadowOffsetY!==void 0&&u.uint32(141).float(o.shadowOffsetY),o.outlineWidth!==void 0&&u.uint32(149).float(o.outlineWidth),o.shadowColor!==void 0&&vt.encode(o.shadowColor,u.uint32(154).fork()).ldelim(),o.outlineColor!==void 0&&vt.encode(o.outlineColor,u.uint32(162).fork()).ldelim(),o.textColor!==void 0&&_t.encode(o.textColor,u.uint32(170).fork()).ldelim(),u}e.encode=r;function a(o,u){let i=o instanceof oc.default.Reader?o:oc.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=Z2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==10)break;f.text=i.string();continue;case 2:if(c!==16)break;f.font=i.int32();continue;case 3:if(c!==29)break;f.fontSize=i.float();continue;case 4:if(c!==32)break;f.fontAutoSize=i.bool();continue;case 5:if(c!==40)break;f.textAlign=i.int32();continue;case 6:if(c!==53)break;f.width=i.float();continue;case 7:if(c!==61)break;f.height=i.float();continue;case 8:if(c!==69)break;f.paddingTop=i.float();continue;case 9:if(c!==77)break;f.paddingRight=i.float();continue;case 10:if(c!==85)break;f.paddingBottom=i.float();continue;case 11:if(c!==93)break;f.paddingLeft=i.float();continue;case 12:if(c!==101)break;f.lineSpacing=i.float();continue;case 13:if(c!==104)break;f.lineCount=i.int32();continue;case 14:if(c!==112)break;f.textWrapping=i.bool();continue;case 15:if(c!==125)break;f.shadowBlur=i.float();continue;case 16:if(c!==133)break;f.shadowOffsetX=i.float();continue;case 17:if(c!==141)break;f.shadowOffsetY=i.float();continue;case 18:if(c!==149)break;f.outlineWidth=i.float();continue;case 19:if(c!==154)break;f.shadowColor=vt.decode(i,i.uint32());continue;case 20:if(c!==162)break;f.outlineColor=vt.decode(i,i.uint32());continue;case 21:if(c!==170)break;f.textColor=_t.decode(i,i.uint32());continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(bo||(bo={}));var ih={COMPONENT_ID:1030,serialize(e,r){let a=bo.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return bo.decode(e.buffer(),e.remainingBytes())},create(){return bo.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBTextShape"}};var ic=be(ze());var hi=be(ze());function X2(){return{top:0,left:0,right:0,bottom:0}}var Wr;(function(e){function r(o,u=hi.default.Writer.create()){return o.top!==0&&u.uint32(13).float(o.top),o.left!==0&&u.uint32(21).float(o.left),o.right!==0&&u.uint32(29).float(o.right),o.bottom!==0&&u.uint32(37).float(o.bottom),u}e.encode=r;function a(o,u){let i=o instanceof hi.default.Reader?o:hi.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=X2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==13)break;f.top=i.float();continue;case 2:if(c!==21)break;f.left=i.float();continue;case 3:if(c!==29)break;f.right=i.float();continue;case 4:if(c!==37)break;f.bottom=i.float();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Wr||(Wr={}));function K2(){return{x:0,y:0,width:0,height:0}}var ql;(function(e){function r(o,u=hi.default.Writer.create()){return o.x!==0&&u.uint32(13).float(o.x),o.y!==0&&u.uint32(21).float(o.y),o.width!==0&&u.uint32(29).float(o.width),o.height!==0&&u.uint32(37).float(o.height),u}e.encode=r;function a(o,u){let i=o instanceof hi.default.Reader?o:hi.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=K2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==13)break;f.x=i.float();continue;case 2:if(c!==21)break;f.y=i.float();continue;case 3:if(c!==29)break;f.width=i.float();continue;case 4:if(c!==37)break;f.height=i.float();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(ql||(ql={}));var ac;(function(e){e[e.NINE_SLICES=0]="NINE_SLICES",e[e.CENTER=1]="CENTER",e[e.STRETCH=2]="STRETCH"})(ac||(ac={}));function $2(){return{color:void 0,texture:void 0,textureMode:0,textureSlices:void 0,uvs:[]}}var No;(function(e){function r(o,u=ic.default.Writer.create()){o.color!==void 0&&_t.encode(o.color,u.uint32(10).fork()).ldelim(),o.texture!==void 0&&Qt.encode(o.texture,u.uint32(18).fork()).ldelim(),o.textureMode!==0&&u.uint32(24).int32(o.textureMode),o.textureSlices!==void 0&&Wr.encode(o.textureSlices,u.uint32(34).fork()).ldelim(),u.uint32(42).fork();for(let i of o.uvs)u.float(i);return u.ldelim(),u}e.encode=r;function a(o,u){let i=o instanceof ic.default.Reader?o:ic.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=$2();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==10)break;f.color=_t.decode(i,i.uint32());continue;case 2:if(c!==18)break;f.texture=Qt.decode(i,i.uint32());continue;case 3:if(c!==24)break;f.textureMode=i.int32();continue;case 4:if(c!==34)break;f.textureSlices=Wr.decode(i,i.uint32());continue;case 5:if(c===45){f.uvs.push(i.float());continue}if(c===42){let y=i.uint32()+i.pos;for(;i.pos<y;)f.uvs.push(i.float());continue}break}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(No||(No={}));var ah={COMPONENT_ID:1053,serialize(e,r){let a=No.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return No.decode(e.buffer(),e.remainingBytes())},create(){return No.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBUiBackground"}};var uc=be(ze());function e3(){return{devicePixelRatio:0,width:0,height:0,interactableArea:void 0}}var Ao;(function(e){function r(o,u=uc.default.Writer.create()){return o.devicePixelRatio!==0&&u.uint32(13).float(o.devicePixelRatio),o.width!==0&&u.uint32(16).int32(o.width),o.height!==0&&u.uint32(24).int32(o.height),o.interactableArea!==void 0&&Wr.encode(o.interactableArea,u.uint32(34).fork()).ldelim(),u}e.encode=r;function a(o,u){let i=o instanceof uc.default.Reader?o:uc.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=e3();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==13)break;f.devicePixelRatio=i.float();continue;case 2:if(c!==16)break;f.width=i.int32();continue;case 3:if(c!==24)break;f.height=i.int32();continue;case 4:if(c!==34)break;f.interactableArea=Wr.decode(i,i.uint32());continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Ao||(Ao={}));var uh={COMPONENT_ID:1054,serialize(e,r){let a=Ao.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return Ao.decode(e.buffer(),e.remainingBytes())},create(){return Ao.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBUiCanvasInformation"}};var sc=be(ze());function t3(){return{acceptEmpty:!1,emptyLabel:void 0,options:[],selectedIndex:void 0,disabled:!1,color:void 0,textAlign:void 0,font:void 0,fontSize:void 0}}var Io;(function(e){function r(o,u=sc.default.Writer.create()){o.acceptEmpty===!0&&u.uint32(8).bool(o.acceptEmpty),o.emptyLabel!==void 0&&u.uint32(18).string(o.emptyLabel);for(let i of o.options)u.uint32(26).string(i);return o.selectedIndex!==void 0&&u.uint32(32).int32(o.selectedIndex),o.disabled===!0&&u.uint32(40).bool(o.disabled),o.color!==void 0&&_t.encode(o.color,u.uint32(50).fork()).ldelim(),o.textAlign!==void 0&&u.uint32(80).int32(o.textAlign),o.font!==void 0&&u.uint32(88).int32(o.font),o.fontSize!==void 0&&u.uint32(96).int32(o.fontSize),u}e.encode=r;function a(o,u){let i=o instanceof sc.default.Reader?o:sc.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=t3();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==8)break;f.acceptEmpty=i.bool();continue;case 2:if(c!==18)break;f.emptyLabel=i.string();continue;case 3:if(c!==26)break;f.options.push(i.string());continue;case 4:if(c!==32)break;f.selectedIndex=i.int32();continue;case 5:if(c!==40)break;f.disabled=i.bool();continue;case 6:if(c!==50)break;f.color=_t.decode(i,i.uint32());continue;case 10:if(c!==80)break;f.textAlign=i.int32();continue;case 11:if(c!==88)break;f.font=i.int32();continue;case 12:if(c!==96)break;f.fontSize=i.int32();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Io||(Io={}));var sh={COMPONENT_ID:1094,serialize(e,r){let a=Io.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return Io.decode(e.buffer(),e.remainingBytes())},create(){return Io.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBUiDropdown"}};var cc=be(ze());function n3(){return{value:0}}var zo;(function(e){function r(o,u=cc.default.Writer.create()){return o.value!==0&&u.uint32(8).int32(o.value),u}e.encode=r;function a(o,u){let i=o instanceof cc.default.Reader?o:cc.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=n3();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==8)break;f.value=i.int32();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(zo||(zo={}));var ch={COMPONENT_ID:1096,serialize(e,r){let a=zo.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return zo.decode(e.buffer(),e.remainingBytes())},create(){return zo.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBUiDropdownResult"}};var fc=be(ze());function r3(){return{placeholder:"",color:void 0,placeholderColor:void 0,disabled:!1,textAlign:void 0,font:void 0,fontSize:void 0,value:void 0}}var Po;(function(e){function r(o,u=fc.default.Writer.create()){return o.placeholder!==""&&u.uint32(10).string(o.placeholder),o.color!==void 0&&_t.encode(o.color,u.uint32(18).fork()).ldelim(),o.placeholderColor!==void 0&&_t.encode(o.placeholderColor,u.uint32(26).fork()).ldelim(),o.disabled===!0&&u.uint32(32).bool(o.disabled),o.textAlign!==void 0&&u.uint32(80).int32(o.textAlign),o.font!==void 0&&u.uint32(88).int32(o.font),o.fontSize!==void 0&&u.uint32(96).int32(o.fontSize),o.value!==void 0&&u.uint32(106).string(o.value),u}e.encode=r;function a(o,u){let i=o instanceof fc.default.Reader?o:fc.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=r3();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==10)break;f.placeholder=i.string();continue;case 2:if(c!==18)break;f.color=_t.decode(i,i.uint32());continue;case 3:if(c!==26)break;f.placeholderColor=_t.decode(i,i.uint32());continue;case 4:if(c!==32)break;f.disabled=i.bool();continue;case 10:if(c!==80)break;f.textAlign=i.int32();continue;case 11:if(c!==88)break;f.font=i.int32();continue;case 12:if(c!==96)break;f.fontSize=i.int32();continue;case 13:if(c!==106)break;f.value=i.string();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Po||(Po={}));var fh={COMPONENT_ID:1093,serialize(e,r){let a=Po.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return Po.decode(e.buffer(),e.remainingBytes())},create(){return Po.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBUiInput"}};var lc=be(ze());function o3(){return{value:""}}var Oo;(function(e){function r(o,u=lc.default.Writer.create()){return o.value!==""&&u.uint32(10).string(o.value),u}e.encode=r;function a(o,u){let i=o instanceof lc.default.Reader?o:lc.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=o3();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==10)break;f.value=i.string();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Oo||(Oo={}));var lh={COMPONENT_ID:1095,serialize(e,r){let a=Oo.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return Oo.decode(e.buffer(),e.remainingBytes())},create(){return Oo.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBUiInputResult"}};var dc=be(ze());function i3(){return{value:"",color:void 0,textAlign:void 0,font:void 0,fontSize:void 0}}var Co;(function(e){function r(o,u=dc.default.Writer.create()){return o.value!==""&&u.uint32(10).string(o.value),o.color!==void 0&&_t.encode(o.color,u.uint32(18).fork()).ldelim(),o.textAlign!==void 0&&u.uint32(24).int32(o.textAlign),o.font!==void 0&&u.uint32(32).int32(o.font),o.fontSize!==void 0&&u.uint32(40).int32(o.fontSize),u}e.encode=r;function a(o,u){let i=o instanceof dc.default.Reader?o:dc.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=i3();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==10)break;f.value=i.string();continue;case 2:if(c!==18)break;f.color=_t.decode(i,i.uint32());continue;case 3:if(c!==24)break;f.textAlign=i.int32();continue;case 4:if(c!==32)break;f.font=i.int32();continue;case 5:if(c!==40)break;f.fontSize=i.int32();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Co||(Co={}));var dh={COMPONENT_ID:1052,serialize(e,r){let a=Co.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return Co.decode(e.buffer(),e.remainingBytes())},create(){return Co.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBUiText"}};var pc=be(ze());var mc;(function(e){e[e.YGPT_RELATIVE=0]="YGPT_RELATIVE",e[e.YGPT_ABSOLUTE=1]="YGPT_ABSOLUTE"})(mc||(mc={}));var hc;(function(e){e[e.YGA_AUTO=0]="YGA_AUTO",e[e.YGA_FLEX_START=1]="YGA_FLEX_START",e[e.YGA_CENTER=2]="YGA_CENTER",e[e.YGA_FLEX_END=3]="YGA_FLEX_END",e[e.YGA_STRETCH=4]="YGA_STRETCH",e[e.YGA_BASELINE=5]="YGA_BASELINE",e[e.YGA_SPACE_BETWEEN=6]="YGA_SPACE_BETWEEN",e[e.YGA_SPACE_AROUND=7]="YGA_SPACE_AROUND"})(hc||(hc={}));var yc;(function(e){e[e.YGU_UNDEFINED=0]="YGU_UNDEFINED",e[e.YGU_POINT=1]="YGU_POINT",e[e.YGU_PERCENT=2]="YGU_PERCENT",e[e.YGU_AUTO=3]="YGU_AUTO"})(yc||(yc={}));var gc;(function(e){e[e.YGFD_ROW=0]="YGFD_ROW",e[e.YGFD_COLUMN=1]="YGFD_COLUMN",e[e.YGFD_COLUMN_REVERSE=2]="YGFD_COLUMN_REVERSE",e[e.YGFD_ROW_REVERSE=3]="YGFD_ROW_REVERSE"})(gc||(gc={}));var xc;(function(e){e[e.YGW_NO_WRAP=0]="YGW_NO_WRAP",e[e.YGW_WRAP=1]="YGW_WRAP",e[e.YGW_WRAP_REVERSE=2]="YGW_WRAP_REVERSE"})(xc||(xc={}));var _c;(function(e){e[e.YGJ_FLEX_START=0]="YGJ_FLEX_START",e[e.YGJ_CENTER=1]="YGJ_CENTER",e[e.YGJ_FLEX_END=2]="YGJ_FLEX_END",e[e.YGJ_SPACE_BETWEEN=3]="YGJ_SPACE_BETWEEN",e[e.YGJ_SPACE_AROUND=4]="YGJ_SPACE_AROUND",e[e.YGJ_SPACE_EVENLY=5]="YGJ_SPACE_EVENLY"})(_c||(_c={}));var Sc;(function(e){e[e.YGO_VISIBLE=0]="YGO_VISIBLE",e[e.YGO_HIDDEN=1]="YGO_HIDDEN",e[e.YGO_SCROLL=2]="YGO_SCROLL"})(Sc||(Sc={}));var Ec;(function(e){e[e.YGD_FLEX=0]="YGD_FLEX",e[e.YGD_NONE=1]="YGD_NONE"})(Ec||(Ec={}));var Tc;(function(e){e[e.YGE_LEFT=0]="YGE_LEFT",e[e.YGE_TOP=1]="YGE_TOP",e[e.YGE_RIGHT=2]="YGE_RIGHT",e[e.YGE_BOTTOM=3]="YGE_BOTTOM",e[e.YGE_START=4]="YGE_START",e[e.YGE_END=5]="YGE_END",e[e.YGE_HORIZONTAL=6]="YGE_HORIZONTAL",e[e.YGE_VERTICAL=7]="YGE_VERTICAL",e[e.YGE_ALL=8]="YGE_ALL"})(Tc||(Tc={}));function a3(){return{parent:0,rightOf:0,alignContent:void 0,alignItems:void 0,flexWrap:void 0,flexShrink:void 0,positionType:0,alignSelf:0,flexDirection:0,justifyContent:0,overflow:0,display:0,flexBasisUnit:0,flexBasis:0,flexGrow:0,widthUnit:0,width:0,heightUnit:0,height:0,minWidthUnit:0,minWidth:0,minHeightUnit:0,minHeight:0,maxWidthUnit:0,maxWidth:0,maxHeightUnit:0,maxHeight:0,positionLeftUnit:0,positionLeft:0,positionTopUnit:0,positionTop:0,positionRightUnit:0,positionRight:0,positionBottomUnit:0,positionBottom:0,marginLeftUnit:0,marginLeft:0,marginTopUnit:0,marginTop:0,marginRightUnit:0,marginRight:0,marginBottomUnit:0,marginBottom:0,paddingLeftUnit:0,paddingLeft:0,paddingTopUnit:0,paddingTop:0,paddingRightUnit:0,paddingRight:0,paddingBottomUnit:0,paddingBottom:0}}var Uo;(function(e){function r(o,u=pc.default.Writer.create()){return o.parent!==0&&u.uint32(8).int32(o.parent),o.rightOf!==0&&u.uint32(16).int32(o.rightOf),o.alignContent!==void 0&&u.uint32(24).int32(o.alignContent),o.alignItems!==void 0&&u.uint32(32).int32(o.alignItems),o.flexWrap!==void 0&&u.uint32(40).int32(o.flexWrap),o.flexShrink!==void 0&&u.uint32(53).float(o.flexShrink),o.positionType!==0&&u.uint32(56).int32(o.positionType),o.alignSelf!==0&&u.uint32(64).int32(o.alignSelf),o.flexDirection!==0&&u.uint32(72).int32(o.flexDirection),o.justifyContent!==0&&u.uint32(80).int32(o.justifyContent),o.overflow!==0&&u.uint32(88).int32(o.overflow),o.display!==0&&u.uint32(96).int32(o.display),o.flexBasisUnit!==0&&u.uint32(104).int32(o.flexBasisUnit),o.flexBasis!==0&&u.uint32(117).float(o.flexBasis),o.flexGrow!==0&&u.uint32(125).float(o.flexGrow),o.widthUnit!==0&&u.uint32(128).int32(o.widthUnit),o.width!==0&&u.uint32(141).float(o.width),o.heightUnit!==0&&u.uint32(144).int32(o.heightUnit),o.height!==0&&u.uint32(157).float(o.height),o.minWidthUnit!==0&&u.uint32(160).int32(o.minWidthUnit),o.minWidth!==0&&u.uint32(173).float(o.minWidth),o.minHeightUnit!==0&&u.uint32(176).int32(o.minHeightUnit),o.minHeight!==0&&u.uint32(189).float(o.minHeight),o.maxWidthUnit!==0&&u.uint32(192).int32(o.maxWidthUnit),o.maxWidth!==0&&u.uint32(205).float(o.maxWidth),o.maxHeightUnit!==0&&u.uint32(208).int32(o.maxHeightUnit),o.maxHeight!==0&&u.uint32(221).float(o.maxHeight),o.positionLeftUnit!==0&&u.uint32(224).int32(o.positionLeftUnit),o.positionLeft!==0&&u.uint32(237).float(o.positionLeft),o.positionTopUnit!==0&&u.uint32(240).int32(o.positionTopUnit),o.positionTop!==0&&u.uint32(253).float(o.positionTop),o.positionRightUnit!==0&&u.uint32(256).int32(o.positionRightUnit),o.positionRight!==0&&u.uint32(269).float(o.positionRight),o.positionBottomUnit!==0&&u.uint32(272).int32(o.positionBottomUnit),o.positionBottom!==0&&u.uint32(285).float(o.positionBottom),o.marginLeftUnit!==0&&u.uint32(288).int32(o.marginLeftUnit),o.marginLeft!==0&&u.uint32(301).float(o.marginLeft),o.marginTopUnit!==0&&u.uint32(304).int32(o.marginTopUnit),o.marginTop!==0&&u.uint32(317).float(o.marginTop),o.marginRightUnit!==0&&u.uint32(320).int32(o.marginRightUnit),o.marginRight!==0&&u.uint32(333).float(o.marginRight),o.marginBottomUnit!==0&&u.uint32(336).int32(o.marginBottomUnit),o.marginBottom!==0&&u.uint32(349).float(o.marginBottom),o.paddingLeftUnit!==0&&u.uint32(352).int32(o.paddingLeftUnit),o.paddingLeft!==0&&u.uint32(365).float(o.paddingLeft),o.paddingTopUnit!==0&&u.uint32(368).int32(o.paddingTopUnit),o.paddingTop!==0&&u.uint32(381).float(o.paddingTop),o.paddingRightUnit!==0&&u.uint32(384).int32(o.paddingRightUnit),o.paddingRight!==0&&u.uint32(397).float(o.paddingRight),o.paddingBottomUnit!==0&&u.uint32(400).int32(o.paddingBottomUnit),o.paddingBottom!==0&&u.uint32(413).float(o.paddingBottom),u}e.encode=r;function a(o,u){let i=o instanceof pc.default.Reader?o:pc.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=a3();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==8)break;f.parent=i.int32();continue;case 2:if(c!==16)break;f.rightOf=i.int32();continue;case 3:if(c!==24)break;f.alignContent=i.int32();continue;case 4:if(c!==32)break;f.alignItems=i.int32();continue;case 5:if(c!==40)break;f.flexWrap=i.int32();continue;case 6:if(c!==53)break;f.flexShrink=i.float();continue;case 7:if(c!==56)break;f.positionType=i.int32();continue;case 8:if(c!==64)break;f.alignSelf=i.int32();continue;case 9:if(c!==72)break;f.flexDirection=i.int32();continue;case 10:if(c!==80)break;f.justifyContent=i.int32();continue;case 11:if(c!==88)break;f.overflow=i.int32();continue;case 12:if(c!==96)break;f.display=i.int32();continue;case 13:if(c!==104)break;f.flexBasisUnit=i.int32();continue;case 14:if(c!==117)break;f.flexBasis=i.float();continue;case 15:if(c!==125)break;f.flexGrow=i.float();continue;case 16:if(c!==128)break;f.widthUnit=i.int32();continue;case 17:if(c!==141)break;f.width=i.float();continue;case 18:if(c!==144)break;f.heightUnit=i.int32();continue;case 19:if(c!==157)break;f.height=i.float();continue;case 20:if(c!==160)break;f.minWidthUnit=i.int32();continue;case 21:if(c!==173)break;f.minWidth=i.float();continue;case 22:if(c!==176)break;f.minHeightUnit=i.int32();continue;case 23:if(c!==189)break;f.minHeight=i.float();continue;case 24:if(c!==192)break;f.maxWidthUnit=i.int32();continue;case 25:if(c!==205)break;f.maxWidth=i.float();continue;case 26:if(c!==208)break;f.maxHeightUnit=i.int32();continue;case 27:if(c!==221)break;f.maxHeight=i.float();continue;case 28:if(c!==224)break;f.positionLeftUnit=i.int32();continue;case 29:if(c!==237)break;f.positionLeft=i.float();continue;case 30:if(c!==240)break;f.positionTopUnit=i.int32();continue;case 31:if(c!==253)break;f.positionTop=i.float();continue;case 32:if(c!==256)break;f.positionRightUnit=i.int32();continue;case 33:if(c!==269)break;f.positionRight=i.float();continue;case 34:if(c!==272)break;f.positionBottomUnit=i.int32();continue;case 35:if(c!==285)break;f.positionBottom=i.float();continue;case 36:if(c!==288)break;f.marginLeftUnit=i.int32();continue;case 37:if(c!==301)break;f.marginLeft=i.float();continue;case 38:if(c!==304)break;f.marginTopUnit=i.int32();continue;case 39:if(c!==317)break;f.marginTop=i.float();continue;case 40:if(c!==320)break;f.marginRightUnit=i.int32();continue;case 41:if(c!==333)break;f.marginRight=i.float();continue;case 42:if(c!==336)break;f.marginBottomUnit=i.int32();continue;case 43:if(c!==349)break;f.marginBottom=i.float();continue;case 44:if(c!==352)break;f.paddingLeftUnit=i.int32();continue;case 45:if(c!==365)break;f.paddingLeft=i.float();continue;case 46:if(c!==368)break;f.paddingTopUnit=i.int32();continue;case 47:if(c!==381)break;f.paddingTop=i.float();continue;case 48:if(c!==384)break;f.paddingRightUnit=i.int32();continue;case 49:if(c!==397)break;f.paddingRight=i.float();continue;case 50:if(c!==400)break;f.paddingBottomUnit=i.int32();continue;case 51:if(c!==413)break;f.paddingBottom=i.float();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Uo||(Uo={}));var ph={COMPONENT_ID:1050,serialize(e,r){let a=Uo.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return Uo.decode(e.buffer(),e.remainingBytes())},create(){return Uo.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBUiTransform"}};var vc=be(ze());var kc;(function(e){e[e.VS_NONE=0]="VS_NONE",e[e.VS_ERROR=1]="VS_ERROR",e[e.VS_LOADING=2]="VS_LOADING",e[e.VS_READY=3]="VS_READY",e[e.VS_PLAYING=4]="VS_PLAYING",e[e.VS_BUFFERING=5]="VS_BUFFERING",e[e.VS_SEEKING=6]="VS_SEEKING",e[e.VS_PAUSED=7]="VS_PAUSED"})(kc||(kc={}));function u3(){return{timestamp:0,tickNumber:0,currentOffset:0,videoLength:0,state:0}}var Bo;(function(e){function r(o,u=vc.default.Writer.create()){return o.timestamp!==0&&u.uint32(8).uint32(o.timestamp),o.tickNumber!==0&&u.uint32(16).uint32(o.tickNumber),o.currentOffset!==0&&u.uint32(29).float(o.currentOffset),o.videoLength!==0&&u.uint32(37).float(o.videoLength),o.state!==0&&u.uint32(40).int32(o.state),u}e.encode=r;function a(o,u){let i=o instanceof vc.default.Reader?o:vc.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=u3();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==8)break;f.timestamp=i.uint32();continue;case 2:if(c!==16)break;f.tickNumber=i.uint32();continue;case 3:if(c!==29)break;f.currentOffset=i.float();continue;case 4:if(c!==37)break;f.videoLength=i.float();continue;case 5:if(c!==40)break;f.state=i.int32();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Bo||(Bo={}));var mh={COMPONENT_ID:1044,serialize(e,r){let a=Bo.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return Bo.decode(e.buffer(),e.remainingBytes())},create(){return Bo.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBVideoEvent"}};var Rc=be(ze());function s3(){return{src:"",playing:void 0,position:void 0,volume:void 0,playbackRate:void 0,loop:void 0}}var Mo;(function(e){function r(o,u=Rc.default.Writer.create()){return o.src!==""&&u.uint32(10).string(o.src),o.playing!==void 0&&u.uint32(16).bool(o.playing),o.position!==void 0&&u.uint32(29).float(o.position),o.volume!==void 0&&u.uint32(37).float(o.volume),o.playbackRate!==void 0&&u.uint32(45).float(o.playbackRate),o.loop!==void 0&&u.uint32(48).bool(o.loop),u}e.encode=r;function a(o,u){let i=o instanceof Rc.default.Reader?o:Rc.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=s3();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==10)break;f.src=i.string();continue;case 2:if(c!==16)break;f.playing=i.bool();continue;case 3:if(c!==29)break;f.position=i.float();continue;case 4:if(c!==37)break;f.volume=i.float();continue;case 5:if(c!==45)break;f.playbackRate=i.float();continue;case 6:if(c!==48)break;f.loop=i.bool();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Mo||(Mo={}));var hh={COMPONENT_ID:1043,serialize(e,r){let a=Mo.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return Mo.decode(e.buffer(),e.remainingBytes())},create(){return Mo.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBVideoPlayer"}};var wc=be(ze());function c3(){return{visible:void 0}}var Fo;(function(e){function r(o,u=wc.default.Writer.create()){return o.visible!==void 0&&u.uint32(8).bool(o.visible),u}e.encode=r;function a(o,u){let i=o instanceof wc.default.Reader?o:wc.default.Reader.create(o),p=u===void 0?i.len:i.pos+u,f=c3();for(;i.pos<p;){let c=i.uint32();switch(c>>>3){case 1:if(c!==8)break;f.visible=i.bool();continue}if((c&7)===4||c===0)break;i.skipType(c&7)}return f}e.decode=a})(Fo||(Fo={}));var yh={COMPONENT_ID:1081,serialize(e,r){let a=Fo.encode(e),o=new Uint8Array(a.finish(),0,a.len);r.writeBuffer(o,!1)},deserialize(e){return Fo.decode(e.buffer(),e.remainingBytes())},create(){return Fo.decode(new Uint8Array)},jsonSchema:{type:"object",properties:{},serializationType:"protocol-buffer",protocolBuffer:"PBVisibilityComponent"}};var Jl=e=>e.defineComponentFromSchema("core::Animator",km),bc=e=>e.defineComponentFromSchema("core::AudioSource",Rm),Nc=e=>e.defineComponentFromSchema("core::AudioStream",wm),Ac=e=>e.defineComponentFromSchema("core::AvatarAttach",bm),Ic=e=>e.defineComponentFromSchema("core::AvatarModifierArea",zm),zc=e=>e.defineComponentFromSchema("core::AvatarShape",Vm),Pc=e=>e.defineComponentFromSchema("core::Billboard",jm),Oc=e=>e.defineComponentFromSchema("core::CameraMode",Gm),Cc=e=>e.defineComponentFromSchema("core::CameraModeArea",Ym),Uc=e=>e.defineComponentFromSchema("core::EngineInfo",qm),Bc=e=>e.defineComponentFromSchema("core::GltfContainer",Jm),Mc=e=>e.defineComponentFromSchema("core::GltfContainerLoadingState",Qm),Ql=e=>e.defineComponentFromSchema("core::Material",Zm),Zl=e=>e.defineComponentFromSchema("core::MeshCollider",Xm),Xl=e=>e.defineComponentFromSchema("core::MeshRenderer",Km),Fc=e=>e.defineComponentFromSchema("core::NftShape",$m),aa=e=>e.defineComponentFromSchema("core::PointerEvents",eh),ua=e=>e.defineValueSetComponentFromSchema("core::PointerEventsResult",th,{timestampFunction:r=>r.timestamp,maxElements:100}),Lc=e=>e.defineComponentFromSchema("core::PointerLock",nh),sa=e=>e.defineComponentFromSchema("core::Raycast",rh),ca=e=>e.defineComponentFromSchema("core::RaycastResult",oh),Dc=e=>e.defineComponentFromSchema("core::TextShape",ih),fa=e=>e.defineComponentFromSchema("core::UiBackground",ah),Wc=e=>e.defineComponentFromSchema("core::UiCanvasInformation",uh),la=e=>e.defineComponentFromSchema("core::UiDropdown",sh),da=e=>e.defineComponentFromSchema("core::UiDropdownResult",ch),pa=e=>e.defineComponentFromSchema("core::UiInput",fh),ma=e=>e.defineComponentFromSchema("core::UiInputResult",lh),ha=e=>e.defineComponentFromSchema("core::UiText",dh),ya=e=>e.defineComponentFromSchema("core::UiTransform",ph),ga=e=>e.defineValueSetComponentFromSchema("core::VideoEvent",mh,{timestampFunction:r=>r.timestamp,maxElements:100}),xa=e=>e.defineComponentFromSchema("core::VideoPlayer",hh),Hc=e=>e.defineComponentFromSchema("core::VisibilityComponent",yh),hu={"core::Animator":Jl,"core::AudioSource":bc,"core::AudioStream":Nc,"core::AvatarAttach":Ac,"core::AvatarModifierArea":Ic,"core::AvatarShape":zc,"core::Billboard":Pc,"core::CameraMode":Oc,"core::CameraModeArea":Cc,"core::EngineInfo":Uc,"core::GltfContainer":Bc,"core::GltfContainerLoadingState":Mc,"core::Material":Ql,"core::MeshCollider":Zl,"core::MeshRenderer":Xl,"core::NftShape":Fc,"core::PointerEvents":aa,"core::PointerEventsResult":ua,"core::PointerLock":Lc,"core::Raycast":sa,"core::RaycastResult":ca,"core::TextShape":Dc,"core::UiBackground":fa,"core::UiCanvasInformation":Wc,"core::UiDropdown":la,"core::UiDropdownResult":da,"core::UiInput":pa,"core::UiInputResult":ma,"core::UiText":ha,"core::UiTransform":ya,"core::VideoEvent":ga,"core::VideoPlayer":xa,"core::VisibilityComponent":Hc};function gh(e){let r=Jl(e);function a(o,u){let i=r.getMutableOrNull(o);if(!i)return[null,null];let p=i.states.find(f=>f.name===u||f.clip===u);return p?[i,p]:[i,null]}return{...r,getClipOrNull(o,u){let[i,p]=a(o,u);return p},getClip(o,u){let[i,p]=a(o,u);if(!i)throw new Error(`There is no Animator found in the entity ${o}`);if(!p)throw new Error(`The Animator component of ${o} has no the state ${u}`);return p},playSingleAnimation(o,u,i=!0){let[p,f]=a(o,u);if(!p||!f)return!1;for(let c of p.states)c.playing=!1,c.shouldReset=!0;return f.playing=!0,f.shouldReset=i,!0},stopAllAnimations(o,u=!0){let i=r.getMutableOrNull(o);if(!i)return!1;for(let p of i.states)p.playing=!1,p.shouldReset=u;return!0}}}var l3={Common(e){return{tex:{$case:"texture",texture:e}}},Avatar(e){return{tex:{$case:"avatarTexture",avatarTexture:e}}},Video(e){return{tex:{$case:"videoTexture",videoTexture:e}}}};function xh(e){let r=Ql(e);return{...r,Texture:l3,setBasicMaterial(a,o){r.createOrReplace(a,{material:{$case:"unlit",unlit:o}})},setPbrMaterial(a,o){r.createOrReplace(a,{material:{$case:"pbr",pbr:o}})}}}function _h(e){let r=Zl(e);function a(o){if(Array.isArray(o))return o.map(u=>u).reduce((u,i)=>u|i,0);if(o)return o}return{...r,setBox(o,u){r.createOrReplace(o,{mesh:{$case:"box",box:{}},collisionMask:a(u)})},setPlane(o,u){r.createOrReplace(o,{mesh:{$case:"plane",plane:{}},collisionMask:a(u)})},setCylinder(o,u,i,p){r.createOrReplace(o,{mesh:{$case:"cylinder",cylinder:{radiusBottom:u,radiusTop:i}},collisionMask:a(p)})},setSphere(o,u){r.createOrReplace(o,{mesh:{$case:"sphere",sphere:{}},collisionMask:a(u)})}}}function Sh(e){let r=Xl(e);return{...r,setBox(a,o){r.createOrReplace(a,{mesh:{$case:"box",box:{uvs:o||[]}}})},setPlane(a,o){r.createOrReplace(a,{mesh:{$case:"plane",plane:{uvs:o||[]}}})},setCylinder(a,o,u){r.createOrReplace(a,{mesh:{$case:"cylinder",cylinder:{radiusBottom:o,radiusTop:u}}})},setSphere(a){r.createOrReplace(a,{mesh:{$case:"sphere",sphere:{}}})}}}var Kl={serialize(e,r){let a=r.incrementWriteOffset(44);r.setFloat32(a,e.position.x),r.setFloat32(a+4,e.position.y),r.setFloat32(a+8,e.position.z),r.setFloat32(a+12,e.rotation.x),r.setFloat32(a+16,e.rotation.y),r.setFloat32(a+20,e.rotation.z),r.setFloat32(a+24,e.rotation.w),r.setFloat32(a+28,e.scale.x),r.setFloat32(a+32,e.scale.y),r.setFloat32(a+36,e.scale.z),r.setUint32(a+40,e.parent||0)},deserialize(e){let r=e.incrementReadOffset(44);return{position:{x:e.getFloat32(r),y:e.getFloat32(r+4),z:e.getFloat32(r+8)},rotation:{x:e.getFloat32(r+12),y:e.getFloat32(r+16),z:e.getFloat32(r+20),w:e.getFloat32(r+24)},scale:{x:e.getFloat32(r+28),y:e.getFloat32(r+32),z:e.getFloat32(r+36)},parent:e.getUint32(r+40)}},create(){return{position:{x:0,y:0,z:0},scale:{x:1,y:1,z:1},rotation:{x:0,y:0,z:0,w:1},parent:0}},extend(e){return{position:{x:0,y:0,z:0},scale:{x:1,y:1,z:1},rotation:{x:0,y:0,z:0,w:1},parent:0,...e}},jsonSchema:{type:"object",properties:{position:{type:"object",properties:{x:{type:"number"},y:{type:"number"},z:{type:"number"}}},scale:{type:"object",properties:{x:{type:"number"},y:{type:"number"},z:{type:"number"}}},rotation:{type:"object",properties:{x:{type:"number"},y:{type:"number"},z:{type:"number"},w:{type:"number"}}},parent:{type:"integer"}},serializationType:"transform"}};function Eh(e){let r=e.defineComponentFromSchema("core::Transform",Kl);return{...r,create(a,o){return r.create(a,Kl.extend(o))},createOrReplace(a,o){return r.createOrReplace(a,Kl.extend(o))}}}var Hr=e=>Eh(e),$l=e=>xh(e),ed=e=>gh(e),td=e=>Sh(e),nd=e=>_h(e);var rd={"core::Transform":1,"core::Animator":1042,"core::AudioSource":1020,"core::AudioStream":1021,"core::AvatarAttach":1073,"core::AvatarModifierArea":1070,"core::AvatarShape":1080,"core::Billboard":1090,"core::CameraMode":1072,"core::CameraModeArea":1071,"core::EngineInfo":1048,"core::GltfContainer":1041,"core::GltfContainerLoadingState":1049,"core::Material":1017,"core::MeshCollider":1019,"core::MeshRenderer":1018,"core::NftShape":1040,"core::PointerEvents":1062,"core::PointerEventsResult":1063,"core::PointerLock":1074,"core::Raycast":1067,"core::RaycastResult":1068,"core::TextShape":1030,"core::UiBackground":1053,"core::UiCanvasInformation":1054,"core::UiDropdown":1094,"core::UiDropdownResult":1096,"core::UiInput":1093,"core::UiInputResult":1095,"core::UiText":1052,"core::UiTransform":1050,"core::VideoEvent":1044,"core::VideoPlayer":1043,"core::VisibilityComponent":1081};var vh=be(zs());var d3=new Int32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]);function p3(e,r){let a=~~r^-1;for(let o=0;o<e.length;o++)a=d3[(a^e[o])&255]^a>>>8;return a^-1}function Th(e,r=0){return p3(e,r)>>>0}var od=1<<11;function Sr(e){if(rd[e])return rd[e];let r=new Uint8Array(128);return vh.write(e,r,0),(Th(r)+od&4294967295)>>>0}var id=typeof process=="object"&&!1||!1;function yu(e,r){if(id&&e&&typeof e=="object"&&typeof e.then=="function")throw new Error(r);return e}var Vc=e=>({serialize(r,a){a.writeUint32(r.length);for(let o of r)e.serialize(o,a)},deserialize(r){let a=[],o=r.readUint32();for(let u=0;u<o;u++)a.push(e.deserialize(r));return a},create(){return[]},jsonSchema:{type:"array",items:e.jsonSchema,serializationType:"array"}});var gu={serialize(e,r){r.writeInt8(e?1:0)},deserialize(e){return e.readInt8()===1},create(){return!1},jsonSchema:{type:"boolean",serializationType:"boolean"}};var xu={serialize(e,r){r.writeInt64(BigInt(e))},deserialize(e){return Number(e.readInt64())},create(){return 0},jsonSchema:{type:"integer",serializationType:"int64"}},Lo={serialize(e,r){r.writeInt32(e)},deserialize(e){return e.readInt32()},create(){return 0},jsonSchema:{type:"integer",serializationType:"int32"}},_u={serialize(e,r){r.writeInt16(e)},deserialize(e){return e.readInt16()},create(){return 0},jsonSchema:{type:"integer",serializationType:"int16"}},Su={serialize(e,r){r.writeInt8(e)},deserialize(e){return e.readInt8()},create(){return 0},jsonSchema:{type:"integer",serializationType:"int8"}};var jc={serialize(e,r){r.writeUtf8String(e)},deserialize(e){return e.readUtf8String()},create(){return""},jsonSchema:{type:"string",serializationType:"utf8-string"}},Eu=jc;function m3(e){let o=0,u=0;for(let i in e){if(typeof e[i]=="number"){if(e[i]>2147483647||e[i]<-2147483648)throw new Error("Enum member values must be numbers within the range of -2147483648 to 2147483647.");o++}u++}if(u!==o*2)throw new Error("All enum member values must be of numeric type.")}function h3(e){for(let r in e)if(typeof e[r]!="string")throw new Error("All enum member values must be of string type.")}var y3="enum-int",Gc=(e,r)=>(m3(e),{serialize(a,o){Lo.serialize(a,o)},deserialize(a){return Lo.deserialize(a)},create(){return r},jsonSchema:{type:"integer",enum:Object.values(e).filter(a=>Number.isInteger(a)),default:r,serializationType:y3,enumObject:e}}),g3="enum-string",Yc=(e,r)=>(h3(e),{serialize(a,o){jc.serialize(a,o)},deserialize(a){return jc.deserialize(a)},create(){return r},jsonSchema:{type:"string",enum:Object.values(e),default:r,serializationType:g3,enumObject:e}});var _a={serialize(e,r){r.writeFloat32(e)},deserialize(e){return e.readFloat32()},create(){return 0},jsonSchema:{type:"number",serializationType:"float32"}},Tu={serialize(e,r){r.writeFloat64(e)},deserialize(e){return e.readFloat64()},create(){return 0},jsonSchema:{type:"number",serializationType:"float64"}};var vu={serialize(e,r){r.writeFloat32(e.r),r.writeFloat32(e.g),r.writeFloat32(e.b)},deserialize(e){return{r:e.readFloat32(),g:e.readFloat32(),b:e.readFloat32()}},create(){return{r:0,g:0,b:0}},jsonSchema:{type:"object",properties:{r:{type:"number"},g:{type:"number"},b:{type:"number"}},serializationType:"color3"}};var ku={serialize(e,r){r.writeFloat32(e.r),r.writeFloat32(e.g),r.writeFloat32(e.b),r.writeFloat32(e.a)},deserialize(e){return{r:e.readFloat32(),g:e.readFloat32(),b:e.readFloat32(),a:e.readFloat32()}},create(){return{r:0,g:0,b:0,a:0}},jsonSchema:{type:"object",properties:{r:{type:"number"},g:{type:"number"},b:{type:"number"},a:{type:"number"}},serializationType:"color4"}};var Ru={serialize(e,r){r.writeInt32(e)},deserialize(e){return e.readInt32()},create(){return 0},jsonSchema:{type:"integer",serializationType:"entity"}};var wu={serialize(e,r){r.writeFloat32(e.x),r.writeFloat32(e.y),r.writeFloat32(e.z),r.writeFloat32(e.w)},deserialize(e){return{x:e.readFloat32(),y:e.readFloat32(),z:e.readFloat32(),w:e.readFloat32()}},create(){return{x:0,y:0,z:0,w:0}},jsonSchema:{type:"object",properties:{x:{type:"number"},y:{type:"number"},z:{type:"number"},w:{type:"number"}},serializationType:"quaternion"}};var bu={serialize(e,r){r.writeFloat32(e.x),r.writeFloat32(e.y),r.writeFloat32(e.z)},deserialize(e){return{x:e.readFloat32(),y:e.readFloat32(),z:e.readFloat32()}},create(){return{x:0,y:0,z:0}},jsonSchema:{type:"object",properties:{x:{type:"number"},y:{type:"number"},z:{type:"number"},w:{type:"number"}},serializationType:"vector3"}};var qc=(e,r)=>{let a=Object.keys(e).reduce((o,u)=>(o[u]=e[u].jsonSchema,o),{});return{serialize(o,u){for(let i in e)e[i].serialize(o[i],u)},deserialize(o){let u={};for(let i in e)u[i]=e[i].deserialize(o);return u},create(){let o={};for(let u in e)o[u]=e[u].create();return{...o,...r}},extend:o=>{let u={};for(let i in e)u[i]=e[i].create();return{...u,...r,...o}},jsonSchema:{type:"object",properties:a,serializationType:"map"}}};var Jc=e=>({serialize(r,a){r?(a.writeInt8(1),e.serialize(r,a)):a.writeInt8(0)},deserialize(r){if(r.readInt8())return e.deserialize(r)},create(){},jsonSchema:{type:e.jsonSchema.type,serializationType:"optional",optionalJsonSchema:e.jsonSchema}});var Qc=e=>{let r=Object.keys(e),a=r.reduce((u,i,p)=>(u[i]=p,u),{}),o=r.reduce((u,i)=>(u[i]=e[i].jsonSchema,u),{});return{serialize({$case:u,value:i},p){let f=a[u.toString()]+1;p.writeUint8(f),e[u].serialize(i,p)},deserialize(u){let i=r[u.readInt8()-1],p=e[i].deserialize(u);return{$case:i,value:p}},create(){return{}},jsonSchema:{type:"object",properties:o,serializationType:"one-of"}}};var kh=(e,r)=>r.includes(e.serializationType),x3=e=>kh(e,["one-of"]),_3=()=>({type:{type:"object",serializationType:"unknown"},value:void 0}),Zc=e=>kh(e,["array","map"]),ad=(e,r,a)=>{let o=e[a],u=r[a];if(x3(o)){let i=u;if(!i.$case)return _3();let p=o.properties[i.$case];return Zc(p)&&(r[a]={[i.$case]:i.value}),{type:p,value:i.value}}return{type:o,value:u}};var Rh={[gu.jsonSchema.serializationType]:gu,[Eu.jsonSchema.serializationType]:Eu,[_a.jsonSchema.serializationType]:_a,[Tu.jsonSchema.serializationType]:Tu,[Su.jsonSchema.serializationType]:Su,[_u.jsonSchema.serializationType]:_u,[Lo.jsonSchema.serializationType]:Lo,[xu.jsonSchema.serializationType]:xu,[bu.jsonSchema.serializationType]:bu,[wu.jsonSchema.serializationType]:wu,[vu.jsonSchema.serializationType]:vu,[ku.jsonSchema.serializationType]:ku,[Ru.jsonSchema.serializationType]:Ru};function Sa(e){if(Rh[e.serializationType])return Rh[e.serializationType];if(e.serializationType==="map"){let r=e,a={};for(let o in r.properties)a[o]=Sa(r.properties[o]);return qc(a)}if(e.serializationType==="optional")return Jc(Sa(e.optionalJsonSchema));if(e.serializationType==="array")return Vc(Sa(e.items));if(e.serializationType==="enum-int"){let r=e;return Gc(r.enumObject,r.default)}if(e.serializationType==="enum-string"){let r=e;return Yc(r.enumObject,r.default)}if(e.serializationType==="one-of"){let r=e,a={};for(let o in r.properties)a[o]=Sa(r.properties[o]);return Qc(a)}throw new Error(`${e.serializationType} is not supported as reverse schema generation.`)}function Xc(e,r,a){if(e.serializationType==="map"){let{properties:o}=e,u=r;for(let i in o){let{type:p,value:f}=ad(o,u,i);if(p.serializationType!=="unknown")if(Zc(p))Xc(p,f,a);else{let c=a(f,p);c.changed&&(u[i]=c.value)}}}else if(e.serializationType==="array"){let{items:o}=e,u=r;for(let i=0,p=u.length;i<p;i++){let{type:f,value:c}=ad({items:o},{items:u[i]},"items");if(Zc(f))Xc(f,c,a);else{let y=a(c,f);y.changed&&(u[i]=y.value)}}}}var yn;(function(e){e.Boolean=gu,e.String=Eu,e.Float=_a,e.Double=Tu,e.Byte=Su,e.Short=_u,e.Int=Lo,e.Int64=xu,e.Number=_a,e.Vector3=bu,e.Quaternion=wu,e.Color3=vu,e.Color4=ku,e.Entity=Ru,e.EnumNumber=Gc,e.EnumString=Yc,e.Array=Vc,e.Map=qc,e.Optional=Jc,e.OneOf=Qc,e.fromJson=Sa,e.mutateNestedValues=Xc})(yn||(yn={}));function wh(){let e=new Map;return{addTo(r,a){if(a<0)return!1;let o=e.get(r);return o!==void 0&&o>=a||e.set(r,a),!0},has(r,a){let o=e.get(r);return o!==void 0&&o>=a},getMap(){return e}}}var Do=65535,S3=4294901760,E3=Do+1,Nu=512,ud=Do,tr;(function(e){function r(o){return[(o&Do)>>>0,((o&S3)>>16&Do)>>>0]}e.fromEntityId=r;function a(o,u){return(o&Do|(u&Do)<<16)>>>0}e.toEntityId=a})(tr||(tr={}));var on;(function(e){e[e.Unknown=0]="Unknown",e[e.UsedEntity=1]="UsedEntity",e[e.Removed=2]="Removed",e[e.Reserved=3]="Reserved"})(on||(on={}));function sd(){let e=Nu,r=new Set,a=[],o=wh();function u(){if(e>ud-1)throw new Error(`It fails trying to generate an entity out of range ${ud}.`);let T=e++,w=o.getMap().has(T)?o.getMap().get(T)+1:0,D=tr.toEntityId(T,w);return r.has(D)?u():(r.add(D),D)}function i(){if(r.size+Nu>=e)return u();for(let[T,w]of o.getMap())if(w<Do){let D=tr.toEntityId(T,w+1);if(!r.has(D)&&!a.includes(D))return r.add(D),D}return u()}function p(T){return T<Nu?!1:(r.has(T)?(r.delete(T),a.push(T)):c(T),!0)}function f(){let T=a;if(T.length){a=[];for(let w of T){let[D,B]=tr.fromEntityId(w);o.addTo(D,B)}}return T}function c(T){let[w,D]=tr.fromEntityId(T);o.addTo(w,D);for(let B=0;B<=D;B++)r.delete(tr.toEntityId(w,B));return!0}function y(T){let[w,D]=tr.fromEntityId(T);if(o.has(w,D))return!1;if(D>0){for(let B=0;B<=D-1;B++)r.delete(tr.toEntityId(w,B));o.addTo(w,D-1)}return r.add(T),!0}function R(T){let[w,D]=tr.fromEntityId(T);if(w<Nu)return on.Reserved;if(r.has(T))return on.UsedEntity;let B=o.getMap().get(w);return B!==void 0&&B>=D?on.Removed:on.Unknown}return{generateEntity:i,removeEntity:p,getExistingEntities(){return new Set(r)},getEntityState:R,releaseRemovedEntities:f,updateRemovedEntity:c,updateUsedEntity:y}}var Ea=be(zs()),Ke=function(e,r,a,o){if(a==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof r=="function"?e!==r||!o:!r.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return a==="m"?o:a==="a"?o.call(e):o?o.value:r.get(e)},Qe,gn,Ht;function T3(e,r){let a=Math.max(e,r)+1024;return Math.ceil(a/1024)*1024}var v3=10240,Ut=class{constructor(r,a,o){Qe.add(this),this._buffer=r||new Uint8Array(v3),this.view=new DataView(this._buffer.buffer,this._buffer.byteOffset),this.woffset=o??(r?this._buffer.length:null)??0,this.roffset=a??0}buffer(){return this._buffer}bufferLength(){return this._buffer.length}resetBuffer(){this.roffset=0,this.woffset=0}currentReadOffset(){return this.roffset}currentWriteOffset(){return this.woffset}incrementReadOffset(r){return Ke(this,Qe,"m",Ht).call(this,r)}remainingBytes(){return this.woffset-this.roffset}readFloat32(){return this.view.getFloat32(Ke(this,Qe,"m",Ht).call(this,4),!0)}readFloat64(){return this.view.getFloat64(Ke(this,Qe,"m",Ht).call(this,8),!0)}readInt8(){return this.view.getInt8(Ke(this,Qe,"m",Ht).call(this,1))}readInt16(){return this.view.getInt16(Ke(this,Qe,"m",Ht).call(this,2),!0)}readInt32(){return this.view.getInt32(Ke(this,Qe,"m",Ht).call(this,4),!0)}readInt64(){return this.view.getBigInt64(Ke(this,Qe,"m",Ht).call(this,8),!0)}readUint8(){return this.view.getUint8(Ke(this,Qe,"m",Ht).call(this,1))}readUint16(){return this.view.getUint16(Ke(this,Qe,"m",Ht).call(this,2),!0)}readUint32(){return this.view.getUint32(Ke(this,Qe,"m",Ht).call(this,4),!0)}readUint64(){return this.view.getBigUint64(Ke(this,Qe,"m",Ht).call(this,8),!0)}readBuffer(){let r=this.view.getUint32(Ke(this,Qe,"m",Ht).call(this,4),!0);return this._buffer.subarray(Ke(this,Qe,"m",Ht).call(this,r),Ke(this,Qe,"m",Ht).call(this,0))}readUtf8String(){let r=this.view.getUint32(Ke(this,Qe,"m",Ht).call(this,4),!0);return Ea.read(this._buffer,Ke(this,Qe,"m",Ht).call(this,r),Ke(this,Qe,"m",Ht).call(this,0))}incrementWriteOffset(r){return Ke(this,Qe,"m",gn).call(this,r)}toBinary(){return this._buffer.subarray(0,this.woffset)}toCopiedBinary(){return new Uint8Array(this.toBinary())}writeBuffer(r,a=!0){a&&this.writeUint32(r.byteLength);let o=Ke(this,Qe,"m",gn).call(this,r.byteLength);this._buffer.set(r,o)}writeUtf8String(r,a=!0){let o=Ea.length(r);a&&this.writeUint32(o);let u=Ke(this,Qe,"m",gn).call(this,o);Ea.write(r,this._buffer,u)}writeFloat32(r){let a=Ke(this,Qe,"m",gn).call(this,4);this.view.setFloat32(a,r,!0)}writeFloat64(r){let a=Ke(this,Qe,"m",gn).call(this,8);this.view.setFloat64(a,r,!0)}writeInt8(r){let a=Ke(this,Qe,"m",gn).call(this,1);this.view.setInt8(a,r)}writeInt16(r){let a=Ke(this,Qe,"m",gn).call(this,2);this.view.setInt16(a,r,!0)}writeInt32(r){let a=Ke(this,Qe,"m",gn).call(this,4);this.view.setInt32(a,r,!0)}writeInt64(r){let a=Ke(this,Qe,"m",gn).call(this,8);this.view.setBigInt64(a,r,!0)}writeUint8(r){let a=Ke(this,Qe,"m",gn).call(this,1);this.view.setUint8(a,r)}writeUint16(r){let a=Ke(this,Qe,"m",gn).call(this,2);this.view.setUint16(a,r,!0)}writeUint32(r){let a=Ke(this,Qe,"m",gn).call(this,4);this.view.setUint32(a,r,!0)}writeUint64(r){let a=Ke(this,Qe,"m",gn).call(this,8);this.view.setBigUint64(a,r,!0)}getFloat32(r){return this.view.getFloat32(r,!0)}getFloat64(r){return this.view.getFloat64(r,!0)}getInt8(r){return this.view.getInt8(r)}getInt16(r){return this.view.getInt16(r,!0)}getInt32(r){return this.view.getInt32(r,!0)}getInt64(r){return this.view.getBigInt64(r,!0)}getUint8(r){return this.view.getUint8(r)}getUint16(r){return this.view.getUint16(r,!0)}getUint32(r){return this.view.getUint32(r,!0)}getUint64(r){return this.view.getBigUint64(r,!0)}setFloat32(r,a){this.view.setFloat32(r,a,!0)}setFloat64(r,a){this.view.setFloat64(r,a,!0)}setInt8(r,a){this.view.setInt8(r,a)}setInt16(r,a){this.view.setInt16(r,a,!0)}setInt32(r,a){this.view.setInt32(r,a,!0)}setInt64(r,a){this.view.setBigInt64(r,a,!0)}setUint8(r,a){this.view.setUint8(r,a)}setUint16(r,a){this.view.setUint16(r,a,!0)}setUint32(r,a){this.view.setUint32(r,a,!0)}setUint64(r,a){this.view.setBigUint64(r,a,!0)}};Qe=new WeakSet,gn=function(r){if(this.woffset+r>this._buffer.byteLength){let a=T3(this._buffer.byteLength,this.woffset+r),o=new Uint8Array(a);o.set(this._buffer);let u=this._buffer.byteOffset;this._buffer=o,this.view=new DataView(this._buffer.buffer,u)}return this.woffset+=r,this.woffset-r},Ht=function(r){if(this.roffset+r>this.woffset)throw new Error("Outside of the bounds of writen data.");return this.roffset+=r,this.roffset-r};var Ne;(function(e){e[e.RESERVED=0]="RESERVED",e[e.PUT_COMPONENT=1]="PUT_COMPONENT",e[e.DELETE_COMPONENT=2]="DELETE_COMPONENT",e[e.DELETE_ENTITY=3]="DELETE_ENTITY",e[e.APPEND_VALUE=4]="APPEND_VALUE",e[e.MAX_MESSAGE_TYPE=5]="MAX_MESSAGE_TYPE"})(Ne||(Ne={}));var kn=8,xn;(function(e){e[e.StateUpdatedTimestamp=1]="StateUpdatedTimestamp",e[e.StateOutdatedTimestamp=2]="StateOutdatedTimestamp",e[e.NoChanges=3]="NoChanges",e[e.StateOutdatedData=4]="StateOutdatedData",e[e.StateUpdatedData=5]="StateUpdatedData",e[e.EntityWasDeleted=6]="EntityWasDeleted",e[e.EntityDeleted=7]="EntityDeleted"})(xn||(xn={}));var Rn;(function(e){function r(i){let p=i.remainingBytes();if(p<kn)return!1;let f=i.getUint32(i.currentReadOffset());return!(p<f)}e.validate=r;function a(i){return r(i)?{length:i.readUint32(),type:i.readUint32()}:null}e.readHeader=a;function o(i){if(!r(i))return null;let p=i.currentReadOffset();return{length:i.getUint32(p),type:i.getUint32(p+4)}}e.getHeader=o;function u(i){let p=o(i);return p?(i.incrementReadOffset(p.length),!0):!1}e.consumeMessage=u})(Rn||(Rn={}));var Vr;(function(e){e.MESSAGE_HEADER_LENGTH=12;function r(o,u,i,p){let f=kn+e.MESSAGE_HEADER_LENGTH,c=p.incrementWriteOffset(f);p.setUint32(c,f),p.setUint32(c+4,Ne.DELETE_COMPONENT),p.setUint32(c+8,o),p.setUint32(c+12,u),p.setUint32(c+16,i)}e.write=r;function a(o){let u=Rn.readHeader(o);if(!u)return null;if(u.type!==Ne.DELETE_COMPONENT)throw new Error("DeleteComponentOperation tried to read another message type.");return{...u,entityId:o.readUint32(),componentId:o.readUint32(),timestamp:o.readUint32()}}e.read=a})(Vr||(Vr={}));var Wo;(function(e){e.MESSAGE_HEADER_LENGTH=16;function r(o,u,i,p,f){let c=f.incrementWriteOffset(kn+e.MESSAGE_HEADER_LENGTH);f.writeBuffer(p,!1);let y=f.currentWriteOffset()-c;f.setUint32(c,y),f.setUint32(c+4,Ne.APPEND_VALUE),f.setUint32(c+8,o),f.setUint32(c+12,i),f.setUint32(c+16,u);let R=y-e.MESSAGE_HEADER_LENGTH-kn;f.setUint32(c+20,R)}e.write=r;function a(o){let u=Rn.readHeader(o);if(!u)return null;if(u.type!==Ne.APPEND_VALUE)throw new Error("AppendValueOperation tried to read another message type.");return{...u,entityId:o.readUint32(),componentId:o.readUint32(),timestamp:o.readUint32(),data:o.readBuffer()}}e.read=a})(Wo||(Wo={}));var Ta;(function(e){e.MESSAGE_HEADER_LENGTH=4;function r(o,u){u.writeUint32(kn+4),u.writeUint32(Ne.DELETE_ENTITY),u.writeUint32(o)}e.write=r;function a(o){let u=Rn.readHeader(o);if(!u)return null;if(u.type!==Ne.DELETE_ENTITY)throw new Error("DeleteEntity tried to read another message type.");return{...u,entityId:o.readUint32()}}e.read=a})(Ta||(Ta={}));var jr;(function(e){e.MESSAGE_HEADER_LENGTH=16;function r(o,u,i,p,f){let c=f.incrementWriteOffset(kn+e.MESSAGE_HEADER_LENGTH);f.writeBuffer(p,!1);let y=f.currentWriteOffset()-c;f.setUint32(c,y),f.setUint32(c+4,Ne.PUT_COMPONENT),f.setUint32(c+8,o),f.setUint32(c+12,i),f.setUint32(c+16,u);let R=y-e.MESSAGE_HEADER_LENGTH-kn;f.setUint32(c+20,R)}e.write=r;function a(o){let u=Rn.readHeader(o);if(!u)return null;if(u.type!==Ne.PUT_COMPONENT)throw new Error("PutComponentOperation tried to read another message type.");return{...u,entityId:o.readUint32(),componentId:o.readUint32(),timestamp:o.readUint32(),data:o.readBuffer()}}e.read=a})(jr||(jr={}));function bh(e,r){let a=[],o=[],u=[],i=[];function p(T){return function(D){let B=new Ut(D),P;for(;P=Rn.getHeader(B);){let Y=B.currentReadOffset();if(P.type===Ne.DELETE_COMPONENT){let W=Vr.read(B);o.push({...W,transportId:T,messageBuffer:B.buffer().subarray(Y,B.currentReadOffset())})}else if(P.type===Ne.PUT_COMPONENT){let W=jr.read(B);o.push({...W,transportId:T,messageBuffer:B.buffer().subarray(Y,B.currentReadOffset())})}else if(P.type===Ne.DELETE_ENTITY){let W=Ta.read(B);o.push({...W,transportId:T,messageBuffer:B.buffer().subarray(Y,B.currentReadOffset())})}else if(P.type===Ne.APPEND_VALUE){let W=Wo.read(B);o.push({...W,transportId:T,messageBuffer:B.buffer().subarray(Y,B.currentReadOffset())})}else B.incrementReadOffset(P.length)}}}function f(T){return T.splice(0,T.length)}async function c(){let T=f(o),w=new Ut,D=[];for(let B of T)if(B.type===Ne.DELETE_ENTITY)D.push(B.entityId);else{let P=e.entityContainer.getEntityState(B.entityId);if(P===on.Removed)continue;P===on.Unknown&&e.entityContainer.updateUsedEntity(B.entityId);let Y=e.getComponentOrNull(B.componentId);if(Y){let[W,Q]=Y.updateFromCrdt(B);if(W){let ce=w.currentWriteOffset();W.type===Ne.PUT_COMPONENT?jr.write(B.entityId,W.timestamp,W.componentId,W.data,w):W.type===Ne.DELETE_COMPONENT&&Vr.write(B.entityId,Y.componentId,W.timestamp,w),i.push({...B,messageBuffer:w.buffer().subarray(ce,w.currentWriteOffset())})}else u.push(B),r&&r(B.entityId,B.type,Y,Q)}else u.push(B)}for(let B of D){for(let P=i.length-1;P>=0;P--)i[P].entityId===B&&i[P].type!==Ne.DELETE_ENTITY&&i.splice(P,1);for(let P of e.componentsIter())P.entityDeleted(B,!1);e.entityContainer.updateRemovedEntity(B),r&&r(B,Ne.DELETE_ENTITY)}}async function y(T){let w=f(u),D=f(i),B=new Ut;for(let Y of e.componentsIter())for(let W of Y.getCrdtUpdates()){let Q=B.currentWriteOffset();if(a.some(ce=>ce.filter(W))&&(W.type===Ne.PUT_COMPONENT?jr.write(W.entityId,W.timestamp,W.componentId,W.data,B):W.type===Ne.DELETE_COMPONENT?Vr.write(W.entityId,Y.componentId,W.timestamp,B):W.type===Ne.APPEND_VALUE&&Wo.write(W.entityId,W.timestamp,W.componentId,W.data,B),w.push({...W,messageBuffer:B.buffer().subarray(Q,B.currentWriteOffset())}),r)){let ce=W.type===Ne.PUT_COMPONENT||W.type===Ne.APPEND_VALUE?Y.get(W.entityId):void 0;r(W.entityId,W.type,Y,ce)}}for(let Y of T){let W=B.currentWriteOffset();Ta.write(Y,B),w.push({type:Ne.DELETE_ENTITY,entityId:Y,messageBuffer:B.buffer().subarray(W,B.currentWriteOffset())}),r&&r(Y,Ne.DELETE_ENTITY)}let P=new Ut;for(let Y in a){let W=Number(Y),Q=a[W];P.resetBuffer();for(let $ of D)$.transportId===W&&!w.find(ye=>ye.entityId===$.entityId&&ye.componentId&&ye.componentId===$.componentId)&&P.writeBuffer($.messageBuffer,!1);for(let $ of w)$.transportId!==W&&Q.filter($)&&P.writeBuffer($.messageBuffer,!1);let ce=P.currentWriteOffset()?P.toBinary():new Uint8Array([]);await Q.send(ce)}}function R(T){let w=a.push(T)-1;T.onmessage=p(w)}return{sendMessages:y,receiveMessages:c,addTransport:R}}var Nh;(function(e){let r;(function(a){a[a.NETWORKED=0]="NETWORKED",a[a.RENDERER=1]="RENDERER"})(r=e.SynchronizedEntityType||(e.SynchronizedEntityType={}))})(Nh||(Nh={}));function cd(e,r){if(e===r)return 0;if(e===null&&r!==null)return-1;if(e!==null&&r===null)return 1;if(e instanceof Uint8Array&&r instanceof Uint8Array){let a=e.byteLength-r.byteLength;if(a!==0)return a>0?1:-1;let o;for(let u=0,i=e.byteLength;u<i;u++)if(o=e[u]-r[u],o!==0)return o>0?1:-1;return 0}if(typeof e=="string"){let a=e.length-r.length;return a!==0?a>0?1:-1:e.localeCompare(r)}return e>r?1:-1}function Kc(e){return Object.freeze({...e})}function k3(e,r){let a=(r.get(e)||0)+1;return r.set(e,a),a}function R3(e,r,a,o){return function(i){for(let[p,f]of r)if(o.has(p)){let c=o.get(p),y=new Ut;a.serialize(c,y),jr.write(p,f,e,y.toBinary(),i)}else Vr.write(p,e,f,i)}}function w3(e,r,a,o){function u(i){let{entityId:p,timestamp:f}=i,c=r.get(p);if(c===void 0||c<f)return xn.StateUpdatedTimestamp;if(c>f)return xn.StateOutdatedTimestamp;if(i.type===Ne.DELETE_COMPONENT&&!o.has(p))return xn.NoChanges;let y=0;if(o.has(p)){let R=new Ut;a.serialize(o.get(p),R),y=cd(R.toBinary(),i.data||null)}else y=cd(null,i.data);return y===0?xn.NoChanges:y>0?xn.StateOutdatedData:xn.StateUpdatedData}return i=>{if(i.type!==Ne.PUT_COMPONENT&&i.type!==Ne.DELETE_COMPONENT)return[null,o.get(i.entityId)];let p=u(i),f=i.entityId;switch(p){case xn.StateUpdatedData:case xn.StateUpdatedTimestamp:{if(r.set(f,i.timestamp),i.type===Ne.PUT_COMPONENT){let c=new Ut(i.data);o.set(f,a.deserialize(c))}else o.delete(f);return[null,o.get(f)]}case xn.StateOutdatedTimestamp:case xn.StateOutdatedData:if(o.has(f)){let c=new Ut;return a.serialize(o.get(f),c),[{type:Ne.PUT_COMPONENT,componentId:e,data:c.toBinary(),entityId:f,timestamp:r.get(f)},o.get(f)]}else return[{type:Ne.DELETE_COMPONENT,componentId:e,entityId:f,timestamp:r.get(f)},void 0]}return[null,o.get(f)]}}function b3(e,r,a,o,u){return function*(){for(let i of a){let p=k3(i,r);if(u.has(i)){let f=new Ut;o.serialize(u.get(i),f),yield{type:Ne.PUT_COMPONENT,componentId:e,entityId:i,data:f.toBinary(),timestamp:p}}else yield{type:Ne.DELETE_COMPONENT,componentId:e,entityId:i,timestamp:p}}a.clear()}}function fd(e,r,a){let o=new Map,u=new Set,i=new Map;return{get componentId(){return r},get componentName(){return e},get componentType(){return 0},schema:a,has(p){return o.has(p)},deleteFrom(p,f=!0){let c=o.get(p);return o.delete(p)&&f&&u.add(p),c||null},entityDeleted(p,f){o.delete(p)&&f&&u.add(p)},getOrNull(p){let f=o.get(p);return f?Kc(f):null},get(p){let f=o.get(p);if(!f)throw new Error(`[getFrom] Component ${e} for entity #${p} not found`);return Kc(f)},create(p,f){if(o.get(p))throw new Error(`[create] Component ${e} for ${p} already exists`);let y=f===void 0?a.create():a.extend?a.extend(f):f;return o.set(p,y),u.add(p),y},createOrReplace(p,f){let c=f===void 0?a.create():a.extend?a.extend(f):f;return o.set(p,c),u.add(p),c},getMutableOrNull(p){let f=o.get(p);return f?(u.add(p),f):null},getOrCreateMutable(p,f){let c=o.get(p);return c?(u.add(p),c):this.create(p,f)},getMutable(p){let f=this.getMutableOrNull(p);if(f===null)throw new Error(`[mutable] Component ${e} for ${p} not found`);return f},*iterator(){for(let[p,f]of o)yield[p,f]},*dirtyIterator(){for(let p of u)yield p},getCrdtUpdates:b3(r,i,u,a,o),updateFromCrdt:w3(r,i,a,o),dumpCrdtStateToBuffer:R3(r,i,a,o)}}function Ah(){let e=[];function r(){e.sort((u,i)=>i.priority-u.priority)}function a(u,i,p){let f=p??u.name;if(e.find(c=>c.fn===u))throw new Error(`System ${JSON.stringify(f)} already added to the engine`);e.push({fn:u,priority:i,name:f}),r()}function o(u){let i=-1;return typeof u=="string"?i=e.findIndex(p=>p.name===u):i=e.findIndex(p=>p.fn===u),i===-1?!1:(e.splice(i,1),r(),!0)}return{add:a,remove:o,getSystems(){return e}}}var ld=zh(new Set);function Ih(){throw new Error("The set is frozen")}function zh(e){return e.add=Ih,e.clear=Ih,e}function N3(e,r){return e.timestamp>r.timestamp?1:-1}function Ph(e,r,a,o){let u=new Map,i=new Set,p=[];function f(T){let w=T.raw.length;return w>1&&T.raw[w-1].timestamp<=T.raw[w-2].timestamp}function c(T){let w=u.get(T);if(w){for(f(w)&&w.raw.sort(N3);w.raw.length>o.maxElements;)w.raw.shift();let D=zh(new Set(w?.raw.map(B=>B.value)));return w.frozenSet=D,D}else return ld}function y(T,w){let D=u.get(T);D||(D={raw:[],frozenSet:ld},u.set(T,D));let B=a.extend?a.extend(w):w,P=o.timestampFunction(B);return id&&Object.freeze(B),D.raw.push({value:B,timestamp:P}),{set:c(T),value:B}}return{get componentId(){return r},get componentName(){return e},get componentType(){return 1},schema:a,has(T){return u.has(T)},entityDeleted(T){u.delete(T)},get(T){let w=u.get(T);return w?w.frozenSet:ld},addValue(T,w){let{set:D,value:B}=y(T,w);i.add(T);let P=new Ut;return a.serialize(B,P),p.push({componentId:r,data:P.toBinary(),entityId:T,timestamp:0,type:Ne.APPEND_VALUE}),D},*iterator(){for(let[T,w]of u)yield[T,w.frozenSet]},*dirtyIterator(){for(let T of i)yield T},getCrdtUpdates(){return i.clear(),p.splice(0,p.length)},updateFromCrdt(T){if(T.type===Ne.APPEND_VALUE){let w=new Ut(T.data);y(T.entityId,a.deserialize(w))}return[null,void 0]},dumpCrdtStateToBuffer:function(T){for(let[w,{raw:D}]of u)for(let B of D){let P=new Ut;a.serialize(B.value,P),Wo.write(w,0,r,P.toBinary(),T)}}}}var Oh=[0,1,2,4,5,6,7,8,9,10,11,12,13],A3=1<<20;function dd(e){let r=ua(e),a={previousFrameMaxTimestamp:0,currentFrameMaxTimestamp:0,buttonState:new Map,thisFrameCommands:[]};function o(P,Y,W){let Q=r.get(W);for(let ce of Array.from(Q).reverse())if(ce.button===Y&&ce.state===P)return ce}function*u(P,Y){let W=r.get(Y);for(let Q of Array.from(W).reverse())Q.button===P&&(yield Q)}function i(){let P=a.currentFrameMaxTimestamp;a.previousFrameMaxTimestamp=P,a.thisFrameCommands.length&&(a.thisFrameCommands=[]);for(let[,Y]of e.getEntitiesWith(r)){let W=Array.from(Y);for(let Q=W.length-1;Q>=0;Q--){let ce=W[Q];if(ce.timestamp>P&&(P=ce.timestamp),ce.timestamp>a.previousFrameMaxTimestamp&&a.thisFrameCommands.push(ce),ce.state===0||ce.state===1){let $=a.buttonState.get(ce.button);if(!$||ce.timestamp>$.timestamp)a.buttonState.set(ce.button,ce);else break}}}a.currentFrameMaxTimestamp=P}e.addSystem(i,A3,"@dcl/ecs#inputSystem");function p(P){return P>a.previousFrameMaxTimestamp&&P<=a.currentFrameMaxTimestamp}function f(P,Y){if(P!==3)return c(P,Y);for(let W of Oh){let Q=c(W,Y);if(Q)return Q}return null}function c(P,Y){let W=null,Q=null;for(let ce of u(P,Y))if(Q){if(!W&&ce.state===1){W=ce;break}}else if(ce.state===0){Q=ce;continue}return!Q||!W?null:W.timestamp<Q.timestamp&&p(Q.timestamp)?{up:Q,down:W}:null}function y(P,Y,W){if(P!==3)return T(P,Y,W);for(let Q of Oh){let ce=T(Q,Y,W);if(ce)return ce}return null}function R(P,Y,W){if(W)return y(P,Y,W);for(let Q of a.thisFrameCommands)if((Q.button===P||P===3)&&Q.state===Y)return Q;return null}function T(P,Y,W){let Q=o(Y,P,W);return Q&&p(Q.timestamp)?Q:null}function w(P,Y){return f(P,Y)!==null}function D(P,Y,W){if(W){let Q=o(Y,P,W);return Q&&p(Q.timestamp)||!1}else{for(let Q of a.thisFrameCommands)if((Q.button===P||P===3)&&Q.state===Y)return!0;return!1}}function B(P){return a.buttonState.get(P)?.state===1}return{isPressed:B,getClick:f,getInputCommand:R,isClicked:w,isTriggered:D}}var pd;(function(e){e[e.LastWriteWinElementSet=0]="LastWriteWinElementSet",e[e.GrowOnlyValueSet=1]="GrowOnlyValueSet"})(pd||(pd={}));function z3(){let e=sd(),r=new Map,a=Ah(),o=!1;function u($,ye=1e5,q){a.add($,ye,q)}function i($){return a.remove($)}function p(){return e.generateEntity()}function f($){for(let[,ye]of r)ye.entityDeleted($,!0);return e.removeEntity($)}function c($,ye){if(o)throw new Error("Engine is already sealed. No components can be added at this stage");let q=Sr($);if(r.get(q))throw new Error(`Component number ${q} was already registered.`);if(ye.componentName!==$)throw new Error(`Component name doesn't match componentDefinition.componentName ${$} != ${ye.componentName}`);if(ye.componentId!==q)throw new Error(`Component number doesn't match componentDefinition.componentId ${q} != ${ye.componentId}`);return r.set(q,ye),ye}function y($,ye){if(o)throw new Error("Engine is already sealed. No components can be added at this stage");let q=Sr($),J=r.get(q);if(J)return J;let ae=fd($,q,ye);return r.set(q,ae),ae}function R($,ye,q){if(o)throw new Error("Engine is already sealed. No components can be added at this stage");let J=Sr($),ae=r.get(J);if(ae)return ae;let ge=Ph($,J,ye,q);return r.set(J,ge),ge}function T($,ye,q){if(o)throw new Error("Engine is already sealed. No components can be added at this stage");let J=Sr($),ae=r.get(J);if(ae)return ae;let ge=yn.Map(ye,q),Z=fd($,J,ge),v={...Z,create(z,V){return Z.create(z,V)},createOrReplace(z,V){return Z.createOrReplace(z,V)}};return r.set(J,v),v}function w($){let ye=typeof $=="number"?$:Sr($),q=r.get(ye);if(!q)throw new Error(`Component ${ye} not found. You need to declare the components at the beginnig of the engine declaration`);return q}function D($){let ye=typeof $=="number"?$:Sr($);return r.get(ye)??null}function*B(...$){for(let[ye,...q]of P(...$))yield[ye,...q.map(J=>J.get(ye))]}function*P(...$){let[ye,...q]=$;for(let[J]of ye.iterator()){let ae=!0;for(let ge of q)if(!ge.has(J)){ae=!1;break}ae&&(yield[J,...$])}}function Y(){return a.getSystems()}function W(){return r.values()}function Q($){if(o)throw new Error("Engine is already sealed. No components can be removed at this stage");let ye=typeof $=="number"?$:Sr($);r.delete(ye)}Hr({defineComponentFromSchema:y});function ce(){o||(o=!0)}return{addEntity:p,removeEntity:f,addSystem:u,getSystems:Y,removeSystem:i,defineComponent:T,defineComponentFromSchema:y,defineValueSetComponentFromSchema:R,getEntitiesWith:B,getComponent:w,getComponentOrNull:D,removeComponentDefinition:Q,registerComponentDefinition:c,entityContainer:e,componentsIter:W,seal:ce}}function md(e){let r=z3(),a=bh(r,e?.onChangeFunction||null);async function o(u){await a.receiveMessages();for(let p of r.getSystems()){let f=p.fn(u);yu(f,`A system (${p.name||"anonymous"}) returned a thenable. Systems cannot be async functions. Documentation: https://dcl.gg/sdk/sync-systems`)}let i=r.entityContainer.releaseRemovedEntities();await a.sendMessages(i)}return{addEntity:r.addEntity,removeEntity:r.removeEntity,addSystem:r.addSystem,removeSystem:r.removeSystem,defineComponent:r.defineComponent,defineComponentFromSchema:r.defineComponentFromSchema,defineValueSetComponentFromSchema:r.defineValueSetComponentFromSchema,registerComponentDefinition:r.registerComponentDefinition,getEntitiesWith:r.getEntitiesWith,getComponent:r.getComponent,getComponentOrNull:r.getComponentOrNull,removeComponentDefinition:r.removeComponentDefinition,componentsIter:r.componentsIter,seal:r.seal,update:o,RootEntity:0,PlayerEntity:1,CameraEntity:2,getEntityState:r.entityContainer.getEntityState,addTransport:a.addTransport,entityContainer:r.entityContainer}}function P3(e){let r=Array.from(e);return e.length=0,r}function hd(e){let r=[];async function a(u){try{return await u()}catch(i){console.error(i)}}function o(){for(let u of P3(r))a(u).catch(console.error)}return e.addSystem(o),function(u){r.push(u)}}function yd(e,r){let a=aa(e),o;(function(T){T[T.Click=0]="Click",T[T.Down=1]="Down",T[T.Up=2]="Up"})(o||(o={}));let u=(T={})=>({button:3,...T}),i=new Map;function p(T){return i.get(T)||i.set(T,new Map).get(T)}function f(T,w,D){(D.hoverText||D.showFeedback)&&(a.getMutableOrNull(T)||a.create(T)).pointerEvents.push({eventType:w,eventInfo:{button:D.button,showFeedback:D.showFeedback,hoverText:D.hoverText,maxDistance:D.maxDistance}})}function c(T,w,D){let B=a.getMutableOrNull(T);B&&(B.pointerEvents=B.pointerEvents.filter(P=>!(P.eventInfo?.button===D&&P.eventType===w)))}function y(T){return T===o.Up?0:1}function R(T,w){let D=p(T),B=D.get(w);B?.opts.hoverText&&c(T,y(w),B.opts.button),D.delete(w)}return e.addSystem(function(){for(let[w,D]of i){if(e.getEntityState(w)===on.Removed){i.delete(w);continue}for(let[B,{cb:P,opts:Y}]of D){if(B===o.Click){let W=r.getClick(Y.button,w);W&&yu(P(W.up),"Click event returned a thenable. Only synchronous functions are allowed")}if(B===o.Down||B===o.Up){let W=r.getInputCommand(Y.button,y(B),w);W&&yu(P(W),"Event handler returned a thenable. Only synchronous functions are allowed")}}}}),{removeOnClick(T){R(T,o.Click)},removeOnPointerDown(T){R(T,o.Down)},removeOnPointerUp(T){R(T,o.Up)},onClick(T,w,D){let B=u(D);R(T,o.Click),p(T).set(o.Click,{cb:w,opts:B}),f(T,1,B)},onPointerDown(T,w,D){let B=u(D);R(T,o.Down),p(T).set(o.Down,{cb:w,opts:B}),f(T,1,B)},onPointerUp(T,w,D){let B=u(D);R(T,o.Up),p(T).set(o.Up,{cb:w,opts:B}),f(T,0,B)}}}function gd(e){let r=sa(e),a=ca(e),o=new Map,u={maxDistance:16,queryType:0,continuous:!1,originOffset:{x:0,y:0,z:0},collisionMask:2},i=(T={})=>({...u,...T,directionRawValue:{$case:"localDirection",localDirection:T.direction||{x:0,y:0,z:1}}}),p=(T={})=>({...u,...T,directionRawValue:{$case:"globalDirection",globalDirection:T.direction||{x:0,y:0,z:1}}}),f=(T={})=>({...u,...T,directionRawValue:{$case:"globalTarget",globalTarget:T.target||{x:0,y:0,z:0}}}),c=(T={})=>({...u,...T,directionRawValue:{$case:"targetEntity",targetEntity:T.targetEntity||0}});function y(T,w,D){let B=r.getOrCreateMutable(T);B.maxDistance=D.maxDistance,B.originOffset=D.originOffset,B.collisionMask=D.collisionMask,B.direction=D.directionRawValue,B.continuous=D.continuous,B.queryType=D.queryType,o.set(T,{callback:w})}function R(T){r.deleteFrom(T),a.deleteFrom(T),o.delete(T)}return e.addSystem(function(){for(let[w,D]of o){let B=r.getOrNull(w);if(e.getEntityState(w)===on.Removed||!B){o.delete(w);continue}let P=a.getOrNull(w);P&&(D.callback(P),B.continuous||R(w))}}),{removeRaycasterEntity(T){R(T)},registerLocalDirectionRaycast(T,w,D){y(T,w,i(D))},registerGlobalDirectionRaycast(T,w,D){y(T,w,p(D))},registerGlobalTargetRaycast(T,w,D){y(T,w,f(D))},registerTargetEntityRaycast(T,w,D){y(T,w,c(D))}}}function xd(e){let r=xa(e),a=ga(e),o=new Map;function u(f,c){o.set(f,{callback:c})}function i(f){o.delete(f)}function p(f){return o.has(f)}return e.addSystem(function(){for(let[c,y]of o){let R=r.getOrNull(c);if(e.getEntityState(c)===on.Removed||!R){i(c);continue}let T=a.get(c),w=T.values(),D=T.size,B,P=0;for(let Y of w)P===D-1&&(B=Y),P++;B===void 0||y.lastVideoState!==void 0&&y.lastVideoState===B.state||(y.callback(B),o.set(c,{callback:y.callback,lastVideoState:B.state}))}}),{removeVideoEventsEntity(f){i(f)},registerVideoEventsEntity(f,c){u(f,c)},hasVideoEventsEntity(f){return p(f)}}}var Re=md(),Ch=dd(Re),_d=yd(Re,Ch),O3=gd(Re),C3=xd(Re),U3=hd(Re);function*Uh(e,r){if(r.has(e)){r.delete(e);for(let[a,o]of r)o.parent===e&&(yield*Uh(a,r));yield e}}function Bh(e,r,a){let o=new Map(e.getEntitiesWith(a));return Uh(r,o)}function B3(e,r){let a=Hr(e);for(let o of Bh(e,r,a))e.removeEntity(o)}function Mh(e){let r=Hr(e);return()=>{for(let a of r.dirtyIterator()){let o=r.getOrNull(a);for(;o&&o.parent;)if(o.parent===a){console.error(`There is a cyclic parent with entity ${a}`);break}else o=r.getOrNull(o.parent)}}}var M3=bc(Re),F3=Nc(Re),L3=Ac(Re),D3=Ic(Re),W3=zc(Re),H3=Pc(Re),V3=Oc(Re),j3=Cc(Re),G3=Uc(Re),Y3=Bc(Re),q3=Mc(Re),J3=Fc(Re),Q3=aa(Re),Z3=ua(Re),X3=Lc(Re),K3=sa(Re),$3=ca(Re),eg=Dc(Re),tg=fa(Re),ng=Wc(Re),rg=la(Re),og=da(Re),ig=pa(Re),ag=ma(Re),ug=ha(Re),sg=ya(Re),cg=ga(Re),fg=xa(Re),lg=Hc(Re);var Sd;(function(e){e[e.CT_FIRST_PERSON=0]="CT_FIRST_PERSON",e[e.CT_THIRD_PERSON=1]="CT_THIRD_PERSON",e[e.CT_CINEMATIC=2]="CT_CINEMATIC"})(Sd||(Sd={}));var Ed;(function(e){e[e.IA_POINTER=0]="IA_POINTER",e[e.IA_PRIMARY=1]="IA_PRIMARY",e[e.IA_SECONDARY=2]="IA_SECONDARY",e[e.IA_ANY=3]="IA_ANY",e[e.IA_FORWARD=4]="IA_FORWARD",e[e.IA_BACKWARD=5]="IA_BACKWARD",e[e.IA_RIGHT=6]="IA_RIGHT",e[e.IA_LEFT=7]="IA_LEFT",e[e.IA_JUMP=8]="IA_JUMP",e[e.IA_WALK=9]="IA_WALK",e[e.IA_ACTION_3=10]="IA_ACTION_3",e[e.IA_ACTION_4=11]="IA_ACTION_4",e[e.IA_ACTION_5=12]="IA_ACTION_5",e[e.IA_ACTION_6=13]="IA_ACTION_6"})(Ed||(Ed={}));var Td;(function(e){e[e.PET_UP=0]="PET_UP",e[e.PET_DOWN=1]="PET_DOWN",e[e.PET_HOVER_ENTER=2]="PET_HOVER_ENTER",e[e.PET_HOVER_LEAVE=3]="PET_HOVER_LEAVE"})(Td||(Td={}));var vd;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.LOADING=1]="LOADING",e[e.NOT_FOUND=2]="NOT_FOUND",e[e.FINISHED_WITH_ERROR=3]="FINISHED_WITH_ERROR",e[e.FINISHED=4]="FINISHED"})(vd||(vd={}));var kd;(function(e){e[e.TAM_TOP_LEFT=0]="TAM_TOP_LEFT",e[e.TAM_TOP_CENTER=1]="TAM_TOP_CENTER",e[e.TAM_TOP_RIGHT=2]="TAM_TOP_RIGHT",e[e.TAM_MIDDLE_LEFT=3]="TAM_MIDDLE_LEFT",e[e.TAM_MIDDLE_CENTER=4]="TAM_MIDDLE_CENTER",e[e.TAM_MIDDLE_RIGHT=5]="TAM_MIDDLE_RIGHT",e[e.TAM_BOTTOM_LEFT=6]="TAM_BOTTOM_LEFT",e[e.TAM_BOTTOM_CENTER=7]="TAM_BOTTOM_CENTER",e[e.TAM_BOTTOM_RIGHT=8]="TAM_BOTTOM_RIGHT"})(kd||(kd={}));var Rd;(function(e){e[e.F_SANS_SERIF=0]="F_SANS_SERIF",e[e.F_SERIF=1]="F_SERIF",e[e.F_MONOSPACE=2]="F_MONOSPACE"})(Rd||(Rd={}));function $c(e){let r=e.getComponentOrNull("composite::root");return r||e.defineComponent("composite::root",{src:yn.String,entities:yn.Array(yn.Map({src:yn.Entity,dest:yn.Entity}))})}var dg="/";function pg(e,r=!1){let a="",o=0,u=-1,i=0,p;for(let f=0;f<=e.length;++f){if(f<e.length)p=e.charCodeAt(f);else{if(p===47)break;p=47}if(p===47){if(!(u===f-1||i===1))if(u!==f-1&&i===2){if(a.length<2||o!==2||a.charCodeAt(a.length-1)!==46||a.charCodeAt(a.length-2)!==46){if(a.length>2){let c=a.lastIndexOf("/");if(c!==a.length-1){c===-1?(a="",o=0):(a=a.slice(0,c),o=a.length-1-a.lastIndexOf("/")),u=f,i=0;continue}}else if(a.length===2||a.length===1){a="",o=0,u=f,i=0;continue}}r&&(a.length>0?a+="/..":a="..",o=2)}else a.length>0?a+="/"+e.slice(u+1,f):a=e.slice(u+1,f),o=f-u-1;u=f,i=0}else p===46&&i!==-1?++i:i=-1}return a}function ef(...e){let r="",a=!1,o;for(let u=e.length-1;u>=-1&&!a;u--){let i;u>=0?i=e[u]:(o===void 0&&(o=dg),i=o),i.length!==0&&(r=i+"/"+r,a=i.charCodeAt(0)===47)}return r=pg(r,!a),a?r.length>0?"/"+r:"/":r.length>0?r:"."}function Fh(e){if(e.length===0)return".";let r=e.charCodeAt(0),a=r===47,o=-1,u=!0;for(let i=e.length-1;i>=1;--i)if(r=e.charCodeAt(i),r===47){if(!u){o=i;break}}else u=!1;return o===-1?a?"/":".":a&&o===1?"//":e.slice(0,o)}function tf(e,r){return(e.startsWith(".")?ef(r,e):ef(e)).substring(1)}var yi;(function(e){e[e.EMM_NONE=0]="EMM_NONE",e[e.EMM_NEXT_AVAILABLE=1]="EMM_NEXT_AVAILABLE",e[e.EMM_DIRECT_MAPPING=2]="EMM_DIRECT_MAPPING"})(yi||(yi={}));function Lh(e,r){return r.data?.$case==="json"?r.data.json:e.schema.deserialize(new Ut(r.data?.binary))}function hg(e,r){let a=e.getComponentOrNull(r.name);if(a)return a;if(r.name.startsWith("core::")){if(r.name in hu)return hu[r.name](e);throw new Error(`The core component ${r.name} was not found.`)}else{if(r.jsonSchema)return e.defineComponentFromSchema(r.name,yn.fromJson(r.jsonSchema));throw new Error(`${r.name} is not defined and there is no schema to define it.`)}}function yg(e,r,a,{entityMapping:o}){let u=a.get(r);if(u)return u;if(o?.type===yi.EMM_DIRECT_MAPPING){let p=o.getCompositeEntity(r);return a.set(r,p),p}let i=o?.type===yi.EMM_NEXT_AVAILABLE?o.getNextAvailableEntity():e.addEntity();if(i===null)throw new Error("There is no more entities to allocate");return a.set(r,i),i}function wd(e,r,a,o){let{rootEntity:u,alreadyRequestedSrc:i,entityMapping:p}=o,f=i||new Set,c=Fh(ef(r.src)),y=Sr("core::Transform"),R=$c(e),T=new Map,w=Y=>yg(e,Y,T,o),D=u??w(0);u&&T.set(0,u);let B=r.composite.components.find(Y=>Y.name===R.componentName);if(B)for(let[Y,W]of B.data){let Q=Lh(R,W),ce=tf(Q.src,c),$=a.getCompositeOrNull(ce),ye=w(Y);if($){if(f.has($.src)||$.src===r.src)throw new Error(`Composite ${r.src} has a recursive instanciation while try to instance ${$.src}. Previous instances: ${f.toString()}`);wd(e,$,a,{rootEntity:ye,alreadyRequestedSrc:new Set(f).add($.src),entityMapping:p?.type===yi.EMM_NEXT_AVAILABLE?p:void 0})}}for(let Y of r.composite.components){if(Y.name===R.componentName)continue;let W=hg(e,Y);for(let[Q,ce]of Y.data){let $=Lh(W,ce),ye=w(Q),q=W.create(ye,$);if(W.componentId===y){let J=q;J.parent?J.parent=w(J.parent):J.parent=w(0)}else yn.mutateNestedValues(W.schema.jsonSchema,q,(J,ae)=>ae.serializationType==="entity"?{changed:!0,value:w(J)}:{changed:!1})}}let P=R.getMutableOrNull(D)||R.create(D);for(let[Y,W]of T)P.entities.push({src:Y,dest:W});return P.src=r.src,D}var bn=be(ze());var wn=be(ze());var Dh;(function(e){e[e.NULL_VALUE=0]="NULL_VALUE"})(Dh||(Dh={}));function gg(e){switch(e){case 0:case"NULL_VALUE":return 0;default:throw new jh.Error("Unrecognized enum value "+e+" for enum NullValue")}}function xg(e){switch(e){case 0:return"NULL_VALUE";default:throw new jh.Error("Unrecognized enum value "+e+" for enum NullValue")}}function Wh(){return{fields:new Map}}var va;(function(e){function r(f,c=wn.default.Writer.create()){return f.fields.forEach((y,R)=>{y!==void 0&&nf.encode({key:R,value:y},c.uint32(10).fork()).ldelim()}),c}e.encode=r;function a(f,c){let y=f instanceof wn.default.Reader?f:wn.default.Reader.create(f),R=c===void 0?y.len:y.pos+c,T=Wh();for(;y.pos<R;){let w=y.uint32();switch(w>>>3){case 1:if(w!==10)break;let D=nf.decode(y,y.uint32());D.value!==void 0&&T.fields.set(D.key,D.value);continue}if((w&7)===4||w===0)break;y.skipType(w&7)}return T}e.decode=a;function o(f){return{fields:Sg(f.fields)?Object.entries(f.fields).reduce((c,[y,R])=>(c.set(y,R),c),new Map):new Map}}e.fromJSON=o;function u(f){let c={};return c.fields={},f.fields&&f.fields.forEach((y,R)=>{c.fields[R]=y}),c}e.toJSON=u;function i(f){let c=Wh();return f!==void 0&&Object.keys(f).forEach(y=>{c.fields.set(y,f[y])}),c}e.wrap=i;function p(f){let c={};return[...f.fields.keys()].forEach(y=>{c[y]=f.fields.get(y)}),c}e.unwrap=p})(va||(va={}));function _g(){return{key:"",value:void 0}}var nf;(function(e){function r(i,p=wn.default.Writer.create()){return i.key!==""&&p.uint32(10).string(i.key),i.value!==void 0&&Bt.encode(Bt.wrap(i.value),p.uint32(18).fork()).ldelim(),p}e.encode=r;function a(i,p){let f=i instanceof wn.default.Reader?i:wn.default.Reader.create(i),c=p===void 0?f.len:f.pos+p,y=_g();for(;f.pos<c;){let R=f.uint32();switch(R>>>3){case 1:if(R!==10)break;y.key=f.string();continue;case 2:if(R!==18)break;y.value=Bt.unwrap(Bt.decode(f,f.uint32()));continue}if((R&7)===4||R===0)break;f.skipType(R&7)}return y}e.decode=a;function o(i){return{key:Ho(i.key)?String(i.key):"",value:Ho(i?.value)?i.value:void 0}}e.fromJSON=o;function u(i){let p={};return i.key!==void 0&&(p.key=i.key),i.value!==void 0&&(p.value=i.value),p}e.toJSON=u})(nf||(nf={}));function Hh(){return{kind:void 0}}var Bt;(function(e){function r(f,c=wn.default.Writer.create()){switch(f.kind?.$case){case"nullValue":c.uint32(8).int32(f.kind.nullValue);break;case"numberValue":c.uint32(17).double(f.kind.numberValue);break;case"stringValue":c.uint32(26).string(f.kind.stringValue);break;case"boolValue":c.uint32(32).bool(f.kind.boolValue);break;case"structValue":va.encode(va.wrap(f.kind.structValue),c.uint32(42).fork()).ldelim();break;case"listValue":ka.encode(ka.wrap(f.kind.listValue),c.uint32(50).fork()).ldelim();break}return c}e.encode=r;function a(f,c){let y=f instanceof wn.default.Reader?f:wn.default.Reader.create(f),R=c===void 0?y.len:y.pos+c,T=Hh();for(;y.pos<R;){let w=y.uint32();switch(w>>>3){case 1:if(w!==8)break;T.kind={$case:"nullValue",nullValue:y.int32()};continue;case 2:if(w!==17)break;T.kind={$case:"numberValue",numberValue:y.double()};continue;case 3:if(w!==26)break;T.kind={$case:"stringValue",stringValue:y.string()};continue;case 4:if(w!==32)break;T.kind={$case:"boolValue",boolValue:y.bool()};continue;case 5:if(w!==42)break;T.kind={$case:"structValue",structValue:va.unwrap(va.decode(y,y.uint32()))};continue;case 6:if(w!==50)break;T.kind={$case:"listValue",listValue:ka.unwrap(ka.decode(y,y.uint32()))};continue}if((w&7)===4||w===0)break;y.skipType(w&7)}return T}e.decode=a;function o(f){return{kind:Ho(f.nullValue)?{$case:"nullValue",nullValue:gg(f.nullValue)}:Ho(f.numberValue)?{$case:"numberValue",numberValue:Number(f.numberValue)}:Ho(f.stringValue)?{$case:"stringValue",stringValue:String(f.stringValue)}:Ho(f.boolValue)?{$case:"boolValue",boolValue:!!f.boolValue}:Ho(f.structValue)?{$case:"structValue",structValue:f.structValue}:Ho(f.listValue)?{$case:"listValue",listValue:[...f.listValue]}:void 0}}e.fromJSON=o;function u(f){let c={};return f.kind?.$case==="nullValue"&&(c.nullValue=f.kind?.nullValue!==void 0?xg(f.kind?.nullValue):void 0),f.kind?.$case==="numberValue"&&(c.numberValue=f.kind?.numberValue),f.kind?.$case==="stringValue"&&(c.stringValue=f.kind?.stringValue),f.kind?.$case==="boolValue"&&(c.boolValue=f.kind?.boolValue),f.kind?.$case==="structValue"&&(c.structValue=f.kind?.structValue),f.kind?.$case==="listValue"&&(c.listValue=f.kind?.listValue),c}e.toJSON=u;function i(f){let c=Hh();if(f===null)c.kind={$case:"nullValue",nullValue:0};else if(typeof f=="boolean")c.kind={$case:"boolValue",boolValue:f};else if(typeof f=="number")c.kind={$case:"numberValue",numberValue:f};else if(typeof f=="string")c.kind={$case:"stringValue",stringValue:f};else if(Array.isArray(f))c.kind={$case:"listValue",listValue:f};else if(typeof f=="object")c.kind={$case:"structValue",structValue:f};else if(typeof f<"u")throw new Error("Unsupported any value type: "+typeof f);return c}e.wrap=i;function p(f){return f.kind?.$case==="nullValue"?null:f.kind?.$case==="numberValue"?f.kind?.numberValue:f.kind?.$case==="stringValue"?f.kind?.stringValue:f.kind?.$case==="boolValue"?f.kind?.boolValue:f.kind?.$case==="structValue"?f.kind?.structValue:f.kind?.$case==="listValue"?f.kind?.listValue:void 0}e.unwrap=p})(Bt||(Bt={}));function Vh(){return{values:[]}}var ka;(function(e){function r(f,c=wn.default.Writer.create()){for(let y of f.values)Bt.encode(Bt.wrap(y),c.uint32(10).fork()).ldelim();return c}e.encode=r;function a(f,c){let y=f instanceof wn.default.Reader?f:wn.default.Reader.create(f),R=c===void 0?y.len:y.pos+c,T=Vh();for(;y.pos<R;){let w=y.uint32();switch(w>>>3){case 1:if(w!==10)break;T.values.push(Bt.unwrap(Bt.decode(y,y.uint32())));continue}if((w&7)===4||w===0)break;y.skipType(w&7)}return T}e.decode=a;function o(f){return{values:Array.isArray(f?.values)?[...f.values]:[]}}e.fromJSON=o;function u(f){let c={};return f.values?c.values=f.values.map(y=>y):c.values=[],c}e.toJSON=u;function i(f){let c=Vh();return c.values=f??[],c}e.wrap=i;function p(f){return f?.hasOwnProperty("values")&&Array.isArray(f.values)?f.values:f}e.unwrap=p})(ka||(ka={}));var jh=(()=>{if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof global<"u")return global;throw"Unable to locate global object"})();function Sg(e){return typeof e=="object"&&e!==null}function Ho(e){return e!=null}function Eg(){return{data:void 0}}var Vo;(function(e){function r(i,p=bn.default.Writer.create()){switch(i.data?.$case){case"json":Bt.encode(Bt.wrap(i.data.json),p.uint32(10).fork()).ldelim();break;case"binary":p.uint32(18).bytes(i.data.binary);break}return p}e.encode=r;function a(i,p){let f=i instanceof bn.default.Reader?i:bn.default.Reader.create(i),c=p===void 0?f.len:f.pos+p,y=Eg();for(;f.pos<c;){let R=f.uint32();switch(R>>>3){case 1:if(R!==10)break;y.data={$case:"json",json:Bt.unwrap(Bt.decode(f,f.uint32()))};continue;case 2:if(R!==18)break;y.data={$case:"binary",binary:f.bytes()};continue}if((R&7)===4||R===0)break;f.skipType(R&7)}return y}e.decode=a;function o(i){return{data:xi(i.json)?{$case:"json",json:i.json}:xi(i.binary)?{$case:"binary",binary:Rg(i.binary)}:void 0}}e.fromJSON=o;function u(i){let p={};return i.data?.$case==="json"&&(p.json=i.data?.json),i.data?.$case==="binary"&&(p.binary=i.data?.binary!==void 0?wg(i.data?.binary):void 0),p}e.toJSON=u})(Vo||(Vo={}));function Tg(){return{name:"",jsonSchema:void 0,data:new Map}}var Ra;(function(e){function r(i,p=bn.default.Writer.create()){return i.name!==""&&p.uint32(10).string(i.name),i.jsonSchema!==void 0&&Bt.encode(Bt.wrap(i.jsonSchema),p.uint32(18).fork()).ldelim(),i.data.forEach((f,c)=>{rf.encode({key:c,value:f},p.uint32(26).fork()).ldelim()}),p}e.encode=r;function a(i,p){let f=i instanceof bn.default.Reader?i:bn.default.Reader.create(i),c=p===void 0?f.len:f.pos+p,y=Tg();for(;f.pos<c;){let R=f.uint32();switch(R>>>3){case 1:if(R!==10)break;y.name=f.string();continue;case 2:if(R!==18)break;y.jsonSchema=Bt.unwrap(Bt.decode(f,f.uint32()));continue;case 3:if(R!==26)break;let T=rf.decode(f,f.uint32());T.value!==void 0&&y.data.set(T.key,T.value);continue}if((R&7)===4||R===0)break;f.skipType(R&7)}return y}e.decode=a;function o(i){return{name:xi(i.name)?String(i.name):"",jsonSchema:xi(i?.jsonSchema)?i.jsonSchema:void 0,data:bg(i.data)?Object.entries(i.data).reduce((p,[f,c])=>(p.set(Number(f),Vo.fromJSON(c)),p),new Map):new Map}}e.fromJSON=o;function u(i){let p={};return i.name!==void 0&&(p.name=i.name),i.jsonSchema!==void 0&&(p.jsonSchema=i.jsonSchema),p.data={},i.data&&i.data.forEach((f,c)=>{p.data[c]=Vo.toJSON(f)}),p}e.toJSON=u})(Ra||(Ra={}));function vg(){return{key:0,value:void 0}}var rf;(function(e){function r(i,p=bn.default.Writer.create()){return i.key!==0&&p.uint32(8).int32(i.key),i.value!==void 0&&Vo.encode(i.value,p.uint32(18).fork()).ldelim(),p}e.encode=r;function a(i,p){let f=i instanceof bn.default.Reader?i:bn.default.Reader.create(i),c=p===void 0?f.len:f.pos+p,y=vg();for(;f.pos<c;){let R=f.uint32();switch(R>>>3){case 1:if(R!==8)break;y.key=f.int32();continue;case 2:if(R!==18)break;y.value=Vo.decode(f,f.uint32());continue}if((R&7)===4||R===0)break;f.skipType(R&7)}return y}e.decode=a;function o(i){return{key:xi(i.key)?Number(i.key):0,value:xi(i.value)?Vo.fromJSON(i.value):void 0}}e.fromJSON=o;function u(i){let p={};return i.key!==void 0&&(p.key=Math.round(i.key)),i.value!==void 0&&(p.value=i.value?Vo.toJSON(i.value):void 0),p}e.toJSON=u})(rf||(rf={}));function kg(){return{version:0,components:[]}}var gi;(function(e){function r(i,p=bn.default.Writer.create()){i.version!==0&&p.uint32(8).int32(i.version);for(let f of i.components)Ra.encode(f,p.uint32(18).fork()).ldelim();return p}e.encode=r;function a(i,p){let f=i instanceof bn.default.Reader?i:bn.default.Reader.create(i),c=p===void 0?f.len:f.pos+p,y=kg();for(;f.pos<c;){let R=f.uint32();switch(R>>>3){case 1:if(R!==8)break;y.version=f.int32();continue;case 2:if(R!==18)break;y.components.push(Ra.decode(f,f.uint32()));continue}if((R&7)===4||R===0)break;f.skipType(R&7)}return y}e.decode=a;function o(i){return{version:xi(i.version)?Number(i.version):0,components:Array.isArray(i?.components)?i.components.map(p=>Ra.fromJSON(p)):[]}}e.fromJSON=o;function u(i){let p={};return i.version!==void 0&&(p.version=Math.round(i.version)),i.components?p.components=i.components.map(f=>f?Ra.toJSON(f):void 0):p.components=[],p}e.toJSON=u})(gi||(gi={}));var wa=(()=>{if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof global<"u")return global;throw"Unable to locate global object"})();function Rg(e){if(wa.Buffer)return Uint8Array.from(wa.Buffer.from(e,"base64"));{let r=wa.atob(e),a=new Uint8Array(r.length);for(let o=0;o<r.length;++o)a[o]=r.charCodeAt(o);return a}}function wg(e){if(wa.Buffer)return wa.Buffer.from(e).toString("base64");{let r=[];return e.forEach(a=>{r.push(String.fromCharCode(a))}),wa.btoa(r.join(""))}}function bg(e){return typeof e=="object"&&e!==null}function xi(e){return e!=null}var Gr;(function(e){function r(f){return gi.fromJSON(f)}e.fromJson=r;function a(f){return gi.decode(f)}e.fromBinary=a;function o(f){return gi.toJSON(f)}e.toJson=o;function u(f){return gi.encode(f).finish()}e.toBinary=u;function i(f,c,y,R={}){wd(f,c,y,R)}e.instance=i;function p(f,c="/"){return tf(f,c)}e.resolveAndNormalizePath=p})(Gr||(Gr={}));var Ng=Hr(Re),Ag=ed(Re),Ig=$l(Re),zg=td(Re),Pg=nd(Re);var r1=be(Pd()),_n;(function(e){e.createElement=r1.default.createElement})(_n||(_n={}));var D1=be(_1());var Qg={"sans-serif":0,serif:1,monospace:2};function Tr(e){if(e)return{font:Qg[e]}}var Zg={"top-left":0,"top-center":1,"top-right":2,"middle-left":3,"middle-center":4,"middle-right":5,"bottom-left":6,"bottom-center":7,"bottom-right":8};function vr(e){if(e)return{textAlign:Zg[e]}}var Xg={"nine-slices":0,center:1,stretch:2};function E1(e){return{textureMode:e?Xg[e]:1}}function T1(e){if(e.texture)return{tex:{$case:"texture",texture:S1(e.texture)}};if(e.avatarTexture)return{tex:{$case:"avatarTexture",avatarTexture:S1(e.avatarTexture)}}}function S1(e){return{...e,wrapMode:e.wrapMode?Kg[e.wrapMode]:void 0,filterMode:e.filterMode?$g[e.filterMode]:void 0}}var Kg={repeat:0,clamp:1,mirror:2},$g={point:0,"bi-linear":1,"tri-linear":2};function pf(e){if(!e||!Object.keys(e).length)return;let r=T1(e);return{...e,...E1(e.textureMode),uvs:e.uvs??[],texture:r}}function v1(e){return`${e[0].toUpperCase()}${e.slice(1,e.length)}`}function ex(e){return typeof e=="string"&&e.endsWith("%")}function tx(e){return typeof e=="string"&&e.endsWith("px")}function k1(e){function r(a,o){return Number(o.slice(0,o.indexOf(a)))}return e==null?[void 0,0]:typeof e=="number"||typeof e=="string"&&!isNaN(Number(e))?[Number(e),1]:ex(e)?[r("%",e),2]:tx(e)?[r("px",e),1]:[void 0,0]}function Yr(e={},r){if(typeof e=="object"){let f={};for(let c in e){let y=c,R=`${r}${v1(y)}`,T=`${r}${v1(y)}Unit`,[w,D]=k1(e[y]);w!==void 0&&(f[T]=D,f[R]=w)}return f}if(typeof e=="number")return Yr({top:e,left:e,right:e,bottom:e},r);let a=e.split(" ").filter(f=>f!=="");if(a.length===1){let[f]=a;return Yr({top:f,left:f,right:f,bottom:f},r)}if(a.length===2){let[f,c]=a;return Yr({top:f,left:c,right:c,bottom:f},r)}if(a.length===3){let[f,c,y]=a;return Yr({top:f,left:c,right:c,bottom:y},r)}let[o,u,i,p]=a;return Yr({top:o,right:u,bottom:i,left:p},r)}function Si(e,r){let a=`${r}Unit`,[o,u]=k1(e);return o===void 0?{}:{[r]:o,[a]:u}}function R1(e){return{display:e?nx[e]:0}}var nx={flex:0,none:1};function w1(e){return{justifyContent:e?rx[e]:0}}var rx={center:1,"flex-end":2,"flex-start":0,"space-around":4,"space-between":3,"space-evenly":5};function mf(e,r){let a=ox[r];return{[e]:a}}var ox={auto:0,baseline:5,center:2,"flex-end":3,"flex-start":1,stretch:4,"space-between":6,"space-around":7};function b1(e){return{flexDirection:e?ix[e]:0}}var ix={row:0,column:1,"row-reverse":3,"column-reverse":2};function N1(e){return{flexWrap:ax[e]}}var ax={wrap:1,nowrap:0,"wrap-reverse":2};function A1(e){return{overflow:e?ux[e]:0}}var ux={visible:0,scroll:2,hidden:1};function I1(e){return{positionType:e?sx[e]:0}}var sx={relative:0,absolute:1};var Hd=0,cx={overflow:0,display:0,justifyContent:0,alignSelf:0,flexDirection:0,positionType:0,parent:Hd,rightOf:0,flexBasis:0,width:0,height:0,minWidth:0,minHeight:0,maxWidth:0,maxHeight:0,flexGrow:0,marginBottom:0,marginBottomUnit:0,marginLeft:0,marginLeftUnit:0,marginRight:0,marginRightUnit:0,marginTop:0,marginTopUnit:0,maxHeightUnit:0,maxWidthUnit:0,minHeightUnit:0,minWidthUnit:0,paddingBottom:0,paddingBottomUnit:0,paddingLeft:0,paddingLeftUnit:0,paddingTopUnit:0,paddingRight:0,paddingRightUnit:0,paddingTop:0,positionBottom:0,positionBottomUnit:0,positionLeft:0,positionLeftUnit:0,positionRight:0,positionRightUnit:0,positionTop:0,positionTopUnit:0,flexBasisUnit:0,widthUnit:0,heightUnit:0};function hf(e={}){let{height:r,minHeight:a,maxHeight:o,width:u,minWidth:i,maxWidth:p,alignItems:f,alignContent:c,flexWrap:y,...R}=e;return{...cx,...R,...Yr(e.position,"position"),...Yr(e.margin,"margin"),...Yr(e.padding,"padding"),...Si(e.height,"height"),...Si(e.minHeight,"minHeight"),...Si(e.maxHeight,"maxHeight"),...Si(e.width,"width"),...Si(e.minWidth,"minWidth"),...Si(e.maxWidth,"maxWidth"),...R1(e.display),...mf("alignSelf",e.alignSelf??"auto"),...w1(e.justifyContent),...b1(e.flexDirection),...A1(e.overflow),...I1(e.positionType),...c&&mf("alignContent",c),...f&&mf("alignItems",f),...y&&N1(y)}}function Go(e){let{uiTransform:r,uiBackground:a,...o}=e,u=hf(r),i=a?{uiBackground:pf(a)}:void 0;return{...o,uiTransform:u,...i}}var fx={onMouseDown:void 0,onMouseUp:void 0},lx=Object.keys(fx),Na=e=>lx.includes(e);function dx(e){let{textAlign:r,font:a,...o}=e;return{acceptEmpty:!1,options:[],selectedIndex:e.acceptEmpty?-1:0,disabled:!1,...o,...vr(r),...Tr(a)}}function z1(e){let{uiTransform:r,uiBackground:a,onMouseDown:o,onMouseUp:u,...i}=e,p=dx(i),f=Go({uiTransform:r,uiBackground:a,onMouseDown:o,onMouseUp:u});return _n.createElement("entity",{...f,uiDropdown:p})}function px(e){let{textAlign:r,font:a,...o}=e;return{disabled:!1,placeholder:"",...o,...vr(r),...Tr(a)}}function P1(e){let{uiTransform:r,uiBackground:a,onMouseDown:o,onMouseUp:u,...i}=e,p=px(i),f=Go({uiTransform:r,uiBackground:a,onMouseDown:o,onMouseUp:u});return _n.createElement("entity",{...f,uiInput:p})}function O1(e){let{uiTransform:r,uiBackground:a,onMouseDown:o,onMouseUp:u,...i}=e,p=Go({uiTransform:r,uiBackground:a,onMouseDown:o,onMouseUp:u}),{font:f,textAlign:c,...y}=i,R={...y,...Tr(f),...vr(c)};return _n.createElement("entity",{...p,uiText:R})}function mx(e){return e.variant==="secondary"?{uiBackground:{color:{r:1,g:1,b:1,a:1}},uiText:{color:{r:.98,g:.17,b:.33,a:1}}}:{uiBackground:{color:{r:.98,g:.17,b:.33,a:1}},uiText:{color:{r:1,g:1,b:1,a:1}}}}function C1(e){let{uiTransform:r,uiBackground:a,onMouseDown:o,onMouseUp:u,...i}=e,p=mx(e),f=pf({...p.uiBackground,...a}),{font:c,textAlign:y,...R}=i,T={...p.uiText,...R,...Tr(c),...vr(y)},w=hf({height:36,...r});return e.disabled&&(T.color&&(T.color.a/=2),f&&f.color&&(f.color.a/=2)),_n.createElement("entity",{onMouseDown:e.disabled?void 0:o,onMouseUp:e.disabled?void 0:u,uiTransform:w,uiText:T,uiBackground:f})}function hx(e){let r=e.uiText&&{uiText:{...e.uiText,...Tr(e.uiText.font),...vr(e.uiText.textAlign)}};return _n.createElement("entity",{...Go(e),...r})}function U1(e,r,a){if(r&&!a)return{type:"delete",component:e};if(!a)return;if(!r&&a)return{type:"add",props:a,component:e};if(Na(e)&&!Vd(r,a))return{type:"put",component:e,props:a};let o={};for(let u in r){let i=u;Vd(r[i],a[i])||(o[i]=a[i])}if(Object.keys(o).length)return{type:"put",props:o,component:e}}var yx={uiText:void 0,uiBackground:void 0,uiTransform:void 0,onMouseDown:void 0,onMouseUp:void 0,uiInput:void 0,uiDropdown:void 0},B1=Object.keys(yx);function Vd(e,r){if(!e&&!r)return!0;if(!e||!r)return e===r;if(e===r)return!0;if(typeof e!=typeof r)return!1;if(typeof e!="object")return e===r;if(Array.isArray(e)&&Array.isArray(r)&&e.length!==r.length||Object.keys(e).length!==Object.keys(r).length)return!1;if(JSON.stringify(e)===JSON.stringify(r))return!0;for(let a in e)if(!Vd(e[a],r[a]))return!1;return!0}var M1=e=>!!e,F1={supportsMutation:!0,supportsPersistence:!1,noTimeout:-1,isPrimaryRenderer:!0,supportsHydration:!1,insertInContainerBefore(e,r,a){},detachDeletedInstance(e){},hideInstance(e){},hideTextInstance(e){},unhideInstance(e,r){},unhideTextInstance(e,r){},clearContainer(e){},getCurrentEventPriority(){return 0},getInstanceFromNode(e){return null},beforeActiveInstanceBlur(){},afterActiveInstanceBlur(){},prepareScopeUpdate(){},getInstanceFromScope(){return null},commitMount(e,r,a,o){},resetTextContent(e){},commitTextUpdate(e,r,a){},prepareForCommit(e){return null},resetAfterCommit(e){},preparePortalMount(e){},createTextInstance(e,r,a,o){return{}},scheduleTimeout(e,r){},cancelTimeout(e){},shouldSetTextContent(e,r){return!1},getRootHostContext(e){return null},getChildHostContext(e,r,a){return null},getPublicInstance(e){return e},finalizeInitialChildren(e,r,a,o,u){return!1}};function L1(e){return{onMouseDown:1,onMouseUp:0}[e]}function W1(e,r){let a=new Set,o=new Map,u=new Map,i=ya(e),p=ha(e),f=fa(e),c=pa(e),y=ma(e),R=la(e),T=da(e),w={uiTransform:i.componentId,uiText:p.componentId,uiBackground:f.componentId,uiInput:c.componentId,uiDropdown:R.componentId};function D(Z,v){let z=u.get(Z)?.get(v);z&&z()}function B(Z,v){W(Z,v,"uiTransform")}function P(Z,v){if(v.type==="delete"||!v.props){u.get(Z.entity)?.delete(L1(v.component)),v.component==="onMouseDown"?r.removeOnPointerDown(Z.entity):v.component==="onMouseUp"&&r.removeOnPointerUp(Z.entity);return}if(v.props){let z=L1(v.component),V=u.get(Z.entity)||u.set(Z.entity,new Map).get(Z.entity),X=V.get(z);if(V.set(z,v.props),X)return;(v.component==="onMouseDown"?r.onPointerDown:r.onPointerUp)(Z.entity,()=>D(Z.entity,z),{button:0,showFeedback:!0})}}function Y(Z,v){let z=w[v];e.getComponent(z).deleteFrom(Z.entity)}function W(Z,v={},z){let V=w[z];if("onChange"in v){let xe=v.onChange;ye(Z.entity,V,{fn:xe}),delete v.onChange}if(!Object.keys(v).length)return;let X=e.getComponent(V),ue=X.getMutableOrNull(Z.entity)||X.create(Z.entity);for(let xe in v){let Pe=xe;ue[Pe]=v[Pe]}}function Q(Z){o.delete(Z.entity),e.removeEntity(Z.entity);for(let v of Z._child)Q(v)}function ce(Z,v){if(!v||!Object.keys(Z).length)return;if(Z._child.find(V=>V.entity===v.entity)){let V=Z._child.find(X=>X.rightOf===v.entity);V&&(V.rightOf=v.rightOf,Z._child=Z._child.filter(X=>X.entity!==v.entity),Z._child.push(v),B(V,{rightOf:V.rightOf})),v.rightOf=Z._child[Z._child.length-2]?.entity}else v.rightOf=Z._child[Z._child.length-1]?.entity,Z._child.push(v);v.parent=Z.entity,B(v,{rightOf:v.rightOf,parent:Z.entity})}function $(Z,v){let z=Z._child.findIndex(X=>X.entity===v.entity),V=Z._child[z+1];V&&(V.rightOf=v.rightOf,B(V,{rightOf:v.rightOf})),Z._child.splice(z,1),Q(v)}function ye(Z,v,z){let V=o.get(Z)||o.set(Z,new Map).get(Z),X=V.get(v),ue=z?.fn,xe=z?.value??X?.value;V.set(v,{fn:ue,value:xe})}let q={...F1,createInstance(Z,v){let z=e.addEntity();a.add(z);let V={entity:z,_child:[],parent:Hd,rightOf:void 0};for(let X in v){let ue=X;ue==="children"||ue==="key"||(Na(ue)?P(V,{type:"add",props:v[ue],component:ue}):W(V,v[ue],ue))}return V},appendChild:ce,appendChildToContainer:ce,appendInitialChild:ce,removeChild:$,prepareUpdate(Z,v,z,V){return B1.map(X=>U1(X,z[X],V[X])).filter(M1)},commitUpdate(Z,v,z,V,X,ue){for(let xe of v){if(Na(xe.component)){P(Z,xe);continue}xe.type==="delete"?Y(Z,xe.component):xe.props&&W(Z,xe.props,xe.component)}},insertBefore(Z,v,z){let V=Z._child.findIndex(X=>X.entity===z.entity);Z._child=[...Z._child.slice(0,V),v,...Z._child.slice(V)],v.rightOf=z.rightOf,z.rightOf=v.entity,v.parent=Z.entity,B(v,{rightOf:v.rightOf,parent:v.parent}),B(z,{rightOf:z.rightOf})},removeChildFromContainer(Z,v){Q(v)}},J=(0,D1.default)(q),ae=J.createContainer({},0,null,!1,null,"",function(){},null);function ge(Z,v){for(let[z,V]of e.getEntitiesWith(v)){let X=o.get(z)?.get(Z);X?.fn&&V.value!==X.value&&(X.fn(V.value),ye(z,Z,{fn:X.fn,value:V.value}))}}return{update:function(Z){return o.size&&(ge(c.componentId,y),ge(R.componentId,T)),J.updateContainer(Z,ae,null)},getEntities:()=>Array.from(a)}}function jd(e,r){let a=W1(e,r),o;function u(){o&&a.update(o())}return e.addSystem(u,1e5,"@dcl/react-ecs"),{destroy(){e.removeSystem(u);for(let i of a.getEntities())e.removeEntity(i)},setUiRenderer(i){o=i}}}var gx=jd(Re,_d),H1=_n;var V1=H1;var Ou=class{constructor(r,a=!1,o,u){this.initalize(r,a,o,u)}initalize(r,a=!1,o,u){return this.mask=r,this.skipNextObservers=a,this.target=o,this.currentTarget=u,this}},Cu=class{constructor(r,a,o=null){this.callback=r,this.mask=a,this.scope=o,this.unregisterOnNextCall=!1,this._willBeUnregistered=!1}},Vt=class{constructor(r){this._observers=new Array,this._onObserverAdded=null,this._eventState=new Ou(0),r&&(this._onObserverAdded=r)}add(r,a=-1,o=!1,u=null,i=!1){if(!r)return null;let p=new Cu(r,a,u);return p.unregisterOnNextCall=i,o?this._observers.unshift(p):this._observers.push(p),this._onObserverAdded&&this._onObserverAdded(p),p}addOnce(r){return this.add(r,void 0,void 0,void 0,!0)}remove(r){return r&&this._observers.indexOf(r)!==-1?(this._deferUnregister(r),!0):!1}removeCallback(r,a){for(let o=0;o<this._observers.length;o++)if(this._observers[o].callback===r&&(!a||a===this._observers[o].scope))return this._deferUnregister(this._observers[o]),!0;return!1}notifyObservers(r,a=-1,o,u){if(!this._observers.length)return!0;let i=this._eventState;i.mask=a,i.target=o,i.currentTarget=u,i.skipNextObservers=!1,i.lastReturnValue=r;for(let p of this._observers)if(!p._willBeUnregistered&&(p.mask&a&&(p.scope?i.lastReturnValue=p.callback.apply(p.scope,[r,i]):i.lastReturnValue=p.callback(r,i),p.unregisterOnNextCall&&this._deferUnregister(p)),i.skipNextObservers))return!1;return!0}notifyObserversWithPromise(r,a=-1,o,u){let i=Promise.resolve(r);if(!this._observers.length)return i;let p=this._eventState;return p.mask=a,p.target=o,p.currentTarget=u,p.skipNextObservers=!1,this._observers.forEach(f=>{p.skipNextObservers||f._willBeUnregistered||f.mask&a&&(f.scope?i=i.then(c=>(p.lastReturnValue=c,f.callback.apply(f.scope,[r,p]))):i=i.then(c=>(p.lastReturnValue=c,f.callback(r,p))),f.unregisterOnNextCall&&this._deferUnregister(f))}),i.then(()=>r)}notifyObserver(r,a,o=-1){let u=this._eventState;u.mask=o,u.skipNextObservers=!1,r.callback(a,u)}hasObservers(){return this._observers.length>0}clear(){this._observers=new Array,this._onObserverAdded=null}clone(){let r=new Vt;return r._observers=this._observers.slice(0),r}hasSpecificMask(r=-1){for(let a of this._observers)if(a.mask&r||a.mask===r)return!0;return!1}_deferUnregister(r){r.unregisterOnNextCall=!1,r._willBeUnregistered=!0,Promise.resolve().then.bind(Promise.resolve())(async()=>this._remove(r)).catch(console.error)}_remove(r){if(!r)return!1;let a=this._observers.indexOf(r);return a!==-1?(this._observers.splice(a,1),!0):!1}};var j1=require("~system/EngineApi"),G1=j1.subscribe;function rr(e){return()=>{G1({eventId:e}).catch(console.error)}}var Gd=new Vt(rr("onEnterScene")),xx=Gd,Yd=new Vt(rr("onLeaveScene")),_x=Yd,Y1=new Vt(rr("sceneStart")),q1=new Vt(rr("playerExpression")),J1=new Vt(rr("videoEvent")),Q1=new Vt(rr("profileChanged")),Z1=new Vt(rr("playerConnected")),X1=new Vt(rr("playerDisconnected")),K1=new Vt(rr("onRealmChanged")),$1=new Vt(rr("playerClicked")),Uu=new Vt(rr("comms"));function Sx(e){G1=e}async function qd(e){let{events:r}=await e({actions:[]});for(let a of r)if(a.generic){let o=JSON.parse(a.generic.eventData);switch(a.generic.eventId){case"onEnterScene":{Gd.notifyObservers(o);break}case"onLeaveScene":{Yd.notifyObservers(o);break}case"sceneStart":{Y1.notifyObservers(o);break}case"playerExpression":{q1.notifyObservers(o);break}case"videoEvent":{let u=o;J1.notifyObservers(u);break}case"profileChanged":{Q1.notifyObservers(o);break}case"playerConnected":{Z1.notifyObservers(o);break}case"playerDisconnected":{X1.notifyObservers(o);break}case"onRealmChanged":{K1.notifyObservers(o);break}case"playerClicked":{$1.notifyObservers(o);break}case"comms":{Uu.notifyObservers(o);break}}}}var ey=be(require("~system/CommunicationsController")),Jd=class{constructor(){this.messageQueue=[],this.flushing=!1}on(r,a){return Uu.add(o=>{let u=JSON.parse(o.message);u.message===r&&a(u.payload,o.sender)})}sendRaw(r){this.messageQueue.push(r),this.flush()}emit(r,a){let o=JSON.stringify({message:r,payload:a});this.sendRaw(o),Uu.notifyObservers({message:o,sender:"self"})}flush(){if(this.messageQueue.length===0||this.flushing)return;let r=this.messageQueue.shift();this.flushing=!0,ey.send({message:r}).then(a=>{this.flushing=!1,this.flush()},a=>{this.flushing=!1})}};var ny=require("~system/EthereumController");function ty(e){async function r(a){let o=await e({id:a.id,method:a.method,jsonParams:JSON.stringify(a.params)});return JSON.parse(o.jsonAnyResponse)}return{send(a,o){if(a&&o&&o instanceof Function)r(a).then(u=>o(null,u)).catch(o);else throw new Error("Decentraland provider only allows async calls")},sendAsync(a,o){r(a).then(u=>o(null,u)).catch(o)}}}function Ex(){return ty(ny.sendAsync)}var Aa=require("~system/EngineApi");function ry(e){async function r(o){let u=await e.crdtSendToRenderer({data:new Uint8Array(o)});if(u&&u.data&&u.data.length&&a.onmessage)for(let i of u.data)a.onmessage(i)}let a={async send(o){try{await r(o)}catch(u){console.error(u);debugger}},filter(o){return o.componentId>od?!1:!!o}};return a}var Qd={};var yf=[],Zd={getCompositeOrNull(e,r){let a=Qd[e];if(a){try{if(a instanceof Uint8Array){let o=Gr.fromBinary(a);yf.push({src:e,composite:o})}else if(typeof a=="string"){let o=Gr.fromJson(JSON.parse(a));yf.push({src:e,composite:o})}else if(typeof a=="object"){let o=Gr.fromJson(a);yf.push({src:e,composite:o})}}catch(o){console.error(o)}delete Qd[e]}return yf.find(o=>o.src===e)||null}};var gf=ry({crdtSendToRenderer:Aa.crdtSendToRenderer});Re.addTransport(gf);async function Tx(e){Re.seal(),await Re.update(e),await qd(Aa.sendBatch)}async function vx(){let e=await(0,Aa.crdtGetState)({data:new Uint8Array});if(!e.hasEntities){let r=Zd.getCompositeOrNull("main.composite");if(r)try{Gr.instance(Re,r,Zd)}catch(a){console.log("Warning: main.composite couldn't be instanced."),console.error(a)}}if(gf.onmessage&&e&&e.data&&e.data.length)for(let r of e.data)gf.onmessage(r)}
12
12
  /*! Bundled license information:
13
13
 
14
14
  react/cjs/react.production.min.js: