bimland/public/Cesium/Workers/S3MBTilesParser.js

2 lines
241 KiB
JavaScript

define(["./createTaskProcessorWorker","./Check-7b2a090c","./FeatureDetection-c3b71206","./when-b60132fc","./PrimitiveType-a54dc62f","./Cartesian2-47311507","./Cartographic-3309dd0d","./Cartesian4-3ca25aab","./Color-5008547b","./ComponentDatatype-c140a87d","./getStringFromTypedArray-c37342c0","./buildModuleUrl-4e1b81e7","./S3MCompressType-555475e4","./IndexDatatype-8a5eead4","./RuntimeError-4a5c8994","./BoundingRectangle-3ed8ca6d","./pako_inflate-f73548c4","./arrayFill-4513d7ad","./CompressedTextureBuffer-290a1ff4","./PixelFormat-fd637eac","./Math-119be1a3","./WebGLConstants-4ae0db90","./Event-16a2dfbf"],(function(e,t,r,n,o,a,i,s,c,E,u,l,d,A,f,p,_,g,m,T,y,B,C){"use strict";function D(e,t,n){if("function"==typeof e.slice)return e.slice(t,n);for(var o=Array.prototype.slice.call(e,t,n),a=r.FeatureDetection.typedArrayTypes,i=a.length,s=0;s<i;++s)if(e instanceof a[s]){o=new a[s](o);break}return o}function h(){}var O;function P(e,t){for(var r=e.num_points(),n=e.num_faces(),o=new O.DracoInt32Array,a=3*n,i=A.IndexDatatype.createTypedArray(r,a),s=0,c=0;c<n;++c)t.GetFaceFromMesh(e,c,o),i[s+0]=o.GetValue(0),i[s+1]=o.GetValue(1),i[s+2]=o.GetValue(2),s+=3;var E=A.IndexDatatype.UNSIGNED_SHORT;return i instanceof Uint32Array&&(E=A.IndexDatatype.UNSIGNED_INT),O.destroy(o),{typedArray:i,numberOfIndices:a,indexDataType:E}}function v(e,t,r,n,o){var a,i;n.quantizationBits<=8?(i=new O.DracoUInt8Array,a=new Uint8Array(o),t.GetAttributeUInt8ForAllPoints(e,r,i)):(i=new O.DracoUInt16Array,a=new Uint16Array(o),t.GetAttributeUInt16ForAllPoints(e,r,i));for(var s=0;s<o;++s)a[s]=i.GetValue(s);return O.destroy(i),a}function F(e,t,r,n){var o,a;switch(r.data_type()){case 1:case 11:a=new O.DracoInt8Array,o=new Int8Array(n),t.GetAttributeInt8ForAllPoints(e,r,a);break;case 2:a=new O.DracoUInt8Array,o=new Uint8Array(n),t.GetAttributeUInt8ForAllPoints(e,r,a);break;case 3:a=new O.DracoInt16Array,o=new Int16Array(n),t.GetAttributeInt16ForAllPoints(e,r,a);break;case 4:a=new O.DracoUInt16Array,o=new Uint16Array(n),t.GetAttributeUInt16ForAllPoints(e,r,a);break;case 5:case 7:a=new O.DracoInt32Array,o=new Int32Array(n),t.GetAttributeInt32ForAllPoints(e,r,a);break;case 6:case 8:a=new O.DracoUInt32Array,o=new Uint32Array(n),t.GetAttributeUInt32ForAllPoints(e,r,a);break;case 9:case 10:a=new O.DracoFloat32Array,o=new Float32Array(n),t.GetAttributeFloatForAllPoints(e,r,a)}for(var i=0;i<n;++i)o[i]=a.GetValue(i);return O.destroy(a),o}function M(e,t,r){var o,a=e.num_points(),i=r.num_components(),s=new O.AttributeQuantizationTransform;if(s.InitFromAttribute(r)){for(var c=new Array(i),u=0;u<i;++u)c[u]=s.min_value(u);o={quantizationBits:s.quantization_bits(),minValues:c,range:s.range(),octEncoded:!1}}O.destroy(s),(s=new O.AttributeOctahedronTransform).InitFromAttribute(r)&&(o={quantizationBits:s.quantization_bits(),octEncoded:!0}),O.destroy(s);var l,d=a*i;l=n.defined(o)?v(e,t,r,o,d):F(e,t,r,d);var A=E.ComponentDatatype.fromTypedArray(l);return{array:l,data:{componentsPerAttribute:i,componentDatatype:A,byteOffset:r.byte_offset(),byteStride:E.ComponentDatatype.getSizeInBytes(A)*i,normalized:r.normalized(),quantization:o}}}var S=new i.Cartesian3(40680631590769,40680631590769,40408299984661.445),b=new i.Cartesian3,R=new i.Cartesian3;function w(e,t,r,o){var a=Math.cos(t);b.x=a*Math.cos(e),b.y=a*Math.sin(e),b.z=Math.sin(t),b=i.Cartesian3.normalize(b,b),i.Cartesian3.multiplyComponents(S,b,R);var s=Math.sqrt(i.Cartesian3.dot(b,R));return R=i.Cartesian3.divideByScalar(R,s,R),b=i.Cartesian3.multiplyByScalar(b,r,b),n.defined(o)||(o=new i.Cartesian3),i.Cartesian3.add(R,b,o)}var I=new o.Matrix4,L=new o.Matrix4,x=new i.Cartesian3,N=new i.Cartographic;function U(e,t,r,c,u,l,A,f){var p=void 0,_=void 0,g=r.vertexAttributes,m=r.attrLocation;if(r.nCompressOptions=0,n.defined(c.posUniqueID)&&c.posUniqueID>=0){n.defined(f)||(r.nCompressOptions|=d.VertexCompressOption.SVC_Vertex);var T=t.GetAttribute(e,c.posUniqueID),y=M(e,t,T),B=y.data.componentsPerAttribute;r.verticesCount=y.array.length/B,r.vertCompressConstant=y.data.quantization.range/(1<<y.data.quantization.quantizationBits);var C=y.data.quantization.minValues;if(r.minVerticesValue=new s.Cartesian4(C[0],C[1],C[2],1),B>3&&(r.minVerticesValue.w=C[3]),n.defined(f)){var D=y.array,h=3===B?i.Cartesian3.unpackArray(D):s.Cartesian4.unpackArray(D);for(let e=0,t=h.length;e<t;e++){let t=h[e];i.Cartesian3.multiplyByScalar(t,r.vertCompressConstant,t),i.Cartesian3.add(t,r.minVerticesValue,t)}var O=o.Matrix4.multiply(f.sphereMatrix,f.geoMatrix,I),P=o.Matrix4.multiply(f.ellipsoidMatrix,f.geoMatrix,L);o.Matrix4.inverse(P,P);var v=new a.Ellipsoid(6378137,6378137,6378137);for(let e=0,t=h.length;e<t;e++){let t=h[e];o.Matrix4.multiplyByPoint(O,t,x);let r=v.cartesianToCartographic(x,N),n=w(r.longitude,r.latitude,r.height,x);o.Matrix4.multiplyByPoint(P,n,t)}var F=new Array(3*h.length);3===B?i.Cartesian3.packArray(h,F):s.Cartesian4.packArray(h,F),y.array=new Float32Array(F),y.data.componentDatatype=E.ComponentDatatype.FLOAT,y.data.byteStride=4*B}if(m.aPosition=g.length,g.push({index:m.aPosition,typedArray:y.array,componentsPerAttribute:B,componentDatatype:y.data.componentDatatype,offsetInBytes:y.data.byteOffset,strideInBytes:y.data.byteStride,normalize:y.data.normalized}),l){var S=r.verticesCount,b=new i.Cartesian3,R=new i.Cartesian3,U=new i.Cartographic;p=new i.Cartographic,_=new i.Cartographic;for(var G=new Float32Array(2*S),k=new Float64Array(2*S),H=0;H<S;H++)o.Matrix4.multiplyByPoint(u,i.Cartesian3.fromElements(y.array[3*H]*r.vertCompressConstant+C[0],y.array[3*H+1]*r.vertCompressConstant+C[1],y.array[3*H+2]*r.vertCompressConstant+C[2],b),R),U=i.Cartographic.fromCartesian(R),k[2*H]=U.longitude,k[2*H+1]=U.latitude,0===H?(p.longitude=U.longitude,p.latitude=U.latitude,_.longitude=U.longitude,_.latitude=U.latitude):(p.longitude=Math.max(U.longitude,p.longitude),p.latitude=Math.max(U.latitude,p.latitude),_.longitude=Math.min(U.longitude,_.longitude),_.latitude=Math.min(U.latitude,_.latitude));for(H=0;H<S;H++)G[2*H]=k[2*H]-_.longitude,G[2*H+1]=k[2*H+1]-_.latitude;m.img=g.length,g.push({index:m.img,typedArray:G,componentsPerAttribute:2,componentDatatype:E.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:2*Float32Array.BYTES_PER_ELEMENT,normalize:!1}),A.max=p,A.min=_}}if(n.defined(c.normalUniqueID)&&c.normalUniqueID>=0){r.nCompressOptions|=d.VertexCompressOption.SVC_Normal;var X=t.GetAttribute(e,c.normalUniqueID),V=M(e,t,X),K=V.data.quantization;r.normalRangeConstant=(1<<K.quantizationBits)-1,m.aNormal=g.length,g.push({index:m.aNormal,typedArray:V.array,componentsPerAttribute:V.data.componentsPerAttribute,componentDatatype:V.data.componentDatatype,offsetInBytes:V.data.byteOffset,strideInBytes:V.data.byteStride,normalize:V.data.normalized})}if(n.defined(c.colorUniqueID)&&c.colorUniqueID>=0){r.nCompressOptions|=d.VertexCompressOption.SVC_VertexColor;var j=t.GetAttribute(e,c.colorUniqueID),Y=M(e,t,j);m.aColor=g.length,g.push({index:m.aColor,typedArray:Y.array,componentsPerAttribute:Y.data.componentsPerAttribute,componentDatatype:Y.data.componentDatatype,offsetInBytes:Y.data.byteOffset,strideInBytes:Y.data.byteStride,normalize:Y.data.normalized})}for(H=0;H<c.texCoordUniqueIDs.length;H++){r.texCoordCompressConstant=[],r.minTexCoordValue=[];var Q=c.texCoordUniqueIDs[H];if(!(Q<0)){var J=t.GetAttribute(e,Q),W=M(e,t,J);if(n.defined(W.data.quantization)){r.nCompressOptions|=d.VertexCompressOption.SVC_TexutreCoord,r.texCoordCompressConstant.push(W.data.quantization.range/(1<<W.data.quantization.quantizationBits));C=W.data.quantization.minValues;r.minTexCoordValue.push(new a.Cartesian2(C[0],C[1]))}var z="aTexCoord"+H;m[z]=g.length,g.push({index:m[z],typedArray:W.array,componentsPerAttribute:W.data.componentsPerAttribute,componentDatatype:W.data.componentDatatype,offsetInBytes:W.data.byteOffset,strideInBytes:W.data.byteStride,normalize:W.data.normalized}),r.textureCoordIsW=!0}}for(H=0;H<c.vertexAttrUniqueIDs.length;H++){var Z=c.vertexAttrUniqueIDs[H];if(!(Z<0)){var q=t.GetAttribute(e,Z),$=M(e,t,q);m.aVertexWeight=g.length,g.push({index:m.aVertexWeight,typedArray:$.array,componentsPerAttribute:$.data.componentsPerAttribute,componentDatatype:$.data.componentDatatype,offsetInBytes:$.data.byteOffset,strideInBytes:$.data.byteStride,normalize:$.data.normalized}),r.customVertexAttribute={VertexWeight:0}}}}h.dracoDecodePointCloud=function(e,t,r,n,o){for(var a=new(O=e).Decoder,i=["POSITION","NORMAL","COLOR"],s=0;s<i.length;++s)a.SkipAttributeTransform(O[i[s]]);var c=new O.DecoderBuffer;if(c.Init(t,r),a.GetEncodedGeometryType(c)!==O.POINT_CLOUD)throw new f.RuntimeError("Draco geometry type must be POINT_CLOUD.");var E=new O.PointCloud,u=a.DecodeBufferToPointCloud(c,E);if(!u.ok()||0===E.ptr)throw new f.RuntimeError("Error decoding draco point cloud: "+u.error_msg());O.destroy(c),U(E,a,n,o),O.destroy(E),O.destroy(a)},h.dracoDecodeMesh=function(e,t,r,n,a,i,s,c,E,u){for(var l=new(O=e).Decoder,d=["POSITION","NORMAL","COLOR","TEX_COORD"],A=0;A<d.length;++A)l.SkipAttributeTransform(O[d[A]]);var p=new O.DecoderBuffer;if(p.Init(t,r),l.GetEncodedGeometryType(p)!==O.TRIANGULAR_MESH)throw new f.RuntimeError("Unsupported draco mesh geometry type.");var _=new O.Mesh,g=l.DecodeBufferToMesh(p,_);if(!g.ok()||0===_.ptr)throw new f.RuntimeError("Error decoding draco mesh geometry: "+g.error_msg());O.destroy(p),U(_,l,n,i,s,c,E,u);var m=P(_,l);a.indicesTypedArray=m.typedArray,a.indicesCount=m.numberOfIndices,a.indexType=m.indexDataType,a.primitiveType=o.PrimitiveType.TRIANGLES,O.destroy(_),O.destroy(l)};var G={OSGBFile:0,OSGBCacheFile:1,ClampGroundPolygon:2,ClampObjectPolygon:3,ClampGroundLine:4,ClampObjectLine:5,IconPoint:6,Text:7,PointCloudFile:8,ExtendRegion3D:9,ExtendClampPolygonCache:10,PolylineEffect:11,RegionEffect:12,ClampGroundAndObjectLineCache:13,ClampGroundRealtimeRasterCache:14},k=Object.freeze(G);function H(){}function X(e){var t=new l.BoundingSphere,r=e.instanceBounds;if(!n.defined(r))return t;var o=new i.Cartesian3(r[0],r[1],r[2]),a=new i.Cartesian3(r[3],r[4],r[5]),s=i.Cartesian3.lerp(o,a,.5,new i.Cartesian3),c=i.Cartesian3.distance(s,o);return t.center=s,t.radius=c,t}function V(e){var t,r,o=new l.BoundingSphere,a=new i.Cartesian3,s=e.vertexAttributes[0],c=s.componentsPerAttribute,E=n.defined(e.nCompressOptions)&&(e.nCompressOptions&d.VertexCompressOption.SVC_Vertex)===d.VertexCompressOption.SVC_Vertex,u=1;E?(u=e.vertCompressConstant,t=new i.Cartesian3(e.minVerticesValue.x,e.minVerticesValue.y,e.minVerticesValue.z),r=new Uint16Array(s.typedArray.buffer,s.typedArray.byteOffset,s.typedArray.byteLength/2)):r=new Float32Array(s.typedArray.buffer,s.typedArray.byteOffset,s.typedArray.byteLength/4);for(var A=[],f=0;f<e.verticesCount;f++)i.Cartesian3.fromArray(r,c*f,a),E&&(a=i.Cartesian3.multiplyByScalar(a,u,a),a=i.Cartesian3.add(a,t,a)),A.push(i.Cartesian3.clone(a));return l.BoundingSphere.fromPoints(A,o),A.length=0,o}function K(e){var t,r,o=new l.BoundingSphere,a=new i.Cartesian3,s=n.defined(e.nCompressOptions)&&(e.nCompressOptions&d.VertexCompressOption.SVC_Vertex)===d.VertexCompressOption.SVC_Vertex,c=e.vertexAttributes[0],E=c.componentsPerAttribute,u=1;s?(u=e.vertCompressConstant,r=new i.Cartesian3(e.minVerticesValue.x,e.minVerticesValue.y,e.minVerticesValue.z),t=new Uint16Array(c.typedArray.buffer,c.typedArray.byteOffset,c.typedArray.byteLength/2)):t=new Float32Array(c.typedArray.buffer,c.typedArray.byteOffset,c.typedArray.byteLength/4);for(var A=[],f=0;f<e.verticesCount;f++)i.Cartesian3.fromArray(t,E*f,a),s&&(a=i.Cartesian3.multiplyByScalar(a,u,a),a=i.Cartesian3.add(a,r,a)),A.push(i.Cartesian3.clone(a));return l.BoundingSphere.fromPoints(A,o),A.length=0,o}function j(e){var t,r,o=n.defined(e.nCompressOptions)&&(e.nCompressOptions&d.VertexCompressOption.SVC_Vertex)===d.VertexCompressOption.SVC_Vertex,s=new p.BoundingRectangle,c=e.vertexAttributes[0],E=c.componentsPerAttribute,u=1;o?(u=e.vertCompressConstant,r=new i.Cartesian3(e.minVerticesValue.x,e.minVerticesValue.y,e.minVerticesValue.z),t=new Uint16Array(c.typedArray.buffer,c.typedArray.byteOffset,c.typedArray.byteLength/2)):t=new Float32Array(c.typedArray.buffer,c.typedArray.byteOffset,c.typedArray.byteLength/4);for(var l=[],A=0;A<e.verticesCount;A++){var f=t[E*A],_=t[E*A+1];o&&(f=u*f+r.x,_=u*_+r.y),l.push(new a.Cartesian2(f,_))}return p.BoundingRectangle.fromPoints(l,s),l.length=0,s}function Y(e){var t,r,o=n.defined(e.nCompressOptions)&&(e.nCompressOptions&d.VertexCompressOption.SVC_Vertex)===d.VertexCompressOption.SVC_Vertex,a=new l.BoundingSphere,s=new i.Cartesian3,c=new i.Cartesian3,E=e.vertexAttributes[0],u=E.componentsPerAttribute,A=e.attrLocation.aPosition,f=e.vertexAttributes[A],p=e.attrLocation.aTexCoord5,_=e.vertexAttributes[p],g=_.componentsPerAttribute;o?(u=3,g=3,t=W(e,f),r=z(e,_,5)):(t=new Float32Array(E.typedArray.buffer,E.typedArray.byteOffset,E.typedArray.byteLength/4),r=new Float32Array(_.typedArray.buffer,_.typedArray.byteOffset,_.typedArray.byteLength/4));for(var m=[],T=0;T<e.verticesCount;T++)i.Cartesian3.fromArray(t,u*T,s),i.Cartesian3.fromArray(r,g*T,c),i.Cartesian3.add(s,c,s),m.push(i.Cartesian3.clone(s));return l.BoundingSphere.fromPoints(m,a),m.length=0,a}function Q(e){var t=o.PrimitiveType.TRIANGLES;switch(e){case 1:t=o.PrimitiveType.POINTS;break;case 2:t=o.PrimitiveType.LINES;break;case 3:t=o.PrimitiveType.LINE_STRIP;break;case 4:t=o.PrimitiveType.TRIANGLES}return t}function J(e,t,r,n){var a,i={};i.indicesCount=6*(e-t),i.indexType=n>65535?1:0,i.primitiveType=o.PrimitiveType.TRIANGLES,a=0===i.indexType?new Uint16Array(i.indicesCount):new Uint32Array(i.indicesCount);for(var s=0,c=0;c<t;c++){for(var E=0;E<r[c]-1;E++)a[6*(s-c+E)]=4*(s-c+E),a[6*(s-c+E)+1]=4*(s-c+E)+2,a[6*(s-c+E)+2]=4*(s-c+E)+1,a[6*(s-c+E)+3]=4*(s-c+E)+1,a[6*(s-c+E)+4]=4*(s-c+E)+2,a[6*(s-c+E)+5]=4*(s-c+E)+3;s+=r[c]}return i.indicesTypedArray=a,i}function W(e,t){for(var r,n,o,a=t.componentsPerAttribute,s=e.vertCompressConstant,c=new i.Cartesian3(e.minVerticesValue.x,e.minVerticesValue.y,e.minVerticesValue.z),E=new Uint16Array(t.typedArray.buffer,t.typedArray.byteOffset,t.typedArray.byteLength/2),u=new Float32Array(3*e.verticesCount),l=0;l<e.verticesCount;l++)r=E[a*l]*s+c.x,n=E[a*l+1]*s+c.y,o=E[a*l+2]*s+c.z,u[3*l]=r,u[3*l+1]=n,u[3*l+2]=o;return u}function z(e,t,r){for(var n,o,a,i=t.componentsPerAttribute,c=e.texCoordCompressConstant[r],E=new s.Cartesian4(e.minTexCoordValue[r].x,e.minTexCoordValue[r].y,e.minTexCoordValue[r].z,e.minTexCoordValue[r].w),u=new Uint16Array(t.typedArray.buffer,t.typedArray.byteOffset,t.typedArray.byteLength/2),l=new Float32Array(3*e.verticesCount),d=0;d<e.verticesCount;d++)n=u[i*d]*c+E.x,o=u[i*d+1]*c+E.y,a=u[i*d+2]*c+E.z,l[3*d]=n,l[3*d+1]=o,l[3*d+2]=a;return l}function Z(e){for(var t=[],r=e.length,n=0;n<r;n++){var a=Q(e[n].primitiveType);a!==o.PrimitiveType.LINES&&a!==o.PrimitiveType.LINE_STRIP||t.push(e[n])}return t}function q(e){for(var t=0,r=e.length,n=0;n<r;n++){var a=e[n],i=Q(a.primitiveType);i==o.PrimitiveType.LINES?t+=a.indicesCount/2:i==o.PrimitiveType.LINE_STRIP&&t++}return t}function $(e){for(var t=0,r=e.length,n=0;n<r;n++){t+=e[n].indicesCount}return t}function ee(e,t,r){for(var n,a=[],s=r.length,c=0;c<s;c++){var E,u=r[c];E=0===u.indexType?new Uint16Array(u.indicesTypedArray.buffer,u.indicesTypedArray.byteOffset,u.indicesTypedArray.byteLength/2):new Uint32Array(u.indicesTypedArray.buffer,u.indicesTypedArray.byteOffset,u.indicesTypedArray.byteLength/4);var l=Q(u.primitiveType);if(l==o.PrimitiveType.LINES)for(n=0;n<u.indicesCount;n+=2){var d=[],A=new i.Cartesian3;A.x=e[E[n]*t],A.y=e[E[n]*t+1],A.z=e[E[n]*t+2],d.push(A);var f=new i.Cartesian3;f.x=e[E[n+1]*t],f.y=e[E[n+1]*t+1],f.z=e[E[n+1]*t+2],d.push(f),a.push(d)}else if(l==o.PrimitiveType.LINE_STRIP){d=[];for(n=0;n<u.indicesCount;n++){var p=new i.Cartesian3;p.x=e[E[n]*t],p.y=e[E[n]*t+1],p.z=e[E[n]*t+2],d.push(p)}a.push(d)}}return a}H.calcBoundingSphereInWorker=function(e,t){return t.instanceIndex>-1?X(t):n.defined(t.clampRegionEdge)?Y(t):e>=k.ClampGroundPolygon&&e<=k.ClampObjectLine?K(t):e==k.ClampGroundAndObjectLineCache?Y(t):V(t)},H.calcBoundingSphere=function(e,t,r){var o,a=e._fileType;return o=t.instanceIndex>-1?X(t):n.defined(t.clampRegionEdge)?Y(t):a>=k.ClampGroundPolygon&&a<=k.ClampObjectLine?K(t):a==k.ClampGroundAndObjectLineCache?Y(t):V(t),l.BoundingSphere.transform(o,r,o),o},H.calcBoundingRectangle=function(e,t){var r;return e._fileType===k.ClampGroundPolygon&&(r=j(t)),r},H.createEdge=function(e,t){if(!(t.length<1)){var r=Z(t);if(0!=r.length){var o,a=q(r),i=e.attrLocation.aPosition,s=e.vertexAttributes[i],c=n.defined(e.nCompressOptions)&&(e.nCompressOptions&d.VertexCompressOption.SVC_Vertex)===d.VertexCompressOption.SVC_Vertex,u=s.componentsPerAttribute;c?(u=3,o=W(e,s)):o=new Float32Array(s.typedArray.buffer,s.typedArray.byteOffset,s.typedArray.byteLength/4);for(var l=$(r),A=ee(o,u,r),f=4*l-4*a,p=new Float32Array(3*f),_=new Float32Array(3*f),g=new Float32Array(3*f),m=new Int8Array(2*f),T=0,y=0;y<a;y++){for(var B=A[y].length,C=0;C<B;C++){var D=4*T-4*y,h=3*D+12*C,O=A[y][C];0!=C&&(p[h-6]=O.x,p[h-5]=O.y,p[h-4]=O.z,p[h-3]=O.x,p[h-2]=O.y,p[h-1]=O.z),C!=B-1&&(p[h]=O.x,p[h+1]=O.y,p[h+2]=O.z,p[h+3]=O.x,p[h+4]=O.y,p[h+5]=O.z);var P=O;C+1<B&&(P=A[y][C+1]),0!=C&&(g[h-6]=P.x,g[h-5]=P.y,g[h-4]=P.z,g[h-3]=P.x,g[h-2]=P.y,g[h-1]=P.z),C!=B-1&&(g[h]=P.x,g[h+1]=P.y,g[h+2]=P.z,g[h+3]=P.x,g[h+4]=P.y,g[h+5]=P.z);var v=O;C>=1&&(v=A[y][C-1]),0!=C&&(_[h-6]=v.x,_[h-5]=v.y,_[h-4]=v.z,_[h-3]=v.x,_[h-2]=v.y,_[h-1]=v.z),C!=B-1&&(_[h]=v.x,_[h+1]=v.y,_[h+2]=v.z,_[h+3]=v.x,_[h+4]=v.y,_[h+5]=v.z),h=2*D+8*C,0!=C&&(m[h-4]=-1,m[h-3]=-1,m[h-2]=1,m[h-1]=-1),C!=B-1&&(m[h]=-1,m[h+1]=1,m[h+2]=1,m[h+3]=1)}T+=A[y].length}var F={vertexAttributes:[],attrLocation:{}},M=F.vertexAttributes,S=F.attrLocation;F.instanceCount=0,F.instanceMode=0,S.aPosition=0,M.push({index:S.aPosition,typedArray:p,componentsPerAttribute:3,componentDatatype:E.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:3*Float32Array.BYTES_PER_ELEMENT,normalize:!1}),S.aNormal=1,M.push({index:S.aNormal,typedArray:_,componentsPerAttribute:3,componentDatatype:E.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:3*Float32Array.BYTES_PER_ELEMENT,normalize:!1}),S.aTexCoord0=2,M.push({index:S.aTexCoord0,typedArray:g,componentsPerAttribute:3,componentDatatype:E.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:3*Float32Array.BYTES_PER_ELEMENT,normalize:!1}),S.aTexCoord1=3,M.push({index:S.aTexCoord1,typedArray:m,componentsPerAttribute:2,componentDatatype:E.ComponentDatatype.BYTE,offsetInBytes:0,strideInBytes:2*Int8Array.BYTES_PER_ELEMENT,normalize:!1});for(var b=[],R=0;R<A.length;R++)b.push(A[R].length);return{vertexPackage:F,indexPackage:J(l,a,b,f)}}}};var te,re={S3M:49,S3M4:1},ne=Object.freeze(re),oe=function(){var e=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if("object"!=typeof WebAssembly)return{supported:!1};var r,n="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";WebAssembly.validate(e)&&(n="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");var o=WebAssembly.instantiate(function(e){for(var r=new Uint8Array(e.length),n=0;n<e.length;++n){var o=e.charCodeAt(n);r[n]=o>96?o-71:o>64?o-65:o>47?o+4:o>46?63:62}var a=0;for(n=0;n<e.length;++n)r[a++]=r[n]<60?t[r[n]]:64*(r[n]-60)+r[++n];return r.buffer.slice(0,a)}(n),{}).then((function(e){(r=e.instance).exports.__wasm_call_ctors()}));function a(e,t,n,o,a,i){var s=r.exports.sbrk,c=n+3&-4,E=s(c*o),u=s(a.length),l=new Uint8Array(r.exports.memory.buffer);l.set(a,u);var d=e(E,n,o,u,a.length);if(0==d&&i&&i(E,c,o),t.set(l.subarray(E,E+n*o)),s(E-s(0)),0!=d)throw new Error("Malformed buffer data: "+d)}var i={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},s={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return{ready:o,supported:!0,decodeVertexBuffer:function(e,t,n,o,s){a(r.exports.meshopt_decodeVertexBuffer,e,t,n,o,r.exports[i[s]])},decodeIndexBuffer:function(e,t,n,o){a(r.exports.meshopt_decodeIndexBuffer,e,t,n,o)},decodeIndexSequence:function(e,t,n,o){a(r.exports.meshopt_decodeIndexSequence,e,t,n,o)},decodeGltfBuffer:function(e,t,n,o,c,E){a(r.exports[s[c]],e,t,n,o,r.exports[i[E]])}}}(),ae=void 0!==ae?ae:{},ie={};for(te in ae)ae.hasOwnProperty(te)&&(ie[te]=ae[te]);var se="./this.program",ce=function(e,t){throw t},Ee=!1,ue=!1,le=!1,de=!1;if(Ee="object"==typeof window,ue="function"==typeof importScripts,le="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,de=!Ee&&!le&&!ue,ae.ENVIRONMENT)throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)");var Ae,fe,pe,_e,ge,me="";function Te(e){return ae.locateFile?ae.locateFile(e,me):me+e}if(le)me=ue?require("path").dirname(me)+"/":__dirname+"/",Ae=function(e,t){return _e||(_e=require("fs")),ge||(ge=require("path")),e=ge.normalize(e),_e.readFileSync(e,t?null:"utf8")},pe=function(e){var t=Ae(e,!0);return t.buffer||(t=new Uint8Array(t)),we(t.buffer),t},process.argv.length>1&&(se=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),"undefined"!=typeof module&&(module.exports=ae),process.on("uncaughtException",(function(e){if(!(e instanceof Ks))throw e})),process.on("unhandledRejection",Ft),ce=function(e){process.exit(e)},ae.inspect=function(){return"[Emscripten Module object]"};else if(de)"undefined"!=typeof read&&(Ae=function(e){return read(e)}),pe=function(e){var t;return"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(we("object"==typeof(t=read(e,"binary"))),t)},"undefined"!=typeof scriptArgs&&scriptArgs,"function"==typeof quit&&(ce=function(e){quit(e)}),"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print);else{if(!Ee&&!ue)throw new Error("environment detection error");ue?me=self.location.href:"undefined"!=typeof document&&document.currentScript&&(me=document.currentScript.src),me=0!==me.indexOf("blob:")?me.substr(0,me.lastIndexOf("/")+1):"",Ae=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},ue&&(pe=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),fe=function(e,t,r){var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=function(){200==n.status||0==n.status&&n.response?t(n.response):r()},n.onerror=r,n.send(null)}}var ye=ae.print||console.log.bind(console),Be=ae.printErr||console.warn.bind(console);for(te in ie)ie.hasOwnProperty(te)&&(ae[te]=ie[te]);ie=null,ae.arguments,Object.getOwnPropertyDescriptor(ae,"arguments")||Object.defineProperty(ae,"arguments",{configurable:!0,get:function(){Ft("Module.arguments has been replaced with plain arguments_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),ae.thisProgram&&(se=ae.thisProgram),Object.getOwnPropertyDescriptor(ae,"thisProgram")||Object.defineProperty(ae,"thisProgram",{configurable:!0,get:function(){Ft("Module.thisProgram has been replaced with plain thisProgram (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),ae.quit&&(ce=ae.quit),Object.getOwnPropertyDescriptor(ae,"quit")||Object.defineProperty(ae,"quit",{configurable:!0,get:function(){Ft("Module.quit has been replaced with plain quit_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),we(void 0===ae.memoryInitializerPrefixURL,"Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),we(void 0===ae.pthreadMainPrefixURL,"Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),we(void 0===ae.cdInitializerPrefixURL,"Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),we(void 0===ae.filePackagePrefixURL,"Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),we(void 0===ae.read,"Module.read option was removed (modify read_ in JS)"),we(void 0===ae.readAsync,"Module.readAsync option was removed (modify readAsync in JS)"),we(void 0===ae.readBinary,"Module.readBinary option was removed (modify readBinary in JS)"),we(void 0===ae.setWindowTitle,"Module.setWindowTitle option was removed (modify setWindowTitle in JS)"),we(void 0===ae.TOTAL_MEMORY,"Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),Object.getOwnPropertyDescriptor(ae,"read")||Object.defineProperty(ae,"read",{configurable:!0,get:function(){Ft("Module.read has been replaced with plain read_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),Object.getOwnPropertyDescriptor(ae,"readAsync")||Object.defineProperty(ae,"readAsync",{configurable:!0,get:function(){Ft("Module.readAsync has been replaced with plain readAsync (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),Object.getOwnPropertyDescriptor(ae,"readBinary")||Object.defineProperty(ae,"readBinary",{configurable:!0,get:function(){Ft("Module.readBinary has been replaced with plain readBinary (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),Object.getOwnPropertyDescriptor(ae,"setWindowTitle")||Object.defineProperty(ae,"setWindowTitle",{configurable:!0,get:function(){Ft("Module.setWindowTitle has been replaced with plain setWindowTitle (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}});var Ce=16;function De(e,t){return t||(t=Ce),Math.ceil(e/t)*t}function he(e){he.shown||(he.shown={}),he.shown[e]||(he.shown[e]=1,Be(e))}var Oe,Pe=0,ve=function(e){Pe=e},Fe=function(){return Pe};ae.wasmBinary&&(Oe=ae.wasmBinary),Object.getOwnPropertyDescriptor(ae,"wasmBinary")||Object.defineProperty(ae,"wasmBinary",{configurable:!0,get:function(){Ft("Module.wasmBinary has been replaced with plain wasmBinary (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}});var Me,Se=ae.noExitRuntime||!0;function be(e,t,r){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return Ue[e>>0];case"i16":return ke[e>>1];case"i32":case"i64":return Xe[e>>2];case"float":return Ke[e>>2];case"double":return je[e>>3];default:Ft("invalid type for getValue: "+t)}return null}Object.getOwnPropertyDescriptor(ae,"noExitRuntime")||Object.defineProperty(ae,"noExitRuntime",{configurable:!0,get:function(){Ft("Module.noExitRuntime has been replaced with plain noExitRuntime (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),"object"!=typeof WebAssembly&&Ft("no native wasm support detected");var Re=!1;function we(e,t){e||Ft("Assertion failed: "+t)}function Ie(e){var t=ae["_"+e];return we(t,"Cannot call unknown function "+e+", make sure it is exported"),t}function Le(e,t,r,n,o){var a={string:function(e){var t=0;if(null!=e&&0!==e){var r=1+(e.length<<2);ze(e,t=bs(r),r)}return t},array:function(e){var t=bs(e.length);return $e(e,t),t}};var i=Ie(e),s=[],c=0;if(we("array"!==t,'Return type should not be "array".'),n)for(var E=0;E<n.length;E++){var u=a[r[E]];u?(0===c&&(c=Ms()),s[E]=u(n[E])):s[E]=n[E]}var l=i.apply(null,s);return l=function(e){return"string"===t?Je(e):"boolean"===t?Boolean(e):e}(l),0!==c&&Ss(c),l}function xe(e,t,r,n){return function(){return Le(e,t,r,arguments)}}var Ne,Ue,Ge,ke,He,Xe,Ve,Ke,je,Ye="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function Qe(e,t,r){for(var n=t+r,o=t;e[o]&&!(o>=n);)++o;if(o-t>16&&e.subarray&&Ye)return Ye.decode(e.subarray(t,o));for(var a="";t<o;){var i=e[t++];if(128&i){var s=63&e[t++];if(192!=(224&i)){var c=63&e[t++];if(224==(240&i)?i=(15&i)<<12|s<<6|c:(240!=(248&i)&&he("Invalid UTF-8 leading byte 0x"+i.toString(16)+" encountered when deserializing a UTF-8 string in wasm memory to a JS string!"),i=(7&i)<<18|s<<12|c<<6|63&e[t++]),i<65536)a+=String.fromCharCode(i);else{var E=i-65536;a+=String.fromCharCode(55296|E>>10,56320|1023&E)}}else a+=String.fromCharCode((31&i)<<6|s)}else a+=String.fromCharCode(i)}return a}function Je(e,t){return e?Qe(Ge,e,t):""}function We(e,t,r,n){if(!(n>0))return 0;for(var o=r,a=r+n-1,i=0;i<e.length;++i){var s=e.charCodeAt(i);if(s>=55296&&s<=57343)s=65536+((1023&s)<<10)|1023&e.charCodeAt(++i);if(s<=127){if(r>=a)break;t[r++]=s}else if(s<=2047){if(r+1>=a)break;t[r++]=192|s>>6,t[r++]=128|63&s}else if(s<=65535){if(r+2>=a)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|63&s}else{if(r+3>=a)break;s>=2097152&&he("Invalid Unicode code point 0x"+s.toString(16)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x1FFFFF)."),t[r++]=240|s>>18,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|63&s}}return t[r]=0,r-o}function ze(e,t,r){return we("number"==typeof r,"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),We(e,Ge,t,r)}function Ze(e){for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&(n=65536+((1023&n)<<10)|1023&e.charCodeAt(++r)),n<=127?++t:t+=n<=2047?2:n<=65535?3:4}return t}function qe(e){var t=Ze(e)+1,r=xs(t);return r&&We(e,Ue,r,t),r}function $e(e,t){we(e.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)"),Ue.set(e,t)}function et(e,t,r){for(var n=0;n<e.length;++n)we(e.charCodeAt(n)==e.charCodeAt(n)&255),Ue[t++>>0]=e.charCodeAt(n);r||(Ue[t>>0]=0)}function tt(e,t){return e%t>0&&(e+=t-e%t),e}function rt(e){Ne=e,ae.HEAP8=Ue=new Int8Array(e),ae.HEAP16=ke=new Int16Array(e),ae.HEAP32=Xe=new Int32Array(e),ae.HEAPU8=Ge=new Uint8Array(e),ae.HEAPU16=He=new Uint16Array(e),ae.HEAPU32=Ve=new Uint32Array(e),ae.HEAPF32=Ke=new Float32Array(e),ae.HEAPF64=je=new Float64Array(e)}"undefined"!=typeof TextDecoder&&new TextDecoder("utf-16le");var nt=5242880;ae.TOTAL_STACK&&we(nt===ae.TOTAL_STACK,"the stack size can no longer be determined at runtime");var ot,at=ae.INITIAL_MEMORY||16777216;function it(){var e=Is();we(0==(3&e)),Ve[1+(e>>2)]=34821223,Ve[2+(e>>2)]=2310721022,Xe[0]=1668509029}function st(){if(!Re){var e=Is(),t=Ve[1+(e>>2)],r=Ve[2+(e>>2)];34821223==t&&2310721022==r||Ft("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x"+r.toString(16)+" "+t.toString(16)),1668509029!==Xe[0]&&Ft("Runtime error: The application has corrupted its heap memory area (address zero)!")}}Object.getOwnPropertyDescriptor(ae,"INITIAL_MEMORY")||Object.defineProperty(ae,"INITIAL_MEMORY",{configurable:!0,get:function(){Ft("Module.INITIAL_MEMORY has been replaced with plain INITIAL_MEMORY (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),we(at>=nt,"INITIAL_MEMORY should be larger than TOTAL_STACK, was "+at+"! (TOTAL_STACK="+nt+")"),we("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&void 0!==Int32Array.prototype.subarray&&void 0!==Int32Array.prototype.set,"JS engine does not provide full typed array support"),we(!ae.wasmMemory,"Use of `wasmMemory` detected. Use -s IMPORTED_MEMORY to define wasmMemory externally"),we(16777216==at,"Detected runtime INITIAL_MEMORY setting. Use -s IMPORTED_MEMORY to define wasmMemory dynamically"),function(){var e=new Int16Array(1),t=new Int8Array(e.buffer);if(e[0]=25459,115!==t[0]||99!==t[1])throw"Runtime error: expected the system to be little-endian!"}();var ct=[],Et=[],ut=[],lt=[],dt=!1,At=!1;function ft(){if(ae.preRun)for("function"==typeof ae.preRun&&(ae.preRun=[ae.preRun]);ae.preRun.length;)Tt(ae.preRun.shift());Vt(ct)}function pt(){st(),we(!dt),dt=!0,ae.noFSInit||mr.init.initialized||mr.init(),Ar.init(),Vt(Et)}function _t(){st(),mr.ignorePermissions=!1,Vt(ut)}function gt(){st(),At=!0}function mt(){if(st(),ae.postRun)for("function"==typeof ae.postRun&&(ae.postRun=[ae.postRun]);ae.postRun.length;)yt(ae.postRun.shift());Vt(lt)}function Tt(e){ct.unshift(e)}function yt(e){lt.unshift(e)}Et.push({func:function(){hs()}}),we(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),we(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),we(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),we(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var Bt=0,Ct=null,Dt=null,ht={};function Ot(e){for(var t=e;;){if(!ht[e])return e;e=t+Math.random()}}function Pt(e){Bt++,ae.monitorRunDependencies&&ae.monitorRunDependencies(Bt),e?(we(!ht[e]),ht[e]=1,null===Ct&&"undefined"!=typeof setInterval&&(Ct=setInterval((function(){if(Re)return clearInterval(Ct),void(Ct=null);var e=!1;for(var t in ht)e||(e=!0,Be("still waiting on run dependencies:")),Be("dependency: "+t);e&&Be("(end of list)")}),1e4))):Be("warning: run dependency added without ID")}function vt(e){if(Bt--,ae.monitorRunDependencies&&ae.monitorRunDependencies(Bt),e?(we(ht[e]),delete ht[e]):Be("warning: run dependency removed without ID"),0==Bt&&(null!==Ct&&(clearInterval(Ct),Ct=null),Dt)){var t=Dt;Dt=null,t()}}function Ft(e){ae.onAbort&&ae.onAbort(e),Re=!0,e="abort("+(e+="")+") at "+Qt(),new WebAssembly.RuntimeError(e)}function Mt(e,t){return String.prototype.startsWith?e.startsWith(t):0===e.indexOf(t)}ae.preloadedImages={},ae.preloadedAudios={};var St="data:application/octet-stream;base64,";function bt(e){return Mt(e,St)}var Rt,wt="file://";function It(e){return Mt(e,wt)}function Lt(e,t){return function(){var r=e,n=t;return t||(n=ae.asm),we(dt,"native function `"+r+"` called before runtime initialization"),we(!At,"native function `"+r+"` called after runtime exit (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),n[e]||we(n[e],"exported native function `"+r+"` not found"),n[e].apply(null,arguments)}}var xt,Nt,Ut,Gt="undefined"==typeof window?self:window;function kt(e){try{if(e==Rt&&Oe)return new Uint8Array(Oe);if(pe)return pe(e);throw"both async and sync fetching of the wasm failed"}catch(e){Ft(e)}}function Ht(){if(!Oe&&(Ee||ue)){if("function"==typeof fetch&&!It(Rt))return fetch(Rt,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+Rt+"'";return e.arrayBuffer()})).catch((function(){return kt(Rt)}));if(fe)return new Promise((function(e,t){fe(Rt,(function(t){e(new Uint8Array(t))}),t)}))}return Promise.resolve().then((function(){return kt(Rt)}))}function Xt(){var e={env:Ds,wasi_snapshot_preview1:Ds};function t(e,t){var r=e.exports;ae.asm=r,we(Me=ae.asm.memory,"memory not found in wasm exports"),rt(Me.buffer),we(ot=ae.asm.__indirect_function_table,"table not found in wasm exports"),vt("wasm-instantiate")}Pt("wasm-instantiate");var r=ae;function n(e){we(ae===r,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),r=null,t(e.instance)}function o(t){return Ht().then((function(t){return WebAssembly.instantiate(t,e)})).then(t,(function(e){It(Rt),Ft(e)}))}if(ae.instantiateWasm)try{return ae.instantiateWasm(e,t)}catch(e){return Be("Module.instantiateWasm callback failed with error: "+e),!1}return Oe||"function"!=typeof WebAssembly.instantiateStreaming||bt(Rt)||It(Rt)||"function"!=typeof fetch?o(n):fetch(Rt,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(n,(function(e){return o(n)}))})),{}}function Vt(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var r=t.func;"number"==typeof r?void 0===t.arg?ot.get(r)():ot.get(r)(t.arg):r(void 0===t.arg?null:t.arg)}else t(ae)}}function Kt(e){return he("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling"),e}function jt(e){return e.replace(/\b_Z[\w\d_]+/g,(function(e){var t=Kt(e);return e===t?e:t+" ["+e+"]"}))}function Yt(){return""}function Qt(){var e="";return ae.extraStackTrace&&(e+="\n"+ae.extraStackTrace()),jt(e)}function Jt(e,t,r,n){Ft("Assertion failed: "+Je(e)+", at: "+[t?Je(t):"unknown filename",r,n?Je(n):"unknown function"])}bt(Rt=Gt.location.href.endsWith(".openrealspace")?"../../static/Build/Cesium/ThirdParty/OSGBToS3M.wasm":"ThirdParty/OSGBToS3M.wasm")||(Rt=Te(Rt)),ae.callRuntimeCallbacks=Vt,ae.demangle=Kt,ae.demangleAll=jt,ae.jsStackTrace=Yt,ae.stackTrace=Qt,ae.___assert_fail=Jt,Ut=le?function(){var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:"undefined"!=typeof dateNow?dateNow:function(){return performance.now()},ae._emscripten_get_now=Ut;var Wt=!0;function zt(e){return Xe[Os()>>2]=e,e}function Zt(e,t){var r;if(0===e)r=Date.now();else{if(1!==e&&4!==e||!Wt)return zt(28),-1;r=Ut()}return Xe[t>>2]=r/1e3|0,Xe[t+4>>2]=r%1e3*1e3*1e3|0,0}function qt(e,t){return Zt(e,t)}ae._emscripten_get_now_is_monotonic=Wt,ae.setErrNo=zt,ae._clock_gettime=Zt,ae.___clock_gettime=qt;var $t={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function er(e){return xs(e+$t.SIZE)+$t.SIZE}function tr(e,t){}function rr(e,t){}function nr(e){this.excPtr=e,this.ptr=e-$t.SIZE,this.set_type=function(e){Xe[this.ptr+$t.TYPE_OFFSET>>2]=e},this.get_type=function(){return Xe[this.ptr+$t.TYPE_OFFSET>>2]},this.set_destructor=function(e){Xe[this.ptr+$t.DESTRUCTOR_OFFSET>>2]=e},this.get_destructor=function(){return Xe[this.ptr+$t.DESTRUCTOR_OFFSET>>2]},this.set_refcount=function(e){Xe[this.ptr+$t.REFCOUNT_OFFSET>>2]=e},this.set_caught=function(e){e=e?1:0,Ue[this.ptr+$t.CAUGHT_OFFSET>>0]=e},this.get_caught=function(){return 0!=Ue[this.ptr+$t.CAUGHT_OFFSET>>0]},this.set_rethrown=function(e){e=e?1:0,Ue[this.ptr+$t.RETHROWN_OFFSET>>0]=e},this.get_rethrown=function(){return 0!=Ue[this.ptr+$t.RETHROWN_OFFSET>>0]},this.init=function(e,t){this.set_type(e),this.set_destructor(t),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var e=Xe[this.ptr+$t.REFCOUNT_OFFSET>>2];Xe[this.ptr+$t.REFCOUNT_OFFSET>>2]=e+1},this.release_ref=function(){var e=Xe[this.ptr+$t.REFCOUNT_OFFSET>>2];return Xe[this.ptr+$t.REFCOUNT_OFFSET>>2]=e-1,we(e>0),1===e}}ae.ExceptionInfoAttrs=$t,ae.___cxa_allocate_exception=er,ae._atexit=tr,ae.___cxa_atexit=rr,ae.ExceptionInfo=nr;var or=0;ae.exceptionLast=or;var ar=0;function ir(e,t,r){throw new nr(e).init(t,r),or=e,ar++,e+" - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch."}function sr(){if(!sr.called){sr.called=!0;var e=(new Date).getFullYear(),t=new Date(e,0,1),r=new Date(e,6,1),n=t.getTimezoneOffset(),o=r.getTimezoneOffset(),a=Math.max(n,o);Xe[Fs()>>2]=60*a,Xe[vs()>>2]=Number(n!=o);var i=u(t),s=u(r),c=qe(i),E=qe(s);o<n?(Xe[Ps()>>2]=c,Xe[Ps()+4>>2]=E):(Xe[Ps()>>2]=E,Xe[Ps()+4>>2]=c)}function u(e){var t=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return t?t[1]:"GMT"}}function cr(e,t){sr();var r=new Date(1e3*Xe[e>>2]);Xe[t>>2]=r.getSeconds(),Xe[t+4>>2]=r.getMinutes(),Xe[t+8>>2]=r.getHours(),Xe[t+12>>2]=r.getDate(),Xe[t+16>>2]=r.getMonth(),Xe[t+20>>2]=r.getFullYear()-1900,Xe[t+24>>2]=r.getDay();var n=new Date(r.getFullYear(),0,1),o=(r.getTime()-n.getTime())/864e5|0;Xe[t+28>>2]=o,Xe[t+36>>2]=-60*r.getTimezoneOffset();var a=new Date(r.getFullYear(),6,1).getTimezoneOffset(),i=n.getTimezoneOffset(),s=0|(a!=i&&r.getTimezoneOffset()==Math.min(i,a));Xe[t+32>>2]=s;var c=Xe[Ps()+(s?4:0)>>2];return Xe[t+40>>2]=c,t}function Er(e,t){return cr(e,t)}ae.uncaughtExceptionCount=ar,ae.___cxa_throw=ir,ae._tzset=sr,ae._localtime_r=cr,ae.___localtime_r=Er;var ur={splitPath:function(e){return/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1)},normalizeArray:function(e,t){for(var r=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize:function(e){var t="/"===e.charAt(0),r="/"===e.substr(-1);return(e=ur.normalizeArray(e.split("/").filter((function(e){return!!e})),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:function(e){var t=ur.splitPath(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},basename:function(e){if("/"===e)return"/";var t=(e=(e=ur.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},extname:function(e){return ur.splitPath(e)[3]},join:function(){var e=Array.prototype.slice.call(arguments,0);return ur.normalize(e.join("/"))},join2:function(e,t){return ur.normalize(e+"/"+t)}};function lr(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return function(){return crypto.getRandomValues(e),e[0]}}if(le)try{var t=require("crypto");return function(){return t.randomBytes(1)[0]}}catch(e){}return function(){Ft("no cryptographic support found for randomDevice. consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: function(array) { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };")}}ae.PATH=ur,ae.getRandomDevice=lr;var dr={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:mr.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,t="/"===n.charAt(0)}return(t?"/":"")+(e=ur.normalizeArray(e.split("/").filter((function(e){return!!e})),!t).join("/"))||"."},relative:function(e,t){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=dr.resolve(e).substr(1),t=dr.resolve(t).substr(1);for(var n=r(e.split("/")),o=r(t.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s<a;s++)if(n[s]!==o[s]){i=s;break}var c=[];for(s=i;s<n.length;s++)c.push("..");return(c=c.concat(o.slice(i))).join("/")}};ae.PATH_FS=dr;var Ar={ttys:[],init:function(){},shutdown:function(){},register:function(e,t){Ar.ttys[e]={input:[],output:[],ops:t},mr.registerDevice(e,Ar.stream_ops)},stream_ops:{open:function(e){var t=Ar.ttys[e.node.rdev];if(!t)throw new mr.ErrnoError(43);e.tty=t,e.seekable=!1},close:function(e){e.tty.ops.flush(e.tty)},flush:function(e){e.tty.ops.flush(e.tty)},read:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.get_char)throw new mr.ErrnoError(60);for(var a=0,i=0;i<n;i++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new mr.ErrnoError(29)}if(void 0===s&&0===a)throw new mr.ErrnoError(6);if(null==s)break;a++,t[r+i]=s}return a&&(e.node.timestamp=Date.now()),a},write:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.put_char)throw new mr.ErrnoError(60);try{for(var a=0;a<n;a++)e.tty.ops.put_char(e.tty,t[r+a])}catch(e){throw new mr.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),a}},default_tty_ops:{get_char:function(e){if(!e.input.length){var t=null;if(le){var r=Buffer.alloc?Buffer.alloc(256):new Buffer(256),n=0;try{n=_e.readSync(process.stdin.fd,r,0,256,null)}catch(e){if(-1==e.toString().indexOf("EOF"))throw e;n=0}t=n>0?r.slice(0,n).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n");if(!t)return null;e.input=Cs(t,!0)}return e.input.shift()},put_char:function(e,t){null===t||10===t?(ye(Qe(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(ye(Qe(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,t){null===t||10===t?(Be(Qe(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(Be(Qe(e.output,0)),e.output=[])}}};function fr(e){for(var t=De(e,16384),r=xs(t);e<t;)Ue[r+e++]=0;return r}ae.TTY=Ar,ae.mmapAlloc=fr;var pr={ops_table:null,mount:function(e){return pr.createNode(null,"/",16895,0)},createNode:function(e,t,r,n){if(mr.isBlkdev(r)||mr.isFIFO(r))throw new mr.ErrnoError(63);pr.ops_table||(pr.ops_table={dir:{node:{getattr:pr.node_ops.getattr,setattr:pr.node_ops.setattr,lookup:pr.node_ops.lookup,mknod:pr.node_ops.mknod,rename:pr.node_ops.rename,unlink:pr.node_ops.unlink,rmdir:pr.node_ops.rmdir,readdir:pr.node_ops.readdir,symlink:pr.node_ops.symlink},stream:{llseek:pr.stream_ops.llseek}},file:{node:{getattr:pr.node_ops.getattr,setattr:pr.node_ops.setattr},stream:{llseek:pr.stream_ops.llseek,read:pr.stream_ops.read,write:pr.stream_ops.write,allocate:pr.stream_ops.allocate,mmap:pr.stream_ops.mmap,msync:pr.stream_ops.msync}},link:{node:{getattr:pr.node_ops.getattr,setattr:pr.node_ops.setattr,readlink:pr.node_ops.readlink},stream:{}},chrdev:{node:{getattr:pr.node_ops.getattr,setattr:pr.node_ops.setattr},stream:mr.chrdev_stream_ops}});var o=mr.createNode(e,t,r,n);return mr.isDir(o.mode)?(o.node_ops=pr.ops_table.dir.node,o.stream_ops=pr.ops_table.dir.stream,o.contents={}):mr.isFile(o.mode)?(o.node_ops=pr.ops_table.file.node,o.stream_ops=pr.ops_table.file.stream,o.usedBytes=0,o.contents=null):mr.isLink(o.mode)?(o.node_ops=pr.ops_table.link.node,o.stream_ops=pr.ops_table.link.stream):mr.isChrdev(o.mode)&&(o.node_ops=pr.ops_table.chrdev.node,o.stream_ops=pr.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[t]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage:function(e,t){var r=e.contents?e.contents.length:0;if(!(r>=t)){t=Math.max(t,r*(r<1048576?2:1.125)>>>0),0!=r&&(t=Math.max(t,256));var n=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage:function(e,t){if(e.usedBytes!=t)if(0==t)e.contents=null,e.usedBytes=0;else{var r=e.contents;e.contents=new Uint8Array(t),r&&e.contents.set(r.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr:function(e){var t={};return t.dev=mr.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,mr.isDir(e.mode)?t.size=4096:mr.isFile(e.mode)?t.size=e.usedBytes:mr.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr:function(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&pr.resizeFileStorage(e,t.size)},lookup:function(e,t){throw mr.genericErrors[44]},mknod:function(e,t,r,n){return pr.createNode(e,t,r,n)},rename:function(e,t,r){if(mr.isDir(e.mode)){var n;try{n=mr.lookupNode(t,r)}catch(e){}if(n)for(var o in n.contents)throw new mr.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=r,t.contents[r]=e,t.timestamp=e.parent.timestamp,e.parent=t},unlink:function(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir:function(e,t){var r=mr.lookupNode(e,t);for(var n in r.contents)throw new mr.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir:function(e){var t=[".",".."];for(var r in e.contents)e.contents.hasOwnProperty(r)&&t.push(r);return t},symlink:function(e,t,r){var n=pr.createNode(e,t,41471,0);return n.link=r,n},readlink:function(e){if(!mr.isLink(e.mode))throw new mr.ErrnoError(28);return e.link}},stream_ops:{read:function(e,t,r,n,o){var a=e.node.contents;if(o>=e.node.usedBytes)return 0;var i=Math.min(e.node.usedBytes-o,n);if(we(i>=0),i>8&&a.subarray)t.set(a.subarray(o,o+i),r);else for(var s=0;s<i;s++)t[r+s]=a[o+s];return i},write:function(e,t,r,n,o,a){if(we(!(t instanceof ArrayBuffer)),t.buffer===Ue.buffer&&(a=!1),!n)return 0;var i=e.node;if(i.timestamp=Date.now(),t.subarray&&(!i.contents||i.contents.subarray)){if(a)return we(0===o,"canOwn must imply no weird position inside the file"),i.contents=t.subarray(r,r+n),i.usedBytes=n,n;if(0===i.usedBytes&&0===o)return i.contents=t.slice(r,r+n),i.usedBytes=n,n;if(o+n<=i.usedBytes)return i.contents.set(t.subarray(r,r+n),o),n}if(pr.expandFileStorage(i,o+n),i.contents.subarray&&t.subarray)i.contents.set(t.subarray(r,r+n),o);else for(var s=0;s<n;s++)i.contents[o+s]=t[r+s];return i.usedBytes=Math.max(i.usedBytes,o+n),n},llseek:function(e,t,r){var n=t;if(1===r?n+=e.position:2===r&&mr.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new mr.ErrnoError(28);return n},allocate:function(e,t,r){pr.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap:function(e,t,r,n,o,a){if(0!==t)throw new mr.ErrnoError(28);if(!mr.isFile(e.node.mode))throw new mr.ErrnoError(43);var i,s,c=e.node.contents;if(2&a||c.buffer!==Ne){if((n>0||n+r<c.length)&&(c=c.subarray?c.subarray(n,n+r):Array.prototype.slice.call(c,n,n+r)),s=!0,!(i=fr(r)))throw new mr.ErrnoError(48);Ue.set(c,i)}else s=!1,i=c.byteOffset;return{ptr:i,allocated:s}},msync:function(e,t,r,n,o){if(!mr.isFile(e.node.mode))throw new mr.ErrnoError(43);return 2&o||pr.stream_ops.write(e,t,0,n,r,!1),0}}};ae.MEMFS=pr;var _r={0:"Success",1:"Arg list too long",2:"Permission denied",3:"Address already in use",4:"Address not available",5:"Address family not supported by protocol family",6:"No more processes",7:"Socket already connected",8:"Bad file number",9:"Trying to read unreadable message",10:"Mount device busy",11:"Operation canceled",12:"No children",13:"Connection aborted",14:"Connection refused",15:"Connection reset by peer",16:"File locking deadlock error",17:"Destination address required",18:"Math arg out of domain of func",19:"Quota exceeded",20:"File exists",21:"Bad address",22:"File too large",23:"Host is unreachable",24:"Identifier removed",25:"Illegal byte sequence",26:"Connection already in progress",27:"Interrupted system call",28:"Invalid argument",29:"I/O error",30:"Socket is already connected",31:"Is a directory",32:"Too many symbolic links",33:"Too many open files",34:"Too many links",35:"Message too long",36:"Multihop attempted",37:"File or path name too long",38:"Network interface is not configured",39:"Connection reset by network",40:"Network is unreachable",41:"Too many open files in system",42:"No buffer space available",43:"No such device",44:"No such file or directory",45:"Exec format error",46:"No record locks available",47:"The link has been severed",48:"Not enough core",49:"No message of desired type",50:"Protocol not available",51:"No space left on device",52:"Function not implemented",53:"Socket is not connected",54:"Not a directory",55:"Directory not empty",56:"State not recoverable",57:"Socket operation on non-socket",59:"Not a typewriter",60:"No such device or address",61:"Value too large for defined data type",62:"Previous owner died",63:"Not super-user",64:"Broken pipe",65:"Protocol error",66:"Unknown protocol",67:"Protocol wrong type for socket",68:"Math result not representable",69:"Read only file system",70:"Illegal seek",71:"No such process",72:"Stale file handle",73:"Connection timed out",74:"Text file busy",75:"Cross-device link",100:"Device not a stream",101:"Bad font file fmt",102:"Invalid slot",103:"Invalid request code",104:"No anode",105:"Block device required",106:"Channel number out of range",107:"Level 3 halted",108:"Level 3 reset",109:"Link number out of range",110:"Protocol driver not attached",111:"No CSI structure available",112:"Level 2 halted",113:"Invalid exchange",114:"Invalid request descriptor",115:"Exchange full",116:"No data (for no delay io)",117:"Timer expired",118:"Out of streams resources",119:"Machine is not on the network",120:"Package not installed",121:"The object is remote",122:"Advertise error",123:"Srmount error",124:"Communication error on send",125:"Cross mount point (not really error)",126:"Given log. name not unique",127:"f.d. invalid for this operation",128:"Remote address changed",129:"Can access a needed shared lib",130:"Accessing a corrupted shared lib",131:".lib section in a.out corrupted",132:"Attempting to link in too many libs",133:"Attempting to exec a shared library",135:"Streams pipe error",136:"Too many users",137:"Socket type not supported",138:"Not supported",139:"Protocol family not supported",140:"Can't send after socket shutdown",141:"Too many references",142:"Host is down",148:"No medium (in tape drive)",156:"Level 2 not synchronized"};ae.ERRNO_MESSAGES=_r;var gr={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};ae.ERRNO_CODES=gr;var mr={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,trackingDelegate:{},tracking:{openFlags:{READ:1,WRITE:2}},ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:function(e,t){if(t=t||{},!(e=dr.resolve(mr.cwd(),e)))return{path:"",node:null};var r={follow_mount:!0,recurse_count:0};for(var n in r)void 0===t[n]&&(t[n]=r[n]);if(t.recurse_count>8)throw new mr.ErrnoError(32);for(var o=ur.normalizeArray(e.split("/").filter((function(e){return!!e})),!1),a=mr.root,i="/",s=0;s<o.length;s++){var c=s===o.length-1;if(c&&t.parent)break;if(a=mr.lookupNode(a,o[s]),i=ur.join2(i,o[s]),mr.isMountpoint(a)&&(!c||c&&t.follow_mount)&&(a=a.mounted.root),!c||t.follow)for(var E=0;mr.isLink(a.mode);){var u=mr.readlink(i);if(i=dr.resolve(ur.dirname(i),u),a=mr.lookupPath(i,{recurse_count:t.recurse_count}).node,E++>40)throw new mr.ErrnoError(32)}}return{path:i,node:a}},getPath:function(e){for(var t;;){if(mr.isRoot(e)){var r=e.mount.mountpoint;return t?"/"!==r[r.length-1]?r+"/"+t:r+t:r}t=t?e.name+"/"+t:e.name,e=e.parent}},hashName:function(e,t){for(var r=0,n=0;n<t.length;n++)r=(r<<5)-r+t.charCodeAt(n)|0;return(e+r>>>0)%mr.nameTable.length},hashAddNode:function(e){var t=mr.hashName(e.parent.id,e.name);e.name_next=mr.nameTable[t],mr.nameTable[t]=e},hashRemoveNode:function(e){var t=mr.hashName(e.parent.id,e.name);if(mr.nameTable[t]===e)mr.nameTable[t]=e.name_next;else for(var r=mr.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode:function(e,t){var r=mr.mayLookup(e);if(r)throw new mr.ErrnoError(r,e);for(var n=mr.hashName(e.id,t),o=mr.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===e.id&&a===t)return o}return mr.lookup(e,t)},createNode:function(e,t,r,n){we("object"==typeof e);var o=new mr.FSNode(e,t,r,n);return mr.hashAddNode(o),o},destroyNode:function(e){mr.hashRemoveNode(e)},isRoot:function(e){return e===e.parent},isMountpoint:function(e){return!!e.mounted},isFile:function(e){return 32768==(61440&e)},isDir:function(e){return 16384==(61440&e)},isLink:function(e){return 40960==(61440&e)},isChrdev:function(e){return 8192==(61440&e)},isBlkdev:function(e){return 24576==(61440&e)},isFIFO:function(e){return 4096==(61440&e)},isSocket:function(e){return 49152==(49152&e)},flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:function(e){var t=mr.flagModes[e];if(void 0===t)throw new Error("Unknown file open mode: "+e);return t},flagsToPermissionString:function(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:function(e,t){return mr.ignorePermissions||(-1===t.indexOf("r")||292&e.mode)&&(-1===t.indexOf("w")||146&e.mode)&&(-1===t.indexOf("x")||73&e.mode)?0:2},mayLookup:function(e){var t=mr.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate:function(e,t){try{mr.lookupNode(e,t);return 20}catch(e){}return mr.nodePermissions(e,"wx")},mayDelete:function(e,t,r){var n;try{n=mr.lookupNode(e,t)}catch(e){return e.errno}var o=mr.nodePermissions(e,"wx");if(o)return o;if(r){if(!mr.isDir(n.mode))return 54;if(mr.isRoot(n)||mr.getPath(n)===mr.cwd())return 10}else if(mr.isDir(n.mode))return 31;return 0},mayOpen:function(e,t){return e?mr.isLink(e.mode)?32:mr.isDir(e.mode)&&("r"!==mr.flagsToPermissionString(t)||512&t)?31:mr.nodePermissions(e,mr.flagsToPermissionString(t)):44},MAX_OPEN_FDS:4096,nextfd:function(e,t){e=e||0,t=t||mr.MAX_OPEN_FDS;for(var r=e;r<=t;r++)if(!mr.streams[r])return r;throw new mr.ErrnoError(33)},getStream:function(e){return mr.streams[e]},createStream:function(e,t,r){mr.FSStream||(mr.FSStream=function(){},mr.FSStream.prototype={object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}}});var n=new mr.FSStream;for(var o in e)n[o]=e[o];e=n;var a=mr.nextfd(t,r);return e.fd=a,mr.streams[a]=e,e},closeStream:function(e){mr.streams[e]=null},chrdev_stream_ops:{open:function(e){var t=mr.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:function(){throw new mr.ErrnoError(70)}},major:function(e){return e>>8},minor:function(e){return 255&e},makedev:function(e,t){return e<<8|t},registerDevice:function(e,t){mr.devices[e]={stream_ops:t}},getDevice:function(e){return mr.devices[e]},getMounts:function(e){for(var t=[],r=[e];r.length;){var n=r.pop();t.push(n),r.push.apply(r,n.mounts)}return t},syncfs:function(e,t){"function"==typeof e&&(t=e,e=!1),mr.syncFSRequests++,mr.syncFSRequests>1&&Be("warning: "+mr.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var r=mr.getMounts(mr.root.mount),n=0;function o(e){return we(mr.syncFSRequests>0),mr.syncFSRequests--,t(e)}function a(e){if(e)return a.errored?void 0:(a.errored=!0,o(e));++n>=r.length&&o(null)}r.forEach((function(t){if(!t.type.syncfs)return a(null);t.type.syncfs(t,e,a)}))},mount:function(e,t,r){if("string"==typeof e)throw e;var n,o="/"===r,a=!r;if(o&&mr.root)throw new mr.ErrnoError(10);if(!o&&!a){var i=mr.lookupPath(r,{follow_mount:!1});if(r=i.path,n=i.node,mr.isMountpoint(n))throw new mr.ErrnoError(10);if(!mr.isDir(n.mode))throw new mr.ErrnoError(54)}var s={type:e,opts:t,mountpoint:r,mounts:[]},c=e.mount(s);return c.mount=s,s.root=c,o?mr.root=c:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),c},unmount:function(e){var t=mr.lookupPath(e,{follow_mount:!1});if(!mr.isMountpoint(t.node))throw new mr.ErrnoError(28);var r=t.node,n=r.mounted,o=mr.getMounts(n);Object.keys(mr.nameTable).forEach((function(e){for(var t=mr.nameTable[e];t;){var r=t.name_next;-1!==o.indexOf(t.mount)&&mr.destroyNode(t),t=r}})),r.mounted=null;var a=r.mount.mounts.indexOf(n);we(-1!==a),r.mount.mounts.splice(a,1)},lookup:function(e,t){return e.node_ops.lookup(e,t)},mknod:function(e,t,r){var n=mr.lookupPath(e,{parent:!0}).node,o=ur.basename(e);if(!o||"."===o||".."===o)throw new mr.ErrnoError(28);var a=mr.mayCreate(n,o);if(a)throw new mr.ErrnoError(a);if(!n.node_ops.mknod)throw new mr.ErrnoError(63);return n.node_ops.mknod(n,o,t,r)},create:function(e,t){return t=void 0!==t?t:438,t&=4095,t|=32768,mr.mknod(e,t,0)},mkdir:function(e,t){return t=void 0!==t?t:511,t&=1023,t|=16384,mr.mknod(e,t,0)},mkdirTree:function(e,t){for(var r=e.split("/"),n="",o=0;o<r.length;++o)if(r[o]){n+="/"+r[o];try{mr.mkdir(n,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:function(e,t,r){return void 0===r&&(r=t,t=438),t|=8192,mr.mknod(e,t,r)},symlink:function(e,t){if(!dr.resolve(e))throw new mr.ErrnoError(44);var r=mr.lookupPath(t,{parent:!0}).node;if(!r)throw new mr.ErrnoError(44);var n=ur.basename(t),o=mr.mayCreate(r,n);if(o)throw new mr.ErrnoError(o);if(!r.node_ops.symlink)throw new mr.ErrnoError(63);return r.node_ops.symlink(r,n,e)},rename:function(e,t){var r,n,o=ur.dirname(e),a=ur.dirname(t),i=ur.basename(e),s=ur.basename(t);if(r=mr.lookupPath(e,{parent:!0}).node,n=mr.lookupPath(t,{parent:!0}).node,!r||!n)throw new mr.ErrnoError(44);if(r.mount!==n.mount)throw new mr.ErrnoError(75);var c,E=mr.lookupNode(r,i),u=dr.relative(e,a);if("."!==u.charAt(0))throw new mr.ErrnoError(28);if("."!==(u=dr.relative(t,o)).charAt(0))throw new mr.ErrnoError(55);try{c=mr.lookupNode(n,s)}catch(e){}if(E!==c){var l=mr.isDir(E.mode),d=mr.mayDelete(r,i,l);if(d)throw new mr.ErrnoError(d);if(d=c?mr.mayDelete(n,s,l):mr.mayCreate(n,s))throw new mr.ErrnoError(d);if(!r.node_ops.rename)throw new mr.ErrnoError(63);if(mr.isMountpoint(E)||c&&mr.isMountpoint(c))throw new mr.ErrnoError(10);if(n!==r&&(d=mr.nodePermissions(r,"w")))throw new mr.ErrnoError(d);try{mr.trackingDelegate.willMovePath&&mr.trackingDelegate.willMovePath(e,t)}catch(r){Be("FS.trackingDelegate['willMovePath']('"+e+"', '"+t+"') threw an exception: "+r.message)}mr.hashRemoveNode(E);try{r.node_ops.rename(E,n,s)}catch(e){throw e}finally{mr.hashAddNode(E)}try{mr.trackingDelegate.onMovePath&&mr.trackingDelegate.onMovePath(e,t)}catch(r){Be("FS.trackingDelegate['onMovePath']('"+e+"', '"+t+"') threw an exception: "+r.message)}}},rmdir:function(e){var t=mr.lookupPath(e,{parent:!0}).node,r=ur.basename(e),n=mr.lookupNode(t,r),o=mr.mayDelete(t,r,!0);if(o)throw new mr.ErrnoError(o);if(!t.node_ops.rmdir)throw new mr.ErrnoError(63);if(mr.isMountpoint(n))throw new mr.ErrnoError(10);try{mr.trackingDelegate.willDeletePath&&mr.trackingDelegate.willDeletePath(e)}catch(t){Be("FS.trackingDelegate['willDeletePath']('"+e+"') threw an exception: "+t.message)}t.node_ops.rmdir(t,r),mr.destroyNode(n);try{mr.trackingDelegate.onDeletePath&&mr.trackingDelegate.onDeletePath(e)}catch(t){Be("FS.trackingDelegate['onDeletePath']('"+e+"') threw an exception: "+t.message)}},readdir:function(e){var t=mr.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new mr.ErrnoError(54);return t.node_ops.readdir(t)},unlink:function(e){var t=mr.lookupPath(e,{parent:!0}).node,r=ur.basename(e),n=mr.lookupNode(t,r),o=mr.mayDelete(t,r,!1);if(o)throw new mr.ErrnoError(o);if(!t.node_ops.unlink)throw new mr.ErrnoError(63);if(mr.isMountpoint(n))throw new mr.ErrnoError(10);try{mr.trackingDelegate.willDeletePath&&mr.trackingDelegate.willDeletePath(e)}catch(t){Be("FS.trackingDelegate['willDeletePath']('"+e+"') threw an exception: "+t.message)}t.node_ops.unlink(t,r),mr.destroyNode(n);try{mr.trackingDelegate.onDeletePath&&mr.trackingDelegate.onDeletePath(e)}catch(t){Be("FS.trackingDelegate['onDeletePath']('"+e+"') threw an exception: "+t.message)}},readlink:function(e){var t=mr.lookupPath(e).node;if(!t)throw new mr.ErrnoError(44);if(!t.node_ops.readlink)throw new mr.ErrnoError(28);return dr.resolve(mr.getPath(t.parent),t.node_ops.readlink(t))},stat:function(e,t){var r=mr.lookupPath(e,{follow:!t}).node;if(!r)throw new mr.ErrnoError(44);if(!r.node_ops.getattr)throw new mr.ErrnoError(63);return r.node_ops.getattr(r)},lstat:function(e){return mr.stat(e,!0)},chmod:function(e,t,r){var n;"string"==typeof e?n=mr.lookupPath(e,{follow:!r}).node:n=e;if(!n.node_ops.setattr)throw new mr.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod:function(e,t){mr.chmod(e,t,!0)},fchmod:function(e,t){var r=mr.getStream(e);if(!r)throw new mr.ErrnoError(8);mr.chmod(r.node,t)},chown:function(e,t,r,n){var o;"string"==typeof e?o=mr.lookupPath(e,{follow:!n}).node:o=e;if(!o.node_ops.setattr)throw new mr.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:function(e,t,r){mr.chown(e,t,r,!0)},fchown:function(e,t,r){var n=mr.getStream(e);if(!n)throw new mr.ErrnoError(8);mr.chown(n.node,t,r)},truncate:function(e,t){if(t<0)throw new mr.ErrnoError(28);var r;"string"==typeof e?r=mr.lookupPath(e,{follow:!0}).node:r=e;if(!r.node_ops.setattr)throw new mr.ErrnoError(63);if(mr.isDir(r.mode))throw new mr.ErrnoError(31);if(!mr.isFile(r.mode))throw new mr.ErrnoError(28);var n=mr.nodePermissions(r,"w");if(n)throw new mr.ErrnoError(n);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate:function(e,t){var r=mr.getStream(e);if(!r)throw new mr.ErrnoError(8);if(0==(2097155&r.flags))throw new mr.ErrnoError(28);mr.truncate(r.node,t)},utime:function(e,t,r){var n=mr.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,r)})},open:function(e,t,r,n,o){if(""===e)throw new mr.ErrnoError(44);var a;if(r=void 0===r?438:r,r=64&(t="string"==typeof t?mr.modeStringToFlags(t):t)?4095&r|32768:0,"object"==typeof e)a=e;else{e=ur.normalize(e);try{a=mr.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var i=!1;if(64&t)if(a){if(128&t)throw new mr.ErrnoError(20)}else a=mr.mknod(e,r,0),i=!0;if(!a)throw new mr.ErrnoError(44);if(mr.isChrdev(a.mode)&&(t&=-513),65536&t&&!mr.isDir(a.mode))throw new mr.ErrnoError(54);if(!i){var s=mr.mayOpen(a,t);if(s)throw new mr.ErrnoError(s)}512&t&&mr.truncate(a,0),t&=-131713;var c=mr.createStream({node:a,path:mr.getPath(a),flags:t,seekable:!0,position:0,stream_ops:a.stream_ops,ungotten:[],error:!1},n,o);c.stream_ops.open&&c.stream_ops.open(c),!ae.logReadFiles||1&t||(mr.readFiles||(mr.readFiles={}),e in mr.readFiles||(mr.readFiles[e]=1,Be("FS.trackingDelegate error on read file: "+e)));try{if(mr.trackingDelegate.onOpenFile){var E=0;1!=(2097155&t)&&(E|=mr.tracking.openFlags.READ),0!=(2097155&t)&&(E|=mr.tracking.openFlags.WRITE),mr.trackingDelegate.onOpenFile(e,E)}}catch(t){Be("FS.trackingDelegate['onOpenFile']('"+e+"', flags) threw an exception: "+t.message)}return c},close:function(e){if(mr.isClosed(e))throw new mr.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{mr.closeStream(e.fd)}e.fd=null},isClosed:function(e){return null===e.fd},llseek:function(e,t,r){if(mr.isClosed(e))throw new mr.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new mr.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new mr.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,r),e.ungotten=[],e.position},read:function(e,t,r,n,o){if(n<0||o<0)throw new mr.ErrnoError(28);if(mr.isClosed(e))throw new mr.ErrnoError(8);if(1==(2097155&e.flags))throw new mr.ErrnoError(8);if(mr.isDir(e.node.mode))throw new mr.ErrnoError(31);if(!e.stream_ops.read)throw new mr.ErrnoError(28);var a=void 0!==o;if(a){if(!e.seekable)throw new mr.ErrnoError(70)}else o=e.position;var i=e.stream_ops.read(e,t,r,n,o);return a||(e.position+=i),i},write:function(e,t,r,n,o,a){if(n<0||o<0)throw new mr.ErrnoError(28);if(mr.isClosed(e))throw new mr.ErrnoError(8);if(0==(2097155&e.flags))throw new mr.ErrnoError(8);if(mr.isDir(e.node.mode))throw new mr.ErrnoError(31);if(!e.stream_ops.write)throw new mr.ErrnoError(28);e.seekable&&1024&e.flags&&mr.llseek(e,0,2);var i=void 0!==o;if(i){if(!e.seekable)throw new mr.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,t,r,n,o,a);i||(e.position+=s);try{e.path&&mr.trackingDelegate.onWriteToFile&&mr.trackingDelegate.onWriteToFile(e.path)}catch(t){Be("FS.trackingDelegate['onWriteToFile']('"+e.path+"') threw an exception: "+t.message)}return s},allocate:function(e,t,r){if(mr.isClosed(e))throw new mr.ErrnoError(8);if(t<0||r<=0)throw new mr.ErrnoError(28);if(0==(2097155&e.flags))throw new mr.ErrnoError(8);if(!mr.isFile(e.node.mode)&&!mr.isDir(e.node.mode))throw new mr.ErrnoError(43);if(!e.stream_ops.allocate)throw new mr.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap:function(e,t,r,n,o,a){if(0!=(2&o)&&0==(2&a)&&2!=(2097155&e.flags))throw new mr.ErrnoError(2);if(1==(2097155&e.flags))throw new mr.ErrnoError(2);if(!e.stream_ops.mmap)throw new mr.ErrnoError(43);return e.stream_ops.mmap(e,t,r,n,o,a)},msync:function(e,t,r,n,o){return e&&e.stream_ops.msync?e.stream_ops.msync(e,t,r,n,o):0},munmap:function(e){return 0},ioctl:function(e,t,r){if(!e.stream_ops.ioctl)throw new mr.ErrnoError(59);return e.stream_ops.ioctl(e,t,r)},readFile:function(e,t){if((t=t||{}).flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw new Error('Invalid encoding type "'+t.encoding+'"');var r,n=mr.open(e,t.flags),o=mr.stat(e).size,a=new Uint8Array(o);return mr.read(n,a,0,o,0),"utf8"===t.encoding?r=Qe(a,0):"binary"===t.encoding&&(r=a),mr.close(n),r},writeFile:function(e,t,r){(r=r||{}).flags=r.flags||577;var n=mr.open(e,r.flags,r.mode);if("string"==typeof t){var o=new Uint8Array(Ze(t)+1),a=We(t,o,0,o.length);mr.write(n,o,0,a,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");mr.write(n,t,0,t.byteLength,void 0,r.canOwn)}mr.close(n)},cwd:function(){return mr.currentPath},chdir:function(e){var t=mr.lookupPath(e,{follow:!0});if(null===t.node)throw new mr.ErrnoError(44);if(!mr.isDir(t.node.mode))throw new mr.ErrnoError(54);var r=mr.nodePermissions(t.node,"x");if(r)throw new mr.ErrnoError(r);mr.currentPath=t.path},createDefaultDirectories:function(){mr.mkdir("/tmp"),mr.mkdir("/home"),mr.mkdir("/home/web_user")},createDefaultDevices:function(){mr.mkdir("/dev"),mr.registerDevice(mr.makedev(1,3),{read:function(){return 0},write:function(e,t,r,n,o){return n}}),mr.mkdev("/dev/null",mr.makedev(1,3)),Ar.register(mr.makedev(5,0),Ar.default_tty_ops),Ar.register(mr.makedev(6,0),Ar.default_tty1_ops),mr.mkdev("/dev/tty",mr.makedev(5,0)),mr.mkdev("/dev/tty1",mr.makedev(6,0));var e=lr();mr.createDevice("/dev","random",e),mr.createDevice("/dev","urandom",e),mr.mkdir("/dev/shm"),mr.mkdir("/dev/shm/tmp")},createSpecialDirectories:function(){mr.mkdir("/proc");var e=mr.mkdir("/proc/self");mr.mkdir("/proc/self/fd"),mr.mount({mount:function(){var t=mr.createNode(e,"fd",16895,73);return t.node_ops={lookup:function(e,t){var r=+t,n=mr.getStream(r);if(!n)throw new mr.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:function(){return n.path}}};return o.parent=o,o}},t}},{},"/proc/self/fd")},createStandardStreams:function(){ae.stdin?mr.createDevice("/dev","stdin",ae.stdin):mr.symlink("/dev/tty","/dev/stdin"),ae.stdout?mr.createDevice("/dev","stdout",null,ae.stdout):mr.symlink("/dev/tty","/dev/stdout"),ae.stderr?mr.createDevice("/dev","stderr",null,ae.stderr):mr.symlink("/dev/tty1","/dev/stderr");var e=mr.open("/dev/stdin",0),t=mr.open("/dev/stdout",1),r=mr.open("/dev/stderr",1);we(0===e.fd,"invalid handle for stdin ("+e.fd+")"),we(1===t.fd,"invalid handle for stdout ("+t.fd+")"),we(2===r.fd,"invalid handle for stderr ("+r.fd+")")},ensureErrnoError:function(){mr.ErrnoError||(mr.ErrnoError=function(e,t){this.node=t,this.setErrno=function(e){for(var t in this.errno=e,gr)if(gr[t]===e){this.code=t;break}},this.setErrno(e),this.message=_r[e],this.stack&&(Object.defineProperty(this,"stack",{value:(new Error).stack,writable:!0}),this.stack=jt(this.stack))},mr.ErrnoError.prototype=new Error,mr.ErrnoError.prototype.constructor=mr.ErrnoError,[44].forEach((function(e){mr.genericErrors[e]=new mr.ErrnoError(e),mr.genericErrors[e].stack="<generic error, no stack>"})))},staticInit:function(){mr.ensureErrnoError(),mr.nameTable=new Array(4096),mr.mount(pr,{},"/"),mr.createDefaultDirectories(),mr.createDefaultDevices(),mr.createSpecialDirectories(),mr.filesystems={MEMFS:pr}},init:function(e,t,r){we(!mr.init.initialized,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)"),mr.init.initialized=!0,mr.ensureErrnoError(),ae.stdin=e||ae.stdin,ae.stdout=t||ae.stdout,ae.stderr=r||ae.stderr,mr.createStandardStreams()},quit:function(){mr.init.initialized=!1;var e=ae._fflush;e&&e(0);for(var t=0;t<mr.streams.length;t++){var r=mr.streams[t];r&&mr.close(r)}},getMode:function(e,t){var r=0;return e&&(r|=365),t&&(r|=146),r},findObject:function(e,t){var r=mr.analyzePath(e,t);return r.exists?r.object:null},analyzePath:function(e,t){try{e=(n=mr.lookupPath(e,{follow:!t})).path}catch(e){}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=mr.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=ur.basename(e),n=mr.lookupPath(e,{follow:!t}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot="/"===n.path}catch(e){r.error=e.errno}return r},createPath:function(e,t,r,n){e="string"==typeof e?e:mr.getPath(e);for(var o=t.split("/").reverse();o.length;){var a=o.pop();if(a){var i=ur.join2(e,a);try{mr.mkdir(i)}catch(e){}e=i}}return i},createFile:function(e,t,r,n,o){var a=ur.join2("string"==typeof e?e:mr.getPath(e),t),i=mr.getMode(n,o);return mr.create(a,i)},createDataFile:function(e,t,r,n,o,a){var i=t?ur.join2("string"==typeof e?e:mr.getPath(e),t):e,s=mr.getMode(n,o),c=mr.create(i,s);if(r){if("string"==typeof r){for(var E=new Array(r.length),u=0,l=r.length;u<l;++u)E[u]=r.charCodeAt(u);r=E}mr.chmod(c,146|s);var d=mr.open(c,577);mr.write(d,r,0,r.length,0,a),mr.close(d),mr.chmod(c,s)}return c},createDevice:function(e,t,r,n){var o=ur.join2("string"==typeof e?e:mr.getPath(e),t),a=mr.getMode(!!r,!!n);mr.createDevice.major||(mr.createDevice.major=64);var i=mr.makedev(mr.createDevice.major++,0);return mr.registerDevice(i,{open:function(e){e.seekable=!1},close:function(e){n&&n.buffer&&n.buffer.length&&n(10)},read:function(e,t,n,o,a){for(var i=0,s=0;s<o;s++){var c;try{c=r()}catch(e){throw new mr.ErrnoError(29)}if(void 0===c&&0===i)throw new mr.ErrnoError(6);if(null==c)break;i++,t[n+s]=c}return i&&(e.node.timestamp=Date.now()),i},write:function(e,t,r,o,a){for(var i=0;i<o;i++)try{n(t[r+i])}catch(e){throw new mr.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),i}}),mr.mkdev(o,a,i)},forceLoadFile:function(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!Ae)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=Cs(Ae(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new mr.ErrnoError(29)}},createLazyFile:function(e,t,r,n,o){function a(){this.lengthKnown=!1,this.chunks=[]}if(a.prototype.get=function(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,r=e/this.chunkSize|0;return this.getter(r)[t]}},a.prototype.setDataGetter=function(e){this.getter=e},a.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",r,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+r+". Status: "+e.status);var t,n=Number(e.getResponseHeader("Content-length")),o=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,a=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,i=1048576;o||(i=n);var s=this;s.setDataGetter((function(e){var t=e*i,o=(e+1)*i-1;if(o=Math.min(o,n-1),void 0===s.chunks[e]&&(s.chunks[e]=function(e,t){if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",r,!1),n!==i&&o.setRequestHeader("Range","bytes="+e+"-"+t),"undefined"!=typeof Uint8Array&&(o.responseType="arraybuffer"),o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+r+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):Cs(o.responseText||"",!0)}(t,o)),void 0===s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]})),!a&&n||(i=n=1,n=this.getter(0).length,i=n,ye("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=i,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!ue)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var i=new a;Object.defineProperties(i,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var s={isDevice:!1,contents:i}}else s={isDevice:!1,url:r};var c=mr.createFile(e,t,s,n,o);s.contents?c.contents=s.contents:s.url&&(c.contents=null,c.url=s.url),Object.defineProperties(c,{usedBytes:{get:function(){return this.contents.length}}});var E={};return Object.keys(c.stream_ops).forEach((function(e){var t=c.stream_ops[e];E[e]=function(){return mr.forceLoadFile(c),t.apply(null,arguments)}})),E.read=function(e,t,r,n,o){mr.forceLoadFile(c);var a=e.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(we(i>=0),a.slice)for(var s=0;s<i;s++)t[r+s]=a[o+s];else for(s=0;s<i;s++)t[r+s]=a.get(o+s);return i},c.stream_ops=E,c},createPreloadedFile:function(e,t,r,n,o,a,i,s,c,E){Browser.init();var u=t?dr.resolve(ur.join2(e,t)):e,l=Ot("cp "+u);function d(r){function d(r){E&&E(),s||mr.createDataFile(e,t,r,n,o,c),a&&a(),vt(l)}var A=!1;ae.preloadPlugins.forEach((function(e){A||e.canHandle(u)&&(e.handle(r,u,d,(function(){i&&i(),vt(l)})),A=!0)})),A||d(r)}Pt(l),"string"==typeof r?Browser.asyncLoad(r,(function(e){d(e)}),i):d(r)},indexedDB:function(){return window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB},DB_NAME:function(){return"EM_FS_"+window.location.pathname},DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:function(e,t,r){t=t||function(){},r=r||function(){};var n=mr.indexedDB();try{var o=n.open(mr.DB_NAME(),mr.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=function(){ye("creating db"),o.result.createObjectStore(mr.DB_STORE_NAME)},o.onsuccess=function(){var n=o.result.transaction([mr.DB_STORE_NAME],"readwrite"),a=n.objectStore(mr.DB_STORE_NAME),i=0,s=0,c=e.length;function E(){0==s?t():r()}e.forEach((function(e){var t=a.put(mr.analyzePath(e).object.contents,e);t.onsuccess=function(){++i+s==c&&E()},t.onerror=function(){s++,i+s==c&&E()}})),n.onerror=r},o.onerror=r},loadFilesFromDB:function(e,t,r){t=t||function(){},r=r||function(){};var n=mr.indexedDB();try{var o=n.open(mr.DB_NAME(),mr.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=r,o.onsuccess=function(){var n=o.result;try{var a=n.transaction([mr.DB_STORE_NAME],"readonly")}catch(e){return void r(e)}var i=a.objectStore(mr.DB_STORE_NAME),s=0,c=0,E=e.length;function u(){0==c?t():r()}e.forEach((function(e){var t=i.get(e);t.onsuccess=function(){mr.analyzePath(e).exists&&mr.unlink(e),mr.createDataFile(ur.dirname(e),ur.basename(e),t.result,!0,!0,!0),++s+c==E&&u()},t.onerror=function(){c++,s+c==E&&u()}})),a.onerror=r},o.onerror=r},absolutePath:function(){Ft("FS.absolutePath has been removed; use PATH_FS.resolve instead")},createFolder:function(){Ft("FS.createFolder has been removed; use FS.mkdir instead")},createLink:function(){Ft("FS.createLink has been removed; use FS.symlink instead")},joinPath:function(){Ft("FS.joinPath has been removed; use PATH.join instead")},mmapAlloc:function(){Ft("FS.mmapAlloc has been replaced by the top level function mmapAlloc")},standardizePath:function(){Ft("FS.standardizePath has been removed; use PATH.normalize instead")}};ae.FS=mr;var Tr={mappings:{},DEFAULT_POLLMASK:5,umask:511,calculateAt:function(e,t,r){if("/"===t[0])return t;var n;if(-100===e)n=mr.cwd();else{var o=mr.getStream(e);if(!o)throw new mr.ErrnoError(8);n=o.path}if(0==t.length){if(!r)throw new mr.ErrnoError(44);return n}return ur.join2(n,t)},doStat:function(e,t,r){try{var n=e(t)}catch(e){if(e&&e.node&&ur.normalize(t)!==ur.normalize(mr.getPath(e.node)))return-54;throw e}return Xe[r>>2]=n.dev,Xe[r+4>>2]=0,Xe[r+8>>2]=n.ino,Xe[r+12>>2]=n.mode,Xe[r+16>>2]=n.nlink,Xe[r+20>>2]=n.uid,Xe[r+24>>2]=n.gid,Xe[r+28>>2]=n.rdev,Xe[r+32>>2]=0,Nt=[n.size>>>0,(xt=n.size,+Math.abs(xt)>=1?xt>0?(0|Math.min(+Math.floor(xt/4294967296),4294967295))>>>0:~~+Math.ceil((xt-+(~~xt>>>0))/4294967296)>>>0:0)],Xe[r+40>>2]=Nt[0],Xe[r+44>>2]=Nt[1],Xe[r+48>>2]=4096,Xe[r+52>>2]=n.blocks,Xe[r+56>>2]=n.atime.getTime()/1e3|0,Xe[r+60>>2]=0,Xe[r+64>>2]=n.mtime.getTime()/1e3|0,Xe[r+68>>2]=0,Xe[r+72>>2]=n.ctime.getTime()/1e3|0,Xe[r+76>>2]=0,Nt=[n.ino>>>0,(xt=n.ino,+Math.abs(xt)>=1?xt>0?(0|Math.min(+Math.floor(xt/4294967296),4294967295))>>>0:~~+Math.ceil((xt-+(~~xt>>>0))/4294967296)>>>0:0)],Xe[r+80>>2]=Nt[0],Xe[r+84>>2]=Nt[1],0},doMsync:function(e,t,r,n,o){var a=Ge.slice(e,e+r);mr.msync(t,a,o,r,n)},doMkdir:function(e,t){return"/"===(e=ur.normalize(e))[e.length-1]&&(e=e.substr(0,e.length-1)),mr.mkdir(e,t,0),0},doMknod:function(e,t,r){switch(61440&t){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}return mr.mknod(e,t,r),0},doReadlink:function(e,t,r){if(r<=0)return-28;var n=mr.readlink(e),o=Math.min(r,Ze(n)),a=Ue[t+o];return ze(n,t,r+1),Ue[t+o]=a,o},doAccess:function(e,t){if(-8&t)return-28;var r;if(!(r=mr.lookupPath(e,{follow:!0}).node))return-44;var n="";return 4&t&&(n+="r"),2&t&&(n+="w"),1&t&&(n+="x"),n&&mr.nodePermissions(r,n)?-2:0},doDup:function(e,t,r){var n=mr.getStream(r);return n&&mr.close(n),mr.open(e,t,0,r,r).fd},doReadv:function(e,t,r,n){for(var o=0,a=0;a<r;a++){var i=Xe[t+8*a>>2],s=Xe[t+(8*a+4)>>2],c=mr.read(e,Ue,i,s,n);if(c<0)return-1;if(o+=c,c<s)break}return o},doWritev:function(e,t,r,n){for(var o=0,a=0;a<r;a++){var i=Xe[t+8*a>>2],s=Xe[t+(8*a+4)>>2],c=mr.write(e,Ue,i,s,n);if(c<0)return-1;o+=c}return o},varargs:void 0,get:function(){return we(null!=Tr.varargs),Tr.varargs+=4,Xe[Tr.varargs-4>>2]},getStr:function(e){return Je(e)},getStreamFromFD:function(e){var t=mr.getStream(e);if(!t)throw new mr.ErrnoError(8);return t},get64:function(e,t){return we(e>=0?0===t:-1===t),e}};function yr(e,t){try{return e=Tr.getStr(e),Tr.doAccess(e,t)}catch(e){return void 0!==mr&&e instanceof mr.ErrnoError||Ft(e),-e.errno}}function Br(e){try{var t=Tr.getStreamFromFD(e);return mr.open(t.path,t.flags,0).fd}catch(e){return void 0!==mr&&e instanceof mr.ErrnoError||Ft(e),-e.errno}}function Cr(e,t,r){Tr.varargs=r;try{var n=Tr.getStreamFromFD(e);switch(t){case 0:return(o=Tr.get())<0?-28:mr.open(n.path,n.flags,0,o).fd;case 1:case 2:case 13:case 14:return 0;case 3:return n.flags;case 4:var o=Tr.get();return n.flags|=o,0;case 12:o=Tr.get();return ke[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return zt(28),-1}}catch(e){return void 0!==mr&&e instanceof mr.ErrnoError||Ft(e),-e.errno}}function Dr(e,t){try{var r=Tr.getStreamFromFD(e);return Tr.doStat(mr.stat,r.path,t)}catch(e){return void 0!==mr&&e instanceof mr.ErrnoError||Ft(e),-e.errno}}function hr(e,t){try{if(0===t)return-28;var r=mr.cwd();return t<Ze(r)+1?-68:(ze(r,e,t),e)}catch(e){return void 0!==mr&&e instanceof mr.ErrnoError||Ft(e),-e.errno}}function Or(e,t,r){try{var n=Tr.getStreamFromFD(e);n.getdents||(n.getdents=mr.readdir(n.path));for(var o=280,a=0,i=mr.llseek(n,0,1),s=Math.floor(i/o);s<n.getdents.length&&a+o<=r;){var c,E,u=n.getdents[s];if("."===u[0])c=1,E=4;else{var l=mr.lookupNode(n.node,u);c=l.id,E=mr.isChrdev(l.mode)?2:mr.isDir(l.mode)?4:mr.isLink(l.mode)?10:8}Nt=[c>>>0,(xt=c,+Math.abs(xt)>=1?xt>0?(0|Math.min(+Math.floor(xt/4294967296),4294967295))>>>0:~~+Math.ceil((xt-+(~~xt>>>0))/4294967296)>>>0:0)],Xe[t+a>>2]=Nt[0],Xe[t+a+4>>2]=Nt[1],Nt=[(s+1)*o>>>0,(xt=(s+1)*o,+Math.abs(xt)>=1?xt>0?(0|Math.min(+Math.floor(xt/4294967296),4294967295))>>>0:~~+Math.ceil((xt-+(~~xt>>>0))/4294967296)>>>0:0)],Xe[t+a+8>>2]=Nt[0],Xe[t+a+12>>2]=Nt[1],ke[t+a+16>>1]=280,Ue[t+a+18>>0]=E,ze(u,t+a+19,256),a+=o,s+=1}return mr.llseek(n,s*o,0),a}catch(e){return void 0!==mr&&e instanceof mr.ErrnoError||Ft(e),-e.errno}}function Pr(e,t,r){Tr.varargs=r;try{var n=Tr.getStreamFromFD(e);switch(t){case 21509:case 21505:case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:case 21523:case 21524:return n.tty?0:-59;case 21519:if(!n.tty)return-59;var o=Tr.get();return Xe[o>>2]=0,0;case 21520:return n.tty?-28:-59;case 21531:o=Tr.get();return mr.ioctl(n,t,o);default:Ft("bad ioctl syscall "+t)}}catch(e){return void 0!==mr&&e instanceof mr.ErrnoError||Ft(e),-e.errno}}function vr(e,t){try{return e=Tr.getStr(e),Tr.doStat(mr.lstat,e,t)}catch(e){return void 0!==mr&&e instanceof mr.ErrnoError||Ft(e),-e.errno}}function Fr(e,t){try{return e=Tr.getStr(e),Tr.doMkdir(e,t)}catch(e){return void 0!==mr&&e instanceof mr.ErrnoError||Ft(e),-e.errno}}function Mr(e,t,r){Tr.varargs=r;try{var n=Tr.getStr(e),o=r?Tr.get():0;return mr.open(n,t,o).fd}catch(e){return void 0!==mr&&e instanceof mr.ErrnoError||Ft(e),-e.errno}}function Sr(e,t,r){try{return e=Tr.getStr(e),Tr.doReadlink(e,t,r)}catch(e){return void 0!==mr&&e instanceof mr.ErrnoError||Ft(e),-e.errno}}function br(e,t){try{return e=Tr.getStr(e),t=Tr.getStr(t),mr.rename(e,t),0}catch(e){return void 0!==mr&&e instanceof mr.ErrnoError||Ft(e),-e.errno}}function Rr(e){try{return e=Tr.getStr(e),mr.rmdir(e),0}catch(e){return void 0!==mr&&e instanceof mr.ErrnoError||Ft(e),-e.errno}}function wr(e,t){try{return e=Tr.getStr(e),Tr.doStat(mr.stat,e,t)}catch(e){return void 0!==mr&&e instanceof mr.ErrnoError||Ft(e),-e.errno}}function Ir(e){try{return e=Tr.getStr(e),mr.unlink(e),0}catch(e){return void 0!==mr&&e instanceof mr.ErrnoError||Ft(e),-e.errno}}function Lr(){Ft()}function xr(e){Ft("To use dlopen, you need to use Emscripten's linking support, see https://github.com/emscripten-core/emscripten/wiki/Linking")}function Nr(){Ft("To use dlopen, you need to use Emscripten's linking support, see https://github.com/emscripten-core/emscripten/wiki/Linking")}function Ur(e,t){Ft("To use dlopen, you need to use Emscripten's linking support, see https://github.com/emscripten-core/emscripten/wiki/Linking")}function Gr(e){var t=e.getExtension("ANGLE_instanced_arrays");if(t)return e.vertexAttribDivisor=function(e,r){t.vertexAttribDivisorANGLE(e,r)},e.drawArraysInstanced=function(e,r,n,o){t.drawArraysInstancedANGLE(e,r,n,o)},e.drawElementsInstanced=function(e,r,n,o,a){t.drawElementsInstancedANGLE(e,r,n,o,a)},1}function kr(e){var t=e.getExtension("OES_vertex_array_object");if(t)return e.createVertexArray=function(){return t.createVertexArrayOES()},e.deleteVertexArray=function(e){t.deleteVertexArrayOES(e)},e.bindVertexArray=function(e){t.bindVertexArrayOES(e)},e.isVertexArray=function(e){return t.isVertexArrayOES(e)},1}function Hr(e){var t=e.getExtension("WEBGL_draw_buffers");if(t)return e.drawBuffers=function(e,r){t.drawBuffersWEBGL(e,r)},1}function Xr(e){return!!(e.multiDrawWebgl=e.getExtension("WEBGL_multi_draw"))}ae.SYSCALLS=Tr,ae.___sys_access=yr,ae.___sys_dup=Br,ae.___sys_fcntl64=Cr,ae.___sys_fstat64=Dr,ae.___sys_getcwd=hr,ae.___sys_getdents64=Or,ae.___sys_ioctl=Pr,ae.___sys_lstat64=vr,ae.___sys_mkdir=Fr,ae.___sys_open=Mr,ae.___sys_readlink=Sr,ae.___sys_rename=br,ae.___sys_rmdir=Rr,ae.___sys_stat64=wr,ae.___sys_unlink=Ir,ae._abort=Lr,ae._dlclose=xr,ae._dlerror=Nr,ae._dlopen=Ur,ae.__webgl_enable_ANGLE_instanced_arrays=Gr,ae.__webgl_enable_OES_vertex_array_object=kr,ae.__webgl_enable_WEBGL_draw_buffers=Hr,ae.__webgl_enable_WEBGL_multi_draw=Xr;var Vr={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],uniforms:[],shaders:[],vaos:[],contexts:[],offscreenCanvases:{},timerQueriesEXT:[],programInfos:{},stringCache:{},unpackAlignment:4,recordError:function(e){Vr.lastError||(Vr.lastError=e)},getNewId:function(e){for(var t=Vr.counter++,r=e.length;r<t;r++)e[r]=null;return t},getSource:function(e,t,r,n){for(var o="",a=0;a<t;++a){var i=n?Xe[n+4*a>>2]:-1;o+=Je(Xe[r+4*a>>2],i<0?void 0:i)}return o},createContext:function(e,t){var r=e.getContext("webgl",t);return r?Vr.registerContext(r,t):0},registerContext:function(e,t){var r=Vr.getNewId(Vr.contexts),n={handle:r,attributes:t,version:t.majorVersion,GLctx:e};return e.canvas&&(e.canvas.GLctxObject=n),Vr.contexts[r]=n,(void 0===t.enableExtensionsByDefault||t.enableExtensionsByDefault)&&Vr.initExtensions(n),r},makeContextCurrent:function(e){return Vr.currentContext=Vr.contexts[e],ae.ctx=ps=Vr.currentContext&&Vr.currentContext.GLctx,!(e&&!ps)},getContext:function(e){return Vr.contexts[e]},deleteContext:function(e){Vr.currentContext===Vr.contexts[e]&&(Vr.currentContext=null),"object"==typeof JSEvents&&JSEvents.removeAllHandlersOnTarget(Vr.contexts[e].GLctx.canvas),Vr.contexts[e]&&Vr.contexts[e].GLctx.canvas&&(Vr.contexts[e].GLctx.canvas.GLctxObject=void 0),Vr.contexts[e]=null},initExtensions:function(e){if(e||(e=Vr.currentContext),!e.initExtensionsDone){e.initExtensionsDone=!0;var t=e.GLctx;Gr(t),kr(t),Hr(t),t.disjointTimerQueryExt=t.getExtension("EXT_disjoint_timer_query"),Xr(t),(t.getSupportedExtensions()||[]).forEach((function(e){e.indexOf("lose_context")<0&&e.indexOf("debug")<0&&t.getExtension(e)}))}},populateUniformTable:function(e){for(var t=Vr.programs[e],r=Vr.programInfos[e]={uniforms:{},maxUniformLength:0,maxAttributeLength:-1,maxUniformBlockNameLength:-1},n=r.uniforms,o=ps.getProgramParameter(t,35718),a=0;a<o;++a){var i=ps.getActiveUniform(t,a),s=i.name;r.maxUniformLength=Math.max(r.maxUniformLength,s.length+1),"]"==s.slice(-1)&&(s=s.slice(0,s.lastIndexOf("[")));var c=ps.getUniformLocation(t,s);if(c){var E=Vr.getNewId(Vr.uniforms);n[s]=[i.size,E],Vr.uniforms[E]=c;for(var u=1;u<i.size;++u){var l=s+"["+u+"]";c=ps.getUniformLocation(t,l),E=Vr.getNewId(Vr.uniforms),Vr.uniforms[E]=c}}}}};function Kr(e){ps.activeTexture(e)}function jr(e,t){ps.attachShader(Vr.programs[e],Vr.shaders[t])}function Yr(e,t){ps.disjointTimerQueryExt.beginQueryEXT(e,Vr.timerQueriesEXT[t])}function Qr(e,t,r){ps.bindAttribLocation(Vr.programs[e],t,Je(r))}function Jr(e,t){ps.bindBuffer(e,Vr.buffers[t])}function Wr(e,t){ps.bindFramebuffer(e,Vr.framebuffers[t])}function zr(e,t){ps.bindRenderbuffer(e,Vr.renderbuffers[t])}function Zr(e,t){ps.bindTexture(e,Vr.textures[t])}function qr(e){ps.bindVertexArray(Vr.vaos[e])}function $r(e,t,r,n){ps.blendColor(e,t,r,n)}function en(e){ps.blendEquation(e)}function tn(e,t){ps.blendEquationSeparate(e,t)}function rn(e,t){ps.blendFunc(e,t)}function nn(e,t,r,n){ps.blendFuncSeparate(e,t,r,n)}function on(e,t,r,n){ps.bufferData(e,r?Ge.subarray(r,r+t):t,n)}function an(e,t,r,n){ps.bufferSubData(e,t,Ge.subarray(n,n+r))}function sn(e){return ps.checkFramebufferStatus(e)}function cn(e){ps.clear(e)}function En(e,t,r,n){ps.clearColor(e,t,r,n)}function un(e){ps.clearDepth(e)}function ln(e){ps.clearStencil(e)}function dn(e,t,r,n){ps.colorMask(!!e,!!t,!!r,!!n)}function An(e){ps.compileShader(Vr.shaders[e])}function fn(e,t,r,n,o,a,i,s){ps.compressedTexImage2D(e,t,r,n,o,a,s?Ge.subarray(s,s+i):null)}function pn(e,t,r,n,o,a,i,s,c){ps.compressedTexSubImage2D(e,t,r,n,o,a,i,c?Ge.subarray(c,c+s):null)}function _n(e,t,r,n,o,a,i,s){ps.copyTexImage2D(e,t,r,n,o,a,i,s)}function gn(e,t,r,n,o,a,i,s){ps.copyTexSubImage2D(e,t,r,n,o,a,i,s)}function mn(){var e=Vr.getNewId(Vr.programs),t=ps.createProgram();return t.name=e,Vr.programs[e]=t,e}function Tn(e){var t=Vr.getNewId(Vr.shaders);return Vr.shaders[t]=ps.createShader(e),t}function yn(e){ps.cullFace(e)}function Bn(e,t){for(var r=0;r<e;r++){var n=Xe[t+4*r>>2],o=Vr.buffers[n];o&&(ps.deleteBuffer(o),o.name=0,Vr.buffers[n]=null)}}function Cn(e,t){for(var r=0;r<e;++r){var n=Xe[t+4*r>>2],o=Vr.framebuffers[n];o&&(ps.deleteFramebuffer(o),o.name=0,Vr.framebuffers[n]=null)}}function Dn(e){if(e){var t=Vr.programs[e];t?(ps.deleteProgram(t),t.name=0,Vr.programs[e]=null,Vr.programInfos[e]=null):Vr.recordError(1281)}}function hn(e,t){for(var r=0;r<e;r++){var n=Xe[t+4*r>>2],o=Vr.timerQueriesEXT[n];o&&(ps.disjointTimerQueryExt.deleteQueryEXT(o),Vr.timerQueriesEXT[n]=null)}}function On(e,t){for(var r=0;r<e;r++){var n=Xe[t+4*r>>2],o=Vr.renderbuffers[n];o&&(ps.deleteRenderbuffer(o),o.name=0,Vr.renderbuffers[n]=null)}}function Pn(e){if(e){var t=Vr.shaders[e];t?(ps.deleteShader(t),Vr.shaders[e]=null):Vr.recordError(1281)}}function vn(e,t){for(var r=0;r<e;r++){var n=Xe[t+4*r>>2],o=Vr.textures[n];o&&(ps.deleteTexture(o),o.name=0,Vr.textures[n]=null)}}function Fn(e,t){for(var r=0;r<e;r++){var n=Xe[t+4*r>>2];ps.deleteVertexArray(Vr.vaos[n]),Vr.vaos[n]=null}}function Mn(e){ps.depthFunc(e)}function Sn(e){ps.depthMask(!!e)}function bn(e,t){ps.depthRange(e,t)}function Rn(e,t){ps.detachShader(Vr.programs[e],Vr.shaders[t])}function wn(e){ps.disable(e)}function In(e){ps.disableVertexAttribArray(e)}function Ln(e,t,r){ps.drawArrays(e,t,r)}function xn(e,t,r,n){ps.drawArraysInstanced(e,t,r,n)}ae.GL=Vr,ae._emscripten_glActiveTexture=Kr,ae._emscripten_glAttachShader=jr,ae._emscripten_glBeginQueryEXT=Yr,ae._emscripten_glBindAttribLocation=Qr,ae._emscripten_glBindBuffer=Jr,ae._emscripten_glBindFramebuffer=Wr,ae._emscripten_glBindRenderbuffer=zr,ae._emscripten_glBindTexture=Zr,ae._emscripten_glBindVertexArrayOES=qr,ae._emscripten_glBlendColor=$r,ae._emscripten_glBlendEquation=en,ae._emscripten_glBlendEquationSeparate=tn,ae._emscripten_glBlendFunc=rn,ae._emscripten_glBlendFuncSeparate=nn,ae._emscripten_glBufferData=on,ae._emscripten_glBufferSubData=an,ae._emscripten_glCheckFramebufferStatus=sn,ae._emscripten_glClear=cn,ae._emscripten_glClearColor=En,ae._emscripten_glClearDepthf=un,ae._emscripten_glClearStencil=ln,ae._emscripten_glColorMask=dn,ae._emscripten_glCompileShader=An,ae._emscripten_glCompressedTexImage2D=fn,ae._emscripten_glCompressedTexSubImage2D=pn,ae._emscripten_glCopyTexImage2D=_n,ae._emscripten_glCopyTexSubImage2D=gn,ae._emscripten_glCreateProgram=mn,ae._emscripten_glCreateShader=Tn,ae._emscripten_glCullFace=yn,ae._emscripten_glDeleteBuffers=Bn,ae._emscripten_glDeleteFramebuffers=Cn,ae._emscripten_glDeleteProgram=Dn,ae._emscripten_glDeleteQueriesEXT=hn,ae._emscripten_glDeleteRenderbuffers=On,ae._emscripten_glDeleteShader=Pn,ae._emscripten_glDeleteTextures=vn,ae._emscripten_glDeleteVertexArraysOES=Fn,ae._emscripten_glDepthFunc=Mn,ae._emscripten_glDepthMask=Sn,ae._emscripten_glDepthRangef=bn,ae._emscripten_glDetachShader=Rn,ae._emscripten_glDisable=wn,ae._emscripten_glDisableVertexAttribArray=In,ae._emscripten_glDrawArrays=Ln,ae._emscripten_glDrawArraysInstancedANGLE=xn;var Nn=[];function Un(e,t){for(var r=Nn[e],n=0;n<e;n++)r[n]=Xe[t+4*n>>2];ps.drawBuffers(r)}function Gn(e,t,r,n){ps.drawElements(e,t,r,n)}function kn(e,t,r,n,o){ps.drawElementsInstanced(e,t,r,n,o)}function Hn(e){ps.enable(e)}function Xn(e){ps.enableVertexAttribArray(e)}function Vn(e){ps.disjointTimerQueryExt.endQueryEXT(e)}function Kn(){ps.finish()}function jn(){ps.flush()}function Yn(e,t,r,n){ps.framebufferRenderbuffer(e,t,r,Vr.renderbuffers[n])}function Qn(e,t,r,n,o){ps.framebufferTexture2D(e,t,r,Vr.textures[n],o)}function Jn(e){ps.frontFace(e)}function Wn(e,t,r,n){for(var o=0;o<e;o++){var a=ps[r](),i=a&&Vr.getNewId(n);a?(a.name=i,n[i]=a):Vr.recordError(1282),Xe[t+4*o>>2]=i}}function zn(e,t){Wn(e,t,"createBuffer",Vr.buffers)}function Zn(e,t){Wn(e,t,"createFramebuffer",Vr.framebuffers)}function qn(e,t){for(var r=0;r<e;r++){var n=ps.disjointTimerQueryExt.createQueryEXT();if(!n){for(Vr.recordError(1282);r<e;)Xe[t+4*r++>>2]=0;return}var o=Vr.getNewId(Vr.timerQueriesEXT);n.name=o,Vr.timerQueriesEXT[o]=n,Xe[t+4*r>>2]=o}}function $n(e,t){Wn(e,t,"createRenderbuffer",Vr.renderbuffers)}function eo(e,t){Wn(e,t,"createTexture",Vr.textures)}function to(e,t){Wn(e,t,"createVertexArray",Vr.vaos)}function ro(e){ps.generateMipmap(e)}function no(e,t,r,n,o,a,i,s){t=Vr.programs[t];var c=ps[e](t,r);if(c){var E=s&&ze(c.name,s,n);o&&(Xe[o>>2]=E),a&&(Xe[a>>2]=c.size),i&&(Xe[i>>2]=c.type)}}function oo(e,t,r,n,o,a,i){no("getActiveAttrib",e,t,r,n,o,a,i)}function ao(e,t,r,n,o,a,i){no("getActiveUniform",e,t,r,n,o,a,i)}function io(e,t,r,n){var o=ps.getAttachedShaders(Vr.programs[e]),a=o.length;a>t&&(a=t),Xe[r>>2]=a;for(var i=0;i<a;++i){var s=Vr.shaders.indexOf(o[i]);Xe[n+4*i>>2]=s}}function so(e,t){return ps.getAttribLocation(Vr.programs[e],Je(t))}function co(e){return Ve[e>>2]+4294967296*Xe[e+4>>2]}function Eo(e){return Ve[e>>2]+4294967296*Ve[e+4>>2]}function uo(e,t){Ve[e>>2]=t,Ve[e+4>>2]=(t-Ve[e>>2])/4294967296;var r=t>=0?Eo(e):co(e);r!=t&&he("writeI53ToI64() out of range: serialized JS Number "+t+" to Wasm heap as bytes lo=0x"+Ve[e>>2].toString(16)+", hi=0x"+Ve[e+4>>2].toString(16)+", which deserializes back to "+r+" instead!")}function lo(e,t,r){if(t){var n=void 0;switch(e){case 36346:n=1;break;case 36344:return void(0!=r&&1!=r&&Vr.recordError(1280));case 36345:n=0;break;case 34466:var o=ps.getParameter(34467);n=o?o.length:0}if(void 0===n){var a=ps.getParameter(e);switch(typeof a){case"number":n=a;break;case"boolean":n=a?1:0;break;case"string":return void Vr.recordError(1280);case"object":if(null===a)switch(e){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 34068:n=0;break;default:return void Vr.recordError(1280)}else{if(a instanceof Float32Array||a instanceof Uint32Array||a instanceof Int32Array||a instanceof Array){for(var i=0;i<a.length;++i)switch(r){case 0:Xe[t+4*i>>2]=a[i];break;case 2:Ke[t+4*i>>2]=a[i];break;case 4:Ue[t+i>>0]=a[i]?1:0}return}try{n=0|a.name}catch(t){return Vr.recordError(1280),void Be("GL_INVALID_ENUM in glGet"+r+"v: Unknown object returned from WebGL getParameter("+e+")! (error: "+t+")")}}break;default:return Vr.recordError(1280),void Be("GL_INVALID_ENUM in glGet"+r+"v: Native code calling glGet"+r+"v("+e+") and it returns "+a+" of type "+typeof a+"!")}}switch(r){case 1:uo(t,n);break;case 0:Xe[t>>2]=n;break;case 2:Ke[t>>2]=n;break;case 4:Ue[t>>0]=n?1:0}}else Vr.recordError(1281)}function Ao(e,t){lo(e,t,4)}function fo(e,t,r){r?Xe[r>>2]=ps.getBufferParameter(e,t):Vr.recordError(1281)}function po(){var e=ps.getError()||Vr.lastError;return Vr.lastError=0,e}function _o(e,t){lo(e,t,2)}function go(e,t,r,n){var o=ps.getFramebufferAttachmentParameter(e,t,r);(o instanceof WebGLRenderbuffer||o instanceof WebGLTexture)&&(o=0|o.name),Xe[n>>2]=o}function mo(e,t){lo(e,t,0)}function To(e,t,r,n){var o=ps.getProgramInfoLog(Vr.programs[e]);null===o&&(o="(unknown error)");var a=t>0&&n?ze(o,n,t):0;r&&(Xe[r>>2]=a)}function yo(e,t,r){if(r)if(e>=Vr.counter)Vr.recordError(1281);else{var n=Vr.programInfos[e];if(n)if(35716==t){var o=ps.getProgramInfoLog(Vr.programs[e]);null===o&&(o="(unknown error)"),Xe[r>>2]=o.length+1}else if(35719==t)Xe[r>>2]=n.maxUniformLength;else if(35722==t){if(-1==n.maxAttributeLength){e=Vr.programs[e];var a=ps.getProgramParameter(e,35721);n.maxAttributeLength=0;for(var i=0;i<a;++i){var s=ps.getActiveAttrib(e,i);n.maxAttributeLength=Math.max(n.maxAttributeLength,s.name.length+1)}}Xe[r>>2]=n.maxAttributeLength}else if(35381==t){if(-1==n.maxUniformBlockNameLength){e=Vr.programs[e];var c=ps.getProgramParameter(e,35382);n.maxUniformBlockNameLength=0;for(i=0;i<c;++i){var E=ps.getActiveUniformBlockName(e,i);n.maxUniformBlockNameLength=Math.max(n.maxUniformBlockNameLength,E.length+1)}}Xe[r>>2]=n.maxUniformBlockNameLength}else Xe[r>>2]=ps.getProgramParameter(Vr.programs[e],t);else Vr.recordError(1282)}else Vr.recordError(1281)}function Bo(e,t,r){if(r){var n=Vr.timerQueriesEXT[e],o=ps.disjointTimerQueryExt.getQueryObjectEXT(n,t);uo(r,"boolean"==typeof o?o?1:0:o)}else Vr.recordError(1281)}function Co(e,t,r){if(r){var n,o=Vr.timerQueriesEXT[e],a=ps.disjointTimerQueryExt.getQueryObjectEXT(o,t);n="boolean"==typeof a?a?1:0:a,Xe[r>>2]=n}else Vr.recordError(1281)}function Do(e,t,r){if(r){var n=Vr.timerQueriesEXT[e],o=ps.disjointTimerQueryExt.getQueryObjectEXT(n,t);uo(r,"boolean"==typeof o?o?1:0:o)}else Vr.recordError(1281)}function ho(e,t,r){if(r){var n,o=Vr.timerQueriesEXT[e],a=ps.disjointTimerQueryExt.getQueryObjectEXT(o,t);n="boolean"==typeof a?a?1:0:a,Xe[r>>2]=n}else Vr.recordError(1281)}function Oo(e,t,r){r?Xe[r>>2]=ps.disjointTimerQueryExt.getQueryEXT(e,t):Vr.recordError(1281)}function Po(e,t,r){r?Xe[r>>2]=ps.getRenderbufferParameter(e,t):Vr.recordError(1281)}function vo(e,t,r,n){var o=ps.getShaderInfoLog(Vr.shaders[e]);null===o&&(o="(unknown error)");var a=t>0&&n?ze(o,n,t):0;r&&(Xe[r>>2]=a)}function Fo(e,t,r,n){var o=ps.getShaderPrecisionFormat(e,t);Xe[r>>2]=o.rangeMin,Xe[r+4>>2]=o.rangeMax,Xe[n>>2]=o.precision}function Mo(e,t,r,n){var o=ps.getShaderSource(Vr.shaders[e]);if(o){var a=t>0&&n?ze(o,n,t):0;r&&(Xe[r>>2]=a)}}function So(e,t,r){if(r)if(35716==t){var n=ps.getShaderInfoLog(Vr.shaders[e]);null===n&&(n="(unknown error)");var o=n?n.length+1:0;Xe[r>>2]=o}else if(35720==t){var a=ps.getShaderSource(Vr.shaders[e]),i=a?a.length+1:0;Xe[r>>2]=i}else Xe[r>>2]=ps.getShaderParameter(Vr.shaders[e],t);else Vr.recordError(1281)}function bo(e){var t=Ze(e)+1,r=xs(t);return ze(e,r,t),r}function Ro(e){if(Vr.stringCache[e])return Vr.stringCache[e];var t;switch(e){case 7939:var r=ps.getSupportedExtensions()||[];t=bo((r=r.concat(r.map((function(e){return"GL_"+e})))).join(" "));break;case 7936:case 7937:case 37445:case 37446:var n=ps.getParameter(e);n||Vr.recordError(1280),t=bo(n);break;case 7938:var o=ps.getParameter(7938);t=bo(o="OpenGL ES 2.0 ("+o+")");break;case 35724:var a=ps.getParameter(35724),i=a.match(/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/);null!==i&&(3==i[1].length&&(i[1]=i[1]+"0"),a="OpenGL ES GLSL ES "+i[1]+" ("+a+")"),t=bo(a);break;default:return Vr.recordError(1280),0}return Vr.stringCache[e]=t,t}function wo(e,t,r){r?Ke[r>>2]=ps.getTexParameter(e,t):Vr.recordError(1281)}function Io(e,t,r){r?Xe[r>>2]=ps.getTexParameter(e,t):Vr.recordError(1281)}function Lo(e){return parseInt(e)}function xo(e,t){var r=0;if("]"==(t=Je(t))[t.length-1]){var n=t.lastIndexOf("[");r="]"!=t[n+1]?Lo(t.slice(n+1)):0,t=t.slice(0,n)}var o=Vr.programInfos[e]&&Vr.programInfos[e].uniforms[t];return o&&r>=0&&r<o[0]?o[1]+r:-1}function No(e,t,r,n){if(r){var o=ps.getUniform(Vr.programs[e],Vr.uniforms[t]);if("number"==typeof o||"boolean"==typeof o)switch(n){case 0:Xe[r>>2]=o;break;case 2:Ke[r>>2]=o}else for(var a=0;a<o.length;a++)switch(n){case 0:Xe[r+4*a>>2]=o[a];break;case 2:Ke[r+4*a>>2]=o[a]}}else Vr.recordError(1281)}function Uo(e,t,r){No(e,t,r,2)}function Go(e,t,r){No(e,t,r,0)}function ko(e,t,r){r?Xe[r>>2]=ps.getVertexAttribOffset(e,t):Vr.recordError(1281)}function Ho(e,t,r,n){if(r){var o=ps.getVertexAttrib(e,t);if(34975==t)Xe[r>>2]=o&&o.name;else if("number"==typeof o||"boolean"==typeof o)switch(n){case 0:Xe[r>>2]=o;break;case 2:Ke[r>>2]=o;break;case 5:Xe[r>>2]=Math.fround(o)}else for(var a=0;a<o.length;a++)switch(n){case 0:Xe[r+4*a>>2]=o[a];break;case 2:Ke[r+4*a>>2]=o[a];break;case 5:Xe[r+4*a>>2]=Math.fround(o[a])}}else Vr.recordError(1281)}function Xo(e,t,r){Ho(e,t,r,2)}function Vo(e,t,r){Ho(e,t,r,5)}function Ko(e,t){ps.hint(e,t)}function jo(e){var t=Vr.buffers[e];return t?ps.isBuffer(t):0}function Yo(e){return ps.isEnabled(e)}function Qo(e){var t=Vr.framebuffers[e];return t?ps.isFramebuffer(t):0}function Jo(e){return(e=Vr.programs[e])?ps.isProgram(e):0}function Wo(e){var t=Vr.timerQueriesEXT[e];return t?ps.disjointTimerQueryExt.isQueryEXT(t):0}function zo(e){var t=Vr.renderbuffers[e];return t?ps.isRenderbuffer(t):0}function Zo(e){var t=Vr.shaders[e];return t?ps.isShader(t):0}function qo(e){var t=Vr.textures[e];return t?ps.isTexture(t):0}function $o(e){var t=Vr.vaos[e];return t?ps.isVertexArray(t):0}function ea(e){ps.lineWidth(e)}function ta(e){ps.linkProgram(Vr.programs[e]),Vr.populateUniformTable(e)}function ra(e,t){3317==e&&(Vr.unpackAlignment=t),ps.pixelStorei(e,t)}function na(e,t){ps.polygonOffset(e,t)}function oa(e,t){ps.disjointTimerQueryExt.queryCounterEXT(Vr.timerQueriesEXT[e],t)}function aa(e,t,r,n){var o;return t*(e*r+(o=n)-1&-o)}function ia(e){return{5:3,6:4,8:2,29502:3,29504:4}[e-6402]||1}function sa(e){return 1==(e-=5120)?Ge:4==e?Xe:6==e?Ke:5==e||28922==e?Ve:He}function ca(e){return 31-Math.clz32(e.BYTES_PER_ELEMENT)}function Ea(e,t,r,n,o,a){var i=sa(e),s=ca(i),c=1<<s,E=aa(r,n,ia(t)*c,Vr.unpackAlignment);return i.subarray(o>>s,o+E>>s)}function ua(e,t,r,n,o,a,i){var s=Ea(a,o,r,n,i);s?ps.readPixels(e,t,r,n,o,a,s):Vr.recordError(1280)}function la(){}function da(e,t,r,n){ps.renderbufferStorage(e,t,r,n)}function Aa(e,t){ps.sampleCoverage(e,!!t)}function fa(e,t,r,n){ps.scissor(e,t,r,n)}function pa(){Vr.recordError(1280)}function _a(e,t,r,n){var o=Vr.getSource(e,t,r,n);ps.shaderSource(Vr.shaders[e],o)}function ga(e,t,r){ps.stencilFunc(e,t,r)}function ma(e,t,r,n){ps.stencilFuncSeparate(e,t,r,n)}function Ta(e){ps.stencilMask(e)}function ya(e,t){ps.stencilMaskSeparate(e,t)}function Ba(e,t,r){ps.stencilOp(e,t,r)}function Ca(e,t,r,n){ps.stencilOpSeparate(e,t,r,n)}function Da(e,t,r,n,o,a,i,s,c){ps.texImage2D(e,t,r,n,o,a,i,s,c?Ea(s,i,n,o,c):null)}function ha(e,t,r){ps.texParameterf(e,t,r)}function Oa(e,t,r){var n=Ke[r>>2];ps.texParameterf(e,t,n)}function Pa(e,t,r){ps.texParameteri(e,t,r)}function va(e,t,r){var n=Xe[r>>2];ps.texParameteri(e,t,n)}function Fa(e,t,r,n,o,a,i,s,c){var E=null;c&&(E=Ea(s,i,o,a,c)),ps.texSubImage2D(e,t,r,n,o,a,i,s,E)}function Ma(e,t){ps.uniform1f(Vr.uniforms[e],t)}ae.tempFixedLengthArray=Nn,ae._emscripten_glDrawBuffersWEBGL=Un,ae._emscripten_glDrawElements=Gn,ae._emscripten_glDrawElementsInstancedANGLE=kn,ae._emscripten_glEnable=Hn,ae._emscripten_glEnableVertexAttribArray=Xn,ae._emscripten_glEndQueryEXT=Vn,ae._emscripten_glFinish=Kn,ae._emscripten_glFlush=jn,ae._emscripten_glFramebufferRenderbuffer=Yn,ae._emscripten_glFramebufferTexture2D=Qn,ae._emscripten_glFrontFace=Jn,ae.__glGenObject=Wn,ae._emscripten_glGenBuffers=zn,ae._emscripten_glGenFramebuffers=Zn,ae._emscripten_glGenQueriesEXT=qn,ae._emscripten_glGenRenderbuffers=$n,ae._emscripten_glGenTextures=eo,ae._emscripten_glGenVertexArraysOES=to,ae._emscripten_glGenerateMipmap=ro,ae.__glGetActiveAttribOrUniform=no,ae._emscripten_glGetActiveAttrib=oo,ae._emscripten_glGetActiveUniform=ao,ae._emscripten_glGetAttachedShaders=io,ae._emscripten_glGetAttribLocation=so,ae.readI53FromI64=co,ae.readI53FromU64=Eo,ae.writeI53ToI64=uo,ae.emscriptenWebGLGet=lo,ae._emscripten_glGetBooleanv=Ao,ae._emscripten_glGetBufferParameteriv=fo,ae._emscripten_glGetError=po,ae._emscripten_glGetFloatv=_o,ae._emscripten_glGetFramebufferAttachmentParameteriv=go,ae._emscripten_glGetIntegerv=mo,ae._emscripten_glGetProgramInfoLog=To,ae._emscripten_glGetProgramiv=yo,ae._emscripten_glGetQueryObjecti64vEXT=Bo,ae._emscripten_glGetQueryObjectivEXT=Co,ae._emscripten_glGetQueryObjectui64vEXT=Do,ae._emscripten_glGetQueryObjectuivEXT=ho,ae._emscripten_glGetQueryivEXT=Oo,ae._emscripten_glGetRenderbufferParameteriv=Po,ae._emscripten_glGetShaderInfoLog=vo,ae._emscripten_glGetShaderPrecisionFormat=Fo,ae._emscripten_glGetShaderSource=Mo,ae._emscripten_glGetShaderiv=So,ae.stringToNewUTF8=bo,ae._emscripten_glGetString=Ro,ae._emscripten_glGetTexParameterfv=wo,ae._emscripten_glGetTexParameteriv=Io,ae.jstoi_q=Lo,ae._emscripten_glGetUniformLocation=xo,ae.emscriptenWebGLGetUniform=No,ae._emscripten_glGetUniformfv=Uo,ae._emscripten_glGetUniformiv=Go,ae._emscripten_glGetVertexAttribPointerv=ko,ae.emscriptenWebGLGetVertexAttrib=Ho,ae._emscripten_glGetVertexAttribfv=Xo,ae._emscripten_glGetVertexAttribiv=Vo,ae._emscripten_glHint=Ko,ae._emscripten_glIsBuffer=jo,ae._emscripten_glIsEnabled=Yo,ae._emscripten_glIsFramebuffer=Qo,ae._emscripten_glIsProgram=Jo,ae._emscripten_glIsQueryEXT=Wo,ae._emscripten_glIsRenderbuffer=zo,ae._emscripten_glIsShader=Zo,ae._emscripten_glIsTexture=qo,ae._emscripten_glIsVertexArrayOES=$o,ae._emscripten_glLineWidth=ea,ae._emscripten_glLinkProgram=ta,ae._emscripten_glPixelStorei=ra,ae._emscripten_glPolygonOffset=na,ae._emscripten_glQueryCounterEXT=oa,ae.computeUnpackAlignedImageSize=aa,ae.__colorChannelsInGlTextureFormat=ia,ae.heapObjectForWebGLType=sa,ae.heapAccessShiftForWebGLHeap=ca,ae.emscriptenWebGLGetTexPixelData=Ea,ae._emscripten_glReadPixels=ua,ae._emscripten_glReleaseShaderCompiler=la,ae._emscripten_glRenderbufferStorage=da,ae._emscripten_glSampleCoverage=Aa,ae._emscripten_glScissor=fa,ae._emscripten_glShaderBinary=pa,ae._emscripten_glShaderSource=_a,ae._emscripten_glStencilFunc=ga,ae._emscripten_glStencilFuncSeparate=ma,ae._emscripten_glStencilMask=Ta,ae._emscripten_glStencilMaskSeparate=ya,ae._emscripten_glStencilOp=Ba,ae._emscripten_glStencilOpSeparate=Ca,ae._emscripten_glTexImage2D=Da,ae._emscripten_glTexParameterf=ha,ae._emscripten_glTexParameterfv=Oa,ae._emscripten_glTexParameteri=Pa,ae._emscripten_glTexParameteriv=va,ae._emscripten_glTexSubImage2D=Fa,ae._emscripten_glUniform1f=Ma;var Sa=[];function ba(e,t,r){if(t<=288)for(var n=Sa[t-1],o=0;o<t;++o)n[o]=Ke[r+4*o>>2];else n=Ke.subarray(r>>2,r+4*t>>2);ps.uniform1fv(Vr.uniforms[e],n)}function Ra(e,t){ps.uniform1i(Vr.uniforms[e],t)}ae.miniTempWebGLFloatBuffers=Sa,ae._emscripten_glUniform1fv=ba,ae._emscripten_glUniform1i=Ra;var wa=[];function Ia(e,t,r){if(t<=288)for(var n=wa[t-1],o=0;o<t;++o)n[o]=Xe[r+4*o>>2];else n=Xe.subarray(r>>2,r+4*t>>2);ps.uniform1iv(Vr.uniforms[e],n)}function La(e,t,r){ps.uniform2f(Vr.uniforms[e],t,r)}function xa(e,t,r){if(t<=144)for(var n=Sa[2*t-1],o=0;o<2*t;o+=2)n[o]=Ke[r+4*o>>2],n[o+1]=Ke[r+(4*o+4)>>2];else n=Ke.subarray(r>>2,r+8*t>>2);ps.uniform2fv(Vr.uniforms[e],n)}function Na(e,t,r){ps.uniform2i(Vr.uniforms[e],t,r)}function Ua(e,t,r){if(t<=144)for(var n=wa[2*t-1],o=0;o<2*t;o+=2)n[o]=Xe[r+4*o>>2],n[o+1]=Xe[r+(4*o+4)>>2];else n=Xe.subarray(r>>2,r+8*t>>2);ps.uniform2iv(Vr.uniforms[e],n)}function Ga(e,t,r,n){ps.uniform3f(Vr.uniforms[e],t,r,n)}function ka(e,t,r){if(t<=96)for(var n=Sa[3*t-1],o=0;o<3*t;o+=3)n[o]=Ke[r+4*o>>2],n[o+1]=Ke[r+(4*o+4)>>2],n[o+2]=Ke[r+(4*o+8)>>2];else n=Ke.subarray(r>>2,r+12*t>>2);ps.uniform3fv(Vr.uniforms[e],n)}function Ha(e,t,r,n){ps.uniform3i(Vr.uniforms[e],t,r,n)}function Xa(e,t,r){if(t<=96)for(var n=wa[3*t-1],o=0;o<3*t;o+=3)n[o]=Xe[r+4*o>>2],n[o+1]=Xe[r+(4*o+4)>>2],n[o+2]=Xe[r+(4*o+8)>>2];else n=Xe.subarray(r>>2,r+12*t>>2);ps.uniform3iv(Vr.uniforms[e],n)}function Va(e,t,r,n,o){ps.uniform4f(Vr.uniforms[e],t,r,n,o)}function Ka(e,t,r){if(t<=72){var n=Sa[4*t-1],o=Ke;r>>=2;for(var a=0;a<4*t;a+=4){var i=r+a;n[a]=o[i],n[a+1]=o[i+1],n[a+2]=o[i+2],n[a+3]=o[i+3]}}else n=Ke.subarray(r>>2,r+16*t>>2);ps.uniform4fv(Vr.uniforms[e],n)}function ja(e,t,r,n,o){ps.uniform4i(Vr.uniforms[e],t,r,n,o)}function Ya(e,t,r){if(t<=72)for(var n=wa[4*t-1],o=0;o<4*t;o+=4)n[o]=Xe[r+4*o>>2],n[o+1]=Xe[r+(4*o+4)>>2],n[o+2]=Xe[r+(4*o+8)>>2],n[o+3]=Xe[r+(4*o+12)>>2];else n=Xe.subarray(r>>2,r+16*t>>2);ps.uniform4iv(Vr.uniforms[e],n)}function Qa(e,t,r,n){if(t<=72)for(var o=Sa[4*t-1],a=0;a<4*t;a+=4)o[a]=Ke[n+4*a>>2],o[a+1]=Ke[n+(4*a+4)>>2],o[a+2]=Ke[n+(4*a+8)>>2],o[a+3]=Ke[n+(4*a+12)>>2];else o=Ke.subarray(n>>2,n+16*t>>2);ps.uniformMatrix2fv(Vr.uniforms[e],!!r,o)}function Ja(e,t,r,n){if(t<=32)for(var o=Sa[9*t-1],a=0;a<9*t;a+=9)o[a]=Ke[n+4*a>>2],o[a+1]=Ke[n+(4*a+4)>>2],o[a+2]=Ke[n+(4*a+8)>>2],o[a+3]=Ke[n+(4*a+12)>>2],o[a+4]=Ke[n+(4*a+16)>>2],o[a+5]=Ke[n+(4*a+20)>>2],o[a+6]=Ke[n+(4*a+24)>>2],o[a+7]=Ke[n+(4*a+28)>>2],o[a+8]=Ke[n+(4*a+32)>>2];else o=Ke.subarray(n>>2,n+36*t>>2);ps.uniformMatrix3fv(Vr.uniforms[e],!!r,o)}function Wa(e,t,r,n){if(t<=18){var o=Sa[16*t-1],a=Ke;n>>=2;for(var i=0;i<16*t;i+=16){var s=n+i;o[i]=a[s],o[i+1]=a[s+1],o[i+2]=a[s+2],o[i+3]=a[s+3],o[i+4]=a[s+4],o[i+5]=a[s+5],o[i+6]=a[s+6],o[i+7]=a[s+7],o[i+8]=a[s+8],o[i+9]=a[s+9],o[i+10]=a[s+10],o[i+11]=a[s+11],o[i+12]=a[s+12],o[i+13]=a[s+13],o[i+14]=a[s+14],o[i+15]=a[s+15]}}else o=Ke.subarray(n>>2,n+64*t>>2);ps.uniformMatrix4fv(Vr.uniforms[e],!!r,o)}function za(e){ps.useProgram(Vr.programs[e])}function Za(e){ps.validateProgram(Vr.programs[e])}function qa(e,t){ps.vertexAttrib1f(e,t)}function $a(e,t){ps.vertexAttrib1f(e,Ke[t>>2])}function ei(e,t,r){ps.vertexAttrib2f(e,t,r)}function ti(e,t){ps.vertexAttrib2f(e,Ke[t>>2],Ke[t+4>>2])}function ri(e,t,r,n){ps.vertexAttrib3f(e,t,r,n)}function ni(e,t){ps.vertexAttrib3f(e,Ke[t>>2],Ke[t+4>>2],Ke[t+8>>2])}function oi(e,t,r,n,o){ps.vertexAttrib4f(e,t,r,n,o)}function ai(e,t){ps.vertexAttrib4f(e,Ke[t>>2],Ke[t+4>>2],Ke[t+8>>2],Ke[t+12>>2])}function ii(e,t){ps.vertexAttribDivisor(e,t)}function si(e,t,r,n,o,a){ps.vertexAttribPointer(e,t,r,!!n,o,a)}function ci(e,t,r,n){ps.viewport(e,t,r,n)}function Ei(e,t){throw Ls(e,t||1),"longjmp"}function ui(e,t){return Ei(e,t)}function li(e,t,r){Ge.copyWithin(e,t,t+r)}function di(){return Ge.length}function Ai(e){try{return Me.grow(e-Ne.byteLength+65535>>>16),rt(Me.buffer),1}catch(t){console.error("emscripten_realloc_buffer: Attempted to grow heap from "+Ne.byteLength+" bytes to "+e+" bytes, but got error: "+t)}}function fi(e){var t=di();we(e>t);var r=2147483648;if(e>r)return Be("Cannot enlarge memory, asked to go up to "+e+" bytes, but the limit is "+"2147483648 bytes!"),!1;for(var n=1;n<=4;n*=2){var o=t*(1+.2/n);o=Math.min(o,e+100663296);var a=Math.min(r,tt(Math.max(e,o),65536));if(Ai(a))return!0}return Be("Failed to grow the heap from "+t+" bytes to "+a+" bytes, not enough memory!"),!1}ae.__miniTempWebGLIntBuffers=wa,ae._emscripten_glUniform1iv=Ia,ae._emscripten_glUniform2f=La,ae._emscripten_glUniform2fv=xa,ae._emscripten_glUniform2i=Na,ae._emscripten_glUniform2iv=Ua,ae._emscripten_glUniform3f=Ga,ae._emscripten_glUniform3fv=ka,ae._emscripten_glUniform3i=Ha,ae._emscripten_glUniform3iv=Xa,ae._emscripten_glUniform4f=Va,ae._emscripten_glUniform4fv=Ka,ae._emscripten_glUniform4i=ja,ae._emscripten_glUniform4iv=Ya,ae._emscripten_glUniformMatrix2fv=Qa,ae._emscripten_glUniformMatrix3fv=Ja,ae._emscripten_glUniformMatrix4fv=Wa,ae._emscripten_glUseProgram=za,ae._emscripten_glValidateProgram=Za,ae._emscripten_glVertexAttrib1f=qa,ae._emscripten_glVertexAttrib1fv=$a,ae._emscripten_glVertexAttrib2f=ei,ae._emscripten_glVertexAttrib2fv=ti,ae._emscripten_glVertexAttrib3f=ri,ae._emscripten_glVertexAttrib3fv=ni,ae._emscripten_glVertexAttrib4f=oi,ae._emscripten_glVertexAttrib4fv=ai,ae._emscripten_glVertexAttribDivisorANGLE=ii,ae._emscripten_glVertexAttribPointer=si,ae._emscripten_glViewport=ci,ae._longjmp=Ei,ae._emscripten_longjmp=ui,ae._emscripten_memcpy_big=li,ae._emscripten_get_heap_size=di,ae.emscripten_realloc_buffer=Ai,ae._emscripten_resize_heap=fi;var pi={};function _i(){return se||"./this.program"}function gi(){if(!gi.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:_i()};for(var t in pi)e[t]=pi[t];var r=[];for(var t in e)r.push(t+"="+e[t]);gi.strings=r}return gi.strings}function mi(e,t){try{var r=0;return gi().forEach((function(n,o){var a=t+r;Xe[e+4*o>>2]=a,et(n,a),r+=n.length+1})),0}catch(e){return void 0!==mr&&e instanceof mr.ErrnoError||Ft(e),e.errno}}function Ti(e,t){try{var r=gi();Xe[e>>2]=r.length;var n=0;return r.forEach((function(e){n+=e.length+1})),Xe[t>>2]=n,0}catch(e){return void 0!==mr&&e instanceof mr.ErrnoError||Ft(e),e.errno}}function yi(e){Js(e)}function Bi(e){try{var t=Tr.getStreamFromFD(e);return mr.close(t),0}catch(e){return void 0!==mr&&e instanceof mr.ErrnoError||Ft(e),e.errno}}function Ci(e,t){try{var r=Tr.getStreamFromFD(e),n=r.tty?2:mr.isDir(r.mode)?3:mr.isLink(r.mode)?7:4;return Ue[t>>0]=n,0}catch(e){return void 0!==mr&&e instanceof mr.ErrnoError||Ft(e),e.errno}}function Di(e,t,r,n){try{var o=Tr.getStreamFromFD(e),a=Tr.doReadv(o,t,r);return Xe[n>>2]=a,0}catch(e){return void 0!==mr&&e instanceof mr.ErrnoError||Ft(e),e.errno}}function hi(e,t,r,n,o){try{var a=Tr.getStreamFromFD(e),i=4294967296*r+(t>>>0),s=9007199254740992;return i<=-s||i>=s?-61:(mr.llseek(a,i,n),Nt=[a.position>>>0,(xt=a.position,+Math.abs(xt)>=1?xt>0?(0|Math.min(+Math.floor(xt/4294967296),4294967295))>>>0:~~+Math.ceil((xt-+(~~xt>>>0))/4294967296)>>>0:0)],Xe[o>>2]=Nt[0],Xe[o+4>>2]=Nt[1],a.getdents&&0===i&&0===n&&(a.getdents=null),0)}catch(e){return void 0!==mr&&e instanceof mr.ErrnoError||Ft(e),e.errno}}function Oi(e,t,r,n){try{var o=Tr.getStreamFromFD(e),a=Tr.doWritev(o,t,r);return Xe[n>>2]=a,0}catch(e){return void 0!==mr&&e instanceof mr.ErrnoError||Ft(e),e.errno}}function Pi(){return 0|Fe()}function vi(e,t){ps.bindTexture(e,Vr.textures[t])}function Fi(e,t){ps.blendFunc(e,t)}function Mi(e,t,r,n){ps.colorMask(!!e,!!t,!!r,!!n)}function Si(e){ps.cullFace(e)}function bi(e,t){for(var r=0;r<e;r++){var n=Xe[t+4*r>>2],o=Vr.textures[n];o&&(ps.deleteTexture(o),o.name=0,Vr.textures[n]=null)}}function Ri(e){ps.depthFunc(e)}function wi(e){ps.depthMask(!!e)}function Ii(e,t){ps.depthRange(e,t)}function Li(e,t,r){ps.drawArrays(e,t,r)}function xi(e,t,r,n){ps.drawElements(e,t,r,n)}function Ni(e){ps.enable(e)}function Ui(e){ps.frontFace(e)}function Gi(e,t){Wn(e,t,"createTexture",Vr.textures)}function ki(){var e=ps.getError()||Vr.lastError;return Vr.lastError=0,e}function Hi(e,t){lo(e,t,0)}function Xi(e){if(Vr.stringCache[e])return Vr.stringCache[e];var t;switch(e){case 7939:var r=ps.getSupportedExtensions()||[];t=bo((r=r.concat(r.map((function(e){return"GL_"+e})))).join(" "));break;case 7936:case 7937:case 37445:case 37446:var n=ps.getParameter(e);n||Vr.recordError(1280),t=bo(n);break;case 7938:var o=ps.getParameter(7938);t=bo(o="OpenGL ES 2.0 ("+o+")");break;case 35724:var a=ps.getParameter(35724),i=a.match(/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/);null!==i&&(3==i[1].length&&(i[1]=i[1]+"0"),a="OpenGL ES GLSL ES "+i[1]+" ("+a+")"),t=bo(a);break;default:return Vr.recordError(1280),0}return Vr.stringCache[e]=t,t}function Vi(e,t){ps.hint(e,t)}function Ki(e){ps.lineWidth(e)}function ji(e,t){3317==e&&(Vr.unpackAlignment=t),ps.pixelStorei(e,t)}function Yi(e,t){ps.polygonOffset(e,t)}function Qi(e,t,r,n,o,a,i){var s=Ea(a,o,r,n,i);s?ps.readPixels(e,t,r,n,o,a,s):Vr.recordError(1280)}function Ji(e,t,r,n){ps.scissor(e,t,r,n)}function Wi(){Vr.recordError(1280)}function zi(e,t,r){ps.stencilFunc(e,t,r)}function Zi(e){ps.stencilMask(e)}function qi(e,t,r){ps.stencilOp(e,t,r)}function $i(e,t,r,n,o,a,i,s,c){ps.texImage2D(e,t,r,n,o,a,i,s,c?Ea(s,i,n,o,c):null)}function es(e,t,r){ps.texParameterf(e,t,r)}function ts(e,t,r){var n=Ke[r>>2];ps.texParameterf(e,t,n)}function rs(e,t,r){ps.texParameteri(e,t,r)}function ns(e,t,r){var n=Xe[r>>2];ps.texParameteri(e,t,n)}function os(e,t,r,n,o,a,i,s,c){var E=null;c&&(E=Ea(s,i,o,a,c)),ps.texSubImage2D(e,t,r,n,o,a,i,s,E)}function as(e,t,r,n){ps.viewport(e,t,r,n)}function is(e){ve(0|e)}function ss(e){return e%4==0&&(e%100!=0||e%400==0)}function cs(e,t){for(var r=0,n=0;n<=t;r+=e[n++]);return r}ae.ENV=pi,ae.getExecutableName=_i,ae.getEnvStrings=gi,ae._environ_get=mi,ae._environ_sizes_get=Ti,ae._exit=yi,ae._fd_close=Bi,ae._fd_fdstat_get=Ci,ae._fd_read=Di,ae._fd_seek=hi,ae._fd_write=Oi,ae._getTempRet0=Pi,ae._glBindTexture=vi,ae._glBlendFunc=Fi,ae._glColorMask=Mi,ae._glCullFace=Si,ae._glDeleteTextures=bi,ae._glDepthFunc=Ri,ae._glDepthMask=wi,ae._glDepthRangef=Ii,ae._glDrawArrays=Li,ae._glDrawElements=xi,ae._glEnable=Ni,ae._glFrontFace=Ui,ae._glGenTextures=Gi,ae._glGetError=ki,ae._glGetIntegerv=Hi,ae._glGetString=Xi,ae._glHint=Vi,ae._glLineWidth=Ki,ae._glPixelStorei=ji,ae._glPolygonOffset=Yi,ae._glReadPixels=Qi,ae._glScissor=Ji,ae._glShaderBinary=Wi,ae._glStencilFunc=zi,ae._glStencilMask=Zi,ae._glStencilOp=qi,ae._glTexImage2D=$i,ae._glTexParameterf=es,ae._glTexParameterfv=ts,ae._glTexParameteri=rs,ae._glTexParameteriv=ns,ae._glTexSubImage2D=os,ae._glViewport=as,ae._setTempRet0=is,ae.__isLeapYear=ss,ae.__arraySum=cs;var Es=[31,29,31,30,31,30,31,31,30,31,30,31];ae.__MONTH_DAYS_LEAP=Es;var us=[31,28,31,30,31,30,31,31,30,31,30,31];function ls(e,t){for(var r=new Date(e.getTime());t>0;){var n=ss(r.getFullYear()),o=r.getMonth(),a=(n?Es:us)[o];if(!(t>a-r.getDate()))return r.setDate(r.getDate()+t),r;t-=a-r.getDate()+1,r.setDate(1),o<11?r.setMonth(o+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1))}return r}function ds(e,t,r,n){var o=Xe[n+40>>2],a={tm_sec:Xe[n>>2],tm_min:Xe[n+4>>2],tm_hour:Xe[n+8>>2],tm_mday:Xe[n+12>>2],tm_mon:Xe[n+16>>2],tm_year:Xe[n+20>>2],tm_wday:Xe[n+24>>2],tm_yday:Xe[n+28>>2],tm_isdst:Xe[n+32>>2],tm_gmtoff:Xe[n+36>>2],tm_zone:o?Je(o):""},i=Je(r),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var c in s)i=i.replace(new RegExp(c,"g"),s[c]);var E=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],u=["January","February","March","April","May","June","July","August","September","October","November","December"];function l(e,t,r){for(var n="number"==typeof e?e.toString():e||"";n.length<t;)n=r[0]+n;return n}function d(e,t){return l(e,t,"0")}function A(e,t){function r(e){return e<0?-1:e>0?1:0}var n;return 0===(n=r(e.getFullYear()-t.getFullYear()))&&0===(n=r(e.getMonth()-t.getMonth()))&&(n=r(e.getDate()-t.getDate())),n}function f(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function p(e){var t=ls(new Date(e.tm_year+1900,0,1),e.tm_yday),r=new Date(t.getFullYear(),0,4),n=new Date(t.getFullYear()+1,0,4),o=f(r),a=f(n);return A(o,t)<=0?A(a,t)<=0?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var _={"%a":function(e){return E[e.tm_wday].substring(0,3)},"%A":function(e){return E[e.tm_wday]},"%b":function(e){return u[e.tm_mon].substring(0,3)},"%B":function(e){return u[e.tm_mon]},"%C":function(e){return d((e.tm_year+1900)/100|0,2)},"%d":function(e){return d(e.tm_mday,2)},"%e":function(e){return l(e.tm_mday,2," ")},"%g":function(e){return p(e).toString().substring(2)},"%G":function(e){return p(e)},"%H":function(e){return d(e.tm_hour,2)},"%I":function(e){var t=e.tm_hour;return 0==t?t=12:t>12&&(t-=12),d(t,2)},"%j":function(e){return d(e.tm_mday+cs(ss(e.tm_year+1900)?Es:us,e.tm_mon-1),3)},"%m":function(e){return d(e.tm_mon+1,2)},"%M":function(e){return d(e.tm_min,2)},"%n":function(){return"\n"},"%p":function(e){return e.tm_hour>=0&&e.tm_hour<12?"AM":"PM"},"%S":function(e){return d(e.tm_sec,2)},"%t":function(){return"\t"},"%u":function(e){return e.tm_wday||7},"%U":function(e){var t=new Date(e.tm_year+1900,0,1),r=0===t.getDay()?t:ls(t,7-t.getDay()),n=new Date(e.tm_year+1900,e.tm_mon,e.tm_mday);if(A(r,n)<0){var o=cs(ss(n.getFullYear())?Es:us,n.getMonth()-1)-31,a=31-r.getDate()+o+n.getDate();return d(Math.ceil(a/7),2)}return 0===A(r,t)?"01":"00"},"%V":function(e){var t,r=new Date(e.tm_year+1900,0,4),n=new Date(e.tm_year+1901,0,4),o=f(r),a=f(n),i=ls(new Date(e.tm_year+1900,0,1),e.tm_yday);return A(i,o)<0?"53":A(a,i)<=0?"01":(t=o.getFullYear()<e.tm_year+1900?e.tm_yday+32-o.getDate():e.tm_yday+1-o.getDate(),d(Math.ceil(t/7),2))},"%w":function(e){return e.tm_wday},"%W":function(e){var t=new Date(e.tm_year,0,1),r=1===t.getDay()?t:ls(t,0===t.getDay()?1:7-t.getDay()+1),n=new Date(e.tm_year+1900,e.tm_mon,e.tm_mday);if(A(r,n)<0){var o=cs(ss(n.getFullYear())?Es:us,n.getMonth()-1)-31,a=31-r.getDate()+o+n.getDate();return d(Math.ceil(a/7),2)}return 0===A(r,t)?"01":"00"},"%y":function(e){return(e.tm_year+1900).toString().substring(2)},"%Y":function(e){return e.tm_year+1900},"%z":function(e){var t=e.tm_gmtoff,r=t>=0;return t=(t=Math.abs(t)/60)/60*100+t%60,(r?"+":"-")+String("0000"+t).slice(-4)},"%Z":function(e){return e.tm_zone},"%%":function(){return"%"}};for(var c in _)i.indexOf(c)>=0&&(i=i.replace(new RegExp(c,"g"),_[c](a)));var g=Cs(i,!1);return g.length>t?0:($e(g,e),g.length-1)}function As(e,t,r,n){return ds(e,t,r,n)}function fs(e){var t=Date.now()/1e3|0;return e&&(Xe[e>>2]=t),t}ae.__MONTH_DAYS_REGULAR=us,ae.__addDays=ls,ae._strftime=ds,ae._strftime_l=As,ae._time=fs;var ps,_s=function(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=mr.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n},gs=365,ms=146;Object.defineProperties(_s.prototype,{read:{get:function(){return(this.mode&gs)===gs},set:function(e){e?this.mode|=gs:this.mode&=~gs}},write:{get:function(){return(this.mode&ms)===ms},set:function(e){e?this.mode|=ms:this.mode&=~ms}},isFolder:{get:function(){return mr.isDir(this.mode)}},isDevice:{get:function(){return mr.isChrdev(this.mode)}}}),mr.FSNode=_s,mr.staticInit();for(var Ts=0;Ts<32;++Ts)Nn.push(new Array(Ts));var ys=new Float32Array(288);for(Ts=0;Ts<288;++Ts)Sa[Ts]=ys.subarray(0,Ts+1);var Bs=new Int32Array(288);for(Ts=0;Ts<288;++Ts)wa[Ts]=Bs.subarray(0,Ts+1);function Cs(e,t,r){var n=r>0?r:Ze(e)+1,o=new Array(n),a=We(e,o,0,o.length);return t&&(o.length=a),o}var Ds={__assert_fail:Jt,__clock_gettime:qt,__cxa_allocate_exception:er,__cxa_atexit:rr,__cxa_throw:ir,__localtime_r:Er,__sys_access:yr,__sys_dup:Br,__sys_fcntl64:Cr,__sys_fstat64:Dr,__sys_getcwd:hr,__sys_getdents64:Or,__sys_ioctl:Pr,__sys_lstat64:vr,__sys_mkdir:Fr,__sys_open:Mr,__sys_readlink:Sr,__sys_rename:br,__sys_rmdir:Rr,__sys_stat64:wr,__sys_unlink:Ir,abort:Lr,clock_gettime:Zt,dlclose:xr,dlerror:Nr,dlopen:Ur,emscripten_glActiveTexture:Kr,emscripten_glAttachShader:jr,emscripten_glBeginQueryEXT:Yr,emscripten_glBindAttribLocation:Qr,emscripten_glBindBuffer:Jr,emscripten_glBindFramebuffer:Wr,emscripten_glBindRenderbuffer:zr,emscripten_glBindTexture:Zr,emscripten_glBindVertexArrayOES:qr,emscripten_glBlendColor:$r,emscripten_glBlendEquation:en,emscripten_glBlendEquationSeparate:tn,emscripten_glBlendFunc:rn,emscripten_glBlendFuncSeparate:nn,emscripten_glBufferData:on,emscripten_glBufferSubData:an,emscripten_glCheckFramebufferStatus:sn,emscripten_glClear:cn,emscripten_glClearColor:En,emscripten_glClearDepthf:un,emscripten_glClearStencil:ln,emscripten_glColorMask:dn,emscripten_glCompileShader:An,emscripten_glCompressedTexImage2D:fn,emscripten_glCompressedTexSubImage2D:pn,emscripten_glCopyTexImage2D:_n,emscripten_glCopyTexSubImage2D:gn,emscripten_glCreateProgram:mn,emscripten_glCreateShader:Tn,emscripten_glCullFace:yn,emscripten_glDeleteBuffers:Bn,emscripten_glDeleteFramebuffers:Cn,emscripten_glDeleteProgram:Dn,emscripten_glDeleteQueriesEXT:hn,emscripten_glDeleteRenderbuffers:On,emscripten_glDeleteShader:Pn,emscripten_glDeleteTextures:vn,emscripten_glDeleteVertexArraysOES:Fn,emscripten_glDepthFunc:Mn,emscripten_glDepthMask:Sn,emscripten_glDepthRangef:bn,emscripten_glDetachShader:Rn,emscripten_glDisable:wn,emscripten_glDisableVertexAttribArray:In,emscripten_glDrawArrays:Ln,emscripten_glDrawArraysInstancedANGLE:xn,emscripten_glDrawBuffersWEBGL:Un,emscripten_glDrawElements:Gn,emscripten_glDrawElementsInstancedANGLE:kn,emscripten_glEnable:Hn,emscripten_glEnableVertexAttribArray:Xn,emscripten_glEndQueryEXT:Vn,emscripten_glFinish:Kn,emscripten_glFlush:jn,emscripten_glFramebufferRenderbuffer:Yn,emscripten_glFramebufferTexture2D:Qn,emscripten_glFrontFace:Jn,emscripten_glGenBuffers:zn,emscripten_glGenFramebuffers:Zn,emscripten_glGenQueriesEXT:qn,emscripten_glGenRenderbuffers:$n,emscripten_glGenTextures:eo,emscripten_glGenVertexArraysOES:to,emscripten_glGenerateMipmap:ro,emscripten_glGetActiveAttrib:oo,emscripten_glGetActiveUniform:ao,emscripten_glGetAttachedShaders:io,emscripten_glGetAttribLocation:so,emscripten_glGetBooleanv:Ao,emscripten_glGetBufferParameteriv:fo,emscripten_glGetError:po,emscripten_glGetFloatv:_o,emscripten_glGetFramebufferAttachmentParameteriv:go,emscripten_glGetIntegerv:mo,emscripten_glGetProgramInfoLog:To,emscripten_glGetProgramiv:yo,emscripten_glGetQueryObjecti64vEXT:Bo,emscripten_glGetQueryObjectivEXT:Co,emscripten_glGetQueryObjectui64vEXT:Do,emscripten_glGetQueryObjectuivEXT:ho,emscripten_glGetQueryivEXT:Oo,emscripten_glGetRenderbufferParameteriv:Po,emscripten_glGetShaderInfoLog:vo,emscripten_glGetShaderPrecisionFormat:Fo,emscripten_glGetShaderSource:Mo,emscripten_glGetShaderiv:So,emscripten_glGetString:Ro,emscripten_glGetTexParameterfv:wo,emscripten_glGetTexParameteriv:Io,emscripten_glGetUniformLocation:xo,emscripten_glGetUniformfv:Uo,emscripten_glGetUniformiv:Go,emscripten_glGetVertexAttribPointerv:ko,emscripten_glGetVertexAttribfv:Xo,emscripten_glGetVertexAttribiv:Vo,emscripten_glHint:Ko,emscripten_glIsBuffer:jo,emscripten_glIsEnabled:Yo,emscripten_glIsFramebuffer:Qo,emscripten_glIsProgram:Jo,emscripten_glIsQueryEXT:Wo,emscripten_glIsRenderbuffer:zo,emscripten_glIsShader:Zo,emscripten_glIsTexture:qo,emscripten_glIsVertexArrayOES:$o,emscripten_glLineWidth:ea,emscripten_glLinkProgram:ta,emscripten_glPixelStorei:ra,emscripten_glPolygonOffset:na,emscripten_glQueryCounterEXT:oa,emscripten_glReadPixels:ua,emscripten_glReleaseShaderCompiler:la,emscripten_glRenderbufferStorage:da,emscripten_glSampleCoverage:Aa,emscripten_glScissor:fa,emscripten_glShaderBinary:pa,emscripten_glShaderSource:_a,emscripten_glStencilFunc:ga,emscripten_glStencilFuncSeparate:ma,emscripten_glStencilMask:Ta,emscripten_glStencilMaskSeparate:ya,emscripten_glStencilOp:Ba,emscripten_glStencilOpSeparate:Ca,emscripten_glTexImage2D:Da,emscripten_glTexParameterf:ha,emscripten_glTexParameterfv:Oa,emscripten_glTexParameteri:Pa,emscripten_glTexParameteriv:va,emscripten_glTexSubImage2D:Fa,emscripten_glUniform1f:Ma,emscripten_glUniform1fv:ba,emscripten_glUniform1i:Ra,emscripten_glUniform1iv:Ia,emscripten_glUniform2f:La,emscripten_glUniform2fv:xa,emscripten_glUniform2i:Na,emscripten_glUniform2iv:Ua,emscripten_glUniform3f:Ga,emscripten_glUniform3fv:ka,emscripten_glUniform3i:Ha,emscripten_glUniform3iv:Xa,emscripten_glUniform4f:Va,emscripten_glUniform4fv:Ka,emscripten_glUniform4i:ja,emscripten_glUniform4iv:Ya,emscripten_glUniformMatrix2fv:Qa,emscripten_glUniformMatrix3fv:Ja,emscripten_glUniformMatrix4fv:Wa,emscripten_glUseProgram:za,emscripten_glValidateProgram:Za,emscripten_glVertexAttrib1f:qa,emscripten_glVertexAttrib1fv:$a,emscripten_glVertexAttrib2f:ei,emscripten_glVertexAttrib2fv:ti,emscripten_glVertexAttrib3f:ri,emscripten_glVertexAttrib3fv:ni,emscripten_glVertexAttrib4f:oi,emscripten_glVertexAttrib4fv:ai,emscripten_glVertexAttribDivisorANGLE:ii,emscripten_glVertexAttribPointer:si,emscripten_glViewport:ci,emscripten_longjmp:ui,emscripten_memcpy_big:li,emscripten_resize_heap:fi,environ_get:mi,environ_sizes_get:Ti,exit:yi,fd_close:Bi,fd_fdstat_get:Ci,fd_read:Di,fd_seek:hi,fd_write:Oi,getTempRet0:Pi,glBindTexture:vi,glBlendFunc:Fi,glColorMask:Mi,glCullFace:Si,glDeleteTextures:bi,glDepthFunc:Ri,glDepthMask:wi,glDepthRangef:Ii,glDrawArrays:Li,glDrawElements:xi,glEnable:Ni,glFrontFace:Ui,glGenTextures:Gi,glGetError:ki,glGetIntegerv:Hi,glGetString:Xi,glHint:Vi,glLineWidth:Ki,glPixelStorei:ji,glPolygonOffset:Yi,glReadPixels:Qi,glScissor:Ji,glShaderBinary:Wi,glStencilFunc:zi,glStencilMask:Zi,glStencilOp:qi,glTexImage2D:$i,glTexParameterf:es,glTexParameterfv:ts,glTexParameteri:rs,glTexParameteriv:ns,glTexSubImage2D:os,glViewport:as,invoke_ii:Ns,invoke_iii:Hs,invoke_iiii:Vs,invoke_iiiii:Xs,invoke_vi:Us,invoke_vii:ks,invoke_viii:Gs,setTempRet0:is,strftime:ds,strftime_l:As,time:fs};Xt();var hs=ae.___wasm_call_ctors=Lt("__wasm_call_ctors");ae._FreeMemory=Lt("FreeMemory"),ae._OSGBToS3MB=Lt("OSGBToS3MB");var Os=ae.___errno_location=Lt("__errno_location");ae._fflush=Lt("fflush");var Ps=ae.__get_tzname=Lt("_get_tzname"),vs=ae.__get_daylight=Lt("_get_daylight"),Fs=ae.__get_timezone=Lt("_get_timezone");ae._emscripten_main_thread_process_queued_calls=Lt("emscripten_main_thread_process_queued_calls");var Ms=ae.stackSave=Lt("stackSave"),Ss=ae.stackRestore=Lt("stackRestore"),bs=ae.stackAlloc=Lt("stackAlloc"),Rs=ae._emscripten_stack_init=function(){return(Rs=ae._emscripten_stack_init=ae.asm.emscripten_stack_init).apply(null,arguments)};ae._emscripten_stack_get_free=function(){return(ae._emscripten_stack_get_free=ae.asm.emscripten_stack_get_free).apply(null,arguments)};var ws,Is=ae._emscripten_stack_get_end=function(){return(Is=ae._emscripten_stack_get_end=ae.asm.emscripten_stack_get_end).apply(null,arguments)},Ls=ae._setThrew=Lt("setThrew"),xs=ae._malloc=Lt("malloc");function Ns(e,t){var r=Ms();try{return ot.get(e)(t)}catch(e){if(Ss(r),e!==e+0&&"longjmp"!==e)throw e;Ls(1,0)}}function Us(e,t){var r=Ms();try{ot.get(e)(t)}catch(e){if(Ss(r),e!==e+0&&"longjmp"!==e)throw e;Ls(1,0)}}function Gs(e,t,r,n){var o=Ms();try{ot.get(e)(t,r,n)}catch(e){if(Ss(o),e!==e+0&&"longjmp"!==e)throw e;Ls(1,0)}}function ks(e,t,r){var n=Ms();try{ot.get(e)(t,r)}catch(e){if(Ss(n),e!==e+0&&"longjmp"!==e)throw e;Ls(1,0)}}function Hs(e,t,r){var n=Ms();try{return ot.get(e)(t,r)}catch(e){if(Ss(n),e!==e+0&&"longjmp"!==e)throw e;Ls(1,0)}}function Xs(e,t,r,n,o){var a=Ms();try{return ot.get(e)(t,r,n,o)}catch(e){if(Ss(a),e!==e+0&&"longjmp"!==e)throw e;Ls(1,0)}}function Vs(e,t,r,n){var o=Ms();try{return ot.get(e)(t,r,n)}catch(e){if(Ss(o),e!==e+0&&"longjmp"!==e)throw e;Ls(1,0)}}function Ks(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function js(){Rs(),it()}function Ys(e){function t(){ws||(ws=!0,ae.calledRun=!0,Re||(pt(),_t(),ae.onRuntimeInitialized&&ae.onRuntimeInitialized(),we(!ae._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),mt()))}Bt>0||(js(),ft(),Bt>0||(ae.setStatus?(ae.setStatus("Running..."),setTimeout((function(){setTimeout((function(){ae.setStatus("")}),1),t()}),1)):t(),st()))}function Qs(){var e=ye,t=Be,r=!1;ye=Be=function(e){r=!0};try{var n=ae._fflush;n&&n(0),["stdout","stderr"].forEach((function(e){var t=mr.analyzePath("/dev/"+e);if(t){var n=t.object.rdev,o=Ar.ttys[n];o&&o.output&&o.output.length&&(r=!0)}}))}catch(e){}ye=e,Be=t,r&&he("stdio streams had content in them that was not flushed. you should set EXIT_RUNTIME to 1 (see the FAQ), or make sure to emit a newline when you printf etc.")}function Js(e,t){if(Qs(),!t||!Se||0!==e){if(Se){if(!t)Be("program exited (with status: "+e+"), but EXIT_RUNTIME is not set, so halting execution but not exiting the runtime or preventing further async execution (build with EXIT_RUNTIME=1, if you want a true shutdown)")}else gt(),ae.onExit&&ae.onExit(e),Re=!0;ce(e,new Ks(e))}}if(ae._free=Lt("free"),ae.dynCall_jiji=Lt("dynCall_jiji"),ae.dynCall_iiiiij=Lt("dynCall_iiiiij"),ae.dynCall_iiiiijj=Lt("dynCall_iiiiijj"),ae.dynCall_iiiiiijj=Lt("dynCall_iiiiiijj"),ae.dynCall_viijii=Lt("dynCall_viijii"),ae.dynCall_vij=Lt("dynCall_vij"),ae.dynCall_jii=Lt("dynCall_jii"),ae.dynCall_iiiji=Lt("dynCall_iiiji"),ae.dynCall_ij=Lt("dynCall_ij"),ae.dynCall_ji=Lt("dynCall_ji"),ae.dynCall_iiiij=Lt("dynCall_iiiij"),Object.getOwnPropertyDescriptor(ae,"intArrayFromString")||(ae.intArrayFromString=function(){Ft("'intArrayFromString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"intArrayToString")||(ae.intArrayToString=function(){Ft("'intArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),ae.ccall=Le,ae.cwrap=xe,Object.getOwnPropertyDescriptor(ae,"setValue")||(ae.setValue=function(){Ft("'setValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),ae.getValue=be,Object.getOwnPropertyDescriptor(ae,"allocate")||(ae.allocate=function(){Ft("'allocate' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"UTF8ArrayToString")||(ae.UTF8ArrayToString=function(){Ft("'UTF8ArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"UTF8ToString")||(ae.UTF8ToString=function(){Ft("'UTF8ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"stringToUTF8Array")||(ae.stringToUTF8Array=function(){Ft("'stringToUTF8Array' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"stringToUTF8")||(ae.stringToUTF8=function(){Ft("'stringToUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"lengthBytesUTF8")||(ae.lengthBytesUTF8=function(){Ft("'lengthBytesUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"stackTrace")||(ae.stackTrace=function(){Ft("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"addOnPreRun")||(ae.addOnPreRun=function(){Ft("'addOnPreRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"addOnInit")||(ae.addOnInit=function(){Ft("'addOnInit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"addOnPreMain")||(ae.addOnPreMain=function(){Ft("'addOnPreMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"addOnExit")||(ae.addOnExit=function(){Ft("'addOnExit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"addOnPostRun")||(ae.addOnPostRun=function(){Ft("'addOnPostRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"writeStringToMemory")||(ae.writeStringToMemory=function(){Ft("'writeStringToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"writeArrayToMemory")||(ae.writeArrayToMemory=function(){Ft("'writeArrayToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"writeAsciiToMemory")||(ae.writeAsciiToMemory=function(){Ft("'writeAsciiToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"addRunDependency")||(ae.addRunDependency=function(){Ft("'addRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),Object.getOwnPropertyDescriptor(ae,"removeRunDependency")||(ae.removeRunDependency=function(){Ft("'removeRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),Object.getOwnPropertyDescriptor(ae,"FS_createFolder")||(ae.FS_createFolder=function(){Ft("'FS_createFolder' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"FS_createPath")||(ae.FS_createPath=function(){Ft("'FS_createPath' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),Object.getOwnPropertyDescriptor(ae,"FS_createDataFile")||(ae.FS_createDataFile=function(){Ft("'FS_createDataFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),Object.getOwnPropertyDescriptor(ae,"FS_createPreloadedFile")||(ae.FS_createPreloadedFile=function(){Ft("'FS_createPreloadedFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),Object.getOwnPropertyDescriptor(ae,"FS_createLazyFile")||(ae.FS_createLazyFile=function(){Ft("'FS_createLazyFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),Object.getOwnPropertyDescriptor(ae,"FS_createLink")||(ae.FS_createLink=function(){Ft("'FS_createLink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"FS_createDevice")||(ae.FS_createDevice=function(){Ft("'FS_createDevice' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),Object.getOwnPropertyDescriptor(ae,"FS_unlink")||(ae.FS_unlink=function(){Ft("'FS_unlink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),Object.getOwnPropertyDescriptor(ae,"getLEB")||(ae.getLEB=function(){Ft("'getLEB' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"getFunctionTables")||(ae.getFunctionTables=function(){Ft("'getFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"alignFunctionTables")||(ae.alignFunctionTables=function(){Ft("'alignFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"registerFunctions")||(ae.registerFunctions=function(){Ft("'registerFunctions' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"addFunction")||(ae.addFunction=function(){Ft("'addFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"removeFunction")||(ae.removeFunction=function(){Ft("'removeFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"getFuncWrapper")||(ae.getFuncWrapper=function(){Ft("'getFuncWrapper' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"prettyPrint")||(ae.prettyPrint=function(){Ft("'prettyPrint' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"makeBigInt")||(ae.makeBigInt=function(){Ft("'makeBigInt' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"dynCall")||(ae.dynCall=function(){Ft("'dynCall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"getCompilerSetting")||(ae.getCompilerSetting=function(){Ft("'getCompilerSetting' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"print")||(ae.print=function(){Ft("'print' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"printErr")||(ae.printErr=function(){Ft("'printErr' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"getTempRet0")||(ae.getTempRet0=function(){Ft("'getTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"setTempRet0")||(ae.setTempRet0=function(){Ft("'setTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"callMain")||(ae.callMain=function(){Ft("'callMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"abort")||(ae.abort=function(){Ft("'abort' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"stringToNewUTF8")||(ae.stringToNewUTF8=function(){Ft("'stringToNewUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"setFileTime")||(ae.setFileTime=function(){Ft("'setFileTime' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"emscripten_realloc_buffer")||(ae.emscripten_realloc_buffer=function(){Ft("'emscripten_realloc_buffer' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"ENV")||(ae.ENV=function(){Ft("'ENV' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"ERRNO_CODES")||(ae.ERRNO_CODES=function(){Ft("'ERRNO_CODES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"ERRNO_MESSAGES")||(ae.ERRNO_MESSAGES=function(){Ft("'ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"setErrNo")||(ae.setErrNo=function(){Ft("'setErrNo' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"inetPton4")||(ae.inetPton4=function(){Ft("'inetPton4' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"inetNtop4")||(ae.inetNtop4=function(){Ft("'inetNtop4' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"inetPton6")||(ae.inetPton6=function(){Ft("'inetPton6' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"inetNtop6")||(ae.inetNtop6=function(){Ft("'inetNtop6' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"readSockaddr")||(ae.readSockaddr=function(){Ft("'readSockaddr' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"writeSockaddr")||(ae.writeSockaddr=function(){Ft("'writeSockaddr' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"DNS")||(ae.DNS=function(){Ft("'DNS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"getHostByName")||(ae.getHostByName=function(){Ft("'getHostByName' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"GAI_ERRNO_MESSAGES")||(ae.GAI_ERRNO_MESSAGES=function(){Ft("'GAI_ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"Protocols")||(ae.Protocols=function(){Ft("'Protocols' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"Sockets")||(ae.Sockets=function(){Ft("'Sockets' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"getRandomDevice")||(ae.getRandomDevice=function(){Ft("'getRandomDevice' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"traverseStack")||(ae.traverseStack=function(){Ft("'traverseStack' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"UNWIND_CACHE")||(ae.UNWIND_CACHE=function(){Ft("'UNWIND_CACHE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"withBuiltinMalloc")||(ae.withBuiltinMalloc=function(){Ft("'withBuiltinMalloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"readAsmConstArgsArray")||(ae.readAsmConstArgsArray=function(){Ft("'readAsmConstArgsArray' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"readAsmConstArgs")||(ae.readAsmConstArgs=function(){Ft("'readAsmConstArgs' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"mainThreadEM_ASM")||(ae.mainThreadEM_ASM=function(){Ft("'mainThreadEM_ASM' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"jstoi_q")||(ae.jstoi_q=function(){Ft("'jstoi_q' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"jstoi_s")||(ae.jstoi_s=function(){Ft("'jstoi_s' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"getExecutableName")||(ae.getExecutableName=function(){Ft("'getExecutableName' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"listenOnce")||(ae.listenOnce=function(){Ft("'listenOnce' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"autoResumeAudioContext")||(ae.autoResumeAudioContext=function(){Ft("'autoResumeAudioContext' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"dynCallLegacy")||(ae.dynCallLegacy=function(){Ft("'dynCallLegacy' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"getDynCaller")||(ae.getDynCaller=function(){Ft("'getDynCaller' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"dynCall")||(ae.dynCall=function(){Ft("'dynCall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"callRuntimeCallbacks")||(ae.callRuntimeCallbacks=function(){Ft("'callRuntimeCallbacks' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"reallyNegative")||(ae.reallyNegative=function(){Ft("'reallyNegative' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"unSign")||(ae.unSign=function(){Ft("'unSign' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"reSign")||(ae.reSign=function(){Ft("'reSign' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"formatString")||(ae.formatString=function(){Ft("'formatString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"PATH")||(ae.PATH=function(){Ft("'PATH' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"PATH_FS")||(ae.PATH_FS=function(){Ft("'PATH_FS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"SYSCALLS")||(ae.SYSCALLS=function(){Ft("'SYSCALLS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"syscallMmap2")||(ae.syscallMmap2=function(){Ft("'syscallMmap2' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"syscallMunmap")||(ae.syscallMunmap=function(){Ft("'syscallMunmap' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"getSocketFromFD")||(ae.getSocketFromFD=function(){Ft("'getSocketFromFD' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"getSocketAddress")||(ae.getSocketAddress=function(){Ft("'getSocketAddress' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"JSEvents")||(ae.JSEvents=function(){Ft("'JSEvents' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"registerKeyEventCallback")||(ae.registerKeyEventCallback=function(){Ft("'registerKeyEventCallback' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"specialHTMLTargets")||(ae.specialHTMLTargets=function(){Ft("'specialHTMLTargets' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"maybeCStringToJsString")||(ae.maybeCStringToJsString=function(){Ft("'maybeCStringToJsString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"findEventTarget")||(ae.findEventTarget=function(){Ft("'findEventTarget' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"findCanvasEventTarget")||(ae.findCanvasEventTarget=function(){Ft("'findCanvasEventTarget' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"getBoundingClientRect")||(ae.getBoundingClientRect=function(){Ft("'getBoundingClientRect' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"fillMouseEventData")||(ae.fillMouseEventData=function(){Ft("'fillMouseEventData' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"registerMouseEventCallback")||(ae.registerMouseEventCallback=function(){Ft("'registerMouseEventCallback' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"registerWheelEventCallback")||(ae.registerWheelEventCallback=function(){Ft("'registerWheelEventCallback' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"registerUiEventCallback")||(ae.registerUiEventCallback=function(){Ft("'registerUiEventCallback' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"registerFocusEventCallback")||(ae.registerFocusEventCallback=function(){Ft("'registerFocusEventCallback' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"fillDeviceOrientationEventData")||(ae.fillDeviceOrientationEventData=function(){Ft("'fillDeviceOrientationEventData' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"registerDeviceOrientationEventCallback")||(ae.registerDeviceOrientationEventCallback=function(){Ft("'registerDeviceOrientationEventCallback' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"fillDeviceMotionEventData")||(ae.fillDeviceMotionEventData=function(){Ft("'fillDeviceMotionEventData' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"registerDeviceMotionEventCallback")||(ae.registerDeviceMotionEventCallback=function(){Ft("'registerDeviceMotionEventCallback' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"screenOrientation")||(ae.screenOrientation=function(){Ft("'screenOrientation' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"fillOrientationChangeEventData")||(ae.fillOrientationChangeEventData=function(){Ft("'fillOrientationChangeEventData' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"registerOrientationChangeEventCallback")||(ae.registerOrientationChangeEventCallback=function(){Ft("'registerOrientationChangeEventCallback' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"fillFullscreenChangeEventData")||(ae.fillFullscreenChangeEventData=function(){Ft("'fillFullscreenChangeEventData' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"registerFullscreenChangeEventCallback")||(ae.registerFullscreenChangeEventCallback=function(){Ft("'registerFullscreenChangeEventCallback' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"registerRestoreOldStyle")||(ae.registerRestoreOldStyle=function(){Ft("'registerRestoreOldStyle' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"hideEverythingExceptGivenElement")||(ae.hideEverythingExceptGivenElement=function(){Ft("'hideEverythingExceptGivenElement' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"restoreHiddenElements")||(ae.restoreHiddenElements=function(){Ft("'restoreHiddenElements' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"setLetterbox")||(ae.setLetterbox=function(){Ft("'setLetterbox' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"currentFullscreenStrategy")||(ae.currentFullscreenStrategy=function(){Ft("'currentFullscreenStrategy' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"restoreOldWindowedStyle")||(ae.restoreOldWindowedStyle=function(){Ft("'restoreOldWindowedStyle' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"softFullscreenResizeWebGLRenderTarget")||(ae.softFullscreenResizeWebGLRenderTarget=function(){Ft("'softFullscreenResizeWebGLRenderTarget' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"doRequestFullscreen")||(ae.doRequestFullscreen=function(){Ft("'doRequestFullscreen' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"fillPointerlockChangeEventData")||(ae.fillPointerlockChangeEventData=function(){Ft("'fillPointerlockChangeEventData' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"registerPointerlockChangeEventCallback")||(ae.registerPointerlockChangeEventCallback=function(){Ft("'registerPointerlockChangeEventCallback' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"registerPointerlockErrorEventCallback")||(ae.registerPointerlockErrorEventCallback=function(){Ft("'registerPointerlockErrorEventCallback' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"requestPointerLock")||(ae.requestPointerLock=function(){Ft("'requestPointerLock' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"fillVisibilityChangeEventData")||(ae.fillVisibilityChangeEventData=function(){Ft("'fillVisibilityChangeEventData' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"registerVisibilityChangeEventCallback")||(ae.registerVisibilityChangeEventCallback=function(){Ft("'registerVisibilityChangeEventCallback' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"registerTouchEventCallback")||(ae.registerTouchEventCallback=function(){Ft("'registerTouchEventCallback' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"fillGamepadEventData")||(ae.fillGamepadEventData=function(){Ft("'fillGamepadEventData' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"registerGamepadEventCallback")||(ae.registerGamepadEventCallback=function(){Ft("'registerGamepadEventCallback' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"registerBeforeUnloadEventCallback")||(ae.registerBeforeUnloadEventCallback=function(){Ft("'registerBeforeUnloadEventCallback' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"fillBatteryEventData")||(ae.fillBatteryEventData=function(){Ft("'fillBatteryEventData' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"battery")||(ae.battery=function(){Ft("'battery' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"registerBatteryEventCallback")||(ae.registerBatteryEventCallback=function(){Ft("'registerBatteryEventCallback' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"setCanvasElementSize")||(ae.setCanvasElementSize=function(){Ft("'setCanvasElementSize' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"getCanvasElementSize")||(ae.getCanvasElementSize=function(){Ft("'getCanvasElementSize' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"polyfillSetImmediate")||(ae.polyfillSetImmediate=function(){Ft("'polyfillSetImmediate' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"demangle")||(ae.demangle=function(){Ft("'demangle' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"demangleAll")||(ae.demangleAll=function(){Ft("'demangleAll' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"jsStackTrace")||(ae.jsStackTrace=function(){Ft("'jsStackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"stackTrace")||(ae.stackTrace=function(){Ft("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"getEnvStrings")||(ae.getEnvStrings=function(){Ft("'getEnvStrings' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"checkWasiClock")||(ae.checkWasiClock=function(){Ft("'checkWasiClock' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"writeI53ToI64")||(ae.writeI53ToI64=function(){Ft("'writeI53ToI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"writeI53ToI64Clamped")||(ae.writeI53ToI64Clamped=function(){Ft("'writeI53ToI64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"writeI53ToI64Signaling")||(ae.writeI53ToI64Signaling=function(){Ft("'writeI53ToI64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"writeI53ToU64Clamped")||(ae.writeI53ToU64Clamped=function(){Ft("'writeI53ToU64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"writeI53ToU64Signaling")||(ae.writeI53ToU64Signaling=function(){Ft("'writeI53ToU64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"readI53FromI64")||(ae.readI53FromI64=function(){Ft("'readI53FromI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"readI53FromU64")||(ae.readI53FromU64=function(){Ft("'readI53FromU64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"convertI32PairToI53")||(ae.convertI32PairToI53=function(){Ft("'convertI32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"convertU32PairToI53")||(ae.convertU32PairToI53=function(){Ft("'convertU32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"uncaughtExceptionCount")||(ae.uncaughtExceptionCount=function(){Ft("'uncaughtExceptionCount' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"exceptionLast")||(ae.exceptionLast=function(){Ft("'exceptionLast' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"exceptionCaught")||(ae.exceptionCaught=function(){Ft("'exceptionCaught' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"ExceptionInfoAttrs")||(ae.ExceptionInfoAttrs=function(){Ft("'ExceptionInfoAttrs' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"ExceptionInfo")||(ae.ExceptionInfo=function(){Ft("'ExceptionInfo' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"CatchInfo")||(ae.CatchInfo=function(){Ft("'CatchInfo' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"exception_addRef")||(ae.exception_addRef=function(){Ft("'exception_addRef' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"exception_decRef")||(ae.exception_decRef=function(){Ft("'exception_decRef' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"Browser")||(ae.Browser=function(){Ft("'Browser' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"funcWrappers")||(ae.funcWrappers=function(){Ft("'funcWrappers' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"getFuncWrapper")||(ae.getFuncWrapper=function(){Ft("'getFuncWrapper' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"setMainLoop")||(ae.setMainLoop=function(){Ft("'setMainLoop' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"FS")||(ae.FS=function(){Ft("'FS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"mmapAlloc")||(ae.mmapAlloc=function(){Ft("'mmapAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"MEMFS")||(ae.MEMFS=function(){Ft("'MEMFS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"TTY")||(ae.TTY=function(){Ft("'TTY' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"PIPEFS")||(ae.PIPEFS=function(){Ft("'PIPEFS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"SOCKFS")||(ae.SOCKFS=function(){Ft("'SOCKFS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"_setNetworkCallback")||(ae._setNetworkCallback=function(){Ft("'_setNetworkCallback' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"tempFixedLengthArray")||(ae.tempFixedLengthArray=function(){Ft("'tempFixedLengthArray' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"miniTempWebGLFloatBuffers")||(ae.miniTempWebGLFloatBuffers=function(){Ft("'miniTempWebGLFloatBuffers' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"heapObjectForWebGLType")||(ae.heapObjectForWebGLType=function(){Ft("'heapObjectForWebGLType' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"heapAccessShiftForWebGLHeap")||(ae.heapAccessShiftForWebGLHeap=function(){Ft("'heapAccessShiftForWebGLHeap' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"GL")||(ae.GL=function(){Ft("'GL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"emscriptenWebGLGet")||(ae.emscriptenWebGLGet=function(){Ft("'emscriptenWebGLGet' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"computeUnpackAlignedImageSize")||(ae.computeUnpackAlignedImageSize=function(){Ft("'computeUnpackAlignedImageSize' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"emscriptenWebGLGetTexPixelData")||(ae.emscriptenWebGLGetTexPixelData=function(){Ft("'emscriptenWebGLGetTexPixelData' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"emscriptenWebGLGetUniform")||(ae.emscriptenWebGLGetUniform=function(){Ft("'emscriptenWebGLGetUniform' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"emscriptenWebGLGetVertexAttrib")||(ae.emscriptenWebGLGetVertexAttrib=function(){Ft("'emscriptenWebGLGetVertexAttrib' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"writeGLArray")||(ae.writeGLArray=function(){Ft("'writeGLArray' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"AL")||(ae.AL=function(){Ft("'AL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"SDL_unicode")||(ae.SDL_unicode=function(){Ft("'SDL_unicode' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"SDL_ttfContext")||(ae.SDL_ttfContext=function(){Ft("'SDL_ttfContext' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"SDL_audio")||(ae.SDL_audio=function(){Ft("'SDL_audio' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"SDL")||(ae.SDL=function(){Ft("'SDL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"SDL_gfx")||(ae.SDL_gfx=function(){Ft("'SDL_gfx' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"GLUT")||(ae.GLUT=function(){Ft("'GLUT' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"EGL")||(ae.EGL=function(){Ft("'EGL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"GLFW_Window")||(ae.GLFW_Window=function(){Ft("'GLFW_Window' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"GLFW")||(ae.GLFW=function(){Ft("'GLFW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"GLEW")||(ae.GLEW=function(){Ft("'GLEW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"IDBStore")||(ae.IDBStore=function(){Ft("'IDBStore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"runAndAbortIfError")||(ae.runAndAbortIfError=function(){Ft("'runAndAbortIfError' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"warnOnce")||(ae.warnOnce=function(){Ft("'warnOnce' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"stackSave")||(ae.stackSave=function(){Ft("'stackSave' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"stackRestore")||(ae.stackRestore=function(){Ft("'stackRestore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"stackAlloc")||(ae.stackAlloc=function(){Ft("'stackAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"AsciiToString")||(ae.AsciiToString=function(){Ft("'AsciiToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"stringToAscii")||(ae.stringToAscii=function(){Ft("'stringToAscii' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"UTF16ToString")||(ae.UTF16ToString=function(){Ft("'UTF16ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"stringToUTF16")||(ae.stringToUTF16=function(){Ft("'stringToUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"lengthBytesUTF16")||(ae.lengthBytesUTF16=function(){Ft("'lengthBytesUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"UTF32ToString")||(ae.UTF32ToString=function(){Ft("'UTF32ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"stringToUTF32")||(ae.stringToUTF32=function(){Ft("'stringToUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"lengthBytesUTF32")||(ae.lengthBytesUTF32=function(){Ft("'lengthBytesUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"allocateUTF8")||(ae.allocateUTF8=function(){Ft("'allocateUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(ae,"allocateUTF8OnStack")||(ae.allocateUTF8OnStack=function(){Ft("'allocateUTF8OnStack' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),ae.writeStackCookie=it,ae.checkStackCookie=st,Object.getOwnPropertyDescriptor(ae,"ALLOC_NORMAL")||Object.defineProperty(ae,"ALLOC_NORMAL",{configurable:!0,get:function(){Ft("'ALLOC_NORMAL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}}),Object.getOwnPropertyDescriptor(ae,"ALLOC_STACK")||Object.defineProperty(ae,"ALLOC_STACK",{configurable:!0,get:function(){Ft("'ALLOC_STACK' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}}),Dt=function e(){ws||Ys(),ws||(Dt=e)},ae.run=Ys,ae.preInit)for("function"==typeof ae.preInit&&(ae.preInit=[ae.preInit]);ae.preInit.length>0;)ae.preInit.pop()();Ys();var Ws,zs,Zs={cCRNFmtInvalid:-1,cCRNFmtDXT1:0,cCRNFmtDXT3:1,cCRNFmtDXT5:2},qs={};qs[Zs.cCRNFmtDXT1]=T.PixelFormat.RGB_DXT1,qs[Zs.cCRNFmtDXT3]=T.PixelFormat.RGBA_DXT3,qs[Zs.cCRNFmtDXT5]=T.PixelFormat.RGBA_DXT5;var $s,ec=0,tc=!1;function rc(e,t,r,n){var o,a=r/4,i=n%4,s=new Uint32Array(e.buffer,0,(n-i)/4),c=new Uint32Array(t.buffer);for(o=0;o<s.length;o++)c[a+o]=s[o];for(o=n-i;o<n;o++)t[r+o]=e[o]}function nc(e,t){var r=e.data,o=r.byteLength,a=new Uint8Array(r),i=$s._malloc(o);rc(a,$s.HEAPU8,i,o);var s=$s._crn_get_dxt_format(i,o),c=qs[s];if(!n.defined(c))throw new f.RuntimeError("Unsupported compressed format.");var E,u=$s._crn_get_levels(i,o),l=$s._crn_get_width(i,o),d=$s._crn_get_height(i,o),A=0;for(E=0;E<u;++E)A+=T.PixelFormat.compressedTextureSizeInBytes(c,l>>E,d>>E);if(ec<A&&(n.defined(Ws)&&$s._free(Ws),Ws=$s._malloc(A),zs=new Uint8Array($s.HEAPU8.buffer,Ws,A),ec=A),$s._crn_decompress(i,o,Ws,A,0,u),$s._free(i),n.defaultValue(e.bMipMap,!1)){var p=zs.slice(0,A);return t.push(p.buffer),new m.CompressedTextureBuffer(c,l,d,p)}var _=T.PixelFormat.compressedTextureSizeInBytes(c,l,d),g=zs.subarray(0,_),y=new Uint8Array(_);return y.set(g,0),t.push(y.buffer),new m.CompressedTextureBuffer(c,l,d,y)}var oc,ac={SVO_HasInstSelInfo:1},ic={SV_Unkown:0,SV_Standard:1,SV_Compressed:2,SV_DracoCompressed:3},sc={Standard:0,Draco:1,MeshOpt:2},cc=new c.Color,Ec="ClampGroundAndObjectLinePass",uc=!1;if(n.defined(ae)){ae.onRuntimeInitialized=function(){uc=!0};var lc=ae.cwrap("OSGBToS3MB","number",["number","number","number","number"])}function dc(e,t,r,n,o,a){this.left=e,this.bottom=t,this.right=r,this.top=n,this.minHeight=o,this.maxHeight=a,this.width=r-e,this.length=n-t,this.height=a-o}function Ac(e,t,r){var n=r,o=e.getUint32(n,!0),a=n+=Uint32Array.BYTES_PER_ELEMENT,i=new Uint8Array(t,n,o);return{dataViewByteOffset:a,byteOffset:n+=o*Uint8Array.BYTES_PER_ELEMENT,buffer:i}}function fc(e,t,r,n){var o=e.getUint32(n+t,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var a=r.subarray(n,n+o);return{string:u.getStringFromTypedArray(a),bytesOffset:n+=o}}function pc(e,t,r,n,o,a){var i=r,s=e.getUint16(r+n,!0);i+=Uint16Array.BYTES_PER_ELEMENT,a||(i+=Uint16Array.BYTES_PER_ELEMENT);for(var c=0;c<s;c++){var u=e.getUint32(i+n,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var l=e.getUint16(i+n,!0);if(i+=Uint16Array.BYTES_PER_ELEMENT,e.getUint16(i+n,!0),i+=Uint16Array.BYTES_PER_ELEMENT,20==l||35==l);else{var d=u*l*Float32Array.BYTES_PER_ELEMENT,A=t.subarray(i,i+d);i+=d;var f="aTexCoord"+c,p=o.vertexAttributes,_=o.attrLocation;_[f]=p.length,p.push({index:_[f],typedArray:A,componentsPerAttribute:l,componentDatatype:E.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:l*Float32Array.BYTES_PER_ELEMENT,normalize:!1})}}return{bytesOffset:i}}function _c(e,t,r,n,o){o.texCoordCompressConstant=[],o.minTexCoordValue=[];var a=r,i=e.getUint16(r+n,!0);a+=Uint16Array.BYTES_PER_ELEMENT,a+=Uint16Array.BYTES_PER_ELEMENT;for(var c=0,u=0;u<i;u++){var l=e.getUint8(a+n,!0);a+=Uint8Array.BYTES_PER_ELEMENT,a+=3*Uint8Array.BYTES_PER_ELEMENT;var d=e.getUint32(a+n,!0);a+=Uint32Array.BYTES_PER_ELEMENT;var A=e.getUint16(a+n,!0);a+=Uint16Array.BYTES_PER_ELEMENT,e.getUint16(a+n,!0),a+=Uint16Array.BYTES_PER_ELEMENT;var f=e.getFloat32(a+n,!0);a+=Float32Array.BYTES_PER_ELEMENT,o.texCoordCompressConstant.push(f);var p=new s.Cartesian4;p.x=e.getFloat32(a+n,!0),a+=Float32Array.BYTES_PER_ELEMENT,p.y=e.getFloat32(a+n,!0),a+=Float32Array.BYTES_PER_ELEMENT,p.z=e.getFloat32(a+n,!0),a+=Float32Array.BYTES_PER_ELEMENT,p.w=e.getFloat32(a+n,!0),a+=Float32Array.BYTES_PER_ELEMENT,o.minTexCoordValue.push(p);var _=d*A*Int16Array.BYTES_PER_ELEMENT,g=t.subarray(a,a+_),m=(a+=_)%4;0!==m&&(a+=4-m);var T="aTexCoord"+c,y=o.vertexAttributes,B=o.attrLocation;if(B[T]=y.length,y.push({index:B[T],typedArray:g,componentsPerAttribute:A,componentDatatype:E.ComponentDatatype.SHORT,offsetInBytes:0,strideInBytes:A*Int16Array.BYTES_PER_ELEMENT,normalize:!1}),l){_=d*Float32Array.BYTES_PER_ELEMENT;var C=t.subarray(a,a+_);a+=_,o.texCoordZMatrix=!0,B[T="aTexCoordZ"+c]=y.length,y.push({index:B[T],typedArray:C,componentsPerAttribute:1,componentDatatype:E.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:Float32Array.BYTES_PER_ELEMENT,normalize:!1})}c++}return{bytesOffset:a}}function gc(e,t,r,n,o){var a=r,i=e.getUint16(a+n,!0);a+=Uint16Array.BYTES_PER_ELEMENT,a+=Uint16Array.BYTES_PER_ELEMENT;for(var s=o.vertexAttributes,c=o.attrLocation,u=0;u<i;u++){var l=e.getUint32(a+n,!0);a+=Uint32Array.BYTES_PER_ELEMENT;var d=e.getUint16(a+n,!0);if(a+=Uint16Array.BYTES_PER_ELEMENT,16===d){a-=Uint16Array.BYTES_PER_ELEMENT;var A=l*(d*Float32Array.BYTES_PER_ELEMENT+Uint16Array.BYTES_PER_ELEMENT),f=t.subarray(a,a+A);a+=A;var p=new Uint8Array(Float32Array.BYTES_PER_ELEMENT*d*l);o.instanceCount=l,o.instanceMode=d,o.instanceBuffer=p,o.instanceIndex=1;for(var _=Float32Array.BYTES_PER_ELEMENT*d+Uint16Array.BYTES_PER_ELEMENT,g=0;g<l;g++){var m=g*_+Uint16Array.BYTES_PER_ELEMENT,T=f.subarray(m,m+_);p.set(T,g*(_-Uint16Array.BYTES_PER_ELEMENT))}y=16*Float32Array.BYTES_PER_ELEMENT,c.uv2=s.length,s.push({index:c.uv2,componentsPerAttribute:4,componentDatatype:E.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:y,instanceDivisor:1}),c.uv3=s.length,s.push({index:c.uv3,componentsPerAttribute:4,componentDatatype:E.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:4*Float32Array.BYTES_PER_ELEMENT,strideInBytes:y,instanceDivisor:1}),c.uv4=s.length,s.push({index:c.uv4,componentsPerAttribute:4,componentDatatype:E.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:8*Float32Array.BYTES_PER_ELEMENT,strideInBytes:y,instanceDivisor:1}),c.secondary_colour=s.length,s.push({index:c.secondary_colour,componentsPerAttribute:4,componentDatatype:E.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:12*Float32Array.BYTES_PER_ELEMENT,strideInBytes:y,instanceDivisor:1})}else{e.getUint16(a+n,!0),a+=Uint16Array.BYTES_PER_ELEMENT;A=l*d*Float32Array.BYTES_PER_ELEMENT;if(17===d||29===d){var y;p=t.subarray(a,a+A);o.instanceCount=l,o.instanceMode=d,o.instanceBuffer=p,o.instanceIndex=1,17===d?(y=17*Float32Array.BYTES_PER_ELEMENT,c.uv2=s.length,s.push({index:c.uv2,componentsPerAttribute:4,componentDatatype:E.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:y,instanceDivisor:1}),c.uv3=s.length,s.push({index:c.uv3,componentsPerAttribute:4,componentDatatype:E.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:4*Float32Array.BYTES_PER_ELEMENT,strideInBytes:y,instanceDivisor:1}),c.uv4=s.length,s.push({index:c.uv4,componentsPerAttribute:4,componentDatatype:E.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:8*Float32Array.BYTES_PER_ELEMENT,strideInBytes:y,instanceDivisor:1}),c.secondary_colour=s.length,s.push({index:c.secondary_colour,componentsPerAttribute:4,componentDatatype:E.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:12*Float32Array.BYTES_PER_ELEMENT,strideInBytes:y,instanceDivisor:1}),c.uv6=s.length,s.push({index:c.uv6,componentsPerAttribute:4,componentDatatype:E.ComponentDatatype.UNSIGNED_BYTE,normalize:!0,offsetInBytes:16*Float32Array.BYTES_PER_ELEMENT,strideInBytes:y,instanceDivisor:1})):29===d&&(y=29*Float32Array.BYTES_PER_ELEMENT,c.uv1=s.length,s.push({index:c.uv1,componentsPerAttribute:4,componentDatatype:E.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:y,instanceDivisor:1,byteLength:A}),c.uv2=s.length,s.push({index:c.uv2,componentsPerAttribute:4,componentDatatype:E.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:4*Float32Array.BYTES_PER_ELEMENT,strideInBytes:y,instanceDivisor:1}),c.uv3=s.length,s.push({index:c.uv3,componentsPerAttribute:4,componentDatatype:E.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:8*Float32Array.BYTES_PER_ELEMENT,strideInBytes:y,instanceDivisor:1}),c.uv4=s.length,s.push({index:c.uv4,componentsPerAttribute:4,componentDatatype:E.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:12*Float32Array.BYTES_PER_ELEMENT,strideInBytes:y,instanceDivisor:1}),c.uv5=s.length,s.push({index:c.uv5,componentsPerAttribute:4,componentDatatype:E.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:16*Float32Array.BYTES_PER_ELEMENT,strideInBytes:y,instanceDivisor:1}),c.uv6=s.length,s.push({index:c.uv6,componentsPerAttribute:4,componentDatatype:E.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:20*Float32Array.BYTES_PER_ELEMENT,strideInBytes:y,instanceDivisor:1}),c.uv7=s.length,s.push({index:c.uv7,componentsPerAttribute:3,componentDatatype:E.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:24*Float32Array.BYTES_PER_ELEMENT,strideInBytes:y,instanceDivisor:1}),c.secondary_colour=s.length,s.push({index:c.secondary_colour,componentsPerAttribute:4,componentDatatype:E.ComponentDatatype.UNSIGNED_BYTE,normalize:!0,offsetInBytes:27*Float32Array.BYTES_PER_ELEMENT,strideInBytes:y,instanceDivisor:1}),c.uv9=s.length,s.push({index:c.uv9,componentsPerAttribute:4,componentDatatype:E.ComponentDatatype.UNSIGNED_BYTE,normalize:!0,offsetInBytes:28*Float32Array.BYTES_PER_ELEMENT,strideInBytes:y,instanceDivisor:1}))}else{var B=l*d;o.instanceBounds=new Float32Array(B);for(var C=0;C<B;C++)o.instanceBounds[C]=e.getFloat32(a+n+C*Float32Array.BYTES_PER_ELEMENT,!0)}a+=A}}return{bytesOffset:a}}var mc=new i.Cartesian3(40680631590769,40680631590769,40408299984661.445),Tc=new i.Cartesian3,yc=new i.Cartesian3;function Bc(e,t,r,o){var a=Math.cos(t);Tc.x=a*Math.cos(e),Tc.y=a*Math.sin(e),Tc.z=Math.sin(t),Tc=i.Cartesian3.normalize(Tc,Tc),i.Cartesian3.multiplyComponents(mc,Tc,yc);var s=Math.sqrt(i.Cartesian3.dot(Tc,yc));return yc=i.Cartesian3.divideByScalar(yc,s,yc),Tc=i.Cartesian3.multiplyByScalar(Tc,r,Tc),n.defined(o)||(o=new i.Cartesian3),i.Cartesian3.add(yc,Tc,o)}var Cc=new i.Cartesian3,Dc=new i.Cartographic,hc=new o.Matrix4,Oc=new o.Matrix4;function Pc(e,t,r,c,u,l,d,A){var f=c,p=t.getUint32(f+r,!0);if(u.verticesCount=p,f+=Uint32Array.BYTES_PER_ELEMENT,p<=0)return{bytesOffset:f};var _=t.getUint16(f+r,!0);f+=Uint16Array.BYTES_PER_ELEMENT;var g=t.getUint16(f+r,!0);g=_*Float32Array.BYTES_PER_ELEMENT,f+=Uint16Array.BYTES_PER_ELEMENT;var m=p*_*Float32Array.BYTES_PER_ELEMENT,T=e.subarray(f,f+m);f+=m;var y=u.vertexAttributes,B=u.attrLocation,C=void 0,D=void 0;if(d){B.aPosition=y.length,y.push({index:B.aPosition,typedArray:T,componentsPerAttribute:_,componentDatatype:E.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:g,normalize:!1});var h=new i.Cartesian3,O=new i.Cartesian3,P=new Float32Array(T.buffer,T.byteOffset,T.byteLength/4),v=new i.Cartographic;C=new i.Cartographic,D=new i.Cartographic;for(var F=new Float32Array(2*p),M=new Float64Array(2*p),S=0;S<p;S++)o.Matrix4.multiplyByPoint(l,i.Cartesian3.fromElements(P[3*S],P[3*S+1],P[3*S+2],h),O),v=i.Cartographic.fromCartesian(O),M[2*S]=v.longitude,M[2*S+1]=v.latitude,0===S?(C.longitude=v.longitude,C.latitude=v.latitude,D.longitude=v.longitude,D.latitude=v.latitude):(C.longitude=Math.max(v.longitude,C.longitude),C.latitude=Math.max(v.latitude,C.latitude),D.longitude=Math.min(v.longitude,D.longitude),D.latitude=Math.min(v.latitude,D.latitude));for(S=0;S<p;S++)F[2*S]=M[2*S]-D.longitude,F[2*S+1]=M[2*S+1]-D.latitude;B.img=y.length,y.push({index:B.img,typedArray:F,componentsPerAttribute:2,componentDatatype:E.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:2*Float32Array.BYTES_PER_ELEMENT,normalize:!1})}else{if(3===_&&n.defined(l)){O=new i.Cartesian3,P=new Float32Array(T.buffer,T.byteOffset,T.byteLength/4);for(var b=new Float32Array(T.byteLength/4+p),R=P.length,w=(S=0,0);S<R;S+=3,w+=4)b[w]=P[S],b[w+1]=P[S+1],b[w+2]=P[S+2],o.Matrix4.multiplyByPoint(l,i.Cartesian3.fromElements(b[w],b[w+1],b[w+2],h),O),b[w+3]=i.Cartographic.fromCartesian(O).height;T=b,g=(_=4)*Float32Array.BYTES_PER_ELEMENT}if(n.defined(A)){var I,L=new Float32Array(T.byteLength/4),x=new Float32Array(T.buffer,T.byteOffset,T.byteLength/4);I=3===_?i.Cartesian3.unpackArray(x):s.Cartesian4.unpackArray(x);var N=o.Matrix4.multiply(A.sphereMatrix,A.geoMatrix,hc),U=o.Matrix4.multiply(A.ellipsoidMatrix,A.geoMatrix,Oc);o.Matrix4.inverse(U,U);for(var G=new a.Ellipsoid(6378137,6378137,6378137),k=0,H=0,X=I.length;H<X;H++){var V=I[H];o.Matrix4.multiplyByPoint(N,V,Cc);var K=G.cartesianToCartographic(Cc,Dc),j=Bc(K.longitude,K.latitude,K.height,Cc);o.Matrix4.multiplyByPoint(U,j,V),3===_?(i.Cartesian3.pack(V,L,k),k+=3):(s.Cartesian4.pack(V,L,k),k+=4)}T=L}B.aPosition=y.length,y.push({index:B.aPosition,typedArray:T,componentsPerAttribute:_,componentDatatype:E.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:g,normalize:!1})}return{bytesOffset:f,cartographicBounds:{max:C,min:D}}}function vc(e,t,r,c,u,l){var d=c,A=t.getUint32(d+r,!0);if(u.verticesCount=A,d+=Uint32Array.BYTES_PER_ELEMENT,A<=0)return{bytesOffset:d};var f=t.getUint16(d+r,!0);d+=Uint16Array.BYTES_PER_ELEMENT;var p=t.getUint16(d+r,!0);p=f*Int16Array.BYTES_PER_ELEMENT,d+=Uint16Array.BYTES_PER_ELEMENT;var _=t.getFloat32(d+r,!0);d+=Float32Array.BYTES_PER_ELEMENT;var g=new s.Cartesian4;g.x=t.getFloat32(d+r,!0),d+=Float32Array.BYTES_PER_ELEMENT,g.y=t.getFloat32(d+r,!0),d+=Float32Array.BYTES_PER_ELEMENT,g.z=t.getFloat32(d+r,!0),d+=Float32Array.BYTES_PER_ELEMENT,g.w=t.getFloat32(d+r,!0),d+=Float32Array.BYTES_PER_ELEMENT,u.vertCompressConstant=_,u.minVerticesValue=g;var m=A*f*Int16Array.BYTES_PER_ELEMENT,T=e.subarray(d,d+m);if(d+=m,n.defined(l)){var y=new Float32Array(T.byteLength/4),B=new Float32Array(T.buffer,T.byteOffset,T.byteLength/4),C=i.Cartesian3.unpackArray(B);for(let e=0,t=C.length;e<t;e++){let t=C[e];i.Cartesian3.multiplyByScalar(t,_,t),i.Cartesian3.add(t,g,t)}var D=o.Matrix4.multiply(l.sphereMatrix,l.geoMatrix,hc),h=o.Matrix4.multiply(l.ellipsoidMatrix,l.geoMatrix,Oc);o.Matrix4.inverse(h,h);var O=new a.Ellipsoid(6378137,6378137,6378137),P=0;for(let e=0,t=C.length;e<t;e++){let t=C[e];o.Matrix4.multiplyByPoint(D,t,Cc);let r=O.cartesianToCartographic(Cc,Dc),n=Bc(r.longitude,r.latitude,r.height,Cc);o.Matrix4.multiplyByPoint(h,n,t),i.Cartesian3.pack(t,y,P),P+=3}T=y}var v=u.vertexAttributes,F=u.attrLocation;return F.aPosition=v.length,v.push({index:F.aPosition,typedArray:T,componentsPerAttribute:f,componentDatatype:E.ComponentDatatype.SHORT,offsetInBytes:0,strideInBytes:p,normalize:!1}),{bytesOffset:d}}function Fc(e,t,r,n,o){var a=n,i=t.getUint32(a+r,!0);if(a+=Uint32Array.BYTES_PER_ELEMENT,i<=0)return{bytesOffset:a};var s=t.getUint16(a+r,!0);a+=Uint16Array.BYTES_PER_ELEMENT;var c=t.getUint16(a+r,!0);a+=Uint16Array.BYTES_PER_ELEMENT;var u=i*s*Float32Array.BYTES_PER_ELEMENT,l=e.subarray(a,a+u);if(a+=u,!o.ignoreNormal){var d=o.vertexAttributes,A=o.attrLocation;A.aNormal=d.length,d.push({index:A.aNormal,typedArray:l,componentsPerAttribute:s,componentDatatype:E.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:c,normalize:!1})}return{bytesOffset:a}}function Mc(e,t,r,n,o){var a=n,i=t.getUint32(a+r,!0);if(a+=Uint32Array.BYTES_PER_ELEMENT,i<=0)return{bytesOffset:a};var s=t.getUint16(a+r,!0);return a+=Uint16Array.BYTES_PER_ELEMENT,t.getUint16(a+r,!0),a+=Uint16Array.BYTES_PER_ELEMENT,{bytesOffset:a+=i*s*Float32Array.BYTES_PER_ELEMENT}}var Sc={0:Uint32Array.BYTES_PER_ELEMENT,1:Float32Array.BYTES_PER_ELEMENT,2:Float64Array.BYTES_PER_ELEMENT};function bc(e,t,r,n,o){var a=n,i=t.getUint32(a+r,!0);a+=Uint32Array.BYTES_PER_ELEMENT;for(var s=0;s<i;s++){var c=t.getUint32(a+r,!0);a+=Uint32Array.BYTES_PER_ELEMENT;var u=t.getUint16(a+r,!0);a+=Uint16Array.BYTES_PER_ELEMENT;var l=t.getUint16(a+r,!0);a+=Uint16Array.BYTES_PER_ELEMENT;var d=c*u*Sc[l],A=e.subarray(a,a+d);a+=d;var f=o.vertexAttributes,p=o.attrLocation,_="aCustom"+s;p[_]=f.length,f.push({index:p[_],typedArray:A,componentsPerAttribute:u,componentDatatype:E.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:0,normalize:!1})}return{bytesOffset:a}}function Rc(e,t,r,n,o){var a=n,i=t.getUint32(a+r,!0);if(a+=Uint32Array.BYTES_PER_ELEMENT,i<=0)return{bytesOffset:a};t.getUint16(a+r,!0),a+=Uint16Array.BYTES_PER_ELEMENT;var s=t.getUint16(a+r,!0);a+=Uint16Array.BYTES_PER_ELEMENT;var c=2*i*Int16Array.BYTES_PER_ELEMENT,u=e.subarray(a,a+c);if(a+=c,!o.ignoreNormal){var l=o.vertexAttributes,d=o.attrLocation;d.aNormal=l.length,l.push({index:d.aNormal,typedArray:u,componentsPerAttribute:2,componentDatatype:E.ComponentDatatype.SHORT,offsetInBytes:0,strideInBytes:s,normalize:!1})}return{bytesOffset:a}}function wc(e,t,r,n,o){var a,i=n,s=t.getUint32(i+r,!0);if(i+=Uint32Array.BYTES_PER_ELEMENT,o.verticesCount,s>0){t.getUint16(i+r,!0),i+=Uint16Array.BYTES_PER_ELEMENT,i+=2*Uint8Array.BYTES_PER_ELEMENT;var c=s*Uint8Array.BYTES_PER_ELEMENT*4;a=D(e,i,i+c),i+=c;var u=o.vertexAttributes,l=o.attrLocation;l.aColor=u.length,u.push({index:l.aColor,typedArray:a,componentsPerAttribute:4,componentDatatype:E.ComponentDatatype.UNSIGNED_BYTE,offsetInBytes:0,strideInBytes:4,normalize:!0})}return{bytesOffset:i}}function Ic(e,t,r,n,o){var a=n,i=t.getUint32(a+r,!0);return a+=Uint32Array.BYTES_PER_ELEMENT,i<=0?{bytesOffset:a}:(t.getUint16(a+r,!0),a+=Uint16Array.BYTES_PER_ELEMENT,a+=2*Uint8Array.BYTES_PER_ELEMENT,{bytesOffset:a+=i*Uint8Array.BYTES_PER_ELEMENT*4})}function Lc(e,t,r,n,o){var a=o,i=[],s=r.getUint32(a+n,!0);a+=Uint32Array.BYTES_PER_ELEMENT;for(var c=0;c<s;c++){var E={};3===e&&(r.getUint32(a+n,!0),a+=Uint32Array.BYTES_PER_ELEMENT);var u=r.getUint32(a+n,!0);a+=Uint32Array.BYTES_PER_ELEMENT;var l=r.getUint8(a+n,!0);a+=Uint8Array.BYTES_PER_ELEMENT,r.getUint8(a+n,!0),a+=Uint8Array.BYTES_PER_ELEMENT;var d=r.getUint8(a+n,!0);if(a+=Uint8Array.BYTES_PER_ELEMENT,a+=Uint8Array.BYTES_PER_ELEMENT,u>0){var A=0,f=null;1===l||3===l?(A=u*Uint32Array.BYTES_PER_ELEMENT,f=t.subarray(a,a+A)):(A=u*Uint16Array.BYTES_PER_ELEMENT,f=t.subarray(a,a+A),u%2!=0&&(A+=2)),E.indicesTypedArray=f,a+=A}E.indicesCount=u,E.indexType=l,E.primitiveType=d;var p=[],_=r.getUint32(a+n,!0);a+=Uint32Array.BYTES_PER_ELEMENT;for(var g=0;g<_;g++){var m=fc(r,n,t,a),T=m.string;a=m.bytesOffset,p.push(T),E.materialCode=T}if(0===_&&(E.materialCode="OSGBEmpty"),i.push(E),0!==a%4)a+=4-a%4}return{bytesOffset:a,arrIndexPackage:i}}function xc(e,t,r,n,o,a,i,s,c){var E=n,u=t.getUint32(E+r,!0);return o.nCompressOptions=u,E+=Uint32Array.BYTES_PER_ELEMENT,E=(u&d.VertexCompressOption.SVC_Vertex)==d.VertexCompressOption.SVC_Vertex?vc(e,t,r,E,o,c).bytesOffset:Pc(e,t,r,E,o,i,s,c).bytesOffset,E=(u&d.VertexCompressOption.SVC_Normal)==d.VertexCompressOption.SVC_Normal?Rc(e,t,r,E,o).bytesOffset:Fc(e,t,r,E,o).bytesOffset,E=Ic(0,t,r,E=wc(e,t,r,E,o).bytesOffset).bytesOffset,E=(u&d.VertexCompressOption.SVC_TexutreCoord)==d.VertexCompressOption.SVC_TexutreCoord?_c(t,e,E,r,o).bytesOffset:pc(t,e,E,r,o,a).bytesOffset,(u&d.VertexCompressOption.SVC_TexutreCoordIsW)==d.VertexCompressOption.SVC_TexutreCoordIsW&&(o.textureCoordIsW=!0),{bytesOffset:E=gc(t,e,E,r,o).bytesOffset}}function Nc(e,t,r,o,a,i,s,c,E,u){3===e&&(r.getUint32(a,!0),a+=Uint32Array.BYTES_PER_ELEMENT,c=void 0);var l,d=a;d=(l=Pc(t,r,o,d,i,c,E,u)).bytesOffset;var A=l.cartographicBounds;if(d=(l=wc(t,r,o,d=(l=Fc(t,r,o,d,i)).bytesOffset,i)).bytesOffset,3!==e&&(d=(l=Ic(0,r,o,d)).bytesOffset),d=(l=gc(r,t,d=(l=pc(r,t,d,o,i,s)).bytesOffset,o,i)).bytesOffset,3===e&&(d=(l=bc(t,r,o,d,i)).bytesOffset),3==e){var f=fc(r,o,t,d);d=f.bytesOffset,i.customVertexAttribute=JSON.parse(f.string);var p="aCustom"+i.customVertexAttribute.TextureCoordMatrix,_="aCustom"+i.customVertexAttribute.VertexWeight,g="aCustom"+i.customVertexAttribute.VertexWeight_1;n.defined(i.attrLocation[p])&&(i.attrLocation.aTextureCoordMatrix=i.attrLocation[p],delete i.attrLocation[p]),n.defined(i.attrLocation[_])&&(i.attrLocation.aVertexWeight=i.attrLocation[_],delete i.attrLocation[_]),n.defined(i.attrLocation[g])&&(i.attrLocation.aVertexWeight_1=i.attrLocation[g],delete i.attrLocation[g]);for(var m=Object.keys(i.attrLocation),T=m.length,y=0;y<T;++y){var B=m[y];-1!==B.indexOf("aCustom")&&delete i.attrLocation[B]}var C=(d+o)%4;C&&(C=4-C),d+=C}return 3===e&&(d=(l=Mc(0,r,o,d)).bytesOffset),{bytesOffset:d,cartographicBounds:A}}function Uc(e){return 0!==e.length&&e[0].materialCode===Ec}var Gc={AttributeType_Invalid:0,AttributeType_Position:1,AttributeType_PositionW:2,AttributeType_Normal:4,AttributeType_Tangent:8,AttributeType_FirstTexcoord:16,AttributeType_SecondTexcoord:32,AttributeType_Color:64,AttributeType_SecondColor:128,AttributeType_Custom0:512,AttributeType_Custom1:1024};function kc(e,t,r,c,u,l,A,f,p,_,g,m,T){var y=e,B=0,C=t.getUint32(B+r,!0);B+=Uint32Array.BYTES_PER_ELEMENT,_=n.defaultValue(_,n.defaultValue.EMPTY_OBJECT);for(var O=void 0,P=0;P<C;P++){3===f&&(t.getUint32(B+r,!0),B+=Uint32Array.BYTES_PER_ELEMENT);var v=(Se=fc(t,r,y,B)).string;if(n.defined(p)){var F=n.defaultValue(_[v],o.Matrix4.IDENTITY);O=new o.Matrix4,o.Matrix4.multiply(p,F,O)}n.defined(T)&&(T.geoMatrix=n.defaultValue(_[v],o.Matrix4.IDENTITY));var M=(B=Se.bytesOffset)%4;0!==M&&(B+=4-M);var S=ic.SV_Unkown;if(S=t.getUint32(B+r,!0),B+=Int32Array.BYTES_PER_ELEMENT,($e={vertexAttributes:[],attrLocation:{},instanceCount:0,instanceMode:0,instanceIndex:-1}).ignoreNormal=c.ignoreNormal,3===f)switch(S){case sc.Standard:S=ic.SV_Standard;break;case sc.Draco:S=ic.SV_DracoCompressed;break;case sc.MeshOpt:S=ic.SV_Compressed}if(S===ic.SV_DracoCompressed){3===f&&(t.getInt32(B+r,!0),B+=Int32Array.BYTES_PER_ELEMENT),f>=2&&(t.getInt32(B+r,!0),B+=Int32Array.BYTES_PER_ELEMENT);var b,R={};R.posUniqueID=t.getInt32(B+r,!0),B+=Int32Array.BYTES_PER_ELEMENT,R.normalUniqueID=t.getInt32(B+r,!0),B+=Int32Array.BYTES_PER_ELEMENT,R.colorUniqueID=t.getInt32(B+r,!0),B+=Int32Array.BYTES_PER_ELEMENT,R.secondColorUniqueID=t.getInt32(B+r,!0),B+=Int32Array.BYTES_PER_ELEMENT,3===f?(b=t.getUint32(B+r,!0),B+=Int32Array.BYTES_PER_ELEMENT):(b=t.getUint16(B+r,!0),B+=Int16Array.BYTES_PER_ELEMENT);for(var w=[],I=0;I<b;I++){var L=t.getInt32(B+r,!0);w.push(L),B+=Int32Array.BYTES_PER_ELEMENT}R.texCoordUniqueIDs=w;var x=[];if(3===f){var N=t.getUint32(B+r,!0);B+=Int32Array.BYTES_PER_ELEMENT;for(var U=0;U<N;U++){var G=t.getInt32(B+r,!0);B+=Int32Array.BYTES_PER_ELEMENT,x.push(G)}}R.vertexAttrUniqueIDs=x;var k=t.getInt32(B+r,!0);B+=Int32Array.BYTES_PER_ELEMENT;var H=[],X={};if(k>0){var V=(K=fc(t,r,y,B)).string;B=K.bytesOffset,X.materialCode=V,H.push(X)}3===f&&((Ie=(B+r)%4)&&(Ie=4-Ie),B+=Ie);var K,j=new Object,Y=t.getUint32(B+r,!0),Q=D(y,B+=Int32Array.BYTES_PER_ELEMENT,B+Y);if(k>0?h.dracoDecodeMesh(oc,Q,Y,$e,X,R,O,g,j,T):h.dracoDecodePointCloud(oc,Q,Y,$e,R),n.defined(j.min)&&n.defined(j.max)||(j=void 0),B+=Y,3===f)(Ie=(B+r)%4)&&(Ie=4-Ie),(Ie=((B=(K=fc(t,r,y,B+=Ie)).bytesOffset)+r)%4)&&(Ie=4-Ie),B+=Ie;c[v]={vertexPackage:$e,arrIndexPackage:H,cartographicBounds:j}}else if(S==ic.SV_Compressed&&3==f){var J=t.getUint32(B+r,!0);B+=Uint32Array.BYTES_PER_ELEMENT;var W=t.getUint32(B+r,!0);B+=Uint32Array.BYTES_PER_ELEMENT,$e.minVerticesValue=new s.Cartesian4,$e.minTexCoordValue=[new a.Cartesian2,new a.Cartesian2],$e.texCoordCompressConstant=[new i.Cartesian3,new i.Cartesian3];H=[];for(var z=0;z<W;z++){var Z=t.getUint32(B+r,!0);B+=Uint32Array.BYTES_PER_ELEMENT,$e.vertCompressConstant=t.getFloat32(B+r,!0),B+=Float32Array.BYTES_PER_ELEMENT,$e.minVerticesValue.x=t.getFloat64(B+r,!0),B+=Float64Array.BYTES_PER_ELEMENT,$e.minVerticesValue.y=t.getFloat64(B+r,!0),B+=Float64Array.BYTES_PER_ELEMENT,$e.minVerticesValue.z=t.getFloat64(B+r,!0),B+=Float64Array.BYTES_PER_ELEMENT;var q=t.getFloat64(B+r,!0);B+=Float64Array.BYTES_PER_ELEMENT;var $=t.getFloat64(B+r,!0);B+=Float64Array.BYTES_PER_ELEMENT;var ee=t.getFloat64(B+r,!0);B+=Float64Array.BYTES_PER_ELEMENT;var te=t.getFloat64(B+r,!0);B+=Float64Array.BYTES_PER_ELEMENT;var re=t.getFloat64(B+r,!0);B+=Float64Array.BYTES_PER_ELEMENT;var ne=t.getFloat64(B+r,!0);B+=Float64Array.BYTES_PER_ELEMENT;var ae=t.getFloat64(B+r,!0);B+=Float64Array.BYTES_PER_ELEMENT;var ie=t.getFloat64(B+r,!0);B+=Float64Array.BYTES_PER_ELEMENT,$e.minTexCoordValue[0].x=ee,$e.minTexCoordValue[0].y=te,$e.minTexCoordValue[1].x=ae,$e.minTexCoordValue[1].y=ie,$e.texCoordCompressConstant[0].x=q,$e.texCoordCompressConstant[0].y=$,$e.texCoordCompressConstant[1].x=re,$e.texCoordCompressConstant[1].y=ne;var se=t.getInt32(B+r,!0);B+=Int32Array.BYTES_PER_ELEMENT;for(var ce=0;ce<se;ce++){var Ee=t.getInt32(B+r,!0);B+=Int32Array.BYTES_PER_ELEMENT;var ue=Ee,le=0;ue!=Gc.AttributeType_Custom0&&ue!=Gc.AttributeType_Custom1||(le=t.getInt32(B+r,!0),B+=Int32Array.BYTES_PER_ELEMENT);var de=t.getInt32(B+r,!0);B+=Int32Array.BYTES_PER_ELEMENT;var Ae=new Uint8Array(t.buffer,B+r,de);(Ie=((B+=Uint8Array.BYTES_PER_ELEMENT*de)+r)%4)&&(Ie=4-Ie),B+=Ie,Xc(Z,ue,le,Ae,$e,J,T)}B=(we=fc(t,r,y,B)).bytesOffset,$e.customVertexAttribute=JSON.parse(we.string);var fe="aCustom"+$e.customVertexAttribute.TextureCoordMatrix,pe="aCustom"+$e.customVertexAttribute.VertexWeight,_e="aCustom"+$e.customVertexAttribute.VertexWeight_1;n.defined($e.attrLocation[fe])&&($e.attrLocation.aTextureCoordMatrix=$e.attrLocation[fe],z===W-1&&delete $e.attrLocation[fe]),n.defined($e.attrLocation[pe])&&($e.attrLocation.aVertexWeight=$e.attrLocation[pe],z===W-1&&delete $e.attrLocation[pe]),n.defined($e.attrLocation[_e])&&($e.attrLocation.aVertexWeight_1=$e.attrLocation[_e],z===W-1&&delete $e.attrLocation[_e]);for(var ge=(Le=Object.keys($e.attrLocation)).length,me=0;me<ge;++me){-1!==(xe=Le[me]).indexOf("aCustom")&&delete $e.attrLocation[xe]}(Ie=(B+r)%4)&&(Ie=4-Ie),B+=Ie;var Te=t.getInt32(B+r,!0);B+=Int32Array.BYTES_PER_ELEMENT;for(var ye=0;ye<Te;ye++){X={};var Be=t.getInt32(B+r,!0);if(B+=Int32Array.BYTES_PER_ELEMENT,Be>0){var Ce=t.getInt8(B+r,!0);B+=Int8Array.BYTES_PER_ELEMENT,t.getInt8(B+r,!0),B+=Int8Array.BYTES_PER_ELEMENT;var De=t.getInt8(B+r,!0);B+=Int8Array.BYTES_PER_ELEMENT,t.getInt8(B+r,!0),B+=Int8Array.BYTES_PER_ELEMENT;var he,Oe,Pe=t.getInt32(B+r,!0);B+=Int32Array.BYTES_PER_ELEMENT,13!==De?(he=new Uint8Array(t.buffer,B+r,Pe),B+=Uint8Array.BYTES_PER_ELEMENT*Pe):(he=new Uint32Array(t.buffer,B+r,Pe),B+=Uint32Array.BYTES_PER_ELEMENT*Pe),(Ie=(B+r)%4)&&(Ie=4-Ie),B+=Ie,13!==De?(Oe=E.ComponentDatatype.createTypedArray(E.ComponentDatatype.UNSIGNED_BYTE,Be*Uint32Array.BYTES_PER_ELEMENT),oe.decodeIndexBuffer(Oe,Be,Uint32Array.BYTES_PER_ELEMENT,he)):Oe=he;var ve,Fe=t.getInt32(B+r,!0);B+=Int32Array.BYTES_PER_ELEMENT,X.indexType=Ce,0===Ce?ve=new Uint16Array(Be):1===Ce&&(ve=new Uint32Array(Be)),X.indicesCount=Be;var Me=new Uint32Array(Oe.buffer,Oe.byteOffset,Oe.byteLength/4);ve.set(Me,0),X.indicesTypedArray=ve,X.primitiveType=De;for(ce=0;ce<Fe;ce++){var Se;V=(Se=fc(t,r,y,B)).string;B=Se.bytesOffset,X.materialCode=V}if(H.length>0&&13!==De){var be=$e.preVertexCount;X.indicesTypedArray=Me.map((function(e){return e+be})),X.indexType=1}H.push(X),(Ie=(B+r)%4)&&(Ie=4-Ie),B+=Ie}}}$e.nCompressOptions=J,2===H.length&&13===H[1].primitiveType&&H[1].indicesCount>=3&&(Re=d.S3MEdgeProcessor.createEdgeDataByIndices($e,H[1],l)),c[v]={vertexPackage:$e,arrIndexPackage:H,edgeGeometry:Re}}else{var Re;if(S===ic.SV_Standard||S===ic.SV_Unkown)B=(Se=Nc(f,y,t,r,B,$e,u,O,g,T)).bytesOffset,j=Se.cartographicBounds;else if(S===ic.SV_Compressed&&(B=(Se=xc(y,t,r,B,$e,u,O,g,T)).bytesOffset,3==f)){var we;B=(we=fc(t,r,y,B)).bytesOffset,$e.customVertexAttribute=JSON.parse(we.string);var Ie;fe="aCustom"+$e.customVertexAttribute.TextureCoordMatrix,pe="aCustom"+$e.customVertexAttribute.VertexWeight,_e="aCustom"+$e.customVertexAttribute.VertexWeight_1;n.defined($e.attrLocation[fe])&&($e.attrLocation.aTextureCoordMatrix=$e.attrLocation[fe],delete $e.attrLocation[fe]),n.defined($e.attrLocation[pe])&&($e.attrLocation.aVertexWeight=$e.attrLocation[pe],delete $e.attrLocation[pe]),n.defined($e.attrLocation[_e])&&($e.attrLocation.aVertexWeight_1=$e.attrLocation[_e],delete $e.attrLocation[_e]);var Le;for(ge=(Le=Object.keys($e.attrLocation)).length,me=0;me<ge;++me){var xe;-1!==(xe=Le[me]).indexOf("aCustom")&&delete $e.attrLocation[xe]}(Ie=(B+r)%4)&&(Ie=4-Ie),B+=Ie}Uc(H=(Se=Lc(f,y,t,r,B)).arrIndexPackage)&&($e.clampRegionEdge=!0),2===H.length&&13===H[1].primitiveType&&H[1].indicesCount>=3&&(Re=d.S3MEdgeProcessor.createEdgeDataByIndices($e,H[1],l)),B=Se.bytesOffset,c[v]={vertexPackage:$e,arrIndexPackage:H,edgeGeometry:Re,cartographicBounds:j}}if(3!==f&&n.defined(A)&&A){var Ne=t.getUint16(B+r,!0);if(B+=Uint16Array.BYTES_PER_ELEMENT,1===Ne){var Ue=t.getUint32(B+r,!0);B+=Uint32Array.BYTES_PER_ELEMENT;var Ge,ke=t.getUint32(B+r,!0);B+=Uint32Array.BYTES_PER_ELEMENT,t.getFloat32(B+r,!0),B+=Float32Array.BYTES_PER_ELEMENT;var He=new Array(Ue),Xe=new Array(Ue),Ve=new Array(Ue),Ke=new Array(Ue);for(Ge=0;Ge<Ue;Ge++){var je=t.getFloat32(B+r,!0);B+=Float32Array.BYTES_PER_ELEMENT,He[Ge]=je;var Ye=t.getUint16(B+r,!0);B+=Uint16Array.BYTES_PER_ELEMENT,Xe[Ge]=Ye;var Qe=t.getUint16(B+r,!0);B+=Uint16Array.BYTES_PER_ELEMENT,Ve[Ge]=Qe;for(var Je=Qe*ke,We=new Array(Je),ze=0;ze<Je;ze++){fe=t.getFloat32(B+r,!0);B+=Float32Array.BYTES_PER_ELEMENT,We[ze]=fe}Ke[Ge]=We}}var Ze=new i.Cartesian3,qe=new i.Cartesian3;Ze.x=t.getFloat64(B+r,!0),B+=Float64Array.BYTES_PER_ELEMENT,Ze.y=t.getFloat64(B+r,!0),B+=Float64Array.BYTES_PER_ELEMENT,Ze.z=t.getFloat64(B+r,!0),B+=Float64Array.BYTES_PER_ELEMENT,qe.x=t.getFloat64(B+r,!0),B+=Float64Array.BYTES_PER_ELEMENT,qe.y=t.getFloat64(B+r,!0),B+=Float64Array.BYTES_PER_ELEMENT,qe.z=t.getFloat64(B+r,!0),B+=Float64Array.BYTES_PER_ELEMENT,c[v].min=Ze,c[v].max=qe;var $e=c[v].vertexPackage;n.defined($e.instanceBuffer)&&2===f&&($e.instanceBounds=new Float32Array(6),i.Cartesian3.pack(Ze,$e.instanceBounds,0),i.Cartesian3.pack(qe,$e.instanceBounds,3))}if(3===f){var et=new i.Cartesian3;et.x=t.getFloat64(B+r,!0),B+=Float64Array.BYTES_PER_ELEMENT,et.y=t.getFloat64(B+r,!0),B+=Float64Array.BYTES_PER_ELEMENT,et.z=t.getFloat64(B+r,!0),B+=Float64Array.BYTES_PER_ELEMENT;var tt=new i.Cartesian3;tt.x=t.getFloat64(B+r,!0),B+=Float64Array.BYTES_PER_ELEMENT,tt.y=t.getFloat64(B+r,!0),B+=Float64Array.BYTES_PER_ELEMENT,tt.z=t.getFloat64(B+r,!0),B+=Float64Array.BYTES_PER_ELEMENT;var rt=new i.Cartesian3;rt.x=t.getFloat64(B+r,!0),B+=Float64Array.BYTES_PER_ELEMENT,rt.y=t.getFloat64(B+r,!0),B+=Float64Array.BYTES_PER_ELEMENT,rt.z=t.getFloat64(B+r,!0),B+=Float64Array.BYTES_PER_ELEMENT;var nt=new i.Cartesian3;nt.x=t.getFloat64(B+r,!0),B+=Float64Array.BYTES_PER_ELEMENT,nt.y=t.getFloat64(B+r,!0),B+=Float64Array.BYTES_PER_ELEMENT,nt.z=t.getFloat64(B+r,!0),B+=Float64Array.BYTES_PER_ELEMENT}}}function Hc(e,t,r){var n=e.typedArray,o=new r(n.length+t.length);o.set(n,0),o.set(t,n.length),e.typedArray=o}function Xc(e,t,r,s,c,u,l){var d,A=0,f=c.vertexAttributes,p=c.attrLocation;switch(t){case Gc.AttributeType_Normal:case Gc.AttributeType_FirstTexcoord:case Gc.AttributeType_SecondTexcoord:A=2*Uint16Array.BYTES_PER_ELEMENT,0!=(16&u)||t!==Gc.AttributeType_FirstTexcoord&&t!==Gc.AttributeType_SecondTexcoord||(A=2*Float32Array.BYTES_PER_ELEMENT),d=E.ComponentDatatype.createTypedArray(E.ComponentDatatype.UNSIGNED_BYTE,e*A);break;case Gc.AttributeType_Color:case Gc.AttributeType_SecondColor:A=4*Uint8Array.BYTES_PER_ELEMENT,d=E.ComponentDatatype.createTypedArray(E.ComponentDatatype.UNSIGNED_BYTE,4*e);break;case Gc.AttributeType_Custom0:case Gc.AttributeType_Custom1:A=Float32Array.BYTES_PER_ELEMENT*r,d=E.ComponentDatatype.createTypedArray(E.ComponentDatatype.UNSIGNED_BYTE,e*r*4);break;default:A=4*Uint16Array.BYTES_PER_ELEMENT,d=E.ComponentDatatype.createTypedArray(E.ComponentDatatype.UNSIGNED_BYTE,e*A)}switch(oe.decodeVertexBuffer(d,e,A,s,s.length),t){case Gc.AttributeType_Position:var _=new Uint16Array(d.buffer,0,d.length/2),g=E.ComponentDatatype.SHORT;if(n.defined(l)){var m=i.Cartesian3.unpackArray(_);for(let e=0,t=m.length;e<t;e++){let t=m[e];i.Cartesian3.multiplyByScalar(t,c.vertCompressConstant,t),i.Cartesian3.add(t,c.minVerticesValue,t)}var T=o.Matrix4.multiply(l.sphereMatrix,l.geoMatrix,hc),y=o.Matrix4.multiply(l.ellipsoidMatrix,l.geoMatrix,Oc);o.Matrix4.inverse(y,y);var B=new a.Ellipsoid(6378137,6378137,6378137);for(let e=0,t=m.length;e<t;e++){let t=m[e];o.Matrix4.multiplyByPoint(T,t,Cc);let r=B.cartesianToCartographic(Cc,Dc),n=Bc(r.longitude,r.latitude,r.height,Cc);o.Matrix4.multiplyByPoint(y,n,t)}var C=new Array(3*m.length);i.Cartesian3.packArray(m,C),_=new Float32Array(C),g=E.ComponentDatatype.FLOAT}void 0!==(D=p.aPosition)?(Hc(f[D],_,Uint16Array),c.preVertexCount=c.verticesCount,c.verticesCount+=e):(p.aPosition=f.length,f.push({index:p.aPosition,typedArray:_,componentsPerAttribute:4,componentDatatype:g,offsetInBytes:0,strideInBytes:0,normalize:!1}),c.verticesCount=e);break;case Gc.AttributeType_Normal:var D=p.aNormal,h=new Int16Array(d.buffer,0,d.length/2);void 0!==D?Hc(f[D],h,Uint16Array):(p.aNormal=f.length,f.push({index:p.aNormal,typedArray:h,componentsPerAttribute:2,componentDatatype:E.ComponentDatatype.SHORT,offsetInBytes:0,strideInBytes:0,normalize:!1}));break;case Gc.AttributeType_FirstTexcoord:var O=new Uint16Array(d.buffer,0,d.length/2),P=(D=p.aTexCoord0,g=E.ComponentDatatype.SHORT,Uint16Array);0==(16&u)&&(g=E.ComponentDatatype.FLOAT,P=Float32Array,O=new Float32Array(d.buffer,0,d.length/4)),void 0!==D?Hc(f[D],O,P):(p.aTexCoord0=f.length,f.push({index:p.aTexCoord0,typedArray:O,componentsPerAttribute:2,componentDatatype:g,offsetInBytes:0,strideInBytes:0,normalize:!1}));break;case Gc.AttributeType_SecondTexcoord:O=new Uint16Array(d.buffer,0,d.length/2),D=p.aTexCoord1,g=E.ComponentDatatype.SHORT,P=Uint16Array;0==(16&u)&&(g=E.ComponentDatatype.FLOAT,P=Float32Array,O=new Float32Array(d.buffer,0,d.length/4)),void 0!==D?Hc(f[D],O,P):(p.aTexCoord1=f.length,f.push({index:p.aTexCoord1,typedArray:O,componentsPerAttribute:2,componentDatatype:g,offsetInBytes:0,strideInBytes:0,normalize:!1}));break;case Gc.AttributeType_Color:void 0!==(D=p.aColor)?Hc(f[D],d,Uint8Array):(p.aColor=f.length,f.push({index:p.aColor,typedArray:d,componentsPerAttribute:4,componentDatatype:E.ComponentDatatype.UNSIGNED_BYTE,offsetInBytes:0,strideInBytes:0,normalize:!0}));break;case Gc.AttributeType_SecondColor:void 0!==(D=p.aSecondColor)?Hc(f[D],d,Uint8Array):(p.aSecondColor=f.length,f.push({index:p.aSecondColor,typedArray:d,componentsPerAttribute:4,componentDatatype:E.ComponentDatatype.BYTE,offsetInBytes:0,strideInBytes:0,normalize:!1}));break;case Gc.AttributeType_Custom0:O=new Float32Array(d.buffer,0,d.length/4);void 0!==(D=p.aCustom0||p.aVertexWeight)?Hc(f[D],O,Float32Array):(p.aCustom0=f.length,f.push({index:p.aCustom0,typedArray:O,componentsPerAttribute:r,componentDatatype:E.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:0,normalize:!1}));break;case Gc.AttributeType_Custom1:var v=new Float32Array(d.buffer,0,d.length/4);void 0!==(D=p.aCustom1||p.aTextureCoordMatrix)?Hc(f[D],v,Float32Array):(p.aCustom1=f.length,f.push({index:p.aCustom1,typedArray:v,componentsPerAttribute:r,componentDatatype:E.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:0,normalize:!1}))}}function Vc(e,t,r,a,i){var s={},c=[],E=new o.Matrix4,u=e;i=n.defaultValue(i,{});for(var l=0;l<16;l++)E[l]=t.getFloat64(r+a,!0),r+=Float64Array.BYTES_PER_ELEMENT;s.matrix=E,s.skeletonNames=c;var d=t.getUint32(r+a,!0);r+=Uint32Array.BYTES_PER_ELEMENT;for(var A=0;A<d;A++){var f=fc(t,a,u,r),p=f.string;r=f.bytesOffset,c.push(p),i[p]=E}return{byteOffset:r,geode:s}}function Kc(e){var t=e.indexOf("Geometry");if(-1===t)return e;var r=e.substring(t,e.length);return e.replace(r,"")}function jc(e,t,r,n,o,a){var s={},c=r.getFloat32(n+o,!0);n+=Float32Array.BYTES_PER_ELEMENT;var E=r.getUint16(n+o,!0);n+=Uint16Array.BYTES_PER_ELEMENT,s.rangeMode=E,s.rangeList=c;var u=new i.Cartesian3;u.x=r.getFloat64(n+o,!0),n+=Float64Array.BYTES_PER_ELEMENT,u.y=r.getFloat64(n+o,!0),n+=Float64Array.BYTES_PER_ELEMENT,u.z=r.getFloat64(n+o,!0),n+=Float64Array.BYTES_PER_ELEMENT;var d=r.getFloat64(n+o,!0);if(n+=Float64Array.BYTES_PER_ELEMENT,s.boundingSphere=new l.BoundingSphere(u,d),3===e){var A=new i.Cartesian3;A.x=r.getFloat64(n+o,!0),n+=Float64Array.BYTES_PER_ELEMENT,A.y=r.getFloat64(n+o,!0),n+=Float64Array.BYTES_PER_ELEMENT,A.z=r.getFloat64(n+o,!0),n+=Float64Array.BYTES_PER_ELEMENT;var f=new i.Cartesian3;f.x=r.getFloat64(n+o,!0),n+=Float64Array.BYTES_PER_ELEMENT,f.y=r.getFloat64(n+o,!0),n+=Float64Array.BYTES_PER_ELEMENT,f.z=r.getFloat64(n+o,!0),n+=Float64Array.BYTES_PER_ELEMENT;var p=new i.Cartesian3;p.x=r.getFloat64(n+o,!0),n+=Float64Array.BYTES_PER_ELEMENT,p.y=r.getFloat64(n+o,!0),n+=Float64Array.BYTES_PER_ELEMENT,p.z=r.getFloat64(n+o,!0),n+=Float64Array.BYTES_PER_ELEMENT;var _=new i.Cartesian3;_.x=r.getFloat64(n+o,!0),n+=Float64Array.BYTES_PER_ELEMENT,_.y=r.getFloat64(n+o,!0),n+=Float64Array.BYTES_PER_ELEMENT,_.z=r.getFloat64(n+o,!0),n+=Float64Array.BYTES_PER_ELEMENT,s._obb={xExtent:f,yExtent:p,zExtent:_,obbCenter:A}}var g=t,m=(B=fc(r,o,g,n)).string;n=B.bytesOffset,m=Kc(m=(m=m.replace(/(\.s3mblock)|(\.s3mbz)|(\.s3mb)/gi,"")).replace(/\\/gi,"/")),s.childTile=m,s.geodes=[];var T=r.getUint32(n+o,!0);n+=Uint32Array.BYTES_PER_ELEMENT;for(var y=0;y<T;y++){var B;n=(B=Vc(t,r,n,o,a)).byteOffset,s.geodes.push(B.geode)}return 3===e&&(n=(B=fc(r,o,g,n)).bytesOffset),{pageLOD:s,bytesOffset:n}}function Yc(e,t,r,n,o){var a=0,i={},s=[],c=r.getUint32(a+n,!0);a+=Uint32Array.BYTES_PER_ELEMENT;for(var E=0;E<c;E++){var u=jc(e,t,r,a,n,o);a=u.bytesOffset,s.push(u.pageLOD)}return i.pageLods=s,i}function Qc(e,t,r,n,o,a){var i=0,s=r.getUint32(i+n,!0);i+=Uint32Array.BYTES_PER_ELEMENT;for(var c=0;c<s;c++){var E=fc(r,n,t,i),u=E.string,l=(i=E.bytesOffset)%4;0!==l&&(i+=4-l);var A=r.getUint32(i+n,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var f=r.getUint32(i+n,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var p=r.getUint32(i+n,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var _=r.getUint32(i+n,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var g=r.getUint32(i+n,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var m=r.getUint32(i+n,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var T=t.subarray(i,i+g);i+=g;var y=null,B=_;_===d.S3MCompressType.enrS3TCDXTN&&1!=e?(d.DXTTextureDecode.decode(y,f,p,T,m),y=m>d.S3MPixelFormat.BGR||m===d.S3MPixelFormat.LUMINANCE_ALPHA?new Uint8Array(f*p*4):new Uint16Array(f*p),d.DXTTextureDecode.decode(y,f,p,T,m),a.push(y.buffer),_=0):y=T,o[u]={id:u,width:f,height:p,compressType:_,oriCompressType:B,nFormat:m,imageBuffer:y,mipmapLevel:A}}}function Jc(e,t,r){var n=e.vertexAttributes,o=e.attrLocation,a=n.length;o["aTextureBatchId"+r]=a,n.push({index:a,typedArray:t,componentsPerAttribute:1,componentDatatype:E.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:0})}function Wc(e,t,r,o){for(var a=r.length,i=0;i<a;i++)for(var s=r[i],c=s.subName.split("_")[0],E=s.subVertexOffsetArr,u=0;u<E.length;u++){var l=E[u],d=l.geoName,A=l.offset,f=l.count,p=l.texUnitIndex,_=t[d].vertexPackage.verticesCount,m=o[d];n.defined(m)||(m=o[d]={});var T=m[p];n.defined(T)||(T=m[p]=new Float32Array(_),g.arrayFill(T,-1));var y=n.defined(e)?e[c]:i;g.arrayFill(T,y,A,A+f)}}function zc(e,t,r,o,a,i,s,c,E,l){var A=c,f=s.getUint32(A,!0);A+=Uint32Array.BYTES_PER_ELEMENT;for(var p={},_=0;_<f;_++){var g=s.getUint32(A,!0);A+=Uint32Array.BYTES_PER_ELEMENT;var m=u.getStringFromTypedArray(i,A-c,g),T=(A+=g)%4;0!==T&&(A+=4-T),s.getUint32(A,!0),A+=Uint32Array.BYTES_PER_ELEMENT;var y=s.getUint8(A,!0);A+=Uint8Array.BYTES_PER_ELEMENT;var B=s.getUint32(A,!0);A+=Uint32Array.BYTES_PER_ELEMENT;var C=s.getUint32(A,!0);A+=Uint32Array.BYTES_PER_ELEMENT;var D=s.getUint32(A,!0);A+=Uint32Array.BYTES_PER_ELEMENT;var h=s.getUint32(A,!0);A+=Uint32Array.BYTES_PER_ELEMENT;var O,P=s.getUint32(A,!0);if(A+=Uint32Array.BYTES_PER_ELEMENT,o&&y){var v=A-c;O=i.subarray(v,v+h),A+=h}var F=s.getUint32(A,!0);A+=Uint32Array.BYTES_PER_ELEMENT;for(var M=[],S=0;S<F;S++){g=s.getUint32(A,!0),A+=Uint32Array.BYTES_PER_ELEMENT;var b=u.getStringFromTypedArray(i,A-c,g);A+=g,M.push(b),r[b]=m}var R=s.getUint32(A,!0);A+=Uint32Array.BYTES_PER_ELEMENT;var w=[];for(S=0;S<R;S++){g=s.getUint32(A,!0),A+=Uint32Array.BYTES_PER_ELEMENT;var I=u.getStringFromTypedArray(i,A-c,g);A+=g,w.push(I)}var L=s.getUint32(A,!0);A+=Uint32Array.BYTES_PER_ELEMENT;var x=[],N=void 0,U=m;if(o)N=t[m]={};else{var G=r[m];for(U=G;n.defined(G)&&G!==m;)U=G,G=r[G];n.defined(U)&&(N=t[U])}var k=0;for(S=0;S<L;S++){g=s.getUint32(A,!0),A+=Uint32Array.BYTES_PER_ELEMENT;var H=u.getStringFromTypedArray(i,A-c,g);if(A+=g,o){var X=H.split("_")[0];n.defined(N[X])?k++:N[X]=S-k}var V=s.getUint32(A,!0);A+=Uint32Array.BYTES_PER_ELEMENT;var K=s.getUint32(A,!0);A+=Uint32Array.BYTES_PER_ELEMENT;var j=s.getUint32(A,!0);A+=Uint32Array.BYTES_PER_ELEMENT;var Y=s.getUint32(A,!0);A+=Uint32Array.BYTES_PER_ELEMENT;var Q=s.getUint32(A,!0);A+=Uint32Array.BYTES_PER_ELEMENT;for(var J=[],W=0;W<Q;W++){g=s.getUint32(A,!0),A+=Uint32Array.BYTES_PER_ELEMENT;var z=u.getStringFromTypedArray(i,A-c,g);A+=g;var Z=s.getUint32(A,!0);A+=Uint32Array.BYTES_PER_ELEMENT;var q=s.getUint32(A,!0);A+=Uint32Array.BYTES_PER_ELEMENT;var $=s.getUint32(A,!0);A+=Uint32Array.BYTES_PER_ELEMENT,J.push({geoName:z,offset:Z,count:q,texUnitIndex:$})}x.push({subName:H,offsetX:V,offsetY:K,width:j,height:Y,subVertexOffsetArr:J})}Wc(N,e,x,p),n.defined(O)&&D===d.S3MPixelFormat.CRN_DXT5&&tc&&(O=nc({data:O},l).bufferView),E[m]={id:m,rootTextureName:U,width:B,height:C,compressType:D,size:h,format:P,textureData:O,subTexInfos:x,requestNames:w}}for(var z in p)if(p.hasOwnProperty(z)){var ee=e[z].vertexPackage,te=p[z];for(var $ in te){if(te.hasOwnProperty($))Jc(ee,te[$],$)}}}function Zc(e,t,r){var n=e.vertexAttributes,o=e.attrLocation,a=n.length;o[1===r?"instanceId":"batchId"]=a,n.push({index:a,typedArray:t,componentsPerAttribute:1,componentDatatype:E.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:0,instanceDivisor:r})}var qc=65536;function $c(e,t,r,o,a){var i=0,s=e,E=t.getUint32(i+r,!0);i+=Uint32Array.BYTES_PER_ELEMENT;for(var u=0;u<E;u++){var l=fc(t,r,s,i),A=l.string;i=l.bytesOffset;var f=t.getUint32(i+r,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var p={};o[A].pickInfo=p;var _=o[A].edgeGeometry;if(-1==o[A].vertexPackage.instanceIndex){for(var m=new Float32Array(o[A].vertexPackage.verticesCount),T=0;T<f;T++){var y=t.getUint32(i+r,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var B=t.getUint32(i+r,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var C=0,D=0;p[y]={batchId:T};for(var h=0;h<B;h++)D=t.getUint32(i+r,!0),i+=Uint32Array.BYTES_PER_ELEMENT,C=t.getUint32(i+r,!0),i+=Uint32Array.BYTES_PER_ELEMENT,g.arrayFill(m,T,D,D+C);p[y].vertexColorOffset=D,p[y].vertexCount=C}Zc(o[A].vertexPackage,m,void 0)}else{var O=o[A].vertexPackage.instanceCount,P=o[A].vertexPackage.instanceBuffer,v=o[A].vertexPackage.instanceMode,F=new Float32Array(O),M=17===v?16:28;M*=Float32Array.BYTES_PER_ELEMENT;var S=0;for(T=0;T<f;T++){var b=t.getUint32(i+r,!0);if(i+=Uint32Array.BYTES_PER_ELEMENT,2!==a){var R=S*v*Float32Array.BYTES_PER_ELEMENT+M;c.Color.unpack(P,R,cc),b=cc.red+256*cc.green+cc.blue*qc}B=t.getUint32(i+r,!0);i+=Uint32Array.BYTES_PER_ELEMENT;for(h=0;h<B;h++){var w=t.getUint32(i+r,!0);if(i+=Uint32Array.BYTES_PER_ELEMENT,F[S]=S,void 0===p[b]&&(p[b]={vertexColorCount:1,instanceIds:[],vertexColorOffset:S}),p[b].instanceIds.push(w),S++,3===a){C=t.getUint32(i+r,!0);i+=Uint32Array.BYTES_PER_ELEMENT}}}Zc(o[A].vertexPackage,F,1)}_=o[A].edgeGeometry;if(n.defined(_)){var I,L,x=_.regular.instancesData,N=d.S3MEdgeProcessor.RegularInstanceStride;if(n.defined(x))for(L=x.length,I=0;I<L;I+=N){var U=x[I+9];x[I+9]=m[U]}var G=_.silhouette.instancesData;if(N=d.S3MEdgeProcessor.SilhouetteInstanceStride,n.defined(G))for(L=G.length,I=0;I<L;I+=N){U=G[I+12];G[I+12]=m[U]}}}}function eE(e){return e<1e-10&&e>-1e-10}function tE(e,t,r,n,o,a,i,s){var c=new DataView(e),E=new Uint8Array(e),l=c.getUint32(r,!0);r+=Uint32Array.BYTES_PER_ELEMENT;var d=u.getStringFromTypedArray(E,r,l);d=d.replace(/(\.s3mblock)|(\.s3mbz)|(\.s3mb)/gi,""),r+=l;var A=c.getUint32(r,!0);r+=Uint32Array.BYTES_PER_ELEMENT;for(var f=0;f<A;f++){var p={},g=c.getFloat32(r,!0);r+=Float32Array.BYTES_PER_ELEMENT;var m=c.getUint16(r,!0);r+=Uint16Array.BYTES_PER_ELEMENT,p.rangeMode=m,p.rangeList=g;var T={};T.x=c.getFloat64(r,!0),r+=Float64Array.BYTES_PER_ELEMENT,T.y=c.getFloat64(r,!0),r+=Float64Array.BYTES_PER_ELEMENT,T.z=c.getFloat64(r,!0),r+=Float64Array.BYTES_PER_ELEMENT;var y=c.getFloat64(r,!0);r+=Float64Array.BYTES_PER_ELEMENT,p.boundingSphere={center:T,radius:y},l=c.getUint32(r,!0),r+=Uint32Array.BYTES_PER_ELEMENT;var B=u.getStringFromTypedArray(E,r,l);r+=l,B=Kc(B=B.replace(/(\.s3mblock)|(\.s3mbz)|(\.s3mb)/gi,"")),p.childTile=B}var C={},D=c.getFloat32(r,!0);r+=Float32Array.BYTES_PER_ELEMENT;D>=3&&(c.getUint32(r,!0),r+=Uint32Array.BYTES_PER_ELEMENT),c.getUint32(r,!0),r+=Uint32Array.BYTES_PER_ELEMENT;var h=c.getUint32(r,!0);r+=Uint32Array.BYTES_PER_ELEMENT;var O=new Uint8Array(e,r,h),P=r+h,v=_.pako.inflate(O).buffer;s.push(v),c=new DataView(v);E=new Uint8Array(v);r=0;var F=c.getUint32(r,!0),M=Ac(c,v,r+=Uint32Array.BYTES_PER_ELEMENT),S=M.buffer;r=M.byteOffset;var b=Yc(D,S,c,M.dataViewByteOffset),R=r%4;0!==R&&(r+=4-R),kc((M=Ac(c,v,r)).buffer,c,M.dataViewByteOffset,C,!1,void 0,void 0,D),r=M.byteOffset,3!==D&&((M=Ac(c,v,r)).buffer,r=M.byteOffset);var w={};zc(C,n,o,a,0,(M=Ac(c,v,r)).buffer,c,M.dataViewByteOffset,w,s),r=M.byteOffset;var I=c.getUint32(r,!0);r+=Uint32Array.BYTES_PER_ELEMENT;var L=E.subarray(r,r+I),x=u.getStringFromTypedArray(L);r+=I;var N=JSON.parse(x);(3===D&&(F=c.getUint32(r,!0),r+=Uint32Array.BYTES_PER_ELEMENT),(F&ac.SVO_HasInstSelInfo)==ac.SVO_HasInstSelInfo)&&($c((M=Ac(c,v,r)).buffer,c,M.dataViewByteOffset,C,D),r=M.byteOffset);if(1==D){var U=b.pageLods,G=!0;for(f=0;f<U.length;f++){var k=U[f];G=""===k.childTile;for(var X=k.geodes,V=0;V<X.length;V++)for(var K=X[V].skeletonNames,j=0;j<K.length;j++){var Y=K[j];if(G){var Q=C[Y].vertexPackage;Q.boundingSphere=H.calcBoundingSphereInWorker(1,Q)}}}}i[d]={result:!0,groupNode:b,geoPackage:C,matrials:N,texturePackage:w,version:ne.S3M4,dataVersion:D,rootBatchIdMap:n,ancestorMap:o},P<t&&tE(e,t,P,n,o,!1,i,s)}function rE(e,t,r){for(var o in delete e.ignoreNormal,e)if(e.hasOwnProperty(o)){var a=e[o],i=a.arrIndexPackage;if(i.length<1)continue;if(1===i.length||2===i.length&&13===i[1].primitiveType){var s=a.vertexPackage.attrLocation.aTextureCoordMatrix;if(void 0!==s){if((c=(b=a.vertexPackage.vertexAttributes[s]).typedArray)[0]<0)continue}else if(void 0!==(s=a.vertexPackage.attrLocation.aTextureCoordMatrix||a.vertexPackage.attrLocation.aTexCoord0)){b=a.vertexPackage.vertexAttributes[s];var c=new Float32Array(b.typedArray.buffer,b.typedArray.byteOffset,b.typedArray.byteLength/4);if(3===b.componentsPerAttribute&&c[2]<0)continue}}var E,u,l=0,A={},f=void 0;for(E=0,u=i.length;E<u;E++)13!==i[E].primitiveType?l+=i[E].indicesTypedArray.byteLength:f=i[E],0===E&&(A.indicesCount=0,A.indexType=i[E].indexType,A.primitiveType=i[E].primitiveType,A.materialCode=i[E].materialCode);A.indicesCount=l/2;var p=a.vertexPackage.verticesCount>65535?new Uint32Array(l/2):new Uint16Array(l/2),_=0;for(E=0,u=i.length;E<u;E++){if(13!==(R=i[E]).primitiveType){var g=0===R.indexType?Uint16Array:Uint32Array,m=0===R.indexType?R.indicesTypedArray.byteLength/2:R.indicesTypedArray.byteLength/4,T=new g(R.indicesTypedArray.buffer,R.indicesTypedArray.byteOffset,m);p.set(T,_),_+=T.length}}A.indicesTypedArray=p,a.arrIndexPackage=[A],n.defined(f)&&(a.arrIndexPackage.push(f),a.edgeGeometry=d.S3MEdgeProcessor.createEdgeDataByIndices(a.vertexPackage,f));var y=2*i.length*4,B=new Float32Array(y),C={};for(E=0,u=r.material.length;E<u;E++){C[(w=r.material[E].material).id]=w}for(E=0,u=i.length;E<u;E++){if(w=C[(R=i[E]).materialCode]){var D=w.pbrMetallicRoughness;if(D){B[8*E]=D.metallicFactor,B[8*E+1]=D.roughnessFactor,B[8*E+2]=w.alphaCutoff;var h=""===w.alphaMode?0:1,O="none"===w.cullMode?0:1;B[8*E+3]=O|h<<16,B[8*E+4]=D.emissiveFactor.x,B[8*E+5]=D.emissiveFactor.y,B[8*E+6]=D.emissiveFactor.z,B[8*E+7]=0,w.pbrIndex=E}}}var P="PBRMaterialParam_"+o;for(E=0,u=r.material.length;E<u;E++){if((w=r.material[E].material).id===A.materialCode){w.textureunitstates.push({textureunitstate:{addressmode:{u:0,v:0,w:0},filteringoption:0,filtermax:2,filtermin:2,id:P,texmodmatrix:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],url:""}});break}}var v,F,M=a.vertexPackage,S=M.attrLocation.aTexCoord1;if(void 0!==S){var b=M.vertexAttributes[S];v=new Float32Array(2*M.verticesCount),b.typedArray=v}else v=new Float32Array(2*M.verticesCount),S=M.vertexAttributes.length,M.attrLocation.aTexCoord1=S,M.vertexAttributes.push({index:S,typedArray:v,componentsPerAttribute:2,componentDatatype:5126,offsetInBytes:0,strideInBytes:8,normalize:!1});if(void 0!==(S=M.attrLocation.aColor))F=(b=M.vertexAttributes[S]).typedArray;for(E=0,u=i.length;E<u;E++){var R,w;if((w=C[(R=i[E]).materialCode])&&w.pbrMetallicRoughness)for(var I=w.pbrMetallicRoughness.baseColor,L=void 0!==F,x=w.pbrIndex,N=(p=R.indicesTypedArray,0),U=(p=0===R.indexType?new Uint16Array(p.buffer,p.byteOffset,p.byteLength/2):new Uint32Array(p.buffer,p.byteOffset,p.byteLength/4)).length;N<U;N++){var G=p[N];v[2*G]=x,L&&(F[4*G]=255*I.x,F[4*G+1]=255*I.y,F[4*G+2]=255*I.z,F[4*G+3]=255*I.w)}}t[P]={id:P,width:2*i.length,height:1,compressType:0,nFormat:25,imageBuffer:B,mipmapLevel:0}}}function nE(e,t,r){var n=ae._malloc(20*t),o=ae._malloc(Uint8Array.BYTES_PER_ELEMENT*t);ae.HEAPU8.set(e,o/Uint8Array.BYTES_PER_ELEMENT);var a=lc(o,t,n,r),i=new Uint8Array(ae.HEAPU8.buffer,n,a);e=null;e=new Uint8Array(i).buffer;return ae._free(n),ae._free(o),e}function oE(e,t){var r=e.buffer;if(e.isOSGB){if(!uc)return null;var o;switch(e.suffix){case"dae":case"DAE":o=4;break;case"x":o=2;break;default:o=0}r=nE(new Uint8Array(r),r.byteLength,o)}var a=e.isS3MZ,i=e.fileType,s=e.supportCompressType,c=e.bVolume,E=e.isS3MBlock,l=e.modelMatrix,d=e.materialType,A=e.isCoverImageryLayer,f=e.transformPar,p=null,g=null,m=null;if(c&&e.volbuffer.byteLength<8&&(c=!1),c){var T=e.volbuffer,y=new Uint8Array(T,8),B=_.pako.inflate(y).buffer,C=new Float64Array(B,0,1),D=new Uint32Array(B,48,1);if(0===C[0]||3200===D[0]||3201===D[0]){var h=0;0==C[0]&&(h=8),t.push(B);var O=new Float64Array(B,h,6),P=O[0],v=O[1],F=O[2],M=O[3],S=O[4]<O[5]?O[4]:O[5],b=O[4]>O[5]?O[4]:O[5];g={left:P,top:v,right:F,bottom:M,minHeight:S,maxHeight:b,width:(p=new dc(P,M,F,v,S,b)).width,length:p.length,height:p.height};var R=new Uint32Array(B,48+h,7),w=R[0],I=R[1],L=R[2],x=R[3];m={nFormat:w,nSideBlockCount:I,nBlockLength:L,nLength:x,nWidth:R[4],nHeight:R[5],nDepth:R[6],imageArray:new Uint8Array(B,76+h,x*x*4)}}}var N=0,U={};U.ignoreNormal=e.ignoreNormal;var G=e.rootBatchIdMap||{},k=e.ancestorMap||{},X={},V=new DataView(r),K=V.getFloat32(N,!0);if(N+=Float32Array.BYTES_PER_ELEMENT,E)return V.getUint32(N,!0),N+=Uint32Array.BYTES_PER_ELEMENT,tE(r,r.byteLength,N,G,k,e.isRoot,X,t),X;var j=!1;if(K>=3&&(V.getUint32(N,!0),N+=Uint32Array.BYTES_PER_ELEMENT),K>=2&&(V.getUint32(N,!0),N+=Uint32Array.BYTES_PER_ELEMENT),eE(K-1)||eE(K-2)||eE(K-3)||K>2.09&&K<2.11){var Y=V.getUint32(N,!0);N+=Uint32Array.BYTES_PER_ELEMENT;var Q=new Uint8Array(r,N,Y);r=_.pako.inflate(Q).buffer,t.push(r),V=new DataView(r),N=0}else if(K>1.199&&K<1.201){Y=V.getUint32(N,!0);N+=Uint32Array.BYTES_PER_ELEMENT,t.push(r)}else{j=!0,N=0;Y=V.getInt32(N,!0);if(N+=Int32Array.BYTES_PER_ELEMENT,N+=Uint8Array.BYTES_PER_ELEMENT*Y,a){V.getUint32(N,!0),N+=Uint32Array.BYTES_PER_ELEMENT;y=new Uint8Array(r,N);r=_.pako.inflate(y).buffer,t.push(r),V=new DataView(r),N=0}}var J=V.getUint32(N,!0),W=Ac(V,r,N+=Uint32Array.BYTES_PER_ELEMENT),z=W.buffer;N=W.byteOffset;var Z={},q=Yc(K,z,V,W.dataViewByteOffset,Z),$=N%4;0!==$&&(N+=4-$);var ee=K>2.09&&3!==K;if(kc((W=Ac(V,r,N)).buffer,V,W.dataViewByteOffset,U,j,t,ee,K,l,Z,A,e.fileType,f),N=W.byteOffset,ee)for(var te=0;te<q.pageLods.length;te++)for(var re=q.pageLods[te],oe=re.geodes,ae=0;ae<oe.length;ae++)for(var ie=oe[ae].skeletonNames,se=0;se<ie.length;se++){var ce=ie[se];n.defined(U[ce].max)&&(n.defined(re.max)?(re.max.x=Math.max(U[ce].max.x,re.max.x),re.max.y=Math.max(U[ce].max.y,re.max.y),re.max.z=Math.max(U[ce].max.z,re.max.z),re.min.x=Math.min(U[ce].min.x,re.min.x),re.min.y=Math.min(U[ce].min.y,re.min.y),re.min.z=Math.min(U[ce].min.z,re.min.z)):(re.max=U[ce].max,re.min=U[ce].min))}3!==K&&((W=Ac(V,r,N)).buffer,N=W.byteOffset);var Ee={};Qc(s,(W=Ac(V,r,N)).buffer,V,W.dataViewByteOffset,Ee,t),N=W.byteOffset;var ue=V.getUint32(N,!0);N+=Uint32Array.BYTES_PER_ELEMENT;var le=new Uint8Array(r).subarray(N,N+ue),de=u.getStringFromTypedArray(le);N+=ue,de=de.replace(/\n\0/,"");var Ae=JSON.parse(de);(3===K&&(J=V.getUint32(N,!0),N+=Uint32Array.BYTES_PER_ELEMENT),(J&ac.SVO_HasInstSelInfo)==ac.SVO_HasInstSelInfo)&&$c((W=Ac(V,r,N)).buffer,V,W.dataViewByteOffset,U,K);if(1==K){var fe=q.pageLods,pe=!0;for(te=0;te<fe.length;te++){var _e=fe[te];pe=""===_e.childTile;for(var ge=_e.geodes,me=0;me<ge.length;me++){ie=ge[me].skeletonNames;for(var Te=0;Te<ie.length;Te++){var ye=ie[Te];if(pe){var Be=U[ye].vertexPackage;Be.boundingSphere=H.calcBoundingSphereInWorker(i,Be)}}}}}return"BatchPBR"===d&&rE(U,Ee,Ae),{result:!0,groupNode:q,geoPackage:U,matrials:Ae,texturePackage:Ee,version:ne.S3M4,dataVersion:K,volImageBuffer:m,volBounds:g}}function aE(){n.defined($s)&&n.defined(oc)&&($s.onRuntimeInitialized=function(){tc=!0},self.onmessage=e(oE),self.postMessage(!0))}function iE(t){if("undefined"==typeof WebAssembly)return self.onmessage=e(oE),void self.postMessage(!0);var o=t.data.webAssemblyConfig;return n.defined(o)?r.FeatureDetection.isInternetExplorer()?require([l.buildModuleUrl("ThirdParty/Workers/ie-webworker-promise-polyfill.js")],(function(e){return self.Promise=e,-1!==o.modulePath.indexOf("crunch")?require([o.modulePath],(function(e){n.defined(o.wasmBinaryFile)?(n.defined(e)||(e=self.Module),$s=e,aE()):($s=e,aE())})):require([o.modulePath],(function(e){n.defined(o.wasmBinaryFile)?(n.defined(e)||(e=self.DracoDecoderModule),e(o).then((function(e){oc=e,aE()}))):(oc=e(),aE())}))})):-1!==o.modulePath.indexOf("crunch")?require([o.modulePath],(function(e){n.defined(o.wasmBinaryFile)?(n.defined(e)||(e=self.Module),$s=e,aE()):($s=e,aE())})):require([o.modulePath],(function(e){n.defined(o.wasmBinaryFile)?(n.defined(e)||(e=self.DracoDecoderModule),e(o).then((function(e){oc=e,aE()}))):(oc=e(),aE())})):void 0}return iE}));