XWWitPark/witpark_jzzs/xw_jzzs_web/public/lib/echarts/echarts-gl.min.js
2024-09-12 08:10:00 +08:00

2 lines
653 KiB
JavaScript

/* 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<i.length;o++)a+=i[o]+"_"+r[i[o]]+"_";var s,u=t.__textureCache=t.__textureCache||new v.a(20);if((s=e).getZr&&s.setOption){var l=e.__textureid__;if(c=u.get(a+l))c.texture.surface.setECharts(e),n&&n(c.texture);else{var h=new x.a(e);h.onupdate=function(){t.getZr().refresh()},c={texture:h.getTexture()};for(o=0;o<i.length;o++)c.texture[i[o]]=r[i[o]];l=e.__textureid__||"__ecgl_ec__"+c.texture.__uid__,e.__textureid__=l,u.put(a+l,c),n&&n(c.texture)}return c.texture}if(p(e)){var c,l=e.__textureid__;if(!(c=u.get(a+l))){c={texture:new ne.Texture2D({image:e})};for(o=0;o<i.length;o++)c.texture[i[o]]=r[i[o]];l=e.__textureid__||"__ecgl_image__"+c.texture.__uid__,e.__textureid__=l,u.put(a+l,c),m(c.texture),n&&n(c.texture)}return c.texture}if(c=u.get(a+e))c.callbacks?c.callbacks.push(n):n&&n(c.texture);else if(e.match(/.hdr$|^data:application\/octet-stream/)){c={callbacks:[n]};var d=y.a.loadTexture(e,{exposure:r.exposure,fileType:"hdr"},function(){d.dirty(),c.callbacks.forEach(function(e){e&&e(d)}),c.callbacks=null});c.texture=d,u.put(a+e,c)}else{for(d=new ne.Texture2D({image:new Image}),o=0;o<i.length;o++)d[i[o]]=r[i[o]];c={texture:d,callbacks:[n]};var f=d.image;f.onload=function(){d.image=f,m(d),d.dirty(),c.callbacks.forEach(function(e){e&&e(d)}),c.callbacks=null},f.src=e,d.image=ie,u.put(a+e,c)}return c.texture},ne.createAmbientCubemap=function(e,t,r,n){var i=(e=e||{}).texture,a=E.a.firstNotNull(e.exposure,1),o=new T.a({intensity:E.a.firstNotNull(e.specularIntensity,1)}),s=new b.a({intensity:E.a.firstNotNull(e.diffuseIntensity,1),coefficients:[.844,.712,.691,-.037,.083,.167,.343,.288,.299,-.041,-.021,-.009,-.003,-.041,-.064,-.011,-.007,-.004,-.031,.034,.081,-.06,-.049,-.06,.046,.056,.05]});return o.cubemap=ne.loadTexture(i,r,{exposure:a},function(){o.cubemap.flipY=!1,o.prefilter(t,32),s.coefficients=w.a.projectEnvironmentMap(t,o.cubemap,{lod:1}),n&&n()}),{specular:o,diffuse:s}},ne.createBlankTexture=y.a.createBlank,ne.isImage=p,ne.additiveBlend=function(e){e.blendEquation(e.FUNC_ADD),e.blendFunc(e.SRC_ALPHA,e.ONE)},ne.parseColor=function(e,t){return e instanceof Array?((t=t||[])[0]=e[0],t[1]=e[1],t[2]=e[2],3<e.length?t[3]=e[3]:t[3]=1):((t=f.a.color.parse(e||"#000",t)||[0,0,0,0])[0]/=255,t[1]/=255,t[2]/=255),t},ne.directionFromAlphaBeta=function(e,t){var r=e/180*Math.PI+Math.PI/2,n=-t/180*Math.PI+Math.PI/2,i=[],a=Math.sin(r);return i[0]=a*Math.cos(n),i[1]=-Math.cos(r),i[2]=a*Math.sin(n),i},ne.getShadowResolution=function(e){var t=1024;switch(e){case"low":t=512;break;case"medium":break;case"high":t=2048;break;case"ultra":t=4096}return t},ne.COMMON_SHADERS=["lambert","color","realistic","hatching"],ne.createShader=function(e){var t=u.a.source(e+".vertex"),r=u.a.source(e+".fragment");t||console.error("Vertex shader of '%s' not exits",e),r||console.error("Fragment shader of '%s' not exits",e);var n=new u.a(t,r);return n.name=e,n},ne.createMaterial=function(e,t){t instanceof Array||(t=[t]);var r=ne.createShader(e),n=new l.a({shader:r});return t.forEach(function(e){"string"==typeof e&&n.define(e)}),n},ne.setMaterialFromModel=function(e,t,r,n){t.autoUpdateTextureStatus=!1;var i=r.getModel(e+"Material"),a=i.get("detailTexture"),o=E.a.firstNotNull(i.get("textureTiling"),1),s=E.a.firstNotNull(i.get("textureOffset"),0);"number"==typeof o&&(o=[o,o]),"number"==typeof s&&(s=[s,s]);var u=1<o[0]||1<o[1]?ne.Texture.REPEAT:ne.Texture.CLAMP_TO_EDGE,l={anisotropic:8,wrapS:u,wrapT:u};if("realistic"===e){var h=i.get("roughness"),c=i.get("metalness");null!=c?isNaN(c)&&(t.setTextureImage("metalnessMap",c,n,l),c=E.a.firstNotNull(i.get("metalnessAdjust"),.5)):c=0,null!=h?isNaN(h)&&(t.setTextureImage("roughnessMap",h,n,l),h=E.a.firstNotNull(i.get("roughnessAdjust"),.5)):h=.5;var d=i.get("normalTexture");t.setTextureImage("detailMap",a,n,l),t.setTextureImage("normalMap",d,n,l),t.set({roughness:h,metalness:c,detailUvRepeat:o,detailUvOffset:s})}else if("lambert"===e)t.setTextureImage("detailMap",a,n,l),t.set({detailUvRepeat:o,detailUvOffset:s});else if("color"===e)t.setTextureImage("detailMap",a,n,l),t.set({detailUvRepeat:o,detailUvOffset:s});else if("hatching"===e){for(var f=i.get("hatchingTextures")||[],p=0;p<6;p++)t.setTextureImage("hatch"+(p+1),f[p],n,{anisotropic:8,wrapS:ne.Texture.REPEAT,wrapT:ne.Texture.REPEAT});t.set({detailUvRepeat:o,detailUvOffset:s})}},ne.updateVertexAnimation=function(e,t,r,n){var i=n.get("animation"),a=n.get("animationDurationUpdate"),o=n.get("animationEasingUpdate"),s=r.shadowDepthMaterial;if(i&&t&&0<a&&t.geometry.vertexCount===r.geometry.vertexCount){r.material.define("vertex","VERTEX_ANIMATION"),r.ignorePreZ=!0,s&&s.define("vertex","VERTEX_ANIMATION");for(var u=0;u<e.length;u++)r.geometry.attributes[e[u][0]].value=t.geometry.attributes[e[u][1]].value;r.geometry.dirty(),r.__percent=0,r.material.set("percent",0),r.stopAnimation(),r.animate().when(a,{__percent:1}).during(function(){r.material.set("percent",r.__percent),s&&s.set("percent",r.__percent)}).done(function(){r.ignorePreZ=!1,r.material.undefine("vertex","VERTEX_ANIMATION"),s&&s.undefine("vertex","VERTEX_ANIMATION")}).start(o)}else r.material.undefine("vertex","VERTEX_ANIMATION"),s&&s.undefine("vertex","VERTEX_ANIMATION")},t.a=ne},function(e,t,r){"use strict";var n=r(0),i=r.n(n),a={firstNotNull:function(){for(var e=0,t=arguments.length;e<t;e++)if(null!=arguments[e])return arguments[e]},queryDataIndex:function(t,e){return null!=e.dataIndexInside?e.dataIndexInside:null!=e.dataIndex?i.a.util.isArray(e.dataIndex)?i.a.util.map(e.dataIndex,function(e){return t.indexOfRawIndex(e)}):t.indexOfRawIndex(e.dataIndex):null!=e.name?i.a.util.isArray(e.name)?i.a.util.map(e.name,function(e){return t.indexOfName(e)}):t.indexOfName(e.name):void 0}};t.a=a},function(e,t,r){"use strict";function p(e,t,r){return e<t?t:r<e?r:e}function n(e,t,r){e=e||0,t=t||0,r=r||0,this.array=i.a.fromValues(e,t,r),this._dirty=!0}var i=r(12);n.prototype={constructor:n,add:function(e){return i.a.add(this.array,this.array,e.array),this._dirty=!0,this},set:function(e,t,r){return this.array[0]=e,this.array[1]=t,this.array[2]=r,this._dirty=!0,this},setArray:function(e){return this.array[0]=e[0],this.array[1]=e[1],this.array[2]=e[2],this._dirty=!0,this},clone:function(){return new n(this.x,this.y,this.z)},copy:function(e){return i.a.copy(this.array,e.array),this._dirty=!0,this},cross:function(e,t){return i.a.cross(this.array,e.array,t.array),this._dirty=!0,this},dist:function(e){return i.a.dist(this.array,e.array)},distance:function(e){return i.a.distance(this.array,e.array)},div:function(e){return i.a.div(this.array,this.array,e.array),this._dirty=!0,this},divide:function(e){return i.a.divide(this.array,this.array,e.array),this._dirty=!0,this},dot:function(e){return i.a.dot(this.array,e.array)},len:function(){return i.a.len(this.array)},length:function(){return i.a.length(this.array)},lerp:function(e,t,r){return i.a.lerp(this.array,e.array,t.array,r),this._dirty=!0,this},min:function(e){return i.a.min(this.array,this.array,e.array),this._dirty=!0,this},max:function(e){return i.a.max(this.array,this.array,e.array),this._dirty=!0,this},mul:function(e){return i.a.mul(this.array,this.array,e.array),this._dirty=!0,this},multiply:function(e){return i.a.multiply(this.array,this.array,e.array),this._dirty=!0,this},negate:function(){return i.a.negate(this.array,this.array),this._dirty=!0,this},normalize:function(){return i.a.normalize(this.array,this.array),this._dirty=!0,this},random:function(e){return i.a.random(this.array,e),this._dirty=!0,this},scale:function(e){return i.a.scale(this.array,this.array,e),this._dirty=!0,this},scaleAndAdd:function(e,t){return i.a.scaleAndAdd(this.array,this.array,e.array,t),this._dirty=!0,this},sqrDist:function(e){return i.a.sqrDist(this.array,e.array)},squaredDistance:function(e){return i.a.squaredDistance(this.array,e.array)},sqrLen:function(){return i.a.sqrLen(this.array)},squaredLength:function(){return i.a.squaredLength(this.array)},sub:function(e){return i.a.sub(this.array,this.array,e.array),this._dirty=!0,this},subtract:function(e){return i.a.subtract(this.array,this.array,e.array),this._dirty=!0,this},transformMat3:function(e){return i.a.transformMat3(this.array,this.array,e.array),this._dirty=!0,this},transformMat4:function(e){return i.a.transformMat4(this.array,this.array,e.array),this._dirty=!0,this},transformQuat:function(e){return i.a.transformQuat(this.array,this.array,e.array),this._dirty=!0,this},applyProjection:function(e){var t,r=this.array;return 0===(e=e.array)[15]?(t=-1/r[2],r[0]=e[0]*r[0]*t,r[1]=e[5]*r[1]*t,r[2]=(e[10]*r[2]+e[14])*t):(r[0]=e[0]*r[0]+e[12],r[1]=e[5]*r[1]+e[13],r[2]=e[10]*r[2]+e[14]),this._dirty=!0,this},eulerFromQuat:function(e,t){n.eulerFromQuat(this,e,t)},eulerFromMat3:function(e,t){n.eulerFromMat3(this,e,t)},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var a,o=Object.defineProperty;o&&(o(a=n.prototype,"x",{get:function(){return this.array[0]},set:function(e){this.array[0]=e,this._dirty=!0}}),o(a,"y",{get:function(){return this.array[1]},set:function(e){this.array[1]=e,this._dirty=!0}}),o(a,"z",{get:function(){return this.array[2]},set:function(e){this.array[2]=e,this._dirty=!0}})),n.add=function(e,t,r){return i.a.add(e.array,t.array,r.array),e._dirty=!0,e},n.set=function(e,t,r,n){i.a.set(e.array,t,r,n),e._dirty=!0},n.copy=function(e,t){return i.a.copy(e.array,t.array),e._dirty=!0,e},n.cross=function(e,t,r){return i.a.cross(e.array,t.array,r.array),e._dirty=!0,e},n.distance=n.dist=function(e,t){return i.a.distance(e.array,t.array)},n.divide=n.div=function(e,t,r){return i.a.divide(e.array,t.array,r.array),e._dirty=!0,e},n.dot=function(e,t){return i.a.dot(e.array,t.array)},n.len=function(e){return i.a.length(e.array)},n.lerp=function(e,t,r,n){return i.a.lerp(e.array,t.array,r.array,n),e._dirty=!0,e},n.min=function(e,t,r){return i.a.min(e.array,t.array,r.array),e._dirty=!0,e},n.max=function(e,t,r){return i.a.max(e.array,t.array,r.array),e._dirty=!0,e},n.multiply=n.mul=function(e,t,r){return i.a.multiply(e.array,t.array,r.array),e._dirty=!0,e},n.negate=function(e,t){return i.a.negate(e.array,t.array),e._dirty=!0,e},n.normalize=function(e,t){return i.a.normalize(e.array,t.array),e._dirty=!0,e},n.random=function(e,t){return i.a.random(e.array,t),e._dirty=!0,e},n.scale=function(e,t,r){return i.a.scale(e.array,t.array,r),e._dirty=!0,e},n.scaleAndAdd=function(e,t,r,n){return i.a.scaleAndAdd(e.array,t.array,r.array,n),e._dirty=!0,e},n.squaredDistance=n.sqrDist=function(e,t){return i.a.sqrDist(e.array,t.array)},n.squaredLength=n.sqrLen=function(e){return i.a.sqrLen(e.array)},n.subtract=n.sub=function(e,t,r){return i.a.subtract(e.array,t.array,r.array),e._dirty=!0,e},n.transformMat3=function(e,t,r){return i.a.transformMat3(e.array,t.array,r.array),e._dirty=!0,e},n.transformMat4=function(e,t,r){return i.a.transformMat4(e.array,t.array,r.array),e._dirty=!0,e},n.transformQuat=function(e,t,r){return i.a.transformQuat(e.array,t.array,r.array),e._dirty=!0,e};var m=Math.atan2,g=Math.asin,_=Math.abs;n.eulerFromQuat=function(e,t,r){e._dirty=!0,t=t.array;var n=e.array,i=t[0],a=t[1],o=t[2],s=t[3],u=i*i,l=a*a,h=o*o,c=s*s;switch(r=(r||"XYZ").toUpperCase()){case"XYZ":n[0]=m(2*(i*s-a*o),c-u-l+h),n[1]=g(p(2*(i*o+a*s),-1,1)),n[2]=m(2*(o*s-i*a),c+u-l-h);break;case"YXZ":n[0]=g(p(2*(i*s-a*o),-1,1)),n[1]=m(2*(i*o+a*s),c-u-l+h),n[2]=m(2*(i*a+o*s),c-u+l-h);break;case"ZXY":n[0]=g(p(2*(i*s+a*o),-1,1)),n[1]=m(2*(a*s-o*i),c-u-l+h),n[2]=m(2*(o*s-i*a),c-u+l-h);break;case"ZYX":n[0]=m(2*(i*s+o*a),c-u-l+h),n[1]=g(p(2*(a*s-i*o),-1,1)),n[2]=m(2*(i*a+o*s),c+u-l-h);break;case"YZX":n[0]=m(2*(i*s-o*a),c-u+l-h),n[1]=m(2*(a*s-i*o),c+u-l-h),n[2]=g(p(2*(i*a+o*s),-1,1));break;case"XZY":n[0]=m(2*(i*s+a*o),c-u+l-h),n[1]=m(2*(i*o+a*s),c+u-l-h),n[2]=g(p(2*(o*s-i*a),-1,1));break;default:console.warn("Unkown order: "+r)}return e},n.eulerFromMat3=function(e,t,r){var n=t.array,i=n[0],a=n[3],o=n[6],s=n[1],u=n[4],l=n[7],h=n[2],c=n[5],d=n[8],f=e.array;switch(r=(r||"XYZ").toUpperCase()){case"XYZ":f[1]=g(p(o,-1,1)),_(o)<.99999?(f[0]=m(-l,d),f[2]=m(-a,i)):(f[0]=m(c,u),f[2]=0);break;case"YXZ":f[0]=g(-p(l,-1,1)),_(l)<.99999?(f[1]=m(o,d),f[2]=m(s,u)):(f[1]=m(-h,i),f[2]=0);break;case"ZXY":f[0]=g(p(c,-1,1)),_(c)<.99999?(f[1]=m(-h,d),f[2]=m(-a,u)):(f[1]=0,f[2]=m(s,i));break;case"ZYX":f[1]=g(-p(h,-1,1)),_(h)<.99999?(f[0]=m(c,d),f[2]=m(s,i)):(f[0]=0,f[2]=m(-a,u));break;case"YZX":f[2]=g(p(s,-1,1)),_(s)<.99999?(f[0]=m(-l,u),f[1]=m(-h,i)):(f[0]=0,f[1]=m(o,d));break;case"XZY":f[2]=g(-p(a,-1,1)),_(a)<.99999?(f[0]=m(c,u),f[1]=m(o,i)):(f[0]=m(-l,d),f[1]=0);break;default:console.warn("Unkown order: "+r)}return e._dirty=!0,e},Object.defineProperties(n,{POSITIVE_X:{get:function(){return new n(1,0,0)}},NEGATIVE_X:{get:function(){return new n(-1,0,0)}},POSITIVE_Y:{get:function(){return new n(0,1,0)}},NEGATIVE_Y:{get:function(){return new n(0,-1,0)}},POSITIVE_Z:{get:function(){return new n(0,0,1)}},NEGATIVE_Z:{get:function(){return new n(0,0,-1)}},UP:{get:function(){return new n(0,1,0)}},ZERO:{get:function(){return new n}}}),t.a=n},function(e,t,r){"use strict";var n=r(7),i=r(11),a=r(57),o=n.a.extend({width:512,height:512,type:i.a.UNSIGNED_BYTE,format:i.a.RGBA,wrapS:i.a.REPEAT,wrapT:i.a.REPEAT,minFilter:i.a.LINEAR_MIPMAP_LINEAR,magFilter:i.a.LINEAR,useMipmap:!0,anisotropic:1,flipY:!0,sRGB:!0,unpackAlignment:4,premultiplyAlpha:!1,dynamic:!1,NPOT:!1,__used:0},function(){this._cache=new a.a},{getWebGLTexture:function(e){var t=e.gl,r=this._cache;return r.use(e.__uid__),r.miss("webgl_texture")&&r.put("webgl_texture",t.createTexture()),this.dynamic?this.update(e):r.isDirty()&&(this.update(e),r.fresh()),r.get("webgl_texture")},bind:function(){},unbind:function(){},dirty:function(){this._cache&&this._cache.dirtyAll()},update:function(){},updateCommon:function(e){var t=e.gl;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,this.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,this.unpackAlignment),this.format===i.a.DEPTH_COMPONENT&&(this.useMipmap=!1);var r=e.getGLExtension("EXT_sRGB");this.format!==o.SRGB||r||(this.format=o.RGB),this.format!==o.SRGB_ALPHA||r||(this.format=o.RGBA),this.NPOT=!this.isPowerOfTwo()},getAvailableWrapS:function(){return this.NPOT?i.a.CLAMP_TO_EDGE:this.wrapS},getAvailableWrapT:function(){return this.NPOT?i.a.CLAMP_TO_EDGE:this.wrapT},getAvailableMinFilter:function(){var e=this.minFilter;return this.NPOT||!this.useMipmap?e===i.a.NEAREST_MIPMAP_NEAREST||e===i.a.NEAREST_MIPMAP_LINEAR?i.a.NEAREST:e===i.a.LINEAR_MIPMAP_LINEAR||e===i.a.LINEAR_MIPMAP_NEAREST?i.a.LINEAR:e:e},getAvailableMagFilter:function(){return this.magFilter},nextHighestPowerOfTwo:function(e){--e;for(var t=1;t<32;t<<=1)e|=e>>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<this.anisotropic&&t.texParameterf(t.TEXTURE_2D,a.TEXTURE_MAX_ANISOTROPY_EXT,this.anisotropic),36193===n&&(e.getGLExtension("OES_texture_half_float")||(n=h.a.FLOAT)),this.mipmaps.length)for(var o=this.width,s=this.height,u=0;u<this.mipmaps.length;u++){var l=this.mipmaps[u];this._updateTextureData(t,l,u,o,s,r,n,!1),o/=2,s/=2}else this._updateTextureData(t,this,0,this.width,this.height,r,n,i),!this.useMipmap||this.NPOT&&!i||t.generateMipmap(t.TEXTURE_2D);t.bindTexture(t.TEXTURE_2D,null)},_updateTextureData:function(e,t,r,n,i,a,o,s){var u,l,h,c,d;t.image?(u=t.image,s&&(this._potCanvas=(h=(l=this)._potCanvas,c=f(l.width),d=f(l.height),(h=h||document.createElement("canvas")).width=c,h.height=d,h.getContext("2d").drawImage(l.image,0,0,c,d),h),u=this._potCanvas),e.texImage2D(e.TEXTURE_2D,r,a,a,o,u)):a<=p.a.COMPRESSED_RGBA_S3TC_DXT5_EXT&&a>=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;r<e;r++)t[r]=0;return t}function i(e){return e.replace(/[ \t]*\/\/.*\n/g,"").replace(/[ \t]*\/\*[\s\S]*?\*\//g,"")}function f(){console.error("Wrong uniform/attributes syntax")}function p(e,t){function r(e){e||f();var t=e.match(/\[(.*?)\]/);s=e.replace(/\[(.*?)\]/,""),l[s]={},t&&(l[s].isArray=!0,l[s].arraySize=t[1])}for(var n=/[,=\(\):]/,i=t.replace(/:\s*\[\s*(.*)\s*\]/g,"="+e+"($1)").replace(/\s+/g,"").split(/(?=[,=\(\):])/g),a=[],o=0;o<i.length;o++)i[o].match(n)?a.push(i[o].charAt(0),i[o].slice(1)):a.push(i[o]);var s,u=0,l={},h=null;r((i=a)[0]);for(o=1;o<i.length;o++){var c,d=i[o];if(d)if("="!==d)if(":"!==d)if(","!==d)if(")"!==d)if("("!==d)if(0<=d.indexOf("vec")){if(1!==u&&4!==u){f();break}u=2,h=[]}else{1!==u?4!==u?(r(d),u=0):(c=d,0<=_.indexOf(c)||0<=v.indexOf(c)||0<=y.indexOf(c)?l[s].semantic=c:"ignore"===c||"unconfigurable"===c?l[s].ignore=!0:l[s].value="bool"===e?"true"===c:parseFloat(c)):(l[s].value="bool"===e?"true"===d:parseFloat(d),h=null)}else{if(2!==u){f();break}if(!(h instanceof Array)){f();break}h.push(+i[++o])}else l[s].value=new m.a.Float32Array(h),h=null,u=5;else if(2===u){if(!(h instanceof Array)){f();break}h.push(+i[++o])}else u=5;else u=4;else{if(0!==u&&3!==u){f();break}u=1}}return l}function u(e,t){"object"==_typeof(e)&&(t=e.fragment,e=e.vertex),e=i(e),t=i(t),this._shaderID=function(e,t){var r="vertex:"+e+"fragment:"+t;if(d[r])return d[r];var n=a.a.genGUID();return d[r]=n,x[n]={vertex:e,fragment:t},n}(e,t),this._vertexCode=u.parseImport(e),this._fragmentCode=u.parseImport(t),this.attributeSemantics={},this.matrixSemantics={},this.uniformSemantics={},this.matrixSemanticKeys=[],this.uniformTemplates={},this.attributes={},this.textures={},this.vertexDefines={},this.fragmentDefines={},this._parseAttributes(),this._parseUniforms(),this._parseDefines()}var a=r(23),m=r(14),o=/uniform\s+(bool|float|int|vec2|vec3|vec4|ivec2|ivec3|ivec4|mat2|mat3|mat4|sampler2D|samplerCube)\s+([\s\S]*?);/g,s=/attribute\s+(float|int|vec2|vec3|vec4)\s+([\s\S]*?);/g,l=/#define\s+(\w+)?(\s+[\d-.]+)?\s*;?\s*\n/g,g={bool:"1i",int:"1i",sampler2D:"t",samplerCube:"t",float:"1f",vec2:"2f",vec3:"3f",vec4:"4f",ivec2:"2i",ivec3:"3i",ivec4:"4i",mat2:"m2",mat3:"m3",mat4:"m4"},h={bool:function(){return!0},int:function(){return 0},float:function(){return 0},sampler2D:function(){return null},samplerCube:function(){return null},vec2:function(){return n(2)},vec3:function(){return n(3)},vec4:function(){return n(4)},ivec2:function(){return n(2)},ivec3:function(){return n(3)},ivec4:function(){return n(4)},mat2:function(){return n(4)},mat3:function(){return n(9)},mat4:function(){return n(16)},array:function(){return[]}},_=["POSITION","NORMAL","BINORMAL","TANGENT","TEXCOORD","TEXCOORD_0","TEXCOORD_1","COLOR","JOINT","WEIGHT"],v=["SKIN_MATRIX","VIEWPORT_SIZE","VIEWPORT","DEVICEPIXELRATIO","WINDOW_SIZE","NEAR","FAR","TIME"],y=["WORLD","VIEW","PROJECTION","WORLDVIEW","VIEWPROJECTION","WORLDVIEWPROJECTION","WORLDINVERSE","VIEWINVERSE","PROJECTIONINVERSE","WORLDVIEWINVERSE","VIEWPROJECTIONINVERSE","WORLDVIEWPROJECTIONINVERSE","WORLDTRANSPOSE","VIEWTRANSPOSE","PROJECTIONTRANSPOSE","WORLDVIEWTRANSPOSE","VIEWPROJECTIONTRANSPOSE","WORLDVIEWPROJECTIONTRANSPOSE","WORLDINVERSETRANSPOSE","VIEWINVERSETRANSPOSE","PROJECTIONINVERSETRANSPOSE","WORLDVIEWINVERSETRANSPOSE","VIEWPROJECTIONINVERSETRANSPOSE","WORLDVIEWPROJECTIONINVERSETRANSPOSE"],c={vec4:4,vec3:3,vec2:2,float:1},d={},x={};u.prototype={constructor:u,createUniforms:function(){var e,t={};for(e in this.uniformTemplates){var r=this.uniformTemplates[e];t[e]={type:r.type,value:r.value()}}return t},_parseImport:function(){this._vertexCode=u.parseImport(this.vertex),this._fragmentCode=u.parseImport(this.fragment)},_addSemanticUniform:function(e,t,r){var n,i;0<=_.indexOf(r)?this.attributeSemantics[r]={symbol:e,type:t}:0<=y.indexOf(r)?(n=!1,(i=r).match(/TRANSPOSE$/)&&(n=!0,i=r.slice(0,-9)),this.matrixSemantics[r]={symbol:e,type:t,isTranspose:n,semanticNoTranspose:i}):0<=v.indexOf(r)&&(this.uniformSemantics[r]={symbol:e,type:t})},_addMaterialUniform:function(e,t,r,n,i,a){a[e]={type:r,value:i?h.array:n||h[t],semantic:null}},_parseUniforms:function(){function e(e,t,r){var n,i=p(t,r),a=[];for(n in i){var o=i[n],s=o.semantic,u=n,l=g[t],h=function(e){return null!=e?function(){return e}:null}(i[n].value);i[n].isArray&&(u+="["+i[n].arraySize+"]",l+="v"),a.push(u),d._uniformList.push(n),o.ignore||("sampler2D"!==t&&"samplerCube"!==t||(d.textures[n]={shaderType:f,type:t}),s?d._addSemanticUniform(n,l,s):d._addMaterialUniform(n,t,l,h,i[n].isArray,c))}return 0<a.length?"uniform "+t+" "+a.join(",")+";\n":""}var c={},d=this,f="vertex";this._uniformList=[],this._vertexCode=this._vertexCode.replace(o,e),f="fragment",this._fragmentCode=this._fragmentCode.replace(o,e),d.matrixSemanticKeys=Object.keys(this.matrixSemantics),this.uniformTemplates=c},_parseAttributes:function(){var u={},l=this;this._vertexCode=this._vertexCode.replace(s,function(e,t,r){var n,i=p(t,r),a=c[t]||1,o=[];for(n in i){var s=i[n].semantic;if(u[n]={type:"float",size:a,semantic:s||null},s){if(_.indexOf(s)<0)throw new Error('Unkown semantic "'+s+'"');l.attributeSemantics[s]={symbol:n,type:t}}o.push(n)}return"attribute "+t+" "+o.join(",")+";\n"}),this.attributes=u},_parseDefines:function(){function e(e,t,r){var n="vertex"===a?i.vertexDefines:i.fragmentDefines;return n[t]||(n[t]="false"!==r&&("true"===r||(r?isNaN(parseFloat(r))?r.trim():parseFloat(r):null))),""}var i=this,a="vertex";this._vertexCode=this._vertexCode.replace(l,e),a="fragment",this._fragmentCode=this._fragmentCode.replace(l,e)},clone:function(){var e=x[this._shaderID];return new u(e.vertex,e.fragment)}},Object.defineProperty&&(Object.defineProperty(u.prototype,"shaderID",{get:function(){return this._shaderID}}),Object.defineProperty(u.prototype,"vertex",{get:function(){return this._vertexCode}}),Object.defineProperty(u.prototype,"fragment",{get:function(){return this._fragmentCode}}),Object.defineProperty(u.prototype,"uniforms",{get:function(){return this._uniformList}}));var T=/(@import)\s*([0-9a-zA-Z_\-\.]*)/g;u.parseImport=function(e){return e.replace(T,function(e,t,r){return(e=u.source(r))?u.parseImport(e):(console.error('Shader chunk "'+r+'" not existed in library'),"")})};var b=/(@export)\s*([0-9a-zA-Z_\-\.]*)\s*\n([\s\S]*?)@end/g;u.import=function(e){e.replace(b,function(e,t,r,n){if(n=n.replace(/(^[\s\t\xa0\u3000]+)|([\u3000\xa0\s\t]+\x24)/g,"")){for(var i,a=r.split("."),o=u.codes,s=0;s<a.length-1;)o[i=a[s++]]||(o[i]={}),o=o[i];o[i=a[s]]=n}return n})},u.codes={},u.source=function(e){for(var t=e.split("."),r=u.codes,n=0;r&&n<t.length;)r=r[t[n++]];return"string"!=typeof r?(console.error('Shader "'+e+'" not existed in library'),""):r},t.a=u},function(e,t,r){"use strict";function n(){this._axisX=new i.a,this._axisY=new i.a,this._axisZ=new i.a,this.array=c.a.create(),this._dirty=!0}var s,u,l,h,c=r(21),d=r(12),f=r(55),p=r(34),i=r(3);n.prototype={constructor:n,setArray:function(e){for(var t=0;t<this.array.length;t++)this.array[t]=e[t];return this._dirty=!0,this},adjoint:function(){return c.a.adjoint(this.array,this.array),this._dirty=!0,this},clone:function(){return(new n).copy(this)},copy:function(e){return c.a.copy(this.array,e.array),this._dirty=!0,this},determinant:function(){return c.a.determinant(this.array)},fromQuat:function(e){return c.a.fromQuat(this.array,e.array),this._dirty=!0,this},fromRotationTranslation:function(e,t){return c.a.fromRotationTranslation(this.array,e.array,t.array),this._dirty=!0,this},fromMat2d:function(e){return n.fromMat2d(this,e),this},frustum:function(e,t,r,n,i,a){return c.a.frustum(this.array,e,t,r,n,i,a),this._dirty=!0,this},identity:function(){return c.a.identity(this.array),this._dirty=!0,this},invert:function(){return c.a.invert(this.array,this.array),this._dirty=!0,this},lookAt:function(e,t,r){return c.a.lookAt(this.array,e.array,t.array,r.array),this._dirty=!0,this},mul:function(e){return c.a.mul(this.array,this.array,e.array),this._dirty=!0,this},mulLeft:function(e){return c.a.mul(this.array,e.array,this.array),this._dirty=!0,this},multiply:function(e){return c.a.multiply(this.array,this.array,e.array),this._dirty=!0,this},multiplyLeft:function(e){return c.a.multiply(this.array,e.array,this.array),this._dirty=!0,this},ortho:function(e,t,r,n,i,a){return c.a.ortho(this.array,e,t,r,n,i,a),this._dirty=!0,this},perspective:function(e,t,r,n){return c.a.perspective(this.array,e,t,r,n),this._dirty=!0,this},rotate:function(e,t){return c.a.rotate(this.array,this.array,e,t.array),this._dirty=!0,this},rotateX:function(e){return c.a.rotateX(this.array,this.array,e),this._dirty=!0,this},rotateY:function(e){return c.a.rotateY(this.array,this.array,e),this._dirty=!0,this},rotateZ:function(e){return c.a.rotateZ(this.array,this.array,e),this._dirty=!0,this},scale:function(e){return c.a.scale(this.array,this.array,e.array),this._dirty=!0,this},translate:function(e){return c.a.translate(this.array,this.array,e.array),this._dirty=!0,this},transpose:function(){return c.a.transpose(this.array,this.array),this._dirty=!0,this},decomposeMatrix:(s=d.a.create(),u=d.a.create(),l=d.a.create(),h=p.a.create(),function(e,t,r){var n=this.array;d.a.set(s,n[0],n[1],n[2]),d.a.set(u,n[4],n[5],n[6]),d.a.set(l,n[8],n[9],n[10]);var i=d.a.length(s),a=d.a.length(u),o=d.a.length(l);this.determinant()<0&&(i=-i),e&&e.set(i,a,o),r.set(n[12],n[13],n[14]),p.a.fromMat4(h,n),h[0]/=i,h[1]/=i,h[2]/=i,h[3]/=a,h[4]/=a,h[5]/=a,h[6]/=o,h[7]/=o,h[8]/=o,f.a.fromMat3(t.array,h),f.a.normalize(t.array,t.array),t._dirty=!0,r._dirty=!0}),toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var a,o=Object.defineProperty;o&&(o(a=n.prototype,"z",{get:function(){var e=this.array;return this._axisZ.set(e[8],e[9],e[10]),this._axisZ},set:function(e){var t=this.array;e=e.array,t[8]=e[0],t[9]=e[1],t[10]=e[2],this._dirty=!0}}),o(a,"y",{get:function(){var e=this.array;return this._axisY.set(e[4],e[5],e[6]),this._axisY},set:function(e){var t=this.array;e=e.array,t[4]=e[0],t[5]=e[1],t[6]=e[2],this._dirty=!0}}),o(a,"x",{get:function(){var e=this.array;return this._axisX.set(e[0],e[1],e[2]),this._axisX},set:function(e){var t=this.array;e=e.array,t[0]=e[0],t[1]=e[1],t[2]=e[2],this._dirty=!0}})),n.adjoint=function(e,t){return c.a.adjoint(e.array,t.array),e._dirty=!0,e},n.copy=function(e,t){return c.a.copy(e.array,t.array),e._dirty=!0,e},n.determinant=function(e){return c.a.determinant(e.array)},n.identity=function(e){return c.a.identity(e.array),e._dirty=!0,e},n.ortho=function(e,t,r,n,i,a,o){return c.a.ortho(e.array,t,r,n,i,a,o),e._dirty=!0,e},n.perspective=function(e,t,r,n,i){return c.a.perspective(e.array,t,r,n,i),e._dirty=!0,e},n.lookAt=function(e,t,r,n){return c.a.lookAt(e.array,t.array,r.array,n.array),e._dirty=!0,e},n.invert=function(e,t){return c.a.invert(e.array,t.array),e._dirty=!0,e},n.multiply=n.mul=function(e,t,r){return c.a.mul(e.array,t.array,r.array),e._dirty=!0,e},n.fromQuat=function(e,t){return c.a.fromQuat(e.array,t.array),e._dirty=!0,e},n.fromRotationTranslation=function(e,t,r){return c.a.fromRotationTranslation(e.array,t.array,r.array),e._dirty=!0,e},n.fromMat2d=function(e,t){e._dirty=!0;t=t.array;return(e=e.array)[0]=t[0],e[4]=t[2],e[12]=t[4],e[1]=t[1],e[5]=t[3],e[13]=t[5],e},n.rotate=function(e,t,r,n){return c.a.rotate(e.array,t.array,r,n.array),e._dirty=!0,e},n.rotateX=function(e,t,r){return c.a.rotateX(e.array,t.array,r),e._dirty=!0,e},n.rotateY=function(e,t,r){return c.a.rotateY(e.array,t.array,r),e._dirty=!0,e},n.rotateZ=function(e,t,r){return c.a.rotateZ(e.array,t.array,r),e._dirty=!0,e},n.scale=function(e,t,r){return c.a.scale(e.array,t.array,r.array),e._dirty=!0,e},n.transpose=function(e,t){return c.a.transpose(e.array,t.array),e._dirty=!0,e},n.translate=function(e,t,r){return c.a.translate(e.array,t.array,r.array),e._dirty=!0,e},t.a=n},function(e,t,r){"use strict";var n=r(7),o=r(4),h=(r(27),r(11)),i=r(57),c=h.a.FRAMEBUFFER,d=h.a.RENDERBUFFER,f=h.a.DEPTH_ATTACHMENT,u=h.a.COLOR_ATTACHMENT0,a=n.a.extend({depthBuffer:!0,viewport:null,_width:0,_height:0,_textures:null,_boundRenderer:null},function(){this._cache=new i.a,this._textures={}},{getTextureWidth:function(){return this._width},getTextureHeight:function(){return this._height},bind:function(e){if(e.__currentFrameBuffer){if(e.__currentFrameBuffer===this)return;console.warn("Renderer already bound with another framebuffer. Unbind it first")}e.__currentFrameBuffer=this;var t=e.gl;t.bindFramebuffer(c,this._getFrameBufferGL(e)),this._boundRenderer=e;var r=this._cache;r.put("viewport",e.viewport);var n,i,a=!1;for(h in this._textures){a=!0;var o=this._textures[h];o&&(n=o.texture.width,i=o.texture.height,this._doAttach(e,o.texture,h,o.target))}this._width=n,this._height=i,!a&&this.depthBuffer&&console.error("Must attach texture before bind, or renderbuffer may have incorrect width and height."),this.viewport?e.setViewport(this.viewport):e.setViewport(0,0,n,i,1);var s,u,l=r.get("attached_textures");if(l)for(var h in l){this._textures[h]||(s=l[h],this._doDetach(t,h,s))}!r.get("depthtexture_attached")&&this.depthBuffer&&(r.miss("renderbuffer")&&r.put("renderbuffer",t.createRenderbuffer()),u=r.get("renderbuffer"),n===r.get("renderbuffer_width")&&i===r.get("renderbuffer_height")||(t.bindRenderbuffer(d,u),t.renderbufferStorage(d,t.DEPTH_COMPONENT16,n,i),r.put("renderbuffer_width",n),r.put("renderbuffer_height",i),t.bindRenderbuffer(d,null)),r.get("renderbuffer_attached")||(t.framebufferRenderbuffer(c,f,d,u),r.put("renderbuffer_attached",!0)))},unbind:function(e){e.__currentFrameBuffer=null,e.gl.bindFramebuffer(c,null),this._boundRenderer=null,this._cache.use(e.__uid__);var t=this._cache.get("viewport");t&&e.setViewport(t),this.updateMipmap(e)},updateMipmap:function(e){var t,r=e.gl;for(t in this._textures){var n,i,a=this._textures[t];!a||!(n=a.texture).NPOT&&n.useMipmap&&n.minFilter===o.a.LINEAR_MIPMAP_LINEAR&&(i="textureCube"===n.textureType?h.a.TEXTURE_CUBE_MAP:h.a.TEXTURE_2D,r.bindTexture(i,n.getWebGLTexture(e)),r.generateMipmap(i),r.bindTexture(i,null))}},checkStatus:function(e){return e.checkFramebufferStatus(c)},_getFrameBufferGL:function(e){var t=this._cache;return t.use(e.__uid__),t.miss("framebuffer")&&t.put("framebuffer",e.gl.createFramebuffer()),t.get("framebuffer")},attach:function(e,t,r){if(!e.width)throw new Error("The texture attached to color buffer is not a valid.");t=t||u,r=r||h.a.TEXTURE_2D;var n,i,a=this._boundRenderer;a&&a.gl&&((i=this._cache).use(a.__uid__),n=i.get("attached_textures"));var o,s=this._textures[t];s&&s.target===r&&s.texture===e&&n&&null!=n[t]||(o=!0,a&&(o=this._doAttach(a,e,t,r),this.viewport||a.setViewport(0,0,e.width,e.height,1)),o&&(this._textures[t]=this._textures[t]||{},this._textures[t].texture=e,this._textures[t].target=r))},_doAttach:function(e,t,r,n){var i=e.gl,a=t.getWebGLTexture(e),o=this._cache.get("attached_textures");if(o&&o[r]){var s=o[r];if(s.texture===t&&s.target===n)return}var u,l=!0;return(r=+r)!==f&&r!==h.a.DEPTH_STENCIL_ATTACHMENT||(e.getGLExtension("WEBGL_depth_texture")||(console.error("Depth texture is not supported by the browser"),l=!1),t.format!==h.a.DEPTH_COMPONENT&&t.format!==h.a.DEPTH_STENCIL&&(console.error("The texture attached to depth buffer is not a valid."),l=!1),l&&((u=this._cache.get("renderbuffer"))&&(i.framebufferRenderbuffer(c,f,d,null),i.deleteRenderbuffer(u),this._cache.put("renderbuffer",!1)),this._cache.put("renderbuffer_attached",!1),this._cache.put("depthtexture_attached",!0))),i.framebufferTexture2D(c,r,n,a,0),o||(o={},this._cache.put("attached_textures",o)),o[r]=o[r]||{},o[r].texture=t,o[r].target=n,l},_doDetach:function(e,t,r){e.framebufferTexture2D(c,t,r,null,0);var n=this._cache.get("attached_textures");n&&n[t]&&(n[t]=null),t!==f&&t!==h.a.DEPTH_STENCIL_ATTACHMENT||this._cache.put("depthtexture_attached",!1)},detach:function(e,t){this._textures[e]=null,this._boundRenderer&&(this._cache.use(this._boundRenderer.__uid__),this._doDetach(this._boundRenderer.gl,e,t))},dispose:function(e){var t=e.gl,r=this._cache;r.use(e.__uid__);var n=r.get("renderbuffer");n&&t.deleteRenderbuffer(n);var i=r.get("framebuffer");i&&t.deleteFramebuffer(i),r.deleteContext(e.__uid__),this._textures={}}});a.DEPTH_ATTACHMENT=f,a.COLOR_ATTACHMENT0=u,a.STENCIL_ATTACHMENT=h.a.STENCIL_ATTACHMENT,a.DEPTH_STENCIL_ATTACHMENT=h.a.DEPTH_STENCIL_ATTACHMENT,t.a=a},function(e,t,r){"use strict";t.a={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444}},function(e,t,r){"use strict";var u,a=r(20),o={create:function(){var e=new a.a(3);return e[0]=0,e[1]=0,e[2]=0,e},clone:function(e){var t=new a.a(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},fromValues:function(e,t,r){var n=new a.a(3);return n[0]=e,n[1]=t,n[2]=r,n},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},set:function(e,t,r,n){return e[0]=t,e[1]=r,e[2]=n,e},add:function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e},subtract:function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}};o.sub=o.subtract,o.multiply=function(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e},o.mul=o.multiply,o.divide=function(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e},o.div=o.divide,o.min=function(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e},o.max=function(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e},o.scale=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e},o.scaleAndAdd=function(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e},o.distance=function(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2];return Math.sqrt(r*r+n*n+i*i)},o.dist=o.distance,o.squaredDistance=function(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2];return r*r+n*n+i*i},o.sqrDist=o.squaredDistance,o.length=function(e){var t=e[0],r=e[1],n=e[2];return Math.sqrt(t*t+r*r+n*n)},o.len=o.length,o.squaredLength=function(e){var t=e[0],r=e[1],n=e[2];return t*t+r*r+n*n},o.sqrLen=o.squaredLength,o.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e},o.inverse=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e},o.normalize=function(e,t){var r=t[0],n=t[1],i=t[2],a=r*r+n*n+i*i;return 0<a&&(a=1/Math.sqrt(a),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a),e},o.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},o.cross=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],u=r[2];return e[0]=i*u-a*s,e[1]=a*o-n*u,e[2]=n*s-i*o,e},o.lerp=function(e,t,r,n){var i=t[0],a=t[1],o=t[2];return e[0]=i+n*(r[0]-i),e[1]=a+n*(r[1]-a),e[2]=o+n*(r[2]-o),e},o.random=function(e,t){t=t||1;var r=2*Object(a.c)()*Math.PI,n=2*Object(a.c)()-1,i=Math.sqrt(1-n*n)*t;return e[0]=Math.cos(r)*i,e[1]=Math.sin(r)*i,e[2]=n*t,e},o.transformMat4=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=(o=r[3]*n+r[7]*i+r[11]*a+r[15])||1;return e[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o,e[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,e[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,e},o.transformMat3=function(e,t,r){var n=t[0],i=t[1],a=t[2];return e[0]=n*r[0]+i*r[3]+a*r[6],e[1]=n*r[1]+i*r[4]+a*r[7],e[2]=n*r[2]+i*r[5]+a*r[8],e},o.transformQuat=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],u=r[2],l=r[3],h=l*n+s*a-u*i,c=l*i+u*n-o*a,d=l*a+o*i-s*n,f=-o*n-s*i-u*a;return e[0]=h*l+f*-o+c*-u-d*-s,e[1]=c*l+f*-s+d*-o-h*-u,e[2]=d*l+f*-u+h*-s-c*-o,e},o.rotateX=function(e,t,r,n){var i=[],a=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e},o.rotateY=function(e,t,r,n){var i=[],a=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e},o.rotateZ=function(e,t,r,n){var i=[],a=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e},o.forEach=(u=o.create(),function(e,t,r,n,i,a){var o,s;for(t=t||3,r=r||0,s=n?Math.min(n*t+r,e.length):e.length,o=r;o<s;o+=t)u[0]=e[o],u[1]=e[o+1],u[2]=e[o+2],i(u,u,a),e[o]=u[0],e[o+1]=u[1],e[o+2]=u[2];return e}),o.angle=function(e,t){var r=o.fromValues(e[0],e[1],e[2]),n=o.fromValues(t[0],t[1],t[2]);o.normalize(r,r),o.normalize(n,n);var i=o.dot(r,n);return 1<i?0:Math.acos(i)},t.a=o},function(e,t){function s(e){if(null==e||"object"!=_typeof(e))return e;var t=e,r=g.call(e);if("[object Array]"===r){if(!d(e)){t=[];for(var n=0,i=e.length;n<i;n++)t[n]=s(e[n])}}else if(m[r]){if(!d(e)){var a=e.constructor;if(e.constructor.from)t=a.from(e);else{t=new a(e.length);for(n=0,i=e.length;n<i;n++)t[n]=s(e[n])}}}else if(!p[r]&&!d(e)&&!c(e))for(var o in t={},e)e.hasOwnProperty(o)&&(t[o]=s(e[o]));return t}function o(e,t,r){if(!l(t)||!l(e))return r?s(t):e;for(var n in t){var i,a;t.hasOwnProperty(n)&&(i=e[n],!l(a=t[n])||!l(i)||u(a)||u(i)||c(a)||c(i)||h(a)||h(i)||d(a)||d(i)?!r&&n in e||(e[n]=s(t[n])):o(i,a,r))}return e}function n(e,t,r){for(var n in t)t.hasOwnProperty(n)&&(r?null!=t[n]:null==e[n])&&(e[n]=t[n]);return e}function i(e,t,r){if(e&&t)if(e.forEach&&e.forEach===v)e.forEach(t,r);else if(e.length===+e.length)for(var n=0,i=e.length;n<i;n++)t.call(r,e[n],n,e);else for(var a in e)e.hasOwnProperty(a)&&t.call(r,e[a],a,e)}function a(e,t){var r=x.call(arguments,2);return function(){return e.apply(t,r.concat(x.call(arguments)))}}function u(e){return"[object Array]"===g.call(e)}function l(e){var t=_typeof(e);return"function"===t||!!e&&"object"==t}function h(e){return!!p[g.call(e)]}function c(e){return"object"==_typeof(e)&&"number"==typeof e.nodeType&&"object"==_typeof(e.ownerDocument)}function d(e){return e[S]}function f(e){function t(e,t){r?n.set(e,t):n.set(t,e)}var r=u(e),n=this;e instanceof f?e.each(t):e&&i(e,t)}function r(){return w.createCanvas()}var p={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1,"[object CanvasPattern]":1,"[object Image]":1,"[object Canvas]":1},m={"[object Int8Array]":1,"[object Uint8Array]":1,"[object Uint8ClampedArray]":1,"[object Int16Array]":1,"[object Uint16Array]":1,"[object Int32Array]":1,"[object Uint32Array]":1,"[object Float32Array]":1,"[object Float64Array]":1},g=Object.prototype.toString,_=Array.prototype,v=_.forEach,y=_.filter,x=_.slice,T=_.map,b=_.reduce,w={};w.createCanvas=function(){return document.createElement("canvas")};var E,S="__ec_primitive__";f.prototype={constructor:f,get:function(e){return this.hasOwnProperty(e)?this[e]:null},set:function(e,t){return this[e]=t},each:function(e,t){for(var r in void 0!==t&&(e=a(e,t)),this)this.hasOwnProperty(r)&&e(this[r],r)},removeKey:function(e){delete this[e]}},t.$override=function(e,t){"createCanvas"===e&&(E=null),w[e]=t},t.clone=s,t.merge=o,t.mergeAll=function(e,t){for(var r=e[0],n=1,i=e.length;n<i;n++)r=o(r,e[n],t);return r},t.extend=function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e},t.defaults=n,t.createCanvas=r,t.getContext=function(){return E=E||r().getContext("2d")},t.indexOf=function(e,t){if(e){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r}return-1},t.inherits=function(e,t){function r(){}var n,i=e.prototype;for(n in r.prototype=t.prototype,e.prototype=new r,i)e.prototype[n]=i[n];(e.prototype.constructor=e).superClass=t},t.mixin=function(e,t,r){n(e="prototype"in e?e.prototype:e,t="prototype"in t?t.prototype:t,r)},t.isArrayLike=function(e){if(e)return"string"!=typeof e&&"number"==typeof e.length},t.each=i,t.map=function(e,t,r){if(e&&t){if(e.map&&e.map===T)return e.map(t,r);for(var n=[],i=0,a=e.length;i<a;i++)n.push(t.call(r,e[i],i,e));return n}},t.reduce=function(e,t,r,n){if(e&&t){if(e.reduce&&e.reduce===b)return e.reduce(t,r,n);for(var i=0,a=e.length;i<a;i++)r=t.call(n,r,e[i],i,e);return r}},t.filter=function(e,t,r){if(e&&t){if(e.filter&&e.filter===y)return e.filter(t,r);for(var n=[],i=0,a=e.length;i<a;i++)t.call(r,e[i],i,e)&&n.push(e[i]);return n}},t.find=function(e,t,r){if(e&&t)for(var n=0,i=e.length;n<i;n++)if(t.call(r,e[n],n,e))return e[n]},t.bind=a,t.curry=function(e){var t=x.call(arguments,1);return function(){return e.apply(this,t.concat(x.call(arguments)))}},t.isArray=u,t.isFunction=function(e){return"function"==typeof e},t.isString=function(e){return"[object String]"===g.call(e)},t.isObject=l,t.isBuiltInObject=h,t.isTypedArray=function(e){return!!m[g.call(e)]},t.isDom=c,t.eqNaN=function(e){return e!=e},t.retrieve=function(e){for(var t=0,r=arguments.length;t<r;t++)if(null!=arguments[t])return arguments[t]},t.retrieve2=function(e,t){return null!=e?e:t},t.retrieve3=function(e,t,r){return null!=e?e:null!=t?t:r},t.slice=function(){return Function.call.apply(x,arguments)},t.normalizeCssArray=function(e){if("number"==typeof e)return[e,e,e,e];var t=e.length;return 2===t?[e[0],e[1],e[0],e[1]]:3===t?[e[0],e[1],e[2],e[1]]:e},t.assert=function(e,t){if(!e)throw new Error(t)},t.trim=function(e){return null==e?null:"function"==typeof e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},t.setAsPrimitive=function(e){e[S]=!0},t.isPrimitive=d,t.createHashMap=function(e){return new f(e)},t.concatArray=function(e,t){for(var r=new e.constructor(e.length+t.length),n=0;n<e.length;n++)r[n]=e[n];for(var i=e.length,n=0;n<t.length;n++)r[n+i]=t[n];return r},t.noop=function(){}},function(e,a,o){"use strict";(function(e){var t,r=o(112),n={supportWebGL:function(){if(null==t)try{var e=document.createElement("canvas");if(!e.getContext("webgl")&&!e.getContext("experimental-webgl"))throw new Error}catch(e){t=!1}return t}};n.Int8Array="undefined"==typeof Int8Array?Array:Int8Array,n.Uint8Array="undefined"==typeof Uint8Array?Array:Uint8Array,n.Uint16Array="undefined"==typeof Uint16Array?Array:Uint16Array,n.Uint32Array="undefined"==typeof Uint32Array?Array:Uint32Array,n.Int16Array="undefined"==typeof Int16Array?Array:Int16Array,n.Float32Array="undefined"==typeof Float32Array?Array:Float32Array,n.Float64Array="undefined"==typeof Float64Array?Array:Float64Array;var i={};"undefined"!=typeof window?i=window:void 0!==e&&(i=e),n.requestAnimationFrame=i.requestAnimationFrame||i.msRequestAnimationFrame||i.mozRequestAnimationFrame||i.webkitRequestAnimationFrame||function(e){setTimeout(e,16)},n.createCanvas=function(){return document.createElement("canvas")},n.createImage=function(){return new i.Image},n.request={get:r.a.get},a.a=n}).call(a,o(68))},function(e,t,r){"use strict";var g=r(14),W=r(12),u=r(21),h=r(18),n=r(118),j=W.a.create,X=W.a.add,_=W.a.set,i=n.a.Attribute,a=n.a.extend(function(){return{attributes:{position:new i("position","float",3,"POSITION"),texcoord0:new i("texcoord0","float",2,"TEXCOORD_0"),texcoord1:new i("texcoord1","float",2,"TEXCOORD_1"),normal:new i("normal","float",3,"NORMAL"),tangent:new i("tangent","float",4,"TANGENT"),color:new i("color","float",4,"COLOR"),weight:new i("weight","float",3,"WEIGHT"),joint:new i("joint","float",4,"JOINT"),barycentric:new i("barycentric","float",3,null)},boundingBox:null}},{mainAttribute:"position",updateBoundingBox:function(){var e=(e=this.boundingBox)||(this.boundingBox=new h.a),t=this.attributes.position.value;if(t&&t.length){var r=e.min,n=e.max,i=r.array,a=n.array;W.a.set(i,t[0],t[1],t[2]),W.a.set(a,t[0],t[1],t[2]);for(var o=3;o<t.length;){var s=t[o++],u=t[o++],l=t[o++];s<i[0]&&(i[0]=s),u<i[1]&&(i[1]=u),l<i[2]&&(i[2]=l),s>a[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<n.length;i++)n[i]=0;else n=t.normal.value=new g.a.Float32Array(r.length);for(var a,o,s,u=j(),l=j(),h=j(),c=j(),d=j(),f=j(),p=e?e.length:this.vertexCount,m=0;m<p;){s=e?(a=e[m++],o=e[m++],e[m++]):(a=m++,o=m++,m++),_(u,r[3*a],r[3*a+1],r[3*a+2]),_(l,r[3*o],r[3*o+1],r[3*o+2]),_(h,r[3*s],r[3*s+1],r[3*s+2]),W.a.sub(c,u,l),W.a.sub(d,l,h),W.a.cross(f,c,d);for(i=0;i<3;i++)n[3*a+i]=n[3*a+i]+f[i],n[3*o+i]=n[3*o+i]+f[i],n[3*s+i]=n[3*s+i]+f[i]}for(i=0;i<n.length;)_(f,n[i],n[i+1],n[i+2]),W.a.normalize(f,f),n[i++]=f[0],n[i++]=f[1],n[i++]=f[2];this.dirty()}},generateFaceNormals:function(){if(this.vertexCount){this.isUniqueVertex()||this.generateUniqueVertex();for(var e,t,r,n=this.indices,i=this.attributes,a=i.position.value,o=i.normal.value,s=j(),u=j(),l=j(),h=j(),c=j(),d=j(),o=o||(i.normal.value=new Float32Array(a.length)),f=n?n.length:this.vertexCount,p=0;p<f;){r=n?(e=n[p++],t=n[p++],n[p++]):(e=p++,t=p++,p++),_(s,a[3*e],a[3*e+1],a[3*e+2]),_(u,a[3*t],a[3*t+1],a[3*t+2]),_(l,a[3*r],a[3*r+1],a[3*r+2]),W.a.sub(h,s,u),W.a.sub(c,u,l),W.a.cross(d,h,c),W.a.normalize(d,d);for(var m=0;m<3;m++)o[3*e+m]=d[m],o[3*t+m]=d[m],o[3*r+m]=d[m]}this.dirty()}},generateTangents:function(){if(this.vertexCount){var e=this.vertexCount,t=this.attributes;t.tangent.value||(t.tangent.value=new Float32Array(4*e));var r=t.texcoord0.value,n=t.position.value,i=t.tangent.value,a=t.normal.value;if(!r)return void console.warn("Geometry without texcoords can't generate tangents.");for(var o=[],s=[],u=0;u<e;u++)o[u]=[0,0,0],s[u]=[0,0,0];for(var l,h,c,d=[0,0,0],f=[0,0,0],p=this.indices,m=p?p.length:this.vertexCount,u=0;u<m;){c=p?(l=p[u++],h=p[u++],p[u++]):(l=u++,h=u++,u++);var g=r[2*l],_=r[2*h],v=r[2*c],y=r[2*l+1],x=r[2*h+1],T=r[2*c+1],b=n[3*l],w=n[3*h],E=n[3*c],S=n[3*l+1],A=n[3*h+1],M=n[3*c+1],C=n[3*l+2],L=w-b,D=E-b,N=A-S,R=M-S,P=n[3*h+2]-C,I=n[3*c+2]-C,O=_-g,F=v-g,B=x-y,U=T-y,z=1/(O*U-B*F);d[0]=(U*L-B*D)*z,d[1]=(U*N-B*R)*z,d[2]=(U*P-B*I)*z,f[0]=(O*D-F*L)*z,f[1]=(O*R-F*N)*z,f[2]=(O*I-F*P)*z,X(o[l],o[l],d),X(o[h],o[h],d),X(o[c],o[c],d),X(s[l],s[l],f),X(s[h],s[h],f),X(s[c],s[c],f)}for(var G=j(),H=j(),V=j(),u=0;u<e;u++){V[0]=a[3*u],V[1]=a[3*u+1],V[2]=a[3*u+2];var k=o[u];W.a.scale(G,V,W.a.dot(V,k)),W.a.sub(G,k,G),W.a.normalize(G,G),W.a.cross(H,V,k),i[4*u]=G[0],i[4*u+1]=G[1],i[4*u+2]=G[2],i[4*u+3]=W.a.dot(H,s[u])<0?-1:1}this.dirty()}},isUniqueVertex:function(){return!this.isUseIndices()||this.vertexCount===this.indices.length},generateUniqueVertex:function(){if(this.vertexCount&&this.indices){65535<this.indices.length&&(this.indices=new g.a.Uint32Array(this.indices));for(var e=this.attributes,t=this.indices,r=this.getEnabledAttributes(),n={},i=0;i<r.length;i++){n[u=r[i]]=e[u].value,e[u].init(this.indices.length)}for(var a=0,o=0;o<t.length;o++){for(var s=t[o],i=0;i<r.length;i++)for(var u,l=e[u=r[i]].value,h=e[u].size,c=0;c<h;c++)l[a*h+c]=n[u][s*h+c];t[o]=a,a++}this.dirty()}},generateBarycentric:function(){if(this.vertexCount){this.isUniqueVertex()||this.generateUniqueVertex();var e=this.attributes,t=e.barycentric.value,r=this.indices;if(!t||t.length!==3*r.length){t=e.barycentric.value=new Float32Array(3*r.length);for(var n=0;n<(r?r.length:this.vertexCount/3);)for(var i=0;i<3;i++){t[3*(r?r[n++]:3*n+i)+i]=1}this.dirty()}}},applyTransform:function(e){var t=this.attributes,r=t.position.value,n=t.normal.value,i=t.tangent.value;e=e.array;var a=u.a.create();u.a.invert(a,e),u.a.transpose(a,a);var o=W.a.transformMat4,s=W.a.forEach;s(r,3,0,null,o,e),n&&s(n,3,0,null,o,a),i&&s(i,4,0,null,o,a),this.boundingBox&&this.updateBoundingBox()},dispose:function(e){var t=this._cache;t.use(e.__uid__);var r=t.get("chunks");if(r)for(var n=0;n<r.length;n++){for(var i=r[n],a=0;a<i.attributeBuffers.length;a++){var o=i.attributeBuffers[a];e.gl.deleteBuffer(o.buffer)}i.indicesBuffer&&e.gl.deleteBuffer(i.indicesBuffer.buffer)}if(this.__vaoCache){var s,u=e.getGLExtension("OES_vertex_array_object");for(s in this.__vaoCache){var l=this.__vaoCache[s].vao;l&&u.deleteVertexArrayOES(l)}}this.__vaoCache={},t.deleteContext(e.__uid__)}});a.STATIC_DRAW=n.a.STATIC_DRAW,a.DYNAMIC_DRAW=n.a.DYNAMIC_DRAW,a.STREAM_DRAW=n.a.STREAM_DRAW,a.AttributeBuffer=n.a.AttributeBuffer,a.IndicesBuffer=n.a.IndicesBuffer,a.Attribute=i,t.a=a},function(e,t,r){"use strict";var n=r(7),i=r(37),a=r(43),o=r(8),s=r(19),u=r(40),l=r(11),h=r(126);o.a.import(h.a);var c=new a.a,d=new u.a({geometry:c,frustumCulling:!1}),f=new i.a,p=n.a.extend(function(){return{fragment:"",outputs:null,material:null,blendWithPrevious:!1,clearColor:!1,clearDepth:!0}},function(){var e=new o.a(o.a.source("clay.compositor.vertex"),this.fragment),t=new s.a({shader:e});t.enableTexturesAll(),this.material=t},{setUniform:function(e,t){this.material.setUniform(e,t)},getUniform:function(e){var t=this.material.uniforms[e];if(t)return t.value},attachOutput:function(e,t){this.outputs||(this.outputs={}),t=t||l.a.COLOR_ATTACHMENT0,this.outputs[t]=e},detachOutput:function(e){for(var t in this.outputs)this.outputs[t]===e&&(this.outputs[t]=null)},bind:function(e,t){if(this.outputs)for(var r in this.outputs){var n=this.outputs[r];n&&t.attach(n,r)}t&&t.bind(e)},unbind:function(e,t){t.unbind(e)},render:function(e,t){var r=e.gl;if(t){this.bind(e,t);var n=e.getGLExtension("EXT_draw_buffers");if(n&&this.outputs){var i,a=[];for(i in this.outputs)(i=+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(0<e.length){var t=this.min,r=this.max,n=t.array,i=r.array;p(n,e[0]),p(i,e[0]);for(var a=1;a<e.length;a++){var o=e[a];o[0]<n[0]&&(n[0]=o[0]),o[1]<n[1]&&(n[1]=o[1]),o[2]<n[2]&&(n[2]=o[2]),o[0]>i[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]<n[0]||r[1]<n[1]||r[2]<n[2])},containBoundingBox:function(e){var t=this.min.array,r=this.max.array,n=e.min.array,i=e.max.array;return t[0]<=n[0]&&t[1]<=n[1]&&t[2]<=n[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<t.length;n++){var i=t[n],a=e[i];null===a?r.push(i):r.push(i+" "+a.toString())}return r.join("\n")}var n=r(7),l=r(23),i=r(113).a.parseToFloat,h={},a=n.a.extend(function(){return{name:"",depthTest:!0,depthMask:!0,transparent:!1,blend:null,autoUpdateTextureStatus:!0,uniforms:{},vertexDefines:{},fragmentDefines:{},_textureStatus:{},_enabledUniforms:null}},function(){this.name||(this.name="MATERIAL_"+this.__uid__),this.shader&&this.attachShader(this.shader,!0)},{precision:"highp",setUniform:function(e,t){void 0===t&&console.warn('Uniform value "'+e+'" is undefined');var r=this.uniforms[e];r&&("string"==typeof t&&(t=i(t)||t),r.value=t,this.autoUpdateTextureStatus&&"t"===r.type&&(t?this.enableTexture(e):this.disableTexture(e)))},setUniforms:function(e){for(var t in e){var r=e[t];this.setUniform(t,r)}},isUniformEnabled:function(e){return 0<=this._enabledUniforms.indexOf(e)},getEnabledUniforms:function(){return this._enabledUniforms},getTextureUniforms:function(){return this._textureUniforms},set:function(e,t){if("object"==_typeof(e))for(var r in e){var n=e[r];this.setUniform(r,n)}else this.setUniform(e,t)},get:function(e){var t=this.uniforms[e];if(t)return t.value},attachShader:function(e,t){var r=this.uniforms;this.uniforms=e.createUniforms(),this.shader=e;var n=this.uniforms;this._enabledUniforms=Object.keys(n),this._enabledUniforms.sort(),this._textureUniforms=this._enabledUniforms.filter(function(e){var t=this.uniforms[e].type;return"t"===t||"tv"===t},this);var i=this.vertexDefines,a=this.fragmentDefines;if(this.vertexDefines=l.a.clone(e.vertexDefines),this.fragmentDefines=l.a.clone(e.fragmentDefines),t){for(var o in r)n[o]&&(n[o].value=r[o].value);l.a.defaults(this.vertexDefines,i),l.a.defaults(this.fragmentDefines,a)}var s,u={};for(s in e.textures)u[s]={shaderType:e.textures[s].shaderType,type:e.textures[s].type,enabled:!(!t||!this._textureStatus[s])&&this._textureStatus[s].enabled};this._textureStatus=u,this._programKey=""},clone:function(){var e,t=new this.constructor({name:this.name,shader:this.shader});for(e in this.uniforms)t.uniforms[e].value=this.uniforms[e].value;return t.depthTest=this.depthTest,t.depthMask=this.depthMask,t.transparent=this.transparent,t.blend=this.blend,t.vertexDefines=l.a.clone(this.vertexDefines),t.fragmentDefines=l.a.clone(this.fragmentDefines),t.enableTexture(this.getEnabledTextures()),t.precision=this.precision,t},define:function(e,t,r){var n=this.vertexDefines,i=this.fragmentDefines;"vertex"!==e&&"fragment"!==e&&"both"!==e&&arguments.length<3&&(r=t,t=e,e="both"),r=null!=r?r:null,"vertex"!==e&&"both"!==e||n[t]!==r&&(n[t]=r,this._programKey=""),"fragment"!==e&&"both"!==e||i[t]!==r&&(i[t]=r,"both"!==e&&(this._programKey=""))},undefine:function(e,t){"vertex"!==e&&"fragment"!==e&&"both"!==e&&arguments.length<2&&(t=e,e="both"),"vertex"!==e&&"both"!==e||this.isDefined("vertex",t)&&(delete this.vertexDefines[t],this._programKey=""),"fragment"!==e&&"both"!==e||this.isDefined("fragment",t)&&(delete this.fragmentDefines[t],"both"!==e&&(this._programKey=""))},isDefined:function(e,t){switch(e){case"vertex":return void 0!==this.vertexDefines[t];case"fragment":return void 0!==this.fragmentDefines[t]}},getDefine:function(e,t){switch(e){case"vertex":return this.vertexDefines[t];case"fragment":return this.fragmentDefines[t]}},enableTexture:function(e){if(Array.isArray(e))for(var t=0;t<e.length;t++)this.enableTexture(e[t]);else{var r=this._textureStatus[e];r&&(r.enabled||(r.enabled=!0,this._programKey=""))}},enableTexturesAll:function(){var e,t=this._textureStatus;for(e in t)t[e].enabled=!0;this._programKey=""},disableTexture:function(e){if(Array.isArray(e))for(var t=0;t<e.length;t++)this.disableTexture(e[t]);else{var r=this._textureStatus[e];r&&r.enabled&&(r.enabled=!1,this._programKey="")}},disableTexturesAll:function(){var e,t=this._textureStatus;for(e in t)t[e].enabled=!1;this._programKey=""},isTextureEnabled:function(e){var t=this._textureStatus;return!!t[e]&&t[e].enabled},getEnabledTextures:function(){var e,t=[],r=this._textureStatus;for(e in r)r[e].enabled&&t.push(e);return t},dirtyDefines:function(){this._programKey=""},getProgramKey:function(){return this._programKey||(this._programKey=function(e,t,r){r.sort();for(var n=[],i=0;i<r.length;i++){var a=r[i];n.push(a)}var o=u(e)+"\n"+u(t)+"\n"+n.join("\n");if(h[o])return h[o];var s=l.a.genGUID();return h[o]=s}(this.vertexDefines,this.fragmentDefines,this.getEnabledTextures())),this._programKey}});t.a=a},function(e,t,r){"use strict";r.d(t,"b",function(){return n}),r.d(t,"a",function(){return i}),r.d(t,"c",function(){return a});var n=1e-6,i=Array,a=Math.random},function(e,t,r){"use strict";var R=r(20),w={create:function(){var e=new R.a(16);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},clone:function(e){var t=new R.a(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},copy:function(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[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},transpose:function(e,t){var r,n,i,a,o,s;return e===t?(r=t[1],n=t[2],i=t[3],a=t[6],o=t[7],s=t[11],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=a,e[11]=t[14],e[12]=i,e[13]=o,e[14]=s):(e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15]),e},invert:function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],l=t[7],h=t[8],c=t[9],d=t[10],f=t[11],p=t[12],m=t[13],g=t[14],_=t[15],v=r*s-n*o,y=r*u-i*o,x=r*l-a*o,T=n*u-i*s,b=n*l-a*s,w=i*l-a*u,E=h*m-c*p,S=h*g-d*p,A=h*_-f*p,M=c*g-d*m,C=c*_-f*m,L=d*_-f*g,D=v*L-y*C+x*M+T*A-b*S+w*E;return D?(D=1/D,e[0]=(s*L-u*C+l*M)*D,e[1]=(i*C-n*L-a*M)*D,e[2]=(m*w-g*b+_*T)*D,e[3]=(d*b-c*w-f*T)*D,e[4]=(u*A-o*L-l*S)*D,e[5]=(r*L-i*A+a*S)*D,e[6]=(g*x-p*w-_*y)*D,e[7]=(h*w-d*x+f*y)*D,e[8]=(o*C-s*A+l*E)*D,e[9]=(n*A-r*C-a*E)*D,e[10]=(p*b-m*x+_*v)*D,e[11]=(c*x-h*b-f*v)*D,e[12]=(s*S-o*M-u*E)*D,e[13]=(r*M-n*S+i*E)*D,e[14]=(m*y-p*T-g*v)*D,e[15]=(h*T-c*y+d*v)*D,e):null},adjoint:function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],l=t[7],h=t[8],c=t[9],d=t[10],f=t[11],p=t[12],m=t[13],g=t[14],_=t[15];return e[0]=s*(d*_-f*g)-c*(u*_-l*g)+m*(u*f-l*d),e[1]=-(n*(d*_-f*g)-c*(i*_-a*g)+m*(i*f-a*d)),e[2]=n*(u*_-l*g)-s*(i*_-a*g)+m*(i*l-a*u),e[3]=-(n*(u*f-l*d)-s*(i*f-a*d)+c*(i*l-a*u)),e[4]=-(o*(d*_-f*g)-h*(u*_-l*g)+p*(u*f-l*d)),e[5]=r*(d*_-f*g)-h*(i*_-a*g)+p*(i*f-a*d),e[6]=-(r*(u*_-l*g)-o*(i*_-a*g)+p*(i*l-a*u)),e[7]=r*(u*f-l*d)-o*(i*f-a*d)+h*(i*l-a*u),e[8]=o*(c*_-f*m)-h*(s*_-l*m)+p*(s*f-l*c),e[9]=-(r*(c*_-f*m)-h*(n*_-a*m)+p*(n*f-a*c)),e[10]=r*(s*_-l*m)-o*(n*_-a*m)+p*(n*l-a*s),e[11]=-(r*(s*f-l*c)-o*(n*f-a*c)+h*(n*l-a*s)),e[12]=-(o*(c*g-d*m)-h*(s*g-u*m)+p*(s*d-u*c)),e[13]=r*(c*g-d*m)-h*(n*g-i*m)+p*(n*d-i*c),e[14]=-(r*(s*g-u*m)-o*(n*g-i*m)+p*(n*u-i*s)),e[15]=r*(s*d-u*c)-o*(n*d-i*c)+h*(n*u-i*s),e},determinant:function(e){var t=e[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],u=e[7],l=e[8],h=e[9],c=e[10],d=e[11],f=e[12],p=e[13],m=e[14],g=e[15];return(t*o-r*a)*(c*g-d*m)-(t*s-n*a)*(h*g-d*p)+(t*u-i*a)*(h*m-c*p)+(r*s-n*o)*(l*g-d*f)-(r*u-i*o)*(l*m-c*f)+(n*u-i*s)*(l*p-h*f)},multiply:function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],l=t[6],h=t[7],c=t[8],d=t[9],f=t[10],p=t[11],m=t[12],g=t[13],_=t[14],v=t[15],y=r[0],x=r[1],T=r[2],b=r[3];return e[0]=y*n+x*s+T*c+b*m,e[1]=y*i+x*u+T*d+b*g,e[2]=y*a+x*l+T*f+b*_,e[3]=y*o+x*h+T*p+b*v,y=r[4],x=r[5],T=r[6],b=r[7],e[4]=y*n+x*s+T*c+b*m,e[5]=y*i+x*u+T*d+b*g,e[6]=y*a+x*l+T*f+b*_,e[7]=y*o+x*h+T*p+b*v,y=r[8],x=r[9],T=r[10],b=r[11],e[8]=y*n+x*s+T*c+b*m,e[9]=y*i+x*u+T*d+b*g,e[10]=y*a+x*l+T*f+b*_,e[11]=y*o+x*h+T*p+b*v,y=r[12],x=r[13],T=r[14],b=r[15],e[12]=y*n+x*s+T*c+b*m,e[13]=y*i+x*u+T*d+b*g,e[14]=y*a+x*l+T*f+b*_,e[15]=y*o+x*h+T*p+b*v,e},multiplyAffine:function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[4],s=t[5],u=t[6],l=t[8],h=t[9],c=t[10],d=t[12],f=t[13],p=t[14],m=r[0],g=r[1],_=r[2];return e[0]=m*n+g*o+_*l,e[1]=m*i+g*s+_*h,e[2]=m*a+g*u+_*c,m=r[4],g=r[5],_=r[6],e[4]=m*n+g*o+_*l,e[5]=m*i+g*s+_*h,e[6]=m*a+g*u+_*c,m=r[8],g=r[9],_=r[10],e[8]=m*n+g*o+_*l,e[9]=m*i+g*s+_*h,e[10]=m*a+g*u+_*c,m=r[12],g=r[13],_=r[14],e[12]=m*n+g*o+_*l+d,e[13]=m*i+g*s+_*h+f,e[14]=m*a+g*u+_*c+p,e}};w.mul=w.multiply,w.mulAffine=w.multiplyAffine,w.translate=function(e,t,r){var n,i,a,o,s,u,l,h,c,d,f,p,m=r[0],g=r[1],_=r[2];return t===e?(e[12]=t[0]*m+t[4]*g+t[8]*_+t[12],e[13]=t[1]*m+t[5]*g+t[9]*_+t[13],e[14]=t[2]*m+t[6]*g+t[10]*_+t[14],e[15]=t[3]*m+t[7]*g+t[11]*_+t[15]):(n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],l=t[6],h=t[7],c=t[8],d=t[9],f=t[10],p=t[11],e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=u,e[6]=l,e[7]=h,e[8]=c,e[9]=d,e[10]=f,e[11]=p,e[12]=n*m+s*g+c*_+t[12],e[13]=i*m+u*g+d*_+t[13],e[14]=a*m+l*g+f*_+t[14],e[15]=o*m+h*g+p*_+t[15]),e},w.scale=function(e,t,r){var n=r[0],i=r[1],a=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},w.rotate=function(e,t,r,n){var i,a,o,s,u,l,h,c,d,f,p,m,g,_,v,y,x,T,b,w,E,S,A,M,C=n[0],L=n[1],D=n[2],N=Math.sqrt(C*C+L*L+D*D);return Math.abs(N)<R.b?null:(C*=N=1/N,L*=N,D*=N,i=Math.sin(r),o=1-(a=Math.cos(r)),s=t[0],u=t[1],l=t[2],h=t[3],c=t[4],d=t[5],f=t[6],p=t[7],m=t[8],g=t[9],_=t[10],v=t[11],y=C*C*o+a,x=L*C*o+D*i,T=D*C*o-L*i,b=C*L*o-D*i,w=L*L*o+a,E=D*L*o+C*i,S=C*D*o+L*i,A=L*D*o-C*i,M=D*D*o+a,e[0]=s*y+c*x+m*T,e[1]=u*y+d*x+g*T,e[2]=l*y+f*x+_*T,e[3]=h*y+p*x+v*T,e[4]=s*b+c*w+m*E,e[5]=u*b+d*w+g*E,e[6]=l*b+f*w+_*E,e[7]=h*b+p*w+v*E,e[8]=s*S+c*A+m*M,e[9]=u*S+d*A+g*M,e[10]=l*S+f*A+_*M,e[11]=h*S+p*A+v*M,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)},w.rotateX=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[4],o=t[5],s=t[6],u=t[7],l=t[8],h=t[9],c=t[10],d=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*i+l*n,e[5]=o*i+h*n,e[6]=s*i+c*n,e[7]=u*i+d*n,e[8]=l*i-a*n,e[9]=h*i-o*n,e[10]=c*i-s*n,e[11]=d*i-u*n,e},w.rotateY=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],u=t[3],l=t[8],h=t[9],c=t[10],d=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i-l*n,e[1]=o*i-h*n,e[2]=s*i-c*n,e[3]=u*i-d*n,e[8]=a*n+l*i,e[9]=o*n+h*i,e[10]=s*n+c*i,e[11]=u*n+d*i,e},w.rotateZ=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],u=t[3],l=t[4],h=t[5],c=t[6],d=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i+l*n,e[1]=o*i+h*n,e[2]=s*i+c*n,e[3]=u*i+d*n,e[4]=l*i-a*n,e[5]=h*i-o*n,e[6]=c*i-s*n,e[7]=d*i-u*n,e},w.fromRotationTranslation=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=n+n,u=i+i,l=a+a,h=n*s,c=n*u,d=n*l,f=i*u,p=i*l,m=a*l,g=o*s,_=o*u,v=o*l;return e[0]=1-(f+m),e[1]=c+v,e[2]=d-_,e[3]=0,e[4]=c-v,e[5]=1-(h+m),e[6]=p+g,e[7]=0,e[8]=d+_,e[9]=p-g,e[10]=1-(h+f),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e},w.fromQuat=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r+r,s=n+n,u=i+i,l=r*o,h=n*o,c=n*s,d=i*o,f=i*s,p=i*u,m=a*o,g=a*s,_=a*u;return e[0]=1-c-p,e[1]=h+_,e[2]=d-g,e[3]=0,e[4]=h-_,e[5]=1-l-p,e[6]=f+m,e[7]=0,e[8]=d+g,e[9]=f-m,e[10]=1-l-c,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},w.frustum=function(e,t,r,n,i,a,o){var s=1/(r-t),u=1/(i-n),l=1/(a-o);return e[0]=2*a*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*a*u,e[6]=0,e[7]=0,e[8]=(r+t)*s,e[9]=(i+n)*u,e[10]=(o+a)*l,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*a*2*l,e[15]=0,e},w.perspective=function(e,t,r,n,i){var a=1/Math.tan(t/2),o=1/(n-i);return e[0]=a/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=(i+n)*o,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*i*n*o,e[15]=0,e},w.ortho=function(e,t,r,n,i,a,o){var s=1/(t-r),u=1/(n-i),l=1/(a-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*u,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*l,e[11]=0,e[12]=(t+r)*s,e[13]=(i+n)*u,e[14]=(o+a)*l,e[15]=1,e},w.lookAt=function(e,t,r,n){var i,a,o,s,u,l,h,c,d,f,p=t[0],m=t[1],g=t[2],_=n[0],v=n[1],y=n[2],x=r[0],T=r[1],b=r[2];return Math.abs(p-x)<R.b&&Math.abs(m-T)<R.b&&Math.abs(g-b)<R.b?w.identity(e):(h=p-x,c=m-T,d=g-b,i=v*(d*=f=1/Math.sqrt(h*h+c*c+d*d))-y*(c*=f),a=y*(h*=f)-_*d,o=_*c-v*h,(f=Math.sqrt(i*i+a*a+o*o))?(i*=f=1/f,a*=f,o*=f):o=a=i=0,s=c*o-d*a,u=d*i-h*o,l=h*a-c*i,(f=Math.sqrt(s*s+u*u+l*l))?(s*=f=1/f,u*=f,l*=f):l=u=s=0,e[0]=i,e[1]=s,e[2]=h,e[3]=0,e[4]=a,e[5]=u,e[6]=c,e[7]=0,e[8]=o,e[9]=l,e[10]=d,e[11]=0,e[12]=-(i*p+a*m+o*g),e[13]=-(s*p+u*m+l*g),e[14]=-(h*p+c*m+d*g),e[15]=1,e)},w.frob=function(e){return Math.sqrt(Math.pow(e[0],2)+Math.pow(e[1],2)+Math.pow(e[2],2)+Math.pow(e[3],2)+Math.pow(e[4],2)+Math.pow(e[5],2)+Math.pow(e[6],2)+Math.pow(e[7],2)+Math.pow(e[8],2)+Math.pow(e[9],2)+Math.pow(e[10],2)+Math.pow(e[11],2)+Math.pow(e[12],2)+Math.pow(e[13],2)+Math.pow(e[14],2)+Math.pow(e[15],2))},t.a=w},function(e,t,r){"use strict";function n(e){e=e||"perspective",this.layer=null,this.scene=new o.a,this.rootNode=this.scene,this.viewport={x:0,y:0,width:0,height:0},this.setProjection(e),this._compositor=new p.a,this._temporalSS=new m.a,this._shadowMapPass=new s.a;for(var t=[],r=0,n=0;n<30;n++){for(var i=[],a=0;a<6;a++)i.push(4*Object(g.a)(r,2)-2),i.push(4*Object(g.a)(r,3)-2),r++;t.push(i)}this._pcfKernels=t,this.scene.on("beforerender",function(e,t,r){this.needsTemporalSS()&&this._temporalSS.jitterProjection(e,r)},this)}var i=r(0),a=r.n(i),o=r(36),s=r(174),u=r(41),l=r(37),c=r(9),d=r(3),h=r(26),f=r(53),p=r(176),m=r(200),g=r(49);n.prototype.setProjection=function(e){var t=this.camera;t&&t.update(),"perspective"===e?this.camera instanceof u.a||(this.camera=new u.a,t&&this.camera.setLocalTransform(t.localTransform)):this.camera instanceof l.a||(this.camera=new l.a,t&&this.camera.setLocalTransform(t.localTransform)),this.camera.near=.1,this.camera.far=2e3},n.prototype.setViewport=function(e,t,r,n,i){this.camera instanceof u.a&&(this.camera.aspect=r/n),i=i||1,this.viewport.x=e,this.viewport.y=t,this.viewport.width=r,this.viewport.height=n,this.viewport.devicePixelRatio=i,this._compositor.resize(r*i,n*i),this._temporalSS.resize(r*i,n*i)},n.prototype.containPoint=function(e,t){var r=this.viewport;return t=this.layer.renderer.getHeight()-t,e>=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;t<e.transparent.length;t++){var r=e.transparent[t].geometry;r.needsSortVerticesProgressively&&r.needsSortVerticesProgressively()&&(this._needsSortProgressively=!0),r.needsSortTrianglesProgressively&&r.needsSortTrianglesProgressively()&&(this._needsSortProgressively=!0)}this._frame=0,this._temporalSS.resetFrame()},n.prototype.render=function(e,t){this._doRender(e,t,this._frame),this._frame++},n.prototype.needsAccumulate=function(){return this.needsTemporalSS()||this._needsSortProgressively},n.prototype.needsTemporalSS=function(){var e=this._enableTemporalSS;return"auto"===e&&(e=this._enablePostEffect),e},n.prototype.hasDOF=function(){return this._enableDOF},n.prototype.isAccumulateFinished=function(){return this.needsTemporalSS()?this._temporalSS.isFinished():30<this._frame},n.prototype._doRender=function(e,t,r){var n=this.scene,i=this.camera;r=r||0,this._updateTransparent(e,n,i,r),t||(this._shadowMapPass.kernelPCF=this._pcfKernels[0],this._shadowMapPass.render(e,n,i,!0)),this._updateShadowPCFKernel(r);var a,o=e.clearColor;e.gl.clearColor(o[0],o[1],o[2],o[3]),this._enablePostEffect&&(this.needsTemporalSS()&&this._temporalSS.jitterProjection(e,i),this._compositor.updateNormal(e,n,i,this._temporalSS.getFrame())),this._updateSSAO(e,n,i,this._temporalSS.getFrame()),this._enablePostEffect?((a=this._compositor.getSourceFrameBuffer()).bind(e),e.gl.clear(e.gl.DEPTH_BUFFER_BIT|e.gl.COLOR_BUFFER_BIT),e.render(n,i,!0,!0),a.unbind(e),this.needsTemporalSS()&&t?(this._compositor.composite(e,n,i,this._temporalSS.getSourceFrameBuffer(),this._temporalSS.getFrame()),e.setViewport(this.viewport),this._temporalSS.render(e)):(e.setViewport(this.viewport),this._compositor.composite(e,n,i,null,0))):this.needsTemporalSS()&&t?((a=this._temporalSS.getSourceFrameBuffer()).bind(e),e.saveClear(),e.clearBit=e.gl.DEPTH_BUFFER_BIT|e.gl.COLOR_BUFFER_BIT,e.render(n,i,!0,!0),e.restoreClear(),a.unbind(e),e.setViewport(this.viewport),this._temporalSS.render(e)):(e.setViewport(this.viewport),e.render(n,i,!0,!0))},n.prototype._updateTransparent=function(e,t,r,n){for(var i=new d.a,a=new c.a,o=r.getWorldPosition(),s=t.getRenderList(r).transparent,u=0;u<s.length;u++){var l=s[u],h=l.geometry;c.a.invert(a,l.worldTransform),d.a.transformMat4(i,o,a),h.needsSortTriangles&&h.needsSortTriangles()&&h.doSortTriangles(i,n),h.needsSortVertices&&h.needsSortVertices()&&h.doSortVertices(i,n)}},n.prototype._updateSSAO=function(e,t,r){var n=this._enableSSAO&&this._enablePostEffect;n&&this._compositor.updateSSAO(e,t,r,this._temporalSS.getFrame());for(var i=t.getRenderList(r),a=0;a<i.opaque.length;a++){var o=i.opaque[a];o.renderNormal&&o.material[n?"enableTexture":"disableTexture"]("ssaoMap"),n&&o.material.set("ssaoMap",this._compositor.getSSAOTexture())}},n.prototype._updateShadowPCFKernel=function(e){for(var t=this._pcfKernels[e%this._pcfKernels.length],r=this.scene.getRenderList(this.camera).opaque,n=0;n<r.length;n++)r[n].receiveShadow&&(r[n].material.set("pcfKernel",t),r[n].material.define("fragment","PCF_KERNEL_SIZE",t.length/2))},n.prototype.dispose=function(e){this._compositor.dispose(e.gl),this._temporalSS.dispose(e.gl),this._shadowMapPass.dispose(e)},n.prototype.setPostEffect=function(e,t){var r=this._compositor;this._enablePostEffect=e.get("enable");var n=e.getModel("bloom"),i=e.getModel("edge"),a=e.getModel("DOF",e.getModel("depthOfField")),o=e.getModel("SSAO",e.getModel("screenSpaceAmbientOcclusion")),s=e.getModel("SSR",e.getModel("screenSpaceReflection")),u=e.getModel("FXAA"),l=e.getModel("colorCorrection");n.get("enable")?r.enableBloom():r.disableBloom(),a.get("enable")?r.enableDOF():r.disableDOF(),s.get("enable")?r.enableSSR():r.disableSSR(),l.get("enable")?r.enableColorCorrection():r.disableColorCorrection(),i.get("enable")?r.enableEdge():r.disableEdge(),u.get("enable")?r.enableFXAA():r.disableFXAA(),this._enableDOF=a.get("enable"),this._enableSSAO=o.get("enable"),this._enableSSAO?r.enableSSAO():r.disableSSAO(),r.setBloomIntensity(n.get("intensity")),r.setEdgeColor(i.get("color")),r.setColorLookupTexture(l.get("lookupTexture"),t),r.setExposure(l.get("exposure")),["radius","quality","intensity"].forEach(function(e){r.setSSAOParameter(e,o.get(e))}),["quality","maxRoughness","physical"].forEach(function(e){r.setSSRParameter(e,s.get(e))}),["quality","focalDistance","focalRange","blurRadius","fstop"].forEach(function(e){r.setDOFParameter(e,a.get(e))}),["brightness","contrast","saturation"].forEach(function(e){r.setColorCorrection(e,l.get(e))})},n.prototype.setDOFFocusOnPoint=function(e){if(this._enablePostEffect){if(e>this.camera.far||e<this.camera.near)return;return this._compositor.setDOFParameter("focalDistance",e),!0}},n.prototype.setTemporalSuperSampling=function(e){this._enableTemporalSS=e.get("enable")},n.prototype.isLinearSpace=function(){return this._enablePostEffect},n.prototype.setRootNode=function(e){if(this.rootNode!==e){for(var t=this.rootNode.children(),r=0;r<t.length;r++)e.add(t[r]);e!==this.scene&&this.scene.add(e),this.rootNode=e}},n.prototype.add=function(e){this.rootNode.add(e)},n.prototype.remove=function(e){this.rootNode.remove(e)},n.prototype.removeAll=function(e){this.rootNode.removeAll(e)},a.a.util.extend(n.prototype,f.a),t.a=n},function(e,t,r){"use strict";var n=0,o=Array.prototype.forEach,i={genGUID:function(){return++n},relative2absolute:function(e,t){if(!t||e.match(/^\//))return e;for(var r=e.split("/"),n=t.split("/"),i=r[0];"."===i||".."===i;)".."===i&&n.pop(),r.shift(),i=r[0];return n.join("/")+"/"+r.join("/")},extend:function(e,t){if(t)for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e},defaults:function(e,t){if(t)for(var r in t)void 0===e[r]&&(e[r]=t[r]);return e},extendWithPropList:function(e,t,r){if(t)for(var n=0;n<r.length;n++){var i=r[n];e[i]=t[i]}return e},defaultsWithPropList:function(e,t,r){if(t)for(var n=0;n<r.length;n++){var i=r[n];null==e[i]&&(e[i]=t[i])}return e},each:function(e,t,r){if(e&&t)if(e.forEach&&e.forEach===o)e.forEach(t,r);else if(e.length===+e.length)for(var n=0,i=e.length;n<i;n++)t.call(r,e[n],n,e);else for(var a in e)e.hasOwnProperty(a)&&t.call(r,e[a],a,e)},isObject:function(e){return e===Object(e)},isArray:function(e){return Array.isArray(e)},isArrayLike:function(e){return!!e&&e.length===+e.length},clone:function(e){if(i.isObject(e)){if(i.isArray(e))return e.slice();if(i.isArrayLike(e)){for(var t=new e.constructor(e.length),r=0;r<e.length;r++)t[r]=e[r];return t}return i.extend({},e)}return e}};t.a=i},function(e,t,r){"use strict";var n=r(35),i=r(8),a=r(119);i.a.import(a.a);var o=n.a.extend(function(){return{color:[1,1,1],intensity:1,castShadow:!0,shadowResolution:512,group:0}},{type:"",clone:function(){var e=n.a.prototype.clone.call(this);return e.color=Array.prototype.slice.call(this.color),e.intensity=this.intensity,e.castShadow=this.castShadow,e.shadowResolution=this.shadowResolution,e}});t.a=o},function(e,t,r){"use strict";var n=r(15),i=r(0),a=r.n(i),o=r(38),s=r(6).a.vec3,u=[[0,0],[1,1]],l=n.a.extend(function(){return{segmentScale:1,dynamic:!0,useNativeLine:!0,attributes:{position:new n.a.Attribute("position","float",3,"POSITION"),positionPrev:new n.a.Attribute("positionPrev","float",3),positionNext:new n.a.Attribute("positionNext","float",3),prevPositionPrev:new n.a.Attribute("prevPositionPrev","float",3),prevPosition:new n.a.Attribute("prevPosition","float",3),prevPositionNext:new n.a.Attribute("prevPositionNext","float",3),offset:new n.a.Attribute("offset","float",1),color:new n.a.Attribute("color","float",4,"COLOR")}}},{resetOffset:function(){this._vertexOffset=0,this._triangleOffset=0,this._itemVertexOffsets=[]},setVertexCount:function(e){var t=this.attributes;this.vertexCount!==e&&(t.position.init(e),t.color.init(e),this.useNativeLine||(t.positionPrev.init(e),t.positionNext.init(e),t.offset.init(e)),65535<e?this.indices instanceof Uint16Array&&(this.indices=new Uint32Array(this.indices)):this.indices instanceof Uint32Array&&(this.indices=new Uint16Array(this.indices)))},setTriangleCount:function(e){this.triangleCount!==e&&(this.indices=0===e?null:new(65535<this.vertexCount?Uint32Array:Uint16Array)(3*e))},_getCubicCurveApproxStep:function(e,t,r,n){return 1/(s.dist(e,t)+s.dist(r,t)+s.dist(n,r)+1)*this.segmentScale},getCubicCurveVertexCount:function(e,t,r,n){var i=this._getCubicCurveApproxStep(e,t,r,n),a=Math.ceil(1/i);return this.useNativeLine?2*a:2*a+2},getCubicCurveTriangleCount:function(e,t,r,n){var i=this._getCubicCurveApproxStep(e,t,r,n),a=Math.ceil(1/i);return this.useNativeLine?0:2*a},getLineVertexCount:function(){return this.getPolylineVertexCount(u)},getLineTriangleCount:function(){return this.getPolylineTriangleCount(u)},getPolylineVertexCount:function(e){var t="number"==typeof e?e:"number"!=typeof e[0]?e.length:e.length/3;return this.useNativeLine?2*(t-1):2*(t-1)+2},getPolylineTriangleCount:function(e){var t="number"==typeof e?e:"number"!=typeof e[0]?e.length:e.length/3;return this.useNativeLine?0:2*Math.max(t-1,0)},addCubicCurve:function(e,t,r,n,i,a){null==a&&(a=1);for(var o=e[0],s=e[1],u=e[2],l=t[0],h=t[1],c=t[2],d=r[0],f=r[1],p=r[2],m=n[0],g=n[1],_=n[2],v=this._getCubicCurveApproxStep(e,t,r,n),y=v*v,x=y*v,T=3*v,b=3*y,w=6*y,E=6*x,S=o-2*l+d,A=s-2*h+f,M=u-2*c+p,C=3*(l-d)-o+m,L=3*(h-f)-s+g,D=3*(c-p)-u+_,N=o,R=s,P=u,I=(l-o)*T+S*b+C*x,O=(h-s)*T+A*b+L*x,F=(c-u)*T+M*b+D*x,B=S*w+C*E,U=A*w+L*E,z=M*w+D*E,G=C*E,H=L*E,V=D*E,k=0,W=0,j=Math.ceil(1/v),X=new Float32Array(3*(j+1)),X=[],q=0,W=0;W<j+1;W++)X[q++]=N,X[q++]=R,X[q++]=P,N+=I,R+=O,P+=F,I+=B,O+=U,F+=z,B+=G,U+=H,z+=V,1<(k+=v)&&(N=0<I?Math.min(N,m):Math.max(N,m),R=0<O?Math.min(R,g):Math.max(R,g),P=0<F?Math.min(P,_):Math.max(P,_));return this.addPolyline(X,i,a)},addLine:function(e,t,r,n){return this.addPolyline([e,t],r,n)},addPolyline:function(e,t,r,n,i){if(e.length){var a="number"!=typeof e[0];if(null==i&&(i=a?e.length:e.length/3),!(i<2)){null==n&&(n=0),null==r&&(r=1),this._itemVertexOffsets.push(this._vertexOffset);var o,s=(a="number"!=typeof e[0])?"number"!=typeof t[0]:t.length/4===i,u=this.attributes.position,l=this.attributes.positionPrev,h=this.attributes.positionNext,c=this.attributes.color,d=this.attributes.offset,f=this.indices,p=this._vertexOffset;r=Math.max(r,.01);for(var m,g,_,v,y,x,T=n;T<i;T++){a?(o=e[T],_=s?t[T]:t):((o=o||[])[0]=e[m=3*T],o[1]=e[1+m],o[2]=e[2+m],s?((_=_||[])[0]=t[g=4*T],_[1]=t[1+g],_[2]=t[2+g],_[3]=t[3+g]):_=t),this.useNativeLine?1<T&&(u.copy(p,p-1),c.copy(p,p-1),p++):(T<i-1&&(l.set(p+2,o),l.set(p+3,o)),0<T&&(h.set(p-2,o),h.set(p-1,o)),u.set(p,o),u.set(p+1,o),c.set(p,_),c.set(p+1,_),d.set(p,r/2),d.set(p+1,-r/2),p+=2),this.useNativeLine?(c.set(p,_),u.set(p,o),p++):0<T&&(v=3*this._triangleOffset,(f=this.indices)[v]=p-4,f[1+v]=p-3,f[2+v]=p-2,f[3+v]=p-3,f[4+v]=p-1,f[5+v]=p-2,this._triangleOffset+=2)}return this.useNativeLine||(y=this._vertexOffset,x=this._vertexOffset+2*i,l.copy(y,y+2),l.copy(y+1,y+3),h.copy(x-1,x-3),h.copy(x-2,x-4)),this._vertexOffset=p,this._vertexOffset}}},setItemColor:function(e,t){for(var r=this._itemVertexOffsets[e],n=e<this._itemVertexOffsets.length-1?this._itemVertexOffsets[e+1]:this._vertexOffset,i=r;i<n;i++)this.attributes.color.set(i,t);this.dirty("color")},currentTriangleOffset:function(){return this._triangleOffset},currentVertexOffset:function(){return this._vertexOffset}});a.a.util.defaults(l.prototype,o.a),t.a=l},function(e,t,r){"use strict";function n(e,t){e=e||0,t=t||0,this.array=a.a.fromValues(e,t),this._dirty=!0}var i,a=r(70);n.prototype={constructor:n,add:function(e){return a.a.add(this.array,this.array,e.array),this._dirty=!0,this},set:function(e,t){return this.array[0]=e,this.array[1]=t,this._dirty=!0,this},setArray:function(e){return this.array[0]=e[0],this.array[1]=e[1],this._dirty=!0,this},clone:function(){return new n(this.x,this.y)},copy:function(e){return a.a.copy(this.array,e.array),this._dirty=!0,this},cross:function(e,t){return a.a.cross(e.array,this.array,t.array),e._dirty=!0,this},dist:function(e){return a.a.dist(this.array,e.array)},distance:function(e){return a.a.distance(this.array,e.array)},div:function(e){return a.a.div(this.array,this.array,e.array),this._dirty=!0,this},divide:function(e){return a.a.divide(this.array,this.array,e.array),this._dirty=!0,this},dot:function(e){return a.a.dot(this.array,e.array)},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},min:function(e){return a.a.min(this.array,this.array,e.array),this._dirty=!0,this},max:function(e){return a.a.max(this.array,this.array,e.array),this._dirty=!0,this},mul:function(e){return a.a.mul(this.array,this.array,e.array),this._dirty=!0,this},multiply:function(e){return a.a.multiply(this.array,this.array,e.array),this._dirty=!0,this},negate:function(){return a.a.negate(this.array,this.array),this._dirty=!0,this},normalize:function(){return a.a.normalize(this.array,this.array),this._dirty=!0,this},random:function(e){return a.a.random(this.array,e),this._dirty=!0,this},scale:function(e){return a.a.scale(this.array,this.array,e),this._dirty=!0,this},scaleAndAdd:function(e,t){return a.a.scaleAndAdd(this.array,this.array,e.array,t),this._dirty=!0,this},sqrDist:function(e){return a.a.sqrDist(this.array,e.array)},squaredDistance:function(e){return a.a.squaredDistance(this.array,e.array)},sqrLen:function(){return a.a.sqrLen(this.array)},squaredLength:function(){return a.a.squaredLength(this.array)},sub:function(e){return a.a.sub(this.array,this.array,e.array),this._dirty=!0,this},subtract:function(e){return a.a.subtract(this.array,this.array,e.array),this._dirty=!0,this},transformMat2:function(e){return a.a.transformMat2(this.array,this.array,e.array),this._dirty=!0,this},transformMat2d:function(e){return a.a.transformMat2d(this.array,this.array,e.array),this._dirty=!0,this},transformMat3:function(e){return a.a.transformMat3(this.array,this.array,e.array),this._dirty=!0,this},transformMat4:function(e){return a.a.transformMat4(this.array,this.array,e.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}},Object.defineProperty&&(i=n.prototype,Object.defineProperty(i,"x",{get:function(){return this.array[0]},set:function(e){this.array[0]=e,this._dirty=!0}}),Object.defineProperty(i,"y",{get:function(){return this.array[1]},set:function(e){this.array[1]=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){return a.a.set(e.array,t,r),e._dirty=!0,e},n.copy=function(e,t){return a.a.copy(e.array,t.array),e._dirty=!0,e},n.cross=function(e,t,r){return a.a.cross(e.array,t.array,r.array),e._dirty=!0,e},n.distance=n.dist=function(e,t){return a.a.distance(e.array,t.array)},n.divide=n.div=function(e,t,r){return a.a.divide(e.array,t.array,r.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.min=function(e,t,r){return a.a.min(e.array,t.array,r.array),e._dirty=!0,e},n.max=function(e,t,r){return a.a.max(e.array,t.array,r.array),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.negate=function(e,t){return a.a.negate(e.array,t.array),e._dirty=!0,e},n.normalize=function(e,t){return a.a.normalize(e.array,t.array),e._dirty=!0,e},n.random=function(e,t){return a.a.random(e.array,t),e._dirty=!0,e},n.scale=function(e,t,r){return a.a.scale(e.array,t.array,r),e._dirty=!0,e},n.scaleAndAdd=function(e,t,r,n){return a.a.scaleAndAdd(e.array,t.array,r.array,n),e._dirty=!0,e},n.squaredDistance=n.sqrDist=function(e,t){return a.a.sqrDist(e.array,t.array)},n.squaredLength=n.sqrLen=function(e){return a.a.sqrLen(e.array)},n.subtract=n.sub=function(e,t,r){return a.a.subtract(e.array,t.array,r.array),e._dirty=!0,e},n.transformMat2=function(e,t,r){return a.a.transformMat2(e.array,t.array,r.array),e._dirty=!0,e},n.transformMat2d=function(e,t,r){return a.a.transformMat2d(e.array,t.array,r.array),e._dirty=!0,e},n.transformMat3=function(e,t,r){return a.a.transformMat3(e.array,t.array,r.array),e._dirty=!0,e},n.transformMat4=function(e,t,r){return a.a.transformMat4(e.array,t.array,r.array),e._dirty=!0,e},t.a=n},function(e,t,r){"use strict";function n(e){return"CANVAS"===e.nodeName||"VIDEO"===e.nodeName||e.complete}var i=r(4),l=r(11),o=r(23),a=r(73),s=r(14),u=a.a.isPowerOfTwo,h=["px","nx","py","ny","pz","nz"],c=i.a.extend(function(){return{image:{px:null,nx:null,py:null,ny:null,pz:null,nz:null},pixels:{px:null,nx:null,py:null,ny:null,pz:null,nz:null},mipmaps:[]}},{textureType:"textureCube",update:function(e){var t=e.gl;t.bindTexture(t.TEXTURE_CUBE_MAP,this._cache.get("webgl_texture")),this.updateCommon(e);var r=this.format,n=this.type;t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_WRAP_S,this.getAvailableWrapS()),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_WRAP_T,this.getAvailableWrapT()),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MAG_FILTER,this.getAvailableMagFilter()),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MIN_FILTER,this.getAvailableMinFilter());var i=e.getGLExtension("EXT_texture_filter_anisotropic");if(i&&1<this.anisotropic&&t.texParameterf(t.TEXTURE_CUBE_MAP,i.TEXTURE_MAX_ANISOTROPY_EXT,this.anisotropic),36193===n&&(e.getGLExtension("OES_texture_half_float")||(n=l.a.FLOAT)),this.mipmaps.length)for(var a=this.width,o=this.height,s=0;s<this.mipmaps.length;s++){var u=this.mipmaps[s];this._updateTextureData(t,u,s,a,o,r,n),a/=2,o/=2}else this._updateTextureData(t,this,0,this.width,this.height,r,n),!this.NPOT&&this.useMipmap&&t.generateMipmap(t.TEXTURE_CUBE_MAP);t.bindTexture(t.TEXTURE_CUBE_MAP,null)},_updateTextureData:function(e,t,r,n,i,a,o){for(var s=0;s<6;s++){var u=h[s],l=t.image&&t.image[u];l?e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+s,r,a,a,o,l):e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+s,r,a,n,i,0,a,o,t.pixels&&t.pixels[u])}},generateMipmap:function(e){var t=e.gl;this.useMipmap&&!this.NPOT&&(t.bindTexture(t.TEXTURE_CUBE_MAP,this._cache.get("webgl_texture")),t.generateMipmap(t.TEXTURE_CUBE_MAP))},bind:function(e){e.gl.bindTexture(e.gl.TEXTURE_CUBE_MAP,this.getWebGLTexture(e))},unbind:function(e){e.gl.bindTexture(e.gl.TEXTURE_CUBE_MAP,null)},isPowerOfTwo:function(){return this.image.px?u(this.image.px.width)&&u(this.image.px.height):u(this.width)&&u(this.height)},isRenderable:function(){return this.image.px?n(this.image.px)&&n(this.image.nx)&&n(this.image.py)&&n(this.image.ny)&&n(this.image.pz)&&n(this.image.nz):!(!this.width||!this.height)},load:function(e,n){var i=0,a=this;return o.a.each(e,function(e,t){var r=s.a.createImage();n&&(r.crossOrigin=n),r.onload=function(){0===--i&&(a.dirty(),a.trigger("success",a)),r.onload=null},r.onerror=function(){i--,r.onerror=null},i++,r.src=e,a.image[t]=r}),this}});Object.defineProperty(c.prototype,"width",{get:function(){return this.image&&this.image.px?this.image.px.width:this._width},set:function(e){this.image&&this.image.px?console.warn("Texture from image can't set width"):(this._width!==e&&this.dirty(),this._width=e)}}),Object.defineProperty(c.prototype,"height",{get:function(){return this.image&&this.image.px?this.image.px.height:this._height},set:function(e){this.image&&this.image.px?console.warn("Texture from image can't set height"):(this._height!==e&&this.dirty(),this._height=e)}}),t.a=c},function(e,t,r){"use strict";t.a={defaultOption:{postEffect:{enable:!1,bloom:{enable:!0,intensity:.1},depthOfField:{enable:!1,focalRange:20,focalDistance:50,blurRadius:10,fstop:2.8,quality:"medium"},screenSpaceAmbientOcclusion:{enable:!1,radius:2,quality:"medium",intensity:1},screenSpaceReflection:{enable:!1,quality:"medium",maxRoughness:.8},colorCorrection:{enable:!0,exposure:0,brightness:0,contrast:1,saturation:1,lookupTexture:""},edge:{enable:!1},FXAA:{enable:!1}},temporalSuperSampling:{enable:"auto"}}}},function(e,t,r){"use strict";t.a={defaultOption:{light:{main:{shadow:!1,shadowQuality:"high",color:"#fff",intensity:1,alpha:0,beta:0},ambient:{color:"#fff",intensity:.2},ambientCubemap:{texture:null,exposure:1,diffuseIntensity:.5,specularIntensity:.5}}}}},function(e,t,r){"use strict";function n(){}var d=r(1),f=r(42),i=r(0),p=r.n(i);n.prototype={constructor:n,setScene:function(e){this._scene=e,this._skybox&&this._skybox.attachScene(this._scene)},initLight:function(e){this._lightRoot=e,this.mainLight=new d.a.DirectionalLight({shadowBias:.005}),this.ambientLight=new d.a.AmbientLight,e.add(this.mainLight),e.add(this.ambientLight)},dispose:function(){this._lightRoot&&(this._lightRoot.remove(this.mainLight),this._lightRoot.remove(this.ambientLight))},updateLight:function(e){var t=this.mainLight,r=this.ambientLight,n=e.getModel("light"),i=n.getModel("main"),a=n.getModel("ambient");t.intensity=i.get("intensity"),r.intensity=a.get("intensity"),t.color=d.a.parseColor(i.get("color")).slice(0,3),r.color=d.a.parseColor(a.get("color")).slice(0,3);var o=i.get("alpha")||0,s=i.get("beta")||0;t.position.setArray(d.a.directionFromAlphaBeta(o,s)),t.lookAt(d.a.Vector3.ZERO),t.castShadow=i.get("shadow"),t.shadowResolution=d.a.getShadowResolution(i.get("shadowQuality"))},updateAmbientCubemap:function(e,t,r){var n,i,a=t.getModel("light.ambientCubemap"),o=a.get("texture");o?(this._cubemapLightsCache=this._cubemapLightsCache||{},(i=this._cubemapLightsCache[o])||(i=(n=this)._cubemapLightsCache[o]=d.a.createAmbientCubemap(a.option,e,r,function(){n._isSkyboxFromAmbientCubemap&&n._skybox.setEnvironmentMap(i.specular.cubemap),r.getZr().refresh()})),this._lightRoot.add(i.diffuse),this._lightRoot.add(i.specular),this._currentCubemapLights=i):this._currentCubemapLights&&(this._lightRoot.remove(this._currentCubemapLights.diffuse),this._lightRoot.remove(this._currentCubemapLights.specular),this._currentCubemapLights=null)},updateSkybox:function(e,t,r){var n,i,a,o,s=t.get("environment"),u=this,l=(u._skybox=u._skybox||new f.a,u._skybox);s&&"none"!==s?"auto"===s?(this._isSkyboxFromAmbientCubemap=!0,this._currentCubemapLights?(n=this._currentCubemapLights.specular.cubemap,l.setEnvironmentMap(n),this._scene&&l.attachScene(this._scene),l.material.set("lod",3)):this._skybox&&this._skybox.detachScene()):("object"==_typeof(s)&&s.colorStops||"string"==typeof s&&p.a.color.parse(s)?(this._isSkyboxFromAmbientCubemap=!1,o=new d.a.Texture2D({anisotropic:8,flipY:!1}),l.setEnvironmentMap(o),(i=o.image=document.createElement("canvas")).width=i.height=16,a=i.getContext("2d"),new p.a.graphic.Rect({shape:{x:0,y:0,width:16,height:16},style:{fill:s}}).brush(a)):(this._isSkyboxFromAmbientCubemap=!1,o=d.a.loadTexture(s,r,{anisotropic:8,flipY:!1}),l.setEnvironmentMap(o)),l.attachScene(this._scene)):(this._skybox&&this._skybox.detachScene(this._scene),this._skybox=null);var h,c=t.coordinateSystem;this._skybox&&(!c||!c.viewGL||"auto"===s||s.match&&s.match(/.hdr$/)?this._skybox.material.undefine("fragment","SRGB_DECODE"):(h=c.viewGL.isLinearSpace()?"define":"undefine",this._skybox.material[h]("fragment","SRGB_DECODE")))}},t.a=n},function(e,t,r){"use strict";t.a={defaultOption:{shading:null,realisticMaterial:{textureTiling:1,textureOffset:0,detailTexture:null},lambertMaterial:{textureTiling:1,textureOffset:0,detailTexture:null},colorMaterial:{textureTiling:1,textureOffset:0,detailTexture:null},hatchingMaterial:{textureTiling:1,textureOffset:0,paperColor:"#fff"}}}},function(e,t,r){"use strict";var n=r(0),l=r.n(n),i={getFormattedLabel:function(e,t,r,n,i){r=r||"normal";var a=e.getData(n).getItemModel(t),o=e.getDataParams(t,n);null!=i&&o.value instanceof Array&&(o.value=o.value[i]);var s,u=a.get("normal"===r?["label","formatter"]:["emphasis","label","formatter"]);return null==u&&(u=a.get(["label","formatter"])),"function"==typeof u?(o.status=r,s=u(o)):"string"==typeof u&&(s=l.a.format.formatTpl(u,o)),s},normalizeToArray:function(e){return e instanceof Array?e:null==e?[]:[e]}};t.a=i},function(e,t,r){"use strict";var u,a=r(20),n={create:function(){var e=new a.a(4);return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e},clone:function(e){var t=new a.a(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},fromValues:function(e,t,r,n){var i=new a.a(4);return i[0]=e,i[1]=t,i[2]=r,i[3]=n,i},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},set:function(e,t,r,n,i){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e},add:function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e},subtract:function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e}};n.sub=n.subtract,n.multiply=function(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e[3]=t[3]*r[3],e},n.mul=n.multiply,n.divide=function(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e[3]=t[3]/r[3],e},n.div=n.divide,n.min=function(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e[3]=Math.min(t[3],r[3]),e},n.max=function(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e[3]=Math.max(t[3],r[3]),e},n.scale=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e},n.scaleAndAdd=function(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e},n.distance=function(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2],a=t[3]-e[3];return Math.sqrt(r*r+n*n+i*i+a*a)},n.dist=n.distance,n.squaredDistance=function(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2],a=t[3]-e[3];return r*r+n*n+i*i+a*a},n.sqrDist=n.squaredDistance,n.length=function(e){var t=e[0],r=e[1],n=e[2],i=e[3];return Math.sqrt(t*t+r*r+n*n+i*i)},n.len=n.length,n.squaredLength=function(e){var t=e[0],r=e[1],n=e[2],i=e[3];return t*t+r*r+n*n+i*i},n.sqrLen=n.squaredLength,n.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e},n.inverse=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e},n.normalize=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r*r+n*n+i*i+a*a;return 0<o&&(o=1/Math.sqrt(o),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e[3]=t[3]*o),e},n.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},n.lerp=function(e,t,r,n){var i=t[0],a=t[1],o=t[2],s=t[3];return e[0]=i+n*(r[0]-i),e[1]=a+n*(r[1]-a),e[2]=o+n*(r[2]-o),e[3]=s+n*(r[3]-s),e},n.random=function(e,t){return t=t||1,e[0]=Object(a.c)(),e[1]=Object(a.c)(),e[2]=Object(a.c)(),e[3]=Object(a.c)(),n.normalize(e,e),n.scale(e,e,t),e},n.transformMat4=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,e[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,e[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,e[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,e},n.transformQuat=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],u=r[2],l=r[3],h=l*n+s*a-u*i,c=l*i+u*n-o*a,d=l*a+o*i-s*n,f=-o*n-s*i-u*a;return e[0]=h*l+f*-o+c*-u-d*-s,e[1]=c*l+f*-s+d*-o-h*-u,e[2]=d*l+f*-u+h*-s-c*-o,e},n.forEach=(u=n.create(),function(e,t,r,n,i,a){var o,s;for(t=t||4,r=r||0,s=n?Math.min(n*t+r,e.length):e.length,o=r;o<s;o+=t)u[0]=e[o],u[1]=e[o+1],u[2]=e[o+2],u[3]=e[o+3],i(u,u,a),e[o]=u[0],e[o+1]=u[1],e[o+2]=u[2],e[o+3]=u[3];return e}),t.a=n},function(e,t,r){"use strict";var n=r(20),i={create:function(){var e=new n.a(9);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},fromMat4:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e},clone:function(e){var t=new n.a(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},copy:function(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[6]=t[6],e[7]=t[7],e[8]=t[8],e},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},transpose:function(e,t){var r,n,i;return e===t?(r=t[1],n=t[2],i=t[5],e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=n,e[7]=i):(e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8]),e},invert:function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],l=t[7],h=t[8],c=h*o-s*l,d=-h*a+s*u,f=l*a-o*u,p=r*c+n*d+i*f;return p?(p=1/p,e[0]=c*p,e[1]=(-h*n+i*l)*p,e[2]=(s*n-i*o)*p,e[3]=d*p,e[4]=(h*r-i*u)*p,e[5]=(-s*r+i*a)*p,e[6]=f*p,e[7]=(-l*r+n*u)*p,e[8]=(o*r-n*a)*p,e):null},adjoint:function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],l=t[7],h=t[8];return e[0]=o*h-s*l,e[1]=i*l-n*h,e[2]=n*s-i*o,e[3]=s*u-a*h,e[4]=r*h-i*u,e[5]=i*a-r*s,e[6]=a*l-o*u,e[7]=n*u-r*l,e[8]=r*o-n*a,e},determinant:function(e){var t=e[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],u=e[7],l=e[8];return t*(l*a-o*u)+r*(-l*i+o*s)+n*(u*i-a*s)},multiply:function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],l=t[6],h=t[7],c=t[8],d=r[0],f=r[1],p=r[2],m=r[3],g=r[4],_=r[5],v=r[6],y=r[7],x=r[8];return e[0]=d*n+f*o+p*l,e[1]=d*i+f*s+p*h,e[2]=d*a+f*u+p*c,e[3]=m*n+g*o+_*l,e[4]=m*i+g*s+_*h,e[5]=m*a+g*u+_*c,e[6]=v*n+y*o+x*l,e[7]=v*i+y*s+x*h,e[8]=v*a+y*u+x*c,e}};i.mul=i.multiply,i.translate=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],l=t[6],h=t[7],c=t[8],d=r[0],f=r[1];return e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=u,e[6]=d*n+f*o+l,e[7]=d*i+f*s+h,e[8]=d*a+f*u+c,e},i.rotate=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],l=t[6],h=t[7],c=t[8],d=Math.sin(r),f=Math.cos(r);return e[0]=f*n+d*o,e[1]=f*i+d*s,e[2]=f*a+d*u,e[3]=f*o-d*n,e[4]=f*s-d*i,e[5]=f*u-d*a,e[6]=l,e[7]=h,e[8]=c,e},i.scale=function(e,t,r){var n=r[0],i=r[1];return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=i*t[3],e[4]=i*t[4],e[5]=i*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},i.fromMat2d=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e},i.fromQuat=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r+r,s=n+n,u=i+i,l=r*o,h=n*o,c=n*s,d=i*o,f=i*s,p=i*u,m=a*o,g=a*s,_=a*u;return e[0]=1-c-p,e[3]=h-_,e[6]=d+g,e[1]=h+_,e[4]=1-l-p,e[7]=f-m,e[2]=d-g,e[5]=f+m,e[8]=1-l-c,e},i.normalFromMat4=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],l=t[7],h=t[8],c=t[9],d=t[10],f=t[11],p=t[12],m=t[13],g=t[14],_=t[15],v=r*s-n*o,y=r*u-i*o,x=r*l-a*o,T=n*u-i*s,b=n*l-a*s,w=i*l-a*u,E=h*m-c*p,S=h*g-d*p,A=h*_-f*p,M=c*g-d*m,C=c*_-f*m,L=d*_-f*g,D=v*L-y*C+x*M+T*A-b*S+w*E;return D?(D=1/D,e[0]=(s*L-u*C+l*M)*D,e[1]=(u*A-o*L-l*S)*D,e[2]=(o*C-s*A+l*E)*D,e[3]=(i*C-n*L-a*M)*D,e[4]=(r*L-i*A+a*S)*D,e[5]=(n*A-r*C-a*E)*D,e[6]=(m*w-g*b+_*T)*D,e[7]=(g*x-p*w-_*y)*D,e[8]=(p*b-m*x+_*v)*D,e):null},i.frob=function(e){return Math.sqrt(Math.pow(e[0],2)+Math.pow(e[1],2)+Math.pow(e[2],2)+Math.pow(e[3],2)+Math.pow(e[4],2)+Math.pow(e[5],2)+Math.pow(e[6],2)+Math.pow(e[7],2)+Math.pow(e[8],2))},t.a=i},function(e,t,r){"use strict";var n,i,a,o,s,u,l,h=r(7),c=r(3),d=r(56),f=r(9),p=r(21),m=r(18),g=0,_=h.a.extend({name:"",position:null,rotation:null,scale:null,worldTransform:null,localTransform:null,autoUpdateLocalTransform:!0,_parent:null,_scene:null,_needsUpdateWorldTransform:!0,_inIterating:!1,__depth:0},function(){this.name||(this.name=(this.type||"NODE")+"_"+g++),this.position||(this.position=new c.a),this.rotation||(this.rotation=new d.a),this.scale||(this.scale=new c.a(1,1,1)),this.worldTransform=new f.a,this.localTransform=new f.a,this._children=[]},{target:null,invisible:!1,isSkinnedMesh:function(){return!1},isRenderable:function(){return!1},setName:function(e){var t,r=this._scene;r&&(delete(t=r._nodeRepository)[this.name],t[e]=this),this.name=e},add:function(e){var t,r=e._parent;r!==this&&(r&&r.remove(e),(e._parent=this)._children.push(e),(t=this._scene)&&t!==e.scene&&e.traverse(this._addSelfToScene,this),e._needsUpdateWorldTransform=!0)},remove:function(e){var t=this._children,r=t.indexOf(e);r<0||(t.splice(r,1),e._parent=null,this._scene&&e.traverse(this._removeSelfFromScene,this))},removeAll:function(){for(var e=this._children,t=0;t<e.length;t++)e[t]._parent=null,this._scene&&e[t].traverse(this._removeSelfFromScene,this);this._children=[]},getScene:function(){return this._scene},getParent:function(){return this._parent},_removeSelfFromScene:function(e){e._scene.removeFromScene(e),e._scene=null},_addSelfToScene:function(e){this._scene.addToScene(e),e._scene=this._scene},isAncestor:function(e){for(var t=e._parent;t;){if(t===this)return!0;t=t._parent}return!1},children:function(){return this._children.slice()},childAt:function(e){return this._children[e]},getChildByName:function(e){for(var t=this._children,r=0;r<t.length;r++)if(t[r].name===e)return t[r]},getDescendantByName:function(e){for(var t=this._children,r=0;r<t.length;r++){var n=t[r];if(n.name===e)return n;var i=n.getDescendantByName(e);if(i)return i}},queryNode:function(e){if(e){for(var t=e.split("/"),r=this,n=0;n<t.length;n++){var i=t[n];if(i){for(var a=!1,o=r._children,s=0;s<o.length;s++){var u=o[s];if(u.name===i){r=u,a=!0;break}}if(!a)return}}return r}},getPath:function(e){if(!this._parent)return"/";for(var t=this._parent,r=this.name;t._parent&&(r=t.name+"/"+r,t._parent!=e);)t=t._parent;return!t._parent&&e?null:r},traverse:function(e,t){e.call(t,this);for(var r=this._children,n=0,i=r.length;n<i;n++)r[n].traverse(e,t)},eachChild:function(e,t){for(var r=this._children,n=0,i=r.length;n<i;n++){var a=r[n];e.call(t,a,n)}},setLocalTransform:function(e){p.a.copy(this.localTransform.array,e.array),this.decomposeLocalTransform()},decomposeLocalTransform:function(e){var t=e?null:this.scale;this.localTransform.decomposeMatrix(t,this.rotation,this.position)},setWorldTransform:function(e){p.a.copy(this.worldTransform.array,e.array),this.decomposeWorldTransform()},decomposeWorldTransform:(l=p.a.create(),function(e){var t=this.localTransform,r=this.worldTransform;this._parent?(p.a.invert(l,this._parent.worldTransform.array),p.a.multiply(t.array,l,r.array)):p.a.copy(t.array,r.array);var n=e?null:this.scale;t.decomposeMatrix(n,this.rotation,this.position)}),transformNeedsUpdate:function(){return this.position._dirty||this.rotation._dirty||this.scale._dirty},updateLocalTransform:function(){var e,t=this.position,r=this.rotation,n=this.scale;this.transformNeedsUpdate()&&(e=this.localTransform.array,p.a.fromRotationTranslation(e,r.array,t.array),p.a.scale(e,e,n.array),r._dirty=!1,n._dirty=!1,t._dirty=!1,this._needsUpdateWorldTransform=!0)},_updateWorldTransformTopDown:function(){var e=this.localTransform.array,t=this.worldTransform.array;this._parent?p.a.multiplyAffine(t,this._parent.worldTransform.array,e):p.a.copy(t,e)},updateWorldTransform:function(){for(var e=this;e&&e.getParent()&&e.getParent().transformNeedsUpdate();)e=e.getParent();e.update()},update:function(e){this.autoUpdateLocalTransform?this.updateLocalTransform():e=!0,(e||this._needsUpdateWorldTransform)&&(this._updateWorldTransformTopDown(),e=!0,this._needsUpdateWorldTransform=!1);for(var t=this._children,r=0,n=t.length;r<n;r++)t[r].update(e)},getBoundingBox:(o=new m.a,s=new f.a,u=new f.a,function(e,t){return t=t||new m.a,this._parent?f.a.invert(u,this._parent.worldTransform):f.a.identity(u),this.traverse(function(e){e.geometry&&e.geometry.boundingBox&&(o.copy(e.geometry.boundingBox),f.a.multiply(s,u,e.worldTransform),o.applyTransform(s),t.union(o))},this,v),t}),getWorldPosition:function(e){this.transformNeedsUpdate()&&this.updateWorldTransform();var t=this.worldTransform.array;if(e){var r=e.array;return r[0]=t[12],r[1]=t[13],r[2]=t[14],e}return new c.a(t[12],t[13],t[14])},clone:function(){var e=new this.constructor,t=this._children;e.setName(this.name),e.position.copy(this.position),e.rotation.copy(this.rotation),e.scale.copy(this.scale);for(var r=0;r<t.length;r++)e.add(t[r].clone());return e},rotateAround:(i=new c.a,a=new f.a,function(e,t,r){i.copy(this.position).subtract(e);var n=this.localTransform;n.identity(),n.translate(e),n.rotate(r,t),a.fromRotationTranslation(this.rotation,i),n.multiply(a),n.scale(this.scale),this.decomposeLocalTransform(),this._needsUpdateWorldTransform=!0}),lookAt:(n=new f.a,function(e,t){n.lookAt(this.position,e,t||this.localTransform.y).invert(),this.setLocalTransform(n),this.target=e})});function v(e){return!e.invisible&&e.geometry}t.a=_},function(e,t,r){"use strict";function a(){this.opaque=[],this.transparent=[],this._opaqueCount=0,this._transparentCount=0}function h(e,t){if(t.castShadow&&!e.castShadow)return!0}var n=r(35),i=r(24),o=r(58),s=r(18),u=r(23),l=r(21),c=r(69),d=r(9),f=l.a.create(),p=l.a.create(),m={};a.prototype.startCount=function(){this._opaqueCount=0,this._transparentCount=0},a.prototype.add=function(e,t){t?this.transparent[this._transparentCount++]=e:this.opaque[this._opaqueCount++]=e},a.prototype.endCount=function(){this.transparent.length=this._transparentCount,this.opaque.length=this._opaqueCount};var g,_,v=n.a.extend(function(){return{material:null,lights:[],viewBoundingBoxLastFrame:new s.a,shadowUniforms:{},_cameraList:[],_lightUniforms:{},_previousLightNumber:{},_lightNumber:{},_lightProgramKeys:{},_nodeRepository:{},_renderLists:new c.a(20)}},function(){this._scene=this},{addToScene:function(e){e instanceof o.a?(0<this._cameraList.length&&console.warn("Found multiple camera in one scene. Use the fist one."),this._cameraList.push(e)):e instanceof i.a&&this.lights.push(e),e.name&&(this._nodeRepository[e.name]=e)},removeFromScene:function(e){var t;e instanceof o.a?0<=(t=this._cameraList.indexOf(e))&&this._cameraList.splice(t,1):e instanceof i.a&&0<=(t=this.lights.indexOf(e))&&this.lights.splice(t,1),e.name&&delete this._nodeRepository[e.name]},getNode:function(e){return this._nodeRepository[e]},setMainCamera:function(e){var t=this._cameraList.indexOf(e);0<=t&&this._cameraList.splice(t,1),this._cameraList.unshift(e)},getMainCamera:function(){return this._cameraList[0]},getLights:function(){return this.lights},updateLights:function(){var e=this.lights;this._previousLightNumber=this._lightNumber;for(var t,r={},n=0;n<e.length;n++){var i,a=e[n];a.invisible||(r[i=a.group]||(r[i]={}),r[i][a.type]=r[i][a.type]||0,r[i][a.type]++)}for(t in this._lightNumber=r)this._lightProgramKeys[t]=function(e){var t=[],r=Object.keys(e);r.sort();for(var n=0;n<r.length;n++){var i=r[n];t.push(i+" "+e[i])}var a=t.join("\n");if(m[a])return m[a];var o=u.a.genGUID();return m[a]=o}(r[t]);this._updateLightUniforms()},cloneNode:function(e){var t=e.clone(),i={};return function e(t,r){i[t.__uid__]=r;for(var n=0;n<t._children.length;n++)e(t._children[n],r._children[n])}(e,t),t.traverse(function(e){e.skeleton&&(e.skeleton=e.skeleton.clone(i)),e.material&&(e.material=e.material.clone())}),t},updateRenderList:function(e,t){var r=e.__uid__,n=this._renderLists.get(r);n||(n=new a,this._renderLists.put(r,n)),n.startCount(),t&&(this.viewBoundingBoxLastFrame.min.set(1/0,1/0,1/0),this.viewBoundingBoxLastFrame.max.set(-1/0,-1/0,-1/0));var i=this.material&&this.material.transparent||!1;return this._doUpdateRenderList(this,e,i,n,t),n.endCount(),n},getRenderList:function(e){return this._renderLists.get(e.__uid__)},_doUpdateRenderList:function(e,t,r,n,i){if(!e.invisible)for(var a=0;a<e._children.length;a++){var o,s,u=e._children[a];u.isRenderable()&&(o=u.isSkinnedMesh()?f:u.worldTransform.array,s=u.geometry,l.a.multiplyAffine(p,t.viewMatrix.array,o),(!i||s.boundingBox)&&this.isFrustumCulled(u,t,p)||n.add(u,u.material.transparent||r)),0<u._children.length&&this._doUpdateRenderList(u,t,r,n,i)}},isFrustumCulled:(g=new s.a,_=new d.a,function(e,t,r){var n=e.boundingBox;if(!(n=n||(e.skeleton&&e.skeleton.boundingBox?e.skeleton.boundingBox:e.geometry.boundingBox)))return!1;if(_.array=r,g.transformFrom(n,_),e.castShadow&&this.viewBoundingBoxLastFrame.union(g),e.frustumCulling){if(!g.intersectBoundingBox(t.frustum.boundingBox))return!0;_.array=t.projectionMatrix.array,0<g.max.array[2]&&g.min.array[2]<0&&(g.max.array[2]=-1e-20),g.applyProjection(_);var i=g.min.array,a=g.max.array;if(a[0]<-1||1<i[0]||a[1]<-1||1<i[1]||a[2]<-1||1<i[2])return!0}return!1}),_updateLightUniforms:function(){var e=this.lights;e.sort(h);var t=this._lightUniforms;for(a in t)for(var r in t[a])t[a][r].value.length=0;for(var n=0;n<e.length;n++){var i=e[n];if(!i.invisible){var a=i.group;for(r in i.uniformTemplates){var o=i.uniformTemplates[r],s=o.value(i);if(null!=s){t[a]||(t[a]={}),t[a][r]||(t[a][r]={type:"",value:[]});var u=t[a][r];switch(u.type=o.type+"v",o.type){case"1i":case"1f":case"t":u.value.push(s);break;case"2f":case"3f":case"4f":for(var l=0;l<s.length;l++)u.value.push(s[l]);break;default:console.error("Unkown light uniform type "+o.type)}}}}}},getLightGroups:function(){var e,t=[];for(e in this._lightNumber)t.push(e);return t},getNumberChangedLightGroups:function(){var e,t=[];for(e in this._lightNumber)this.isLightNumberChanged(e)&&t.push(e);return t},isLightNumberChanged:function(e){var t,r=this._previousLightNumber,n=this._lightNumber;for(t in n[e]){if(!r[e])return!0;if(n[e][t]!==r[e][t])return!0}for(t in r[e]){if(!n[e])return!0;if(n[e][t]!==r[e][t])return!0}return!1},getLightsNumbers:function(e){return this._lightNumber[e]},getProgramKey:function(e){return this._lightProgramKeys[e]},setLightUniforms:function(e,t,r){y(this._lightUniforms[t],e,r),y(this.shadowUniforms,e,r)},dispose:function(){this.material=null,this._opaqueList=[],this._transparentList=[],this.lights=[],this._lightUniforms={},this._lightNumber={},this._nodeRepository={}}});function y(e,t,r){for(var n in e){var i=e[n];if("tv"===i.type){if(!t.hasUniform(n))continue;for(var a=[],o=0;o<i.value.length;o++){var s=i.value[o],u=t.takeCurrentTextureSlot(r,s);a.push(u)}t.setUniform(r.gl,"1iv",n,a)}else t.setUniform(r.gl,i.type,n,i.value)}}t.a=v},function(e,t,r){"use strict";var n=r(58),i=n.a.extend({left:-1,right:1,near:-1,far:1,top:1,bottom:-1},{updateProjectionMatrix:function(){this.projectionMatrix.ortho(this.left,this.right,this.bottom,this.top,this.near,this.far)},decomposeProjectionMatrix:function(){var e=this.projectionMatrix.array;this.left=(-1-e[12])/e[0],this.right=(1-e[12])/e[0],this.top=(1-e[13])/e[5],this.bottom=(-1-e[13])/e[5],this.near=-(-1-e[14])/e[10],this.far=-(1-e[14])/e[10]},clone:function(){var e=n.a.prototype.clone.call(this);return e.left=this.left,e.right=this.right,e.near=this.near,e.far=this.far,e.top=this.top,e.bottom=this.bottom,e}});t.a=i},function(e,t,r){"use strict";t.a={convertToDynamicArray:function(e){e&&this.resetOffset();var t,r=this.attributes;for(t in r)e||!r[t].value?r[t].value=[]:r[t].value=Array.prototype.slice.call(r[t].value);e||!this.indices?this.indices=[]:this.indices=Array.prototype.slice.call(this.indices)},convertToTypedArray:function(){var e,t=this.attributes;for(e in t)t[e].value&&0<t[e].value.length?t[e].value=new Float32Array(t[e].value):t[e].value=null;this.indices&&0<this.indices.length&&(this.indices=new(65535<this.vertexCount?Uint32Array:Uint16Array)(this.indices)),this.dirty()}}},function(e,t,r){"use strict";var n=r(0),_=r.n(n);t.a=function(e,t,a){var r,n,i,o,s,u,l=e.getData(),h=e.getRawValue(t),c=_.a.util.isArray(h)?(r=h,s=[],n=l,i="tooltip",o=[],_.a.util.each(n.dimensions,function(e){var t=n.getDimensionInfo(e),r=t.otherDims[i];null!=r&&!1!==r&&(o[r]=t.name)}),(u=o).length?_.a.util.each(u,function(e){p(l.get(e,t),e)}):_.a.util.each(r,p),"<br/>"+s.join("<br/>")):_.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?": ":"<br/>"):"",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&&0<this.joints.length)},clone:function(){var e=n.a.prototype.clone.call(this);return e.skeleton=this.skeleton,this.joints&&(e.joints=this.joints.slice()),e}});a.POINTS=i.a.POINTS,a.LINES=i.a.LINES,a.LINE_LOOP=i.a.LINE_LOOP,a.LINE_STRIP=i.a.LINE_STRIP,a.TRIANGLES=i.a.TRIANGLES,a.TRIANGLE_STRIP=i.a.TRIANGLE_STRIP,a.TRIANGLE_FAN=i.a.TRIANGLE_FAN,a.BACK=i.a.BACK,a.FRONT=i.a.FRONT,a.FRONT_AND_BACK=i.a.FRONT_AND_BACK,a.CW=i.a.CW,a.CCW=i.a.CCW,t.a=a},function(e,t,r){"use strict";var n=r(58),i=n.a.extend({fov:50,aspect:1,near:.1,far:2e3},{updateProjectionMatrix:function(){var e=this.fov/180*Math.PI;this.projectionMatrix.perspective(e,this.aspect,this.near,this.far)},decomposeProjectionMatrix:function(){var e=this.projectionMatrix.array,t=2*Math.atan(1/e[5]);this.fov=t/Math.PI*180,this.aspect=e[5]/e[0],this.near=e[14]/(e[10]-1),this.far=e[14]/(e[10]+1)},clone:function(){var e=n.a.prototype.clone.call(this);return e.fov=this.fov,e.aspect=this.aspect,e.near=this.near,e.far=this.far,e}});t.a=i},function(e,t,r){"use strict";var n=r(40),i=r(76),a=r(8),o=r(19),s=r(4),u=r(121);a.a.import(u.a);var l=n.a.extend(function(){var e=new a.a({vertex:a.a.source("clay.skybox.vertex"),fragment:a.a.source("clay.skybox.fragment")}),t=new o.a({shader:e,depthMask:!1});return{scene:null,geometry:new i.a,material:t,environmentMap:null,culling:!1}},function(){var e=this.scene;e&&this.attachScene(e),this.environmentMap&&this.setEnvironmentMap(this.environmentMap)},{attachScene:function(e){this.scene&&this.detachScene(),((e.skybox=this).scene=e).on("beforerender",this._beforeRenderScene,this)},detachScene:function(){this.scene&&(this.scene.off("beforerender",this._beforeRenderScene),this.scene.skybox=null),this.scene=null},dispose:function(e){this.detachScene(),this.geometry.dispose(e)},setEnvironmentMap:function(e){"texture2D"===e.textureType?(this.material.define("EQUIRECTANGULAR"),e.minFilter=s.a.LINEAR):this.material.undefine("EQUIRECTANGULAR"),this.material.set("environmentMap",e)},getEnvironmentMap:function(){return this.material.get("environmentMap")},_beforeRenderScene:function(e,t,r){this.renderSkybox(e,r)},renderSkybox:function(e,t){this.position.copy(t.getWorldPosition()),this.update(),e.gl.disable(e.gl.BLEND),0<this.material.get("lod")?this.material.define("fragment","LOD"):this.material.undefine("fragment","LOD"),e.renderPass([this],t)}});t.a=l},function(e,t,r){"use strict";var n=r(15),d=r(18),i=n.a.extend({dynamic:!1,widthSegments:1,heightSegments:1},function(){this.build()},{build:function(){for(var e=this.heightSegments,t=this.widthSegments,r=this.attributes,n=[],i=[],a=[],o=[],s=0;s<=e;s++)for(var u=s/e,l=0;l<=t;l++){var h,c=l/t;n.push([2*c-1,2*u-1,0]),i&&i.push([c,u]),a&&a.push([0,0,1]),l<t&&s<e&&(h=l+s*(t+1),o.push([h,h+1,h+t+1]),o.push([h+t+1,h+1,h+t+2]))}r.position.fromArray(n),r.texcoord0.fromArray(i),r.normal.fromArray(a),this.initIndicesFromArray(o),this.boundingBox=new d.a,this.boundingBox.min.set(-1,-1,0),this.boundingBox.max.set(1,1,0)}});t.a=i},function(e,t,r){"use strict";t.a={defaultOption:{viewControl:{projection:"perspective",autoRotate:!1,autoRotateDirection:"cw",autoRotateSpeed:10,autoRotateAfterStill:3,damping:.8,rotateSensitivity:1,zoomSensitivity:1,panSensitivity:1,panMouseButton:"middle",rotateMouseButton:"left",distance:150,minDistance:40,maxDistance:400,orthographicSize:150,maxOrthographicSize:400,minOrthographicSize:20,center:[0,0,0],alpha:0,beta:0,minAlpha:-90,maxAlpha:90}},setView:function(e){e=e||{},this.option.viewControl=this.option.viewControl||{},null!=e.alpha&&(this.option.viewControl.alpha=e.alpha),null!=e.beta&&(this.option.viewControl.beta=e.beta),null!=e.distance&&(this.option.viewControl.distance=e.distance),null!=e.center&&(this.option.viewControl.center=e.center)}}},function(e,t,r){"use strict";function n(e){return e instanceof Array||(e=[e,e]),e}var i=r(7),a=r(26),o=r(3),d=(r(56),r(2)).a.firstNotNull,s={left:0,middle:1,right:2},u=i.a.extend(function(){return{zr:null,viewGL:null,_center:new o.a,minDistance:.5,maxDistance:1.5,maxOrthographicSize:300,minOrthographicSize:30,minAlpha:-90,maxAlpha:90,minBeta:-1/0,maxBeta:1/0,autoRotateAfterStill:0,autoRotateDirection:"cw",autoRotateSpeed:60,damping:.8,rotateSensitivity:1,zoomSensitivity:1,panSensitivity:1,panMouseButton:"middle",rotateMouseButton:"left",_mode:"rotate",_camera:null,_needsUpdate:!1,_rotating:!1,_phi:0,_theta:0,_mouseX:0,_mouseY:0,_rotateVelocity:new a.a,_panVelocity:new a.a,_distance:500,_zoomSpeed:0,_stillTimeout:0,_animators:[]}},function(){["_mouseDownHandler","_mouseWheelHandler","_mouseMoveHandler","_mouseUpHandler","_pinchHandler","_contextMenuHandler","_update"].forEach(function(e){this[e]=this[e].bind(this)},this)},{init:function(){var e=this.zr;e&&(e.on("mousedown",this._mouseDownHandler),e.on("globalout",this._mouseUpHandler),e.on("mousewheel",this._mouseWheelHandler),e.on("pinch",this._pinchHandler),e.animation.on("frame",this._update),e.dom.addEventListener("contextmenu",this._contextMenuHandler))},dispose:function(){var e=this.zr;e&&(e.off("mousedown",this._mouseDownHandler),e.off("mousemove",this._mouseMoveHandler),e.off("mouseup",this._mouseUpHandler),e.off("mousewheel",this._mouseWheelHandler),e.off("pinch",this._pinchHandler),e.off("globalout",this._mouseUpHandler),e.dom.removeEventListener("contextmenu",this._contextMenuHandler),e.animation.off("frame",this._update)),this.stopAllAnimation()},getDistance:function(){return this._distance},setDistance:function(e){this._distance=e,this._needsUpdate=!0},getOrthographicSize:function(){return this._orthoSize},setOrthographicSize:function(e){this._orthoSize=e,this._needsUpdate=!0},getAlpha:function(){return this._theta/Math.PI*180},getBeta:function(){return-this._phi/Math.PI*180},getCenter:function(){return this._center.toArray()},setAlpha:function(e){e=Math.max(Math.min(this.maxAlpha,e),this.minAlpha),this._theta=e/180*Math.PI,this._needsUpdate=!0},setBeta:function(e){e=Math.max(Math.min(this.maxBeta,e),this.minBeta),this._phi=-e/180*Math.PI,this._needsUpdate=!0},setCenter:function(e){this._center.setArray(e)},setViewGL:function(e){this.viewGL=e},getCamera:function(){return this.viewGL.camera},setFromViewControlModel:function(t,e){var r=(e=e||{}).baseDistance||0,n=e.baseOrthoSize||1,i=t.get("projection");"perspective"!==i&&"orthographic"!==i&&"isometric"!==i&&(i="perspective"),this._projection=i,this.viewGL.setProjection(i);var a=t.get("distance")+r,o=t.get("orthographicSize")+n;[["damping",.8],["autoRotate",!1],["autoRotateAfterStill",3],["autoRotateDirection","cw"],["autoRotateSpeed",10],["minDistance",30],["maxDistance",400],["minOrthographicSize",30],["maxOrthographicSize",300],["minAlpha",-90],["maxAlpha",90],["minBeta",-1/0],["maxBeta",1/0],["rotateSensitivity",1],["zoomSensitivity",1],["panSensitivity",1],["panMouseButton","left"],["rotateMouseButton","middle"]].forEach(function(e){this[e[0]]=d(t.get(e[0]),e[1])},this),this.minDistance+=r,this.maxDistance+=r,this.minOrthographicSize+=n,this.maxOrthographicSize+=n;var s=t.ecModel,u={};["animation","animationDurationUpdate","animationEasingUpdate"].forEach(function(e){u[e]=d(t.get(e),s&&s.get(e))});var l=d(e.alpha,t.get("alpha"))||0,h=d(e.beta,t.get("beta"))||0,c=d(e.center,t.get("center"))||[0,0,0];u.animation&&0<u.animationDurationUpdate&&this._notFirst?this.animateTo({alpha:l,beta:h,center:c,distance:a,targetOrthographicSize:o,easing:u.animationEasingUpdate,duration:u.animationDurationUpdate}):(this.setDistance(a),this.setAlpha(l),this.setBeta(h),this.setCenter(c),this.setOrthographicSize(o)),this._notFirst=!0,this._validateProperties()},_validateProperties:function(){},animateTo:function(e){var t=this.zr,r=this,n={},i={};return null!=e.distance&&(n.distance=this.getDistance(),i.distance=e.distance),null!=e.orthographicSize&&(n.orthographicSize=this.getOrthographicSize(),i.orthographicSize=e.orthographicSize),null!=e.alpha&&(n.alpha=this.getAlpha(),i.alpha=e.alpha),null!=e.beta&&(n.beta=this.getBeta(),i.beta=e.beta),null!=e.center&&(n.center=this.getCenter(),i.center=e.center),this._addAnimator(t.animation.animate(n).when(e.duration||1e3,i).during(function(){null!=n.alpha&&r.setAlpha(n.alpha),null!=n.beta&&r.setBeta(n.beta),null!=n.distance&&r.setDistance(n.distance),null!=n.center&&r.setCenter(n.center),null!=n.orthographicSize&&r.setOrthographicSize(n.orthographicSize),r._needsUpdate=!0})).start(e.easing||"linear")},stopAllAnimation:function(){for(var e=0;e<this._animators.length;e++)this._animators[e].stop();this._animators.length=0},update:function(){this._needsUpdate=!0,this._update(20)},_isAnimating:function(){return 0<this._animators.length},_update:function(e){var t;this._rotating?(t=("cw"===this.autoRotateDirection?1:-1)*this.autoRotateSpeed/180*Math.PI,this._phi-=t*e/1e3,this._needsUpdate=!0):0<this._rotateVelocity.len()&&(this._needsUpdate=!0),(.1<Math.abs(this._zoomSpeed)||0<this._panVelocity.len())&&(this._needsUpdate=!0),this._needsUpdate&&(e=Math.min(e,50),this._updateDistanceOrSize(e),this._updatePan(e),this._updateRotate(e),this._updateTransform(),this.getCamera().update(),this.zr&&this.zr.refresh(),this.trigger("update"),this._needsUpdate=!1)},_updateRotate:function(e){var t=this._rotateVelocity;this._phi=t.y*e/20+this._phi,this._theta=t.x*e/20+this._theta,this.setAlpha(this.getAlpha()),this.setBeta(this.getBeta()),this._vectorDamping(t,Math.pow(this.damping,e/16))},_updateDistanceOrSize:function(e){"perspective"===this._projection?this._setDistance(this._distance+this._zoomSpeed*e/20):this._setOrthoSize(this._orthoSize+this._zoomSpeed*e/20),this._zoomSpeed*=Math.pow(this.damping,e/16)},_setDistance:function(e){this._distance=Math.max(Math.min(e,this.maxDistance),this.minDistance)},_setOrthoSize:function(e){this._orthoSize=Math.max(Math.min(e,this.maxOrthographicSize),this.minOrthographicSize);var t=this.getCamera(),r=this._orthoSize,n=r/this.viewGL.viewport.height*this.viewGL.viewport.width;t.left=-n/2,t.right=n/2,t.top=r/2,t.bottom=-r/2},_updatePan:function(){var e=this._panVelocity,t=this._distance,r=this.getCamera(),n=r.worldTransform.y,i=r.worldTransform.x;this._center.scaleAndAdd(i,-e.x*t/200).scaleAndAdd(n,-e.y*t/200),this._vectorDamping(e,0)},_updateTransform:function(){var e=this.getCamera(),t=new o.a,r=this._theta+Math.PI/2,n=this._phi+Math.PI/2,i=Math.sin(r);t.x=i*Math.cos(n),t.y=-Math.cos(r),t.z=i*Math.sin(n),e.position.copy(this._center).scaleAndAdd(t,this._distance),e.rotation.identity().rotateY(-this._phi).rotateX(-this._theta)},_startCountingStill:function(){clearTimeout(this._stillTimeout);var e=this.autoRotateAfterStill,t=this;!isNaN(e)&&0<e&&(this._stillTimeout=setTimeout(function(){t._rotating=!0},1e3*e))},_vectorDamping:function(e,t){var r=e.len();(r*=t)<1e-4&&(r=0),e.normalize().scale(r)},_decomposeTransform:function(){var e,t,r;this.getCamera()&&(this.getCamera().updateWorldTransform(),e=this.getCamera().worldTransform.z,t=Math.asin(e.y),r=Math.atan2(e.x,e.z),this._theta=t,this._phi=-r,this.setBeta(this.getBeta()),this.setAlpha(this.getAlpha()),this.getCamera().aspect?this._setDistance(this.getCamera().position.dist(this._center)):this._setOrthoSize(this.getCamera().top-this.getCamera().bottom))},_mouseDownHandler:function(e){var t,r;e.target||this._isAnimating()||(t=e.offsetX,r=e.offsetY,this.viewGL&&!this.viewGL.containPoint(t,r)||(this.zr.on("mousemove",this._mouseMoveHandler),this.zr.on("mouseup",this._mouseUpHandler),e.event.targetTouches?1===e.event.targetTouches.length&&(this._mode="rotate"):e.event.button===s[this.rotateMouseButton]?this._mode="rotate":e.event.button===s[this.panMouseButton]?this._mode="pan":this._mode="",this._rotateVelocity.set(0,0),this._rotating=!1,this.autoRotate&&this._startCountingStill(),this._mouseX=e.offsetX,this._mouseY=e.offsetY))},_mouseMoveHandler:function(e){var t,r;e.target&&e.target.__isGLToZRProxy||this._isAnimating()||(t=n(this.panSensitivity),r=n(this.rotateSensitivity),"rotate"===this._mode?(this._rotateVelocity.y=(e.offsetX-this._mouseX)/this.zr.getHeight()*2*r[0],this._rotateVelocity.x=(e.offsetY-this._mouseY)/this.zr.getWidth()*2*r[1]):"pan"===this._mode&&(this._panVelocity.x=(e.offsetX-this._mouseX)/this.zr.getWidth()*t[0]*400,this._panVelocity.y=(-e.offsetY+this._mouseY)/this.zr.getHeight()*t[1]*400),this._mouseX=e.offsetX,this._mouseY=e.offsetY,e.event.preventDefault())},_mouseWheelHandler:function(e){var t;this._isAnimating()||(t=e.event.wheelDelta||-e.event.detail,this._zoomHandler(e,t))},_pinchHandler:function(e){this._isAnimating()||(this._zoomHandler(e,1<e.pinchScale?1:-1),this._mode="")},_zoomHandler:function(e,t){var r,n,i;0!==t&&(r=e.offsetX,n=e.offsetY,this.viewGL&&!this.viewGL.containPoint(r,n)||(i="perspective"===this._projection?Math.max(Math.max(Math.min(this._distance-this.minDistance,this.maxDistance-this._distance))/20,.5):Math.max(Math.max(Math.min(this._orthoSize-this.minOrthographicSize,this.maxOrthographicSize-this._orthoSize))/20,.5),this._zoomSpeed=(0<t?-1:1)*i*this.zoomSensitivity,this._rotating=!1,this.autoRotate&&"rotate"===this._mode&&this._startCountingStill(),e.event.preventDefault()))},_mouseUpHandler:function(){this.zr.off("mousemove",this._mouseMoveHandler),this.zr.off("mouseup",this._mouseUpHandler)},_isRightMouseButtonUsed:function(){return"right"===this.rotateMouseButton||"right"===this.panMouseButton},_contextMenuHandler:function(e){this._isRightMouseButtonUsed()&&e.preventDefault()},_addAnimator:function(t){var r=this._animators;return r.push(t),t.done(function(){var e=r.indexOf(t);0<=e&&r.splice(e,1)}),t}});Object.defineProperty(u.prototype,"autoRotate",{get:function(){return this._autoRotate},set:function(e){this._autoRotate=e,this._rotating=e}}),t.a=u},function(e,t,r){"use strict";t.a="@export ecgl.lines3D.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nattribute vec3 position: POSITION;\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n\nvoid main()\n{\n gl_Position = worldViewProjection * vec4(position, 1.0);\n v_Color = a_Color;\n}\n\n@end\n\n@export ecgl.lines3D.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nvarying vec4 v_Color;\n\n@import clay.util.srgb\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color * v_Color);\n#else\n gl_FragColor = color * v_Color;\n#endif\n}\n@end\n\n\n\n@export ecgl.lines3D.clipNear\n\nvec4 clipNear(vec4 p1, vec4 p2) {\n float n = (p1.w - near) / (p1.w - p2.w);\n return vec4(mix(p1.xy, p2.xy, n), -near, near);\n}\n\n@end\n\n@export ecgl.lines3D.expandLine\n#ifdef VERTEX_ANIMATION\n vec4 prevProj = worldViewProjection * vec4(mix(prevPositionPrev, positionPrev, percent), 1.0);\n vec4 currProj = worldViewProjection * vec4(mix(prevPosition, position, percent), 1.0);\n vec4 nextProj = worldViewProjection * vec4(mix(prevPositionNext, positionNext, percent), 1.0);\n#else\n vec4 prevProj = worldViewProjection * vec4(positionPrev, 1.0);\n vec4 currProj = worldViewProjection * vec4(position, 1.0);\n vec4 nextProj = worldViewProjection * vec4(positionNext, 1.0);\n#endif\n\n if (currProj.w < 0.0) {\n if (nextProj.w > 0.0) {\n currProj = clipNear(currProj, nextProj);\n }\n else if (prevProj.w > 0.0) {\n currProj = clipNear(currProj, prevProj);\n }\n }\n\n vec2 prevScreen = (prevProj.xy / abs(prevProj.w) + 1.0) * 0.5 * viewport.zw;\n vec2 currScreen = (currProj.xy / abs(currProj.w) + 1.0) * 0.5 * viewport.zw;\n vec2 nextScreen = (nextProj.xy / abs(nextProj.w) + 1.0) * 0.5 * viewport.zw;\n\n vec2 dir;\n float len = offset;\n if (position == positionPrev) {\n dir = normalize(nextScreen - currScreen);\n }\n else if (position == positionNext) {\n dir = normalize(currScreen - prevScreen);\n }\n else {\n vec2 dirA = normalize(currScreen - prevScreen);\n vec2 dirB = normalize(nextScreen - currScreen);\n\n vec2 tanget = normalize(dirA + dirB);\n\n float miter = 1.0 / max(dot(tanget, dirA), 0.5);\n len *= miter;\n dir = tanget;\n }\n\n dir = vec2(-dir.y, dir.x) * len;\n currScreen += dir;\n\n currProj.xy = (currScreen / viewport.zw - 0.5) * 2.0 * abs(currProj.w);\n@end\n\n\n@export ecgl.meshLines3D.vertex\n\nattribute vec3 position: POSITION;\nattribute vec3 positionPrev;\nattribute vec3 positionNext;\nattribute float offset;\nattribute vec4 a_Color : COLOR;\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nattribute vec3 prevPositionPrev;\nattribute vec3 prevPositionNext;\nuniform float percent : 1.0;\n#endif\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform vec4 viewport : VIEWPORT;\nuniform float near : NEAR;\n\nvarying vec4 v_Color;\n\n@import ecgl.common.wireframe.vertexHeader\n\n@import ecgl.lines3D.clipNear\n\nvoid main()\n{\n @import ecgl.lines3D.expandLine\n\n gl_Position = currProj;\n\n v_Color = a_Color;\n\n @import ecgl.common.wireframe.vertexMain\n}\n@end\n\n\n@export ecgl.meshLines3D.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nvarying vec4 v_Color;\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.util.srgb\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color * v_Color);\n#else\n gl_FragColor = color * v_Color;\n#endif\n\n @import ecgl.common.wireframe.fragmentMain\n}\n\n@end"},function(e,t,r){function n(h,c,d,f,p){var m=0,g=0;null==f&&(f=1/0),null==p&&(p=1/0);var _=0;c.eachChild(function(e,t){var r,n,i,a,o=e.position,s=e.getBoundingRect(),u=c.childAt(t+1),l=u&&u.getBoundingRect();_="horizontal"===h?(r=s.width+(l?-l.x+s.x:0),f<(n=m+r)||e.newline?(m=0,n=r,g+=_+d,s.height):Math.max(_,s.height)):(i=s.height+(l?-l.y+s.y:0),p<(a=g+i)||e.newline?(m+=_+d,g=0,a=i,s.width):Math.max(_,s.width)),e.newline||(o[0]=m,o[1]=g,"horizontal"===h?m=n+d:g=a+d)})}function f(e,t,r){r=_.normalizeCssArray(r||0);var n=t.width,i=t.height,a=g(e.left,n),o=g(e.top,i),s=g(e.right,n),u=g(e.bottom,i),l=g(e.width,n),h=g(e.height,i),c=r[2]+r[0],d=r[1]+r[3],f=e.aspect;switch(isNaN(l)&&(l=n-s-d-a),isNaN(h)&&(h=i-u-c-o),null!=f&&(isNaN(l)&&isNaN(h)&&(n/i<f?l=.8*n:h=.8*i),isNaN(l)&&(l=f*h),isNaN(h)&&(h=l/f)),isNaN(a)&&(a=n-s-l-d),isNaN(o)&&(o=i-u-h-c),e.left||e.right){case"center":a=n/2-l/2-r[3];break;case"right":a=n-l-d}switch(e.top||e.bottom){case"middle":case"center":o=i/2-h/2-r[0];break;case"bottom":o=i-h-c}a=a||0,o=o||0,isNaN(l)&&(l=n-d-a-(s||0)),isNaN(h)&&(h=i-c-o-(u||0));var p=new m(a+r[3],o+r[0],l,h);return p.margin=r,p}function i(t,r){return r&&t&&v(a,function(e){r.hasOwnProperty(e)&&(t[e]=r[e])}),t}var p=r(13),m=r(82),g=r(85).parsePercent,_=r(171),v=p.each,a=["left","right","top","bottom","width","height"],o=[["width","left","right"],["height","top","bottom"]],s=n,u=p.curry(n,"vertical"),l=p.curry(n,"horizontal");t.LOCATION_PARAMS=a,t.HV_NAMES=o,t.box=s,t.vbox=u,t.hbox=l,t.getAvailableSize=function(e,t,r){var n=t.width,i=t.height,a=g(e.x,n),o=g(e.y,i),s=g(e.x2,n),u=g(e.y2,i);return(isNaN(a)||isNaN(parseFloat(e.x)))&&(a=0),(isNaN(s)||isNaN(parseFloat(e.x2)))&&(s=n),(isNaN(o)||isNaN(parseFloat(e.y)))&&(o=0),(isNaN(u)||isNaN(parseFloat(e.y2)))&&(u=i),r=_.normalizeCssArray(r||0),{width:Math.max(s-a-r[1]-r[3],0),height:Math.max(u-o-r[0]-r[2],0)}},t.getLayoutRect=f,t.positionElement=function(e,t,r,n,i){var a,o,s,u,l,h=!i||!i.hv||i.hv[0],c=!i||!i.hv||i.hv[1],d=i&&i.boundingMode||"all";(h||c)&&("raw"===d?o="group"===e.type?new m(0,0,+t.width||0,+t.height||0):e.getBoundingRect():(o=e.getBoundingRect(),e.needLocalTransform()&&(a=e.getLocalTransform(),(o=o.clone()).applyTransform(a))),t=f(p.defaults({width:o.width,height:o.height},t),r,n),s=e.position,u=h?t.x-o.x:0,l=c?t.y-o.y:0,e.attr("position","raw"===d?[u,l]:[s[0]+u,s[1]+l]))},t.sizeCalculable=function(e,t){return null!=e[o[t][0]]||null!=e[o[t][1]]&&null!=e[o[t][2]]},t.mergeLayoutParam=function(u,l,e){function t(e,t){var r={},n=0,i={},a=0;if(v(e,function(e){i[e]=u[e]}),v(e,function(e){h(l,e)&&(r[e]=i[e]=l[e]),c(r,e)&&n++,c(i,e)&&a++}),d[t])return c(l,e[1])?i[e[2]]=null:c(l,e[2])&&(i[e[1]]=null),i;if(2!==a&&n){if(2<=n)return r;for(var o=0;o<e.length;o++){var s=e[o];if(!h(r,s)&&h(u,s)){r[s]=u[s];break}}return r}return i}function h(e,t){return e.hasOwnProperty(t)}function c(e,t){return null!=e[t]&&"auto"!==e[t]}function r(e,t,r){v(e,function(e){t[e]=r[e]})}p.isObject(e)||(e={});var d=e.ignoreSize;p.isArray(d)||(d=[d,d]);var n=t(o[0],0),i=t(o[1],1);r(o[0],u,n),r(o[1],u,i)},t.getLayoutParams=function(e){return i({},e)},t.copyLayoutParams=i},function(e,t,r){"use strict";var n=r(7).a.extend(function(){return{name:"",inputLinks:{},outputLinks:{},_prevOutputTextures:{},_outputTextures:{},_outputReferences:{},_rendering:!1,_rendered:!1,_compositor:null}},{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,o.width===r&&o.height===n||this._outputTextures[e]&&this._outputTextures[e].dispose(t.gl),o.width=r,o.height=n,o},setParameter:function(){},getParameter:function(){},setParameters:function(e){for(var t in e)this.setParameter(t,e[t])},render:function(){},getOutput:function(e,t){if(null==t)return t=e,this._outputTextures[t];var r=this.outputs[t];return r?this._rendered?r.outputLastFrame?this._prevOutputTextures[t]:this._outputTextures[t]:this._rendering?(this._prevOutputTextures[t]||(this._prevOutputTextures[t]=this._compositor.allocateTexture(r.parameters||{})),this._prevOutputTextures[t]):(this.render(e),this._outputTextures[t]):void 0},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]))},link:function(e,t,r){this.inputLinks[e]={node:t,pin:r},t.outputLinks[r]||(t.outputLinks[r]=[]),t.outputLinks[r].push({node:this,pin:e}),this.pass.material.enableTexture(e)},clear:function(){this.inputLinks={},this.outputLinks={}},updateReference:function(e){if(!this._rendering){for(var t in this._rendering=!0,this.inputLinks){var r=this.inputLinks[t];r.node.updateReference(r.pin)}this._rendering=!1}e&&this._outputReferences[e]++},beforeFrame:function(){for(var e in this._rendered=!1,this.outputLinks)this._outputReferences[e]=0},afterFrame:function(){for(var e in this.outputLinks){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]))}}});t.a=n},function(e,t,r){"use strict";t.a=function(e,t){for(var r=0,n=1/t,i=e;0<i;)r+=n*(i%t),i=Math.floor(i/t),n/=t;return r}},function(e,t,r){"use strict";var n=r(0),s=r.n(n);t.a=function(r,e,t){t=t||r.getSource();var n=e||s.a.getCoordinateSystemDimensions(r.get("coordinateSystem"))||["x","y","z"],i=s.a.helper.createDimensions(t,{dimensionsDefine:t.dimensionsDefine||r.get("dimensions"),encodeDefine:t.encodeDefine||r.get("encode"),coordDimensions:n.map(function(e){var t=r.getReferringComponents(e+"Axis3D")[0];return{type:t&&"category"===t.get("type")?"ordinal":"float",name:e}})});"cartesian3D"===r.get("coordinateSystem")&&i.forEach(function(e){var t;0<=n.indexOf(e.coordDim)&&((t=r.getReferringComponents(e.coordDim+"Axis3D")[0])&&"category"===t.get("type")&&(e.ordinalMeta=t.getOrdinalMeta()))});var a=s.a.helper.dataStack.enableDataStack(r,i,{byIndex:!0,stackedCoordDimension:"z"}),o=new s.a.List(i,r);return o.setCalculationInfo(a),o.initData(t),o}},function(e,t){e.exports=function(e,a,o){return{seriesType:e,performRawSeries:!0,reset:function(u,e){var t=u.getData(),r=u.get("symbol")||a,l=u.get("symbolSize"),n=u.get("symbolKeepAspect");if(t.setVisual({legendSymbol:o||r,symbol:r,symbolSize:l,symbolKeepAspect:n}),!e.isSeriesFiltered(u)){var i="function"==typeof l;return{dataEach:t.hasItemOption||i?function(e,t){var r,n,i,a,o,s;"function"==typeof l&&(r=u.getRawValue(t),n=u.getDataParams(t),e.setItemVisual(t,"symbolSize",l(r,n))),e.hasItemOption&&(a=(i=e.getItemModel(t)).getShallow("symbol",!0),o=i.getShallow("symbolSize",!0),s=i.getShallow("symbolKeepAspect",!0),null!=a&&e.setItemVisual(t,"symbol",a),null!=o&&e.setItemVisual(t,"symbolSize",o),null!=s&&e.setItemVisual(t,"symbolKeepAspect",s))}:null}}}}}},function(e,t,r){"use strict";function k(e){return e.material}function W(e,t,r){return t.uniforms[r].value}function j(e,t,r,n){return r!==n}function X(e){return!0}function q(){}function A(e,t,r){this.availableAttributes=e,this.availableAttributeSymbols=t,this.indicesBuffer=r,this.vao=null}function n(e){var n,i;this.bind=function(e){n||((n=s.a.createCanvas()).width=n.height=1,n.getContext("2d"));var t=e.gl,r=!i;r&&(i=t.createTexture()),t.bindTexture(t.TEXTURE_2D,i),r&&t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,n)},this.unbind=function(e){e.gl.bindTexture(e.gl.TEXTURE_2D,null)},this.isRenderable=function(){return!0}}var i=r(7),a=r(111),o=r(11),s=r(14),u=r(19),l=r(26),h=r(115),c=r(8),d=r(71),Z=r(21),_=r(12);c.a.import(d.a);var v=Z.a.create,f={},M={float:o.a.FLOAT,byte:o.a.BYTE,ubyte:o.a.UNSIGNED_BYTE,short:o.a.SHORT,ushort:o.a.UNSIGNED_SHORT},p=i.a.extend(function(){return{canvas:null,_width:100,_height:100,devicePixelRatio:"undefined"!=typeof window&&window.devicePixelRatio||1,clearColor:[0,0,0,0],clearBit:17664,alpha:!0,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!1,throwError:!0,gl:null,viewport:{},__currentFrameBuffer:null,_viewportStack:[],_clearStack:[],_sceneRendering:null}},function(){this.canvas||(this.canvas=s.a.createCanvas());var e=this.canvas;try{var t={alpha:this.alpha,depth:this.depth,stencil:this.stencil,antialias:this.antialias,premultipliedAlpha:this.premultipliedAlpha,preserveDrawingBuffer:this.preserveDrawingBuffer};if(this.gl=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),!this.gl)throw new Error;this._glinfo=new a.a(this.gl),this.gl.targetRenderer&&console.error("Already created a renderer"),(this.gl.targetRenderer=this).resize()}catch(e){throw"Error creating WebGL Context "+e}this._programMgr=new h.a(this),this._placeholderTexture=new n},{resize:function(e,t){var r=this.canvas,n=this.devicePixelRatio;null!=e?(r.style.width=e+"px",r.style.height=t+"px",r.width=e*n,r.height=t*n,this._width=e,this._height=t):(this._width=r.width/n,this._height=r.height/n),this.setViewport(0,0,this._width,this._height)},getWidth:function(){return this._width},getHeight:function(){return this._height},getViewportAspect:function(){var e=this.viewport;return e.width/e.height},setDevicePixelRatio:function(e){this.devicePixelRatio=e,this.resize(this._width,this._height)},getDevicePixelRatio:function(){return this.devicePixelRatio},getGLExtension:function(e){return this._glinfo.getExtension(e)},getGLParameter:function(e){return this._glinfo.getParameter(e)},setViewport:function(e,t,r,n,i){var a;"object"==_typeof(e)&&(e=(a=e).x,t=a.y,r=a.width,n=a.height,i=a.devicePixelRatio),i=i||this.devicePixelRatio,this.gl.viewport(e*i,t*i,r*i,n*i),this.viewport={x:e,y:t,width:r,height:n,devicePixelRatio:i}},saveViewport:function(){this._viewportStack.push(this.viewport)},restoreViewport:function(){0<this._viewportStack.length&&this.setViewport(this._viewportStack.pop())},saveClear:function(){this._clearStack.push({clearBit:this.clearBit,clearColor:this.clearColor})},restoreClear:function(){var e;0<this._clearStack.length&&(e=this._clearStack.pop(),this.clearColor=e.clearColor,this.clearBit=e.clearBit)},bindSceneRendering:function(e){this._sceneRendering=e},render:function(e,t,r,n){var i,a,o,s=this.gl,u=this.clearColor;if(this.clearBit&&(s.colorMask(!0,!0,!0,!0),s.depthMask(!0),a=!1,o=(i=this.viewport).devicePixelRatio,(i.width!==this._width||i.height!==this._height||o&&o!==this.devicePixelRatio||i.x||i.y)&&(a=!0,s.enable(s.SCISSOR_TEST),s.scissor(i.x*o,i.y*o,i.width*o,i.height*o)),s.clearColor(u[0],u[1],u[2],u[3]),s.clear(this.clearBit),a&&s.disable(s.SCISSOR_TEST)),r||e.update(!1),e.updateLights(),t=t||e.getMainCamera()){t.update();var l=e.updateRenderList(t,!0);this._sceneRendering=e;var h=l.opaque,c=l.transparent,d=e.material;e.trigger("beforerender",this,e,t,l),n?(this.renderPreZ(h,e,t),s.depthFunc(s.LEQUAL)):s.depthFunc(s.LESS);for(var f=v(),p=_.a.create(),m=0;m<c.length;m++){var g=c[m];Z.a.multiplyAffine(f,t.viewMatrix.array,g.worldTransform.array),_.a.transformMat4(p,g.position.array,f),g.__depth=p[2]}this.renderPass(h,t,{getMaterial:function(e){return d||e.material},sortCompare:this.opaqueSortCompare}),this.renderPass(c,t,{getMaterial:function(e){return d||e.material},sortCompare:this.transparentSortCompare}),e.trigger("afterrender",this,e,t,l),this._sceneRendering=null}else console.error("Can't find camera in the scene.")},getProgram:function(e,t,r){return t=t||e.material,this._programMgr.getProgram(e,t,r)},validateProgram:function(e){if(e.__error){var t=e.__error;if(f[e.__uid__])return;if(f[e.__uid__]=!0,this.throwError)throw new Error(t);this.trigger("error",t)}},updatePrograms:function(e,t,r){var n=r&&r.getMaterial||k;t=t||null;for(var i=0;i<e.length;i++){var a=e[i],o=n.call(this,a);if(0<i){var s=e[i-1],u=s.joints?s.joints.length:0;if((a.joints?a.joints.length:0)===u&&a.material===s.material&&a.lightGroup===s.lightGroup){a.__program=s.__program;continue}}var l=this._programMgr.getProgram(a,o,t);this.validateProgram(l),a.__program=l}},renderPass:function(e,t,r){this.trigger("beforerenderpass",this,e,t,r),(r=r||{}).getMaterial=r.getMaterial||k,r.getUniform=r.getUniform||W,r.isMaterialChanged=r.isMaterialChanged||j,r.beforeRender=r.beforeRender||q,r.afterRender=r.afterRender||q;var n=r.ifRender||X;this.updatePrograms(e,this._sceneRendering,r),r.sortCompare&&e.sort(r.sortCompare);var i=this.viewport,a=i.devicePixelRatio,o=[i.x*a,i.y*a,i.width*a,i.height*a],s=this.devicePixelRatio,u=this.__currentFrameBuffer?[this.__currentFrameBuffer.getTextureWidth(),this.__currentFrameBuffer.getTextureHeight()]:[this._width*s,this._height*s],l=[o[2],o[3]],h=Date.now();t?(Z.a.copy(Y.VIEW,t.viewMatrix.array),Z.a.copy(Y.PROJECTION,t.projectionMatrix.array),Z.a.copy(Y.VIEWINVERSE,t.worldTransform.array)):(Z.a.identity(Y.VIEW),Z.a.identity(Y.PROJECTION),Z.a.identity(Y.VIEWINVERSE)),Z.a.multiply(Y.VIEWPROJECTION,Y.PROJECTION,Y.VIEW),Z.a.invert(Y.PROJECTIONINVERSE,Y.PROJECTION),Z.a.invert(Y.VIEWPROJECTIONINVERSE,Y.VIEWPROJECTION);for(var c,d,f,p,m,g,_,v,y,x,T,b=this.gl,w=this._sceneRendering,E=this.getGLExtension("OES_vertex_array_object"),S=0;S<e.length;S++){var A,M=e[S],C=null!=M.worldTransform;if(n(M)){C&&(A=M.isSkinnedMesh&&M.isSkinnedMesh()?Y.IDENTITY:M.worldTransform.array);var L=M.geometry,D=r.getMaterial.call(this,M),N=M.__program,R=D.shader,P=L.__uid__+"-"+N.__uid__,I=P!==O,O=P;I&&E&&E.bindVertexArrayOES(null),C&&(Z.a.copy(Y.WORLD,A),Z.a.multiply(Y.WORLDVIEWPROJECTION,Y.VIEWPROJECTION,A),Z.a.multiplyAffine(Y.WORLDVIEW,Y.VIEW,A),(R.matrixSemantics.WORLDINVERSE||R.matrixSemantics.WORLDINVERSETRANSPOSE)&&Z.a.invert(Y.WORLDINVERSE,A),(R.matrixSemantics.WORLDVIEWINVERSE||R.matrixSemantics.WORLDVIEWINVERSETRANSPOSE)&&Z.a.invert(Y.WORLDVIEWINVERSE,Y.WORLDVIEW),(R.matrixSemantics.WORLDVIEWPROJECTIONINVERSE||R.matrixSemantics.WORLDVIEWPROJECTIONINVERSETRANSPOSE)&&Z.a.invert(Y.WORLDVIEWPROJECTIONINVERSE,Y.WORLDVIEWPROJECTION)),M.beforeRender&&M.beforeRender(this),r.beforeRender.call(this,M,D,c);var F=N!==d;F?(N.bind(this),N.setUniformOfSemantic(b,"VIEWPORT",o),N.setUniformOfSemantic(b,"WINDOW_SIZE",u),t&&(N.setUniformOfSemantic(b,"NEAR",t.near),N.setUniformOfSemantic(b,"FAR",t.far)),N.setUniformOfSemantic(b,"DEVICEPIXELRATIO",a),N.setUniformOfSemantic(b,"TIME",h),N.setUniformOfSemantic(b,"VIEWPORT_SIZE",l),w&&w.setLightUniforms(N,M.lightGroup,this)):N=d,(F||r.isMaterialChanged(M,f,D,c))&&(D.depthTest!==p&&(D.depthTest?b.enable(b.DEPTH_TEST):b.disable(b.DEPTH_TEST),p=D.depthTest),D.depthMask!==m&&(b.depthMask(D.depthMask),m=D.depthMask),D.transparent!==y&&(D.transparent?b.enable(b.BLEND):b.disable(b.BLEND),y=D.transparent),D.transparent&&(D.blend?D.blend(b):(b.blendEquationSeparate(b.FUNC_ADD,b.FUNC_ADD),b.blendFuncSeparate(b.SRC_ALPHA,b.ONE_MINUS_SRC_ALPHA,b.ONE,b.ONE_MINUS_SRC_ALPHA))),T=this._bindMaterial(M,D,N,f||null,c||null,d||null,r.getUniform),c=D);var B=R.matrixSemanticKeys;if(C)for(var U=0;U<B.length;U++){var z,G=B[U],H=R.matrixSemantics[G],V=Y[G];H.isTranspose&&(z=Y[H.semanticNoTranspose],Z.a.transpose(V,z)),N.setUniform(b,H.type,H.symbol,V)}M.cullFace!==_&&(_=M.cullFace,b.cullFace(_)),M.frontFace!==v&&(v=M.frontFace,b.frontFace(v)),M.culling!==g&&((g=M.culling)?b.enable(b.CULL_FACE):b.disable(b.CULL_FACE)),this._updateSkeleton(M,N,T),I&&(x=this._bindVAO(E,R,L,N)),this._renderObject(M,x),r.afterRender(this,M),M.afterRender&&M.afterRender(this),d=N,f=M}}E&&E.bindVertexArrayOES(null),this.trigger("afterrenderpass",this,e,t,r)},getMaxJointNumber:function(){return this._glinfo.getMaxJointNumber()},_updateSkeleton:function(e,t,r){var n,i,a=this.gl,o=e.skeleton;o&&(o.update(),e.joints.length>this._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;f<c.length;f++){var p=o(e,t,_=c[f]);if("t"===(g=t.uniforms[_].type)&&p)p.__slot=-1;else if("tv"===g)for(var m=0;m<p.length;m++)p[m]&&(p[m].__slot=-1)}d.__slot=-1;for(f=0;f<h.length;f++){var g,_=h[f],v=t.uniforms[_],p=o(e,t,_),y="t"===(g=v.type);if(y&&(p&&p.isRenderable()||(p=d)),i&&u){var x=o(n,i,_);if(y&&(x&&x.isRenderable()||(x=d)),x===p){if(y)r.takeCurrentTextureSlot(this,null);else if("tv"===g&&p)for(m=0;m<p.length;m++)r.takeCurrentTextureSlot(this,null);continue}}if(null!=p)if(y){p.__slot<0?(b=r.currentTextureSlot(),r.setUniform(s,"1i",_,b)&&(r.takeCurrentTextureSlot(this,p),p.__slot=b)):r.setUniform(s,"1i",_,p.__slot)}else if(Array.isArray(p)){if(0===p.length)continue;if("tv"===g){if(!r.hasUniform(_))continue;for(var T=[],m=0;m<p.length;m++){var b,w=p[m];w.__slot<0?(b=r.currentTextureSlot(),T.push(b),r.takeCurrentTextureSlot(this,w),w.__slot=b):T.push(w.__slot)}r.setUniform(s,"1iv",_,T)}else r.setUniform(s,v.type,_,p)}else r.setUniform(s,v.type,_,p)}var E=r.currentTextureSlot();return r.resetTextureSlot(l),E},_bindVAO:function(e,t,r,n){var i=!r.dynamic,a=this.gl,o=this.__uid__+"-"+n.__uid__,s=r.__vaoCache[o];if(!s){var u=r.getBufferChunks(this);if(!u||!u.length)return;for(var l=u[0],h=l.attributeBuffers,c=l.indicesBuffer,d=[],f=[],p=0;p<h.length;p++){var m,g,_=(T=h[p]).name,v=T.semantic;(g=v?(m=t.attributeSemantics[v])&&m.symbol:_)&&n.attributes[g]&&(d.push(T),f.push(g))}s=new A(d,f,c),i&&(r.__vaoCache[o]=s)}var y=!0;e&&i&&(null==s.vao?s.vao=e.createVertexArrayOES():y=!1,e.bindVertexArrayOES(s.vao));d=s.availableAttributes,c=s.indicesBuffer;if(y){for(var x=n.enableAttributes(this,s.availableAttributeSymbols,e&&i&&s),p=0;p<d.length;p++){var T,b,w,E,S=x[p];-1!==S&&(b=(T=d[p]).buffer,w=T.size,E=M[T.type]||a.FLOAT,a.bindBuffer(a.ARRAY_BUFFER,b),a.vertexAttribPointer(S,w,E,!1,0,0))}r.isUseIndices()&&a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,c.buffer)}return s},renderPreZ:function(e,t,r){var n=this.gl,i=this._prezMaterial||new u.a({shader:new c.a(c.a.source("clay.prez.vertex"),c.a.source("clay.prez.fragment"))});this._prezMaterial=i,n.colorMask(!1,!1,!1,!1),n.depthMask(!0),this.renderPass(e,r,{ifRender:function(e){return!e.ignorePreZ},isMaterialChanged:function(e,t){var r=e.material,n=t.material;return r.get("diffuseMap")!==n.get("diffuseMap")||(r.get("alphaCutoff")||0)!==(n.get("alphaCutoff")||0)},getUniform:function(e,t,r){return"alphaMap"===r?e.material.get("diffuseMap"):"alphaCutoff"===r?e.material.isDefined("fragment","ALPHA_TEST")&&e.material.get("diffuseMap")&&e.material.get("alphaCutoff")||0:t.get(r)},getMaterial:function(){return i},sort:this.opaqueSortCompare}),n.colorMask(!0,!0,!0,!0),n.depthMask(!0)},disposeScene:function(e){this.disposeNode(e,!0,!0),e.dispose()},disposeNode:function(e,u,l){e.getParent()&&e.getParent().remove(e);var h={};e.traverse(function(e){var t=e.material;if(e.geometry&&u&&e.geometry.dispose(this),l&&t&&!h[t.__uid__]){for(var r=t.getTextureUniforms(),n=0;n<r.length;n++){var i=r[n],a=t.uniforms[i].value,o=t.uniforms[i].type;if(a)if("t"===o)a.dispose&&a.dispose(this);else if("tv"===o)for(var s=0;s<a.length;s++)a[s]&&a[s].dispose&&a[s].dispose(this)}h[t.__uid__]=!0}e.dispose&&e.dispose(this)},this)},disposeGeometry:function(e){e.dispose(this)},disposeTexture:function(e){e.dispose(this)},disposeFrameBuffer:function(e){e.dispose(this)},dispose:function(){},screenToNDC:function(e,t,r){r=r||new l.a,t=this._height-t;var n=this.viewport,i=r.array;return i[0]=(e-n.x)/n.width,i[0]=2*i[0]-1,i[1]=(t-n.y)/n.height,i[1]=2*i[1]-1,r}});p.opaqueSortCompare=p.prototype.opaqueSortCompare=function(e,t){return e.renderOrder===t.renderOrder?e.__program===t.__program?e.material===t.material?e.geometry.__uid__-t.geometry.__uid__:e.material.__uid__-t.material.__uid__:e.__program&&t.__program?e.__program.__uid__-t.__program.__uid__:0:e.renderOrder-t.renderOrder},p.transparentSortCompare=p.prototype.transparentSortCompare=function(e,t){return e.renderOrder===t.renderOrder?e.__depth===t.__depth?e.__program===t.__program?e.material===t.material?e.geometry.__uid__-t.geometry.__uid__:e.material.__uid__-t.material.__uid__:e.__program&&t.__program?e.__program.__uid__-t.__program.__uid__:0:e.__depth-t.__depth:e.renderOrder-t.renderOrder};var Y={IDENTITY:v(),WORLD:v(),VIEW:v(),PROJECTION:v(),WORLDVIEW:v(),VIEWPROJECTION:v(),WORLDVIEWPROJECTION:v(),WORLDINVERSE:v(),VIEWINVERSE:v(),PROJECTIONINVERSE:v(),WORLDVIEWINVERSE:v(),VIEWPROJECTIONINVERSE:v(),WORLDVIEWPROJECTIONINVERSE:v(),WORLDTRANSPOSE:v(),VIEWTRANSPOSE:v(),PROJECTIONTRANSPOSE:v(),WORLDVIEWTRANSPOSE:v(),VIEWPROJECTIONTRANSPOSE:v(),WORLDVIEWPROJECTIONTRANSPOSE:v(),WORLDINVERSETRANSPOSE:v(),VIEWINVERSETRANSPOSE:v(),PROJECTIONINVERSETRANSPOSE:v(),WORLDVIEWINVERSETRANSPOSE:v(),VIEWPROJECTIONINVERSETRANSPOSE:v(),WORLDVIEWPROJECTIONINVERSETRANSPOSE:v()};p.COLOR_BUFFER_BIT=o.a.COLOR_BUFFER_BIT,p.DEPTH_BUFFER_BIT=o.a.DEPTH_BUFFER_BIT,p.STENCIL_BUFFER_BIT=o.a.STENCIL_BUFFER_BIT,t.a=p},function(e,t,r){"use strict";function a(e,t){this.action=e,this.context=t}var n={trigger:function(e){if(this.hasOwnProperty("__handlers__")&&this.__handlers__.hasOwnProperty(e)){var t=this.__handlers__[e],r=t.length,n=-1,i=arguments;switch(i.length){case 1:for(;++n<r;)t[n].action.call(t[n].context);return;case 2:for(;++n<r;)t[n].action.call(t[n].context,i[1]);return;case 3:for(;++n<r;)t[n].action.call(t[n].context,i[1],i[2]);return;case 4:for(;++n<r;)t[n].action.call(t[n].context,i[1],i[2],i[3]);return;case 5:for(;++n<r;)t[n].action.call(t[n].context,i[1],i[2],i[3],i[4]);return;default:for(;++n<r;)t[n].action.apply(t[n].context,Array.prototype.slice.call(i,1));return}}},on:function(e,t,r){if(e&&t){var n=this.__handlers__||(this.__handlers__={});if(n[e]){if(this.has(e,t))return}else n[e]=[];var i=new a(t,r||this);return n[e].push(i),this}},once:function(t,r,e){if(t&&r){var n=this;return this.on(t,function e(){n.off(t,e),r.apply(this,arguments)},e)}},before:function(e,t,r){if(e&&t)return e="before"+e,this.on(e,t,r)},after:function(e,t,r){if(e&&t)return e="after"+e,this.on(e,t,r)},success:function(e,t){return this.once("success",e,t)},error:function(e,t){return this.once("error",e,t)},off:function(e,t){var r=this.__handlers__||(this.__handlers__={});if(t){if(r[e]){for(var n=r[e],i=[],a=0;a<n.length;a++)t&&n[a].action!==t&&i.push(n[a]);r[e]=i}return this}r[e]=[]},has:function(e,t){var r=this.__handlers__;if(!r||!r[e])return!1;for(var n=r[e],i=0;i<n.length;i++)if(n[i].action===t)return!0}};t.a=n},function(e,t,r){"use strict";function n(e,t){this.origin=e||new g.a,this.direction=t||new g.a}var d,f,p,m,c,i,g=r(3),_=r(12);n.prototype={constructor:n,intersectPlane:function(e,t){var r=e.normal.array,n=e.distance,i=this.origin.array,a=this.direction.array,o=_.a.dot(r,a);if(0===o)return null;t=t||new g.a;var s=(_.a.dot(r,i)-n)/o;return _.a.scaleAndAdd(t.array,i,a,-s),t._dirty=!0,t},mirrorAgainstPlane:function(e){var t=_.a.dot(e.normal.array,this.direction.array);_.a.scaleAndAdd(this.direction.array,this.direction.array,e.normal.array,2*-t),this.direction._dirty=!0},distanceToPoint:(i=_.a.create(),function(e){_.a.sub(i,e,this.origin.array);var t=_.a.dot(i,this.direction.array);if(t<0)return _.a.distance(this.origin.array,e);var r=_.a.lenSquared(i);return Math.sqrt(r-t*t)}),intersectSphere:(c=_.a.create(),function(e,t,r){var n=this.origin.array,i=this.direction.array;e=e.array,_.a.sub(c,e,n);var a=_.a.dot(c,i),o=_.a.squaredLength(c)-a*a,s=t*t;if(!(s<o)){var u=Math.sqrt(s-o),l=a-u,h=a+u;return r=r||new g.a,l<0?h<0?null:(_.a.scaleAndAdd(r.array,n,i,h),r):(_.a.scaleAndAdd(r.array,n,i,l),r)}}),intersectBoundingBox:function(e,t){var r,n,i,a,o,s,u=this.direction.array,l=this.origin.array,h=e.min.array,c=e.max.array,d=1/u[0],f=1/u[1],p=1/u[2];if(0<=d?(r=(h[0]-l[0])*d,n=(c[0]-l[0])*d):(n=(h[0]-l[0])*d,r=(c[0]-l[0])*d),0<=f?(i=(h[1]-l[1])*f,a=(c[1]-l[1])*f):(a=(h[1]-l[1])*f,i=(c[1]-l[1])*f),a<r||n<i)return null;if((r<i||r!=r)&&(r=i),(a<n||n!=n)&&(n=a),0<=p?(o=(h[2]-l[2])*p,s=(c[2]-l[2])*p):(s=(h[2]-l[2])*p,o=(c[2]-l[2])*p),s<r||n<o)return null;if((r<o||r!=r)&&(r=o),(s<n||n!=n)&&(n=s),n<0)return null;var m=0<=r?r:n;return t=t||new g.a,_.a.scaleAndAdd(t.array,l,u,m),t},intersectTriangle:(d=_.a.create(),f=_.a.create(),p=_.a.create(),m=_.a.create(),function(e,t,r,n,i,a){var o=this.direction.array,s=this.origin.array;e=e.array,t=t.array,r=r.array,_.a.sub(d,t,e),_.a.sub(f,r,e),_.a.cross(m,f,o);var u=_.a.dot(d,m);if(n){if(-1e-5<u)return null}else if(-1e-5<u&&u<1e-5)return null;_.a.sub(p,s,e);var l=_.a.dot(m,p)/u;if(l<0||1<l)return null;_.a.cross(m,d,p);var h=_.a.dot(o,m)/u;if(h<0||1<h||1<l+h)return null;_.a.cross(m,d,f);var c=-_.a.dot(p,m)/u;return c<0?null:(i=i||new g.a,a&&g.a.set(a,1-l-h,l,h),_.a.scaleAndAdd(i.array,s,o,c),i)}),applyTransform:function(e){g.a.add(this.direction,this.direction,this.origin),g.a.transformMat4(this.origin,this.origin,e),g.a.transformMat4(this.direction,this.direction,e),g.a.sub(this.direction,this.direction,this.origin),g.a.normalize(this.direction,this.direction)},copy:function(e){g.a.copy(this.origin,e.origin),g.a.copy(this.direction,e.direction)},clone:function(){var e=new n;return e.copy(this),e}},t.a=n},function(e,t,r){"use strict";var i,a,o,s,n=r(20),u=r(12),l=r(33),h=r(34),c={create:function(){var e=new n.a(4);return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}};c.rotationTo=(a=u.a.create(),o=u.a.fromValues(1,0,0),s=u.a.fromValues(0,1,0),function(e,t,r){var n=u.a.dot(t,r);return n<-.999999?(u.a.cross(a,o,t),u.a.length(a)<1e-6&&u.a.cross(a,s,t),u.a.normalize(a,a),c.setAxisAngle(e,a,Math.PI),e):.999999<n?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(u.a.cross(a,t,r),e[0]=a[0],e[1]=a[1],e[2]=a[2],e[3]=1+n,c.normalize(e,e))}),c.setAxes=(i=h.a.create(),function(e,t,r,n){return i[0]=r[0],i[3]=r[1],i[6]=r[2],i[1]=n[0],i[4]=n[1],i[7]=n[2],i[2]=-t[0],i[5]=-t[1],i[8]=-t[2],c.normalize(e,c.fromMat3(e,i))}),c.clone=l.a.clone,c.fromValues=l.a.fromValues,c.copy=l.a.copy,c.set=l.a.set,c.identity=function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},c.setAxisAngle=function(e,t,r){r*=.5;var n=Math.sin(r);return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(r),e},c.add=l.a.add,c.multiply=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=r[0],u=r[1],l=r[2],h=r[3];return e[0]=n*h+o*s+i*l-a*u,e[1]=i*h+o*u+a*s-n*l,e[2]=a*h+o*l+n*u-i*s,e[3]=o*h-n*s-i*u-a*l,e},c.mul=c.multiply,c.scale=l.a.scale,c.rotateX=function(e,t,r){r*=.5;var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),u=Math.cos(r);return e[0]=n*u+o*s,e[1]=i*u+a*s,e[2]=a*u-i*s,e[3]=o*u-n*s,e},c.rotateY=function(e,t,r){r*=.5;var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),u=Math.cos(r);return e[0]=n*u-a*s,e[1]=i*u+o*s,e[2]=a*u+n*s,e[3]=o*u-i*s,e},c.rotateZ=function(e,t,r){r*=.5;var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),u=Math.cos(r);return e[0]=n*u+i*s,e[1]=i*u-n*s,e[2]=a*u+o*s,e[3]=o*u-a*s,e},c.calculateW=function(e,t){var r=t[0],n=t[1],i=t[2];return e[0]=r,e[1]=n,e[2]=i,e[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),e},c.dot=l.a.dot,c.lerp=l.a.lerp,c.slerp=function(e,t,r,n){var i,a,o,s,u=t[0],l=t[1],h=t[2],c=t[3],d=r[0],f=r[1],p=r[2],m=r[3],g=u*d+l*f+h*p+c*m;return g<0&&(g=-g,d=-d,f=-f,p=-p,m=-m),s=1e-6<1-g?(i=Math.acos(g),a=Math.sin(i),o=Math.sin((1-n)*i)/a,Math.sin(n*i)/a):(o=1-n,n),e[0]=o*u+s*d,e[1]=o*l+s*f,e[2]=o*h+s*p,e[3]=o*c+s*m,e},c.invert=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r*r+n*n+i*i+a*a,s=o?1/o:0;return e[0]=-r*s,e[1]=-n*s,e[2]=-i*s,e[3]=a*s,e},c.conjugate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e},c.length=l.a.length,c.len=c.length,c.squaredLength=l.a.squaredLength,c.sqrLen=c.squaredLength,c.normalize=l.a.normalize,c.fromMat3=function(e,t){var r,n,i,a,o=t[0]+t[4]+t[8];return 0<o?(a=Math.sqrt(o+1),e[3]=.5*a,a=.5/a,e[0]=(t[5]-t[7])*a,e[1]=(t[6]-t[2])*a,e[2]=(t[1]-t[3])*a):(r=0,t[4]>t[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<r.length;n++)r[n]&&(r[n][t]=!0)},fresh:function(e){var t="__dt__"+(e=e||"");this.put(t,!1)},freshAll:function(e){for(var t="__dt__"+(e=e||""),r=this._caches,n=0;n<r.length;n++)r[n]&&(r[n][t]=!1)},isDirty:function(e){var t="__dt__"+(e=e||""),r=this._context;return!r.hasOwnProperty(t)||!0===r[t]},deleteContext:function(e){delete this._caches[e],this._context={}},delete:function(e){delete this._context[e]},clearAll:function(){this._caches={}},getContext:function(){return this._context},eachContext:function(t,r){Object.keys(this._caches).forEach(function(e){t&&t.call(r,e)})},miss:function(e){return!this._context.hasOwnProperty(e)}}).constructor=n,t.a=n},function(e,t,r){"use strict";var a,n=r(35),i=r(9),o=r(59),s=r(54),u=r(33),l=r(12),h=n.a.extend(function(){return{projectionMatrix:new i.a,invProjectionMatrix:new i.a,viewMatrix:new i.a,frustum:new o.a}},function(){this.update(!0)},{update:function(e){n.a.prototype.update.call(this,e),i.a.invert(this.viewMatrix,this.worldTransform),this.updateProjectionMatrix(),i.a.invert(this.invProjectionMatrix,this.projectionMatrix),this.frustum.setFromProjection(this.projectionMatrix)},setViewMatrix:function(e){i.a.copy(this.viewMatrix,e),i.a.invert(this.worldTransform,e),this.decomposeWorldTransform()},decomposeProjectionMatrix:function(){},setProjectionMatrix:function(e){i.a.copy(this.projectionMatrix,e),i.a.invert(this.invProjectionMatrix,e),this.decomposeProjectionMatrix()},updateProjectionMatrix:function(){},castRay:(a=u.a.create(),function(e,t){var r=void 0!==t?t:new s.a,n=e.array[0],i=e.array[1];return u.a.set(a,n,i,-1,1),u.a.transformMat4(a,a,this.invProjectionMatrix.array),u.a.transformMat4(a,a,this.worldTransform.array),l.a.scale(r.origin.array,a,1/a[3]),u.a.set(a,n,i,1,1),u.a.transformMat4(a,a,this.invProjectionMatrix.array),u.a.transformMat4(a,a,this.worldTransform.array),l.a.scale(a,a,1/a[3]),l.a.sub(r.direction.array,a,r.origin.array),l.a.normalize(r.direction.array,r.direction.array),r.direction._dirty=!0,r.origin._dirty=!0,r})});t.a=h},function(e,t,r){"use strict";function n(){this.planes=[];for(var e=0;e<6;e++)this.planes.push(new a.a);for(this.boundingBox=new i.a,this.vertices=[],e=0;e<8;e++)this.vertices[e]=o.a.fromValues(0,0,0)}var h,i=r(18),a=r(74),o=r(12),I=o.a.set,c=o.a.copy,d=o.a.transformMat4,f=Math.min,p=Math.max;n.prototype={setFromProjection:function(e){var t=this.planes,r=e.array,n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],u=r[5],l=r[6],h=r[7],c=r[8],d=r[9],f=r[10],p=r[11],m=r[12],g=r[13],_=r[14],v=r[15];I(t[0].normal.array,o-n,h-s,p-c),t[0].distance=-(v-m),t[0].normalize(),I(t[1].normal.array,o+n,h+s,p+c),t[1].distance=-(v+m),t[1].normalize(),I(t[2].normal.array,o+i,h+u,p+d),t[2].distance=-(v+g),t[2].normalize(),I(t[3].normal.array,o-i,h-u,p-d),t[3].distance=-(v-g),t[3].normalize(),I(t[4].normal.array,o-a,h-l,p-f),t[4].distance=-(v-_),t[4].normalize(),I(t[5].normal.array,o+a,h+l,p+f),t[5].distance=-(v+_),t[5].normalize();var y,x,T,b,w,E,S,A,M,C,L,D,N,R=this.boundingBox,P=this.vertices;0===v?(y=u/n,b=-(T=-_/(f+1))/u,w=-(x=-_/(f-1))/u,R.min.set(-b*y,-b,T),R.max.set(b*y,b,x),I(P[0],-b*y,-b,T),I(P[1],-b*y,b,T),I(P[2],b*y,-b,T),I(P[3],b*y,b,T),I(P[4],-w*y,-w,x),I(P[5],-w*y,w,x),I(P[6],w*y,-w,x),I(P[7],w*y,w,x)):(E=(-1-m)/n,S=(1-m)/n,A=(1-g)/u,M=(-1-g)/u,C=(-1-_)/f,L=(1-_)/f,R.min.set(Math.min(E,S),Math.min(M,A),Math.min(L,C)),R.max.set(Math.max(S,E),Math.max(A,M),Math.max(C,L)),D=R.min.array,N=R.max.array,I(P[0],D[0],D[1],D[2]),I(P[1],D[0],N[1],D[2]),I(P[2],N[0],D[1],D[2]),I(P[3],N[0],N[1],D[2]),I(P[4],D[0],D[1],N[2]),I(P[5],D[0],N[1],N[2]),I(P[6],N[0],D[1],N[2]),I(P[7],N[0],N[1],N[2]))},getTransformedBoundingBox:(h=o.a.create(),function(e,t){var r=this.vertices,n=t.array,i=e.min,a=e.max,o=i.array,s=a.array,u=r[0];d(h,u,n),c(o,h),c(s,h);for(var l=1;l<8;l++)u=r[l],d(h,u,n),o[0]=f(h[0],o[0]),o[1]=f(h[1],o[1]),o[2]=f(h[2],o[2]),s[0]=p(h[0],s[0]),s[1]=p(h[1],s[1]),s[2]=p(h[2],s[2]);return i._dirty=!0,a._dirty=!0,e})},t.a=n},function(e,t){function r(){this.head=null,this.tail=null,this._len=0}var n=r.prototype;n.insert=function(e){var t=new u(e);return this.insertEntry(t),t},n.insertEntry=function(e){this.head?((this.tail.next=e).prev=this.tail,e.next=null,this.tail=e):this.head=this.tail=e,this._len++},n.remove=function(e){var t=e.prev,r=e.next;t?t.next=r:this.head=r,r?r.prev=t:this.tail=t,e.next=e.prev=null,this._len--},n.len=function(){return this._len},n.clear=function(){this.head=this.tail=null,this._len=0};function i(e){this._list=new r,this._map={},this._maxSize=e||10,this._lastRemovedEntry=null}var u=function(e){this.value=e,this.next,this.prev},a=i.prototype;a.put=function(e,t){var r,n,i,a=this._list,o=this._map,s=null;return null==o[e]&&(r=a.len(),n=this._lastRemovedEntry,r>=this._maxSize&&0<r&&(i=a.head,a.remove(i),delete o[i.key],s=i.value,this._lastRemovedEntry=i),n?n.value=t:n=new u(t),n.key=e,a.insertEntry(n),o[e]=n),s},a.get=function(e){var t=this._map[e],r=this._list;if(null!=t)return t!==r.tail&&(r.remove(t),r.insertEntry(t)),t.value},a.clear=function(){this._list.clear(),this._map={}};e.exports=i},function(e,t,r){"use strict";var l=r(5),a=r(27),n=r(14),o=r(62),s=r(75),u=r(36),h=r(122),c=r(123),d={loadTexture:function(e,t,r,n){var i;if(t="function"==typeof t?(n=r=t,{}):t||{},"string"==typeof e){if(e.match(/.hdr$/)||"hdr"===t.fileType)return i=new l.a({width:0,height:0,sRGB:!1}),d._fetchTexture(e,function(e){c.a.parseRGBE(e,i,t.exposure),i.dirty(),r&&r(i)},n),i;e.match(/.dds$/)||"dds"===t.fileType?(i=new l.a({width:0,height:0}),d._fetchTexture(e,function(e){h.a.parse(e,i),i.dirty(),r&&r(i)},n)):((i=new l.a).load(e),i.success(r),i.error(n))}else"object"==_typeof(e)&&void 0!==e.px&&((i=new a.a).load(e),i.success(r),i.error(n));return i},loadPanorama:function(t,e,r,n,i,a){var o=this;n="function"==typeof n?(a=i=n,{}):n||{},d.loadTexture(e,n,function(e){e.flipY=n.flipY||!1,o.panoramaToCubeMap(t,e,r,n),e.dispose(t),i&&i(r)},a)},panoramaToCubeMap:function(e,t,r,n){var i=new o.a,a=new s.a({scene:new u.a});return a.setEnvironmentMap(t),(n=n||{}).encodeRGBM&&a.material.define("fragment","RGBM_ENCODE"),r.sRGB=t.sRGB,i.texture=r,i.render(e,a.scene),i.texture=null,i.dispose(e),r},heightToNormal:function(e,t){var r=document.createElement("canvas"),n=r.width=e.width,i=r.height=e.height,a=r.getContext("2d");a.drawImage(e,0,0,n,i),t=t||!1;for(var o=a.getImageData(0,0,n,i),s=a.createImageData(n,i),u=0;u<o.data.length;u+=4){if(t){var l=o.data[u],h=o.data[u+1],c=o.data[u+2];if(20<Math.abs(l-h)+Math.abs(h-c))return console.warn("Given image is not a height map"),e}var d,f,p=u%(4*n)==0?(d=o.data[u],o.data[u+4]):u%(4*n)==4*(n-1)?(d=o.data[u-4],o.data[u]):(d=o.data[u-4],o.data[u+4]),m=u<4*n?(f=o.data[u],o.data[u+4*n]):n*(i-1)*4<u?(f=o.data[u-4*n],o.data[u]):(f=o.data[u-4*n],o.data[u+4*n]);s.data[u]=d-p+127,s.data[u+1]=f-m+127,s.data[u+2]=255,s.data[u+3]=255}return a.putImageData(s,0,0),r},isHeightImage:function(e,t,r){if(!e||!e.width||!e.height)return!1;var n=document.createElement("canvas"),i=n.getContext("2d"),a=t||32;r=r||20,n.width=n.height=a,i.drawImage(e,0,0,a,a);for(var o=i.getImageData(0,0,a,a),s=0;s<o.data.length;s+=4){var u=o.data[s],l=o.data[s+1],h=o.data[s+2];if(Math.abs(u-l)+Math.abs(l-h)>r)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;s<i;s++)for(var u=0;u<i;u++){(u%2?s%2:s%2-1)&&o.fillRect(s*t,u*t,t,t)}return new l.a({image:a,anisotropic:8})},createBlank:function(e){var t=document.createElement("canvas");t.width=1,t.height=1;var r=t.getContext("2d");return r.fillStyle=e,r.fillRect(0,0,1,1),new l.a({image:t})}};t.a=d},function(e,t,r){"use strict";var n=r(7),h=r(3),i=r(41),a=r(10),c=["px","nx","py","ny","pz","nz"],o=n.a.extend(function(){var e={position:new h.a,far:1e3,near:.1,texture:null,shadowMapPass:null},t=e._cameras={px:new i.a({fov:90}),nx:new i.a({fov:90}),py:new i.a({fov:90}),ny:new i.a({fov:90}),pz:new i.a({fov:90}),nz:new i.a({fov:90})};return t.px.lookAt(h.a.POSITIVE_X,h.a.NEGATIVE_Y),t.nx.lookAt(h.a.NEGATIVE_X,h.a.NEGATIVE_Y),t.py.lookAt(h.a.POSITIVE_Y,h.a.POSITIVE_Z),t.ny.lookAt(h.a.NEGATIVE_Y,h.a.NEGATIVE_Z),t.pz.lookAt(h.a.POSITIVE_Z,h.a.NEGATIVE_Y),t.nz.lookAt(h.a.NEGATIVE_Z,h.a.NEGATIVE_Y),e._frameBuffer=new a.a,e},{getCamera:function(e){return this._cameras[e]},render:function(e,t,r){var n=e.gl;r||t.update();for(var i=this.texture.width,a=2*Math.atan(i/(i-.5))/Math.PI*180,o=0;o<6;o++){var s,u=c[o],l=this._cameras[u];h.a.copy(l.position,this.position),l.far=this.far,l.near=this.near,l.fov=a,this.shadowMapPass&&(l.update(),(s=t.getBoundingBox()).applyTransform(l.viewMatrix),t.viewBoundingBoxLastFrame.copy(s),this.shadowMapPass.render(e,t,l,!0)),this._frameBuffer.attach(this.texture,n.COLOR_ATTACHMENT0,n.TEXTURE_CUBE_MAP_POSITIVE_X+o),this._frameBuffer.bind(e),e.render(t,l,!0),this._frameBuffer.unbind(e)}},dispose:function(e){this._frameBuffer.dispose(e)}});t.a=o},function(e,t,r){"use strict";var n=r(1),i=r(165),a=r(166);n.a.Shader.import(a.a),t.a=n.a.Mesh.extend(function(){return{geometry:new i.a({dynamic:!0}),material:new n.a.Material({shader:n.a.createShader("ecgl.labels"),transparent:!0,depthMask:!1}),culling:!1,castShadow:!1,ignorePicking:!0}})},function(e,t,r){"use strict";function n(e){this.rootNode=new w.a.Node,this._triangulationResults={},this._shadersMap=w.a.COMMON_SHADERS.reduce(function(e,t){return e[t]=w.a.createShader("ecgl."+t),e},{}),this._linesShader=w.a.createShader("ecgl.meshLines3D");var t={};w.a.COMMON_SHADERS.forEach(function(e){t[e]=new w.a.Material({shader:w.a.createShader("ecgl."+e)})}),this._groundMaterials=t,this._groundMesh=new w.a.Mesh({geometry:new w.a.PlaneGeometry({dynamic:!0}),castShadow:!1,renderNormal:!0,$ignorePicking:!0}),this._groundMesh.rotation.rotateX(-Math.PI/2),this._labelsBuilder=new l.a(512,512,e),this._labelsBuilder.getMesh().renderOrder=100,this._labelsBuilder.getMesh().material.depthTest=!1,this.rootNode.add(this._labelsBuilder.getMesh()),this._initMeshes(),this._api=e}var i=r(0),s=r.n(i),w=r(1),S=r(204),a=r(25),E=r(2),o=r(6),u=r(65),l=r(66),h=r(46),k=o.a.vec3;w.a.Shader.import(h.a),n.prototype={constructor:n,extrudeY:!0,update:function(e,t,r,n,i){var u=e.getData();null==n&&(n=0),null==i&&(i=u.count()),this._startIndex=n,this._endIndex=i-1,this._triangulation(e,n,i);var a=this._getShader(e.get("shading"));this._prepareMesh(e,a,r,n,i),this.rootNode.updateWorldTransform(),this._updateRegionMesh(e,r,n,i);var l=e.coordinateSystem;"geo3D"===l.type&&this._updateGroundPlane(e,l,r);var h=this;this._labelsBuilder.updateData(u,n,i),this._labelsBuilder.getLabelPosition=function(e,t,r){var n=u.getName(e),i=r;if("geo3D"===l.type){var a=l.getRegion(n);return a?(s=a.center,l.dataToPoint([s[0],s[1],i])):[NaN,NaN,NaN]}var o=h._triangulationResults[e-h._startIndex],s=h.extrudeY?[(o.max[0]+o.min[0])/2,o.max[1]+i,(o.max[2]+o.min[2])/2]:[(o.max[0]+o.min[0])/2,(o.max[1]+o.min[1])/2,o.max[2]+i]},this._data=u,this._labelsBuilder.updateLabels(),this._updateDebugWireframe(e),this._lastHoverDataIndex=0},_initMeshes:function(){var e,t=this,r=(e=new w.a.Mesh({name:"Polygon",material:new w.a.Material({shader:t._shadersMap.lambert}),geometry:new w.a.Geometry({sortTriangles:!0,dynamic:!0}),culling:!1,ignorePicking:!0,renderNormal:!0}),s.a.util.extend(e.geometry,u.a),e),n=new w.a.Mesh({material:new w.a.Material({shader:this._linesShader}),castShadow:!1,ignorePicking:!0,$ignorePicking:!0,geometry:new a.a({useNativeLine:!1})});this.rootNode.add(r),this.rootNode.add(n),r.material.define("both","VERTEX_COLOR"),r.material.define("fragment","DOUBLE_SIDED"),this._polygonMesh=r,this._linesMesh=n,this.rootNode.add(this._groundMesh)},_getShader:function(e){var t=this._shadersMap[e];return(t=t||this._shadersMap.lambert).__shading=e,t},_prepareMesh:function(e,t,r,n,i){for(var a=0,o=0,s=0,u=0,l=n;l<i;l++){var h=this._getRegionPolygonInfo(l),c=this._getRegionLinesInfo(l,e,this._linesMesh.geometry);a+=h.vertexCount,o+=h.triangleCount,s+=c.vertexCount,u+=c.triangleCount}var d=this._polygonMesh,f=d.geometry;["position","normal","texcoord0","color"].forEach(function(e){f.attributes[e].init(a)}),f.indices=new(65535<a?Uint32Array:Uint16Array)(3*o),d.material.shader!==t&&d.material.attachShader(t,!0),w.a.setMaterialFromModel(t.__shading,d.material,e,r),0<s&&(this._linesMesh.geometry.resetOffset(),this._linesMesh.geometry.setVertexCount(s),this._linesMesh.geometry.setTriangleCount(u)),this._dataIndexOfVertex=new Uint32Array(a),this._vertexRangeOfDataIndex=new Uint32Array(2*(i-n))},_updateRegionMesh:function(e,t,r,n){for(var i=e.getData(),a=0,o=0,s=!1,u=this._polygonMesh,l=this._linesMesh,h=r;h<n;h++){var c=e.getRegionModel(h),d=c.getModel("itemStyle"),f=d.get("color"),p=E.a.firstNotNull(d.get("opacity"),1),m=i.getItemVisual(h,"color",!0);null!=m&&i.hasValue(h)&&(f=m),i.setItemVisual(h,"color",f),i.setItemVisual(h,"opacity",p),f=w.a.parseColor(f);var g=w.a.parseColor(d.get("borderColor"));f[3]*=p,g[3]*=p;var _=f[3]<.99;u.material.set("color",[1,1,1,1]),s=s||_;for(var v=E.a.firstNotNull(c.get("height",!0),e.get("regionHeight")),y=this._updatePolygonGeometry(e,u.geometry,h,v,a,o,f),x=a;x<y.vertexOffset;x++)this._dataIndexOfVertex[x]=h;this._vertexRangeOfDataIndex[2*(h-r)]=a,this._vertexRangeOfDataIndex[2*(h-r)+1]=y.vertexOffset,a=y.vertexOffset,o=y.triangleOffset;var T=d.get("borderWidth"),b=0<T;b&&(T*=t.getDevicePixelRatio(),this._updateLinesGeometry(l.geometry,e,h,v,T,e.coordinateSystem.transform)),l.invisible=!b,l.material.set({color:g})}(u=this._polygonMesh).material.transparent=s,u.material.depthMask=!s,u.geometry.updateBoundingBox(),u.frontFace=this.extrudeY?w.a.Mesh.CCW:w.a.Mesh.CW,u.material.get("normalMap")&&u.geometry.generateTangents(),u.seriesIndex=e.seriesIndex,u.on("mousemove",this._onmousemove,this),u.on("mouseout",this._onmouseout,this)},_updateDebugWireframe:function(e){var t,r,n,i=e.getModel("debug.wireframe");i.get("show")&&(t=w.a.parseColor(i.get("lineStyle.color")||"rgba(0,0,0,0.5)"),r=E.a.firstNotNull(i.get("lineStyle.width"),1),(n=this._polygonMesh).geometry.generateBarycentric(),n.material.define("both","WIREFRAME_TRIANGLE"),n.material.set("wireframeLineColor",t),n.material.set("wireframeLineWidth",r))},_onmousemove:function(e){var t=this._dataIndexOfVertex[e.triangle[0]];null==t&&(t=-1),t!==this._lastHoverDataIndex&&(this.downplay(this._lastHoverDataIndex),this.highlight(t),this._labelsBuilder.updateLabels([t])),this._lastHoverDataIndex=t,this._polygonMesh.dataIndex=t},_onmouseout:function(e){e.target&&(this.downplay(this._lastHoverDataIndex),this._lastHoverDataIndex=-1,this._polygonMesh.dataIndex=-1),this._labelsBuilder.updateLabels([])},_updateGroundPlane:function(e,t,r){var n,i,a=e.getModel("groundPlane",e);this._groundMesh.invisible=!a.get("show",!0),this._groundMesh.invisible||(n=e.get("shading"),i=(i=this._groundMaterials[n])||this._groundMaterials.lambert,w.a.setMaterialFromModel(n,i,a,r),i.get("normalMap")&&this._groundMesh.geometry.generateTangents(),this._groundMesh.material=i,this._groundMesh.material.set("color",w.a.parseColor(a.get("color"))),this._groundMesh.scale.set(t.size[0],t.size[2],1))},_triangulation:function(e,t,r){this._triangulationResults=[];for(var n=[1/0,1/0,1/0],i=[-1/0,-1/0,-1/0],a=e.coordinateSystem,o=t;o<r;o++){for(var s=[],u=e.getRegionPolygonCoords(o),l=0;l<u.length;l++){var h=u[l].exterior,c=u[l].interiors,d=[],f=[];if(!(h.length<3)){for(var p=0,m=0;m<h.length;m++){var g=h[m];d[p++]=g[0],d[p++]=g[1]}for(m=0;m<c.length;m++)if(!(c[m].length<3)){for(var _=d.length/2,v=0;v<c[m].length;v++){g=c[m][v];d.push(g[0]),d.push(g[1])}f.push(_)}for(var y=Object(S.a)(d,f),x=new Float64Array(d.length/2*3),T=[],b=[1/0,1/0,1/0],w=[-1/0,-1/0,-1/0],E=0,m=0;m<d.length;)k.set(T,d[m++],0,d[m++]),a&&a.transform&&k.transformMat4(T,T,a.transform),k.min(b,b,T),k.max(w,w,T),x[E++]=T[0],x[E++]=T[1],x[E++]=T[2];k.min(n,n,b),k.max(i,i,w),s.push({points:x,indices:y,min:b,max:w})}}this._triangulationResults.push(s)}this._geoBoundingBox=[n,i]},_getRegionPolygonInfo:function(e){for(var t=this._triangulationResults[e-this._startIndex],r=0,n=0,i=0;i<t.length;i++)r+=t[i].points.length/3,n+=t[i].indices.length/3;return{vertexCount:2*r+4*r,triangleCount:2*n+2*r}},_updatePolygonGeometry:function(e,t,r,n,s,a,u){function i(e,t){var r=s;!function(e,t){for(var r=e.points,n=r.length,i=[],a=[],o=0;o<n;o+=3)i[0]=r[o],i[g]=t,i[_]=r[o+2],a[0]=(r[o]*v[0]-y[0])/T,a[1]=(r[o+2]*v[_]-y[2])/T,l.set(s,i),p&&d.set(s,u),c.set(s++,a)}(e,t);for(var n=e.indices.length,i=0;i<n;i++)m[3*a+i]=e.indices[i]+r;a+=e.indices.length/3}for(var o=e.get("projectUVOnGround"),l=t.attributes.position,h=t.attributes.normal,c=t.attributes.texcoord0,d=t.attributes.color,f=this._triangulationResults[r-this._startIndex],p=d.value&&u,m=t.indices,g=this.extrudeY?1:2,_=this.extrudeY?2:1,v=[this.rootNode.worldTransform.x.len(),this.rootNode.worldTransform.y.len(),this.rootNode.worldTransform.z.len()],y=k.mul([],this._geoBoundingBox[0],v),x=k.mul([],this._geoBoundingBox[1],v),T=Math.max(x[0]-y[0],x[2]-y[2]),b=this.extrudeY?[0,1,0]:[0,0,1],w=k.negate([],b),E=0;E<f.length;E++){var S=s,A=f[E];i(A,0),i(A,n);for(var M=A.points.length/3,C=0;C<M;C++)h.set(S+C,w),h.set(S+C+M,b);for(var L=[0,3,1,1,3,2],D=[[],[],[],[]],N=[],R=[],P=[],I=[],O=0,C=0;C<M;C++){for(var F=(C+1)%M,B=(A.points[3*F]-A.points[3*C])*v[0],U=(A.points[3*F+2]-A.points[3*C+2])*v[_],z=Math.sqrt(B*B+U*U),G=0;G<4;G++){var H=0===G||3===G,V=3*(H?C:F);D[G][0]=A.points[V],D[G][g]=1<G?n:0,D[G][_]=A.points[2+V],l.set(s+G,D[G]),o?(I[0]=(A.points[V]*v[0]-y[0])/T,I[1]=(A.points[2+V]*v[_]-y[_])/T):(I[0]=(H?O:O+z)/T,I[1]=(D[G][g]*v[g]-y[g])/T),c.set(s+G,I)}k.sub(N,D[1],D[0]),k.sub(R,D[3],D[0]),k.cross(P,N,R),k.normalize(P,P);for(G=0;G<4;G++)h.set(s+G,P),p&&d.set(s+G,u);for(G=0;G<6;G++)m[3*a+G]=L[G]+s;s+=4,a+=2,O+=z}}return t.dirty(),{vertexOffset:s,triangleOffset:a}},_getRegionLinesInfo:function(e,t,i){var a=0,o=0;return 0<t.getRegionModel(e).getModel("itemStyle").get("borderWidth")&&t.getRegionPolygonCoords(e).forEach(function(e){var t=e.exterior,r=e.interiors;a+=i.getPolylineVertexCount(t),o+=i.getPolylineTriangleCount(t);for(var n=0;n<r.length;n++)a+=i.getPolylineVertexCount(r[n]),o+=i.getPolylineTriangleCount(r[n])},this),{vertexCount:a,triangleCount:o}},_updateLinesGeometry:function(i,e,t,a,o,s){function u(e){for(var t=new Float64Array(3*e.length),r=0,n=[],i=0;i<e.length;i++)n[0]=e[i][0],n[1]=a+.1,n[2]=e[i][1],s&&k.transformMat4(n,n,s),t[r++]=n[0],t[r++]=n[1],t[r++]=n[2];return t}var l=[1,1,1,1];e.getRegionPolygonCoords(t).forEach(function(e){var t=e.exterior,r=e.interiors;i.addPolyline(u(t),l,o);for(var n=0;n<r.length;n++)i.addPolyline(u(r[n]),l,o)})},highlight:function(e){var t,r,n,i,a,o=this._data;o&&(i=(t=o.getItemModel(e).getModel("emphasis.itemStyle")).get("color"),r=E.a.firstNotNull(t.get("opacity"),o.getItemVisual(e,"opacity"),1),null==i&&(n=o.getItemVisual(e,"color"),i=s.a.color.lift(n,-.4)),null==r&&(r=o.getItemVisual(e,"opacity")),(a=w.a.parseColor(i))[3]*=r,this._setColorOfDataIndex(o,e,a))},downplay:function(e){var t,r,n,i=this._data;i&&(t=i.getItemVisual(e,"color"),r=E.a.firstNotNull(i.getItemVisual(e,"opacity"),1),(n=w.a.parseColor(t))[3]*=r,this._setColorOfDataIndex(i,e,n))},_setColorOfDataIndex:function(e,t,r){if(!(t<this._startIndex&&t>this._endIndex)){t-=this._startIndex;for(var n=this._vertexRangeOfDataIndex[2*t];n<this._vertexRangeOfDataIndex[2*t+1];n++)this._polygonMesh.geometry.attributes.color.set(n,r);this._polygonMesh.geometry.dirty(),this._api.getZr().refresh()}}},t.a=n},function(e,t,r){"use strict";var i=r(97),v=r(6).a.vec3,y=v.create(),x=v.create(),T=v.create();t.a={needsSortTriangles:function(){return this.indices&&this.sortTriangles},needsSortTrianglesProgressively:function(){return this.needsSortTriangles()&&2e4<=this.triangleCount},doSortTriangles:function(e,t){var r=this.indices;if(0===t){var n=this.attributes.position,e=e.array;this._triangleZList&&this._triangleZList.length===this.triangleCount||(this._triangleZList=new Float32Array(this.triangleCount),this._sortedTriangleIndices=new Uint32Array(this.triangleCount),this._indicesTmp=new r.constructor(r.length),this._triangleZListTmp=new Float32Array(this.triangleCount));for(var i,a=0,o=0;o<r.length;){n.get(r[o++],y),n.get(r[o++],x),n.get(r[o++],T);var s=v.sqrDist(y,e),u=v.sqrDist(x,e),l=v.sqrDist(T,e),h=Math.min(s,u),h=Math.min(h,l);3===o?(i=h,h=0):h-=i,this._triangleZList[a++]=h}}for(var c=this._sortedTriangleIndices,o=0;o<c.length;o++)c[o]=o;if(this.triangleCount<2e4)0===t&&this._simpleSort(!0);else for(o=0;o<3;o++)this._progressiveQuickSort(3*t+o);for(var d=this._indicesTmp,f=this._triangleZListTmp,p=this._triangleZList,o=0;o<this.triangleCount;o++){var m=3*c[o],g=3*o;d[g++]=r[m++],d[g++]=r[m++],d[g]=r[m],f[o]=p[c[o]]}var _=this._indicesTmp;this._indicesTmp=this.indices,this.indices=_;_=this._triangleZListTmp;this._triangleZListTmp=this._triangleZList,this._triangleZList=_,this.dirtyIndices()},_simpleSort:function(e){function t(e,t){return r[t]-r[e]}var r=this._triangleZList,n=this._sortedTriangleIndices;e?Array.prototype.sort.call(n,t):i.a.sort(n,t,0,n.length-1)},_progressiveQuickSort:function(e){var r=this._triangleZList,t=this._sortedTriangleIndices;this._quickSort=this._quickSort||new i.a,this._quickSort.step(t,function(e,t){return r[t]-r[e]},e)}}},function(e,t,r){"use strict";function n(e,t,r){this._labelsMesh=new o.a,this._labelTextureSurface=new a.a({width:512,height:512,devicePixelRatio:r.getDevicePixelRatio(),onupdate:function(){r.getZr().refresh()}}),this._api=r,this._labelsMesh.material.set("textureAtlas",this._labelTextureSurface.getTexture())}var i=r(0),S=r.n(i),a=r(81),o=r(63),A=r(2);n.prototype.getLabelPosition=function(e,t,r){return[0,0,0]},n.prototype.getLabelDistance=function(e,t,r){return 0},n.prototype.getMesh=function(){return this._labelsMesh},n.prototype.updateData=function(e,t,r){null==t&&(t=0),null==r&&(r=e.count()),this._labelsVisibilitiesBits&&this._labelsVisibilitiesBits.length===r-t||(this._labelsVisibilitiesBits=new Uint8Array(r-t));for(var n=["label","show"],i=["emphasis","label","show"],a=t;a<r;a++){var o=e.getItemModel(a),s=o.get(n),u=o.get(i);null==u&&(u=s);var l=(s?1:0)|(u?2:0);this._labelsVisibilitiesBits[a-t]=l}this._start=t,this._end=r,this._data=e},n.prototype.updateLabels=function(e){if(this._data){for(var t=0<(e=e||[]).length,r={},n=0;n<e.length;n++)r[e[n]]=!0;this._labelsMesh.geometry.convertToDynamicArray(!0),this._labelTextureSurface.clear();for(var i=["label"],a=["emphasis","label"],o=this._data.hostModel,s=this._data,u=o.getModel(i),l=o.getModel(a,u),h={left:"right",right:"left",top:"center",bottom:"center"},c={left:"middle",right:"middle",top:"bottom",bottom:"top"},d=this._start;d<this._end;d++){var f=!1;if(t&&r[d]&&(f=!0),this._labelsVisibilitiesBits[d-this._start]&(f?2:1)){var p=s.getItemModel(d).getModel(f?a:i,f?l:u),m=p.get("distance")||0,g=p.get("position"),_=p.getModel("textStyle"),v=this._api.getDevicePixelRatio(),y=o.getFormattedLabel(d,f?"emphasis":"normal");if(null==y||""===y)return;var x=new S.a.graphic.Text;S.a.graphic.setTextStyle(x.style,_,{text:y,textFill:_.get("color")||s.getItemVisual(d,"color")||"#000",textAlign:"left",textVerticalAlign:"top",opacity:A.a.firstNotNull(_.get("opacity"),s.getItemVisual(d,"opacity"),1)});var T=x.getBoundingRect();T.height*=1.2;var b=this._labelTextureSurface.add(x),w=h[g]||"center",E=c[g]||"bottom";this._labelsMesh.geometry.addSprite(this.getLabelPosition(d,g,m),[T.width*v,T.height*v],b,w,E,this.getLabelDistance(d,g,m)*v)}}this._labelsMesh.material.set("uvScale",this._labelTextureSurface.getCoordsScale()),this._labelTextureSurface.getZr().refreshImmediately(),this._labelsMesh.geometry.convertToTypedArray(),this._labelsMesh.geometry.dirty()}},t.a=n},function(e,t,r){"use strict";function n(e,t){this.rootNode=new S.a.Node,this.is2D=e,this._labelsBuilder=new a.a(256,256,t),this._labelsBuilder.getMesh().renderOrder=100,this.rootNode.add(this._labelsBuilder.getMesh()),this._api=t,this._spriteImageCanvas=document.createElement("canvas"),this._startDataIndex=0,this._endDataIndex=0,this._sizeScale=1}var i=r(0),s=r.n(i),S=r(1),u=r(239),A=r(240),a=r(66),o=r(9),c=r(2);n.prototype={constructor:n,highlightOnMouseover:!0,update:function(e,t,r,n,i){var a=this._prevMesh;this._prevMesh=this._mesh,this._mesh=a;var o=e.getData();null==n&&(n=0),null==i&&(i=o.count()),this._startDataIndex=n,this._endDataIndex=i-1,this._mesh||(s=this._prevMesh&&this._prevMesh.material,this._mesh=new A.a({renderOrder:10,frustumCulling:!1}),s&&(this._mesh.material=s));var s=this._mesh.material,u=this._mesh.geometry,l=u.attributes;this.rootNode.remove(this._prevMesh),this.rootNode.add(this._mesh),this._setPositionTextureToMesh(this._mesh,this._positionTexture);var h=this._getSymbolInfo(e,n,i),c=r.getDevicePixelRatio(),d=e.getModel("itemStyle").getItemStyle(),f=e.get("large"),p=1;2<h.maxSize?(p=this._updateSymbolSprite(e,d,h,c),s.enableTexture("sprite")):s.disableTexture("sprite"),l.position.init(i-n);var m=[];f?(s.undefine("VERTEX_SIZE"),s.undefine("VERTEX_COLOR"),y=o.getVisual("color"),x=o.getVisual("opacity"),S.a.parseColor(y,m),m[3]*=x,s.set({color:m,u_Size:h.maxSize*this._sizeScale})):(s.set({color:[1,1,1,1]}),s.define("VERTEX_SIZE"),s.define("VERTEX_COLOR"),l.size.init(i-n),l.color.init(i-n),this._originalOpacity=new Float32Array(i-n));for(var g=o.getLayout("points"),_=l.position.value,v=0;v<i-n;v++){var y,x,T,b=3*v,w=2*v;this.is2D?(_[b]=g[w],_[1+b]=g[1+w],_[2+b]=-10):(_[b]=g[b],_[1+b]=g[1+b],_[2+b]=g[2+b]),f||(y=o.getItemVisual(v,"color"),x=o.getItemVisual(v,"opacity"),S.a.parseColor(y,m),m[3]*=x,l.color.set(v,m),m[3],T=(T=o.getItemVisual(v,"symbolSize"))instanceof Array?Math.max(T[0],T[1]):T,isNaN(T)&&(T=0),l.size.value[v]=T*p*this._sizeScale,this._originalOpacity[v]=m[3])}this._mesh.sizeScale=p,u.updateBoundingBox(),u.dirty(),this._updateMaterial(e,d);var E=e.coordinateSystem;E&&E.viewGL&&s[E.viewGL.isLinearSpace()?"define":"undefine"]("fragment","SRGB_DECODE"),f||this._updateLabelBuilder(e,n,i),this._updateHandler(e,t,r),this._updateAnimation(e),this._api=r},getPointsMesh:function(){return this._mesh},updateLabels:function(e){this._labelsBuilder.updateLabels(e)},hideLabels:function(){this.rootNode.remove(this._labelsBuilder.getMesh())},showLabels:function(){this.rootNode.add(this._labelsBuilder.getMesh())},_updateSymbolSprite:function(e,t,r,n){r.maxSize=Math.min(2*r.maxSize,200);var i,a,o=[];return 1<r.aspect?(o[0]=r.maxSize,o[1]=r.maxSize/r.aspect):(o[1]=r.maxSize,o[0]=r.maxSize*r.aspect),o[0]=o[0]||1,o[1]=o[1]||1,this._symbolType===r.type&&(i=this._symbolSize,a=o,i&&a&&i[0]===a[0]&&i[1]===a[1])&&this._lineWidth===t.lineWidth||(u.a.createSymbolSprite(r.type,o,{fill:"#fff",lineWidth:t.lineWidth,stroke:"transparent",shadowColor:"transparent",minMargin:Math.min(o[0]/2,10)},this._spriteImageCanvas),u.a.createSDFFromCanvas(this._spriteImageCanvas,Math.min(this._spriteImageCanvas.width,32),20,this._mesh.material.get("sprite").image),this._symbolType=r.type,this._symbolSize=o,this._lineWidth=t.lineWidth),this._spriteImageCanvas.width/r.maxSize*n},_updateMaterial:function(e,t){var r="lighter"===e.get("blendMode")?S.a.additiveBlend:null,n=this._mesh.material;n.blend=r,n.set("lineWidth",t.lineWidth/20);var i=S.a.parseColor(t.stroke);n.set("strokeColor",i),n.transparent=!0,n.depthMask=!1,n.depthTest=!this.is2D,n.sortVertices=!this.is2D},_updateLabelBuilder:function(e,i,t){var r=e.getData(),n=this._mesh.geometry,a=n.attributes.position.value,i=this._startDataIndex,o=this._mesh.sizeScale;this._labelsBuilder.updateData(r,i,t),this._labelsBuilder.getLabelPosition=function(e,t,r){var n=3*(e-i);return[a[n],a[1+n],a[2+n]]},this._labelsBuilder.getLabelDistance=function(e,t,r){return n.attributes.size.get(e-i)/o/2+r},this._labelsBuilder.updateLabels()},_updateAnimation:function(e){S.a.updateVertexAnimation([["prevPosition","position"],["prevSize","size"]],this._prevMesh,this._mesh,e)},_updateHandler:function(r,e,n){var i,a=r.getData(),o=this._mesh,s=this,u=-1,l=r.coordinateSystem&&"cartesian3D"===r.coordinateSystem.type;l&&(i=r.coordinateSystem.model),o.seriesIndex=r.seriesIndex,o.off("mousemove"),o.off("mouseout"),o.on("mousemove",function(e){var t=e.vertexIndex+s._startDataIndex;t!==u&&(this.highlightOnMouseover&&(this.downplay(a,u),this.highlight(a,t),this._labelsBuilder.updateLabels([t])),l&&n.dispatchAction({type:"grid3DShowAxisPointer",value:[a.get(r.coordDimToDataDim("x")[0],t),a.get(r.coordDimToDataDim("y")[0],t),a.get(r.coordDimToDataDim("z")[0],t)],grid3DIndex:i.componentIndex})),o.dataIndex=t,u=t},this),o.on("mouseout",function(e){var t=e.vertexIndex+s._startDataIndex;this.highlightOnMouseover&&(this.downplay(a,t),this._labelsBuilder.updateLabels()),u=-1,o.dataIndex=-1,l&&n.dispatchAction({type:"grid3DHideAxisPointer",grid3DIndex:i.componentIndex})},this)},updateLayout:function(e,t,r){var n=e.getData();if(this._mesh){var i=this._mesh.geometry.attributes.position.value,a=n.getLayout("points");if(this.is2D)for(var o=0;o<a.length/2;o++){var s=3*o,u=2*o;i[s]=a[u],i[1+s]=a[1+u],i[2+s]=-10}else for(o=0;o<a.length;o++)i[o]=a[o];this._mesh.geometry.dirty(),r.getZr().refresh()}},updateView:function(e){var t;this._mesh&&(t=new o.a,o.a.mul(t,e.viewMatrix,this._mesh.worldTransform),o.a.mul(t,e.projectionMatrix,t),this._mesh.updateNDCPosition(t,this.is2D,this._api))},highlight:function(e,t){var r,n,i,a,o;t>this._endDataIndex||t<this._startDataIndex||(a=(r=e.getItemModel(t).getModel("emphasis.itemStyle")).get("color"),n=r.get("opacity"),null==a&&(i=e.getItemVisual(t,"color"),a=s.a.color.lift(i,-.4)),null==n&&(n=e.getItemVisual(t,"opacity")),(o=S.a.parseColor(a))[3]*=n,this._mesh.geometry.attributes.color.set(t-this._startDataIndex,o),this._mesh.geometry.dirtyAttribute("color"),this._api.getZr().refresh())},downplay:function(e,t){var r,n,i;t>this._endDataIndex||t<this._startDataIndex||(r=e.getItemVisual(t,"color"),n=e.getItemVisual(t,"opacity"),(i=S.a.parseColor(r))[3]*=n,this._mesh.geometry.attributes.color.set(t-this._startDataIndex,i),this._mesh.geometry.dirtyAttribute("color"),this._api.getZr().refresh())},fadeOutAll:function(e){if(this._originalOpacity){for(var t=this._mesh.geometry,r=0;r<t.vertexCount;r++){var n=this._originalOpacity[r]*e;t.attributes.color.value[4*r+3]=n}t.dirtyAttribute("color"),this._api.getZr().refresh()}},fadeInAll:function(){this.fadeOutAll(1)},setPositionTexture:function(e){this._mesh&&this._setPositionTextureToMesh(this._mesh,e),this._positionTexture=e},removePositionTexture:function(){this._positionTexture=null,this._mesh&&this._setPositionTextureToMesh(this._mesh,null)},setSizeScale:function(e){if(e!==this._sizeScale){if(this._mesh){var t=this._mesh.material.get("u_Size");this._mesh.material.set("u_Size",t/this._sizeScale*e);var r=this._mesh.geometry.attributes;if(r.size.value)for(var n=0;n<r.size.value.length;n++)r.size.value[n]=r.size.value[n]/this._sizeScale*e}this._sizeScale=e}},_setPositionTextureToMesh:function(e,t){t&&e.material.set("positionTexture",t),e.material[t?"enableTexture":"disableTexture"]("positionTexture")},_getSymbolInfo:function(e,t,r){if(e.get("large"))return n=(l=c.a.firstNotNull(e.get("symbolSize"),1))instanceof Array?(o=Math.max(l[0],l[1]),l[0]/l[1]):(o=l,1),{maxSize:l,type:e.get("symbol"),aspect:n};for(var n,i=e.getData(),a=i.getItemVisual(0,"symbol")||"circle",o=0,s=t;s<r;s++){var u,l=i.getItemVisual(s,"symbolSize"),h=i.getItemVisual(s,"symbol");if(l instanceof Array)u=l[0]/l[1],o=Math.max(Math.max(l[0],l[1]),o);else{if(isNaN(l))return;u=1,o=Math.max(l,o)}a=h,n=u}return{maxSize:o,type:a,aspect:n}}},t.a=n},function(e,t){var r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(e){"object"==("undefined"==typeof window?"undefined":_typeof(window))&&(r=window)}e.exports=r},function(e,t,r){"use strict";function n(e){this._list=new i.a,this._map={},this._maxSize=e||10}var i=r(114);n.prototype.setMaxSize=function(e){this._maxSize=e},n.prototype.put=function(e,t){var r,n,i;this._map.hasOwnProperty(e)||((r=this._list.length())>=this._maxSize&&0<r&&(n=this._list.head,this._list.remove(n),delete this._map[n.key]),(i=this._list.insert(t)).key=e,this._map[e]=i)},n.prototype.get=function(e){var t=this._map[e];if(this._map.hasOwnProperty(e))return t!==this._list.tail&&(this._list.remove(t),this._list.insertEntry(t)),t.value},n.prototype.remove=function(e){var t=this._map[e];void 0!==t&&(delete this._map[e],this._list.remove(t))},n.prototype.clear=function(){this._list.clear(),this._map={}},t.a=n},function(e,t,r){"use strict";var u,n=r(20),i={create:function(){var e=new n.a(2);return e[0]=0,e[1]=0,e},clone:function(e){var t=new n.a(2);return t[0]=e[0],t[1]=e[1],t},fromValues:function(e,t){var r=new n.a(2);return r[0]=e,r[1]=t,r},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e},set:function(e,t,r){return e[0]=t,e[1]=r,e},add:function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e},subtract:function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e}};i.sub=i.subtract,i.multiply=function(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e},i.mul=i.multiply,i.divide=function(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e},i.div=i.divide,i.min=function(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e},i.max=function(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e},i.scale=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e},i.scaleAndAdd=function(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e},i.distance=function(e,t){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)},i.dist=i.distance,i.squaredDistance=function(e,t){var r=t[0]-e[0],n=t[1]-e[1];return r*r+n*n},i.sqrDist=i.squaredDistance,i.length=function(e){var t=e[0],r=e[1];return Math.sqrt(t*t+r*r)},i.len=i.length,i.squaredLength=function(e){var t=e[0],r=e[1];return t*t+r*r},i.sqrLen=i.squaredLength,i.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e},i.inverse=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e},i.normalize=function(e,t){var r=t[0],n=t[1],i=r*r+n*n;return 0<i&&(i=1/Math.sqrt(i),e[0]=t[0]*i,e[1]=t[1]*i),e},i.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]},i.cross=function(e,t,r){var n=t[0]*r[1]-t[1]*r[0];return e[0]=e[1]=0,e[2]=n,e},i.lerp=function(e,t,r,n){var i=t[0],a=t[1];return e[0]=i+n*(r[0]-i),e[1]=a+n*(r[1]-a),e},i.random=function(e,t){t=t||1;var r=2*GLMAT_RANDOM()*Math.PI;return e[0]=Math.cos(r)*t,e[1]=Math.sin(r)*t,e},i.transformMat2=function(e,t,r){var n=t[0],i=t[1];return e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i,e},i.transformMat2d=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},i.transformMat3=function(e,t,r){var n=t[0],i=t[1];return e[0]=r[0]*n+r[3]*i+r[6],e[1]=r[1]*n+r[4]*i+r[7],e},i.transformMat4=function(e,t,r){var n=t[0],i=t[1];return e[0]=r[0]*n+r[4]*i+r[12],e[1]=r[1]*n+r[5]*i+r[13],e},i.forEach=(u=i.create(),function(e,t,r,n,i,a){var o,s;for(t=t||2,r=r||0,s=n?Math.min(n*t+r,e.length):e.length,o=r;o<s;o+=t)u[0]=e[o],u[1]=e[o+1],i(u,u,a),e[o]=u[0],e[o+1]=u[1];return e}),t.a=i},function(e,t,r){"use strict";t.a="@export clay.prez.vertex\nuniform mat4 WVP : WORLDVIEWPROJECTION;\nattribute vec3 pos : POSITION;\nattribute vec2 uv : TEXCOORD_0;\n@import clay.chunk.skinning_header\nvarying vec2 v_Texcoord;\nvoid main()\n{\n vec3 P = pos;\n#ifdef SKINNING\n @import clay.chunk.skin_matrix\n P = (skinMatrixWS * vec4(pos, 1.0)).xyz;\n#endif\n gl_Position = WVP * vec4(P, 1.0);\n v_Texcoord = uv;\n}\n@end\n@export clay.prez.fragment\nuniform sampler2D alphaMap;\nuniform float alphaCutoff: 0.0;\nvarying vec2 v_Texcoord;\nvoid main()\n{\n if (alphaCutoff > 0.0) {\n if (texture2D(alphaMap, v_Texcoord).a <= alphaCutoff) {\n discard;\n }\n }\n gl_FragColor = vec4(0.0,0.0,0.0,1.0);\n}\n@end"},function(e,t,r){"use strict";var n,i=r(35),a=r(11),o=i.a.extend({material:null,geometry:null,mode:a.a.TRIANGLES,_renderInfo:null},{__program:null,lightGroup:0,renderOrder:0,culling:!0,cullFace:a.a.BACK,frontFace:a.a.CCW,frustumCulling:!0,receiveShadow:!0,castShadow:!0,ignorePicking:!1,ignorePreZ:!1,ignoreGBuffer:!1,isRenderable:function(){return this.geometry&&this.material&&this.material.shader&&!this.invisible&&0<this.geometry.vertexCount},beforeRender:function(){},afterRender:function(){},getBoundingBox:function(e,t){return t=i.a.prototype.getBoundingBox.call(this,e,t),this.geometry&&this.geometry.boundingBox&&t.union(this.geometry.boundingBox),t},clone:(n=["castShadow","receiveShadow","mode","culling","cullFace","frontFace","frustumCulling","renderOrder","lineWidth","ignorePicking","ignorePreZ","ignoreGBuffer"],function(){var e=i.a.prototype.clone.call(this);e.geometry=this.geometry,e.material=this.material;for(var t=0;t<n.length;t++){var r=n[t];e[r]!==this[r]&&(e[r]=this[r])}return e})});o.POINTS=a.a.POINTS,o.LINES=a.a.LINES,o.LINE_LOOP=a.a.LINE_LOOP,o.LINE_STRIP=a.a.LINE_STRIP,o.TRIANGLES=a.a.TRIANGLES,o.TRIANGLE_STRIP=a.a.TRIANGLE_STRIP,o.TRIANGLE_FAN=a.a.TRIANGLE_FAN,o.BACK=a.a.BACK,o.FRONT=a.a.FRONT,o.FRONT_AND_BACK=a.a.FRONT_AND_BACK,o.CW=a.a.CW,o.CCW=a.a.CCW,t.a=o},function(e,t,r){"use strict";var n={isPowerOfTwo:function(e){return 0==(e&e-1)},nextPowerOfTwo:function(e){return e--,e|=e>>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<n&&0<i||n<0&&i<0)return null;var a=this.normal.array,o=this.distance,s=e.array;d.a.sub(h,t.array,e.array),d.a.normalize(h,h);var u=d.a.dot(a,h);if(0===u)return null;r=r||new c.a;var l=(d.a.dot(a,s)-o)/u;return d.a.scaleAndAdd(r.array,s,h,-l),r._dirty=!0,r}),applyTransform:(i=s.a.create(),a=u.a.create(),(o=u.a.create())[3]=1,function(e){e=e.array,d.a.scale(o,this.normal.array,this.distance),u.a.transformMat4(o,o,e),this.distance=d.a.dot(o,this.normal.array),s.a.invert(i,e),s.a.transpose(i,i),a[3]=0,d.a.copy(a,this.normal.array),u.a.transformMat4(a,a,i),d.a.copy(this.normal.array,a)}),copy:function(e){d.a.copy(this.normal.array,e.normal.array),this.normal._dirty=!0,this.distance=e.distance},clone:function(){var e=new n;return e.copy(this),e}},t.a=n},function(e,t,r){"use strict";var n=r(42);t.a=n.a},function(e,t,r){"use strict";function g(e,t,r){s.identity();var n=new i.a({widthSegments:t,heightSegments:r});switch(e){case"px":a.a.translate(s,s,o.a.POSITIVE_X),a.a.rotateY(s,s,Math.PI/2);break;case"nx":a.a.translate(s,s,o.a.NEGATIVE_X),a.a.rotateY(s,s,-Math.PI/2);break;case"py":a.a.translate(s,s,o.a.POSITIVE_Y),a.a.rotateX(s,s,-Math.PI/2);break;case"ny":a.a.translate(s,s,o.a.NEGATIVE_Y),a.a.rotateX(s,s,Math.PI/2);break;case"pz":a.a.translate(s,s,o.a.POSITIVE_Z);break;case"nz":a.a.translate(s,s,o.a.NEGATIVE_Z),a.a.rotateY(s,s,Math.PI)}return n.applyTransform(s),n}var n=r(15),i=r(43),a=r(9),o=r(3),_=r(18),v=r(14),s=new a.a,u=n.a.extend({dynamic:!1,widthSegments:1,heightSegments:1,depthSegments:1,inside:!1},function(){this.build()},{build:function(){var e={px:g("px",this.depthSegments,this.heightSegments),nx:g("nx",this.depthSegments,this.heightSegments),py:g("py",this.widthSegments,this.depthSegments),ny:g("ny",this.widthSegments,this.depthSegments),pz:g("pz",this.widthSegments,this.heightSegments),nz:g("nz",this.widthSegments,this.heightSegments)},t=["position","texcoord0","normal"],r=0,n=0;for(a in e)r+=e[a].vertexCount,n+=e[a].indices.length;for(var i=0;i<t.length;i++)this.attributes[t[i]].init(r);this.indices=new v.a.Uint16Array(n);var a,o=0,s=0;for(a in e){for(var u=e[a],i=0;i<t.length;i++)for(var l=t[i],h=u.attributes[l].value,c=u.attributes[l].size,d="normal"===l,f=0;f<h.length;f++){var p=h[f];this.inside&&d&&(p=-p),this.attributes[l].value[f+c*s]=p}for(var m=u.indices.length,f=0;f<u.indices.length;f++)this.indices[f+o]=s+u.indices[this.inside?m-f-1:f];o+=u.indices.length,s+=u.vertexCount}this.boundingBox=new _.a,this.boundingBox.max.set(1,1,1),this.boundingBox.min.set(-1,-1,-1)}});t.a=u},function(e,t,r){"use strict";var S=r(5),A=r(27),M=r(4),C=r(10),a=r(16),L=r(19),D=r(8),N=r(42),R=r(36),P=r(62),I=r(14),O=r(61),o=r(127),F=r(128),B={},U=["px","nx","py","ny","pz","nz"];B.prefilterEnvironmentMap=function(e,t,r,n,i){i&&n||(n=B.generateNormalDistribution(),i=B.integrateBRDF(e,n));var a=(r=r||{}).width||64,o=r.height||64,s=r.type||t.type,u=new A.a({width:a,height:o,type:s,flipY:!1,mipmaps:[]});u.isPowerOfTwo()||console.warn("Width and height must be power of two to enable mipmap.");var l=Math.min(a,o),h=Math.log(l)/Math.log(2)+1,c=new L.a({shader:new D.a({vertex:D.a.source("clay.skybox.vertex"),fragment:F.a})});c.set("normalDistribution",n),r.encodeRGBM&&c.define("fragment","RGBM_ENCODE"),r.decodeRGBM&&c.define("fragment","RGBM_DECODE");var d,f,p=new R.a;"texture2D"===t.textureType&&(f=new A.a({width:a,height:o,type:s===M.a.FLOAT?M.a.HALF_FLOAT:s}),O.a.panoramaToCubeMap(e,t,f,{encodeRGBM:r.decodeRGBM}),t=f),(d=new N.a({scene:p,material:c})).material.set("environmentMap",t);var m=new P.a({texture:u});r.encodeRGBM&&(s=u.type=M.a.UNSIGNED_BYTE);for(var g=new S.a({width:a,height:o,type:s}),_=new C.a({depthBuffer:!1}),v=I.a[s===M.a.UNSIGNED_BYTE?"Uint8Array":"Float32Array"],y=0;y<h;y++){u.mipmaps[y]={pixels:{}},d.material.set("roughness",y/(h-1));for(var x=g.width,T=2*Math.atan(x/(x-.5))/Math.PI*180,b=0;b<U.length;b++){var w=new v(g.width*g.height*4);_.attach(g),_.bind(e);var E=m.getCamera(U[b]);E.fov=T,e.render(p,E),e.gl.readPixels(0,0,g.width,g.height,M.a.RGBA,s,w),_.unbind(e),u.mipmaps[y].pixels[U[b]]=w}g.width/=2,g.height/=2,g.dirty()}return _.dispose(e),g.dispose(e),d.dispose(e),n.dispose(e),{environmentMap:u,brdfLookup:i,normalDistribution:n,maxMipmapLevel:h}},B.integrateBRDF=function(e,t){t=t||B.generateNormalDistribution();var r=new C.a({depthBuffer:!1}),n=new a.a({fragment:o.a}),i=new S.a({width:512,height:256,type:M.a.HALF_FLOAT,wrapS:M.a.CLAMP_TO_EDGE,wrapT:M.a.CLAMP_TO_EDGE,minFilter:M.a.NEAREST,magFilter:M.a.NEAREST,useMipmap:!1});return n.setUniform("normalDistribution",t),n.setUniform("viewportSize",[512,256]),n.attachOutput(i),n.render(e,r),r.dispose(e),i},B.generateNormalDistribution=function(e,t){for(var e=e||256,t=t||1024,r=new S.a({width:e,height:t,type:M.a.FLOAT,minFilter:M.a.NEAREST,magFilter:M.a.NEAREST,wrapS:M.a.CLAMP_TO_EDGE,wrapT:M.a.CLAMP_TO_EDGE,useMipmap:!1}),n=new Float32Array(t*e*4),i=[],a=0;a<e;a++){for(var o=a/e,s=o*o,u=0;u<t;u++){var l=(u<<16|u>>>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<t;u++){var c=4*(u*e+a),h=i[u],d=Math.sqrt(1-h*h),f=u/t,p=2*Math.PI*f;n[c]=d*Math.cos(p),n[1+c]=h,n[2+c]=d*Math.sin(p),n[3+c]=1}}return r.pixels=n,r},t.a=B},function(e,t,r){"use strict";var n=r(20),i={create:function(){var e=new n.a(4);return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e},clone:function(e){var t=new n.a(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e},transpose:function(e,t){var r;return e===t?(r=t[1],e[1]=t[2],e[2]=r):(e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3]),e},invert:function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r*a-i*n;return o?(o=1/o,e[0]=a*o,e[1]=-n*o,e[2]=-i*o,e[3]=r*o,e):null},adjoint:function(e,t){var r=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=r,e},determinant:function(e){return e[0]*e[3]-e[2]*e[1]},multiply:function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=r[0],u=r[1],l=r[2],h=r[3];return e[0]=n*s+a*u,e[1]=i*s+o*u,e[2]=n*l+a*h,e[3]=i*l+o*h,e}};i.mul=i.multiply,i.rotate=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),u=Math.cos(r);return e[0]=n*u+a*s,e[1]=i*u+o*s,e[2]=n*-s+a*u,e[3]=i*-s+o*u,e},i.scale=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=r[0],u=r[1];return e[0]=n*s,e[1]=i*s,e[2]=a*u,e[3]=o*u,e},i.frob=function(e){return Math.sqrt(Math.pow(e[0],2)+Math.pow(e[1],2)+Math.pow(e[2],2)+Math.pow(e[3],2))},i.LDU=function(e,t,r,n){return e[2]=n[2]/n[0],r[0]=n[0],r[1]=n[1],r[3]=n[3]-e[2]*r[1],[e,t,r]},t.a=i},function(e,t,r){"use strict";var n=r(20),i={create:function(){var e=new n.a(6);return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e},clone:function(e){var t=new n.a(6);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t},copy:function(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},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e},invert:function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=r*a-n*i;return u?(u=1/u,e[0]=a*u,e[1]=-n*u,e[2]=-i*u,e[3]=r*u,e[4]=(i*s-a*o)*u,e[5]=(n*o-r*s)*u,e):null},determinant:function(e){return e[0]*e[3]-e[1]*e[2]},multiply:function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],l=r[0],h=r[1],c=r[2],d=r[3],f=r[4],p=r[5];return e[0]=n*l+a*h,e[1]=i*l+o*h,e[2]=n*c+a*d,e[3]=i*c+o*d,e[4]=n*f+a*p+s,e[5]=i*f+o*p+u,e}};i.mul=i.multiply,i.rotate=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],l=Math.sin(r),h=Math.cos(r);return e[0]=n*h+a*l,e[1]=i*h+o*l,e[2]=n*-l+a*h,e[3]=i*-l+o*h,e[4]=s,e[5]=u,e},i.scale=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],l=r[0],h=r[1];return e[0]=n*l,e[1]=i*l,e[2]=a*h,e[3]=o*h,e[4]=s,e[5]=u,e},i.translate=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],l=r[0],h=r[1];return e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=n*l+a*h+s,e[5]=i*l+o*h+u,e},i.frob=function(e){return Math.sqrt(Math.pow(e[0],2)+Math.pow(e[1],2)+Math.pow(e[2],2)+Math.pow(e[3],2)+Math.pow(e[4],2)+Math.pow(e[5],2)+1)},t.a=i},function(e,t){var r="undefined"!=typeof window&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(e){setTimeout(e,16)};e.exports=r},function(e,t,r){"use strict";function s(e,t,r,n,i,a,o){this._zr=e,this._x=0,this._y=0,this._rowHeight=0,this.width=n,this.height=i,this.offsetX=t,this.offsetY=r,this.dpr=o,this.gap=a}function n(e){(e=e||{}).width=e.width||512,e.height=e.height||512,e.devicePixelRatio=e.devicePixelRatio||1,e.gap=null==e.gap?2:e.gap;var t=document.createElement("canvas");t.width=e.width*e.devicePixelRatio,t.height=e.height*e.devicePixelRatio,this._canvas=t,this._texture=new o.a({image:t,flipY:!1});var r=this;this._zr=a.a.zrender.init(t);var n=this._zr.refreshImmediately;this._zr.refreshImmediately=function(){n.call(this),r._texture.dirty(),r.onupdate&&r.onupdate()},this._dpr=e.devicePixelRatio,this._coords={},this.onupdate=e.onupdate,this._gap=e.gap,this._textureAtlasNodes=[new s(this._zr,0,0,e.width,e.height,this._gap,this._dpr)],this._nodeWidth=e.width,this._nodeHeight=e.height,this._currentNodeIdx=0}var i=r(0),a=r.n(i),o=r(5);s.prototype={constructor:s,clear:function(){this._x=0,this._y=0,this._rowHeight=0},add:function(e,t,r){var n=e.getBoundingRect();null==t&&(t=n.width),null==r&&(r=n.height),t*=this.dpr,r*=this.dpr,this._fitElement(e,t,r);var i=this._x,a=this._y,o=this.width*this.dpr,s=this.height*this.dpr,u=this.gap;if(o<i+t+u&&(i=this._x=0,a+=this._rowHeight+u,this._y=a,this._rowHeight=0),this._x+=t+u,this._rowHeight=Math.max(this._rowHeight,r),s<a+r+u)return null;e.position[0]+=this.offsetX*this.dpr+i,e.position[1]+=this.offsetY*this.dpr+a,this._zr.add(e);var l=[this.offsetX/this.width,this.offsetY/this.height];return[[i/o+l[0],a/s+l[1]],[(i+t)/o+l[0],(a+r)/s+l[1]]]},_fitElement:function(e,t,r){var n=e.getBoundingRect(),i=t/n.width,a=r/n.height;e.position=[-n.x*i,-n.y*a],e.scale=[i,a],e.update()}},n.prototype={clear:function(){for(var e=0;e<this._textureAtlasNodes.length;e++)this._textureAtlasNodes[e].clear();this._currentNodeIdx=0,this._zr.clear(),this._coords={}},getWidth:function(){return this._width},getHeight:function(){return this._height},getTexture:function(){return this._texture},getDevicePixelRatio:function(){return this._dpr},getZr:function(){return this._zr},_getCurrentNode:function(){return this._textureAtlasNodes[this._currentNodeIdx]},_expand:function(){if(this._currentNodeIdx++,this._textureAtlasNodes[this._currentNodeIdx])return this._textureAtlasNodes[this._currentNodeIdx];var e=4096/this._dpr,t=this._textureAtlasNodes.length,r=t*this._nodeWidth%e,n=Math.floor(t*this._nodeWidth/e)*this._nodeHeight;if(!(e<=n)){var i=(r+this._nodeWidth)*this._dpr,a=(n+this._nodeHeight)*this._dpr;try{this._zr.resize({width:i,height:a})}catch(e){this._canvas.width=i,this._canvas.height=a}var o=new s(this._zr,r,n,this._nodeWidth,this._nodeHeight,this._gap,this._dpr);return this._textureAtlasNodes.push(o),o}},add:function(e,t,r){if(this._coords[e.id])return this._coords[e.id];var n=this._getCurrentNode().add(e,t,r);if(!n){var i=this._expand();if(!i)return;n=i.add(e,t,r)}return this._coords[e.id]=n},getCoordsScale:function(){var e=this._dpr;return[this._nodeWidth/this._canvas.width*e,this._nodeHeight/this._canvas.height*e]},getCoords:function(e){return this._coords[e]}},t.a=n},function(e,t,r){function l(e,t,r,n){r<0&&(e+=r,r=-r),n<0&&(t+=n,n=-n),this.x=e,this.y=t,this.width=r,this.height=n}var n,i,a,o,s=r(83),u=r(84),h=s.applyTransform,c=Math.min,d=Math.max;l.prototype={constructor:l,union:function(e){var t=c(e.x,this.x),r=c(e.y,this.y);this.width=d(e.x+e.width,this.x+this.width)-t,this.height=d(e.y+e.height,this.y+this.height)-r,this.x=t,this.y=r},applyTransform:(n=[],i=[],a=[],o=[],function(e){var t,r;e&&(n[0]=a[0]=this.x,n[1]=o[1]=this.y,i[0]=o[0]=this.x+this.width,i[1]=a[1]=this.y+this.height,h(n,n,e),h(i,i,e),h(a,a,e),h(o,o,e),this.x=c(n[0],i[0],a[0],o[0]),this.y=c(n[1],i[1],a[1],o[1]),t=d(n[0],i[0],a[0],o[0]),r=d(n[1],i[1],a[1],o[1]),this.width=t-this.x,this.height=r-this.y)}),calculateTransform:function(e){var t=e.width/this.width,r=e.height/this.height,n=u.create();return u.translate(n,n,[-this.x,-this.y]),u.scale(n,n,[t,r]),u.translate(n,n,[e.x,e.y]),n},intersect:function(e){if(!e)return!1;e instanceof l||(e=l.create(e));var t=this.x,r=this.x+this.width,n=this.y,i=this.y+this.height,a=e.x,o=e.x+e.width,s=e.y,u=e.y+e.height;return!(r<a||o<t||i<s||u<n)},contain:function(e,t){return e>=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<i){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]}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(0<r){var n=+t.slice(r+1);return n<0?-n:0}var i=t.indexOf(".");return i<0?0:t.length-1-i},t.getPixelPrecision=function(e,t){var r=Math.log,n=Math.LN10,i=Math.floor(r(e[1]-e[0])/n),a=Math.round(r(Math.abs(t[1]-t[0]))/n),o=Math.min(Math.max(-i+a,0),20);return isFinite(o)?o:20},t.getPercentWithPrecision=function(e,t,r){if(!e[t])return 0;var n=p.reduce(e,function(e,t){return e+(isNaN(t)?0:t)},0);if(0===n)return 0;for(var i=Math.pow(10,r),a=p.map(e,function(e){return(isNaN(e)?0:e)/n*i*100}),o=100*i,s=p.map(a,function(e){return Math.floor(e)}),u=p.reduce(s,function(e,t){return e+t},0),l=p.map(a,function(e,t){return e-s[t]});u<o;){for(var h=Number.NEGATIVE_INFINITY,c=null,d=0,f=l.length;d<f;++d)l[d]>h&&(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<e&&e<1e-4},t.parseDate=function(e){if(e instanceof Date)return e;if("string"!=typeof e)return null==e?new Date(NaN):new Date(Math.round(e));var t=n.exec(e);if(!t)return new Date(NaN);if(t[8]){var r=+t[4]||0;return"Z"!==t[8].toUpperCase()&&(r-=t[8].slice(0,3)),new Date(Date.UTC(+t[1],(t[2]||1)-1,+t[3]||1,r,+(t[5]||0),+t[6]||0,+t[7]||0))}return new Date(+t[1],(t[2]||1)-1,+t[3]||1,+t[4]||0,+(t[5]||0),+t[6]||0,+t[7]||0)},t.quantity=function(e){return Math.pow(10,a(e))},t.nice=function(e,t){var r=a(e),n=Math.pow(10,r),i=e/n;return e=(t?i<1.5?1:i<2.5?2:i<4?3:i<7?5:10:i<1?1:i<2?2:i<3?3:i<5?5:10)*n,-20<=r?+e.toFixed(r<0?-r:0):e},t.reformIntervals=function(e){e.sort(function(e,t){return function e(t,r,n){return t.interval[n]<r.interval[n]||t.interval[n]===r.interval[n]&&(t.close[n]-r.close[n]==(n?-1:1)||!n&&e(t,r,1))}(e,t,0)?-1:1});for(var t=-1/0,r=1,n=0;n<e.length;){for(var i=e[n].interval,a=e[n].close,o=0;o<2;o++)i[o]<=t&&(i[o]=t,a[o]=o?1:1-r),t=i[o],r=a[o];i[0]===i[1]&&a[0]*a[1]!=1?e.splice(n,1):n++}return e},t.isNumeric=function(e){return 0<=e-parseFloat(e)}},function(e,t,r){"use strict";function i(e){var t,r;s.a.defaultsWithPropList(e,u,l),r=function(e,t){return 0==(e&e-1)&&0==(t&t-1)}((t=e).width,t.height),t.format===o.a.DEPTH_COMPONENT&&(t.useMipmap=!1),r&&t.useMipmap||(t.minFilter==o.a.NEAREST_MIPMAP_NEAREST||t.minFilter==o.a.NEAREST_MIPMAP_LINEAR?t.minFilter=o.a.NEAREST:t.minFilter!=o.a.LINEAR_MIPMAP_LINEAR&&t.minFilter!=o.a.LINEAR_MIPMAP_NEAREST||(t.minFilter=o.a.LINEAR)),r||(t.wrapS=o.a.CLAMP_TO_EDGE,t.wrapT=o.a.CLAMP_TO_EDGE);for(var n="",i=0;i<l.length;i++)n+=e[l[i]].toString();return n}function n(){this._pool={},this._allocatedTextures=[]}var a=r(5),o=r(11),s=r(23);n.prototype={constructor:n,get:function(e){var t=i(e);this._pool.hasOwnProperty(t)||(this._pool[t]=[]);var r=this._pool[t];if(r.length)return r.pop();var n=new a.a(e);return this._allocatedTextures.push(n),n},put:function(e){var t=i(e);this._pool.hasOwnProperty(t)||(this._pool[t]=[]),this._pool[t].push(e)},clear:function(e){for(var t=0;t<this._allocatedTextures.length;t++)this._allocatedTextures[t].dispose(e);this._pool={},this._allocatedTextures=[]}};var u={width:512,height:512,type:o.a.UNSIGNED_BYTE,format:o.a.RGBA,wrapS:o.a.CLAMP_TO_EDGE,wrapT:o.a.CLAMP_TO_EDGE,minFilter:o.a.LINEAR_MIPMAP_LINEAR,magFilter:o.a.LINEAR,useMipmap:!0,anisotropic:1,flipY:!0,unpackAlignment:4,premultiplyAlpha:!1},l=Object.keys(u);t.a=n},function(e,t,r){"use strict";t.a="@export clay.compositor.kernel.gaussian_9\nfloat gaussianKernel[9];\ngaussianKernel[0] = 0.07;\ngaussianKernel[1] = 0.09;\ngaussianKernel[2] = 0.12;\ngaussianKernel[3] = 0.14;\ngaussianKernel[4] = 0.16;\ngaussianKernel[5] = 0.14;\ngaussianKernel[6] = 0.12;\ngaussianKernel[7] = 0.09;\ngaussianKernel[8] = 0.07;\n@end\n@export clay.compositor.kernel.gaussian_13\nfloat gaussianKernel[13];\ngaussianKernel[0] = 0.02;\ngaussianKernel[1] = 0.03;\ngaussianKernel[2] = 0.06;\ngaussianKernel[3] = 0.08;\ngaussianKernel[4] = 0.11;\ngaussianKernel[5] = 0.13;\ngaussianKernel[6] = 0.14;\ngaussianKernel[7] = 0.13;\ngaussianKernel[8] = 0.11;\ngaussianKernel[9] = 0.08;\ngaussianKernel[10] = 0.06;\ngaussianKernel[11] = 0.03;\ngaussianKernel[12] = 0.02;\n@end\n@export clay.compositor.gaussian_blur\n#define SHADER_NAME gaussian_blur\nuniform sampler2D texture;varying vec2 v_Texcoord;\nuniform float blurSize : 2.0;\nuniform vec2 textureSize : [512.0, 512.0];\nuniform float blurDir : 0.0;\n@import clay.util.rgbm\n@import clay.util.clamp_sample\nvoid main (void)\n{\n @import clay.compositor.kernel.gaussian_9\n vec2 off = blurSize / textureSize;\n off *= vec2(1.0 - blurDir, blurDir);\n vec4 sum = vec4(0.0);\n float weightAll = 0.0;\n for (int i = 0; i < 9; i++) {\n float w = gaussianKernel[i];\n vec4 texel = decodeHDR(clampSample(texture, v_Texcoord + float(i - 4) * off));\n sum += texel * w;\n weightAll += w;\n }\n gl_FragColor = encodeHDR(sum / max(weightAll, 0.01));\n}\n@end\n"},function(e,t,r){"use strict";t.a="\n@export clay.compositor.lut\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform sampler2D lookup;\nvoid main()\n{\n vec4 tex = texture2D(texture, v_Texcoord);\n float blueColor = tex.b * 63.0;\n vec2 quad1;\n quad1.y = floor(floor(blueColor) / 8.0);\n quad1.x = floor(blueColor) - (quad1.y * 8.0);\n vec2 quad2;\n quad2.y = floor(ceil(blueColor) / 8.0);\n quad2.x = ceil(blueColor) - (quad2.y * 8.0);\n vec2 texPos1;\n texPos1.x = (quad1.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.r);\n texPos1.y = (quad1.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.g);\n vec2 texPos2;\n texPos2.x = (quad2.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.r);\n texPos2.y = (quad2.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.g);\n vec4 newColor1 = texture2D(lookup, texPos1);\n vec4 newColor2 = texture2D(lookup, texPos2);\n vec4 newColor = mix(newColor1, newColor2, fract(blueColor));\n gl_FragColor = vec4(newColor.rgb, tex.w);\n}\n@end"},function(e,t,r){"use strict";t.a="@export clay.compositor.output\n#define OUTPUT_ALPHA\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\n@import clay.util.rgbm\nvoid main()\n{\n vec4 tex = decodeHDR(texture2D(texture, v_Texcoord));\n gl_FragColor.rgb = tex.rgb;\n#ifdef OUTPUT_ALPHA\n gl_FragColor.a = tex.a;\n#else\n gl_FragColor.a = 1.0;\n#endif\n gl_FragColor = encodeHDR(gl_FragColor);\n#ifdef PREMULTIPLY_ALPHA\n gl_FragColor.rgb *= gl_FragColor.a;\n#endif\n}\n@end"},function(e,t,r){"use strict";t.a="@export clay.compositor.bright\nuniform sampler2D texture;\nuniform float threshold : 1;\nuniform float scale : 1.0;\nuniform vec2 textureSize: [512, 512];\nvarying vec2 v_Texcoord;\nconst vec3 lumWeight = vec3(0.2125, 0.7154, 0.0721);\n@import clay.util.rgbm\nvec4 median(vec4 a, vec4 b, vec4 c)\n{\n return a + b + c - min(min(a, b), c) - max(max(a, b), c);\n}\nvoid main()\n{\n vec4 texel = decodeHDR(texture2D(texture, v_Texcoord));\n#ifdef ANTI_FLICKER\n vec3 d = 1.0 / textureSize.xyx * vec3(1.0, 1.0, 0.0);\n vec4 s1 = decodeHDR(texture2D(texture, v_Texcoord - d.xz));\n vec4 s2 = decodeHDR(texture2D(texture, v_Texcoord + d.xz));\n vec4 s3 = decodeHDR(texture2D(texture, v_Texcoord - d.zy));\n vec4 s4 = decodeHDR(texture2D(texture, v_Texcoord + d.zy));\n texel = median(median(texel, s1, s2), s3, s4);\n#endif\n float lum = dot(texel.rgb , lumWeight);\n vec4 color;\n if (lum > threshold && texel.a > 0.0)\n {\n color = vec4(texel.rgb * scale, texel.a * scale);\n }\n else\n {\n color = vec4(0.0);\n }\n gl_FragColor = encodeHDR(color);\n}\n@end\n"},function(e,t,r){"use strict";t.a="@export clay.compositor.downsample\nuniform sampler2D texture;\nuniform vec2 textureSize : [512, 512];\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\nfloat brightness(vec3 c)\n{\n return max(max(c.r, c.g), c.b);\n}\n@import clay.util.clamp_sample\nvoid main()\n{\n vec4 d = vec4(-1.0, -1.0, 1.0, 1.0) / textureSize.xyxy;\n#ifdef ANTI_FLICKER\n vec3 s1 = decodeHDR(clampSample(texture, v_Texcoord + d.xy)).rgb;\n vec3 s2 = decodeHDR(clampSample(texture, v_Texcoord + d.zy)).rgb;\n vec3 s3 = decodeHDR(clampSample(texture, v_Texcoord + d.xw)).rgb;\n vec3 s4 = decodeHDR(clampSample(texture, v_Texcoord + d.zw)).rgb;\n float s1w = 1.0 / (brightness(s1) + 1.0);\n float s2w = 1.0 / (brightness(s2) + 1.0);\n float s3w = 1.0 / (brightness(s3) + 1.0);\n float s4w = 1.0 / (brightness(s4) + 1.0);\n float oneDivideSum = 1.0 / (s1w + s2w + s3w + s4w);\n vec4 color = vec4(\n (s1 * s1w + s2 * s2w + s3 * s3w + s4 * s4w) * oneDivideSum,\n 1.0\n );\n#else\n vec4 color = decodeHDR(clampSample(texture, v_Texcoord + d.xy));\n color += decodeHDR(clampSample(texture, v_Texcoord + d.zy));\n color += decodeHDR(clampSample(texture, v_Texcoord + d.xw));\n color += decodeHDR(clampSample(texture, v_Texcoord + d.zw));\n color *= 0.25;\n#endif\n gl_FragColor = encodeHDR(color);\n}\n@end"},function(e,t,r){"use strict";t.a="\n@export clay.compositor.upsample\n#define HIGH_QUALITY\nuniform sampler2D texture;\nuniform vec2 textureSize : [512, 512];\nuniform float sampleScale: 0.5;\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\n@import clay.util.clamp_sample\nvoid main()\n{\n#ifdef HIGH_QUALITY\n vec4 d = vec4(1.0, 1.0, -1.0, 0.0) / textureSize.xyxy * sampleScale;\n vec4 s;\n s = decodeHDR(clampSample(texture, v_Texcoord - d.xy));\n s += decodeHDR(clampSample(texture, v_Texcoord - d.wy)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord - d.zy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zw)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord )) * 4.0;\n s += decodeHDR(clampSample(texture, v_Texcoord + d.xw)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.wy)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord + d.xy));\n gl_FragColor = encodeHDR(s / 16.0);\n#else\n vec4 d = vec4(-1.0, -1.0, +1.0, +1.0) / textureSize.xyxy;\n vec4 s;\n s = decodeHDR(clampSample(texture, v_Texcoord + d.xy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.xw));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zw));\n gl_FragColor = encodeHDR(s / 4.0);\n#endif\n}\n@end"},function(e,t,r){"use strict";t.a="@export clay.compositor.hdr.composite\n#define TONEMAPPING\nuniform sampler2D texture;\n#ifdef BLOOM_ENABLED\nuniform sampler2D bloom;\n#endif\n#ifdef LENSFLARE_ENABLED\nuniform sampler2D lensflare;\nuniform sampler2D lensdirt;\n#endif\n#ifdef LUM_ENABLED\nuniform sampler2D lum;\n#endif\n#ifdef LUT_ENABLED\nuniform sampler2D lut;\n#endif\n#ifdef COLOR_CORRECTION\nuniform float brightness : 0.0;\nuniform float contrast : 1.0;\nuniform float saturation : 1.0;\n#endif\n#ifdef VIGNETTE\nuniform float vignetteDarkness: 1.0;\nuniform float vignetteOffset: 1.0;\n#endif\nuniform float exposure : 1.0;\nuniform float bloomIntensity : 0.25;\nuniform float lensflareIntensity : 1;\nvarying vec2 v_Texcoord;\n@import clay.util.srgb\nvec3 ACESToneMapping(vec3 color)\n{\n const float A = 2.51;\n const float B = 0.03;\n const float C = 2.43;\n const float D = 0.59;\n const float E = 0.14;\n return (color * (A * color + B)) / (color * (C * color + D) + E);\n}\nfloat eyeAdaption(float fLum)\n{\n return mix(0.2, fLum, 0.5);\n}\n#ifdef LUT_ENABLED\nvec3 lutTransform(vec3 color) {\n float blueColor = color.b * 63.0;\n vec2 quad1;\n quad1.y = floor(floor(blueColor) / 8.0);\n quad1.x = floor(blueColor) - (quad1.y * 8.0);\n vec2 quad2;\n quad2.y = floor(ceil(blueColor) / 8.0);\n quad2.x = ceil(blueColor) - (quad2.y * 8.0);\n vec2 texPos1;\n texPos1.x = (quad1.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.r);\n texPos1.y = (quad1.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.g);\n vec2 texPos2;\n texPos2.x = (quad2.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.r);\n texPos2.y = (quad2.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.g);\n vec4 newColor1 = texture2D(lut, texPos1);\n vec4 newColor2 = texture2D(lut, texPos2);\n vec4 newColor = mix(newColor1, newColor2, fract(blueColor));\n return newColor.rgb;\n}\n#endif\n@import clay.util.rgbm\nvoid main()\n{\n vec4 texel = vec4(0.0);\n vec4 originalTexel = vec4(0.0);\n#ifdef TEXTURE_ENABLED\n texel = decodeHDR(texture2D(texture, v_Texcoord));\n originalTexel = texel;\n#endif\n#ifdef BLOOM_ENABLED\n vec4 bloomTexel = decodeHDR(texture2D(bloom, v_Texcoord));\n texel.rgb += bloomTexel.rgb * bloomIntensity;\n texel.a += bloomTexel.a * bloomIntensity;\n#endif\n#ifdef LENSFLARE_ENABLED\n texel += decodeHDR(texture2D(lensflare, v_Texcoord)) * texture2D(lensdirt, v_Texcoord) * lensflareIntensity;\n#endif\n texel.a = min(texel.a, 1.0);\n#ifdef LUM_ENABLED\n float fLum = texture2D(lum, vec2(0.5, 0.5)).r;\n float adaptedLumDest = 3.0 / (max(0.1, 1.0 + 10.0*eyeAdaption(fLum)));\n float exposureBias = adaptedLumDest * exposure;\n#else\n float exposureBias = exposure;\n#endif\n#ifdef TONEMAPPING\n texel.rgb *= exposureBias;\n texel.rgb = ACESToneMapping(texel.rgb);\n#endif\n texel = linearTosRGB(texel);\n#ifdef LUT_ENABLED\n texel.rgb = lutTransform(clamp(texel.rgb,vec3(0.0),vec3(1.0)));\n#endif\n#ifdef COLOR_CORRECTION\n texel.rgb = clamp(texel.rgb + vec3(brightness), 0.0, 1.0);\n texel.rgb = clamp((texel.rgb - vec3(0.5))*contrast+vec3(0.5), 0.0, 1.0);\n float lum = dot(texel.rgb, vec3(0.2125, 0.7154, 0.0721));\n texel.rgb = mix(vec3(lum), texel.rgb, saturation);\n#endif\n#ifdef VIGNETTE\n vec2 uv = (v_Texcoord - vec2(0.5)) * vec2(vignetteOffset);\n texel.rgb = mix(texel.rgb, vec3(1.0 - vignetteDarkness), dot(uv, uv));\n#endif\n gl_FragColor = encodeHDR(texel);\n#ifdef DEBUG\n #if DEBUG == 1\n gl_FragColor = encodeHDR(decodeHDR(texture2D(texture, v_Texcoord)));\n #elif DEBUG == 2\n gl_FragColor = encodeHDR(decodeHDR(texture2D(bloom, v_Texcoord)) * bloomIntensity);\n #elif DEBUG == 3\n gl_FragColor = encodeHDR(decodeHDR(texture2D(lensflare, v_Texcoord) * lensflareIntensity));\n #endif\n#endif\n if (originalTexel.a <= 0.01 && gl_FragColor.a > 1e-5) {\n gl_FragColor.a = dot(gl_FragColor.rgb, vec3(0.2125, 0.7154, 0.0721));\n }\n#ifdef PREMULTIPLY_ALPHA\n gl_FragColor.rgb *= gl_FragColor.a;\n#endif\n}\n@end"},function(e,t,r){"use strict";t.a="@export clay.compositor.blend\n#define SHADER_NAME blend\n#ifdef TEXTURE1_ENABLED\nuniform sampler2D texture1;\nuniform float weight1 : 1.0;\n#endif\n#ifdef TEXTURE2_ENABLED\nuniform sampler2D texture2;\nuniform float weight2 : 1.0;\n#endif\n#ifdef TEXTURE3_ENABLED\nuniform sampler2D texture3;\nuniform float weight3 : 1.0;\n#endif\n#ifdef TEXTURE4_ENABLED\nuniform sampler2D texture4;\nuniform float weight4 : 1.0;\n#endif\n#ifdef TEXTURE5_ENABLED\nuniform sampler2D texture5;\nuniform float weight5 : 1.0;\n#endif\n#ifdef TEXTURE6_ENABLED\nuniform sampler2D texture6;\nuniform float weight6 : 1.0;\n#endif\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\nvoid main()\n{\n vec4 tex = vec4(0.0);\n#ifdef TEXTURE1_ENABLED\n tex += decodeHDR(texture2D(texture1, v_Texcoord)) * weight1;\n#endif\n#ifdef TEXTURE2_ENABLED\n tex += decodeHDR(texture2D(texture2, v_Texcoord)) * weight2;\n#endif\n#ifdef TEXTURE3_ENABLED\n tex += decodeHDR(texture2D(texture3, v_Texcoord)) * weight3;\n#endif\n#ifdef TEXTURE4_ENABLED\n tex += decodeHDR(texture2D(texture4, v_Texcoord)) * weight4;\n#endif\n#ifdef TEXTURE5_ENABLED\n tex += decodeHDR(texture2D(texture5, v_Texcoord)) * weight5;\n#endif\n#ifdef TEXTURE6_ENABLED\n tex += decodeHDR(texture2D(texture6, v_Texcoord)) * weight6;\n#endif\n gl_FragColor = encodeHDR(tex);\n}\n@end"},function(e,t,r){"use strict";t.a="@export clay.compositor.fxaa\nuniform sampler2D texture;\nuniform vec4 viewport : VIEWPORT;\nvarying vec2 v_Texcoord;\n#define FXAA_REDUCE_MIN (1.0/128.0)\n#define FXAA_REDUCE_MUL (1.0/8.0)\n#define FXAA_SPAN_MAX 8.0\n@import clay.util.rgbm\nvoid main()\n{\n vec2 resolution = 1.0 / viewport.zw;\n vec3 rgbNW = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( -1.0, -1.0 ) ) * resolution ) ).xyz;\n vec3 rgbNE = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( 1.0, -1.0 ) ) * resolution ) ).xyz;\n vec3 rgbSW = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( -1.0, 1.0 ) ) * resolution ) ).xyz;\n vec3 rgbSE = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( 1.0, 1.0 ) ) * resolution ) ).xyz;\n vec4 rgbaM = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution ) );\n vec3 rgbM = rgbaM.xyz;\n float opacity = rgbaM.w;\n vec3 luma = vec3( 0.299, 0.587, 0.114 );\n float lumaNW = dot( rgbNW, luma );\n float lumaNE = dot( rgbNE, luma );\n float lumaSW = dot( rgbSW, luma );\n float lumaSE = dot( rgbSE, luma );\n float lumaM = dot( rgbM, luma );\n float lumaMin = min( lumaM, min( min( lumaNW, lumaNE ), min( lumaSW, lumaSE ) ) );\n float lumaMax = max( lumaM, max( max( lumaNW, lumaNE) , max( lumaSW, lumaSE ) ) );\n vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n float dirReduce = max( ( lumaNW + lumaNE + lumaSW + lumaSE ) * ( 0.25 * FXAA_REDUCE_MUL ), FXAA_REDUCE_MIN );\n float rcpDirMin = 1.0 / ( min( abs( dir.x ), abs( dir.y ) ) + dirReduce );\n dir = min( vec2( FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max( vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * resolution;\n vec3 rgbA = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * ( 1.0 / 3.0 - 0.5 ) ) ).xyz;\n rgbA += decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * ( 2.0 / 3.0 - 0.5 ) ) ).xyz;\n rgbA *= 0.5;\n vec3 rgbB = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * -0.5 ) ).xyz;\n rgbB += decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * 0.5 ) ).xyz;\n rgbB *= 0.25;\n rgbB += rgbA * 0.5;\n float lumaB = dot( rgbB, luma );\n if ( ( lumaB < lumaMin ) || ( lumaB > lumaMax ) )\n {\n gl_FragColor = vec4( rgbA, opacity );\n }\n else {\n gl_FragColor = vec4( rgbB, opacity );\n }\n}\n@end"},function(e,t,r){"use strict";var n=r(0),u=r.n(n);t.a={getFilledRegions:function(e,t){var r,n=(e||[]).slice();if("string"==typeof t?r=(t=u.a.getMap(t))&&t.geoJson:t&&t.features&&(r=t),!r)return[];for(var i={},a=r.features,o=0;o<n.length;o++)i[n[o].name]=n[o];for(o=0;o<a.length;o++){var s=a[o].properties.name;i[s]||n.push({name:s})}return n},defaultOption:{show:!0,zlevel:-10,map:"",left:0,top:0,width:"100%",height:"100%",boxWidth:100,boxHeight:10,boxDepth:"auto",regionHeight:3,environment:"auto",groundPlane:{show:!1,color:"#aaa"},shading:"lambert",light:{main:{alpha:40,beta:30}},viewControl:{alpha:40,beta:0,distance:100,orthographicSize:60,minAlpha:5,minBeta:-80,maxBeta:80},label:{show:!1,distance:2,textStyle:{fontSize:20,color:"#000",backgroundColor:"rgba(255,255,255,0.7)",padding:3,borderRadius:4}},itemStyle:{color:"#fff",borderWidth:0,borderColor:"#333"},emphasis:{itemStyle:{color:"#639fc0"},label:{show:!0}}}}},function(e,t,r){"use strict";function u(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function c(e,t,r,n,i){var a=r,o=e[t];u(e,t,n);for(var s=r;s<n;s++)i(e[s],o)<0&&(u(e,s,a),a++);return u(e,n,a),a}function d(e,t,r,n){var i;r<n&&(d(e,t,r,(i=c(e,Math.floor((r+n)/2),r,n,t))-1),d(e,t,i+1,n))}function n(){this._parts=[]}n.prototype.step=function(e,t,r){var n,i=e.length;if(0===r&&(this._parts=[],this._sorted=!1,n=Math.floor(i/2),this._parts.push({pivot:n,left:0,right:i-1}),this._currentSortPartIdx=0),!this._sorted){var a=this._parts;if(0===a.length)return this._sorted=!0;if(a.length<512){for(var o=0;o<a.length;o++)a[o].pivot=c(e,a[o].pivot,a[o].left,a[o].right,t);for(var s=[],o=0;o<a.length;o++){var u=a[o].left,l=a[o].pivot-1;u<l&&s.push({pivot:Math.floor((l+u)/2),left:u,right:l}),(u=a[o].pivot+1)<(l=a[o].right)&&s.push({pivot:Math.floor((l+u)/2),left:u,right:l})}a=this._parts=s}else for(o=0;o<Math.floor(a.length/10);o++){var h=a.length-1-this._currentSortPartIdx;if(d(e,t,a[h].left,a[h].right),++this._currentSortPartIdx===a.length)return this._sorted=!0}return!1}},n.sort=d,t.a=n},function(e,t,r){"use strict";function o(e,t){var r=e.getBoxLayoutParams(),n=l.a.getLayoutRect(r,{width:t.getWidth(),height:t.getHeight()});n.y=t.getHeight()-n.y-n.height,this.viewGL.setViewport(n.x,n.y,n.width,n.height,t.getDevicePixelRatio());var i=this.getGeoBoundingRect(),a=i.width/i.height*(e.get("aspectScale")||.75),o=e.get("boxWidth"),s=e.get("boxDepth"),u=e.get("boxHeight");null==u&&(u=5),isNaN(o)&&isNaN(s)&&(o=100),isNaN(s)?s=o/a:isNaN(o)&&(o=s/a),this.setSize(o,u,s),this.regionHeight=e.get("regionHeight"),this.altitudeAxis&&this.altitudeAxis.setExtent(0,Math.max(u-this.regionHeight,0))}function s(e,t){var r,a=[1/0,-1/0];e.eachSeries(function(e){var t,r,n,i;e.coordinateSystem===this&&"series.map3D"!==e.type&&(t=e.getData(),(n=(r=e.coordDimToDataDim("alt"))&&r[0])&&(i=t.getDataExtent(n,!0),a[0]=Math.min(a[0],i[0]),a[1]=Math.max(a[1],i[1])))},this),a&&isFinite(a[1]-a[0])&&(r=u.a.helper.createScale(a,{type:"value",min:"dataMin",max:"dataMax"}),this.altitudeAxis=new u.a.Axis("altitude",r),this.resize(this.model,t))}var n=r(99),i=r(0),u=r.n(i),a=r(47),l=r.n(a),h=r(22),c=r(2),d=0,f={dimensions:n.a.prototype.dimensions,create:function(r,n){function i(e){var t=f.createGeo3D(e);e.__viewGL=e.__viewGL||new h.a,t.viewGL=e.__viewGL,(e.coordinateSystem=t).model=e,a.push(t),t.resize=o,t.resize(e,n),t.update=s}var a=[];if(!u.a.getMap)throw new Error("geo3D component depends on geo component");return r.eachComponent("geo3D",function(e,t){i(e)}),r.eachSeriesByType("map3D",function(e,t){var r=e.get("coordinateSystem");null==r&&(r="geo3D"),"geo3D"===r&&i(e)}),r.eachSeries(function(e){if("geo3D"===e.get("coordinateSystem")){if("series.map3D"===e.type)return;var t=e.getReferringComponents("geo3D")[0];if(!(t=t||r.getComponent("geo3D")))throw new Error('geo "'+c.a.firstNotNull(e.get("geo3DIndex"),e.get("geo3DId"),0)+'" not found');e.coordinateSystem=t.coordinateSystem}}),a},createGeo3D:function(e){var t,r=e.get("map");return"string"==typeof r?(t=r,r=u.a.getMap(r)):r&&r.features&&(r={geoJson:r}),null==t&&(t="GEO_ANONYMOUS_"+d++),new n.a(t+d++,t,r&&r.geoJson,r&&r.specialAreas,e.get("nameMap"))}};u.a.registerCoordinateSystem("geo3D",f),t.a=f},function(e,t,r){"use strict";function n(e,t,r,n,i){this.name=e,this.map=t,this.regionHeight=0,this.regions=[],this._nameCoordMap={},this.loadGeoJson(r,n,i),this.transform=d.identity(new Float64Array(16)),this.invTransform=d.identity(new Float64Array(16)),this.extrudeY=!0,this.altitudeAxis}var i=r(0),l=r.n(i),a=r(6),o=r(205),s=r.n(o),u=r(206),h=r.n(u),c=a.a.vec3,d=a.a.mat4,f=[s.a,h.a];n.prototype={constructor:n,type:"geo3D",dimensions:["lng","lat","alt"],containPoint:function(){},loadGeoJson:function(e,t,r){var n=l.a.parseGeoJSON||l.a.parseGeoJson;try{this.regions=e?n(e):[]}catch(e){throw"Invalid geoJson format\n"+e}t=t||{},r=r||{};for(var i=this.regions,a={},o=0;o<i.length;o++){var s=r[s=i[o].name]||s;a[i[o].name=s]=i[o],this.addGeoCoord(s,i[o].center);var u=t[s];u&&i[o].transformTo(u.left,u.top,u.width,u.height)}this._regionsMap=a,this._geoRect=null,f.forEach(function(e){e(this)},this)},getGeoBoundingRect:function(){if(this._geoRect)return this._geoRect;for(var e=this.regions,t=0;t<e.length;t++){var r,n=e[t].getBoundingRect();(r=r||n.clone()).union(n)}return this._geoRect=r||new l.a.graphic.BoundingRect(0,0,0,0)},addGeoCoord:function(e,t){this._nameCoordMap[e]=t},getRegion:function(e){return this._regionsMap[e]},getRegionByCoord:function(e){for(var t=this.regions,r=0;r<t.length;r++)if(t[r].contain(e))return t[r]},setSize:function(e,t,r){this.size=[e,t,r];var n=this.getGeoBoundingRect(),i=e/n.width,a=-r/n.height,o=-e/2-n.x*i,s=r/2-n.y*a,u=this.extrudeY?[o,0,s]:[o,s,0],l=this.extrudeY?[i,1,a]:[i,a,1],h=this.transform;d.identity(h),d.translate(h,h,u),d.scale(h,h,l),d.invert(this.invTransform,h)},dataToPoint:function(e,t){t=t||[];var r=this.extrudeY?1:2,n=this.extrudeY?2:1,i=e[2];return isNaN(i)&&(i=0),t[0]=e[0],t[n]=e[1],this.altitudeAxis?t[r]=this.altitudeAxis.dataToCoord(i):t[r]=0,t[r]+=this.regionHeight,c.transformMat4(t,t,this.transform),t},pointToData:function(){}},t.a=n},function(e,t,r){"use strict";function n(){this.width=0,this.height=0,this.altitudeScale=1,this.boxHeight="auto",this.altitudeExtent,this.bearing=0,this.pitch=0,this.center=[0,0],this._origin,this.zoom=0,this._initialZoom,this.maxPitch=60,this.zoomOffset=0}var c=r(6).a.mat4,d=.6435011087932844,s=Math.PI;n.prototype={constructor:n,dimensions:["lng","lat","alt"],containPoint:function(){},setCameraOption:function(e){this.bearing=e.bearing,this.pitch=e.pitch,this.center=e.center,this.zoom=e.zoom,this._origin||(this._origin=this.projectOnTileWithScale(this.center,512)),null==this._initialZoom&&(this._initialZoom=this.zoom),this.updateTransform()},updateTransform:function(){var e,t,r,n,i,a,o,s,u,l,h;this.height&&(e=.5/Math.tan(d/2)*this.height*.1,t=Math.max(Math.min(this.pitch,this.maxPitch),0)/180*Math.PI,r=Math.PI/2+t,n=Math.sin(.3217505543966422)*e/Math.sin(Math.PI-r-.3217505543966422),i=1.1*(Math.cos(Math.PI/2-t)*n+e),50<this.pitch&&(i=1e3),a=[],c.perspective(a,d,this.width/this.height,1,i),this.viewGL.camera.projectionMatrix.setArray(a),this.viewGL.camera.decomposeProjectionMatrix(),a=c.identity([]),o=this.dataToPoint(this.center),c.scale(a,a,[1,-1,1]),c.translate(a,a,[0,0,-e]),c.rotateX(a,a,t),c.rotateZ(a,a,-this.bearing/180*Math.PI),c.translate(a,a,[-o[0]*this.getScale()*.1,-o[1]*this.getScale()*.1,0]),this.viewGL.camera.viewMatrix.array=a,s=[],c.invert(s,a),this.viewGL.camera.worldTransform.array=s,this.viewGL.camera.decomposeWorldTransform(),u=512*this.getScale(),h=this.altitudeExtent&&!isNaN(this.boxHeight)?(l=this.altitudeExtent[1]-this.altitudeExtent[0],this.boxHeight/l*this.getScale()/Math.pow(2,this._initialZoom-this.zoomOffset)):u/(2*Math.PI*6378e3*Math.abs(Math.cos(this.center[1]*(Math.PI/180))))*this.altitudeScale*.1,this.viewGL.rootNode.scale.set(.1*this.getScale(),.1*this.getScale(),h))},getScale:function(){return Math.pow(2,this.zoom-this.zoomOffset)},projectOnTile:function(e,t){return this.projectOnTileWithScale(e,512*this.getScale(),t)},projectOnTileWithScale:function(e,t,r){var n=e[0],i=e[1]*s/180,a=t*(n*s/180+s)/(2*s),o=t*(s-Math.log(Math.tan(s/4+.5*i)))/(2*s);return(r=r||[])[0]=a,r[1]=o,r},unprojectFromTile:function(e,t){return this.unprojectOnTileWithScale(e,512*this.getScale(),t)},unprojectOnTileWithScale:function(e,t,r){var n=e[0],i=e[1],a=n/t*(2*s)-s,o=2*(Math.atan(Math.exp(s-i/t*(2*s)))-s/4);return(r=r||[])[0]=180*a/s,r[1]=180*o/s,r},dataToPoint:function(e,t){return(t=this.projectOnTileWithScale(e,512,t))[0]-=this._origin[0],t[1]-=this._origin[1],t[2]=isNaN(e[2])?0:e[2],isNaN(e[2])||(t[2]=e[2],this.altitudeExtent&&(t[2]-=this.altitudeExtent[0])),t}},t.a=n},function(e,t,r){"use strict";var l=r(2),h=r(1),c=r(22);t.a=function(a,o,e){function s(e,t){var r=t.getWidth(),n=t.getHeight(),i=t.getDevicePixelRatio();this.viewGL.setViewport(0,0,r,n,i),this.width=r,this.height=n,this.altitudeScale=e.get("altitudeScale"),this.boxHeight=e.get("boxHeight")}function u(e,t){var i;"auto"!==this.model.get("boxHeight")&&(i=[1/0,-1/0],e.eachSeries(function(e){var t,r,n;e.coordinateSystem===this&&(t=e.getData(),(r=e.coordDimToDataDim("alt")[0])&&(n=t.getDataExtent(r,!0),i[0]=Math.min(i[0],n[0]),i[1]=Math.max(i[1],n[1])))},this),i&&isFinite(i[1]-i[0])&&(this.altitudeExtent=i))}return{dimensions:o.prototype.dimensions,create:function(r,n){var i=[];return r.eachComponent(a,function(e){var t=e.__viewGL;t||(t=e.__viewGL=new c.a).setRootNode(new h.a.Node);var r=new o;r.viewGL=e.__viewGL,r.resize=s,r.resize(e,n),i.push(r),(e.coordinateSystem=r).model=e,r.update=u}),r.eachSeries(function(e){if(e.get("coordinateSystem")===a){var t=e.getReferringComponents(a)[0];if(!(t=t||r.getComponent(a)))throw new Error(a+' "'+l.a.firstNotNull(e.get(a+"Index"),e.get(a+"Id"),0)+'" not found');e.coordinateSystem=t.coordinateSystem}}),e&&e(i,r,n),i}}}},function(e,t,r){"use strict";t.a="\n@export ecgl.displayShadow.vertex\n\n@import ecgl.common.transformUniforms\n\n@import ecgl.common.uv.header\n\n@import ecgl.common.attributes\n\nvarying vec3 v_WorldPosition;\n\nvarying vec3 v_Normal;\n\nvoid main()\n{\n @import ecgl.common.uv.main\n v_Normal = normalize((worldInverseTranspose * vec4(normal, 0.0)).xyz);\n\n v_WorldPosition = (world * vec4(position, 1.0)).xyz;\n gl_Position = worldViewProjection * vec4(position, 1.0);\n}\n\n@end\n\n\n@export ecgl.displayShadow.fragment\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform float roughness: 0.2;\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n@import clay.header.directional_light\n#endif\n\n@import ecgl.common.ssaoMap.header\n\n@import clay.plugin.compute_shadow_map\n\nvoid main()\n{\n float shadow = 1.0;\n\n @import ecgl.common.ssaoMap.main\n\n#if defined(DIRECTIONAL_LIGHT_COUNT) && defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];\n if(shadowEnabled)\n {\n computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);\n }\n for (int i = 0; i < DIRECTIONAL_LIGHT_COUNT; i++) {\n shadow = min(shadow, shadowContribsDir[i] * 0.5 + 0.5);\n }\n#endif\n\n shadow *= 0.5 + ao * 0.5;\n shadow = clamp(shadow, 0.0, 1.0);\n\n gl_FragColor = vec4(vec3(0.0), 1.0 - shadow);\n}\n\n@end"},function(e,t,r){"use strict";function n(e){this.viewGL=e}var i=r(84),a=r.n(i),o=r(83),s=r.n(o);n.prototype.reset=function(e,t){this._updateCamera(t.getWidth(),t.getHeight(),t.getDevicePixelRatio()),this._viewTransform=a.a.create(),this.updateTransform(e,t)},n.prototype.updateTransform=function(e,t){var r=e.coordinateSystem;r.getRoamTransform&&(a.a.invert(this._viewTransform,r.getRoamTransform()),this._setCameraTransform(this._viewTransform),t.getZr().refresh())},n.prototype.dataToPoint=function(e,t,r){r=e.dataToPoint(t,null,r);var n=this._viewTransform;n&&s.a.applyTransform(r,r,n)},n.prototype.removeTransformInPoint=function(e){return this._viewTransform&&s.a.applyTransform(e,e,this._viewTransform),e},n.prototype.getZoom=function(){if(this._viewTransform){var e=this._viewTransform;return 1/Math.max(Math.sqrt(e[0]*e[0]+e[1]*e[1]),Math.sqrt(e[2]*e[2]+e[3]*e[3]))}return 1},n.prototype._setCameraTransform=function(e){var t=this.viewGL.camera;t.position.set(e[4],e[5],0),t.scale.set(Math.sqrt(e[0]*e[0]+e[1]*e[1]),Math.sqrt(e[2]*e[2]+e[3]*e[3]),1)},n.prototype._updateCamera=function(e,t,r){this.viewGL.setViewport(0,0,e,t,r);var n=this.viewGL.camera;n.left=n.top=0,n.bottom=t,n.right=e,n.near=0,n.far=100},t.a=n},function(e,r,t){(function(e){var t;"undefined"!=typeof window?t=window.__DEV__:void 0!==e&&(t=e.__DEV__),void 0===t&&(t=!0);r.__DEV__=t}).call(r,t(68))},function(e,t,r){"use strict";var x,T,b,w,E,S,A,n=r(15),i=r(0),a=r.n(i),o=r(38),M=r(6).a.vec2,s=[[0,0],[1,1]],u=n.a.extend(function(){return{segmentScale:4,dynamic:!0,useNativeLine:!0,attributes:{position:new n.a.Attribute("position","float",2,"POSITION"),normal:new n.a.Attribute("normal","float",2),offset:new n.a.Attribute("offset","float",1),color:new n.a.Attribute("color","float",4,"COLOR")}}},{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0,this._itemVertexOffsets=[]},setVertexCount:function(e){var t=this.attributes;this.vertexCount!==e&&(t.position.init(e),t.color.init(e),this.useNativeLine||(t.offset.init(e),t.normal.init(e)),65535<e?this.indices instanceof Uint16Array&&(this.indices=new Uint32Array(this.indices)):this.indices instanceof Uint32Array&&(this.indices=new Uint16Array(this.indices)))},setTriangleCount:function(e){this.triangleCount!==e&&(this.indices=0===e?null:new(65535<this.vertexCount?Uint32Array:Uint16Array)(3*e))},_getCubicCurveApproxStep:function(e,t,r,n){return 1/(M.dist(e,t)+M.dist(r,t)+M.dist(n,r)+1)*this.segmentScale},getCubicCurveVertexCount:function(e,t,r,n){var i=this._getCubicCurveApproxStep(e,t,r,n),a=Math.ceil(1/i);return this.useNativeLine?2*a:2*a+2},getCubicCurveTriangleCount:function(e,t,r,n){var i=this._getCubicCurveApproxStep(e,t,r,n),a=Math.ceil(1/i);return this.useNativeLine?0:2*a},getLineVertexCount:function(){return this.getPolylineVertexCount(s)},getLineTriangleCount:function(){return this.getPolylineTriangleCount(s)},getPolylineVertexCount:function(e){var t="number"==typeof e?e:"number"!=typeof e[0]?e.length:e.length/2;return this.useNativeLine?2*(t-1):2*(t-1)+2},getPolylineTriangleCount:function(e){var t="number"==typeof e?e:"number"!=typeof e[0]?e.length:e.length/2;return this.useNativeLine?0:2*(t-1)},addCubicCurve:function(e,t,r,n,i,a){null==a&&(a=1);for(var o=e[0],s=e[1],u=t[0],l=t[1],h=r[0],c=r[1],d=n[0],f=n[1],p=this._getCubicCurveApproxStep(e,t,r,n),m=p*p,g=m*p,_=3*p,v=3*m,y=6*m,x=6*g,T=o-2*u+h,b=s-2*l+c,w=3*(u-h)-o+d,E=3*(l-c)-s+f,S=o,A=s,M=(u-o)*_+T*v+w*g,C=(l-s)*_+b*v+E*g,L=T*y+w*x,D=b*y+E*x,N=w*x,R=E*x,P=0,I=0,O=Math.ceil(1/p),F=new Float32Array(3*(O+1)),F=[],B=0,I=0;I<O+1;I++)F[B++]=S,F[B++]=A,S+=M,A+=C,M+=L,C+=D,L+=N,D+=R,1<(P+=p)&&(S=0<M?Math.min(S,d):Math.max(S,d),A=0<C?Math.min(A,f):Math.max(A,f));this.addPolyline(F,i,a)},addLine:function(e,t,r,n){this.addPolyline([e,t],r,n)},addPolyline:(x=M.create(),T=M.create(),b=M.create(),w=M.create(),E=[],S=[],A=[],function(e,t,r,n,i){if(e.length){var a="number"!=typeof e[0];if(null==i&&(i=a?e.length:e.length/2),!(i<2)){null==n&&(n=0),null==r&&(r=1),this._itemVertexOffsets.push(this._vertexOffset);for(var o,s,u,l,h,c,d=a?"number"!=typeof t[0]:t.length/4===i,f=this.attributes.position,p=this.attributes.color,m=this.attributes.offset,g=this.attributes.normal,_=this.indices,v=this._vertexOffset,y=0;y<i;y++){a?(E=e[y+n],s=d?t[y+n]:t):((E=E||[])[0]=e[u=2*y+n],E[1]=e[u+1],d?((s=s||[])[0]=t[o=4*y+n],s[1]=t[o+1],s[2]=t[o+2],s[3]=t[o+3]):s=t),this.useNativeLine?1<y&&(f.copy(v,v-1),p.copy(v,v-1),v++):(h=y<i-1?(a?M.copy(S,e[y+1]):((S=S||[])[0]=e[u=2*(y+1)+n],S[1]=e[u+1]),0<y?(M.sub(x,E,A),M.sub(T,S,E),M.normalize(x,x),M.normalize(T,T),M.add(w,x,T),M.normalize(w,w),l=r/2*Math.min(1/M.dot(x,w),2),b[0]=-w[1],b[1]=w[0],l):(M.sub(x,S,E),M.normalize(x,x),b[0]=-x[1],b[1]=x[0],r/2)):(M.sub(x,E,A),M.normalize(x,x),b[0]=-x[1],b[1]=x[0],r/2),g.set(v,b),g.set(v+1,b),m.set(v,h),m.set(v+1,-h),M.copy(A,E),f.set(v,E),f.set(v+1,E),p.set(v,s),p.set(v+1,s),v+=2),this.useNativeLine?(p.set(v,s),f.set(v,E),v++):0<y&&(c=3*this._faceOffset,(_=this.indices)[c]=v-4,_[1+c]=v-3,_[2+c]=v-2,_[3+c]=v-3,_[4+c]=v-1,_[5+c]=v-2,this._faceOffset+=2)}this._vertexOffset=v}}}),setItemColor:function(e,t){for(var r=this._itemVertexOffsets[e],n=e<this._itemVertexOffsets.length-1?this._itemVertexOffsets[e+1]:this._vertexOffset,i=r;i<n;i++)this.attributes.color.set(i,t);this.dirty("color")}});a.a.util.defaults(u.prototype,o.a),t.a=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(107),r(154),r(201),r(207),r(213),r(219),r(225),r(232),r(236),r(243),r(249),r(252),r(256),r(259),r(262),r(275),r(281)},function(e,t,r){"use strict";function n(e,t){+e.replace(".","")<+l[t].replace(".","")&&function(e){throw new Error(e+" version is too old, needs "+l[e]+" or higher")}(t),console.log("Loaded "+t+", version "+e)}function i(e){this._layers={},this._zr=e}var a=r(0),c=r.n(a),o=r(108),d=r(109),s=r(153),u=r(1),l={echarts:"4.1.0",claygl:"1.2.1"};n(o.a,"claygl"),n(c.a.version,"echarts"),i.prototype.update=function(o,s){function u(e){var t;e.coordinateSystem&&e.coordinateSystem.model,t=e.get("zlevel");var r,n=a._layers,i=n[t];return i||(i=n[t]=new d.a("gl-"+t,h),h.painter.isSingleCanvas()&&(i.virtual=!0,r=new c.a.graphic.Image({z:1e4,style:{image:i.renderer.canvas},silent:!0}),i.__hostImage=r,h.add(r)),h.painter.insertLayer(t,i)),i.__hostImage&&i.__hostImage.setStyle({width:i.renderer.getWidth(),height:i.renderer.getHeight()}),i}function l(e,t){e&&e.traverse(function(e){e.isRenderable&&e.isRenderable()&&(e.ignorePicking=null!=e.$ignorePicking?e.$ignorePicking:t)})}var a=this,h=s.getZr();if(h.getWidth()&&h.getHeight()){for(var e in this._layers)this._layers[e].removeViewsAll();o.eachComponent(function(e,t){if("series"!==e){var r=s.getViewOfComponentModel(t),n=t.coordinateSystem;if(r.__ecgl__){if(n){if(!n.viewGL)return void console.error("Can't find viewGL in coordinateSystem of component "+t.id);i=n.viewGL}else{if(!t.viewGL)return void console.error("Can't find viewGL of component "+t.id);i=n.viewGL}var i=n.viewGL,a=u(t);a.addView(i),r.afterRender&&r.afterRender(t,o,s,a),l(r.groupGL,t.get("silent"))}}}),o.eachSeries(function(e){var t=s.getViewOfSeriesModel(e),r=e.coordinateSystem;if(t.__ecgl__){if(r&&!r.viewGL&&!t.viewGL)return void console.error("Can't find viewGL of series "+t.id);var n=r&&r.viewGL||t.viewGL,i=u(e);i.addView(n),t.afterRender&&t.afterRender(e,o,s,i),l(t.groupGL,e.get("silent"))}})}else console.warn("Dom has no width or height")};var h=c.a.init;c.a.init=function(){var e=h.apply(this,arguments);return e.getZr().painter.getRenderedCanvas=function(e){function t(e,t){var r=u._zlevelList;null==e&&(e=-1/0);for(var n,i=0;i<r.length;i++){var a=r[i],o=u._layers[a];if(!o.__builtin__&&e<a&&a<t){n=o;break}}n&&n.renderToCanvas&&(s.save(),n.renderToCanvas(s),s.restore())}if(e=e||{},this._singleCanvas)return this._layers[0].dom;var r=document.createElement("canvas"),n=e.pixelRatio||this.dpr;r.width=this.getWidth()*n,r.height=this.getHeight()*n;var s=r.getContext("2d");s.dpr=n,s.clearRect(0,0,r.width,r.height),e.backgroundColor&&(s.fillStyle=e.backgroundColor,s.fillRect(0,0,r.width,r.height));for(var i,a=this.storage.getDisplayList(!0),o={},u=this,l={ctx:s},h=0;h<a.length;h++){var c=a[h];c.zlevel!==i&&(t(i,c.zlevel),i=c.zlevel),this._doPaintEl(c,l,!0,o)}return t(i,1/0),r},e},c.a.registerPostUpdate(function(e,t){var r=t.getZr();(r.__egl=r.__egl||new i(r)).update(e,t)}),c.a.registerPreprocessor(s.a),c.a.graphicGL=u.a},function(e,t,r){"use strict";t.a="1.2.1"},function(e,t,r){"use strict";function n(e){var t=e.__zr;e.__zr=null,t&&e.removeAnimatorsFromZr&&e.removeAnimatorsFromZr(t)}function i(e){for(var t=0;t<e.length;t++)e[t].__used__=0}function a(e,t){for(var r=0;r<t.length;r++)t[r].__used__||t[r].dispose(e)}function d(e,t){e.__used__=e.__used__||0,1==++e.__used__&&t.push(e)}function o(e,t){this.id=e,this.zr=t;try{this.renderer=new l.a({clearBit:0,devicePixelRatio:t.painter.dpr,preserveDrawingBuffer:!0,premultipliedAlpha:!0}),this.renderer.resize(t.painter.getWidth(),t.painter.getHeight())}catch(e){return this.renderer=null,this.dom=document.createElement("div"),this.dom.style.cssText="position:absolute; left: 0; top: 0; right: 0; bottom: 0;",this.dom.className="ecgl-nowebgl",this.dom.innerHTML="Sorry, your browser does not support WebGL",void console.error(e)}this.onglobalout=this.onglobalout.bind(this),t.on("globalout",this.onglobalout),this.dom=this.renderer.canvas;var r=this.dom.style;r.position="absolute",r.left="0",r.top="0",this.views=[],this._picking=new h.a({renderer:this.renderer}),this._viewsToDispose=[],this._accumulatingId=0,this._zrEventProxy=new u.a.graphic.Rect({shape:{x:-1,y:-1,width:2,height:2},__isGLToZRProxy:!0}),this._backgroundColor=null}var s=r(0),u=r.n(s),l=r(52),h=r(117),f=r(4),c=r(1),p=r(53),m=r(80),g=r.n(m);o.prototype.addView=function(e){var t,r;e.layer!==this&&(0<=(t=this._viewsToDispose.indexOf(e))&&this._viewsToDispose.splice(t,1),this.views.push(e),r=(e.layer=this).zr,e.scene.traverse(function(e){e.__zr=r,e.addAnimatorsToZr&&e.addAnimatorsToZr(r)}))},o.prototype.removeView=function(e){var t;e.layer!==this||0<=(t=this.views.indexOf(e))&&(this.views.splice(t,1),e.scene.traverse(n,this),e.layer=null,this._viewsToDispose.push(e))},o.prototype.removeViewsAll=function(){this.views.forEach(function(e){e.scene.traverse(n,this),e.layer=null,this._viewsToDispose.push(e)},this),this.views.length=0},o.prototype.resize=function(e,t){this.renderer.resize(e,t)},o.prototype.clear=function(){var e=this.renderer.gl,t=this._backgroundColor||[0,0,0,0];e.clearColor(t[0],t[1],t[2],t[3]),e.depthMask(!0),e.colorMask(!0,!0,!0,!0),e.clear(e.DEPTH_BUFFER_BIT|e.COLOR_BUFFER_BIT)},o.prototype.clearDepth=function(){var e=this.renderer.gl;e.clear(e.DEPTH_BUFFER_BIT)},o.prototype.clearColor=function(){var e=this.renderer.gl;e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT)},o.prototype.needsRefresh=function(){this.zr.refresh()},o.prototype.refresh=function(e){this._backgroundColor=e?c.a.parseColor(e):[0,0,0,0],this.renderer.clearColor=this._backgroundColor;for(var t=0;t<this.views.length;t++)this.views[t].prepareRender(this.renderer);this._doRender(!1),this._trackAndClean();for(t=0;t<this._viewsToDispose.length;t++)this._viewsToDispose[t].dispose(this.renderer);this._viewsToDispose.length=0,this._startAccumulating()},o.prototype.renderToCanvas=function(e){this._startAccumulating(!0),e.drawImage(this.dom,0,0,e.canvas.width,e.canvas.height)},o.prototype._doRender=function(e){this.clear(),this.renderer.saveViewport();for(var t=0;t<this.views.length;t++)this.views[t].render(this.renderer,e);this.renderer.restoreViewport()},o.prototype._stopAccumulating=function(){this._accumulatingId=0,clearTimeout(this._accumulatingTimeout)};var _=1;o.prototype._startAccumulating=function(n){function i(e){if(a._accumulatingId&&e===a._accumulatingId){for(var t=!0,r=0;r<a.views.length;r++)t=a.views[r].isAccumulateFinished()&&o;t||(a._doRender(!0),n?i(e):g()(function(){i(e)}))}}var a=this;this._stopAccumulating();for(var o=!1,e=0;e<this.views.length;e++)o=this.views[e].needsAccumulate()||o;o&&(this._accumulatingId=_++,n?i(a._accumulatingId):this._accumulatingTimeout=setTimeout(function(){i(a._accumulatingId)},50))},o.prototype._trackAndClean=function(){var e=[],t=[];this._textureList&&(i(this._textureList),i(this._geometriesList));for(var r=0;r<this.views.length;r++)!function(e,u,l){var h,c;e.traverse(function(e){if(e.isRenderable()){var t=e.geometry,r=e.material;if(r!==h)for(var n=r.getTextureUniforms(),i=0;i<n.length;i++){var a=n[i],o=r.uniforms[a].value;if(o)if(o instanceof f.a)d(o,u);else if(o instanceof Array)for(var s=0;s<o.length;s++)o[s]instanceof f.a&&d(o[s],u)}t!==c&&d(t,l),h=r,c=t}});for(var t=0;t<e.lights.length;t++)e.lights[t].cubemap&&d(e.lights[t].cubemap,u)}(this.views[r].scene,e,t);this._textureList&&(a(this.renderer,this._textureList),a(this.renderer,this._geometriesList)),this._textureList=e,this._geometriesList=t},o.prototype.dispose=function(){this._stopAccumulating(),this.renderer.disposeScene(this.scene),this.zr.off("globalout",this.onglobalout)},o.prototype.onmousedown=function(e){var t;e.target&&e.target.__isGLToZRProxy||(e=e.event,(t=this.pickObject(e.offsetX,e.offsetY))&&(this._dispatchEvent("mousedown",e,t),this._dispatchDataEvent("mousedown",e,t)),this._downX=e.offsetX,this._downY=e.offsetY)},o.prototype.onmousemove=function(e){var t,r,n;e.target&&e.target.__isGLToZRProxy||(e=e.event,r=(t=this.pickObject(e.offsetX,e.offsetY))&&t.target,n=this._hovered,this._hovered=t,n&&r!==n.target&&(n.relatedTarget=r,this._dispatchEvent("mouseout",e,n),this.zr.setCursorStyle("default")),this._dispatchEvent("mousemove",e,t),t&&(this.zr.setCursorStyle("pointer"),n&&r===n.target||this._dispatchEvent("mouseover",e,t)),this._dispatchDataEvent("mousemove",e,t))},o.prototype.onmouseup=function(e){var t;e.target&&e.target.__isGLToZRProxy||(e=e.event,(t=this.pickObject(e.offsetX,e.offsetY))&&(this._dispatchEvent("mouseup",e,t),this._dispatchDataEvent("mouseup",e,t)),this._upX=e.offsetX,this._upY=e.offsetY)},o.prototype.onclick=o.prototype.dblclick=function(e){var t,r,n,i;e.target&&e.target.__isGLToZRProxy||(t=this._upX-this._downX,r=this._upY-this._downY,20<Math.sqrt(t*t+r*r)||(e=e.event,(n=this.pickObject(e.offsetX,e.offsetY))&&(this._dispatchEvent(e.type,e,n),this._dispatchDataEvent(e.type,e,n)),(i=this._clickToSetFocusPoint(e))&&i.view.setDOFFocusOnPoint(i.distance)&&this.zr.refresh()))},o.prototype._clickToSetFocusPoint=function(e){for(var t=this.renderer,r=t.viewport,n=this.views.length-1;0<=n;n--){var i=this.views[n];if(i.hasDOF()&&i.containPoint(e.offsetX,e.offsetY)){this._picking.scene=i.scene,this._picking.camera=i.camera,t.viewport=i.viewport;var a=this._picking.pick(e.offsetX,e.offsetY,!0);if(a)return a.view=i,a}}t.viewport=r},o.prototype.onglobalout=function(e){var t=this._hovered;t&&this._dispatchEvent("mouseout",e,{target:t.target})},o.prototype.pickObject=function(e,t){for(var r=[],n=this.renderer,i=n.viewport,a=0;a<this.views.length;a++){var o=this.views[a];o.containPoint(e,t)&&(this._picking.scene=o.scene,this._picking.camera=o.camera,n.viewport=o.viewport,this._picking.pickAll(e,t,r))}return n.viewport=i,r.sort(function(e,t){return e.distance-t.distance}),r[0]},o.prototype._dispatchEvent=function(e,t,r){var n=(r=r||{}).target;for(r.cancelBubble=!1,r.event=t,r.type=e,r.offsetX=t.offsetX,r.offsetY=t.offsetY;n&&(n.trigger(e,r),n=n.getParent(),!r.cancelBubble););this._dispatchToView(e,r)},o.prototype._dispatchDataEvent=function(e,t,r){var n=r&&r.target,i=n&&n.dataIndex,a=n&&n.seriesIndex,o=n&&n.eventData,s=!1,u=this._zrEventProxy;u.position=[t.offsetX,t.offsetY],u.update();var l={target:u};"mousemove"===e&&(null!=i?i!==this._lastDataIndex&&(0<=parseInt(this._lastDataIndex,10)&&(u.dataIndex=this._lastDataIndex,u.seriesIndex=this._lastSeriesIndex,this.zr.handler.dispatchToElement(l,"mouseout",t)),s=!0):null!=o&&o!==this._lastEventData&&(null!=this._lastEventData&&(u.eventData=this._lastEventData,this.zr.handler.dispatchToElement(l,"mouseout",t)),s=!0),this._lastEventData=o,this._lastDataIndex=i,this._lastSeriesIndex=a),u.eventData=o,u.dataIndex=i,u.seriesIndex=a,(null!=o||0<=parseInt(i,10)&&0<=parseInt(a,10))&&(this.zr.handler.dispatchToElement(l,e,t),s&&this.zr.handler.dispatchToElement(l,"mouseover",t))},o.prototype._dispatchToView=function(e,t){for(var r=0;r<this.views.length;r++)this.views[r].containPoint(t.offsetX,t.offsetY)&&this.views[r].trigger(e,t)},u.a.util.extend(o.prototype,p.a),t.a=o},function(e,t,r){"use strict";function n(n,e,t){"object"==_typeof(e)&&(t=e,e=null);var i,a=this;if(!(n instanceof Function))for(var r in i=[],n)n.hasOwnProperty(r)&&i.push(r);function o(e){if(a.apply(this,arguments),n instanceof Function?u(this,n.call(this,e)):function(e,t,r){for(var n=0;n<r.length;n++){var i=r[n];e[i]=t[i]}}(this,n,i),this.constructor===o)for(var t=o.__initializers__,r=0;r<t.length;r++)t[r].apply(this,arguments)}(o.__super__=a).__initializers__?o.__initializers__=a.__initializers__.slice():o.__initializers__=[],e&&o.__initializers__.push(e);function s(){}return s.prototype=a.prototype,u(((o.prototype=new s).constructor=o).prototype,t),o.extend=a.extend,o.derive=a.extend,o}function u(e,t){if(t)for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])}t.a={extend:n,derive:n}},function(e,t,r){"use strict";var o=["OES_texture_float","OES_texture_half_float","OES_texture_float_linear","OES_texture_half_float_linear","OES_standard_derivatives","OES_vertex_array_object","OES_element_index_uint","WEBGL_compressed_texture_s3tc","WEBGL_depth_texture","EXT_texture_filter_anisotropic","EXT_shader_texture_lod","WEBGL_draw_buffers","EXT_frag_depth","EXT_sRGB"],s=["MAX_TEXTURE_SIZE","MAX_CUBE_MAP_TEXTURE_SIZE"];t.a=function(r){function t(e){var t=r.getExtension(e);t=(t=t||r.getExtension("MOZ_"+e))||r.getExtension("WEBKIT_"+e),n[e]=t}for(var n={},i={},e=0;e<o.length;e++)t(o[e]);for(e=0;e<s.length;e++){var a=s[e];i[a]=r.getParameter(r[a])}this.getExtension=function(e){return e in n||t(e),n[e]},this.getParameter=function(e){return i[e]},this.getMaxJointNumber=function(){return 15}}},function(e,t,r){"use strict";t.a={get:function(r){var t=new XMLHttpRequest;t.open("get",r.url),t.responseType=r.responseType||"text",r.onprogress&&(t.onprogress=function(e){var t;e.lengthComputable?(t=e.loaded/e.total,r.onprogress(t,e.loaded,e.total)):r.onprogress(null)}),t.onload=function(e){400<=t.status?r.onerror&&r.onerror():r.onload&&r.onload(t.response)},r.onerror&&(t.onerror=r.onerror),t.send(null)}}},function(e,t,r){"use strict";function h(e){return(e=Math.round(e))<0?0:255<e?255:e}function c(e){return e<0?0:1<e?1:e}function d(e){return h(e.length&&"%"===e.charAt(e.length-1)?parseFloat(e)/100*255:parseInt(e,10))}function f(e){return c(e.length&&"%"===e.charAt(e.length-1)?parseFloat(e)/100:parseFloat(e))}function s(e,t,r){return r<0?r+=1:1<r&&--r,6*r<1?e+(t-e)*r*6:2*r<1?t:3*r<2?e+(t-e)*(2/3-r)*6:e}function p(e,t,r){return e+(t-e)*r}function m(e,t,r,n,i){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e}function g(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function _(e,t){i&&g(i,t),i=T.put(e,i||t.slice())}function v(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}var n=r(69),y={},x={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]},T=new n.a(20),i=null;y.parse=function(e,t){if(e){t=t||[];var r=T.get(e);if(r)return g(t,r);var n,i=(e+="").replace(/ /g,"").toLowerCase();if(i in x)return g(t,x[i]),_(e,t),t;if("#"!==i.charAt(0)){var a=i.indexOf("("),o=i.indexOf(")");if(-1!==a&&o+1===i.length){var s=i.substr(0,a),u=i.substr(a+1,o-(a+1)).split(","),l=1;switch(s){case"rgba":if(4!==u.length)return void m(t,0,0,0,1);l=f(u.pop());case"rgb":return 3!==u.length?void m(t,0,0,0,1):(m(t,d(u[0]),d(u[1]),d(u[2]),l),_(e,t),t);case"hsla":return 4!==u.length?void m(t,0,0,0,1):(u[3]=f(u[3]),v(u,t),_(e,t),t);case"hsl":return 3!==u.length?void m(t,0,0,0,1):(v(u,t),_(e,t),t);default:return}}m(t,0,0,0,1)}else{if(4===i.length)return 0<=(n=parseInt(i.substr(1),16))&&n<=4095?(m(t,(3840&n)>>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),1<t&&--t);var f=[360*t,r,d];return null!=e[3]&&f.push(e[3]),f}}(e),null!=t&&(e[0]=(i=t,(i=Math.round(i))<0?0:360<i?360:i)),null!=r&&(e[1]=f(r)),null!=n&&(e[2]=f(n)),y.stringify(v(e),"rgba");var i},y.modifyAlpha=function(e,t){if((e=y.parse(e))&&null!=t)return e[3]=c(t),y.stringify(e,"rgba")},y.stringify=function(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+")"}},t.a=y},function(e,t,r){"use strict";function o(){this.head=null,this.tail=null,this._length=0}o.prototype.insert=function(e){var t=new o.Entry(e);return this.insertEntry(t),t},o.prototype.insertAt=function(e,t){if(!(e<0)){for(var r,n,i=this.head,a=0;i&&a!=e;)i=i.next,a++;i?(r=new o.Entry(t),(n=i.prev)?(n.next=r).prev=n:this.head=r,(r.next=i).prev=r):this.insert(t)}},o.prototype.insertBeforeEntry=function(e,t){var r=new o.Entry(e),n=t.prev;n?(n.next=r).prev=n:this.head=r,(r.next=t).prev=r,this._length++},o.prototype.insertEntry=function(e){this.head?((this.tail.next=e).prev=this.tail,this.tail=e):this.head=this.tail=e,this._length++},o.prototype.remove=function(e){var t=e.prev,r=e.next;t?t.next=r:this.head=r,r?r.prev=t:this.tail=t,e.next=e.prev=null,this._length--},o.prototype.removeAt=function(e){if(!(e<0)){for(var t=this.head,r=0;t&&r!=e;)t=t.next,r++;return t?(this.remove(t),t.value):void 0}},o.prototype.getHead=function(){if(this.head)return this.head.value},o.prototype.getTail=function(){if(this.tail)return this.tail.value},o.prototype.getAt=function(e){if(!(e<0)){for(var t=this.head,r=0;t&&r!=e;)t=t.next,r++;return t.value}},o.prototype.indexOf=function(e){for(var t=this.head,r=0;t;){if(t.value===e)return r;t=t.next,r++}},o.prototype.length=function(){return this._length},o.prototype.isEmpty=function(){return 0===this._length},o.prototype.forEach=function(e,t){for(var r=this.head,n=0,i=void 0!==t;r;)i?e.call(t,r.value,n):e(r.value,n),r=r.next,n++},o.prototype.clear=function(){this.tail=this.head=null,this._length=0},o.Entry=function(e){this.value=e,this.next=null,this.prev=null},t.a=o},function(e,t,r){"use strict";function b(e,o,t){var r,s={};for(r in t)s[r+"_COUNT"]=t[r];return e.replace(i,function(e,t,r,n){var i="";isNaN(t)&&(t=t in o?o[t]:s[t]),isNaN(r)&&(r=r in o?o[r]:s[r]);for(var a=parseInt(t);a<parseInt(r);a++)i+="{"+n.replace(/float\s*\(\s*_idx_\s*\)/g,a.toFixed(1)).replace(/_idx_/g,a)+"}";return i})}function w(e,t,r){var n=[];if(t)for(var i in t){var a=t[i];0<a&&n.push("#define "+i.toUpperCase()+"_COUNT "+a)}if(r)for(var o=0;o<r.length;o++){var s=r[o];n.push("#define "+s.toUpperCase()+"_ENABLED")}for(s in e){var u=e[s];null===u?n.push("#define "+s):n.push("#define "+s+" "+u.toString())}return n.join("\n")}function n(e){this._renderer=e,this._cache={}}var E=r(116),i=/for\s*?\(int\s*?_idx_\s*\=\s*([\w-]+)\;\s*_idx_\s*<\s*([\w-]+);\s*_idx_\s*\+\+\s*\)\s*\{\{([\s\S]+?)(?=\}\})\}\}/g;n.prototype.getProgram=function(e,t,r){var n=this._cache,i=e.isSkinnedMesh&&e.isSkinnedMesh(),a="s"+t.shader.shaderID+"m"+t.getProgramKey();r&&(a+="se"+r.getProgramKey(e.lightGroup)),i&&(a+=","+e.joints.length);var o=n[a];if(o)return o;var s,u=r?r.getLightsNumbers(e.lightGroup):{},l=this._renderer,h=l.gl,c=t.getEnabledTextures(),d="";i&&(s={SKINNING:null,JOINT_COUNT:e.joints.length},e.joints.length>l.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<e.length;r++)t.push("#extension GL_"+e[r]+" : enable");return t.join("\n")}(g)+"\n"+(["precision",_=t.precision,"float"].join(" ")+";\n"+["precision",_,"int"].join(" ")+";\n"+["precision",_,"sampler2D"].join(" ")+";\n")+"\n"+p+"\n"+t.shader.fragment,y=b(m,t.vertexDefines,u),x=b(v,t.fragmentDefines,u);(o=new E.a).uniformSemantics=t.shader.uniformSemantics,o.attributes=t.shader.attributes;var T=o.buildProgram(h,t.shader,y,x);return o.__error=T,n[a]=o},t.a=n},function(e,t,r){"use strict";function c(e,t,r){if(!e.getShaderParameter(t,e.COMPILE_STATUS))return[e.getShaderInfoLog(t),function(e){for(var t=e.split("\n"),r=0,n=t.length;r<n;r++)t[r]=r+1+": "+t[r];return t.join("\n")}(r)].join("\n")}var h=r(14),n=r(7),d={},f=new h.a.Float32Array(16),i=n.a.extend({uniformSemantics:{},attributes:{}},function(){this._locations={},this._textureSlot=0,this._program=null},{bind:function(e){this._textureSlot=0,e.gl.useProgram(this._program)},hasUniform:function(e){var t=this._locations[e];return null!=t},useTextureSlot:function(e,t,r){t&&(e.gl.activeTexture(e.gl.TEXTURE0+r),t.isRenderable()?t.bind(e):t.unbind(e))},currentTextureSlot:function(){return this._textureSlot},resetTextureSlot:function(e){this._textureSlot=e||0},takeCurrentTextureSlot:function(e,t){var r=this._textureSlot;return this.useTextureSlot(e,t,r),this._textureSlot++,r},setUniform:function(e,t,r,n){var i=this._locations[r];if(null==i)return!1;switch(t){case"m4":if(!(n instanceof Float32Array)){for(var a=0;a<n.length;a++)f[a]=n[a];n=f}e.uniformMatrix4fv(i,!1,n);break;case"2i":e.uniform2i(i,n[0],n[1]);break;case"2f":e.uniform2f(i,n[0],n[1]);break;case"3i":e.uniform3i(i,n[0],n[1],n[2]);break;case"3f":e.uniform3f(i,n[0],n[1],n[2]);break;case"4i":e.uniform4i(i,n[0],n[1],n[2],n[3]);break;case"4f":e.uniform4f(i,n[0],n[1],n[2],n[3]);break;case"1i":e.uniform1i(i,n);break;case"1f":e.uniform1f(i,n);break;case"1fv":e.uniform1fv(i,n);break;case"1iv":e.uniform1iv(i,n);break;case"2iv":e.uniform2iv(i,n);break;case"2fv":e.uniform2fv(i,n);break;case"3iv":e.uniform3iv(i,n);break;case"3fv":e.uniform3fv(i,n);break;case"4iv":e.uniform4iv(i,n);break;case"4fv":e.uniform4fv(i,n);break;case"m2":case"m2v":e.uniformMatrix2fv(i,!1,n);break;case"m3":case"m3v":e.uniformMatrix3fv(i,!1,n);break;case"m4v":if(Array.isArray(n)&&Array.isArray(n[0])){for(var o=new h.a.Float32Array(16*n.length),s=0,a=0;a<n.length;a++)for(var u=n[a],l=0;l<16;l++)o[s++]=u[l];e.uniformMatrix4fv(i,!1,o)}else e.uniformMatrix4fv(i,!1,n)}return!0},setUniformOfSemantic:function(e,t,r){var n=this.uniformSemantics[t];return!!n&&this.setUniform(e,n.type,n.symbol,r)},enableAttributes:function(e,t,r){var n,i=e.gl,a=this._program,o=this._locations;(n=r?r.__enabledAttributeList:d[e.__uid__])||(n=r?r.__enabledAttributeList=[]:d[e.__uid__]=[]);for(var s=[],u=0;u<t.length;u++){var l=t[u];if(this.attributes[l]){var h=o[l];if(null==h){if(-1===(h=i.getAttribLocation(a,l))){s[u]=-1;continue}o[l]=h}n[s[u]=h]?n[h]=2:n[h]=1}else s[u]=-1}for(u=0;u<n.length;u++)switch(n[u]){case 1:i.enableVertexAttribArray(u),n[u]=3;break;case 2:n[u]=3;break;case 3:i.disableVertexAttribArray(u),n[u]=0}return s},buildProgram:function(e,t,r,n){var i=e.createShader(e.VERTEX_SHADER),a=e.createProgram();e.shaderSource(i,r),e.compileShader(i);var o=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(o,n),e.compileShader(o);var s,u=c(e,i,r);if(u)return u;if(u=c(e,o,n))return u;if(e.attachShader(a,i),e.attachShader(a,o),t.attributeSemantics.POSITION?e.bindAttribLocation(a,0,t.attributeSemantics.POSITION.symbol):(s=Object.keys(this.attributes),e.bindAttribLocation(a,0,s[0])),e.linkProgram(a),!e.getProgramParameter(a,e.LINK_STATUS))return"Could not link program\n"+e.getProgramInfoLog(a);for(var l=0;l<t.uniforms.length;l++){var h=t.uniforms[l];this._locations[h]=e.getUniformLocation(a,h)}e.deleteShader(i),e.deleteShader(o),this._program=a,this.vertexCode=r,this.fragmentCode=n}});t.a=i},function(e,t,r){"use strict";var A,M,C,L,D,n=r(7),i=r(54),a=r(26),N=r(3),R=r(9),o=r(72),P=r(11),I=r(12),O=n.a.extend({scene:null,camera:null,renderer:null},function(){this._ray=new i.a,this._ndc=new a.a},{pick:function(e,t,r){return this.pickAll(e,t,[],r)[0]||null},pickAll:function(e,t,r,n){return this.renderer.screenToNDC(e,t,this._ndc),this.camera.castRay(this._ndc,this._ray),r=r||[],this._intersectNode(this.scene,r,n||!1),r.sort(this._intersectionCompareFunc),r},_intersectNode:function(e,t,r){e instanceof o.a&&e.isRenderable()&&(e.ignorePicking&&!r||!(e.mode===P.a.TRIANGLES&&e.geometry.isUseIndices()||e.geometry.pickByRay||e.geometry.pick)||this._intersectRenderable(e,t));for(var n=0;n<e._children.length;n++)this._intersectNode(e._children[n],t,r)},_intersectRenderable:(A=new N.a,M=new N.a,C=new N.a,L=new i.a,D=new R.a,function(e,t){var r=e.isSkinnedMesh();L.copy(this._ray),R.a.invert(D,e.worldTransform),r||L.applyTransform(D);var n=e.geometry,i=r?e.skeleton.boundingBox:n.boundingBox;if(!i||L.intersectBoundingBox(i)){if(n.pick)return void n.pick(this._ndc.x,this._ndc.y,this.renderer,this.camera,e,t);if(n.pickByRay)return void n.pickByRay(L,e,t);var a,o,s=e.cullFace===P.a.BACK&&e.frontFace===P.a.CCW||e.cullFace===P.a.FRONT&&e.frontFace===P.a.CW,u=n.indices,l=n.attributes.position,h=n.attributes.weight,c=n.attributes.joint,d=[];if(l&&l.value&&u){if(r){o=e.skeleton.getSubSkinMatrices(e.__uid__,e.joints);for(var f=0;f<e.joints.length;f++){d[f]=d[f]||[];for(var p=0;p<16;p++)d[f][p]=o[16*f+p]}var m=[],g=[],_=[],v=[],y=[],x=n.attributes.skinnedPosition;x&&x.value||(n.createAttribute("skinnedPosition","f",3),(x=n.attributes.skinnedPosition).init(n.vertexCount));for(f=0;f<n.vertexCount;f++){l.get(f,m),h.get(f,g),c.get(f,_),g[3]=1-g[0]-g[1]-g[2],I.a.set(v,0,0,0);for(p=0;p<4;p++)0<=_[p]&&1e-4<g[p]&&(I.a.transformMat4(y,m,d[_[p]]),I.a.scaleAndAdd(v,v,y,g[p]));x.set(f,v)}}for(f=0;f<u.length;f+=3){var T,b=u[f],w=u[f+1],E=u[f+2],S=r?n.attributes.skinnedPosition:l;S.get(b,A.array),S.get(w,M.array),S.get(E,C.array),(a=s?L.intersectTriangle(A,M,C,e.culling):L.intersectTriangle(A,C,M,e.culling))&&(T=new N.a,r?N.a.copy(T,a):N.a.transformMat4(T,a,e.worldTransform),t.push(new O.Intersection(a,T,e,[b,w,E],f/3,N.a.dist(T,this._ray.origin))))}}}}),_intersectionCompareFunc:function(e,t){return e.distance-t.distance}});O.Intersection=function(e,t,r,n,i,a){this.point=e,this.pointWorld=t,this.target=r,this.triangle=n,this.triangleIndex=i,this.distance=a},t.a=O},function(e,t,r){"use strict";function s(e){return{byte:o.a.Int8Array,ubyte:o.a.Uint8Array,short:o.a.Int16Array,ushort:o.a.Uint16Array}[e]||o.a.Float32Array}function _(e){return"attr_"+e}function a(e,t,r,n){switch(this.name=e,this.type=t,this.size=r,this.semantic=n||"",this.value=null,r){case 1:this.get=function(e){return this.value[e]},this.set=function(e,t){this.value[e]=t},this.copy=function(e,t){this.value[e]=this.value[e]};break;case 2:this.get=function(e,t){var r=this.value;return t[0]=r[2*e],t[1]=r[2*e+1],t},this.set=function(e,t){var r=this.value;r[2*e]=t[0],r[2*e+1]=t[1]},this.copy=function(e,t){var r=this.value;t*=2,r[e*=2]=r[t],r[e+1]=r[t+1]};break;case 3:this.get=function(e,t){var r=3*e,n=this.value;return t[0]=n[r],t[1]=n[1+r],t[2]=n[2+r],t},this.set=function(e,t){var r=3*e,n=this.value;n[r]=t[0],n[1+r]=t[1],n[2+r]=t[2]},this.copy=function(e,t){var r=this.value;t*=3,r[e*=3]=r[t],r[e+1]=r[t+1],r[e+2]=r[t+2]};break;case 4:this.get=function(e,t){var r=this.value,n=4*e;return t[0]=r[n],t[1]=r[1+n],t[2]=r[2+n],t[3]=r[3+n],t},this.set=function(e,t){var r=this.value,n=4*e;r[n]=t[0],r[1+n]=t[1],r[2+n]=t[2],r[3+n]=t[3]},this.copy=function(e,t){var r=this.value;t*=4,r[e*=4]=r[t],r[e+1]=r[t+1],r[e+2]=r[t+2],r[e+3]=r[t+3]}}}function v(e,t,r,n,i){this.name=e,this.type=t,this.buffer=r,this.size=n,this.semantic=i,this.symbol="",this.needsRemove=!1}function y(e){this.buffer=e,this.count=0}var n=r(7),x=r(11),i=r(57),o=r(14);a.prototype.init=function(e){var t;this.value&&this.value.length==e*this.size||(t=s(this.type),this.value=new t(e*this.size))},a.prototype.fromArray=function(e){var t=s(this.type);if(e[0]&&e[0].length)for(var r=0,n=this.size,i=new t(e.length*n),a=0;a<e.length;a++)for(var o=0;o<n;o++)i[r++]=e[a][o];else i=new t(e);this.value=i},a.prototype.clone=function(e){var t=new a(this.name,this.type,this.size,this.semantic);return e&&console.warn("todo"),t};var u=n.a.extend(function(){return{attributes:{},indices:null,dynamic:!0,_enabledAttributes:null,__used:0}},function(){this._cache=new i.a,this._attributeList=Object.keys(this.attributes),this.__vaoCache={}},{mainAttribute:"",pick:null,pickByRay:null,dirty:function(){for(var e=this.getEnabledAttributes(),t=0;t<e.length;t++)this.dirtyAttribute(e[t]);this.dirtyIndices(),this._enabledAttributes=null,this._cache.dirty("any")},dirtyIndices:function(){this._cache.dirtyAll("indices")},dirtyAttribute:function(e){this._cache.dirtyAll(_(e)),this._cache.dirtyAll("attributes")},getTriangleIndices:function(e,t){if(e<this.triangleCount&&0<=e){t=t||[];var r=this.indices;return t[0]=r[3*e],t[1]=r[3*e+1],t[2]=r[3*e+2],t}},setTriangleIndices:function(e,t){var r=this.indices;r[3*e]=t[0],r[3*e+1]=t[1],r[3*e+2]=t[2]},isUseIndices:function(){return!!this.indices},initIndicesFromArray:function(e){var t=65535<this.vertexCount?o.a.Uint32Array:o.a.Uint16Array;if(e[0]&&e[0].length)for(var r=0,n=new t(3*e.length),i=0;i<e.length;i++)for(var a=0;a<3;a++)n[r++]=e[i][a];else n=new t(e);this.indices=n},createAttribute:function(e,t,r,n){var i=new a(e,t,r,n);return this.attributes[e]&&this.removeAttribute(e),this.attributes[e]=i,this._attributeList.push(e),i},removeAttribute:function(e){var t=this._attributeList,r=t.indexOf(e);return 0<=r&&(t.splice(r,1),delete this.attributes[e],!0)},getAttribute:function(e){return this.attributes[e]},getEnabledAttributes:function(){var e=this._enabledAttributes,t=this._attributeList;if(e)return e;for(var r=[],n=this.vertexCount,i=0;i<t.length;i++){var a=t[i],o=this.attributes[a];o.value&&o.value.length===n*o.size&&r.push(a)}return this._enabledAttributes=r},getBufferChunks:function(e){var t=this._cache;t.use(e.__uid__);var r=t.isDirty("attributes"),n=t.isDirty("indices");if(r||n){this._updateBuffer(e.gl,r,n);for(var i=this.getEnabledAttributes(),a=0;a<i.length;a++)t.fresh(_(i[a]));t.fresh("attributes"),t.fresh("indices")}return t.fresh("any"),t.get("chunks")},_updateBuffer:function(e,t,r){var n=this._cache,i=n.get("chunks"),a=!1;i||((i=[])[0]={attributeBuffers:[],indicesBuffer:null},n.put("chunks",i),a=!0);var o=i[0],s=o.attributeBuffers,u=o.indicesBuffer;if(t||a){var l=this.getEnabledAttributes(),h={};if(!a)for(var c=0;c<s.length;c++)h[s[c].name]=s[c];for(var d=0;d<l.length;d++){var f,p,m=l[d],g=this.attributes[m];a||(f=h[m]),p=f?f.buffer:e.createBuffer(),n.isDirty(_(m))&&(e.bindBuffer(e.ARRAY_BUFFER,p),e.bufferData(e.ARRAY_BUFFER,g.value,this.dynamic?x.a.DYNAMIC_DRAW:x.a.STATIC_DRAW)),s[d]=new v(m,g.type,p,g.size,g.semantic)}for(c=d;c<s.length;c++)e.deleteBuffer(s[c].buffer);s.length=d}this.isUseIndices()&&(r||a)&&(u||(u=new y(e.createBuffer()),o.indicesBuffer=u),u.count=this.indices.length,e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,u.buffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,this.indices,this.dynamic?x.a.DYNAMIC_DRAW:x.a.STATIC_DRAW))},dispose:function(e){var t=this._cache;t.use(e.__uid__);var r=t.get("chunks");if(r)for(var n=0;n<r.length;n++){for(var i=r[n],a=0;a<i.attributeBuffers.length;a++){var o=i.attributeBuffers[a];e.gl.deleteBuffer(o.buffer)}i.indicesBuffer&&e.gl.deleteBuffer(i.indicesBuffer.buffer)}if(this.__vaoCache){var s,u=e.getGLExtension("OES_vertex_array_object");for(s in this.__vaoCache){var l=this.__vaoCache[s].vao;l&&u.deleteVertexArrayOES(l)}}this.__vaoCache={},t.deleteContext(e.__uid__)}});Object.defineProperty&&(Object.defineProperty(u.prototype,"vertexCount",{enumerable:!1,get:function(){var e=this.attributes[this.mainAttribute];return(e=e||this.attributes[this._attributeList[0]])&&e.value?e.value.length/e.size:0}}),Object.defineProperty(u.prototype,"triangleCount",{enumerable:!1,get:function(){var e=this.indices;return e?e.length/3:0}})),u.STATIC_DRAW=x.a.STATIC_DRAW,u.DYNAMIC_DRAW=x.a.DYNAMIC_DRAW,u.STREAM_DRAW=x.a.STREAM_DRAW,u.AttributeBuffer=v,u.IndicesBuffer=y,u.Attribute=a,t.a=u},function(e,t,r){"use strict";var n=r(120),i=":unconfigurable;";t.a=["@export clay.header.directional_light","uniform vec3 directionalLightDirection[DIRECTIONAL_LIGHT_COUNT]"+i,"uniform vec3 directionalLightColor[DIRECTIONAL_LIGHT_COUNT]"+i,"@end","@export clay.header.ambient_light","uniform vec3 ambientLightColor[AMBIENT_LIGHT_COUNT]"+i,"@end","@export clay.header.ambient_sh_light","uniform vec3 ambientSHLightColor[AMBIENT_SH_LIGHT_COUNT]"+i,"uniform vec3 ambientSHLightCoefficients[AMBIENT_SH_LIGHT_COUNT * 9]"+i,n.a,"@end","@export clay.header.ambient_cubemap_light","uniform vec3 ambientCubemapLightColor[AMBIENT_CUBEMAP_LIGHT_COUNT]"+i,"uniform samplerCube ambientCubemapLightCubemap[AMBIENT_CUBEMAP_LIGHT_COUNT]"+i,"uniform sampler2D ambientCubemapLightBRDFLookup[AMBIENT_CUBEMAP_LIGHT_COUNT]"+i,"@end","@export clay.header.point_light","uniform vec3 pointLightPosition[POINT_LIGHT_COUNT]"+i,"uniform float pointLightRange[POINT_LIGHT_COUNT]"+i,"uniform vec3 pointLightColor[POINT_LIGHT_COUNT]"+i,"@end","@export clay.header.spot_light","uniform vec3 spotLightPosition[SPOT_LIGHT_COUNT]"+i,"uniform vec3 spotLightDirection[SPOT_LIGHT_COUNT]"+i,"uniform float spotLightRange[SPOT_LIGHT_COUNT]"+i,"uniform float spotLightUmbraAngleCosine[SPOT_LIGHT_COUNT]"+i,"uniform float spotLightPenumbraAngleCosine[SPOT_LIGHT_COUNT]"+i,"uniform float spotLightFalloffFactor[SPOT_LIGHT_COUNT]"+i,"uniform vec3 spotLightColor[SPOT_LIGHT_COUNT]"+i,"@end"].join("\n")},function(e,t,r){"use strict";t.a="vec3 calcAmbientSHLight(int idx, vec3 N) {\n int offset = 9 * idx;\n return ambientSHLightCoefficients[0]\n + ambientSHLightCoefficients[1] * N.x\n + ambientSHLightCoefficients[2] * N.y\n + ambientSHLightCoefficients[3] * N.z\n + ambientSHLightCoefficients[4] * N.x * N.z\n + ambientSHLightCoefficients[5] * N.z * N.y\n + ambientSHLightCoefficients[6] * N.y * N.x\n + ambientSHLightCoefficients[7] * (3.0 * N.z * N.z - 1.0)\n + ambientSHLightCoefficients[8] * (N.x * N.x - N.y * N.y);\n}"},function(e,t,r){"use strict";t.a="@export clay.skybox.vertex\n#define SHADER_NAME skybox\nuniform mat4 world : WORLD;\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nattribute vec3 position : POSITION;\nvarying vec3 v_WorldPosition;\nvoid main()\n{\n v_WorldPosition = (world * vec4(position, 1.0)).xyz;\n gl_Position = worldViewProjection * vec4(position, 1.0);\n}\n@end\n@export clay.skybox.fragment\n#define PI 3.1415926\nuniform mat4 viewInverse : VIEWINVERSE;\n#ifdef EQUIRECTANGULAR\nuniform sampler2D environmentMap;\n#else\nuniform samplerCube environmentMap;\n#endif\nuniform float lod: 0.0;\nvarying vec3 v_WorldPosition;\n@import clay.util.rgbm\n@import clay.util.srgb\n@import clay.util.ACES\nvoid main()\n{\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(v_WorldPosition - eyePos);\n#ifdef EQUIRECTANGULAR\n float phi = acos(V.y);\n float theta = atan(-V.x, V.z) + PI * 0.5;\n vec2 uv = vec2(theta / 2.0 / PI, phi / PI);\n vec4 texel = decodeHDR(texture2D(environmentMap, fract(uv)));\n#else\n #if defined(LOD) || defined(SUPPORT_TEXTURE_LOD)\n vec4 texel = decodeHDR(textureCubeLodEXT(environmentMap, V, lod));\n #else\n vec4 texel = decodeHDR(textureCube(environmentMap, V));\n #endif\n#endif\n#ifdef SRGB_DECODE\n texel = sRGBToLinear(texel);\n#endif\n#ifdef TONEMAPPING\n texel.rgb = ACESToneMapping(texel.rgb);\n#endif\n#ifdef SRGB_ENCODE\n texel = linearTosRGB(texel);\n#endif\n gl_FragColor = encodeHDR(vec4(texel.rgb, 1.0));\n}\n@end"},function(e,t,r){"use strict";function n(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}var T=r(4),b=r(5),w=(r(27),n("DXT1")),E=n("DXT3"),S=n("DXT5"),i={parse:function(e,t){var r=new Int32Array(e,0,31);if(542327876!==r[0])return null;if(4&!r(20))return null;var n,i,a=r(21),o=r[4],s=r[3],u=512&r[28],l=131072&r[2];switch(a){case w:n=8,i=T.a.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case E:n=16,i=T.a.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case S:n=16,i=T.a.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return null}var h=r[1]+4,c=u?6:1,d=1;l&&(d=Math.max(1,r[7]));for(var f=[],p=0;p<c;p++){var m=o,g=s;f[p]=new b.a({width:m,height:g,format:i});for(var _=[],v=0;v<d;v++){var y=Math.max(4,m)/4*Math.max(4,g)/4*n,x=new Uint8Array(e,h,y);h+=y,m*=.5,g*=.5,_[v]=x}f[p].pixels=_[0],l&&(f[p].mipmaps=_)}if(!t)return f[0];t.width=f[0].width,t.height=f[0].height,t.format=f[0].format,t.pixels=f[0].pixels,t.mipmaps=f[0].mipmaps}};t.a=i},function(e,t,r){"use strict";function w(e,t,r,n){for(var i,a,o=0,s=0,u=n;0<u;)if(e[s][0]=t[r++],e[s][1]=t[r++],e[s][2]=t[r++],e[s][3]=t[r++],1===e[s][0]&&1===e[s][1]&&1===e[s][2]){for(var l=e[s][3]<<o>>>0;0<l;l--)i=e[s-1],(a=e[s])[0]=i[0],a[1]=i[1],a[2]=i[2],a[3]=i[3],s++,u--;o+=8}else s++,u--,o=0;return r}var E=r(4),S=r(5),A=String.fromCharCode,M=8,C=32767,n={parseRGBE:function(e,t,r){null==r&&(r=0);var n,i,a,o,s,u=new Uint8Array(e),l=u.length;if("#?"===function(e,t,r){for(var n="",i=t;i<r;i++)n+=A(e[i]);return n}(u,0,2)){for(var h=2;h<l&&("\n"!==A(u[h])||"\n"!==A(u[h+1]));h++);if(!(l<=h)){h+=2;for(var c="";h<l;h++){var d=A(u[h]);if("\n"===d)break;c+=d}var f=c.split(" "),p=parseInt(f[1]),m=parseInt(f[3]);if(m&&p){for(var g=h+1,_=[],v=0;v<m;v++){_[v]=[];for(var y=0;y<4;y++)_[v][y]=0}for(var x=new Float32Array(m*p*4),T=0,b=0;b<p;b++){if(!(g=function(e,t,r,n){if(n<M|C<n)return w(e,t,r,n);if(2!=(i=t[r++]))return w(e,t,r-1,n);if(e[0][1]=t[r++],e[0][2]=t[r++],i=t[r++],(e[0][2]<<8>>>0|i)>>>0!==n)return null;for(var i=0;i<4;i++)for(var a=0;a<n;){var o=t[r++];if(128<o){o=(127&o)>>>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;v<m;v++)n=_[v],i=x,a=T,o=r,s=void 0,0<n[3]?(s=Math.pow(2,n[3]-128-8+o),i[a+0]=n[0]*s,i[a+1]=n[1]*s,i[a+2]=n[2]*s):(i[a+0]=0,i[a+1]=0,i[a+2]=0),i[a+3]=1,T+=4}return(t=t||new S.a).width=m,t.height=p,t.pixels=x,t.type=E.a.FLOAT,t}}}},parseRGBEFromPNG:function(){}};t.a=n},function(e,t,r){"use strict";function n(e){return"_on"+e}function i(e){var t=this;this._texture=new a.a({anisotropic:32,flipY:!1,surface:this,dispose:function(e){t.dispose(),a.a.prototype.dispose.call(this,e)}}),o.forEach(function(r){this[n(r)]=function(t){t.triangle&&this._meshes.forEach(function(e){this.dispatchEvent(r,e,t.triangle,t.point)},this)}},this),this._meshes=[],e&&this.setECharts(e),this.onupdate=null}var m,g,_,v,y,x,T,b,a=r(5),w=r(3),E=r(26),o=["mousedown","mouseup","mousemove","mouseover","mouseout","click","dblclick","contextmenu"];i.prototype={constructor:i,getTexture:function(){return this._texture},setECharts:function(e){var t,r,n,i=(this._chart=e).getDom();i instanceof HTMLCanvasElement?(t=this,r=e.getZr(),n=r.__oldRefreshImmediately||r.refreshImmediately,r.refreshImmediately=function(){n.call(this),t._texture.dirty(),t.onupdate&&t.onupdate()},r.__oldRefreshImmediately=n):(console.error("ECharts must init on canvas if it is used as texture."),i=document.createElement("canvas")),this._texture.image=i,this._texture.dirty(),this.onupdate&&this.onupdate()},dispatchEvent:(m=new w.a,g=new w.a,_=new w.a,v=new E.a,y=new E.a,x=new E.a,T=new E.a,b=new w.a,function(e,t,r,n){var i=t.geometry,a=i.attributes.position,o=i.attributes.texcoord0,s=w.a.dot,u=w.a.cross;a.get(r[0],m.array),a.get(r[1],g.array),a.get(r[2],_.array),o.get(r[0],v.array),o.get(r[1],y.array),o.get(r[2],x.array),u(b,g,_);var l=s(m,b),h=s(n,b)/l;u(b,_,m);var c=s(n,b)/l;u(b,m,g);var d=s(n,b)/l;E.a.scale(T,v,h),E.a.scaleAndAdd(T,T,y,c),E.a.scaleAndAdd(T,T,x,d);var f=T.x*this._chart.getWidth(),p=T.y*this._chart.getHeight();this._chart.getZr().handler.dispatch(e,{zrX:f,zrY:p})}),attachToMesh:function(t){0<=this._meshes.indexOf(t)||(o.forEach(function(e){t.on(e,this[n(e)],this)},this),this._meshes.push(t))},detachFromMesh:function(t){var e=this._meshes.indexOf(t);0<=e&&this._meshes.splice(e,1),o.forEach(function(e){t.off(e,this[n(e)])},this)},dispose:function(){this._meshes.forEach(function(e){this.detachFromMesh(e)},this)}},t.a=i},function(e,t,r){"use strict";var n=r(24),i=r(77),a=n.a.extend({cubemap:null,castShadow:!1,_normalDistribution:null,_brdfLookup:null},{type:"AMBIENT_CUBEMAP_LIGHT",prefilter:function(e,t){var r,n;e.getGLExtension("EXT_shader_texture_lod")?(this._brdfLookup||(this._normalDistribution=i.a.generateNormalDistribution(),this._brdfLookup=i.a.integrateBRDF(e,this._normalDistribution)),(r=this.cubemap).__prefiltered||(n=i.a.prefilterEnvironmentMap(e,r,{encodeRGBM:!0,width:t,height:t},this._normalDistribution,this._brdfLookup),this.cubemap=n.environmentMap,this.cubemap.__prefiltered=!0,r.dispose(e))):console.warn("Device not support textureCubeLodEXT")},getBRDFLookup:function(){return this._brdfLookup},uniformTemplates:{ambientCubemapLightColor:{type:"3f",value:function(e){var t=e.color,r=e.intensity;return[t[0]*r,t[1]*r,t[2]*r]}},ambientCubemapLightCubemap:{type:"t",value:function(e){return e.cubemap}},ambientCubemapLightBRDFLookup:{type:"t",value:function(e){return e._brdfLookup}}}});t.a=a},function(e,t,r){"use strict";t.a="\n@export clay.compositor.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nattribute vec3 position : POSITION;\nattribute vec2 texcoord : TEXCOORD_0;\nvarying vec2 v_Texcoord;\nvoid main()\n{\n v_Texcoord = texcoord;\n gl_Position = worldViewProjection * vec4(position, 1.0);\n}\n@end"},function(e,t,r){"use strict";t.a="#define SAMPLE_NUMBER 1024\n#define PI 3.14159265358979\nuniform sampler2D normalDistribution;\nuniform vec2 viewportSize : [512, 256];\nconst vec3 N = vec3(0.0, 0.0, 1.0);\nconst float fSampleNumber = float(SAMPLE_NUMBER);\nvec3 importanceSampleNormal(float i, float roughness, vec3 N) {\n vec3 H = texture2D(normalDistribution, vec2(roughness, i)).rgb;\n vec3 upVector = abs(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}\nfloat G_Smith(float roughness, float NoV, float NoL) {\n float k = roughness * roughness / 2.0;\n float G1V = NoV / (NoV * (1.0 - k) + k);\n float G1L = NoL / (NoL * (1.0 - k) + k);\n return G1L * G1V;\n}\nvoid main() {\n vec2 uv = gl_FragCoord.xy / viewportSize;\n float NoV = uv.x;\n float roughness = uv.y;\n vec3 V;\n V.x = sqrt(1.0 - NoV * NoV);\n V.y = 0.0;\n V.z = NoV;\n float A = 0.0;\n float B = 0.0;\n for (int i = 0; i < SAMPLE_NUMBER; i++) {\n vec3 H = importanceSampleNormal(float(i) / fSampleNumber, roughness, N);\n vec3 L = reflect(-V, H);\n float NoL = clamp(L.z, 0.0, 1.0);\n float NoH = clamp(H.z, 0.0, 1.0);\n float VoH = clamp(dot(V, H), 0.0, 1.0);\n if (NoL > 0.0) {\n float G = G_Smith(roughness, NoV, NoL);\n float G_Vis = G * VoH / (NoH * NoV);\n float Fc = pow(1.0 - VoH, 5.0);\n A += (1.0 - Fc) * G_Vis;\n B += Fc * G_Vis;\n }\n }\n gl_FragColor = vec4(vec2(A, B) / fSampleNumber, 0.0, 1.0);\n}\n"},function(e,t,r){"use strict";t.a="#define SHADER_NAME prefilter\n#define SAMPLE_NUMBER 1024\n#define PI 3.14159265358979\nuniform mat4 viewInverse : VIEWINVERSE;\nuniform samplerCube environmentMap;\nuniform sampler2D normalDistribution;\nuniform float roughness : 0.5;\nvarying vec2 v_Texcoord;\nvarying vec3 v_WorldPosition;\n@import clay.util.rgbm\nvec3 importanceSampleNormal(float i, float roughness, vec3 N) {\n vec3 H = texture2D(normalDistribution, vec2(roughness, i)).rgb;\n vec3 upVector = abs(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}\nvoid main() {\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(v_WorldPosition - eyePos);\n vec3 N = V;\n vec3 prefilteredColor = vec3(0.0);\n float totalWeight = 0.0;\n float fMaxSampleNumber = float(SAMPLE_NUMBER);\n for (int i = 0; i < SAMPLE_NUMBER; i++) {\n vec3 H = importanceSampleNormal(float(i) / fMaxSampleNumber, roughness, N);\n vec3 L = reflect(-V, H);\n float NoL = clamp(dot(N, L), 0.0, 1.0);\n if (NoL > 0.0) {\n prefilteredColor += decodeHDR(textureCube(environmentMap, L)).rgb * NoL;\n totalWeight += NoL;\n }\n }\n gl_FragColor = encodeHDR(vec4(prefilteredColor / totalWeight, 1.0));\n}\n"},function(e,t,r){"use strict";var n=r(24),i=r(14),a=n.a.extend({castShadow:!1,coefficients:[]},function(){this._coefficientsTmpArr=new i.a.Float32Array(27)},{type:"AMBIENT_SH_LIGHT",uniformTemplates:{ambientSHLightColor:{type:"3f",value:function(e){var t=e.color,r=e.intensity;return[t[0]*r,t[1]*r,t[2]*r]}},ambientSHLightCoefficients:{type:"3f",value:function(e){for(var t=e._coefficientsTmpArr,r=0;r<e.coefficients.length;r++)t[r]=e.coefficients[r];return t}}}});t.a=a},function(e,t,r){"use strict";var p=r(4),m=r(10),g=r(5),w=(r(16),r(14)),_=r(42),v=r(75),y=r(62),x=r(36),E=r(12),n=(r(131),{}),S=["px","nx","py","ny","pz","nz"],A={px:[2,1,0,-1,-1,1],nx:[2,1,0,1,-1,-1],py:[0,2,1,1,-1,-1],ny:[0,2,1,1,1,1],pz:[0,1,2,-1,-1,-1],nz:[0,1,2,1,-1,1]};n.projectEnvironmentMap=function(e,t,r){(r=r||{}).lod=r.lod||0;var n=new x.a,i=64,a="texture2D"===t.textureType?new v.a({scene:n,environmentMap:t}):(i=t.image&&t.image.px?t.image.px.width:t.width,new _.a({scene:n,environmentMap:t})),o=Math.ceil(i/Math.pow(2,r.lod)),s=Math.ceil(i/Math.pow(2,r.lod)),u=new g.a({width:o,height:s}),l=new m.a;a.material.define("fragment","RGBM_ENCODE"),r.decodeRGBM&&a.material.define("fragment","RGBM_DECODE"),a.material.set("lod",r.lod);for(var h=new y.a({texture:u}),c={},d=0;d<S.length;d++){c[S[d]]=new Uint8Array(o*s*4);var f=h.getCamera(S[d]);f.fov=90,l.attach(u),l.bind(e),e.render(n,f),e.gl.readPixels(0,0,o,s,p.a.RGBA,p.a.UNSIGNED_BYTE,c[S[d]]),l.unbind(e)}return a.dispose(e),l.dispose(e),u.dispose(e),function(e,t,r){for(var n,i,a,o,s,u=new w.a.Float32Array(27),l=E.a.create(),h=E.a.create(),c=E.a.create(),d=0;d<9;d++){for(var f=E.a.create(),p=0;p<S.length;p++){for(var m=e[S[p]],g=E.a.create(),_=0,v=0,y=A[S[p]],x=0;x<r;x++)for(var T=0;T<t;T++){l[0]=T/(t-1)*2-1,l[1]=x/(r-1)*2-1,l[2]=-1,E.a.normalize(l,l),c[0]=l[y[0]]*y[3],c[1]=l[y[1]]*y[4],c[2]=l[y[2]]*y[5],h[0]=m[v++]/255,h[1]=m[v++]/255,h[2]=m[v++]/255;var b=m[v++]/255*8.12;h[0]*=b,h[1]*=b,h[2]*=b,E.a.scaleAndAdd(g,g,h,(i=d,s=o=a=void 0,a=(n=c)[0],o=n[1],s=n[2],(0===i?1:1===i?a:2===i?o:3===i?s:4===i?a*s:5===i?o*s:6===i?a*o:7===i?3*s*s-1:a*a-o*o)*-l[2])),_+=-l[2]}E.a.scaleAndAdd(f,f,g,1/_)}u[3*d]=f[0]/6,u[3*d+1]=f[1]/6,u[3*d+2]=f[2]/6}return u}(c,o,s)},t.a=n},function(e,t,r){"use strict";t.a="uniform samplerCube environmentMap;\nvarying vec2 v_Texcoord;\n#define TEXTURE_SIZE 16\nmat3 front = mat3(\n 1.0, 0.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 0.0, 1.0\n);\nmat3 back = mat3(\n -1.0, 0.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 0.0, -1.0\n);\nmat3 left = mat3(\n 0.0, 0.0, -1.0,\n 0.0, 1.0, 0.0,\n 1.0, 0.0, 0.0\n);\nmat3 right = mat3(\n 0.0, 0.0, 1.0,\n 0.0, 1.0, 0.0,\n -1.0, 0.0, 0.0\n);\nmat3 up = mat3(\n 1.0, 0.0, 0.0,\n 0.0, 0.0, 1.0,\n 0.0, -1.0, 0.0\n);\nmat3 down = mat3(\n 1.0, 0.0, 0.0,\n 0.0, 0.0, -1.0,\n 0.0, 1.0, 0.0\n);\nfloat harmonics(vec3 normal){\n int index = int(gl_FragCoord.x);\n float x = normal.x;\n float y = normal.y;\n float z = normal.z;\n if(index==0){\n return 1.0;\n }\n else if(index==1){\n return x;\n }\n else if(index==2){\n return y;\n }\n else if(index==3){\n return z;\n }\n else if(index==4){\n return x*z;\n }\n else if(index==5){\n return y*z;\n }\n else if(index==6){\n return x*y;\n }\n else if(index==7){\n return 3.0*z*z - 1.0;\n }\n else{\n return x*x - y*y;\n }\n}\nvec3 sampleSide(mat3 rot)\n{\n vec3 result = vec3(0.0);\n float divider = 0.0;\n for (int i = 0; i < TEXTURE_SIZE * TEXTURE_SIZE; i++) {\n float x = mod(float(i), float(TEXTURE_SIZE));\n float y = float(i / TEXTURE_SIZE);\n vec2 sidecoord = ((vec2(x, y) + vec2(0.5, 0.5)) / vec2(TEXTURE_SIZE)) * 2.0 - 1.0;\n vec3 normal = normalize(vec3(sidecoord, -1.0));\n vec3 fetchNormal = rot * normal;\n vec3 texel = textureCube(environmentMap, fetchNormal).rgb;\n result += harmonics(fetchNormal) * texel * -normal.z;\n divider += -normal.z;\n }\n return result / divider;\n}\nvoid main()\n{\n vec3 result = (\n sampleSide(front) +\n sampleSide(back) +\n sampleSide(left) +\n sampleSide(right) +\n sampleSide(up) +\n sampleSide(down)\n ) / 6.0;\n gl_FragColor = vec4(result, 1.0);\n}"},function(e,t,r){"use strict";var n=r(15),D=r(18),i=n.a.extend({dynamic:!1,widthSegments:40,heightSegments:20,phiStart:0,phiLength:2*Math.PI,thetaStart:0,thetaLength:Math.PI,radius:1},function(){this.build()},{build:function(){var e=this.heightSegments,t=this.widthSegments,r=this.attributes.position,n=this.attributes.texcoord0,i=this.attributes.normal,a=(t+1)*(e+1);r.init(a),n.init(a),i.init(a);for(var o,s,u,l,h,c,d=65535<a?Uint32Array:Uint16Array,f=this.indices=new d(t*e*6),p=this.radius,m=this.phiStart,g=this.phiLength,_=this.thetaStart,v=this.thetaLength,y=[],x=[],T=0,b=1/(p=this.radius),w=0;w<=e;w++)for(c=0;c<=t;c++)l=c/t,h=w/e,o=-p*Math.cos(m+l*g)*Math.sin(_+h*v),s=p*Math.cos(_+h*v),u=p*Math.sin(m+l*g)*Math.sin(_+h*v),y[0]=o,y[1]=s,y[2]=u,x[0]=l,x[1]=h,r.set(T,y),n.set(T,x),y[0]*=b,y[1]*=b,y[2]*=b,i.set(T,y),T++;var E,S,A,M,C=t+1,L=0;for(w=0;w<e;w++)for(c=0;c<t;c++)E=(S=w*C+c)+1,M=(w+1)*C+c+1,A=(w+1)*C+c,f[L++]=E,f[L++]=S,f[L++]=M,f[L++]=S,f[L++]=A,f[L++]=M;this.boundingBox=new D.a,this.boundingBox.max.set(p,p,p),this.boundingBox.min.set(-p,-p,-p)}});t.a=i},function(e,t,r){"use strict";var n=r(24).a.extend({castShadow:!1},{type:"AMBIENT_LIGHT",uniformTemplates:{ambientLightColor:{type:"3f",value:function(e){var t=e.color,r=e.intensity;return[t[0]*r,t[1]*r,t[2]*r]}}}});t.a=n},function(e,t,r){"use strict";var n=r(24),i=r(3),a=n.a.extend({shadowBias:.001,shadowSlopeScale:2,shadowCascade:1,cascadeSplitLogFactor:.2},{type:"DIRECTIONAL_LIGHT",uniformTemplates:{directionalLightDirection:{type:"3f",value:function(e){return e.__dir=e.__dir||new i.a,e.__dir.copy(e.worldTransform.z).normalize().negate().array}},directionalLightColor:{type:"3f",value:function(e){var t=e.color,r=e.intensity;return[t[0]*r,t[1]*r,t[2]*r]}}},clone:function(){var e=n.a.prototype.clone.call(this);return e.shadowBias=this.shadowBias,e.shadowSlopeScale=this.shadowSlopeScale,e}});t.a=a},function(e,t,r){"use strict";var n=r(24),i=n.a.extend({range:100,castShadow:!1},{type:"POINT_LIGHT",uniformTemplates:{pointLightPosition:{type:"3f",value:function(e){return e.getWorldPosition().array}},pointLightRange:{type:"1f",value:function(e){return e.range}},pointLightColor:{type:"3f",value:function(e){var t=e.color,r=e.intensity;return[t[0]*r,t[1]*r,t[2]*r]}}},clone:function(){var e=n.a.prototype.clone.call(this);return e.range=this.range,e}});t.a=i},function(e,t,r){"use strict";var n=r(24),i=r(3),a=n.a.extend({range:20,umbraAngle:30,penumbraAngle:45,falloffFactor:2,shadowBias:.001,shadowSlopeScale:2},{type:"SPOT_LIGHT",uniformTemplates:{spotLightPosition:{type:"3f",value:function(e){return e.getWorldPosition().array}},spotLightRange:{type:"1f",value:function(e){return e.range}},spotLightUmbraAngleCosine:{type:"1f",value:function(e){return Math.cos(e.umbraAngle*Math.PI/180)}},spotLightPenumbraAngleCosine:{type:"1f",value:function(e){return Math.cos(e.penumbraAngle*Math.PI/180)}},spotLightFalloffFactor:{type:"1f",value:function(e){return e.falloffFactor}},spotLightDirection:{type:"3f",value:function(e){return e.__dir=e.__dir||new i.a,e.__dir.copy(e.worldTransform.z).negate().array}},spotLightColor:{type:"3f",value:function(e){var t=e.color,r=e.intensity;return[t[0]*r,t[1]*r,t[2]*r]}}},clone:function(){var e=n.a.prototype.clone.call(this);return e.range=this.range,e.umbraAngle=this.umbraAngle,e.penumbraAngle=this.penumbraAngle,e.falloffFactor=this.falloffFactor,e.shadowBias=this.shadowBias,e.shadowSlopeScale=this.shadowSlopeScale,e}});t.a=a},function(e,t,r){"use strict";function n(e,t,r,n){e=e||0,t=t||0,r=r||0,n=n||0,this.array=a.a.fromValues(e,t,r,n),this._dirty=!0}var a=r(33);n.prototype={constructor:n,add:function(e){return a.a.add(this.array,this.array,e.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)},copy:function(e){return a.a.copy(this.array,e.array),this._dirty=!0,this},dist:function(e){return a.a.dist(this.array,e.array)},distance:function(e){return a.a.distance(this.array,e.array)},div:function(e){return a.a.div(this.array,this.array,e.array),this._dirty=!0,this},divide:function(e){return a.a.divide(this.array,this.array,e.array),this._dirty=!0,this},dot:function(e){return a.a.dot(this.array,e.array)},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},min:function(e){return a.a.min(this.array,this.array,e.array),this._dirty=!0,this},max:function(e){return a.a.max(this.array,this.array,e.array),this._dirty=!0,this},mul:function(e){return a.a.mul(this.array,this.array,e.array),this._dirty=!0,this},multiply:function(e){return a.a.multiply(this.array,this.array,e.array),this._dirty=!0,this},negate:function(){return a.a.negate(this.array,this.array),this._dirty=!0,this},normalize:function(){return a.a.normalize(this.array,this.array),this._dirty=!0,this},random:function(e){return a.a.random(this.array,e),this._dirty=!0,this},scale:function(e){return a.a.scale(this.array,this.array,e),this._dirty=!0,this},scaleAndAdd:function(e,t){return a.a.scaleAndAdd(this.array,this.array,e.array,t),this._dirty=!0,this},sqrDist:function(e){return a.a.sqrDist(this.array,e.array)},squaredDistance:function(e){return a.a.squaredDistance(this.array,e.array)},sqrLen:function(){return a.a.sqrLen(this.array)},squaredLength:function(){return a.a.squaredLength(this.array)},sub:function(e){return a.a.sub(this.array,this.array,e.array),this._dirty=!0,this},subtract:function(e){return a.a.subtract(this.array,this.array,e.array),this._dirty=!0,this},transformMat4:function(e){return a.a.transformMat4(this.array,this.array,e.array),this._dirty=!0,this},transformQuat:function(e){return a.a.transformQuat(this.array,this.array,e.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var i,o=Object.defineProperty;o&&(o(i=n.prototype,"x",{get:function(){return this.array[0]},set:function(e){this.array[0]=e,this._dirty=!0}}),o(i,"y",{get:function(){return this.array[1]},set:function(e){this.array[1]=e,this._dirty=!0}}),o(i,"z",{get:function(){return this.array[2]},set:function(e){this.array[2]=e,this._dirty=!0}}),o(i,"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.distance=n.dist=function(e,t){return a.a.distance(e.array,t.array)},n.divide=n.div=function(e,t,r){return a.a.divide(e.array,t.array,r.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.min=function(e,t,r){return a.a.min(e.array,t.array,r.array),e._dirty=!0,e},n.max=function(e,t,r){return a.a.max(e.array,t.array,r.array),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.negate=function(e,t){return a.a.negate(e.array,t.array),e._dirty=!0,e},n.normalize=function(e,t){return a.a.normalize(e.array,t.array),e._dirty=!0,e},n.random=function(e,t){return a.a.random(e.array,t),e._dirty=!0,e},n.scale=function(e,t,r){return a.a.scale(e.array,t.array,r),e._dirty=!0,e},n.scaleAndAdd=function(e,t,r,n){return a.a.scaleAndAdd(e.array,t.array,r.array,n),e._dirty=!0,e},n.squaredDistance=n.sqrDist=function(e,t){return a.a.sqrDist(e.array,t.array)},n.squaredLength=n.sqrLen=function(e){return a.a.sqrLen(e.array)},n.subtract=n.sub=function(e,t,r){return a.a.subtract(e.array,t.array,r.array),e._dirty=!0,e},n.transformMat4=function(e,t,r){return a.a.transformMat4(e.array,t.array,r.array),e._dirty=!0,e},n.transformQuat=function(e,t,r){return a.a.transformQuat(e.array,t.array,r.array),e._dirty=!0,e},t.a=n},function(e,t,r){"use strict";function n(){this.array=i.a.create(),this._dirty=!0}var i=r(78);n.prototype={constructor:n,setArray:function(e){for(var t=0;t<this.array.length;t++)this.array[t]=e[t];return this._dirty=!0,this},clone:function(){return(new n).copy(this)},copy:function(e){return i.a.copy(this.array,e.array),this._dirty=!0,this},adjoint:function(){return i.a.adjoint(this.array,this.array),this._dirty=!0,this},determinant:function(){return i.a.determinant(this.array)},identity:function(){return i.a.identity(this.array),this._dirty=!0,this},invert:function(){return i.a.invert(this.array,this.array),this._dirty=!0,this},mul:function(e){return i.a.mul(this.array,this.array,e.array),this._dirty=!0,this},mulLeft:function(e){return i.a.mul(this.array,e.array,this.array),this._dirty=!0,this},multiply:function(e){return i.a.multiply(this.array,this.array,e.array),this._dirty=!0,this},multiplyLeft:function(e){return i.a.multiply(this.array,e.array,this.array),this._dirty=!0,this},rotate:function(e){return i.a.rotate(this.array,this.array,e),this._dirty=!0,this},scale:function(e){return i.a.scale(this.array,this.array,e.array),this._dirty=!0,this},transpose:function(){return i.a.transpose(this.array,this.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}},n.adjoint=function(e,t){return i.a.adjoint(e.array,t.array),e._dirty=!0,e},n.copy=function(e,t){return i.a.copy(e.array,t.array),e._dirty=!0,e},n.determinant=function(e){return i.a.determinant(e.array)},n.identity=function(e){return i.a.identity(e.array),e._dirty=!0,e},n.invert=function(e,t){return i.a.invert(e.array,t.array),e._dirty=!0,e},n.multiply=n.mul=function(e,t,r){return i.a.mul(e.array,t.array,r.array),e._dirty=!0,e},n.rotate=function(e,t,r){return i.a.rotate(e.array,t.array,r),e._dirty=!0,e},n.scale=function(e,t,r){return i.a.scale(e.array,t.array,r.array),e._dirty=!0,e},n.transpose=function(e,t){return i.a.transpose(e.array,t.array),e._dirty=!0,e},t.a=n},function(e,t,r){"use strict";function n(){this.array=i.a.create(),this._dirty=!0}var i=r(79);n.prototype={constructor:n,setArray:function(e){for(var t=0;t<this.array.length;t++)this.array[t]=e[t];return this._dirty=!0,this},clone:function(){return(new n).copy(this)},copy:function(e){return i.a.copy(this.array,e.array),this._dirty=!0,this},determinant:function(){return i.a.determinant(this.array)},identity:function(){return i.a.identity(this.array),this._dirty=!0,this},invert:function(){return i.a.invert(this.array,this.array),this._dirty=!0,this},mul:function(e){return i.a.mul(this.array,this.array,e.array),this._dirty=!0,this},mulLeft:function(e){return i.a.mul(this.array,e.array,this.array),this._dirty=!0,this},multiply:function(e){return i.a.multiply(this.array,this.array,e.array),this._dirty=!0,this},multiplyLeft:function(e){return i.a.multiply(this.array,e.array,this.array),this._dirty=!0,this},rotate:function(e){return i.a.rotate(this.array,this.array,e),this._dirty=!0,this},scale:function(e){return i.a.scale(this.array,this.array,e.array),this._dirty=!0,this},translate:function(e){return i.a.translate(this.array,this.array,e.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}},n.copy=function(e,t){return i.a.copy(e.array,t.array),e._dirty=!0,e},n.determinant=function(e){return i.a.determinant(e.array)},n.identity=function(e){return i.a.identity(e.array),e._dirty=!0,e},n.invert=function(e,t){return i.a.invert(e.array,t.array),e._dirty=!0,e},n.multiply=n.mul=function(e,t,r){return i.a.mul(e.array,t.array,r.array),e._dirty=!0,e},n.rotate=function(e,t,r){return i.a.rotate(e.array,t.array,r),e._dirty=!0,e},n.scale=function(e,t,r){return i.a.scale(e.array,t.array,r.array),e._dirty=!0,e},n.translate=function(e,t,r){return i.a.translate(e.array,t.array,r.array),e._dirty=!0,e},t.a=n},function(e,t,r){"use strict";function n(){this.array=i.a.create(),this._dirty=!0}var i=r(34);n.prototype={constructor:n,setArray:function(e){for(var t=0;t<this.array.length;t++)this.array[t]=e[t];return this._dirty=!0,this},adjoint:function(){return i.a.adjoint(this.array,this.array),this._dirty=!0,this},clone:function(){return(new n).copy(this)},copy:function(e){return i.a.copy(this.array,e.array),this._dirty=!0,this},determinant:function(){return i.a.determinant(this.array)},fromMat2d:function(e){return i.a.fromMat2d(this.array,e.array),this._dirty=!0,this},fromMat4:function(e){return i.a.fromMat4(this.array,e.array),this._dirty=!0,this},fromQuat:function(e){return i.a.fromQuat(this.array,e.array),this._dirty=!0,this},identity:function(){return i.a.identity(this.array),this._dirty=!0,this},invert:function(){return i.a.invert(this.array,this.array),this._dirty=!0,this},mul:function(e){return i.a.mul(this.array,this.array,e.array),this._dirty=!0,this},mulLeft:function(e){return i.a.mul(this.array,e.array,this.array),this._dirty=!0,this},multiply:function(e){return i.a.multiply(this.array,this.array,e.array),this._dirty=!0,this},multiplyLeft:function(e){return i.a.multiply(this.array,e.array,this.array),this._dirty=!0,this},rotate:function(e){return i.a.rotate(this.array,this.array,e),this._dirty=!0,this},scale:function(e){return i.a.scale(this.array,this.array,e.array),this._dirty=!0,this},translate:function(e){return i.a.translate(this.array,this.array,e.array),this._dirty=!0,this},normalFromMat4:function(e){return i.a.normalFromMat4(this.array,e.array),this._dirty=!0,this},transpose:function(){return i.a.transpose(this.array,this.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}},n.adjoint=function(e,t){return i.a.adjoint(e.array,t.array),e._dirty=!0,e},n.copy=function(e,t){return i.a.copy(e.array,t.array),e._dirty=!0,e},n.determinant=function(e){return i.a.determinant(e.array)},n.identity=function(e){return i.a.identity(e.array),e._dirty=!0,e},n.invert=function(e,t){return i.a.invert(e.array,t.array),e},n.multiply=n.mul=function(e,t,r){return i.a.mul(e.array,t.array,r.array),e._dirty=!0,e},n.fromMat2d=function(e,t){return i.a.fromMat2d(e.array,t.array),e._dirty=!0,e},n.fromMat4=function(e,t){return i.a.fromMat4(e.array,t.array),e._dirty=!0,e},n.fromQuat=function(e,t){return i.a.fromQuat(e.array,t.array),e._dirty=!0,e},n.normalFromMat4=function(e,t){return i.a.normalFromMat4(e.array,t.array),e._dirty=!0,e},n.rotate=function(e,t,r){return i.a.rotate(e.array,t.array,r),e._dirty=!0,e},n.scale=function(e,t,r){return i.a.scale(e.array,t.array,r.array),e._dirty=!0,e},n.transpose=function(e,t){return i.a.transpose(e.array,t.array),e._dirty=!0,e},n.translate=function(e,t,r){return i.a.translate(e.array,t.array,r.array),e._dirty=!0,e},t.a=n},function(e,t,r){"use strict";var n=r(142),h=r.n(n),i={_animators:null,getAnimators:function(){return this._animators=this._animators||[],this._animators},animate:function(e,t){this._animators=this._animators||[];var r;if(e){for(var n=e.split("."),i=this,a=0,o=n.length;a<o;a++)i=i&&i[n[a]];i&&(r=i)}else r=this;if(null==r)throw new Error("Target "+e+" not exists");var s=this._animators,u=new h.a(r,t),l=this;return u.during(function(){l.__zr&&l.__zr.refresh()}).done(function(){var e=s.indexOf(u);0<=e&&s.splice(e,1)}),s.push(u),this.__zr&&this.__zr.animation.addAnimator(u),u},stopAnimation:function(e){this._animators=this._animators||[];for(var t=this._animators,r=t.length,n=0;n<r;n++)t[n].stop(e);return t.length=0,this},addAnimatorsToZr:function(e){if(this._animators)for(var t=0;t<this._animators.length;t++)e.animation.addAnimator(this._animators[t])},removeAnimatorsFromZr:function(e){if(this._animators)for(var t=0;t<this._animators.length;t++)e.animation.removeAnimator(this._animators[t])}};t.a=i},function(e,t,r){function i(e,t){return e[t]}function a(e,t,r){e[t]=r}function O(e,t,r){return(t-e)*r+e}function F(e,t,r){return.5<r?t:e}function B(e,t,r,n,i){var a=e.length;if(1==i)for(var o=0;o<a;o++)n[o]=O(e[o],t[o],r);else for(var s=a&&e[0].length,o=0;o<a;o++)for(var u=0;u<s;u++)n[o][u]=O(e[o][u],t[o][u],r)}function U(e,t,r){var n=e.length,i=t.length;if(n!==i)if(i<n)e.length=i;else for(var a=n;a<i;a++)e.push(1===r?t[a]:u.call(t[a]));for(var o=e[0]&&e[0].length,a=0;a<e.length;a++)if(1===r)isNaN(e[a])&&(e[a]=t[a]);else for(var s=0;s<o;s++)isNaN(e[a][s])&&(e[a][s]=t[a][s])}function z(e,t,r,n,i,a,o,s,u){var l=e.length;if(1==u)for(var h=0;h<l;h++)s[h]=G(e[h],t[h],r[h],n[h],i,a,o);else for(var c=e[0].length,h=0;h<l;h++)for(var d=0;d<c;d++)s[h][d]=G(e[h][d],t[h][d],r[h][d],n[h][d],i,a,o)}function G(e,t,r,n,i,a,o){var s=.5*(r-e),u=.5*(n-t);return(2*(t-r)+s+u)*o+(-3*(t-r)-2*s-u)*a+s*i+t}function H(e){return e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.floor(e[2]),"rgba("+e.join(",")+")"}function l(e,t,r,n,a,i){var o,s,u=e._getter,l=e._setter,h="spline"===t,c=n.length;if(c){var d,f=n[0].value,p=W(f),m=!1,g=!1,_=p?(s=(o=n)[o.length-1].value,W(s&&s[0])?2:1):0;n.sort(function(e,t){return e.time-t.time}),d=n[c-1].time;for(var v=[],y=[],x=n[0].value,T=!0,b=0;b<c;b++){v.push(n[b].time/d);var w,E=n[b].value;p&&function(e,t,r){if(e===t)return 1;var n=e.length;if(n===t.length){if(1===r){for(var i=0;i<n;i++)if(e[i]!==t[i])return}else for(var a=e[0].length,i=0;i<n;i++)for(var o=0;o<a;o++)if(e[i][o]!==t[i][o])return;return 1}}(E,x,_)||!p&&E===x||(T=!1),"string"==typeof(x=E)&&((w=k.parse(E))?(E=w,m=!0):g=!0),y.push(E)}if(i||!T){for(var S=y[c-1],b=0;b<c-1;b++)p?U(y[b],S,_):!isNaN(y[b])||isNaN(S)||g||m||(y[b]=S);p&&U(u(e._target,a),S,_);var A,M,C,L,D,N,R=0,P=0;m&&(N=[0,0,0,0]);var I=new V({target:e._target,life:d,loop:e._loop,delay:e._delay,onframe:function(e,t){var r;if(t<0)r=0;else if(t<P){for(r=Math.min(R+1,c-1);0<=r&&!(v[r]<=t);r--);r=Math.min(r,c-2)}else{for(r=R;r<c&&!(v[r]>t);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<r?c-1:r+1],D=y[c-3<r?c-1:r+2],p)z(M,C,L,D,A,A*A,A*A*A,u(e,a),_);else{if(m)n=z(M,C,L,D,A,A*A,A*A*A,N,1),n=H(N);else{if(g)return.5<A?L:C;n=G(M,C,L,D,A,A*A,A*A*A)}l(e,a,n)}else if(p)B(y[r],y[r+1],A,u(e,a),_);else{if(m)B(y[r],y[r+1],A,N,1),n=H(N);else{if(g)return F(y[r],y[r+1],A);n=O(y[r],y[r+1],A)}l(e,a,n)}},ondestroy:r});return t&&"spline"!==t&&(I.easing=t),I}}}function n(e,t,r,n){this._tracks={},this._target=e,this._loop=t||!1,this._getter=r||i,this._setter=n||a,this._clipCount=0,this._delay=0,this._doneList=[],this._onframeList=[],this._clipList=[]}var V=r(143),k=r(145),W=r(13).isArrayLike,u=Array.prototype.slice;n.prototype={when:function(e,t){var r,n=this._tracks;for(r in t)if(t.hasOwnProperty(r)){if(!n[r]){n[r]=[];var i=this._getter(this._target,r);if(null==i)continue;0!==e&&n[r].push({time:0,value:function(e){if(W(e)){var t=e.length;if(W(e[0])){for(var r=[],n=0;n<t;n++)r.push(u.call(e[n]));return r}return u.call(e)}return e}(i)})}n[r].push({time:e,value:t[r]})}return this},during:function(e){return this._onframeList.push(e),this},pause:function(){for(var e=0;e<this._clipList.length;e++)this._clipList[e].pause();this._paused=!0},resume:function(){for(var e=0;e<this._clipList.length;e++)this._clipList[e].resume();this._paused=!1},isPaused:function(){return!!this._paused},_doneCallback:function(){this._tracks={},this._clipList.length=0;for(var e=this._doneList,t=e.length,r=0;r<t;r++)e[r].call(this)},start:function(e,t){function r(){--u||s._doneCallback()}var n,i,a,o,s=this,u=0;for(i in this._tracks){!this._tracks.hasOwnProperty(i)||(a=l(this,e,r,this._tracks[i],i,t))&&(this._clipList.push(a),u++,this.animation&&this.animation.addClip(a),n=a)}return n&&(o=n.onframe,n.onframe=function(e,t){o(e,t);for(var r=0;r<s._onframeList.length;r++)s._onframeList[r](e,t)}),u||this._doneCallback(),this},stop:function(e){for(var t=this._clipList,r=this.animation,n=0;n<t.length;n++){var i=t[n];e&&i.onframe(this._target,1),r&&r.removeClip(i)}t.length=0},delay:function(e){return this._delay=e,this},done:function(e){return e&&this._doneList.push(e),this},getClips:function(){return this._clipList}},e.exports=n},function(e,t,r){function n(e){this._target=e.target,this._life=e.life||1e3,this._delay=e.delay||0,this._initialized=!1,this.loop=null!=e.loop&&e.loop,this.gap=e.gap||0,this.easing=e.easing||"Linear",this.onframe=e.onframe,this.ondestroy=e.ondestroy,this.onrestart=e.onrestart,this._pausedTime=0,this._paused=!1}var o=r(144);n.prototype={constructor:n,step:function(e,t){if(this._initialized||(this._startTime=e+this._delay,this._initialized=!0),this._paused)this._pausedTime+=t;else{var r=(e-this._startTime-this._pausedTime)/this._life;if(!(r<0)){r=Math.min(r,1);var n=this.easing,i="string"==typeof n?o[n]:n,a="function"==typeof i?i(r):r;return this.fire("frame",a),1==r?this.loop?(this.restart(e),"restart"):(this._needsRemove=!0,"destroy"):null}}},restart:function(e){var t=(e-this._startTime-this._pausedTime)%this._life;this._startTime=e-t+this.gap,this._pausedTime=0,this._needsRemove=!1},fire:function(e,t){this[e="on"+e]&&this[e](this._target,t)},pause:function(){this._paused=!0},resume:function(){this._paused=!1}};e.exports=n},function(e,t){var r={linear:function(e){return e},quadraticIn:function(e){return e*e},quadraticOut:function(e){return e*(2-e)},quadraticInOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},cubicIn:function(e){return e*e*e},cubicOut:function(e){return--e*e*e+1},cubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},quarticIn:function(e){return e*e*e*e},quarticOut:function(e){return 1- --e*e*e*e},quarticInOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},quinticIn:function(e){return e*e*e*e*e},quinticOut:function(e){return--e*e*e*e*e+1},quinticInOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},sinusoidalIn:function(e){return 1-Math.cos(e*Math.PI/2)},sinusoidalOut:function(e){return Math.sin(e*Math.PI/2)},sinusoidalInOut:function(e){return.5*(1-Math.cos(Math.PI*e))},exponentialIn:function(e){return 0===e?0:Math.pow(1024,e-1)},exponentialOut:function(e){return 1===e?1:1-Math.pow(2,-10*e)},exponentialInOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(2-Math.pow(2,-10*(e-1)))},circularIn:function(e){return 1-Math.sqrt(1-e*e)},circularOut:function(e){return Math.sqrt(1- --e*e)},circularInOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},elasticIn:function(e){var t,r=.1;return 0===e?0:1===e?1:(t=!r||r<1?(r=1,.1):.4*Math.asin(1/r)/(2*Math.PI),-r*Math.pow(2,10*--e)*Math.sin((e-t)*(2*Math.PI)/.4))},elasticOut:function(e){var t,r=.1;return 0===e?0:1===e?1:(t=!r||r<1?(r=1,.1):.4*Math.asin(1/r)/(2*Math.PI),r*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/.4)+1)},elasticInOut:function(e){var t,r=.1;return 0===e?0:1===e?1:(t=!r||r<1?(r=1,.1):.4*Math.asin(1/r)/(2*Math.PI),(e*=2)<1?r*Math.pow(2,10*--e)*Math.sin((e-t)*(2*Math.PI)/.4)*-.5:r*Math.pow(2,-10*--e)*Math.sin((e-t)*(2*Math.PI)/.4)*.5+1)},backIn:function(e){return e*e*(2.70158*e-1.70158)},backOut:function(e){return--e*e*(2.70158*e+1.70158)+1},backInOut:function(e){var t=2.5949095;return(e*=2)<1?e*e*((1+t)*e-t)*.5:.5*((e-=2)*e*((1+t)*e+t)+2)},bounceIn:function(e){return 1-r.bounceOut(1-e)},bounceOut:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},bounceInOut:function(e){return e<.5?.5*r.bounceIn(2*e):.5*r.bounceOut(2*e-1)+.5}};e.exports=r},function(e,t,r){function h(e){return(e=Math.round(e))<0?0:255<e?255:e}function c(e){return e<0?0:1<e?1:e}function d(e){return h(e.length&&"%"===e.charAt(e.length-1)?parseFloat(e)/100*255:parseInt(e,10))}function f(e){return c(e.length&&"%"===e.charAt(e.length-1)?parseFloat(e)/100:parseFloat(e))}function s(e,t,r){return r<0?r+=1:1<r&&--r,6*r<1?e+(t-e)*r*6:2*r<1?t:3*r<2?e+(t-e)*(2/3-r)*6:e}function p(e,t,r){return e+(t-e)*r}function m(e,t,r,n,i){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e}function g(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function _(e,t){o&&g(o,t),o=b.put(e,o||t.slice())}function v(e,t){if(e){t=t||[];var r=b.get(e);if(r)return g(t,r);var n,i=(e+="").replace(/ /g,"").toLowerCase();if(i in T)return g(t,T[i]),_(e,t),t;if("#"!==i.charAt(0)){var a=i.indexOf("("),o=i.indexOf(")");if(-1!==a&&o+1===i.length){var s=i.substr(0,a),u=i.substr(a+1,o-(a+1)).split(","),l=1;switch(s){case"rgba":if(4!==u.length)return void m(t,0,0,0,1);l=f(u.pop());case"rgb":return 3!==u.length?void m(t,0,0,0,1):(m(t,d(u[0]),d(u[1]),d(u[2]),l),_(e,t),t);case"hsla":return 4!==u.length?void m(t,0,0,0,1):(u[3]=f(u[3]),y(u,t),_(e,t),t);case"hsl":return 3!==u.length?void m(t,0,0,0,1):(y(u,t),_(e,t),t);default:return}}m(t,0,0,0,1)}else{if(4===i.length)return 0<=(n=parseInt(i.substr(1),16))&&n<=4095?(m(t,(3840&n)>>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,255<r[n]?r[n]=255:e[n]<0&&(r[n]=0);return x(r,4===r.length?"rgba":"rgb")}},t.toHex=function(e){var t=v(e);if(t)return((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1)},t.fastLerp=n,t.fastMapToColor=u,t.lerp=i,t.mapToColor=l,t.modifyHSL=function(e,t,r,n){if(e=v(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),1<t&&--t);var f=[360*t,r,d];return null!=e[3]&&f.push(e[3]),f}}(e),null!=t&&(e[0]=(i=t,(i=Math.round(i))<0?0:360<i?360:i)),null!=r&&(e[1]=f(r)),null!=n&&(e[2]=f(n)),x(y(e),"rgba");var i},t.modifyAlpha=function(e,t){if((e=v(e))&&null!=t)return e[3]=c(t),x(e,"rgba")},t.stringify=x},function(e,t,r){"use strict";t.a="\n@export clay.util.rand\nhighp float rand(vec2 uv) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot(uv.xy, vec2(a,b)), sn = mod(dt, 3.141592653589793);\n return fract(sin(sn) * c);\n}\n@end\n@export clay.util.calculate_attenuation\nuniform float attenuationFactor : 5.0;\nfloat lightAttenuation(float dist, float range)\n{\n float attenuation = 1.0;\n attenuation = dist*dist/(range*range+1.0);\n float att_s = attenuationFactor;\n attenuation = 1.0/(attenuation*att_s+1.0);\n att_s = 1.0/(att_s+1.0);\n attenuation = attenuation - att_s;\n attenuation /= 1.0 - att_s;\n return clamp(attenuation, 0.0, 1.0);\n}\n@end\n@export clay.util.edge_factor\n#ifdef SUPPORT_STANDARD_DERIVATIVES\nfloat edgeFactor(float width)\n{\n vec3 d = fwidth(v_Barycentric);\n vec3 a3 = smoothstep(vec3(0.0), d * width, v_Barycentric);\n return min(min(a3.x, a3.y), a3.z);\n}\n#else\nfloat edgeFactor(float width)\n{\n return 1.0;\n}\n#endif\n@end\n@export clay.util.encode_float\nvec4 encodeFloat(const in float depth)\n{\n const vec4 bitShifts = vec4(256.0*256.0*256.0, 256.0*256.0, 256.0, 1.0);\n const vec4 bit_mask = vec4(0.0, 1.0/256.0, 1.0/256.0, 1.0/256.0);\n vec4 res = fract(depth * bitShifts);\n res -= res.xxyz * bit_mask;\n return res;\n}\n@end\n@export clay.util.decode_float\nfloat decodeFloat(const in vec4 color)\n{\n const vec4 bitShifts = vec4(1.0/(256.0*256.0*256.0), 1.0/(256.0*256.0), 1.0/256.0, 1.0);\n return dot(color, bitShifts);\n}\n@end\n@export clay.util.float\n@import clay.util.encode_float\n@import clay.util.decode_float\n@end\n@export clay.util.rgbm_decode\nvec3 RGBMDecode(vec4 rgbm, float range) {\n return range * rgbm.rgb * rgbm.a;\n}\n@end\n@export clay.util.rgbm_encode\nvec4 RGBMEncode(vec3 color, float range) {\n if (dot(color, color) == 0.0) {\n return vec4(0.0);\n }\n vec4 rgbm;\n color /= range;\n rgbm.a = clamp(max(max(color.r, color.g), max(color.b, 1e-6)), 0.0, 1.0);\n rgbm.a = ceil(rgbm.a * 255.0) / 255.0;\n rgbm.rgb = color / rgbm.a;\n return rgbm;\n}\n@end\n@export clay.util.rgbm\n@import clay.util.rgbm_decode\n@import clay.util.rgbm_encode\nvec4 decodeHDR(vec4 color)\n{\n#if defined(RGBM_DECODE) || defined(RGBM)\n return vec4(RGBMDecode(color, 8.12), 1.0);\n#else\n return color;\n#endif\n}\nvec4 encodeHDR(vec4 color)\n{\n#if defined(RGBM_ENCODE) || defined(RGBM)\n return RGBMEncode(color.xyz, 8.12);\n#else\n return color;\n#endif\n}\n@end\n@export clay.util.srgb\nvec4 sRGBToLinear(in vec4 value) {\n return vec4(mix(pow(value.rgb * 0.9478672986 + vec3(0.0521327014), vec3(2.4)), value.rgb * 0.0773993808, vec3(lessThanEqual(value.rgb, vec3(0.04045)))), value.w);\n}\nvec4 linearTosRGB(in vec4 value) {\n return vec4(mix(pow(value.rgb, vec3(0.41666)) * 1.055 - vec3(0.055), value.rgb * 12.92, vec3(lessThanEqual(value.rgb, vec3(0.0031308)))), value.w);\n}\n@end\n@export clay.chunk.skinning_header\n#ifdef SKINNING\nattribute vec3 weight : WEIGHT;\nattribute vec4 joint : JOINT;\n#ifdef USE_SKIN_MATRICES_TEXTURE\nuniform sampler2D skinMatricesTexture : ignore;\nuniform float skinMatricesTextureSize: ignore;\nmat4 getSkinMatrix(sampler2D tex, float idx) {\n float j = idx * 4.0;\n float x = mod(j, skinMatricesTextureSize);\n float y = floor(j / skinMatricesTextureSize) + 0.5;\n vec2 scale = vec2(skinMatricesTextureSize);\n return mat4(\n texture2D(tex, vec2(x + 0.5, y) / scale),\n texture2D(tex, vec2(x + 1.5, y) / scale),\n texture2D(tex, vec2(x + 2.5, y) / scale),\n texture2D(tex, vec2(x + 3.5, y) / scale)\n );\n}\nmat4 getSkinMatrix(float idx) {\n return getSkinMatrix(skinMatricesTexture, idx);\n}\n#else\nuniform mat4 skinMatrix[JOINT_COUNT] : SKIN_MATRIX;\nmat4 getSkinMatrix(float idx) {\n return skinMatrix[int(idx)];\n}\n#endif\n#endif\n@end\n@export clay.chunk.skin_matrix\nmat4 skinMatrixWS = getSkinMatrix(joint.x) * weight.x;\nif (weight.y > 1e-4)\n{\n skinMatrixWS += getSkinMatrix(joint.y) * weight.y;\n}\nif (weight.z > 1e-4)\n{\n skinMatrixWS += getSkinMatrix(joint.z) * weight.z;\n}\nfloat weightW = 1.0-weight.x-weight.y-weight.z;\nif (weightW > 1e-4)\n{\n skinMatrixWS += getSkinMatrix(joint.w) * weightW;\n}\n@end\n@export clay.util.parallax_correct\nvec3 parallaxCorrect(in vec3 dir, in vec3 pos, in vec3 boxMin, in vec3 boxMax) {\n vec3 first = (boxMax - pos) / dir;\n vec3 second = (boxMin - pos) / dir;\n vec3 further = max(first, second);\n float dist = min(further.x, min(further.y, further.z));\n vec3 fixedPos = pos + dir * dist;\n vec3 boxCenter = (boxMax + boxMin) * 0.5;\n return normalize(fixedPos - boxCenter);\n}\n@end\n@export clay.util.clamp_sample\nvec4 clampSample(const in sampler2D texture, const in vec2 coord)\n{\n#ifdef STEREO\n float eye = step(0.5, coord.x) * 0.5;\n vec2 coordClamped = clamp(coord, vec2(eye, 0.0), vec2(0.5 + eye, 1.0));\n#else\n vec2 coordClamped = clamp(coord, vec2(0.0), vec2(1.0));\n#endif\n return texture2D(texture, coordClamped);\n}\n@end\n@export clay.util.ACES\nvec3 ACESToneMapping(vec3 color)\n{\n const float A = 2.51;\n const float B = 0.03;\n const float C = 2.43;\n const float D = 0.59;\n const float E = 0.14;\n return (color * (A * color + B)) / (color * (C * color + D) + E);\n}\n@end"},function(e,t,r){"use strict";t.a="\n@export ecgl.common.transformUniforms\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform mat4 worldInverseTranspose : WORLDINVERSETRANSPOSE;\nuniform mat4 world : WORLD;\n@end\n\n@export ecgl.common.attributes\nattribute vec3 position : POSITION;\nattribute vec2 texcoord : TEXCOORD_0;\nattribute vec3 normal : NORMAL;\n@end\n\n@export ecgl.common.uv.header\nuniform vec2 uvRepeat : [1.0, 1.0];\nuniform vec2 uvOffset : [0.0, 0.0];\nuniform vec2 detailUvRepeat : [1.0, 1.0];\nuniform vec2 detailUvOffset : [0.0, 0.0];\n\nvarying vec2 v_Texcoord;\nvarying vec2 v_DetailTexcoord;\n@end\n\n@export ecgl.common.uv.main\nv_Texcoord = texcoord * uvRepeat + uvOffset;\nv_DetailTexcoord = texcoord * detailUvRepeat + detailUvOffset;\n@end\n\n@export ecgl.common.uv.fragmentHeader\nvarying vec2 v_Texcoord;\nvarying vec2 v_DetailTexcoord;\n@end\n\n\n@export ecgl.common.albedo.main\n\n vec4 albedoTexel = vec4(1.0);\n#ifdef DIFFUSEMAP_ENABLED\n albedoTexel = texture2D(diffuseMap, v_Texcoord);\n #ifdef SRGB_DECODE\n albedoTexel = sRGBToLinear(albedoTexel);\n #endif\n#endif\n\n#ifdef DETAILMAP_ENABLED\n vec4 detailTexel = texture2D(detailMap, v_DetailTexcoord);\n #ifdef SRGB_DECODE\n detailTexel = sRGBToLinear(detailTexel);\n #endif\n albedoTexel.rgb = mix(albedoTexel.rgb, detailTexel.rgb, detailTexel.a);\n albedoTexel.a = detailTexel.a + (1.0 - detailTexel.a) * albedoTexel.a;\n#endif\n\n@end\n\n@export ecgl.common.wireframe.vertexHeader\n\n#ifdef WIREFRAME_QUAD\nattribute vec4 barycentric;\nvarying vec4 v_Barycentric;\n#elif defined(WIREFRAME_TRIANGLE)\nattribute vec3 barycentric;\nvarying vec3 v_Barycentric;\n#endif\n\n@end\n\n@export ecgl.common.wireframe.vertexMain\n\n#if defined(WIREFRAME_QUAD) || defined(WIREFRAME_TRIANGLE)\n v_Barycentric = barycentric;\n#endif\n\n@end\n\n\n@export ecgl.common.wireframe.fragmentHeader\n\nuniform float wireframeLineWidth : 1;\nuniform vec4 wireframeLineColor: [0, 0, 0, 0.5];\n\n#ifdef WIREFRAME_QUAD\nvarying vec4 v_Barycentric;\nfloat edgeFactor () {\n vec4 d = fwidth(v_Barycentric);\n vec4 a4 = smoothstep(vec4(0.0), d * wireframeLineWidth, v_Barycentric);\n return min(min(min(a4.x, a4.y), a4.z), a4.w);\n}\n#elif defined(WIREFRAME_TRIANGLE)\nvarying vec3 v_Barycentric;\nfloat edgeFactor () {\n vec3 d = fwidth(v_Barycentric);\n vec3 a3 = smoothstep(vec3(0.0), d * wireframeLineWidth, v_Barycentric);\n return min(min(a3.x, a3.y), a3.z);\n}\n#endif\n\n@end\n\n\n@export ecgl.common.wireframe.fragmentMain\n\n#if defined(WIREFRAME_QUAD) || defined(WIREFRAME_TRIANGLE)\n if (wireframeLineWidth > 0.) {\n vec4 lineColor = wireframeLineColor;\n#ifdef SRGB_DECODE\n lineColor = sRGBToLinear(lineColor);\n#endif\n\n gl_FragColor.rgb = mix(gl_FragColor.rgb, lineColor.rgb, (1.0 - edgeFactor()) * lineColor.a);\n }\n#endif\n@end\n\n\n\n\n@export ecgl.common.bumpMap.header\n\n#ifdef BUMPMAP_ENABLED\nuniform sampler2D bumpMap;\nuniform float bumpScale : 1.0;\n\n\nvec3 bumpNormal(vec3 surfPos, vec3 surfNormal, vec3 baseNormal)\n{\n vec2 dSTdx = dFdx(v_Texcoord);\n vec2 dSTdy = dFdy(v_Texcoord);\n\n float Hll = bumpScale * texture2D(bumpMap, v_Texcoord).x;\n float dHx = bumpScale * texture2D(bumpMap, v_Texcoord + dSTdx).x - Hll;\n float dHy = bumpScale * texture2D(bumpMap, v_Texcoord + dSTdy).x - Hll;\n\n vec3 vSigmaX = dFdx(surfPos);\n vec3 vSigmaY = dFdy(surfPos);\n vec3 vN = surfNormal;\n\n vec3 R1 = cross(vSigmaY, vN);\n vec3 R2 = cross(vN, vSigmaX);\n\n float fDet = dot(vSigmaX, R1);\n\n vec3 vGrad = sign(fDet) * (dHx * R1 + dHy * R2);\n return normalize(abs(fDet) * baseNormal - vGrad);\n\n}\n#endif\n\n@end\n\n@export ecgl.common.normalMap.vertexHeader\n\n#ifdef NORMALMAP_ENABLED\nattribute vec4 tangent : TANGENT;\nvarying vec3 v_Tangent;\nvarying vec3 v_Bitangent;\n#endif\n\n@end\n\n@export ecgl.common.normalMap.vertexMain\n\n#ifdef NORMALMAP_ENABLED\n if (dot(tangent, tangent) > 0.0) {\n v_Tangent = normalize((worldInverseTranspose * vec4(tangent.xyz, 0.0)).xyz);\n v_Bitangent = normalize(cross(v_Normal, v_Tangent) * tangent.w);\n }\n#endif\n\n@end\n\n\n@export ecgl.common.normalMap.fragmentHeader\n\n#ifdef NORMALMAP_ENABLED\nuniform sampler2D normalMap;\nvarying vec3 v_Tangent;\nvarying vec3 v_Bitangent;\n#endif\n\n@end\n\n@export ecgl.common.normalMap.fragmentMain\n#ifdef NORMALMAP_ENABLED\n if (dot(v_Tangent, v_Tangent) > 0.0) {\n vec3 normalTexel = texture2D(normalMap, v_DetailTexcoord).xyz;\n if (dot(normalTexel, normalTexel) > 0.0) { N = normalTexel * 2.0 - 1.0;\n mat3 tbn = mat3(v_Tangent, v_Bitangent, v_Normal);\n N = normalize(tbn * N);\n }\n }\n#endif\n@end\n\n\n\n@export ecgl.common.vertexAnimation.header\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nattribute vec3 prevNormal;\nuniform float percent;\n#endif\n\n@end\n\n@export ecgl.common.vertexAnimation.main\n\n#ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n vec3 norm = mix(prevNormal, normal, percent);\n#else\n vec3 pos = position;\n vec3 norm = normal;\n#endif\n\n@end\n\n\n@export ecgl.common.ssaoMap.header\n#ifdef SSAOMAP_ENABLED\nuniform sampler2D ssaoMap;\nuniform vec4 viewport : VIEWPORT;\n#endif\n@end\n\n@export ecgl.common.ssaoMap.main\n float ao = 1.0;\n#ifdef SSAOMAP_ENABLED\n ao = texture2D(ssaoMap, (gl_FragCoord.xy - viewport.xy) / viewport.zw).r;\n#endif\n@end\n\n\n\n\n@export ecgl.common.diffuseLayer.header\n\n#if (LAYER_DIFFUSEMAP_COUNT > 0)\nuniform float layerDiffuseIntensity[LAYER_DIFFUSEMAP_COUNT];\nuniform sampler2D layerDiffuseMap[LAYER_DIFFUSEMAP_COUNT];\n#endif\n\n@end\n\n@export ecgl.common.emissiveLayer.header\n\n#if (LAYER_EMISSIVEMAP_COUNT > 0)\nuniform float layerEmissionIntensity[LAYER_EMISSIVEMAP_COUNT];\nuniform sampler2D layerEmissiveMap[LAYER_EMISSIVEMAP_COUNT];\n#endif\n\n@end\n\n@export ecgl.common.layers.header\n@import ecgl.common.diffuseLayer.header\n@import ecgl.common.emissiveLayer.header\n@end\n\n@export ecgl.common.diffuseLayer.main\n\n#if (LAYER_DIFFUSEMAP_COUNT > 0)\n for (int _idx_ = 0; _idx_ < LAYER_DIFFUSEMAP_COUNT; _idx_++) {{\n float intensity = layerDiffuseIntensity[_idx_];\n vec4 texel2 = texture2D(layerDiffuseMap[_idx_], v_Texcoord);\n #ifdef SRGB_DECODE\n texel2 = sRGBToLinear(texel2);\n #endif\n albedoTexel.rgb = mix(albedoTexel.rgb, texel2.rgb * intensity, texel2.a);\n albedoTexel.a = texel2.a + (1.0 - texel2.a) * albedoTexel.a;\n }}\n#endif\n\n@end\n\n@export ecgl.common.emissiveLayer.main\n\n#if (LAYER_EMISSIVEMAP_COUNT > 0)\n for (int _idx_ = 0; _idx_ < LAYER_EMISSIVEMAP_COUNT; _idx_++)\n {{\n vec4 texel2 = texture2D(layerEmissiveMap[_idx_], v_Texcoord) * layerEmissionIntensity[_idx_];\n #ifdef SRGB_DECODE\n texel2 = sRGBToLinear(texel2);\n #endif\n float intensity = layerEmissionIntensity[_idx_];\n gl_FragColor.rgb += texel2.rgb * texel2.a * intensity;\n }}\n#endif\n\n@end\n"},function(e,t,r){"use strict";t.a="@export ecgl.color.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\n@import ecgl.common.uv.header\n\nattribute vec2 texcoord : TEXCOORD_0;\nattribute vec3 position: POSITION;\n\n@import ecgl.common.wireframe.vertexHeader\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nuniform float percent : 1.0;\n#endif\n\nvoid main()\n{\n#ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n#else\n vec3 pos = position;\n#endif\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n @import ecgl.common.uv.main\n\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n\n @import ecgl.common.wireframe.vertexMain\n\n}\n\n@end\n\n@export ecgl.color.fragment\n\n#define LAYER_DIFFUSEMAP_COUNT 0\n#define LAYER_EMISSIVEMAP_COUNT 0\n\nuniform sampler2D diffuseMap;\nuniform sampler2D detailMap;\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n@import ecgl.common.layers.header\n\n@import ecgl.common.uv.fragmentHeader\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.util.srgb\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color);\n#else\n gl_FragColor = color;\n#endif\n\n#ifdef VERTEX_COLOR\n gl_FragColor *= v_Color;\n#endif\n\n @import ecgl.common.albedo.main\n\n @import ecgl.common.diffuseLayer.main\n\n gl_FragColor *= albedoTexel;\n\n @import ecgl.common.emissiveLayer.main\n\n @import ecgl.common.wireframe.fragmentMain\n\n}\n@end"},function(e,t,r){"use strict";t.a="/**\n * http: */\n\n@export ecgl.lambert.vertex\n\n@import ecgl.common.transformUniforms\n\n@import ecgl.common.uv.header\n\n\n@import ecgl.common.attributes\n\n@import ecgl.common.wireframe.vertexHeader\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\n\n\n@import ecgl.common.vertexAnimation.header\n\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nvoid main()\n{\n @import ecgl.common.uv.main\n\n @import ecgl.common.vertexAnimation.main\n\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n v_Normal = normalize((worldInverseTranspose * vec4(norm, 0.0)).xyz);\n v_WorldPosition = (world * vec4(pos, 1.0)).xyz;\n\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n\n @import ecgl.common.wireframe.vertexMain\n}\n\n@end\n\n\n@export ecgl.lambert.fragment\n\n#define LAYER_DIFFUSEMAP_COUNT 0\n#define LAYER_EMISSIVEMAP_COUNT 0\n\n#define NORMAL_UP_AXIS 1\n#define NORMAL_FRONT_AXIS 2\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform sampler2D diffuseMap;\nuniform sampler2D detailMap;\n\n@import ecgl.common.layers.header\n\nuniform float emissionIntensity: 1.0;\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n#ifdef AMBIENT_LIGHT_COUNT\n@import clay.header.ambient_light\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n@import clay.header.ambient_sh_light\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n@import clay.header.directional_light\n#endif\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n\n@import ecgl.common.ssaoMap.header\n\n@import ecgl.common.bumpMap.header\n\n@import clay.util.srgb\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.plugin.compute_shadow_map\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color);\n#else\n gl_FragColor = color;\n#endif\n\n#ifdef VERTEX_COLOR\n #ifdef SRGB_DECODE\n gl_FragColor *= sRGBToLinear(v_Color);\n #else\n gl_FragColor *= v_Color;\n #endif\n#endif\n\n @import ecgl.common.albedo.main\n\n @import ecgl.common.diffuseLayer.main\n\n gl_FragColor *= albedoTexel;\n\n vec3 N = v_Normal;\n#ifdef DOUBLE_SIDED\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n\n if (dot(N, V) < 0.0) {\n N = -N;\n }\n#endif\n\n float ambientFactor = 1.0;\n\n#ifdef BUMPMAP_ENABLED\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n ambientFactor = dot(v_Normal, N);\n#endif\n\n vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);\n\n vec3 diffuseColor = vec3(0.0, 0.0, 0.0);\n\n @import ecgl.common.ssaoMap.main\n\n#ifdef AMBIENT_LIGHT_COUNT\n for(int i = 0; i < AMBIENT_LIGHT_COUNT; i++)\n {\n diffuseColor += ambientLightColor[i] * ambientFactor * ao;\n }\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)\n {{\n diffuseColor += calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_] * ao;\n }}\n#endif\n#ifdef DIRECTIONAL_LIGHT_COUNT\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];\n if(shadowEnabled)\n {\n computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);\n }\n#endif\n for(int i = 0; i < DIRECTIONAL_LIGHT_COUNT; i++)\n {\n vec3 lightDirection = -directionalLightDirection[i];\n vec3 lightColor = directionalLightColor[i];\n\n float shadowContrib = 1.0;\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n if (shadowEnabled)\n {\n shadowContrib = shadowContribsDir[i];\n }\n#endif\n\n float ndl = dot(N, normalize(lightDirection)) * shadowContrib;\n\n diffuseColor += lightColor * clamp(ndl, 0.0, 1.0);\n }\n#endif\n\n gl_FragColor.rgb *= diffuseColor;\n\n @import ecgl.common.emissiveLayer.main\n\n @import ecgl.common.wireframe.fragmentMain\n}\n\n@end"},function(e,t,r){"use strict";t.a="@export ecgl.realistic.vertex\n\n@import ecgl.common.transformUniforms\n\n@import ecgl.common.uv.header\n\n@import ecgl.common.attributes\n\n\n@import ecgl.common.wireframe.vertexHeader\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\n\n#ifdef NORMALMAP_ENABLED\nattribute vec4 tangent : TANGENT;\nvarying vec3 v_Tangent;\nvarying vec3 v_Bitangent;\n#endif\n\n@import ecgl.common.vertexAnimation.header\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nvoid main()\n{\n\n @import ecgl.common.uv.main\n\n @import ecgl.common.vertexAnimation.main\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n v_Normal = normalize((worldInverseTranspose * vec4(norm, 0.0)).xyz);\n v_WorldPosition = (world * vec4(pos, 1.0)).xyz;\n\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n\n#ifdef NORMALMAP_ENABLED\n v_Tangent = normalize((worldInverseTranspose * vec4(tangent.xyz, 0.0)).xyz);\n v_Bitangent = normalize(cross(v_Normal, v_Tangent) * tangent.w);\n#endif\n\n @import ecgl.common.wireframe.vertexMain\n\n}\n\n@end\n\n\n\n@export ecgl.realistic.fragment\n\n#define LAYER_DIFFUSEMAP_COUNT 0\n#define LAYER_EMISSIVEMAP_COUNT 0\n#define PI 3.14159265358979\n#define ROUGHNESS_CHANEL 0\n#define METALNESS_CHANEL 1\n\n#define NORMAL_UP_AXIS 1\n#define NORMAL_FRONT_AXIS 2\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform sampler2D diffuseMap;\n\nuniform sampler2D detailMap;\nuniform sampler2D metalnessMap;\nuniform sampler2D roughnessMap;\n\n@import ecgl.common.layers.header\n\nuniform float emissionIntensity: 1.0;\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nuniform float metalness : 0.0;\nuniform float roughness : 0.5;\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n#ifdef AMBIENT_LIGHT_COUNT\n@import clay.header.ambient_light\n#endif\n\n#ifdef AMBIENT_SH_LIGHT_COUNT\n@import clay.header.ambient_sh_light\n#endif\n\n#ifdef AMBIENT_CUBEMAP_LIGHT_COUNT\n@import clay.header.ambient_cubemap_light\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n@import clay.header.directional_light\n#endif\n\n@import ecgl.common.normalMap.fragmentHeader\n\n@import ecgl.common.ssaoMap.header\n\n@import ecgl.common.bumpMap.header\n\n@import clay.util.srgb\n\n@import clay.util.rgbm\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.plugin.compute_shadow_map\n\nvec3 F_Schlick(float ndv, vec3 spec) {\n return spec + (1.0 - spec) * pow(1.0 - ndv, 5.0);\n}\n\nfloat D_Phong(float g, float ndh) {\n float a = pow(8192.0, g);\n return (a + 2.0) / 8.0 * pow(ndh, a);\n}\n\nvoid main()\n{\n vec4 albedoColor = color;\n\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n#ifdef VERTEX_COLOR\n #ifdef SRGB_DECODE\n albedoColor *= sRGBToLinear(v_Color);\n #else\n albedoColor *= v_Color;\n #endif\n#endif\n\n @import ecgl.common.albedo.main\n\n @import ecgl.common.diffuseLayer.main\n\n albedoColor *= albedoTexel;\n\n float m = metalness;\n\n#ifdef METALNESSMAP_ENABLED\n float m2 = texture2D(metalnessMap, v_DetailTexcoord)[METALNESS_CHANEL];\n m = clamp(m2 + (m - 0.5) * 2.0, 0.0, 1.0);\n#endif\n\n vec3 baseColor = albedoColor.rgb;\n albedoColor.rgb = baseColor * (1.0 - m);\n vec3 specFactor = mix(vec3(0.04), baseColor, m);\n\n float g = 1.0 - roughness;\n\n#ifdef ROUGHNESSMAP_ENABLED\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#endif\n\n vec3 N = v_Normal;\n\n#ifdef DOUBLE_SIDED\n if (dot(N, V) < 0.0) {\n N = -N;\n }\n#endif\n\n float ambientFactor = 1.0;\n\n#ifdef BUMPMAP_ENABLED\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n ambientFactor = dot(v_Normal, N);\n#endif\n\n@import ecgl.common.normalMap.fragmentMain\n\n vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);\n\n vec3 diffuseTerm = vec3(0.0);\n vec3 specularTerm = vec3(0.0);\n\n float ndv = clamp(dot(N, V), 0.0, 1.0);\n vec3 fresnelTerm = F_Schlick(ndv, specFactor);\n\n @import ecgl.common.ssaoMap.main\n\n#ifdef AMBIENT_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_LIGHT_COUNT; _idx_++)\n {{\n diffuseTerm += ambientLightColor[_idx_] * ambientFactor * ao;\n }}\n#endif\n\n#ifdef AMBIENT_SH_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)\n {{\n diffuseTerm += calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_] * ao;\n }}\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];\n if(shadowEnabled)\n {\n computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);\n }\n#endif\n for(int _idx_ = 0; _idx_ < DIRECTIONAL_LIGHT_COUNT; _idx_++)\n {{\n vec3 L = -directionalLightDirection[_idx_];\n vec3 lc = directionalLightColor[_idx_];\n\n vec3 H = normalize(L + V);\n float ndl = clamp(dot(N, normalize(L)), 0.0, 1.0);\n float ndh = clamp(dot(N, H), 0.0, 1.0);\n\n float shadowContrib = 1.0;\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n if (shadowEnabled)\n {\n shadowContrib = shadowContribsDir[_idx_];\n }\n#endif\n\n vec3 li = lc * ndl * shadowContrib;\n\n diffuseTerm += li;\n specularTerm += li * fresnelTerm * D_Phong(g, ndh);\n }}\n#endif\n\n\n#ifdef AMBIENT_CUBEMAP_LIGHT_COUNT\n vec3 L = reflect(-V, N);\n L = vec3(L.x, L[NORMAL_UP_AXIS], L[NORMAL_FRONT_AXIS]);\n float rough2 = clamp(1.0 - g, 0.0, 1.0);\n float bias2 = rough2 * 5.0;\n vec2 brdfParam2 = texture2D(ambientCubemapLightBRDFLookup[0], vec2(rough2, ndv)).xy;\n vec3 envWeight2 = specFactor * brdfParam2.x + brdfParam2.y;\n vec3 envTexel2;\n for(int _idx_ = 0; _idx_ < AMBIENT_CUBEMAP_LIGHT_COUNT; _idx_++)\n {{\n envTexel2 = RGBMDecode(textureCubeLodEXT(ambientCubemapLightCubemap[_idx_], L, bias2), 8.12);\n specularTerm += ambientCubemapLightColor[_idx_] * envTexel2 * envWeight2 * ao;\n }}\n#endif\n\n gl_FragColor.rgb = albedoColor.rgb * diffuseTerm + specularTerm;\n gl_FragColor.a = albedoColor.a;\n\n#ifdef SRGB_ENCODE\n gl_FragColor = linearTosRGB(gl_FragColor);\n#endif\n\n @import ecgl.common.emissiveLayer.main\n\n @import ecgl.common.wireframe.fragmentMain\n}\n\n@end"},function(e,t,r){"use strict";t.a="@export ecgl.hatching.vertex\n\n@import ecgl.realistic.vertex\n\n@end\n\n\n@export ecgl.hatching.fragment\n\n#define NORMAL_UP_AXIS 1\n#define NORMAL_FRONT_AXIS 2\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform vec4 color : [0.0, 0.0, 0.0, 1.0];\nuniform vec4 paperColor : [1.0, 1.0, 1.0, 1.0];\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n#ifdef AMBIENT_LIGHT_COUNT\n@import clay.header.ambient_light\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n@import clay.header.ambient_sh_light\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n@import clay.header.directional_light\n#endif\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n\n@import ecgl.common.ssaoMap.header\n\n@import ecgl.common.bumpMap.header\n\n@import clay.util.srgb\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.plugin.compute_shadow_map\n\nuniform sampler2D hatch1;\nuniform sampler2D hatch2;\nuniform sampler2D hatch3;\nuniform sampler2D hatch4;\nuniform sampler2D hatch5;\nuniform sampler2D hatch6;\n\nfloat shade(in float tone) {\n vec4 c = vec4(1. ,1., 1., 1.);\n float step = 1. / 6.;\n vec2 uv = v_DetailTexcoord;\n if (tone <= step / 2.0) {\n c = mix(vec4(0.), texture2D(hatch6, uv), 12. * tone);\n }\n else if (tone <= step) {\n c = mix(texture2D(hatch6, uv), texture2D(hatch5, uv), 6. * tone);\n }\n if(tone > step && tone <= 2. * step){\n c = mix(texture2D(hatch5, uv), texture2D(hatch4, uv) , 6. * (tone - step));\n }\n if(tone > 2. * step && tone <= 3. * step){\n c = mix(texture2D(hatch4, uv), texture2D(hatch3, uv), 6. * (tone - 2. * step));\n }\n if(tone > 3. * step && tone <= 4. * step){\n c = mix(texture2D(hatch3, uv), texture2D(hatch2, uv), 6. * (tone - 3. * step));\n }\n if(tone > 4. * step && tone <= 5. * step){\n c = mix(texture2D(hatch2, uv), texture2D(hatch1, uv), 6. * (tone - 4. * step));\n }\n if(tone > 5. * step){\n c = mix(texture2D(hatch1, uv), vec4(1.), 6. * (tone - 5. * step));\n }\n\n return c.r;\n}\n\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n vec4 inkColor = sRGBToLinear(color);\n#else\n vec4 inkColor = color;\n#endif\n\n#ifdef VERTEX_COLOR\n #ifdef SRGB_DECODE\n inkColor *= sRGBToLinear(v_Color);\n #else\n inkColor *= v_Color;\n #endif\n#endif\n\n vec3 N = v_Normal;\n#ifdef DOUBLE_SIDED\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n\n if (dot(N, V) < 0.0) {\n N = -N;\n }\n#endif\n\n float tone = 0.0;\n\n float ambientFactor = 1.0;\n\n#ifdef BUMPMAP_ENABLED\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n ambientFactor = dot(v_Normal, N);\n#endif\n\n vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);\n\n @import ecgl.common.ssaoMap.main\n\n#ifdef AMBIENT_LIGHT_COUNT\n for(int i = 0; i < AMBIENT_LIGHT_COUNT; i++)\n {\n tone += dot(ambientLightColor[i], w) * ambientFactor * ao;\n }\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)\n {{\n tone += dot(calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_], w) * ao;\n }}\n#endif\n#ifdef DIRECTIONAL_LIGHT_COUNT\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];\n if(shadowEnabled)\n {\n computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);\n }\n#endif\n for(int i = 0; i < DIRECTIONAL_LIGHT_COUNT; i++)\n {\n vec3 lightDirection = -directionalLightDirection[i];\n float lightTone = dot(directionalLightColor[i], w);\n\n float shadowContrib = 1.0;\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n if (shadowEnabled)\n {\n shadowContrib = shadowContribsDir[i];\n }\n#endif\n\n float ndl = dot(N, normalize(lightDirection)) * shadowContrib;\n\n tone += lightTone * clamp(ndl, 0.0, 1.0);\n }\n#endif\n\n gl_FragColor = mix(inkColor, paperColor, shade(clamp(tone, 0.0, 1.0)));\n }\n@end\n"},function(e,t,r){"use strict";t.a="@export ecgl.sm.depth.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nattribute vec3 position : POSITION;\nattribute vec2 texcoord : TEXCOORD_0;\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nuniform float percent : 1.0;\n#endif\n\nvarying vec4 v_ViewPosition;\nvarying vec2 v_Texcoord;\n\nvoid main(){\n\n#ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n#else\n vec3 pos = position;\n#endif\n\n v_ViewPosition = worldViewProjection * vec4(pos, 1.0);\n gl_Position = v_ViewPosition;\n\n v_Texcoord = texcoord;\n\n}\n@end\n\n\n\n@export ecgl.sm.depth.fragment\n\n@import clay.sm.depth.fragment\n\n@end"},function(e,t,r){"use strict";function n(e,t){var r,n;e&&e[t]&&(e[t].normal||e[t].emphasis)&&(r=e[t].normal,n=e[t].emphasis,r&&(e[t]=r),n&&(e.emphasis=e.emphasis||{},e.emphasis[t]=n))}function i(e){e&&(e instanceof Array||(e=[e]),o.a.util.each(e,function(e){var t;e.axisLabel&&(t=e.axisLabel,o.a.util.extend(t,t.textStyle),t.textStyle=null)}))}var a=r(0),o=r.n(a),s=["bar3D","line3D","map3D","scatter3D","surface","lines3D","scatterGL","scatter3D"];t.a=function(r){o.a.util.each(r.series,function(e){var t;0<=o.a.util.indexOf(s,e.type)&&(n(t=e,"itemStyle"),n(t,"lineStyle"),n(t,"areaStyle"),n(t,"label"),"mapbox"===e.coordinateSystem&&(e.coordinateSystem="mapbox3D",r.mapbox3D=r.mapbox))}),i(r.xAxis3D),i(r.yAxis3D),i(r.zAxis3D),i(r.grid3D),n(r.geo3D)}},function(e,t,r){"use strict";var n=(r(155),r(159),r(160),r(167),r(0)),i=r.n(n);i.a.registerAction({type:"grid3DChangeCamera",event:"grid3dcamerachanged",update:"series:updateCamera"},function(t,e){e.eachComponent({mainType:"grid3D",query:t},function(e){e.setView(t)})}),i.a.registerAction({type:"grid3DShowAxisPointer",event:"grid3dshowaxispointer",update:"grid3D:showAxisPointer"},function(e,t){}),i.a.registerAction({type:"grid3DHideAxisPointer",event:"grid3dhideaxispointer",update:"grid3D:hideAxisPointer"},function(e,t){})},function(e,t,r){"use strict";function n(e,t){return t.type||(t.data?"category":"value")}var i=r(0),a=r.n(i),o=r(156),s=a.a.extendComponentModel({type:"cartesian3DAxis",axis:null,getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"grid3D",index:this.option.gridIndex,id:this.option.gridId})[0]}});a.a.helper.mixinAxisModelCommonMethods(s),Object(o.a)("x",s,n,{name:"X"}),Object(o.a)("y",s,n,{name:"Y"}),Object(o.a)("z",s,n,{name:"Z"})},function(e,t,r){"use strict";var n=r(0),o=r.n(n),s=r(157),i=r(158),u=r.n(i),l=["value","category","time","log"];t.a=function(i,e,a,t){o.a.util.each(l,function(n){e.extend({type:i+"Axis3D."+n,__ordinalMeta:null,mergeDefaultAndTheme:function(e,t){var r=t.getTheme();o.a.util.merge(e,r.get(n+"Axis3D")),o.a.util.merge(e,this.getDefaultOption()),e.type=a(i,e)},optionUpdated:function(){"category"===this.option.type&&(this.__ordinalMeta=u.a.createByAxisModel(this))},getCategories:function(){if("category"===this.option.type)return this.__ordinalMeta.categories},getOrdinalMeta:function(){return this.__ordinalMeta},defaultOption:o.a.util.merge(o.a.util.clone(s.a[n+"Axis3D"]),t||{},!0)})}),e.superClass.registerSubTypeDefaulter(i+"Axis3D",o.a.util.curry(a,i))}},function(e,t,r){"use strict";var n=r(0),i=r.n(n),a={show:!0,grid3DIndex:0,inverse:!1,name:"",nameLocation:"middle",nameTextStyle:{fontSize:16},nameGap:20,axisPointer:{},axisLine:{},axisTick:{},axisLabel:{},splitArea:{}},o=i.a.util.merge({boundaryGap:!0,axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"},axisPointer:{label:{show:!1}}},a),s=i.a.util.merge({boundaryGap:[0,0],splitNumber:5,axisPointer:{label:{}}},a),u=i.a.util.defaults({scale:!0,min:"dataMin",max:"dataMax"},s),l=i.a.util.defaults({logBase:10},s);l.scale=!0,t.a={categoryAxis3D:o,valueAxis3D:s,timeAxis3D:u,logAxis3D:l}},function(e,t,r){function i(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication,this._map}function a(e){return e._map||(e._map=s(e.categories))}function o(e){return u(e)&&null!=e.value?e.value:e+""}var n=r(13),s=n.createHashMap,u=n.isObject,l=n.map;i.createByAxisModel=function(e){var t=e.option,r=t.data,n=r&&l(r,o);return new i({categories:n,needCollect:!n,deduplication:!1!==t.dedplication})};var h=i.prototype;h.getOrdinal=function(e){return a(this).get(e)},h.parseAndCollect=function(e){var t=this._needCollect;if("string"!=typeof e&&!t)return e;if(t&&!this._deduplication)return r=this.categories.length,this.categories[r]=e,r;var r,n=a(this);return null==(r=n.get(e))&&(t?(r=this.categories.length,this.categories[r]=e,n.set(e,r)):r=NaN),r};e.exports=i},function(e,t,r){"use strict";var n=r(0),i=r.n(n),a=r(44),o=r(28),s=r(29),u=i.a.extendComponentModel({type:"grid3D",dependencies:["xAxis3D","yAxis3D","zAxis3D"],defaultOption:{show:!0,zlevel:-10,left:0,top:0,width:"100%",height:"100%",environment:"auto",boxWidth:100,boxHeight:100,boxDepth:100,axisPointer:{show:!0,lineStyle:{color:"rgba(0, 0, 0, 0.8)",width:1},label:{show:!0,formatter:null,margin:8,textStyle:{fontSize:14,color:"#fff",backgroundColor:"rgba(0,0,0,0.5)",padding:3,borderRadius:3}}},axisLine:{show:!0,lineStyle:{color:"#333",width:2,type:"solid"}},axisTick:{show:!0,inside:!1,length:3,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,margin:8,textStyle:{fontSize:12}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}},light:{main:{alpha:30,beta:40},ambient:{intensity:.4}},viewControl:{alpha:20,beta:40,autoRotate:!1,distance:200,minDistance:40,maxDistance:400}}});i.a.util.merge(u.prototype,a.a),i.a.util.merge(u.prototype,o.a),i.a.util.merge(u.prototype,s.a)},function(e,t,r){"use strict";var n=r(0),w=r.n(n),E=r(1),a=r(45),o=r(25),S=r(2),s=r(81),u=r(30),l=r(162),h=r(164),c=r(63),i=r(46),A=S.a.firstNotNull;E.a.Shader.import(i.a),["x","y","z"].forEach(function(e){w.a.extendComponentView({type:e+"Axis3D"})});var M={x:0,y:2,z:1};w.a.extendComponentView({type:"grid3D",__ecgl__:!0,init:function(e,t){var r=new E.a.Material({shader:E.a.createShader("ecgl.color"),depthMask:!1,transparent:!0}),n=new E.a.Material({shader:E.a.createShader("ecgl.meshLines3D"),depthMask:!1,transparent:!0});r.define("fragment","DOUBLE_SIDED"),r.define("both","VERTEX_COLOR"),this.groupGL=new E.a.Node,this._control=new a.a({zr:t.getZr()}),this._control.init(),this._faces=[["y","z","x",-1,"left"],["y","z","x",1,"right"],["x","y","z",-1,"bottom"],["x","y","z",1,"top"],["x","z","y",-1,"far"],["x","z","y",1,"near"]].map(function(e){var t=new l.a(e,n,r);return this.groupGL.add(t.rootNode),t},this),this._axes=["x","y","z"].map(function(e){var t=new h.a(e,n);return this.groupGL.add(t.rootNode),t},this);var i=t.getDevicePixelRatio();this._axisLabelSurface=new s.a({width:256,height:256,devicePixelRatio:i}),this._axisLabelSurface.onupdate=function(){t.getZr().refresh()},this._axisPointerLineMesh=new E.a.Mesh({geometry:new o.a({useNativeLine:!1}),material:n,castShadow:!1,ignorePicking:!0,renderOrder:3}),this.groupGL.add(this._axisPointerLineMesh),this._axisPointerLabelsSurface=new s.a({width:128,height:128,devicePixelRatio:i}),this._axisPointerLabelsMesh=new c.a({ignorePicking:!0,renderOrder:4,castShadow:!1}),this._axisPointerLabelsMesh.material.set("textureAtlas",this._axisPointerLabelsSurface.getTexture()),this.groupGL.add(this._axisPointerLabelsMesh),this._lightRoot=new E.a.Node,this._sceneHelper=new u.a,this._sceneHelper.initLight(this._lightRoot)},render:function(t,r,n){this._model=t,this._api=n;var e=t.coordinateSystem;e.viewGL.add(this._lightRoot),t.get("show")?e.viewGL.add(this.groupGL):e.viewGL.remove(this.groupGL);var i=this._control;i.setViewGL(e.viewGL);var a=t.getModel("viewControl");i.setFromViewControlModel(a,0),this._axisLabelSurface.clear(),i.off("update"),t.get("show")&&(this._faces.forEach(function(e){e.update(t,r,n)},this),this._axes.forEach(function(e){e.update(t,this._axisLabelSurface,n)},this)),i.on("update",this._onCameraChange.bind(this,t,n),this),this._sceneHelper.setScene(e.viewGL.scene),this._sceneHelper.updateLight(t),e.viewGL.setPostEffect(t.getModel("postEffect"),n),e.viewGL.setTemporalSuperSampling(t.getModel("temporalSuperSampling")),this._initMouseHandler(t)},afterRender:function(e,t,r,n){var i=n.renderer;this._sceneHelper.updateAmbientCubemap(i,e,r),this._sceneHelper.updateSkybox(i,e,r)},showAxisPointer:function(e,t,r,n){this._doShowAxisPointer(),this._updateAxisPointer(n.value)},hideAxisPointer:function(){this._doHideAxisPointer()},_initMouseHandler:function(e){var t=e.coordinateSystem.viewGL;e.get("show")&&e.get("axisPointer.show")?t.on("mousemove",this._updateAxisPointerOnMousePosition,this):t.off("mousemove",this._updateAxisPointerOnMousePosition)},_updateAxisPointerOnMousePosition:function(e){if(!e.target){for(var t,r,n=this._model.coordinateSystem,i=n.viewGL,a=i.castRay(e.offsetX,e.offsetY,new E.a.Ray),o=0;o<this._faces.length;o++){var s,u,l,h,c,d=this._faces[o];d.rootNode.invisible||(d.plane.normal.dot(i.camera.worldTransform.z)<0&&d.plane.normal.negate(),(s=a.intersectPlane(d.plane))&&(u=n.getAxis(d.faceInfo[0]),l=n.getAxis(d.faceInfo[1]),h=M[d.faceInfo[0]],c=M[d.faceInfo[1]],u.contain(s.array[h])&&l.contain(s.array[c])&&(t=s)))}t?(r=n.pointToData(t.array,[],!0),this._updateAxisPointer(r),this._doShowAxisPointer()):this._doHideAxisPointer()}},_onCameraChange:function(e,t){e.get("show")&&(this._updateFaceVisibility(),this._updateAxisLinePosition());var r=this._control;t.dispatchAction({type:"grid3DChangeCamera",alpha:r.getAlpha(),beta:r.getBeta(),distance:r.getDistance(),center:r.getCenter(),from:this.uid,grid3DId:e.id})},_updateFaceVisibility:function(){var e=this._control.getCamera(),t=new E.a.Vector3;e.update();for(var r=0;r<this._faces.length/2;r++){for(var n=[],i=0;i<2;i++)this._faces[2*r+i].rootNode.getWorldPosition(t),t.transformMat4(e.viewMatrix),n[i]=t.z;var a=n[0]>n[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);r<h.length;r++)h[r].setArray(t[r]),h[r].w=1,h[r].transformMat4(e.rootNode.worldTransform).transformMat4(l.viewMatrix).transformMat4(l.projectionMatrix),h[r].x/=h[r].w,h[r].y/=h[r].w;var n,i,a=h[1].x-h[0].x,o=h[1].y-h[0].y,s=(h[1].x+h[0].x)/2,u=(h[1].y+h[0].y)/2;Math.abs(o/a)<.5?(n="center",i=u>c.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<this._faces.length;u++){var l=this._faces[u];if(!l.rootNode.invisible){for(var h=l.faceInfo,c=h[3]<0?n.getAxis(h[2]).getExtentMin():n.getAxis(h[2]).getExtentMax(),d=M[h[2]],f=0;f<2;f++){var p,m,g,_,v,y=h[f],x=h[1-f],T=n.getAxis(y),b=n.getAxis(x);t(T)&&(_=M[x],(p=[0,0,0])[g=M[y]]=(m=[0,0,0])[g]=i[g],p[d]=m[d]=c,p[_]=b.getExtentMin(),m[_]=b.getExtentMax(),v=r(T),a.addLine(p,m,v.color,v.lineWidth*s))}t(n.getAxis(h[2]))&&(p=i.slice(),(m=i.slice())[d]=c,v=r(n.getAxis(h[2])),a.addLine(p,m,v.color,v.lineWidth*s))}}a.convertToTypedArray(),this._updateAxisPointerLabelsMesh(e),this._api.getZr().refresh()},_updateAxisPointerLabelsMesh:function(_){var e=this._model,v=this._axisPointerLabelsMesh,y=this._axisPointerLabelsSurface,x=e.coordinateSystem,T=e.getModel("axisPointer");v.geometry.convertToDynamicArray(!0),y.clear();var b={x:"y",y:"x",z:"y"};this._axes.forEach(function(e,t){var r,n,i,a,o,s,u,l,h,c,d,f=x.getAxis(e.dim),p=f.model.getModel("axisPointer",T),m=p.getModel("label"),g=p.get("lineStyle.color");m.get("show")&&p.get("show")&&(r=_[t],n=m.get("formatter"),a=f.scale.getLabel(r),null!=n?a=n(a,_):"interval"!==f.scale.type&&"log"!==f.scale.type||(i=w.a.number.getPrecisionSafe(f.scale.getTicks()[0]),a=r.toFixed(i+2)),s=(o=m.getModel("textStyle")).get("color"),u=new w.a.graphic.Text,w.a.graphic.setTextStyle(u.style,o,{text:a,textFill:s||g,textAlign:"left",textVerticalAlign:"top"}),l=y.add(u),h=u.getBoundingRect(),c=this._api.getDevicePixelRatio(),(d=e.rootNode.position.toArray())[M[b[e.dim]]]+=(e.flipped?-1:1)*m.get("margin"),d[M[e.dim]]=f.dataToCoord(_[t]),v.geometry.addSprite(d,[h.width*c,h.height*c],l,e.textAlign,e.textVerticalAlign))},this),y.getZr().refreshImmediately(),v.material.set("uvScale",y.getCoordsScale()),v.geometry.convertToTypedArray()},dispose:function(){this.groupGL.removeAll(),this._control.dispose()}})},function(e,t,r){"use strict";var n=r(70),i=r(12),a=r(33),o=r(78),s=r(79),u=r(34),l=r(21),h=r(55);t.a={vec2:n.a,vec3:i.a,vec4:a.a,mat2:o.a,mat2d:s.a,mat3:u.a,mat4:l.a,quat:h.a}},function(e,t,r){"use strict";function n(e,t,r){this.rootNode=new T.a.Node;var n=new T.a.Mesh({geometry:new o.a({useNativeLine:!1}),material:t,castShadow:!1,ignorePicking:!0,$ignorePicking:!0,renderOrder:1}),i=new T.a.Mesh({geometry:new s.a,material:r,castShadow:!1,culling:!1,ignorePicking:!0,$ignorePicking:!0,renderOrder:0});this.rootNode.add(i),this.rootNode.add(n),this.faceInfo=e,this.plane=new T.a.Plane,this.linesMesh=n,this.quadsMesh=i}var i=r(0),x=r.n(i),T=r(1),a=r(2),o=r(25),s=r(163),b=a.a.firstNotNull,p={x:0,y:2,z:1};n.prototype.update=function(e,t,r){var n=e.coordinateSystem,i=[n.getAxis(this.faceInfo[0]),n.getAxis(this.faceInfo[1])],a=this.linesMesh.geometry,o=this.quadsMesh.geometry;a.convertToDynamicArray(!0),o.convertToDynamicArray(!0),this._updateSplitLines(a,i,e,r),this._udpateSplitAreas(o,i,e,r),a.convertToTypedArray(),o.convertToTypedArray();var s,u,l,h,c,d,f=n.getAxis(this.faceInfo[2]);s=this.rootNode,u=this.plane,l=f,h=this.faceInfo[3],c=[0,0,0],d=h<0?l.getExtentMin():l.getExtentMax(),c[p[l.dim]]=d,s.position.setArray(c),s.rotation.identity(),u.distance=-Math.abs(d),u.normal.set(0,0,0),"x"===l.dim?(s.rotation.rotateY(h*Math.PI/2),u.normal.x=-h):"z"===l.dim?(s.rotation.rotateX(-h*Math.PI/2),u.normal.y=-h):(0<h&&s.rotation.rotateY(Math.PI),u.normal.z=-h)},n.prototype._updateSplitLines=function(g,_,v,e){var y=e.getDevicePixelRatio();_.forEach(function(e,t){var r=e.model,n=_[1-t].getExtent();if(!e.scale.isBlank()){var i=r.getModel("splitLine",v.getModel("splitLine"));if(i.get("show"))for(var a=i.getModel("lineStyle"),o=a.get("color"),s=b(a.get("opacity"),1),u=b(a.get("width"),1),o=x.a.util.isArray(o)?o:[o],l=e.getTicksCoords({tickModel:i}),h=0,c=0;c<l.length;c++){var d=l[c].coord,f=T.a.parseColor(o[h%o.length]);f[3]*=s;var p=[0,0,0],m=[0,0,0];p[t]=m[t]=d,p[1-t]=n[0],m[1-t]=n[1],g.addLine(p,m,f,u*y),h++}}})},n.prototype._udpateSplitAreas=function(_,v,y,e){v.forEach(function(e,t){var r=e.model,n=v[1-t].getExtent();if(!e.scale.isBlank()){var i=r.getModel("splitArea",y.getModel("splitArea"));if(i.get("show"))for(var a=i.getModel("areaStyle"),o=a.get("color"),s=b(a.get("opacity"),1),o=x.a.util.isArray(o)?o:[o],u=e.getTicksCoords({tickModel:i,clamp:!0}),l=0,h=[0,0,0],c=[0,0,0],d=0;d<u.length;d++){var f,p=u[d].coord,m=[0,0,0],g=[0,0,0];m[t]=g[t]=p,m[1-t]=n[0],g[1-t]=n[1],0!==d?((f=T.a.parseColor(o[l%o.length]))[3]*=s,_.addQuad([h,m,g,c],f),h=m,c=g,l++):(h=m,c=g)}}})},t.a=n},function(e,t,r){"use strict";var s,u,l,h,n=r(15),i=r(0),a=r.n(i),o=r(38),c=r(6).a.vec3,d=n.a.extend(function(){return{segmentScale:1,useNativeLine:!0,attributes:{position:new n.a.Attribute("position","float",3,"POSITION"),normal:new n.a.Attribute("normal","float",3,"NORMAL"),color:new n.a.Attribute("color","float",4,"COLOR")}}},{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0},setQuadCount:function(e){var t=this.attributes,r=this.getQuadVertexCount()*e,n=this.getQuadTriangleCount()*e;this.vertexCount!==r&&(t.position.init(r),t.normal.init(r),t.color.init(r)),this.triangleCount!==n&&(this.indices=new(65535<r?Uint32Array:Uint16Array)(3*n))},getQuadVertexCount:function(){return 4},getQuadTriangleCount:function(){return 2},addQuad:(s=c.create(),u=c.create(),l=c.create(),h=[0,3,1,3,2,1],function(e,t){var r=this.attributes.position,n=this.attributes.normal,i=this.attributes.color;c.sub(s,e[1],e[0]),c.sub(u,e[2],e[1]),c.cross(l,s,u),c.normalize(l,l);for(var a=0;a<4;a++)r.set(this._vertexOffset+a,e[a]),i.set(this._vertexOffset+a,t),n.set(this._vertexOffset+a,l);for(var o=3*this._faceOffset,a=0;a<6;a++)this.indices[o+a]=h[a]+this._vertexOffset;this._vertexOffset+=4,this._faceOffset+=2})});a.a.util.defaults(d.prototype,o.a),t.a=d},function(e,t,r){"use strict";function n(e,t){var r=new k.a.Mesh({geometry:new a.a({useNativeLine:!1}),material:t,castShadow:!1,ignorePicking:!0,renderOrder:2}),n=new s.a;n.material.depthMask=!1;var i=new k.a.Node;i.add(r),i.add(n),this.rootNode=i,this.dim=e,this.linesMesh=r,this.labelsMesh=n,this.axisLineCoords=null,this.labelElements=[]}var i=r(0),V=r.n(i),k=r(1),a=r(25),o=r(2),s=r(63),W=o.a.firstNotNull,j={x:0,y:2,z:1},X={x:"y",y:"x",z:"y"};n.prototype.update=function(e,t,r){var n=e.coordinateSystem.getAxis(this.dim),i=this.linesMesh.geometry,a=this.labelsMesh.geometry;i.convertToDynamicArray(!0),a.convertToDynamicArray(!0);var o,s,u,l=n.model,h=n.getExtent(),c=r.getDevicePixelRatio(),d=l.getModel("axisLine",e.getModel("axisLine")),f=l.getModel("axisTick",e.getModel("axisTick")),p=l.getModel("axisLabel",e.getModel("axisLabel")),m=d.get("lineStyle.color");if(d.get("show")&&(o=d.getModel("lineStyle"),E=[0,0,0],(w=[0,0,0])[S=j[n.dim]]=h[0],E[S]=h[1],this.axisLineCoords=[w,E],s=k.a.parseColor(m),v=W(o.get("width"),1),u=W(o.get("opacity"),1),s[3]*=u,i.addLine(w,E,s,v*c)),f.get("show")){var g=f.getModel("lineStyle"),_=k.a.parseColor(W(g.get("color"),m)),v=W(g.get("width"),1);_[3]*=W(g.get("opacity"),1);for(var y=n.getTicksCoords(),x=f.get("length"),T=0;T<y.length;T++){var b=y[T].coord,w=[0,0,0],E=[0,0,0],S=j[n.dim],A=j[X[n.dim]];w[S]=E[S]=b,E[A]=x,i.addLine(w,E,_,v*c)}}this.labelElements=[];var M,C,L,c=r.getDevicePixelRatio();if(p.get("show"))for(var y=n.getTicksCoords(),D=l.get("data"),N=p.get("margin"),R=n.getViewLabels(),T=0;T<R.length;T++){var P=R[T].tickValue,I=R[T].formattedLabel,O=R[T].rawLabel,b=n.dataToCoord(P),F=[0,0,0],S=j[n.dim],A=j[X[n.dim]];F[S]=F[S]=b,F[A]=N;var B=p;D&&D[P]&&D[P].textStyle&&(B=new V.a.Model(D[P].textStyle,p,l.ecModel));var U=W(B.get("color"),m),z=new V.a.graphic.Text;V.a.graphic.setTextStyle(z.style,B,{text:I,textFill:"function"==typeof U?U("category"===n.type?O:"value"===n.type?P+"":P,T):U,textVerticalAlign:"top",textAlign:"left"});var G=t.add(z),H=z.getBoundingRect();a.addSprite(F,[H.width*c,H.height*c],G),this.labelElements.push(z)}l.get("name")&&(M=l.getModel("nameTextStyle"),F=[0,0,0],S=j[n.dim],A=j[X[n.dim]],C=W(M.get("color"),m),L=M.get("borderColor"),v=M.get("borderWidth"),F[S]=F[S]=(h[0]+h[1])/2,F[A]=l.get("nameGap"),z=new V.a.graphic.Text,V.a.graphic.setTextStyle(z.style,M,{text:l.get("name"),textFill:C,textStroke:L,lineWidth:v}),G=t.add(z),H=z.getBoundingRect(),a.addSprite(F,[H.width*c,H.height*c],G),z.__idx=this.labelElements.length,this.nameLabelElement=z),this.labelsMesh.material.set("textureAtlas",t.getTexture()),this.labelsMesh.material.set("uvScale",t.getCoordsScale()),i.convertToTypedArray(),a.convertToTypedArray()},n.prototype.setSpriteAlign=function(e,t,r){for(var n=r.getDevicePixelRatio(),i=this.labelsMesh.geometry,a=0;a<this.labelElements.length;a++){var o=this.labelElements[a].getBoundingRect();i.setSpriteAlign(a,[o.width*n,o.height*n],e,t)}var s=this.nameLabelElement;s&&(o=s.getBoundingRect(),i.setSpriteAlign(s.__idx,[o.width*n,o.height*n],e,t),i.dirty()),this.textAlign=e,this.textVerticalAlign=t},t.a=n},function(e,t,r){"use strict";var n=r(0),i=r.n(n),a=r(15),o=r(38),u=[0,1,2,0,2,3],s=a.a.extend(function(){return{attributes:{position:new a.a.Attribute("position","float",3,"POSITION"),texcoord:new a.a.Attribute("texcoord","float",2,"TEXCOORD_0"),offset:new a.a.Attribute("offset","float",2),color:new a.a.Attribute("color","float",4,"COLOR")}}},{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0},setSpriteCount:function(e){var t=4*(this._spriteCount=e),r=2*e;this.vertexCount!==t&&(this.attributes.position.init(t),this.attributes.offset.init(t),this.attributes.color.init(t)),this.triangleCount!==r&&(this.indices=new(65535<t?Uint32Array:Uint16Array)(3*r))},setSpriteAlign:function(e,t,r,n,i){var a,o,s,u;switch(null==r&&(r="left"),null==n&&(n="top"),i=i||0,r){case"left":a=i,s=t[0]+i;break;case"center":case"middle":a=-t[0]/2,s=t[0]/2;break;case"right":a=-t[0]-i,s=-i}switch(n){case"bottom":o=i,u=t[1]+i;break;case"middle":o=-t[1]/2,u=t[1]/2;break;case"top":o=-t[1]-i,u=-i}var l=4*e,h=this.attributes.offset;h.set(l,[a,u]),h.set(1+l,[s,u]),h.set(2+l,[s,o]),h.set(3+l,[a,o])},addSprite:function(e,t,r,n,i,a){var o=this._vertexOffset;this.setSprite(this._vertexOffset/4,e,t,r,n,i,a);for(var s=0;s<u.length;s++)this.indices[3*this._faceOffset+s]=u[s]+o;return this._faceOffset+=2,this._vertexOffset+=4,o/4},setSprite:function(e,t,r,n,i,a,o){for(var s=4*e,u=this.attributes,l=0;l<4;l++)u.position.set(s+l,t);var h=u.texcoord;h.set(s,[n[0][0],n[0][1]]),h.set(1+s,[n[1][0],n[0][1]]),h.set(2+s,[n[1][0],n[1][1]]),h.set(3+s,[n[0][0],n[1][1]]),this.setSpriteAlign(e,r,i,a,o)}});i.a.util.defaults(s.prototype,o.a),t.a=s},function(e,t,r){"use strict";t.a="@export ecgl.labels.vertex\n\nattribute vec3 position: POSITION;\nattribute vec2 texcoord: TEXCOORD_0;\nattribute vec2 offset;\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform vec4 viewport : VIEWPORT;\n\nvarying vec2 v_Texcoord;\n\nvoid main()\n{\n vec4 proj = worldViewProjection * vec4(position, 1.0);\n\n vec2 screen = (proj.xy / abs(proj.w) + 1.0) * 0.5 * viewport.zw;\n\n screen += offset;\n\n proj.xy = (screen / viewport.zw - 0.5) * 2.0 * abs(proj.w);\n gl_Position = proj;\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n v_Texcoord = texcoord;\n}\n@end\n\n\n@export ecgl.labels.fragment\n\nuniform vec3 color : [1.0, 1.0, 1.0];\nuniform float alpha : 1.0;\nuniform sampler2D textureAtlas;\nuniform vec2 uvScale: [1.0, 1.0];\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\nvarying float v_Miter;\n\nvarying vec2 v_Texcoord;\n\nvoid main()\n{\n gl_FragColor = vec4(color, alpha) * texture2D(textureAtlas, v_Texcoord * uvScale);\n#ifdef VERTEX_COLOR\n gl_FragColor *= v_Color;\n#endif\n}\n\n@end"},function(e,t,r){"use strict";function n(e,t){var r=e.getBoxLayoutParams(),n=u.a.getLayoutRect(r,{width:t.getWidth(),height:t.getHeight()});n.y=t.getHeight()-n.y-n.height,this.viewGL.setViewport(n.x,n.y,n.width,n.height,t.getDevicePixelRatio());var i=e.get("boxWidth"),a=e.get("boxHeight"),o=e.get("boxDepth");this.getAxis("x").setExtent(-i/2,i/2),this.getAxis("y").setExtent(o/2,-o/2),this.getAxis("z").setExtent(-a/2,a/2),this.size=[i,a,o]}function i(e,t){var u={};e.eachSeries(function(e){var i;e.coordinateSystem===this&&(i=e.getData(),["x","y","z"].forEach(function(n){i.mapDimension(n,!0).forEach(function(e){var t,r;t=n,r=i.getDataExtent(e,!0),u[t]=u[t]||[1/0,-1/0],u[t][0]=Math.min(r[0],u[t][0]),u[t][1]=Math.max(r[1],u[t][1])})}))},this),["xAxis3D","yAxis3D","zAxis3D"].forEach(function(s){e.eachComponent(s,function(e){var t,r,n,i=s.charAt(0),a=e.getReferringComponents("grid3D")[0],o=a.coordinateSystem;o===this&&((r=o.getAxis(i))||(t=h.a.helper.createScale(u[i]||[1/0,-1/0],e),(r=new l.a(i,t)).type=e.get("type"),n="category"===r.type,r.onBand=n&&e.get("boundaryGap"),r.inverse=e.get("inverse"),(e.axis=r).model=e,r.getLabelModel=function(){return e.getModel("axisLabel",a.getModel("axisLabel"))},r.getTickModel=function(){return e.getModel("axisTick",a.getModel("axisTick"))},o.addAxis(r)))},this)},this),this.resize(this.model,t)}var a=r(168),l=r(170),o=r(0),h=r.n(o),s=r(47),u=r.n(s),c=r(22),d=(r(2),{dimensions:a.a.prototype.dimensions,create:function(o){var r=[];o.eachComponent("grid3D",function(e){e.__viewGL=e.__viewGL||new c.a;var t=new a.a;t.model=e,t.viewGL=e.__viewGL,e.coordinateSystem=t,r.push(t),t.resize=n,t.update=i});var s=["xAxis3D","yAxis3D","zAxis3D"];return o.eachSeries(function(e){var t,r,n,i,a;"cartesian3D"===e.get("coordinateSystem")&&(null==(r=e.getReferringComponents("grid3D")[0])&&(i=e,a=o,r=(t=s.map(function(e){var t=i.getReferringComponents(e)[0];return null==t&&(t=a.getComponent(e)),t}))[0].getCoordSysModel(),t.forEach(function(e){e.getCoordSysModel()})),n=r.coordinateSystem,e.coordinateSystem=n)}),r}});h.a.registerCoordinateSystem("grid3D",d)},function(e,t,r){"use strict";function n(e){s.a.call(this,e),this.size=[0,0,0]}var i=r(0),a=r.n(i),o=r(169),s=r.n(o);n.prototype={constructor:n,type:"cartesian3D",dimensions:["x","y","z"],model:null,containPoint:function(e){return this.getAxis("x").contain(e[0])&&this.getAxis("y").contain(e[2])&&this.getAxis("z").contain(e[1])},containData:function(e){return this.getAxis("x").containData(e[0])&&this.getAxis("y").containData(e[1])&&this.getAxis("z").containData(e[2])},dataToPoint:function(e,t,r){return(t=t||[])[0]=this.getAxis("x").dataToCoord(e[0],r),t[2]=this.getAxis("y").dataToCoord(e[1],r),t[1]=this.getAxis("z").dataToCoord(e[2],r),t},pointToData:function(e,t,r){return(t=t||[])[0]=this.getAxis("x").coordToData(e[0],r),t[1]=this.getAxis("y").coordToData(e[2],r),t[2]=this.getAxis("z").coordToData(e[1],r),t}},a.a.util.inherits(n,s.a),t.a=n},function(e,t,r){function n(e){return this._axes[e]}function i(e){this._axes={},this._dimList=[],this.name=e||""}var a=r(13);i.prototype={constructor:i,type:"cartesian",getAxis:function(e){return this._axes[e]},getAxes:function(){return a.map(this._dimList,n,this)},getAxesByScale:function(t){return t=t.toLowerCase(),a.filter(this.getAxes(),function(e){return e.scale.type===t})},addAxis:function(e){var t=e.dim;this._axes[t]=e,this._dimList.push(t)},dataToCoord:function(e){return this._dataCoordConvert(e,"dataToCoord")},coordToData:function(e){return this._dataCoordConvert(e,"coordToData")},_dataCoordConvert:function(e,t){for(var r=this._dimList,n=e instanceof Array?[]:{},i=0;i<r.length;i++){var a=r[i],o=this._axes[a];n[a]=o[t](e[a])}return n}};e.exports=i},function(e,t,r){"use strict";function n(e,t,r){a.a.Axis.call(this,e,t,r)}var i=r(0),a=r.n(i);n.prototype={constructor:n,getExtentMin:function(){var e=this._extent;return Math.min(e[0],e[1])},getExtentMax:function(){var e=this._extent;return Math.max(e[0],e[1])},calculateCategoryInterval:function(){return Math.floor(this.scale.count()/8)}},a.a.util.inherits(n,a.a.Axis),t.a=n},function(e,t,r){function h(e){return null==e?"":(e+"").replace(a,function(e,t){return o[t]})}function d(e,t){return"0000".substr(0,t-(e+="").length)+e}function c(e,t){return"{"+e+(null==t?"":t)+"}"}var f=r(13),n=r(172),p=r(85),i=f.normalizeCssArray,a=/([&<>"'])/g,o={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},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<e.length?"."+e[1]:"")},t.toCamelCase=function(e,t){return e=(e||"").toLowerCase().replace(/-(.)/g,function(e,t){return t.toUpperCase()}),t&&e&&(e=e.charAt(0).toUpperCase()+e.slice(1)),e},t.normalizeCssArray=i,t.encodeHTML=h,t.formatTpl=function(e,t,r){f.isArray(t)||(t=[t]);var n=t.length;if(!n)return"";for(var i=t[0].$vars||[],a=0;a<i.length;a++){var o=m[a];e=e.replace(c(o),c(o,0))}for(var s=0;s<n;s++)for(var u=0;u<i.length;u++){var l=t[s][i[u]];e=e.replace(c(m[u],s),r?h(l):l)}return e},t.formatTplSimple=function(r,e,n){return f.each(e,function(e,t){r=r.replace("{"+t+"}",n?h(e):e)}),r},t.getTooltipMarker=function(e,t){var r=(e=f.isString(e)?{color:e,extraCssText:t}:e||{}).color,n=e.type,t=e.extraCssText;return r?"subItem"===n?'<span style="display:inline-block;vertical-align:middle;margin-right:8px;margin-left:3px;border-radius:4px;width:4px;height:4px;background-color:'+h(r)+";"+(t||"")+'"></span>':'<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:'+h(r)+";"+(t||"")+'"></span>':""},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<o;a++)i=Math.max(s(n[a],t).width,i);return c<h&&(h=0,u={}),h++,u[r]=i}function p(e,t,r){return"right"===r?e-=t:"center"===r&&(e-=t/2),e}function m(e,t,r){return"middle"===r?e-=t/2:"bottom"===r&&(e-=t),e}function R(e,t,r,n,i){if(!t)return"";var a=(e+"").split("\n");i=f(t,r,n,i);for(var o=0,s=a.length;o<s;o++)a[o]=g(a[o],i);return a.join("\n")}function f(e,t,r,n){(n=l({},n)).font=t;r=F(r,"...");n.maxIterations=F(n.maxIterations,2);var i=n.minChar=F(n.minChar,0);n.cnCharWidth=N("国",t);var a=n.ascCharWidth=N("a",t);n.placeholder=F(n.placeholder,"");for(var o=e=Math.max(0,e-1),s=0;s<i&&a<=o;s++)o-=a;var u=N(r);return o<u&&(r="",u=0),o=e-u,n.ellipsis=r,n.ellipsisWidth=u,n.contentWidth=o,n.containerWidth=e,n}function g(e,t){var r=t.containerWidth,n=t.font,i=t.contentWidth;if(!r)return"";if((s=N(e,n))<=r)return e;for(var a=0;;a++){if(s<=i||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;a<o&&i<t;a++){var s=e.charCodeAt(a);i+=0<=s&&s<=127?r:n}return a}(e,i,t.ascCharWidth,t.cnCharWidth):0<s?Math.floor(e.length*i/s):0,s=N(e=e.substr(0,o),n)}return""===e&&(e=t.placeholder),e}function P(e){return N("国",e)}function s(e,t){return o.measureText(e,t)}function _(e,t,r,n){null!=e&&(e+="");var i=P(t),a=e?e.split("\n"):[],o=a.length*i,s=o;if(r&&(s+=r[0]+r[2]),e&&n){var u=n.outerHeight,l=n.outerWidth;if(null!=u&&u<s)e="",a=[];else if(null!=l)for(var h=f(l-(r?r[1]+r[3]:0),t,n.ellipsis,{minChar:n.minChar,placeholder:n.placeholder}),c=0,d=a.length;c<d;c++)a[c]=g(a[c],h)}return{lines:a,height:o,outerHeight:s,lineHeight:i}}function v(e,t){var r={lines:[],width:0,height:0};if(null!=e&&(e+=""),!e)return r;for(var n,i=U.lastIndex=0;null!=(n=U.exec(e));){var a=n.index;i<a&&I(r,e.substring(i,a)),I(r,n[2],n[1]),i=U.lastIndex}i<e.length&&I(r,e.substring(i,e.length));var o=r.lines,s=0,u=0,l=[],h=t.textPadding,c=t.truncate,d=c&&c.outerWidth,f=c&&c.outerHeight;h&&(null!=d&&(d-=h[1]+h[3]),null!=f&&(f-=h[0]+h[2]));for(var p=0;p<o.length;p++){for(var m=o[p],g=0,_=0,v=0;v<m.tokens.length;v++){var y=(L=m.tokens[v]).styleName&&t.rich[L.styleName]||{},x=L.textPadding=y.textPadding,T=L.font=y.font||t.font,b=L.textHeight=F(y.textHeight,P(T));if(x&&(b+=x[0]+x[2]),L.height=b,L.lineHeight=B(y.textLineHeight,t.textLineHeight,b),L.textAlign=y&&y.textAlign||t.textAlign,L.textVerticalAlign=y&&y.textVerticalAlign||"middle",null!=f&&s+L.lineHeight>f)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<M&&(!C||A<S?(L.text="",L.textWidth=M=0):(L.text=R(L.text,A-S,T,c.ellipsis,{minChar:c.minChar}),L.textWidth=N(L.text,T),M=L.textWidth+S))),_+=L.width=M,y&&(g=Math.max(g,L.lineHeight))}m.width=_,s+=m.lineHeight=g,u=Math.max(u,_)}r.outerWidth=r.width=F(t.textWidth,u),r.outerHeight=r.height=F(t.textHeight,s),h&&(r.outerWidth+=h[1]+h[3],r.outerHeight+=h[0]+h[2]);for(p=0;p<l.length;p++){var L,D=(L=l[p]).percentWidth;L.width=parseInt(D,10)/100*u}return r}function I(e,t,r){for(var n=""===t,i=t.split("\n"),a=e.lines,o=0;o<i.length;o++){var s,u,l=i[o],h={styleName:r,text:l,isLineHolder:!l&&!n};o?a.push({tokens:[h]}):1===(u=(s=(a[a.length-1]||(a[0]={tokens:[]})).tokens).length)&&s[0].isLineHolder?s[0]=h:!l&&u&&!n||s.push(h)}}var y=r(82),O=r(173),n=r(13),i=n.getContext,l=n.extend,F=n.retrieve2,B=n.retrieve3,a=n.trim,u={},h=0,c=5e3,U=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g,d="12px sans-serif",o={measureText:function(e,t){var r=i();return r.font=t||d,r.measureText(e)}};t.DEFAULT_FONT=d,t.$override=function(e,t){o[e]=t},t.getWidth=N,t.getBoundingRect=function(e,t,r,n,i,a,o){return a?(u=n,l=v(e,{rich:a,truncate:o,font:t,textAlign:s=r,textPadding:i}),h=l.outerWidth,c=l.outerHeight,d=p(0,h,s),f=m(0,c,u),new y(d,f,h,c)):function(e,t,r,n,i,a){var o=_(e,t,i,a),s=N(e,t);i&&(s+=i[1]+i[3]);var u=o.outerHeight,l=p(0,s,r),h=m(0,u,n),c=new y(l,h,s,u);return c.lineHeight=o.lineHeight,c}(e,t,r,n,i,o);var s,u,l,h,c,d,f},t.adjustTextX=p,t.adjustTextY=m,t.adjustTextPositionOnRect=function(e,t,r){var n=t.x,i=t.y,a=t.height,o=t.width,s=a/2,u="left",l="top";switch(e){case"left":n-=r,i+=s,u="right",l="middle";break;case"right":n+=r+o,i+=s,l="middle";break;case"top":n+=o/2,i-=r,u="center",l="bottom";break;case"bottom":n+=o/2,i+=a+r,u="center";break;case"inside":n+=o/2,i+=s,u="center",l="middle";break;case"insideLeft":n+=r,i+=s,l="middle";break;case"insideRight":n+=o-r,i+=s,u="right",l="middle";break;case"insideTop":n+=o/2,i+=r,u="center";break;case"insideBottom":n+=o/2,i+=a-r,u="center",l="bottom";break;case"insideTopLeft":n+=r,i+=r;break;case"insideTopRight":n+=o-r,i+=r,u="right";break;case"insideBottomLeft":n+=r,i+=a-r,l="bottom";break;case"insideBottomRight":n+=o-r,i+=a-r,u="right",l="bottom"}return{x:n,y:i,textAlign:u,textVerticalAlign:l}},t.truncateText=R,t.getLineHeight=P,t.measureText=s,t.parsePlainText=_,t.parseRichText=v,t.makeFont=function(e){var t=(e.fontSize||e.fontFamily)&&[e.fontStyle,e.fontWeight,(e.fontSize||12)+"px",e.fontFamily||"sans-serif"].join(" ");return t&&a(t)||e.textFont||e.font}},function(e,t,r){function s(){var e=this.__cachedImgObj;this.onload=this.__cachedImgObj=null;for(var t=0;t<e.pending.length;t++){var r=e.pending[t],n=r.cb;n&&n(this,r.cbPayload),r.hostEl.dirty()}e.pending.length=0}function u(e){return e&&e.width&&e.height}var l=new(r(60))(50);t.findExistImage=function(e){if("string"!=typeof e)return e;var t=l.get(e);return t&&t.image},t.createOrUpdateImage=function(e,t,r,n,i){if(e){if("string"!=typeof e)return e;if(t&&t.__zrImageSrc===e||!r)return t;var a=l.get(e),o={hostEl:r,cb:n,cbPayload:i};return a?u(t=a.image)||a.pending.push(o):(t||(t=new Image),t.onload=s,l.put(e,t.__cachedImgObj={image:t,pending:[o]}),t.src=t.__zrImageSrc=e),t}return t},t.isImageReady=u},function(e,t,r){"use strict";function R(e,t,r){return"alphaMap"===r?e.material.get("diffuseMap"):"alphaCutoff"===r?e.material.isDefined("fragment","ALPHA_TEST")&&e.material.get("diffuseMap")&&e.material.get("alphaCutoff")||0:t.get(r)}function P(e,t){var r=e.material,n=t.material;return r.get("diffuseMap")!==n.get("diffuseMap")||(r.get("alphaCutoff")||0)!==(n.get("alphaCutoff")||0)}var n=r(7),a=r(11),v=r(3),y=r(18),i=r(59),I=r(9),O=r(52),o=r(8),s=r(19),u=r(10),l=r(4),h=r(5),c=r(27),F=r(41),d=r(37),f=r(16),p=r(86),B=r(21),m=r(175),x=["px","nx","py","ny","pz","nz"];o.a.import(m.a);var g,_,T,U,z,G,H,V,k,W,j=n.a.extend(function(){return{softShadow:j.PCF,shadowBlur:1,lightFrustumBias:"auto",kernelPCF:new Float32Array([1,0,1,1,-1,1,0,1,-1,0,-1,-1,1,-1,0,-1]),precision:"highp",_lastRenderNotCastShadow:!1,_frameBuffer:new u.a,_textures:{},_shadowMapNumber:{POINT_LIGHT:0,DIRECTIONAL_LIGHT:0,SPOT_LIGHT:0},_depthMaterials:{},_distanceMaterials:{},_receivers:[],_lightsCastShadow:[],_lightCameras:{},_lightMaterials:{},_texturePool:new p.a}},function(){this._gaussianPassH=new f.a({fragment:o.a.source("clay.compositor.gaussian_blur")}),this._gaussianPassV=new f.a({fragment:o.a.source("clay.compositor.gaussian_blur")}),this._gaussianPassH.setUniform("blurSize",this.shadowBlur),this._gaussianPassH.setUniform("blurDir",0),this._gaussianPassV.setUniform("blurSize",this.shadowBlur),this._gaussianPassV.setUniform("blurDir",1),this._outputDepthPass=new f.a({fragment:o.a.source("clay.sm.debug_depth")})},{render:function(e,t,r,n){r=r||t.getMainCamera(),this.trigger("beforerender",this,e,t,r),this._renderShadowPass(e,t,r,n),this.trigger("afterrender",this,e,t,r)},renderDebug:function(e,t){e.saveClear();var r,n=e.viewport,i=0,a=t||n.width/4,o=a;for(r in this.softShadow===j.VSM?this._outputDepthPass.material.define("fragment","USE_VSM"):this._outputDepthPass.material.undefine("fragment","USE_VSM"),this._textures){var s=this._textures[r];e.setViewport(i,0,a*s.width/s.height,o),this._outputDepthPass.setUniform("depthMap",s),this._outputDepthPass.render(e),i+=a*s.width/s.height}e.setViewport(n),e.restoreClear()},_updateReceivers:function(e,t){var r;t.receiveShadow?(this._receivers.push(t),t.material.set("shadowEnabled",1),t.material.set("pcfKernel",this.kernelPCF)):t.material.set("shadowEnabled",0),this.softShadow===j.VSM?(t.material.define("fragment","USE_VSM"),t.material.undefine("fragment","PCF_KERNEL_SIZE")):(t.material.undefine("fragment","USE_VSM"),(r=this.kernelPCF)&&r.length?t.material.define("fragment","PCF_KERNEL_SIZE",r.length/2):t.material.undefine("fragment","PCF_KERNEL_SIZE"))},_update:function(t,e){var r=this;e.traverse(function(e){e.isRenderable()&&r._updateReceivers(t,e)});for(var n=0;n<e.lights.length;n++){var i=e.lights[n];i.castShadow&&!i.invisible&&this._lightsCastShadow.push(i)}},_renderShadowPass:function(e,t,r,n){function i(e){return e.height}for(var a in this._shadowMapNumber)this._shadowMapNumber[a]=0;this._lightsCastShadow.length=0,this._receivers.length=0;var o=e.gl;if(n||t.update(),r&&r.update(),t.updateLights(),this._update(e,t),this._lightsCastShadow.length||!this._lastRenderNotCastShadow){this._lastRenderNotCastShadow=0===this._lightsCastShadow,o.enable(o.DEPTH_TEST),o.depthMask(!0),o.disable(o.BLEND),o.clearColor(1,1,1,1);for(var s,u,l=[],h=[],c=[],d=[],f=[],p=[],m=0;m<this._lightsCastShadow.length;m++){var g=this._lightsCastShadow[m];if("DIRECTIONAL_LIGHT"===g.type){if(s){console.warn("Only one direectional light supported with shadow cascade");continue}if(4<g.shadowCascade){console.warn("Support at most 4 cascade");continue}1<g.shadowCascade&&(s=g),this.renderDirectionalLightShadow(e,t,r,g,f,d,c)}else"SPOT_LIGHT"===g.type?this.renderSpotLightShadow(e,t,g,h,l):"POINT_LIGHT"===g.type&&this.renderPointLightShadow(e,t,g,p);this._shadowMapNumber[g.type]++}for(u in this._shadowMapNumber)for(var _=this._shadowMapNumber[u],v=u+"_SHADOWMAP_COUNT",m=0;m<this._receivers.length;m++){(y=this._receivers[m].material).fragmentDefines[v]!==_&&(0<_?y.define("fragment",v,_):y.isDefined("fragment",v)&&y.undefine("fragment",v))}for(m=0;m<this._receivers.length;m++){var y=this._receivers[m].material;s?y.define("fragment","SHADOW_CASCADE",s.shadowCascade):y.undefine("fragment","SHADOW_CASCADE")}var x,T,b,w,E=t.shadowUniforms;0<c.length&&(x=c.map(i),E.directionalLightShadowMaps={value:c,type:"tv"},E.directionalLightMatrices={value:d,type:"m4v"},E.directionalLightShadowMapSizes={value:x,type:"1fv"},s&&(T=f.slice(),b=f.slice(),T.pop(),b.shift(),T.reverse(),b.reverse(),d.reverse(),E.shadowCascadeClipsNear={value:T,type:"1fv"},E.shadowCascadeClipsFar={value:b,type:"1fv"})),0<l.length&&(w=l.map(i),(E=t.shadowUniforms).spotLightShadowMaps={value:l,type:"tv"},E.spotLightMatrices={value:h,type:"m4v"},E.spotLightShadowMapSizes={value:w,type:"1fv"}),0<p.length&&(E.pointLightShadowMaps={value:p,type:"tv"})}},renderDirectionalLightShadow:(U=new i.a,z=new I.a,G=new y.a,H=new I.a,V=new I.a,k=new I.a,W=new I.a,function(e,t,r,n,i,a,o){var s,u=this._getDepthMaterial(n),l={getMaterial:function(e){return e.shadowDepthMaterial||u},isMaterialChanged:P,getUniform:R,ifRender:function(e){return e.castShadow},sortCompare:O.a.opaqueSortCompare};t.viewBoundingBoxLastFrame.isFinite()||(s=t.getBoundingBox(),t.viewBoundingBoxLastFrame.copy(s).applyTransform(r.viewMatrix));var h=Math.min(-t.viewBoundingBoxLastFrame.min.z,r.far),c=Math.max(-t.viewBoundingBoxLastFrame.max.z,r.near),d=this._getDirectionalLightCamera(n,t,r),f=k.array;W.copy(d.projectionMatrix),B.a.invert(V.array,d.worldTransform.array),B.a.multiply(V.array,V.array,r.worldTransform.array),B.a.multiply(f,W.array,V.array);for(var p=[],m=r instanceof F.a,g=(r.near+r.far)/(r.near-r.far),_=2*r.near*r.far/(r.near-r.far),v=0;v<=n.shadowCascade;v++){var y=c*Math.pow(h/c,v/n.shadowCascade),x=c+(h-c)*v/n.shadowCascade,T=y*n.cascadeSplitLogFactor+x*(1-n.cascadeSplitLogFactor);p.push(T),i.push(-(-T*g+_)/-T)}var b=this._getTexture(n,n.shadowCascade);o.push(b);var w=e.viewport,E=e.gl;this._frameBuffer.attach(b),this._frameBuffer.bind(e),E.clear(E.COLOR_BUFFER_BIT|E.DEPTH_BUFFER_BIT);for(v=0;v<n.shadowCascade;v++){var S=p[v],A=p[v+1];m?B.a.perspective(z.array,r.fov/180*Math.PI,r.aspect,S,A):B.a.ortho(z.array,r.left,r.right,r.bottom,r.top,S,A),U.setFromProjection(z),U.getTransformedBoundingBox(G,V),G.applyProjection(W);var M=G.min.array,C=G.max.array;M[0]=Math.max(M[0],-1),M[1]=Math.max(M[1],-1),C[0]=Math.min(C[0],1),C[1]=Math.min(C[1],1),H.ortho(M[0],C[0],M[1],C[1],1,-1),d.projectionMatrix.multiplyLeft(H);var L=n.shadowResolution||512;e.setViewport((n.shadowCascade-v-1)*L,0,L,L,1);var D=t.updateRenderList(d);e.renderPass(D.opaque,d,l),this.softShadow===j.VSM&&this._gaussianFilter(e,b,b.width);var N=new I.a;N.copy(d.viewMatrix).multiplyLeft(d.projectionMatrix),a.push(N.array),d.projectionMatrix.copy(W)}this._frameBuffer.unbind(e),e.setViewport(w)}),renderSpotLightShadow:function(e,t,r,n,i){var a=this._getTexture(r),o=this._getSpotLightCamera(r),s=e.gl;this._frameBuffer.attach(a),this._frameBuffer.bind(e),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT);var u=this._getDepthMaterial(r),l={getMaterial:function(e){return e.shadowDepthMaterial||u},isMaterialChanged:P,getUniform:R,ifRender:function(e){return e.castShadow},sortCompare:O.a.opaqueSortCompare},h=t.updateRenderList(o);e.renderPass(h.opaque,o,l),this._frameBuffer.unbind(e),this.softShadow===j.VSM&&this._gaussianFilter(e,a,a.width);var c=new I.a;c.copy(o.worldTransform).invert().multiplyLeft(o.projectionMatrix),i.push(a),n.push(c.array)},renderPointLightShadow:function(e,t,r,n){var i=this._getTexture(r),a=e.gl;n.push(i);var o=this._getDepthMaterial(r),s={getMaterial:function(e){return e.shadowDepthMaterial||o},getUniform:R,sortCompare:O.a.opaqueSortCompare},h={px:[],py:[],pz:[],nx:[],ny:[],nz:[]},c=new y.a,d=r.getWorldPosition().array,f=new y.a,u=r.range;f.min.setArray(d),f.max.setArray(d);var l=new v.a(u,u,u);f.max.add(l),f.min.sub(l);var p={px:!1,py:!1,pz:!1,nx:!1,ny:!1,nz:!1};t.traverse(function(e){if(e.isRenderable()&&e.castShadow){var t=e.geometry;if(!t.boundingBox){for(var r=0;r<x.length;r++)h[x[r]].push(e);return}if(c.transformFrom(t.boundingBox,e.worldTransform),!c.intersectBoundingBox(f))return;c.updateVertices();for(r=0;r<x.length;r++)p[x[r]]=!1;for(r=0;r<8;r++){var n=c.vertices[r],i=n[0]-d[0],a=n[1]-d[1],o=n[2]-d[2],s=Math.abs(i),u=Math.abs(a),l=Math.abs(o);u<s?l<s?p[0<i?"px":"nx"]=!0:p[0<o?"pz":"nz"]=!0:l<u?p[0<a?"py":"ny"]=!0:p[0<o?"pz":"nz"]=!0}for(r=0;r<x.length;r++)p[x[r]]&&h[x[r]].push(e)}});for(var m=0;m<6;m++){var g=x[m],_=this._getPointLightCamera(r,g);this._frameBuffer.attach(i,a.COLOR_ATTACHMENT0,a.TEXTURE_CUBE_MAP_POSITIVE_X+m),this._frameBuffer.bind(e),a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT),e.renderPass(h[g],_,s)}this._frameBuffer.unbind(e)},_getDepthMaterial:function(e){var t,r=this._lightMaterials[e.__uid__],n="POINT_LIGHT"===e.type;return r||(t=n?"clay.sm.distance.":"clay.sm.depth.",r=new s.a({precision:this.precision,shader:new o.a(o.a.source(t+"vertex"),o.a.source(t+"fragment"))}),this._lightMaterials[e.__uid__]=r),null!=e.shadowSlopeScale&&r.setUniform("slopeScale",e.shadowSlopeScale),null!=e.shadowBias&&r.setUniform("bias",e.shadowBias),this.softShadow===j.VSM?r.define("fragment","USE_VSM"):r.undefine("fragment","USE_VSM"),n&&(r.set("lightPosition",e.getWorldPosition().array),r.set("range",e.range)),r},_gaussianFilter:function(e,t,r){var n={width:r,height:r,type:l.a.FLOAT},i=this._texturePool.get(n);this._frameBuffer.attach(i),this._frameBuffer.bind(e),this._gaussianPassH.setUniform("texture",t),this._gaussianPassH.setUniform("textureWidth",r),this._gaussianPassH.render(e),this._frameBuffer.attach(t),this._gaussianPassV.setUniform("texture",i),this._gaussianPassV.setUniform("textureHeight",r),this._gaussianPassV.render(e),this._frameBuffer.unbind(e),this._texturePool.put(i)},_getTexture:function(e,t){var r=e.__uid__,n=this._textures[r],i=e.shadowResolution||512;return t=t||1,n||((n="POINT_LIGHT"===e.type?new c.a:new h.a).width=i*t,n.height=i,this.softShadow===j.VSM?(n.type=l.a.FLOAT,n.anisotropic=4):(n.minFilter=a.a.NEAREST,n.magFilter=a.a.NEAREST,n.useMipmap=!1),this._textures[r]=n),n},_getPointLightCamera:function(e,t){this._lightCameras.point||(this._lightCameras.point={px:new F.a,nx:new F.a,py:new F.a,ny:new F.a,pz:new F.a,nz:new F.a});var r=this._lightCameras.point[t];switch(r.far=e.range,r.fov=90,r.position.set(0,0,0),t){case"px":r.lookAt(v.a.POSITIVE_X,v.a.NEGATIVE_Y);break;case"nx":r.lookAt(v.a.NEGATIVE_X,v.a.NEGATIVE_Y);break;case"py":r.lookAt(v.a.POSITIVE_Y,v.a.POSITIVE_Z);break;case"ny":r.lookAt(v.a.NEGATIVE_Y,v.a.NEGATIVE_Z);break;case"pz":r.lookAt(v.a.POSITIVE_Z,v.a.NEGATIVE_Y);break;case"nz":r.lookAt(v.a.NEGATIVE_Z,v.a.NEGATIVE_Y)}return e.getWorldPosition(r.position),r.update(),r},_getDirectionalLightCamera:(g=new I.a,_=new y.a,T=new y.a,function(e,t,r){this._lightCameras.directional||(this._lightCameras.directional=new d.a);var n=this._lightCameras.directional;_.copy(t.viewBoundingBoxLastFrame),_.intersection(r.frustum.boundingBox),n.position.copy(_.min).add(_.max).scale(.5).transformMat4(r.worldTransform),n.rotation.copy(e.rotation),n.scale.copy(e.scale),n.updateWorldTransform(),I.a.invert(g,n.worldTransform),I.a.multiply(g,g,r.worldTransform),T.copy(_).applyTransform(g);var i=T.min.array,a=T.max.array;return n.position.set((i[0]+a[0])/2,(i[1]+a[1])/2,a[2]).transformMat4(n.worldTransform),n.near=0,n.far=-i[2]+a[2],isNaN(this.lightFrustumBias)?n.far*=4:n.far+=this.lightFrustumBias,n.left=i[0],n.right=a[0],n.top=a[1],n.bottom=i[1],n.update(!0),n}),_getSpotLightCamera:function(e){this._lightCameras.spot||(this._lightCameras.spot=new F.a);var t=this._lightCameras.spot;return t.fov=2*e.penumbraAngle,t.far=e.range,t.worldTransform.copy(e.worldTransform),t.updateProjectionMatrix(),B.a.invert(t.viewMatrix.array,t.worldTransform.array),t},dispose:function(e){var t,r=e.gl||e;for(t in this._frameBuffer&&this._frameBuffer.dispose(r),this._textures)this._textures[t].dispose(r);this._texturePool.clear(e.gl),this._depthMaterials={},this._distanceMaterials={},this._textures={},this._lightCameras={},this._shadowMapNumber={POINT_LIGHT:0,DIRECTIONAL_LIGHT:0,SPOT_LIGHT:0},this._meshMaterials={};for(var n=0;n<this._receivers.length;n++){var i,a=this._receivers[n];a.material&&((i=a.material).undefine("fragment","POINT_LIGHT_SHADOW_COUNT"),i.undefine("fragment","DIRECTIONAL_LIGHT_SHADOW_COUNT"),i.undefine("fragment","AMBIENT_LIGHT_SHADOW_COUNT"),i.set("shadowEnabled",0))}this._receivers=[],this._lightsCastShadow=[]}});j.VSM=1,j.PCF=2,t.a=j},function(e,t,r){"use strict";t.a="@export clay.sm.depth.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nattribute vec3 position : POSITION;\nattribute vec2 texcoord : TEXCOORD_0;\n@import clay.chunk.skinning_header\nvarying vec4 v_ViewPosition;\nvarying vec2 v_Texcoord;\nvoid main(){\n vec3 skinnedPosition = position;\n#ifdef SKINNING\n @import clay.chunk.skin_matrix\n skinnedPosition = (skinMatrixWS * vec4(position, 1.0)).xyz;\n#endif\n v_ViewPosition = worldViewProjection * vec4(skinnedPosition, 1.0);\n gl_Position = v_ViewPosition;\n v_Texcoord = texcoord;\n}\n@end\n@export clay.sm.depth.fragment\nvarying vec4 v_ViewPosition;\nvarying vec2 v_Texcoord;\nuniform float bias : 0.001;\nuniform float slopeScale : 1.0;\nuniform sampler2D alphaMap;\nuniform float alphaCutoff: 0.0;\n@import clay.util.encode_float\nvoid main(){\n float depth = v_ViewPosition.z / v_ViewPosition.w;\n if (alphaCutoff > 0.0) {\n if (texture2D(alphaMap, v_Texcoord).a <= alphaCutoff) {\n discard;\n }\n }\n#ifdef USE_VSM\n depth = depth * 0.5 + 0.5;\n float moment1 = depth;\n float moment2 = depth * depth;\n float dx = dFdx(depth);\n float dy = dFdy(depth);\n moment2 += 0.25*(dx*dx+dy*dy);\n gl_FragColor = vec4(moment1, moment2, 0.0, 1.0);\n#else\n float dx = dFdx(depth);\n float dy = dFdy(depth);\n depth += sqrt(dx*dx + dy*dy) * slopeScale + bias;\n gl_FragColor = encodeFloat(depth * 0.5 + 0.5);\n#endif\n}\n@end\n@export clay.sm.debug_depth\nuniform sampler2D depthMap;\nvarying vec2 v_Texcoord;\n@import clay.util.decode_float\nvoid main() {\n vec4 tex = texture2D(depthMap, v_Texcoord);\n#ifdef USE_VSM\n gl_FragColor = vec4(tex.rgb, 1.0);\n#else\n float depth = decodeFloat(tex);\n gl_FragColor = vec4(depth, depth, depth, 1.0);\n#endif\n}\n@end\n@export clay.sm.distance.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform mat4 world : WORLD;\nattribute vec3 position : POSITION;\n@import clay.chunk.skinning_header\nvarying vec3 v_WorldPosition;\nvoid main (){\n vec3 skinnedPosition = position;\n#ifdef SKINNING\n @import clay.chunk.skin_matrix\n skinnedPosition = (skinMatrixWS * vec4(position, 1.0)).xyz;\n#endif\n gl_Position = worldViewProjection * vec4(skinnedPosition , 1.0);\n v_WorldPosition = (world * vec4(skinnedPosition, 1.0)).xyz;\n}\n@end\n@export clay.sm.distance.fragment\nuniform vec3 lightPosition;\nuniform float range : 100;\nvarying vec3 v_WorldPosition;\n@import clay.util.encode_float\nvoid main(){\n float dist = distance(lightPosition, v_WorldPosition);\n#ifdef USE_VSM\n gl_FragColor = vec4(dist, dist * dist, 0.0, 0.0);\n#else\n dist = dist / range;\n gl_FragColor = encodeFloat(dist);\n#endif\n}\n@end\n@export clay.plugin.shadow_map_common\n@import clay.util.decode_float\nfloat tapShadowMap(sampler2D map, vec2 uv, float z){\n vec4 tex = texture2D(map, uv);\n return step(z, decodeFloat(tex) * 2.0 - 1.0);\n}\nfloat pcf(sampler2D map, vec2 uv, float z, float textureSize, vec2 scale) {\n float shadowContrib = tapShadowMap(map, uv, z);\n vec2 offset = vec2(1.0 / textureSize) * scale;\n#ifdef PCF_KERNEL_SIZE\n for (int _idx_ = 0; _idx_ < PCF_KERNEL_SIZE; _idx_++) {{\n shadowContrib += tapShadowMap(map, uv + offset * pcfKernel[_idx_], z);\n }}\n return shadowContrib / float(PCF_KERNEL_SIZE + 1);\n#else\n shadowContrib += tapShadowMap(map, uv+vec2(offset.x, 0.0), z);\n shadowContrib += tapShadowMap(map, uv+vec2(offset.x, offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(-offset.x, offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(0.0, offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(-offset.x, 0.0), z);\n shadowContrib += tapShadowMap(map, uv+vec2(-offset.x, -offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(offset.x, -offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(0.0, -offset.y), z);\n return shadowContrib / 9.0;\n#endif\n}\nfloat pcf(sampler2D map, vec2 uv, float z, float textureSize) {\n return pcf(map, uv, z, textureSize, vec2(1.0));\n}\nfloat chebyshevUpperBound(vec2 moments, float z){\n float p = 0.0;\n z = z * 0.5 + 0.5;\n if (z <= moments.x) {\n p = 1.0;\n }\n float variance = moments.y - moments.x * moments.x;\n variance = max(variance, 0.0000001);\n float mD = moments.x - z;\n float pMax = variance / (variance + mD * mD);\n pMax = clamp((pMax-0.4)/(1.0-0.4), 0.0, 1.0);\n return max(p, pMax);\n}\nfloat computeShadowContrib(\n sampler2D map, mat4 lightVPM, vec3 position, float textureSize, vec2 scale, vec2 offset\n) {\n vec4 posInLightSpace = lightVPM * vec4(position, 1.0);\n posInLightSpace.xyz /= posInLightSpace.w;\n float z = posInLightSpace.z;\n if(all(greaterThan(posInLightSpace.xyz, vec3(-0.99, -0.99, -1.0))) &&\n all(lessThan(posInLightSpace.xyz, vec3(0.99, 0.99, 1.0)))){\n vec2 uv = (posInLightSpace.xy+1.0) / 2.0;\n #ifdef USE_VSM\n vec2 moments = texture2D(map, uv * scale + offset).xy;\n return chebyshevUpperBound(moments, z);\n #else\n return pcf(map, uv * scale + offset, z, textureSize, scale);\n #endif\n }\n return 1.0;\n}\nfloat computeShadowContrib(sampler2D map, mat4 lightVPM, vec3 position, float textureSize) {\n return computeShadowContrib(map, lightVPM, position, textureSize, vec2(1.0), vec2(0.0));\n}\nfloat computeShadowContribOmni(samplerCube map, vec3 direction, float range)\n{\n float dist = length(direction);\n vec4 shadowTex = textureCube(map, direction);\n#ifdef USE_VSM\n vec2 moments = shadowTex.xy;\n float variance = moments.y - moments.x * moments.x;\n float mD = moments.x - dist;\n float p = variance / (variance + mD * mD);\n if(moments.x + 0.001 < dist){\n return clamp(p, 0.0, 1.0);\n }else{\n return 1.0;\n }\n#else\n return step(dist, (decodeFloat(shadowTex) + 0.0002) * range);\n#endif\n}\n@end\n@export clay.plugin.compute_shadow_map\n#if defined(SPOT_LIGHT_SHADOWMAP_COUNT) || defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT) || defined(POINT_LIGHT_SHADOWMAP_COUNT)\n#ifdef SPOT_LIGHT_SHADOWMAP_COUNT\nuniform sampler2D spotLightShadowMaps[SPOT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\nuniform mat4 spotLightMatrices[SPOT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\nuniform float spotLightShadowMapSizes[SPOT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\n#endif\n#ifdef DIRECTIONAL_LIGHT_SHADOWMAP_COUNT\n#if defined(SHADOW_CASCADE)\nuniform sampler2D directionalLightShadowMaps[1]:unconfigurable;\nuniform mat4 directionalLightMatrices[SHADOW_CASCADE]:unconfigurable;\nuniform float directionalLightShadowMapSizes[1]:unconfigurable;\nuniform float shadowCascadeClipsNear[SHADOW_CASCADE]:unconfigurable;\nuniform float shadowCascadeClipsFar[SHADOW_CASCADE]:unconfigurable;\n#else\nuniform sampler2D directionalLightShadowMaps[DIRECTIONAL_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\nuniform mat4 directionalLightMatrices[DIRECTIONAL_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\nuniform float directionalLightShadowMapSizes[DIRECTIONAL_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\n#endif\n#endif\n#ifdef POINT_LIGHT_SHADOWMAP_COUNT\nuniform samplerCube pointLightShadowMaps[POINT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\n#endif\nuniform bool shadowEnabled : true;\n#ifdef PCF_KERNEL_SIZE\nuniform vec2 pcfKernel[PCF_KERNEL_SIZE];\n#endif\n@import clay.plugin.shadow_map_common\n#if defined(SPOT_LIGHT_SHADOWMAP_COUNT)\nvoid computeShadowOfSpotLights(vec3 position, inout float shadowContribs[SPOT_LIGHT_COUNT] ) {\n float shadowContrib;\n for(int _idx_ = 0; _idx_ < SPOT_LIGHT_SHADOWMAP_COUNT; _idx_++) {{\n shadowContrib = computeShadowContrib(\n spotLightShadowMaps[_idx_], spotLightMatrices[_idx_], position,\n spotLightShadowMapSizes[_idx_]\n );\n shadowContribs[_idx_] = shadowContrib;\n }}\n for(int _idx_ = SPOT_LIGHT_SHADOWMAP_COUNT; _idx_ < SPOT_LIGHT_COUNT; _idx_++){{\n shadowContribs[_idx_] = 1.0;\n }}\n}\n#endif\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n#ifdef SHADOW_CASCADE\nvoid computeShadowOfDirectionalLights(vec3 position, inout float shadowContribs[DIRECTIONAL_LIGHT_COUNT]){\n float depth = (2.0 * gl_FragCoord.z - gl_DepthRange.near - gl_DepthRange.far)\n / (gl_DepthRange.far - gl_DepthRange.near);\n float shadowContrib;\n shadowContribs[0] = 1.0;\n for (int _idx_ = 0; _idx_ < SHADOW_CASCADE; _idx_++) {{\n if (\n depth >= shadowCascadeClipsNear[_idx_] &&\n depth <= shadowCascadeClipsFar[_idx_]\n ) {\n shadowContrib = computeShadowContrib(\n directionalLightShadowMaps[0], directionalLightMatrices[_idx_], position,\n directionalLightShadowMapSizes[0],\n vec2(1.0 / float(SHADOW_CASCADE), 1.0),\n vec2(float(_idx_) / float(SHADOW_CASCADE), 0.0)\n );\n shadowContribs[0] = shadowContrib;\n }\n }}\n for(int _idx_ = DIRECTIONAL_LIGHT_SHADOWMAP_COUNT; _idx_ < DIRECTIONAL_LIGHT_COUNT; _idx_++) {{\n shadowContribs[_idx_] = 1.0;\n }}\n}\n#else\nvoid computeShadowOfDirectionalLights(vec3 position, inout float shadowContribs[DIRECTIONAL_LIGHT_COUNT]){\n float shadowContrib;\n for(int _idx_ = 0; _idx_ < DIRECTIONAL_LIGHT_SHADOWMAP_COUNT; _idx_++) {{\n shadowContrib = computeShadowContrib(\n directionalLightShadowMaps[_idx_], directionalLightMatrices[_idx_], position,\n directionalLightShadowMapSizes[_idx_]\n );\n shadowContribs[_idx_] = shadowContrib;\n }}\n for(int _idx_ = DIRECTIONAL_LIGHT_SHADOWMAP_COUNT; _idx_ < DIRECTIONAL_LIGHT_COUNT; _idx_++) {{\n shadowContribs[_idx_] = 1.0;\n }}\n}\n#endif\n#endif\n#if defined(POINT_LIGHT_SHADOWMAP_COUNT)\nvoid computeShadowOfPointLights(vec3 position, inout float shadowContribs[POINT_LIGHT_COUNT] ){\n vec3 lightPosition;\n vec3 direction;\n for(int _idx_ = 0; _idx_ < POINT_LIGHT_SHADOWMAP_COUNT; _idx_++) {{\n lightPosition = pointLightPosition[_idx_];\n direction = position - lightPosition;\n shadowContribs[_idx_] = computeShadowContribOmni(pointLightShadowMaps[_idx_], direction, pointLightRange[_idx_]);\n }}\n for(int _idx_ = POINT_LIGHT_SHADOWMAP_COUNT; _idx_ < POINT_LIGHT_COUNT; _idx_++) {{\n shadowContribs[_idx_] = 1.0;\n }}\n}\n#endif\n#endif\n@end"},function(e,t,r){"use strict";function n(){this._sourceTexture=new a.a({type:o.a.HALF_FLOAT}),this._depthTexture=new a.a({format:o.a.DEPTH_COMPONENT,type:o.a.UNSIGNED_INT}),this._framebuffer=new s.a,this._framebuffer.attach(this._sourceTexture),this._framebuffer.attach(this._depthTexture,s.a.DEPTH_ATTACHMENT),this._normalPass=new f.a,this._compositor=Object(u.a)(m.a);var e=this._compositor.getNodeByName("source");e.texture=this._sourceTexture;var t=this._compositor.getNodeByName("coc");this._sourceNode=e,this._cocNode=t,this._compositeNode=this._compositor.getNodeByName("composite"),this._fxaaNode=this._compositor.getNodeByName("FXAA"),this._dofBlurNodes=["dof_far_blur","dof_near_blur","dof_coc_blur"].map(function(e){return this._compositor.getNodeByName(e)},this),this._dofBlurKernel=0,this._dofBlurKernelSize=new Float32Array(0),this._finalNodesChain=C.map(function(e){return this._compositor.getNodeByName(e)},this);var r={normalTexture:this._normalPass.getNormalTexture(),depthTexture:this._normalPass.getDepthTexture()};this._ssaoPass=new l.a(r),this._ssrPass=new h.a(r),this._edgePass=new p.a(r)}var i=r(8),a=r(5),o=r(4),s=r(10),u=r(177),l=r(189),h=r(191),c=r(193),d=r(1),f=r(194),p=r(196),m=(r(9),r(197)),g=r(87),_=r(88),v=r(89),y=r(90),x=r(91),T=r(92),b=r(93),w=r(94),E=r(95),S=r(198),A=r(199);i.a.import(g.a),i.a.import(_.a),i.a.import(v.a),i.a.import(y.a),i.a.import(x.a),i.a.import(T.a),i.a.import(b.a),i.a.import(w.a),i.a.import(E.a),i.a.import(S.a),i.a.import(A.a);var M={color:{parameters:{width:function(e){return e.getWidth()},height:function(e){return e.getHeight()}}}},C=["composite","FXAA"];n.prototype.resize=function(e,t,r){var e=e*(r=r||1),t=t*r,n=this._sourceTexture,i=this._depthTexture;n.width=e,n.height=t,i.width=e,i.height=t},n.prototype._ifRenderNormalPass=function(){return this._enableSSAO||this._enableEdge||this._enableSSR},n.prototype._getPrevNode=function(e){for(var t=C.indexOf(e.name)-1,r=this._finalNodesChain[t];r&&!this._compositor.getNodeByName(r.name);)--t,r=this._finalNodesChain[t];return r},n.prototype._getNextNode=function(e){for(var t=C.indexOf(e.name)+1,r=this._finalNodesChain[t];r&&!this._compositor.getNodeByName(r.name);)t+=1,r=this._finalNodesChain[t];return r},n.prototype._addChainNode=function(e){var t=this._getPrevNode(e),r=this._getNextNode(e);t&&(t.outputs=M,e.inputs.texture=t.name,r?(e.outputs=M,r.inputs.texture=e.name):e.outputs=null,this._compositor.addNode(e))},n.prototype._removeChainNode=function(e){var t=this._getPrevNode(e),r=this._getNextNode(e);t&&(r?(t.outputs=M,r.inputs.texture=t.name):t.outputs=null,this._compositor.removeNode(e))},n.prototype.updateNormal=function(e,t,r,n){this._ifRenderNormalPass()&&this._normalPass.update(e,t,r)},n.prototype.updateSSAO=function(e,t,r,n){this._ssaoPass.update(e,r,n)},n.prototype.enableSSAO=function(){this._enableSSAO=!0},n.prototype.disableSSAO=function(){this._enableSSAO=!1},n.prototype.enableSSR=function(){this._enableSSR=!0},n.prototype.disableSSR=function(){this._enableSSR=!1},n.prototype.getSSAOTexture=function(){return this._ssaoPass.getTargetTexture()},n.prototype.getSourceFrameBuffer=function(){return this._framebuffer},n.prototype.getSourceTexture=function(){return this._sourceTexture},n.prototype.disableFXAA=function(){this._removeChainNode(this._fxaaNode)},n.prototype.enableFXAA=function(){this._addChainNode(this._fxaaNode)},n.prototype.enableBloom=function(){this._compositeNode.inputs.bloom="bloom_composite",this._compositor.dirty()},n.prototype.disableBloom=function(){this._compositeNode.inputs.bloom=null,this._compositor.dirty()},n.prototype.enableDOF=function(){this._compositeNode.inputs.texture="dof_composite",this._compositor.dirty()},n.prototype.disableDOF=function(){this._compositeNode.inputs.texture="source",this._compositor.dirty()},n.prototype.enableColorCorrection=function(){this._compositeNode.define("COLOR_CORRECTION"),this._enableColorCorrection=!0},n.prototype.disableColorCorrection=function(){this._compositeNode.undefine("COLOR_CORRECTION"),this._enableColorCorrection=!1},n.prototype.enableEdge=function(){this._enableEdge=!0},n.prototype.disableEdge=function(){this._enableEdge=!1},n.prototype.setBloomIntensity=function(e){this._compositeNode.setParameter("bloomIntensity",e)},n.prototype.setSSAOParameter=function(e,t){switch(e){case"quality":var r={low:6,medium:12,high:32,ultra:62}[t]||12;this._ssaoPass.setParameter("kernelSize",r);break;case"radius":this._ssaoPass.setParameter(e,t),this._ssaoPass.setParameter("bias",t/200);break;case"intensity":this._ssaoPass.setParameter(e,t)}},n.prototype.setDOFParameter=function(e,t){switch(e){case"focalDistance":case"focalRange":case"fstop":this._cocNode.setParameter(e,t);break;case"blurRadius":for(var r=0;r<this._dofBlurNodes.length;r++)this._dofBlurNodes[r].setParameter("blurRadius",t);break;case"quality":var n={low:4,medium:8,high:16,ultra:32}[t]||8;this._dofBlurKernelSize=n;for(r=0;r<this._dofBlurNodes.length;r++)this._dofBlurNodes[r].pass.material.define("POISSON_KERNEL_SIZE",n);this._dofBlurKernel=new Float32Array(2*n)}},n.prototype.setSSRParameter=function(e,t){if(null!=t)switch(e){case"quality":var r={low:10,medium:15,high:30,ultra:80}[t]||20,n={low:32,medium:16,high:8,ultra:4}[t]||16;this._ssrPass.setParameter("maxIteration",r),this._ssrPass.setParameter("pixelStride",n);break;case"maxRoughness":this._ssrPass.setParameter("minGlossiness",Math.max(Math.min(1-t,1),0));break;case"physical":this.setPhysicallyCorrectSSR(t);break;default:console.warn("Unkown SSR parameter "+e)}},n.prototype.setPhysicallyCorrectSSR=function(e){this._ssrPass.setPhysicallyCorrect(e)},n.prototype.setEdgeColor=function(e){var t=d.a.parseColor(e);this._edgePass.setParameter("edgeColor",t)},n.prototype.setExposure=function(e){this._compositeNode.setParameter("exposure",Math.pow(2,e))},n.prototype.setColorLookupTexture=function(e,t){this._compositeNode.pass.material.setTextureImage("lut",this._enableColorCorrection?e:"none",t,{minFilter:d.a.Texture.NEAREST,magFilter:d.a.Texture.NEAREST,flipY:!1})},n.prototype.setColorCorrection=function(e,t){this._compositeNode.setParameter(e,t)},n.prototype.isSSREnabled=function(){return this._enableSSR},n.prototype.composite=function(e,t,r,n,i){var a=this._sourceTexture,o=a;this._enableEdge&&(this._edgePass.update(e,r,a,i),a=o=this._edgePass.getTargetTexture()),this._enableSSR&&(this._ssrPass.update(e,r,a,i),o=this._ssrPass.getTargetTexture(),this._ssrPass.setSSAOTexture(this._enableSSAO?this._ssaoPass.getTargetTexture():null)),this._sourceNode.texture=o,this._cocNode.setParameter("depth",this._depthTexture);for(var s=this._dofBlurKernel,u=this._dofBlurKernelSize,l=i%Math.floor(c.a.length/2/u),h=0;h<2*u;h++)s[h]=c.a[h+l*u*2];for(h=0;h<this._dofBlurNodes.length;h++)this._dofBlurNodes[h].setParameter("percent",i/30),this._dofBlurNodes[h].setParameter("poissonKernel",s);this._cocNode.setParameter("zNear",r.near),this._cocNode.setParameter("zFar",r.far),this._compositor.render(e,n)},n.prototype.dispose=function(e){this._sourceTexture.dispose(e),this._depthTexture.dispose(e),this._framebuffer.dispose(e),this._compositor.dispose(e),this._normalPass.dispose(e),this._ssaoPass.dispose(e)},t.a=n},function(e,t,r){"use strict";var n=r(178);t.a=n.a},function(e,t,r){"use strict";function i(e,t){return e}function a(e,t){return t}function f(r){var n={};if(!r)return n;["type","minFilter","magFilter","wrapS","wrapT","flipY","useMipmap"].forEach(function(e){var t=r[e];null!=t&&("string"==typeof t&&(t=u.a[t]),n[e]=t)});var o=r.scale||1;return["width","height"].forEach(function(e){var t,i,a;null!=r[e]&&("string"==typeof(t=r[e])?(t=t.trim(),n[e]=(i=p(t),a=(a=o)||1,function(e){var t=e.getDevicePixelRatio(),r=e.getWidth()*a,n=e.getHeight()*a;return i(r,n,t)})):n[e]=t)}),n.width||(n.width=i),n.height||(n.height=a),null!=r.useMipmap&&(n.useMipmap=r.useMipmap),n}function p(e){var t=/^expr\((.*)\)$/.exec(e);if(t)try{var r=new Function("width","height","dpr","return "+t[1]);return r(1,1),r}catch(e){throw new Error("Invalid expression.")}}var h=r(23),s=r(179),m=r(181),g=r(182),_=r(183),v=r(8),u=r(4),c=r(5),d=r(27),n=r(184);Object(n.a)(v.a);var y=/^#source\((.*?)\)/;t.a=function(r,n){var i=new s.a;function t(){for(var e=0;e<r.nodes.length;e++){var t=function(e,t,r){var n,i,a,o,s=e.type||"filter";if("filter"===s){var u=e.shader.trim(),l=y.exec(u);if(l?n=v.a.source(l[1].trim()):"#"===u.charAt(0)&&(n=t.shaders[u.substr(1)]),!(n=n||u))return}if(e.inputs)for(var h in i={},e.inputs)"string"==typeof e.inputs[h]?i[h]=e.inputs[h]:i[h]={node:e.inputs[h].node,pin:e.inputs[h].pin};if(e.outputs)for(var h in a={},e.outputs){var c=e.outputs[h];a[h]={},null!=c.attachment&&(a[h].attachment=c.attachment),null!=c.keepLastFrame&&(a[h].keepLastFrame=c.keepLastFrame),null!=c.outputLastFrame&&(a[h].outputLastFrame=c.outputLastFrame),c.parameters&&(a[h].parameters=f(c.parameters))}if(o="scene"===s?new m.a({name:e.name,scene:r.scene,camera:r.camera,outputs:a}):"texture"===s?new g.a({name:e.name,outputs:a}):new _.a({name:e.name,shader:n,inputs:i,outputs:a})){if(e.parameters)for(var h in e.parameters){"string"==typeof(d=e.parameters[h])&&("#"===(d=d.trim()).charAt(0)?d=t.textures[d.substr(1)]:o.on("beforerender",function(a,o){return function(e){var t=e.getDevicePixelRatio(),r=e.getWidth(),n=e.getHeight(),i=o(r,n,t);this.setParameter(a,i)}}(h,p(d)))),o.setParameter(h,d)}if(e.defines&&o.pass)for(var h in e.defines){var d=e.defines[h];o.pass.material.define("fragment",h,d)}}return o}(r.nodes[e],a,n);t&&i.addNode(t)}}n=n||{};var e,a={textures:{},parameters:{}};for(e in r.parameters){var o=r.parameters[e];a.parameters[e]=f(o)}return function(e,t,a){if(!e.textures)return a({});var o={},s=0,u=!1,l=t.textureRootPath;h.a.each(e.textures,function(e,t){var r,n=e.path,i=f(e.parameters);if(Array.isArray(n)&&6===n.length)l&&(n=n.map(function(e){return h.a.relative2absolute(e,l)})),r=new d.a(i);else{if("string"!=typeof n)return;l&&(n=h.a.relative2absolute(n,l)),r=new c.a(i)}r.load(n),s++,r.once("success",function(){o[t]=r,0==--s&&(a(o),u=!0)})}),0!==s||u||a(o)}(r,n,function(e){a.textures=e,t()}),i}},function(e,t,r){"use strict";var n=r(180),i=r(86),a=r(10),o=n.a.extend(function(){return{_outputs:[],_texturePool:new i.a,_frameBuffer:new a.a({depthBuffer:!1})}},{addNode:function(e){n.a.prototype.addNode.call(this,e),e._compositor=this},render:function(e,t){if(this._dirty){this.update(),this._dirty=!1;for(var r=this._outputs.length=0;r<this.nodes.length;r++)this.nodes[r].outputs||this._outputs.push(this.nodes[r])}for(r=0;r<this.nodes.length;r++)this.nodes[r].beforeFrame();for(r=0;r<this._outputs.length;r++)this._outputs[r].updateReference();for(r=0;r<this._outputs.length;r++)this._outputs[r].render(e,t);for(r=0;r<this.nodes.length;r++)this.nodes[r].afterFrame()},allocateTexture:function(e){return this._texturePool.get(e)},releaseTexture:function(e){this._texturePool.put(e)},getFrameBuffer:function(){return this._frameBuffer},dispose:function(e){this._texturePool.clear(e)}});t.a=o},function(e,t,r){"use strict";var n=r(7),a=r(48),i=n.a.extend(function(){return{nodes:[]}},{dirty:function(){this._dirty=!0},addNode:function(e){0<=this.nodes.indexOf(e)||(this.nodes.push(e),this._dirty=!0)},removeNode:function(e){"string"==typeof e&&(e=this.getNodeByName(e));var t=this.nodes.indexOf(e);0<=t&&(this.nodes.splice(t,1),this._dirty=!0)},getNodeByName:function(e){for(var t=0;t<this.nodes.length;t++)if(this.nodes[t].name===e)return this.nodes[t]},update:function(){for(var e=0;e<this.nodes.length;e++)this.nodes[e].clear();for(e=0;e<this.nodes.length;e++){var t,r,n=this.nodes[e];if(n.inputs)for(var i in n.inputs){n.inputs[i]&&(!n.pass||n.pass.material.isUniformEnabled(i)?(t=n.inputs[i],(r=this.findPin(t))?n.link(i,r.node,r.pin):"string"==typeof t?console.warn("Node "+t+" not exist"):console.warn("Pin of "+t.node+"."+t.pin+" not exist")):console.warn("Pin "+n.name+"."+i+" not used."))}}},findPin:function(e){var t;if(("string"==typeof e||e instanceof a.a)&&(e={node:e}),"string"==typeof e.node)for(var r=0;r<this.nodes.length;r++){var n=this.nodes[r];n.name===e.node&&(t=n)}else t=e.node;if(t){var i=e.pin;if(i||t.outputs&&(i=Object.keys(t.outputs)[0]),t.outputs[i])return{node:t,pin:i}}}});t.a=i},function(e,t,r){"use strict";var n=r(48),c=r(11),i=r(10),a=n.a.extend({name:"scene",scene:null,camera:null,autoUpdateScene:!0,preZ:!1},function(){this.frameBuffer=new i.a},{render:function(e){this._rendering=!0;var t,r=e.gl;if(this.trigger("beforerender"),this.outputs){var n,i=this.frameBuffer;for(n in this.outputs){var a=this.updateParameter(n,e),o=this.outputs[n],s=this._compositor.allocateTexture(a);this._outputTextures[n]=s,"string"==typeof(l=o.attachment||r.COLOR_ATTACHMENT0)&&(l=r[l]),i.attach(s,l)}i.bind(e);var u=e.getGLExtension("EXT_draw_buffers");if(u){var l,h=[];for(l in this.outputs)(l=parseInt(l))>=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;i<e;i++)for(var a=0;a<e;a++)n.set(2*Math.random()-1,2*Math.random()-1,0).normalize(),t[r++]=255*(.5*n.x+.5),t[r++]=255*(.5*n.y+.5),t[r++]=0,t[r++]=255;return t}function i(e){return new s.a({pixels:n(e),wrapS:u.a.REPEAT,wrapT:u.a.REPEAT,width:e,height:e})}function a(e){e=e||{},this._ssaoPass=new l.a({fragment:h.a.source("ecgl.ssao.estimate")}),this._blurPass=new l.a({fragment:h.a.source("ecgl.ssao.blur")}),this._framebuffer=new c.a({depthBuffer:!1}),this._ssaoTexture=new s.a,this._blurTexture=new s.a,this._blurTexture2=new s.a,this._depthTex=e.depthTexture,this._normalTex=e.normalTexture,this.setNoiseSize(4),this.setKernelSize(e.kernelSize||12),null!=e.radius&&this.setParameter("radius",e.radius),null!=e.power&&this.setParameter("power",e.power),this._normalTex||(this._ssaoPass.material.disableTexture("normalTex"),this._blurPass.material.disableTexture("normalTex")),this._depthTex||this._blurPass.material.disableTexture("depthTex"),this._blurPass.material.setUniform("normalTex",this._normalTex),this._blurPass.material.setUniform("depthTex",this._depthTex)}var d=r(9),o=r(3),s=r(5),u=r(4),l=r(16),h=r(8),c=r(10),f=r(49),p=r(190);h.a.import(p.a),a.prototype.setDepthTexture=function(e){this._depthTex=e},a.prototype.setNormalTexture=function(e){this._normalTex=e,this._ssaoPass.material[e?"enableTexture":"disableTexture"]("normalTex"),this.setKernelSize(this._kernelSize)},a.prototype.update=function(e,t,r){var n=e.getWidth(),i=e.getHeight(),a=this._ssaoPass,o=this._blurPass;a.setUniform("kernel",this._kernels[r%this._kernels.length]),a.setUniform("depthTex",this._depthTex),null!=this._normalTex&&a.setUniform("normalTex",this._normalTex),a.setUniform("depthTexSize",[this._depthTex.width,this._depthTex.height]);var s=new d.a;d.a.transpose(s,t.worldTransform),a.setUniform("projection",t.projectionMatrix.array),a.setUniform("projectionInv",t.invProjectionMatrix.array),a.setUniform("viewInverseTranspose",s.array);var u=this._ssaoTexture,l=this._blurTexture,h=this._blurTexture2;u.width=n/2,u.height=i/2,l.width=n,l.height=i,h.width=n,h.height=i,this._framebuffer.attach(u),this._framebuffer.bind(e),e.gl.clearColor(1,1,1,1),e.gl.clear(e.gl.COLOR_BUFFER_BIT),a.render(e),o.setUniform("textureSize",[n/2,i/2]),o.setUniform("projection",t.projectionMatrix.array),this._framebuffer.attach(l),o.setUniform("direction",0),o.setUniform("ssaoTexture",u),o.render(e),this._framebuffer.attach(h),o.setUniform("textureSize",[n,i]),o.setUniform("direction",1),o.setUniform("ssaoTexture",l),o.render(e),this._framebuffer.unbind(e);var c=e.clearColor;e.gl.clearColor(c[0],c[1],c[2],c[3])},a.prototype.getTargetTexture=function(){return this._blurTexture2},a.prototype.setParameter=function(e,t){"noiseTexSize"===e?this.setNoiseSize(t):"kernelSize"===e?this.setKernelSize(t):"intensity"===e?this._ssaoPass.material.set("intensity",t):this._ssaoPass.setUniform(e,t)},a.prototype.setKernelSize=function(e){this._kernelSize=e,this._ssaoPass.material.define("fragment","KERNEL_SIZE",e),this._kernels=this._kernels||[];for(var t=0;t<30;t++)this._kernels[t]=function(e,t,r){var n=new Float32Array(3*e);t=t||0;for(var i=0;i<e;i++){var a=Object(f.a)(i+t,2)*(r?1:2)*Math.PI,o=Object(f.a)(i+t,3)*Math.PI,s=Math.random(),u=Math.cos(a)*Math.sin(o)*s,l=Math.cos(o)*s,h=Math.sin(a)*Math.sin(o)*s;n[3*i]=u,n[3*i+1]=l,n[3*i+2]=h}return n}(e,t*e,!!this._normalTex)},a.prototype.setNoiseSize=function(e){var t=this._ssaoPass.getUniform("noiseTex");t?(t.data=n(e),t.width=t.height=e,t.dirty()):(t=i(e),this._ssaoPass.setUniform("noiseTex",i(e))),this._ssaoPass.setUniform("noiseTexSize",[e,e])},a.prototype.dispose=function(e){this._blurTexture.dispose(e),this._ssaoTexture.dispose(e),this._blurTexture2.dispose(e)},t.a=a},function(e,t,r){"use strict";t.a="@export ecgl.ssao.estimate\n\nuniform sampler2D depthTex;\n\nuniform sampler2D normalTex;\n\nuniform sampler2D noiseTex;\n\nuniform vec2 depthTexSize;\n\nuniform vec2 noiseTexSize;\n\nuniform mat4 projection;\n\nuniform mat4 projectionInv;\n\nuniform mat4 viewInverseTranspose;\n\nuniform vec3 kernel[KERNEL_SIZE];\n\nuniform float radius : 1;\n\nuniform float power : 1;\n\nuniform float bias: 1e-2;\n\nuniform float intensity: 1.0;\n\nvarying vec2 v_Texcoord;\n\nfloat ssaoEstimator(in vec3 originPos, in mat3 kernelBasis) {\n float occlusion = 0.0;\n\n for (int i = 0; i < KERNEL_SIZE; i++) {\n vec3 samplePos = kernel[i];\n#ifdef NORMALTEX_ENABLED\n samplePos = kernelBasis * samplePos;\n#endif\n samplePos = samplePos * radius + originPos;\n\n vec4 texCoord = projection * vec4(samplePos, 1.0);\n texCoord.xy /= texCoord.w;\n\n vec4 depthTexel = texture2D(depthTex, texCoord.xy * 0.5 + 0.5);\n\n float sampleDepth = depthTexel.r * 2.0 - 1.0;\n if (projection[3][3] == 0.0) {\n sampleDepth = projection[3][2] / (sampleDepth * projection[2][3] - projection[2][2]);\n }\n else {\n sampleDepth = (sampleDepth - projection[3][2]) / projection[2][2];\n }\n \n float rangeCheck = smoothstep(0.0, 1.0, radius / abs(originPos.z - sampleDepth));\n occlusion += rangeCheck * step(samplePos.z, sampleDepth - bias);\n }\n#ifdef NORMALTEX_ENABLED\n occlusion = 1.0 - occlusion / float(KERNEL_SIZE);\n#else\n occlusion = 1.0 - clamp((occlusion / float(KERNEL_SIZE) - 0.6) * 2.5, 0.0, 1.0);\n#endif\n return pow(occlusion, power);\n}\n\nvoid main()\n{\n\n vec4 depthTexel = texture2D(depthTex, v_Texcoord);\n\n#ifdef NORMALTEX_ENABLED\n vec4 tex = texture2D(normalTex, v_Texcoord);\n if (dot(tex.rgb, tex.rgb) == 0.0) {\n gl_FragColor = vec4(1.0);\n return;\n }\n vec3 N = tex.rgb * 2.0 - 1.0;\n N = (viewInverseTranspose * vec4(N, 0.0)).xyz;\n\n vec2 noiseTexCoord = depthTexSize / vec2(noiseTexSize) * v_Texcoord;\n vec3 rvec = texture2D(noiseTex, noiseTexCoord).rgb * 2.0 - 1.0;\n vec3 T = normalize(rvec - N * dot(rvec, N));\n vec3 BT = normalize(cross(N, T));\n mat3 kernelBasis = mat3(T, BT, N);\n#else\n if (depthTexel.r > 0.99999) {\n gl_FragColor = vec4(1.0);\n return;\n }\n mat3 kernelBasis;\n#endif\n\n float z = depthTexel.r * 2.0 - 1.0;\n\n vec4 projectedPos = vec4(v_Texcoord * 2.0 - 1.0, z, 1.0);\n vec4 p4 = projectionInv * projectedPos;\n\n vec3 position = p4.xyz / p4.w;\n\n float ao = ssaoEstimator(position, kernelBasis);\n ao = clamp(1.0 - (1.0 - ao) * intensity, 0.0, 1.0);\n gl_FragColor = vec4(vec3(ao), 1.0);\n}\n\n@end\n\n\n@export ecgl.ssao.blur\n#define SHADER_NAME SSAO_BLUR\n\nuniform sampler2D ssaoTexture;\n\n#ifdef NORMALTEX_ENABLED\nuniform sampler2D normalTex;\n#endif\n\nvarying vec2 v_Texcoord;\n\nuniform vec2 textureSize;\nuniform float blurSize : 1.0;\n\nuniform int direction: 0.0;\n\n#ifdef DEPTHTEX_ENABLED\nuniform sampler2D depthTex;\nuniform mat4 projection;\nuniform float depthRange : 0.5;\n\nfloat getLinearDepth(vec2 coord)\n{\n float depth = texture2D(depthTex, coord).r * 2.0 - 1.0;\n return projection[3][2] / (depth * projection[2][3] - projection[2][2]);\n}\n#endif\n\nvoid main()\n{\n float kernel[5];\n kernel[0] = 0.122581;\n kernel[1] = 0.233062;\n kernel[2] = 0.288713;\n kernel[3] = 0.233062;\n kernel[4] = 0.122581;\n\n vec2 off = vec2(0.0);\n if (direction == 0) {\n off[0] = blurSize / textureSize.x;\n }\n else {\n off[1] = blurSize / textureSize.y;\n }\n\n vec2 coord = v_Texcoord;\n\n float sum = 0.0;\n float weightAll = 0.0;\n\n#ifdef NORMALTEX_ENABLED\n vec3 centerNormal = texture2D(normalTex, v_Texcoord).rgb * 2.0 - 1.0;\n#endif\n#if defined(DEPTHTEX_ENABLED)\n float centerDepth = getLinearDepth(v_Texcoord);\n#endif\n\n for (int i = 0; i < 5; i++) {\n vec2 coord = clamp(v_Texcoord + vec2(float(i) - 2.0) * off, vec2(0.0), vec2(1.0));\n\n float w = kernel[i];\n#ifdef NORMALTEX_ENABLED\n vec3 normal = texture2D(normalTex, coord).rgb * 2.0 - 1.0;\n w *= clamp(dot(normal, centerNormal), 0.0, 1.0);\n#endif\n#ifdef DEPTHTEX_ENABLED\n float d = getLinearDepth(coord);\n w *= (1.0 - smoothstep(abs(centerDepth - d) / depthRange, 0.0, 1.0));\n#endif\n\n weightAll += w;\n sum += texture2D(ssaoTexture, coord).r * w;\n }\n\n gl_FragColor = vec4(vec3(sum / weightAll), 1.0);\n}\n\n@end\n"},function(e,t,r){"use strict";function n(e){e=e||{},this._ssrPass=new o.a({fragment:s.a.source("ecgl.ssr.main"),clearColor:[0,0,0,0]}),this._blurPass1=new o.a({fragment:s.a.source("ecgl.ssr.blur"),clearColor:[0,0,0,0]}),this._blurPass2=new o.a({fragment:s.a.source("ecgl.ssr.blur"),clearColor:[0,0,0,0]}),this._blendPass=new o.a({fragment:s.a.source("clay.compositor.blend")}),this._blendPass.material.disableTexturesAll(),this._blendPass.material.enableTexture(["texture1","texture2"]),this._ssrPass.setUniform("gBufferTexture1",e.normalTexture),this._ssrPass.setUniform("gBufferTexture2",e.depthTexture),this._blurPass1.setUniform("gBufferTexture1",e.normalTexture),this._blurPass1.setUniform("gBufferTexture2",e.depthTexture),this._blurPass2.setUniform("gBufferTexture1",e.normalTexture),this._blurPass2.setUniform("gBufferTexture2",e.depthTexture),this._blurPass2.material.define("fragment","VERTICAL"),this._blurPass2.material.define("fragment","BLEND"),this._ssrTexture=new i.a({type:a.a.HALF_FLOAT}),this._texture2=new i.a({type:a.a.HALF_FLOAT}),this._texture3=new i.a({type:a.a.HALF_FLOAT}),this._prevTexture=new i.a({type:a.a.HALF_FLOAT}),this._currentTexture=new i.a({type:a.a.HALF_FLOAT}),this._frameBuffer=new u.a({depthBuffer:!1}),this._normalDistribution=null,this._totalSamples=256,this._samplePerFrame=4,this._ssrPass.material.define("fragment","SAMPLE_PER_FRAME",this._samplePerFrame),this._ssrPass.material.define("fragment","TOTAL_SAMPLES",this._totalSamples),this._downScale=1}var v=r(9),i=(r(3),r(5)),a=r(4),o=r(16),s=r(8),u=r(10),l=(r(49),r(77)),h=r(192);s.a.import(h.a),n.prototype.setAmbientCubemap=function(e,t){this._ssrPass.material.set("specularCubemap",e),this._ssrPass.material.set("specularIntensity",t);var r=e&&t;this._ssrPass.material[r?"enableTexture":"disableTexture"]("specularCubemap")},n.prototype.update=function(e,t,r,n){var i=e.getWidth(),a=e.getHeight(),o=this._ssrTexture,s=this._texture2,u=this._texture3;o.width=this._prevTexture.width=this._currentTexture.width=i/this._downScale,o.height=this._prevTexture.height=this._currentTexture.height=a/this._downScale,s.width=u.width=i,s.height=u.height=a;var l=this._frameBuffer,h=this._ssrPass,c=this._blurPass1,d=this._blurPass2,f=this._blendPass,p=new v.a,m=new v.a;v.a.transpose(p,t.worldTransform),v.a.transpose(m,t.viewMatrix),h.setUniform("sourceTexture",r),h.setUniform("projection",t.projectionMatrix.array),h.setUniform("projectionInv",t.invProjectionMatrix.array),h.setUniform("toViewSpace",p.array),h.setUniform("toWorldSpace",m.array),h.setUniform("nearZ",t.near);var g,_=n/this._totalSamples*this._samplePerFrame;h.setUniform("jitterOffset",_),h.setUniform("sampleOffset",n*this._samplePerFrame),c.setUniform("textureSize",[o.width,o.height]),d.setUniform("textureSize",[i,a]),d.setUniform("sourceTexture",r),c.setUniform("projection",t.projectionMatrix.array),d.setUniform("projection",t.projectionMatrix.array),l.attach(o),l.bind(e),h.render(e),this._physicallyCorrect&&(l.attach(this._currentTexture),f.setUniform("texture1",this._prevTexture),f.setUniform("texture2",o),f.material.set({weight1:1<=n?.95:0,weight2:1<=n?.05:1}),f.render(e)),l.attach(s),c.setUniform("texture",this._physicallyCorrect?this._currentTexture:o),c.render(e),l.attach(u),d.setUniform("texture",s),d.render(e),l.unbind(e),this._physicallyCorrect&&(g=this._prevTexture,this._prevTexture=this._currentTexture,this._currentTexture=g)},n.prototype.getTargetTexture=function(){return this._texture3},n.prototype.setParameter=function(e,t){"maxIteration"===e?this._ssrPass.material.define("fragment","MAX_ITERATION",t):this._ssrPass.setUniform(e,t)},n.prototype.setPhysicallyCorrect=function(e){e?(this._normalDistribution||(this._normalDistribution=l.a.generateNormalDistribution(64,this._totalSamples)),this._ssrPass.material.define("fragment","PHYSICALLY_CORRECT"),this._ssrPass.material.set("normalDistribution",this._normalDistribution),this._ssrPass.material.set("normalDistributionSize",[64,this._totalSamples])):this._ssrPass.material.undefine("fragment","PHYSICALLY_CORRECT"),this._physicallyCorrect=e},n.prototype.setSSAOTexture=function(e){var t=this._blurPass2;e?(t.material.enableTexture("ssaoTex"),t.material.set("ssaoTex",e)):t.material.disableTexture("ssaoTex")},n.prototype.isFinished=function(e){return!this._physicallyCorrect||e>this._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<a;i++)o=t[i]*n,s=i<a-1?t[i+1]*n:e.length,(u=m(e,o,s,n,!1))===u.next&&(u.steiner=!0),l.push(function(e){var t=e,r=e;for(;t.x<r.x&&(r=t),t=t.next,t!==e;);return r}(u));for(l.sort(v),i=0;i<l.length;i++)(function(e,t){{var r;(t=function(e,t){var r,n=t,i=e.x,a=e.y,o=-1/0;do{if(a<=n.y&&a>=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<s){if((o=s)===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x<n.next.x?n:n.next}}n=n.next}while(n!==t);if(!r)return null;if(i===o)return r.prev;var u,l=r,h=r.x,c=r.y,d=1/0;for(n=r.next;n!==l;)i>=n.x&&n.x>=h&&i!==n.x&&y(a<c?i:o,a,h,c,a<c?o:i,a,n.x,n.y)&&((u=Math.abs(a-n.y)/(i-n.x))<d||u===d&&n.x>r.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;p<c;p+=r)(s=e[p])<n&&(n=s),(u=e[p+1])<i&&(i=u),a<s&&(a=s),o<u&&(o=u);l=Math.max(a-n,o-i)}return _(d,f,r,n,i,l),f}function m(e,t,r,n,i){var a,o;if(i===0<w(e,t,r,n))for(a=t;a<r;a+=n)o=s(a,e[a],e[a+1],o);else for(a=r-n;t<=a;a-=n)o=s(a,e[a],e[a+1],o);return o&&h(o,o.next)&&(d(o),o=o.next),o}function g(e,t){if(!e)return e;t=t||e;var r,n=e;do{if(r=!1,n.steiner||!h(n,n.next)&&0!==x(n.prev,n,n.next))n=n.next;else{if(d(n),(n=t=n.prev)===n.next)return null;r=!0}}while(r||n!==t);return t}function _(e,t,r,n,i,a,o){if(e){!o&&a&&function(e,t,r,n){var i=e;for(;null===i.z&&(i.z=p(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next,i!==e;);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,r,n,i,a,o,s,u,l=1;do{for(r=e,a=e=null,o=0;r;){for(o++,n=r,t=s=0;t<l&&(s++,n=n.nextZ);t++);for(u=l;0<s||0<u&&n;)0!==s&&(0===u||!n||r.z<=n.z)?(r=(i=r).nextZ,s--):(n=(i=n).nextZ,u--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;r=n}a.nextZ=null,l*=2}while(1<o)}(i)}(e,n,i,a);for(var s,u,l=e;e.prev!==e.next;)if(s=e.prev,u=e.next,a?function(e,t,r,n){var i=e.prev,a=e,o=e.next;if(0<=x(i,a,o))return!1;for(var s=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,u=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,l=i.x>a.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)||0<x(e,t,r)!=0<x(e,t,n)&&0<x(r,n,e)!=0<x(r,n,t)}function T(e,t){return x(e.prev,e,e.next)<0?0<=x(e,t,e.next)&&0<=x(e,e.prev,t):x(e,t,e.prev)<0||x(e,e.next,t)<0}function b(e,t){var r=new o(e.i,e.x,e.y),n=new o(t.i,t.x,t.y),i=e.next,a=t.prev;return(e.next=t).prev=e,(r.next=i).prev=r,(n.next=r).prev=n,(a.next=n).prev=a,n}function s(e,t,r,n){var i=new o(e,t,r);return n?(i.next=n.next,(i.prev=n).next.prev=i,n.next=i):(i.prev=i).next=i,i}function d(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function o(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function w(e,t,r,n){for(var i=0,a=t,o=r-n;a<r;a+=n)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}(t.a=n).deviation=function(e,t,r,n){var i=t&&t.length,a=i?t[0]*r:e.length,o=Math.abs(w(e,0,a,r));if(i)for(var s=0,u=t.length;s<u;s++){var l=t[s]*r,h=s<u-1?t[s+1]*r:e.length;o-=Math.abs(w(e,l,h,r))}for(var c=0,s=0;s<n.length;s+=3){var d=n[s]*r,f=n[s+1]*r,p=n[s+2]*r;c+=Math.abs((e[d]-e[p])*(e[1+f]-e[1+d])-(e[d]-e[f])*(e[1+p]-e[1+d]))}return 0===o&&0===c?0:Math.abs((c-o)/o)}},function(e,t,r){var n=r(13),i={"南海诸岛":[32,80],"广东":[0,-10],"香港":[10,5],"澳门":[-10,10],"天津":[5,5]};e.exports=function(e){n.each(e.regions,function(e){var t,r=i[e.name];r&&((t=e.center)[0]+=r[0]/10.5,t[1]+=-r[1]/14)})}},function(e,t,r){var n=r(13),i={Russia:[100,60],"United States":[-99,38],"United States of America":[-99,38]};e.exports=function(e){n.each(e.regions,function(e){var t,r=i[e.name];r&&((t=e.center)[0]=r[0],t[1]=r[1])})}},function(e,t,r){"use strict";var n=r(0),i=r.n(n);r(208),r(209),r(211),i.a.registerAction({type:"globeChangeCamera",event:"globecamerachanged",update:"series:updateCamera"},function(t,e){e.eachComponent({mainType:"globe",query:t},function(e){e.setView(t)})}),i.a.registerAction({type:"globeUpdateDisplacment",event:"globedisplacementupdated",update:"update"},function(e,t){})},function(e,t,r){"use strict";function o(e,t){e.id=e.id||e.name||t+""}var n=r(0),s=r.n(n),i=r(44),a=r(28),u=r(29),l=r(31),h=s.a.extendComponentModel({type:"globe",layoutMode:"box",coordinateSystem:null,init:function(){h.superApply(this,"init",arguments),s.a.util.each(this.option.layers,function(e,t){s.a.util.merge(e,this.defaultLayerOption),o(e,t)},this)},mergeOption:function(e){function t(e){return s.a.util.reduce(e,function(e,t,r){return o(t,r),e[t.id]=t,e},{})}var r=this.option.layers;if(this.option.layers=null,h.superApply(this,"mergeOption",arguments),r&&r.length){var n,i=t(e.layers),a=t(r);for(n in i)a[n]?s.a.util.merge(a[n],i[n],!0):r.push(e.layers[n]);this.option.layers=r}s.a.util.each(this.option.layers,function(e){s.a.util.merge(e,this.defaultLayerOption)},this)},optionUpdated:function(){this.updateDisplacementHash()},defaultLayerOption:{show:!0,type:"overlay"},defaultOption:{show:!0,zlevel:-10,left:0,top:0,width:"100%",height:"100%",environment:"auto",baseColor:"#fff",baseTexture:"",heightTexture:"",displacementTexture:"",displacementScale:0,displacementQuality:"medium",globeRadius:100,globeOuterRadius:150,shading:"lambert",light:{main:{time:""}},viewControl:{autoRotate:!0,panSensitivity:0,targetCoord:null},layers:[]},setDisplacementData:function(e,t,r){this.displacementData=e,this.displacementWidth=t,this.displacementHeight=r},getDisplacementTexture:function(){return this.get("displacementTexture")||this.get("heightTexture")},getDisplacemenScale:function(){var e=this.getDisplacementTexture(),t=this.get("displacementScale");return e&&"none"!==e||(t=0),t},hasDisplacement:function(){return 0<this.getDisplacemenScale()},_displacementChanged:!0,_displacementScale:0,updateDisplacementHash:function(){var e=this.getDisplacementTexture(),t=this.getDisplacemenScale();this._displacementChanged=this._displacementTexture!==e||this._displacementScale!==t,this._displacementTexture=e,this._displacementScale=t},isDisplacementChanged:function(){return this._displacementChanged}});s.a.util.merge(h.prototype,i.a),s.a.util.merge(h.prototype,a.a),s.a.util.merge(h.prototype,u.a),s.a.util.merge(h.prototype,l.a)},function(e,t,r){"use strict";var n=r(0),v=r.n(n),y=r(1),i=r(45),a=r(30),o=r(210),x=r(2);v.a.extendComponentView({type:"globe",__ecgl__:!0,_displacementScale:0,init:function(e,t){this.groupGL=new y.a.Node,this._sphereGeometry=new y.a.SphereGeometry({widthSegments:200,heightSegments:100,dynamic:!0}),this._overlayGeometry=new y.a.SphereGeometry({widthSegments:80,heightSegments:40}),this._planeGeometry=new y.a.PlaneGeometry,this._earthMesh=new y.a.Mesh({renderNormal:!0}),this._lightRoot=new y.a.Node,this._sceneHelper=new a.a,this._sceneHelper.initLight(this._lightRoot),this.groupGL.add(this._earthMesh),this._control=new i.a({zr:t.getZr()}),this._control.init(),this._layerMeshes={}},render:function(e,t,r){var n=e.coordinateSystem,i=e.get("shading");n.viewGL.add(this._lightRoot),e.get("show")?n.viewGL.add(this.groupGL):n.viewGL.remove(this.groupGL),this._sceneHelper.setScene(n.viewGL.scene),n.viewGL.setPostEffect(e.getModel("postEffect"),r),n.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling"));var a=this._earthMesh;a.geometry=this._sphereGeometry;var o="ecgl."+i;a.material&&a.material.shader.name===o||(a.material=y.a.createMaterial(o)),y.a.setMaterialFromModel(i,a.material,e,r),["roughnessMap","metalnessMap","detailMap","normalMap"].forEach(function(e){var t=a.material.get(e);t&&(t.flipY=!1)}),a.material.set("color",y.a.parseColor(e.get("baseColor")));var s=.99*n.radius;a.scale.set(s,s,s);var u=a.material.setTextureImage("diffuseMap",e.get("baseTexture"),r,{flipY:!1,anisotropic:8});u&&u.surface&&u.surface.attachToMesh(a);var l=a.material.setTextureImage("bumpMap",e.get("heightTexture"),r,{flipY:!1,anisotropic:8});l&&l.surface&&l.surface.attachToMesh(a),a.material[e.get("postEffect.enable")?"define":"undefine"]("fragment","SRGB_DECODE"),this._updateLight(e,r),this._displaceVertices(e,r),this._updateViewControl(e,r),this._updateLayers(e,r)},afterRender:function(e,t,r,n){var i=n.renderer;this._sceneHelper.updateAmbientCubemap(i,e,r),this._sceneHelper.updateSkybox(i,e,r)},_updateLayers:function(e,c){var d=e.coordinateSystem,t=e.get("layers"),f=d.radius,p=[],m=[],g=[],_=[];v.a.util.each(t,function(e){var t,r,n,i,a,o,s,u=new v.a.Model(e),l=u.get("type"),h=y.a.loadTexture(u.get("texture"),c,{flipY:!1,anisotropic:8});h.surface&&h.surface.attachToMesh(this._earthMesh),"blend"===l?(t=u.get("blendTo"),r=x.a.firstNotNull(u.get("intensity"),1),"emission"===t?(g.push(h),_.push(r)):(p.push(h),m.push(r))):(n=u.get("id"),i=(i=this._layerMeshes[n])||(this._layerMeshes[n]=new y.a.Mesh({geometry:this._overlayGeometry,castShadow:!1,ignorePicking:!0})),"lambert"===u.get("shading")?(i.material=i.__lambertMaterial||new y.a.Material({autoUpdateTextureStatus:!1,shader:y.a.createShader("ecgl.lambert"),transparent:!0,depthMask:!1}),i.__lambertMaterial=i.material):(i.material=i.__colorMaterial||new y.a.Material({autoUpdateTextureStatus:!1,shader:y.a.createShader("ecgl.color"),transparent:!0,depthMask:!1}),i.__colorMaterial=i.material),i.material.enableTexture("diffuseMap"),a=u.get("distance"),o=f+(null==a?d.radius/100:a),i.scale.set(o,o,o),f=o,s=this._blankTexture||(this._blankTexture=y.a.createBlankTexture("rgba(255, 255, 255, 0)")),i.material.set("diffuseMap",s),y.a.loadTexture(u.get("texture"),c,{flipY:!1,anisotropic:8},function(e){e.surface&&e.surface.attachToMesh(i),i.material.set("diffuseMap",e),c.getZr().refresh()}),u.get("show")?this.groupGL.add(i):this.groupGL.remove(i))},this);var r=this._earthMesh.material;r.define("fragment","LAYER_DIFFUSEMAP_COUNT",p.length),r.define("fragment","LAYER_EMISSIVEMAP_COUNT",g.length),r.set("layerDiffuseMap",p),r.set("layerDiffuseIntensity",m),r.set("layerEmissiveMap",g),r.set("layerEmissionIntensity",_);var n,i,a=e.getModel("debug.wireframe");a.get("show")?(r.define("both","WIREFRAME_TRIANGLE"),n=y.a.parseColor(a.get("lineStyle.color")||"rgba(0,0,0,0.5)"),i=x.a.firstNotNull(a.get("lineStyle.width"),1),r.set("wireframeLineWidth",i),r.set("wireframeLineColor",n)):r.undefine("both","WIREFRAME_TRIANGLE")},_updateViewControl:function(e,t){var r=e.coordinateSystem,n=e.getModel("viewControl"),i=(r.viewGL.camera,this),a=this._control;a.setViewGL(r.viewGL);var o,s,u=n.get("targetCoord");null!=u&&(s=u[0]+90,o=u[1]),a.setFromViewControlModel(n,{baseDistance:r.radius,alpha:o,beta:s}),a.off("update"),a.on("update",function(){t.dispatchAction({type:"globeChangeCamera",alpha:a.getAlpha(),beta:a.getBeta(),distance:a.getDistance()-r.radius,center:a.getCenter(),from:i.uid,globeId:e.id})})},_displaceVertices:function(e){var t,r,n,i=e.get("displacementQuality"),a=e.get("debug.wireframe.show"),o=e.coordinateSystem;!e.isDisplacementChanged()&&i===this._displacementQuality&&a===this._showDebugWireframe||(this._displacementQuality=i,this._showDebugWireframe=a,t=this._sphereGeometry,n=(r={low:100,medium:200,high:400,ultra:800}[i]||200)/2,t.widthSegments===r&&!a||(t.widthSegments=r,t.heightSegments=n,t.build()),this._doDisplaceVertices(t,o),a&&t.generateBarycentric())},_doDisplaceVertices:function(e,t){var r=e.attributes.position.value,n=e.attributes.texcoord0.value,i=e.__originalPosition;i&&i.length===r.length||((i=new Float32Array(r.length)).set(r),e.__originalPosition=i);for(var a=t.displacementWidth,o=t.displacementHeight,s=t.displacementData,u=0;u<e.vertexCount;u++){var l=3*u,h=2*u,c=i[1+l],d=i[2+l],f=i[3+l],p=n[h++],m=n[h++],g=Math.round(p*(a-1)),_=Math.round(m*(o-1)),v=s?s[_*a+g]:0;r[1+l]=c+c*v,r[2+l]=d+d*v,r[3+l]=f+f*v}e.generateVertexNormals(),e.dirty(),e.updateBoundingBox()},_updateLight:function(e){var t=this._earthMesh;this._sceneHelper.updateLight(e);var r=this._sceneHelper.mainLight,n=e.get("light.main.time")||new Date,i=o.a.getPosition(v.a.number.parseDate(n),0,0),a=Math.cos(i.altitude);r.position.y=-a*Math.cos(i.azimuth),r.position.x=Math.sin(i.altitude),r.position.z=a*Math.sin(i.azimuth),r.lookAt(t.getWorldPosition())},dispose:function(){this.groupGL.removeAll(),this._control.dispose()}})},function(e,t,r){"use strict";function p(e){return e.valueOf()/n-.5+i-2451545}function m(e){var t,r,n,i,a,o=(t=T*(357.5291+.98560028*e))+T*(1.9148*g(t)+.02*g(2*t)+3e-4*g(3*t))+102.9372*T+s;return{dec:(i=o,y(g(a=0)*_(u)+_(a)*g(u)*g(i))),ra:(n=0,x(g(r=o)*_(u)-v(n)*g(u),_(r)))}}var s=Math.PI,g=Math.sin,_=Math.cos,v=Math.tan,y=Math.asin,x=Math.atan2,T=s/180,n=864e5,i=2440588,u=23.4397*T,a={};a.getPosition=function(e,t,r){var n,i,a,o,s,u,l=T*-r,h=T*t,c=p(e),d=m(c),f=T*(280.16+360.9856235*c)-l-d.ra;return{azimuth:(o=f,s=h,u=d.dec,x(g(o),_(o)*g(s)-v(u)*_(s))),altitude:(n=f,i=h,a=d.dec,y(g(i)*g(a)+_(i)*_(a)*_(n)))}},t.a=a},function(e,t,r){"use strict";function i(e,t){var r=e.getBoxLayoutParams(),n=l.a.getLayoutRect(r,{width:t.getWidth(),height:t.getHeight()});n.y=t.getHeight()-n.y-n.height,this.viewGL.setViewport(n.x,n.y,n.width,n.height,t.getDevicePixelRatio()),this.radius=e.get("globeRadius");var i=e.get("globeOuterRadius");this.altitudeAxis&&this.altitudeAxis.setExtent(0,i-this.radius)}function a(e,t){var r,a=[1/0,-1/0];e.eachSeries(function(e){var t,r,n,i;e.coordinateSystem===this&&(t=e.getData(),(n=(r=e.coordDimToDataDim("alt"))&&r[0])&&(i=t.getDataExtent(n,!0),a[0]=Math.min(a[0],i[0]),a[1]=Math.max(a[1],i[1])))},this),a&&isFinite(a[1]-a[0])&&(r=o.a.helper.createScale(a,{type:"value",min:"dataMin",max:"dataMax"}),this.altitudeAxis=new o.a.Axis("altitude",r),this.resize(this.model,t))}var s=r(212),n=r(0),o=r.n(n),u=r(47),l=r.n(u),h=r(22),c=r(2),d=r(1),f={dimensions:s.a.prototype.dimensions,create:function(n,o){var r=[];return n.eachComponent("globe",function(e){e.__viewGL=e.__viewGL||new h.a;var t=new s.a;t.viewGL=e.__viewGL,(e.coordinateSystem=t).model=e,r.push(t),t.resize=i,t.resize(e,o),t.update=a}),n.eachSeries(function(e){if("globe"===e.get("coordinateSystem")){var t=e.getReferringComponents("globe")[0];if(!(t=t||n.getComponent("globe")))throw new Error('globe "'+c.a.firstNotNull(e.get("globe3DIndex"),e.get("globe3DId"),0)+'" not found');var r=t.coordinateSystem;e.coordinateSystem=r}}),n.eachComponent("globe",function(r,e){var n,t=r.coordinateSystem,i=r.getDisplacementTexture(),a=r.getDisplacemenScale();r.isDisplacementChanged()&&(r.hasDisplacement()?(n=!0,d.a.loadTexture(i,o,function(e){var t=function(e,t){var r=document.createElement("canvas"),n=r.getContext("2d"),i=e.width,a=e.height;r.width=i,r.height=a,n.drawImage(e,0,0,i,a);for(var o=n.getImageData(0,0,i,a).data,s=new Float32Array(o.length/4),u=0;u<o.length/4;u++){var l=o[4*u];s[u]=l/255*t}return{data:s,width:i,height:a}}(e.image,a);r.setDisplacementData(t.data,t.width,t.height),n||o.dispatchAction({type:"globeUpdateDisplacment"})}),n=!1):t.setDisplacementData(null,0,0),t.setDisplacementData(r.displacementData,r.displacementWidth,r.displacementHeight))}),r}};o.a.registerCoordinateSystem("globe",f)},function(e,t,r){"use strict";function n(e){this.radius=e,this.viewGL=null,this.altitudeAxis,this.displacementData=null,this.displacementWidth,this.displacementHeight}var h=r(6).a.vec3;n.prototype={constructor:n,dimensions:["lng","lat","alt"],type:"globe",containPoint:function(){},setDisplacementData:function(e,t,r){this.displacementData=e,this.displacementWidth=t,this.displacementHeight=r},_getDisplacementScale:function(e,t){var r=(e+180)/360*(this.displacementWidth-1),n=(90-t)/180*(this.displacementHeight-1),i=Math.round(r)+Math.round(n)*this.displacementWidth;return this.displacementData[i]},dataToPoint:function(e,t){var r=e[0],n=e[1],i=e[2]||0,a=this.radius;this.displacementData&&(a*=1+this._getDisplacementScale(r,n)),this.altitudeAxis&&(a+=this.altitudeAxis.dataToCoord(i)),r=r*Math.PI/180,n=n*Math.PI/180;var o=Math.cos(n)*a;return(t=t||[])[0]=-o*Math.cos(r+Math.PI),t[1]=Math.sin(n)*a,t[2]=o*Math.sin(r+Math.PI),t},pointToData:function(e,t){var r=e[0],n=e[1],i=e[2],a=h.len(e);r/=a,n/=a,i/=a;var o=Math.asin(n),s=Math.atan2(i,-r);s<0&&(s=2*Math.PI+s);var u=180*o/Math.PI,l=180*s/Math.PI-180;return(t=t||[])[0]=l,t[1]=u,t[2]=a-this.radius,this.altitudeAxis&&(t[2]=this.altitudeAxis.coordToData(t[2])),t}},t.a=n},function(e,t,r){"use strict";var n=r(0),i=r.n(n);r(214),r(216),r(217),i.a.registerAction({type:"mapbox3DChangeCamera",event:"mapbox3dcamerachanged",update:"mapbox3D:updateCamera"},function(t,e){e.eachComponent({mainType:"mapbox3D",query:t},function(e){e.setMapboxCameraOption(t)})})},function(e,t,r){"use strict";var n=r(215),i=r(0),a=r.n(i),o=r(101),s=Object(o.a)("mapbox3D",n.a,function(e){e.forEach(function(e){e.setCameraOption(e.model.getMapboxCameraOption())})});a.a.registerCoordinateSystem("mapbox3D",s)},function(e,t,r){"use strict";function n(){i.a.apply(this,arguments)}var i=r(100);((n.prototype=new i.a).constructor=n).prototype.type="mapbox3D",t.a=n},function(e,t,r){"use strict";var n=r(0),i=r.n(n),a=r(28),o=r(29),s=["zoom","center","pitch","bearing"],u=i.a.extendComponentModel({type:"mapbox3D",layoutMode:"box",coordinateSystem:null,defaultOption:{zlevel:-10,style:"mapbox://styles/mapbox/light-v9",center:[0,0],zoom:0,pitch:0,bearing:0,light:{main:{alpha:20,beta:30}},altitudeScale:1,boxHeight:"auto"},getMapboxCameraOption:function(){var r=this;return s.reduce(function(e,t){return e[t]=r.get(t),e},{})},setMapboxCameraOption:function(t){null!=t&&s.forEach(function(e){null!=t[e]&&(this.option[e]=t[e])},this)},getMapbox:function(){return this._mapbox},setMapbox:function(e){this._mapbox=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(218),o=r(30),u=r(1),s=r(102);u.a.Shader.import(s.a),i.a.extendComponentView({type:"mapbox3D",__ecgl__:!0,init:function(e,t){var r=t.getZr();this._zrLayer=new a.a("mapbox3D",r),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.getMapbox(),i=this._dispatchInteractAction.bind(this,t,n);["zoom","rotate","drag","pitch","rotate","move"].forEach(function(e){n.on(e,i)}),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})},render:function(e,t,r){var n=this._zrLayer.getMapbox(),i=e.get("style"),a=JSON.stringify(i);a!==this._oldStyleStr&&i&&n.setStyle(i),this._oldStyleStr=a,n.setCenter(e.get("center")),n.setZoom(e.get("zoom")),n.setPitch(e.get("pitch")),n.setBearing(e.get("bearing")),e.setMapbox(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._mapbox3DModel=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:"mapbox3DChangeCamera",pitch:t.getPitch(),zoom:t.getZoom(),center:t.getCenter().toArray(),bearing:t.getBearing(),mapbox3DId:this._mapbox3DModel&&this._mapbox3DModel.id})},_updateGroundMesh:function(){var e,t,r,n,i,a,o,s;this._mapbox3DModel&&(t=(e=this._mapbox3DModel.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){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;",!mapboxgl)throw new Error("Mapbox GL library must be included. See https://www.mapbox.com/mapbox-gl-js/api/");this._mapbox=new mapboxgl.Map({container:this.dom}),this._initEvents()}n.prototype.resize=function(){this._mapbox.resize()},n.prototype.getMapbox=function(){return this._mapbox},n.prototype.clear=function(){},n.prototype.refresh=function(){this._mapbox.resize()};var a=["mousedown","mouseup","click","dblclick","mousemove","mousewheel","wheel","touchstart","touchend","touchmove","touchcancel"];n.prototype._initEvents=function(){var i=this._mapbox.getCanvasContainer();this._handlers=this._handlers||{contextmenu:function(e){return e.preventDefault(),!1}},a.forEach(function(e){this._handlers[e]=function(e){var t,r={};for(t in e)r[t]=e[t];r.bubbles=!1;var n=new e.constructor(e.type,r);i.dispatchEvent(n)},this.zr.dom.addEventListener(e,this._handlers[e])},this),this.zr.dom.addEventListener("contextmenu",this._handlers.contextmenu)},n.prototype.dispose=function(){a.forEach(function(e){this.zr.dom.removeEventListener(e,this._handlers[e])},this)},t.a=n},function(e,t,r){"use strict";var n=r(0),i=r.n(n);r(220),r(222),r(223),i.a.registerAction({type:"maptalks3DChangeCamera",event:"maptalks3dcamerachanged",update:"maptalks3D:updateCamera"},function(t,e){e.eachComponent({mainType:"maptalks3D",query:t},function(e){e.setMaptalksCameraOption(t)})})},function(e,t,r){"use strict";var n=r(221),i=r(0),a=r.n(i),o=r(101),s=Object(o.a)("maptalks3D",n.a,function(e){e.forEach(function(e){e.setCameraOption(e.model.getMaptalksCameraOption())})});a.a.registerCoordinateSystem("maptalks3D",s)},function(e,t,r){"use strict";function n(){i.a.apply(this,arguments),this.maxPitch=85,this.zoomOffset=1}var i=r(100);((n.prototype=new i.a).constructor=n).prototype.type="maptalks3D",t.a=n},function(e,t,r){"use strict";var n=r(0),i=r.n(n),a=r(28),o=r(29),s=["zoom","center","pitch","bearing"],u=i.a.extendComponentModel({type:"maptalks3D",layoutMode:"box",coordinateSystem:null,defaultOption:{zlevel:-10,urlTemplate:"http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png",attribution:'&copy; <a href="http://osm.org">OpenStreetMap</a> contributors, &copy; <a href="https://carto.com/">CARTO</a>',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<a&&0<o||a<0&&o<0)),s=["x","y","z"].map(function(e){return t.coordDimToDataDim(e)[0]}),g=l(d,s[2]),_=g?d.getCalculationInfo("stackResultDimension"):s[2];d.each(s,function(e,t,r,n){var i=d.get(_,n),a=g?i-r:m?0:p[0],o=c.dataToPoint([e,t,a]),s=c.dataToPoint([e,t,i]),u=v.dist(o,s),l=[0,s[1]<o[1]?-1:1,0];0===Math.abs(u)&&(u=.1);var h=[f[0],u,f[1]];d.setItemLayout(n,[o,l,h])}),d.setLayout("orient",[1,0,0])}},function(e,t,r){"use strict";t.a=function(e,t,r){for(var n=e.getDataExtent(t),i=e.getDataExtent(r),a=n[1]-n[0]||n[0],o=i[1]-i[0]||i[0],s=new Uint8Array(2500),u=0;u<e.count();u++){var l=e.get(t,u),h=e.get(r,u),c=Math.floor((l-n[0])/a*49),d=50*Math.floor((h-i[0])/o*49)+c;s[d]=s[d]||1}for(var f=0,u=0;u<s.length;u++)s[u]&&f++;return f/s.length}},function(e,t,r){"use strict";var n=r(0),u=r.n(n),v=r(1),l=r(2),h=r(32),o=r(230),i=r(66),c=r(6).a.vec3;u.a.extendChartView({type:"bar3D",__ecgl__:!0,init:function(e,t){this.groupGL=new v.a.Node,this._api=t,this._labelsBuilder=new i.a(256,256,t);var s=this;this._labelsBuilder.getLabelPosition=function(e,t,r){if(s._data){var n=s._data.getItemLayout(e),i=n[0],a=n[1],o=n[2][1];return c.scaleAndAdd([],i,a,r+o)}return[0,0]},this._labelsBuilder.getMesh().renderOrder=100},render:function(e,t,r){var n=this._prevBarMesh;this._prevBarMesh=this._barMesh,this._barMesh=n,this._barMesh||(this._barMesh=new v.a.Mesh({geometry:new o.a,shadowDepthMaterial:new v.a.Material({shader:new v.a.Shader(v.a.Shader.source("ecgl.sm.depth.vertex"),v.a.Shader.source("ecgl.sm.depth.fragment"))}),culling:"cartesian3D"===e.coordinateSystem.type,renderOrder:10,renderNormal:!0})),this.groupGL.remove(this._prevBarMesh),this.groupGL.add(this._barMesh),this.groupGL.add(this._labelsBuilder.getMesh());var i,a=e.coordinateSystem;this._doRender(e,r),a&&a.viewGL&&(a.viewGL.add(this.groupGL),i=a.viewGL.isLinearSpace()?"define":"undefine",this._barMesh.material[i]("fragment","SRGB_DECODE")),this._data=e.getData(),this._labelsBuilder.updateData(this._data),this._labelsBuilder.updateLabels(),this._updateAnimation(e)},_updateAnimation:function(e){v.a.updateVertexAnimation([["prevPosition","position"],["prevNormal","normal"]],this._prevBarMesh,this._barMesh,e)},_doRender:function(e,t){var o=e.getData(),r=e.get("shading"),n="color"!==r,s=this,i=this._barMesh,a="ecgl."+r;i.material&&i.material.shader.name===a||(i.material=v.a.createMaterial(a,["VERTEX_COLOR"])),v.a.setMaterialFromModel(r,i.material,e,t),i.geometry.enableNormal=n,i.geometry.resetOffset();var u=e.get("bevelSize"),l=e.get("bevelSmoothness");i.geometry.bevelSegments=l,i.geometry.bevelSize=u;var h=[],c=new Float32Array(4*o.count()),d=0,f=0,p=!1;o.each(function(e){var t,r;o.hasValue(e)&&(t=o.getItemVisual(e,"color"),null==(r=o.getItemVisual(e,"opacity"))&&(r=1),v.a.parseColor(t,h),h[3]*=r,c[d++]=h[0],c[d++]=h[1],c[d++]=h[2],c[d++]=h[3],0<h[3]&&(f++,h[3]<.99&&(p=!0)))}),i.geometry.setBarCount(f);var m=o.getLayout("orient"),g=this._barIndexOfData=new Int32Array(o.count()),f=0;o.each(function(e){var t,r,n,i,a;o.hasValue(e)?(r=(t=o.getItemLayout(e))[0],n=t[1],i=t[2],a=4*e,h[0]=c[a++],h[1]=c[a++],h[2]=c[a++],h[3]=c[a++],0<h[3]&&(s._barMesh.geometry.addBar(r,n,m,i,h,e),g[e]=f++)):g[e]=-1}),i.geometry.dirty(),i.geometry.updateBoundingBox();var _=i.material;_.transparent=p,_.depthMask=!p,i.geometry.sortTriangles=p,this._initHandler(e,t)},_initHandler:function(e,r){var n=e.getData(),i=this._barMesh,a="cartesian3D"===e.coordinateSystem.type;i.seriesIndex=e.seriesIndex;var o=-1;i.off("mousemove"),i.off("mouseout"),i.on("mousemove",function(e){var t=i.geometry.getDataIndexOfVertex(e.triangle[0]);t!==o&&(this._downplay(o),this._highlight(t),this._labelsBuilder.updateLabels([t]),a&&r.dispatchAction({type:"grid3DShowAxisPointer",value:[n.get("x",t),n.get("y",t),n.get("z",t,!0)]})),o=t,i.dataIndex=t},this),i.on("mouseout",function(e){this._downplay(o),this._labelsBuilder.updateLabels(),o=-1,i.dataIndex=-1,a&&r.dispatchAction({type:"grid3DHideAxisPointer"})},this)},_highlight:function(e){var t,r,n,i,a,o,s=this._data;s&&((t=this._barIndexOfData[e])<0||(a=(r=s.getItemModel(e).getModel("emphasis.itemStyle")).get("color"),n=r.get("opacity"),null==a&&(i=s.getItemVisual(e,"color"),a=u.a.color.lift(i,-.4)),null==n&&(n=s.getItemVisual(e,"opacity")),(o=v.a.parseColor(a))[3]*=n,this._barMesh.geometry.setColor(t,o),this._api.getZr().refresh()))},_downplay:function(e){var t,r,n,i,a=this._data;a&&((t=this._barIndexOfData[e])<0||(r=a.getItemVisual(e,"color"),n=a.getItemVisual(e,"opacity"),(i=v.a.parseColor(r))[3]*=n,this._barMesh.geometry.setColor(t,i),this._api.getZr().refresh()))},highlight:function(e,t,r,n){this._toggleStatus("highlight",e,t,r,n)},downplay:function(e,t,r,n){this._toggleStatus("downplay",e,t,r,n)},_toggleStatus:function(t,e,r,n,i){var a=e.getData(),o=l.a.queryDataIndex(a,i),s=this;null!=o?u.a.util.each(h.a.normalizeToArray(o),function(e){"highlight"===t?this._highlight(e):this._downplay(e)},this):a.each(function(e){"highlight"===t?s._highlight(e):s._downplay(e)})},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll()}})},function(e,t,r){"use strict";var M,C,L,D,N,R,P,I,n=r(0),i=r.n(n),a=r(38),o=r(65),s=r(15),u=r(6),O=u.a.vec3,l=u.a.mat3,h=s.a.extend(function(){return{attributes:{position:new s.a.Attribute("position","float",3,"POSITION"),normal:new s.a.Attribute("normal","float",3,"NORMAL"),color:new s.a.Attribute("color","float",4,"COLOR"),prevPosition:new s.a.Attribute("prevPosition","float",3),prevNormal:new s.a.Attribute("prevNormal","float",3)},dynamic:!0,enableNormal:!1,bevelSize:1,bevelSegments:0,_dataIndices:null,_vertexOffset:0,_triangleOffset:0}},{resetOffset:function(){this._vertexOffset=0,this._triangleOffset=0},setBarCount:function(e){var t=this.enableNormal,r=this.getBarVertexCount()*e,n=this.getBarTriangleCount()*e;this.vertexCount!==r&&(this.attributes.position.init(r),t?this.attributes.normal.init(r):this.attributes.normal.value=null,this.attributes.color.init(r)),this.triangleCount!==n&&(this.indices=new(65535<r?Uint32Array:Uint16Array)(3*n),this._dataIndices=new Uint32Array(r))},getBarVertexCount:function(){var e=0<this.bevelSize?this.bevelSegments:0;return 0<e?this._getBevelBarVertexCount(e):this.enableNormal?24:8},getBarTriangleCount:function(){var e=0<this.bevelSize?this.bevelSegments:0;return 0<e?this._getBevelBarTriangleCount(e):12},_getBevelBarVertexCount:function(e){return 4*(e+1)*(e+1)*2},_getBevelBarTriangleCount:function(e){return(4*e+3+1)*(2*e+1)*2+4},setColor:function(e,t){for(var r=this.getBarVertexCount(),n=r*(e+1),i=r*e;i<n;i++)this.attributes.color.set(i,t);this.dirtyAttribute("color")},getDataIndexOfVertex:function(e){return this._dataIndices?this._dataIndices[e]:null},addBar:function(){for(var e=O.create,m=O.scaleAndAdd,g=e(),_=e(),v=e(),y=e(),x=e(),T=e(),b=e(),w=[],E=[],t=0;t<8;t++)w[t]=e();for(var S=[[0,1,5,4],[2,3,7,6],[4,5,6,7],[3,2,1,0],[0,4,7,3],[1,2,6,5]],A=[0,1,2,0,2,3],M=[],t=0;t<S.length;t++)for(var r=S[t],n=0;n<2;n++){for(var i=[],a=0;a<3;a++)i.push(r[A[3*n+a]]);M.push(i)}return function(e,t,r,n,i,a){var o=this._vertexOffset;if(0<this.bevelSize&&0<this.bevelSegments)this._addBevelBar(e,t,r,n,this.bevelSize,this.bevelSegments,i);else{O.copy(v,t),O.normalize(v,v),O.cross(y,r,v),O.normalize(y,y),O.cross(_,v,y),O.normalize(y,y),O.negate(x,_),O.negate(T,v),O.negate(b,y),m(w[0],e,_,n[0]/2),m(w[0],w[0],y,n[2]/2),m(w[1],e,_,n[0]/2),m(w[1],w[1],b,n[2]/2),m(w[2],e,x,n[0]/2),m(w[2],w[2],b,n[2]/2),m(w[3],e,x,n[0]/2),m(w[3],w[3],y,n[2]/2),m(g,e,v,n[1]),m(w[4],g,_,n[0]/2),m(w[4],w[4],y,n[2]/2),m(w[5],g,_,n[0]/2),m(w[5],w[5],b,n[2]/2),m(w[6],g,x,n[0]/2),m(w[6],w[6],b,n[2]/2),m(w[7],g,x,n[0]/2),m(w[7],w[7],y,n[2]/2);var s=this.attributes;if(this.enableNormal){E[0]=_,E[1]=x,E[2]=v,E[3]=T,E[4]=y,E[5]=b;for(var u=this._vertexOffset,l=0;l<S.length;l++){for(var h=3*this._triangleOffset,c=0;c<6;c++)this.indices[h++]=u+A[c];u+=4,this._triangleOffset+=2}for(l=0;l<S.length;l++)for(var d=E[l],c=0;c<4;c++){var f=S[l][c];s.position.set(this._vertexOffset,w[f]),s.normal.set(this._vertexOffset,d),s.color.set(this._vertexOffset++,i)}}else{for(l=0;l<M.length;l++){for(h=3*this._triangleOffset,c=0;c<3;c++)this.indices[h+c]=M[l][c]+this._vertexOffset;this._triangleOffset++}for(l=0;l<w.length;l++)s.position.set(this._vertexOffset,w[l]),s.color.set(this._vertexOffset++,i)}}for(var p=this._vertexOffset,l=o;l<p;l++)this._dataIndices[l]=a}}(),_addBevelBar:(M=O.create(),C=O.create(),L=O.create(),D=l.create(),N=[],R=[1,-1,-1,1],P=[1,1,-1,-1],I=[2,0],function(e,t,r,n,i,a,o){O.copy(C,t),O.normalize(C,C),O.cross(L,r,C),O.normalize(L,L),O.cross(M,C,L),O.normalize(L,L),D[0]=M[0],D[1]=M[1],D[2]=M[2],D[3]=C[0],D[4]=C[1],D[5]=C[2],D[6]=L[0],D[7]=L[1],D[8]=L[2],i=Math.min(n[0],n[2])/2*i;for(var s=0;s<3;s++)N[s]=Math.max(n[s]-2*i,0);for(var u=(n[0]-N[0])/2,l=(n[1]-N[1])/2,h=(n[2]-N[2])/2,c=[],d=[],f=this._vertexOffset,p=[],s=0;s<2;s++){p[s]=p[s]=[];for(var m=0;m<=a;m++)for(var g=0;g<4;g++){(0===m&&0===s||1===s&&m===a)&&p[s].push(f);for(var _=0;_<=a;_++){var v=_/a*Math.PI/2+Math.PI/2*g,y=m/a*Math.PI/2+Math.PI/2*s;d[0]=u*Math.cos(v)*Math.sin(y),d[1]=l*Math.cos(y),d[2]=h*Math.sin(v)*Math.sin(y),c[0]=d[0]+R[g]*N[0]/2,c[1]=d[1]+l+I[s]*N[1]/2,c[2]=d[2]+P[g]*N[2]/2,Math.abs(u-l)<1e-6&&Math.abs(l-h)<1e-6||(d[0]/=u*u,d[1]/=l*l,d[2]/=h*h),O.normalize(d,d),O.transformMat3(c,c,D),O.transformMat3(d,d,D),O.add(c,c,e),this.attributes.position.set(f,c),this.enableNormal&&this.attributes.normal.set(f,d),this.attributes.color.set(f,o),f++}}}for(var x=4*a+3,T=2*a+1,b=1+x,g=0;g<T;g++)for(s=0;s<=x;s++){var w=g*b+s+this._vertexOffset,E=g*b+(s+1)%b+this._vertexOffset,S=(g+1)*b+(s+1)%b+this._vertexOffset,A=(g+1)*b+s+this._vertexOffset;this.setTriangleIndices(this._triangleOffset++,[S,w,E]),this.setTriangleIndices(this._triangleOffset++,[S,A,w])}this.setTriangleIndices(this._triangleOffset++,[p[0][0],p[0][2],p[0][1]]),this.setTriangleIndices(this._triangleOffset++,[p[0][0],p[0][3],p[0][2]]),this.setTriangleIndices(this._triangleOffset++,[p[1][0],p[1][1],p[1][2]]),this.setTriangleIndices(this._triangleOffset++,[p[1][0],p[1][2],p[1][3]]),this._vertexOffset=f})});i.a.util.defaults(h.prototype,a.a),i.a.util.defaults(h.prototype,o.a),t.a=h},function(e,t,r){"use strict";var n=r(0),i=r.n(n),a=r(31),o=r(32),s=r(39),u=r(50),l=i.a.extendSeriesModel({type:"series.bar3D",dependencies:["globe"],visualColorAccessPath:"itemStyle.color",getInitialData:function(){return Object(u.a)(this)},getFormattedLabel:function(e,t,r,n){var i=o.a.getFormattedLabel(this,e,t,r,n);return null==i&&(i=this.getData().get("z",e)),i},formatTooltip:function(e){return Object(s.a)(this,e)},defaultOption:{coordinateSystem:"cartesian3D",globeIndex:0,grid3DIndex:0,zlevel:-10,bevelSize:0,bevelSmoothness:2,onGridPlane:"xy",shading:"color",minHeight:0,itemStyle:{opacity:1},label:{show:!1,distance:2,textStyle:{fontSize:14,color:"#000",backgroundColor:"rgba(255,255,255,0.7)",padding:3,borderRadius:3}},emphasis:{label:{show:!0}},animationDurationUpdate:500}});i.a.util.merge(l.prototype,a.a)},function(e,t,r){"use strict";var n=r(0),i=r.n(n),a=(r(233),r(234),r(51)),o=r.n(a),s=r(17);i.a.registerVisual(o()("line3D","circle",null)),i.a.registerVisual(Object(s.a)("line3D")),i.a.registerLayout(function(e,t){e.eachSeriesByType("line3D",function(t){var e=t.getData(),i=t.coordinateSystem;if(i){if("cartesian3D"!==i.type)return;var a=new Float32Array(3*e.count()),o=[],s=[],r=i.dimensions.map(function(e){return t.coordDimToDataDim(e)[0]});i&&e.each(r,function(e,t,r,n){o[0]=e,o[1]=t,o[2]=r,i.dataToPoint(o,s),a[3*n]=s[0],a[3*n+1]=s[1],a[3*n+2]=s[2]}),e.setLayout("points",a)}})})},function(e,t,r){"use strict";var n=r(0),i=r.n(n),a=r(39),o=r(50);i.a.extendSeriesModel({type:"series.line3D",dependencies:["grid3D"],visualColorAccessPath:"lineStyle.color",getInitialData:function(){return Object(o.a)(this)},formatTooltip:function(e){return Object(a.a)(this,e)},defaultOption:{coordinateSystem:"cartesian3D",zlevel:-10,grid3DIndex:0,lineStyle:{width:2},animationDurationUpdate:500}})},function(e,t,r){"use strict";var n=r(0),i=r.n(n),c=r(1),d=r(2),o=r(25),l=r(9),v=r(3),a=r(235),y=r.n(a),s=r(6),u=r(46),h=s.a.vec3;c.a.Shader.import(u.a),i.a.extendChartView({type:"line3D",__ecgl__:!0,init:function(e,t){this.groupGL=new c.a.Node,this._api=t},render:function(e,t,r){var n=this._prevLine3DMesh;this._prevLine3DMesh=this._line3DMesh,this._line3DMesh=n,this._line3DMesh||(this._line3DMesh=new c.a.Mesh({geometry:new o.a({useNativeLine:!1,sortTriangles:!0}),material:new c.a.Material({shader:c.a.createShader("ecgl.meshLines3D")}),renderOrder:10}),this._line3DMesh.geometry.pick=this._pick.bind(this)),this.groupGL.remove(this._prevLine3DMesh),this.groupGL.add(this._line3DMesh);var i,a=e.coordinateSystem;a&&a.viewGL&&(a.viewGL.add(this.groupGL),i=a.viewGL.isLinearSpace()?"define":"undefine",this._line3DMesh.material[i]("fragment","SRGB_DECODE")),this._doRender(e,r),this._data=e.getData(),this._camera=a.viewGL.camera,this.updateCamera(),this._updateAnimation(e)},updateCamera:function(){this._updateNDCPosition()},_doRender:function(e,t){var n=e.getData(),r=this._line3DMesh;r.geometry.resetOffset();var i=n.getLayout("points"),a=[],o=new Float32Array(i.length/3*4),s=0,u=!1;n.each(function(e){var t=n.getItemVisual(e,"color"),r=n.getItemVisual(e,"opacity");null==r&&(r=1),c.a.parseColor(t,a),a[3]*=r,o[s++]=a[0],o[s++]=a[1],o[s++]=a[2],o[s++]=a[3],a[3]<.99&&(u=!0)}),r.geometry.setVertexCount(r.geometry.getPolylineVertexCount(i)),r.geometry.setTriangleCount(r.geometry.getPolylineTriangleCount(i)),r.geometry.addPolyline(i,o,d.a.firstNotNull(e.get("lineStyle.width"),1)),r.geometry.dirty(),r.geometry.updateBoundingBox();var l=r.material;l.transparent=u,l.depthMask=!u;var h=e.getModel("debug.wireframe");h.get("show")?(r.geometry.createAttribute("barycentric","float",3),r.geometry.generateBarycentric(),r.material.set("both","WIREFRAME_TRIANGLE"),r.material.set("wireframeLineColor",c.a.parseColor(h.get("lineStyle.color")||"rgba(0,0,0,0.5)")),r.material.set("wireframeLineWidth",d.a.firstNotNull(h.get("lineStyle.width"),1))):r.material.set("both","WIREFRAME_TRIANGLE"),this._points=i,this._initHandler(e,t)},_updateAnimation:function(e){c.a.updateVertexAnimation([["prevPosition","position"],["prevPositionPrev","positionPrev"],["prevPositionNext","positionNext"]],this._prevLine3DMesh,this._line3DMesh,e)},_initHandler:function(e,n){var i=e.getData(),a=e.coordinateSystem,o=this._line3DMesh,s=-1;o.seriesIndex=e.seriesIndex,o.off("mousemove"),o.off("mouseout"),o.on("mousemove",function(e){var t=a.pointToData(e.point.array),r=i.indicesOfNearest("x",t[0])[0];r!==s&&(n.dispatchAction({type:"grid3DShowAxisPointer",value:[i.get("x",r),i.get("y",r),i.get("z",r)]}),o.dataIndex=r),s=r},this),o.on("mouseout",function(e){s=-1,o.dataIndex=-1,n.dispatchAction({type:"grid3DHideAxisPointer"})},this)},_updateNDCPosition:function(){var e=new l.a,t=this._camera;l.a.multiply(e,t.projectionMatrix,t.viewMatrix);var r=this._positionNDC,n=this._points,i=n.length/3;r&&r.length/2==i||(r=this._positionNDC=new Float32Array(2*i));for(var a=[],o=0;o<i;o++){var s=3*o,u=2*o;a[0]=n[s],a[1]=n[1+s],a[2]=n[2+s],a[3]=1,h.transformMat4(a,a,e.array),r[u]=a[0]/a[3],r[1+u]=a[1]/a[3]}},_pick:function(e,t,r,n,i,a){var o=this._positionNDC,s=this._data.hostModel.get("lineStyle.width"),u=-1,l=.5*r.viewport.width,h=.5*r.viewport.height;e=(e+1)*l,t=(t+1)*h;for(var c,d,f=1;f<o.length/2;f++){var p=(o[2*(f-1)]+1)*l,m=(o[2*(f-1)+1]+1)*h,g=(o[2*f]+1)*l,_=(o[2*f+1]+1)*h;y.a.containStroke(p,m,g,_,s,e,t)&&(u=(p-e)*(p-e)+(m-t)*(m-t)<(g-e)*(g-e)+(_-t)*(_-t)?f-1:f)}0<=u&&(c=3*u,d=new v.a(this._points[c],this._points[1+c],this._points[2+c]),a.push({dataIndex:u,point:d,pointWorld:d.clone(),target:this._line3DMesh,distance:this._camera.getWorldPosition().dist(d)}))},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll()}})},function(e,t){t.containStroke=function(e,t,r,n,i,a,o){if(0===i)return!1;var s,u=i;if(t+u<o&&n+u<o||o<t-u&&o<n-u||e+u<a&&r+u<a||a<e-u&&a<r-u)return!1;if(e===r)return Math.abs(a-e)<=u/2;var l=(s=(t-n)/(e-r))*a-o+(e*n-r*t)/(e-r);return l*l/(s*s+1)<=u/2*u/2}},function(e,t,r){"use strict";var n=r(0),i=r.n(n),a=(r(237),r(238),r(51)),o=r.n(a),s=r(17);i.a.registerVisual(o()("scatter3D","circle",null)),i.a.registerVisual(Object(s.a)("scatter3D")),i.a.registerLayout({seriesType:"scatter3D",reset:function(t){var a=t.coordinateSystem;if(a){var e=a.dimensions;if(e.length<3)return;var o=e.map(function(e){return t.coordDimToDataDim(e)[0]}),s=[],u=[];return{progress:function(e,t){for(var r=new Float32Array(3*(e.end-e.start)),n=e.start;n<e.end;n++){var i=3*(n-e.start);s[0]=t.get(o[0],n),s[1]=t.get(o[1],n),s[2]=t.get(o[2],n),a.dataToPoint(s,u),r[i]=u[0],r[1+i]=u[1],r[2+i]=u[2]}t.setLayout("points",r)}}}}})},function(e,t,r){"use strict";var n=r(0),i=r.n(n),s=r(32),a=r(39),o=r(50);i.a.extendSeriesModel({type:"series.scatter3D",dependencies:["globe","grid3D","geo3D"],visualColorAccessPath:"itemStyle.color",getInitialData:function(){return Object(o.a)(this)},getFormattedLabel:function(e,t,r,n){var i,a,o=s.a.getFormattedLabel(this,e,t,r,n);return null==o&&(a=(i=this.getData()).dimensions[i.dimensions.length-1],o=i.get(a,e)),o},formatTooltip:function(e){return Object(a.a)(this,e)},defaultOption:{coordinateSystem:"cartesian3D",zlevel:-10,progressive:1e5,progressiveThreshold:1e5,grid3DIndex:0,globeIndex:0,symbol:"circle",symbolSize:10,blendMode:"source-over",label:{show:!1,position:"right",distance:5,textStyle:{fontSize:14,color:"#000",backgroundColor:"rgba(255,255,255,0.7)",padding:3,borderRadius:3}},itemStyle:{opacity:.8},emphasis:{label:{show:!0}},animationDurationUpdate:500}})},function(e,t,r){"use strict";var n=r(0),u=r.n(n),i=r(1),l=r(2),h=r(32),a=r(67);u.a.extendChartView({type:"scatter3D",__ecgl__:!0,init:function(){this.groupGL=new i.a.Node,this._pointsBuilderList=[],this._currentStep=0},render:function(e,t,r){var n,i;this.groupGL.removeAll(),e.getData().count()&&(n=e.coordinateSystem)&&n.viewGL&&(n.viewGL.add(this.groupGL),this._camera=n.viewGL.camera,i=(i=this._pointsBuilderList[0])||(this._pointsBuilderList[0]=new a.a(!1,r)),this._pointsBuilderList.length=1,this.groupGL.add(i.rootNode),i.update(e,t,r),i.updateView(n.viewGL.camera))},incrementalPrepareRender:function(e){var t=e.coordinateSystem;t&&t.viewGL&&(t.viewGL.add(this.groupGL),this._camera=t.viewGL.camera),this.groupGL.removeAll(),this._currentStep=0},incrementalRender:function(e,t,r,n){var i;e.end<=e.start||((i=this._pointsBuilderList[this._currentStep])||(i=new a.a(!1,n),this._pointsBuilderList[this._currentStep]=i),this.groupGL.add(i.rootNode),i.update(t,r,n,e.start,e.end),i.updateView(t.coordinateSystem.viewGL.camera),this._currentStep++)},updateCamera:function(){this._pointsBuilderList.forEach(function(e){e.updateView(this._camera)},this)},highlight:function(e,t,r,n){this._toggleStatus("highlight",e,t,r,n)},downplay:function(e,t,r,n){this._toggleStatus("downplay",e,t,r,n)},_toggleStatus:function(e,t,r,n,i){var a=t.getData(),o=l.a.queryDataIndex(a,i),s="highlight"===e;null!=o?u.a.util.each(h.a.normalizeToArray(o),function(e){for(var t=0;t<this._pointsBuilderList.length;t++){var r=this._pointsBuilderList[t];s?r.highlight(a,e):r.downplay(a,e)}},this):a.each(function(e){for(var t=0;t<this._pointsBuilderList.length;t++){var r=this._pointsBuilderList[t];s?r.highlight(a,e):r.downplay(a,e)}})},dispose:function(){this.groupGL.removeAll()},remove:function(){this.groupGL.removeAll()}})},function(e,t,r){"use strict";function o(e,t,r){(t=t||document.createElement("canvas")).width=e,t.height=e;var n=t.getContext("2d");return r&&r(n),t}var n=r(0),h=r.n(n),c={getMarginByStyle:function(e){var t=e.minMargin||0,r=0;e.stroke&&"none"!==e.stroke&&(r=null==e.lineWidth?1:e.lineWidth);var n=e.shadowBlur||0,i=e.shadowOffsetX||0,a=e.shadowOffsetY||0,o={};return o.left=Math.max(r/2,-i+n,t),o.right=Math.max(r/2,i+n,t),o.top=Math.max(r/2,-a+n,t),o.bottom=Math.max(r/2,a+n,t),o},createSymbolSprite:function(e,t,r,n){var i=function(e,t,r,n){h.a.util.isArray(t)||(t=[t,t]);var i=c.getMarginByStyle(r,n),a=t[0]+i.left+i.right,o=t[1]+i.top+i.bottom,s=h.a.helper.createSymbol(e,0,0,t[0],t[1]),u=Math.max(a,o);s.position=[i.left,i.top],o<a?s.position[1]+=(u-o)/2:s.position[0]+=(u-a)/2;var l=s.getBoundingRect();return s.position[0]-=l.x,s.position[1]-=l.y,s.setStyle(r),s.update(),s.__size=u,s}(e,t,r),a=c.getMarginByStyle(r);return{image:o(i.__size,n,function(e){i.brush(e)}),margin:a}},createSDFFromCanvas:function(r,e,n,t){return o(e,t,function(e){var t=r.getContext("2d").getImageData(0,0,r.width,r.height);e.putImageData(function(e,h,c){function d(e){return e<128?1:-1}for(var f=h.width,p=h.height,t=e.canvas.width,r=e.canvas.height,m=f/t,g=p/r,n=e.createImageData(t,r),i=0;i<r;i++)for(var a=0;a<t;a++){var o=function(e,t){var r=1/0;e=Math.floor(e*m);for(var n=(t=Math.floor(t*g))*f+e,i=d(h.data[4*n]),a=Math.max(t-c,0);a<Math.min(t+c,p);a++)for(var o=Math.max(e-c,0);o<Math.min(e+c,f);o++){var s,n=a*f+o,u=o-e,l=a-t;i===d(h.data[4*n])||(s=u*u+l*l)<r&&(r=s)}return i*Math.sqrt(r)}(a,i)/c*.5+.5,s=4*(i*t+a);n.data[s++]=255*(1-o),n.data[s++]=255*(1-o),n.data[s++]=255*(1-o),n.data[s++]=255}return n}(e,t,n),0,0)})},createSimpleSprite:function(n,e){return o(n,e,function(e){var t=n/2;e.beginPath(),e.arc(t,t,60,0,2*Math.PI,!1),e.closePath();var r=e.createRadialGradient(t,t,0,t,t,t);r.addColorStop(0,"rgba(255, 255, 255, 1)"),r.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),r.addColorStop(1,"rgba(255, 255, 255, 0)"),e.fillStyle=r,e.fill()})}};t.a=c},function(e,t,r){"use strict";var _=r(1),n=r(241),i=r(0),a=r.n(i),o=r(6),s=r(242),u=o.a.vec4;_.a.Shader.import(s.a);var l=_.a.Mesh.extend(function(){var e=new _.a.Geometry({dynamic:!0,attributes:{color:new _.a.Geometry.Attribute("color","float",4,"COLOR"),position:new _.a.Geometry.Attribute("position","float",3,"POSITION"),size:new _.a.Geometry.Attribute("size","float",1),prevPosition:new _.a.Geometry.Attribute("prevPosition","float",3),prevSize:new _.a.Geometry.Attribute("prevSize","float",1)}});a.a.util.extend(e,n.a);var t=new _.a.Material({shader:_.a.createShader("ecgl.sdfSprite"),transparent:!0,depthMask:!1});t.enableTexture("sprite"),t.define("both","VERTEX_COLOR"),t.define("both","VERTEX_SIZE");var r=new _.a.Texture2D({image:document.createElement("canvas"),flipY:!1});return t.set("sprite",r),e.pick=this._pick.bind(this),{geometry:e,material:t,mode:_.a.Mesh.POINTS,sizeScale:1}},{_pick:function(e,t,r,n,i,a){var o=this._positionNDC;if(o)for(var s=r.viewport,u=2/s.width,l=2/s.height,h=this.geometry.vertexCount-1;0<=h;h--){var c,d,f=this.geometry.indices?this.geometry.indices[h]:h,p=o[2*f],m=o[2*f+1],g=this.geometry.attributes.size.get(f)/this.sizeScale/2;p-g*u<e&&e<p+g*u&&m-g*l<t&&t<m+g*l&&(c=new _.a.Vector3,d=new _.a.Vector3,this.geometry.attributes.position.get(f,c.array),_.a.Vector3.transformMat4(d,c,this.worldTransform),a.push({vertexIndex:f,point:c,pointWorld:d,target:this,distance:d.distance(n.getWorldPosition())}))}},updateNDCPosition:function(e){var t=this._positionNDC,r=this.geometry;t&&t.length/2===r.vertexCount||(t=this._positionNDC=new Float32Array(2*r.vertexCount));for(var n=u.create(),i=0;i<r.vertexCount;i++)r.attributes.position.get(i,n),n[3]=1,u.transformMat4(n,n,e.array),u.scale(n,n,1/n[3]),t[2*i]=n[0],t[2*i+1]=n[1]}});t.a=l},function(e,t,r){"use strict";var i=r(97),l=r(6).a.vec3;t.a={needsSortVertices:function(){return this.sortVertices},needsSortVerticesProgressively:function(){return this.needsSortVertices()&&2e4<=this.vertexCount},doSortVertices:function(e,t){var r=this.indices,n=l.create();if(!r){r=this.indices=new(65535<this.vertexCount?Uint32Array:Uint16Array)(this.vertexCount);for(var i=0;i<r.length;i++)r[i]=i}if(0===t){var a=this.attributes.position,e=e.array,o=0;this._zList&&this._zList.length===this.vertexCount||(this._zList=new Float32Array(this.vertexCount));for(var s,i=0;i<this.vertexCount;i++){a.get(i,n);var u=l.sqrDist(n,e);isNaN(u)&&(u=1e7,o++),0===i?(s=u,u=0):u-=s,this._zList[i]=u}this._noneCount=o}if(this.vertexCount<2e4)0===t&&this._simpleSort(.05<this._noneCount/this.vertexCount);else for(i=0;i<3;i++)this._progressiveQuickSort(3*t+i);this.dirtyIndices()},_simpleSort:function(e){function t(e,t){return r[t]-r[e]}var r=this._zList,n=this.indices;e?Array.prototype.sort.call(n,t):i.a.sort(n,t,0,n.length-1)},_progressiveQuickSort:function(e){var r=this._zList,t=this.indices;this._quickSort=this._quickSort||new i.a,this._quickSort.step(t,function(e,t){return r[t]-r[e]},e)}}},function(e,t,r){"use strict";t.a="@export ecgl.sdfSprite.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform float elapsedTime : 0;\n\nattribute vec3 position : POSITION;\n\n#ifdef VERTEX_SIZE\nattribute float size;\n#else\nuniform float u_Size;\n#endif\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_FillColor: COLOR;\nvarying vec4 v_Color;\n#endif\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nattribute float prevSize;\nuniform float percent : 1.0;\n#endif\n\n\n#ifdef POSITIONTEXTURE_ENABLED\nuniform sampler2D positionTexture;\n#endif\n\nvarying float v_Size;\n\nvoid main()\n{\n\n#ifdef POSITIONTEXTURE_ENABLED\n gl_Position = worldViewProjection * vec4(texture2D(positionTexture, position.xy).xy, -10.0, 1.0);\n#else\n\n #ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n #else\n vec3 pos = position;\n #endif\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n#endif\n\n#ifdef VERTEX_SIZE\n#ifdef VERTEX_ANIMATION\n v_Size = mix(prevSize, size, percent);\n#else\n v_Size = size;\n#endif\n#else\n v_Size = u_Size;\n#endif\n\n#ifdef VERTEX_COLOR\n v_Color = a_FillColor;\n #endif\n\n gl_PointSize = v_Size;\n}\n\n@end\n\n@export ecgl.sdfSprite.fragment\n\nuniform vec4 color: [1, 1, 1, 1];\nuniform vec4 strokeColor: [1, 1, 1, 1];\nuniform float smoothing: 0.07;\n\nuniform float lineWidth: 0.0;\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\nvarying float v_Size;\n\nuniform sampler2D sprite;\n\n@import clay.util.srgb\n\nvoid main()\n{\n gl_FragColor = color;\n\n vec4 _strokeColor = strokeColor;\n\n#ifdef VERTEX_COLOR\n gl_FragColor *= v_Color;\n #endif\n\n#ifdef SPRITE_ENABLED\n float d = texture2D(sprite, gl_PointCoord).r;\n gl_FragColor.a *= smoothstep(0.5 - smoothing, 0.5 + smoothing, d);\n\n if (lineWidth > 0.0) {\n float sLineWidth = lineWidth / 2.0;\n\n float outlineMaxValue0 = 0.5 + sLineWidth;\n float outlineMaxValue1 = 0.5 + sLineWidth + smoothing;\n float outlineMinValue0 = 0.5 - sLineWidth - smoothing;\n float outlineMinValue1 = 0.5 - sLineWidth;\n\n if (d <= outlineMaxValue1 && d >= outlineMinValue0) {\n float a = _strokeColor.a;\n if (d <= outlineMinValue1) {\n a = a * smoothstep(outlineMinValue0, outlineMinValue1, d);\n }\n else {\n a = a * smoothstep(outlineMaxValue1, outlineMaxValue0, d);\n }\n gl_FragColor.rgb = mix(gl_FragColor.rgb * gl_FragColor.a, _strokeColor.rgb, a);\n gl_FragColor.a = gl_FragColor.a * (1.0 - a) + a;\n }\n }\n#endif\n\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(gl_FragColor);\n#endif\n}\n@end"},function(e,t,r){"use strict";var n=r(0),i=r.n(n),a=(r(244),r(245),r(248),r(17));i.a.registerVisual(Object(a.a)("lines3D")),i.a.registerAction({type:"lines3DPauseEffect",event:"lines3deffectpaused",update:"series.lines3D:pauseEffect"},function(){}),i.a.registerAction({type:"lines3DResumeEffect",event:"lines3deffectresumed",update:"series.lines3D:resumeEffect"},function(){}),i.a.registerAction({type:"lines3DToggleEffect",event:"lines3deffectchanged",update:"series.lines3D:toggleEffect"},function(){})},function(e,t,r){"use strict";function s(e,t){c.copy(T,e[0]),c.copy(b,e[1]);var r=[],n=r[0]=g(),i=r[1]=g(),a=r[2]=g(),o=r[3]=g();t.dataToPoint(T,n),t.dataToPoint(b,o),d(_,n),p(v,o,n),d(v,v),f(y,v,_),d(y,y),f(v,_,y),m(i,_,v),d(i,i),d(_,o),p(v,n,o),d(v,v),f(y,v,_),d(y,y),f(v,_,y),m(a,_,v),d(a,a),m(x,n,o),d(x,x);var s=h.dot(n,x),u=h.dot(x,i),l=(Math.max(h.len(n),h.len(o))-s)/u*2;return h.scaleAndAdd(i,n,i,l),h.scaleAndAdd(a,o,a,l),r}function u(e,t){for(var r=new Float32Array(3*e.length),n=0,i=[],a=0;a<e.length;a++)t.dataToPoint(e[a],i),r[n++]=i[0],r[n++]=i[1],r[n++]=i[2];return r}function l(n){var i=[];return n.each(function(e){var t=n.getItemModel(e),r=t.option instanceof Array?t.option:t.getShallow("coords",!0);i.push(r)}),{coordsList:i}}function n(e,n,i){var a=e.getData(),o=e.get("polyline"),s=l(a);a.setLayout("lineType",o?"polyline":"cubicBezier"),a.each(function(e){var t=s.coordsList[e],r=o?u(t,n):function(e,t,r){var n=[],i=n[0]=h.create(),a=n[1]=h.create(),o=n[2]=h.create(),s=n[3]=h.create();t.dataToPoint(e[0],i),t.dataToPoint(e[1],s);var u=h.dist(i,s);return h.lerp(a,i,s,.3),h.lerp(o,i,s,.3),h.scaleAndAdd(a,a,r,Math.min(.1*u,10)),h.scaleAndAdd(o,o,r,Math.min(.1*u,10)),n}(t,n,i);a.setItemLayout(e,r)})}var i=r(0),a=r.n(i),o=r(6),h=o.a.vec3,c=o.a.vec2,d=h.normalize,f=h.cross,p=h.sub,m=h.add,g=h.create,_=g(),v=g(),y=g(),x=g(),T=[],b=[];a.a.registerLayout(function(e,t){e.eachSeriesByType("lines3D",function(e){var t=e.coordinateSystem;"globe"===t.type?function(e,n){var i=e.getData(),a=e.get("polyline");i.setLayout("lineType",a?"polyline":"cubicBezier");var o=l(i);i.each(function(e){var t=o.coordsList[e],r=a?u:s;i.setItemLayout(e,r(t,n))})}(e,t):"geo3D"===t.type?n(e,t,[0,1,0]):"mapbox3D"!==t.type&&"maptalks3D"!==t.type||n(e,t,[0,0,1])})})},function(e,t,r){"use strict";var n=r(0),i=r.n(n),m=r(1),a=r(25),o=r(246),s=r(46);m.a.Shader.import(s.a),i.a.extendChartView({type:"lines3D",__ecgl__:!0,init:function(){this.groupGL=new m.a.Node,this._meshLinesMaterial=new m.a.Material({shader:m.a.createShader("ecgl.meshLines3D"),transparent:!0,depthMask:!1}),this._linesMesh=new m.a.Mesh({geometry:new a.a,material:this._meshLinesMaterial,$ignorePicking:!0}),this._trailMesh=new o.a},render:function(e,t,r){this.groupGL.add(this._linesMesh);var n,i=e.coordinateSystem,a=e.getData();i&&i.viewGL&&(i.viewGL.add(this.groupGL),this._updateLines(e,t,r),n=i.viewGL.isLinearSpace()?"define":"undefine",this._linesMesh.material[n]("fragment","SRGB_DECODE"),this._trailMesh.material[n]("fragment","SRGB_DECODE"));var o=this._trailMesh;o.stopAnimation(),e.get("effect.show")?(this.groupGL.add(o),o.updateData(a,r,this._linesMesh.geometry),o.__time=o.__time||0,this._curveEffectsAnimator=o.animate("",{loop:!0}).when(36e5,{__time:36e5}).during(function(){o.setAnimationTime(o.__time)}).start()):(this.groupGL.remove(o),this._curveEffectsAnimator=null),this._linesMesh.material.blend=this._trailMesh.material.blend="lighter"===e.get("blendMode")?m.a.additiveBlend:null},pauseEffect:function(){this._curveEffectsAnimator&&this._curveEffectsAnimator.pause()},resumeEffect:function(){this._curveEffectsAnimator&&this._curveEffectsAnimator.resume()},toggleEffect:function(){var e=this._curveEffectsAnimator;e&&(e.isPaused()?e.resume():e.pause())},_updateLines:function(e,t,r){var a=e.getData(),n=e.coordinateSystem,o=this._linesMesh.geometry,s=e.get("polyline");o.expandLine=!0;var i,u=null!=(i=n).radius?i.radius:null!=i.size?Math.max(i.size[0],i.size[1],i.size[2]):100;o.segmentScale=u/20;var l="lineStyle.width".split("."),h=r.getDevicePixelRatio(),c=0;a.each(function(e){var t=a.getItemModel(e).get(l);null==t&&(t=1),a.setItemVisual(e,"lineWidth",t),c=Math.max(t,c)}),o.useNativeLine=!1;var d=0,f=0;a.each(function(e){var t=a.getItemLayout(e);s?(d+=o.getPolylineVertexCount(t),f+=o.getPolylineTriangleCount(t)):(d+=o.getCubicCurveVertexCount(t[0],t[1],t[2],t[3]),f+=o.getCubicCurveTriangleCount(t[0],t[1],t[2],t[3]))}),o.setVertexCount(d),o.setTriangleCount(f),o.resetOffset();var p=[];a.each(function(e){var t=a.getItemLayout(e),r=a.getItemVisual(e,"color"),n=a.getItemVisual(e,"opacity"),i=a.getItemVisual(e,"lineWidth")*h;null==n&&(n=1),(p=m.a.parseColor(r,p))[3]*=n,s?o.addPolyline(t,p,i):o.addCubicCurve(t[0],t[1],t[2],t[3],p,i)}),o.dirty()},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll()}})},function(e,t,r){"use strict";var n=r(0),M=(r.n(n),r(1)),i=r(6),a=r(25),o=r(247),C=i.a.vec3;M.a.Shader.import(o.a),t.a=M.a.Mesh.extend(function(){var e=new M.a.Material({shader:new M.a.Shader(M.a.Shader.source("ecgl.trail2.vertex"),M.a.Shader.source("ecgl.trail2.fragment")),transparent:!0,depthMask:!1}),t=new a.a({dynamic:!0});return t.createAttribute("dist","float",1),t.createAttribute("distAll","float",1),t.createAttribute("start","float",1),{geometry:t,material:e,culling:!1,$ignorePicking:!0}},{updateData:function(h,e,c){var t=h.hostModel,d=this.geometry,r=t.getModel("effect"),f=r.get("trailWidth")*e.getDevicePixelRatio(),n=r.get("trailLength"),i=t.get("effect.constantSpeed"),p=1e3*t.get("effect.period"),m=null!=i;m?this.material.set("speed",i/1e3):this.material.set("period",p),this.material[m?"define":"undefine"]("vertex","CONSTANT_SPEED");var g=t.get("polyline");d.trailLength=n,this.material.set("trailLength",n),d.resetOffset(),["position","positionPrev","positionNext"].forEach(function(e){d.attributes[e].value=c.attributes[e].value}),["dist","distAll","start","offset","color"].forEach(function(e){d.attributes[e].init(d.vertexCount)}),d.indices=c.indices;var _=[],v=r.get("trailColor"),y=r.get("trailOpacity"),x=null!=v,T=null!=y;this.updateWorldTransform();var b=this.worldTransform.x.len(),w=this.worldTransform.y.len(),E=this.worldTransform.z.len(),S=0,A=0;h.each(function(e){var t=h.getItemLayout(e),r=T?y:h.getItemVisual(e,"opacity"),n=h.getItemVisual(e,"color");null==r&&(r=1),(_=M.a.parseColor(x?v:n,_))[3]*=r;for(var i=g?c.getPolylineVertexCount(t):c.getCubicCurveVertexCount(t[0],t[1],t[2],t[3]),a=0,o=[],s=[],u=S;u<S+i;u++)d.attributes.position.get(u,o),o[0]*=b,o[1]*=w,o[2]*=E,S<u&&(a+=C.dist(o,s)),d.attributes.dist.set(u,a),C.copy(s,o);A=Math.max(A,a);for(var l=Math.random()*(m?a:p),u=S;u<S+i;u++)d.attributes.distAll.set(u,a),d.attributes.start.set(u,l),d.attributes.offset.set(u,(0<c.attributes.offset.get(u)?1:-1)*f/2),d.attributes.color.set(u,_);S+=i}),this.material.set("spotSize",.1*A*n),this.material.set("spotIntensity",r.get("spotIntensity")),d.dirty()},setAnimationTime:function(e){this.material.set("time",e)}})},function(e,t,r){"use strict";t.a="@export ecgl.trail2.vertex\nattribute vec3 position: POSITION;\nattribute vec3 positionPrev;\nattribute vec3 positionNext;\nattribute float offset;\nattribute float dist;\nattribute float distAll;\nattribute float start;\n\nattribute vec4 a_Color : COLOR;\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform vec4 viewport : VIEWPORT;\nuniform float near : NEAR;\n\nuniform float speed : 0;\nuniform float trailLength: 0.3;\nuniform float time;\nuniform float period: 1000;\n\nuniform float spotSize: 1;\n\nvarying vec4 v_Color;\nvarying float v_Percent;\nvarying float v_SpotPercent;\n\n@import ecgl.common.wireframe.vertexHeader\n\n@import ecgl.lines3D.clipNear\n\nvoid main()\n{\n @import ecgl.lines3D.expandLine\n\n gl_Position = currProj;\n\n v_Color = a_Color;\n\n @import ecgl.common.wireframe.vertexMain\n\n#ifdef CONSTANT_SPEED\n float t = mod((speed * time + start) / distAll, 1. + trailLength) - trailLength;\n#else\n float t = mod((time + start) / period, 1. + trailLength) - trailLength;\n#endif\n\n float trailLen = distAll * trailLength;\n\n v_Percent = (dist - t * distAll) / trailLen;\n\n v_SpotPercent = spotSize / distAll;\n\n }\n@end\n\n\n@export ecgl.trail2.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\nuniform float spotIntensity: 5;\n\nvarying vec4 v_Color;\nvarying float v_Percent;\nvarying float v_SpotPercent;\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.util.srgb\n\nvoid main()\n{\n if (v_Percent > 1.0 || v_Percent < 0.0) {\n discard;\n }\n\n float fade = v_Percent;\n\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color * v_Color);\n#else\n gl_FragColor = color * v_Color;\n#endif\n\n @import ecgl.common.wireframe.fragmentMain\n\n if (v_Percent > (1.0 - v_SpotPercent)) {\n gl_FragColor.rgb *= spotIntensity;\n }\n\n gl_FragColor.a *= fade;\n}\n\n@end"},function(e,t,r){"use strict";var n=r(0),i=r.n(n);i.a.extendSeriesModel({type:"series.lines3D",dependencies:["globe"],visualColorAccessPath:"lineStyle.color",getInitialData:function(e){var a=new i.a.List(["value"],this);return a.hasItemOption=!1,a.initData(e.data,[],function(e,t,r,n){if(e instanceof Array)return NaN;a.hasItemOption=!0;var i=e.value;return null!=i?i instanceof Array?i[n]:i:void 0}),a},defaultOption:{coordinateSystem:"globe",globeIndex:0,geo3DIndex:0,zlevel:-10,polyline:!1,effect:{show:!1,period:4,trailWidth:4,trailLength:.2,spotIntensity:6},silent:!0,blendMode:"source-over",lineStyle:{width:1,opacity:.5}}})},function(e,t,r){"use strict";var n=r(0),i=r.n(n),a=(r(250),r(251),r(17));i.a.registerVisual(Object(a.a)("polygons3D"))},function(e,t,r){"use strict";function u(e,t){for(var r=[],n=0;n<t.length;n++)r.push(e.dataToPoint(t[n]));return r}var n=r(0),i=r.n(n),a=r(31),o=i.a.extendSeriesModel({type:"series.polygons3D",getRegionModel:function(e){return this.getData().getItemModel(e)},getRegionPolygonCoords:function(e){var t=this.coordinateSystem,r=this.getData().getItemModel(e),n=r.option instanceof Array?r.option:r.getShallow("coords");r.get("multiPolygon")||(n=[n]);for(var i=[],a=0;a<n.length;a++){for(var o=[],s=1;s<n[a].length;s++)o.push(u(t,n[a][s]));i.push({exterior:u(t,n[a][0]),interiors:o})}return i},getInitialData:function(e){var a=new i.a.List(["value"],this);return a.hasItemOption=!1,a.initData(e.data,[],function(e,t,r,n){if(e instanceof Array)return NaN;a.hasItemOption=!0;var i=e.value;return null!=i?i instanceof Array?i[n]:i:void 0}),a},defaultOption:{show:!0,data:null,multiPolygon:!1,progressiveThreshold:1e3,progressive:1e3,zlevel:-10,label:{show:!1,distance:2,textStyle:{fontSize:20,color:"#000",backgroundColor:"rgba(255,255,255,0.7)",padding:3,borderRadius:4}},itemStyle:{color:"#fff",borderWidth:0,borderColor:"#333"},emphasis:{itemStyle:{color:"#639fc0"},label:{show:!0}}}});i.a.util.merge(o.prototype,a.a)},function(e,t,r){"use strict";var n=r(0),i=r.n(n),o=r(64),a=r(1);i.a.extendChartView({type:"polygons3D",__ecgl__:!0,init:function(){this.groupGL=new a.a.Node,this._geo3DBuilderList=[],this._currentStep=0},render:function(e,t,r){this.groupGL.removeAll();var n=e.coordinateSystem;n&&n.viewGL&&n.viewGL.add(this.groupGL);var i=this._geo3DBuilderList[0];i||((i=new o.a(r)).extrudeY="mapbox3D"!==n.type&&"maptalks3D"!==n.type,this._geo3DBuilderList[0]=i),this._updateShaderDefines(n,i),i.update(e,t,r),this._geo3DBuilderList.length=1,this.groupGL.add(i.rootNode)},incrementalPrepareRender:function(e){this.groupGL.removeAll();var t=e.coordinateSystem;t&&t.viewGL&&t.viewGL.add(this.groupGL),this._currentStep=0},incrementalRender:function(e,t,r,n){var i=this._geo3DBuilderList[this._currentStep],a=t.coordinateSystem;i||((i=new o.a(n)).extrudeY="mapbox3D"!==a.type&&"maptalks3D"!==a.type,this._geo3DBuilderList[this._currentStep]=i),i.update(t,r,n,e.start,e.end),this.groupGL.add(i.rootNode),this._updateShaderDefines(a,i),this._currentStep++},_updateShaderDefines:function(t,e){var r=t.viewGL.isLinearSpace()?"define":"undefine";e.rootNode.traverse(function(e){e.material&&(e.material[r]("fragment","SRGB_DECODE"),"mapbox3D"!==t.type&&"maptalks3D"!==t.type||(e.material.define("fragment","NORMAL_UP_AXIS",2),e.material.define("fragment","NORMAL_FRONT_AXIS",1)))})},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll()}})},function(e,t,r){"use strict";var n=r(0),i=r.n(n),a=(r(253),r(254),r(255),r(17));i.a.registerVisual(Object(a.a)("surface"))},function(e,t,r){"use strict";var n=r(0),N=r.n(n),i=r(31),a=r(39),R=r(50),o=N.a.extendSeriesModel({type:"series.surface",dependencies:["globe","grid3D","geo3D"],visualColorAccessPath:"itemStyle.color",formatTooltip:function(e){return Object(a.a)(this,e)},getInitialData:function(e){function t(e){return!(isNaN(e.min)||isNaN(e.max)||isNaN(e.step))}function r(e){var t=N.a.number.getPrecisionSafe;return Math.max(t(e.min),t(e.max),t(e.step))+1}if(!(u=e.data))if(e.parametric){var n=e.parametricEquation||{},i=n.u||{},a=n.v||{};["u","v"].forEach(function(e){t(n[e])}),["x","y","z"].forEach(function(e){n[e]});for(var o=Math.floor((i.max+i.step-i.min)/i.step),s=Math.floor((a.max+a.step-a.min)/a.step),u=new Float32Array(o*s*5),l=r(i),h=r(a),c=0,d=0;d<s;d++)for(var f=0;f<o;f++){var p=f*i.step+i.min,m=d*a.step+a.min,g=N.a.number.round(Math.min(p,i.max),l),_=N.a.number.round(Math.min(m,a.max),h),v=n.x(g,_),y=n.y(g,_),x=n.z(g,_);u[c++]=v,u[c++]=y,u[c++]=x,u[c++]=g,u[c++]=_}}else{var T=e.equation||{},b=T.x||{},w=T.y||{};if(["x","y"].forEach(function(e){t(T[e])}),"function"!=typeof T.z)return;var E=Math.floor((b.max+b.step-b.min)/b.step),S=Math.floor((w.max+w.step-w.min)/w.step);u=new Float32Array(E*S*3);for(var A=r(b),M=r(w),c=0,d=0;d<S;d++)for(f=0;f<E;f++){var v=f*b.step+b.min,y=d*w.step+w.min,C=N.a.number.round(Math.min(v,b.max),A),L=N.a.number.round(Math.min(y,w.max),M),x=T.z(C,L);u[c++]=C,u[c++]=L,u[c++]=x}}var D=["x","y","z"];return e.parametric&&D.push("u","v"),Object(R.a)(this,D,u)},defaultOption:{coordinateSystem:"cartesian3D",zlevel:-10,grid3DIndex:0,shading:"lambert",parametric:!1,wireframe:{show:!0,lineStyle:{color:"rgba(0,0,0,0.5)",width:1}},equation:{x:{min:-1,max:1,step:.1},y:{min:-1,max:1,step:.1},z:null},parametricEquation:{u:{min:-1,max:1,step:.1},v:{min:-1,max:1,step:.1},x:null,y:null,z:null},itemStyle:{},animationDurationUpdate:500}});N.a.util.merge(o.prototype,i.a)},function(e,t,r){"use strict";var n=r(0),i=r.n(n),Z=r(1),a=(r(2),r(6)),o=r(65),Y=a.a.vec3;i.a.extendChartView({type:"surface",__ecgl__:!0,init:function(){this.groupGL=new Z.a.Node},render:function(e,t,r){var n=this._prevSurfaceMesh;this._prevSurfaceMesh=this._surfaceMesh,this._surfaceMesh=n,this._surfaceMesh||(this._surfaceMesh=this._createSurfaceMesh()),this.groupGL.remove(this._prevSurfaceMesh),this.groupGL.add(this._surfaceMesh);var i,a=e.coordinateSystem,o=e.get("shading"),s=e.getData(),u="ecgl."+o;this._surfaceMesh.material&&this._surfaceMesh.material.shader.name===u||(this._surfaceMesh.material=Z.a.createMaterial(u,["VERTEX_COLOR","DOUBLE_SIDED"])),Z.a.setMaterialFromModel(o,this._surfaceMesh.material,e,r),a&&a.viewGL&&(a.viewGL.add(this.groupGL),i=a.viewGL.isLinearSpace()?"define":"undefine",this._surfaceMesh.material[i]("fragment","SRGB_DECODE"));var l=e.get("parametric"),h=this._getDataShape(s,l),c=e.getModel("wireframe"),d=c.get("lineStyle.width"),f=c.get("show")&&0<d;this._updateSurfaceMesh(this._surfaceMesh,e,h,f);var p=this._surfaceMesh.material;f?(p.define("WIREFRAME_QUAD"),p.set("wireframeLineWidth",d),p.set("wireframeLineColor",Z.a.parseColor(c.get("lineStyle.color")))):p.undefine("WIREFRAME_QUAD"),this._initHandler(e,r),this._updateAnimation(e)},_updateAnimation:function(e){Z.a.updateVertexAnimation([["prevPosition","position"],["prevNormal","normal"]],this._prevSurfaceMesh,this._surfaceMesh,e)},_createSurfaceMesh:function(){var e=new Z.a.Mesh({geometry:new Z.a.Geometry({dynamic:!0,sortTriangles:!0}),shadowDepthMaterial:new Z.a.Material({shader:new Z.a.Shader(Z.a.Shader.source("ecgl.sm.depth.vertex"),Z.a.Shader.source("ecgl.sm.depth.fragment"))}),culling:!1,renderOrder:10,renderNormal:!0});return e.geometry.createAttribute("barycentric","float",4),e.geometry.createAttribute("prevPosition","float",3),e.geometry.createAttribute("prevNormal","float",3),i.a.util.extend(e.geometry,o.a),e},_initHandler:function(e,l){var h=e.getData(),c=this._surfaceMesh,d=e.coordinateSystem;c.seriesIndex=e.seriesIndex;var f=-1;c.off("mousemove"),c.off("mouseout"),c.on("mousemove",function(e){var t=function(e,t){for(var r=1/0,n=-1,i=[],a=0;a<e.length;a++){c.geometry.attributes.position.get(e[a],i);var o=Y.dist(t.array,i);o<r&&(r=o,n=e[a])}return n}(e.triangle,e.point);if(0<=t){var r=[];c.geometry.attributes.position.get(t,r);for(var n=d.pointToData(r),i=1/0,a=-1,o=[],s=0;s<h.count();s++){o[0]=h.get("x",s),o[1]=h.get("y",s),o[2]=h.get("z",s);var u=Y.squaredDistance(o,n);u<i&&(a=s,i=u)}a!==f&&l.dispatchAction({type:"grid3DShowAxisPointer",value:n}),f=a,c.dataIndex=a}else c.dataIndex=-1},this),c.on("mouseout",function(e){f=-1,c.dataIndex=-1,l.dispatchAction({type:"grid3DHideAxisPointer"})},this)},_updateSurfaceMesh:function(e,t,r,n){var i=e.geometry,a=t.getData(),o=a.getLayout("points"),s=0;a.each(function(e){a.hasValue(e)||s++});var u,l=s||n,h=i.attributes.position,c=i.attributes.normal,d=i.attributes.texcoord0,f=i.attributes.barycentric,p=i.attributes.color,m=r.row,g=r.column,_="color"!==t.get("shading");l?(u=(m-1)*(g-1)*4,h.init(u),n&&f.init(u)):h.value=new Float32Array(o),p.init(i.vertexCount),d.init(i.vertexCount);function v(e,t,r){r[1]=e*g+t,r[0]=e*g+t+1,r[3]=(e+1)*g+t+1,r[2]=(e+1)*g+t}var y,x=[0,3,1,1,3,2],T=[[1,1,0,0],[0,1,0,1],[1,0,0,1],[1,0,1,0]],b=i.indices=new(65535<i.vertexCount?Uint32Array:Uint16Array)((m-1)*(g-1)*6),w=!1;if(l){var E=[],S=[],A=0;_?c.init(i.vertexCount):c.value=null;for(var M=[[],[],[]],C=[],L=[],D=Y.create(),N=function(e,t,r){var n=3*t;return r[0]=e[n],r[1]=e[1+n],r[2]=e[2+n],r},R=new Float32Array(o.length),P=new Float32Array(o.length/3*4),I=0;I<a.count();I++)if(a.hasValue(I)){var O=Z.a.parseColor(a.getItemVisual(I,"color")),F=a.getItemVisual(I,"opacity");O[3]*=F,O[3]<.99&&(w=!0);for(var B=0;B<4;B++)P[4*I+B]=O[B]}for(var U=[1e7,1e7,1e7],I=0;I<m-1;I++)for(var z=0;z<g-1;z++){var G=4*(I*(g-1)+z);v(I,z,E);for(var H=!1,B=0;B<4;B++)N(o,E[B],S),y=S,(isNaN(y[0])||isNaN(y[1])||isNaN(y[2]))&&(H=!0);for(B=0;B<4;B++)H?h.set(G+B,U):(N(o,E[B],S),h.set(G+B,S)),n&&f.set(G+B,T[B]);for(B=0;B<6;B++)b[A++]=x[B]+G;if(_&&!H)for(B=0;B<2;B++){for(var V=3*B,k=0;k<3;k++){N(o,X=E[x[V]+k],M[k])}Y.sub(C,M[0],M[1]),Y.sub(L,M[1],M[2]),Y.cross(D,C,L);for(k=0;k<3;k++){var W=3*E[x[V]+k];R[W]=R[W]+D[0],R[1+W]=R[1+W]+D[1],R[2+W]=R[2+W]+D[2]}}}if(_)for(I=0;I<R.length/3;I++)N(R,I,D),Y.normalize(D,D),R[3*I]=D[0],R[3*I+1]=D[1],R[3*I+2]=D[2];for(var O=[],j=[],I=0;I<m-1;I++)for(z=0;z<g-1;z++){G=4*(I*(g-1)+z);v(I,z,E);for(B=0;B<4;B++){for(k=0;k<4;k++)O[k]=P[4*E[B]+k];p.set(G+B,O),_&&(N(R,E[B],D),c.set(G+B,D));var X=E[B];j[0]=X%g/(g-1),j[1]=Math.floor(X/g)/(m-1),d.set(G+B,j)}0}}else{for(j=[],I=0;I<a.count();I++){j[0]=I%g/(g-1),j[1]=Math.floor(I/g)/(m-1);O=Z.a.parseColor(a.getItemVisual(I,"color")),F=a.getItemVisual(I,"opacity");O[3]*=F,O[3]<.99&&(w=!0),p.set(I,O),d.set(I,j)}for(var E=[],q=0,I=0;I<m-1;I++)for(z=0;z<g-1;z++){v(I,z,E);for(B=0;B<6;B++)b[q++]=E[x[B]]}_?i.generateVertexNormals():c.value=null}e.material.get("normalMap")&&i.generateTangents(),i.updateBoundingBox(),i.dirty(),e.material.transparent=w,e.material.depthMask=!w},_getDataShape:function(e,t){for(var r=-1/0,n=0,i=0,a=t?"u":"x",o=0;o<e.count();o++){var s=e.get(a,o);s<r&&(i=0,n++),r=s,i++}return{row:n+1,column:i}},dispose:function(){this.groupGL.removeAll()},remove:function(){this.groupGL.removeAll()}})},function(e,t,r){"use strict";var n=r(0);r.n(n).a.registerLayout(function(e,t){e.eachSeriesByType("surface",function(t){var a=t.coordinateSystem;a&&a.type;var e,o=t.getData(),s=new Float32Array(3*o.count()),u=[NaN,NaN,NaN];a&&"cartesian3D"===a.type&&(e=a.dimensions.map(function(e){return t.coordDimToDataDim(e)[0]}),o.each(e,function(e,t,r,n){var i=o.hasValue(n)?a.dataToPoint([e,t,r]):u;s[3*n]=i[0],s[3*n+1]=i[1],s[3*n+2]=i[2]})),o.setLayout("points",s)})})},function(e,t,r){"use strict";var n=r(0),i=r.n(n),a=(r(99),r(257),r(258),r(17));i.a.registerVisual(Object(a.a)("map3D")),i.a.registerAction({type:"map3DChangeCamera",event:"map3dcamerachanged",update:"series:updateCamera"},function(t,e){e.eachComponent({mainType:"series",subType:"map3D",query:t},function(e){e.setView(t)})})},function(e,t,r){"use strict";function h(e,t){for(var r=[],n=0;n<t.length;n++)r.push(e.dataToPoint(t[n]));return r}var n=r(0),a=r.n(n),i=r(44),o=r(28),s=r(29),u=r(31),l=r(96),c=r(32),d=r(39),f=r(98),p=a.a.extendSeriesModel({type:"series.map3D",layoutMode:"box",coordinateSystem:null,visualColorAccessPath:"itemStyle.color",optionUpdated:function(){var e=this.get("coordinateSystem");null!=e&&"geo3D"!==e&&(this.get("groundPlane.show")&&(this.option.groundPlane.show=!1),this._geo=null)},getInitialData:function(e){e.data=this.getFilledRegions(e.data,e.map);var t=a.a.helper.completeDimensions(["value"],e.data),n=new a.a.List(t,this);n.initData(e.data);var i={};return n.each(function(e){var t=n.getName(e),r=n.getItemModel(e);i[t]=r}),this._regionModelMap=i,n},formatTooltip:function(e){return Object(d.a)(this,e)},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.coordinateSystem,r=this.getData().getName(e);if(t.transform)return(n=t.getRegion(r))?n.geometries:[];this._geo||(this._geo=f.a.createGeo3D(this));for(var n=this._geo.getRegion(r),i=[],a=0;a<n.geometries.length;a++){var o=n.geometries[a],s=[],u=h(t,o.exterior);if(s&&s.length)for(var l=0;l<o.interiors.length;l++)s.push(h(t,s[l]));i.push({interiors:s,exterior:u})}return i},getFormattedLabel:function(e,t){var r=c.a.getFormattedLabel(this,e,t);return null==r&&(r=this.getData().getName(e)),r},defaultOption:{coordinateSystem:"geo3D",data:null}});a.a.util.merge(p.prototype,l.a),a.a.util.merge(p.prototype,i.a),a.a.util.merge(p.prototype,o.a),a.a.util.merge(p.prototype,s.a),a.a.util.merge(p.prototype,u.a)},function(e,t,r){"use strict";var n=r(0),i=r.n(n),a=r(1),s=r(45),u=r(30),o=r(64);i.a.extendChartView({type:"map3D",__ecgl__:!0,init:function(e,t){this._geo3DBuilder=new o.a(t),this.groupGL=new a.a.Node},render:function(e,t,r){var n,i,a,o=e.coordinateSystem;o&&o.viewGL&&(this.groupGL.add(this._geo3DBuilder.rootNode),o.viewGL.add(this.groupGL),"geo3D"===o.type?(this._sceneHelper||(this._sceneHelper=new u.a,this._sceneHelper.initLight(this.groupGL)),this._sceneHelper.setScene(o.viewGL.scene),this._sceneHelper.updateLight(e),o.viewGL.setPostEffect(e.getModel("postEffect"),r),o.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling")),(n=this._control)||(n=this._control=new s.a({zr:r.getZr()}),this._control.init()),i=e.getModel("viewControl"),n.setViewGL(o.viewGL),n.setFromViewControlModel(i,0),n.off("update"),n.on("update",function(){r.dispatchAction({type:"map3DChangeCamera",alpha:n.getAlpha(),beta:n.getBeta(),distance:n.getDistance(),from:this.uid,map3DId:e.id})}),this._geo3DBuilder.extrudeY=!0):(this._control&&(this._control.dispose(),this._control=null),this._sceneHelper&&(this._sceneHelper.dispose(),this._sceneHelper=null),e.getData().getLayout("geo3D"),this._geo3DBuilder.extrudeY=!1),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")}))},afterRender:function(e,t,r,n){var i=n.renderer,a=e.coordinateSystem;a&&"geo3D"===a.type&&(this._sceneHelper.updateAmbientCubemap(i,e,r),this._sceneHelper.updateSkybox(i,e,r))},dispose:function(){this.groupGL.removeAll(),this._control.dispose()}})},function(e,t,r){"use strict";var n=r(0),i=r.n(n),a=(r(260),r(261),r(51)),o=r.n(a),s=r(17);i.a.registerVisual(o()("scatterGL","circle",null)),i.a.registerVisual(Object(s.a)("scatterGL")),i.a.registerLayout({seriesType:"scatterGL",reset:function(e){var t,s,u,l=e.coordinateSystem;return l&&(s=l.dimensions,u=[],1===s.length?t=function(e,t){for(var r=new Float32Array(2*(e.end-e.start)),n=e.start;n<e.end;n++){var i=2*(n-e.start),a=t.get(s[0],n),o=l.dataToPoint(a);r[i]=o[0],r[1+i]=o[1]}t.setLayout("points",r)}:2===s.length&&(t=function(e,t){for(var r=new Float32Array(2*(e.end-e.start)),n=e.start;n<e.end;n++){var i=2*(n-e.start),a=t.get(s[0],n),o=t.get(s[1],n);u[0]=a,u[1]=o,u=l.dataToPoint(u),r[i]=u[0],r[1+i]=u[1]}t.setLayout("points",r)})),{progress:t}}})},function(e,t,r){"use strict";var n=r(0),i=r.n(n);i.a.extendSeriesModel({type:"series.scatterGL",dependencies:["grid","polar","geo","singleAxis"],visualColorAccessPath:"itemStyle.color",getInitialData:function(){return i.a.helper.createList(this)},defaultOption:{coordinateSystem:"cartesian2d",zlevel:10,progressive:1e5,progressiveThreshold:1e5,large:!1,symbol:"circle",symbolSize:10,zoomScale:0,blendMode:"source-over",itemStyle:{opacity:.8},postEffect:{enable:!1,colorCorrection:{exposure:0,brightness:0,contrast:1,saturation:1,enable:!0}}}})},function(e,t,r){"use strict";var n=r(0),i=r.n(n),a=r(1),o=r(22),s=r(67),u=r(103);r(2),i.a.extendChartView({type:"scatterGL",__ecgl__:!0,init:function(){this.groupGL=new a.a.Node,this.viewGL=new o.a("orthographic"),this.viewGL.add(this.groupGL),this._pointsBuilderList=[],this._currentStep=0,this._sizeScale=1,this._glViewHelper=new u.a(this.viewGL)},render:function(e,t,r){var n;this.groupGL.removeAll(),this._glViewHelper.reset(e,r),e.getData().count()&&(n=(n=this._pointsBuilderList[0])||(this._pointsBuilderList[0]=new s.a(!0,r)),this._pointsBuilderList.length=1,this.groupGL.add(n.rootNode),this._removeTransformInPoints(e.getData().getLayout("points")),n.update(e,t,r),this.viewGL.setPostEffect(e.getModel("postEffect"),r))},incrementalPrepareRender:function(e,t,r){this.groupGL.removeAll(),this._glViewHelper.reset(e,r),this._currentStep=0,this.viewGL.setPostEffect(e.getModel("postEffect"),r)},incrementalRender:function(e,t,r,n){var i;e.end<=e.start||((i=this._pointsBuilderList[this._currentStep])||(i=new s.a(!0,n),this._pointsBuilderList[this._currentStep]=i),this.groupGL.add(i.rootNode),this._removeTransformInPoints(t.getData().getLayout("points")),i.setSizeScale(this._sizeScale),i.update(t,r,n,e.start,e.end),n.getZr().refresh(),this._currentStep++)},updateTransform:function(e,t,r){var n,i;e.coordinateSystem.getRoamTransform&&(this._glViewHelper.updateTransform(e,r),n=this._glViewHelper.getZoom(),i=Math.max((e.get("zoomScale")||0)*(n-1)+1,0),this._sizeScale=i,this._pointsBuilderList.forEach(function(e){e.setSizeScale(i)}))},_removeTransformInPoints:function(e){if(e)for(var t=[],r=0;r<e.length;r+=2)t[0]=e[r],t[1]=e[r+1],this._glViewHelper.removeTransformInPoint(t),e[r]=t[0],e[r+1]=t[1]},dispose:function(){this.groupGL.removeAll()},remove:function(){this.groupGL.removeAll()}})},function(e,t,r){"use strict";function n(){}var i=r(0),a=r.n(i),o=(r(263),r(268),r(51)),s=r.n(o),u=r(17);a.a.registerVisual(s()("graphGL","circle",null)),a.a.registerVisual(Object(u.a)("graphGL")),a.a.registerVisual(function(e){var o={};e.eachSeriesByType("graphGL",function(n){var i=n.getCategoriesData(),r=n.getData(),a={};i.each(function(e){var t=i.getName(e);a[t]=e;var r=i.getItemModel(e).get("itemStyle.color")||n.getColorFromPalette(t,o);i.setItemVisual(e,"color",r)}),i.count()&&r.each(function(e){var t=r.getItemModel(e).getShallow("category");null!=t&&("string"==typeof t&&(t=a[t]),r.getItemVisual(e,"color",!0)||r.setItemVisual(e,"color",i.getItemVisual(t,"color")))})})}),a.a.registerVisual(function(e){e.eachSeriesByType("graphGL",function(e){var a=e.getGraph(),o=e.getEdgeData(),s="lineStyle.color".split("."),u="lineStyle.opacity".split(".");o.setVisual("color",e.get(s)),o.setVisual("opacity",e.get(u)),o.each(function(e){var t=o.getItemModel(e),r=a.getEdgeByIndex(e),n=t.get(s),i=t.get(u);switch(n){case"source":n=r.node1.getVisual("color");break;case"target":n=r.node2.getVisual("color")}r.setVisual("color",n),r.setVisual("opacity",i)})})}),a.a.registerAction({type:"graphGLRoam",event:"graphglroam",update:"series.graphGL:roam"},function(t,e){e.eachComponent({mainType:"series",query:t},function(e){e.setView(t)})}),a.a.registerAction({type:"graphGLStartLayout",event:"graphgllayoutstarted",update:"series.graphGL:startLayout"},n),a.a.registerAction({type:"graphGLStopLayout",event:"graphgllayoutstopped",update:"series.graphGL:stopLayout"},n),a.a.registerAction({type:"graphGLFocusNodeAdjacency",event:"graphGLFocusNodeAdjacency",update:"series.graphGL:focusNodeAdjacency"},n),a.a.registerAction({type:"graphGLUnfocusNodeAdjacency",event:"graphGLUnfocusNodeAdjacency",update:"series.graphGL:unfocusNodeAdjacency"},n)},function(e,t,r){"use strict";var n=r(0),l=r.n(n),i=r(264),s=r(32),h=l.a.extendSeriesModel({type:"series.graphGL",visualColorAccessPath:"itemStyle.color",init:function(e){h.superApply(this,"init",arguments),this.legendDataProvider=function(){return this._categoriesData},this._updateCategoriesData()},mergeOption:function(e){h.superApply(this,"mergeOption",arguments),this._updateCategoriesData()},getFormattedLabel:function(e,t,r,n){var i,a,o=s.a.getFormattedLabel(this,e,t,r,n);return null==o&&(a=(i=this.getData()).dimensions[i.dimensions.length-1],o=i.get(a,e)),o},getInitialData:function(e,a){var t=e.edges||e.links||[],r=e.data||e.nodes||[],o=this;if(r&&t)return Object(i.a)(r,t,this,!0,function(e,t){function r(e){return(e=this.parsePath(e))&&"label"===e[0]?i:this.parentModel}e.wrapMethod("getItemModel",function(e){var t=o._categoriesModels[e.getShallow("category")];return t&&(t.parentModel=e.parentModel,e.parentModel=t),e});var n=o.getModel("edgeLabel"),i=new l.a.Model({label:n.option},n.parentModel,a);t.wrapMethod("getItemModel",function(e){return e.customizeGetParent(r),e})}).data},getGraph:function(){return this.getData().graph},getEdgeData:function(){return this.getGraph().edgeData},getCategoriesData:function(){return this._categoriesData},formatTooltip:function(e,t,r){if("edge"!==r)return h.superApply(this,"formatTooltip",arguments);var n=this.getData(),i=this.getDataParams(e,r),a=n.graph.getEdgeByIndex(e),o=n.getName(a.node1.dataIndex),s=n.getName(a.node2.dataIndex),u=[];return null!=o&&u.push(o),null!=s&&u.push(s),u=l.a.format.encodeHTML(u.join(" > ")),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<e.length/2;t++){var r=e[2*t],n=e[2*t+1],i=this.getData().getRawDataItem(t);i.x=r,i.y=n}},isAnimationEnabled:function(){return h.superCall(this,"isAnimationEnabled")&&!("force"===this.get("layout")&&this.get("force.layoutAnimation"))},defaultOption:{zlevel:10,z:2,legendHoverLink:!0,layout:"forceAtlas2",forceAtlas2:{initLayout:null,GPU:!0,steps:1,maxSteps:1e3,repulsionByDegree:!0,linLogMode:!1,strongGravityMode:!1,gravity:1,edgeWeightInfluence:1,edgeWeight:[1,4],nodeWeight:[1,4],preventOverlap:!1,gravityCenter:null},focusNodeAdjacency:!0,focusNodeAdjacencyOn:"mouseover",left:"center",top:"center",symbol:"circle",symbolSize:5,roam:!1,center:null,zoom:1,label:{show:!1,formatter:"{b}",position:"right",distance:5,textStyle:{fontSize:14}},itemStyle:{},lineStyle:{color:"#aaa",width:1,opacity:.5},emphasis:{label:{show:!0}},animation:!1}})},function(e,t,r){"use strict";var n=r(0),g=r.n(n),i=r(265),_=r.n(i),a=r(267),v=r.n(a),y=r(2);t.a=function(e,t,r,n,i){for(var a=new _.a(n),o=0;o<e.length;o++)a.addNode(y.a.firstNotNull(e[o].id,e[o].name,o),o);for(var s=[],u=[],l=0,o=0;o<t.length;o++){var h=t[o],c=h.source,d=h.target;a.addEdge(c,d,l)&&(u.push(h),s.push(y.a.firstNotNull(h.id,c+" > "+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;i<n;i++)0<=r[i].dataIndex&&e.call(t,r[i],i)},o.eachEdge=function(e,t){for(var r=this.edges,n=r.length,i=0;i<n;i++)0<=r[i].dataIndex&&0<=r[i].node1.dataIndex&&0<=r[i].node2.dataIndex&&e.call(t,r[i],i)},o.breadthFirstTraverse=function(e,t,r,n){if(d.isInstance(t)||(t=this._nodesMap[c(t)]),t){for(var i="out"===r?"outEdges":"in"===r?"inEdges":"edges",a=0;a<this.nodes.length;a++)this.nodes[a].__visited=!1;if(!e.call(n,t,null))for(var o=[t];o.length;)for(var s=o.shift(),u=s[i],a=0;a<u.length;a++){var l=u[a],h=l.node1===s?l.node2:l.node1;if(!h.__visited){if(e.call(n,h,s))return;o.push(h),h.__visited=!0}}}},o.update=function(){for(var e=this.data,r=this.edgeData,t=this.nodes,n=this.edges,i=0,a=t.length;i<a;i++)t[i].dataIndex=-1;for(i=0,a=e.count();i<a;i++)t[e.getRawIndex(i)].dataIndex=i;r.filterSelf(function(e){var t=n[r.getRawIndex(e)];return 0<=t.node1.dataIndex&&0<=t.node2.dataIndex});for(i=0,a=n.length;i<a;i++)n[i].dataIndex=-1;for(i=0,a=r.count();i<a;i++)n[r.getRawIndex(i)].dataIndex=i},o.clone=function(){for(var e=new a(this._directed),t=this.nodes,r=this.edges,n=0;n<t.length;n++)e.addNode(t[n].id,t[n].dataIndex);for(n=0;n<r.length;n++){var i=r[n];e.addEdge(i.node1.id,i.node2.id,i.dataIndex)}return e},d.prototype={constructor:d,degree:function(){return this.edges.length},inDegree:function(){return this.inEdges.length},outDegree:function(){return this.outEdges.length},getModel:function(e){if(!(this.dataIndex<0))return this.hostGraph.data.getItemModel(this.dataIndex).getModel(e)}},s.prototype.getModel=function(e){if(!(this.dataIndex<0))return this.hostGraph.edgeData.getItemModel(this.dataIndex).getModel(e)};function u(r,n){return{getValue:function(e){var t=this[r][n];return t.get(t.getDimension(e||"value"),this.dataIndex)},setVisual:function(e,t){0<=this.dataIndex&&this[r][n].setItemVisual(this.dataIndex,e,t)},getVisual:function(e,t){return this[r][n].getItemVisual(this.dataIndex,e,t)},setLayout:function(e,t){0<=this.dataIndex&&this[r][n].setItemLayout(this.dataIndex,e,t)},getLayout:function(){return this[r][n].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[r][n].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[r][n].getRawIndex(this.dataIndex)}}}n.mixin(d,u("hostGraph","data")),n.mixin(s,u("hostGraph","edgeData")),a.Node=d,a.Edge=s,i(d),i(s),e.exports=a},function(e,t,r){function o(e){var t={main:"",sub:""};return e&&(e=e.split(a),t.main=e[0]||"",t.sub=e[1]||""),t}function n(e,t){var r=s.slice(arguments,2);return this.superClass.prototype[t].apply(e,r)}function i(e,t,r){return this.superClass.prototype[t].apply(e,r)}var s=(r(104).__DEV__,r(13)),a=".",u="___EC__COMPONENT__CONTAINER___",l=0;t.parseClassType=o,t.enableClassExtend=function(e,t){(e.$constructor=e).extend=function(e){function t(){e.$constructor?e.$constructor.apply(this,arguments):r.apply(this,arguments)}var r=this;return s.extend(t.prototype,e),t.extend=this.extend,t.superCall=n,t.superApply=i,s.inherits(t,this),t.superClass=r,t}},t.enableClassCheck=function(e){var t=["__\0is_clz",l++,Math.random().toFixed(3)].join("_");e.prototype[t]=!0,e.isInstance=function(e){return!(!e||!e[t])}},t.enableClassManagement=function(r,e){e=e||{};var n,a={};return r.registerClass=function(e,t){var r,n,i;return t&&(i=t,s.assert(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(i),'componentType "'+i+'" illegal'),(t=o(t)).sub?t.sub!==u&&(((n=a[(r=t).main])&&n[u]||((n=a[r.main]={})[u]=!0),n)[t.sub]=e):a[t.main]=e),e},r.getClass=function(e,t,r){var n=a[e];if(n&&n[u]&&(n=t?n[t]:null),r&&!n)throw new Error(t?"Component "+e+"."+(t||"")+" not exists. Load it first.":e+".type should be specified.");return n},r.getClassesByMainType=function(e){e=o(e);var r=[],t=a[e.main];return t&&t[u]?s.each(t,function(e,t){t!==u&&r.push(e)}):r.push(t),r},r.hasClass=function(e){return e=o(e),!!a[e.main]},r.getAllClassMainTypes=function(){var r=[];return s.each(a,function(e,t){r.push(t)}),r},r.hasSubTypes=function(e){e=o(e);var t=a[e.main];return t&&t[u]},r.parseClassType=o,e.registerWhenExtend&&(n=r.extend)&&(r.extend=function(e){var t=n.call(this,e);return r.registerClass(t,e.type)}),r},t.setReadOnly=function(e,t){}},function(e,t,r){function i(e,t){var r,n;return(n=this)[f]===n?u((r=h.extend({},this[d]))[this.dataType]=t,r,e):l(t,this.dataType,this[f],e),t}function a(e,t){return e.struct&&e.struct.update(this),t}function o(r,n){return c(n[d],function(e,t){e!==n&&l(e.cloneShallow(),t,n,r)}),n}function s(e){var t=this[f];return null==e||null==t?t:t[d][e]}function u(r,e,n){r[d]={},c(e,function(e,t){l(e,t,r,n)})}function l(e,t,r,n){(r[d][t]=e)[f]=r,e.dataType=t,n.struct&&(e[n.structAttr]=n.struct,n.struct[n.datasAttr[t]]=e),e.getLinkedData=s}function n(r){var n=r.mainData,e=r.datas;e||(e={main:n},r.datasAttr={main:"data"}),r.datas=r.mainData=null,u(n,e,r),c(e,function(t){c(n.TRANSFERABLE_METHODS,function(e){t.wrapMethod(e,h.curry(i,r))})}),n.wrapMethod("cloneShallow",h.curry(o,r)),c(n.CHANGABLE_METHODS,function(e){n.wrapMethod(e,h.curry(a,r))}),h.assert(e[n.dataType]===n)}var h=r(13),c=h.each,d="\0__link_datas",f="\0__link_mainData";e.exports=n},function(e,t,r){"use strict";var n=r(0),T=r.n(n),i=r(47),b=r.n(i),m=r(1),a=r(22),o=r(105),w=r(2),E=r(269),S=r(271),s=r(80),p=r.n(s),u=r(6),l=r(273),h=r(67),c=r(274),d=u.a.vec2;m.a.Shader.import(c.a);var f,g=1;T.a.extendChartView({type:"graphGL",__ecgl__:!0,init:function(e,t){this.groupGL=new m.a.Node,this.viewGL=new a.a("orthographic"),this.viewGL.camera.left=this.viewGL.camera.right=0,this.viewGL.add(this.groupGL),this._pointsBuilder=new h.a(!0,t),this._forceEdgesMesh=new m.a.Mesh({material:new m.a.Material({shader:m.a.createShader("ecgl.forceAtlas2.edges"),transparent:!0,depthMask:!1,depthTest:!1}),$ignorePicking:!0,geometry:new m.a.Geometry({attributes:{node:new m.a.Geometry.Attribute("node","float",2),color:new m.a.Geometry.Attribute("color","float",4,"COLOR")},dynamic:!0,mainAttribute:"node"}),renderOrder:-1,mode:m.a.Mesh.LINES}),this._edgesMesh=new m.a.Mesh({material:new m.a.Material({shader:m.a.createShader("ecgl.meshLines2D"),transparent:!0,depthMask:!1,depthTest:!1}),$ignorePicking:!0,geometry:new o.a({useNativeLine:!1,dynamic:!0}),renderOrder:-1,culling:!1}),this._layoutId=0,this._control=new l.a({zr:t.getZr(),viewGL:this.viewGL}),this._control.setTarget(this.groupGL),this._control.init(),this._clickHandler=this._clickHandler.bind(this)},render:function(e,t,r){this.groupGL.add(this._pointsBuilder.rootNode),this._model=e,this._api=r,this._initLayout(e,t,r),this._pointsBuilder.update(e,t,r),this._forceLayoutInstance instanceof E.a||this.groupGL.remove(this._forceEdgesMesh),this._updateCamera(e,r),this._control.off("update"),this._control.on("update",function(){r.dispatchAction({type:"graphGLRoam",seriesId:e.id,zoom:this._control.getZoom(),offset:this._control.getOffset()}),this._pointsBuilder.updateView(this.viewGL.camera)},this),this._control.setZoom(w.a.firstNotNull(e.get("zoom"),1)),this._control.setOffset(e.get("offset")||[0,0]);var n,i=this._pointsBuilder.getPointsMesh();i.off("mousemove",this._mousemoveHandler),i.off("mouseout",this._mouseOutHandler,this),r.getZr().off("click",this._clickHandler),this._pointsBuilder.highlightOnMouseover=!0,e.get("focusNodeAdjacency")&&("click"===(n=e.get("focusNodeAdjacencyOn"))?r.getZr().on("click",this._clickHandler):"mouseover"===n&&(i.on("mousemove",this._mousemoveHandler,this),i.on("mouseout",this._mouseOutHandler,this),this._pointsBuilder.highlightOnMouseover=!1)),this._lastMouseOverDataIndex=-1},_clickHandler:function(){var e;this._layouting||(0<=(e=this._pointsBuilder.getPointsMesh().dataIndex)?this._api.dispatchAction({type:"graphGLFocusNodeAdjacency",seriesId:this._model.id,dataIndex:e}):this._api.dispatchAction({type:"graphGLUnfocusNodeAdjacency",seriesId:this._model.id}))},_mousemoveHandler:function(e){var t;this._layouting||(0<=(t=this._pointsBuilder.getPointsMesh().dataIndex)?t!==this._lastMouseOverDataIndex&&this._api.dispatchAction({type:"graphGLFocusNodeAdjacency",seriesId:this._model.id,dataIndex:t}):this._mouseOutHandler(e),this._lastMouseOverDataIndex=t)},_mouseOutHandler:function(){this._layouting||(this._api.dispatchAction({type:"graphGLUnfocusNodeAdjacency",seriesId:this._model.id}),this._lastMouseOverDataIndex=-1)},_updateForceEdgesGeometry:function(i,e){var a=this._forceEdgesMesh.geometry,o=e.getEdgeData(),s=0,u=this._forceLayoutInstance,t=2*o.count();a.attributes.node.init(t),a.attributes.color.init(t),o.each(function(e){var t=i[e];a.attributes.node.set(s,u.getNodeUV(t.node1)),a.attributes.node.set(s+1,u.getNodeUV(t.node2));var r=o.getItemVisual(t.dataIndex,"color"),n=m.a.parseColor(r);n[3]*=w.a.firstNotNull(o.getItemVisual(t.dataIndex,"opacity"),1),a.attributes.color.set(s,n),a.attributes.color.set(s+1,n),s+=2}),a.dirty()},_updateMeshLinesGeometry:function(){var l=this._model.getEdgeData(),h=this._edgesMesh.geometry,l=this._model.getEdgeData(),c=this._model.getData().getLayout("points");h.resetOffset(),h.setVertexCount(l.count()*h.getLineVertexCount()),h.setTriangleCount(l.count()*h.getLineTriangleCount());var d=[],f=[],p=["lineStyle","width"];this._originalEdgeColors=new Float32Array(4*l.count()),this._edgeIndicesMap=new Float32Array(l.count()),l.each(function(e){var t=l.graph.getEdgeByIndex(e),r=2*t.node1.dataIndex,n=2*t.node2.dataIndex;d[0]=c[r],d[1]=c[1+r],f[0]=c[n],f[1]=c[1+n];var i=l.getItemVisual(t.dataIndex,"color"),a=m.a.parseColor(i);a[3]*=w.a.firstNotNull(l.getItemVisual(t.dataIndex,"opacity"),1);var o=l.getItemModel(t.dataIndex),s=w.a.firstNotNull(o.get(p),1)*this._api.getDevicePixelRatio();h.addLine(d,f,a,s);for(var u=0;u<4;u++)this._originalEdgeColors[4*t.dataIndex+u]=a[u];this._edgeIndicesMap[t.dataIndex]=e},this),h.dirty()},_updateForceNodesGeometry:function(e){for(var t=this._pointsBuilder.getPointsMesh(),r=[],n=0;n<e.count();n++)this._forceLayoutInstance.getNodeUV(n,r),t.geometry.attributes.position.set(n,r);t.geometry.dirty("position")},_initLayout:function(e,t,r){var n=e.get("layout"),i=e.getGraph(),a=e.getBoxLayoutParams(),s=b.a.getLayoutRect(a,{width:r.getWidth(),height:r.getHeight()});"force"===n&&(n="forceAtlas2"),this.stopLayout(e,t,r,{beforeLayout:!0});var o,u,l,h,c,d,f,p,m,g,_,v,y=e.getData(),x=e.getData();"forceAtlas2"===n?(o=e.getModel("forceAtlas2"),u=this._forceLayoutInstance,l=[],h=[],c=y.getDataExtent("value"),d=x.getDataExtent("value"),f=w.a.firstNotNull(o.get("edgeWeight"),1),p=w.a.firstNotNull(o.get("nodeWeight"),1),"number"==typeof f&&(f=[f,f]),"number"==typeof p&&(p=[p,p]),v=0,m={},_=new Float32Array(2*y.count()),i.eachNode(function(e){var t,r,n,i=e.dataIndex,a=y.get("value",i);y.hasItemOption&&(r=(t=y.getItemModel(i)).get("x"),n=t.get("y")),null==r&&(r=s.x+Math.random()*s.width,n=s.y+Math.random()*s.height),_[2*v]=r,_[2*v+1]=n,m[e.id]=v++;var o=T.a.number.linearMap(a,c,p);isNaN(o)&&(o=isNaN(p[0])?1:p[0]),l.push({x:r,y:n,mass:o,size:y.getItemVisual(i,"symbolSize")})}),y.setLayout("points",_),i.eachEdge(function(e){var t=e.dataIndex,r=y.get("value",t),n=T.a.number.linearMap(r,d,f);isNaN(n)&&(n=isNaN(f[0])?1:f[0]),h.push({node1:m[e.node1.id],node2:m[e.node2.id],weight:n,dataIndex:t})}),u||(g=o.get("GPU"),this._forceLayoutInstance&&((!g||this._forceLayoutInstance instanceof E.a)&&(g||this._forceLayoutInstance instanceof S.a)||(this._forceLayoutInstanceToDispose=this._forceLayoutInstance)),u=this._forceLayoutInstance=g?new E.a:new S.a),u.initData(l,h),u.updateOption(o.option),this._updateForceEdgesGeometry(u.getEdges(),e),this._updatePositionTexture(),r.dispatchAction({type:"graphGLStartLayout",from:this.uid})):(_=new Float32Array(2*y.count()),v=0,i.eachNode(function(e){var t,r,n,i=e.dataIndex;y.hasItemOption&&(r=(t=y.getItemModel(i)).get("x"),n=t.get("y")),_[v++]=r,_[v++]=n}),y.setLayout("points",_),this._updateAfterLayout(e,t,r))},_updatePositionTexture:function(){var e=this._forceLayoutInstance.getNodePositionTexture();this._pointsBuilder.setPositionTexture(e),this._forceEdgesMesh.material.set("positionTex",e)},startLayout:function(r,e,n,t){var i,a,o,s,u,l,h,c,d,f;t&&null!=t.from&&t.from!==this.uid||(i=this.viewGL,n=this._api,a=this._forceLayoutInstance,o=this._model.getData(),s=this._model.getModel("forceAtlas2"),a&&(this.groupGL.remove(this._edgesMesh),this.groupGL.add(this._forceEdgesMesh),this._forceLayoutInstance)&&(this._updateForceNodesGeometry(r.getData()),this._pointsBuilder.hideLabels(),l=(u=this)._layoutId=g++,h=s.getShallow("maxSteps"),c=s.getShallow("steps"),d=0,f=Math.max(2*c,20),p()(function(){u._forceLayoutInstanceToDispose&&(u._forceLayoutInstanceToDispose.dispose(i.layer.renderer),u._forceLayoutInstanceToDispose=null),function e(t){if(t===u._layoutId)return a.isFinished(h)?(n.dispatchAction({type:"graphGLStopLayout",from:u.uid}),void n.dispatchAction({type:"graphGLFinishLayout",points:o.getLayout("points"),from:u.uid})):void a.update(i.layer.renderer,c,function(){u._updatePositionTexture(),f<=(d+=c)&&(u._syncNodePosition(r),d=0),n.getZr().refresh(),p()(function(){e(t)})})}(l)}),this._layouting=!0))},stopLayout:function(e,t,r,n){n&&null!=n.from&&n.from!==this.uid||(this._layoutId=0,this.groupGL.remove(this._forceEdgesMesh),this.groupGL.add(this._edgesMesh),this._forceLayoutInstance&&this.viewGL.layer&&(n&&n.beforeLayout||(this._syncNodePosition(e),this._updateAfterLayout(e,t,r)),this._api.getZr().refresh(),this._layouting=!1))},_syncNodePosition:function(e){var t=this._forceLayoutInstance.getNodePosition(this.viewGL.layer.renderer);e.getData().setLayout("points",t),e.setNodePosition(t)},_updateAfterLayout:function(e,t,r){this._updateMeshLinesGeometry(),this._pointsBuilder.removePositionTexture(),this._pointsBuilder.updateLayout(e,t,r),this._pointsBuilder.updateView(this.viewGL.camera),this._pointsBuilder.updateLabels(),this._pointsBuilder.showLabels()},focusNodeAdjacency:function(e,t,r,n){var i=this._model.getData();this._downplayAll();var a=n.dataIndex,o=i.graph,s=[],u=o.getNodeByIndex(a);s.push(u),u.edges.forEach(function(e){e.dataIndex<0||(e.node1!==u&&s.push(e.node1),e.node2!==u&&s.push(e.node2))},this),this._pointsBuilder.fadeOutAll(.05),this._fadeOutEdgesAll(.05),s.forEach(function(e){this._pointsBuilder.highlight(i,e.dataIndex)},this),this._pointsBuilder.updateLabels(s.map(function(e){return e.dataIndex}));var l=[];u.edges.forEach(function(e){0<=e.dataIndex&&(this._highlightEdge(e.dataIndex),l.push(e))},this),this._focusNodes=s,this._focusEdges=l},unfocusNodeAdjacency:function(){this._downplayAll(),this._pointsBuilder.fadeInAll(),this._fadeInEdgesAll(),this._pointsBuilder.updateLabels()},_highlightEdge:function(e){var t=this._model.getEdgeData().getItemModel(e),r=m.a.parseColor(t.get("emphasis.lineStyle.color")||t.get("lineStyle.color")),n=w.a.firstNotNull(t.get("emphasis.lineStyle.opacity"),t.get("lineStyle.opacity"),1);r[3]*=n,this._edgesMesh.geometry.setItemColor(this._edgeIndicesMap[e],r)},_downplayAll:function(){this._focusNodes&&this._focusNodes.forEach(function(e){this._pointsBuilder.downplay(this._model.getData(),e.dataIndex)},this),this._focusEdges&&this._focusEdges.forEach(function(e){this._downplayEdge(e.dataIndex)},this)},_downplayEdge:function(e){var t=this._getColor(e,[]);this._edgesMesh.geometry.setItemColor(this._edgeIndicesMap[e],t)},_setEdgeFade:(f=[],function(e,t){this._getColor(e,f),f[3]*=t,this._edgesMesh.geometry.setItemColor(this._edgeIndicesMap[e],f)}),_getColor:function(e,t){for(var r=0;r<4;r++)t[r]=this._originalEdgeColors[4*e+r];return t},_fadeOutEdgesAll:function(t){this._model.getData().graph.eachEdge(function(e){this._setEdgeFade(e.dataIndex,t)},this)},_fadeInEdgesAll:function(){this._fadeOutEdgesAll(1)},_updateCamera:function(e,t){this.viewGL.setViewport(0,0,t.getWidth(),t.getHeight(),t.getDevicePixelRatio());for(var r=this.viewGL.camera,n=e.getData().getLayout("points"),i=d.create(1/0,1/0),a=d.create(-1/0,-1/0),o=[],s=0;s<n.length;)o[0]=n[s++],o[1]=n[s++],d.min(i,i,o),d.max(a,a,o);var u,l,h=(a[1]+i[1])/2,c=(a[0]+i[0])/2;c>r.left&&c<r.right&&h<r.bottom&&h>r.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=5e4<r?10:5e3<r?1:.1,this.scaling=100<r?2:10,e)for(var t in h)null!=e[t]&&(this[t]=e[t]);if(this.repulsionByDegree)for(var n=this._positionSourceTex.pixels,i=0;i<this._nodes.length;i++)n[4*i+2]=(this._nodes[i].degree||0)+1},n.prototype._updateGravityCenter=function(e){var t=this._nodes,r=this._edges;if(this.gravityCenter)this._gravityCenter=this.gravityCenter;else{for(var n=[1/0,1/0],i=[-1/0,-1/0],a=0;a<t.length;a++)n[0]=Math.min(t[a].x,n[0]),n[1]=Math.min(t[a].y,n[1]),i[0]=Math.max(t[a].x,i[0]),i[1]=Math.max(t[a].y,i[1]);this._gravityCenter=[.5*(n[0]+i[0]),.5*(n[1]+i[1])]}for(a=0;a<r.length;a++){var o=r[a].node1,s=r[a].node2;t[o].degree=(t[o].degree||0)+1,t[s].degree=(t[s].degree||0)+1}},n.prototype.initData=function(e,t){this._nodes=e,this._edges=t,this._updateGravityCenter();var r=Math.ceil(Math.sqrt(e.length)),n=r,i=new Float32Array(r*n*4);this._resize(r,n);for(var a=0,o=0;o<e.length;o++){var s=e[o];i[a++]=s.x||0,i[a++]=s.y||0,i[a++]=s.mass||1,i[a++]=s.size||1}this._positionSourceTex.pixels=i;var u=this._edgeForceMesh.geometry,l=t.length;u.attributes.node1.init(2*l),u.attributes.node2.init(2*l),u.attributes.weight.init(2*l);for(var h=[],o=0;o<t.length;o++){var c=u.attributes,d=t[o].weight;null==d&&(d=1),c.node1.set(o,this.getNodeUV(t[o].node1,h)),c.node2.set(o,this.getNodeUV(t[o].node2,h)),c.weight.set(o,d),c.node1.set(o+l,this.getNodeUV(t[o].node2,h)),c.node2.set(o+l,this.getNodeUV(t[o].node1,h)),c.weight.set(o+l,d)}var f=this._weightedSumMesh.geometry;f.attributes.node.init(e.length);for(o=0;o<e.length;o++)f.attributes.node.set(o,this.getNodeUV(o,h));u.dirty(),f.dirty(),this._nodeRepulsionPass.material.define("fragment","NODE_COUNT",e.length),this._nodeRepulsionPass.material.setUniform("textureSize",[r,n]),this._inited=!1,this._frame=0},n.prototype.getNodes=function(){return this._nodes},n.prototype.getEdges=function(){return this._edges},n.prototype.step=function(e){this._inited||(this._initFromSource(e),this._inited=!0),this._frame++,this._framebuffer.attach(this._forceTex),this._framebuffer.bind(e);var t=this._nodeRepulsionPass;t.setUniform("strongGravityMode",this.strongGravityMode),t.setUniform("gravity",this.gravity),t.setUniform("gravityCenter",this._gravityCenter),t.setUniform("scaling",this.scaling),t.setUniform("preventOverlap",this.preventOverlap),t.setUniform("positionTex",this._positionPrevTex),t.render(e);var r=this._edgeForceMesh;r.material.set("linLogMode",this.linLogMode),r.material.set("edgeWeightInfluence",this.edgeWeightInfluence),r.material.set("preventOverlap",this.preventOverlap),r.material.set("positionTex",this._positionPrevTex),e.gl.enable(e.gl.BLEND),e.renderPass([r],this._dummyCamera),this._framebuffer.attach(this._weightedSumTex),e.gl.clearColor(0,0,0,0),e.gl.clear(e.gl.COLOR_BUFFER_BIT),e.gl.enable(e.gl.BLEND);var n=this._weightedSumMesh;n.material.set("positionTex",this._positionPrevTex),n.material.set("forceTex",this._forceTex),n.material.set("forcePrevTex",this._forcePrevTex),e.renderPass([n],this._dummyCamera),this._framebuffer.attach(this._globalSpeedTex);var i=this._globalSpeedPass;i.setUniform("globalSpeedPrevTex",this._globalSpeedPrevTex),i.setUniform("weightedSumTex",this._weightedSumTex),i.setUniform("jitterTolerence",this.jitterTolerence),e.gl.disable(e.gl.BLEND),i.render(e);var a=this._positionPass;this._framebuffer.attach(this._positionTex),a.setUniform("globalSpeedTex",this._globalSpeedTex),a.setUniform("positionTex",this._positionPrevTex),a.setUniform("forceTex",this._forceTex),a.setUniform("forcePrevTex",this._forcePrevTex),a.render(e),this._framebuffer.unbind(e),this._swapTexture()},n.prototype.update=function(e,t,r){null==t&&(t=1),t=Math.max(t,1);for(var n=0;n<t;n++)this.step(e);r&&r()},n.prototype.getNodePositionTexture=function(){return this._inited?this._positionPrevTex:this._positionSourceTex},n.prototype.getNodeUV=function(e,t){t=t||[];var r=this._positionTex.width,n=this._positionTex.height;return t[0]=e%r/(r-1),t[1]=Math.floor(e/r)/(n-1)||0,t},n.prototype.getNodePosition=function(e,t){var r=this._positionArr,n=this._positionTex.width,i=this._positionTex.height,a=n*i;r&&r.length===4*a||(r=this._positionArr=new Float32Array(4*a)),this._framebuffer.bind(e),this._framebuffer.attach(this._positionPrevTex),e.gl.readPixels(0,0,n,i,e.gl.RGBA,e.gl.FLOAT,r),this._framebuffer.unbind(e),t=t||new Float32Array(2*this._nodes.length);for(var o=0;o<this._nodes.length;o++)t[2*o]=r[4*o],t[2*o+1]=r[4*o+1];return t},n.prototype.getTextureData=function(e,t){var r=this["_"+t+"Tex"],n=r.width,i=r.height;this._framebuffer.bind(e),this._framebuffer.attach(r);var a=new Float32Array(n*i*4);return e.gl.readPixels(0,0,n,i,e.gl.RGBA,e.gl.FLOAT,a),this._framebuffer.unbind(e),a},n.prototype.getTextureSize=function(){return{width:this._positionTex.width,height:this._positionTex.height}},n.prototype.isFinished=function(e){return this._frame>e},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;c<e.length;c++){var d=e[c];o[2*c]=d.x,o[2*c+1]=d.y,s[c]=null==d.mass?1:d.mass,u[c]=null==d.size?1:d.size}for(c=0;c<t.length;c++){var f=t[c],p=f.node1,m=f.node2;l[2*c]=p,l[2*c+1]=m,h[c]=null==f.weight?1:f.weight}var g=Math.ceil(Math.sqrt(e.length)),_=g,v=new Float32Array(g*_*4),y=this._positionTex;y.width=g,y.height=_,y.pixels=v,this._worker.postMessage({cmd:"init",nodesPosition:o,nodesMass:s,nodesSize:u,edges:l,edgesWeight:h}),this._globalSpeed=1/0},n.prototype.updateOption=function(e){var t={};for(a in c)t[a]=c[a];var r=this._nodes,n=this._edges,i=r.length;if(t.jitterTolerence=5e4<i?10:5e3<i?1:.1,t.scaling=100<i?2:10,t.barnesHutOptimize=1e3<i,e)for(var a in c)null!=e[a]&&(t[a]=e[a]);if(!t.gravityCenter){for(var o=[1/0,1/0],s=[-1/0,-1/0],u=0;u<r.length;u++)o[0]=Math.min(r[u].x,o[0]),o[1]=Math.min(r[u].y,o[1]),s[0]=Math.max(r[u].x,s[0]),s[1]=Math.max(r[u].y,s[1]);t.gravityCenter=[.5*(o[0]+s[0]),.5*(o[1]+s[1])]}for(u=0;u<n.length;u++){var l=n[u].node1,h=n[u].node2;r[l].degree=(r[l].degree||0)+1,r[h].degree=(r[h].degree||0)+1}this._worker&&this._worker.postMessage({cmd:"updateConfig",config:t})},n.prototype.update=function(e,t,r){null==t&&(t=1),t=Math.max(t,1),this._frame+=t,this._onupdate=r,this._worker&&this._worker.postMessage({cmd:"update",steps:Math.round(t)})},n.prototype._$onupdate=function(e){var t;this._disposed||(t=new Float32Array(e.data.buffer),this._globalSpeed=e.data.globalSpeed,this._positionArr=t,this._updateTexture(t),this._onupdate&&this._onupdate())},n.prototype.getNodePositionTexture=function(){return this._positionTex},n.prototype.getNodeUV=function(e,t){t=t||[];var r=this._positionTex.width,n=this._positionTex.height;return t[0]=e%r/(r-1),t[1]=Math.floor(e/r)/(n-1),t},n.prototype.getNodes=function(){return this._nodes},n.prototype.getEdges=function(){return this._edges},n.prototype.isFinished=function(e){return this._frame>e},n.prototype.getNodePosition=function(e,t){if(t=t||new Float32Array(2*this._nodes.length),this._positionArr)for(var r=0;r<this._positionArr.length;r++)t[r]=this._positionArr[r];return t},n.prototype._updateTexture=function(e){for(var t=this._positionTex.pixels,r=0,n=0;n<e.length;)t[r++]=e[n++],t[r++]=e[n++],t[r++]=1,t[r++]=1;this._positionTex.dirty()},n.prototype.dispose=function(e){this._disposed=!0,this._worker=null},t.a=n},function(e,t,r){"use strict";t.a=function(){function t(){this.subRegions=[],this.nSubRegions=0,this.node=null,this.mass=0,this.centerOfMass=null,this.bbox=new Float32Array(4),this.size=0}function s(){this.position=new Float32Array(2),this.force=f.create(),this.forcePrev=f.create(),this.mass=1,this.inDegree=0,this.outDegree=0}function l(e,t){this.source=e,this.target=t,this.weight=1}function u(){this.autoSettings=!0,this.barnesHutOptimize=!0,this.barnesHutTheta=1.5,this.repulsionByDegree=!0,this.linLogMode=!1,this.strongGravityMode=!1,this.gravity=1,this.scaling=1,this.edgeWeightInfluence=1,this.jitterTolerence=.1,this.preventOverlap=!1,this.dissuadeHubs=!1,this.rootRegion=new t,this.rootRegion.centerOfMass=f.create(),this.nodes=[],this.edges=[],this.bbox=new Float32Array(4),this.gravityCenter=null,this._massArr=null,this._swingingArr=null,this._sizeArr=null,this._globalSpeed=0}var f={create:function(){return new Float32Array(2)},dist:function(e,t){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)},len:function(e){var t=e[0],r=e[1];return Math.sqrt(t*t+r*r)},scaleAndAdd:function(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e},scale:function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e},add:function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e},sub:function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e},normalize:function(e,t){var r=t[0],n=t[1],i=r*r+n*n;return 0<i&&(i=1/Math.sqrt(i),e[0]=t[0]*i,e[1]=t[1]*i),e},negate:function(e,t){return e[0]=-t[0],e[1]=-t[1],e},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e},set:function(e,t,r){return e[0]=t,e[1]=r,e}},e=t.prototype;e.beforeUpdate=function(){for(var e=0;e<this.nSubRegions;e++)this.subRegions[e].beforeUpdate();this.mass=0,this.centerOfMass&&(this.centerOfMass[0]=0,this.centerOfMass[1]=0),this.nSubRegions=0,this.node=null},e.afterUpdate=function(){this.subRegions.length=this.nSubRegions;for(var e=0;e<this.nSubRegions;e++)this.subRegions[e].afterUpdate()},e.addNode=function(e){if(0===this.nSubRegions){if(null==this.node)return void(this.node=e);this._addNodeToSubRegion(this.node),this.node=null}this._addNodeToSubRegion(e),this._updateCenterOfMass(e)},e.findSubRegion=function(e,t){for(var r=0;r<this.nSubRegions;r++){var n=this.subRegions[r];if(n.contain(e,t))return n}},e.contain=function(e,t){return this.bbox[0]<=e&&this.bbox[2]>=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;a<n;a++){var o=new s;o.position[0]=e[2*a],o.position[1]=e[2*a+1],o.mass=t[a],i&&(o.size=r[a]),this.nodes.push(o)}this._massArr=t,this._swingingArr=new Float32Array(n),i&&(this._sizeArr=r)},i.initEdges=function(e,t){for(var r=e.length/2,n=this.edges.length=0;n<r;n++){var i=e[2*n],a=e[2*n+1],o=this.nodes[i],s=this.nodes[a];if(!o||!s)return void console.error("Node not exists, try initNodes before initEdges");o.outDegree++,s.inDegree++;var u=new l(o,s);t&&(u.weight=t[n]),this.edges.push(u)}},i.updateSettings=function(){if(this.repulsionByDegree)for(var e=0;e<this.nodes.length;e++){(t=this.nodes[e]).mass=t.inDegree+t.outDegree+1}else for(e=0;e<this.nodes.length;e++){var t;(t=this.nodes[e]).mass=this._massArr[e]}},i.update=function(){var e=this.nodes.length;if(this.updateSettings(),this.updateBBox(),this.barnesHutOptimize){this.rootRegion.setBBox(this.bbox[0],this.bbox[1],this.bbox[2],this.bbox[3]),this.rootRegion.beforeUpdate();for(var t=0;t<e;t++)this.rootRegion.addNode(this.nodes[t]);this.rootRegion.afterUpdate()}for(t=0;t<e;t++){var r=this.nodes[t];f.copy(r.forcePrev,r.force),f.set(r.force,0,0)}for(t=0;t<e;t++){var n=this.nodes[t];if(this.barnesHutOptimize)this.applyRegionToNodeRepulsion(this.rootRegion,n);else for(var i=t+1;i<e;i++){var a=this.nodes[i];this.applyNodeToNodeRepulsion(n,a,!1)}0<this.gravity&&(this.strongGravityMode?this.applyNodeStrongGravity(n):this.applyNodeGravity(n))}for(t=0;t<this.edges.length;t++)this.applyEdgeAttraction(this.edges[t]);for(var o=0,s=0,u=f.create(),t=0;t<e;t++){r=this.nodes[t];o+=(h=f.dist(r.force,r.forcePrev))*r.mass,f.add(u,r.force,r.forcePrev),s+=.5*f.len(u)*r.mass,this._swingingArr[t]=h}var l=this.jitterTolerence*this.jitterTolerence*s/o;0<this._globalSpeed&&(l=Math.min(l/this._globalSpeed,1.5)*this._globalSpeed),this._globalSpeed=l;for(t=0;t<e;t++){var r=this.nodes[t],h=this._swingingArr[t],c=.1*l/(1+l*Math.sqrt(h)),d=f.len(r.force);0<d&&(c=Math.min(d*c,10)/d,f.scaleAndAdd(r.position,r.position,r.force,c))}},i.applyRegionToNodeRepulsion=(a=f.create(),function(e,t){if(e.node)this.applyNodeToNodeRepulsion(e.node,t,!0);else{f.sub(a,t.position,e.centerOfMass);var r=a[0]*a[0]+a[1]*a[1];if(r>this.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<e.nSubRegions;i++)this.applyRegionToNodeRepulsion(e.subRegions[i],t)}}),i.applyNodeToNodeRepulsion=(h=f.create(),function(e,t,r){if(e!=t){f.sub(h,e.position,t.position);var n,i=h[0]*h[0]+h[1]*h[1];if(0!=i){if(this.preventOverlap){var a=Math.sqrt(i);if(0<(a=a-e.size-t.size))n=this.scaling*e.mass*t.mass/(a*a);else{if(!(a<0))return;n=100*this.scaling*e.mass*t.mass}}else n=this.scaling*e.mass*t.mass/i;f.scaleAndAdd(e.force,e.force,h,n),f.scaleAndAdd(t.force,t.force,h,-n)}}}),i.applyEdgeAttraction=(o=f.create(),function(e){var t=e.source,r=e.target;f.sub(o,t.position,r.position);var n,i=f.len(o),a=0===this.edgeWeightInfluence?1:1===this.edgeWeightInfluence?e.weight:Math.pow(e.weight,this.edgeWeightInfluence);this.preventOverlap&&(i=i-t.size-r.size)<=0||(n=this.linLogMode?-a*Math.log(i+1)/(i+1):-a,f.scaleAndAdd(t.force,t.force,o,n),f.scaleAndAdd(r.force,r.force,o,-n))}),i.applyNodeGravity=(n=f.create(),function(e){f.sub(n,this.gravityCenter,e.position);var t=f.len(n);f.scaleAndAdd(e.force,e.force,n,this.gravity*e.mass/(t+1))}),i.applyNodeStrongGravity=(r=f.create(),function(e){f.sub(r,this.gravityCenter,e.position),f.scaleAndAdd(e.force,e.force,r,this.gravity*e.mass)}),i.updateBBox=function(){for(var e=1/0,t=1/0,r=-1/0,n=-1/0,i=0;i<this.nodes.length;i++)var a=this.nodes[i].position,e=Math.min(e,a[0]),t=Math.min(t,a[1]),r=Math.max(r,a[0]),n=Math.max(n,a[1]);this.bbox[0]=e,this.bbox[1]=t,this.bbox[2]=r,this.bbox[3]=n},i.getGlobalSpeed=function(){return this._globalSpeed};var c=null;self.onmessage=function(e){switch(e.data.cmd){case"init":(c=new u).initNodes(e.data.nodesPosition,e.data.nodesMass,e.data.nodesSize),c.initEdges(e.data.edges,e.data.edgesWeight);break;case"updateConfig":if(c)for(var t in e.data.config)c[t]=e.data.config[t];break;case"update":var r=e.data.steps;if(c){for(var n=0;n<r;n++)c.update();for(var i=c.nodes.length,a=new Float32Array(2*i),n=0;n<i;n++){var o=c.nodes[n];a[2*n]=o.position[0],a[2*n+1]=o.position[1]}self.postMessage({buffer:a.buffer,globalSpeed:c.getGlobalSpeed()},[a.buffer])}else{var s=new Float32Array;self.postMessage({buffer:s.buffer,globalSpeed:c.getGlobalSpeed()},[s.buffer])}}}}},function(e,t,r){"use strict";var n=r(7),i=(r(2),n.a.extend(function(){return{zr:null,viewGL:null,minZoom:.2,maxZoom:5,_needsUpdate:!1,_dx:0,_dy:0,_zoom:1}},function(){this._mouseDownHandler=this._mouseDownHandler.bind(this),this._mouseWheelHandler=this._mouseWheelHandler.bind(this),this._mouseMoveHandler=this._mouseMoveHandler.bind(this),this._mouseUpHandler=this._mouseUpHandler.bind(this),this._update=this._update.bind(this)},{init:function(){var e=this.zr;e.on("mousedown",this._mouseDownHandler),e.on("mousewheel",this._mouseWheelHandler),e.on("globalout",this._mouseUpHandler),e.animation.on("frame",this._update)},setTarget:function(e){this._target=e},setZoom:function(e){this._zoom=Math.max(Math.min(e,this.maxZoom),this.minZoom),this._needsUpdate=!0},setOffset:function(e){this._dx=e[0],this._dy=e[1],this._needsUpdate=!0},getZoom:function(){return this._zoom},getOffset:function(){return[this._dx,this._dy]},_update:function(){var e,t;this._target&&this._needsUpdate&&(e=this._target,t=this._zoom,e.position.x=this._dx,e.position.y=this._dy,e.scale.set(t,t,t),this.zr.refresh(),this._needsUpdate=!1,this.trigger("update"))},_mouseDownHandler:function(e){var t,r,n;e.target||(t=e.offsetX,r=e.offsetY,this.viewGL&&!this.viewGL.containPoint(t,r)||(this.zr.on("mousemove",this._mouseMoveHandler),this.zr.on("mouseup",this._mouseUpHandler),n=this._convertPos(t,r),this._x=n.x,this._y=n.y))},_convertPos:function(e,t){var r=this.viewGL.camera,n=this.viewGL.viewport;return{x:(e-n.x)/n.width*(r.right-r.left)+r.left,y:(t-n.y)/n.height*(r.bottom-r.top)+r.top}},_mouseMoveHandler:function(e){var t=this._convertPos(e.offsetX,e.offsetY);this._dx+=t.x-this._x,this._dy+=t.y-this._y,this._x=t.x,this._y=t.y,this._needsUpdate=!0},_mouseUpHandler:function(){this.zr.off("mousemove",this._mouseMoveHandler),this.zr.off("mouseup",this._mouseUpHandler)},_mouseWheelHandler:function(e){var t,r,n,i,a,o,s,u=(e=e.event).wheelDelta||-e.detail;0!==u&&(t=e.offsetX,r=e.offsetY,this.viewGL&&!this.viewGL.containPoint(t,r)||(i=0<u?1.1:.9,i=(n=Math.max(Math.min(this._zoom*i,this.maxZoom),this.minZoom))/this._zoom,o=((a=this._convertPos(t,r)).x-this._dx)*(i-1),s=(a.y-this._dy)*(i-1),this._dx-=o,this._dy-=s,this._zoom=n,this._needsUpdate=!0))},dispose:function(){var e=this.zr;e.off("mousedown",this._mouseDownHandler),e.off("mousemove",this._mouseMoveHandler),e.off("mouseup",this._mouseUpHandler),e.off("mousewheel",this._mouseWheelHandler),e.off("globalout",this._mouseUpHandler),e.animation.off("frame",this._update)}}));t.a=i},function(e,t,r){"use strict";t.a="@export ecgl.lines2D.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nattribute vec2 position: POSITION;\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n\n#ifdef POSITIONTEXTURE_ENABLED\nuniform sampler2D positionTexture;\n#endif\n\nvoid main()\n{\n gl_Position = worldViewProjection * vec4(position, -10.0, 1.0);\n\n v_Color = a_Color;\n}\n\n@end\n\n@export ecgl.lines2D.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nvarying vec4 v_Color;\n\nvoid main()\n{\n gl_FragColor = color * v_Color;\n}\n@end\n\n\n@export ecgl.meshLines2D.vertex\n\nattribute vec2 position: POSITION;\nattribute vec2 normal;\nattribute float offset;\nattribute vec4 a_Color : COLOR;\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform vec4 viewport : VIEWPORT;\n\nvarying vec4 v_Color;\nvarying float v_Miter;\n\nvoid main()\n{\n vec4 p2 = worldViewProjection * vec4(position + normal, -10.0, 1.0);\n gl_Position = worldViewProjection * vec4(position, -10.0, 1.0);\n\n p2.xy /= p2.w;\n gl_Position.xy /= gl_Position.w;\n\n vec2 N = normalize(p2.xy - gl_Position.xy);\n gl_Position.xy += N * offset / viewport.zw * 2.0;\n\n gl_Position.xy *= gl_Position.w;\n\n v_Color = a_Color;\n}\n@end\n\n\n@export ecgl.meshLines2D.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nvarying vec4 v_Color;\nvarying float v_Miter;\n\nvoid main()\n{\n gl_FragColor = color * v_Color;\n}\n\n@end"},function(e,t,r){"use strict";var n=r(0);r.n(n),r(276),r(280)},function(e,t,r){"use strict";var n=r(0),i=r.n(n),c=r(1),d=r(2),a=r(22),o=r(277);i.a.extendChartView({type:"flowGL",__ecgl__:!0,init:function(){this.viewGL=new a.a("orthographic"),this.groupGL=new c.a.Node,this.viewGL.add(this.groupGL),this._particleSurface=new o.a;var e=new c.a.Mesh({geometry:new c.a.PlaneGeometry,material:new c.a.Material({shader:new c.a.Shader({vertex:c.a.Shader.source("ecgl.color.vertex"),fragment:c.a.Shader.source("ecgl.color.fragment")}),transparent:!0})});e.material.enableTexture("diffuseMap"),this.groupGL.add(e),this._planeMesh=e},render:function(e,t,r){var n=this._particleSurface;n.setParticleType(e.get("particleType")),n.setSupersampling(e.get("supersampling")),this._updateData(e,r),this._updateCamera(r.getWidth(),r.getHeight(),r.getDevicePixelRatio());var i=d.a.firstNotNull(e.get("particleDensity"),128);n.setParticleDensity(i,i);var a=this._planeMesh,o=+new Date,s=this,u=!0;a.__percent=0,a.stopAnimation(),a.animate("",{loop:!0}).when(1e5,{__percent:1}).during(function(){var e=+new Date,t=Math.min(e-o,20);o+=t,s._renderer&&(n.update(s._renderer,r,t/1e3,u),a.material.set("diffuseMap",n.getSurfaceTexture())),u=!1}).start();var l=e.getModel("itemStyle"),h=c.a.parseColor(l.get("color"));h[3]*=d.a.firstNotNull(l.get("opacity"),1),a.material.set("color",h),n.setColorTextureImage(e.get("colorTexture"),r),n.setParticleSize(e.get("particleSize")),n.particleSpeedScaling=e.get("particleSpeed"),n.motionBlurFactor=1-Math.pow(.1,e.get("particleTrail"))},updateTransform:function(e,t,r){this._updateData(e,r)},afterRender:function(e,t,r,n){var i=n.renderer;this._renderer=i},_updateData:function(t,e){var r,o=t.coordinateSystem,n=o.dimensions.map(function(e){return t.coordDimToDataDim(e)[0]}),i=t.getData(),a=i.getDataExtent(n[0]),s=i.getDataExtent(n[1]),u=t.get("gridWidth"),l=t.get("gridHeight");null!=u&&"auto"!==u||(r=(a[1]-a[0])/(s[1]-s[0]),u=Math.round(Math.sqrt(r*i.count()))),null!=l&&"auto"!==l||(l=Math.ceil(i.count()/u));var h=this._particleSurface.vectorFieldTexture,c=h.pixels;if(c&&c.length===l*u*4)for(var d=0;d<c.length;d++)c[d]=0;else c=h.pixels=new Float32Array(u*l*4);var f=0,p=1/0,m=new Float32Array(2*i.count()),g=0,_=[[1/0,1/0],[-1/0,-1/0]];i.each([n[0],n[1],"vx","vy"],function(e,t,r,n){var i=o.dataToPoint([e,t]);m[g++]=i[0],m[g++]=i[1],_[0][0]=Math.min(i[0],_[0][0]),_[0][1]=Math.min(i[1],_[0][1]),_[1][0]=Math.max(i[0],_[1][0]),_[1][1]=Math.max(i[1],_[1][1]);var a=Math.sqrt(r*r+n*n);f=Math.max(f,a),p=Math.min(p,a)}),i.each(["vx","vy"],function(e,t,r){var n=Math.round((m[2*r]-_[0][0])/(_[1][0]-_[0][0])*(u-1)),i=4*((l-1-Math.round((m[2*r+1]-_[0][1])/(_[1][1]-_[0][1])*(l-1)))*u+n);c[i]=e/f*.5+.5,c[1+i]=t/f*.5+.5,c[3+i]=1}),h.width=u,h.height=l,"bmap"===t.get("coordinateSystem")&&this._fillEmptyPixels(h),h.dirty(),this._updatePlanePosition(_[0],_[1],t,e),this._updateGradientTexture(i.getVisual("visualMeta"),[p,f])},_fillEmptyPixels:function(e){function t(e,t,r){e=Math.max(Math.min(e,a-1),0);var n=4*((t=Math.max(Math.min(t,o-1),0))*(a-1)+e);return 0!==i[3+n]&&(r[0]=i[n],r[1]=i[1+n],1)}function r(e,t,r){r[0]=e[0]+t[0],r[1]=e[1]+t[1]}for(var i=e.pixels,a=e.width,o=e.height,n=[],s=[],u=[],l=[],h=[],c=0,d=0;d<o;d++)for(var f=0;f<a;f++){var p=4*(d*(a-1)+f);0===i[3+p]&&(c=n[0]=n[1]=0,t(f-1,d,s)&&(c++,r(s,n,n)),t(f+1,d,u)&&(c++,r(u,n,n)),t(f,d-1,l)&&(c++,r(l,n,n)),t(f,d+1,h)&&(c++,r(h,n,n)),n[0]/=c,n[1]/=c,i[p]=n[0],i[1+p]=n[1]),i[3+p]=1}},_updateGradientTexture:function(e,r){var t,n,i,a;e&&e.length?(this._gradientTexture=this._gradientTexture||new c.a.Texture2D({image:document.createElement("canvas")}),(n=(t=this._gradientTexture).image).width=200,n.height=1,i=n.getContext("2d"),a=i.createLinearGradient(0,.5,n.width,.5),e[0].stops.forEach(function(e){var t=r[1]===r[0]?0:(t=e.value/r[1],Math.min(Math.max(t,0),1));a.addColorStop(t,e.color)}),i.fillStyle=a,i.fillRect(0,0,n.width,n.height),t.dirty(),this._particleSurface.setGradientTexture(this._gradientTexture)):this._particleSurface.setGradientTexture(null)},_updatePlanePosition:function(e,t,r,n){var i=this._limitInViewportAndFullFill(e,t,r,n);e=i.leftTop,t=i.rightBottom,this._particleSurface.setRegion(i.region),this._planeMesh.position.set((e[0]+t[0])/2,n.getHeight()-(e[1]+t[1])/2,0);var a=t[0]-e[0],o=t[1]-e[1];this._planeMesh.scale.set(a/2,o/2,1),this._particleSurface.resize(Math.max(Math.min(a,2048),1),Math.max(Math.min(o,2048),1)),this._renderer&&this._particleSurface.clearFrame(this._renderer)},_limitInViewportAndFullFill:function(e,t,r,n){var i,a=[Math.max(e[0],0),Math.max(e[1],0)],o=[Math.min(t[0],n.getWidth()),Math.min(t[1],n.getHeight())];"bmap"===r.get("coordinateSystem")&&(i=r.getData().getDataExtent(r.coordDimToDataDim("lng")[0]),359<=Math.floor(i[1]-i[0])&&(0<a[0]&&(a[0]=0),o[0]<n.getWidth()&&(o[0]=n.getWidth())));var s=t[0]-e[0],u=t[1]-e[1],l=o[0]-a[0],h=o[1]-a[1];return{leftTop:a,rightBottom:o,region:[(a[0]-e[0])/s,1-h/u-(a[1]-e[1])/u,l/s,h/u]}},_updateCamera:function(e,t,r){this.viewGL.setViewport(0,0,e,t,r);var n=this.viewGL.camera;n.left=n.bottom=0,n.top=t,n.right=e,n.near=0,n.far=100,n.position.z=10},remove:function(){this._planeMesh.stopAnimation(),this.groupGL.removeAll()},dispose:function(){this._renderer&&this._particleSurface.dispose(this._renderer),this.groupGL.removeAll()}})},function(e,t,r){"use strict";var i=r(16),a=r(15),o=r(40),s=r(19),u=r(8),l=r(5),h=r(4),c=r(37),d=r(43),f=r(10),p=r(278),n=r(279);u.a.import(n.a);function m(){this.motionBlurFactor=.99,this.vectorFieldTexture=new l.a({type:h.a.FLOAT,flipY:!1}),this.particleLife=[5,20],this._particleType="point",this._particleSize=1,this.particleColor=[1,1,1,1],this.particleSpeedScaling=1,this._thisFrameTexture=null,this._particlePass=null,this._spawnTexture=null,this._particleTexture0=null,this._particleTexture1=null,this._particlePointsMesh=null,this._surfaceFrameBuffer=null,this._elapsedTime=0,this._scene=null,this._camera=null,this._lastFrameTexture=null,this._supersampling=1,this._downsampleTextures=[],this._width=512,this._height=512,this.init()}m.prototype={constructor:m,init:function(){var e={type:h.a.FLOAT,minFilter:h.a.NEAREST,magFilter:h.a.NEAREST,useMipmap:!1};this._spawnTexture=new l.a(e),this._particleTexture0=new l.a(e),this._particleTexture1=new l.a(e),this._frameBuffer=new f.a({depthBuffer:!1}),this._particlePass=new i.a({fragment:u.a.source("ecgl.vfParticle.particle.fragment")}),this._particlePass.setUniform("velocityTexture",this.vectorFieldTexture),this._particlePass.setUniform("spawnTexture",this._spawnTexture),this._downsamplePass=new i.a({fragment:u.a.source("clay.compositor.downsample")});var t=new o.a({renderOrder:10,material:new s.a({shader:new u.a(u.a.source("ecgl.vfParticle.renderPoints.vertex"),u.a.source("ecgl.vfParticle.renderPoints.fragment"))}),mode:o.a.POINTS,geometry:new a.a({dynamic:!0,mainAttribute:"texcoord0"})}),r=new o.a({renderOrder:10,material:new s.a({shader:new u.a(u.a.source("ecgl.vfParticle.renderLines.vertex"),u.a.source("ecgl.vfParticle.renderLines.fragment"))}),geometry:new p.a,culling:!1}),n=new o.a({material:new s.a({shader:new u.a(u.a.source("ecgl.color.vertex"),u.a.source("ecgl.color.fragment"))}),geometry:new d.a});n.material.enableTexture("diffuseMap"),this._particlePointsMesh=t,this._particleLinesMesh=r,this._lastFrameFullQuadMesh=n,this._camera=new c.a,this._thisFrameTexture=new l.a,this._lastFrameTexture=new l.a},setParticleDensity:function(e,t){for(var r=new Float32Array(4*(e*t)),n=0,i=this.particleLife,a=0;a<e;a++)for(var o=0;o<t;o++,n++){r[4*n]=Math.random(),r[4*n+1]=Math.random(),r[4*n+2]=Math.random();var s=(i[1]-i[0])*Math.random()+i[0];r[4*n+3]=s}"line"===this._particleType?this._setLineGeometry(e,t):this._setPointsGeometry(e,t),this._spawnTexture.width=e,this._spawnTexture.height=t,this._spawnTexture.pixels=r,this._particleTexture0.width=this._particleTexture1.width=e,this._particleTexture0.height=this._particleTexture1.height=t,this._particlePass.setUniform("textureSize",[e,t])},_setPointsGeometry:function(e,t){var r=e*t,n=this._particlePointsMesh.geometry,i=n.attributes;i.texcoord0.init(r);for(var a=0,o=0;o<e;o++)for(var s=0;s<t;s++,a++)i.texcoord0.value[2*a]=o/e,i.texcoord0.value[2*a+1]=s/t;n.dirty()},_setLineGeometry:function(e,t){var r=e*t,n=this._getParticleMesh().geometry;n.setLineCount(r),n.resetOffset();for(var i=0;i<e;i++)for(var a=0;a<t;a++)n.addLine([i/e,a/t]);n.dirty()},_getParticleMesh:function(){return"line"===this._particleType?this._particleLinesMesh:this._particlePointsMesh},update:function(e,t,r,n){var i=this._getParticleMesh(),a=this._frameBuffer,o=this._particlePass;n&&this._updateDownsampleTextures(e,t),i.material.set("size",this._particleSize*this._supersampling),i.material.set("color",this.particleColor),o.setUniform("speedScaling",this.particleSpeedScaling),a.attach(this._particleTexture1),o.setUniform("firstFrameTime",n?(this.particleLife[1]+this.particleLife[0])/2:0),o.setUniform("particleTexture",this._particleTexture0),o.setUniform("deltaTime",r),o.setUniform("elapsedTime",this._elapsedTime),o.render(e,a),i.material.set("particleTexture",this._particleTexture1),i.material.set("prevParticleTexture",this._particleTexture0),a.attach(this._thisFrameTexture),a.bind(e),e.gl.clear(e.gl.DEPTH_BUFFER_BIT|e.gl.COLOR_BUFFER_BIT);var s=this._lastFrameFullQuadMesh;s.material.set("diffuseMap",this._lastFrameTexture),s.material.set("color",[1,1,1,this.motionBlurFactor]),this._camera.update(!0),e.renderPass([s,i],this._camera),a.unbind(e),this._downsample(e),this._swapTexture(),this._elapsedTime+=r},_downsample:function(e){var t=this._downsampleTextures;if(0!==t.length)for(var r=0,n=this._thisFrameTexture,i=t[r];i;)this._frameBuffer.attach(i),this._downsamplePass.setUniform("texture",n),this._downsamplePass.setUniform("textureSize",[n.width,n.height]),this._downsamplePass.render(e,this._frameBuffer),n=i,i=t[++r]},getSurfaceTexture:function(){var e=this._downsampleTextures;return 0<e.length?e[e.length-1]:this._lastFrameTexture},setRegion:function(e){this._particlePass.setUniform("region",e)},resize:function(e,t){this._lastFrameTexture.width=e*this._supersampling,this._lastFrameTexture.height=t*this._supersampling,this._thisFrameTexture.width=e*this._supersampling,this._thisFrameTexture.height=t*this._supersampling,this._width=e,this._height=t},setParticleSize:function(e){var t=this._getParticleMesh();if(e<=2)return t.material.disableTexture("spriteTexture"),void(t.material.transparent=!1);this._spriteTexture||(this._spriteTexture=new l.a),this._spriteTexture.image&&this._spriteTexture.image.width===e||(this._spriteTexture.image=function(e){var t=document.createElement("canvas");t.width=t.height=e;var r=t.getContext("2d");return r.fillStyle="#fff",r.arc(e/2,e/2,e/2,0,2*Math.PI),r.fill(),t}(e),this._spriteTexture.dirty()),t.material.transparent=!0,t.material.enableTexture("spriteTexture"),t.material.set("spriteTexture",this._spriteTexture),this._particleSize=e},setGradientTexture:function(e){var t=this._getParticleMesh().material;t[e?"enableTexture":"disableTexture"]("gradientTexture"),t.setUniform("gradientTexture",e)},setColorTextureImage:function(e,t){this._getParticleMesh().material.setTextureImage("colorTexture",e,t,{flipY:!0})},setParticleType:function(e){this._particleType=e},clearFrame:function(e){var t=this._frameBuffer;t.attach(this._lastFrameTexture),t.bind(e),e.gl.clear(e.gl.DEPTH_BUFFER_BIT|e.gl.COLOR_BUFFER_BIT),t.unbind(e)},setSupersampling:function(e){this._supersampling=e,this.resize(this._width,this._height)},_updateDownsampleTextures:function(e,t){for(var r=this._downsampleTextures,n=Math.max(Math.floor(Math.log(this._supersampling/t.getDevicePixelRatio())/Math.log(2)),0),i=2,a=this._width*this._supersampling,o=this._height*this._supersampling,s=0;s<n;s++)r[s]=r[s]||new l.a,r[s].width=a/i,r[s].height=o/i,i*=2;for(;s<r.length;s++)r[s].dispose(e);r.length=n},_swapTexture:function(){var e=this._particleTexture0;this._particleTexture0=this._particleTexture1,this._particleTexture1=e;e=this._thisFrameTexture;this._thisFrameTexture=this._lastFrameTexture,this._lastFrameTexture=e},dispose:function(t){t.disposeFrameBuffer(this._frameBuffer),t.disposeTexture(this.vectorFieldTexture),t.disposeTexture(this._spawnTexture),t.disposeTexture(this._particleTexture0),t.disposeTexture(this._particleTexture1),t.disposeTexture(this._thisFrameTexture),t.disposeTexture(this._lastFrameTexture),t.disposeGeometry(this._particleLinesMesh.geometry),t.disposeGeometry(this._particlePointsMesh.geometry),t.disposeGeometry(this._lastFrameFullQuadMesh.geometry),this._spriteTexture&&t.disposeTexture(this._spriteTexture),this._particlePass.dispose(t),this._downsamplePass.dispose(t),this._downsampleTextures.forEach(function(e){e.dispose(t)})}},t.a=m},function(e,t,r){"use strict";var n=r(15),i=r(0),a=(r.n(i),n.a.extend(function(){return{dynamic:!0,attributes:{position:new n.a.Attribute("position","float",3,"POSITION")}}},{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0},setLineCount:function(e){var t=this.attributes,r=4*e,n=2*e;this.vertexCount!==r&&t.position.init(r),this.triangleCount!==n&&(this.indices=0==n?null:new(65535<this.vertexCount?Uint32Array:Uint16Array)(3*n))},addLine:function(e){var t=this._vertexOffset;this.attributes.position.set(t,[e[0],e[1],1]),this.attributes.position.set(t+1,[e[0],e[1],-1]),this.attributes.position.set(t+2,[e[0],e[1],2]),this.attributes.position.set(t+3,[e[0],e[1],-2]),this.setTriangleIndices(this._faceOffset++,[t,t+1,t+2]),this.setTriangleIndices(this._faceOffset++,[t+1,t+2,t+3]),this._vertexOffset+=4}}));t.a=a},function(e,t,r){"use strict";t.a="@export ecgl.vfParticle.particle.fragment\n\nuniform sampler2D particleTexture;\nuniform sampler2D spawnTexture;\nuniform sampler2D velocityTexture;\n\nuniform float deltaTime;\nuniform float elapsedTime;\n\nuniform float speedScaling : 1.0;\n\nuniform vec2 textureSize;\nuniform vec4 region : [0, 0, 1, 1];\nuniform float firstFrameTime;\n\nvarying vec2 v_Texcoord;\n\n\nvoid main()\n{\n vec4 p = texture2D(particleTexture, v_Texcoord);\n bool spawn = false;\n if (p.w <= 0.0) {\n p = texture2D(spawnTexture, fract(v_Texcoord + elapsedTime / 10.0));\n p.w -= firstFrameTime;\n spawn = true;\n }\n vec2 v = texture2D(velocityTexture, fract(p.xy * region.zw + region.xy)).xy;\n v = (v - 0.5) * 2.0;\n p.z = length(v);\n p.xy += v * deltaTime / 10.0 * speedScaling;\n p.w -= deltaTime;\n\n if (spawn || p.xy != fract(p.xy)) {\n p.z = 0.0;\n }\n p.xy = fract(p.xy);\n\n gl_FragColor = p;\n}\n@end\n\n@export ecgl.vfParticle.renderPoints.vertex\n\n#define PI 3.1415926\n\nattribute vec2 texcoord : TEXCOORD_0;\n\nuniform sampler2D particleTexture;\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nuniform float size : 1.0;\n\nvarying float v_Mag;\nvarying vec2 v_Uv;\n\nvoid main()\n{\n vec4 p = texture2D(particleTexture, texcoord);\n\n if (p.w > 0.0 && p.z > 1e-5) {\n gl_Position = worldViewProjection * vec4(p.xy * 2.0 - 1.0, 0.0, 1.0);\n }\n else {\n gl_Position = vec4(100000.0, 100000.0, 100000.0, 1.0);\n }\n\n v_Mag = p.z;\n v_Uv = p.xy;\n\n gl_PointSize = size;\n}\n\n@end\n\n@export ecgl.vfParticle.renderPoints.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\nuniform sampler2D gradientTexture;\nuniform sampler2D colorTexture;\nuniform sampler2D spriteTexture;\n\nvarying float v_Mag;\nvarying vec2 v_Uv;\n\nvoid main()\n{\n gl_FragColor = color;\n#ifdef SPRITETEXTURE_ENABLED\n gl_FragColor *= texture2D(spriteTexture, gl_PointCoord);\n if (color.a == 0.0) {\n discard;\n }\n#endif\n#ifdef GRADIENTTEXTURE_ENABLED\n gl_FragColor *= texture2D(gradientTexture, vec2(v_Mag, 0.5));\n#endif\n#ifdef COLORTEXTURE_ENABLED\n gl_FragColor *= texture2D(colorTexture, v_Uv);\n#endif\n}\n\n@end\n\n@export ecgl.vfParticle.renderLines.vertex\n\n#define PI 3.1415926\n\nattribute vec3 position : POSITION;\n\nuniform sampler2D particleTexture;\nuniform sampler2D prevParticleTexture;\n\nuniform float size : 1.0;\nuniform vec4 vp: VIEWPORT;\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nvarying float v_Mag;\nvarying vec2 v_Uv;\n\n@import clay.util.rand\n\nvoid main()\n{\n vec4 p = texture2D(particleTexture, position.xy);\n vec4 p2 = texture2D(prevParticleTexture, position.xy);\n\n p.xy = p.xy * 2.0 - 1.0;\n p2.xy = p2.xy * 2.0 - 1.0;\n\n if (p.w > 0.0 && p.z > 1e-5) {\n vec2 dir = normalize(p.xy - p2.xy);\n vec2 norm = vec2(dir.y / vp.z, -dir.x / vp.w) * sign(position.z) * size;\n if (abs(position.z) == 2.0) {\n gl_Position = vec4(p.xy + norm, 0.0, 1.0);\n v_Uv = p.xy;\n v_Mag = p.z;\n }\n else {\n gl_Position = vec4(p2.xy + norm, 0.0, 1.0);\n v_Mag = p2.z;\n v_Uv = p2.xy;\n }\n gl_Position = worldViewProjection * gl_Position;\n }\n else {\n gl_Position = vec4(100000.0, 100000.0, 100000.0, 1.0);\n }\n}\n\n@end\n\n@export ecgl.vfParticle.renderLines.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\nuniform sampler2D gradientTexture;\nuniform sampler2D colorTexture;\n\nvarying float v_Mag;\nvarying vec2 v_Uv;\n\nvoid main()\n{\n gl_FragColor = color;\n #ifdef GRADIENTTEXTURE_ENABLED\n gl_FragColor *= texture2D(gradientTexture, vec2(v_Mag, 0.5));\n#endif\n#ifdef COLORTEXTURE_ENABLED\n gl_FragColor *= texture2D(colorTexture, v_Uv);\n#endif\n}\n\n@end\n"},function(e,t,r){"use strict";var n=r(0),i=r.n(n);i.a.extendSeriesModel({type:"series.flowGL",dependencies:["geo","grid","bmap"],visualColorAccessPath:"itemStyle.color",getInitialData:function(){var e=i.a.getCoordinateSystemDimensions(this.get("coordinateSystem"))||["x","y"];e.push("vx","vy");var t=i.a.helper.completeDimensions(e,this.getSource(),{encodeDef:this.get("encode"),dimsDef:this.get("dimensions")}),r=new i.a.List(t,this);return r.initData(this.getSource()),r},defaultOption:{coordinateSystem:"cartesian2d",zlevel:10,supersampling:1,particleType:"point",particleDensity:128,particleSize:1,particleSpeed:1,particleTrail:2,colorTexture:null,gridWidth:"auto",gridHeight:"auto",itemStyle:{color:"#fff",opacity:.8}}})},function(e,t,r){"use strict";var n=r(0),i=r.n(n),a=(r(282),r(283),r(17));i.a.registerVisual(Object(a.a)("linesGL"))},function(e,t,r){"use strict";var n=r(0),i=r.n(n),a=r(13),o=(r.n(a),i.a.extendSeriesModel({type:"series.linesGL",dependencies:["grid","geo"],visualColorAccessPath:"lineStyle.color",streamEnabled:!0,init:function(e){var t=this._processFlatCoordsArray(e.data);this._flatCoords=t.flatCoords,this._flatCoordsOffset=t.flatCoordsOffset,t.flatCoords&&(e.data=new Float32Array(t.count)),o.superApply(this,"init",arguments)},mergeOption:function(e){var t=this._processFlatCoordsArray(e.data);this._flatCoords=t.flatCoords,this._flatCoordsOffset=t.flatCoordsOffset,t.flatCoords&&(e.data=new Float32Array(t.count)),o.superApply(this,"mergeOption",arguments)},appendData:function(e){var t=this._processFlatCoordsArray(e.data);t.flatCoords&&(this._flatCoords?(this._flatCoords=Object(a.concatArray)(this._flatCoords,t.flatCoords),this._flatCoordsOffset=Object(a.concatArray)(this._flatCoordsOffset,t.flatCoordsOffset)):(this._flatCoords=t.flatCoords,this._flatCoordsOffset=t.flatCoordsOffset),e.data=new Float32Array(t.count)),this.getRawData().appendData(e.data)},_getCoordsFromItemModel:function(e){var t=this.getData().getItemModel(e);return t.option instanceof Array?t.option:t.getShallow("coords")},getLineCoordsCount:function(e){return this._flatCoordsOffset?this._flatCoordsOffset[2*e+1]:this._getCoordsFromItemModel(e).length},getLineCoords:function(e,t){if(this._flatCoordsOffset){for(var r=this._flatCoordsOffset[2*e],n=this._flatCoordsOffset[2*e+1],i=0;i<n;i++)t[i]=t[i]||[],t[i][0]=this._flatCoords[r+2*i],t[i][1]=this._flatCoords[r+2*i+1];return n}for(var a=this._getCoordsFromItemModel(e),i=0;i<a.length;i++)t[i]=t[i]||[],t[i][0]=a[i][0],t[i][1]=a[i][1];return a.length},_processFlatCoordsArray:function(e){var t=0;if(this._flatCoords&&(t=this._flatCoords.length),"number"!=typeof e[0])return{flatCoordsOffset:null,flatCoords:null,count:e.length};for(var r=e.length,n=new Uint32Array(r),i=new Float64Array(r),a=0,o=0,s=0,u=0;u<r;){s++;var l=e[u++];n[o++]=a+t,n[o++]=l;for(var h=0;h<l;h++){var c=e[u++],d=e[u++];i[a++]=c,i[a++]=d}}return{flatCoordsOffset:new Uint32Array(n.buffer,0,o),flatCoords:i,count:s}},getInitialData:function(e){var a=new i.a.List(["value"],this);return a.hasItemOption=!1,a.initData(e.data,[],function(e,t,r,n){if(e instanceof Array)return NaN;a.hasItemOption=!0;var i=e.value;return null!=i?i instanceof Array?i[n]:i:void 0}),a},defaultOption:{coordinateSystem:"geo",zlevel:10,progressive:1e4,progressiveThreshold:5e4,blendMode:"source-over",lineStyle:{opacity:.8},postEffect:{enable:!1,colorCorrection:{exposure:0,brightness:0,contrast:1,saturation:1,enable:!0}}}}))},function(e,t,r){"use strict";var n=r(0),i=r.n(n),M=r(1),a=r(22),o=r(105),s=r(103),C=r(2);i.a.extendChartView({type:"linesGL",__ecgl__:!0,init:function(){this.groupGL=new M.a.Node,this.viewGL=new a.a("orthographic"),this.viewGL.add(this.groupGL),this._glViewHelper=new s.a(this.viewGL),this._nativeLinesShader=M.a.createShader("ecgl.lines3D"),this._meshLinesShader=M.a.createShader("ecgl.meshLines3D"),this._linesMeshes=[],this._currentStep=0},render:function(e,t,r){this.groupGL.removeAll(),this._glViewHelper.reset(e,r);var n=(n=this._linesMeshes[0])||(this._linesMeshes[0]=this._createLinesMesh(e));this._linesMeshes.length=1,this.groupGL.add(n),this._updateLinesMesh(e,n,0,e.getData().count()),this.viewGL.setPostEffect(e.getModel("postEffect"),r)},incrementalPrepareRender:function(e,t,r){this.groupGL.removeAll(),this._glViewHelper.reset(e,r),this._currentStep=0,this.viewGL.setPostEffect(e.getModel("postEffect"),r)},incrementalRender:function(e,t,r,n){var i=this._linesMeshes[this._currentStep];i||(i=this._createLinesMesh(t),this._linesMeshes[this._currentStep]=i),this._updateLinesMesh(t,i,e.start,e.end),this.groupGL.add(i),n.getZr().refresh(),this._currentStep++},updateTransform:function(e,t,r){e.coordinateSystem.getRoamTransform&&this._glViewHelper.updateTransform(e,r)},_createLinesMesh:function(){return new M.a.Mesh({$ignorePicking:!0,material:new M.a.Material({shader:M.a.createShader("ecgl.lines3D"),transparent:!0,depthMask:!1,depthTest:!1}),geometry:new o.a({segmentScale:10,useNativeLine:!0,dynamic:!1}),mode:M.a.Mesh.LINES,culling:!1})},_updateLinesMesh:function(e,t,r,n){function i(){p[0]=f[0]*y+g[0]*v-(f[1]-g[1])*o,p[1]=f[1]*y+g[1]*v-(g[0]-f[0])*o,m[0]=f[0]*v+g[0]*y-(f[1]-g[1])*o,m[1]=f[1]*v+g[1]*y-(g[0]-f[0])*o}var a=e.getData();t.material.blend="lighter"===e.get("blendMode")?M.a.additiveBlend:null;var o=e.get("lineStyle.curveness")||0,s=e.get("polyline"),u=t.geometry,l=e.coordinateSystem,h=C.a.firstNotNull(e.get("lineStyle.width"),1);1<h?(t.material.shader!==this._meshLinesShader&&t.material.attachShader(this._meshLinesShader),t.mode=M.a.Mesh.TRIANGLES):(t.material.shader!==this._nativeLinesShader&&t.material.attachShader(this._nativeLinesShader),t.mode=M.a.Mesh.LINES),r=r||0,n=n||a.count(),u.resetOffset();var c=0,d=0,f=[],p=[],m=[],g=[],_=[],v=.3,y=.7;if(s||0!==o)for(var x=r;x<n;x++){s?(S=e.getLineCoordsCount(x),c+=u.getPolylineVertexCount(S),d+=u.getPolylineTriangleCount(S)):(e.getLineCoords(x,_),this._glViewHelper.dataToPoint(l,_[0],f),this._glViewHelper.dataToPoint(l,_[1],g),i(),c+=u.getCubicCurveVertexCount(f,p,m,g),d+=u.getCubicCurveTriangleCount(f,p,m,g))}else{var T=n-r;c+=T*u.getLineVertexCount(),d+=T*u.getLineVertexCount()}u.setVertexCount(c),u.setTriangleCount(d);for(var b=r,w=[],x=r;x<n;x++){M.a.parseColor(a.getItemVisual(b,"color"),w);var E=C.a.firstNotNull(a.getItemVisual(b,"opacity"),1);w[3]*=E;for(var S=e.getLineCoords(x,_),A=0;A<S;A++)this._glViewHelper.dataToPoint(l,_[A],_[A]);s?u.addPolyline(_,w,h,0,S):0!==o?(f=_[0],g=_[1],i(),u.addCubicCurve(f,p,m,g,w,h)):u.addPolyline(_,w,h,0,2),b++}},dispose:function(){this.groupGL.removeAll()},remove:function(){this.groupGL.removeAll()}})}],n.c=a,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=106);function n(e){if(a[e])return a[e].exports;var t=a[e]={i:e,l:!1,exports:{}};return i[e].call(t.exports,t,t.exports,n),t.l=!0,t.exports}var i,a});