????

Your IP : 13.58.192.154


Current Path : C:/inetpub/vhost/binhdinhinvest.gdtvietnam.com/www/
Upload File :
Current File : C:/inetpub/vhost/binhdinhinvest.gdtvietnam.com/www/12.e1d3714ba58e357ea55b.js

(function(){var e={"esri/views/3d/webgl-engine/lib/geometryDataUtils":"+nCE","esri/views/3d/webgl-engine/lib/screenSizePerspectiveUtils":"+wMf","esri/views/3d/support/geometryUtils/sphere":"/dtL","esri/views/3d/support/geometryUtils/vector":"18xY","esri/views/3d/webgl-engine/lib/doublePrecisionUtils":"1f+t","esri/core/libs/gl-matrix-2/mat4f64":"1m5D","esri/views/3d/support/geometryUtils/boundedPlane":"2eYJ","esri/views/3d/webgl-engine/core/shaderLibrary/util/ScreenSizePerspective.glsl":"2o+p","esri/views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl":"3PFg","esri/views/3d/webgl-engine/lib/BoundingInfo":"3RHn","esri/views/3d/webgl-engine/core/shaderLibrary/Transform.glsl":"3kdR","esri/views/3d/support/geometryUtils/ray":"4p4v","esri/views/3d/webgl-engine/lib/GeometryUtil":"4ziW","esri/core/libs/gl-matrix-2/mat3f64":"51bw","esri/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl":"6t3m","esri/views/3d/webgl-engine/core/shaderLibrary/output/ReadLinearDepth.glsl":"6vp1","esri/views/3d/webgl-engine/core/shaderModules/interfaces":"7Aei","esri/core/libs/gl-matrix-2/factories/mat4f32":"7Yqx","esri/views/3d/webgl-engine/lib/intersectorUtils":"9DjX","esri/views/3d/webgl-engine/lib/GLMaterialTexture":"9FJH","esri/views/3d/webgl-engine/lib/GeometryData":"AgDx","esri/views/3d/webgl-engine/core/shaderLibrary/shading/FoamRendering.glsl":"B4Pz","esri/views/3d/layers/graphics/graphicUtils":"BwdQ","esri/views/3d/webgl-engine/lib/Util":"CIy2","esri/core/libs/gl-matrix-2/factories/mat4f64":"CIzB","esri/views/3d/webgl-engine/materials/WaterGLMaterial":"CP88","esri/views/3d/webgl-engine/core/shaderLibrary/util/RgbaFloatEncoding.glsl":"DKwL","esri/views/3d/webgl-engine/lib/DefaultTextureUnits":"EiD/","esri/views/3d/webgl-engine/lib/DDSUtil":"EyQ4","esri/views/3d/webgl-engine/lib/renderStats":"FLCf","esri/views/3d/webgl-engine/lib/Material":"FNtW","esri/views/3d/webgl-engine/core/shaderTechnique/ShaderTechnique":"FQ4r","esri/views/3d/support/geometryUtils/plane":"GG08","esri/views/3d/support/geometryUtils/axisAngle":"GyfB","esri/views/3d/webgl-engine/materials/internal/bufferWriterUtils":"ILj8","esri/views/3d/webgl-engine/core/shaderLibrary/util/AlphaDiscard.glsl":"IwVr","esri/views/3d/support/stack":"JjCO","esri/views/3d/webgl-engine/lib/AutoDisposable":"KRuQ","esri/views/3d/support/geometryUtils/lineSegment":"N5NQ","esri/core/ObjectStack":"PHan","esri/views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl":"PaEL","esri/views/3d/webgl-engine/materials/renderers/utils":"PwS/","esri/views/3d/webgl-engine/core/shaderLibrary/shading/WaterDistortion.glsl":"RdU/","esri/views/3d/webgl-engine/core/shaderTechnique/ReloadableShaderModule":"W/V4","esri/views/3d/webgl-engine/lib/IdGen":"W0kZ","esri/views/3d/webgl-engine/core/shaderLibrary/shading/Reprojection.glsl":"Xakh","esri/views/3d/webgl-engine/lib/ResizableFloat32Array":"YseA","esri/views/3d/webgl-engine/materials/renderers/MergedRenderer":"ZeO9","esri/views/3d/support/geometryUtils/triangle":"ZjcA","esri/views/3d/webgl-engine/core/shaderModules/ShaderBuilder":"aExC","esri/views/3d/support/geometryUtils":"aWgr","esri/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl":"cj3m","esri/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl":"cmSR","esri/views/3d/support/geometryUtils/frustum":"cpxo","esri/views/3d/support/geometryUtils/clipRay":"fXZm","esri/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl":"fese","esri/views/3d/webgl-engine/lib/DefaultVertexAttributeLocations":"ff/U","esri/core/libs/gl-matrix-2/factories/vec3f32":"iHt0","esri/views/3d/webgl-engine/shaders/WaterSurface.glsl":"jl7D","esri/views/3d/webgl-engine/core/shaderLibrary/shading/AnalyticalSkyModel.glsl":"juLw","esri/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration":"lBa0","esri/views/3d/webgl-engine/lib/StencilUtils":"lfQW","esri/views/3d/webgl-engine/core/shaderLibrary/util/Camera.glsl":"naZ0","esri/core/libs/gl-matrix-2/mat4f32":"oZZu","esri/views/3d/webgl-engine/core/shaderLibrary/shading/NormalUtils.glsl":"pLfv","esri/views/3d/webgl-engine/materials/renderers/Instance":"pbva","esri/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRendering.glsl":"piY7","esri/views/3d/webgl-engine/core/shaderLibrary/shading/PiUtils.glsl":"quQL","esri/views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl":"rCq5","esri/views/3d/webgl-engine/materials/internal/MaterialUtil":"s6rJ","esri/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceReflections.glsl":"sQDZ","esri/views/3d/webgl-engine/lib/GLMaterial":"tUyH","esri/views/3d/webgl-engine/materials/WaterTechnique":"v22c","esri/views/3d/webgl-engine/core/shaderLibrary/shading/Water.glsl":"vGsU","esri/core/libs/gl-matrix-2/vec3f32":"vlC2","esri/core/VectorStack":"wSO/","esri/views/3d/support/imageUtils":"weRx","esri/views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl":"xDGw","esri/views/3d/webgl-engine/core/shaderLibrary/shading/Gamma.glsl":"ybGv","esri/views/3d/webgl-engine/lib/Texture":"yqrJ","esri/views/3d/webgl-engine/lib/Geometry":"ys4y"},t=this||window,n=t.webpackJsonp=t.webpackJsonp||[];n.registerAbsMids?n.registerAbsMids(e):(n.absMidsWaiting=n.absMidsWaiting||[]).push(e)})(),(window.webpackJsonp=window.webpackJsonp||[]).push([[12],{"+nCE":function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("0LE5"),n("Rdxj"),n("ZjcA")],void 0===(a=(function(e,t,n,r,a){Object.defineProperty(t,"__esModule",{value:!0});var i=1,o=null,s=new Uint32Array([0]);t.generateDefaultIndexArray=function(e){if(1===e)return s;if(e>i||null==o){for(;e>i;)i*=2;o=new Uint32Array(i);for(var t=0;t<i;t++)o[t]=t}return new Uint32Array(o.buffer,0,e)},t.computeAttachmentOriginTriangles=function(e,t,r){if(!e)return!1;var i=e.strideIdx,o=e.offsetIdx,s=e.data;n.vec3.set(r,0,0,0),n.vec3.set(f,0,0,0);for(var c=0,v=0,p=0;p<t.length-2;p+=3){var h=t[p+0]*i+o,m=t[p+1]*i+o,g=t[p+2]*i+o;n.vec3.set(l,s[h+0],s[h+1],s[h+2]),n.vec3.set(d,s[m+0],s[m+1],s[m+2]),n.vec3.set(u,s[g+0],s[g+1],s[g+2]);var y=a.areaPoints3d(l,d,u);y?(n.vec3.add(l,l,d),n.vec3.add(l,l,u),n.vec3.scale(l,l,1/3*y),n.vec3.add(r,r,l),c+=y):(n.vec3.add(f,f,l),n.vec3.add(f,f,d),n.vec3.add(f,f,u),v+=3)}return!(0===v&&0===c||(0!==c?(n.vec3.scale(r,r,1/c),0):0===v||(n.vec3.scale(r,f,1/v),0)))},t.computeAttachmentOriginPoints=function(e,t,r){if(!e||!t)return!1;var a=e.strideIdx,i=e.offsetIdx,o=e.data;n.vec3.set(r,0,0,0);for(var s=-1,c=0,l=0;l<t.length;l++){var d=t[l]*a+i;s!==d&&(r[0]+=o[d+0],r[1]+=o[d+1],r[2]+=o[d+2],c++),s=d}return c>1&&n.vec3.scale(r,r,1/c),c>0},t.computeAttachmentOriginLines=function(e,t,r,a){if(!e)return!1;var i=e.strideIdx,o=e.offsetIdx,s=e.data;n.vec3.set(a,0,0,0),n.vec3.set(f,0,0,0);for(var c=0,u=0,v=t?t.length-1:s.length/i-1,p=v+(r?2:0),h=0;h<p;h+=2){var m=h<v?h:v,g=h<v?h+1:0,y=(t?t[m]:m)*i+o,b=(t?t[g]:g)*i+o;l[0]=s[y+0],l[1]=s[y+1],l[2]=s[y+2],d[0]=s[b+0],d[1]=s[b+1],d[2]=s[b+2],n.vec3.scale(l,n.vec3.add(l,l,d),.5);var x=n.vec3.dist(l,d);x>0?(n.vec3.add(a,a,n.vec3.scale(l,l,x)),c+=x):(n.vec3.add(f,f,l),u++)}return 0!==c?(n.vec3.scale(a,a,1/c),!0):0!==u&&(n.vec3.scale(a,f,1/u),!0)};var c=0;t.getNewId=function(){return c++};var l=r.vec3f64.create(),d=r.vec3f64.create(),u=r.vec3f64.create(),f=r.vec3f64.create()}).apply(null,r))||(e.exports=a)},"+wMf":function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("xoE+"),n("wPX3")],void 0===(a=(function(e,t,n,r){function a(e,t,n){var r=n.parameters,a=n.paddingPixelsOverride;return d.scale=Math.min(r.divisor/(t-r.offset),1),d.factor=function(e){return Math.abs(e*e*e)}(e),d.minPixelSize=r.minPixelSize,d.paddingPixels=a,d}function i(e,t){return 0===e?t.minPixelSize:t.minPixelSize*(1+2*t.paddingPixels/e)}function o(e,t){return Math.max(n.lerp(e*t.scale,e,t.factor),i(e,t))}Object.defineProperty(t,"__esModule",{value:!0}),t.getSettings=function(e){return new s(e,c)},t.getLabelSettings=function(e){var t=c.curvatureDependent;return new s(e,{curvatureDependent:{min:{curvature:t.min.curvature,tiltAngle:t.min.tiltAngle,scaleFallOffFactor:l.curvatureDependent.min.scaleFallOffFactor},max:{curvature:t.max.curvature,tiltAngle:t.max.tiltAngle,scaleFallOffFactor:l.curvatureDependent.max.scaleFallOffFactor}},scaleStart:c.scaleStart,scaleFallOffRange:c.scaleFallOffRange,minPixelSize:l.minPixelSize})},t.applyScaleFactor=o,t.applyScaleFactorVec2=function(e,t,r){void 0===r&&(r=[0,0]);var a=Math.min(Math.max(t.scale,i(e[1],t)/e[1]),1);return r[0]=n.lerp(e[0]*a,e[0],t.factor),r[1]=n.lerp(e[1]*a,e[1],t.factor),r},t.precomputeScaleFactor=function(e,t,n,r){r.scale=function(e,t,n){var r=a(e,t,n);return r.minPixelSize=0,r.paddingPixels=0,o(1,r)}(e,t,n),r.factor=0,r.minPixelSize=n.parameters.minPixelSize,r.paddingPixels=n.paddingPixelsOverride},t.applyPrecomputedScaleFactor=function(e,t,n){void 0===n&&(n=[0,0]);var r=Math.min(Math.max(t.scale,i(e[1],t)/e[1]),1);return n[0]=e[0]*r,n[1]=e[1]*r,n},t.scale=function(e,t,n,r){return o(e,a(t,n,r))};var s=function(){function e(e,t,n,r){void 0===n&&(n={camera:{distance:0,fovY:0},divisor:0,offset:0,minPixelSize:0,paddingPixels:0}),this.viewingMode=e,this.description=t,this.parameters=n,this._paddingPixelsOverride=r,"local"===this.viewingMode?(this.coverageCompensation=this.surfaceCoverageCompensationLocal,this.calculateCurvatureDependentParameters=this.calculateCurvatureDependentParametersLocal):(this.coverageCompensation=this.surfaceCoverageCompensationGlobal,this.calculateCurvatureDependentParameters=this.calculateCurvatureDependentParametersGlobal)}return Object.defineProperty(e.prototype,"paddingPixelsOverride",{get:function(){return this._paddingPixelsOverride||this.parameters.paddingPixels},enumerable:!0,configurable:!0}),e.prototype.update=function(e){return!(this.parameters&&this.parameters.camera.fovY===e.fovY&&this.parameters.camera.distance===e.distance||(this.calculateParameters(e,this.parameters),0))},e.prototype.overridePadding=function(t){return t!==this.paddingPixelsOverride?new e(this.viewingMode,this.description,this.parameters,t):this},e.prototype.calculateParameters=function(e,t){var n=this.description,r=n.scaleStart,a=n.scaleFallOffRange,i=n.minPixelSize,o=e.fovY,s=e.distance,c=this.calculateCurvatureDependentParameters(e),l=this.coverageCompensation(e,c),d=c.tiltAngle,u=c.scaleFallOffFactor,f=Math.sin(d)*s,v=.5*Math.PI-d-o*(.5-r*l),p=f/Math.cos(v),h=(p-u*(f/Math.cos(v+o*a*l)))/(1-u);return t.camera.fovY=e.fovY,t.camera.distance=e.distance,t.offset=h,t.divisor=p-h,t.minPixelSize=i,t},e.prototype.calculateCurvatureDependentParametersLocal=function(e,t){return void 0===t&&(t=u),t.tiltAngle=this.description.curvatureDependent.min.tiltAngle,t.scaleFallOffFactor=this.description.curvatureDependent.min.scaleFallOffFactor,t},e.prototype.calculateCurvatureDependentParametersGlobal=function(e,t){void 0===t&&(t=u);var a=this.description.curvatureDependent,i=1+e.distance/r.earthRadius,o=Math.sqrt(i*i-1),s=[a.min.curvature,a.max.curvature],c=s[0],l=n.clamp((o-c)/(s[1]-c),0,1),d=[a.min,a.max],f=d[0],v=d[1];return t.tiltAngle=n.lerp(f.tiltAngle,v.tiltAngle,l),t.scaleFallOffFactor=n.lerp(f.scaleFallOffFactor,v.scaleFallOffFactor,l),t},e.prototype.surfaceCoverageCompensationLocal=function(e,t){return(e.fovY-t.tiltAngle)/e.fovY},e.prototype.surfaceCoverageCompensationGlobal=function(e,t){var n=r.earthRadius*r.earthRadius,a=t.tiltAngle+.5*Math.PI,i=e.fovY,o=e.distance,s=o*o+n-2*Math.cos(a)*o*r.earthRadius,c=Math.sqrt(s),l=Math.sqrt(s-n);return(Math.acos(l/c)-Math.asin(r.earthRadius/(c/Math.sin(a)))+.5*i)/i},e}(),c={curvatureDependent:{min:{curvature:n.deg2rad(10),tiltAngle:n.deg2rad(12),scaleFallOffFactor:.5},max:{curvature:n.deg2rad(70),tiltAngle:n.deg2rad(40),scaleFallOffFactor:.8}},scaleStart:.3,scaleFallOffRange:.65,minPixelSize:0},l={curvatureDependent:{min:{scaleFallOffFactor:.7},max:{scaleFallOffFactor:.95}},minPixelSize:14},d={scale:0,factor:0,minPixelSize:0,paddingPixels:0},u={tiltAngle:0,scaleFallOffFactor:0}}).apply(null,r))||(e.exports=a)},"/Bau":function(e,t){},"/dtL":function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("pcDC"),n("qsST"),n("xoE+"),n("PHan"),n("FXVB"),n("0LE5"),n("Rdxj"),n("aWgr"),n("AzkI"),n("JjCO"),n("4p4v")],void 0===(a=(function(e,t,n,r,a,i,o,s,c,l,d,u,f){Object.defineProperty(t,"__esModule",{value:!0});var v=r.getLogger("esri.views.3d.support.geometryUtils.sphere");function p(e){return e?{radius:e.radius,center:c.vec3f64.clone(e.center)}:{radius:1,center:c.vec3f64.create()}}function h(e,t){return void 0===t&&(t=p()),m(e.radius,e.center,t)}function m(e,t,n){return void 0===n&&(n=p()),s.vec3.copy(n.center,t),n.radius=e,n}function g(e,t,n){var r=s.vec3.subtract(u.sv3d.get(),t.origin,e.center),a=s.vec3.dot(t.direction,t.direction),i=2*s.vec3.dot(t.direction,r),o=i*i-4*a*(s.vec3.dot(r,r)-e.radius*e.radius);if(o<0)return!1;var c=Math.sqrt(o),l=(-i-c)/(2*a),d=(-i+c)/(2*a);return(l<0||d<l&&d>0)&&(l=d),!(l<0||(n&&s.vec3.add(n,t.origin,s.vec3.scale(u.sv3d.get(),t.direction,l)),0))}function y(e,t,n){var r=u.sv3d.get(),a=u.sm4d.get();s.vec3.cross(r,t.origin,t.direction),s.vec3.cross(n,r,t.origin),s.vec3.scale(n,n,1/s.vec3.length(n)*e.radius);var i=x(e,t.origin),c=l.vector.angle(t.origin,n);return o.mat4.identity(a),o.mat4.rotate(a,a,c+i,r),s.vec3.transformMat4(n,n,a),n}function b(e,t,n){var r=s.vec3.subtract(u.sv3d.get(),t,e.center),a=s.vec3.scale(u.sv3d.get(),r,e.radius/s.vec3.length(r));return s.vec3.add(n,a,e.center)}function x(e,t){var n=s.vec3.subtract(u.sv3d.get(),t,e.center),r=s.vec3.length(n),i=e.radius+Math.abs(e.radius-r);return a.acosClamped(e.radius/i)}t.create=p,t.wrap=function(e,t){var n=P.get();return n.radius=e,n.center=t||M,n},t.copy=h,t.fromValues=m,t.elevate=function(e,t,n){return e!==n&&s.vec3.copy(n.center,e.center),n.radius=e.radius+t,n},t.setExtent=function(e,t,n){return v.error("sphere.setExtent is not yet supported"),e===n?n:h(e,n)},t.intersectRay=g,t.intersectScreen=function(e,t,n,r){return g(e,f.fromScreenAtEye(t,n,O),r)},t.intersectsRay=function(e,t){return g(e,t,null)},t.intersectRayClosestSilhouette=function(e,t,n){if(g(e,t,n))return n;var r=y(e,t,u.sv3d.get());return s.vec3.add(n,t.origin,s.vec3.scale(u.sv3d.get(),t.direction,s.vec3.distance(t.origin,r)/s.vec3.length(t.direction))),n},t.closestPointOnSilhouette=y,t.closestPoint=function(e,t,n){return g(e,t,n)?n:(f.closestPoint(t,e.center,n),b(e,n,n))},t.projectPoint=b,t.distanceToSilhouette=function(e,t){var n=s.vec3.subtract(u.sv3d.get(),t,e.center),r=s.vec3.squaredLength(n);return Math.sqrt(Math.abs(r-e.radius*e.radius))},t.angleToSilhouette=x;var w=c.vec3f64.create();function _(e,t,r,a){var i=s.vec3.subtract(w,t,e.center);switch(r){case 0:var o=(c=d.cartesianToSpherical(i,w))[2];return s.vec3.set(a,-Math.sin(o),Math.cos(o),0);case 1:var c,l=(c=d.cartesianToSpherical(i,w))[1],u=(o=c[2],Math.sin(l));return s.vec3.set(a,-u*Math.cos(o),-u*Math.sin(o),Math.cos(l));case 2:return s.vec3.normalize(a,i);default:return void n.neverReached(r)}}function S(e,t){var n=s.vec3.subtract(A,t,e.center);return s.vec3.length(n)-e.radius}t.axisAt=_,t.altitudeAt=S,t.setAltitudeAt=function(e,t,n,r){var a=S(e,t),i=_(e,t,2,A),o=s.vec3.scale(A,i,n-a);return s.vec3.add(r,t,o),r};var P=new i.ObjectStack((function(){return{center:null,radius:0}})),O=f.create(),M=c.vec3f64.create(),A=c.vec3f64.create();Object.freeze(M)}).apply(null,r))||(e.exports=a)},"18xY":function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("xoE+"),n("0LE5"),n("Rdxj")],void 0===(a=(function(e,t,n,r,a){Object.defineProperty(t,"__esModule",{value:!0}),t.projectPoint=function(e,t,n){var a=r.vec3.dot(e,t)/r.vec3.dot(e,e);return r.vec3.scale(n,e,a)},t.projectPointSignedLength=function(e,t){return r.vec3.dot(e,t)/r.vec3.length(e)},t.angle=function(e,t){var a=r.vec3.dot(e,t)/(r.vec3.length(e)*r.vec3.length(t));return-n.acosClamped(a)},t.angleAroundAxis=function(e,t,a){r.vec3.normalize(i,e),r.vec3.normalize(o,t);var s=r.vec3.dot(i,o),c=n.acosClamped(s),l=r.vec3.cross(i,i,o);return r.vec3.dot(l,a)<0?2*Math.PI-c:c};var i=a.vec3f64.create(),o=a.vec3f64.create()}).apply(null,r))||(e.exports=a)},"1f+t":function(e,t,n){var r,a;r=[n.dj.c(e.i),t],void 0===(a=(function(e,t){function n(e,t,n){for(var r=0;r<n;++r)t[2*r]=e[r],t[2*r+1]=e[r]-t[2*r]}Object.defineProperty(t,"__esModule",{value:!0}),t.encodeDouble=function(e,t){a[0]=e,a[1]=e-a[0],t[0]=a[0],t[1]=a[1]},t.encodeDoubleArray=n,t.decodeDoubleArray=function(e,t,n){for(var r=0;r<n;++r)t[r]=e[2*r]+e[2*r+1]},t.encodeDoubleArraySplit=function(e,t,i,o){for(var s=0;s<o;++s)r[0]=e[s],n(r,a,1),t[s]=a[0],i[s]=a[1]};var r=new Float64Array(1),a=new Float32Array(2)}).apply(null,r))||(e.exports=a)},"1m5D":function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("CIzB")],void 0===(a=(function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.mat4f64=n}).apply(null,r))||(e.exports=a)},"2eYJ":function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("pcDC"),n("qsST"),n("xoE+"),n("PHan"),n("FXVB"),n("1m5D"),n("0LE5"),n("Rdxj"),n("AzkI"),n("JjCO"),n("N5NQ"),n("GG08"),n("4p4v"),n("18xY")],void 0===(a=(function(e,t,n,r,a,i,o,s,c,l,d,u,f,v,p,h){Object.defineProperty(t,"__esModule",{value:!0});var m=r.getLogger("esri.views.3d.support.geometryUtils.boundedPlane");function g(e){return void 0===e&&(e=t.UP),{plane:v.create(e.plane),origin:l.vec3f64.clone(e.origin),basis1:l.vec3f64.clone(e.basis1),basis2:l.vec3f64.clone(e.basis2)}}function y(e,t){return void 0===t&&(t=g()),b(e.origin,e.basis1,e.basis2,t)}function b(e,t,n,r){return void 0===r&&(r=g()),c.vec3.copy(r.origin,e),c.vec3.copy(r.basis1,t),c.vec3.copy(r.basis2,n),x(r),function(e,t){Math.abs(c.vec3.dot(e.basis1,e.basis2)/(c.vec3.length(e.basis1)*c.vec3.length(e.basis2)))>1e-6&&m.warn(t,"Provided basis vectors are not perpendicular"),Math.abs(c.vec3.dot(e.basis1,z(e)))>1e-6&&m.warn(t,"Basis vectors and plane normal are not perpendicular"),Math.abs(-c.vec3.dot(z(e),e.origin)-e.plane[3])>1e-6&&m.warn(t,"Plane offset is not consistent with plane origin")}(r,"fromValues()"),r}function x(e){v.fromVectorsAndPoint(e.basis2,e.basis1,e.origin,e.plane)}function w(e,t,n){e!==n&&y(e,n);var r=c.vec3.scale(u.sv3d.get(),z(e),t);return c.vec3.add(n.origin,n.origin,r),n.plane[3]-=t,n}function _(e,t){void 0===t&&(t=g());var n=(e[2]-e[0])/2,r=(e[3]-e[1])/2;return c.vec3.set(t.origin,e[0]+n,e[1]+r,0),c.vec3.set(t.basis1,n,0,0),c.vec3.set(t.basis2,0,r,0),v.fromValues(0,0,1,0,t.plane),t}function S(e,t,n){return!!v.intersectRay(e.plane,t,n)&&I(e,n)}function P(e,t,n){var r=F.get();V(e,t,r,F.get());for(var i=Number.POSITIVE_INFINITY,o=0,s=k;o<s.length;o++){var l=j(e,s[o],N.get()),f=u.sv3d.get();if(v.intersectLineSegment(r,l,f)){var p=d.directionFromTo(u.sv3d.get(),t.origin,f),h=Math.abs(a.acosClamped(c.vec3.dot(t.direction,p)));h<i&&(i=h,c.vec3.copy(n,f))}}return i===Number.POSITIVE_INFINITY?O(e,t,n):n}function O(e,t,n){if(S(e,t,n))return n;var r=F.get(),a=F.get();V(e,t,r,a);for(var i=Number.POSITIVE_INFINITY,o=0,s=k;o<s.length;o++){var l=j(e,s[o],N.get()),d=u.sv3d.get();if(v.intersectLineSegmentClamp(r,l,d)){var f=p.distance2(t,d);if(!v.isPointInside(a,d))continue;f<i&&(i=f,c.vec3.copy(n,d))}}return C(e,t.origin)<i&&M(e,t.origin,n),n}function M(e,t,n){var r=v.projectPoint(e.plane,t,u.sv3d.get()),a=f.projectPointClamp(D(e,e.basis1),r,-1,1,u.sv3d.get()),i=f.projectPointClamp(D(e,e.basis2),r,-1,1,u.sv3d.get());return c.vec3.subtract(n,c.vec3.add(u.sv3d.get(),a,i),e.origin),n}function A(e,t,n){var r=e.origin,a=e.basis1,i=e.basis2,o=c.vec3.subtract(u.sv3d.get(),t,r),s=h.projectPointSignedLength(a,o),l=h.projectPointSignedLength(i,o),d=h.projectPointSignedLength(z(e),o);return c.vec3.set(n,s,l,d)}function C(e,t){var n=A(e,t,u.sv3d.get()),r=e.basis2,a=c.vec3.length(e.basis1),i=c.vec3.length(r),o=Math.max(Math.abs(n[0])-a,0),s=Math.max(Math.abs(n[1])-i,0),l=n[2];return o*o+s*s+l*l}function T(e,t){var n=-e.plane[3];return h.projectPointSignedLength(z(e),t)-n}function z(e){return v.normal(e.plane)}function I(e,t){var n=c.vec3.subtract(u.sv3d.get(),t,e.origin),r=c.vec3.squaredLength(e.basis1),a=c.vec3.squaredLength(e.basis2),i=c.vec3.dot(e.basis1,n),o=c.vec3.dot(e.basis2,n);return-i-r<0&&i-r<0&&-o-a<0&&o-a<0}function D(e,t){var n=N.get();return c.vec3.copy(n.origin,e.origin),c.vec3.copy(n.vector,t),n}function j(e,t,n){var r=e.basis1,a=e.basis2,i=e.origin,o=c.vec3.scale(u.sv3d.get(),r,t.origin[0]),s=c.vec3.scale(u.sv3d.get(),a,t.origin[1]);c.vec3.add(n.origin,o,s),c.vec3.add(n.origin,n.origin,i);var l=c.vec3.scale(u.sv3d.get(),r,t.direction[0]),d=c.vec3.scale(u.sv3d.get(),a,t.direction[1]);return c.vec3.scale(n.vector,c.vec3.add(l,l,d),2),n}function V(e,t,n,r){var a=z(e);v.fromVectorsAndPoint(a,t.direction,t.origin,n),v.fromVectorsAndPoint(v.normal(n),a,t.origin,r)}t.BoundedPlaneClass=function(){this.plane=v.create(),this.origin=l.vec3f64.create(),this.basis1=l.vec3f64.create(),this.basis2=l.vec3f64.create()},t.create=g,t.wrap=function(e,t,n){var r=L.get();return r.origin=e,r.basis1=t,r.basis2=n,r.plane=v.wrap(0,0,0,0),x(r),r},t.copy=y,t.fromValues=b,t.updateUnboundedPlane=x,t.elevate=w,t.setExtent=function(e,t,n){return _(t,n),w(n,T(e,e.origin),n),n},t.fromAABoundingRect=_,t.intersectRay=S,t.intersectRayClosestSilhouette=function(e,t,n){if(S(e,t,n))return n;var r=P(e,t,u.sv3d.get());return c.vec3.add(n,t.origin,c.vec3.scale(u.sv3d.get(),t.direction,c.vec3.distance(t.origin,r)/c.vec3.length(t.direction))),n},t.closestPointOnSilhouette=P,t.closestPoint=O,t.projectPoint=M,t.projectPointLocal=A,t.distance2=C,t.distance=function(e,t){return Math.sqrt(C(e,t))},t.distanceToSilhouette=function(e,t){for(var n=Number.NEGATIVE_INFINITY,r=0,a=k;r<a.length;r++){var i=j(e,a[r],N.get()),o=f.distance2(i,t);o>n&&(n=o)}return Math.sqrt(n)},t.extrusionContainsPoint=function(e,t){return v.isPointInside(e.plane,t)&&I(e,t)},t.axisAt=function(e,t,r,a){return function(e,t,r){switch(t){case 0:c.vec3.copy(r,e.basis1),c.vec3.normalize(r,r);break;case 1:c.vec3.copy(r,e.basis2),c.vec3.normalize(r,r);break;case 2:c.vec3.copy(r,z(e));break;default:n.neverReached(t)}return r}(e,r,a)},t.altitudeAt=T,t.setAltitudeAt=function(e,t,n,r){var a=T(e,t),i=c.vec3.scale(R,z(e),n-a);return c.vec3.add(r,t,i),r},t.equals=function(e,t){return c.vec3.equals(e.basis1,t.basis1)&&c.vec3.equals(e.basis2,t.basis2)&&c.vec3.equals(e.origin,t.origin)},t.transform=function(e,t,n){return e!==n&&y(e,n),o.mat4.invert(U,t),o.mat4.transpose(U,U),c.vec3.transformMat4(n.basis1,e.basis1,U),c.vec3.transformMat4(n.basis2,e.basis2,U),c.vec3.transformMat4(n.plane,e.plane,U),c.vec3.transformMat4(n.origin,e.origin,t),v.setOffsetFromPoint(n.plane,n.origin,n.plane),n},t.rotate=function(e,t,n,r){return e!==r&&y(e,r),o.mat4.rotate(E,o.mat4.identity(E),t,n),c.vec3.transformMat4(r.basis1,e.basis1,E),c.vec3.transformMat4(r.basis2,e.basis2,E),x(r),r},t.normal=z,t.UP={plane:v.create(),origin:l.vec3f64.fromValues(0,0,0),basis1:l.vec3f64.fromValues(1,0,0),basis2:l.vec3f64.fromValues(0,1,0)};var F=new i.ObjectStack(v.create),N=new i.ObjectStack(f.create),R=l.vec3f64.create(),L=new i.ObjectStack((function(){return{origin:null,basis1:null,basis2:null,plane:null}})),k=[{origin:[-1,-1],direction:[1,0]},{origin:[1,-1],direction:[0,1]},{origin:[1,1],direction:[-1,0]},{origin:[-1,1],direction:[0,-1]}],U=s.mat4f64.create(),E=s.mat4f64.create()}).apply(null,r))||(e.exports=a)},"2o+p":function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("zOht"),n("7Aei"),n("s6rJ")],void 0===(a=(function(e,t,n,r,a){function i(e){e.vertex.code.add(r.glsl(o||(o=n.__makeTemplateObject(["\n    float screenSizePerspectiveMinSize(float size, vec4 factor) {\n      float nonZeroSize = 1.0 - step(size, 0.0);\n\n      return (\n        factor.z * (\n          1.0 +\n          // Multiply by nzs ensures if size is 0, then we ignore proportionally scaled padding\n          nonZeroSize *\n          2.0 * factor.w / (\n            size + (1.0 - nonZeroSize) // Adding 1 - nzs ensures we divide either by size, or by 1\n          )\n        )\n      );\n    }\n  "],["\n    float screenSizePerspectiveMinSize(float size, vec4 factor) {\n      float nonZeroSize = 1.0 - step(size, 0.0);\n\n      return (\n        factor.z * (\n          1.0 +\n          // Multiply by nzs ensures if size is 0, then we ignore proportionally scaled padding\n          nonZeroSize *\n          2.0 * factor.w / (\n            size + (1.0 - nonZeroSize) // Adding 1 - nzs ensures we divide either by size, or by 1\n          )\n        )\n      );\n    }\n  "])))),e.vertex.code.add(r.glsl(s||(s=n.__makeTemplateObject(["\n    float screenSizePerspectiveViewAngleDependentFactor(float absCosAngle) {\n      return absCosAngle * absCosAngle * absCosAngle;\n    }\n  "],["\n    float screenSizePerspectiveViewAngleDependentFactor(float absCosAngle) {\n      return absCosAngle * absCosAngle * absCosAngle;\n    }\n  "])))),e.vertex.code.add(r.glsl(c||(c=n.__makeTemplateObject(["\n    vec4 screenSizePerspectiveScaleFactor(float absCosAngle, float distanceToCamera, vec4 params) {\n      return vec4(\n        min(params.x / (distanceToCamera - params.y), 1.0),\n        screenSizePerspectiveViewAngleDependentFactor(absCosAngle),\n        params.z,\n        params.w\n      );\n    }\n  "],["\n    vec4 screenSizePerspectiveScaleFactor(float absCosAngle, float distanceToCamera, vec4 params) {\n      return vec4(\n        min(params.x / (distanceToCamera - params.y), 1.0),\n        screenSizePerspectiveViewAngleDependentFactor(absCosAngle),\n        params.z,\n        params.w\n      );\n    }\n  "])))),e.vertex.code.add(r.glsl(l||(l=n.__makeTemplateObject(["\n    float applyScreenSizePerspectiveScaleFactorFloat(float size, vec4 factor) {\n      return max(mix(size * factor.x, size, factor.y), screenSizePerspectiveMinSize(size, factor));\n    }\n  "],["\n    float applyScreenSizePerspectiveScaleFactorFloat(float size, vec4 factor) {\n      return max(mix(size * factor.x, size, factor.y), screenSizePerspectiveMinSize(size, factor));\n    }\n  "])))),e.vertex.code.add(r.glsl(d||(d=n.__makeTemplateObject(["\n    float screenSizePerspectiveScaleFloat(float size, float absCosAngle, float distanceToCamera, vec4 params) {\n      return applyScreenSizePerspectiveScaleFactorFloat(\n        size,\n        screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params)\n      );\n    }\n  "],["\n    float screenSizePerspectiveScaleFloat(float size, float absCosAngle, float distanceToCamera, vec4 params) {\n      return applyScreenSizePerspectiveScaleFactorFloat(\n        size,\n        screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params)\n      );\n    }\n  "])))),e.vertex.code.add(r.glsl(u||(u=n.__makeTemplateObject(["\n    vec2 applyScreenSizePerspectiveScaleFactorVec2(vec2 size, vec4 factor) {\n      return mix(size * clamp(factor.x, screenSizePerspectiveMinSize(size.y, factor) / size.y, 1.0), size, factor.y);\n    }\n  "],["\n    vec2 applyScreenSizePerspectiveScaleFactorVec2(vec2 size, vec4 factor) {\n      return mix(size * clamp(factor.x, screenSizePerspectiveMinSize(size.y, factor) / size.y, 1.0), size, factor.y);\n    }\n  "])))),e.vertex.code.add(r.glsl(f||(f=n.__makeTemplateObject(["\n    vec2 screenSizePerspectiveScaleVec2(vec2 size, float absCosAngle, float distanceToCamera, vec4 params) {\n      return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params));\n    }\n  "],["\n    vec2 screenSizePerspectiveScaleVec2(vec2 size, float absCosAngle, float distanceToCamera, vec4 params) {\n      return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params));\n    }\n  "]))))}var o,s,c,l,d,u,f;Object.defineProperty(t,"__esModule",{value:!0}),t.ScreenSizePerspective=i,function(e){e.bindUniforms=function(e,t){t.screenSizePerspective&&(a.bindScreenSizePerspective(t.screenSizePerspective,e,"screenSizePerspective"),a.bindScreenSizePerspective(t.screenSizePerspectiveAlignment||t.screenSizePerspective,e,"screenSizePerspectiveAlignment"))}}(i=t.ScreenSizePerspective||(t.ScreenSizePerspective={}))}).apply(null,r))||(e.exports=a)},"3PFg":function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("zOht"),n("7Aei")],void 0===(a=(function(e,t,n,r){function a(e,t){t.vvInstancingEnabled&&(t.vvSize||t.vvColor)&&e.attributes.add("instanceFeatureAttribute","vec4"),t.vvSize?(e.vertex.uniforms.add("vvSizeMinSize","vec3"),e.vertex.uniforms.add("vvSizeMaxSize","vec3"),e.vertex.uniforms.add("vvSizeOffset","vec3"),e.vertex.uniforms.add("vvSizeFactor","vec3"),e.vertex.uniforms.add("vvSymbolRotationMatrix","mat3"),e.vertex.uniforms.add("vvSymbolAnchor","vec3"),e.vertex.code.add(r.glsl(i||(i=n.__makeTemplateObject(["\n      vec3 vvScale(vec4 _featureAttribute) {\n        return clamp(vvSizeOffset + _featureAttribute.x * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize);\n      }\n\n      vec4 vvTransformPosition(vec3 position, vec4 _featureAttribute) {\n        return vec4(vvSymbolRotationMatrix * ( vvScale(_featureAttribute) * (position + vvSymbolAnchor)), 1.0);\n      }\n    "],["\n      vec3 vvScale(vec4 _featureAttribute) {\n        return clamp(vvSizeOffset + _featureAttribute.x * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize);\n      }\n\n      vec4 vvTransformPosition(vec3 position, vec4 _featureAttribute) {\n        return vec4(vvSymbolRotationMatrix * ( vvScale(_featureAttribute) * (position + vvSymbolAnchor)), 1.0);\n      }\n    "])))),e.vertex.code.add(r.glsl(s||(s=n.__makeTemplateObject(["\n      const float eps = 1.192092896e-07;\n      vec4 vvTransformNormal(vec3 _normal, vec4 _featureAttribute) {\n        vec3 vvScale = clamp(vvSizeOffset + _featureAttribute.x * vvSizeFactor, vvSizeMinSize + eps, vvSizeMaxSize);\n        return vec4(vvSymbolRotationMatrix * _normal / vvScale, 1.0);\n      }\n\n      ","\n    "],["\n      const float eps = 1.192092896e-07;\n      vec4 vvTransformNormal(vec3 _normal, vec4 _featureAttribute) {\n        vec3 vvScale = clamp(vvSizeOffset + _featureAttribute.x * vvSizeFactor, vvSizeMinSize + eps, vvSizeMaxSize);\n        return vec4(vvSymbolRotationMatrix * _normal / vvScale, 1.0);\n      }\n\n      ","\n    "])),t.vvInstancingEnabled?r.glsl(o||(o=n.__makeTemplateObject(["\n      vec4 vvLocalNormal(vec3 _normal) {\n        return vvTransformNormal(_normal, instanceFeatureAttribute);\n      }\n\n      vec4 localPosition() {\n        return vvTransformPosition(position, instanceFeatureAttribute);\n      }"],["\n      vec4 vvLocalNormal(vec3 _normal) {\n        return vvTransformNormal(_normal, instanceFeatureAttribute);\n      }\n\n      vec4 localPosition() {\n        return vvTransformPosition(position, instanceFeatureAttribute);\n      }"]))):""))):e.vertex.code.add(r.glsl(c||(c=n.__makeTemplateObject(["\n      vec4 localPosition() { return vec4(position, 1.0); }\n\n      vec4 vvLocalNormal(vec3 _normal) { return vec4(_normal, 1.0); }\n    "],["\n      vec4 localPosition() { return vec4(position, 1.0); }\n\n      vec4 vvLocalNormal(vec3 _normal) { return vec4(_normal, 1.0); }\n    "])))),t.vvColor?(e.vertex.defines.addInt("VV_COLOR_N",8),e.vertex.code.add(r.glsl(d||(d=n.__makeTemplateObject(["\n      uniform float vvColorValues[VV_COLOR_N];\n      uniform vec4 vvColorColors[VV_COLOR_N];\n\n      vec4 vvGetColor(vec4 featureAttribute, float values[VV_COLOR_N], vec4 colors[VV_COLOR_N]) {\n        float value = featureAttribute.y;\n        if (value <= values[0]) {\n          return colors[0];\n        }\n\n        for (int i = 1; i < VV_COLOR_N; ++i) {\n          if (values[i] >= value) {\n            float f = (value - values[i-1]) / (values[i] - values[i-1]);\n            return mix(colors[i-1], colors[i], f);\n          }\n        }\n        return colors[VV_COLOR_N - 1];\n      }\n\n      ","\n    "],["\n      uniform float vvColorValues[VV_COLOR_N];\n      uniform vec4 vvColorColors[VV_COLOR_N];\n\n      vec4 vvGetColor(vec4 featureAttribute, float values[VV_COLOR_N], vec4 colors[VV_COLOR_N]) {\n        float value = featureAttribute.y;\n        if (value <= values[0]) {\n          return colors[0];\n        }\n\n        for (int i = 1; i < VV_COLOR_N; ++i) {\n          if (values[i] >= value) {\n            float f = (value - values[i-1]) / (values[i] - values[i-1]);\n            return mix(colors[i-1], colors[i], f);\n          }\n        }\n        return colors[VV_COLOR_N - 1];\n      }\n\n      ","\n    "])),t.vvInstancingEnabled?r.glsl(l||(l=n.__makeTemplateObject(["\n      vec4 vvColor() {\n        return vvGetColor(instanceFeatureAttribute, vvColorValues, vvColorColors);\n      }"],["\n      vec4 vvColor() {\n        return vvGetColor(instanceFeatureAttribute, vvColorValues, vvColorColors);\n      }"]))):""))):e.vertex.code.add(r.glsl(u||(u=n.__makeTemplateObject(["\n      vec4 vvColor() { return vec4(1.0); }\n    "],["\n      vec4 vvColor() { return vec4(1.0); }\n    "]))))}var i,o,s,c,l,d,u;Object.defineProperty(t,"__esModule",{value:!0}),t.VisualVariables=a,function(e){function t(e,t){t.vvSizeEnabled&&(e.setUniform3fv("vvSizeMinSize",t.vvSizeMinSize),e.setUniform3fv("vvSizeMaxSize",t.vvSizeMaxSize),e.setUniform3fv("vvSizeOffset",t.vvSizeOffset),e.setUniform3fv("vvSizeFactor",t.vvSizeFactor)),t.vvColorEnabled&&(e.setUniform1fv("vvColorValues",t.vvColorValues),e.setUniform4fv("vvColorColors",t.vvColorColors))}e.bindUniforms=t,e.bindUniformsWithOpacity=function(e,n){t(e,n),n.vvOpacityEnabled&&(e.setUniform1fv("vvOpacityValues",n.vvOpacityValues),e.setUniform1fv("vvOpacityOpacities",n.vvOpacityOpacities))},e.bindUniformsForSymbols=function(e,n){t(e,n),n.vvSizeEnabled&&(e.setUniform3fv("vvSymbolAnchor",n.vvSymbolAnchor),e.setUniformMatrix3fv("vvSymbolRotationMatrix",n.vvSymbolRotationMatrix))}}(a=t.VisualVariables||(t.VisualVariables={}))}).apply(null,r))||(e.exports=a)},"3RHn":function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("KBgh"),n("0LE5"),n("Rdxj"),n("CIy2")],void 0===(a=(function(e,t,n,r,a,i){var o=function(){function e(t,n,o,s){this.primitiveIndices=t,this._numIndexPerPrimitive=n,this.indices=o,this._position=s,this.center=a.vec3f64.create(),i.assert(t.length>=1),i.assert(o.length%this._numIndexPerPrimitive==0),i.assert(o.length>=t.length*this._numIndexPerPrimitive),i.assert(3===this._position.size||4===this._position.size);var c=this._position,l=c.data,d=c.offsetIdx,u=c.strideIdx,f=0,v=t.length,p=d+u*o[this._numIndexPerPrimitive*t[f]];for(e.tmpIndices.clear(),e.tmpIndices.push(p),this.bbMin=a.vec3f64.fromValues(l[p],l[p+1],l[p+2]),this.bbMax=a.vec3f64.clone(this.bbMin);f<v;++f)for(var h=this._numIndexPerPrimitive*t[f],m=0;m<this._numIndexPerPrimitive;++m){e.tmpIndices.push(p=d+u*o[h+m]);var g=l[p];this.bbMin[0]=Math.min(g,this.bbMin[0]),this.bbMax[0]=Math.max(g,this.bbMax[0]),g=l[p+1],this.bbMin[1]=Math.min(g,this.bbMin[1]),this.bbMax[1]=Math.max(g,this.bbMax[1]),g=l[p+2],this.bbMin[2]=Math.min(g,this.bbMin[2]),this.bbMax[2]=Math.max(g,this.bbMax[2])}r.vec3.lerp(this.center,this.bbMin,this.bbMax,.5),this.bsRadius=.5*Math.max(Math.max(this.bbMax[0]-this.bbMin[0],this.bbMax[1]-this.bbMin[1]),this.bbMax[2]-this.bbMin[2]);var y=this.bsRadius*this.bsRadius;for(f=0;f<e.tmpIndices.length;++f){var b=l[p=e.tmpIndices.data[f]]-this.center[0],x=l[p+1]-this.center[1],w=l[p+2]-this.center[2],_=b*b+x*x+w*w;if(!(_<=y)){var S=Math.sqrt(_),P=.5*(S-this.bsRadius);this.bsRadius=this.bsRadius+P,y=this.bsRadius*this.bsRadius;var O=P/S;this.center[0]+=b*O,this.center[1]+=x*O,this.center[2]+=w*O}}e.tmpIndices.clear()}return e.prototype.getCenter=function(){return this.center},e.prototype.getBSRadius=function(){return this.bsRadius},e.prototype.getBBMin=function(){return this.bbMin},e.prototype.getBBMax=function(){return this.bbMax},e.prototype.getPrimitiveIndices=function(){return this.primitiveIndices},e.prototype.getIndices=function(){return this.indices},e.prototype.getPosition=function(){return this._position},e.prototype.getChildren=function(){if(this._children)return this._children;if(r.vec3.squaredDistance(this.bbMin,this.bbMax)>1){for(var t=r.vec3.lerp(a.vec3f64.create(),this.bbMin,this.bbMax,.5),n=this.primitiveIndices.length,i=new Uint8Array(n),o=new Array(8),s=0;s<8;++s)o[s]=0;var c=this._position,l=c.data,d=c.offsetIdx,u=c.strideIdx;for(s=0;s<n;++s){for(var f=0,v=this._numIndexPerPrimitive*this.primitiveIndices[s],p=d+u*this.indices[v],h=l[p],m=l[p+1],g=l[p+2],y=1;y<this._numIndexPerPrimitive;++y){var b=l[p=d+u*this.indices[v+y]],x=l[p+1],w=l[p+2];b<h&&(h=b),x<m&&(m=x),w<g&&(g=w)}h<t[0]&&(f|=1),m<t[1]&&(f|=2),g<t[2]&&(f|=4),i[s]=f,++o[f]}var _=0;for(s=0;s<8;++s)o[s]>0&&++_;if(_<2)return;var S=new Array(8);for(s=0;s<8;++s)S[s]=o[s]>0?new Uint32Array(o[s]):void 0;for(s=0;s<8;++s)o[s]=0;for(s=0;s<n;++s)S[f=i[s]][o[f]++]=this.primitiveIndices[s];for(this._children=new Array(8),s=0;s<8;++s)void 0!==S[s]&&(this._children[s]=new e(S[s],this._numIndexPerPrimitive,this.indices,this._position))}return this._children},e}();return function(e){e.tmpIndices=new n({deallocator:null})}(o||(o={})),o}).apply(null,r))||(e.exports=a)},"3kdR":function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("zOht"),n("FXVB"),n("oZZu"),n("7Aei")],void 0===(a=(function(e,t,n,r,a,i){function o(e,t){e.vertex.code.add(i.glsl(t.linearDepth?s||(s=n.__makeTemplateObject(["\n    vec4 transformPositionWithDepth(mat4 proj, mat4 view, vec3 pos, vec2 nearFar, out float depth) {\n      vec4 eye = view * vec4(pos, 1.0);\n      depth = (-eye.z - nearFar[0]) / (nearFar[1] - nearFar[0]) ;\n      return proj * eye;\n    }\n    "],["\n    vec4 transformPositionWithDepth(mat4 proj, mat4 view, vec3 pos, vec2 nearFar, out float depth) {\n      vec4 eye = view * vec4(pos, 1.0);\n      depth = (-eye.z - nearFar[0]) / (nearFar[1] - nearFar[0]) ;\n      return proj * eye;\n    }\n    "])):c||(c=n.__makeTemplateObject(["\n    vec4 transformPosition(mat4 proj, mat4 view, vec3 pos) {\n      // Make sure the order of operations is the same as in transformPositionWithDepth.\n      return proj * (view * vec4(pos, 1.0));\n    }\n    "],["\n    vec4 transformPosition(mat4 proj, mat4 view, vec3 pos) {\n      // Make sure the order of operations is the same as in transformPositionWithDepth.\n      return proj * (view * vec4(pos, 1.0));\n    }\n    "]))))}Object.defineProperty(t,"__esModule",{value:!0}),t.Transform=o,function(e){function t(e,t,n){r.mat4.translate(l,n,t),e.setUniform3fv("localOrigin",t),e.setUniformMatrix4fv("view",l)}e.bindUniformsCustomOrigin=t,e.bindUniforms=function(e,n){t(e,n.origin,n.view)}}(o=t.Transform||(t.Transform={}));var s,c,l=a.mat4f32.create()}).apply(null,r))||(e.exports=a)},"4p4v":function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("PHan"),n("jBNx"),n("W9tT"),n("0LE5"),n("Rdxj"),n("JjCO")],void 0===(a=(function(e,t,n,r,a,i,o,s){function c(e){return e?{origin:o.vec3f64.clone(e.origin),direction:o.vec3f64.clone(e.direction)}:{origin:o.vec3f64.create(),direction:o.vec3f64.create()}}function l(e,t,n){return void 0===n&&(n=c()),i.vec3.copy(n.origin,e),i.vec3.copy(n.direction,t),n}function d(e,t,n){void 0===n&&(n=c());var o=r.castRenderScreenPointArray3(a.vec2.copy(s.sv3d.get(),t));o[2]=0,e.unprojectPoint(o,n.origin);var l=r.castRenderScreenPointArray3(a.vec2.copy(s.sv3d.get(),t));l[2]=1;var d=e.unprojectPoint(l,s.sv3d.get());return i.vec3.subtract(n.direction,d,n.origin),n}function u(e,t,n){void 0===n&&(n=c()),i.vec3.copy(n.origin,e.eye);var r=i.vec3.set(s.sv3d.get(),t[0],t[1],1),a=e.unprojectPoint(r,s.sv3d.get());return i.vec3.subtract(n.direction,a,n.origin),n}function f(e,t){var n=i.vec3.cross(s.sv3d.get(),i.vec3.normalize(s.sv3d.get(),e.direction),i.vec3.subtract(s.sv3d.get(),t,e.origin));return i.vec3.dot(n,n)}function v(){return{origin:null,direction:null}}Object.defineProperty(t,"__esModule",{value:!0}),t.create=c,t.wrap=function(e,t){var n=p.get();return n.origin=e,n.direction=t,n},t.copy=function(e,t){return void 0===t&&(t=c()),l(e.origin,e.direction,t)},t.fromPoints=function(e,t,n){return void 0===n&&(n=c()),i.vec3.copy(n.origin,e),i.vec3.subtract(n.direction,t,e),n},t.fromValues=l,t.fromScreen=function(e,t,n){return void 0===n&&(n=c()),d(e,e.screenToRender(t,r.castRenderScreenPointArray3(s.sv3d.get())),n)},t.fromRender=d,t.fromScreenAtEye=function(e,t,n){return void 0===n&&(n=c()),u(e,e.screenToRender(t,r.castRenderScreenPointArray3(s.sv3d.get())),n)},t.fromRenderAtEye=u,t.distance2=f,t.distance=function(e,t){return Math.sqrt(f(e,t))},t.closestPoint=function(e,t,n){var r=i.vec3.dot(e.direction,i.vec3.subtract(n,t,e.origin));return i.vec3.add(n,e.origin,i.vec3.scale(n,e.direction,r)),n},t.createWrapper=v;var p=new n.ObjectStack(v)}).apply(null,r))||(e.exports=a)},"4ziW":function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("0LE5"),n("vlC2"),n("Rdxj"),n("aWgr"),n("83/a"),n("AgDx"),n("CIy2")],void 0===(a=(function(e,t,n,r,a,i,o,s,c){var l,d,u,f,v=o.Vec3Compact;!function(e){for(var t=.5,n=[[-t,-t,t],[t,-t,t],[t,t,t],[-t,t,t],[-t,-t,-t],[t,-t,-t],[t,t,-t],[-t,t,-t]],r=[0,0,1,-1,0,0,1,0,0,0,-1,0,0,1,0,0,0,-1],a=[0,0,1,0,1,1,0,1],i=[0,1,2,2,3,0,4,0,3,3,7,4,1,5,6,6,2,1,1,0,4,4,5,1,3,2,6,6,7,3,5,4,7,7,6,5],o=new Array(36),l=0;l<6;l++)for(var d=0;d<6;d++)o[6*l+d]=l;var u=new Array(36);for(l=0;l<6;l++)u[6*l+0]=0,u[6*l+1]=1,u[6*l+2]=2,u[6*l+3]=2,u[6*l+4]=3,u[6*l+5]=0;e.createGeometry=function(e){Array.isArray(e)||(e=[e,e,e]);for(var t=new Float32Array(24),l=0;l<8;l++)t[3*l]=n[l][0]*e[0],t[3*l+1]=n[l][1]*e[1],t[3*l+2]=n[l][2]*e[2];var d={};d[c.VertexAttrConstants.POSITION]=new Uint32Array(i),d[c.VertexAttrConstants.NORMAL]=new Uint32Array(o),d[c.VertexAttrConstants.UV0]=new Uint32Array(u);var f={};return f[c.VertexAttrConstants.POSITION]={size:3,data:t},f[c.VertexAttrConstants.NORMAL]={size:3,data:new Float32Array(r)},f[c.VertexAttrConstants.UV0]={size:2,data:new Float32Array(a)},new s.GeometryData(f,d)}}(l||(l={})),function(e){var t=.5,n=[[-t,0,-t],[t,0,-t],[t,0,t],[-t,0,t],[0,-t,0],[0,t,0]],r=[0,1,-1,1,1,0,0,1,1,-1,1,0,0,-1,-1,1,-1,0,0,-1,1,-1,-1,0],a=[5,1,0,5,2,1,5,3,2,5,0,3,4,0,1,4,1,2,4,2,3,4,3,0],i=[0,0,0,1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,6,6,6,7,7,7];e.createGeometry=function(e){Array.isArray(e)||(e=[e,e,e]);for(var t=new Float32Array(18),o=0;o<6;o++)t[3*o]=n[o][0]*e[0],t[3*o+1]=n[o][1]*e[1],t[3*o+2]=n[o][2]*e[2];var l={};l[c.VertexAttrConstants.POSITION]=new Uint32Array(a),l[c.VertexAttrConstants.NORMAL]=new Uint32Array(i);var d={};return d[c.VertexAttrConstants.POSITION]={size:3,data:t},d[c.VertexAttrConstants.NORMAL]={size:3,data:new Float32Array(r)},new s.GeometryData(d,l)}}(d||(d={})),function(e){var t=.5,a=r.vec3f32.fromValues(-t,0,-t),i=r.vec3f32.fromValues(t,0,-t),o=r.vec3f32.fromValues(0,0,t),l=r.vec3f32.fromValues(0,.5,0),d=r.vec3f32.create(),u=r.vec3f32.create(),f=r.vec3f32.create(),v=r.vec3f32.create(),p=r.vec3f32.create();n.vec3.subtract(d,a,l),n.vec3.subtract(u,a,i),n.vec3.cross(f,d,u),n.vec3.normalize(f,f),n.vec3.subtract(d,i,l),n.vec3.subtract(u,i,o),n.vec3.cross(v,d,u),n.vec3.normalize(v,v),n.vec3.subtract(d,o,l),n.vec3.subtract(u,o,a),n.vec3.cross(p,d,u),n.vec3.normalize(p,p);var h=[a,i,o,l],m=[0,-1,0,f[0],f[1],f[2],v[0],v[1],v[2],p[0],p[1],p[2]],g=[0,1,2,3,1,0,3,2,1,3,0,2],y=[0,0,0,1,1,1,2,2,2,3,3,3];e.createGeometry=function(e){Array.isArray(e)||(e=[e,e,e]);for(var t=new Float32Array(12),n=0;n<4;n++)t[3*n]=h[n][0]*e[0],t[3*n+1]=h[n][1]*e[1],t[3*n+2]=h[n][2]*e[2];var r={};r[c.VertexAttrConstants.POSITION]=new Uint32Array(g),r[c.VertexAttrConstants.NORMAL]=new Uint32Array(y);var a={};return a[c.VertexAttrConstants.POSITION]={size:3,data:t},a[c.VertexAttrConstants.NORMAL]={size:3,data:new Float32Array(m)},new s.GeometryData(a,r)}}(u||(u={})),function(e){e.createBoxGeometry=l.createGeometry,e.createDiamondGeometry=d.createGeometry,e.createTetrahedronGeometry=u.createGeometry,e.createSphereGeometry=function(e,t,n,r,a,i,o){e=e||50,r=void 0!==r?r:-Math.PI,a=void 0!==a?a:2*Math.PI,i=void 0!==i?i:.5*-Math.PI,o=void 0!==o?o:Math.PI;for(var l=Math.max(3,Math.floor(t)||8),d=Math.max(2,Math.floor(n)||6),u=(l+1)*(d+1),f=new Float32Array(3*u),v=new Float32Array(3*u),p=new Float32Array(2*u),h=[],m=0,g=0;g<=d;g++){for(var y=[],b=g/d,x=i+b*o,w=Math.cos(x),_=0;_<=l;_++){var S=_/l,P=r+S*a,O=Math.cos(P)*w,M=Math.sin(x),A=-Math.sin(P)*w;f[3*m]=O*e,f[3*m+1]=M*e,f[3*m+2]=A*e,v[3*m]=O,v[3*m+1]=M,v[3*m+2]=A,p[2*m]=S,p[2*m+1]=b,y.push(m),++m}h.push(y)}var C=new Uint32Array(2*l*(d-1)*3);for(m=0,g=0;g<d;g++)for(_=0;_<l;_++){var T=h[g][_],z=h[g][_+1],I=h[g+1][_+1],D=h[g+1][_];0===g?(C[m++]=T,C[m++]=I,C[m++]=D):g===d-1?(C[m++]=T,C[m++]=z,C[m++]=I):(C[m++]=T,C[m++]=z,C[m++]=I,C[m++]=I,C[m++]=D,C[m++]=T)}c.assert(m===C.length);var j={};j[c.VertexAttrConstants.POSITION]=C,j[c.VertexAttrConstants.NORMAL]=C,j[c.VertexAttrConstants.UV0]=C;var V={};return V[c.VertexAttrConstants.POSITION]={size:3,data:f},V[c.VertexAttrConstants.NORMAL]={size:3,data:v},V[c.VertexAttrConstants.UV0]={size:2,data:p},new s.GeometryData(V,j)},e.createPolySphereGeometry=function(e,t,n){var r,a,i=e;if(n)r=[0,-1,0,1,0,0,0,0,1,-1,0,0,0,0,-1,0,1,0],a=new Uint32Array([0,1,2,0,2,3,0,3,4,0,4,1,1,5,2,2,5,3,3,5,4,4,5,1]);else{var o=i*(1+Math.sqrt(5))/2;r=[-i,o,0,i,o,0,-i,-o,0,i,-o,0,0,-i,o,0,i,o,0,-i,-o,0,i,-o,o,0,-i,o,0,i,-o,0,-i,-o,0,i],a=new Uint32Array([0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1])}for(var l=0;l<r.length;l+=3)v.scale(r,l,e/v.length(r,l));var d={};function u(t,n){var a;t>n&&(t=(a=[n,t])[0],n=a[1]);var i=t.toString()+"."+n.toString();if(d[i])return d[i];var o=r.length;return r.length+=3,v.add(r,3*t,r,3*n,r,o),v.scale(r,o,e/v.length(r,o)),d[i]=o/=3,o}for(l=0;l<t;l++){for(var f=a.length,p=new Uint32Array(4*f),h=0;h<f;h+=3){var m=a[h],g=a[h+1],y=a[h+2],b=u(m,g),x=u(g,y),w=u(y,m),_=4*h;p[_]=m,p[_+1]=b,p[_+2]=w,p[_+3]=g,p[_+4]=x,p[_+5]=b,p[_+6]=y,p[_+7]=w,p[_+8]=x,p[_+9]=b,p[_+10]=x,p[_+11]=w}a=p,d={}}var S=new Float32Array(r);for(l=0;l<S.length;l+=3)v.normalize(S,l);var P={};P[c.VertexAttrConstants.POSITION]=a,P[c.VertexAttrConstants.NORMAL]=a;var O={};return O[c.VertexAttrConstants.POSITION]={size:3,data:new Float32Array(r)},O[c.VertexAttrConstants.NORMAL]={size:3,data:S},new s.GeometryData(O,P)},e.createPointGeometry=function(e,t,n,r,a,i,o,l){var d=t?new Float64Array([t[0],t[1],t[2]]):new Float32Array([0,0,0]),u=e?new Float32Array([e[0],e[1],e[2]]):new Float32Array([0,0,1]),f=i?new Float32Array(i):new Float32Array([0,0]),v=n?new Uint8Array([255*n[0],255*n[1],255*n[2],n.length>3?255*n[3]:255]):new Uint8Array([255,255,255,255]),p=null!=r&&2===r.length?new Float32Array(r):new Float32Array([1,1]),h={};if(h[c.VertexAttrConstants.POSITION]={size:3,data:d},h[c.VertexAttrConstants.NORMAL]={size:3,data:u},h[c.VertexAttrConstants.UV0]={size:f.length,data:f},h[c.VertexAttrConstants.COLOR]={size:4,data:v},h[c.VertexAttrConstants.SIZE]={size:2,data:p},null!=a){var m=new Float32Array([a[0],a[1],a[2],a[3]]);h[c.VertexAttrConstants.AUXPOS1]={size:4,data:m}}if(null!=o){var g=new Float32Array([o[0],o[1],o[2],o[3]]);h[c.VertexAttrConstants.AUXPOS2]={size:4,data:g}}return null!=l?(s.GeometryData.call(l,h,s.GeometryData.DefaultIndices,"point"),l):new s.GeometryData(h,s.GeometryData.DefaultIndices,"point")},e.updatePointGeometry=function(e,t,n,r,a,i,o,s){var l,d=s.vertexAttributes;return null!=e&&((l=d[c.VertexAttrConstants.NORMAL].data)[0]=e[0],l[1]=e[1],l[2]=e[2]),null!=t&&((l=d[c.VertexAttrConstants.POSITION].data)[0]=t[0],l[1]=t[1],l[2]=t[2]),null!=n&&((l=d[c.VertexAttrConstants.COLOR].data)[0]=n[0],l[1]=n[1],l[2]=n[2],l[3]=n[3]),null!=r&&((l=d[c.VertexAttrConstants.SIZE].data)[0]=r[0],l[1]=r[1]),null!=a&&((l=d[c.VertexAttrConstants.AUXPOS1].data)[0]=a[0],l[1]=a[1],l[2]=a[2],l[3]=a[3]),null!=i&&((l=d[c.VertexAttrConstants.UV0].data)[0]=i[0],l[1]=i[1]),null!=o&&((l=d[c.VertexAttrConstants.AUXPOS2].data)[0]=o[0],l[1]=o[1],l[2]=o[2],l[3]=o[3]),s},e.createPointArrayGeometry=function(e,t){for(var n=new Float32Array(3*e.length),r=new Float32Array(t?3*e.length:3),a=new Uint32Array(e.length),i=new Uint32Array(e.length),o=0;o<e.length;o++)n[3*o]=e[o][0],n[3*o+1]=e[o][1],n[3*o+2]=e[o][2],t&&(r[3*o]=t[o][0],r[3*o+1]=t[o][1],r[3*o+2]=t[o][2]),a[o]=o,i[o]=0;t||(r[0]=0,r[1]=1,r[2]=0);var l=new Float32Array(2);l[0]=0,l[1]=0;var d={};d[c.VertexAttrConstants.POSITION]=a,d[c.VertexAttrConstants.NORMAL]=t?a:i,d[c.VertexAttrConstants.UV0]=i;var u={};return u[c.VertexAttrConstants.POSITION]={size:3,data:n},u[c.VertexAttrConstants.NORMAL]={size:3,data:r},u[c.VertexAttrConstants.UV0]={size:2,data:l},new s.GeometryData(u,d,"point")},e.createTriangleGeometry=function(){var e=new Float32Array([0,0,0,0,0,100,100,0,0]),t=new Uint32Array([0,1,2]),n=new Float32Array([0,1,0]),r=new Uint32Array([0,0,0]),a=new Float32Array([0,0]),i=new Uint32Array([0,0,0]),o={};o[c.VertexAttrConstants.POSITION]=t,o[c.VertexAttrConstants.NORMAL]=r,o[c.VertexAttrConstants.UV0]=i;var l={};return l[c.VertexAttrConstants.POSITION]={size:3,data:e},l[c.VertexAttrConstants.NORMAL]={size:3,data:n},l[c.VertexAttrConstants.UV0]={size:2,data:a},new s.GeometryData(l,o)};var t=[[-1,-1,0],[1,-1,0],[1,1,0],[-1,1,0]];function f(e,t,r,a,i){return!(Math.abs(n.vec3.dot(t,e))>i||(n.vec3.cross(r,e,t),n.vec3.normalize(r,r),n.vec3.cross(a,r,e),n.vec3.normalize(a,a),0))}function g(e,t,n,r,a,i,o){return f(e,t,a,i,o)||f(e,n,a,i,o)||f(e,r,a,i,o)}e.createSquareGeometry=function(e){var n,r;void 0===e&&(e=t);for(var a=new Float64Array(12),i=0;i<4;i++)for(var o=0;o<3;o++)a[3*i+o]=e[i][o];var l=new Uint32Array([0,1,2,2,3,0]),d=new Float32Array([0,0,1]),u=new Uint32Array([0,0,0,0,0,0]),f=new Float32Array([0,0,1,0,1,1,0,1]),v=new Uint8Array([255,255,255,255]),p=((n={})[c.VertexAttrConstants.POSITION]=l,n[c.VertexAttrConstants.NORMAL]=u,n[c.VertexAttrConstants.UV0]=l,n[c.VertexAttrConstants.COLOR]=u,n),h=((r={})[c.VertexAttrConstants.POSITION]={size:3,data:a},r[c.VertexAttrConstants.NORMAL]={size:3,data:d},r[c.VertexAttrConstants.UV0]={size:2,data:f},r[c.VertexAttrConstants.COLOR]={size:4,data:v},r);return new s.GeometryData(h,p)},e.createConeGeometry=function(e,t,n,a,i,o){void 0===i&&(i=!0),void 0===o&&(o=!0);var l=0,d=t,u=e,f=r.vec3f32.fromValues(0,l,0),v=r.vec3f32.fromValues(0,l+u,0),p=r.vec3f32.fromValues(0,-1,0),h=r.vec3f32.fromValues(0,1,0);a&&(l=u,v=r.vec3f32.fromValues(0,0,0),f=r.vec3f32.fromValues(0,l,0),p=r.vec3f32.fromValues(0,1,0),h=r.vec3f32.fromValues(0,-1,0));var m=[v,f],g=[p,h],y=n+2,b=Math.sqrt(u*u+d*d);if(a)for(x=n-1;x>=0;x--)w=x*(2*Math.PI/n),_=r.vec3f32.fromValues(Math.cos(w)*d,l,Math.sin(w)*d),m.push(_),S=r.vec3f32.fromValues(u*Math.cos(w)/b,-d/b,u*Math.sin(w)/b),g.push(S);else for(var x=0;x<n;x++){var w=x*(2*Math.PI/n),_=r.vec3f32.fromValues(Math.cos(w)*d,l,Math.sin(w)*d);m.push(_);var S=r.vec3f32.fromValues(u*Math.cos(w)/b,d/b,u*Math.sin(w)/b);g.push(S)}var P=new Uint32Array(2*(n+2)*3),O=new Uint32Array(2*(n+2)*3),M=0,A=0;if(i){for(x=3;x<m.length;x++)P[M++]=1,P[M++]=x-1,P[M++]=x,O[A++]=0,O[A++]=0,O[A++]=0;P[M++]=m.length-1,P[M++]=2,P[M++]=1,O[A++]=0,O[A++]=0,O[A++]=0}if(o){for(x=3;x<m.length;x++)P[M++]=x,P[M++]=x-1,P[M++]=0,O[A++]=x,O[A++]=x-1,O[A++]=1;P[M++]=0,P[M++]=2,P[M++]=m.length-1,O[A++]=1,O[A++]=2,O[A++]=g.length-1}var C=new Float32Array(3*y);for(x=0;x<y;x++)C[3*x]=m[x][0],C[3*x+1]=m[x][1],C[3*x+2]=m[x][2];var T=new Float32Array(3*y);for(x=0;x<y;x++)T[3*x]=g[x][0],T[3*x+1]=g[x][1],T[3*x+2]=g[x][2];var z={};z[c.VertexAttrConstants.POSITION]=P,z[c.VertexAttrConstants.NORMAL]=O;var I={};return I[c.VertexAttrConstants.POSITION]={size:3,data:C},I[c.VertexAttrConstants.NORMAL]={size:3,data:T},new s.GeometryData(I,z)},e.createCylinderGeometry=function(e,t,a,i,o,l){var d=i?r.vec3f32.clone(i):r.vec3f32.fromValues(1,0,0),u=o?r.vec3f32.clone(o):r.vec3f32.fromValues(0,0,0),f=void 0===l||l,v=r.vec3f32.create();n.vec3.normalize(v,d);var p=r.vec3f32.create();n.vec3.scale(p,v,Math.abs(e));var h=r.vec3f32.create();n.vec3.scale(h,p,-.5),n.vec3.add(h,h,u);var m=r.vec3f32.fromValues(0,1,0);Math.abs(1-n.vec3.dot(v,m))<.2&&n.vec3.set(m,0,0,1);var g=r.vec3f32.create();n.vec3.cross(g,v,m),n.vec3.normalize(g,g),n.vec3.cross(m,g,v);var y=2*a+(f?2:0),b=a+(f?2:0),x=new Float32Array(3*y),w=new Float32Array(3*b),_=new Float32Array(2*y),S=new Uint32Array(3*a*(f?4:2)),P=new Uint32Array(3*a*(f?4:2));f&&(x[3*(y-2)+0]=h[0],x[3*(y-2)+1]=h[1],x[3*(y-2)+2]=h[2],_[2*(y-2)]=0,_[2*(y-2)+1]=0,x[3*(y-1)+0]=x[3*(y-2)+0]+p[0],x[3*(y-1)+1]=x[3*(y-2)+1]+p[1],x[3*(y-1)+2]=x[3*(y-2)+2]+p[2],_[2*(y-1)]=1,_[2*(y-1)+1]=1,w[3*(b-2)+0]=-v[0],w[3*(b-2)+1]=-v[1],w[3*(b-2)+2]=-v[2],w[3*(b-1)+0]=v[0],w[3*(b-1)+1]=v[1],w[3*(b-1)+2]=v[2]);for(var O=function(e,t,n){S[e]=t,P[e]=n},M=0,A=r.vec3f32.create(),C=r.vec3f32.create(),T=0;T<a;T++){var z=T*(2*Math.PI/a);n.vec3.scale(A,m,Math.sin(z)),n.vec3.scale(C,g,Math.cos(z)),n.vec3.add(A,A,C),w[3*T+0]=A[0],w[3*T+1]=A[1],w[3*T+2]=A[2],n.vec3.scale(A,A,t),n.vec3.add(A,A,h),x[3*T+0]=A[0],x[3*T+1]=A[1],x[3*T+2]=A[2],_[2*T+0]=T/a,_[2*T+1]=0,x[3*(T+a)+0]=x[3*T+0]+p[0],x[3*(T+a)+1]=x[3*T+1]+p[1],x[3*(T+a)+2]=x[3*T+2]+p[2],_[2*(T+a)+0]=T/a,_[2*T+1]=1;var I=(T+1)%a;O(M++,T,T),O(M++,T+a,T),O(M++,I,I),O(M++,I,I),O(M++,T+a,T),O(M++,I+a,I)}if(f){for(T=0;T<a;T++)I=(T+1)%a,O(M++,y-2,b-2),O(M++,T,b-2),O(M++,I,b-2);for(T=0;T<a;T++)I=(T+1)%a,O(M++,T+a,b-1),O(M++,y-1,b-1),O(M++,I+a,b-1)}var D={};D[c.VertexAttrConstants.POSITION]=S,D[c.VertexAttrConstants.NORMAL]=P,D[c.VertexAttrConstants.UV0]=S;var j={};return j[c.VertexAttrConstants.POSITION]={size:3,data:x},j[c.VertexAttrConstants.NORMAL]={size:3,data:w},j[c.VertexAttrConstants.UV0]={size:2,data:_},new s.GeometryData(j,D)},e.createTubeGeometry=function(t,n,r,a,i){r=r||10,a=null==a||a,c.assert(t.length>1);for(var o=[],s=[],l=0;l<r;l++){o.push([0,-l-1,-(l+1)%r-1]);var d=l/r*2*Math.PI;s.push([Math.cos(d)*n,Math.sin(d)*n])}return e.createPathExtrusionGeometry(s,t,[[0,0,0]],o,a,i)},e.createPathExtrusionGeometry=function(e,t,o,l,d,u){void 0===u&&(u=r.vec3f32.fromValues(0,0,0));var f=e.length,v=new Float32Array(t.length*f*3+(6*o.length||0)),h=new Float32Array(t.length*f+(2*o.length||0)),m=new Float32Array(t.length*f*3+(o?6:0)),y=(t.length-1)*f*6+3*l.length*2,b=new Uint32Array(y),x=new Uint32Array(y),w=0,_=0,S=0,P=0,O=0,M=r.vec3f32.create(),A=r.vec3f32.create(),C=r.vec3f32.create(),T=r.vec3f32.create(),z=r.vec3f32.create(),I=r.vec3f32.create(),D=r.vec3f32.create(),j=a.vec3f64.create(),V=r.vec3f32.create(),F=r.vec3f32.create(),N=r.vec3f32.create(),R=r.vec3f32.create(),L=r.vec3f32.create(),k=i.plane.create();n.vec3.set(V,0,1,0),n.vec3.subtract(A,t[1],t[0]),n.vec3.normalize(A,A),d?(n.vec3.add(j,t[0],u),n.vec3.normalize(C,j)):n.vec3.set(C,0,0,1),g(A,C,V,V,z,C,p),n.vec3.copy(T,C),n.vec3.copy(R,z);for(var U=0;U<o.length;U++)n.vec3.scale(I,z,o[U][0]),n.vec3.scale(j,C,o[U][2]),n.vec3.add(I,I,j),n.vec3.add(I,I,t[0]),v[w++]=I[0],v[w++]=I[1],v[w++]=I[2],h[S++]=0;for(m[_++]=-A[0],m[_++]=-A[1],m[_++]=-A[2],U=0;U<l.length;U++)b[P++]=l[U][0]>0?l[U][0]:-l[U][0]-1+o.length,b[P++]=l[U][1]>0?l[U][1]:-l[U][1]-1+o.length,b[P++]=l[U][2]>0?l[U][2]:-l[U][2]-1+o.length,x[O++]=0,x[O++]=0,x[O++]=0;for(var E=o.length,H=o.length-1,G=0;G<t.length;G++){var B=!1;G>0&&(n.vec3.copy(M,A),G<t.length-1?(n.vec3.subtract(A,t[G+1],t[G]),n.vec3.normalize(A,A)):B=!0,n.vec3.add(F,M,A),n.vec3.normalize(F,F),n.vec3.add(N,t[G-1],T),i.plane.fromPositionAndNormal(t[G],F,k),i.plane.intersectRay(k,i.ray.wrap(N,M),j)?(n.vec3.subtract(j,j,t[G]),n.vec3.normalize(C,j),n.vec3.cross(z,F,C),n.vec3.normalize(z,z)):g(F,T,R,V,z,C,p),n.vec3.copy(T,C),n.vec3.copy(R,z)),d&&(n.vec3.add(j,t[G],u),n.vec3.normalize(L,j));for(var W=0;W<f;W++)if(n.vec3.scale(I,z,e[W][0]),n.vec3.scale(j,C,e[W][1]),n.vec3.add(I,I,j),n.vec3.normalize(D,I),m[_++]=D[0],m[_++]=D[1],m[_++]=D[2],h[S++]=d?n.vec3.dot(I,L):I[2],n.vec3.add(I,I,t[G]),v[w++]=I[0],v[w++]=I[1],v[w++]=I[2],!B){var q=(W+1)%f;b[P++]=E+W,b[P++]=E+f+W,b[P++]=E+q,b[P++]=E+q,b[P++]=E+f+W,b[P++]=E+f+q;for(var Z=0;Z<6;Z++)x[O++]=b[P-6+Z]-H}E+=f}var X=t[t.length-1];for(U=0;U<o.length;U++)n.vec3.scale(I,z,o[U][0]),n.vec3.scale(j,C,o[U][1]),n.vec3.add(I,I,j),n.vec3.add(I,I,X),v[w++]=I[0],v[w++]=I[1],v[w++]=I[2],h[S++]=0;var Q=_/3;m[_++]=A[0],m[_++]=A[1],m[_++]=A[2];var Y=E-f;for(U=0;U<l.length;U++)b[P++]=l[U][0]>=0?E+l[U][0]:-l[U][0]-1+Y,b[P++]=l[U][2]>=0?E+l[U][2]:-l[U][2]-1+Y,b[P++]=l[U][1]>=0?E+l[U][1]:-l[U][1]-1+Y,x[O++]=Q,x[O++]=Q,x[O++]=Q;var J={};J[c.VertexAttrConstants.POSITION]=b,J[c.VertexAttrConstants.NORMAL]=x;var K={};return K[c.VertexAttrConstants.POSITION]={size:3,data:v},K.zOffset={size:1,data:h},K[c.VertexAttrConstants.NORMAL]={size:3,data:m},new s.GeometryData(K,J)},e.createPolylineGeometry=function(e,t){c.assert(e.length>1,"createPolylineGeometry(): polyline needs at least 2 points"),c.assert(3===e[0].length,"createPolylineGeometry(): malformed vertex"),c.assert(void 0===t||t.length===e.length,"createPolylineGeometry: need same number of points and normals"),c.assert(void 0===t||3===t[0].length,"createPolylineGeometry(): malformed normal");for(var n=new Float64Array(3*e.length),r=new Uint32Array(2*(e.length-1)),a=0,i=0,o=0;o<e.length;o++){for(var l=0;l<3;l++)n[a++]=e[o][l];o>0&&(r[i++]=o-1,r[i++]=o)}var d={},u={};if(d[c.VertexAttrConstants.POSITION]=r,u[c.VertexAttrConstants.POSITION]={size:3,data:n},t){var f=new Float32Array(3*t.length),v=0;for(o=0;o<e.length;o++)for(l=0;l<3;l++)f[v++]=t[o][l];d[c.VertexAttrConstants.NORMAL]=r,u[c.VertexAttrConstants.NORMAL]={size:3,data:f}}return new s.GeometryData(u,d,"line")},e.createExtrudedTriangle=function(e,t,n,r){for(var a,i,o=new Float32Array(18),l=[[-t,0,r/2],[n,0,r/2],[0,e,r/2],[-t,0,-r/2],[n,0,-r/2],[0,e,-r/2]],d=0;d<6;d++)o[3*d]=l[d][0],o[3*d+1]=l[d][1],o[3*d+2]=l[d][2];var u=((a={})[c.VertexAttrConstants.POSITION]=new Uint32Array([0,1,2,3,0,2,2,5,3,1,4,5,5,2,1,1,0,3,3,4,1,4,3,5]),a),f=((i={})[c.VertexAttrConstants.POSITION]={size:3,data:o},i);return new s.GeometryData(f,u)},e.transformInPlace=function(e,t){for(var r=e.vertexAttributes[c.VertexAttrConstants.POSITION].data,a=0;a<r.length;a+=3)n.vec3.set(h,r[a],r[a+1],r[a+2]),n.vec3.transformMat4(h,h,t),r[a]=h[0],r[a+1]=h[1],r[a+2]=h[2]},e.addVertexColors=function(e,t){var n=t||[1,1,1,1],r=new Uint8Array(4);r[0]=255*n[0],r[1]=255*n[1],r[2]=255*n[2],r[3]=255*(n.length>3?n[3]:1);var a={},i=e.getVertexAttr();for(var o in i)a[o]=i[o];a[c.VertexAttrConstants.COLOR]={size:4,data:r};var l={};for(var o in e.indices)l[o]=e.indices[o];return l[c.VertexAttrConstants.COLOR]=new Uint32Array(l[c.VertexAttrConstants.POSITION].length),new s.GeometryData(a,l,e.primitiveType)},e.addNormals=function(e){for(var t=e.getVertexAttr(),r=e.indices,a=o.Vec3Compact.subtract,i=new Float32Array(r.position.length/3*3),s=t.position.data,l=0,d=r.position,u=new Uint32Array(d.length),f=0;f<d.length;f+=3){a(s,3*d[f],s,3*d[f+2],m,0),a(s,3*d[f],s,3*d[f+1],h,0),n.vec3.cross(h,h,m),n.vec3.normalize(h,h);var v=l/3;i[l++]=h[0],i[l++]=h[1],i[l++]=h[2],u[f]=v,u[f+1]=v,u[f+2]=v}t[c.VertexAttrConstants.NORMAL]={size:3,data:i,offsetIdx:0,strideIdx:3},r[c.VertexAttrConstants.NORMAL]=u},e.cgToGIS=function(e,t){void 0===t&&(t=e);var n=e.getVertexAttr(),r=n.position.data,a=n.normal.data,i=t.getVertexAttr(),o=i.position.data,s=i.normal.data;if(a)for(var c=0;c<a.length;c+=3){var l=a[c+1];s[c+1]=-a[c+2],s[c+2]=l}if(r)for(c=0;c<r.length;c+=3)l=r[c+1],o[c+1]=-r[c+2],o[c+2]=l;return t},e.makeOrthoBasisDirUp=f,e.makeOrthoBasisDirUpFallback=g}(f||(f={}));var p=.99619469809,h=r.vec3f32.create(),m=r.vec3f32.create();return f}).apply(null,r))||(e.exports=a)},"51bw":function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("xf8T")],void 0===(a=(function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.mat3f64=n}).apply(null,r))||(e.exports=a)},"6t3m":function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("zOht"),n("7Aei")],void 0===(a=(function(e,t,n,r){var a,i,o;Object.defineProperty(t,"__esModule",{value:!0}),t.VertexColor=function(e,t){t.attributeColor?(e.attributes.add("color","vec4"),e.varyings.add("vColor","vec4"),e.vertex.code.add(r.glsl(a||(a=n.__makeTemplateObject(["\n      void forwardVertexColor() { vColor = color; }\n    "],["\n      void forwardVertexColor() { vColor = color; }\n    "])))),e.vertex.code.add(r.glsl(i||(i=n.__makeTemplateObject(["\n      void forwardNormalizedVertexColor() { vColor = color * 0.003921568627451; }\n    "],["\n      void forwardNormalizedVertexColor() { vColor = color * 0.003921568627451; }\n    "]))))):e.vertex.code.add(r.glsl(o||(o=n.__makeTemplateObject(["\n      void forwardVertexColor() {}\n      void forwardNormalizedVertexColor() {}\n    "],["\n      void forwardVertexColor() {}\n      void forwardNormalizedVertexColor() {}\n    "]))))}}).apply(null,r))||(e.exports=a)},"6vp1":function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("zOht"),n("DKwL"),n("7Aei")],void 0===(a=(function(e,t,n,r,a){function i(e){e.include(r.RgbaFloatEncoding),e.fragment.code.add(a.glsl(o||(o=n.__makeTemplateObject(["\n    float linearDepthFromTexture(sampler2D depthTex, vec2 uv, vec2 nearFar) {\n      return -(rgba2float(texture2D(depthTex, uv)) * (nearFar[1] - nearFar[0]) + nearFar[0]);\n    }\n  "],["\n    float linearDepthFromTexture(sampler2D depthTex, vec2 uv, vec2 nearFar) {\n      return -(rgba2float(texture2D(depthTex, uv)) * (nearFar[1] - nearFar[0]) + nearFar[0]);\n    }\n  "]))))}var o;Object.defineProperty(t,"__esModule",{value:!0}),t.ReadLinearDepth=i,function(e){e.bindUniforms=function(e,t){e.setUniform2fv("nearFar",t.nearFar)}}(i=t.ReadLinearDepth||(t.ReadLinearDepth={}))}).apply(null,r))||(e.exports=a)},"7Aei":function(e,t,n){var r,a;r=[n.dj.c(e.i),t],a=(function(e,t){function n(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r="",a=0;a<t.length;a++)r+=e[a]+t[a];return r+e[e.length-1]}Object.defineProperty(t,"__esModule",{value:!0}),t.glsl=n,function(e){e.int=function(e){return Math.round(e).toString()},e.float=function(e){return e.toPrecision(8)}}(n=t.glsl||(t.glsl={}))}).apply(null,r),void 0===a||(e.exports=a)},"7Yqx":function(e,t,n){var r,a;r=[n.dj.c(e.i),t],void 0===(a=(function(e,t){function n(){var e=new Float32Array(16);return e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}Object.defineProperty(t,"__esModule",{value:!0}),t.create=n,t.clone=function(e){var t=new Float32Array(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.fromValues=function(e,t,n,r,a,i,o,s,c,l,d,u,f,v,p,h){var m=new Float32Array(16);return m[0]=e,m[1]=t,m[2]=n,m[3]=r,m[4]=a,m[5]=i,m[6]=o,m[7]=s,m[8]=c,m[9]=l,m[10]=d,m[11]=u,m[12]=f,m[13]=v,m[14]=p,m[15]=h,m},t.createView=function(e,t){return new Float32Array(e,t,16)},t.IDENTITY=n()}).apply(null,r))||(e.exports=a)},"9DjX":function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("LxLY"),n("YX1r"),n("51bw"),n("FXVB"),n("1m5D"),n("EuvN"),n("lLWD"),n("0LE5"),n("vlC2"),n("Rdxj"),n("2fXB"),n("O7NG"),n("aWgr"),n("2eYJ"),n("/dtL"),n("ZJC8")],void 0===(a=(function(e,t,n,r,a,i,o,s,c,l,d,u,f,v,p,h,m,g){Object.defineProperty(t,"__esModule",{value:!0}),t.sliceFilterPredicate=function(e){return function(t,n,r){return l.vec3.lerp(z,t,n,r),!h.extrusionContainsPoint(e,z)}},t.IntersectorOptions=function(){this.verticalOffset=0,this.selectionMode=!1,this.hud=!0,this.selectOpaqueTerrainOnly=!0,this.invisibleTerrain=!1,this.backfacesTerrain=!0,this.storeTerrainResults=!0,this.store=2};var y=function(){function e(){this._transform=o.mat4f64.create(),this._transformInverse=new b({value:this._transform},i.mat4.invert,o.mat4f64.create),this._transformInverseTranspose=new b(this._transformInverse,i.mat4.transpose,o.mat4f64.create),this._transformTranspose=new b({value:this._transform},i.mat4.transpose,o.mat4f64.create),this._transformInverseRotation=new b({value:this._transform},r.mat3.normalFromMat4Legacy,a.mat3f64.create)}return e.prototype.invalidateLazyTransforms=function(){this._transformInverse.invalidate(),this._transformInverseTranspose.invalidate(),this._transformTranspose.invalidate(),this._transformInverseRotation.invalidate()},Object.defineProperty(e.prototype,"transform",{get:function(){return this._transform},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inverse",{get:function(){return this._transformInverse.value},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inverseTranspose",{get:function(){return this._transformInverseTranspose.value},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inverseRotation",{get:function(){return this._transformInverseRotation.value},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"transpose",{get:function(){return this._transformTranspose.value},enumerable:!0,configurable:!0}),e.prototype.setTransformMatrix=function(e){i.mat4.copy(this._transform,e)},e.prototype.multiplyTransform=function(e){i.mat4.multiply(this._transform,this._transform,e)},e.prototype.set=function(e){i.mat4.copy(this._transform,e),this.invalidateLazyTransforms()},e.prototype.setAndInvalidateLazyTransforms=function(e,t){this.setTransformMatrix(e),this.multiplyTransform(t),this.invalidateLazyTransforms()},e}();t.IntersectorTransform=y;var b=function(){function e(e,t,n){this.original=e,this.update=t,this.dirty=!0,this.transform=n()}return e.prototype.invalidate=function(){this.dirty=!0},Object.defineProperty(e.prototype,"value",{get:function(){return this.dirty&&(this.update(this.transform,this.original.value),this.dirty=!1),this.transform},enumerable:!0,configurable:!0}),e}(),x=function(){function e(){this.min=new w,this.max=new w,this.hud=new w,this.ground=new w}return e.prototype.init=function(e){this.min.init(e),this.max.init(e),this.hud.init(e),this.ground.init(e),this.all=[]},e}();t.IntersectorResults=x;var w=function(){function e(e){this.normal=u.vec3f64.create(),this.transformation=o.mat4f64.create(),this._ray=p.ray.create(),this.init(e)}return Object.defineProperty(e.prototype,"ray",{get:function(){return this._ray},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasIntersectionPoint",{get:function(){return null!=this.dist},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"distanceInRenderSpace",{get:function(){if(null!=this.dist)return l.vec3.scale(I,this.ray.direction,this.dist),l.vec3.length(I)},enumerable:!0,configurable:!0}),e.prototype.getIntersectionPoint=function(e){return!!this.hasIntersectionPoint&&(l.vec3.scale(I,this.ray.direction,this.dist),l.vec3.add(e,this.ray.origin,I),!0)},e.prototype.getTransformedNormal=function(e){return l.vec3.copy(D,this.normal),D[3]=0,f.vec4.transformMat4(D,D,this.transformation),l.vec3.copy(e,D),l.vec3.normalize(e,e),e},e.prototype.init=function(e){this.dist=void 0,this.target=void 0,this.name=void 0,this.drapedLayerOrder=void 0,this.drapedLayerGraphicOrder=void 0,this.center=null,this.geometryId=null,this.triangleNr=null,this.intersector="Stage",e?p.ray.copy(e,this._ray):this._ray=p.ray.create()},e.prototype.set=function(e,t,n,r,a,o,s,c,d,f){e instanceof g&&(e={type:"stage",obj:e}),this.dist=n,l.vec3.copy(this.normal,r),i.mat4.copy(this.transformation,a),this.target=e,this.name=t,this.drapedLayerOrder=o,this.center=s?u.vec3f64.clone(s):null,this.geometryId=c,this.triangleNr=d,this.drapedLayerGraphicOrder=f},e.prototype.copyFrom=function(e){p.ray.copy(e._ray,this._ray),this.dist=e.dist,this.target=e.target,this.name=e.name,this.drapedLayerOrder=e.drapedLayerOrder,this.center=e.center?u.vec3f64.clone(e.center):null,this.geometryId=e.geometryId,this.triangleNr=e.triangleNr,this.intersector=e.intersector,this.drapedLayerGraphicOrder=e.drapedLayerGraphicOrder,l.vec3.copy(this.normal,e.normal),i.mat4.copy(this.transformation,e.transformation)},e.prototype.toOwner=function(e){if(!this.target)return null;switch(this.target.type){case"stage":return _(this.target.obj.metadata,e);case"external":switch(this.intersector){case"PointRenderer":return function(e,t){var n=e.metadata.layerUid;return null!=n?t.map.findLayerByUid(n):null}(this.target,e);case"I3S":case"IM":case"LodRenderer":case"OverlayRenderer":return _(this.target.metadata,e);case"TerrainRenderer":return e.map&&e.map.ground}}return null},e.prototype.toGraphic=function(e){if(!this.target)return null;switch(this.target.type){case"stage":return S(this.target.obj.metadata,e);case"external":switch(this.intersector){case"PointRenderer":return this.target.metadata.createGraphic();case"I3S":case"IM":case"LodRenderer":case"OverlayRenderer":return S(this.target.metadata,e)}}return null},e}();function _(e,t){return n.isNone(e)||null==e.layerUid?null:n.isSome(t.graphicsView)&&e.layerUid===t.graphicsView.mockLayerId?t.graphics:t.map.findLayerByUid(e.layerUid)}function S(e,t){if(n.isNone(e))return null;var r=_(e,t);if(n.isNone(r))return null;if(r===t.graphics)return n.isSome(t.graphicsView)?n.unwrap(t.graphicsView.getGraphicFromGraphicUid(e.graphicUid)):null;var a=t.allLayerViews.find((function(e){return e.layer===r}));return a?function(e,t){return!e||e.suspended?null:"getGraphicFromIntersectorMetadata"in e&&t?e.getGraphicFromIntersectorMetadata(t):"getGraphicFromGraphicUid"in e&&null!=t.graphicUid?e.getGraphicFromGraphicUid(t.graphicUid):null}(a,e):null}t.IntersectorResult=w;var P=function(){function e(e){void 0===e&&(e=0),this.offset=e,this.tmpVertex=u.vec3f64.create()}return e.prototype.applyToVertex=function(e,t,n){var r=e+this.localOrigin[0],a=t+this.localOrigin[1],i=n+this.localOrigin[2],o=this.offset/Math.sqrt(r*r+a*a+i*i);return this.tmpVertex[0]=e+r*o,this.tmpVertex[1]=t+a*o,this.tmpVertex[2]=n+i*o,this.tmpVertex},e.prototype.applyToAABB=function(e){var t=e[0]+this.localOrigin[0],n=e[1]+this.localOrigin[1],r=e[2]+this.localOrigin[2],a=e[3]+this.localOrigin[0],i=e[4]+this.localOrigin[1],o=e[5]+this.localOrigin[2],s=this.offset/Math.sqrt(t*t+n*n+r*r);e[0]+=t*s,e[1]+=n*s,e[2]+=r*s;var c=this.offset/Math.sqrt(a*a+i*i+o*o);return e[3]+=a*c,e[4]+=i*c,e[5]+=o*c,e},e}();t.TerrainVerticalOffsetGlobalViewingMode=P;var O=function(){function e(e){void 0===e&&(e=0),this.offset=e,this.componentLocalOriginLength=0,this.tmpVertex=u.vec3f64.create(),this.mbs=v.vec4f64.create(),this.obb={center:u.vec3f64.create(),halfSize:d.vec3f32.create(),quaternion:null}}return Object.defineProperty(e.prototype,"localOrigin",{set:function(e){this.componentLocalOriginLength=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2])},enumerable:!0,configurable:!0}),e.prototype.applyToVertex=function(e,t,n){var r=e,a=t,i=n+this.componentLocalOriginLength,o=this.offset/Math.sqrt(r*r+a*a+i*i);return this.tmpVertex[0]=e+r*o,this.tmpVertex[1]=t+a*o,this.tmpVertex[2]=n+i*o,this.tmpVertex},e.prototype.applyToAABB=function(e){var t=e[0],n=e[1],r=e[2]+this.componentLocalOriginLength,a=e[3],i=e[4],o=e[5]+this.componentLocalOriginLength,s=this.offset/Math.sqrt(t*t+n*n+r*r);e[0]+=t*s,e[1]+=n*s,e[2]+=r*s;var c=this.offset/Math.sqrt(a*a+i*i+o*o);return e[3]+=a*c,e[4]+=i*c,e[5]+=o*c,e},e.prototype.applyToMbs=function(e){var t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),n=this.offset/t;return this.mbs[0]=e[0]+e[0]*n,this.mbs[1]=e[1]+e[1]*n,this.mbs[2]=e[2]+e[2]*n,this.mbs[3]=e[3]+e[3]*this.offset/t,this.mbs},e.prototype.applyToObb=function(e){var t=e.center,n=this.offset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);this.obb.center[0]=t[0]+t[0]*n,this.obb.center[1]=t[1]+t[1]*n,this.obb.center[2]=t[2]+t[2]*n,l.vec3.transformQuat(this.obb.halfSize,e.halfSize,e.quaternion),l.vec3.add(this.obb.halfSize,this.obb.halfSize,e.center);var r=this.offset/Math.sqrt(this.obb.halfSize[0]*this.obb.halfSize[0]+this.obb.halfSize[1]*this.obb.halfSize[1]+this.obb.halfSize[2]*this.obb.halfSize[2]);return this.obb.halfSize[0]+=this.obb.halfSize[0]*r,this.obb.halfSize[1]+=this.obb.halfSize[1]*r,this.obb.halfSize[2]+=this.obb.halfSize[2]*r,l.vec3.subtract(this.obb.halfSize,this.obb.halfSize,e.center),s.quat.conjugate(j,e.quaternion),l.vec3.transformQuat(this.obb.halfSize,this.obb.halfSize,j),this.obb.halfSize[0]*=this.obb.halfSize[0]<0?-1:1,this.obb.halfSize[1]*=this.obb.halfSize[1]<0?-1:1,this.obb.halfSize[2]*=this.obb.halfSize[2]<0?-1:1,this.obb.quaternion=e.quaternion,this.obb},e}();t.I3SVerticalOffsetGlobalViewingMode=O;var M=function(){function e(e){void 0===e&&(e=0),this.offset=e,this.sphere=m.create(),this.tmpVertex=u.vec3f64.create()}return e.prototype.applyToVertex=function(e,t,n){var r=this.objectTransform.transform,a=r[0]*e+r[4]*t+r[8]*n+r[12],i=r[1]*e+r[5]*t+r[9]*n+r[13],o=r[2]*e+r[6]*t+r[10]*n+r[14],s=this.offset/Math.sqrt(a*a+i*i+o*o),c=this.objectTransform.inverse;return this.tmpVertex[0]=c[0]*(a+=a*s)+c[4]*(i+=i*s)+c[8]*(o+=o*s)+c[12],this.tmpVertex[1]=c[1]*a+c[5]*i+c[9]*o+c[13],this.tmpVertex[2]=c[2]*a+c[6]*i+c[10]*o+c[14],this.tmpVertex},e.prototype.applyToMinMax=function(e,t){var n=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*n,e[1]+=e[1]*n,e[2]+=e[2]*n;var r=this.offset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]+=t[0]*r,t[1]+=t[1]*r,t[2]+=t[2]*r},e.prototype.applyToAABB=function(e){var t=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*t,e[1]+=e[1]*t,e[2]+=e[2]*t;var n=this.offset/Math.sqrt(e[3]*e[3]+e[4]*e[4]+e[5]*e[5]);return e[3]+=e[3]*n,e[4]+=e[4]*n,e[5]+=e[5]*n,e},e.prototype.applyToBoundingSphere=function(e,t){var n=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]),r=this.offset/n;return this.sphere.center[0]=t[0]+t[0]*r,this.sphere.center[1]=t[1]+t[1]*r,this.sphere.center[2]=t[2]+t[2]*r,this.sphere.radius=e+e*this.offset/n,this.sphere},e}();t.Object3DVerticalOffsetGlobalViewingMode=M;var A=new M;t.getVerticalOffsetObject3D=function(e){return n.isSome(e)?(A.offset=e,A):null};var C=new O;t.getVerticalOffsetI3S=function(e){return n.isSome(e)?(C.offset=e,C):null};var T=new P;t.getVerticalOffsetTerrain=function(e){return n.isSome(e)?(T.offset=e,T):null},t.TERRAIN_ID="terrain";var z=u.vec3f64.create(),I=u.vec3f64.create(),D=v.vec4f64.create(),j=c.quatf64.create()}).apply(null,r))||(e.exports=a)},"9FJH":function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("zOht"),n("LxLY"),n("EiD/"),n("tUyH")],void 0===(a=(function(e,t,n,r,a,i){return function(e){function t(t){var n=e.call(this,t)||this;return n._textureIDs=new Set,n._textureRepository=t.textureRep,n._textureId=t.textureId,n._initTransparent=!!t.initTextureTransparent,n._texture=n._acquireIfNotUndefined(n._textureId),n._textureNormal=n._acquireIfNotUndefined(t.normalTextureId),n._textureEmissive=n._acquireIfNotUndefined(t.emissiveTextureId),n._textureOcclusion=n._acquireIfNotUndefined(t.occlusionTextureId),n._textureMetallicRoughness=n._acquireIfNotUndefined(t.metallicRoughnessTextureId),n}return n.__extends(t,e),t.prototype.dispose=function(){var e=this;this._textureIDs.forEach((function(t){return e._textureRepository.release(t)})),this._textureIDs.clear()},t.prototype.updateTexture=function(e){e!==this._textureId&&(this._releaseIfNotUndefined(this._textureId),this._textureId=e,this._texture=this._acquireIfNotUndefined(this._textureId))},t.prototype.bindTexture=function(e,t){r.isSome(this._texture)&&(t.setUniform1i("tex",a.DefaultTextureUnits.DIFFUSE),e.bindTexture(this._texture.glTexture,a.DefaultTextureUnits.DIFFUSE)),r.isSome(this._textureNormal)&&(t.setUniform1i("normalTexture",a.DefaultTextureUnits.NORMAL),e.bindTexture(this._textureNormal.glTexture,a.DefaultTextureUnits.NORMAL)),r.isSome(this._textureEmissive)&&(t.setUniform1i("texEmission",a.DefaultTextureUnits.EMISSION),e.bindTexture(this._textureEmissive.glTexture,a.DefaultTextureUnits.EMISSION)),r.isSome(this._textureOcclusion)&&(t.setUniform1i("texOcclusion",a.DefaultTextureUnits.OCCLUSION),e.bindTexture(this._textureOcclusion.glTexture,a.DefaultTextureUnits.OCCLUSION)),r.isSome(this._textureMetallicRoughness)&&(t.setUniform1i("texMetallicRoughness",a.DefaultTextureUnits.METALLIC_ROUGHNESS),e.bindTexture(this._textureMetallicRoughness.glTexture,a.DefaultTextureUnits.METALLIC_ROUGHNESS))},t.prototype.bindTextureScale=function(e,t){var n=r.isSome(this._texture)&&this._texture.glTexture;n&&n.descriptor.textureCoordinateScaleFactor?t.setUniform2fv("textureCoordinateScaleFactor",n.descriptor.textureCoordinateScaleFactor):t.setUniform2f("textureCoordinateScaleFactor",1,1)},t.prototype._acquireIfNotUndefined=function(e){if(!r.isNone(e))return this._textureIDs.add(e),this._textureRepository.acquire(e,this._initTransparent)},t.prototype._releaseIfNotUndefined=function(e){void 0!==e&&(this._textureIDs.delete(e),this._textureRepository.release(e))},t}(i.GLMaterial)}).apply(null,r))||(e.exports=a)},AgDx:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("+nCE"),n("CIy2")],void 0===(a=(function(e,t,n,r){Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(t,a,i){void 0===a&&(a=e.DefaultIndices),void 0===i&&(i="triangle");var o={};for(var s in t){var c=t[s],l=c.size;o[s]={data:c.data,size:l,offsetIdx:0,strideIdx:l}}if(a===e.DefaultIndices){var d=function(e){var t=r.getFirstObjectValue(e);return null==t?0:t.data.length/t.size}(o),u=n.generateDefaultIndexArray(d);for(var f in a={},o)a[f]=u}this._id=n.getNewId(),this._vertexAttributes=o,this._indices=a,this._primitiveType=i}return Object.defineProperty(e.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"vertexAttributes",{get:function(){return this._vertexAttributes},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"indices",{get:function(){return this._indices},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"indexCount",{get:function(){var e=r.getFirstObjectValue(this._indices);return null==e?0:e.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"primitiveType",{get:function(){return this._primitiveType},enumerable:!0,configurable:!0}),e.prototype.getVertexAttr=function(){return this.vertexAttributes},e.prototype.toRenderData=function(){return{id:this._id.toString(),indices:this._indices,vertexAttr:this._vertexAttributes}},e.prototype.getIndices=function(e){return this._indices[e]},e.prototype.getAttribute=function(e){return this._vertexAttributes[e]},e.prototype.estimateGpuMemoryUsage=function(){var e=0;if(this._indices[r.VertexAttrConstants.POSITION]){var t=3;e+=this._indices[r.VertexAttrConstants.POSITION].length*t*4}return this._indices[r.VertexAttrConstants.NORMAL]&&(e+=this._indices[r.VertexAttrConstants.NORMAL].length*(t=3)*4),this._indices[r.VertexAttrConstants.UV0]&&(e+=this._indices[r.VertexAttrConstants.UV0].length*(t=2)*4),this._indices[r.VertexAttrConstants.COLOR]&&(e+=this._indices[r.VertexAttrConstants.COLOR].length*(t=1)*4),e},e.DefaultIndices={},e}();t.GeometryData=a}).apply(null,r))||(e.exports=a)},B4Pz:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("zOht"),n("7Aei")],void 0===(a=(function(e,t,n,r){var a,i;Object.defineProperty(t,"__esModule",{value:!0}),t.FoamIntensity=function(e){e.fragment.code.add(r.glsl(a||(a=n.__makeTemplateObject(["\n    float normals2FoamIntensity(vec3 n, float waveStrength){\n      float normalizationFactor =  max(0.015, waveStrength);\n      return max((n.x + n.y)*0.3303545/normalizationFactor + 0.3303545, 0.0);\n    }\n  "],["\n    float normals2FoamIntensity(vec3 n, float waveStrength){\n      float normalizationFactor =  max(0.015, waveStrength);\n      return max((n.x + n.y)*0.3303545/normalizationFactor + 0.3303545, 0.0);\n    }\n  "]))))},t.FoamColor=function(e){e.fragment.code.add(r.glsl(i||(i=n.__makeTemplateObject(["\n    vec3 foamIntensity2FoamColor(float foamIntensityExternal, float foamPixelIntensity, vec3 skyZenitColor, float dayMod){\n      return foamIntensityExternal * (0.075 * skyZenitColor * pow(foamPixelIntensity, 4.) +  50.* pow(foamPixelIntensity, 23.0)) * dayMod;\n    }\n  "],["\n    vec3 foamIntensity2FoamColor(float foamIntensityExternal, float foamPixelIntensity, vec3 skyZenitColor, float dayMod){\n      return foamIntensityExternal * (0.075 * skyZenitColor * pow(foamPixelIntensity, 4.) +  50.* pow(foamPixelIntensity, 23.0)) * dayMod;\n    }\n  "]))))}}).apply(null,r))||(e.exports=a)},BwdQ:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("xoE+"),n("LxLY"),n("FXVB"),n("1m5D"),n("DIqE"),n("Rdxj"),n("2fXB"),n("O7NG"),n("WRgd"),n("lRq4"),n("0FS0"),n("ZPQp"),n("ZcgO"),n("mmEe")],void 0===(a=(function(e,t,n,r,a,i,o,s,c,l,d,u,f,v,p,h){function m(e){var t=e.paths[0];if(!t||0===t.length)return null;var n=v.getPointOnPath(t,v.getPathLength(t)/2);return p.makeDehydratedPoint(n[0],n[1],n[2],e.spatialReference)}function g(e,t,n){var r=n?e:p.clonePoint(e);return t&&e?h.pointToPoint(e,r,t)?r:null:r}function y(e){if(Array.isArray(e)){for(var t=0,n=e;t<n.length;t++)if(!y(n[t]))return!1;return!0}return null==e||e>=0}Object.defineProperty(t,"__esModule",{value:!0}),t.computeCentroid=function(e,t){if("point"===e.type)return g(e,t,!1);if(p.isHydratedGeometry(e))switch(e.type){case"extent":return g(e.center,t,!1);case"polygon":return g(e.centroid,t,!1);case"polyline":return g(m(e),t,!0);case"mesh":return g(e.extent.center,t,!1)}else switch(e.type){case"extent":return g(function(e){var t=n.isFinite(e.zmin);return p.makeDehydratedPoint(.5*(e.xmax+e.xmin),.5*(e.ymax+e.ymin),t?.5*(e.zmax+e.zmin):void 0,e.spatialReference)}(e),t,!0);case"polygon":return g(function(e){var t=e.rings[0];if(!t||0===t.length)return null;var n=f.ringsCentroid(e.rings,e.hasZ);return p.makeDehydratedPoint(n[0],n[1],n[2],e.spatialReference)}(e),t,!0);case"polyline":return g(m(e),t,!0)}},t.enlargeExtent=function(e,t,n){if(e){t||(t=u.create());var r=.5*e.width*(n-1),a=.5*e.height*(n-1);return e.width<1e-7*e.height?r+=a/20:e.height<1e-7*e.width&&(a+=r/20),c.vec4.set(t,e.xmin-r,e.ymin-a,e.xmax+r,e.ymax+a),t}return null},t.updateVertexAttributeAuxpos1w=function(e,t){for(var n=0;n<e.geometries.length;++n){var r=e.geometries[n].data.vertexAttributes.auxpos1;r&&r.data[3]!==t&&(r.data[3]=t,e.geometryVertexAttrsUpdated(n))}},t.mixinColorAndOpacity=function(e,t){var n=l.vec4f64.clone(l.vec4f64.ONES);return r.isSome(e)&&(n[0]=e[0],n[1]=e[1],n[2]=e[2]),r.isSome(t)?n[3]=t:r.isSome(e)&&e.length>3&&(n[3]=e[3]),n},t.overrideColor=function(e,t,n,a,i,o){void 0===o&&(o=[0,0,0,0]);for(var s=0;s<3;++s)o[s]=r.isSome(e)&&null!=e[s]?e[s]:r.isSome(n)&&null!=n[s]?n[s]:i[s];return o[3]=r.isSome(t)?t:r.isSome(a)?a:i[3],o},t.computeObjectScale=function(e,t,n,r){void 0===e&&(e=s.vec3f64.ONES),void 0===r&&(r=1);var a=new Array(3);if(null==t||null==n)a[0]=1,a[1]=1,a[2]=1;else{for(var i=void 0,o=0,c=2;c>=0;c--){var l=e[c],d=void 0,u=null!=l,f=n[c];"symbol-value"===l||0===c&&!i&&!u?d=0!==f?t[c]/f:1:u&&"proportional"!==l&&isFinite(l)&&(d=0!==f?l/f:1),null!=d&&(a[c]=d,i=d,o=Math.max(o,Math.abs(d)))}for(c=2;c>=0;c--)null==a[c]?a[c]=i:0===a[c]&&(a[c]=.001*o)}for(c=2;c>=0;c--)a[c]/=r;return s.vec3f64.fromArray(a)},t.computeSizeWithResourceSize=function(e,t){var n=t.width,r=t.depth,a=t.height,i=t.isPrimitive?10:1;if(null==n&&null==a&&null==r)return[i*e[0],i*e[1],i*e[2]];for(var o,c=s.vec3f64.fromValues(n,r,a),l=0;l<3;l++){var d=c[l];if(null!=d){o=d/e[l];break}}for(l=0;l<3;l++)null==c[l]&&(c[l]=e[l]*o);return c},t.validateSymbolLayerSize=function(e){return null!=e.isPrimitive&&(e=[e.width,e.depth,e.height]),y(e)?null:"Symbol sizes may not be negative values"},t.isValidSize=y,t.computeObjectRotation=function(e,t,n,r){void 0===r&&(r=i.mat4f64.create());var o=e||0,s=t||0,c=n||0;return 0!==o&&a.mat4.rotateZ(r,r,-o/180*Math.PI),0!==s&&a.mat4.rotateX(r,r,s/180*Math.PI),0!==c&&a.mat4.rotateY(r,r,c/180*Math.PI),r},t.demResolutionForBoundingBox=function(e,t){return null!=t.minDemResolution?t.minDemResolution:d.isPoint(e)?t.minDemResolutionForPoints:.01*d.maximumDimension(e)},t.namedAnchorToHUDMaterialAnchorPos={"bottom-left":o.vec2f64.fromValues(0,0),bottom:o.vec2f64.fromValues(.5,0),"bottom-right":o.vec2f64.fromValues(1,0),left:o.vec2f64.fromValues(0,.5),center:o.vec2f64.fromValues(.5,.5),right:o.vec2f64.fromValues(1,.5),"top-left":o.vec2f64.fromValues(0,1),top:o.vec2f64.fromValues(.5,1),"top-right":o.vec2f64.fromValues(1,1)}}).apply(null,r))||(e.exports=a)},CIy2:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("xoE+"),n("FXVB"),n("W9tT"),n("DIqE"),n("Rdxj"),n("2fXB"),n("O7NG")],void 0===(a=(function(e,t,n,r,a,i,o,s,c){Object.defineProperty(t,"__esModule",{value:!0});var l=c.vec4f64.create(),d=function(){function e(e){this.message=e}return e.prototype.toString=function(){return"AssertException: "+this.message},e}();function u(e,t){if(!e){t=t||"assert";var n=new Error(t);throw n.stack&&console.log(n.stack),new d(t)}}function f(e){for(var t in e)return t}function v(e,t){e[12]=t[0],e[13]=t[1],e[14]=t[2]}function p(e,t){void 0===t&&(t=0);for(var n=0,r=0;r<4;r++)n+=e[t+r]*m[r];return n}t.AssertException=d,t.VertexAttrConstants={POSITION:"position",NORMAL:"normal",UV0:"uv0",AUXPOS1:"auxpos1",AUXPOS2:"auxpos2",COLOR:"color",SYMBOLCOLOR:"symbolColor",SIZE:"size",TANGENT:"tangent"},t.assert=u,t.verify=function(e,t){e||(t=t||"",console.warn("Verify failed: "+t+"\n"+new Error("verify").stack))},t.encodeInt16=function(e){return n.clamp(Math.round(32767*e),-32767,32767)},t.encodeNormal=function(e,t){var n=Math.abs(e[0]),r=Math.abs(e[1]),a=1/(n+r+Math.abs(e[2])),i=n*a,o=r*a,s=Math.min(e[2]*a,0);t[0]=(e[0]<0?-1:1)*(i-s),t[1]=(e[1]<0?-1:1)*(o-s)},t.fallbackIfUndefined=function(e,t){return void 0===e?t:e},t.hex2rgb=function(e){return[((e=Math.floor(e))>>16&255)/255,(e>>8&255)/255,(255&e)/255]},t.rgb2hex=function(e){return"0x"+((n.clamp(Math.round(255*e[0]),0,255)<<16)+(n.clamp(Math.round(255*e[1]),0,255)<<8)+n.clamp(Math.round(255*e[2]),0,255)).toString(16)},t.dec2hex=function(e){var t=e.toString(16);return"00000000".substr(0,8-t.length)+t},t.rayTriangle3D=function(e,t,n,r,a,i,s,c,l){void 0===l&&(l=o.vec3f64.create());var d=r[s]-n[i],u=r[s+1]-n[i+1],f=r[s+2]-n[i+2],v=a[c]-n[i],p=a[c+1]-n[i+1],h=a[c+2]-n[i+2],m=t[1]*h-p*t[2],g=t[2]*v-h*t[0],y=t[0]*p-v*t[1],b=d*m+u*g+f*y;if(b>-1e-5&&b<1e-5)return!1;var x=1/b,w=e[0]-n[i],_=e[1]-n[i+1],S=e[2]-n[i+2];if(l[1]=x*(w*m+_*g+S*y),l[1]<0||l[1]>1)return!1;var P=_*f-u*S,O=S*d-f*w,M=w*u-d*_;return l[2]=x*(t[0]*P+t[1]*O+t[2]*M),!(l[2]<0||l[1]+l[2]>1||(l[0]=x*(v*P+p*O+h*M),0))},t.rayBoxTest=function(e,t,n,r){var a,i=(n[0]-e[0])/t[0],o=(r[0]-e[0])/t[0];i>o&&(a=i,i=o,o=a);var s=(n[1]-e[1])/t[1],c=(r[1]-e[1])/t[1];if(s>c&&(a=s,s=c,c=a),i>c||s>o)return!1;s>i&&(i=s),c<o&&(o=c);var l=(n[2]-e[2])/t[2],d=(r[2]-e[2])/t[2];return l>d&&(a=l,l=d,d=a),!(i>d||l>o||(d<o&&(o=d),o<0))},t.rayRay2D=function(e,t,n,r,a,o){void 0===o&&(o=i.vec2f64.create());var s=(r[a]-n[a])*(t[0]-e[0])-(r[0]-n[0])*(t[a]-e[a]);if(0===s)return!1;var c=((r[0]-n[0])*(e[a]-n[a])-(r[a]-n[a])*(e[0]-n[0]))/s;return o[0]=e[0]+c*(t[0]-e[0]),o[1]=e[a]+c*(t[a]-e[a]),!0},t.project=function(e,t,n,r,a){a||(a=e),l[0]=e[0],l[1]=e[1],l[2]=e[2],l[3]=1,s.vec4.transformMat4(l,l,t),a.length>2&&(a[2]=-l[2]),s.vec4.transformMat4(l,l,n),u(0!==l[3]),a[0]=l[0]/l[3],a[1]=l[1]/l[3],a[2]=l[2]/l[3],a[0]=(.5*a[0]+.5)*r[2]+r[0],a[1]=(.5*a[1]+.5)*r[3]+r[1]},t.getFirstObjectKey=f,t.getFirstObjectValue=function(e){return e[f(e)]},t.objectEmpty=function(e){for(var t in e)return!1;return!0},t.logWithBase=function(e,t){return Math.log(e)/Math.log(t)},t.setMatrixTranslation=v,t.setMatrixTranslation3=function(e,t,n,r){e[12]=t,e[13]=n,e[14]=r},t.getMatrixTranslation=function(e,t){return void 0===t&&(t=o.vec3f64.create()),t[0]=e[12],t[1]=e[13],t[2]=e[14],t},t.createTranslationMatrix=function(e,t){return v(e=r.mat4.identity(e),t),e},t.isTranslationMatrix=function(e){return 1===e[0]&&0===e[1]&&0===e[2]&&0===e[3]&&0===e[4]&&1===e[5]&&0===e[6]&&0===e[7]&&0===e[8]&&0===e[9]&&1===e[10]&&0===e[11]&&1===e[15]},t.fovx2fovy=function(e,t,n){return 2*Math.atan(n*Math.tan(.5*e)/t)},t.fovy2fovx=function(e,t,n){return 2*Math.atan(t*Math.tan(.5*e)/n)},t.fovx2fovd=function(e,t,n){return 2*Math.atan(Math.sqrt(t*t+n*n)*Math.tan(.5*e)/t)},t.fovy2fovd=function(e,t,n){return 2*Math.atan(Math.sqrt(t*t+n*n)*Math.tan(.5*e)/n)},t.fovd2fovx=function(e,t,n){return 2*Math.atan(t*Math.tan(.5*e)/Math.sqrt(t*t+n*n))},t.fovd2fovy=function(e,t,n){return 2*Math.atan(n*Math.tan(.5*e)/Math.sqrt(t*t+n*n))},t.packFloatRGBA=function(e,t,r){void 0===r&&(r=0);for(var a,i=n.clamp(e,0,g),o=0;o<4;o++)t[r+o]=Math.floor(256*((a=i*h[o])-Math.floor(a)))},t.unpackFloatRGBA=p;var h=[1,256,65536,16777216],m=[1/256,1/65536,1/16777216,1/4294967296],g=p(new Uint8ClampedArray([255,255,255,255]));t.inverseProjectionInfo=function(e,t,n,r,i){var o=e;0===e[11]?(r[0]=2/(t*o[0]),r[1]=2/(n*o[5]),r[2]=(1+o[12])/o[0],r[3]=(1+o[13])/o[5],a.vec2.set(i,0,1)):(r[0]=-2/(t*o[0]),r[1]=-2/(n*o[5]),r[2]=(1-o[8])/o[0],r[3]=(1-o[9])/o[5],a.vec2.set(i,1,0))}}).apply(null,r))||(e.exports=a)},CIzB:function(e,t,n){var r,a;r=[n.dj.c(e.i),t],void 0===(a=(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.create=function(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},t.clone=function(e){return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},t.fromValues=function(e,t,n,r,a,i,o,s,c,l,d,u,f,v,p,h){return[e,t,n,r,a,i,o,s,c,l,d,u,f,v,p,h]},t.createView=function(e,t){return new Float64Array(e,t,16)},t.IDENTITY=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}).apply(null,r))||(e.exports=a)},CP88:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("zOht"),n("tUyH"),n("v22c"),n("s6rJ")],void 0===(a=(function(e,t,n,r,a,i){Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(t){var n=e.call(this,t)||this;return n.updateParameters(),n}return n.__extends(t,e),t.prototype.updateParameters=function(){this.params=i.copyParameters(this.material.getParameters()),this.technique=this.techniqueRep.acquireAndReleaseExisting(a.WaterTechnique,this.material.getTechniqueConfig(this.output),this.technique)},t.prototype.beginSlot=function(e){if(2===this.output)return 22===e;if(5===this.output)return null==e;var t=3;return this.params.transparent&&(t=this.params.writeDepth?5:8),e===t},t.prototype.setElapsedTimeUniform=function(e){e.setUniform1f("timeElapsed",.001*this.material.animation.time*this.params.animationSpeed)},t.prototype._updateShadowState=function(e){e.shadowMappingEnabled!==this.params.receiveShadows&&(this.material.setParameterValues({receiveShadows:e.shadowMappingEnabled}),this.updateParameters())},t.prototype._updateSSRState=function(e){e.ssrEnabled!==this.params.ssrEnabled&&(this.material.setParameterValues({ssrEnabled:e.ssrEnabled}),this.updateParameters())},t.prototype.ensureResources=function(e){return this.technique.ensureResource(e)},t.prototype.ensureParameters=function(e){0===this.output&&(this._updateShadowState(e),this._updateSSRState(e))},t.prototype.bind=function(e,t){e.bindProgram(this.technique.program),this.technique.bindPass(e,this.params,t),2!==this.output&&0!==this.output||this.setElapsedTimeUniform(this.technique.program)},t}(r.GLMaterial);t.WaterGLMaterial=o}).apply(null,r))||(e.exports=a)},DKwL:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("zOht"),n("7Aei")],void 0===(a=(function(e,t,n,r){var a;Object.defineProperty(t,"__esModule",{value:!0}),t.RgbaFloatEncoding=function(e){var t=r.glsl(a||(a=n.__makeTemplateObject(["\n    // This is the maximum float value representable as 32bit fixed point,\n    // it is rgba2float(vec4(1)) inlined.\n    const float MAX_RGBA_FLOAT =\n      255.0 / 256.0 +\n      255.0 / 256.0 / 256.0 +\n      255.0 / 256.0 / 256.0 / 256.0 +\n      255.0 / 256.0 / 256.0 / 256.0 / 256.0;\n\n    // Factors to convert to fixed point, i.e. factors (256^0, 256^1, 256^2, 256^3)\n    const vec4 FIXED_POINT_FACTORS = vec4(1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0);\n\n    vec4 float2rgba(const float value) {\n      // Make sure value is in the domain we can represent\n      float valueInValidDomain = clamp(value, 0.0, MAX_RGBA_FLOAT);\n\n      // Decompose value in 32bit fixed point parts represented as\n      // uint8 rgba components. Decomposition uses the fractional part after multiplying\n      // by a power of 256 (this removes the bits that are represented in the previous\n      // component) and then converts the fractional part to 8bits.\n      vec4 fixedPointU8 = floor(fract(valueInValidDomain * FIXED_POINT_FACTORS) * 256.0);\n\n      // Convert uint8 values (from 0 to 255) to floating point representation for\n      // the shader\n      const float toU8AsFloat = 1.0 / 255.0;\n\n      return fixedPointU8 * toU8AsFloat;\n    }\n\n    // Factors to convert rgba back to float\n    const vec4 RGBA_2_FLOAT_FACTORS = vec4(\n      255.0 / (256.0),\n      255.0 / (256.0 * 256.0),\n      255.0 / (256.0 * 256.0 * 256.0),\n      255.0 / (256.0 * 256.0 * 256.0 * 256.0)\n    );\n\n    float rgba2float(vec4 rgba) {\n      // Convert components from 0->1 back to 0->255 and then\n      // add the components together with their corresponding\n      // fixed point factors, i.e. (256^1, 256^2, 256^3, 256^4)\n      return dot(rgba, RGBA_2_FLOAT_FACTORS);\n    }\n  "],["\n    // This is the maximum float value representable as 32bit fixed point,\n    // it is rgba2float(vec4(1)) inlined.\n    const float MAX_RGBA_FLOAT =\n      255.0 / 256.0 +\n      255.0 / 256.0 / 256.0 +\n      255.0 / 256.0 / 256.0 / 256.0 +\n      255.0 / 256.0 / 256.0 / 256.0 / 256.0;\n\n    // Factors to convert to fixed point, i.e. factors (256^0, 256^1, 256^2, 256^3)\n    const vec4 FIXED_POINT_FACTORS = vec4(1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0);\n\n    vec4 float2rgba(const float value) {\n      // Make sure value is in the domain we can represent\n      float valueInValidDomain = clamp(value, 0.0, MAX_RGBA_FLOAT);\n\n      // Decompose value in 32bit fixed point parts represented as\n      // uint8 rgba components. Decomposition uses the fractional part after multiplying\n      // by a power of 256 (this removes the bits that are represented in the previous\n      // component) and then converts the fractional part to 8bits.\n      vec4 fixedPointU8 = floor(fract(valueInValidDomain * FIXED_POINT_FACTORS) * 256.0);\n\n      // Convert uint8 values (from 0 to 255) to floating point representation for\n      // the shader\n      const float toU8AsFloat = 1.0 / 255.0;\n\n      return fixedPointU8 * toU8AsFloat;\n    }\n\n    // Factors to convert rgba back to float\n    const vec4 RGBA_2_FLOAT_FACTORS = vec4(\n      255.0 / (256.0),\n      255.0 / (256.0 * 256.0),\n      255.0 / (256.0 * 256.0 * 256.0),\n      255.0 / (256.0 * 256.0 * 256.0 * 256.0)\n    );\n\n    float rgba2float(vec4 rgba) {\n      // Convert components from 0->1 back to 0->255 and then\n      // add the components together with their corresponding\n      // fixed point factors, i.e. (256^1, 256^2, 256^3, 256^4)\n      return dot(rgba, RGBA_2_FLOAT_FACTORS);\n    }\n  "])));e.fragment.code.add(t),e.vertex.code.add(t)}}).apply(null,r))||(e.exports=a)},"EiD/":function(e,t,n){var r,a;r=[n.dj.c(e.i),t],void 0===(a=(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultTextureUnits={DIFFUSE:0,NORMAL:1,EMISSION:2,OCCLUSION:3,METALLIC_ROUGHNESS:4,SSAO:6,SHADOW_MAP:7}}).apply(null,r))||(e.exports=a)},EyQ4:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("qsST"),n("xoE+"),n("Zp3t")],void 0===(a=(function(e,t,n,r,a){Object.defineProperty(t,"__esModule",{value:!0});var i=n.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function o(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}var s=o("DXT1"),c=o("DXT3"),l=o("DXT5");function d(e,t){var n=new Int32Array(e,0,31);if(542327876!==n[0])return i.error("Invalid magic number in DDS header"),null;if(!(4&n[20]))return i.error("Unsupported format, must contain a FourCC code"),null;var a,o,d,u=n[21];switch(u){case s:a=8,o=33776;break;case c:a=16,o=33778;break;case l:a=16,o=33779;break;default:return i.error("Unsupported FourCC code:",(d=u,String.fromCharCode(255&d,d>>8&255,d>>16&255,d>>24&255))),null}var f=1,v=n[4],p=n[3];0==(3&v)&&0==(3&p)||(i.warn("Rounding up compressed texture size to nearest multiple of 4."),v=v+3&-4,p=p+3&-4);var h,m,g=v,y=p;131072&n[2]&&!1!==t&&(f=Math.max(1,n[7])),1===f||r.isPowerOfTwo(v)&&r.isPowerOfTwo(p)||(i.warn("Ignoring mipmaps of non power of two sized compressed texture."),f=1);for(var b=n[1]+4,x=[],w=0;w<f;++w)m=(v+3>>2)*(p+3>>2)*a,h=new Uint8Array(e,b,m),x.push(h),b+=m,v=Math.max(1,v>>1),p=Math.max(1,p>>1);return{textureData:{type:"compressed",levels:x},internalFormat:o,width:g,height:y}}t.createDDSTexture=function(e,t,n,r){var i=d(n,r),o=i.textureData,s=i.internalFormat,c=i.width,l=i.height;t.samplingMode=o.levels.length>1?9987:9729,t.hasMipmap=o.levels.length>1,t.internalFormat=s,t.width=c,t.height=l;var u=new a(e,t,o);return e.bindTexture(u),u},t.createDDSTextureData=d}).apply(null,r))||(e.exports=a)},FLCf:function(e,t,n){var r,a;r=[n.dj.c(e.i),t],void 0===(a=(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.makeNewRenderStats=function(){return{triangles:0,drawCalls:0}},t.addToRenderStats=function(e,t,n){n&&(n.drawCalls+=e,n.triangles+=t)};var n=function(){function e(){this.materialRenderStats=new Map,this.reset()}return e.prototype.getMaterialRenderStatsObject=function(e){var t=this.materialRenderStats.get(e);return t||this.materialRenderStats.set(e,t={triangles:0,drawCalls:0}),t},e.prototype.getAggregatedStats=function(){var e={materialRenderers:{},total:{triangles:0,drawCalls:0}};return this.materialRenderStats.forEach((function(t,n){e.materialRenderers[n]=t,e.total.drawCalls+=t.drawCalls,e.total.triangles+=t.triangles})),e},e.prototype.reset=function(){this.materialRenderStats.forEach((function(e){e.drawCalls=0,e.triangles=0}))},e}();t.RenderStatsAggregator=n}).apply(null,r))||(e.exports=a)},FNtW:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("LxLY"),n("W0kZ")],void 0===(a=(function(e,t,n,r){Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(t){this.supportsEdges=!1,this._visible=!0,this._renderOccluded=1,this._renderPriority=0,this._insertOrder=0,this.id=e._idGen.gen(t)}return e.prototype.dispose=function(){},e.prototype.update=function(e){return!1},Object.defineProperty(e.prototype,"visible",{get:function(){return this._visible},set:function(e){e!==this._visible&&(this._visible=e,this.parametersChanged())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"renderOccluded",{get:function(){return this._renderOccluded},set:function(e){e!==this._renderOccluded&&(this._renderOccluded=e,this.parametersChanged())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"renderPriority",{get:function(){return this._renderPriority},set:function(e){e!==this._renderPriority&&(this._renderPriority=e,this.parametersChanged())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"insertOrder",{get:function(){return this._insertOrder},set:function(e){e!==this._insertOrder&&(this._insertOrder=e,this.parametersChanged())},enumerable:!0,configurable:!0}),e.prototype.isVisibleInPass=function(e){return!0},e.prototype.isVisible=function(){return this._visible},e.prototype.parametersChanged=function(){n.isSome(this.materialRepository)&&this.materialRepository.materialChanged(this)},e._idGen=new r.IdGen,e}();t.Material=a,t.materialPredicate=function(e,t){return e.isVisible()&&e.isVisibleInPass(t.pass)&&0!=(e.renderOccluded&t.renderOccludedMask)}}).apply(null,r))||(e.exports=a)},FQ4r:function(e,t,n){var r,a;r=[n.dj.c(e.i),t],void 0===(a=(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){t&&(this._config=function(e){var t=e.__proto__.__configurationParameters||[],n={};n.key=e.key;for(var r=0,a=t;r<a.length;r++){var i=a[r];n[i]=e[i]}return n}(t)),this._program=this.initializeProgram(e),e.commonUniformStore&&(this._commonUniformStore=e.commonUniformStore,this._commonUniformStore.subscribeProgram(this._program)),this._pipeline=this.initializePipeline(e)}return e.prototype.dispose=function(){this._program&&(this._commonUniformStore&&this._commonUniformStore.unsubscribeProgram(this._program),this._program.dispose(),this._program=null)},e.prototype.reload=function(e){this._program&&(this._commonUniformStore&&this._commonUniformStore.unsubscribeProgram(this._program),this._program.dispose()),this._program=this.initializeProgram(e),this._commonUniformStore&&this._commonUniformStore.subscribeProgram(this._program)},Object.defineProperty(e.prototype,"program",{get:function(){return this._program},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pipeline",{get:function(){return this._pipeline},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"key",{get:function(){return this._config.key},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"configuration",{get:function(){return this._config},enumerable:!0,configurable:!0}),e.prototype.bindPass=function(e,t,n){},e.prototype.bindMaterial=function(e,t,n){},e.prototype.bindDraw=function(e,t,n){},e.prototype.bindPipelineState=function(e){e.setPipelineState(this.pipeline)},e.prototype.ensureAttributeLocations=function(e){this.program.assertCompatibleVertexAttributeLocations(e)},Object.defineProperty(e.prototype,"primitiveType",{get:function(){return 4},enumerable:!0,configurable:!0}),e}();t.ShaderTechnique=n}).apply(null,r))||(e.exports=a)},GG08:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("xoE+"),n("0LE5"),n("JjCO")],void 0===(a=(function(e,t,n,r,a){function i(e){return void 0===e&&(e=t.UP),[e[0],e[1],e[2],e[3]]}function o(e,t){return void 0===t&&(t=i()),s(e[0],e[1],e[2],e[3],t)}function s(e,t,n,r,a){return void 0===a&&(a=i()),a[0]=e,a[1]=t,a[2]=n,a[3]=r,a}function c(e,t,n){void 0===n&&(n=i()),r.vec3.copy(n,t);var a=r.vec3.dot(t,t);return Math.abs(a-1)>1e-5&&a>1e-12&&r.vec3.scale(n,n,1/Math.sqrt(a)),l(n,e,n),n}function l(e,t,n){return e!==n&&o(e,n),n[3]=-r.vec3.dot(n,t),n}function d(e,t,n,o){return void 0===o&&(o=i()),c(n,r.vec3.cross(a.sv3d.get(),t,e),o)}function u(e,t,n){var i=r.vec3.scale(a.sv3d.get(),e,r.vec3.dot(e,t));return r.vec3.subtract(n,t,i),n}function f(e,t){return r.vec3.dot(e,t)+e[3]}function v(e,t,a,i,o,s){var c=r.vec3.dot(e,a);if(0===c)return!1;var l=-(r.vec3.dot(e,t)+e[3])/c;return o&&(l=i?Math.max(0,l):n.clamp(l,0,1)),!(l<0||!i&&l>1||(r.vec3.add(s,t,r.vec3.scale(s,a,l)),0))}Object.defineProperty(t,"__esModule",{value:!0}),t.create=i,t.wrap=function(e,t,n,r){return s(e,t,n,r,a.sv4d.get())},t.copy=o,t.fromValues=s,t.fromNormalAndOffset=function(e,t,n){return void 0===n&&(n=i()),r.vec3.copy(n,e),n[3]=t,n},t.fromPositionAndNormal=c,t.fromPoints=function(e,t,n,o){return void 0===o&&(o=i()),d(r.vec3.subtract(a.sv3d.get(),e,t),r.vec3.subtract(a.sv3d.get(),n,t),e,o)},t.setOffsetFromPoint=l,t.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},t.fromVectorsAndPoint=d,t.intersectRay=function(e,t,n){return v(e,t.origin,t.direction,!0,!1,n)},t.intersectLineSegment=function(e,t,n){return v(e,t.origin,t.vector,!1,!1,n)},t.intersectLineSegmentClamp=function(e,t,n){return v(e,t.origin,t.vector,!1,!0,n)},t.isSphereFullyInside=function(e,t){var n=t.radius;return f(e,t.center)-n>=0},t.isSphereFullyOutside=function(e,t){var n=t.radius;return f(e,t.center)+n<0},t.isPointInside=function(e,t){return f(e,t)>=0},t.isPointOutside=function(e,t){return f(e,t)<0},t.isAABBFullyInside=function(e,t){return e[0]*(e[0]>0?t[0]:t[3])+e[1]*(e[1]>0?t[1]:t[4])+e[2]*(e[2]>0?t[2]:t[5])+e[3]>=0},t.clip=function(e,t){var n=r.vec3.dot(e,t.ray.direction),a=-f(e,t.ray.origin);if(a<0&&n>=0)return!1;if(n>-1e-6&&n<1e-6)return a>0;if((a<0||n<0)&&!(a<0&&n<0))return!0;var i=a/n;return n>0?i<t.c1&&(t.c1=i):i>t.c0&&(t.c0=i),t.c0<=t.c1},t.clipInfinite=function(e,t){var n=r.vec3.dot(e,t.ray.direction),a=-f(e,t.ray.origin);if(n>-1e-6&&n<1e-6)return a>0;var i=a/n;return n>0?i<t.c1&&(t.c1=i):i>t.c0&&(t.c0=i),t.c0<=t.c1},t.projectPoint=function(e,t,n){var i=r.vec3.scale(a.sv3d.get(),e,-e[3]),o=u(e,r.vec3.subtract(a.sv3d.get(),t,i),a.sv3d.get());return r.vec3.add(n,o,i),n},t.projectVector=u,t.distance=function(e,t){return Math.abs(f(e,t))},t.signedDistance=f,t.normal=function(e){return e},t.UP=[0,0,1,0]}).apply(null,r))||(e.exports=a)},GyfB:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("0LE5"),n("JjCO"),n("18xY")],void 0===(a=(function(e,t,n,r,a){function i(e){return void 0===e&&(e=t.UP),[e[0],e[1],e[2],e[3]]}function o(e,t,n,r,a){return void 0===a&&(a=i()),a[0]=e,a[1]=t,a[2]=n,a[3]=r,a}Object.defineProperty(t,"__esModule",{value:!0}),t.create=i,t.wrap=function(e,t,n,a){return o(e,t,n,a,r.sv4d.get())},t.wrapAxisAngle=function(e,t){return o(e[0],e[1],e[2],t,r.sv4d.get())},t.copy=function(e,t){return void 0===t&&(t=i()),o(e[0],e[1],e[2],e[3],t)},t.fromValues=o,t.fromAxisAndAngle=function(e,t,r){return void 0===r&&(r=i()),n.vec3.copy(r,e),r[3]=t,r},t.fromPoints=function(e,t,r){return void 0===r&&(r=i()),n.vec3.cross(r,e,t),n.vec3.normalize(r,r),r[3]=a.angle(e,t),r},t.UP=[0,0,1,0]}).apply(null,r))||(e.exports=a)},ILj8:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("VfPl"),n("CIy2")],void 0===(a=(function(e,t,n,r){function a(e,t,n,r,a){var i=n.typedBuffer,o=n.typedBufferStride,s=e.length;if(r*=o,null==a||1===a)for(var c=0;c<s;++c){var l=2*e[c];i[r]=t[l],i[r+1]=t[l+1],r+=o}else for(c=0;c<s;++c){l=2*e[c];for(var d=0;d<a;++d)i[r]=t[l],i[r+1]=t[l+1],r+=o}}function i(e,t,n,r,a){var i=n.typedBuffer,o=n.typedBufferStride,s=e.length;if(r*=o,null==a||1===a)for(var c=0;c<s;++c){var l=3*e[c];i[r]=t[l],i[r+1]=t[l+1],i[r+2]=t[l+2],r+=o}else for(c=0;c<s;++c){l=3*e[c];for(var d=0;d<a;++d)i[r]=t[l],i[r+1]=t[l+1],i[r+2]=t[l+2],r+=o}}function o(e,t,n,r,a){var i=n.typedBuffer,o=n.typedBufferStride,s=e.length;if(r*=o,null==a||1===a)for(var c=0;c<s;++c){var l=4*e[c];i[r]=t[l],i[r+1]=t[l+1],i[r+2]=t[l+2],i[r+3]=t[l+3],r+=o}else for(c=0;c<s;++c){l=4*e[c];for(var d=0;d<a;++d)i[r]=t[l],i[r+1]=t[l+1],i[r+2]=t[l+2],i[r+3]=t[l+3],r+=o}}function s(e,t,n,r,a,o){if(n){var s=n,c=r.typedBuffer,l=r.typedBufferStride,d=e.length;if(a*=l,null==o||1===o)for(var u=0;u<d;++u){var f=t[h=3*e[u]],v=t[h+1],p=t[h+2];c[a]=s[0]*f+s[4]*v+s[8]*p+s[12],c[a+1]=s[1]*f+s[5]*v+s[9]*p+s[13],c[a+2]=s[2]*f+s[6]*v+s[10]*p+s[14],a+=l}else for(u=0;u<d;++u){f=t[h=3*e[u]];for(var h,m=s[0]*f+s[4]*(v=t[h+1])+s[8]*(p=t[h+2])+s[12],g=s[1]*f+s[5]*v+s[9]*p+s[13],y=s[2]*f+s[6]*v+s[10]*p+s[14],b=0;b<o;++b)c[a]=m,c[a+1]=g,c[a+2]=y,a+=l}}else i(e,t,r,a,o)}function c(e,t,n,r,a,o){if(n){var s=r.typedBuffer,c=r.typedBufferStride,l=e.length,d=n[0],u=n[1],f=n[2],v=n[4],p=n[5],h=n[6],m=n[8],g=n[9],y=n[10],b=Math.abs(1-d*d+v*v+m*m)>1e-5||Math.abs(1-u*u+p*p+g*g)>1e-5||Math.abs(1-f*f+h*h+y*y)>1e-5;if(a*=c,null==o||1===o)for(var x=0;x<l;++x){var w=d*(O=t[P=3*e[x]])+v*(M=t[P+1])+m*(A=t[P+2]),_=u*O+p*M+g*A,S=f*O+h*M+y*A;b&&(C=w*w+_*_+S*S)<.999999&&C>1e-6&&(w/=T=Math.sqrt(C),_/=T,S/=T),s[a+0]=w,s[a+1]=_,s[a+2]=S,a+=c}else for(x=0;x<l;++x){var P,O,M,A,C,T,z=d*(O=t[P=3*e[x]])+v*(M=t[P+1])+m*(A=t[P+2]),I=u*O+p*M+g*A,D=f*O+h*M+y*A;b&&(C=z*z+I*I+D*D)<.999999&&C>1e-6&&(z/=T=Math.sqrt(C),I/=T,D/=T);for(var j=0;j<o;++j)s[a+0]=z,s[a+1]=I,s[a+2]=D,a+=c}}else i(e,t,r,a,o)}function l(e,t,n,r,a,i){var o=r.typedBuffer,s=r.typedBufferStride,c=e.length;if(a*=s,null==i||1===i){if(4===n)for(var l=0;l<c;++l){var d=4*e[l];o[a]=t[d],o[a+1]=t[d+1],o[a+2]=t[d+2],o[a+3]=t[d+3],a+=s}else if(3===n)for(l=0;l<c;++l)o[a]=t[d=3*e[l]],o[a+1]=t[d+1],o[a+2]=t[d+2],o[a+3]=255,a+=s}else if(4===n)for(l=0;l<c;++l){d=4*e[l];for(var u=0;u<i;++u)o[a]=t[d],o[a+1]=t[d+1],o[a+2]=t[d+2],o[a+3]=t[d+3],a+=s}else if(3===n)for(l=0;l<c;++l)for(d=3*e[l],u=0;u<i;++u)o[a]=t[d],o[a+1]=t[d+1],o[a+2]=t[d+2],o[a+3]=255,a+=s}Object.defineProperty(t,"__esModule",{value:!0}),t.writeBufferVec2=a,t.writeBufferVec3=i,t.writeBufferVec4=o,t.writeBufferMat3f=function(e,t,n,r){var a=n.typedBuffer,i=n.typedBufferStride,o=e.length;r*=i;for(var s=0;s<o;++s){for(var c=9*e[s],l=0;l<9;++l)a[r+l]=t[c+l];r+=i}},t.writeBufferMat4f=function(e,t,n,r){var a=n.typedBuffer,i=n.typedBufferStride,o=e.length;r*=i;for(var s=0;s<o;++s){for(var c=16*e[s],l=0;l<16;++l)a[r+l]=t[c+l];r+=i}},t.writePosition=s,t.writeNormal=c,t.writeColor=l,t.writeMultipliedColor=function(e,t,n,r,a,i,o){var s=a.typedBuffer,c=a.typedBufferStride,l=e.length;if(i*=c,null==o||1===o){if(4===n)for(var d=0;d<l;++d){var u=4*e[d];s[i]=t[u]*r[0],s[i+1]=t[u+1]*r[1],s[i+2]=t[u+2]*r[2],s[i+3]=t[u+3]*r[3],i+=c}else if(3===n){var f=255*r[3];for(d=0;d<l;++d)s[i]=t[u=3*e[d]]*r[0],s[i+1]=t[u+1]*r[1],s[i+2]=t[u+2]*r[2],s[i+3]=f,i+=c}}else if(4===n)for(d=0;d<l;++d){u=4*e[d];for(var v=0;v<o;++v)s[i]=t[u]*r[0],s[i+1]=t[u+1]*r[1],s[i+2]=t[u+2]*r[2],s[i+3]=t[u+3]*r[3],i+=c}else if(3===n)for(f=255*r[3],d=0;d<l;++d)for(u=3*e[d],v=0;v<o;++v)s[i]=t[u]*r[0],s[i+1]=t[u+1]*r[1],s[i+2]=t[u+2]*r[2],s[i+3]=f,i+=c},t.writeDefaultAttributes=function(e,t,i,d,u,f){for(var v=0,p=t.fieldNames;v<p.length;v++){var h=p[v],m=e.vertexAttr[h],g=e.indices[h];if(m&&g)switch(h){case r.VertexAttrConstants.POSITION:r.assert(3===m.size);var y=u.getField(h,n.BufferViewVec3f);y&&s(g,m.data,i,y,f);break;case r.VertexAttrConstants.NORMAL:r.assert(3===m.size);var b=u.getField(h,n.BufferViewVec3f);b&&c(g,m.data,d,b,f);break;case r.VertexAttrConstants.UV0:r.assert(2===m.size);var x=u.getField(h,n.BufferViewVec2f);x&&a(g,m.data,x,f);break;case r.VertexAttrConstants.COLOR:r.assert(3===m.size||4===m.size);var w=u.getField(h,n.BufferViewVec4u8);w&&l(g,m.data,m.size,w,f);break;case r.VertexAttrConstants.SYMBOLCOLOR:r.assert(3===m.size||4===m.size);var _=u.getField(h,n.BufferViewVec4u8);_&&l(g,m.data,m.size,_,f);break;case r.VertexAttrConstants.TANGENT:r.assert(4===m.size);var S=u.getField(h,n.BufferViewVec4f);S&&o(g,m.data,S,f)}}}}).apply(null,r))||(e.exports=a)},IwVr:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("zOht"),n("7Aei")],void 0===(a=(function(e,t,n,r){var a,i,o,s;Object.defineProperty(t,"__esModule",{value:!0}),t.defaultMaskAlphaCutoff=.1,t.symbolAlphaCutoff=.001,t.DiscardOrAdjustAlpha=function(e,t){var c=e.fragment;switch(t.alphaDiscardMode){case 0:c.code.add(r.glsl(a||(a=n.__makeTemplateObject(["\n        void discardOrAdjustAlpha(inout vec4 color) {}\n      "],["\n        void discardOrAdjustAlpha(inout vec4 color) {}\n      "]))));break;case 1:c.code.add(r.glsl(i||(i=n.__makeTemplateObject(["\n        void discardOrAdjustAlpha(inout vec4 color) {\n          color.a = 1.0;\n        }\n      "],["\n        void discardOrAdjustAlpha(inout vec4 color) {\n          color.a = 1.0;\n        }\n      "]))));break;case 2:c.uniforms.add("textureAlphaCutoff","float"),c.code.add(r.glsl(o||(o=n.__makeTemplateObject(["\n        #define discardOrAdjustAlpha(color) { if (color.a < textureAlphaCutoff) { discard; } else { color.a = 1.0; } }\n      "],["\n        #define discardOrAdjustAlpha(color) { if (color.a < textureAlphaCutoff) { discard; } else { color.a = 1.0; } }\n      "]))));break;case 3:e.fragment.uniforms.add("textureAlphaCutoff","float"),e.fragment.code.add(r.glsl(s||(s=n.__makeTemplateObject(["\n        #define discardOrAdjustAlpha(color) { if (color.a < textureAlphaCutoff) { discard; } }\n      "],["\n        #define discardOrAdjustAlpha(color) { if (color.a < textureAlphaCutoff) { discard; } }\n      "]))))}}}).apply(null,r))||(e.exports=a)},JjCO:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("wSO/")],void 0===(a=(function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.sv2d=n.VectorStack.createVec2f64(),t.sv3d=n.VectorStack.createVec3f64(),t.sv4d=n.VectorStack.createVec4f64(),t.sm3d=n.VectorStack.createMat3f64(),t.sm4d=n.VectorStack.createMat4f64(),t.sq4d=n.VectorStack.createQuatf64()}).apply(null,r))||(e.exports=a)},KRuQ:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("zOht")],a=(function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.AutoDisposableMixin=function(e){return function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._isDisposed=!1,t}return n.__extends(t,e),t.prototype.dispose=function(){for(var e=this.__proto__.__managedDisposables__||[],t=e.length-1;t>=0;t--){var n=e[t];this[n]&&"function"==typeof this[n].dispose&&this[n].dispose(),this[n]=null}this._isDisposed=!0},Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._isDisposed},enumerable:!0,configurable:!0}),t}(e)};var r=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t}(t.AutoDisposableMixin((function(){})));t.AutoDisposable=r,t.autoDispose=function(){return function(e,t){e.hasOwnProperty("__managedDisposables__")||(e.__managedDisposables__=e.__managedDisposables__?e.__managedDisposables__.slice():[]),e.__managedDisposables__.push(t)}}}).apply(null,r),void 0===a||(e.exports=a)},N5NQ:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("xoE+"),n("PHan"),n("0LE5"),n("Rdxj"),n("JjCO")],void 0===(a=(function(e,t,n,r,a,i,o){function s(e){return e?{origin:i.vec3f64.clone(e.origin),vector:i.vec3f64.clone(e.vector)}:{origin:i.vec3f64.create(),vector:i.vec3f64.create()}}function c(e,t){var n=p.get();return n.origin=e,n.vector=t,n}function l(e,t,n){return void 0===n&&(n=s()),a.vec3.copy(n.origin,e),a.vec3.copy(n.vector,t),n}function d(e,t){var r=a.vec3.subtract(o.sv3d.get(),t,e.origin),i=a.vec3.dot(e.vector,r),s=a.vec3.dot(e.vector,e.vector),c=n.clamp(i/s,0,1),l=a.vec3.subtract(o.sv3d.get(),a.vec3.scale(o.sv3d.get(),e.vector,c),r);return a.vec3.dot(l,l)}function u(e,t,r,i,s){var c=e.vector,l=e.origin,d=a.vec3.subtract(o.sv3d.get(),t,l),u=a.vec3.length(c),f=a.vec3.dot(c,d)/u;return a.vec3.scale(s,c,n.clamp(f,r,i)),a.vec3.add(s,s,e.origin)}function f(e,t,r,i){var s=e.origin,c=a.vec3.add(o.sv3d.get(),s,e.vector),l=t.origin,d=a.vec3.add(o.sv3d.get(),l,t.vector),u=o.sv3d.get(),f=o.sv3d.get();if(u[0]=s[0]-l[0],u[1]=s[1]-l[1],u[2]=s[2]-l[2],f[0]=d[0]-l[0],f[1]=d[1]-l[1],f[2]=d[2]-l[2],Math.abs(f[0])<1e-6&&Math.abs(f[1])<1e-6&&Math.abs(f[2])<1e-6)return!1;var v=o.sv3d.get();if(v[0]=c[0]-s[0],v[1]=c[1]-s[1],v[2]=c[2]-s[2],Math.abs(v[0])<1e-6&&Math.abs(v[1])<1e-6&&Math.abs(v[2])<1e-6)return!1;var p=u[0]*f[0]+u[1]*f[1]+u[2]*f[2],h=f[0]*v[0]+f[1]*v[1]+f[2]*v[2],m=u[0]*v[0]+u[1]*v[1]+u[2]*v[2],g=f[0]*f[0]+f[1]*f[1]+f[2]*f[2],y=(v[0]*v[0]+v[1]*v[1]+v[2]*v[2])*g-h*h;if(Math.abs(y)<1e-6)return!1;var b=(p*h-m*g)/y,x=(p+h*b)/g;r&&(b=n.clamp(b,0,1),x=n.clamp(x,0,1));var w=o.sv3d.get(),_=o.sv3d.get();return w[0]=s[0]+b*v[0],w[1]=s[1]+b*v[1],w[2]=s[2]+b*v[2],_[0]=l[0]+x*f[0],_[1]=l[1]+x*f[1],_[2]=l[2]+x*f[2],i.tA=b,i.tB=x,i.pA=w,i.pB=_,i.distance2=a.vec3.squaredDistance(w,_),!0}Object.defineProperty(t,"__esModule",{value:!0}),t.create=s,t.wrap=c,t.copy=function(e,t){return void 0===t&&(t=s()),l(e.origin,e.vector,t)},t.fromValues=l,t.fromPoints=function(e,t,n){return void 0===n&&(n=s()),a.vec3.copy(n.origin,e),a.vec3.subtract(n.vector,t,e),n},t.distance2=d,t.distance=function(e,t){return Math.sqrt(d(e,t))},t.projectPoint=function(e,t,n){return u(e,t,0,1,n)},t.pointAt=function(e,t,n){return a.vec3.add(n,e.origin,a.vec3.scale(n,e.vector,t))},t.projectPointClamp=u,t.closestRayDistance2=function(e,t){if(f(e,c(t.origin,t.direction),!1,v)){var n=v.tA,r=v.pB;if(n>=0&&n<=1)return v.distance2;if(n<0)return a.vec3.squaredDistance(e.origin,r);if(n>1)return a.vec3.squaredDistance(a.vec3.add(o.sv3d.get(),e.origin,e.vector),r)}return null},t.closestLineSegmentPoint=function(e,t,n){return!!f(e,t,!0,v)&&(a.vec3.copy(n,v.pA),!0)},t.closestLineSegmentDistance2=function(e,t){return f(e,t,!0,v)?v.distance2:null};var v={tA:0,tB:0,pA:i.vec3f64.create(),pB:i.vec3f64.create(),distance2:0},p=new r.ObjectStack((function(){return{origin:null,vector:null}}))}).apply(null,r))||(e.exports=a)},PHan:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("6DRN")],void 0===(a=(function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e){var t=this;this.allocator=e,this.items=[],this.itemsPtr=0,this.tickHandle=n.before((function(){return t.reset()})),this.grow()}return e.prototype.destroy=function(){this.tickHandle&&(this.tickHandle.remove(),this.tickHandle=null),this.items=null},e.prototype.get=function(){return 0===this.itemsPtr&&n((function(){})),this.itemsPtr===this.items.length&&this.grow(),this.items[this.itemsPtr++]},e.prototype.reset=function(){var e=Math.min(3*Math.max(8,this.itemsPtr),this.itemsPtr+3*a);this.items.length=Math.min(e,this.items.length),this.itemsPtr=0},e.prototype.grow=function(){for(var e=0;e<Math.max(8,Math.min(this.items.length,a));e++)this.items.push(this.allocator())},e}();t.ObjectStack=r;var a=1024;t.default=r}).apply(null,r))||(e.exports=a)},PaEL:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("zOht"),n("7Aei")],void 0===(a=(function(e,t,n,r){function a(e){e.fragment.uniforms.add("depthTex","sampler2D"),e.fragment.uniforms.add("highlightViewportPixelSz","vec4"),e.fragment.code.add(r.glsl(i||(i=n.__makeTemplateObject(["\n    void outputHighlight() {\n      vec4 fragCoord = gl_FragCoord;\n\n      float sceneDepth = texture2D(depthTex, (fragCoord.xy - highlightViewportPixelSz.xy) * highlightViewportPixelSz.zw).r;\n      if (fragCoord.z > sceneDepth + 5e-7) {\n        gl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);\n      }\n      else {\n        gl_FragColor = vec4(1.0, 0.0, 1.0, 1.0);\n      }\n    }\n  "],["\n    void outputHighlight() {\n      vec4 fragCoord = gl_FragCoord;\n\n      float sceneDepth = texture2D(depthTex, (fragCoord.xy - highlightViewportPixelSz.xy) * highlightViewportPixelSz.zw).r;\n      if (fragCoord.z > sceneDepth + 5e-7) {\n        gl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);\n      }\n      else {\n        gl_FragColor = vec4(1.0, 0.0, 1.0, 1.0);\n      }\n    }\n  "]))))}var i;Object.defineProperty(t,"__esModule",{value:!0}),t.OutputHighlight=a,function(e){e.bindOutputHighlight=function(e,t,n){e.bindTexture(n.highlightDepthTexture,5),t.setUniform1i("depthTex",5),t.setUniform4f("highlightViewportPixelSz",0,0,1/n.viewport[2],1/n.viewport[3])}}(a=t.OutputHighlight||(t.OutputHighlight={}))}).apply(null,r))||(e.exports=a)},"PwS/":function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("LxLY"),n("LxLY"),n("FXVB"),n("1m5D"),n("1f+t"),n("CIy2")],void 0===(a=(function(e,t,n,r,a,i,o,s){Object.defineProperty(t,"__esModule",{value:!0}),t.addObject3DStateID=function(e,t){return n.isNone(e)&&(e=[]),e.push(t),e},t.removeObject3DStateID=function(e,t){if(n.isNone(e))return e;var r=e.filter((function(e){return e!==t}));return 0===r.length?null:r},t.isInstanceHidden=function(e){return!!r.isSome(e)&&!e.visible},t.acquireMaterials=function(e,t){var n=new Map;return n.set(0,t.acquire(e,0)),n.set(3,t.acquire(e,3)),n.set(2,t.acquire(e,2)),n.set(1,t.acquire(e,1)),n.set(4,t.acquire(e,4)),n},t.releaseMaterials=function(e,t){t.release(e,0),t.release(e,3),t.release(e,2),t.release(e,1),t.release(e,4)},t.calculateTransformRelToOrigin=function(e,t,n){var i=e.origin.vec3;s.setMatrixTranslation3(d,-i[0],-i[1],-i[2]),r.isSome(e.transformation)?a.mat4.multiply(t,d,e.transformation):a.mat4.copy(t,d),n&&(a.mat4.invert(n,t),a.mat4.transpose(n,n))},t.encodeDoubleVec3=function(e,t,n,r,a){c[0]=e.get(t,0),c[1]=e.get(t,1),c[2]=e.get(t,2),o.encodeDoubleArray(c,l,3),n.set(a,0,l[0]),r.set(a,0,l[1]),n.set(a,1,l[2]),r.set(a,1,l[3]),n.set(a,2,l[4]),r.set(a,2,l[5])};var c=new Float64Array(3),l=new Float32Array(6),d=i.mat4f64.create()}).apply(null,r))||(e.exports=a)},"RdU/":function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("zOht"),n("B4Pz"),n("7Aei")],void 0===(a=(function(e,t,n,r,a){function i(e){e.fragment.uniforms.add("texWaveNormal","sampler2D"),e.fragment.uniforms.add("texWavePerturbation","sampler2D"),e.fragment.uniforms.add("waveParams","vec4"),e.fragment.uniforms.add("waveDirection","vec2"),e.include(r.FoamIntensity),e.fragment.code.add(a.glsl(o||(o=n.__makeTemplateObject(["\n      const vec2  FLOW_JUMP = vec2(6.0/25.0, 5.0/24.0);\n\n      vec2 textureDenormalized2D(sampler2D _tex, vec2 _uv) {\n        return 2.0 * texture2D(_tex, _uv).rg - 1.0;\n      }\n\n      float sampleNoiseTexture(vec2 _uv) {\n        return texture2D(texWavePerturbation, _uv).b;\n      }\n\n      vec3 textureDenormalized3D(sampler2D _tex, vec2 _uv) {\n        return 2.0 * texture2D(_tex, _uv).rgb - 1.0;\n      }\n\n      float computeProgress(vec2 uv, float time) {\n        return fract(time);\n      }\n\n      float computeWeight(vec2 uv, float time) {\n        float progress = computeProgress(uv, time);\n        return 1.0 - abs(1.0 - 2.0 * progress);\n      }\n\n      vec3 computeUVPerturbedWeigth(sampler2D texFlow, vec2 uv, float time, float phaseOffset) {\n        float flowStrength = waveParams[2];\n        float flowOffset = waveParams[3];\n\n        vec2 flowVector = textureDenormalized2D(texFlow, uv) * flowStrength;\n\n        float progress = computeProgress(uv, time + phaseOffset);\n        float weight = computeWeight(uv, time + phaseOffset);\n\n        vec2 result = uv;\n        result -= flowVector * (progress + flowOffset);\n        result += phaseOffset;\n        result += (time - progress) * FLOW_JUMP;\n\n        return vec3(result, weight);\n      }\n\n      const float TIME_NOISE_TEXTURE_REPEAT = 0.3737;\n      const float TIME_NOISE_STRENGTH = 7.77;\n\n      vec3 getWaveLayer(sampler2D _texNormal, sampler2D _dudv, vec2 _uv, vec2 _waveDir, float time) {\n        float waveStrength = waveParams[0];\n\n        // overall directional shift in uv's for directional wave movement for\n        // now we do a hard coded scale for wave speed such that a unit length\n        // direction is not too fast.\n        vec2 waveMovement = time * -_waveDir;\n\n        float timeNoise = sampleNoiseTexture(_uv * TIME_NOISE_TEXTURE_REPEAT) * TIME_NOISE_STRENGTH;\n\n        // compute two perturbed uvs and blend weights\n        // then sample the wave normals at the two positions and blend\n        vec3 uv_A = computeUVPerturbedWeigth(_dudv, _uv + waveMovement, time + timeNoise, 0.0);\n        vec3 uv_B = computeUVPerturbedWeigth(_dudv, _uv + waveMovement, time + timeNoise, 0.5);\n\n        vec3 normal_A = textureDenormalized3D(_texNormal, uv_A.xy) * uv_A.z;\n        vec3 normal_B = textureDenormalized3D(_texNormal, uv_B.xy) * uv_B.z;\n\n        // logic to flatten the wave pattern\n        // scale xy components of the normal, then adjust z (up) component\n        vec3 mixNormal = normalize(normal_A + normal_B);\n        mixNormal.xy *= waveStrength;\n        mixNormal.z = sqrt(1.0 - dot(mixNormal.xy, mixNormal.xy));\n\n        return mixNormal;\n      }\n\n      vec4 getSurfaceNormalAndFoam(vec2 _uv, float _time) {\n        float waveTextureRepeat = waveParams[1];\n        vec3 normal = getWaveLayer(texWaveNormal, texWavePerturbation, _uv * waveTextureRepeat, waveDirection, _time);\n        float foam  = normals2FoamIntensity(normal, waveParams[0]);\n        return vec4(normal, foam);\n      }\n    "],["\n      const vec2  FLOW_JUMP = vec2(6.0/25.0, 5.0/24.0);\n\n      vec2 textureDenormalized2D(sampler2D _tex, vec2 _uv) {\n        return 2.0 * texture2D(_tex, _uv).rg - 1.0;\n      }\n\n      float sampleNoiseTexture(vec2 _uv) {\n        return texture2D(texWavePerturbation, _uv).b;\n      }\n\n      vec3 textureDenormalized3D(sampler2D _tex, vec2 _uv) {\n        return 2.0 * texture2D(_tex, _uv).rgb - 1.0;\n      }\n\n      float computeProgress(vec2 uv, float time) {\n        return fract(time);\n      }\n\n      float computeWeight(vec2 uv, float time) {\n        float progress = computeProgress(uv, time);\n        return 1.0 - abs(1.0 - 2.0 * progress);\n      }\n\n      vec3 computeUVPerturbedWeigth(sampler2D texFlow, vec2 uv, float time, float phaseOffset) {\n        float flowStrength = waveParams[2];\n        float flowOffset = waveParams[3];\n\n        vec2 flowVector = textureDenormalized2D(texFlow, uv) * flowStrength;\n\n        float progress = computeProgress(uv, time + phaseOffset);\n        float weight = computeWeight(uv, time + phaseOffset);\n\n        vec2 result = uv;\n        result -= flowVector * (progress + flowOffset);\n        result += phaseOffset;\n        result += (time - progress) * FLOW_JUMP;\n\n        return vec3(result, weight);\n      }\n\n      const float TIME_NOISE_TEXTURE_REPEAT = 0.3737;\n      const float TIME_NOISE_STRENGTH = 7.77;\n\n      vec3 getWaveLayer(sampler2D _texNormal, sampler2D _dudv, vec2 _uv, vec2 _waveDir, float time) {\n        float waveStrength = waveParams[0];\n\n        // overall directional shift in uv's for directional wave movement for\n        // now we do a hard coded scale for wave speed such that a unit length\n        // direction is not too fast.\n        vec2 waveMovement = time * -_waveDir;\n\n        float timeNoise = sampleNoiseTexture(_uv * TIME_NOISE_TEXTURE_REPEAT) * TIME_NOISE_STRENGTH;\n\n        // compute two perturbed uvs and blend weights\n        // then sample the wave normals at the two positions and blend\n        vec3 uv_A = computeUVPerturbedWeigth(_dudv, _uv + waveMovement, time + timeNoise, 0.0);\n        vec3 uv_B = computeUVPerturbedWeigth(_dudv, _uv + waveMovement, time + timeNoise, 0.5);\n\n        vec3 normal_A = textureDenormalized3D(_texNormal, uv_A.xy) * uv_A.z;\n        vec3 normal_B = textureDenormalized3D(_texNormal, uv_B.xy) * uv_B.z;\n\n        // logic to flatten the wave pattern\n        // scale xy components of the normal, then adjust z (up) component\n        vec3 mixNormal = normalize(normal_A + normal_B);\n        mixNormal.xy *= waveStrength;\n        mixNormal.z = sqrt(1.0 - dot(mixNormal.xy, mixNormal.xy));\n\n        return mixNormal;\n      }\n\n      vec4 getSurfaceNormalAndFoam(vec2 _uv, float _time) {\n        float waveTextureRepeat = waveParams[1];\n        vec3 normal = getWaveLayer(texWaveNormal, texWavePerturbation, _uv * waveTextureRepeat, waveDirection, _time);\n        float foam  = normals2FoamIntensity(normal, waveParams[0]);\n        return vec4(normal, foam);\n      }\n    "]))))}var o;Object.defineProperty(t,"__esModule",{value:!0}),t.WaterDistortion=i,function(e){e.bindUniforms=function(e,t){e.setUniform1i("texWaveNormal",0),e.setUniform1i("texWavePerturbation",1),e.setUniform4f("waveParams",t.waveStrength,t.waveTextureRepeat,t.flowStrength,t.flowOffset),e.setUniform2f("waveDirection",t.waveDirection[0]*t.waveVelocity,t.waveDirection[1]*t.waveVelocity)}}(i=t.WaterDistortion||(t.WaterDistortion={}))}).apply(null,r))||(e.exports=a)},"W/V4":function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("zOht")],void 0===(a=(function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){this._module=e,this._loadModule=t}return e.prototype.get=function(){return this._module},e.prototype.reload=function(){return n.__awaiter(this,void 0,void 0,(function(){var e;return n.__generator(this,(function(t){switch(t.label){case 0:return e=this,[4,this._loadModule()];case 1:return e._module=t.sent(),[2,this._module]}}))}))},e}();t.ReloadableShaderModule=r}).apply(null,r))||(e.exports=a)},W0kZ:function(e,t,n){var r,a;r=[n.dj.c(e.i),t],void 0===(a=(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){this._count=0}return e.prototype.gen=function(e){return null==e&&(e="a"),e+"_"+this._count++},e}();t.IdGen=n}).apply(null,r))||(e.exports=a)},Xakh:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("zOht"),n("7Aei")],void 0===(a=(function(e,t,n,r){function a(e){e.fragment.uniforms.add("lastFrameColorMap","sampler2D"),e.fragment.uniforms.add("reprojectionMat","mat4"),e.fragment.uniforms.add("rpProjectionMat","mat4"),e.fragment.code.add(r.glsl(i||(i=n.__makeTemplateObject(["\n  vec2 reprojectionCoordinate(vec3 projectionCoordinate)\n  {\n    vec4 zw = rpProjectionMat * vec4(0.0, 0.0, -projectionCoordinate.z, 1.0);\n    vec4 reprojectedCoord = reprojectionMat * vec4(zw.w * (projectionCoordinate.xy * 2.0 - 1.0), zw.z, zw.w);\n    reprojectedCoord.xy /= reprojectedCoord.w;\n    return reprojectedCoord.xy*0.5 + 0.5;\n  }\n  "],["\n  vec2 reprojectionCoordinate(vec3 projectionCoordinate)\n  {\n    vec4 zw = rpProjectionMat * vec4(0.0, 0.0, -projectionCoordinate.z, 1.0);\n    vec4 reprojectedCoord = reprojectionMat * vec4(zw.w * (projectionCoordinate.xy * 2.0 - 1.0), zw.z, zw.w);\n    reprojectedCoord.xy /= reprojectedCoord.w;\n    return reprojectedCoord.xy*0.5 + 0.5;\n  }\n  "]))))}var i;Object.defineProperty(t,"__esModule",{value:!0}),t.Reprojection=a,function(e){e.bindUniforms=function(e,t,n){e.setUniform1i("lastFrameColorMap",n.lastFrameColorTextureID),t.bindTexture(n.lastFrameColorTexture,n.lastFrameColorTextureID),e.setUniformMatrix4fv("reprojectionMat",n.reprojectionMat),e.setUniformMatrix4fv("rpProjectionMat",n.rpProjectionMat)}}(a=t.Reprojection||(t.Reprojection={}))}).apply(null,r))||(e.exports=a)},YseA:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("xoE+")],void 0===(a=(function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e){null==e?e=16:e<65536&&(e=n.nextHighestPowerOfTwo(e)),this._array=new Float32Array(e),this._size=0}return e.prototype.resize=function(e,t){if(this._size=e,this._size>this._array.length){for(var n=this._array.length||1;n<this._size;)n*=2;var r=new Float32Array(n);return t&&r.set(this._array),this._array=r,!0}var a=2*this._size;if(a<=this._array.length){for(n=this._array.length;n>=a;)n=Math.floor(n/2);return r=new Float32Array(n),t&&r.set(this._array.subarray(0,n)),this._array=r,!0}return!1},e.prototype.append=function(e){var t=this._size;this.resize(this._size+e.length,!0),this._array.set(e,t)},e.prototype.erase=function(e,t){for(var n=e;n<t;++n)this._array[n]=0},Object.defineProperty(e.prototype,"array",{get:function(){return this._array},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),e}();t.ResizableFloat32Array=r}).apply(null,r))||(e.exports=a)},ZJC8:function(e,t){},ZeO9:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("R2Zq"),n("R2Zq"),n("LxLY"),n("LxLY"),n("FXVB"),n("1m5D"),n("MzcX"),n("ff/U"),n("FLCf"),n("YseA"),n("CIy2"),n("CP88"),n("pbva"),n("PwS/"),n("QFi0"),n("Kfys"),n("z2+Q")],void 0===(a=(function(e,t,n,r,a,i,o,s,c,l,d,u,f,v,p,h,m,g,y){var b=function(){function e(e,t,n,r){void 0===r&&(r=l.Default3D),this.type="MergedRenderer",this._dataByOrigin=new Map,this._hasHighlights=!1,this._hasOccludees=!1,this._rctx=e,this._vertexAttributeLocations=r,this._material=n,this._materialRep=t,this._glMaterials=h.acquireMaterials(this._material,this._materialRep),this._bufferWriter=n.createBufferWriter()}return e.prototype.dispose=function(){h.releaseMaterials(this._material,this._materialRep),this._dataByOrigin&&(this._dataByOrigin.forEach((function(e){e.vao.dispose(!0),e.vao=null})),this._dataByOrigin.clear(),this._dataByOrigin=null),this._glMaterials&&(this._glMaterials.forEach((function(e){e&&e.dispose()})),this._glMaterials.clear(),this._glMaterials=null)},Object.defineProperty(e.prototype,"isEmpty",{get:function(){return 0===this._dataByOrigin.size},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasHighlights",{get:function(){return this._hasHighlights},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasOccludees",{get:function(){return this._hasOccludees},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasWater",{get:function(){return!this.isEmpty&&r.someMap(this._glMaterials,(function(e){return e instanceof v.WaterGLMaterial}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rendersOccluded",{get:function(){return!this.isEmpty&&1!==this._material.renderOccluded},enumerable:!0,configurable:!0}),e.prototype.modify=function(e){this.updateGeometries(e.toUpdate),this.addAndRemoveGeometries(e.toAdd,e.toRemove),this.updateRenderCommands()},e.prototype.addAndRemoveGeometries=function(e,t){var n=this,r=this._bufferWriter,a=r.vertexBufferLayout,i=a.stride/4,o=this._dataByOrigin,s=function(e,t,n,r){for(var a=new Map,i=t.vertexBufferLayout.stride/4,o=function(n,r){var o=n.origin,s=e.get(o.id),c=a.get(o.id);null==c&&a.set(o.id,c={optimalCount:null==s?0:s.optimalCount,sparseCount:null==s?0:s.buffer.size,toAdd:[],toRemove:[],origin:o.vec3});var l=t.elementCount(n.data)*i;r?(c.optimalCount+=l,c.sparseCount+=l,c.toAdd.push(n)):(c.optimalCount-=l,c.toRemove.push(n))},s=0,c=n;s<c.length;s++){var l=c[s];o(l,!0)}for(var d=0,u=r;d<u.length;d++)o(l=u[d],!1);return a}(o,r,e,t);s.forEach((function(e,t){s.delete(t);var r=e.optimalCount,c=e.sparseCount,l=o.get(t);if(null==l&&(f.assert(r>0),l=n.createData(a,r,e.origin),o.set(t,l)),0===r)return l.vao.dispose(!0),l.vao=null,void o.delete(t);var d=r<e.sparseCount/2,u=x,v=l.buffer.size,p=l.buffer.array,h=l.buffer.resize(d?r:c,!1);d||h?n.removeAndRebuild(l,e.toRemove,i,p,u):e.toRemove.length>0?(n.removeByErasing(l,e.toRemove,i,u),e.toAdd.length>0&&(u.end=v)):(u.begin=v,u.end=v);var m=w;f.setMatrixTranslation3(m,-e.origin[0],-e.origin[1],-e.origin[2]),n.append(l,e.toAdd,i,m,u);var g=l.vao.vertexBuffers.geometry;if(g.byteSize!==l.buffer.array.buffer.byteLength)g.setData(l.buffer.array);else{var y=u.begin,b=u.end;if(y<b){var _=4*y;g.setSubData(l.buffer.array,_,_,4*b)}}l.drawCommandsDirty=!0}))},e.prototype.updateGeometries=function(e){for(var t=this._bufferWriter,n=t.vertexBufferLayout.stride/4,r=0,a=e;r<a.length;r++){var i=a[r],o=i.updateType,s=i.renderGeometry,c=this._dataByOrigin.get(s.origin.id),l=c&&c.instances.get(s.uniqueName);if(!l)return;if(1&o&&(l.isVisible=s.instanceParameters.visible),9&o&&(l.hasHighlights=!!s.instanceParameters.highlights&&s.instanceParameters.visible),16&o&&(l.hasOccludees=!!s.instanceParameters.occludees),6&o){var d=c.buffer.array,u=c.vao;h.calculateTransformRelToOrigin(s,_,S),t.write({transformation:_,invTranspTransformation:S},s.data,t.vertexBufferLayout.createView(d.buffer),l.from),f.assert(l.from+t.elementCount(s.data)===l.to,"material VBO layout has changed"),u.vertexBuffers.geometry.setSubData(d,l.from*n*4,l.from*n*4,l.to*n*4)}c.drawCommandsDirty=!0}},e.prototype.updateRenderCommands=function(){this._dataByOrigin.forEach((function(e){e.hasHiddenInstances=r.someMap(e.instances,(function(e){return!e.isVisible})),e.hasHighlights=r.someMap(e.instances,(function(e){return e.isVisible&&e.hasHighlights})),e.hasOccludees=r.someMap(e.instances,(function(e){return e.isVisible&&e.hasOccludees}))})),this._hasHighlights=r.someMap(this._dataByOrigin,(function(e){return e.hasHighlights})),this._hasOccludees=r.someMap(this._dataByOrigin,(function(e){return e.hasOccludees})),this._dataByOrigin.forEach((function(e){e.drawCommandsDirty&&(function(e){if(e.drawCommandsDefault=null,e.drawCommandsHighlight=null,e.drawCommandsOccludees=null,e.stats={default:0,highlight:0,occludees:0},0!==e.instances.size){if(!(e.hasOccludees||e.hasHighlights||e.hasHiddenInstances)){var t=4*e.buffer.size/g.getStride(e.vao.layout.geometry);return e.drawCommandsDefault=[{first:0,count:t}],void(e.stats={default:t,highlight:0,occludees:0})}var r=p.sortInstancesAccordingToRange(n.valuesOfMap(e.instances));e.drawCommandsDefault=[],e.drawCommandsHighlight=[],e.drawCommandsOccludees=[];for(var a=0,i=r;a<i.length;a++){var o=i[a];o.isVisible&&(p.addOrMerge(o.hasOccludees?e.drawCommandsOccludees:e.drawCommandsDefault,o),o.hasHighlights&&p.addOrMerge(e.drawCommandsHighlight,o))}var s=function(e){for(var t=0,n=0,r=e;n<r.length;n++)t+=r[n].count;return t/3};e.stats={default:s(e.drawCommandsDefault),highlight:s(e.drawCommandsHighlight),occludees:s(e.drawCommandsOccludees)}}}(e),e.drawCommandsDirty=!1)}))},e.prototype.updateLogic=function(e){return this._material.update(e)},e.prototype.render=function(e,t,n,r){var o=this,s=this._rctx,c=this._glMaterials.get(t.pass),l=4===t.pass,u=e;if(2===t.pass&&null===u&&(u=22),!c||2!==c.ensureResources(s)||null!=u&&!c.beginSlot(u)||l&&!this._hasHighlights)return!1;c.ensureParameters(n);var f=c.getTechnique(),v=c.getPipelineState(u,!1);s.setPipelineState(v),c.bind(s,n);var p=!1;return this._dataByOrigin.forEach((function(e){if(!(a.isNone(e.drawCommandsDefault)&&a.isNone(e.drawCommandsHighlight)&&a.isNone(e.drawCommandsOccludees))&&(!l||e.hasHighlights)){n.origin=e.origin,f.bindDraw(n),f.ensureAttributeLocations(e.vao),s.bindVAO(e.vao);var t=f.primitiveType,h=l?e.drawCommandsHighlight:e.drawCommandsDefault,m=l?e.stats.highlight:e.stats.default;if(i.isSome(h)&&(o.renderCommands(s,t,h),d.addToRenderStats(h.length,m,r),p=!0),!l&&i.isSome(h=e.drawCommandsOccludees)){var g=c.getPipelineState(u,!0);s.setPipelineState(g),o.renderCommands(s,t,h),s.setPipelineState(v),d.addToRenderStats(h.length,e.stats.occludees,r),p=!0}}})),p},e.prototype.renderCommands=function(e,t,n){for(var r=0;r<n.length;r++)e.drawArrays(t,n[r].first,n[r].count)},e.prototype.createData=function(e,t,n){return{instances:new Map,vao:new y(this._rctx,this._vertexAttributeLocations,{geometry:c.glLayout(e)},{geometry:m.createVertex(this._rctx,35044)}),buffer:new u.ResizableFloat32Array(t),optimalCount:0,origin:n,hasHiddenInstances:!1,hasHighlights:!1,hasOccludees:!1,drawCommandsDirty:!1,drawCommandsDefault:null,drawCommandsOccludees:null,drawCommandsHighlight:null,stats:{default:0,highlight:0,occludees:0}}},e.prototype.removeAndRebuild=function(e,t,n,r,a){for(var i=0,o=t;i<o.length;i++){var s=o[i].uniqueName,c=e.instances.get(s);e.optimalCount-=(c.to-c.from)*n,e.instances.delete(s)}var l=0,d=e.buffer.array;a.begin=0,a.end=0;var u=-1,f=-1,v=0;e.instances.forEach((function(e){var t=e.from*n,a=e.to*n,i=a-t;u!==f&&f!==t?(d.set(r.subarray(u,f),v),v+=f-u,u=t):-1===u&&(u=t),f=a,e.from=l/n,e.to=(l+=i)/n})),u!==f&&d.set(r.subarray(u,f),v),a.end=l},e.prototype.removeByErasing=function(e,t,n,r){r.begin=1/0,r.end=-1/0;for(var a=-1,i=-1,o=0,s=t;o<s.length;o++){var c=s[o].uniqueName,l=e.instances.get(c),d=l.from*n,u=l.to*n;a!==i&&i!==d?(e.buffer.erase(a,i),a=d):-1===a&&(a=d),i=u,e.instances.delete(c),e.optimalCount-=u-d,d<r.begin&&(r.begin=d),u>r.end&&(r.end=u)}a!==i&&e.buffer.erase(a,i)},e.prototype.append=function(e,t,n,r,a){for(var s=this._bufferWriter,c=0,l=t;c<l.length;c++){var d=l[c],u=i.isSome(d.transformation)?o.mat4.multiply(_,r,d.transformation):r;o.mat4.invert(S,u),o.mat4.transpose(S,S);var v=a.end;s.write({transformation:u,invTranspTransformation:S},d.data,s.vertexBufferLayout.createView(e.buffer.array.buffer),a.end/n);var h=s.elementCount(d.data)*n,m=v+h;f.assert(null==e.instances.get(d.uniqueName));var g=d.instanceParameters.visible,y=new p.Instance(v/n,m/n,g,!!d.instanceParameters.highlights&&g,!!d.instanceParameters.occludees);e.instances.set(d.uniqueName,y),e.optimalCount+=h,a.end+=h}},Object.defineProperty(e.prototype,"test",{get:function(){return{material:this._material,glMaterials:this._glMaterials}},enumerable:!0,configurable:!0}),e}(),x={begin:0,end:0},w=s.mat4f64.create(),_=s.mat4f64.create(),S=s.mat4f64.create();return b}).apply(null,r))||(e.exports=a)},ZjcA:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("PHan"),n("W9tT"),n("0LE5"),n("Rdxj"),n("JjCO"),n("N5NQ")],void 0===(a=(function(e,t,n,r,a,i,o,s){function c(e){return e?{p0:i.vec3f64.clone(e.p0),p1:i.vec3f64.clone(e.p1),p2:i.vec3f64.clone(e.p2)}:{p0:i.vec3f64.create(),p1:i.vec3f64.create(),p2:i.vec3f64.create()}}function l(e,t,n,r){return void 0===r&&(r=c()),a.vec3.copy(r.p0,e),a.vec3.copy(r.p1,t),a.vec3.copy(r.p2,n),r}function d(e,t,n){var a=r.vec2.distance(e,t),i=r.vec2.distance(t,n),o=r.vec2.distance(n,e),s=(a+i+o)/2,c=s*(s-a)*(s-i)*(s-o);return c<=0?0:Math.sqrt(c)}Object.defineProperty(t,"__esModule",{value:!0}),t.create=c,t.wrap=function(e,t,n){var r=f.get();return r.p0=e,r.p1=t,r.p2=n,r},t.copy=function(e,t){return void 0===t&&(t=c()),l(e.p0,e.p1,e.p2,t)},t.fromValues=l,t.distance2=function(e,t){var n=e.p0,r=e.p1,i=e.p2,c=a.vec3.subtract(o.sv3d.get(),r,n),l=a.vec3.subtract(o.sv3d.get(),i,r),d=a.vec3.subtract(o.sv3d.get(),n,i),f=a.vec3.subtract(o.sv3d.get(),t,n),v=a.vec3.subtract(o.sv3d.get(),t,r),p=a.vec3.subtract(o.sv3d.get(),t,i),h=a.vec3.cross(c,c,d),m=a.vec3.dot(a.vec3.cross(o.sv3d.get(),c,h),f),g=a.vec3.dot(a.vec3.cross(o.sv3d.get(),l,h),v),y=a.vec3.dot(a.vec3.cross(o.sv3d.get(),d,h),p);if(m>0&&g>0&&y>0){var b=a.vec3.dot(h,f);return b*b/a.vec3.dot(h,h)}var x=s.distance2(s.fromValues(n,c,u.get()),t),w=s.distance2(s.fromValues(r,l,u.get()),t),_=s.distance2(s.fromValues(i,d,u.get()),t);return Math.min(x,w,_)},t.intersectRay=function(e,t,n){var r=t.direction,i=t.origin,o=e.p0,s=e.p1,c=e.p2,l=s[0]-o[0],d=s[1]-o[1],u=s[2]-o[2],f=c[0]-o[0],v=c[1]-o[1],p=c[2]-o[2],h=r[1]*p-v*r[2],m=r[2]*f-p*r[0],g=r[0]*v-f*r[1],y=l*h+d*m+u*g;if(y>-1e-5&&y<1e-5)return!1;var b=1/y,x=i[0]-o[0],w=i[1]-o[1],_=i[2]-o[2],S=b*(x*h+w*m+_*g);if(S<0||S>1)return!1;var P=w*u-d*_,O=_*l-u*x,M=x*d-l*w,A=b*(r[0]*P+r[1]*O+r[2]*M);return!(A<0||S+A>1||(n&&(a.vec3.scale(n,r,b*(f*P+v*O+p*M)),a.vec3.add(n,i,n)),0))},t.areaPoints2d=d,t.area2d=function(e){return d(e.p0,e.p1,e.p2)},t.areaPoints3d=function(e,t,n){return a.vec3.subtract(v,t,e),a.vec3.subtract(p,n,e),a.vec3.length(a.vec3.cross(v,v,p))/2};var u=new n.ObjectStack(s.create),f=new n.ObjectStack((function(){return{p0:null,p1:null,p2:null}})),v=i.vec3f64.create(),p=i.vec3f64.create()}).apply(null,r))||(e.exports=a)},aExC:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("qsST"),n("R2Zq"),n("ULaq")],void 0===(a=(function(e,t,n,r,a){Object.defineProperty(t,"__esModule",{value:!0});var i=n.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder"),o=function(){function e(){this.vertex=new l,this.fragment=new l,this.attributes=new d,this.varyings=new u,this.extensions=new f,this.defines=new v,this._includedModules=new Map}return e.prototype.include=function(e,t){this._includedModules.has(e)?this._includedModules.get(e)!==t&&i.error("Trying to include shader module multiple times with different sets of options."):(this._includedModules.set(e,t),"shaderModule"in e?e.shaderModule(this,t):e(this,t))},e.prototype.generateSource=function(e){var t=this.extensions.generateSource(e),n=this.attributes.generateSource(e),r=this.varyings.generateSource(),a="vertex"===e?this.vertex:this.fragment,i=a.uniforms.generateSource(),o=a.code.generateSource(),s="vertex"===e?h:p,c=this.defines.generateSource().concat(a.defines.generateSource());return"\n"+t.join("\n")+"\n\n"+c.join("\n")+"\n\n"+s+"\n\n"+i.join("\n")+"\n\n"+n.join("\n")+"\n\n"+r.join("\n")+"\n\n"+o.join("\n")},e}();t.ShaderBuilder=o;var s=function(){function e(){this._entries=new Array,this._set=new Set}return e.prototype.add=function(e,t,n){var r=e+"_"+t+"_"+n;return this._set.has(r)||(this._entries.push([e,t,n]),this._set.add(r)),this},e.prototype.generateSource=function(){return this._entries.map((function(e){return"uniform "+e[1]+" "+e[0]+((t=e[2])?"["+t+"]":"")+";";var t}))},e}(),c=function(){function e(){this._entries=new Array}return e.prototype.add=function(e){this._entries.push(e)},e.prototype.generateSource=function(){return this._entries},e}(),l=function(){this.uniforms=new s,this.code=new c,this.defines=new v},d=function(){function e(){this._entries=new Array}return e.prototype.add=function(e,t){this._entries.push([e,t])},e.prototype.generateSource=function(e){return"fragment"===e?[]:this._entries.map((function(e){return"attribute "+e[1]+" "+e[0]+";"}))},e}(),u=function(){function e(){this._entries=new Array}return e.prototype.add=function(e,t){this._entries.push([e,t])},e.prototype.generateSource=function(){return this._entries.map((function(e){return"varying "+e[1]+" "+e[0]+";"}))},e}(),f=function(){function e(){this._entries=new Set}return e.prototype.add=function(e){this._entries.add(e)},e.prototype.generateSource=function(t){var n="vertex"===t?e.WHITELIST_VERTEX:e.WHITELIST_FRAGMENT;return a.valuesOfSet(this._entries).filter((function(e){return n.indexOf(e)>=0})).map((function(e){return"#extension "+e+" : enable"}))},e.WHITELIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"],e.WHITELIST_VERTEX=[],e}(),v=function(){function e(){this._entries=new Map}return e.prototype.addInt=function(e,t){var n=t%1==0?t.toFixed(0):t.toString();this._entries.set(e,n)},e.prototype.addFloat=function(e,t){var n=t%1==0?t.toFixed(1):t.toString();this._entries.set(e,n)},e.prototype.generateSource=function(){return r.pairsOfMap(this._entries).map((function(e){return"#define "+e[0]+" "+e[1]}))},e}(),p="#ifdef GL_FRAGMENT_PRECISION_HIGH\n  precision highp float;\n  precision highp sampler2D;\n#else\n  precision mediump float;\n  precision mediump sampler2D;\n#endif",h="precision highp float;\nprecision highp sampler2D;"}).apply(null,r))||(e.exports=a)},aWgr:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("GyfB"),n("2eYJ"),n("fXZm"),n("cpxo"),n("N5NQ"),n("GG08"),n("4p4v"),n("/dtL"),n("ZjcA"),n("18xY")],void 0===(a=(function(e,t,n,r,a,i,o,s,c,l,d,u){Object.defineProperty(t,"__esModule",{value:!0}),t.plane=s,t.boundedPlane=r,t.triangle=d,t.lineSegment=o,t.ray=c,t.clipRay=a,t.sphere=l,t.frustum=i,t.vector=u,t.axisAngle=n}).apply(null,r))||(e.exports=a)},cj3m:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("zOht"),n("DKwL"),n("7Aei")],void 0===(a=(function(e,t,n,r,a){function i(e){e.include(r.RgbaFloatEncoding),e.fragment.uniforms.add("depthTex","sampler2D"),e.fragment.uniforms.add("shadowMapNum","int"),e.fragment.uniforms.add("shadowMapDistance","vec4"),e.fragment.uniforms.add("shadowMapMatrix","mat4",4),e.fragment.uniforms.add("depthHalfPixelSz","float"),e.fragment.code.add(a.glsl(o||(o=n.__makeTemplateObject(["\n    float readShadowMap(const in vec3 _vpos, float _linearDepth) {\n      float halfPixelSize = depthHalfPixelSz;\n      vec4 distance = shadowMapDistance;\n      float depth = _linearDepth;\n\n      //choose correct cascade\n      int i = depth < distance[1] ? 0 : depth < distance[2] ? 1 : depth < distance[3] ? 2 : 3;\n\n      if (i >= shadowMapNum) { return 0.0; }\n\n      mat4 mat = i == 0 ? shadowMapMatrix[0] : i == 1 ? shadowMapMatrix[1] : i == 2 ? shadowMapMatrix[2] : shadowMapMatrix[3];\n\n      vec4 lv = mat * vec4(_vpos, 1.0);\n      lv.xy /= lv.w;\n\n      // vertex completely outside? -> no shadow\n      vec3 lvpos = 0.5 * lv.xyz + vec3(0.5);\n      if (lvpos.z >= 1.0) { return 0.0; }\n      if (lvpos.x < 0.0 || lvpos.x > 1.0 || lvpos.y < 0.0 || lvpos.y > 1.0) { return 0.0; }\n\n      // calc coord in cascade texture\n      vec2 uv = vec2(float(i - 2 * (i / 2)) * 0.5, float(i / 2) * 0.5) + 0.5 * lvpos.xy;\n\n      float texSize = 0.5 / halfPixelSize;\n\n      // filter, offset by half pixels\n      vec2 st = fract((vec2(halfPixelSize) + uv) * texSize);\n\n      float s00 = rgba2float(texture2D(depthTex, uv + vec2(-halfPixelSize, -halfPixelSize))) < lvpos.z ? 1.0 : 0.0;\n      float s10 = rgba2float(texture2D(depthTex, uv + vec2(halfPixelSize, -halfPixelSize))) < lvpos.z ? 1.0 : 0.0;\n      float s11 = rgba2float(texture2D(depthTex, uv + vec2(halfPixelSize, halfPixelSize))) < lvpos.z ? 1.0 : 0.0;\n      float s01 = rgba2float(texture2D(depthTex, uv + vec2(-halfPixelSize, halfPixelSize))) < lvpos.z ? 1.0 : 0.0;\n\n      return mix(mix(s00, s10, st.x), mix(s01, s11, st.x), st.y);\n    }\n  "],["\n    float readShadowMap(const in vec3 _vpos, float _linearDepth) {\n      float halfPixelSize = depthHalfPixelSz;\n      vec4 distance = shadowMapDistance;\n      float depth = _linearDepth;\n\n      //choose correct cascade\n      int i = depth < distance[1] ? 0 : depth < distance[2] ? 1 : depth < distance[3] ? 2 : 3;\n\n      if (i >= shadowMapNum) { return 0.0; }\n\n      mat4 mat = i == 0 ? shadowMapMatrix[0] : i == 1 ? shadowMapMatrix[1] : i == 2 ? shadowMapMatrix[2] : shadowMapMatrix[3];\n\n      vec4 lv = mat * vec4(_vpos, 1.0);\n      lv.xy /= lv.w;\n\n      // vertex completely outside? -> no shadow\n      vec3 lvpos = 0.5 * lv.xyz + vec3(0.5);\n      if (lvpos.z >= 1.0) { return 0.0; }\n      if (lvpos.x < 0.0 || lvpos.x > 1.0 || lvpos.y < 0.0 || lvpos.y > 1.0) { return 0.0; }\n\n      // calc coord in cascade texture\n      vec2 uv = vec2(float(i - 2 * (i / 2)) * 0.5, float(i / 2) * 0.5) + 0.5 * lvpos.xy;\n\n      float texSize = 0.5 / halfPixelSize;\n\n      // filter, offset by half pixels\n      vec2 st = fract((vec2(halfPixelSize) + uv) * texSize);\n\n      float s00 = rgba2float(texture2D(depthTex, uv + vec2(-halfPixelSize, -halfPixelSize))) < lvpos.z ? 1.0 : 0.0;\n      float s10 = rgba2float(texture2D(depthTex, uv + vec2(halfPixelSize, -halfPixelSize))) < lvpos.z ? 1.0 : 0.0;\n      float s11 = rgba2float(texture2D(depthTex, uv + vec2(halfPixelSize, halfPixelSize))) < lvpos.z ? 1.0 : 0.0;\n      float s01 = rgba2float(texture2D(depthTex, uv + vec2(-halfPixelSize, halfPixelSize))) < lvpos.z ? 1.0 : 0.0;\n\n      return mix(mix(s00, s10, st.x), mix(s01, s11, st.x), st.y);\n    }\n  "]))))}var o;Object.defineProperty(t,"__esModule",{value:!0}),t.ReadShadowMap=i,function(e){e.bindUniforms=function(e,t,n){t.shadowMappingEnabled&&(t.shadowMap.bind(e,n),t.shadowMap.bindView(e,t.origin))},e.bindViewCustomOrigin=function(e,t,n){t.shadowMappingEnabled&&t.shadowMap.bindView(e,n)},e.bindView=function(e,t){t.shadowMappingEnabled&&t.shadowMap.bindView(e,t.origin)}}(i=t.ReadShadowMap||(t.ReadShadowMap={}))}).apply(null,r))||(e.exports=a)},cmSR:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("zOht"),n("7Aei")],void 0===(a=(function(e,t,n,r){var a,i,o;Object.defineProperty(t,"__esModule",{value:!0}),t.ForwardLinearDepth=function(e,t){0===t.output&&t.receiveShadows?(e.varyings.add("linearDepth","float"),e.vertex.code.add(r.glsl(a||(a=n.__makeTemplateObject(["\n      void forwardLinearDepth() { linearDepth = gl_Position.w; }\n    "],["\n      void forwardLinearDepth() { linearDepth = gl_Position.w; }\n    "]))))):1===t.output||3===t.output?(e.varyings.add("linearDepth","float"),e.vertex.uniforms.add("uCameraNearFar","vec2"),e.vertex.code.add(r.glsl(i||(i=n.__makeTemplateObject(["\n      void forwardLinearDepth() {\n        linearDepth = (-position_view().z - uCameraNearFar[0]) / (uCameraNearFar[1] - uCameraNearFar[0]);\n      }\n    "],["\n      void forwardLinearDepth() {\n        linearDepth = (-position_view().z - uCameraNearFar[0]) / (uCameraNearFar[1] - uCameraNearFar[0]);\n      }\n    "]))))):e.vertex.code.add(r.glsl(o||(o=n.__makeTemplateObject(["\n      void forwardLinearDepth() {}\n    "],["\n      void forwardLinearDepth() {}\n    "]))))}}).apply(null,r))||(e.exports=a)},cpxo:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("PHan"),n("FXVB"),n("0LE5"),n("Rdxj"),n("2fXB"),n("O7NG"),n("JjCO"),n("fXZm"),n("GG08")],void 0===(a=(function(e,t,n,r,a,i,o,s,c,l,d){function u(e){if(e){var t=e.planes,n=e.points;return{planes:[d.create(t[0]),d.create(t[1]),d.create(t[2]),d.create(t[3]),d.create(t[4]),d.create(t[5])],points:[i.vec3f64.clone(n[0]),i.vec3f64.clone(n[1]),i.vec3f64.clone(n[2]),i.vec3f64.clone(n[3]),i.vec3f64.clone(n[4]),i.vec3f64.clone(n[5]),i.vec3f64.clone(n[6]),i.vec3f64.clone(n[7])]}}return{planes:[d.create(),d.create(),d.create(),d.create(),d.create(),d.create()],points:[i.vec3f64.create(),i.vec3f64.create(),i.vec3f64.create(),i.vec3f64.create(),i.vec3f64.create(),i.vec3f64.create(),i.vec3f64.create(),i.vec3f64.create()]}}function f(e,t,n){void 0===n&&(n=u());for(var r=0;r<6;r++)d.copy(e[r],n.planes[r]);for(r=0;r<8;r++)a.vec3.copy(n.points[r],t[r]);return n}function v(e){var t=e.planes,n=e.points;d.fromPoints(n[4],n[0],n[3],t[0]),d.fromPoints(n[1],n[5],n[6],t[1]),d.fromPoints(n[4],n[5],n[1],t[2]),d.fromPoints(n[3],n[2],n[6],t[3]),d.fromPoints(n[0],n[1],n[2],t[4]),d.fromPoints(n[5],n[4],n[7],t[5])}function p(e,t){for(var n=0;n<6;n++)if(!d.clip(e[n],t))return!1;return!0}Object.defineProperty(t,"__esModule",{value:!0}),t.create=u,t.copy=function(e,t){return void 0===t&&(t=u()),f(e.planes,e.points,t)},t.fromValues=f,t.fromMatrix=function(e,t,n){void 0===n&&(n=u());var i=n.points,s=r.mat4.multiply(c.sm4d.get(),t,e);r.mat4.invert(s,s);for(var l=0;l<8;++l){var d=o.vec4.transformMat4(c.sv4d.get(),h[l],s);a.vec3.set(i[l],d[0]/d[3],d[1]/d[3],d[2]/d[3])}return v(n),n},t.recomputePlanes=v,t.intersectsSphere=function(e,t){for(var n=0;n<6;n++)if(d.isSphereFullyInside(e[n],t))return!1;return!0},t.intersectsRay=function(e,t){return p(e,l.fromRay(t,m.get()))},t.intersectClipRay=function(e,t){for(var n=0;n<6;n++)if(!d.clipInfinite(e[n],t))return!1;return!0},t.intersectsLineSegment=function(e,t,n){return p(e,l.fromLineSegmentAndDirection(t,n,m.get()))},t.intersectsPoint=function(e,t){for(var n=0;n<6;n++)if(d.signedDistance(e[n],t)>0)return!1;return!0},t.intersectsAABB=function(e,t){for(var n=0;n<6;n++)if(d.isAABBFullyInside(e[n],t))return!1;return!0},t.planePointIndices={bottom:[5,1,0,4],near:[0,1,2,3],far:[5,4,7,6],right:[1,5,6,2],left:[4,0,3,7],top:[7,3,2,6]};var h=[s.vec4f64.fromValues(-1,-1,-1,1),s.vec4f64.fromValues(1,-1,-1,1),s.vec4f64.fromValues(1,1,-1,1),s.vec4f64.fromValues(-1,1,-1,1),s.vec4f64.fromValues(-1,-1,1,1),s.vec4f64.fromValues(1,-1,1,1),s.vec4f64.fromValues(1,1,1,1),s.vec4f64.fromValues(-1,1,1,1)],m=new n.ObjectStack(l.create)}).apply(null,r))||(e.exports=a)},fXZm:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("PHan"),n("0LE5"),n("JjCO"),n("4p4v")],void 0===(a=(function(e,t,n,r,a,i){function o(e){return e?{ray:i.create(e.ray),c0:e.c0,c1:e.c1}:{ray:i.create(),c0:0,c1:Number.MAX_VALUE}}function s(e,t,n,r){return void 0===r&&(r=o()),i.copy(e,r.ray),r.c0=t,r.c1=n,r}function c(e,t,n){void 0===n&&(n=o());var a=r.vec3.length(e.vector);return i.fromValues(e.origin,t,n.ray),n.c0=0,n.c1=a,n}function l(e,t,n){return r.vec3.add(n,e.ray.origin,r.vec3.scale(n,e.ray.direction,t))}Object.defineProperty(t,"__esModule",{value:!0}),t.create=o,t.wrap=function(e,t,n){var r=d.get();return r.ray=e,r.c0=t,r.c1=n,r},t.copy=function(e,t){return void 0===t&&(t=o()),s(e.ray,e.c0,e.c1,t)},t.fromValues=s,t.fromRay=function(e,t){return void 0===t&&(t=o()),i.copy(e,t.ray),t.c0=0,t.c1=Number.MAX_VALUE,t},t.fromLineSegment=function(e,t){return void 0===t&&(t=o()),c(e,r.vec3.normalize(a.sv3d.get(),e.vector),t)},t.fromLineSegmentAndDirection=c,t.getStart=function(e,t){return l(e,e.c0,t)},t.getEnd=function(e,t){return l(e,e.c1,t)},t.getAt=l;var d=new n.ObjectStack((function(){return{c0:0,c1:0,ray:null}}))}).apply(null,r))||(e.exports=a)},fese:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("zOht"),n("LxLY"),n("0LE5"),n("Rdxj"),n("7Aei")],void 0===(a=(function(e,t,n,r,a,i,o){function s(e,t){if(t.slicePlaneEnabled){e.extensions.add("GL_OES_standard_derivatives"),t.sliceEnabledForVertexPrograms&&(e.vertex.uniforms.add("slicePlaneOrigin","vec3"),e.vertex.uniforms.add("slicePlaneBasis1","vec3"),e.vertex.uniforms.add("slicePlaneBasis2","vec3")),e.fragment.uniforms.add("slicePlaneOrigin","vec3"),e.fragment.uniforms.add("slicePlaneBasis1","vec3"),e.fragment.uniforms.add("slicePlaneBasis2","vec3");var r=o.glsl(c||(c=n.__makeTemplateObject(["\n      struct SliceFactors {\n        float front;\n        float side0;\n        float side1;\n        float side2;\n        float side3;\n      };\n\n      SliceFactors calculateSliceFactors(vec3 pos) {\n        vec3 rel = pos - slicePlaneOrigin;\n\n        vec3 slicePlaneNormal = -cross(slicePlaneBasis1, slicePlaneBasis2);\n        float slicePlaneW = -dot(slicePlaneNormal, slicePlaneOrigin);\n\n        float basis1Len2 = dot(slicePlaneBasis1, slicePlaneBasis1);\n        float basis2Len2 = dot(slicePlaneBasis2, slicePlaneBasis2);\n\n        float basis1Dot = dot(slicePlaneBasis1, rel);\n        float basis2Dot = dot(slicePlaneBasis2, rel);\n\n        return SliceFactors(\n          dot(slicePlaneNormal, pos) + slicePlaneW,\n          -basis1Dot - basis1Len2,\n          basis1Dot - basis1Len2,\n          -basis2Dot - basis2Len2,\n          basis2Dot - basis2Len2\n        );\n      }\n\n      bool sliceByFactors(SliceFactors factors) {\n        return factors.front < 0.0\n          && factors.side0 < 0.0\n          && factors.side1 < 0.0\n          && factors.side2 < 0.0\n          && factors.side3 < 0.0;\n      }\n      \n      bool sliceEnabled() {\n        // a slicePlaneBasis1 vector of zero length is used to disable slicing in the shader during draped rendering.\n        return dot(slicePlaneBasis1, slicePlaneBasis1) != 0.0;\n      }\n\n      bool sliceByPlane(vec3 pos) {\n        return sliceEnabled() && sliceByFactors(calculateSliceFactors(pos));\n      }\n\n      #define rejectBySlice(_pos_) sliceByPlane(_pos_)\n      #define discardBySlice(_pos_) { if (sliceByPlane(_pos_)) discard; }\n    "],["\n      struct SliceFactors {\n        float front;\n        float side0;\n        float side1;\n        float side2;\n        float side3;\n      };\n\n      SliceFactors calculateSliceFactors(vec3 pos) {\n        vec3 rel = pos - slicePlaneOrigin;\n\n        vec3 slicePlaneNormal = -cross(slicePlaneBasis1, slicePlaneBasis2);\n        float slicePlaneW = -dot(slicePlaneNormal, slicePlaneOrigin);\n\n        float basis1Len2 = dot(slicePlaneBasis1, slicePlaneBasis1);\n        float basis2Len2 = dot(slicePlaneBasis2, slicePlaneBasis2);\n\n        float basis1Dot = dot(slicePlaneBasis1, rel);\n        float basis2Dot = dot(slicePlaneBasis2, rel);\n\n        return SliceFactors(\n          dot(slicePlaneNormal, pos) + slicePlaneW,\n          -basis1Dot - basis1Len2,\n          basis1Dot - basis1Len2,\n          -basis2Dot - basis2Len2,\n          basis2Dot - basis2Len2\n        );\n      }\n\n      bool sliceByFactors(SliceFactors factors) {\n        return factors.front < 0.0\n          && factors.side0 < 0.0\n          && factors.side1 < 0.0\n          && factors.side2 < 0.0\n          && factors.side3 < 0.0;\n      }\n      \n      bool sliceEnabled() {\n        // a slicePlaneBasis1 vector of zero length is used to disable slicing in the shader during draped rendering.\n        return dot(slicePlaneBasis1, slicePlaneBasis1) != 0.0;\n      }\n\n      bool sliceByPlane(vec3 pos) {\n        return sliceEnabled() && sliceByFactors(calculateSliceFactors(pos));\n      }\n\n      #define rejectBySlice(_pos_) sliceByPlane(_pos_)\n      #define discardBySlice(_pos_) { if (sliceByPlane(_pos_)) discard; }\n    "]))),a=o.glsl(l||(l=n.__makeTemplateObject(["\n      vec4 applySliceHighlight(vec4 color, vec3 pos) {\n        SliceFactors factors = calculateSliceFactors(pos);\n\n        if (sliceByFactors(factors)) {\n          return color;\n        }\n\n        const float HIGHLIGHT_WIDTH = 1.0;\n        const vec4 HIGHLIGHT_COLOR = vec4(0.0, 0.0, 0.0, 0.3);\n\n        factors.front /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.front);\n        factors.side0 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side0);\n        factors.side1 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side1);\n        factors.side2 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side2);\n        factors.side3 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side3);\n\n        float highlightFactor = (1.0 - step(0.5, factors.front))\n          * (1.0 - step(0.5, factors.side0))\n          * (1.0 - step(0.5, factors.side1))\n          * (1.0 - step(0.5, factors.side2))\n          * (1.0 - step(0.5, factors.side3));\n\n        return mix(color, vec4(HIGHLIGHT_COLOR.rgb, color.a), highlightFactor * HIGHLIGHT_COLOR.a);\n      }\n    "],["\n      vec4 applySliceHighlight(vec4 color, vec3 pos) {\n        SliceFactors factors = calculateSliceFactors(pos);\n\n        if (sliceByFactors(factors)) {\n          return color;\n        }\n\n        const float HIGHLIGHT_WIDTH = 1.0;\n        const vec4 HIGHLIGHT_COLOR = vec4(0.0, 0.0, 0.0, 0.3);\n\n        factors.front /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.front);\n        factors.side0 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side0);\n        factors.side1 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side1);\n        factors.side2 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side2);\n        factors.side3 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side3);\n\n        float highlightFactor = (1.0 - step(0.5, factors.front))\n          * (1.0 - step(0.5, factors.side0))\n          * (1.0 - step(0.5, factors.side1))\n          * (1.0 - step(0.5, factors.side2))\n          * (1.0 - step(0.5, factors.side3));\n\n        return mix(color, vec4(HIGHLIGHT_COLOR.rgb, color.a), highlightFactor * HIGHLIGHT_COLOR.a);\n      }\n    "]))),i=t.sliceHighlightDisabled?o.glsl(d||(d=n.__makeTemplateObject(["#define highlightSlice(_color_, _pos_) (_color_)"],["#define highlightSlice(_color_, _pos_) (_color_)"]))):o.glsl(u||(u=n.__makeTemplateObject(["\n        "," \n        #define highlightSlice(_color_, _pos_) (sliceEnabled() ? applySliceHighlight(_color_, _pos_) : (_color_))\n      "],["\n        "," \n        #define highlightSlice(_color_, _pos_) (sliceEnabled() ? applySliceHighlight(_color_, _pos_) : (_color_))\n      "])),a);t.sliceEnabledForVertexPrograms&&e.vertex.code.add(r),e.fragment.code.add(r),e.fragment.code.add(i)}else{var s=o.glsl(f||(f=n.__makeTemplateObject(["\n      #define rejectBySlice(_pos_) false\n      #define discardBySlice(_pos_) {}\n      #define highlightSlice(_color_, _pos_) (_color_)\n    "],["\n      #define rejectBySlice(_pos_) false\n      #define discardBySlice(_pos_) {}\n      #define highlightSlice(_color_, _pos_) (_color_)\n    "])));t.sliceEnabledForVertexPrograms&&e.vertex.code.add(s),e.fragment.code.add(s)}}Object.defineProperty(t,"__esModule",{value:!0}),t.Slice=s,function(e){e.bindUniformsWithOrigin=function(t,n,r){e.bindUniforms(t,n,r.slicePlane,r.origin)},e.bindUniforms=function(e,t,n,o){t.slicePlaneEnabled&&(r.isSome(n)?(o?(a.vec3.subtract(v,n.origin,o),e.setUniform3fv("slicePlaneOrigin",v)):e.setUniform3fv("slicePlaneOrigin",n.origin),e.setUniform3fv("slicePlaneBasis1",n.basis1),e.setUniform3fv("slicePlaneBasis2",n.basis2)):(e.setUniform3fv("slicePlaneBasis1",i.vec3f64.ZEROS),e.setUniform3fv("slicePlaneBasis2",i.vec3f64.ZEROS),e.setUniform3fv("slicePlaneOrigin",i.vec3f64.ZEROS)))}}(s=t.Slice||(t.Slice={}));var c,l,d,u,f,v=i.vec3f64.create()}).apply(null,r))||(e.exports=a)},"ff/U":function(e,t,n){var r,a;r=[n.dj.c(e.i),t],void 0===(a=(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Default3D={position:0,normal:1,uv0:2,color:3,size:4,tangent:4,auxpos1:5,symbolColor:5,auxpos2:6,featureAttribute:6,instanceFeatureAttribute:6,instanceColor:7,model:8,modelNormal:12,modelOriginHi:11,modelOriginLo:15}}).apply(null,r))||(e.exports=a)},iHt0:function(e,t,n){var r,a;r=[n.dj.c(e.i),t],void 0===(a=(function(e,t){function n(){return new Float32Array(3)}function r(e,t,n){var r=new Float32Array(3);return r[0]=e,r[1]=t,r[2]=n,r}function a(){return n()}function i(){return r(1,1,1)}function o(){return r(1,0,0)}function s(){return r(0,1,0)}function c(){return r(0,0,1)}Object.defineProperty(t,"__esModule",{value:!0}),t.create=n,t.clone=function(e){var t=new Float32Array(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},t.fromValues=r,t.createView=function(e,t){return new Float32Array(e,t,3)},t.zeros=a,t.ones=i,t.unitX=o,t.unitY=s,t.unitZ=c,t.ZEROS=a(),t.ONES=i(),t.UNIT_X=o(),t.UNIT_Y=s(),t.UNIT_Z=c()}).apply(null,r))||(e.exports=a)},jl7D:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("zOht"),n("cmSR"),n("fese"),n("3kdR"),n("pLfv"),n("cj3m"),n("vGsU"),n("RdU/"),n("7Aei"),n("aExC")],void 0===(a=(function(e,t,n,r,a,i,o,s,c,l,d,u){var f,v,p,h,m,g,y,b,x;Object.defineProperty(t,"__esModule",{value:!0}),t.build=function(e){var t=new u.ShaderBuilder;return t.include(i.Transform,{linearDepth:!1}),t.attributes.add("position","vec3"),t.attributes.add("uv0","vec2"),t.vertex.uniforms.add("proj","mat4").add("view","mat4").add("localOrigin","vec3"),0===e.output&&(t.include(o.NormalUtils,e),t.include(r.ForwardLinearDepth,e),t.varyings.add("vuv","vec2"),t.varyings.add("vpos","vec3"),t.varyings.add("vnormal","vec3"),t.varyings.add("vtbnMatrix","mat3"),t.vertex.code.add(d.glsl(f||(f=n.__makeTemplateObject(["\n      void main(void) {\n        vuv = uv0;\n        vpos = position;\n\n        vnormal = getLocalUp(vpos, localOrigin);\n        vtbnMatrix = getTBNMatrix(vnormal);\n\n        gl_Position = transformPosition(proj, view, vpos);\n        forwardLinearDepth();\n      }\n    "],["\n      void main(void) {\n        vuv = uv0;\n        vpos = position;\n\n        vnormal = getLocalUp(vpos, localOrigin);\n        vtbnMatrix = getTBNMatrix(vnormal);\n\n        gl_Position = transformPosition(proj, view, vpos);\n        forwardLinearDepth();\n      }\n    "])))),t.include(l.WaterDistortion,e),t.include(a.Slice,e),e.receiveShadows&&t.include(s.ReadShadowMap,e),t.include(c.Water,e),t.fragment.uniforms.add("waterColor","vec4").add("lightingMainDirection","vec3").add("lightingMainIntensity","vec3").add("camPos","vec3").add("timeElapsed","float").add("view","mat4"),t.fragment.code.add(d.glsl(v||(v=n.__makeTemplateObject(["\n      void main() {\n        discardBySlice(vpos);\n        vec3 localUp = vnormal;\n        // the created normal is in tangent space\n        vec4 tangentNormalFoam = getSurfaceNormalAndFoam(vuv, timeElapsed);\n\n        // we rotate the normal according to the tangent-bitangent-normal-Matrix\n        vec3 n = normalize(vtbnMatrix * tangentNormalFoam.xyz);\n        vec3 v = -normalize(vpos - camPos);\n        vec3 l = normalize(-lightingMainDirection);\n        "],["\n      void main() {\n        discardBySlice(vpos);\n        vec3 localUp = vnormal;\n        // the created normal is in tangent space\n        vec4 tangentNormalFoam = getSurfaceNormalAndFoam(vuv, timeElapsed);\n\n        // we rotate the normal according to the tangent-bitangent-normal-Matrix\n        vec3 n = normalize(vtbnMatrix * tangentNormalFoam.xyz);\n        vec3 v = -normalize(vpos - camPos);\n        vec3 l = normalize(-lightingMainDirection);\n        "])))),t.fragment.code.add(d.glsl(e.receiveShadows?p||(p=n.__makeTemplateObject(["\n        float shadow = 1.0 - readShadowMap(vpos, linearDepth);\n      "],["\n        float shadow = 1.0 - readShadowMap(vpos, linearDepth);\n      "])):h||(h=n.__makeTemplateObject(["\n        float shadow = 1.0;\n      "],["\n        float shadow = 1.0;\n      "])))),t.fragment.code.add(d.glsl(m||(m=n.__makeTemplateObject(["\n        vec4 vPosView = view*vec4(vpos, 1.0);\n        vec4 final = vec4(getSeaColor(n, v, l, waterColor.rgb, lightingMainIntensity, localUp, shadow, tangentNormalFoam.w, vPosView.xyz), waterColor.w);\n\n        // gamma correction\n        gl_FragColor = delinearizeGamma(final);\n        gl_FragColor = highlightSlice(gl_FragColor, vpos);\n      }\n    "],["\n        vec4 vPosView = view*vec4(vpos, 1.0);\n        vec4 final = vec4(getSeaColor(n, v, l, waterColor.rgb, lightingMainIntensity, localUp, shadow, tangentNormalFoam.w, vPosView.xyz), waterColor.w);\n\n        // gamma correction\n        gl_FragColor = delinearizeGamma(final);\n        gl_FragColor = highlightSlice(gl_FragColor, vpos);\n      }\n    "]))))),2===e.output&&(t.include(o.NormalUtils,e),t.include(l.WaterDistortion,e),t.include(a.Slice,e),t.varyings.add("vpos","vec3"),t.varyings.add("vuv","vec2"),t.vertex.code.add(d.glsl(g||(g=n.__makeTemplateObject(["\n        void main(void) {\n          vuv = uv0;\n          vpos = position;\n          gl_Position = transformPosition(proj, view, vpos);\n        }\n    "],["\n        void main(void) {\n          vuv = uv0;\n          vpos = position;\n          gl_Position = transformPosition(proj, view, vpos);\n        }\n    "])))),t.fragment.uniforms.add("timeElapsed","float"),t.fragment.code.add(d.glsl(y||(y=n.__makeTemplateObject(["\n        void main() {\n          discardBySlice(vpos);\n\n          // the created normal is in tangent space and foam\n          vec4 tangentNormalFoam = getSurfaceNormalAndFoam(vuv, timeElapsed);\n          tangentNormalFoam.xyz = normalize(tangentNormalFoam.xyz);\n\n          gl_FragColor = vec4((tangentNormalFoam.xyz + vec3(1.0)) * 0.5, tangentNormalFoam.w);\n        }\n    "],["\n        void main() {\n          discardBySlice(vpos);\n\n          // the created normal is in tangent space and foam\n          vec4 tangentNormalFoam = getSurfaceNormalAndFoam(vuv, timeElapsed);\n          tangentNormalFoam.xyz = normalize(tangentNormalFoam.xyz);\n\n          gl_FragColor = vec4((tangentNormalFoam.xyz + vec3(1.0)) * 0.5, tangentNormalFoam.w);\n        }\n    "]))))),5===e.output&&(t.include(o.NormalUtils,e),t.varyings.add("vpos","vec3"),t.vertex.code.add(d.glsl(b||(b=n.__makeTemplateObject(["\n        void main(void) {\n          vpos = position;\n          gl_Position = transformPosition(proj, view, vpos);\n        }\n    "],["\n        void main(void) {\n          vpos = position;\n          gl_Position = transformPosition(proj, view, vpos);\n        }\n    "])))),t.fragment.uniforms.add("waterColor","vec4"),t.fragment.code.add(d.glsl(x||(x=n.__makeTemplateObject(["\n        void main() {\n          gl_FragColor = waterColor;\n        }\n    "],["\n        void main() {\n          gl_FragColor = waterColor;\n        }\n    "]))))),t}}).apply(null,r))||(e.exports=a)},juLw:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("zOht"),n("7Aei")],void 0===(a=(function(e,t,n,r){var a,i,o;Object.defineProperty(t,"__esModule",{value:!0}),t.AnalyticalSkyModel=function(e){var t=e.fragment.code;t.add(r.glsl(a||(a=n.__makeTemplateObject(["\n    vec3 evaluateDiffuseIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float NdotNG)\n    {\n      return ((1.0 - NdotNG) * ambientGround + (1.0 + NdotNG) * ambientSky) * 0.5;\n    }\n    "],["\n    vec3 evaluateDiffuseIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float NdotNG)\n    {\n      return ((1.0 - NdotNG) * ambientGround + (1.0 + NdotNG) * ambientSky) * 0.5;\n    }\n    "])))),t.add(r.glsl(i||(i=n.__makeTemplateObject(["\n    float integratedRadiance(float cosTheta2, float roughness)\n    {\n      return (cosTheta2 - 1.0) / (cosTheta2 * (1.0 - roughness * roughness) - 1.0);\n    }\n    "],["\n    float integratedRadiance(float cosTheta2, float roughness)\n    {\n      return (cosTheta2 - 1.0) / (cosTheta2 * (1.0 - roughness * roughness) - 1.0);\n    }\n    "])))),t.add(r.glsl(o||(o=n.__makeTemplateObject(["\n    vec3 evaluateSpecularIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float RdotNG, float roughness)\n    {\n      float cosTheta2 = 1.0 - RdotNG * RdotNG;\n      float intRadTheta = integratedRadiance(cosTheta2, roughness);\n\n      // Calculate the integrated directional radiance of the ground and the sky\n      float ground = RdotNG < 0.0 ? 1.0 - intRadTheta : 1.0 + intRadTheta;\n      float sky = 2.0 - ground;\n      return (ground * ambientGround + sky * ambientSky) * 0.5;\n    }\n    "],["\n    vec3 evaluateSpecularIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float RdotNG, float roughness)\n    {\n      float cosTheta2 = 1.0 - RdotNG * RdotNG;\n      float intRadTheta = integratedRadiance(cosTheta2, roughness);\n\n      // Calculate the integrated directional radiance of the ground and the sky\n      float ground = RdotNG < 0.0 ? 1.0 - intRadTheta : 1.0 + intRadTheta;\n      float sky = 2.0 - ground;\n      return (ground * ambientGround + sky * ambientSky) * 0.5;\n    }\n    "]))))}}).apply(null,r))||(e.exports=a)},lBa0:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("xoE+")],void 0===(a=(function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.ShaderTechniqueConfiguration=function(){this.key=0},t.parameter=function(e){return void 0===e&&(e={}),function(t,r){var a=t;a.__configurationParameters=a.__configurationParameters||[],a.__configurationParameters.push(r);var i="_"+r;void 0===a.__configurationParameters__offset&&(a.__configurationParameters__offset=0);var o=a.__configurationParameters__offset,s=Math.ceil(n.log2(e.count||2)),c=(1<<s)-1<<o;if(a.__configurationParameters__offset+=s,a.__configurationParameters__offset>=32)throw new Error("ShaderTechniqueConfiguration is too complex, requiring more than 32 bits to encode.\n      Either the configuration must be simplified, or this restriction must be relaxed.(Currently used: "+a.__configurationParameters__offset+")");Object.defineProperty(a,r,{get:function(){return this[i]},set:function(e){this.key=this.key&~c|e<<o&c,this[i]=e}})}}}).apply(null,r))||(e.exports=a)},lfQW:function(e,t,n){var r,a;r=[n.dj.c(e.i),t],void 0===(a=(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.depthCompareLess={func:513},t.depthCompareAlways={func:519},t.stencilWriteMaskOn={mask:255},t.stencilWriteMaskOff={mask:0},t.renderWhenBitIsNotSet=function(e){return{function:{func:517,ref:e,mask:e},operation:{fail:7680,zFail:7680,zPass:7680}}},t.replaceBitWhenDepthTestPasses=function(e){return{function:{func:519,ref:e,mask:e},operation:{fail:7680,zFail:7680,zPass:7681}}},t.stencilBaseAllZerosParams={function:{func:519,ref:2,mask:2},operation:{fail:7680,zFail:7680,zPass:0}},t.stencilToolMaskBaseParams={function:{func:519,ref:2,mask:2},operation:{fail:7680,zFail:7680,zPass:7681}},t.stencilToolMaskOccluderParams={function:{func:514,ref:2,mask:2},operation:{fail:7680,zFail:7680,zPass:7680}},t.stencilToolTransparentOccluderParams={function:{func:517,ref:2,mask:2},operation:{fail:7680,zFail:7680,zPass:7680}}}).apply(null,r))||(e.exports=a)},naZ0:function(e,t,n){var r,a;r=[n.dj.c(e.i),t],void 0===(a=(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),function(e){function t(e,t,n){e.setUniform3f("camPos",n[3]-t[0],n[7]-t[1],n[11]-t[2])}e.bindUniformsCustomOrigin=t,e.bindUniforms=function(e,n){t(e,n.origin,n.viewInvTransp)}}(t.Camera||(t.Camera={})),function(e){e.bindUniforms=function(e,t){e.setUniform1f("pixelRatio",t.pixelRatio||1),e.setUniform4fv("viewport",t.viewport)}}(t.Viewport||(t.Viewport={}))}).apply(null,r))||(e.exports=a)},oZZu:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("7Yqx")],void 0===(a=(function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.mat4f32=n}).apply(null,r))||(e.exports=a)},pLfv:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("zOht"),n("7Aei")],void 0===(a=(function(e,t,n,r){var a,i,o,s;Object.defineProperty(t,"__esModule",{value:!0}),t.NormalUtils=function(e,t){e.vertex.code.add(r.glsl(0===t.viewingMode?a||(a=n.__makeTemplateObject(["\n      vec3 getLocalUp(in vec3 pos, in vec3 origin) {\n          return normalize(pos + origin);\n      }\n    "],["\n      vec3 getLocalUp(in vec3 pos, in vec3 origin) {\n          return normalize(pos + origin);\n      }\n    "])):i||(i=n.__makeTemplateObject(["\n      vec3 getLocalUp(in vec3 pos, in vec3 origin) {\n          return vec3(0.0, 0.0, 1.0); // WARNING: up-axis dependent code\n      }\n    "],["\n      vec3 getLocalUp(in vec3 pos, in vec3 origin) {\n          return vec3(0.0, 0.0, 1.0); // WARNING: up-axis dependent code\n      }\n    "])))),e.vertex.code.add(r.glsl(0===t.viewingMode?o||(o=n.__makeTemplateObject(["\n        mat3 getTBNMatrix(in vec3 n) {\n            vec3 t = normalize(cross(vec3(0.0, 0.0, 1.0), n));\n            vec3 b = normalize(cross(n, t));\n            return mat3(t, b, n);\n        }\n    "],["\n        mat3 getTBNMatrix(in vec3 n) {\n            vec3 t = normalize(cross(vec3(0.0, 0.0, 1.0), n));\n            vec3 b = normalize(cross(n, t));\n            return mat3(t, b, n);\n        }\n    "])):s||(s=n.__makeTemplateObject(["\n        mat3 getTBNMatrix(in vec3 n) {\n            vec3 t = vec3(1.0, 0.0, 0.0);\n            vec3 b = normalize(cross(n, t));\n            return mat3(t, b, n);\n        }\n    "],["\n        mat3 getTBNMatrix(in vec3 n) {\n            vec3 t = vec3(1.0, 0.0, 0.0);\n            vec3 b = normalize(cross(n, t));\n            return mat3(t, b, n);\n        }\n    "]))))}}).apply(null,r))||(e.exports=a)},pbva:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("FXVB"),n("1m5D")],void 0===(a=(function(e,t,n,r){Object.defineProperty(t,"__esModule",{value:!0}),t.Instance=function(e,t,a,i,o,s){this.from=e,this.to=t,this.isVisible=a,this.hasHighlights=i,this.hasOccludees=o,this.transformation=s,null!=s&&(this.transformationNormal=r.mat4f64.clone(s),n.mat4.invert(this.transformationNormal,this.transformationNormal),n.mat4.transpose(this.transformationNormal,this.transformationNormal))},t.sortInstancesAccordingToRange=function(e){return e.sort((function(e,t){return e.from===t.from?e.to>t.to?1:e.to<t.to?-1:0:e.from>t.from?1:e.from<t.from?-1:0}))},t.addOrMerge=function(e,t){var n=function(e){return{first:e.from,count:e.to-e.from}};if(0!==e.length){var r,a=e[e.length-1];(r=a).first+r.count>=t.from?a.count=t.from-a.first+t.to-t.from:e.push(n(t))}else e.push(n(t))}}).apply(null,r))||(e.exports=a)},piY7:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("zOht"),n("juLw"),n("quQL"),n("7Aei")],void 0===(a=(function(e,t,n,r,a,i){var o,s,c,l,d,u,f,v,p,h,m;Object.defineProperty(t,"__esModule",{value:!0}),t.PhysicallyBasedRendering=function(e,t){var g=e.fragment.code;e.include(a.PiUtils),3===t.pbrMode||4===t.pbrMode?(g.add(i.glsl(o||(o=n.__makeTemplateObject(["\n    struct PBRShadingWater\n    {\n        float NdotL;   // cos angle between normal and light direction\n        float NdotV;   // cos angle between normal and view direction\n        float NdotH;   // cos angle between normal and half vector\n        float VdotH;   // cos angle between view direction and half vector\n        float LdotH;   // cos angle between light direction and half vector\n        float VdotN;   // cos angle between view direction and normal vector\n    };\n\n    float dtrExponent = ",";\n    "],["\n    struct PBRShadingWater\n    {\n        float NdotL;   // cos angle between normal and light direction\n        float NdotV;   // cos angle between normal and view direction\n        float NdotH;   // cos angle between normal and half vector\n        float VdotH;   // cos angle between view direction and half vector\n        float LdotH;   // cos angle between light direction and half vector\n        float VdotN;   // cos angle between view direction and normal vector\n    };\n\n    float dtrExponent = ",";\n    "])),t.useCustomDTRExponentForWater?"2.2":"2.0")),g.add(i.glsl(s||(s=n.__makeTemplateObject(["\n    vec3 fresnelReflection(float angle, vec3 f0, float f90) {\n      return f0 + (f90 - f0) * pow(1.0 - angle, 5.0);\n    }\n    "],["\n    vec3 fresnelReflection(float angle, vec3 f0, float f90) {\n      return f0 + (f90 - f0) * pow(1.0 - angle, 5.0);\n    }\n    "])))),g.add(i.glsl(c||(c=n.__makeTemplateObject(["\n    float normalDistributionWater(float NdotH, float roughness)\n    {\n      float r2 = roughness * roughness;\n      float NdotH2 = NdotH * NdotH;\n      float denom = pow((NdotH2 * (r2 - 1.0) + 1.0), dtrExponent) * PI;\n      return r2 / denom;\n    }\n    "],["\n    float normalDistributionWater(float NdotH, float roughness)\n    {\n      float r2 = roughness * roughness;\n      float NdotH2 = NdotH * NdotH;\n      float denom = pow((NdotH2 * (r2 - 1.0) + 1.0), dtrExponent) * PI;\n      return r2 / denom;\n    }\n    "])))),g.add(i.glsl(l||(l=n.__makeTemplateObject(["\n    float geometricOcclusionKelemen(float LoH)\n    {\n        return 0.25 / (LoH * LoH);\n    }\n    "],["\n    float geometricOcclusionKelemen(float LoH)\n    {\n        return 0.25 / (LoH * LoH);\n    }\n    "])))),g.add(i.glsl(d||(d=n.__makeTemplateObject(["\n    vec3 brdfSpecularWater(in PBRShadingWater props, float roughness, vec3 F0, float F0Max)\n    {\n      vec3  F = fresnelReflection(props.VdotH, F0, F0Max);\n      float dSun = normalDistributionWater(props.NdotH, roughness);\n      float V = geometricOcclusionKelemen(props.LdotH);\n\n      float diffusionSunHaze = mix(roughness + 0.045, roughness + 0.385, 1.0 - props.VdotH);\n      float strengthSunHaze  = 1.2;\n      float dSunHaze = normalDistributionWater(props.NdotH, diffusionSunHaze)*strengthSunHaze;\n\n      return ((dSun + dSunHaze) * V) * F;\n    }\n\n    vec3 tonemapACES(const vec3 x) {\n      return (x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14);\n    }\n    "],["\n    vec3 brdfSpecularWater(in PBRShadingWater props, float roughness, vec3 F0, float F0Max)\n    {\n      vec3  F = fresnelReflection(props.VdotH, F0, F0Max);\n      float dSun = normalDistributionWater(props.NdotH, roughness);\n      float V = geometricOcclusionKelemen(props.LdotH);\n\n      float diffusionSunHaze = mix(roughness + 0.045, roughness + 0.385, 1.0 - props.VdotH);\n      float strengthSunHaze  = 1.2;\n      float dSunHaze = normalDistributionWater(props.NdotH, diffusionSunHaze)*strengthSunHaze;\n\n      return ((dSun + dSunHaze) * V) * F;\n    }\n\n    vec3 tonemapACES(const vec3 x) {\n      return (x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14);\n    }\n    "]))))):1!==t.pbrMode&&2!==t.pbrMode||(e.include(r.AnalyticalSkyModel),g.add(i.glsl(u||(u=n.__makeTemplateObject(["\n    struct PBRShadingInfo\n    {\n        float NdotL;                  // cos angle between normal and light direction\n        float NdotV;                  // cos angle between normal and view direction\n        float NdotH;                  // cos angle between normal and half vector\n        float VdotH;                  // cos angle between view direction and half vector\n        float LdotH;                  // cos angle between view light direction and half vector\n        float NdotNG;                 // cos angle between normal and normal of the ground\n        float RdotNG;                 // cos angle between view direction reflected of the normal and normal of the ground\n        float NdotAmbDir;             // cos angle between view direction and the fill light in ambient illumination\n        float NdotH_Horizon;          // cos angle between normal and half vector defined with horizon illumination\n        vec3 skyRadianceToSurface;         // integrated radiance of the sky based on the surface roughness (used for specular reflection)\n        vec3 groundRadianceToSurface;      // integrated radiance of the ground based on the surface roughness (used for specular reflection)\n        vec3 skyIrradianceToSurface;       // irradiance of the sky (used for diffuse reflection)\n        vec3 groundIrradianceToSurface;    // irradiance of the ground (used for diffuse reflection)\n\n        float averageAmbientRadiance;      // average ambient radiance used to deduce black level in gamut mapping\n        float ssao;                   // ssao coefficient\n        vec3 albedoLinear;            // linear color of the albedo\n        vec3 f0;                      // fresnel value at normal incident light\n        vec3 f90;                     // fresnel value at 90o of incident light\n\n        vec3 diffuseColor;            // diffuse color of the material used in environment illumination\n        float metalness;              // metalness of the material\n        float roughness;              // roughness of the material\n    };\n    "],["\n    struct PBRShadingInfo\n    {\n        float NdotL;                  // cos angle between normal and light direction\n        float NdotV;                  // cos angle between normal and view direction\n        float NdotH;                  // cos angle between normal and half vector\n        float VdotH;                  // cos angle between view direction and half vector\n        float LdotH;                  // cos angle between view light direction and half vector\n        float NdotNG;                 // cos angle between normal and normal of the ground\n        float RdotNG;                 // cos angle between view direction reflected of the normal and normal of the ground\n        float NdotAmbDir;             // cos angle between view direction and the fill light in ambient illumination\n        float NdotH_Horizon;          // cos angle between normal and half vector defined with horizon illumination\n        vec3 skyRadianceToSurface;         // integrated radiance of the sky based on the surface roughness (used for specular reflection)\n        vec3 groundRadianceToSurface;      // integrated radiance of the ground based on the surface roughness (used for specular reflection)\n        vec3 skyIrradianceToSurface;       // irradiance of the sky (used for diffuse reflection)\n        vec3 groundIrradianceToSurface;    // irradiance of the ground (used for diffuse reflection)\n\n        float averageAmbientRadiance;      // average ambient radiance used to deduce black level in gamut mapping\n        float ssao;                   // ssao coefficient\n        vec3 albedoLinear;            // linear color of the albedo\n        vec3 f0;                      // fresnel value at normal incident light\n        vec3 f90;                     // fresnel value at 90o of incident light\n\n        vec3 diffuseColor;            // diffuse color of the material used in environment illumination\n        float metalness;              // metalness of the material\n        float roughness;              // roughness of the material\n    };\n    "])))),g.add(i.glsl(f||(f=n.__makeTemplateObject(["\n    float normalDistribution(float NdotH, float roughness)\n    {\n        float a = NdotH * roughness;\n        float b = roughness / (1.0 - NdotH * NdotH + a * a);\n        return b * b * INV_PI;\n    }\n    "],["\n    float normalDistribution(float NdotH, float roughness)\n    {\n        float a = NdotH * roughness;\n        float b = roughness / (1.0 - NdotH * NdotH + a * a);\n        return b * b * INV_PI;\n    }\n    "])))),g.add(i.glsl(v||(v=n.__makeTemplateObject(["\n    const vec4 c0 = vec4(-1.0, -0.0275, -0.572,  0.022);\n    const vec4 c1 = vec4( 1.0,  0.0425,  1.040, -0.040);\n    const vec2 c2 = vec2(-1.04, 1.04);\n\n    vec2 prefilteredDFGAnalytical(float roughness, float NdotV) {\n        vec4 r = roughness * c0 + c1;\n        float a004 = min(r.x * r.x, exp2(-9.28 * NdotV)) * r.x + r.y;\n        return c2 * a004 + r.zw;\n    }\n    "],["\n    const vec4 c0 = vec4(-1.0, -0.0275, -0.572,  0.022);\n    const vec4 c1 = vec4( 1.0,  0.0425,  1.040, -0.040);\n    const vec2 c2 = vec2(-1.04, 1.04);\n\n    vec2 prefilteredDFGAnalytical(float roughness, float NdotV) {\n        vec4 r = roughness * c0 + c1;\n        float a004 = min(r.x * r.x, exp2(-9.28 * NdotV)) * r.x + r.y;\n        return c2 * a004 + r.zw;\n    }\n    "])))),g.add(i.glsl(p||(p=n.__makeTemplateObject(["\n    vec3 evaluateEnvironmentIllumination(PBRShadingInfo inputs) {\n      vec3 indirectDiffuse = evaluateDiffuseIlluminationHemisphere(inputs.groundIrradianceToSurface, inputs.skyIrradianceToSurface, inputs.NdotNG);\n      vec3 indirectSpecular = evaluateSpecularIlluminationHemisphere(inputs.groundRadianceToSurface, inputs.skyRadianceToSurface, inputs.RdotNG, inputs.roughness);\n\n      // From diffuse illumination calculate reflected color\n      vec3 diffuseComponent = inputs.diffuseColor * indirectDiffuse * INV_PI;\n\n      // From specular illumination calculate reflected color\n      vec2 dfg = prefilteredDFGAnalytical(inputs.roughness, inputs.NdotV);\n      vec3 specularColor = inputs.f0 * dfg.x + inputs.f90 * dfg.y;\n      vec3 specularComponent = specularColor * indirectSpecular;\n\n      return (diffuseComponent + specularComponent);\n    }\n    "],["\n    vec3 evaluateEnvironmentIllumination(PBRShadingInfo inputs) {\n      vec3 indirectDiffuse = evaluateDiffuseIlluminationHemisphere(inputs.groundIrradianceToSurface, inputs.skyIrradianceToSurface, inputs.NdotNG);\n      vec3 indirectSpecular = evaluateSpecularIlluminationHemisphere(inputs.groundRadianceToSurface, inputs.skyRadianceToSurface, inputs.RdotNG, inputs.roughness);\n\n      // From diffuse illumination calculate reflected color\n      vec3 diffuseComponent = inputs.diffuseColor * indirectDiffuse * INV_PI;\n\n      // From specular illumination calculate reflected color\n      vec2 dfg = prefilteredDFGAnalytical(inputs.roughness, inputs.NdotV);\n      vec3 specularColor = inputs.f0 * dfg.x + inputs.f90 * dfg.y;\n      vec3 specularComponent = specularColor * indirectSpecular;\n\n      return (diffuseComponent + specularComponent);\n    }\n    "])))),g.add(i.glsl(h||(h=n.__makeTemplateObject(["\n    float gamutMapChanel(float x, vec2 p){\n      return (x < p.x) ? mix(0.0, p.y, x/p.x) : mix(p.y, 1.0, (x - p.x) / (1.0 - p.x) );\n    }"],["\n    float gamutMapChanel(float x, vec2 p){\n      return (x < p.x) ? mix(0.0, p.y, x/p.x) : mix(p.y, 1.0, (x - p.x) / (1.0 - p.x) );\n    }"])))),g.add(i.glsl(m||(m=n.__makeTemplateObject(["\n    vec3 blackLevelSoftCompression(vec3 inColor, PBRShadingInfo inputs){\n      vec3 outColor;\n      vec2 p = vec2(0.02 * (inputs.averageAmbientRadiance), 0.0075 * (inputs.averageAmbientRadiance));\n      outColor.x = gamutMapChanel(inColor.x, p) ;\n      outColor.y = gamutMapChanel(inColor.y, p) ;\n      outColor.z = gamutMapChanel(inColor.z, p) ;\n      return outColor;\n    }\n    "],["\n    vec3 blackLevelSoftCompression(vec3 inColor, PBRShadingInfo inputs){\n      vec3 outColor;\n      vec2 p = vec2(0.02 * (inputs.averageAmbientRadiance), 0.0075 * (inputs.averageAmbientRadiance));\n      outColor.x = gamutMapChanel(inColor.x, p) ;\n      outColor.y = gamutMapChanel(inColor.y, p) ;\n      outColor.z = gamutMapChanel(inColor.z, p) ;\n      return outColor;\n    }\n    "])))))}}).apply(null,r))||(e.exports=a)},quQL:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("zOht"),n("7Aei")],void 0===(a=(function(e,t,n,r){var a,i;Object.defineProperty(t,"__esModule",{value:!0}),t.PiUtils=function(e){e.vertex.code.add(r.glsl(a||(a=n.__makeTemplateObject(["\n    const float PI = 3.141592653589793;\n  "],["\n    const float PI = 3.141592653589793;\n  "])))),e.fragment.code.add(r.glsl(i||(i=n.__makeTemplateObject(["\n    const float PI = 3.141592653589793;\n    const float LIGHT_NORMALIZATION = 1.0 / PI;\n    const float INV_PI = 0.3183098861837907;\n    const float HALF_PI = 1.570796326794897;\n    "],["\n    const float PI = 3.141592653589793;\n    const float LIGHT_NORMALIZATION = 1.0 / PI;\n    const float INV_PI = 0.3183098861837907;\n    const float HALF_PI = 1.570796326794897;\n    "]))))}}).apply(null,r))||(e.exports=a)},rCq5:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("zOht"),n("7Aei")],void 0===(a=(function(e,t,n,r){var a,i,o,s;Object.defineProperty(t,"__esModule",{value:!0}),t.ColorConversion=function(e,t){var c=[r.glsl(a||(a=n.__makeTemplateObject(["\n      vec4 premultiplyAlpha(vec4 v) {\n        return vec4(v.rgb * v.a, v.a);\n      }\n    "],["\n      vec4 premultiplyAlpha(vec4 v) {\n        return vec4(v.rgb * v.a, v.a);\n      }\n    "]))),r.glsl(i||(i=n.__makeTemplateObject(["\n      vec3 rgb2hsv(vec3 c) {\n        vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\n        vec4 p = c.g < c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy);\n        vec4 q = c.r < p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx);\n\n        float d = q.x - min(q.w, q.y);\n        float e = 1.0e-10;\n        return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), min(d / (q.x + e), 1.0), q.x);\n      }\n    "],["\n      vec3 rgb2hsv(vec3 c) {\n        vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\n        vec4 p = c.g < c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy);\n        vec4 q = c.r < p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx);\n\n        float d = q.x - min(q.w, q.y);\n        float e = 1.0e-10;\n        return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), min(d / (q.x + e), 1.0), q.x);\n      }\n    "]))),r.glsl(o||(o=n.__makeTemplateObject(["\n      vec3 hsv2rgb(vec3 c) {\n        vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n        vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n        return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n      }\n    "],["\n      vec3 hsv2rgb(vec3 c) {\n        vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n        vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n        return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n      }\n    "]))),r.glsl(s||(s=n.__makeTemplateObject(["\n      float rgb2v(vec3 c) {\n        return max(c.x, max(c.y, c.z));\n      }\n    "],["\n      float rgb2v(vec3 c) {\n        return max(c.x, max(c.y, c.z));\n      }\n    "])))];switch(t.stages){case 0:c.forEach((function(t){return e.vertex.code.add(t)}));break;case 1:c.forEach((function(t){return e.fragment.code.add(t)}));break;default:c.forEach((function(t){return e.vertex.code.add(t)})),c.forEach((function(t){return e.fragment.code.add(t)}))}}}).apply(null,r))||(e.exports=a)},s6rJ:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("xoE+"),n("LxLY"),n("0LE5"),n("Rdxj"),n("WRgd"),n("+wMf"),n("CIy2"),n("PwS/")],void 0===(a=(function(e,t,n,r,a,i,o,s,c,l){Object.defineProperty(t,"__esModule",{value:!0});var d=o.create(),u=c.VertexAttrConstants;t.intersectTriangleGeometry=function(e,t,n,a,i,s,v){var p=l.isInstanceHidden(t),m=n.tolerance;if(!p)if(e.boundingInfo)c.assert("triangle"===e.data.primitiveType),function e(t,n,a,i,s,c){var l=b(n,a,f);if(o.setMin(d,t.getBBMin()),o.setMax(d,t.getBBMax()),r.isSome(s)&&s.applyToAABB(d),x(d,n,l,i)){var u=t.getPrimitiveIndices(),v=t.getIndices(),p=t.getPosition(),m=u?u.length:v.length/3;if(m>S){var g=t.getChildren();if(void 0!==g){for(var y=0;y<8;++y)void 0!==g[y]&&e(g[y],n,a,i,s,c);return}}h(n,a,0,m,v,p,u,s,c)}}(e.boundingInfo,a,i,m,s,v);else{var g=e.getIndices(u.POSITION),y=e.getAttribute(u.POSITION);h(a,i,0,g.length/3,g,y,void 0,s,v)}};var f=i.vec3f64.create(),v=Math.pow(2,-52),p=i.vec3f64.create();function h(e,t,n,a,i,o,s,c,l){var d,u,f;if(s)return function(e,t,n,a,i,o,s,c,l){for(var d,u,f,h=o.data,m=o.offsetIdx,g=o.strideIdx,b=e[0],x=e[1],w=e[2],_=t[0]-b,S=t[1]-x,P=t[2]-w,O=n;O<a;++O){var M=s[O],A=3*M,C=m+g*i[A++],T=h[C++],z=h[C++],I=h[C];C=m+g*i[A++];var D=h[C++],j=h[C++],V=h[C];C=m+g*i[A];var F=h[C++],N=h[C++],R=h[C];r.isSome(c)&&(T=(d=c.applyToVertex(T,z,I))[0],z=d[1],I=d[2],D=(u=c.applyToVertex(D,j,V))[0],j=u[1],V=u[2],F=(f=c.applyToVertex(F,N,R))[0],N=f[1],R=f[2]);var L=D-T,k=j-z,U=V-I,E=F-T,H=N-z,G=R-I,B=S*G-H*P,W=P*E-G*_,q=_*H-E*S,Z=L*B+k*W+U*q;if(!(Math.abs(Z)<=v)){var X=b-T,Q=x-z,Y=w-I,J=X*B+Q*W+Y*q;if(Z>0){if(J<0||J>Z)continue}else if(J>0||J<Z)continue;var K=Q*U-k*Y,$=Y*L-U*X,ee=X*k-L*Q,te=_*K+S*$+P*ee;if(Z>0){if(te<0||J+te>Z)continue}else if(te>0||J+te<Z)continue;var ne=(E*K+H*$+G*ee)/Z;ne>=0&&l(ne,y(L,k,U,E,H,G,p),M)}}}(e,t,n,a,i,o,s,c,l);for(var h=o.data,m=o.offsetIdx,g=o.strideIdx,b=e[0],x=e[1],w=e[2],_=t[0]-b,S=t[1]-x,P=t[2]-w,O=n,M=3*n;O<a;++O){var A=m+g*i[M++],C=h[A++],T=h[A++],z=h[A];A=m+g*i[M++];var I=h[A++],D=h[A++],j=h[A];A=m+g*i[M++];var V=h[A++],F=h[A++],N=h[A];r.isSome(c)&&(C=(d=c.applyToVertex(C,T,z))[0],T=d[1],z=d[2],I=(u=c.applyToVertex(I,D,j))[0],D=u[1],j=u[2],V=(f=c.applyToVertex(V,F,N))[0],F=f[1],N=f[2]);var R=I-C,L=D-T,k=j-z,U=V-C,E=F-T,H=N-z,G=S*H-E*P,B=P*U-H*_,W=_*E-U*S,q=R*G+L*B+k*W;if(!(Math.abs(q)<=v)){var Z=b-C,X=x-T,Q=w-z,Y=Z*G+X*B+Q*W;if(q>0){if(Y<0||Y>q)continue}else if(Y>0||Y<q)continue;var J=X*k-L*Q,K=Q*R-k*Z,$=Z*L-R*X,ee=_*J+S*K+P*$;if(q>0){if(ee<0||Y+ee>q)continue}else if(ee>0||Y+ee<q)continue;var te=(U*J+E*K+H*$)/q;te>=0&&l(te,y(R,L,k,U,E,H,p),O)}}}t.intersectTriangles=h;var m=i.vec3f64.create(),g=i.vec3f64.create();function y(e,t,n,r,i,o,s){return a.vec3.set(m,e,t,n),a.vec3.set(g,r,i,o),a.vec3.cross(s,m,g),a.vec3.normalize(s,s),s}function b(e,t,n){return a.vec3.set(n,1/(t[0]-e[0]),1/(t[1]-e[1]),1/(t[2]-e[2]))}function x(e,t,n,r){return w(e,t,n,r,1/0)}function w(e,t,n,r,a){var i=(e[0]-r-t[0])*n[0],o=(e[3]+r-t[0])*n[0],s=Math.min(i,o),c=Math.max(i,o),l=(e[1]-r-t[1])*n[1],d=(e[4]+r-t[1])*n[1];if((c=Math.min(c,Math.max(l,d)))<0)return!1;if((s=Math.max(s,Math.min(l,d)))>c)return!1;var u=(e[2]-r-t[2])*n[2],f=(e[5]+r-t[2])*n[2];return!((c=Math.min(c,Math.max(u,f)))<0)&&!((s=Math.max(s,Math.min(u,f)))>c)&&s<a}function _(e){var t=[];return e.forEach((function(e){return t.push(e)})),t}t.computeNormal=y,t.computeInvDir=b,t.intersectAabbInvDir=x,t.intersectAabbInvDirBefore=w,t.verticalOffsetAtDistance=function(e,t,r,a,i){var o=(r.screenLength||0)*e.pixelRatio;i&&(o=s.scale(o,a,t,i));var c=o*Math.tan(.5*e.fovY)/(.5*e.fullHeight);return n.glClamp(c*t,r.minWorldLength||0,null!=r.maxWorldLength?r.maxWorldLength:1/0)},t.bindScreenSizePerspective=function(e,t,n){if(e){var r=e.parameters;t.setUniform4f(n,r.divisor,r.offset,r.minPixelSize,e.paddingPixelsOverride)}},t.copyParameters=function e(t,n){var r=n?e(n):{};for(var a in t){var i=t[a];i&&i.forEach&&(i=_(i)),null==i&&a in r||(r[a]=i)}return r},t.updateParameters=function(e,t){var n=!1;for(var r in t){var a=t[r];void 0!==a&&(n=!0,e[r]=Array.isArray(a)?a.slice():a)}return n},t.intersectDrapedRenderLineGeometry=function(e,t,r,a,i){if(t.options.selectionMode){for(var o=e.getAttribute(u.POSITION).data,s=e.getAttribute(u.SIZE),c=r[0],l=r[1],d=(((s&&s.data[0])+a)/2+4)*e.pixelRatio,f=Number.MAX_VALUE,v=0;v<o.length-5;v+=3){var p=o[v],h=o[v+1],m=c-p,g=l-h,y=o[v+3]-p,b=o[v+4]-h,x=n.clamp((y*m+b*g)/(y*y+b*b),0,1),w=y*x-m,_=b*x-g,S=w*w+_*_;S<f&&(f=S)}f<d*d&&i()}},t.colorMixModes={multiply:1,ignore:2,replace:3,tint:4};var S=1e3}).apply(null,r))||(e.exports=a)},sQDZ:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("zOht"),n("6vp1"),n("Xakh"),n("7Aei")],void 0===(a=(function(e,t,n,r,a,i){function o(e,t){e.fragment.uniforms.add("nearFar","vec2"),e.fragment.uniforms.add("depthMapView","sampler2D"),e.fragment.uniforms.add("ssrViewMat","mat4"),e.include(r.ReadLinearDepth),e.include(a.Reprojection),e.fragment.code.add(i.glsl(s||(s=n.__makeTemplateObject(["\n  const int maxSteps = ","\n\n  vec4 applyProjectionMat(mat4 projectionMat, vec3 x)\n  {\n    vec4 projectedCoord =  projectionMat * vec4(x, 1.0);\n    projectedCoord.xy /= projectedCoord.w;\n    projectedCoord.xy = projectedCoord.xy*0.5 + 0.5;\n    return projectedCoord;\n  }\n\n  vec3 screenSpaceIntersection(vec3 dir, vec3 startPosition, vec3 viewDir, vec3 normal)\n  {\n    vec3 viewPos = startPosition;\n    vec3 viewPosEnd = startPosition;\n\n    // Project the start position to the screen\n    vec4 projectedCoordStart = applyProjectionMat(rpProjectionMat, viewPos);\n    vec3  Q0 = viewPos / projectedCoordStart.w; // homogeneous camera space\n    float k0 = 1.0/ projectedCoordStart.w;\n\n    // advance the position in the direction of the reflection\n    viewPos += dir;\n\n    vec4 projectedCoordVanishingPoint = applyProjectionMat(rpProjectionMat, dir);\n\n    // Project the advanced position to the screen\n    vec4 projectedCoordEnd = applyProjectionMat(rpProjectionMat, viewPos);\n    vec3  Q1 = viewPos / projectedCoordEnd.w; // homogeneous camera space\n    float k1 = 1.0/ projectedCoordEnd.w;\n\n    // calculate the reflection direction in the screen space\n    vec2 projectedCoordDir = (projectedCoordEnd.xy - projectedCoordStart.xy);\n    vec2 projectedCoordDistVanishingPoint = (projectedCoordVanishingPoint.xy - projectedCoordStart.xy);\n\n    float yMod = min(abs(projectedCoordDistVanishingPoint.y), 1.0);\n\n    float projectedCoordDirLength = length(projectedCoordDir);\n    float maxSt = float(maxSteps);\n\n    // normalize the projection direction depending on maximum steps\n    // this determines how blocky the reflection looks\n    vec2 dP = yMod * (projectedCoordDir)/(maxSt * projectedCoordDirLength);\n\n    // Normalize the homogeneous camera space coordinates\n    vec3  dQ = yMod * (Q1 - Q0)/(maxSt * projectedCoordDirLength);\n    float dk = yMod * (k1 - k0)/(maxSt * projectedCoordDirLength);\n\n    // initialize the variables for ray marching\n    vec2 P = projectedCoordStart.xy;\n    vec3 Q = Q0;\n    float k = k0;\n    float rayStartZ = -startPosition.z; // estimated ray start depth value\n    float rayEndZ = -startPosition.z;   // estimated ray end depth value\n    float prevEstimateZ = -startPosition.z;\n    float rayDiffZ;\n    float dDepth;\n    float depth;\n    float rayDiffZOld = 0.0;\n\n    // early outs\n    if (dot(normal, dir) < 0.0 || dot(-viewDir, normal) < 0.0)\n      return vec3(P, 0.0);\n\n    for(int i = 0; i < maxSteps; i++)\n    {\n      depth = -linearDepthFromTexture(depthMapView, P, nearFar); // get linear depth from the depth buffer\n\n      // estimate depth of the marching ray\n      rayStartZ = prevEstimateZ;\n      dDepth = -rayStartZ - depth;\n      rayEndZ = (dQ.z * 0.5 + Q.z)/ ((dk * 0.5 + k));\n      rayDiffZ = rayEndZ- rayStartZ;\n      prevEstimateZ = rayEndZ;\n\n      if(-rayEndZ > nearFar[1] || -rayEndZ < nearFar[0] || P.y < 0.0  || P.y > 1.0 )\n      {\n        return vec3(P, 0.);\n      }\n\n      // If we detect a hit - return the intersection point, two conditions:\n      //  - dDepth > 0.0 - sampled point depth is in front of estimated depth\n      //  - if difference between dDepth and rayDiffZOld is not too large\n      //  - if difference between dDepth and 0.025/abs(k) is not too large\n      //  - if the sampled depth is not behind far plane or in front of near plane\n\n      if((dDepth) < 0.025/abs(k) +  abs(rayDiffZOld) && dDepth > 0.0 && depth > nearFar[0] && depth < nearFar[1])\n      {\n          return vec3(P, depth);\n      }\n\n      // continue with ray marching\n      P += dP;\n      Q.z += dQ.z;\n      k += dk;\n      rayDiffZOld = rayDiffZ;\n    }\n    return vec3(P, 0.0);\n  }\n  "],["\n  const int maxSteps = ","\n\n  vec4 applyProjectionMat(mat4 projectionMat, vec3 x)\n  {\n    vec4 projectedCoord =  projectionMat * vec4(x, 1.0);\n    projectedCoord.xy /= projectedCoord.w;\n    projectedCoord.xy = projectedCoord.xy*0.5 + 0.5;\n    return projectedCoord;\n  }\n\n  vec3 screenSpaceIntersection(vec3 dir, vec3 startPosition, vec3 viewDir, vec3 normal)\n  {\n    vec3 viewPos = startPosition;\n    vec3 viewPosEnd = startPosition;\n\n    // Project the start position to the screen\n    vec4 projectedCoordStart = applyProjectionMat(rpProjectionMat, viewPos);\n    vec3  Q0 = viewPos / projectedCoordStart.w; // homogeneous camera space\n    float k0 = 1.0/ projectedCoordStart.w;\n\n    // advance the position in the direction of the reflection\n    viewPos += dir;\n\n    vec4 projectedCoordVanishingPoint = applyProjectionMat(rpProjectionMat, dir);\n\n    // Project the advanced position to the screen\n    vec4 projectedCoordEnd = applyProjectionMat(rpProjectionMat, viewPos);\n    vec3  Q1 = viewPos / projectedCoordEnd.w; // homogeneous camera space\n    float k1 = 1.0/ projectedCoordEnd.w;\n\n    // calculate the reflection direction in the screen space\n    vec2 projectedCoordDir = (projectedCoordEnd.xy - projectedCoordStart.xy);\n    vec2 projectedCoordDistVanishingPoint = (projectedCoordVanishingPoint.xy - projectedCoordStart.xy);\n\n    float yMod = min(abs(projectedCoordDistVanishingPoint.y), 1.0);\n\n    float projectedCoordDirLength = length(projectedCoordDir);\n    float maxSt = float(maxSteps);\n\n    // normalize the projection direction depending on maximum steps\n    // this determines how blocky the reflection looks\n    vec2 dP = yMod * (projectedCoordDir)/(maxSt * projectedCoordDirLength);\n\n    // Normalize the homogeneous camera space coordinates\n    vec3  dQ = yMod * (Q1 - Q0)/(maxSt * projectedCoordDirLength);\n    float dk = yMod * (k1 - k0)/(maxSt * projectedCoordDirLength);\n\n    // initialize the variables for ray marching\n    vec2 P = projectedCoordStart.xy;\n    vec3 Q = Q0;\n    float k = k0;\n    float rayStartZ = -startPosition.z; // estimated ray start depth value\n    float rayEndZ = -startPosition.z;   // estimated ray end depth value\n    float prevEstimateZ = -startPosition.z;\n    float rayDiffZ;\n    float dDepth;\n    float depth;\n    float rayDiffZOld = 0.0;\n\n    // early outs\n    if (dot(normal, dir) < 0.0 || dot(-viewDir, normal) < 0.0)\n      return vec3(P, 0.0);\n\n    for(int i = 0; i < maxSteps; i++)\n    {\n      depth = -linearDepthFromTexture(depthMapView, P, nearFar); // get linear depth from the depth buffer\n\n      // estimate depth of the marching ray\n      rayStartZ = prevEstimateZ;\n      dDepth = -rayStartZ - depth;\n      rayEndZ = (dQ.z * 0.5 + Q.z)/ ((dk * 0.5 + k));\n      rayDiffZ = rayEndZ- rayStartZ;\n      prevEstimateZ = rayEndZ;\n\n      if(-rayEndZ > nearFar[1] || -rayEndZ < nearFar[0] || P.y < 0.0  || P.y > 1.0 )\n      {\n        return vec3(P, 0.);\n      }\n\n      // If we detect a hit - return the intersection point, two conditions:\n      //  - dDepth > 0.0 - sampled point depth is in front of estimated depth\n      //  - if difference between dDepth and rayDiffZOld is not too large\n      //  - if difference between dDepth and 0.025/abs(k) is not too large\n      //  - if the sampled depth is not behind far plane or in front of near plane\n\n      if((dDepth) < 0.025/abs(k) +  abs(rayDiffZOld) && dDepth > 0.0 && depth > nearFar[0] && depth < nearFar[1])\n      {\n          return vec3(P, depth);\n      }\n\n      // continue with ray marching\n      P += dP;\n      Q.z += dQ.z;\n      k += dk;\n      rayDiffZOld = rayDiffZ;\n    }\n    return vec3(P, 0.0);\n  }\n  "])),t.highStepCount?"150;":"75;"))}var s;Object.defineProperty(t,"__esModule",{value:!0}),t.ScreenSpaceReflections=o,function(e){e.bindUniforms=function(e,t,n){n.ssrEnabled&&(e.setUniform1i("depthMapView",n.linearDepthTextureID),t.bindTexture(n.linearDepthTexture,n.linearDepthTextureID),e.setUniform2f("nearFar",n.nearFar[0],n.nearFar[1]),e.setUniformMatrix4fv("ssrViewMat",n.ssrViewMat),a.Reprojection.bindUniforms(e,t,n))}}(o=t.ScreenSpaceReflections||(t.ScreenSpaceReflections={}))}).apply(null,r))||(e.exports=a)},tUyH:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("zOht"),n("KRuQ")],void 0===(a=(function(e,t,n,r){Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){function t(t){var n=e.call(this)||this;return n.material=t.material,n.techniqueRep=t.techniqueRep,n.output=t.output,n}return n.__extends(t,e),t.prototype.getTechnique=function(){return this.technique},t.prototype.getPipelineState=function(e,t){return this.getTechnique().pipeline},t.prototype.ensureResources=function(e){return 2},t.prototype.ensureParameters=function(e){},t}(r.AutoDisposable);t.GLMaterial=a}).apply(null,r))||(e.exports=a)},v22c:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("zOht"),n("fese"),n("3kdR"),n("cj3m"),n("sQDZ"),n("RdU/"),n("naZ0"),n("W/V4"),n("FQ4r"),n("lBa0"),n("EiD/"),n("ff/U"),n("jl7D"),n("G0ER"),n("qbr3"),n("2Kdy")],a=(function(e,t,r,a,i,o,s,c,l,d,u,f,v,p,h,m,g){Object.defineProperty(t,"__esModule",{value:!0});var y=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.waterTextureRepository=t.waterTextureRepository,r}return r.__extends(t,e),t.prototype.initializeProgram=function(e){var n=t.shader.get(),r=this.configuration,a=n.build({output:r.output,viewingMode:e.viewingMode,slicePlaneEnabled:r.slicePlaneEnabled,sliceHighlightDisabled:!1,sliceEnabledForVertexPrograms:!1,receiveShadows:r.receiveShadows,pbrMode:3,useCustomDTRExponentForWater:!0,ssrEnabled:r.useSSR,highStepCount:!0});return new m(e.rctx,a.generateSource("vertex"),a.generateSource("fragment"),p.Default3D)},t.prototype.ensureResource=function(e){return this.waterTextureRepository.ready||this.waterTextureRepository.updating||this.waterTextureRepository.loadTextures(e),this.waterTextureRepository.ready?2:1},t.prototype.bindPass=function(e,t,n){0===this.configuration.output&&s.ScreenSpaceReflections.bindUniforms(this.program,e,n),0!==this.configuration.output&&2!==this.configuration.output||(c.WaterDistortion.bindUniforms(this.program,t),this.waterTextureRepository.bindRepo(e)),0!==this.configuration.output&&5!==this.configuration.output||this.program.setUniform4fv("waterColor",t.color)},t.prototype.bindDraw=function(e){i.Transform.bindUniforms(this.program,e),0===this.configuration.output&&(l.Camera.bindUniforms(this.program,e),a.Slice.bindUniformsWithOrigin(this.program,this.configuration,e),o.ReadShadowMap.bindUniforms(this.program,e,v.DefaultTextureUnits.SHADOW_MAP))},t.prototype.initializePipeline=function(){var e=this.configuration;return g.makePipelineState(2===e.output?{depthTest:{func:513},depthWrite:e.writeDepth&&g.defaultDepthWriteParams,colorWrite:g.defaultColorWriteParams}:{blending:e.transparent&&g.separateBlendingParams(770,1,771,771),depthTest:{func:513},depthWrite:e.writeDepth&&g.defaultDepthWriteParams,colorWrite:g.defaultColorWriteParams})},t.shader=new d.ReloadableShaderModule(h,(function(){return new Promise((function(e,t){Promise.resolve().then((function(){var t=[n("jl7D")];e.apply(null,t)}).bind(this)).catch(t.bind(this))}))})),t}(u.ShaderTechnique);t.WaterTechnique=y;var b=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.output=0,t.receiveShadows=!1,t.slicePlaneEnabled=!1,t.transparent=!1,t.writeDepth=!1,t.useSSR=!1,t.isDraped=!1,t}return r.__extends(t,e),r.__decorate([f.parameter({count:7})],t.prototype,"output",void 0),r.__decorate([f.parameter()],t.prototype,"receiveShadows",void 0),r.__decorate([f.parameter()],t.prototype,"slicePlaneEnabled",void 0),r.__decorate([f.parameter()],t.prototype,"transparent",void 0),r.__decorate([f.parameter()],t.prototype,"writeDepth",void 0),r.__decorate([f.parameter()],t.prototype,"useSSR",void 0),r.__decorate([f.parameter()],t.prototype,"isDraped",void 0),t}(f.ShaderTechniqueConfiguration);t.WaterTechniqueConfiguration=b}).apply(null,r),void 0===a||(e.exports=a)},vGsU:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("zOht"),n("B4Pz"),n("ybGv"),n("piY7"),n("sQDZ"),n("7Aei")],void 0===(a=(function(e,t,n,r,a,i,o,s){var c,l,d;Object.defineProperty(t,"__esModule",{value:!0}),t.Water=function(e,t){e.include(i.PhysicallyBasedRendering,t),e.include(a.Gamma),e.include(r.FoamColor),t.ssrEnabled&&e.include(o.ScreenSpaceReflections,t),e.fragment.code.add(s.glsl(c||(c=n.__makeTemplateObject(["\n    const vec3 fresnelSky =  vec3(0.02, 1.0, 15.0); // f0, f0max, exp\n    const vec2 fresnelMaterial =  vec2(0.02, 0.1); // f0, f0max for specular term\n    const float roughness = 0.015;\n    const float foamIntensityExternal = 1.7;\n    const float ssrIntensity = 0.65;\n    const float ssrHeightFadeStart = 300000.0;\n    const float ssrHeightFadeEnd = 500000.0;\n    const float waterDiffusion = 0.775;\n    const float waterSeeColorMod = 0.8;\n    const float correctionViewingPowerFactor = 0.4;\n\n    const vec3 skyZenitColor = vec3(0.52, 0.68, 0.90);\n    const vec3 skyColor = vec3(0.67, 0.79, 0.9);\n\n    PBRShadingWater shadingInfo;\n\n    /*\n    *   This function is an approximation for the sky gradient reflected\n    *   the water surface and describes a combination of two fresnel terms.\n    *   @parameter: cosTheta = is the result of max(dot(n,v), 0.0)\n    *   @parameter: horizon = the dominant color of the sky horizon\n    *   @parameter: cosTheta = the dominant color of the sky zenit\n    */\n    vec3 getSkyGradientColor(in float cosTheta, in vec3 horizon, in vec3 zenit) {\n      float exponent = pow((1.0 - cosTheta), fresnelSky[2]);\n      return mix(zenit, horizon, exponent);\n    }\n\n    /*\n    *   This function determines the water color per pixel.\n    *   @parameter: n = normal facing away from the surface\n    *   @parameter: v = view direction facing away from the surface.\n    *   @parameter: l = light direction facing away from the surface\n    *   @parameter: lightIntensity = light intensity, currently between 0...PI\n    *   @parameter: localUp = a normal for the general direction of the surface\n    *   @parameter: shadow = the amount of shadow at this pixel (0 = no shadow)\n    */\n    vec3 getSeaColor(in vec3 n, in vec3 v, in vec3 l, vec3 color, in vec3 lightIntensity, in vec3 localUp, in float shadow, float foamIntensity, vec3 positionView) {\n\n      float reflectionHit = 0.;\n      vec3 seaWaterColor = linearizeGamma(color);\n      // using half vector to determine the specular light\n      vec3 h = normalize(l + v);\n      shadingInfo.NdotL = clamp(dot(n, l), 0.0, 1.0);\n      shadingInfo.NdotV = clamp(dot(n, v), 0.001, 1.0);\n      shadingInfo.VdotN = clamp(dot(v, n), 0.001, 1.0);\n      shadingInfo.NdotH = clamp(dot(n, h), 0.0, 1.0);\n      shadingInfo.VdotH = clamp(dot(v, h), 0.0, 1.0);\n      shadingInfo.LdotH = clamp(dot(l, h), 0.0, 1.0);\n\n      // angle between vertex normal and view direction\n      float upDotV = max(dot(localUp,v), 0.0);\n      // reflected sky color: the reflected sky color consists of two main colors, the\n      // reflected color at the horizon and the reflected color of the zenit.\n      // the reflected sky color is then an approximation based on the fresnel term.\n      vec3 skyHorizon = linearizeGamma(skyColor);\n      vec3 skyZenit = linearizeGamma(skyZenitColor);\n      vec3 skyColor = getSkyGradientColor(upDotV, skyHorizon, skyZenit );\n\n      // we use the upDotL to smoothen out the\n      // reflected color of the water\n      float upDotL = max(dot(localUp,l),0.0);\n\n      // The approximated sky color is adjusted according to the sun position.\n      // This is done as approximation for e.g. night views.\n      float daytimeMod = 0.1 + upDotL * 0.9;\n      skyColor *= daytimeMod;\n\n      // If a water surface is in shadow we just use a slight darkening of the\n      // water surface expressed with this shadowModifier.\n      float shadowModifier = clamp(shadow, 0.8, 1.0);\n\n      // The reflected sky color consists of the fresnel reflection multiplied with the approximated sky color.\n      // The shadow is influencing the frensel term to keep the shadow impression for really near views. As long\n      // as reflection are absent there is a need to have a slight shadow for depth perception.\n      vec3 fresnelModifier = fresnelReflection(shadingInfo.VdotN, vec3(fresnelSky[0]), fresnelSky[1]);\n      vec3 reflSky = fresnelModifier * skyColor * shadowModifier;\n\n      // The reflected sea color is the input water color combined with the reflected sky color.\n      // The reflected sky color is modified by the incoming light.\n      vec3 reflSea = seaWaterColor * mix(skyColor, upDotL * lightIntensity * LIGHT_NORMALIZATION, 2.0 / 3.0) * shadowModifier;\n\n      vec3 specular = vec3(0.0);\n      // This prevents the specular light to be rendered when:\n      // - sun is behind a polygon (e.g. sundown for elevated polygons where nDotL might be still ok)\n      // - viewer is under water (for this localUp is better than n)\n      if(upDotV > 0.0 && upDotL > 0.0) {\n        // calculate the cook torrance BRDF but with simplified occlusion\n        vec3 specularSun = brdfSpecularWater(shadingInfo, roughness, vec3(fresnelMaterial[0]), fresnelMaterial[1]);\n\n        // Normalize light intensity to be between 0...1. Shadow cancels out specular light here\n        vec3 incidentLight = lightIntensity * LIGHT_NORMALIZATION * shadow;\n\n        specular = shadingInfo.NdotL * incidentLight * specularSun;\n      }\n\n      vec3 foam = vec3(0.0);\n      if(upDotV > 0.0) {\n        foam = foamIntensity2FoamColor(foamIntensityExternal, foamIntensity, skyZenitColor, daytimeMod);\n      }\n      "],["\n    const vec3 fresnelSky =  vec3(0.02, 1.0, 15.0); // f0, f0max, exp\n    const vec2 fresnelMaterial =  vec2(0.02, 0.1); // f0, f0max for specular term\n    const float roughness = 0.015;\n    const float foamIntensityExternal = 1.7;\n    const float ssrIntensity = 0.65;\n    const float ssrHeightFadeStart = 300000.0;\n    const float ssrHeightFadeEnd = 500000.0;\n    const float waterDiffusion = 0.775;\n    const float waterSeeColorMod = 0.8;\n    const float correctionViewingPowerFactor = 0.4;\n\n    const vec3 skyZenitColor = vec3(0.52, 0.68, 0.90);\n    const vec3 skyColor = vec3(0.67, 0.79, 0.9);\n\n    PBRShadingWater shadingInfo;\n\n    /*\n    *   This function is an approximation for the sky gradient reflected\n    *   the water surface and describes a combination of two fresnel terms.\n    *   @parameter: cosTheta = is the result of max(dot(n,v), 0.0)\n    *   @parameter: horizon = the dominant color of the sky horizon\n    *   @parameter: cosTheta = the dominant color of the sky zenit\n    */\n    vec3 getSkyGradientColor(in float cosTheta, in vec3 horizon, in vec3 zenit) {\n      float exponent = pow((1.0 - cosTheta), fresnelSky[2]);\n      return mix(zenit, horizon, exponent);\n    }\n\n    /*\n    *   This function determines the water color per pixel.\n    *   @parameter: n = normal facing away from the surface\n    *   @parameter: v = view direction facing away from the surface.\n    *   @parameter: l = light direction facing away from the surface\n    *   @parameter: lightIntensity = light intensity, currently between 0...PI\n    *   @parameter: localUp = a normal for the general direction of the surface\n    *   @parameter: shadow = the amount of shadow at this pixel (0 = no shadow)\n    */\n    vec3 getSeaColor(in vec3 n, in vec3 v, in vec3 l, vec3 color, in vec3 lightIntensity, in vec3 localUp, in float shadow, float foamIntensity, vec3 positionView) {\n\n      float reflectionHit = 0.;\n      vec3 seaWaterColor = linearizeGamma(color);\n      // using half vector to determine the specular light\n      vec3 h = normalize(l + v);\n      shadingInfo.NdotL = clamp(dot(n, l), 0.0, 1.0);\n      shadingInfo.NdotV = clamp(dot(n, v), 0.001, 1.0);\n      shadingInfo.VdotN = clamp(dot(v, n), 0.001, 1.0);\n      shadingInfo.NdotH = clamp(dot(n, h), 0.0, 1.0);\n      shadingInfo.VdotH = clamp(dot(v, h), 0.0, 1.0);\n      shadingInfo.LdotH = clamp(dot(l, h), 0.0, 1.0);\n\n      // angle between vertex normal and view direction\n      float upDotV = max(dot(localUp,v), 0.0);\n      // reflected sky color: the reflected sky color consists of two main colors, the\n      // reflected color at the horizon and the reflected color of the zenit.\n      // the reflected sky color is then an approximation based on the fresnel term.\n      vec3 skyHorizon = linearizeGamma(skyColor);\n      vec3 skyZenit = linearizeGamma(skyZenitColor);\n      vec3 skyColor = getSkyGradientColor(upDotV, skyHorizon, skyZenit );\n\n      // we use the upDotL to smoothen out the\n      // reflected color of the water\n      float upDotL = max(dot(localUp,l),0.0);\n\n      // The approximated sky color is adjusted according to the sun position.\n      // This is done as approximation for e.g. night views.\n      float daytimeMod = 0.1 + upDotL * 0.9;\n      skyColor *= daytimeMod;\n\n      // If a water surface is in shadow we just use a slight darkening of the\n      // water surface expressed with this shadowModifier.\n      float shadowModifier = clamp(shadow, 0.8, 1.0);\n\n      // The reflected sky color consists of the fresnel reflection multiplied with the approximated sky color.\n      // The shadow is influencing the frensel term to keep the shadow impression for really near views. As long\n      // as reflection are absent there is a need to have a slight shadow for depth perception.\n      vec3 fresnelModifier = fresnelReflection(shadingInfo.VdotN, vec3(fresnelSky[0]), fresnelSky[1]);\n      vec3 reflSky = fresnelModifier * skyColor * shadowModifier;\n\n      // The reflected sea color is the input water color combined with the reflected sky color.\n      // The reflected sky color is modified by the incoming light.\n      vec3 reflSea = seaWaterColor * mix(skyColor, upDotL * lightIntensity * LIGHT_NORMALIZATION, 2.0 / 3.0) * shadowModifier;\n\n      vec3 specular = vec3(0.0);\n      // This prevents the specular light to be rendered when:\n      // - sun is behind a polygon (e.g. sundown for elevated polygons where nDotL might be still ok)\n      // - viewer is under water (for this localUp is better than n)\n      if(upDotV > 0.0 && upDotL > 0.0) {\n        // calculate the cook torrance BRDF but with simplified occlusion\n        vec3 specularSun = brdfSpecularWater(shadingInfo, roughness, vec3(fresnelMaterial[0]), fresnelMaterial[1]);\n\n        // Normalize light intensity to be between 0...1. Shadow cancels out specular light here\n        vec3 incidentLight = lightIntensity * LIGHT_NORMALIZATION * shadow;\n\n        specular = shadingInfo.NdotL * incidentLight * specularSun;\n      }\n\n      vec3 foam = vec3(0.0);\n      if(upDotV > 0.0) {\n        foam = foamIntensity2FoamColor(foamIntensityExternal, foamIntensity, skyZenitColor, daytimeMod);\n      }\n      "])))),e.fragment.code.add(s.glsl(t.ssrEnabled?l||(l=n.__makeTemplateObject(["\n      // Convert the world position to view position\n      vec4 viewPosition = vec4(positionView.xyz, 1.0);\n      vec3 viewDir = normalize(viewPosition.xyz);\n      vec4 viewNormalVectorCoordinate = ssrViewMat *vec4(n, 0.0);\n      vec3 viewNormal = normalize(viewNormalVectorCoordinate.xyz);\n      vec4 viewUp = ssrViewMat *vec4(localUp, 0.0);\n\n      // at steeper viewing angles we use more of a vertex normal (in this case up) then the wave normal\n      // this removes some artifacts of normal mapping\n      float correctionViewingFactor = pow(max(dot(-viewDir, viewUp.xyz), 0.0), correctionViewingPowerFactor);\n      vec3 viewNormalCorrected = mix(viewUp.xyz, viewNormal, correctionViewingFactor);\n\n      vec3 reflected = normalize(reflect(viewDir, viewNormalCorrected));\n\n      // perform screen space reflection to detect hit\n      vec3 hitCoordinate = screenSpaceIntersection( normalize(reflected), viewPosition.xyz, viewDir, viewUp.xyz);\n      vec3 reflectedColor = vec3(0.0);\n\n      // if there is a hit with ssr find reflected color from the reprojeted frame\n      if (hitCoordinate.z > 0.0)\n      {\n        vec2 reprojectedCoordinate = reprojectionCoordinate(hitCoordinate);\n\n        // fade out if there if the hit is near end of Y axis\n        vec2 dCoords = smoothstep(0.3, 0.6, abs(vec2(0.5, 0.5) - hitCoordinate.xy));\n        float heightMod = smoothstep(ssrHeightFadeEnd, ssrHeightFadeStart, -positionView.z);\n        reflectionHit = waterDiffusion * clamp(1.0 - (1.3*dCoords.y), 0.0, 1.0) * heightMod;\n\n        reflectedColor = linearizeGamma(texture2D(lastFrameColorMap, reprojectedCoordinate).xyz)* reflectionHit * fresnelModifier.y * ssrIntensity;\n      }\n      float seeColorMod =  mix(waterSeeColorMod, waterSeeColorMod*0.5, reflectionHit);\n      // combining reflected sky, reflected sea, specular highlight and SSR reflections.\n      return tonemapACES((1. - reflectionHit) * reflSky + reflectedColor + reflSea * seeColorMod + specular + foam);\n    }\n  "],["\n      // Convert the world position to view position\n      vec4 viewPosition = vec4(positionView.xyz, 1.0);\n      vec3 viewDir = normalize(viewPosition.xyz);\n      vec4 viewNormalVectorCoordinate = ssrViewMat *vec4(n, 0.0);\n      vec3 viewNormal = normalize(viewNormalVectorCoordinate.xyz);\n      vec4 viewUp = ssrViewMat *vec4(localUp, 0.0);\n\n      // at steeper viewing angles we use more of a vertex normal (in this case up) then the wave normal\n      // this removes some artifacts of normal mapping\n      float correctionViewingFactor = pow(max(dot(-viewDir, viewUp.xyz), 0.0), correctionViewingPowerFactor);\n      vec3 viewNormalCorrected = mix(viewUp.xyz, viewNormal, correctionViewingFactor);\n\n      vec3 reflected = normalize(reflect(viewDir, viewNormalCorrected));\n\n      // perform screen space reflection to detect hit\n      vec3 hitCoordinate = screenSpaceIntersection( normalize(reflected), viewPosition.xyz, viewDir, viewUp.xyz);\n      vec3 reflectedColor = vec3(0.0);\n\n      // if there is a hit with ssr find reflected color from the reprojeted frame\n      if (hitCoordinate.z > 0.0)\n      {\n        vec2 reprojectedCoordinate = reprojectionCoordinate(hitCoordinate);\n\n        // fade out if there if the hit is near end of Y axis\n        vec2 dCoords = smoothstep(0.3, 0.6, abs(vec2(0.5, 0.5) - hitCoordinate.xy));\n        float heightMod = smoothstep(ssrHeightFadeEnd, ssrHeightFadeStart, -positionView.z);\n        reflectionHit = waterDiffusion * clamp(1.0 - (1.3*dCoords.y), 0.0, 1.0) * heightMod;\n\n        reflectedColor = linearizeGamma(texture2D(lastFrameColorMap, reprojectedCoordinate).xyz)* reflectionHit * fresnelModifier.y * ssrIntensity;\n      }\n      float seeColorMod =  mix(waterSeeColorMod, waterSeeColorMod*0.5, reflectionHit);\n      // combining reflected sky, reflected sea, specular highlight and SSR reflections.\n      return tonemapACES((1. - reflectionHit) * reflSky + reflectedColor + reflSea * seeColorMod + specular + foam);\n    }\n  "])):d||(d=n.__makeTemplateObject(["\n      // combining reflected sky, reflected sea, specular highlight and SSR reflections.\n      return tonemapACES(reflSky + reflSea * waterSeeColorMod + specular + foam);\n    }\n  "],["\n      // combining reflected sky, reflected sea, specular highlight and SSR reflections.\n      return tonemapACES(reflSky + reflSea * waterSeeColorMod + specular + foam);\n    }\n  "]))))}}).apply(null,r))||(e.exports=a)},vlC2:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("iHt0")],void 0===(a=(function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.vec3f32=n}).apply(null,r))||(e.exports=a)},"wSO/":function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("6DRN"),n("51bw"),n("1m5D"),n("lLWD"),n("DIqE"),n("Rdxj"),n("O7NG")],void 0===(a=(function(e,t,n,r,a,i,o,s,c){Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t,r){var a=this;this.itemByteSize=e,this.itemCreate=t,this.buffers=[],this.items=[],this.itemsPerBuffer=0,this.itemsPtr=0,this.itemsPerBuffer=Math.ceil(r/this.itemByteSize),this.tickHandle=n.before((function(){return a.reset()}))}return e.prototype.destroy=function(){this.tickHandle&&(this.tickHandle.remove(),this.tickHandle=null),this.itemsPtr=0,this.items=null,this.buffers=null},e.prototype.get=function(){0===this.itemsPtr&&n((function(){}));for(var e=Math.floor(this.itemsPtr/this.itemsPerBuffer);this.buffers.length<=e;){for(var t=new ArrayBuffer(this.itemsPerBuffer*this.itemByteSize),r=0;r<this.itemsPerBuffer;++r)this.items.push(this.itemCreate(t,r*this.itemByteSize));this.buffers.push(t)}return this.items[this.itemsPtr++]},e.prototype.reset=function(){for(var e=2*(Math.floor(this.itemsPtr/this.itemsPerBuffer)+1);this.buffers.length>e;)this.buffers.pop(),this.items.length=this.buffers.length*this.itemsPerBuffer;this.itemsPtr=0},e.createVec2f64=function(t){return void 0===t&&(t=d),new e(16,o.vec2f64.createView,t)},e.createVec3f64=function(t){return void 0===t&&(t=d),new e(24,s.vec3f64.createView,t)},e.createVec4f64=function(t){return void 0===t&&(t=d),new e(32,c.vec4f64.createView,t)},e.createMat3f64=function(t){return void 0===t&&(t=d),new e(72,r.mat3f64.createView,t)},e.createMat4f64=function(t){return void 0===t&&(t=d),new e(128,a.mat4f64.createView,t)},e.createQuatf64=function(t){return void 0===t&&(t=d),new e(32,i.quatf64.createView,t)},Object.defineProperty(e.prototype,"test",{get:function(){return{size:this.buffers.length*this.itemsPerBuffer*this.itemByteSize}},enumerable:!0,configurable:!0}),e}();t.VectorStack=l;var d=4096}).apply(null,r))||(e.exports=a)},weRx:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("zOht"),n("zp6E")],void 0===(a=(function(e,t,n,r){Object.defineProperty(t,"__esModule",{value:!0}),t.requestImage=function(e,t){return r(e,n.__assign({responseType:"image"},t)).then((function(e){return e.data}))}}).apply(null,r))||(e.exports=a)},xDGw:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("zOht"),n("2o+p"),n("7Aei")],void 0===(a=(function(e,t,n,r,a){function i(e,t){var i=e.vertex.code;t.verticalOffsetEnabled?(e.vertex.uniforms.add("verticalOffset","vec4"),t.screenSizePerspectiveEnabled&&(e.include(r.ScreenSizePerspective),e.vertex.uniforms.add("screenSizePerspectiveAlignment","vec4")),i.add(a.glsl(u||(u=n.__makeTemplateObject(["\n    vec3 calculateVerticalOffset(vec3 worldPos, vec3 localOrigin) {\n      float viewDistance = length((view * vec4(worldPos, 1.0)).xyz);\n      ","\n      ","\n      // Screen sized offset in world space, used for example for line callouts\n      float worldOffset = clamp(verticalOffsetScreenHeight * verticalOffset.y * viewDistance, verticalOffset.z, verticalOffset.w);\n      return worldNormal * worldOffset;\n    }\n\n    vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) {\n      return worldPos + calculateVerticalOffset(worldPos, localOrigin);\n    }\n    "],["\n    vec3 calculateVerticalOffset(vec3 worldPos, vec3 localOrigin) {\n      float viewDistance = length((view * vec4(worldPos, 1.0)).xyz);\n      ","\n      ","\n      // Screen sized offset in world space, used for example for line callouts\n      float worldOffset = clamp(verticalOffsetScreenHeight * verticalOffset.y * viewDistance, verticalOffset.z, verticalOffset.w);\n      return worldNormal * worldOffset;\n    }\n\n    vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) {\n      return worldPos + calculateVerticalOffset(worldPos, localOrigin);\n    }\n    "])),a.glsl(0===t.viewingMode?s||(s=n.__makeTemplateObject(["vec3 worldNormal = normalize(worldPos + localOrigin);"],["vec3 worldNormal = normalize(worldPos + localOrigin);"])):c||(c=n.__makeTemplateObject(["vec3 worldNormal = vec3(0.0, 0.0, 1.0);"],["vec3 worldNormal = vec3(0.0, 0.0, 1.0);"]))),a.glsl(t.screenSizePerspectiveEnabled?l||(l=n.__makeTemplateObject(["\n          float cosAngle = dot(worldNormal, normalize(worldPos - camPos));\n          float verticalOffsetScreenHeight = screenSizePerspectiveScaleFloat(verticalOffset.x, abs(cosAngle), viewDistance, screenSizePerspectiveAlignment);"],["\n          float cosAngle = dot(worldNormal, normalize(worldPos - camPos));\n          float verticalOffsetScreenHeight = screenSizePerspectiveScaleFloat(verticalOffset.x, abs(cosAngle), viewDistance, screenSizePerspectiveAlignment);"])):d||(d=n.__makeTemplateObject(["\n          float verticalOffsetScreenHeight = verticalOffset.x;"],["\n          float verticalOffsetScreenHeight = verticalOffset.x;"])))))):i.add(a.glsl(f||(f=n.__makeTemplateObject(["\n    vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { return worldPos; }\n    "],["\n    vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { return worldPos; }\n    "]))))}function o(e,t,n,r){return void 0===r&&(r=v),r.screenLength=e.screenLength,r.perDistance=Math.tan(.5*t)/(.5*n),r.minWorldLength=e.minWorldLength,r.maxWorldLength=e.maxWorldLength,r}Object.defineProperty(t,"__esModule",{value:!0}),t.VerticalOffset=i,function(e){e.bindUniforms=function(e,t,n){if(t.verticalOffset){var r=o(t.verticalOffset,n.fovY,n.viewport[3]);e.setUniform4f("verticalOffset",r.screenLength*(n.pixelRatio||1),r.perDistance,r.minWorldLength,r.maxWorldLength)}}}(i=t.VerticalOffset||(t.VerticalOffset={})),t.calculateVerticalOffsetFactors=o;var s,c,l,d,u,f,v={screenLength:0,perDistance:0,minWorldLength:0,maxWorldLength:0}}).apply(null,r))||(e.exports=a)},ybGv:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("zOht"),n("7Aei")],void 0===(a=(function(e,t,n,r){var a;Object.defineProperty(t,"__esModule",{value:!0}),t.Gamma=function(e){e.fragment.code.add(r.glsl(a||(a=n.__makeTemplateObject(["\n    const float GAMMA = 2.2;\n    const float INV_GAMMA = 0.4545454545;\n\n    vec4 delinearizeGamma(vec4 color) {\n      return vec4(pow(color.rgb, vec3(INV_GAMMA)), color.w);\n    }\n\n    vec3 linearizeGamma(vec3 color) {\n      return pow(color, vec3(GAMMA));\n    }\n  "],["\n    const float GAMMA = 2.2;\n    const float INV_GAMMA = 0.4545454545;\n\n    vec4 delinearizeGamma(vec4 color) {\n      return vec4(pow(color.rgb, vec3(INV_GAMMA)), color.w);\n    }\n\n    vec3 linearizeGamma(vec3 color) {\n      return pow(color, vec3(GAMMA));\n    }\n  "]))))}}).apply(null,r))||(e.exports=a)},yqrJ:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("zOht"),n("pcDC"),n("ma1f"),n("BcWh"),n("xoE+"),n("xoE+"),n("LxLY"),n("qMld"),n("rusB"),n("jfWY"),n("R6Tp"),n("weRx"),n("EyQ4"),n("/Bau"),n("W0kZ"),n("CIy2"),n("/f24"),n("Zp3t"),n("Kfys"),n("7laH")],void 0===(a=(function(e,t,n,r,a,i,o,s,c,l,d,u,f,v,p,h,m,g,y,b,x,w){return function(){function e(t,n,r){this.data=t,this.glTexture=null,this.powerOfTwoStretchInfo=null,this.loadingPromise=null,this.loadingController=null,this.events=new i,this.data=t,this.id=e.idGen.gen(n),this.params=r||{},this.params.mipmap=!1!==this.params.mipmap,this.params.noUnpackFlip=this.params.noUnpackFlip||!1,this.params.preMultiplyAlpha=this.params.preMultiplyAlpha||!1,this.params.wrap=this.params.wrap||{s:10497,t:10497},this.params.powerOfTwoResizeMode=this.params.powerOfTwoResizeMode||1,this.estimatedTexMemRequired=e.estimateTexMemRequired(this.data,this.params),this.startPreload()}return e.prototype.startPreload=function(){var e=this.data;c.isNone(e)||(e instanceof HTMLVideoElement?this.startPreloadVideoElement(e):e instanceof HTMLImageElement&&this.startPreloadImageElement(e))},e.prototype.startPreloadVideoElement=function(e){u.isBlobProtocol(e.src)||"auto"===e.preload&&e.crossOrigin||(e.preload="auto",e.crossOrigin="anonymous",e.src=e.src)},e.prototype.startPreloadImageElement=function(e){u.isDataProtocol(e.src)||u.isBlobProtocol(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)},e.getDataDimensions=function(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e},e.estimateTexMemRequired=function(t,n){if(c.isNone(t))return 0;if(d.isArrayBuffer(t)||d.isUint8Array(t))return t.byteLength;var r=t instanceof Image||t instanceof ImageData||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement?e.getDataDimensions(t):n;return(n.mipmap?4/3:1)*r.width*r.height*(n.components||4)||0},e.prototype.dispose=function(){this.data=void 0},Object.defineProperty(e.prototype,"width",{get:function(){return this.params.width},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.params.height},enumerable:!0,configurable:!0}),e.prototype.createDescriptor=function(e){return{target:3553,pixelFormat:6408,dataType:5121,wrapMode:this.params.wrap,flipped:!this.params.noUnpackFlip,samplingMode:this.params.mipmap?9987:9729,hasMipmap:this.params.mipmap,preMultiplyAlpha:this.params.preMultiplyAlpha,maxAnisotropy:this.params.mipmap&&!this.params.disableAnisotropy?e.parameters.maxMaxAnisotropy:void 0}},e.prototype.load=function(t,n){if(c.isSome(this.glTexture))return this.glTexture;if(c.isSome(this.loadingPromise))return this.loadingPromise;var a=this.data;return c.isNone(a)?(this.glTexture=new b(t,this.createDescriptor(t),null),t.bindTexture(this.glTexture),this.glTexture):"string"==typeof a?this.loadFromURL(t,n,a):a instanceof Image?this.loadFromImageElement(t,n,a):a instanceof HTMLVideoElement?this.loadFromVideoElement(t,n,a):a instanceof ImageData||a instanceof HTMLCanvasElement?this.loadFromImage(t,a,n):(d.isArrayBuffer(a)||d.isUint8Array(a))&&this.params.encoding===e.DDS_ENCODING?this.loadFromDDSData(t,a):d.isUint8Array(a)?this.loadFromPixelData(t,a):d.isArrayBuffer(a)?this.loadFromPixelData(t,new Uint8Array(a)):(r.neverReachedSilent(a),null)},Object.defineProperty(e.prototype,"requiresFrameUpdates",{get:function(){return this.data instanceof HTMLVideoElement},enumerable:!0,configurable:!0}),e.prototype.frameUpdate=function(e,t,n){if(!(this.data instanceof HTMLVideoElement)||c.isNone(this.glTexture))return n;if(this.data.readyState<2||n===this.data.currentTime)return n;if(c.isSome(this.powerOfTwoStretchInfo)){var r=this.powerOfTwoStretchInfo,a=r.framebuffer,i=r.vao,o=r.sourceTexture;o.setData(this.data),this.drawStretchedTexture(e,t,a,i,o,this.glTexture)}else{var s=this.data,l=s.width,d=s.height,u=this.glTexture.descriptor,f=u.width,v=u.height;l!==f||d!==v?this.glTexture.updateData(0,0,0,Math.min(l,f),Math.min(d,v),this.data):this.glTexture.setData(this.data)}return this.glTexture.descriptor.hasMipmap&&this.glTexture.generateMipmap(),this.data.currentTime},e.prototype.loadFromDDSData=function(e,t){return this.glTexture=p.createDDSTexture(e,this.createDescriptor(e),t,this.params.mipmap),e.bindTexture(this.glTexture),this.glTexture},e.prototype.loadFromPixelData=function(e,t){g.assert(this.params.width>0&&this.params.height>0);var n=this.createDescriptor(e);return n.pixelFormat=1===this.params.components?6409:3===this.params.components?6407:6408,n.width=this.params.width,n.height=this.params.height,this.glTexture=new b(e,n,t),e.bindTexture(this.glTexture),this.glTexture},e.prototype.loadAsync=function(e){return n.__awaiter(this,void 0,void 0,(function(){var t,r,a,i=this;return n.__generator(this,(function(n){return t=l.createAbortController(),this.loadingController=t,r=e(t.signal),this.loadingPromise=r,r.then(a=function(){i.loadingController===t&&(i.loadingController=null),i.loadingPromise===r&&(i.loadingPromise=null)},a),[2,r]}))}))},e.prototype.loadFromURL=function(e,t,r){var a=this;return this.loadAsync((function(i){return n.__awaiter(a,void 0,void 0,(function(){var a;return n.__generator(this,(function(n){switch(n.label){case 0:return[4,v.requestImage(r,{signal:i})];case 1:return a=n.sent(),[2,this.loadFromImage(e,a,t)]}}))}))}))},e.prototype.loadFromImageElement=function(e,t,r){var a=this;return r.complete?this.loadFromImage(e,r,t):this.loadAsync((function(i){return n.__awaiter(a,void 0,void 0,(function(){var a;return n.__generator(this,(function(n){switch(n.label){case 0:return[4,f.loadImageAsync(r,r.src,!1,i)];case 1:return a=n.sent(),[2,this.loadFromImage(e,a,t)]}}))}))}))},e.prototype.loadFromVideoElement=function(e,t,n){return n.readyState>=2?this.loadFromImage(e,n,t):this.loadFromVideoElementAsync(e,t,n)},e.prototype.loadFromVideoElementAsync=function(e,t,n){var r=this;return this.loadAsync((function(i){return l.create((function(o,s){var d=function(){n.removeEventListener("loadeddata",u),n.removeEventListener("error",f),c.isSome(v)&&v.remove()},u=function(){n.readyState>=2&&(d(),o(r.loadFromImage(e,n,t)))},f=function(e){d(),s(e||new a("Failed to load video"))};n.addEventListener("loadeddata",u),n.addEventListener("error",f);var v=l.onAbort(i,(function(){return f(l.createAbortError())}))}))}))},e.prototype.loadFromImage=function(t,n,r){var a=e.getDataDimensions(n);this.params.width=a.width,this.params.height=a.height;var i=this.createDescriptor(t);return i.pixelFormat=3===this.params.components?6407:6408,!this.requiresPowerOfTwo(t,i)||s.isPowerOfTwo(a.width)&&s.isPowerOfTwo(a.height)?(i.width=a.width,i.height=a.height,this.glTexture=new b(t,i,n),t.bindTexture(this.glTexture),this.glTexture):(this.glTexture=this.makePowerOfTwoTexture(t,n,a,i,r),t.bindTexture(this.glTexture),this.glTexture)},e.prototype.requiresPowerOfTwo=function(e,t){var n="number"==typeof t.wrapMode?33071===t.wrapMode:33071===t.wrapMode.s&&33071===t.wrapMode.t;return!w.default(e.gl)&&(t.hasMipmap||!n)},e.prototype.makePowerOfTwoTexture=function(e,t,n,a,i){var s,c=n.width,l=n.height,d=o.nextHighestPowerOfTwo(c),u=o.nextHighestPowerOfTwo(l);switch(a.width=d,a.height=u,this.params.powerOfTwoResizeMode){case 2:a.textureCoordinateScaleFactor=[c/d,l/u],(s=new b(e,a)).updateData(0,0,0,c,l,t);break;case 1:case null:case void 0:s=this.stretchToPowerOfTwo(e,t,a,i);break;default:r.neverReached(this.params.powerOfTwoResizeMode)}return a.hasMipmap&&s.generateMipmap(),s},e.prototype.stretchToPowerOfTwo=function(e,t,n,r){var a=new b(e,n),i=new y(e,{colorTarget:0,depthStencilTarget:0},a),o=new b(e,{target:3553,pixelFormat:n.pixelFormat,dataType:5121,wrapMode:33071,samplingMode:9729,flipped:!!n.flipped,maxAnisotropy:8,preMultiplyAlpha:n.preMultiplyAlpha},t),s=h.createQuadVAO(e);return this.drawStretchedTexture(e,r,i,s,o,a),this.requiresFrameUpdates?this.powerOfTwoStretchInfo={vao:s,sourceTexture:o,framebuffer:i}:(s.dispose(!0),o.dispose(),i.detachColorTexture(),e.bindFramebuffer(null),i.dispose()),a},e.prototype.drawStretchedTexture=function(e,t,n,r,a,i){e.bindFramebuffer(n);var o=e.getViewport();e.setViewport(0,0,i.descriptor.width,i.descriptor.height);var s=t.program;e.bindProgram(s),s.setUniform4f("color",1,1,1,1),s.setUniform1i("tex",0),e.bindTexture(a,0),e.bindVAO(r),e.setPipelineState(t.pipeline),e.drawArrays(5,0,x.vertexCount(r,"geometry")),e.bindFramebuffer(null),e.setViewport(o.x,o.y,o.width,o.height)},e.prototype.unload=function(){if(c.isSome(this.powerOfTwoStretchInfo)){var e=this.powerOfTwoStretchInfo,t=e.framebuffer,n=e.sourceTexture;e.vao.dispose(!0),n.dispose(),t.dispose(),this.glTexture=null,this.powerOfTwoStretchInfo=null}if(c.isSome(this.glTexture)&&(this.glTexture.dispose(),this.glTexture=null),c.isSome(this.loadingController)){var r=this.loadingController;this.loadingController=null,this.loadingPromise=null,r.abort()}this.events.emit("unloaded")},e.idGen=new m.IdGen,e.DDS_ENCODING="image/vnd-ms.dds",e}()}).apply(null,r))||(e.exports=a)},ys4y:function(e,t,n){var r,a;r=[n.dj.c(e.i),t,n("3RHn"),n("+nCE"),n("W0kZ"),n("CIy2"),n("CIy2")],void 0===(a=(function(e,t,n,r,a,i,o){return function(){function e(t,n,r){this._boundingInfo=null,this._id=e.__idGen.gen(n),this._data=t,this._boundingInfo=r}return Object.defineProperty(e.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this._data},enumerable:!0,configurable:!0}),e.prototype.getIndices=function(e){return this.data.getIndices(e)},Object.defineProperty(e.prototype,"indexCount",{get:function(){return this.data.indexCount},enumerable:!0,configurable:!0}),e.prototype.getAttribute=function(e){return this.data.getAttribute(e)},Object.defineProperty(e.prototype,"vertexCount",{get:function(){return this.data.indexCount},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"faceCount",{get:function(){return this.data.indexCount/3},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"boundingInfo",{get:function(){return null==this._boundingInfo&&(this._boundingInfo=this._calculateBoundingInfo()),this._boundingInfo},enumerable:!0,configurable:!0}),e.prototype.computeAttachmentOrigin=function(e){return"triangle"===this.data.primitiveType?this.computeAttachmentOriginTriangles(e):this.computeAttachmentOriginPoints(e)},e.prototype.computeAttachmentOriginTriangles=function(e){var t=this.getIndices(o.VertexAttrConstants.POSITION),n=this.getAttribute(o.VertexAttrConstants.POSITION);return r.computeAttachmentOriginTriangles(n,t,e)},e.prototype.computeAttachmentOriginPoints=function(e){var t=this.getIndices(o.VertexAttrConstants.POSITION),n=this.getAttribute(o.VertexAttrConstants.POSITION);return r.computeAttachmentOriginPoints(n,t,e)},e.prototype.invalidateBoundingInfo=function(){this._boundingInfo=null},e.prototype._calculateBoundingInfo=function(){var e=this.data.getIndices(o.VertexAttrConstants.POSITION),t=this.data.getAttribute(o.VertexAttrConstants.POSITION),a="triangle"===this.data.primitiveType?3:1;if(0===e.length){e=new Uint32Array(a);for(var s=0;s<a;++s)e[s]=s}var c=e.length;i.assert(c%a==0,"Indexing error: "+c.toFixed(0)+" not divisible by "+a.toFixed(0));var l=r.generateDefaultIndexArray(c/a);return new n(l,a,e,t)},e.__idGen=new a.IdGen,e}()}).apply(null,r))||(e.exports=a)}}]);