/* 2020-9-22 15:23:28 | 版权所有 军懋国兴 */ function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(e,t){"object"==("undefined"==typeof exports?"undefined":_typeof(exports))&&"object"==("undefined"==typeof module?"undefined":_typeof(module))?module.exports=t(require("echarts")):"function"==typeof define&&define.amd?define(["echarts"],t):"object"==("undefined"==typeof exports?"undefined":_typeof(exports))?exports["echarts-gl"]=t(require("echarts")):e["echarts-gl"]=t(e.echarts)}(this,function(r){return a={},n.m=i=[function(e,t){e.exports=r},function(e,t,r){"use strict";function p(e){return e instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof Image}function i(e){return Math.pow(2,Math.round(Math.log(e)/Math.LN2))}function m(e){var t,r,n;e.wrapS!==s.a.REPEAT&&e.wrapT!==s.a.REPEAT||!e.image||(t=i(e.width),r=i(e.height),t===e.width&&r===e.height||((n=document.createElement("canvas")).width=t,n.height=r,n.getContext("2d").drawImage(e.image,0,0,t,r),e.image=n))}var n=r(40),a=r(52),o=r(5),s=r(4),u=r(8),l=r(19),h=r(35),c=r(15),d=r(0),f=r.n(d),g=r(36),_=r(60),v=r.n(_),y=r(61),x=r(124),T=r(125),b=r(129),w=r(130),E=r(2),S=r(132),A=r(43),M=r(76),C=r(133),L=r(134),D=r(135),N=r(136),R=r(41),P=r(37),I=r(26),O=r(3),F=r(137),B=r(56),U=r(138),z=r(139),G=r(140),H=r(9),V=r(74),k=r(54),W=r(18),j=r(59),X=r(141),q=r(146),Z=r(71),Y=r(147),K=r(148),Q=r(149),J=r(150),$=r(151),ee=r(152);f.a.util.extend(h.a.prototype,X.a),u.a.import(q.a),u.a.import(Z.a),u.a.import(Y.a),u.a.import(K.a),u.a.import(Q.a),u.a.import(J.a),u.a.import($.a),u.a.import(ee.a);var te=g.a.prototype.addToScene,re=g.a.prototype.removeFromScene;g.a.prototype.addToScene=function(e){var t;te.call(this,e),this.__zr&&(t=this.__zr,e.traverse(function(e){e.__zr=t,e.addAnimatorsToZr&&e.addAnimatorsToZr(t)}))},g.a.prototype.removeFromScene=function(e){re.call(this,e),e.traverse(function(e){var t=e.__zr;e.__zr=null,t&&e.removeAnimatorsFromZr&&e.removeAnimatorsFromZr(t)})},l.a.prototype.setTextureImage=function(t,e,r,n){if(this.shader){var i,a=r.getZr(),o=this;return o.autoUpdateTextureStatus=!1,o.disableTexture(t),(s=e)&&"none"!==s&&(i=ne.loadTexture(e,r,n,function(e){o.enableTexture(t),a&&a.refresh()}),o.set(t,i)),i}var s};var ne={};ne.Renderer=a.a,ne.Node=h.a,ne.Mesh=n.a,ne.Shader=u.a,ne.Material=l.a,ne.Texture=s.a,ne.Texture2D=o.a,ne.Geometry=c.a,ne.SphereGeometry=S.a,ne.PlaneGeometry=A.a,ne.CubeGeometry=M.a,ne.AmbientLight=C.a,ne.DirectionalLight=L.a,ne.PointLight=D.a,ne.SpotLight=N.a,ne.PerspectiveCamera=R.a,ne.OrthographicCamera=P.a,ne.Vector2=I.a,ne.Vector3=O.a,ne.Vector4=F.a,ne.Quaternion=B.a,ne.Matrix2=U.a,ne.Matrix2d=z.a,ne.Matrix3=G.a,ne.Matrix4=H.a,ne.Plane=V.a,ne.Ray=k.a,ne.BoundingBox=W.a,ne.Frustum=j.a;var ie=y.a.createBlank("rgba(255,255,255,0)").image;ne.loadTexture=function(e,t,r,n){"function"==typeof r&&(n=r,r={}),r=r||{};for(var i=Object.keys(r).sort(),a="",o=0;o>t;return e+1},dispose:function(e){var t=this._cache;t.use(e.__uid__);var r=t.get("webgl_texture");r&&e.gl.deleteTexture(r),t.deleteContext(e.__uid__)},isRenderable:function(){},isPowerOfTwo:function(){}});Object.defineProperty(o.prototype,"width",{get:function(){return this._width},set:function(e){this._width=e}}),Object.defineProperty(o.prototype,"height",{get:function(){return this._height},set:function(e){this._height=e}}),o.BYTE=i.a.BYTE,o.UNSIGNED_BYTE=i.a.UNSIGNED_BYTE,o.SHORT=i.a.SHORT,o.UNSIGNED_SHORT=i.a.UNSIGNED_SHORT,o.INT=i.a.INT,o.UNSIGNED_INT=i.a.UNSIGNED_INT,o.FLOAT=i.a.FLOAT,o.HALF_FLOAT=36193,o.UNSIGNED_INT_24_8_WEBGL=34042,o.DEPTH_COMPONENT=i.a.DEPTH_COMPONENT,o.DEPTH_STENCIL=i.a.DEPTH_STENCIL,o.ALPHA=i.a.ALPHA,o.RGB=i.a.RGB,o.RGBA=i.a.RGBA,o.LUMINANCE=i.a.LUMINANCE,o.LUMINANCE_ALPHA=i.a.LUMINANCE_ALPHA,o.SRGB=35904,o.SRGB_ALPHA=35906,o.COMPRESSED_RGB_S3TC_DXT1_EXT=33776,o.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777,o.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778,o.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779,o.NEAREST=i.a.NEAREST,o.LINEAR=i.a.LINEAR,o.NEAREST_MIPMAP_NEAREST=i.a.NEAREST_MIPMAP_NEAREST,o.LINEAR_MIPMAP_NEAREST=i.a.LINEAR_MIPMAP_NEAREST,o.NEAREST_MIPMAP_LINEAR=i.a.NEAREST_MIPMAP_LINEAR,o.LINEAR_MIPMAP_LINEAR=i.a.LINEAR_MIPMAP_LINEAR,o.REPEAT=i.a.REPEAT,o.CLAMP_TO_EDGE=i.a.CLAMP_TO_EDGE,o.MIRRORED_REPEAT=i.a.MIRRORED_REPEAT,t.a=o},function(e,t,r){"use strict";function f(e){return Math.pow(2,Math.round(Math.log(e)/Math.LN2))}var p=r(4),h=r(11),i=r(14),n=r(73).a.isPowerOfTwo,a=p.a.extend(function(){return{image:null,pixels:null,mipmaps:[],convertToPOT:!1}},{textureType:"texture2D",update:function(e){var t=e.gl;t.bindTexture(t.TEXTURE_2D,this._cache.get("webgl_texture")),this.updateCommon(e);var r=this.format,n=this.type,i=!(!this.convertToPOT||this.mipmaps.length||!this.image||this.wrapS!==p.a.REPEAT&&this.wrapT!==p.a.REPEAT||!this.NPOT);t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,i?this.wrapS:this.getAvailableWrapS()),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,i?this.wrapT:this.getAvailableWrapT()),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,i?this.magFilter:this.getAvailableMagFilter()),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,i?this.minFilter:this.getAvailableMinFilter());var a=e.getGLExtension("EXT_texture_filter_anisotropic");if(a&&1=p.a.COMPRESSED_RGB_S3TC_DXT1_EXT?e.compressedTexImage2D(e.TEXTURE_2D,r,a,n,i,0,t.pixels):e.texImage2D(e.TEXTURE_2D,r,a,n,i,0,a,o,t.pixels)},generateMipmap:function(e){var t=e.gl;this.useMipmap&&!this.NPOT&&(t.bindTexture(t.TEXTURE_2D,this._cache.get("webgl_texture")),t.generateMipmap(t.TEXTURE_2D))},isPowerOfTwo:function(){return n(this.width)&&n(this.height)},isRenderable:function(){return this.image?"CANVAS"===this.image.nodeName||"VIDEO"===this.image.nodeName||this.image.complete:!(!this.width||!this.height)},bind:function(e){e.gl.bindTexture(e.gl.TEXTURE_2D,this.getWebGLTexture(e))},unbind:function(e){e.gl.bindTexture(e.gl.TEXTURE_2D,null)},load:function(e,t){var r=i.a.createImage();t&&(r.crossOrigin=t);var n=this;return r.onload=function(){n.dirty(),n.trigger("success",n),r.onload=null},r.onerror=function(){n.trigger("error",n),r.onerror=null},r.src=e,this.image=r,this}});Object.defineProperty(a.prototype,"width",{get:function(){return this.image?this.image.width:this._width},set:function(e){this.image?console.warn("Texture from image can't set width"):(this._width!==e&&this.dirty(),this._width=e)}}),Object.defineProperty(a.prototype,"height",{get:function(){return this.image?this.image.height:this._height},set:function(e){this.image?console.warn("Texture from image can't set height"):(this._height!==e&&this.dirty(),this._height=e)}}),t.a=a},function(e,t,r){"use strict";var n=r(161);t.a=n.a},function(e,t,r){"use strict";function n(){this.__uid__=o.a.genGUID()}var i=r(110),a=r(53),o=r(23);n.__initializers__=[function(e){o.a.extend(this,e)}],o.a.extend(n,i.a),o.a.extend(n.prototype,a.a),t.a=n},function(e,t,r){"use strict";function n(e){for(var t=[],r=0;ra[0]&&(a[0]=s),u>a[1]&&(a[1]=u),l>a[2]&&(a[2]=l)}r._dirty=!0,n._dirty=!0}},generateVertexNormals:function(){if(this.vertexCount){var e=this.indices,t=this.attributes,r=t.position.value,n=t.normal.value;if(n&&n.length===r.length)for(var i=0;i=r.COLOR_ATTACHMENT0&&i<=r.COLOR_ATTACHMENT0+8&&a.push(i);n.drawBuffersEXT(a)}}this.trigger("beforerender",this,e);var o,s=this.clearDepth?r.DEPTH_BUFFER_BIT:0;r.depthMask(!0),this.clearColor&&(s|=r.COLOR_BUFFER_BIT,r.colorMask(!0,!0,!0,!0),o=this.clearColor,Array.isArray(o)&&r.clearColor(o[0],o[1],o[2],o[3])),r.clear(s),this.blendWithPrevious?(r.enable(r.BLEND),this.material.transparent=!0):(r.disable(r.BLEND),this.material.transparent=!1),this.renderQuad(e),this.trigger("afterrender",this,e),t&&this.unbind(e,t)},renderQuad:function(e){d.material=this.material,e.renderPass([d],f)},dispose:function(){}});t.a=p},function(e,t,r){"use strict";t.a=function(e,t,r){return{seriesType:e,reset:function(e){var t=e.getData(),n=e.visualColorAccessPath.split(".");n[n.length-1]="opacity";var r=e.get(n);return t.setVisual("opacity",null==r?1:r),{dataEach:t.hasItemOption?function(e,t){var r=e.getItemModel(t).get(n,!0);null!=r&&e.setItemVisual(t,"opacity",r)}:null}}}}},function(e,t,r){"use strict";function n(e,t){this.min=e||new c.a(1/0,1/0,1/0),this.max=t||new c.a(-1/0,-1/0,-1/0),this.vertices=null}var a,o,s,u,l,h,i,c=r(3),d=r(12),f=d.a.set,p=d.a.copy;function m(){return i.apply(this,arguments)}n.prototype={constructor:n,updateFromVertices:function(e){if(0i[0]&&(i[0]=o[0]),o[1]>i[1]&&(i[1]=o[1]),o[2]>i[2]&&(i[2]=o[2])}t._dirty=!0,r._dirty=!0}},union:function(e){var t=this.min,r=this.max;return d.a.min(t.array,t.array,e.min.array),d.a.max(r.array,r.array,e.max.array),t._dirty=!0,r._dirty=!0,this},intersection:function(e){var t=this.min,r=this.max;return d.a.max(t.array,t.array,e.min.array),d.a.min(r.array,r.array,e.max.array),t._dirty=!0,r._dirty=!0,this},intersectBoundingBox:function(e){var t=this.min.array,r=this.max.array,n=e.min.array,i=e.max.array;return!(t[0]>i[0]||t[1]>i[1]||t[2]>i[2]||r[0]=i[0]&&r[1]>=i[1]&&r[2]>=i[2]},containPoint:function(e){var t=this.min.array,r=this.max.array,n=e.array;return t[0]<=n[0]&&t[1]<=n[1]&&t[2]<=n[2]&&r[0]>=n[0]&&r[1]>=n[1]&&r[2]>=n[2]},isFinite:(i=function(){var e=this.min.array,t=this.max.array;return isFinite(e[0])&&isFinite(e[1])&&isFinite(e[2])&&isFinite(t[0])&&isFinite(t[1])&&isFinite(t[2])},m.toString=function(){return i.toString()},m),applyTransform:function(e){this.transformFrom(this,e)},transformFrom:(a=d.a.create(),o=d.a.create(),s=d.a.create(),u=d.a.create(),l=d.a.create(),h=d.a.create(),function(e,t){var r=e.min.array,n=e.max.array,i=t.array;return a[0]=i[0]*r[0],a[1]=i[1]*r[0],a[2]=i[2]*r[0],o[0]=i[0]*n[0],o[1]=i[1]*n[0],o[2]=i[2]*n[0],s[0]=i[4]*r[1],s[1]=i[5]*r[1],s[2]=i[6]*r[1],u[0]=i[4]*n[1],u[1]=i[5]*n[1],u[2]=i[6]*n[1],l[0]=i[8]*r[2],l[1]=i[9]*r[2],l[2]=i[10]*r[2],h[0]=i[8]*n[2],h[1]=i[9]*n[2],h[2]=i[10]*n[2],r=this.min.array,n=this.max.array,r[0]=Math.min(a[0],o[0])+Math.min(s[0],u[0])+Math.min(l[0],h[0])+i[12],r[1]=Math.min(a[1],o[1])+Math.min(s[1],u[1])+Math.min(l[1],h[1])+i[13],r[2]=Math.min(a[2],o[2])+Math.min(s[2],u[2])+Math.min(l[2],h[2])+i[14],n[0]=Math.max(a[0],o[0])+Math.max(s[0],u[0])+Math.max(l[0],h[0])+i[12],n[1]=Math.max(a[1],o[1])+Math.max(s[1],u[1])+Math.max(l[1],h[1])+i[13],n[2]=Math.max(a[2],o[2])+Math.max(s[2],u[2])+Math.max(l[2],h[2])+i[14],this.min._dirty=!0,this.max._dirty=!0,this}),applyProjection:function(e){var t,r=this.min.array,n=this.max.array,i=e.array,a=r[0],o=r[1],s=r[2],u=n[0],l=n[1],h=r[2],c=n[0],d=n[1],f=n[2];return 1===i[15]?(r[0]=i[0]*a+i[12],r[1]=i[5]*o+i[13],n[2]=i[10]*s+i[14],n[0]=i[0]*c+i[12],n[1]=i[5]*d+i[13],r[2]=i[10]*f+i[14]):(t=-1/s,r[0]=i[0]*a*t,r[1]=i[5]*o*t,n[2]=(i[10]*s+i[14])*t,t=-1/h,n[0]=i[0]*u*t,n[1]=i[5]*l*t,t=-1/f,r[2]=(i[10]*f+i[14])*t),this.min._dirty=!0,this.max._dirty=!0,this},updateVertices:function(){var e=this.vertices;if(!e){e=[];for(var t=0;t<8;t++)e[t]=d.a.fromValues(0,0,0);this.vertices=e}var r=this.min.array,n=this.max.array;return f(e[0],r[0],r[1],r[2]),f(e[1],r[0],n[1],r[2]),f(e[2],n[0],r[1],r[2]),f(e[3],n[0],n[1],r[2]),f(e[4],r[0],r[1],n[2]),f(e[5],r[0],n[1],n[2]),f(e[6],n[0],r[1],n[2]),f(e[7],n[0],n[1],n[2]),this},copy:function(e){var t=this.min,r=this.max;return p(t.array,e.min.array),p(r.array,e.max.array),t._dirty=!0,r._dirty=!0,this},clone:function(){var e=new n;return e.copy(this),e}},t.a=n},function(e,t,r){"use strict";function u(e){var t=Object.keys(e);t.sort();for(var r=[],n=0;n=r.x&&t>=r.y&&e<=r.x+r.width&&t<=r.y+r.height};var _=new h.a;n.prototype.castRay=function(e,t,r){var n=this.layer.renderer,i=n.viewport;return n.viewport=this.viewport,n.screenToNDC(e,t,_),this.camera.castRay(_,r),n.viewport=i,r},n.prototype.prepareRender=function(){this.scene.update(),this.camera.update(),this.scene.updateLights();var e=this.scene.updateRenderList(this.camera);this._needsSortProgressively=!1;for(var t=0;tthis.camera.far||e"+s.join("
")):_.a.format.encodeHTML(_.a.format.addCommas(h)),d=l.getName(t),f=l.getItemVisual(t,"color");function p(e,t){var r,n,i=l.getDimensionInfo(t);i&&!1!==i.otherDims.tooltip&&(r=i.type,(n="- "+(i.tooltipName||i.name)+": "+("ordinal"===r?e+"":"time"===r?a?"":_.a.format.formatTime("yyyy/MM/dd hh:mm:ss",e):_.a.format.addCommas(e)))&&s.push(_.a.format.encodeHTML(n)))}_.a.util.isObject(f)&&f.colorStops&&(f=(f.colorStops[0]||{}).color),f=f||"transparent";var m=_.a.format.getTooltipMarker(f),g=e.name;return"\0-"===g&&(g=""),g=g?_.a.format.encodeHTML(g)+(a?": ":"
"):"",a?m+g+c:g+m+(d?_.a.format.encodeHTML(d)+": "+c:c)}},function(e,t,r){"use strict";var n=r(72),i=r(11),a=n.a.extend({skeleton:null,joints:null,useSkinMatricesTexture:!1},function(){this.joints||(this.joints=[])},{isSkinnedMesh:function(){return!!(this.skeleton&&this.joints&&0this._glinfo.getMaxJointNumber()?(n=o.getSubSkinMatricesTexture(e.__uid__,e.joints),t.useTextureSlot(this,n,r),t.setUniform(a,"1i","skinMatricesTexture",r),t.setUniform(a,"1f","skinMatricesTextureSize",n.width)):(i=o.getSubSkinMatrices(e.__uid__,e.joints),t.setUniformOfSemantic(a,"SKIN_MATRIX",i)))},_renderObject:function(e,t){var r,n=this.gl,i=e.geometry,a=e.mode;null==a&&(a=4),t.indicesBuffer?(r=this.getGLExtension("OES_element_index_uint")&&i.indices instanceof Uint32Array?n.UNSIGNED_INT:n.UNSIGNED_SHORT,n.drawElements(a,t.indicesBuffer.count,r,0)):n.drawArrays(a,0,i.vertexCount)},_bindMaterial:function(e,t,r,n,i,a,o){for(var s=this.gl,u=a===r,l=r.currentTextureSlot(),h=t.getEnabledUniforms(),c=t.getTextureUniforms(),d=this._placeholderTexture,f=0;ft[0]&&(r=1),t[8]>t[3*r+r]&&(r=2),n=(r+1)%3,i=(r+2)%3,a=Math.sqrt(t[3*r+r]-t[3*n+n]-t[3*i+i]+1),e[r]=.5*a,a=.5/a,e[3]=(t[3*n+i]-t[3*i+n])*a,e[n]=(t[3*n+r]+t[3*r+n])*a,e[i]=(t[3*i+r]+t[3*r+i])*a),e},t.a=c},function(e,t,r){"use strict";function n(e,t,r,n){e=e||0,t=t||0,r=r||0,n=void 0===n?1:n,this.array=a.a.fromValues(e,t,r,n),this._dirty=!0}var i,a=r(55),o=r(34);n.prototype={constructor:n,add:function(e){return a.a.add(this.array,this.array,e.array),this._dirty=!0,this},calculateW:function(){return a.a.calculateW(this.array,this.array),this._dirty=!0,this},set:function(e,t,r,n){return this.array[0]=e,this.array[1]=t,this.array[2]=r,this.array[3]=n,this._dirty=!0,this},setArray:function(e){return this.array[0]=e[0],this.array[1]=e[1],this.array[2]=e[2],this.array[3]=e[3],this._dirty=!0,this},clone:function(){return new n(this.x,this.y,this.z,this.w)},conjugate:function(){return a.a.conjugate(this.array,this.array),this._dirty=!0,this},copy:function(e){return a.a.copy(this.array,e.array),this._dirty=!0,this},dot:function(e){return a.a.dot(this.array,e.array)},fromMat3:function(e){return a.a.fromMat3(this.array,e.array),this._dirty=!0,this},fromMat4:(i=o.a.create(),function(e){return o.a.fromMat4(i,e.array),o.a.transpose(i,i),a.a.fromMat3(this.array,i),this._dirty=!0,this}),identity:function(){return a.a.identity(this.array),this._dirty=!0,this},invert:function(){return a.a.invert(this.array,this.array),this._dirty=!0,this},len:function(){return a.a.len(this.array)},length:function(){return a.a.length(this.array)},lerp:function(e,t,r){return a.a.lerp(this.array,e.array,t.array,r),this._dirty=!0,this},mul:function(e){return a.a.mul(this.array,this.array,e.array),this._dirty=!0,this},mulLeft:function(e){return a.a.multiply(this.array,e.array,this.array),this._dirty=!0,this},multiply:function(e){return a.a.multiply(this.array,this.array,e.array),this._dirty=!0,this},multiplyLeft:function(e){return a.a.multiply(this.array,e.array,this.array),this._dirty=!0,this},normalize:function(){return a.a.normalize(this.array,this.array),this._dirty=!0,this},rotateX:function(e){return a.a.rotateX(this.array,this.array,e),this._dirty=!0,this},rotateY:function(e){return a.a.rotateY(this.array,this.array,e),this._dirty=!0,this},rotateZ:function(e){return a.a.rotateZ(this.array,this.array,e),this._dirty=!0,this},rotationTo:function(e,t){return a.a.rotationTo(this.array,e.array,t.array),this._dirty=!0,this},setAxes:function(e,t,r){return a.a.setAxes(this.array,e.array,t.array,r.array),this._dirty=!0,this},setAxisAngle:function(e,t){return a.a.setAxisAngle(this.array,e.array,t),this._dirty=!0,this},slerp:function(e,t,r){return a.a.slerp(this.array,e.array,t.array,r),this._dirty=!0,this},sqrLen:function(){return a.a.sqrLen(this.array)},squaredLength:function(){return a.a.squaredLength(this.array)},fromEuler:function(e,t){return n.fromEuler(this,e,t)},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var s,u=Object.defineProperty;u&&(u(s=n.prototype,"x",{get:function(){return this.array[0]},set:function(e){this.array[0]=e,this._dirty=!0}}),u(s,"y",{get:function(){return this.array[1]},set:function(e){this.array[1]=e,this._dirty=!0}}),u(s,"z",{get:function(){return this.array[2]},set:function(e){this.array[2]=e,this._dirty=!0}}),u(s,"w",{get:function(){return this.array[3]},set:function(e){this.array[3]=e,this._dirty=!0}})),n.add=function(e,t,r){return a.a.add(e.array,t.array,r.array),e._dirty=!0,e},n.set=function(e,t,r,n,i){a.a.set(e.array,t,r,n,i),e._dirty=!0},n.copy=function(e,t){return a.a.copy(e.array,t.array),e._dirty=!0,e},n.calculateW=function(e,t){return a.a.calculateW(e.array,t.array),e._dirty=!0,e},n.conjugate=function(e,t){return a.a.conjugate(e.array,t.array),e._dirty=!0,e},n.identity=function(e){return a.a.identity(e.array),e._dirty=!0,e},n.invert=function(e,t){return a.a.invert(e.array,t.array),e._dirty=!0,e},n.dot=function(e,t){return a.a.dot(e.array,t.array)},n.len=function(e){return a.a.length(e.array)},n.lerp=function(e,t,r,n){return a.a.lerp(e.array,t.array,r.array,n),e._dirty=!0,e},n.slerp=function(e,t,r,n){return a.a.slerp(e.array,t.array,r.array,n),e._dirty=!0,e},n.multiply=n.mul=function(e,t,r){return a.a.multiply(e.array,t.array,r.array),e._dirty=!0,e},n.rotateX=function(e,t,r){return a.a.rotateX(e.array,t.array,r),e._dirty=!0,e},n.rotateY=function(e,t,r){return a.a.rotateY(e.array,t.array,r),e._dirty=!0,e},n.rotateZ=function(e,t,r){return a.a.rotateZ(e.array,t.array,r),e._dirty=!0,e},n.setAxisAngle=function(e,t,r){return a.a.setAxisAngle(e.array,t.array,r),e._dirty=!0,e},n.normalize=function(e,t){return a.a.normalize(e.array,t.array),e._dirty=!0,e},n.squaredLength=n.sqrLen=function(e){return a.a.sqrLen(e.array)},n.fromMat3=function(e,t){return a.a.fromMat3(e.array,t.array),e._dirty=!0,e},n.setAxes=function(e,t,r,n){return a.a.setAxes(e.array,t.array,r.array,n.array),e._dirty=!0,e},n.rotationTo=function(e,t,r){return a.a.rotationTo(e.array,t.array,r.array),e._dirty=!0,e},n.fromEuler=function(e,t,r){e._dirty=!0,t=t.array;var n=e.array,i=Math.cos(t[0]/2),a=Math.cos(t[1]/2),o=Math.cos(t[2]/2),s=Math.sin(t[0]/2),u=Math.sin(t[1]/2),l=Math.sin(t[2]/2);switch(r=(r||"XYZ").toUpperCase()){case"XYZ":n[0]=s*a*o+i*u*l,n[1]=i*u*o-s*a*l,n[2]=i*a*l+s*u*o,n[3]=i*a*o-s*u*l;break;case"YXZ":n[0]=s*a*o+i*u*l,n[1]=i*u*o-s*a*l,n[2]=i*a*l-s*u*o,n[3]=i*a*o+s*u*l;break;case"ZXY":n[0]=s*a*o-i*u*l,n[1]=i*u*o+s*a*l,n[2]=i*a*l+s*u*o,n[3]=i*a*o-s*u*l;break;case"ZYX":n[0]=s*a*o-i*u*l,n[1]=i*u*o+s*a*l,n[2]=i*a*l-s*u*o,n[3]=i*a*o+s*u*l;break;case"YZX":n[0]=s*a*o+i*u*l,n[1]=i*u*o+s*a*l,n[2]=i*a*l-s*u*o,n[3]=i*a*o-s*u*l;break;case"XZY":n[0]=s*a*o-i*u*l,n[1]=i*u*o-s*a*l,n[2]=i*a*l+s*u*o,n[3]=i*a*o+s*u*l}},t.a=n},function(e,t,r){"use strict";function n(){this._contextId=0,this._caches=[],this._context={}}(n.prototype={use:function(e,t){var r=this._caches;r[e]||(r[e]={},t&&(r[e]=t())),this._contextId=e,this._context=r[e]},put:function(e,t){this._context[e]=t},get:function(e){return this._context[e]},dirty:function(e){var t="__dt__"+(e=e||"");this.put(t,!0)},dirtyAll:function(e){for(var t="__dt__"+(e=e||""),r=this._caches,n=0;n=this._maxSize&&0r)return!1}return!0},_fetchTexture:function(e,t,r){n.a.request.get({url:e,responseType:"arraybuffer",onload:t,onerror:r})},createChessboard:function(e,t,r,n){e=e||512,t=t||64,r=r||"black",n=n||"white";var i=Math.ceil(e/t),a=document.createElement("canvas");a.width=e,a.height=e;var o=a.getContext("2d");o.fillStyle=n,o.fillRect(0,0,e,e),o.fillStyle=r;for(var s=0;sthis._endIndex)){t-=this._startIndex;for(var n=this._vertexRangeOfDataIndex[2*t];nthis._endDataIndex||tthis._endDataIndex||t=this._maxSize&&0>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e},nearestPowerOfTwo:function(e){return Math.pow(2,Math.round(Math.log(e)/Math.LN2))}};t.a=n},function(e,t,r){"use strict";function n(e,t){this.normal=e||new c.a(0,1,0),this.distance=t||0}var i,a,o,h,c=r(3),s=r(21),d=r(12),u=r(33);n.prototype={constructor:n,distanceToPoint:function(e){return d.a.dot(e.array,this.normal.array)-this.distance},projectPoint:function(e,t){t=t||new c.a;var r=this.distanceToPoint(e);return d.a.scaleAndAdd(t.array,e.array,this.normal.array,-r),t._dirty=!0,t},normalize:function(){var e=1/d.a.len(this.normal.array);d.a.scale(this.normal.array,e),this.distance*=e},intersectFrustum:function(e){for(var t=e.vertices,r=this.normal.array,n=d.a.dot(t[0].array,r)>this.distance,i=1;i<8;i++)if(d.a.dot(t[i].array,r)>this.distance!=n)return!0},intersectLine:(h=d.a.create(),function(e,t,r){var n=this.distanceToPoint(e),i=this.distanceToPoint(t);if(0>>16)>>>0;l=(((16711935&(l=((252645135&(l=((858993459&(l=((1431655765&l)<<1|(2863311530&l)>>>1)>>>0))<<2|(3435973836&l)>>>2)>>>0))<<4|(4042322160&l)>>>4)>>>0))<<8|(4278255360&l)>>>8)>>>0)/4294967296;var h=Math.sqrt((1-l)/(1+(s*s-1)*l));i[u]=h}for(u=0;u=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height},clone:function(){return new l(this.x,this.y,this.width,this.height)},copy:function(e){this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height},plain:function(){return{x:this.x,y:this.y,width:this.width,height:this.height}}},l.create=function(e){return new l(e.x,e.y,e.width,e.height)},e.exports=l},function(e,t){function n(e){return Math.sqrt(r(e))}function r(e){return e[0]*e[0]+e[1]*e[1]}function i(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))}function a(e,t){return(e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])}var o="undefined"==typeof Float32Array?Array:Float32Array,s=n,u=r,l=i,h=a;t.create=function(e,t){var r=new o(2);return null==e&&(e=0),null==t&&(t=0),r[0]=e,r[1]=t,r},t.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e},t.clone=function(e){var t=new o(2);return t[0]=e[0],t[1]=e[1],t},t.set=function(e,t,r){return e[0]=t,e[1]=r,e},t.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e},t.scaleAndAdd=function(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e},t.sub=function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e},t.len=n,t.length=s,t.lenSquare=r,t.lengthSquare=u,t.mul=function(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e},t.div=function(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e},t.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]},t.scale=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e},t.normalize=function(e,t){var r=n(t);return 0===r?(e[0]=0,e[1]=0):(e[0]=t[0]/r,e[1]=t[1]/r),e},t.distance=i,t.dist=l,t.distanceSquare=a,t.distSquare=h,t.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e},t.lerp=function(e,t,r,n){return e[0]=t[0]+n*(r[0]-t[0]),e[1]=t[1]+n*(r[1]-t[1]),e},t.applyTransform=function(e,t,r){var n=t[0],i=t[1];return e[0]=r[0]*n+r[2]*i+r[4],e[1]=r[1]*n+r[3]*i+r[5],e},t.min=function(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e},t.max=function(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e}},function(e,t){function r(){var e=new a(6);return n(e),e}function n(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function i(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}var a="undefined"==typeof Float32Array?Array:Float32Array;t.create=r,t.identity=n,t.copy=i,t.mul=function(e,t,r){var n=t[0]*r[0]+t[2]*r[1],i=t[1]*r[0]+t[3]*r[1],a=t[0]*r[2]+t[2]*r[3],o=t[1]*r[2]+t[3]*r[3],s=t[0]*r[4]+t[2]*r[5]+t[4],u=t[1]*r[4]+t[3]*r[5]+t[5];return e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=u,e},t.translate=function(e,t,r){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+r[0],e[5]=t[5]+r[1],e},t.rotate=function(e,t,r){var n=t[0],i=t[2],a=t[4],o=t[1],s=t[3],u=t[5],l=Math.sin(r),h=Math.cos(r);return e[0]=n*h+o*l,e[1]=-n*l+o*h,e[2]=i*h+s*l,e[3]=-i*l+h*s,e[4]=h*a+l*u,e[5]=h*u-l*a,e},t.scale=function(e,t,r){var n=r[0],i=r[1];return e[0]=t[0]*n,e[1]=t[1]*i,e[2]=t[2]*n,e[3]=t[3]*i,e[4]=t[4]*n,e[5]=t[5]*i,e},t.invert=function(e,t){var r=t[0],n=t[2],i=t[4],a=t[1],o=t[3],s=t[5],u=r*o-a*n;return u?(u=1/u,e[0]=o*u,e[1]=-a*u,e[2]=-n*u,e[3]=r*u,e[4]=(n*s-o*i)*u,e[5]=(a*i-r*s)*u,e):null},t.clone=function(e){var t=r();return i(t,e),t}},function(e,t,r){function a(e){return Math.floor(Math.log(e)/Math.LN10)}var p=r(13),n=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d\d)(?::(\d\d)(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;t.linearMap=function(e,t,r,n){var i=t[1]-t[0],a=r[1]-r[0];if(0==i)return 0==a?r[0]:(r[0]+r[1])/2;if(n)if(0=t[1])return r[1]}else{if(e>=t[0])return r[0];if(e<=t[1])return r[1]}else{if(e===t[0])return r[0];if(e===t[1])return r[1]}return(e-t[0])/i*a+r[0]},t.parsePercent=function(e,t){switch(e){case"center":case"middle":e="50%";break;case"left":case"top":e="0%";break;case"right":case"bottom":e="100%"}return"string"==typeof e?e.replace(/^\s+/,"").replace(/\s+$/,"").match(/%$/)?parseFloat(e)/100*t:parseFloat(e):null==e?NaN:+e},t.round=function(e,t,r){return null==t&&(t=10),t=Math.min(Math.max(0,t),20),e=(+e).toFixed(t),r?e:+e},t.asc=function(e){return e.sort(function(e,t){return e-t}),e},t.getPrecision=function(e){if(e=+e,isNaN(e))return 0;for(var t=1,r=0;Math.round(e*t)/t!==e;)t*=10,r++;return r},t.getPrecisionSafe=function(e){var t=e.toString(),r=t.indexOf("e");if(0h&&(h=l[d],c=d);++s[c],l[c]=0,++u}return s[t]/i},t.MAX_SAFE_INTEGER=9007199254740991,t.remRadian=function(e){var t=2*Math.PI;return(e%t+t)%t},t.isRadianAroundZero=function(e){return-1e-4>4|(3840&n)>>8,240&n|(240&n)>>4,15&n|(15&n)<<4,1),_(e,t),t):void m(t,0,0,0,1);if(7===i.length)return 0<=(n=parseInt(i.substr(1),16))&&n<=16777215?(m(t,(16711680&n)>>16,(65280&n)>>8,255&n,1),_(e,t),t):void m(t,0,0,0,1)}}},y.parseToFloat=function(e,t){if(t=y.parse(e,t))return t[0]/=255,t[1]/=255,t[2]/=255,t},y.lift=function(e,t){var r=y.parse(e);if(r){for(var n=0;n<3;n++)r[n]=t<0?r[n]*(1-t)|0:(255-r[n])*t+r[n]|0;return y.stringify(r,4===r.length?"rgba":"rgb")}},y.toHex=function(e){var t=y.parse(e);if(t)return((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1)},y.fastLerp=function(e,t,r){if(t&&t.length&&0<=e&&e<=1){r=r||[];var n=e*(t.length-1),i=Math.floor(n),a=Math.ceil(n),o=t[i],s=t[a],u=n-i;return r[0]=h(p(o[0],s[0],u)),r[1]=h(p(o[1],s[1],u)),r[2]=h(p(o[2],s[2],u)),r[3]=c(p(o[3],s[3],u)),r}},y.fastMapToColor=y.fastLerp,y.lerp=function(e,t,r){if(t&&t.length&&0<=e&&e<=1){var n=e*(t.length-1),i=Math.floor(n),a=Math.ceil(n),o=y.parse(t[i]),s=y.parse(t[a]),u=n-i,l=y.stringify([h(p(o[0],s[0],u)),h(p(o[1],s[1],u)),h(p(o[2],s[2],u)),c(p(o[3],s[3],u))],"rgba");return r?{color:l,leftIndex:i,rightIndex:a,value:n}:l}},y.mapToColor=y.lerp,y.modifyHSL=function(e,t,r,n){if(e=y.parse(e))return e=function(e){if(e){var t,r,n,i,a,o=e[0]/255,s=e[1]/255,u=e[2]/255,l=Math.min(o,s,u),h=Math.max(o,s,u),c=h-l,d=(h+l)/2;0==c?r=t=0:(r=d<.5?c/(h+l):c/(2-h-l),n=((h-o)/6+c/2)/c,i=((h-s)/6+c/2)/c,a=((h-u)/6+c/2)/c,o===h?t=a-i:s===h?t=1/3+n-a:u===h&&(t=2/3+i-n),t<0&&(t+=1),1l.getMaxJointNumber()&&(s.USE_SKIN_MATRICES_TEXTURE=null),d="\n"+w(s)+"\n");var f=d+w(t.vertexDefines,u,c),p=d+w(t.fragmentDefines,u,c),m=f+"\n"+t.shader.vertex,g=["OES_standard_derivatives","EXT_shader_texture_lod"].filter(function(e){return null!=l.getGLExtension(e)});0<=g.indexOf("EXT_shader_texture_lod")&&(p+="\n#define SUPPORT_TEXTURE_LOD"),0<=g.indexOf("OES_standard_derivatives")&&(p+="\n#define SUPPORT_STANDARD_DERIVATIVES");var _,v=function(e){for(var t=[],r=0;r>>0;0>>0|i)>>>0!==n)return null;for(var i=0;i<4;i++)for(var a=0;a>>0;for(var s=t[r++];o--;)e[a++][i]=s}else for(;o--;)e[a++][i]=t[r++]}return r}(_,u,g,m)))return null;for(v=0;vt);r++);r=Math.min(r-1,c-2)}P=t;var n,i=v[(R=r)+1]-v[r];if(0!=i)if(A=(t-v[r])/i,h)if(C=y[r],M=y[0===r?r:r-1],L=y[c-2>4|(3840&n)>>8,240&n|(240&n)>>4,15&n|(15&n)<<4,1),_(e,t),t):void m(t,0,0,0,1);if(7===i.length)return 0<=(n=parseInt(i.substr(1),16))&&n<=16777215?(m(t,(16711680&n)>>16,(65280&n)>>8,255&n,1),_(e,t),t):void m(t,0,0,0,1)}}}function y(e,t){var r=(parseFloat(e[0])%360+360)%360/360,n=f(e[1]),i=f(e[2]),a=i<=.5?i*(n+1):i+n-i*n,o=2*i-a;return m(t=t||[],h(255*s(o,a,r+1/3)),h(255*s(o,a,r)),h(255*s(o,a,r-1/3)),1),4===e.length&&(t[3]=e[3]),t}function n(e,t,r){if(t&&t.length&&0<=e&&e<=1){r=r||[];var n=e*(t.length-1),i=Math.floor(n),a=Math.ceil(n),o=t[i],s=t[a],u=n-i;return r[0]=h(p(o[0],s[0],u)),r[1]=h(p(o[1],s[1],u)),r[2]=h(p(o[2],s[2],u)),r[3]=c(p(o[3],s[3],u)),r}}function i(e,t,r){if(t&&t.length&&0<=e&&e<=1){var n=e*(t.length-1),i=Math.floor(n),a=Math.ceil(n),o=v(t[i]),s=v(t[a]),u=n-i,l=x([h(p(o[0],s[0],u)),h(p(o[1],s[1],u)),h(p(o[2],s[2],u)),c(p(o[3],s[3],u))],"rgba");return r?{color:l,leftIndex:i,rightIndex:a,value:n}:l}}function x(e,t){if(e&&e.length){var r=e[0]+","+e[1]+","+e[2];return"rgba"!==t&&"hsva"!==t&&"hsla"!==t||(r+=","+e[3]),t+"("+r+")"}}var a=r(60),T={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]},b=new a(20),o=null,u=n,l=i;t.parse=v,t.lift=function(e,t){var r=v(e);if(r){for(var n=0;n<3;n++)r[n]=t<0?r[n]*(1-t)|0:(255-r[n])*t+r[n]|0,255n[1]?0:1,o=this._faces[2*r+a],s=this._faces[2*r+1-a];o.rootNode.invisible=!0,s.rootNode.invisible=!1}},_updateAxisLinePosition:function(){var e=this._model.coordinateSystem,t=e.getAxis("x"),r=e.getAxis("y"),n=e.getAxis("z"),i=n.getExtentMax(),a=n.getExtentMin(),o=t.getExtentMin(),s=t.getExtentMax(),u=r.getExtentMax(),l=r.getExtentMin(),h=this._axes[0].rootNode,c=this._axes[1].rootNode,d=this._axes[2].rootNode,f=this._faces,p=f[4].rootNode.invisible?l:u,m=f[2].rootNode.invisible?i:a,g=f[0].rootNode.invisible?o:s,_=f[2].rootNode.invisible?i:a,v=f[0].rootNode.invisible?s:o,y=f[4].rootNode.invisible?l:u;h.rotation.identity(),c.rotation.identity(),d.rotation.identity(),f[4].rootNode.invisible&&(this._axes[0].flipped=!0,h.rotation.rotateX(Math.PI)),f[0].rootNode.invisible&&(this._axes[1].flipped=!0,c.rotation.rotateZ(Math.PI)),f[4].rootNode.invisible&&(this._axes[2].flipped=!0,d.rotation.rotateY(Math.PI)),h.position.set(0,m,p),c.position.set(g,_,0),d.position.set(v,0,y),h.update(),c.update(),d.update(),this._updateAxisLabelAlign()},_updateAxisLabelAlign:function(){var l=this._control.getCamera(),h=[new E.a.Vector4,new E.a.Vector4],c=new E.a.Vector4;this.groupGL.getWorldPosition(c),c.w=1,c.transformMat4(l.viewMatrix).transformMat4(l.projectionMatrix),c.x/=c.w,c.y/=c.w,this._axes.forEach(function(e){for(var t=e.axisLineCoords,r=(e.labelsMesh.geometry,0);rc.y?"bottom":"top"):(i="middle",n=s>c.x?"left":"right"),e.setSpriteAlign(n,i,this._api)},this)},_doShowAxisPointer:function(){this._axisPointerLineMesh.invisible&&(this._axisPointerLineMesh.invisible=!1,this._axisPointerLabelsMesh.invisible=!1,this._api.getZr().refresh())},_doHideAxisPointer:function(){this._axisPointerLineMesh.invisible||(this._axisPointerLineMesh.invisible=!0,this._axisPointerLabelsMesh.invisible=!0,this._api.getZr().refresh())},_updateAxisPointer:function(e){function t(e){return S.a.firstNotNull(e.model.get("axisPointer.show"),o.get("show"))}function r(e){var t=e.model.getModel("axisPointer",o).getModel("lineStyle"),r=E.a.parseColor(t.get("color")),n=A(t.get("width"),1),i=A(t.get("opacity"),1);return r[3]*=i,{color:r,lineWidth:n}}var n=this._model.coordinateSystem,i=n.dataToPoint(e),a=this._axisPointerLineMesh.geometry,o=this._model.getModel("axisPointer"),s=this._api.getDevicePixelRatio();a.convertToDynamicArray(!0);for(var u=0;u"'])/g,o={"&":"&","<":"<",">":">",'"':""","'":"'"},m=["a","b","c","d","e","f","g"],s=n.truncateText,u=n.getBoundingRect;t.addCommas=function(e){return isNaN(e)?"-":(e=(e+"").split("."))[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(1':'':""},t.formatTime=function(e,t,r){"week"!==e&&"month"!==e&&"quarter"!==e&&"half-year"!==e&&"year"!==e||(e="MM-dd\nyyyy");var n=p.parseDate(t),i=r?"UTC":"",a=n["get"+i+"FullYear"](),o=n["get"+i+"Month"]()+1,s=n["get"+i+"Date"](),u=n["get"+i+"Hours"](),l=n["get"+i+"Minutes"](),h=n["get"+i+"Seconds"](),c=n["get"+i+"Milliseconds"]();return e.replace("MM",d(o,2)).replace("M",o).replace("yyyy",a).replace("yy",a%100).replace("dd",d(s,2)).replace("d",s).replace("hh",d(u,2)).replace("h",u).replace("mm",d(l,2)).replace("m",l).replace("ss",d(h,2)).replace("s",h).replace("SSS",d(c,3))},t.capitalFirst=function(e){return e?e.charAt(0).toUpperCase()+e.substr(1):e},t.truncateText=s,t.getTextRect=u},function(e,t,r){function N(e,t){var r=e+":"+(t=t||d);if(u[r])return u[r];for(var n=(e+"").split("\n"),i=0,a=0,o=n.length;a=t.maxIterations){e+=t.ellipsis;break}var o=0===a?function(e,t,r,n){for(var i=0,a=0,o=e.length;af)return{lines:[],width:0,height:0};L.textWidth=N(L.text,T);var w,E,S,A,M=y.textWidth,C=null==M||"auto"===M;"string"==typeof M&&"%"===M.charAt(M.length-1)?(L.percentWidth=M,l.push(L),M=0):(C&&(M=L.textWidth,(E=(w=y.textBackgroundColor)&&w.image)&&(E=O.findExistImage(E),O.isImageReady(E)&&(M=Math.max(M,E.width*b/E.height)))),M+=S=x?x[1]+x[3]:0,null!=(A=null!=d?d-_:null)&&A=r.COLOR_ATTACHMENT0&&l<=r.COLOR_ATTACHMENT0+8&&h.push(l);u.drawBuffersEXT(h)}e.saveClear(),e.clearBit=c.a.DEPTH_BUFFER_BIT|c.a.COLOR_BUFFER_BIT,t=e.render(this.scene,this.camera,!this.autoUpdateScene,this.preZ),e.restoreClear(),i.unbind(e)}else t=e.render(this.scene,this.camera,!this.autoUpdateScene,this.preZ);this.trigger("afterrender",t),this._rendering=!1,this._rendered=!0}});t.a=a},function(e,t,r){"use strict";var n=r(48).a.extend(function(){return{texture:null,outputs:{color:{}}}},function(){},{getOutput:function(){return this.texture},beforeFrame:function(){},afterFrame:function(){}});t.a=n},function(e,t,r){"use strict";var n=r(16),i=r(48),a=i.a.extend(function(){return{name:"",inputs:{},outputs:null,shader:"",inputLinks:{},outputLinks:{},pass:null,_prevOutputTextures:{},_outputTextures:{},_outputReferences:{},_rendering:!1,_rendered:!1,_compositor:null}},function(){var e=new n.a({fragment:this.shader});this.pass=e},{render:function(e,t){this.trigger("beforerender",e),this._rendering=!0;var r,n=e.gl;for(r in this.inputLinks){var i,a=(i=this.inputLinks[r]).node.getOutput(e,i.pin);this.pass.setUniform(r,a)}if(this.outputs){this.pass.outputs={};var o,s={};for(o in this.outputs){var u=this.updateParameter(o,e);isNaN(u.width)&&this.updateParameter(o,e);var l,h=this.outputs[o],c=this._compositor.allocateTexture(u);this._outputTextures[o]=c,"string"==typeof(l=h.attachment||n.COLOR_ATTACHMENT0)&&(l=n[l]),s[l]=c}for(l in this._compositor.getFrameBuffer().bind(e),s)this._compositor.getFrameBuffer().attach(s[l],l);this.pass.render(e),this._compositor.getFrameBuffer().updateMipmap(e)}else this.pass.outputs=null,this._compositor.getFrameBuffer().unbind(e),this.pass.render(e,t);for(r in this.inputLinks){(i=this.inputLinks[r]).node.removeReference(i.pin)}this._rendering=!1,this._rendered=!0,this.trigger("afterrender",e)},updateParameter:function(e,t){var r,n,i=this.outputs[e],a=i.parameters,o=(o=i._parametersCopy)||(i._parametersCopy={});if(a)for(var s in a)"width"!==s&&"height"!==s&&(o[s]=a[s]);return r=a.width instanceof Function?a.width.call(this,t):a.width,n=a.height instanceof Function?a.height.call(this,t):a.height,r=Math.ceil(r),n=Math.ceil(n),o.width===r&&o.height===n||this._outputTextures[e]&&this._outputTextures[e].dispose(t),o.width=r,o.height=n,o},setParameter:function(e,t){this.pass.setUniform(e,t)},getParameter:function(e){return this.pass.getUniform(e)},setParameters:function(e){for(var t in e)this.setParameter(t,e[t])},define:function(e,t){this.pass.material.define("fragment",e,t)},undefine:function(e){this.pass.material.undefine("fragment",e)},removeReference:function(e){0==--this._outputReferences[e]&&(this.outputs[e].keepLastFrame?(this._prevOutputTextures[e]&&this._compositor.releaseTexture(this._prevOutputTextures[e]),this._prevOutputTextures[e]=this._outputTextures[e]):this._compositor.releaseTexture(this._outputTextures[e]))},clear:function(){i.a.prototype.clear.call(this),this.pass.material.disableTexturesAll()}});t.a=a},function(e,t,r){"use strict";t.a=function(e){e.import(n.a),e.import(i.a),e.import(a.a),e.import(o.a),e.import(s.a),e.import(u.a),e.import(l.a),e.import(h.a),e.import(c.a),e.import(d.a),e.import(f.a),e.import(p.a),e.import(m.a)};var n=r(185),i=r(87),a=r(186),o=r(88),s=r(187),u=r(89),l=r(90),h=r(91),c=r(92),d=r(93),f=r(188),p=r(94),m=r(95)},function(e,t,r){"use strict";t.a="@export clay.compositor.coloradjust\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float brightness : 0.0;\nuniform float contrast : 1.0;\nuniform float exposure : 0.0;\nuniform float gamma : 1.0;\nuniform float saturation : 1.0;\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\nvoid main()\n{\n vec4 tex = texture2D( texture, v_Texcoord);\n vec3 color = clamp(tex.rgb + vec3(brightness), 0.0, 1.0);\n color = clamp( (color-vec3(0.5))*contrast+vec3(0.5), 0.0, 1.0);\n color = clamp( color * pow(2.0, exposure), 0.0, 1.0);\n color = clamp( pow(color, vec3(gamma)), 0.0, 1.0);\n float luminance = dot( color, w );\n color = mix(vec3(luminance), color, saturation);\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.brightness\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float brightness : 0.0;\nvoid main()\n{\n vec4 tex = texture2D( texture, v_Texcoord);\n vec3 color = tex.rgb + vec3(brightness);\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.contrast\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float contrast : 1.0;\nvoid main()\n{\n vec4 tex = texture2D( texture, v_Texcoord);\n vec3 color = (tex.rgb-vec3(0.5))*contrast+vec3(0.5);\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.exposure\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float exposure : 0.0;\nvoid main()\n{\n vec4 tex = texture2D(texture, v_Texcoord);\n vec3 color = tex.rgb * pow(2.0, exposure);\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.gamma\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float gamma : 1.0;\nvoid main()\n{\n vec4 tex = texture2D(texture, v_Texcoord);\n vec3 color = pow(tex.rgb, vec3(gamma));\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.saturation\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float saturation : 1.0;\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\nvoid main()\n{\n vec4 tex = texture2D(texture, v_Texcoord);\n vec3 color = tex.rgb;\n float luminance = dot(color, w);\n color = mix(vec3(luminance), color, saturation);\n gl_FragColor = vec4(color, tex.a);\n}\n@end"},function(e,t,r){"use strict";t.a="@export clay.compositor.hdr.log_lum\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\n@import clay.util.rgbm\nvoid main()\n{\n vec4 tex = decodeHDR(texture2D(texture, v_Texcoord));\n float luminance = dot(tex.rgb, w);\n luminance = log(luminance + 0.001);\n gl_FragColor = encodeHDR(vec4(vec3(luminance), 1.0));\n}\n@end\n@export clay.compositor.hdr.lum_adaption\nvarying vec2 v_Texcoord;\nuniform sampler2D adaptedLum;\nuniform sampler2D currentLum;\nuniform float frameTime : 0.02;\n@import clay.util.rgbm\nvoid main()\n{\n float fAdaptedLum = decodeHDR(texture2D(adaptedLum, vec2(0.5, 0.5))).r;\n float fCurrentLum = exp(encodeHDR(texture2D(currentLum, vec2(0.5, 0.5))).r);\n fAdaptedLum += (fCurrentLum - fAdaptedLum) * (1.0 - pow(0.98, 30.0 * frameTime));\n gl_FragColor = encodeHDR(vec4(vec3(fAdaptedLum), 1.0));\n}\n@end\n@export clay.compositor.lum\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\nvoid main()\n{\n vec4 tex = texture2D( texture, v_Texcoord );\n float luminance = dot(tex.rgb, w);\n gl_FragColor = vec4(vec3(luminance), 1.0);\n}\n@end"},function(e,t,r){"use strict";t.a="@export clay.compositor.vignette\n#define OUTPUT_ALPHA\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float darkness: 1;\nuniform float offset: 1;\n@import clay.util.rgbm\nvoid main()\n{\n vec4 texel = decodeHDR(texture2D(texture, v_Texcoord));\n gl_FragColor.rgb = texel.rgb;\n vec2 uv = (v_Texcoord - vec2(0.5)) * vec2(offset);\n gl_FragColor = encodeHDR(vec4(mix(texel.rgb, vec3(1.0 - darkness), dot(uv, uv)), texel.a));\n}\n@end"},function(e,t,r){"use strict";t.a="@export clay.compositor.lensflare\n#define SAMPLE_NUMBER 8\nuniform sampler2D texture;\nuniform sampler2D lenscolor;\nuniform vec2 textureSize : [512, 512];\nuniform float dispersal : 0.3;\nuniform float haloWidth : 0.4;\nuniform float distortion : 1.0;\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\nvec4 textureDistorted(\n in vec2 texcoord,\n in vec2 direction,\n in vec3 distortion\n) {\n return vec4(\n decodeHDR(texture2D(texture, texcoord + direction * distortion.r)).r,\n decodeHDR(texture2D(texture, texcoord + direction * distortion.g)).g,\n decodeHDR(texture2D(texture, texcoord + direction * distortion.b)).b,\n 1.0\n );\n}\nvoid main()\n{\n vec2 texcoord = -v_Texcoord + vec2(1.0); vec2 textureOffset = 1.0 / textureSize;\n vec2 ghostVec = (vec2(0.5) - texcoord) * dispersal;\n vec2 haloVec = normalize(ghostVec) * haloWidth;\n vec3 distortion = vec3(-textureOffset.x * distortion, 0.0, textureOffset.x * distortion);\n vec4 result = vec4(0.0);\n for (int i = 0; i < SAMPLE_NUMBER; i++)\n {\n vec2 offset = fract(texcoord + ghostVec * float(i));\n float weight = length(vec2(0.5) - offset) / length(vec2(0.5));\n weight = pow(1.0 - weight, 10.0);\n result += textureDistorted(offset, normalize(ghostVec), distortion) * weight;\n }\n result *= texture2D(lenscolor, vec2(length(vec2(0.5) - texcoord)) / length(vec2(0.5)));\n float weight = length(vec2(0.5) - fract(texcoord + haloVec)) / length(vec2(0.5));\n weight = pow(1.0 - weight, 10.0);\n vec2 offset = fract(texcoord + haloVec);\n result += textureDistorted(offset, normalize(ghostVec), distortion) * weight;\n gl_FragColor = result;\n}\n@end"},function(e,t,r){"use strict";function n(e){for(var t=new Uint8Array(e*e*4),r=0,n=new o.a,i=0;ithis._totalSamples/this._samplePerFrame},n.prototype.dispose=function(e){this._ssrTexture.dispose(e),this._texture2.dispose(e),this._texture3.dispose(e),this._prevTexture.dispose(e),this._currentTexture.dispose(e),this._frameBuffer.dispose(e)},t.a=n},function(e,t,r){"use strict";t.a="@export ecgl.ssr.main\n\n#define SHADER_NAME SSR\n#define MAX_ITERATION 20;\n#define SAMPLE_PER_FRAME 5;\n#define TOTAL_SAMPLES 128;\n\nuniform sampler2D sourceTexture;\nuniform sampler2D gBufferTexture1;\nuniform sampler2D gBufferTexture2;\nuniform sampler2D gBufferTexture3;\nuniform samplerCube specularCubemap;\nuniform float specularIntensity: 1;\n\nuniform mat4 projection;\nuniform mat4 projectionInv;\nuniform mat4 toViewSpace;\nuniform mat4 toWorldSpace;\n\nuniform float maxRayDistance: 200;\n\nuniform float pixelStride: 16;\nuniform float pixelStrideZCutoff: 50; \nuniform float screenEdgeFadeStart: 0.9; \nuniform float eyeFadeStart : 0.2; uniform float eyeFadeEnd: 0.8; \nuniform float minGlossiness: 0.2; uniform float zThicknessThreshold: 1;\n\nuniform float nearZ;\nuniform vec2 viewportSize : VIEWPORT_SIZE;\n\nuniform float jitterOffset: 0;\n\nvarying vec2 v_Texcoord;\n\n#ifdef DEPTH_DECODE\n@import clay.util.decode_float\n#endif\n\n#ifdef PHYSICALLY_CORRECT\nuniform sampler2D normalDistribution;\nuniform float sampleOffset: 0;\nuniform vec2 normalDistributionSize;\n\nvec3 transformNormal(vec3 H, vec3 N) {\n vec3 upVector = N.y > 0.999 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0);\n vec3 tangentX = normalize(cross(N, upVector));\n vec3 tangentZ = cross(N, tangentX);\n return normalize(tangentX * H.x + N * H.y + tangentZ * H.z);\n}\nvec3 importanceSampleNormalGGX(float i, float roughness, vec3 N) {\n float p = fract((i + sampleOffset) / float(TOTAL_SAMPLES));\n vec3 H = texture2D(normalDistribution,vec2(roughness, p)).rgb;\n return transformNormal(H, N);\n}\nfloat G_Smith(float g, float ndv, float ndl) {\n float roughness = 1.0 - g;\n float k = roughness * roughness / 2.0;\n float G1V = ndv / (ndv * (1.0 - k) + k);\n float G1L = ndl / (ndl * (1.0 - k) + k);\n return G1L * G1V;\n}\nvec3 F_Schlick(float ndv, vec3 spec) {\n return spec + (1.0 - spec) * pow(1.0 - ndv, 5.0);\n}\n#endif\n\nfloat fetchDepth(sampler2D depthTexture, vec2 uv)\n{\n vec4 depthTexel = texture2D(depthTexture, uv);\n return depthTexel.r * 2.0 - 1.0;\n}\n\nfloat linearDepth(float depth)\n{\n if (projection[3][3] == 0.0) {\n return projection[3][2] / (depth * projection[2][3] - projection[2][2]);\n }\n else {\n return (depth - projection[3][2]) / projection[2][2];\n }\n}\n\nbool rayIntersectDepth(float rayZNear, float rayZFar, vec2 hitPixel)\n{\n if (rayZFar > rayZNear)\n {\n float t = rayZFar; rayZFar = rayZNear; rayZNear = t;\n }\n float cameraZ = linearDepth(fetchDepth(gBufferTexture2, hitPixel));\n return rayZFar <= cameraZ && rayZNear >= cameraZ - zThicknessThreshold;\n}\n\n\nbool traceScreenSpaceRay(\n vec3 rayOrigin, vec3 rayDir, float jitter,\n out vec2 hitPixel, out vec3 hitPoint, out float iterationCount\n)\n{\n float rayLength = ((rayOrigin.z + rayDir.z * maxRayDistance) > -nearZ)\n ? (-nearZ - rayOrigin.z) / rayDir.z : maxRayDistance;\n\n vec3 rayEnd = rayOrigin + rayDir * rayLength;\n\n vec4 H0 = projection * vec4(rayOrigin, 1.0);\n vec4 H1 = projection * vec4(rayEnd, 1.0);\n\n float k0 = 1.0 / H0.w, k1 = 1.0 / H1.w;\n\n vec3 Q0 = rayOrigin * k0, Q1 = rayEnd * k1;\n\n vec2 P0 = (H0.xy * k0 * 0.5 + 0.5) * viewportSize;\n vec2 P1 = (H1.xy * k1 * 0.5 + 0.5) * viewportSize;\n\n P1 += dot(P1 - P0, P1 - P0) < 0.0001 ? 0.01 : 0.0;\n vec2 delta = P1 - P0;\n\n bool permute = false;\n if (abs(delta.x) < abs(delta.y)) {\n permute = true;\n delta = delta.yx;\n P0 = P0.yx;\n P1 = P1.yx;\n }\n float stepDir = sign(delta.x);\n float invdx = stepDir / delta.x;\n\n vec3 dQ = (Q1 - Q0) * invdx;\n float dk = (k1 - k0) * invdx;\n\n vec2 dP = vec2(stepDir, delta.y * invdx);\n\n float strideScaler = 1.0 - min(1.0, -rayOrigin.z / pixelStrideZCutoff);\n float pixStride = 1.0 + strideScaler * pixelStride;\n\n dP *= pixStride; dQ *= pixStride; dk *= pixStride;\n\n vec4 pqk = vec4(P0, Q0.z, k0);\n vec4 dPQK = vec4(dP, dQ.z, dk);\n\n pqk += dPQK * jitter;\n float rayZFar = (dPQK.z * 0.5 + pqk.z) / (dPQK.w * 0.5 + pqk.w);\n float rayZNear;\n\n bool intersect = false;\n\n vec2 texelSize = 1.0 / viewportSize;\n\n iterationCount = 0.0;\n\n for (int i = 0; i < MAX_ITERATION; i++)\n {\n pqk += dPQK;\n\n rayZNear = rayZFar;\n rayZFar = (dPQK.z * 0.5 + pqk.z) / (dPQK.w * 0.5 + pqk.w);\n\n hitPixel = permute ? pqk.yx : pqk.xy;\n hitPixel *= texelSize;\n\n intersect = rayIntersectDepth(rayZNear, rayZFar, hitPixel);\n\n iterationCount += 1.0;\n\n dPQK *= 1.2;\n\n if (intersect) {\n break;\n }\n }\n\n Q0.xy += dQ.xy * iterationCount;\n Q0.z = pqk.z;\n hitPoint = Q0 / pqk.w;\n\n return intersect;\n}\n\nfloat calculateAlpha(\n float iterationCount, float reflectivity,\n vec2 hitPixel, vec3 hitPoint, float dist, vec3 rayDir\n)\n{\n float alpha = clamp(reflectivity, 0.0, 1.0);\n alpha *= 1.0 - (iterationCount / float(MAX_ITERATION));\n vec2 hitPixelNDC = hitPixel * 2.0 - 1.0;\n float maxDimension = min(1.0, max(abs(hitPixelNDC.x), abs(hitPixelNDC.y)));\n alpha *= 1.0 - max(0.0, maxDimension - screenEdgeFadeStart) / (1.0 - screenEdgeFadeStart);\n\n float _eyeFadeStart = eyeFadeStart;\n float _eyeFadeEnd = eyeFadeEnd;\n if (_eyeFadeStart > _eyeFadeEnd) {\n float tmp = _eyeFadeEnd;\n _eyeFadeEnd = _eyeFadeStart;\n _eyeFadeStart = tmp;\n }\n\n float eyeDir = clamp(rayDir.z, _eyeFadeStart, _eyeFadeEnd);\n alpha *= 1.0 - (eyeDir - _eyeFadeStart) / (_eyeFadeEnd - _eyeFadeStart);\n\n alpha *= 1.0 - clamp(dist / maxRayDistance, 0.0, 1.0);\n\n return alpha;\n}\n\n@import clay.util.rand\n\n@import clay.util.rgbm\n\nvoid main()\n{\n vec4 normalAndGloss = texture2D(gBufferTexture1, v_Texcoord);\n\n if (dot(normalAndGloss.rgb, vec3(1.0)) == 0.0) {\n discard;\n }\n\n float g = normalAndGloss.a;\n#if !defined(PHYSICALLY_CORRECT)\n if (g <= minGlossiness) {\n discard;\n }\n#endif\n\n float reflectivity = (g - minGlossiness) / (1.0 - minGlossiness);\n\n vec3 N = normalize(normalAndGloss.rgb * 2.0 - 1.0);\n N = normalize((toViewSpace * vec4(N, 0.0)).xyz);\n\n vec4 projectedPos = vec4(v_Texcoord * 2.0 - 1.0, fetchDepth(gBufferTexture2, v_Texcoord), 1.0);\n vec4 pos = projectionInv * projectedPos;\n vec3 rayOrigin = pos.xyz / pos.w;\n vec3 V = -normalize(rayOrigin);\n\n float ndv = clamp(dot(N, V), 0.0, 1.0);\n float iterationCount;\n float jitter = rand(fract(v_Texcoord + jitterOffset));\n\n#ifdef PHYSICALLY_CORRECT\n vec4 color = vec4(vec3(0.0), 1.0);\n vec4 albedoMetalness = texture2D(gBufferTexture3, v_Texcoord);\n vec3 albedo = albedoMetalness.rgb;\n float m = albedoMetalness.a;\n vec3 diffuseColor = albedo * (1.0 - m);\n vec3 spec = mix(vec3(0.04), albedo, m);\n\n float jitter2 = rand(fract(v_Texcoord)) * float(TOTAL_SAMPLES);\n\n for (int i = 0; i < SAMPLE_PER_FRAME; i++) {\n vec3 H = importanceSampleNormalGGX(float(i) + jitter2, 1.0 - g, N);\n vec3 rayDir = normalize(reflect(-V, H));\n#else\n vec3 rayDir = normalize(reflect(-V, N));\n#endif\n vec2 hitPixel;\n vec3 hitPoint;\n\n bool intersect = traceScreenSpaceRay(rayOrigin, rayDir, jitter, hitPixel, hitPoint, iterationCount);\n\n float dist = distance(rayOrigin, hitPoint);\n\n vec3 hitNormal = texture2D(gBufferTexture1, hitPixel).rgb * 2.0 - 1.0;\n hitNormal = normalize((toViewSpace * vec4(hitNormal, 0.0)).xyz);\n#ifdef PHYSICALLY_CORRECT\n float ndl = clamp(dot(N, rayDir), 0.0, 1.0);\n float vdh = clamp(dot(V, H), 0.0, 1.0);\n float ndh = clamp(dot(N, H), 0.0, 1.0);\n vec3 litTexel = vec3(0.0);\n if (dot(hitNormal, rayDir) < 0.0 && intersect) {\n litTexel = texture2D(sourceTexture, hitPixel).rgb;\n litTexel *= pow(clamp(1.0 - dist / 200.0, 0.0, 1.0), 3.0);\n\n }\n else {\n #ifdef SPECULARCUBEMAP_ENABLED\n vec3 rayDirW = normalize(toWorldSpace * vec4(rayDir, 0.0)).rgb;\n litTexel = RGBMDecode(textureCubeLodEXT(specularCubemap, rayDirW, 0.0), 8.12).rgb * specularIntensity;\n#endif\n }\n color.rgb += ndl * litTexel * (\n F_Schlick(ndl, spec) * G_Smith(g, ndv, ndl) * vdh / (ndh * ndv + 0.001)\n );\n }\n color.rgb /= float(SAMPLE_PER_FRAME);\n#else\n #if !defined(SPECULARCUBEMAP_ENABLED)\n if (dot(hitNormal, rayDir) >= 0.0) {\n discard;\n }\n if (!intersect) {\n discard;\n }\n#endif\n float alpha = clamp(calculateAlpha(iterationCount, reflectivity, hitPixel, hitPoint, dist, rayDir), 0.0, 1.0);\n vec4 color = texture2D(sourceTexture, hitPixel);\n color.rgb *= alpha;\n\n#ifdef SPECULARCUBEMAP_ENABLED\n vec3 rayDirW = normalize(toWorldSpace * vec4(rayDir, 0.0)).rgb;\n alpha = alpha * (intersect ? 1.0 : 0.0);\n float bias = (1.0 -g) * 5.0;\n color.rgb += (1.0 - alpha)\n * RGBMDecode(textureCubeLodEXT(specularCubemap, rayDirW, bias), 8.12).rgb\n * specularIntensity;\n#endif\n\n#endif\n\n gl_FragColor = encodeHDR(color);\n}\n@end\n\n@export ecgl.ssr.blur\n\nuniform sampler2D texture;\nuniform sampler2D gBufferTexture1;\nuniform sampler2D gBufferTexture2;\nuniform mat4 projection;\nuniform float depthRange : 0.05;\n\nvarying vec2 v_Texcoord;\n\nuniform vec2 textureSize;\nuniform float blurSize : 1.0;\n\n#ifdef BLEND\n #ifdef SSAOTEX_ENABLED\nuniform sampler2D ssaoTex;\n #endif\nuniform sampler2D sourceTexture;\n#endif\n\nfloat getLinearDepth(vec2 coord)\n{\n float depth = texture2D(gBufferTexture2, coord).r * 2.0 - 1.0;\n return projection[3][2] / (depth * projection[2][3] - projection[2][2]);\n}\n\n@import clay.util.rgbm\n\n\nvoid main()\n{\n @import clay.compositor.kernel.gaussian_9\n\n vec4 centerNTexel = texture2D(gBufferTexture1, v_Texcoord);\n float g = centerNTexel.a;\n float maxBlurSize = clamp(1.0 - g, 0.0, 1.0) * blurSize;\n#ifdef VERTICAL\n vec2 off = vec2(0.0, maxBlurSize / textureSize.y);\n#else\n vec2 off = vec2(maxBlurSize / textureSize.x, 0.0);\n#endif\n\n vec2 coord = v_Texcoord;\n\n vec4 sum = vec4(0.0);\n float weightAll = 0.0;\n\n vec3 cN = centerNTexel.rgb * 2.0 - 1.0;\n float cD = getLinearDepth(v_Texcoord);\n for (int i = 0; i < 9; i++) {\n vec2 coord = clamp((float(i) - 4.0) * off + v_Texcoord, vec2(0.0), vec2(1.0));\n float w = gaussianKernel[i]\n * clamp(dot(cN, texture2D(gBufferTexture1, coord).rgb * 2.0 - 1.0), 0.0, 1.0);\n float d = getLinearDepth(coord);\n w *= (1.0 - smoothstep(abs(cD - d) / depthRange, 0.0, 1.0));\n\n weightAll += w;\n sum += decodeHDR(texture2D(texture, coord)) * w;\n }\n\n#ifdef BLEND\n float aoFactor = 1.0;\n #ifdef SSAOTEX_ENABLED\n aoFactor = texture2D(ssaoTex, v_Texcoord).r;\n #endif\n gl_FragColor = encodeHDR(\n sum / weightAll * aoFactor + decodeHDR(texture2D(sourceTexture, v_Texcoord))\n );\n#else\n gl_FragColor = encodeHDR(sum / weightAll);\n#endif\n}\n\n@end"},function(e,t,r){"use strict";t.a=[0,0,-.321585265978,-.154972575841,.458126042375,.188473391593,.842080129861,.527766490688,.147304551086,-.659453822776,-.331943915203,-.940619700594,.0479226680259,.54812163202,.701581552186,-.709825561388,-.295436780218,.940589268233,-.901489676764,.237713156085,.973570876096,-.109899459384,-.866792314779,-.451805525005,.330975007087,.800048655954,-.344275183665,.381779221166,-.386139432542,-.437418421534,-.576478634965,-.0148463392551,.385798197415,-.262426961053,-.666302061145,.682427250835,-.628010632582,-.732836215494,.10163141741,-.987658134403,.711995289051,-.320024291314,.0296005138058,.950296523438,.0130612307608,-.351024443122,-.879596633704,-.10478487883,.435712737232,.504254490347,.779203817497,.206477676721,.388264289969,-.896736162545,-.153106280781,-.629203242522,-.245517550697,.657969239148,.126830499058,.26862328493,-.634888119007,-.302301223431,.617074219636,.779817204925]},function(e,t,r){"use strict";function S(e,t,r,n,i){var a=e.gl;t.setUniform(a,"1i",r,i),a.activeTexture(a.TEXTURE0+i),n.isRenderable()?n.bind(e):n.unbind(e)}function n(e){this._depthTex=new i.a({format:a.a.DEPTH_COMPONENT,type:a.a.UNSIGNED_INT}),this._normalTex=new i.a({type:a.a.HALF_FLOAT}),this._framebuffer=new s.a,this._framebuffer.attach(this._normalTex),this._framebuffer.attach(this._depthTex,s.a.DEPTH_ATTACHMENT),this._normalMaterial=new u.a({shader:new o.a(o.a.source("ecgl.normal.vertex"),o.a.source("ecgl.normal.fragment"))}),this._normalMaterial.enableTexture(["normalMap","bumpMap","roughnessMap"]),this._defaultNormalMap=h.a.createBlank("#000"),this._defaultBumpMap=h.a.createBlank("#000"),this._defaultRoughessMap=h.a.createBlank("#000"),this._debugPass=new l.a({fragment:o.a.source("clay.compositor.output")}),this._debugPass.setUniform("texture",this._normalTex),this._debugPass.material.undefine("fragment","OUTPUT_ALPHA")}var i=r(5),a=r(4),o=r(8),s=r(10),u=r(19),l=r(16),h=r(61),c=r(195);o.a.import(c.a),n.prototype.getDepthTexture=function(){return this._depthTex},n.prototype.getNormalTexture=function(){return this._normalTex},n.prototype.update=function(e,t,r){var n=e.getWidth(),i=e.getHeight(),a=this._depthTex,o=this._normalTex,s=this._normalMaterial;a.width=n,a.height=i,o.width=n,o.height=i;var g,_,v,y,x,T,b,w,E,u=t.getRenderList(r).opaque;this._framebuffer.bind(e),e.gl.clearColor(0,0,0,0),e.gl.clear(e.gl.COLOR_BUFFER_BIT|e.gl.DEPTH_BUFFER_BIT),e.gl.disable(e.gl.BLEND),e.renderPass(u,r,{getMaterial:function(){return s},ifRender:function(e){return e.renderNormal},beforeRender:(g=e,_=this._defaultNormalMap,v=this._defaultBumpMap,y=this._defaultRoughessMap,this._normalMaterial,E=g.gl,function(e,t,r){var n,i,a,o,s,u,l,h,c,d,f,p,m;w&&w.material===e.material||(n=e.material,i=e.__program,null==(a=n.get("roughness"))&&(a=1),o=n.get("normalMap")||_,m=n.get("roughnessMap"),p=n.get("bumpMap"),s=n.get("uvRepeat"),u=n.get("uvOffset"),l=n.get("detailUvRepeat"),h=n.get("detailUvOffset"),c=!!p&&n.isTextureEnabled("bumpMap"),d=!!m&&n.isTextureEnabled("roughnessMap"),f=n.isDefined("fragment","DOUBLE_SIDED"),p=p||v,m=m||y,r!==t?(t.set("normalMap",o),t.set("bumpMap",p),t.set("roughnessMap",m),t.set("useBumpMap",c),t.set("useRoughnessMap",d),t.set("doubleSide",f),null!=s&&t.set("uvRepeat",s),null!=u&&t.set("uvOffset",u),null!=l&&t.set("detailUvRepeat",l),null!=h&&t.set("detailUvOffset",h),t.set("roughness",a)):(i.setUniform(E,"1f","roughness",a),x!==o&&S(g,i,"normalMap",o,0),T!==p&&p&&S(g,i,"bumpMap",p,1),b!==m&&m&&S(g,i,"roughnessMap",m,2),null!=s&&i.setUniform(E,"2f","uvRepeat",s),null!=u&&i.setUniform(E,"2f","uvOffset",u),null!=l&&i.setUniform(E,"2f","detailUvRepeat",l),null!=h&&i.setUniform(E,"2f","detailUvOffset",h),i.setUniform(E,"1i","useBumpMap",+c),i.setUniform(E,"1i","useRoughnessMap",+d),i.setUniform(E,"1i","doubleSide",+f)),x=o,T=p,b=m,w=e)}),sort:e.opaqueSortCompare}),this._framebuffer.unbind(e)},n.prototype.renderDebug=function(e){this._debugPass.render(e)},n.prototype.dispose=function(e){this._depthTex.dispose(e),this._normalTex.dispose(e)},t.a=n},function(e,t,r){"use strict";t.a="@export ecgl.normal.vertex\n\n@import ecgl.common.transformUniforms\n\n@import ecgl.common.uv.header\n\n@import ecgl.common.attributes\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\n@import ecgl.common.normalMap.vertexHeader\n\n@import ecgl.common.vertexAnimation.header\n\nvoid main()\n{\n\n @import ecgl.common.vertexAnimation.main\n\n @import ecgl.common.uv.main\n\n v_Normal = normalize((worldInverseTranspose * vec4(normal, 0.0)).xyz);\n v_WorldPosition = (world * vec4(pos, 1.0)).xyz;\n\n @import ecgl.common.normalMap.vertexMain\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n}\n\n\n@end\n\n\n@export ecgl.normal.fragment\n\n#define ROUGHNESS_CHANEL 0\n\nuniform bool useBumpMap;\nuniform bool useRoughnessMap;\nuniform bool doubleSide;\nuniform float roughness;\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n@import ecgl.common.normalMap.fragmentHeader\n@import ecgl.common.bumpMap.header\n\nuniform sampler2D roughnessMap;\n\nvoid main()\n{\n vec3 N = v_Normal;\n \n bool flipNormal = false;\n if (doubleSide) {\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n\n if (dot(N, V) < 0.0) {\n flipNormal = true;\n }\n }\n\n @import ecgl.common.normalMap.fragmentMain\n\n if (useBumpMap) {\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n }\n\n float g = 1.0 - roughness;\n\n if (useRoughnessMap) {\n float g2 = 1.0 - texture2D(roughnessMap, v_DetailTexcoord)[ROUGHNESS_CHANEL];\n g = clamp(g2 + (g - 0.5) * 2.0, 0.0, 1.0);\n }\n\n if (flipNormal) {\n N = -N;\n }\n\n gl_FragColor.rgb = (N.xyz + 1.0) * 0.5;\n gl_FragColor.a = g;\n}\n@end"},function(e,t,r){"use strict";function n(e){e=e||{},this._edgePass=new o.a({fragment:s.a.source("ecgl.edge")}),this._edgePass.setUniform("normalTexture",e.normalTexture),this._edgePass.setUniform("depthTexture",e.depthTexture),this._targetTexture=new i.a({type:a.a.HALF_FLOAT}),this._frameBuffer=new u.a,this._frameBuffer.attach(this._targetTexture)}var i=(r(9),r(3),r(5)),a=r(4),o=r(16),s=r(8),u=r(10);n.prototype.update=function(e,t,r,n){var i=e.getWidth(),a=e.getHeight(),o=this._targetTexture;o.width=i,o.height=a;var s=this._frameBuffer;s.bind(e),this._edgePass.setUniform("projectionInv",t.invProjectionMatrix.array),this._edgePass.setUniform("textureSize",[i,a]),this._edgePass.setUniform("texture",r),this._edgePass.render(e),s.unbind(e)},n.prototype.getTargetTexture=function(){return this._targetTexture},n.prototype.setParameter=function(e,t){this._edgePass.setUniform(e,t)},n.prototype.dispose=function(e){this._targetTexture.dispose(e),this._frameBuffer.dispose(e)},t.a=n},function(e,t,r){"use strict";t.a={type:"compositor",nodes:[{name:"source",type:"texture",outputs:{color:{}}},{name:"source_half",shader:"#source(clay.compositor.downsample)",inputs:{texture:"source"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"}},{name:"bright",shader:"#source(clay.compositor.bright)",inputs:{texture:"source_half"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{threshold:2,scale:4,textureSize:"expr([width * 1.0 / 2, height / 2])"}},{name:"bright_downsample_4",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 2, height / 2] )"}},{name:"bright_downsample_8",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright_downsample_4"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 4, height / 4] )"}},{name:"bright_downsample_16",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright_downsample_8"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 16)",height:"expr(height * 1.0 / 16)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 8, height / 8] )"}},{name:"bright_downsample_32",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright_downsample_16"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 32)",height:"expr(height * 1.0 / 32)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 16, height / 16] )"}},{name:"bright_upsample_16_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_32"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 16)",height:"expr(height * 1.0 / 16)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 32, height / 32] )"}},{name:"bright_upsample_16_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_16_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 16)",height:"expr(height * 1.0 / 16)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 16, height * 1.0 / 16] )"}},{name:"bright_upsample_8_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_16"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 16, height * 1.0 / 16] )"}},{name:"bright_upsample_8_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_8_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 8, height * 1.0 / 8] )"}},{name:"bright_upsample_8_blend",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_8_blur_v",texture2:"bright_upsample_16_blur_v"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"bright_upsample_4_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_8"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 8, height * 1.0 / 8] )"}},{name:"bright_upsample_4_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_4_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 4, height * 1.0 / 4] )"}},{name:"bright_upsample_4_blend",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_4_blur_v",texture2:"bright_upsample_8_blend"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"bright_upsample_2_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_4"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 4, height * 1.0 / 4] )"}},{name:"bright_upsample_2_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_2_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 2, height * 1.0 / 2] )"}},{name:"bright_upsample_2_blend",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_2_blur_v",texture2:"bright_upsample_4_blend"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"bright_upsample_full_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 2, height * 1.0 / 2] )"}},{name:"bright_upsample_full_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_full_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0, height * 1.0] )"}},{name:"bloom_composite",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_full_blur_v",texture2:"bright_upsample_2_blend"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"coc",shader:"#source(ecgl.dof.coc)",outputs:{color:{parameters:{minFilter:"NEAREST",magFilter:"NEAREST",width:"expr(width * 1.0)",height:"expr(height * 1.0)"}}},parameters:{focalDist:50,focalRange:30}},{name:"dof_far_blur",shader:"#source(ecgl.dof.diskBlur)",inputs:{texture:"source",coc:"coc"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"}},{name:"dof_near_blur",shader:"#source(ecgl.dof.diskBlur)",inputs:{texture:"source",coc:"coc"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"},defines:{BLUR_NEARFIELD:null}},{name:"dof_coc_blur",shader:"#source(ecgl.dof.diskBlur)",inputs:{texture:"coc"},outputs:{color:{parameters:{minFilter:"NEAREST",magFilter:"NEAREST",width:"expr(width * 1.0)",height:"expr(height * 1.0)"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"},defines:{BLUR_COC:null}},{name:"dof_composite",shader:"#source(ecgl.dof.composite)",inputs:{original:"source",blurred:"dof_far_blur",nearfield:"dof_near_blur",coc:"coc",nearcoc:"dof_coc_blur"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}}},{name:"composite",shader:"#source(clay.compositor.hdr.composite)",inputs:{texture:"source",bloom:"bloom_composite"},defines:{}},{name:"FXAA",shader:"#source(clay.compositor.fxaa)",inputs:{texture:"composite"}}]}},function(e,t,r){"use strict";t.a="@export ecgl.dof.coc\n\nuniform sampler2D depth;\n\nuniform float zNear: 0.1;\nuniform float zFar: 2000;\n\nuniform float focalDistance: 3;\nuniform float focalRange: 1;\nuniform float focalLength: 30;\nuniform float fstop: 2.8;\n\nvarying vec2 v_Texcoord;\n\n@import clay.util.encode_float\n\nvoid main()\n{\n float z = texture2D(depth, v_Texcoord).r * 2.0 - 1.0;\n\n float dist = 2.0 * zNear * zFar / (zFar + zNear - z * (zFar - zNear));\n\n float aperture = focalLength / fstop;\n\n float coc;\n\n float uppper = focalDistance + focalRange;\n float lower = focalDistance - focalRange;\n if (dist <= uppper && dist >= lower) {\n coc = 0.5;\n }\n else {\n float focalAdjusted = dist > uppper ? uppper : lower;\n\n coc = abs(aperture * (focalLength * (dist - focalAdjusted)) / (dist * (focalAdjusted - focalLength)));\n coc = clamp(coc, 0.0, 2.0) / 2.00001;\n\n if (dist < lower) {\n coc = -coc;\n }\n coc = coc * 0.5 + 0.5;\n }\n\n gl_FragColor = encodeFloat(coc);\n}\n@end\n\n\n@export ecgl.dof.composite\n\n#define DEBUG 0\n\nuniform sampler2D original;\nuniform sampler2D blurred;\nuniform sampler2D nearfield;\nuniform sampler2D coc;\nuniform sampler2D nearcoc;\nvarying vec2 v_Texcoord;\n\n@import clay.util.rgbm\n@import clay.util.float\n\nvoid main()\n{\n vec4 blurredColor = texture2D(blurred, v_Texcoord);\n vec4 originalColor = texture2D(original, v_Texcoord);\n\n float fCoc = decodeFloat(texture2D(coc, v_Texcoord));\n\n fCoc = abs(fCoc * 2.0 - 1.0);\n\n float weight = smoothstep(0.0, 1.0, fCoc);\n \n#ifdef NEARFIELD_ENABLED\n vec4 nearfieldColor = texture2D(nearfield, v_Texcoord);\n float fNearCoc = decodeFloat(texture2D(nearcoc, v_Texcoord));\n fNearCoc = abs(fNearCoc * 2.0 - 1.0);\n\n gl_FragColor = encodeHDR(\n mix(\n nearfieldColor, mix(originalColor, blurredColor, weight),\n pow(1.0 - fNearCoc, 4.0)\n )\n );\n#else\n gl_FragColor = encodeHDR(mix(originalColor, blurredColor, weight));\n#endif\n\n}\n\n@end\n\n\n\n@export ecgl.dof.diskBlur\n\n#define POISSON_KERNEL_SIZE 16;\n\nuniform sampler2D texture;\nuniform sampler2D coc;\nvarying vec2 v_Texcoord;\n\nuniform float blurRadius : 10.0;\nuniform vec2 textureSize : [512.0, 512.0];\n\nuniform vec2 poissonKernel[POISSON_KERNEL_SIZE];\n\nuniform float percent;\n\nfloat nrand(const in vec2 n) {\n return fract(sin(dot(n.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\n@import clay.util.rgbm\n@import clay.util.float\n\n\nvoid main()\n{\n vec2 offset = blurRadius / textureSize;\n\n float rnd = 6.28318 * nrand(v_Texcoord + 0.07 * percent );\n float cosa = cos(rnd);\n float sina = sin(rnd);\n vec4 basis = vec4(cosa, -sina, sina, cosa);\n\n#if !defined(BLUR_NEARFIELD) && !defined(BLUR_COC)\n offset *= abs(decodeFloat(texture2D(coc, v_Texcoord)) * 2.0 - 1.0);\n#endif\n\n#ifdef BLUR_COC\n float cocSum = 0.0;\n#else\n vec4 color = vec4(0.0);\n#endif\n\n\n float weightSum = 0.0;\n\n for (int i = 0; i < POISSON_KERNEL_SIZE; i++) {\n vec2 ofs = poissonKernel[i];\n\n ofs = vec2(dot(ofs, basis.xy), dot(ofs, basis.zw));\n\n vec2 uv = v_Texcoord + ofs * offset;\n vec4 texel = texture2D(texture, uv);\n\n float w = 1.0;\n#ifdef BLUR_COC\n float fCoc = decodeFloat(texel) * 2.0 - 1.0;\n cocSum += clamp(fCoc, -1.0, 0.0) * w;\n#else\n texel = texel;\n #if !defined(BLUR_NEARFIELD)\n float fCoc = decodeFloat(texture2D(coc, uv)) * 2.0 - 1.0;\n w *= abs(fCoc);\n #endif\n texel.rgb *= texel.a;\n color += texel * w;\n#endif\n\n weightSum += w;\n }\n\n#ifdef BLUR_COC\n gl_FragColor = encodeFloat(clamp(cocSum / weightSum, -1.0, 0.0) * 0.5 + 0.5);\n#else\n color /= weightSum;\n color.rgb /= (color.a + 0.0001);\n gl_FragColor = color;\n#endif\n}\n\n@end"},function(e,t,r){"use strict";t.a="@export ecgl.edge\n\nuniform sampler2D texture;\n\nuniform sampler2D normalTexture;\nuniform sampler2D depthTexture;\n\nuniform mat4 projectionInv;\n\nuniform vec2 textureSize;\n\nuniform vec4 edgeColor: [0,0,0,0.8];\n\nvarying vec2 v_Texcoord;\n\nvec3 packColor(vec2 coord) {\n float z = texture2D(depthTexture, coord).r * 2.0 - 1.0;\n vec4 p = vec4(v_Texcoord * 2.0 - 1.0, z, 1.0);\n vec4 p4 = projectionInv * p;\n\n return vec3(\n texture2D(normalTexture, coord).rg,\n -p4.z / p4.w / 5.0\n );\n}\n\nvoid main() {\n vec2 cc = v_Texcoord;\n vec3 center = packColor(cc);\n\n float size = clamp(1.0 - (center.z - 10.0) / 100.0, 0.0, 1.0) * 0.5;\n float dx = size / textureSize.x;\n float dy = size / textureSize.y;\n\n vec2 coord;\n vec3 topLeft = packColor(cc+vec2(-dx, -dy));\n vec3 top = packColor(cc+vec2(0.0, -dy));\n vec3 topRight = packColor(cc+vec2(dx, -dy));\n vec3 left = packColor(cc+vec2(-dx, 0.0));\n vec3 right = packColor(cc+vec2(dx, 0.0));\n vec3 bottomLeft = packColor(cc+vec2(-dx, dy));\n vec3 bottom = packColor(cc+vec2(0.0, dy));\n vec3 bottomRight = packColor(cc+vec2(dx, dy));\n\n vec3 v = -topLeft-2.0*top-topRight+bottomLeft+2.0*bottom+bottomRight;\n vec3 h = -bottomLeft-2.0*left-topLeft+bottomRight+2.0*right+topRight;\n\n float edge = sqrt(dot(h, h) + dot(v, v));\n\n edge = smoothstep(0.8, 1.0, edge);\n\n gl_FragColor = mix(texture2D(texture, v_Texcoord), vec4(edgeColor.rgb, 1.0), edgeColor.a * edge);\n}\n@end"},function(e,t,r){"use strict";function n(e){for(var t=[],r=0;r<30;r++)t.push([Object(i.a)(r,2),Object(i.a)(r,3)]);this._haltonSequence=t,this._frame=0,this._sourceTex=new s.a,this._sourceFb=new o.a,this._sourceFb.attach(this._sourceTex),this._prevFrameTex=new s.a,this._outputTex=new s.a;var n=this._blendPass=new a.a({fragment:u.a.source("clay.compositor.blend")});n.material.disableTexturesAll(),n.material.enableTexture(["texture1","texture2"]),this._blendFb=new o.a({depthBuffer:!1}),this._outputPass=new a.a({fragment:u.a.source("clay.compositor.output"),blendWithPrevious:!0}),this._outputPass.material.define("fragment","OUTPUT_ALPHA"),this._outputPass.material.blend=function(e){e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA)}}var i=r(49),a=r(16),o=r(10),s=r(5),u=r(8),l=r(9);n.prototype={constructor:n,jitterProjection:function(e,t){var r=e.viewport,n=r.devicePixelRatio||e.getDevicePixelRatio(),i=r.width*n,a=r.height*n,o=this._haltonSequence[this._frame%this._haltonSequence.length],s=new l.a;s.array[12]=(2*o[0]-1)/i,s.array[13]=(2*o[1]-1)/a,l.a.mul(t.projectionMatrix,s,t.projectionMatrix),l.a.invert(t.invProjectionMatrix,t.projectionMatrix)},resetFrame:function(){this._frame=0},getFrame:function(){return this._frame},getSourceFrameBuffer:function(){return this._sourceFb},getOutputTexture:function(){return this._outputTex},resize:function(e,t){this._prevFrameTex.width=e,this._prevFrameTex.height=t,this._outputTex.width=e,this._outputTex.height=t,this._sourceTex.width=e,this._sourceTex.height=t,this._prevFrameTex.dirty(),this._outputTex.dirty(),this._sourceTex.dirty()},isFinished:function(){return this._frame>=this._haltonSequence.length},render:function(e,t,r){var n=this._blendPass;0===this._frame?(n.setUniform("weight1",0),n.setUniform("weight2",1)):(n.setUniform("weight1",.9),n.setUniform("weight2",.1)),n.setUniform("texture1",this._prevFrameTex),n.setUniform("texture2",t||this._sourceTex),this._blendFb.attach(this._outputTex),this._blendFb.bind(e),n.render(e),this._blendFb.unbind(e),r||(this._outputPass.setUniform("texture",this._outputTex),this._outputPass.render(e));var i=this._prevFrameTex;this._prevFrameTex=this._outputTex,this._outputTex=i,this._frame++},dispose:function(e){this._sourceFb.dispose(e),this._blendFb.dispose(e),this._prevFrameTex.dispose(e),this._outputTex.dispose(e),this._sourceTex.dispose(e),this._outputPass.dispose(e),this._blendPass.dispose(e)}},t.a=n},function(e,t,r){"use strict";var n=r(0),i=r.n(n);r(202),r(203),r(98),i.a.registerAction({type:"geo3DChangeCamera",event:"geo3dcamerachanged",update:"series:updateCamera"},function(t,e){e.eachComponent({mainType:"geo3D",query:t},function(e){e.setView(t)})})},function(e,t,r){"use strict";var n=r(0),a=r.n(n),i=r(44),o=r(28),s=r(29),u=r(31),l=r(96),h=a.a.extendComponentModel({type:"geo3D",layoutMode:"box",coordinateSystem:null,optionUpdated:function(){var e=this.option;e.regions=this.getFilledRegions(e.regions,e.map);var t=a.a.helper.completeDimensions(["value"],e.data,{encodeDef:this.get("encode"),dimsDef:this.get("dimensions")}),n=new a.a.List(t,this);n.initData(e.regions);var i={};n.each(function(e){var t=n.getName(e),r=n.getItemModel(e);i[t]=r}),this._regionModelMap=i,this._data=n},getData:function(){return this._data},getRegionModel:function(e){var t=this.getData().getName(e);return this._regionModelMap[t]||new a.a.Model(null,this)},getRegionPolygonCoords:function(e){var t=this.getData().getName(e),r=this.coordinateSystem.getRegion(t);return r?r.geometries:[]},getFormattedLabel:function(e,t){var r=this._data.getName(e),n=this.getRegionModel(r),i=n.get("normal"===t?["label","formatter"]:["emphasis","label","formatter"]);null==i&&(i=n.get(["label","formatter"]));var a={name:r};if("function"==typeof i)return a.status=t,i(a);if("string"!=typeof i)return r;var o=a.seriesName;return i.replace("{a}",null!=o?o:"")},defaultOption:{regions:[]}});a.a.util.merge(h.prototype,l.a),a.a.util.merge(h.prototype,i.a),a.a.util.merge(h.prototype,o.a),a.a.util.merge(h.prototype,s.a),a.a.util.merge(h.prototype,u.a)},function(e,t,r){"use strict";var n=r(64),i=r(0),a=r.n(i),o=r(1),s=r(45),u=r(30);a.a.extendComponentView({type:"geo3D",__ecgl__:!0,init:function(e,t){this._geo3DBuilder=new n.a(t),this.groupGL=new o.a.Node,this._lightRoot=new o.a.Node,this._sceneHelper=new u.a(this._lightRoot),this._sceneHelper.initLight(this._lightRoot),this._control=new s.a({zr:t.getZr()}),this._control.init()},render:function(e,t,r){this.groupGL.add(this._geo3DBuilder.rootNode);var n,i,a,o=e.coordinateSystem;o&&o.viewGL&&(o.viewGL.add(this._lightRoot),e.get("show")?o.viewGL.add(this.groupGL):o.viewGL.remove(this.groupGL),(n=this._control).setViewGL(o.viewGL),i=e.getModel("viewControl"),n.setFromViewControlModel(i,0),this._sceneHelper.setScene(o.viewGL.scene),this._sceneHelper.updateLight(e),o.viewGL.setPostEffect(e.getModel("postEffect"),r),o.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling")),this._geo3DBuilder.update(e,t,r,0,e.getData().count()),a=o.viewGL.isLinearSpace()?"define":"undefine",this._geo3DBuilder.rootNode.traverse(function(e){e.material&&e.material[a]("fragment","SRGB_DECODE")}),n.off("update"),n.on("update",function(){r.dispatchAction({type:"geo3DChangeCamera",alpha:n.getAlpha(),beta:n.getBeta(),distance:n.getDistance(),center:n.getCenter(),from:this.uid,geo3DId:e.id})}),n.update())},afterRender:function(e,t,r,n){var i=n.renderer;this._sceneHelper.updateAmbientCubemap(i,e,r),this._sceneHelper.updateSkybox(i,e,r)},dispose:function(){this._control.dispose()}})},function(e,t,r){"use strict";function n(e,t,r){r=r||2;var n,i,a,o,s,u,l,h=t&&t.length,c=h?t[0]*r:e.length,d=m(e,0,c,r,!0),f=[];if(!d)return f;if(h&&(d=function(e,t,r,n){var i,a,o,s,u,l=[];for(i=0,a=t.length;i=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&o=n.x&&n.x>=h&&i!==n.x&&y(ar.x)&&T(n,e)&&(r=n,d=u),n=n.next;return r}(e,t))&&g(r=b(t,e),r.next)}})(l[i],r),r=g(r,r.next);return r}(e,t,d,r)),e.length>80*r){n=a=e[0],i=o=e[1];for(var p=r;pa.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,h=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,c=p(s,u,t,r,n),d=p(l,h,t,r,n),f=e.nextZ;f&&f.z<=d;){if(f!==e.prev&&f!==e.next&&y(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&0<=x(f.prev,f,f.next))return!1;f=f.nextZ}for(f=e.prevZ;f&&f.z>=c;){if(f!==e.prev&&f!==e.next&&y(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&0<=x(f.prev,f,f.next))return!1;f=f.prevZ}return!0}(e,n,i,a):function(e){var t=e.prev,r=e,n=e.next;if(0<=x(t,r,n))return!1;for(var i=e.next.next;i!==e.prev;){if(y(t.x,t.y,r.x,r.y,n.x,n.y,i.x,i.y)&&0<=x(i.prev,i,i.next))return!1;i=i.next}return!0}(e))t.push(s.i/r),t.push(e.i/r),t.push(u.i/r),d(e),e=u.next,l=u.next;else if((e=u)===l){o?1===o?_(e=function(e,t,r){var n=e;do{var i=n.prev,a=n.next.next;!h(i,a)&&c(i,n,n.next,a)&&T(i,a)&&T(a,i)&&(t.push(i.i/r),t.push(n.i/r),t.push(a.i/r),d(n),d(n.next),n=e=a),n=n.next}while(n!==e);return n}(e,t,r),t,r,n,i,a,2):2===o&&function(e,t,r,n,i,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&function(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&c(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&T(e,t)&&T(t,e)&&function(e,t){var r=e,n=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;for(;r.y>a!=r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next,r!==e;);return n}(e,t)}(o,s)){var u=b(o,s);return o=g(o,o.next),u=g(u,u.next),_(o,t,r,n,i,a),_(u,t,r,n,i,a)}s=s.next}o=o.next}while(o!==e)}(e,t,r,n,i,a):_(g(e),t,r,n,i,a,1);break}}}function v(e,t){return e.x-t.x}function p(e,t,r,n,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)/i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)/i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function y(e,t,r,n,i,a,o,s){return 0<=(i-o)*(t-s)-(e-o)*(a-s)&&0<=(e-o)*(n-s)-(r-o)*(t-s)&&0<=(r-o)*(a-s)-(i-o)*(n-s)}function x(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function h(e,t){return e.x===t.x&&e.y===t.y}function c(e,t,r,n){return h(e,t)&&h(r,n)||h(e,n)&&h(r,t)||0OpenStreetMap contributors, © CARTO',center:[0,0],zoom:0,pitch:0,bearing:0,light:{main:{alpha:20,beta:30}},altitudeScale:1,boxHeight:"auto"},getMaptalksCameraOption:function(){var r=this;return s.reduce(function(e,t){return e[t]=r.get(t),e},{})},setMaptalksCameraOption:function(t){null!=t&&s.forEach(function(e){null!=t[e]&&(this.option[e]=t[e])},this)},getMaptalks:function(){return this._maptalks},setMaptalks:function(e){this._maptalks=e}});i.a.util.merge(u.prototype,a.a),i.a.util.merge(u.prototype,o.a)},function(e,t,r){"use strict";var n=r(0),i=r.n(n),a=r(224),o=r(30),u=r(1),s=r(102);u.a.Shader.import(s.a),i.a.extendComponentView({type:"maptalks3D",__ecgl__:!0,init:function(){this._groundMesh=new u.a.Mesh({geometry:new u.a.PlaneGeometry,material:new u.a.Material({shader:new u.a.Shader({vertex:u.a.Shader.source("ecgl.displayShadow.vertex"),fragment:u.a.Shader.source("ecgl.displayShadow.fragment")}),depthMask:!1}),renderOrder:-100,culling:!1,castShadow:!1,$ignorePicking:!0,renderNormal:!0})},_initMaptalksLayer:function(e,t){var r=t.getZr();this._zrLayer=new a.a("maptalks3D",r,e.get("center"),e.get("zoom")),r.painter.insertLayer(-1e3,this._zrLayer),this._lightRoot=new u.a.Node,this._sceneHelper=new o.a(this._lightRoot),this._sceneHelper.initLight(this._lightRoot);var n=this._zrLayer.getMaptalks(),i=this._dispatchInteractAction.bind(this,t,n);["zoomend","zooming","zoomstart","dragrotating","pitch","pitchend","movestart","moving","moveend","resize","touchstart","touchmove","touchend"].forEach(function(e){n.on(e,i)})},render:function(e,t,r){this._zrLayer||this._initMaptalksLayer(e,r);var n=this._zrLayer.getMaptalks(),i=e.get("urlTemplate"),a=n.getBaseLayer();i!==this._oldUrlTemplate&&(a?a.setOptions({urlTemplate:i,attribution:e.get("attribution")}):(a=new maptalks.TileLayer("maptalks-echarts-gl-baselayer",{urlTemplate:i,subdomains:["a","b","c"],attribution:e.get("attribution")}),n.setBaseLayer(a))),this._oldUrlTemplate=i,n.setCenter(e.get("center")),n.setZoom(e.get("zoom"),{animation:!1}),n.setPitch(e.get("pitch")),n.setBearing(e.get("bearing")),e.setMaptalks(n);var o=e.coordinateSystem;o.viewGL.scene.add(this._lightRoot),o.viewGL.add(this._groundMesh),this._updateGroundMesh(),this._sceneHelper.setScene(o.viewGL.scene),this._sceneHelper.updateLight(e),o.viewGL.setPostEffect(e.getModel("postEffect"),r),o.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling")),this._maptalks3DModel=e},afterRender:function(e,t,r,n){var i=n.renderer;this._sceneHelper.updateAmbientCubemap(i,e,r),this._sceneHelper.updateSkybox(i,e,r),e.coordinateSystem.viewGL.scene.traverse(function(e){e.material&&(e.material.define("fragment","NORMAL_UP_AXIS",2),e.material.define("fragment","NORMAL_FRONT_AXIS",1))})},updateCamera:function(e,t,r,n){e.coordinateSystem.setCameraOption(n),this._updateGroundMesh(),r.getZr().refresh()},_dispatchInteractAction:function(e,t){e.dispatchAction({type:"maptalks3DChangeCamera",pitch:t.getPitch(),zoom:t.getZoom(),center:t.getCenter().toArray(),bearing:t.getBearing(),maptalks3DId:this._maptalks3DModel&&this._maptalks3DModel.id})},_updateGroundMesh:function(){var e,t,r,n,i,a,o,s;this._maptalks3DModel&&(t=(e=this._maptalks3DModel.coordinateSystem).dataToPoint(e.center),this._groundMesh.position.set(t[0],t[1],-.001),r=new u.a.Plane(new u.a.Vector3(0,0,1),0),n=e.viewGL.camera.castRay(new u.a.Vector2(-1,-1)),i=e.viewGL.camera.castRay(new u.a.Vector2(1,1)),a=n.intersectPlane(r),o=i.intersectPlane(r),s=a.dist(o)/e.viewGL.rootNode.scale.x,this._groundMesh.scale.set(s,s,1))},dispose:function(e,t){this._zrLayer&&this._zrLayer.dispose(),t.getZr().painter.delLayer(-1e3)}})},function(e,t,r){"use strict";function n(e,t,r,n){if(this.id=e,this.zr=t,this.dom=document.createElement("div"),this.dom.style.cssText="position:absolute;left:0;right:0;top:0;bottom:0;",!maptalks)throw new Error("Maptalks library must be included. See https://maptalks.org");this._maptalks=new maptalks.Map(this.dom,{center:r,zoom:n,fog:!1}),this._initEvents()}n.prototype.resize=function(){this._maptalks.checkSize()},n.prototype.getMaptalks=function(){return this._maptalks},n.prototype.clear=function(){},n.prototype.refresh=function(){this._maptalks.checkSize()};var i=["mousedown","mouseup","click","dblclick","mousemove","mousewheel","DOMMouseScroll","touchstart","touchend","touchmove","touchcancel"];n.prototype._initEvents=function(){var a=this.dom;this._handlers=this._handlers||{contextmenu:function(e){return e.preventDefault(),!1}},i.forEach(function(i){this._handlers[i]=function(e){var t,r={};for(t in e)r[t]=e[t];r.bubbles=!1;var n=new e.constructor(e.type,r);"mousewheel"===i||"DOMMouseScroll"===i?a.dispatchEvent(n):a.firstElementChild.dispatchEvent(n)},this.zr.dom.addEventListener(i,this._handlers[i])},this),this.zr.dom.addEventListener("contextmenu",this._handlers.contextmenu)},n.prototype.dispose=function(){i.forEach(function(e){this.zr.dom.removeEventListener(e,this._handlers[e])},this),this._maptalks.remove()},t.a=n},function(e,t,r){"use strict";var n=r(0),i=r.n(n),a=(r(226),r(229),r(231),r(17));i.a.registerVisual(Object(a.a)("bar3D")),i.a.registerProcessor(function(e,t){e.eachSeriesByType("bar3d",function(e){var t=e.getData();t.filterSelf(function(e){return t.hasValue(e)})})})},function(e,t,r){"use strict";function _(e,t){var r=s(e,t[2]);return{dimension:r?e.getCalculationInfo("stackResultDimension"):t[2],isStacked:r}}var n=r(0),v=r.n(n),i=r(3),a=r(6),o=r(227),y=r(228),g=a.a.vec3,s=v.a.helper.dataStack.isDimensionStacked;v.a.registerLayout(function(e,t){e.eachSeriesByType("bar3D",function(e){var t=e.coordinateSystem,r=t&&t.type;"globe"===r?function(t,c){var e,r,d=t.getData(),f=t.get("minHeight")||0,p=t.get("barSize"),n=["lng","lat","alt"].map(function(e){return t.coordDimToDataDim(e)[0]});null==p?(e=c.radius*Math.PI,r=Object(y.a)(d,n[0],n[1]),p=[e/Math.sqrt(d.count()/r),e/Math.sqrt(d.count()/r)]):v.a.util.isArray(p)||(p=[p,p]);var m=_(d,n);d.each(n,function(e,t,r,n){var i=d.get(m.dimension,n),a=m.isStacked?i-r:c.altitudeAxis.scale.getExtent()[0],o=Math.max(c.altitudeAxis.dataToCoord(r),f),s=c.dataToPoint([e,t,a]),u=c.dataToPoint([e,t,i]),l=g.sub([],u,s);g.normalize(l,l);var h=[p[0],o,p[1]];d.setItemLayout(n,[s,l,h])}),d.setLayout("orient",i.a.UP.array)}(e,t):"cartesian3D"===r?Object(o.a)(e,t):"geo3D"===r?function(t,l){var e,r,h=t.getData(),c=t.get("barSize"),d=t.get("minHeight")||0,n=["lng","lat","alt"].map(function(e){return t.coordDimToDataDim(e)[0]});null==c?(e=Math.min(l.size[0],l.size[2]),r=Object(y.a)(h,n[0],n[1]),c=[e/Math.sqrt(h.count()/r),e/Math.sqrt(h.count()/r)]):v.a.util.isArray(c)||(c=[c,c]);var f=[0,1,0],p=_(h,n);h.each(n,function(e,t,r,n){var i=h.get(p.dimension,n),a=p.isStacked?i-r:l.altitudeAxis.scale.getExtent()[0],o=Math.max(l.altitudeAxis.dataToCoord(r),d),s=l.dataToPoint([e,t,a]),u=[c[0],o,c[1]];h.setItemLayout(n,[s,f,u])}),h.setLayout("orient",[1,0,0])}(e,t):"mapbox3D"!==r&&"maptalks3D"!==r||function(e,h){var t,r,n,i,a,o,c=e.getData(),s=e.coordDimToDataDim("lng")[0],u=e.coordDimToDataDim("lat")[0],l=e.coordDimToDataDim("alt")[0],d=e.get("barSize"),f=e.get("minHeight")||0;null==d?(t=c.getDataExtent(s),r=c.getDataExtent(u),n=h.dataToPoint([t[0],r[0]]),i=h.dataToPoint([t[1],r[1]]),a=Math.min(Math.abs(n[0]-i[0]),Math.abs(n[1]-i[1]))||1,o=Object(y.a)(c,s,u),d=[a/Math.sqrt(c.count()/o),a/Math.sqrt(c.count()/o)]):(v.a.util.isArray(d)||(d=[d,d]),d[0]/=h.getScale()/16,d[1]/=h.getScale()/16);var p=[0,0,1],m=[s,u,l],g=_(c,m);c.each(m,function(e,t,r,n){var i=c.get(g.dimension,n),a=g.isStacked?i-r:0,o=h.dataToPoint([e,t,a]),s=h.dataToPoint([e,t,i]),u=Math.max(s[2]-o[2],f),l=[d[0],u,d[1]];c.setItemLayout(n,[o,p,l])}),c.setLayout("orient",[1,0,0])}(e,t)})})},function(e,t,r){"use strict";var n=r(0),u=r.n(n),v=r(6).a.vec3,l=u.a.helper.dataStack.isDimensionStacked;t.a=function(t,c){var e,r,n,d=t.getData(),f=t.get("barSize");null==f?(e=c.size,r=c.getAxis("x"),n=c.getAxis("y"),f=["category"===r.type?.7*r.getBandWidth():.6*Math.round(e[0]/Math.sqrt(d.count())),"category"===n.type?.7*n.getBandWidth():.6*Math.round(e[1]/Math.sqrt(d.count()))]):u.a.util.isArray(f)||(f=[f,f]);var i,a,o,p=c.getAxis("z").scale.getExtent(),m=(a=(i=p)[0],o=i[1],!(0 ")),i.value&&(u+=" : "+l.a.format.encodeHTML(i.value)),u},_updateCategoriesData:function(){var e=(this.option.categories||[]).map(function(e){return null!=e.value?e:l.a.util.extend({value:0},e)}),t=new l.a.List(["value"],this);t.initData(e),this._categoriesData=t,this._categoriesModels=t.mapArray(function(e){return t.getItemModel(e,!0)})},setView:function(e){null!=e.zoom&&(this.option.zoom=e.zoom),null!=e.offset&&(this.option.offset=e.offset)},setNodePosition:function(e){for(var t=0;t "+d)),l++)}var f=g.a.helper.completeDimensions(["value"],e),p=new g.a.List(f,r);p.initData(e);var m=new g.a.List(["value"],r);return m.initData(u,s),i&&i(p,m),v()({mainData:p,struct:a,structAttr:"graph",datas:{node:p,edge:m},datasAttr:{node:"data",edge:"edgeData"}}),a.update(),a}},function(e,t,r){function c(e){return"_EC_"+e}function d(e,t){this.id=null==e?"":e,this.inEdges=[],this.outEdges=[],this.edges=[],this.hostGraph,this.dataIndex=null==t?-1:t}function s(e,t,r){this.node1=e,this.node2=t,this.dataIndex=null==r?-1:r}function a(e){this._directed=e||!1,this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this.data,this.edgeData}var n=(r(104).__DEV__,r(13)),i=r(266).enableClassCheck,o=a.prototype;o.type="graph",o.isDirected=function(){return this._directed},o.addNode=function(e,t){e=e||""+t;var r=this._nodesMap;if(!r[c(e)]){var n=new d(e,t);return(n.hostGraph=this).nodes.push(n),r[c(e)]=n}},o.getNodeByIndex=function(e){var t=this.data.getRawIndex(e);return this.nodes[t]},o.getNodeById=function(e){return this._nodesMap[c(e)]},o.addEdge=function(e,t,r){var n=this._nodesMap,i=this._edgesMap;if("number"==typeof e&&(e=this.nodes[e]),"number"==typeof t&&(t=this.nodes[t]),d.isInstance(e)||(e=n[c(e)]),d.isInstance(t)||(t=n[c(t)]),e&&t){var a=e.id+"-"+t.id;if(!i[a]){var o=new s(e,t,r);return(o.hostGraph=this)._directed&&(e.outEdges.push(o),t.inEdges.push(o)),e.edges.push(o),e!==t&&t.edges.push(o),this.edges.push(o),i[a]=o}}},o.getEdgeByIndex=function(e){var t=this.edgeData.getRawIndex(e);return this.edges[t]},o.getEdge=function(e,t){d.isInstance(e)&&(e=e.id),d.isInstance(t)&&(t=t.id);var r=this._edgesMap;return this._directed?r[e+"-"+t]:r[e+"-"+t]||r[t+"-"+e]},o.eachNode=function(e,t){for(var r=this.nodes,n=r.length,i=0;ir.left&&cr.top||(l=(u=Math.max(a[0]-i[0],10))/t.getWidth()*t.getHeight(),u*=1.4,l*=1.4,i[0]-=.2*u,r.left=i[0],r.top=h-l/2,r.bottom=h+l/2,r.right=u+i[0],r.near=0,r.far=100)},dispose:function(){var e=this.viewGL.layer.renderer;this._forceLayoutInstance&&this._forceLayoutInstance.dispose(e),this.groupGL.removeAll(),this._layoutId=-1},remove:function(){this.groupGL.removeAll(),this._control.dispose()}})},function(e,t,r){"use strict";function n(e){var t={type:o.a.Texture.FLOAT,minFilter:o.a.Texture.NEAREST,magFilter:o.a.Texture.NEAREST};this._positionSourceTex=new o.a.Texture2D(t),this._positionSourceTex.flipY=!1,this._positionTex=new o.a.Texture2D(t),this._positionPrevTex=new o.a.Texture2D(t),this._forceTex=new o.a.Texture2D(t),this._forcePrevTex=new o.a.Texture2D(t),this._weightedSumTex=new o.a.Texture2D(t),this._weightedSumTex.width=this._weightedSumTex.height=1,this._globalSpeedTex=new o.a.Texture2D(t),this._globalSpeedPrevTex=new o.a.Texture2D(t),this._globalSpeedTex.width=this._globalSpeedTex.height=1,this._globalSpeedPrevTex.width=this._globalSpeedPrevTex.height=1,this._nodeRepulsionPass=new s.a({fragment:o.a.Shader.source("ecgl.forceAtlas2.updateNodeRepulsion")}),this._positionPass=new s.a({fragment:o.a.Shader.source("ecgl.forceAtlas2.updatePosition")}),this._globalSpeedPass=new s.a({fragment:o.a.Shader.source("ecgl.forceAtlas2.calcGlobalSpeed")}),this._copyPass=new s.a({fragment:o.a.Shader.source("clay.compositor.output")});function r(e){e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ONE)}this._edgeForceMesh=new o.a.Mesh({geometry:new o.a.Geometry({attributes:{node1:new o.a.Geometry.Attribute("node1","float",2),node2:new o.a.Geometry.Attribute("node2","float",2),weight:new o.a.Geometry.Attribute("weight","float",1)},dynamic:!0,mainAttribute:"node1"}),material:new o.a.Material({transparent:!0,shader:o.a.createShader("ecgl.forceAtlas2.updateEdgeAttraction"),blend:r,depthMask:!1,depthText:!1}),mode:o.a.Mesh.POINTS}),this._weightedSumMesh=new o.a.Mesh({geometry:new o.a.Geometry({attributes:{node:new o.a.Geometry.Attribute("node","float",2)},dynamic:!0,mainAttribute:"node"}),material:new o.a.Material({transparent:!0,shader:o.a.createShader("ecgl.forceAtlas2.calcWeightedSum"),blend:r,depthMask:!1,depthText:!1}),mode:o.a.Mesh.POINTS}),this._framebuffer=new u.a({depthBuffer:!1}),this._dummyCamera=new o.a.OrthographicCamera({left:-1,right:1,top:1,bottom:-1,near:0,far:100}),this._globalSpeed=0}var i=r(0),a=r.n(i),o=r(1),s=r(16),u=r(10),l=r(270);o.a.Shader.import(l.a);var h={repulsionByDegree:!0,linLogMode:!1,strongGravityMode:!1,gravity:1,scaling:1,edgeWeightInfluence:1,jitterTolerence:.1,preventOverlap:!1,dissuadeHubs:!1,gravityCenter:null};n.prototype.updateOption=function(e){for(var t in h)this[t]=h[t];var r=this._nodes.length;if(this.jitterTolerence=5e4e},n.prototype._swapTexture=function(){var e=this._positionPrevTex;this._positionPrevTex=this._positionTex,this._positionTex=e;e=this._forcePrevTex;this._forcePrevTex=this._forceTex,this._forceTex=e;e=this._globalSpeedPrevTex;this._globalSpeedPrevTex=this._globalSpeedTex,this._globalSpeedTex=e},n.prototype._initFromSource=function(e){this._framebuffer.attach(this._positionPrevTex),this._framebuffer.bind(e),this._copyPass.setUniform("texture",this._positionSourceTex),this._copyPass.render(e),e.gl.clearColor(0,0,0,0),this._framebuffer.attach(this._forcePrevTex),e.gl.clear(e.gl.COLOR_BUFFER_BIT),this._framebuffer.attach(this._globalSpeedPrevTex),e.gl.clear(e.gl.COLOR_BUFFER_BIT),this._framebuffer.unbind(e)},n.prototype._resize=function(t,r){["_positionSourceTex","_positionTex","_positionPrevTex","_forceTex","_forcePrevTex"].forEach(function(e){this[e].width=t,this[e].height=r,this[e].dirty()},this)},n.prototype.dispose=function(e){this._framebuffer.dispose(e),this._copyPass.dispose(e),this._nodeRepulsionPass.dispose(e),this._positionPass.dispose(e),this._globalSpeedPass.dispose(e),this._edgeForceMesh.geometry.dispose(e),this._weightedSumMesh.geometry.dispose(e),this._positionSourceTex.dispose(e),this._positionTex.dispose(e),this._positionPrevTex.dispose(e),this._forceTex.dispose(e),this._forcePrevTex.dispose(e),this._weightedSumTex.dispose(e),this._globalSpeedTex.dispose(e),this._globalSpeedPrevTex.dispose(e)},a.a.ForceAtlas2GPU=n,t.a=n},function(e,t,r){"use strict";t.a="@export ecgl.forceAtlas2.updateNodeRepulsion\n\n#define NODE_COUNT 0\n\nuniform sampler2D positionTex;\n\nuniform vec2 textureSize;\nuniform float gravity;\nuniform float scaling;\nuniform vec2 gravityCenter;\n\nuniform bool strongGravityMode;\nuniform bool preventOverlap;\n\nvarying vec2 v_Texcoord;\n\nvoid main() {\n\n vec4 n0 = texture2D(positionTex, v_Texcoord);\n\n vec2 force = vec2(0.0);\n for (int i = 0; i < NODE_COUNT; i++) {\n vec2 uv = vec2(\n mod(float(i), textureSize.x) / (textureSize.x - 1.0),\n floor(float(i) / textureSize.x) / (textureSize.y - 1.0)\n );\n vec4 n1 = texture2D(positionTex, uv);\n\n vec2 dir = n0.xy - n1.xy;\n float d2 = dot(dir, dir);\n\n if (d2 > 0.0) {\n float factor = 0.0;\n if (preventOverlap) {\n float d = sqrt(d2);\n d = d - n0.w - n1.w;\n if (d > 0.0) {\n factor = scaling * n0.z * n1.z / (d * d);\n }\n else if (d < 0.0) {\n factor = scaling * 100.0 * n0.z * n1.z;\n }\n }\n else {\n factor = scaling * n0.z * n1.z / d2;\n }\n force += dir * factor;\n }\n }\n\n vec2 dir = gravityCenter - n0.xy;\n float d = 1.0;\n if (!strongGravityMode) {\n d = length(dir);\n }\n\n force += dir * n0.z * gravity / (d + 1.0);\n\n gl_FragColor = vec4(force, 0.0, 1.0);\n}\n@end\n\n@export ecgl.forceAtlas2.updateEdgeAttraction.vertex\n\nattribute vec2 node1;\nattribute vec2 node2;\nattribute float weight;\n\nuniform sampler2D positionTex;\nuniform float edgeWeightInfluence;\nuniform bool preventOverlap;\nuniform bool linLogMode;\n\nuniform vec2 windowSize: WINDOW_SIZE;\n\nvarying vec2 v_Force;\n\nvoid main() {\n\n vec4 n0 = texture2D(positionTex, node1);\n vec4 n1 = texture2D(positionTex, node2);\n\n vec2 dir = n1.xy - n0.xy;\n float d = length(dir);\n float w;\n if (edgeWeightInfluence == 0.0) {\n w = 1.0;\n }\n else if (edgeWeightInfluence == 1.0) {\n w = weight;\n }\n else {\n w = pow(weight, edgeWeightInfluence);\n }\n vec2 offset = vec2(1.0 / windowSize.x, 1.0 / windowSize.y);\n vec2 scale = vec2((windowSize.x - 1.0) / windowSize.x, (windowSize.y - 1.0) / windowSize.y);\n vec2 pos = node1 * scale * 2.0 - 1.0;\n gl_Position = vec4(pos + offset, 0.0, 1.0);\n gl_PointSize = 1.0;\n\n float factor;\n if (preventOverlap) {\n d = d - n1.w - n0.w;\n }\n if (d <= 0.0) {\n v_Force = vec2(0.0);\n return;\n }\n\n if (linLogMode) {\n factor = w * log(d) / d;\n }\n else {\n factor = w;\n }\n v_Force = dir * factor;\n}\n@end\n\n@export ecgl.forceAtlas2.updateEdgeAttraction.fragment\n\nvarying vec2 v_Force;\n\nvoid main() {\n gl_FragColor = vec4(v_Force, 0.0, 0.0);\n}\n@end\n\n@export ecgl.forceAtlas2.calcWeightedSum.vertex\n\nattribute vec2 node;\n\nvarying vec2 v_NodeUv;\n\nvoid main() {\n\n v_NodeUv = node;\n gl_Position = vec4(0.0, 0.0, 0.0, 1.0);\n gl_PointSize = 1.0;\n}\n@end\n\n@export ecgl.forceAtlas2.calcWeightedSum.fragment\n\nvarying vec2 v_NodeUv;\n\nuniform sampler2D positionTex;\nuniform sampler2D forceTex;\nuniform sampler2D forcePrevTex;\n\nvoid main() {\n vec2 force = texture2D(forceTex, v_NodeUv).rg;\n vec2 forcePrev = texture2D(forcePrevTex, v_NodeUv).rg;\n\n float mass = texture2D(positionTex, v_NodeUv).z;\n float swing = length(force - forcePrev) * mass;\n float traction = length(force + forcePrev) * 0.5 * mass;\n\n gl_FragColor = vec4(swing, traction, 0.0, 0.0);\n}\n@end\n\n@export ecgl.forceAtlas2.calcGlobalSpeed\n\nuniform sampler2D globalSpeedPrevTex;\nuniform sampler2D weightedSumTex;\nuniform float jitterTolerence;\n\nvoid main() {\n vec2 weightedSum = texture2D(weightedSumTex, vec2(0.5)).xy;\n float prevGlobalSpeed = texture2D(globalSpeedPrevTex, vec2(0.5)).x;\n float globalSpeed = jitterTolerence * jitterTolerence\n * weightedSum.y / weightedSum.x;\n if (prevGlobalSpeed > 0.0) {\n globalSpeed = min(globalSpeed / prevGlobalSpeed, 1.5) * prevGlobalSpeed;\n }\n gl_FragColor = vec4(globalSpeed, 0.0, 0.0, 1.0);\n}\n@end\n\n@export ecgl.forceAtlas2.updatePosition\n\nuniform sampler2D forceTex;\nuniform sampler2D forcePrevTex;\nuniform sampler2D positionTex;\nuniform sampler2D globalSpeedTex;\n\nvarying vec2 v_Texcoord;\n\nvoid main() {\n vec2 force = texture2D(forceTex, v_Texcoord).xy;\n vec2 forcePrev = texture2D(forcePrevTex, v_Texcoord).xy;\n vec4 node = texture2D(positionTex, v_Texcoord);\n\n float globalSpeed = texture2D(globalSpeedTex, vec2(0.5)).r;\n float swing = length(force - forcePrev);\n float speed = 0.1 * globalSpeed / (0.1 + globalSpeed * sqrt(swing));\n\n float df = length(force);\n if (df > 0.0) {\n speed = min(df * speed, 10.0) / df;\n\n gl_FragColor = vec4(node.xy + speed * force, node.zw);\n }\n else {\n gl_FragColor = node;\n }\n}\n@end\n\n@export ecgl.forceAtlas2.edges.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nattribute vec2 node;\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n\nuniform sampler2D positionTex;\n\nvoid main()\n{\n gl_Position = worldViewProjection * vec4(\n texture2D(positionTex, node).xy, -10.0, 1.0\n );\n v_Color = a_Color;\n}\n@end\n\n@export ecgl.forceAtlas2.edges.fragment\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\nvarying vec4 v_Color;\nvoid main() {\n gl_FragColor = color * v_Color;\n}\n@end"},function(e,t,r){"use strict";function n(e){for(var t in c)this[t]=c[t];if(e)for(var t in e)this[t]=e[t];this._nodes=[],this._edges=[],this._disposed=!1,this._positionTex=new i.a({type:a.a.FLOAT,flipY:!1,minFilter:a.a.NEAREST,magFilter:a.a.NEAREST})}var i=r(5),a=r(4),o=r(272),x=(x=o.a.toString()).slice(x.indexOf("{")+1,x.lastIndexOf("}")),c={barnesHutOptimize:!0,barnesHutTheta:1.5,repulsionByDegree:!0,linLogMode:!1,strongGravityMode:!1,gravity:1,scaling:1,edgeWeightInfluence:1,jitterTolerence:.1,preventOverlap:!1,dissuadeHubs:!1,gravityCenter:null};n.prototype.initData=function(e,t){var r=new Blob([x]),n=window.URL.createObjectURL(r);this._worker=new Worker(n),this._worker.onmessage=this._$onupdate.bind(this),this._nodes=e,this._edges=t,this._frame=0;for(var i=e.length,a=t.length,o=new Float32Array(2*i),s=new Float32Array(i),u=new Float32Array(i),l=new Float32Array(2*a),h=new Float32Array(a),c=0;ce},n.prototype.getNodePosition=function(e,t){if(t=t||new Float32Array(2*this._nodes.length),this._positionArr)for(var r=0;r=e&&this.bbox[1]<=t&&this.bbox[3]>=t},e.setBBox=function(e,t,r,n){this.bbox[0]=e,this.bbox[1]=t,this.bbox[2]=r,this.bbox[3]=n,this.size=(r-e+n-t)/2},e._newSubRegion=function(){var e=this.subRegions[this.nSubRegions];return e||(e=new t,this.subRegions[this.nSubRegions]=e),this.nSubRegions++,e},e._addNodeToSubRegion=function(e){var t,r,n,i,a,o,s=this.findSubRegion(e.position[0],e.position[1]),u=this.bbox;s||(t=(u[0]+u[2])/2,r=(u[1]+u[3])/2,n=(u[2]-u[0])/2,i=(u[3]-u[1])/2,a=e.position[0]>=t?1:0,o=e.position[1]>=r?1:0,(s=this._newSubRegion()).setBBox(a*n+u[0],o*i+u[1],(1+a)*n+u[0],(1+o)*i+u[1])),s.addNode(e)},e._updateCenterOfMass=function(e){null==this.centerOfMass&&(this.centerOfMass=new Float32Array(2));var t=this.centerOfMass[0]*this.mass,r=this.centerOfMass[1]*this.mass;t+=e.position[0]*e.mass,r+=e.position[1]*e.mass,this.mass+=e.mass,this.centerOfMass[0]=t/this.mass,this.centerOfMass[1]=r/this.mass};var r,n,o,h,a,i=u.prototype;i.initNodes=function(e,t,r){for(var n=t.length,i=void(this.nodes.length=0)!==r,a=0;athis.barnesHutTheta*e.size*e.size){var n=this.scaling*t.mass*e.mass/r;f.scaleAndAdd(t.force,t.force,a,n)}else for(var i=0;i