u)e="",a=[];else if(null!=c)for(var l=h(c-(n?n[1]+n[3]:0),t,r.ellipsis,{minChar:r.minChar,placeholder:r.placeholder}),f=0,p=a.length;fa&&_(n,e.substring(a,o)),_(n,r[2],r[1]),a=N.lastIndex}ag)return{lines:[],width:0,height:0};E.textWidth=i(E.text,O);var L=S.textWidth,D=null==L||"auto"===L;if("string"==typeof L&&"%"===L.charAt(L.length-1))E.percentWidth=L,l.push(E),L=0;else{if(D){L=E.textWidth;var R=S.textBackgroundColor,I=R&&R.image;I&&(I=w.findExistImage(I),w.isImageReady(I)&&(L=Math.max(L,I.width*P/I.height)))}var k=A?A[1]+A[3]:0;L+=k;var F=null!=p?p-b:null;null!=F&&F4){console.warn("Support at most 4 cascade");continue}m.shadowCascade>1&&(s=m),this.renderDirectionalLightShadow(e,t,n,m,h,f,l)}else"SPOT_LIGHT"===m.type?this.renderSpotLightShadow(e,t,m,c,u):"POINT_LIGHT"===m.type&&this.renderPointLightShadow(e,t,m,d);this._shadowMapNumber[m.type]++}for(var g in this._shadowMapNumber)for(var v=this._shadowMapNumber[g],y=g+"_SHADOWMAP_COUNT",p=0;p0?x.define("fragment",y,v):x.isDefined("fragment",y)&&x.undefine("fragment",y))}for(var p=0;p0){var w=l.map(i);if(b.directionalLightShadowMaps={value:l,type:"tv"},b.directionalLightMatrices={value:f,type:"m4v"},b.directionalLightShadowMapSizes={value:w,type:"1fv"},s){var T=h.slice(),E=h.slice();T.pop(),E.shift(),T.reverse(),E.reverse(),f.reverse(),b.shadowCascadeClipsNear={value:T,type:"1fv"},b.shadowCascadeClipsFar={value:E,type:"1fv"}}}if(u.length>0){var S=u.map(i),b=t.shadowUniforms;b.spotLightShadowMaps={value:u,type:"tv"},b.spotLightMatrices={value:c,type:"m4v"},b.spotLightShadowMapSizes={value:S,type:"1fv"}}d.length>0&&(b.pointLightShadowMaps={value:d,type:"tv"})}},renderDirectionalLightShadow:function(){var e=new s.a,t=new u.a,n=new o.a,r=new u.a,i=new u.a,a=new u.a,l=new u.a;return function(o,s,f,h,d,p,m){var v=this._getDepthMaterial(h),y={getMaterial:function(e){return e.shadowDepthMaterial||v},ifRender:function(e){return e.castShadow},sortCompare:c.a.opaqueSortCompare};if(!s.viewBoundingBoxLastFrame.isFinite()){var _=s.getBoundingBox();s.viewBoundingBoxLastFrame.copy(_).applyTransform(f.viewMatrix)}var x=Math.min(-s.viewBoundingBoxLastFrame.min.z,f.far),b=Math.max(-s.viewBoundingBoxLastFrame.max.z,f.near),w=this._getDirectionalLightCamera(h,s,f),E=a.array;l.copy(w.projectionMatrix),T.invert(i.array,w.worldTransform.array),T.multiply(i.array,i.array,f.worldTransform.array),T.multiply(E,l.array,i.array);for(var C=[],M=f instanceof g.a,A=(f.near+f.far)/(f.near-f.far),O=2*f.near*f.far/(f.near-f.far),P=0;P<=h.shadowCascade;P++){var L=b*Math.pow(x/b,P/h.shadowCascade),N=b+(x-b)*P/h.shadowCascade,D=L*h.cascadeSplitLogFactor+N*(1-h.cascadeSplitLogFactor);C.push(D),d.push(-(-D*A+O)/-D)}var R=this._getTexture(h,h.shadowCascade);m.push(R);var I=o.viewport,k=o.gl;this._frameBuffer.attach(R),this._frameBuffer.bind(o),k.clear(k.COLOR_BUFFER_BIT|k.DEPTH_BUFFER_BIT);for(var P=0;Pu?s>c?v[i>0?"px":"nx"]=!0:v[o>0?"pz":"nz"]=!0:u>c?v[a>0?"py":"ny"]=!0:v[o>0?"pz":"nz"]=!0}for(var n=0;n= 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,n){"use strict";function r(){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 d.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=A.map(function(e){return this._compositor.getNodeByName(e)},this);var n={normalTexture:this._normalPass.getNormalTexture(),depthTexture:this._normalPass.getDepthTexture()};this._ssaoPass=new c.a(n),this._ssrPass=new l.a(n),this._edgePass=new p.a(n)}var i=n(8),a=n(5),o=n(6),s=n(10),u=n(168),c=n(181),l=n(183),f=n(185),h=n(2),d=n(186),p=n(188),m=(n(7),n(189)),g=n(80),v=n(81),y=n(82),_=n(83),x=n(84),b=n(85),w=n(86),T=n(87),E=n(88),S=n(190),C=n(191);i.a.import(g.a),i.a.import(v.a),i.a.import(y.a),i.a.import(_.a),i.a.import(x.a),i.a.import(b.a),i.a.import(w.a),i.a.import(T.a),i.a.import(E.a),i.a.import(S.a),i.a.import(C.a);var M={color:{parameters:{width:function(e){return e.getWidth()},height:function(e){return e.getHeight()}}}},A=["composite","FXAA"];r.prototype.resize=function(e,t,n){n=n||1;var e=e*n,t=t*n,r=this._sourceTexture,i=this._depthTexture;r.width=e,r.height=t,i.width=e,i.height=t},r.prototype._ifRenderNormalPass=function(){return this._enableSSAO||this._enableEdge||this._enableSSR},r.prototype._getPrevNode=function(e){for(var t=A.indexOf(e.name)-1,n=this._finalNodesChain[t];n&&!this._compositor.getNodeByName(n.name);)t-=1,n=this._finalNodesChain[t];return n},r.prototype._getNextNode=function(e){for(var t=A.indexOf(e.name)+1,n=this._finalNodesChain[t];n&&!this._compositor.getNodeByName(n.name);)t+=1,n=this._finalNodesChain[t];return n},r.prototype._addChainNode=function(e){var t=this._getPrevNode(e),n=this._getNextNode(e);t&&(t.outputs=M,e.inputs.texture=t.name,n?(e.outputs=M,n.inputs.texture=e.name):e.outputs=null,this._compositor.addNode(e))},r.prototype._removeChainNode=function(e){var t=this._getPrevNode(e),n=this._getNextNode(e);t&&(n?(t.outputs=M,n.inputs.texture=t.name):t.outputs=null,this._compositor.removeNode(e))},r.prototype.updateNormal=function(e,t,n,r){this._ifRenderNormalPass()&&this._normalPass.update(e,t,n)},r.prototype.updateSSAO=function(e,t,n,r){this._ssaoPass.update(e,n,r)},r.prototype.enableSSAO=function(){this._enableSSAO=!0},r.prototype.disableSSAO=function(){this._enableSSAO=!1},r.prototype.enableSSR=function(){this._enableSSR=!0},r.prototype.disableSSR=function(){this._enableSSR=!1},r.prototype.getSSAOTexture=function(){return this._ssaoPass.getTargetTexture()},r.prototype.getSourceFrameBuffer=function(){return this._framebuffer},r.prototype.getSourceTexture=function(){return this._sourceTexture},r.prototype.disableFXAA=function(){this._removeChainNode(this._fxaaNode)},r.prototype.enableFXAA=function(){this._addChainNode(this._fxaaNode)},r.prototype.enableBloom=function(){this._compositeNode.inputs.bloom="bloom_composite",this._compositor.dirty()},r.prototype.disableBloom=function(){this._compositeNode.inputs.bloom=null,this._compositor.dirty()},r.prototype.enableDOF=function(){this._compositeNode.inputs.texture="dof_composite",this._compositor.dirty()},r.prototype.disableDOF=function(){this._compositeNode.inputs.texture="source",this._compositor.dirty()},r.prototype.enableColorCorrection=function(){this._compositeNode.define("COLOR_CORRECTION"),this._enableColorCorrection=!0},r.prototype.disableColorCorrection=function(){this._compositeNode.undefine("COLOR_CORRECTION"),this._enableColorCorrection=!1},r.prototype.enableEdge=function(){this._enableEdge=!0},r.prototype.disableEdge=function(){this._enableEdge=!1},r.prototype.setBloomIntensity=function(e){this._compositeNode.setParameter("bloomIntensity",e)},r.prototype.setSSAOParameter=function(e,t){switch(e){case"quality":var n={low:6,medium:12,high:32,ultra:62}[t]||12;this._ssaoPass.setParameter("kernelSize",n);break;case"radius":this._ssaoPass.setParameter(e,t),this._ssaoPass.setParameter("bias",t/200);break;case"intensity":this._ssaoPass.setParameter(e,t);break;default:console.warn("Unkown SSAO parameter "+e)}},r.prototype.setDOFParameter=function(e,t){switch(e){case"focalDistance":case"focalRange":case"fstop":this._cocNode.setParameter(e,t);break;case"blurRadius":for(var n=0;n=0||(this.nodes.push(e),this._dirty=!0)},removeNode:function(e){"string"==typeof e&&(e=this.getNodeByName(e));var t=this.nodes.indexOf(e);t>=0&&(this.nodes.splice(t,1),this._dirty=!0)},getNodeByName:function(e){for(var t=0;t=t.COLOR_ATTACHMENT0&&c<=t.COLOR_ATTACHMENT0+8&&f.push(c);l.drawBuffersEXT(f)}e.saveClear(),e.clearBit=i.a.DEPTH_BUFFER_BIT|i.a.COLOR_BUFFER_BIT,n=e.render(this.scene,this.camera,!this.autoUpdateScene,this.preZ),e.restoreClear(),r.unbind(e)}else n=e.render(this.scene,this.camera,!this.autoUpdateScene,this.preZ);this.trigger("afterrender",n),this._rendering=!1,this._rendered=!0}});t.a=o},function(e,t,n){"use strict";var r=n(42),i=r.a.extend(function(){return{texture:null,outputs:{color:{}}}},function(){},{getOutput:function(e,t){return this.texture},beforeFrame:function(){},afterFrame:function(){}});t.a=i},function(e,t,n){"use strict";var r=n(14),i=n(42),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 r.a({fragment:this.shader});this.pass=e},{render:function(e,t){this.trigger("beforerender",e),this._rendering=!0;var n=e.gl;for(var r in this.inputLinks){var i=this.inputLinks[r],a=i.node.getOutput(e,i.pin);this.pass.setUniform(r,a)}if(this.outputs){this.pass.outputs={};var o={};for(var s in this.outputs){var u=this.updateParameter(s,e);isNaN(u.width)&&this.updateParameter(s,e);var c=this.outputs[s],l=this._compositor.allocateTexture(u);this._outputTextures[s]=l;var f=c.attachment||n.COLOR_ATTACHMENT0;"string"==typeof f&&(f=n[f]),o[f]=l}this._compositor.getFrameBuffer().bind(e);for(var f in o)this._compositor.getFrameBuffer().attach(o[f],f);this.pass.render(e),this._compositor.getFrameBuffer().updateMipmap(e.gl)}else this.pass.outputs=null,this._compositor.getFrameBuffer().unbind(e),this.pass.render(e,t);for(var r in this.inputLinks){var i=this.inputLinks[r];i.node.removeReference(i.pin)}this._rendering=!1,this._rendered=!0,this.trigger("afterrender",e)},updateParameter:function(e,t){var n=this.outputs[e],r=n.parameters,i=n._parametersCopy;if(i||(i=n._parametersCopy={}),r)for(var a in r)"width"!==a&&"height"!==a&&(i[a]=r[a]);var o,s;return o=r.width instanceof Function?r.width.call(this,t):r.width,s=r.height instanceof Function?r.height.call(this,t):r.height,i.width===o&&i.height===s||this._outputTextures[e]&&this._outputTextures[e].dispose(t),i.width=o,i.height=s,i},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){if(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,n){"use strict";var r=n(8),i=n(176),a=n(80),o=n(177),s=n(81),u=n(178),c=n(82),l=n(83),f=n(84),h=n(85),d=n(86),p=n(179),m=n(180),g=n(87),v=n(88);r.a.import(i.a),r.a.import(a.a),r.a.import(o.a),r.a.import(s.a),r.a.import(u.a),r.a.import(c.a),r.a.import(l.a),r.a.import(f.a),r.a.import(h.a),r.a.import(d.a),r.a.import(p.a),r.a.import(m.a),r.a.import(g.a),r.a.import(v.a)},function(e,t,n){"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,n){"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,n){"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,n){"use strict";t.a="@export clay.compositor.dof.coc\nuniform sampler2D depth;\nuniform float zNear: 0.1;\nuniform float zFar: 2000;\nuniform float focalDist: 3;\nuniform float focalRange: 1;\nuniform float focalLength: 30;\nuniform float fstop: 2.8;\nvarying vec2 v_Texcoord;\n@import clay.util.encode_float\nvoid main()\n{\n float z = texture2D(depth, v_Texcoord).r * 2.0 - 1.0;\n float dist = 2.0 * zNear * zFar / (zFar + zNear - z * (zFar - zNear));\n float aperture = focalLength / fstop;\n float coc;\n float uppper = focalDist + focalRange;\n float lower = focalDist - focalRange;\n if (dist <= uppper && dist >= lower) {\n coc = 0.5;\n }\n else {\n float focalAdjusted = dist > uppper ? uppper : lower;\n coc = abs(aperture * (focalLength * (dist - focalAdjusted)) / (dist * (focalAdjusted - focalLength)));\n coc = clamp(coc, 0.0, 0.4) / 0.4000001;\n if (dist < lower) {\n coc = -coc;\n }\n coc = coc * 0.5 + 0.5;\n }\n gl_FragColor = encodeFloat(coc);\n}\n@end\n@export clay.compositor.dof.premultiply\nuniform sampler2D texture;\nuniform sampler2D coc;\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\n@import clay.util.decode_float\nvoid main() {\n float fCoc = max(abs(decodeFloat(texture2D(coc, v_Texcoord)) * 2.0 - 1.0), 0.1);\n gl_FragColor = encodeHDR(\n vec4(decodeHDR(texture2D(texture, v_Texcoord)).rgb * fCoc, 1.0)\n );\n}\n@end\n@export clay.compositor.dof.min_coc\nuniform sampler2D coc;\nvarying vec2 v_Texcoord;\nuniform vec2 textureSize : [512.0, 512.0];\n@import clay.util.float\nvoid main()\n{\n vec4 d = vec4(-1.0, -1.0, 1.0, 1.0) / textureSize.xyxy;\n float fCoc = decodeFloat(texture2D(coc, v_Texcoord + d.xy));\n fCoc = min(fCoc, decodeFloat(texture2D(coc, v_Texcoord + d.zy)));\n fCoc = min(fCoc, decodeFloat(texture2D(coc, v_Texcoord + d.xw)));\n fCoc = min(fCoc, decodeFloat(texture2D(coc, v_Texcoord + d.zw)));\n gl_FragColor = encodeFloat(fCoc);\n}\n@end\n@export clay.compositor.dof.max_coc\nuniform sampler2D coc;\nvarying vec2 v_Texcoord;\nuniform vec2 textureSize : [512.0, 512.0];\n@import clay.util.float\nvoid main()\n{\n vec4 d = vec4(-1.0, -1.0, 1.0, 1.0) / textureSize.xyxy;\n float fCoc = decodeFloat(texture2D(coc, v_Texcoord + d.xy));\n fCoc = max(fCoc, decodeFloat(texture2D(coc, v_Texcoord + d.zy)));\n fCoc = max(fCoc, decodeFloat(texture2D(coc, v_Texcoord + d.xw)));\n fCoc = max(fCoc, decodeFloat(texture2D(coc, v_Texcoord + d.zw)));\n gl_FragColor = encodeFloat(fCoc);\n}\n@end\n@export clay.compositor.dof.coc_upsample\n#define HIGH_QUALITY\nuniform sampler2D coc;\nuniform vec2 textureSize : [512, 512];\nuniform float sampleScale: 0.5;\nvarying vec2 v_Texcoord;\n@import clay.util.float\nvoid main()\n{\n#ifdef HIGH_QUALITY\n vec4 d = vec4(1.0, 1.0, -1.0, 0.0) / textureSize.xyxy * sampleScale;\n float s;\n s = decodeFloat(texture2D(coc, v_Texcoord - d.xy));\n s += decodeFloat(texture2D(coc, v_Texcoord - d.wy)) * 2.0;\n s += decodeFloat(texture2D(coc, v_Texcoord - d.zy));\n s += decodeFloat(texture2D(coc, v_Texcoord + d.zw)) * 2.0;\n s += decodeFloat(texture2D(coc, v_Texcoord )) * 4.0;\n s += decodeFloat(texture2D(coc, v_Texcoord + d.xw)) * 2.0;\n s += decodeFloat(texture2D(coc, v_Texcoord + d.zy));\n s += decodeFloat(texture2D(coc, v_Texcoord + d.wy)) * 2.0;\n s += decodeFloat(texture2D(coc, v_Texcoord + d.xy));\n gl_FragColor = encodeFloat(s / 16.0);\n#else\n vec4 d = vec4(-1.0, -1.0, +1.0, +1.0) / textureSize.xyxy;\n float s;\n s = decodeFloat(texture2D(coc, v_Texcoord + d.xy));\n s += decodeFloat(texture2D(coc, v_Texcoord + d.zy));\n s += decodeFloat(texture2D(coc, v_Texcoord + d.xw));\n s += decodeFloat(texture2D(coc, v_Texcoord + d.zw));\n gl_FragColor = encodeFloat(s / 4.0);\n#endif\n}\n@end\n@export clay.compositor.dof.upsample\n#define HIGH_QUALITY\nuniform sampler2D coc;\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.decode_float\nfloat tap(vec2 uv, inout vec4 color, float baseWeight) {\n float weight = abs(decodeFloat(texture2D(coc, uv)) * 2.0 - 1.0) * baseWeight;\n color += decodeHDR(texture2D(texture, uv)) * weight;\n return weight;\n}\nvoid main()\n{\n#ifdef HIGH_QUALITY\n vec4 d = vec4(1.0, 1.0, -1.0, 0.0) / textureSize.xyxy * sampleScale;\n vec4 color = vec4(0.0);\n float baseWeight = 1.0 / 16.0;\n float w = tap(v_Texcoord - d.xy, color, baseWeight);\n w += tap(v_Texcoord - d.wy, color, baseWeight * 2.0);\n w += tap(v_Texcoord - d.zy, color, baseWeight);\n w += tap(v_Texcoord + d.zw, color, baseWeight * 2.0);\n w += tap(v_Texcoord , color, baseWeight * 4.0);\n w += tap(v_Texcoord + d.xw, color, baseWeight * 2.0);\n w += tap(v_Texcoord + d.zy, color, baseWeight);\n w += tap(v_Texcoord + d.wy, color, baseWeight * 2.0);\n w += tap(v_Texcoord + d.xy, color, baseWeight);\n gl_FragColor = encodeHDR(color / w);\n#else\n vec4 d = vec4(-1.0, -1.0, +1.0, +1.0) / textureSize.xyxy;\n vec4 color = vec4(0.0);\n float baseWeight = 1.0 / 4.0;\n float w = tap(v_Texcoord + d.xy, color, baseWeight);\n w += tap(v_Texcoord + d.zy, color, baseWeight);\n w += tap(v_Texcoord + d.xw, color, baseWeight);\n w += tap(v_Texcoord + d.zw, color, baseWeight);\n gl_FragColor = encodeHDR(color / w);\n#endif\n}\n@end\n@export clay.compositor.dof.downsample\nuniform sampler2D texture;\nuniform sampler2D coc;\nuniform vec2 textureSize : [512, 512];\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\n@import clay.util.decode_float\nfloat tap(vec2 uv, inout vec4 color) {\n float weight = abs(decodeFloat(texture2D(coc, uv)) * 2.0 - 1.0) * 0.25;\n color += decodeHDR(texture2D(texture, uv)) * weight;\n return weight;\n}\nvoid main()\n{\n vec4 d = vec4(-1.0, -1.0, 1.0, 1.0) / textureSize.xyxy;\n vec4 color = vec4(0.0);\n float weight = tap(v_Texcoord + d.xy, color);\n weight += tap(v_Texcoord + d.zy, color);\n weight += tap(v_Texcoord + d.xw, color);\n weight += tap(v_Texcoord + d.zw, color);\n color /= weight;\n gl_FragColor = encodeHDR(color);\n}\n@end\n@export clay.compositor.dof.hexagonal_blur_frag\n@import clay.util.float\nvec4 doBlur(sampler2D targetTexture, vec2 offset) {\n#ifdef BLUR_COC\n float cocSum = 0.0;\n#else\n vec4 color = vec4(0.0);\n#endif\n float weightSum = 0.0;\n float kernelWeight = 1.0 / float(KERNEL_SIZE);\n for (int i = 0; i < KERNEL_SIZE; i++) {\n vec2 coord = v_Texcoord + offset * float(i);\n float w = kernelWeight;\n#ifdef BLUR_COC\n float fCoc = decodeFloat(texture2D(targetTexture, coord)) * 2.0 - 1.0;\n cocSum += clamp(fCoc, -1.0, 0.0) * w;\n#else\n float fCoc = decodeFloat(texture2D(coc, coord)) * 2.0 - 1.0;\n vec4 texel = texture2D(targetTexture, coord);\n #if !defined(BLUR_NEARFIELD)\n w *= abs(fCoc);\n #endif\n color += decodeHDR(texel) * w;\n#endif\n weightSum += w;\n }\n#ifdef BLUR_COC\n return encodeFloat(clamp(cocSum / weightSum, -1.0, 0.0) * 0.5 + 0.5);\n#else\n return color / weightSum;\n#endif\n}\n@end\n@export clay.compositor.dof.hexagonal_blur_1\n#define KERNEL_SIZE 5\nuniform sampler2D texture;\nuniform sampler2D coc;\nvarying vec2 v_Texcoord;\nuniform float blurSize : 1.0;\nuniform vec2 textureSize : [512.0, 512.0];\n@import clay.util.rgbm\n@import clay.compositor.dof.hexagonal_blur_frag\nvoid main()\n{\n vec2 offset = blurSize / textureSize;\n#if !defined(BLUR_NEARFIELD) && !defined(BLUR_COC)\n offset *= abs(decodeFloat(texture2D(coc, v_Texcoord)) * 2.0 - 1.0);\n#endif\n gl_FragColor = doBlur(texture, vec2(0.0, offset.y));\n#if !defined(BLUR_COC)\n gl_FragColor = encodeHDR(gl_FragColor);\n#endif\n}\n@end\n@export clay.compositor.dof.hexagonal_blur_2\n#define KERNEL_SIZE 5\nuniform sampler2D texture;\nuniform sampler2D coc;\nvarying vec2 v_Texcoord;\nuniform float blurSize : 1.0;\nuniform vec2 textureSize : [512.0, 512.0];\n@import clay.util.rgbm\n@import clay.compositor.dof.hexagonal_blur_frag\nvoid main()\n{\n vec2 offset = blurSize / textureSize;\n#if !defined(BLUR_NEARFIELD) && !defined(BLUR_COC)\n offset *= abs(decodeFloat(texture2D(coc, v_Texcoord)) * 2.0 - 1.0);\n#endif\n offset.y /= 2.0;\n gl_FragColor = doBlur(texture, -offset);\n#if !defined(BLUR_COC)\n gl_FragColor = encodeHDR(gl_FragColor);\n#endif\n}\n@end\n@export clay.compositor.dof.hexagonal_blur_3\n#define KERNEL_SIZE 5\nuniform sampler2D texture1;\nuniform sampler2D texture2;\nuniform sampler2D coc;\nvarying vec2 v_Texcoord;\nuniform float blurSize : 1.0;\nuniform vec2 textureSize : [512.0, 512.0];\n@import clay.util.rgbm\n@import clay.compositor.dof.hexagonal_blur_frag\nvoid main()\n{\n vec2 offset = blurSize / textureSize;\n#if !defined(BLUR_NEARFIELD) && !defined(BLUR_COC)\n offset *= abs(decodeFloat(texture2D(coc, v_Texcoord)) * 2.0 - 1.0);\n#endif\n offset.y /= 2.0;\n vec2 vDownRight = vec2(offset.x, -offset.y);\n vec4 texel1 = doBlur(texture1, -offset);\n vec4 texel2 = doBlur(texture1, vDownRight);\n vec4 texel3 = doBlur(texture2, vDownRight);\n#ifdef BLUR_COC\n float coc1 = decodeFloat(texel1) * 2.0 - 1.0;\n float coc2 = decodeFloat(texel2) * 2.0 - 1.0;\n float coc3 = decodeFloat(texel3) * 2.0 - 1.0;\n gl_FragColor = encodeFloat(\n ((coc1 + coc2 + coc3) / 3.0) * 0.5 + 0.5\n );\n#else\n vec4 color = (texel1 + texel2 + texel3) / 3.0;\n gl_FragColor = encodeHDR(color);\n#endif\n}\n@end\n@export clay.compositor.dof.composite\n#define DEBUG 0\nuniform sampler2D original;\nuniform sampler2D blurred;\nuniform sampler2D nearfield;\nuniform sampler2D coc;\nuniform sampler2D nearcoc;\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\n@import clay.util.float\nvoid main()\n{\n vec4 blurredColor = decodeHDR(texture2D(blurred, v_Texcoord));\n vec4 originalColor = decodeHDR(texture2D(original, v_Texcoord));\n float fCoc = decodeFloat(texture2D(coc, v_Texcoord));\n fCoc = abs(fCoc * 2.0 - 1.0);\n float weight = smoothstep(0.0, 1.0, fCoc);\n#ifdef NEARFIELD_ENABLED\n vec4 nearfieldColor = decodeHDR(texture2D(nearfield, v_Texcoord));\n float fNearCoc = decodeFloat(texture2D(nearcoc, v_Texcoord));\n fNearCoc = abs(fNearCoc * 2.0 - 1.0);\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#if DEBUG == 1\n gl_FragColor = vec4(vec3(fCoc), 1.0);\n#elif DEBUG == 2\n gl_FragColor = vec4(vec3(fNearCoc), 1.0);\n#elif DEBUG == 3\n gl_FragColor = encodeHDR(blurredColor);\n#elif DEBUG == 4\n gl_FragColor = encodeHDR(nearfieldColor);\n#endif\n}\n@end"},function(e,t,n){"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,n){"use strict";function r(e){for(var t=new Uint8Array(e*e*4),n=0,r=new u.a,i=0;i 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,n){"use strict";function r(e){e=e||{},this._ssrPass=new s.a({fragment:u.a.source("ecgl.ssr.main"),clearColor:[0,0,0,0]}),this._blurPass1=new s.a({fragment:u.a.source("ecgl.ssr.blur"),clearColor:[0,0,0,0]}),this._blurPass2=new s.a({fragment:u.a.source("ecgl.ssr.blur"),clearColor:[0,0,0,0]}),this._blendPass=new s.a({fragment:u.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 a.a({type:o.a.HALF_FLOAT}),this._texture2=new a.a({type:o.a.HALF_FLOAT}),this._texture3=new a.a({type:o.a.HALF_FLOAT}),this._prevTexture=new a.a({type:o.a.HALF_FLOAT}),this._currentTexture=new a.a({type:o.a.HALF_FLOAT}),this._frameBuffer=new c.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 i=n(7),a=(n(4),n(5)),o=n(6),s=n(14),u=n(8),c=n(10),l=(n(43),n(70)),f=n(184);u.a.import(f.a),r.prototype.setAmbientCubemap=function(e,t){this._ssrPass.material.set("specularCubemap",e),this._ssrPass.material.set("specularIntensity",t);var n=e&&t;this._ssrPass.material[n?"enableTexture":"disableTexture"]("specularCubemap")},r.prototype.update=function(e,t,n,r){var a=e.getWidth(),o=e.getHeight(),s=this._ssrTexture,u=this._texture2,c=this._texture3;s.width=this._prevTexture.width=this._currentTexture.width=a/this._downScale,s.height=this._prevTexture.height=this._currentTexture.height=o/this._downScale,u.width=c.width=a,u.height=c.height=o;var l=this._frameBuffer,f=this._ssrPass,h=this._blurPass1,d=this._blurPass2,p=this._blendPass,m=new i.a,g=new i.a;i.a.transpose(m,t.worldTransform),i.a.transpose(g,t.viewMatrix),f.setUniform("sourceTexture",n),f.setUniform("projection",t.projectionMatrix.array),f.setUniform("projectionInv",t.invProjectionMatrix.array),f.setUniform("toViewSpace",m.array),f.setUniform("toWorldSpace",g.array),f.setUniform("nearZ",t.near);var v=r/this._totalSamples*this._samplePerFrame;if(f.setUniform("jitterOffset",v),f.setUniform("sampleOffset",r*this._samplePerFrame),h.setUniform("textureSize",[s.width,s.height]),d.setUniform("textureSize",[a,o]),d.setUniform("sourceTexture",n),h.setUniform("projection",t.projectionMatrix.array),d.setUniform("projection",t.projectionMatrix.array),l.attach(s),l.bind(e),f.render(e),this._physicallyCorrect&&(l.attach(this._currentTexture),p.setUniform("texture1",this._prevTexture),p.setUniform("texture2",s),p.material.set({weight1:r>=1?.95:0,weight2:r>=1?.05:1}),p.render(e)),l.attach(u),h.setUniform("texture",this._physicallyCorrect?this._currentTexture:s),h.render(e),l.attach(c),d.setUniform("texture",u),d.render(e),l.unbind(e),this._physicallyCorrect){var y=this._prevTexture;this._prevTexture=this._currentTexture,this._currentTexture=y}},r.prototype.getTargetTexture=function(){return this._texture3},r.prototype.setParameter=function(e,t){"maxIteration"===e?this._ssrPass.material.define("fragment","MAX_ITERATION",t):this._ssrPass.setUniform(e,t)},r.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},r.prototype.setSSAOTexture=function(e){var t=this._blurPass2;e?(t.material.enableTexture("ssaoTex"),t.material.set("ssaoTex",e)):t.material.disableTexture("ssaoTex")},r.prototype.isFinished=function(e){return!this._physicallyCorrect||e>this._totalSamples/this._samplePerFrame},r.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=r},function(e,t,n){"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,n){"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,n){"use strict";function r(e,t,n,r,i){var a=e.gl;t.setUniform(a,"1i",n,i),a.activeTexture(a.TEXTURE0+i),r.isRenderable()?r.bind(e):r.unbind(e)}function i(e,t,n,i,a){var o,s,u,c,l=e.gl;return function(a,f,h){if(!c||c.material!==a.material){var d=a.material,p=a.__program,m=d.get("roughness");null==m&&(m=1);var g=d.get("normalMap")||t,v=d.get("roughnessMap"),y=d.get("bumpMap"),_=d.get("uvRepeat"),x=d.get("uvOffset"),b=d.get("detailUvRepeat"),w=d.get("detailUvOffset"),T=!!y&&d.isTextureEnabled("bumpMap"),E=!!v&&d.isTextureEnabled("roughnessMap"),S=d.isDefined("fragment","DOUBLE_SIDED");y=y||n,v=v||i,h!==f?(f.set("normalMap",g),f.set("bumpMap",y),f.set("roughnessMap",v),f.set("useBumpMap",T),f.set("useRoughnessMap",E),f.set("doubleSide",S),null!=_&&f.set("uvRepeat",_),null!=x&&f.set("uvOffset",x),null!=b&&f.set("detailUvRepeat",b),null!=w&&f.set("detailUvOffset",w),f.set("roughness",m)):(p.setUniform(l,"1f","roughness",m),o!==g&&r(e,p,"normalMap",g,0),s!==y&&y&&r(e,p,"bumpMap",y,1),u!==v&&v&&r(e,p,"roughnessMap",v,2),null!=_&&p.setUniform(l,"2f","uvRepeat",_),null!=x&&p.setUniform(l,"2f","uvOffset",x),null!=b&&p.setUniform(l,"2f","detailUvRepeat",b),null!=w&&p.setUniform(l,"2f","detailUvOffset",w),p.setUniform(l,"1i","useBumpMap",+T),p.setUniform(l,"1i","useRoughnessMap",+E),p.setUniform(l,"1i","doubleSide",+S)),o=g,s=y,u=v,c=a}}}function a(e){e=e||{},this._depthTex=new o.a({format:s.a.DEPTH_COMPONENT,type:s.a.UNSIGNED_INT}),this._normalTex=new o.a({type:s.a.HALF_FLOAT}),this._framebuffer=new c.a,this._framebuffer.attach(this._normalTex),this._framebuffer.attach(this._depthTex,c.a.DEPTH_ATTACHMENT),this._normalMaterial=new l.a({shader:new u.a(u.a.source("ecgl.normal.vertex"),u.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 f.a({fragment:u.a.source("clay.compositor.output")}),this._debugPass.setUniform("texture",this._normalTex),this._debugPass.material.undefine("fragment","OUTPUT_ALPHA")}var o=n(5),s=n(6),u=n(8),c=n(10),l=n(17),f=n(14),h=n(54),d=n(187);u.a.import(d.a),a.prototype.getDepthTexture=function(){return this._depthTex},a.prototype.getNormalTexture=function(){return this._normalTex},a.prototype.update=function(e,t,n){var r=e.getWidth(),a=e.getHeight(),o=this._depthTex,s=this._normalTex,u=this._normalMaterial;o.width=r,o.height=a,s.width=r,s.height=a;var c=t.getRenderList(n).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(c,n,{getMaterial:function(){return u},ifRender:function(e){return e.renderNormal},beforeRender:i(e,this._defaultNormalMap,this._defaultBumpMap,this._defaultRoughessMap,this._normalMaterial),sort:e.opaqueSortCompare}),this._framebuffer.unbind(e)},a.prototype.renderDebug=function(e){this._debugPass.render(e)},a.prototype.dispose=function(e){this._depthTex.dispose(e),this._normalTex.dispose(e)},t.a=a},function(e,t,n){"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,n){"use strict";function r(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=(n(7),n(4),n(5)),a=n(6),o=n(14),s=n(8),u=n(10);r.prototype.update=function(e,t,n,r){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",n),this._edgePass.render(e),s.unbind(e)},r.prototype.getTargetTexture=function(){return this._targetTexture},r.prototype.setParameter=function(e,t){this._edgePass.setUniform(e,t)},r.prototype.dispose=function(e){this._targetTexture.dispose(e),this._frameBuffer.dispose(e)},t.a=r},function(e,t,n){"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,n){"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,n){"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,n){"use strict";function r(e){for(var t=[],n=0;n<30;n++)t.push([Object(i.a)(n,2),Object(i.a)(n,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 r=this._blendPass=new a.a({fragment:u.a.source("clay.compositor.blend")});r.material.disableTexturesAll(),r.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=n(43),a=n(14),o=n(10),s=n(5),u=n(8),c=n(7);r.prototype={constructor:r,jitterProjection:function(e,t){var n=e.viewport,r=n.devicePixelRatio||e.getDevicePixelRatio(),i=n.width*r,a=n.height*r,o=this._haltonSequence[this._frame%this._haltonSequence.length],s=new c.a;s.array[12]=(2*o[0]-1)/i,s.array[13]=(2*o[1]-1)/a,c.a.mul(t.projectionMatrix,s,t.projectionMatrix),c.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,n){var r=this._blendPass;0===this._frame?(r.setUniform("weight1",0),r.setUniform("weight2",1)):(r.setUniform("weight1",.9),r.setUniform("weight2",.1)),r.setUniform("texture1",this._prevFrameTex),r.setUniform("texture2",t||this._sourceTex),this._blendFb.attach(this._outputTex),this._blendFb.bind(e),r.render(e),this._blendFb.unbind(e),n||(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=r},function(e,t,n){"use strict";var r=n(0),i=n.n(r);n(194),n(195),n(91);i.a.registerAction({type:"geo3DChangeCamera",event:"geo3dcamerachanged",update:"series:updateCamera"},function(e,t){t.eachComponent({mainType:"geo3D",query:e},function(t){t.setView(e)})})},function(e,t,n){"use strict";var r=n(0),i=n.n(r),a=n(38),o=n(25),s=n(26),u=n(28),c=n(89),l=i.a.extendComponentModel({type:"geo3D",layoutMode:"box",coordinateSystem:null,optionUpdated:function(){var e=this.option;e.regions=this.getFilledRegions(e.regions,e.map);var t=i.a.helper.completeDimensions(["value"],e.data,{encodeDef:this.get("encode"),dimsDef:this.get("dimensions")}),n=new i.a.List(t,this);n.initData(e.regions);var r={};n.each(function(e){var t=n.getName(e),i=n.getItemModel(e);r[t]=i}),this._regionModelMap=r,this._data=n},getData:function(){return this._data},getRegionModel:function(e){var t=this.getData().getName(e);return this._regionModelMap[t]||new i.a.Model(null,this)},getRegionPolygonCoords:function(e){var t=this.getData().getName(e),n=this.coordinateSystem.getRegion(t);return n?n.geometries:[]},getFormattedLabel:function(e,t){var n=this._data.getName(e),r=this.getRegionModel(n),i=r.get("normal"===t?["label","formatter"]:["emphasis","label","formatter"]);null==i&&(i=r.get(["label","formatter"]));var a={name:n};if("function"==typeof i)return a.status=t,i(a);if("string"==typeof i){var o=a.seriesName;return i.replace("{a}",null!=o?o:"")}return n},defaultOption:{regions:[]}});i.a.util.merge(l.prototype,c.a),i.a.util.merge(l.prototype,a.a),i.a.util.merge(l.prototype,o.a),i.a.util.merge(l.prototype,s.a),i.a.util.merge(l.prototype,u.a)},function(e,t,n){"use strict";var r=n(59),i=n(0),a=n.n(i),o=n(2),s=n(39),u=n(27);a.a.extendComponentView({type:"geo3D",__ecgl__:!0,init:function(e,t){this._geo3DBuilder=new r.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,n){this.groupGL.add(this._geo3DBuilder.rootNode);var r=e.coordinateSystem;if(r&&r.viewGL){r.viewGL.add(this._lightRoot),e.get("show")?r.viewGL.add(this.groupGL):r.viewGL.remove(this.groupGL);var i=this._control;i.setViewGL(r.viewGL);var a=e.getModel("viewControl");i.setFromViewControlModel(a,0),this._sceneHelper.setScene(r.viewGL.scene),this._sceneHelper.updateLight(e),r.viewGL.setPostEffect(e.getModel("postEffect"),n),r.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling")),this._geo3DBuilder.update(e,t,n,0,e.getData().count());var o=r.viewGL.isLinearSpace()?"define":"undefine";this._geo3DBuilder.rootNode.traverse(function(e){e.material&&e.material[o]("fragment","SRGB_DECODE")}),i.off("update"),i.on("update",function(){n.dispatchAction({type:"geo3DChangeCamera",alpha:i.getAlpha(),beta:i.getBeta(),distance:i.getDistance(),center:i.getCenter(),from:this.uid,geo3DId:e.id})}),i.update()}},afterRender:function(e,t,n,r){var i=r.renderer;this._sceneHelper.updateAmbientCubemap(i,e,n),this._sceneHelper.updateSkybox(i,e,n)},dispose:function(){this._control.dispose()}})},function(e,t,n){"use strict";function r(e,t,n){n=n||2;var r=t&&t.length,a=r?t[0]*n:e.length,s=i(e,0,a,n,!0),u=[];if(!s)return u;var c,l,h,d,p,m,g;if(r&&(s=f(e,t,s,n)),e.length>80*n){c=h=e[0],l=d=e[1];for(var v=n;vh&&(h=p),m>d&&(d=m);g=Math.max(h-c,d-l)}return o(s,u,n,c,l,g),u}function i(e,t,n,r,i){var a,o;if(i===L(e,t,n,r)>0)for(a=t;a=t;a-=r)o=A(a,e[a],e[a+1],o);return o&&w(o,o.next)&&(O(o),o=o.next),o}function a(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!w(r,r.next)&&0!==b(r.prev,r,r.next))r=r.next;else{if(O(r),(r=t=r.prev)===r.next)return null;n=!0}}while(n||r!==t);return t}function o(e,t,n,r,i,f,h){if(e){!h&&f&&m(e,r,i,f);for(var d,p,g=e;e.prev!==e.next;)if(d=e.prev,p=e.next,f?u(e,r,i,f):s(e))t.push(d.i/n),t.push(e.i/n),t.push(p.i/n),O(e),e=p.next,g=p.next;else if((e=p)===g){h?1===h?(e=c(e,t,n),o(e,t,n,r,i,f,2)):2===h&&l(e,t,n,r,i,f):o(a(e),t,n,r,i,f,1);break}}}function s(e){var t=e.prev,n=e,r=e.next;if(b(t,n,r)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(_(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&b(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function u(e,t,n,r){var i=e.prev,a=e,o=e.next;if(b(i,a,o)>=0)return!1;for(var s=i.xa.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,l=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,f=v(s,u,t,n,r),h=v(c,l,t,n,r),d=e.nextZ;d&&d.z<=h;){if(d!==e.prev&&d!==e.next&&_(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&b(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(d=e.prevZ;d&&d.z>=f;){if(d!==e.prev&&d!==e.next&&_(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&b(d.prev,d,d.next)>=0)return!1;d=d.prevZ}return!0}function c(e,t,n){var r=e;do{var i=r.prev,a=r.next.next;!w(i,a)&&T(i,r,r.next,a)&&S(i,a)&&S(a,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(a.i/n),O(r),O(r.next),r=e=a),r=r.next}while(r!==e);return r}function l(e,t,n,r,i,s){var u=e;do{for(var c=u.next.next;c!==u.prev;){if(u.i!==c.i&&x(u,c)){var l=M(u,c);return u=a(u,u.next),l=a(l,l.next),o(u,t,n,r,i,s),void o(l,t,n,r,i,s)}c=c.next}u=u.next}while(u!==e)}function f(e,t,n,r){var o,s,u,c,l,f=[];for(o=0,s=t.length;o=r.next.y&&r.next.y!==r.y){var s=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>o){if(o=s,s===i){if(a===r.y)return r;if(a===r.next.y)return r.next}n=r.x=r.x&&r.x>=l&&i!==r.x&&_(an.x)&&S(r,e)&&(n=r,h=u),r=r.next;return n}function m(e,t,n,r){var i=e;do{null===i.z&&(i.z=v(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,g(i)}function g(e){var t,n,r,i,a,o,s,u,c=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,r=n,s=0,t=0;t0||u>0&&r;)0!==s&&(0===u||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,u--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;n=r}a.nextZ=null,c*=2}while(o>1);return e}function v(e,t,n,r,i){return e=32767*(e-n)/i,t=32767*(t-r)/i,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function y(e){var t=e,n=e;do{t.x=0&&(e-o)*(r-s)-(n-o)*(t-s)>=0&&(n-o)*(a-s)-(i-o)*(r-s)>=0}function x(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!E(e,t)&&S(e,t)&&S(t,e)&&C(e,t)}function b(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function w(e,t){return e.x===t.x&&e.y===t.y}function T(e,t,n,r){return!!(w(e,t)&&w(n,r)||w(e,r)&&w(n,t))||b(e,t,n)>0!=b(e,t,r)>0&&b(n,r,e)>0!=b(n,r,t)>0}function E(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&T(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function S(e,t){return b(e.prev,e,e.next)<0?b(e,t,e.next)>=0&&b(e,e.prev,t)>=0:b(e,t,e.prev)<0||b(e,e.next,t)<0}function C(e,t){var n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do{n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}function M(e,t){var n=new P(e.i,e.x,e.y),r=new P(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function A(e,t,n,r){var i=new P(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function O(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 P(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function L(e,t,n,r){for(var i=0,a=t,o=n-r;a0},_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}});a.a.util.merge(l.prototype,o.a),a.a.util.merge(l.prototype,s.a),a.a.util.merge(l.prototype,u.a),a.a.util.merge(l.prototype,c.a)},function(e,t,n){"use strict";var r=n(0),i=n.n(r),a=n(2),o=n(39),s=n(27),u=n(202),c=n(3);i.a.extendComponentView({type:"globe",__ecgl__:!0,_displacementScale:0,init:function(e,t){this.groupGL=new a.a.Node,this._sphereGeometry=new a.a.SphereGeometry({widthSegments:200,heightSegments:100,dynamic:!0}),this._overlayGeometry=new a.a.SphereGeometry({widthSegments:80,heightSegments:40}),this._planeGeometry=new a.a.PlaneGeometry,this._earthMesh=new a.a.Mesh({renderNormal:!0}),this._lightRoot=new a.a.Node,this._sceneHelper=new s.a,this._sceneHelper.initLight(this._lightRoot),this.groupGL.add(this._earthMesh),this._control=new o.a({zr:t.getZr()}),this._control.init(),this._layerMeshes={}},render:function(e,t,n){var r=e.coordinateSystem,i=e.get("shading");r.viewGL.add(this._lightRoot),e.get("show")?r.viewGL.add(this.groupGL):r.viewGL.remove(this.groupGL),this._sceneHelper.setScene(r.viewGL.scene),r.viewGL.setPostEffect(e.getModel("postEffect"),n),r.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling"));var o=this._earthMesh;o.geometry=this._sphereGeometry;var s="ecgl."+i;o.material&&o.material.shader.name===s||(o.material=a.a.createMaterial(s)),a.a.setMaterialFromModel(i,o.material,e,n),["roughnessMap","metalnessMap","detailMap","normalMap"].forEach(function(e){var t=o.material.get(e);t&&(t.flipY=!1)}),o.material.set("color",a.a.parseColor(e.get("baseColor")));var u=.99*r.radius;o.scale.set(u,u,u);var c=o.material.setTextureImage("diffuseMap",e.get("baseTexture"),n,{flipY:!1,anisotropic:8});c&&c.surface&&c.surface.attachToMesh(o);var l=o.material.setTextureImage("bumpMap",e.get("heightTexture"),n,{flipY:!1,anisotropic:8});l&&l.surface&&l.surface.attachToMesh(o),o.material[e.get("postEffect.enable")?"define":"undefine"]("fragment","SRGB_DECODE"),this._updateLight(e,n),this._displaceVertices(e,n),this._updateViewControl(e,n),this._updateLayers(e,n)},afterRender:function(e,t,n,r){var i=r.renderer;this._sceneHelper.updateAmbientCubemap(i,e,n),this._sceneHelper.updateSkybox(i,e,n)},_updateLayers:function(e,t){var n=e.coordinateSystem,r=e.get("layers"),o=n.radius,s=[],u=[],l=[],f=[];i.a.util.each(r,function(e){var r=new i.a.Model(e),h=r.get("type"),d=a.a.loadTexture(r.get("texture"),t,{flipY:!1,anisotropic:8});if(d.surface&&d.surface.attachToMesh(this._earthMesh),"blend"===h){var p=r.get("blendTo"),m=c.a.firstNotNull(r.get("intensity"),1);"emission"===p?(l.push(d),f.push(m)):(s.push(d),u.push(m))}else{var g=r.get("id"),v=this._layerMeshes[g];v||(v=this._layerMeshes[g]=new a.a.Mesh({geometry:this._overlayGeometry,castShadow:!1,ignorePicking:!0}));"lambert"===r.get("shading")?(v.material=v.__lambertMaterial||new a.a.Material({autoUpdateTextureStatus:!1,shader:a.a.createShader("ecgl.lambert"),transparent:!0,depthMask:!1}),v.__lambertMaterial=v.material):(v.material=v.__colorMaterial||new a.a.Material({autoUpdateTextureStatus:!1,shader:a.a.createShader("ecgl.color"),transparent:!0,depthMask:!1}),v.__colorMaterial=v.material),v.material.enableTexture("diffuseMap");var y=r.get("distance"),_=o+(null==y?n.radius/100:y);v.scale.set(_,_,_),o=_;var x=this._blankTexture||(this._blankTexture=a.a.createBlankTexture("rgba(255, 255, 255, 0)"));v.material.set("diffuseMap",x),a.a.loadTexture(r.get("texture"),t,{flipY:!1,anisotropic:8},function(e){e.surface&&e.surface.attachToMesh(v),v.material.set("diffuseMap",e),t.getZr().refresh()}),r.get("show")?this.groupGL.add(v):this.groupGL.remove(v)}},this);var h=this._earthMesh.material;h.define("fragment","LAYER_DIFFUSEMAP_COUNT",s.length),h.define("fragment","LAYER_EMISSIVEMAP_COUNT",l.length),h.set("layerDiffuseMap",s),h.set("layerDiffuseIntensity",u),h.set("layerEmissiveMap",l),h.set("layerEmissionIntensity",f);var d=e.getModel("debug.wireframe");if(d.get("show")){h.define("both","WIREFRAME_TRIANGLE");var p=a.a.parseColor(d.get("lineStyle.color")||"rgba(0,0,0,0.5)"),m=c.a.firstNotNull(d.get("lineStyle.width"),1);h.set("wireframeLineWidth",m),h.set("wireframeLineColor",p)}else h.undefine("both","WIREFRAME_TRIANGLE")},_updateViewControl:function(e,t){function n(){return{type:"globeChangeCamera",alpha:o.getAlpha(),beta:o.getBeta(),distance:o.getDistance()-r.radius,center:o.getCenter(),from:a.uid,globeId:e.id}}var r=e.coordinateSystem,i=e.getModel("viewControl"),a=(r.viewGL.camera,this),o=this._control;o.setViewGL(r.viewGL);var s,u,c=i.get("targetCoord");null!=c&&(u=c[0]+90,s=c[1]),o.setFromViewControlModel(i,{baseDistance:r.radius,alpha:s,beta:u}),o.off("update"),o.on("update",function(){t.dispatchAction(n())})},_displaceVertices:function(e,t){var n=e.get("displacementQuality"),r=e.get("debug.wireframe.show"),i=e.coordinateSystem;if(e.isDisplacementChanged()||n!==this._displacementQuality||r!==this._showDebugWireframe){this._displacementQuality=n,this._showDebugWireframe=r;var a=this._sphereGeometry,o={low:100,medium:200,high:400,ultra:800}[n]||200,s=o/2;(a.widthSegments!==o||r)&&(a.widthSegments=o,a.heightSegments=s,a.build()),this._doDisplaceVertices(a,i),r&&a.generateBarycentric()}},_doDisplaceVertices:function(e,t){var n=e.attributes.position.value,r=e.attributes.texcoord0.value,i=e.__originalPosition;i&&i.length===n.length||(i=new Float32Array(n.length),i.set(n),e.__originalPosition=i);for(var a=t.displacementWidth,o=t.displacementHeight,s=t.displacementData,u=0;uOpenStreetMap contributors, © CARTO',center:[0,0],zoom:0,pitch:0,bearing:0,light:{main:{alpha:20,beta:30}},altitudeScale:1,boxHeight:"auto"},getMaptalksCameraOption:function(){var e=this;return s.reduce(function(t,n){return t[n]=e.get(n),t},{})},setMaptalksCameraOption:function(e){null!=e&&s.forEach(function(t){null!=e[t]&&(this.option[t]=e[t])},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,n){"use strict";var r=n(0),i=n.n(r),a=n(216),o=n(27),s=n(2),u=n(95);s.a.Shader.import(u.a);i.a.extendComponentView({type:"maptalks3D",__ecgl__:!0,init:function(e,t){this._groundMesh=new s.a.Mesh({geometry:new s.a.PlaneGeometry,material:new s.a.Material({shader:new s.a.Shader({vertex:s.a.Shader.source("ecgl.displayShadow.vertex"),fragment:s.a.Shader.source("ecgl.displayShadow.fragment")}),depthMask:!1}),renderOrder:-100,culling:!1,castShadow:!1,$ignorePicking:!0,renderNormal:!0})},_initMaptalksLayer:function(e,t){var n=t.getZr();this._zrLayer=new a.a("maptalks3D",n,e.get("center"),e.get("zoom")),n.painter.insertLayer(-1e3,this._zrLayer),this._lightRoot=new s.a.Node,this._sceneHelper=new o.a(this._lightRoot),this._sceneHelper.initLight(this._lightRoot);var r=this._zrLayer.getMaptalks(),i=this._dispatchInteractAction.bind(this,t,r);["zoomend","zooming","zoomstart","dragrotating","pitch","pitchend","movestart","moving","moveend","resize","touchstart","touchmove","touchend"].forEach(function(e){r.on(e,i)})},render:function(e,t,n){this._zrLayer||this._initMaptalksLayer(e,n);var r=this._zrLayer.getMaptalks(),i=e.get("urlTemplate"),a=r.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")}),r.setBaseLayer(a))),this._oldUrlTemplate=i,r.setCenter(e.get("center")),r.setZoom(e.get("zoom"),{animation:!1}),r.setPitch(e.get("pitch")),r.setBearing(e.get("bearing")),e.setMaptalks(r);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"),n),o.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling")),this._maptalks3DModel=e},afterRender:function(e,t,n,r){var i=r.renderer;this._sceneHelper.updateAmbientCubemap(i,e,n),this._sceneHelper.updateSkybox(i,e,n),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,n,r){e.coordinateSystem.setCameraOption(r),this._updateGroundMesh(),n.getZr().refresh()},_dispatchInteractAction:function(e,t,n){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(){if(this._maptalks3DModel){var e=this._maptalks3DModel.coordinateSystem,t=e.dataToPoint(e.center);this._groundMesh.position.set(t[0],t[1],-.001);var n=new s.a.Plane(new s.a.Vector3(0,0,1),0),r=e.viewGL.camera.castRay(new s.a.Vector2(-1,-1)),i=e.viewGL.camera.castRay(new s.a.Vector2(1,1)),a=r.intersectPlane(n),o=i.intersectPlane(n),u=a.dist(o)/e.viewGL.rootNode.scale.x;this._groundMesh.scale.set(u,u,1)}},dispose:function(e,t){this._zrLayer&&this._zrLayer.dispose(),t.getZr().painter.delLayer(-1e3)}})},function(e,t,n){"use strict";function r(e,t,n,r){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:n,zoom:r,fog:!1}),this._initEvents()}r.prototype.resize=function(){this._maptalks.checkSize()},r.prototype.getMaptalks=function(){return this._maptalks},r.prototype.clear=function(){},r.prototype.refresh=function(){this._maptalks.checkSize()};var i=["mousedown","mouseup","click","dblclick","mousemove","mousewheel","DOMMouseScroll","touchstart","touchend","touchmove","touchcancel"];r.prototype._initEvents=function(){var e=this.dom;this._handlers=this._handlers||{contextmenu:function(e){return e.preventDefault(),!1}},i.forEach(function(t){this._handlers[t]=function(n){var r={};for(var i in n)r[i]=n[i];r.bubbles=!1;var a=new n.constructor(n.type,r);"mousewheel"===t||"DOMMouseScroll"===t?e.dispatchEvent(a):e.firstElementChild.dispatchEvent(a)},this.zr.dom.addEventListener(t,this._handlers[t])},this),this.zr.dom.addEventListener("contextmenu",this._handlers.contextmenu)},r.prototype.dispose=function(){i.forEach(function(e){this.zr.dom.removeEventListener(e,this._handlers[e])},this),this._maptalks.remove()},t.a=r},function(e,t,n){"use strict";var r=n(0),i=n.n(r),a=(n(218),n(221),n(223),n(16));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,n){"use strict";function r(e,t){var n=e.getData(),r=e.get("minHeight")||0,i=e.get("barSize"),a=["lng","lat","alt"].map(function(t){return e.coordDimToDataDim(t)[0]});if(null==i){var s=t.radius*Math.PI,l=Object(d.a)(n,a[0],a[1]);i=[s/Math.sqrt(n.count()/l),s/Math.sqrt(n.count()/l)]}else u.a.util.isArray(i)||(i=[i,i]);var f=o(n,a);n.each(a,function(e,a,o,s){var u=n.get(f.dimension,s),c=f.isStacked?u-o:t.altitudeAxis.scale.getExtent()[0],l=Math.max(t.altitudeAxis.dataToCoord(o),r),h=t.dataToPoint([e,a,c]),d=t.dataToPoint([e,a,u]),m=p.sub([],d,h);p.normalize(m,m);var g=[i[0],l,i[1]];n.setItemLayout(s,[h,m,g])}),n.setLayout("orient",c.a.UP.array)}function i(e,t){var n=e.getData(),r=e.get("barSize"),i=e.get("minHeight")||0,a=["lng","lat","alt"].map(function(t){return e.coordDimToDataDim(t)[0]});if(null==r){var s=Math.min(t.size[0],t.size[2]),c=Object(d.a)(n,a[0],a[1]);r=[s/Math.sqrt(n.count()/c),s/Math.sqrt(n.count()/c)]}else u.a.util.isArray(r)||(r=[r,r]);var l=[0,1,0],f=o(n,a);n.each(a,function(e,a,o,s){var u=n.get(f.dimension,s),c=f.isStacked?u-o:t.altitudeAxis.scale.getExtent()[0],h=Math.max(t.altitudeAxis.dataToCoord(o),i),d=t.dataToPoint([e,a,c]),p=[r[0],h,r[1]];n.setItemLayout(s,[d,l,p])}),n.setLayout("orient",[1,0,0])}function a(e,t){var n=e.getData(),r=e.coordDimToDataDim("lng")[0],i=e.coordDimToDataDim("lat")[0],a=e.coordDimToDataDim("alt")[0],s=e.get("barSize"),c=e.get("minHeight")||0;if(null==s){var l=n.getDataExtent(r),f=n.getDataExtent(i),h=t.dataToPoint([l[0],f[0]]),p=t.dataToPoint([l[1],f[1]]),m=Math.min(Math.abs(h[0]-p[0]),Math.abs(h[1]-p[1]))||1,g=Object(d.a)(n,r,i);s=[m/Math.sqrt(n.count()/g),m/Math.sqrt(n.count()/g)]}else u.a.util.isArray(s)||(s=[s,s]),s[0]/=t.getScale()/16,s[1]/=t.getScale()/16;var v=[0,0,1],y=[r,i,a],_=o(n,y);n.each(y,function(e,r,i,a){var o=n.get(_.dimension,a),u=_.isStacked?o-i:0,l=t.dataToPoint([e,r,u]),f=t.dataToPoint([e,r,o]),h=Math.max(f[2]-l[2],c),d=[s[0],h,s[1]];n.setItemLayout(a,[l,v,d])}),n.setLayout("orient",[1,0,0])}function o(e,t){var n=m(e,t[2]);return{dimension:n?e.getCalculationInfo("stackResultDimension"):t[2],isStacked:n}}var s=n(0),u=n.n(s),c=n(4),l=n(1),f=n.n(l),h=n(219),d=n(220),p=f.a.vec3,m=u.a.helper.dataStack.isDimensionStacked;u.a.registerLayout(function(e,t){e.eachSeriesByType("bar3D",function(e){var t=e.coordinateSystem,n=t&&t.type;if("globe"===n)r(e,t);else if("cartesian3D"===n)Object(h.a)(e,t);else if("geo3D"===n)i(e,t);else{if("mapbox3D"!==n&&"maptalks3D"!==n)throw t?new Error("bar3D doesn't support coordinate system "+t.type):new Error("bar3D doesn't have coordinate system.");a(e,t)}})})},function(e,t,n){"use strict";function r(e){var t=e[0],n=e[1];return!(t>0&&n>0||t<0&&n<0)}function i(e,t){var n=e.getData(),i=e.get("barSize");if(null==i){var a,s,u=t.size,f=t.getAxis("x"),h=t.getAxis("y");a="category"===f.type?.7*f.getBandWidth():.6*Math.round(u[0]/Math.sqrt(n.count())),s="category"===h.type?.7*h.getBandWidth():.6*Math.round(u[1]/Math.sqrt(n.count())),i=[a,s]}else o.a.util.isArray(i)||(i=[i,i]);var d=t.getAxis("z").scale.getExtent(),p=r(d),m=["x","y","z"].map(function(t){return e.coordDimToDataDim(t)[0]}),g=l(n,m[2]),v=g?n.getCalculationInfo("stackResultDimension"):m[2];n.each(m,function(e,r,a,o){var s=n.get(v,o),u=g?s-a:p?0:d[0],l=t.dataToPoint([e,r,u]),f=t.dataToPoint([e,r,s]),h=c.dist(l,f),m=[0,f[1]0&&(p++,f[3]<.99&&(m=!0))}}),s.geometry.setBarCount(p);var g=n.getLayout("orient"),v=this._barIndexOfData=new Int32Array(n.count()),p=0;n.each(function(e){if(!n.hasValue(e))return void(v[e]=-1);var t=n.getItemLayout(e),r=t[0],i=t[1],a=t[2],s=4*e;f[0]=h[s++],f[1]=h[s++],f[2]=h[s++],f[3]=h[s++],f[3]>0&&(o._barMesh.geometry.addBar(r,i,g,a,f,e),v[e]=p++)}),s.geometry.dirty(),s.geometry.updateBoundingBox();var y=s.material;y.transparent=m,y.depthMask=!m,s.geometry.sortTriangles=m,this._initHandler(e,t)},_initHandler:function(e,t){var n=e.getData(),r=this._barMesh,i="cartesian3D"===e.coordinateSystem.type;r.seriesIndex=e.seriesIndex;var a=-1;r.off("mousemove"),r.off("mouseout"),r.on("mousemove",function(e){var o=r.geometry.getDataIndexOfVertex(e.triangle[0]);o!==a&&(this._downplay(a),this._highlight(o),this._labelsBuilder.updateLabels([o]),i&&t.dispatchAction({type:"grid3DShowAxisPointer",value:[n.get("x",o),n.get("y",o),n.get("z",o,!0)]})),a=o,r.dataIndex=o},this),r.on("mouseout",function(e){this._downplay(a),this._labelsBuilder.updateLabels(),a=-1,r.dataIndex=-1,i&&t.dispatchAction({type:"grid3DHideAxisPointer"})},this)},_highlight:function(e){var t=this._data;if(t){var n=this._barIndexOfData[e];if(!(n<0)){var r=t.getItemModel(e),o=r.getModel("emphasis.itemStyle"),s=o.get("color"),u=o.get("opacity");if(null==s){var c=t.getItemVisual(e,"color");s=i.a.color.lift(c,-.4)}null==u&&(u=t.getItemVisual(e,"opacity"));var l=a.a.parseColor(s);l[3]*=u,this._barMesh.geometry.setColor(n,l),this._api.getZr().refresh()}}},_downplay:function(e){var t=this._data;if(t){var n=this._barIndexOfData[e];if(!(n<0)){var r=t.getItemVisual(e,"color"),i=t.getItemVisual(e,"opacity"),o=a.a.parseColor(r);o[3]*=i,this._barMesh.geometry.setColor(n,o),this._api.getZr().refresh()}}},highlight:function(e,t,n,r){this._toggleStatus("highlight",e,t,n,r)},downplay:function(e,t,n,r){this._toggleStatus("downplay",e,t,n,r)},_toggleStatus:function(e,t,n,r,a){var u=t.getData(),c=o.a.queryDataIndex(u,a),l=this;null!=c?i.a.util.each(s.a.normalizeToArray(c),function(t){"highlight"===e?this._highlight(t):this._downplay(t)},this):u.each(function(t){"highlight"===e?l._highlight(t):l._downplay(t)})},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll()}})},function(e,t,n){"use strict";var r=n(0),i=n.n(r),a=n(34),o=n(60),s=n(13),u=n(1),c=n.n(u),l=c.a.vec3,f=c.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,n=this.getBarVertexCount()*e,r=this.getBarTriangleCount()*e;this.vertexCount!==n&&(this.attributes.position.init(n),t?this.attributes.normal.init(n):this.attributes.normal.value=null,this.attributes.color.init(n)),this.triangleCount!==r&&(this.indices=n>65535?new Uint32Array(3*r):new Uint16Array(3*r),this._dataIndices=new Uint32Array(n))},getBarVertexCount:function(){var e=this.bevelSize>0?this.bevelSegments:0;return e>0?this._getBevelBarVertexCount(e):this.enableNormal?24:8},getBarTriangleCount:function(){var e=this.bevelSize>0?this.bevelSegments:0;return e>0?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 n=this.getBarVertexCount(),r=n*e,i=n*(e+1),a=r;a0&&this.bevelSegments>0)this._addBevelBar(e,h,g,v,this.bevelSize,this.bevelSegments,y);else{l.copy(i,h),l.normalize(i,i),l.cross(a,g,i),l.normalize(a,a),l.cross(r,i,a),l.normalize(a,a),l.negate(o,r),l.negate(s,i),l.negate(u,a),t(c[0],e,r,v[0]/2),t(c[0],c[0],a,v[2]/2),t(c[1],e,r,v[0]/2),t(c[1],c[1],u,v[2]/2),t(c[2],e,o,v[0]/2),t(c[2],c[2],u,v[2]/2),t(c[3],e,o,v[0]/2),t(c[3],c[3],a,v[2]/2),t(n,e,i,v[1]),t(c[4],n,r,v[0]/2),t(c[4],c[4],a,v[2]/2),t(c[5],n,r,v[0]/2),t(c[5],c[5],u,v[2]/2),t(c[6],n,o,v[0]/2),t(c[6],c[6],u,v[2]/2),t(c[7],n,o,v[0]/2),t(c[7],c[7],a,v[2]/2);var b=this.attributes;if(this.enableNormal){f[0]=r,f[1]=o,f[2]=i,f[3]=s,f[4]=a,f[5]=u;for(var w=this._vertexOffset,T=0;T=0){var b=3*l,w=new c.a(this._points[b],this._points[b+1],this._points[b+2]);a.push({dataIndex:l,point:w,pointWorld:w.clone(),target:this._line3DMesh,distance:this._camera.getWorldPosition().dist(w)})}},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll()}})},function(e,t){function n(e,t,n,r,i,a,o){if(0===i)return!1;var s=i,u=0,c=e;if(o>t+s&&o>r+s||oe+s&&a>n+s||ao?c.position[1]+=(l-o)/2:c.position[0]+=(l-a)/2;var f=c.getBoundingRect();return c.position[0]-=f.x,c.position[1]-=f.y,c.setStyle(n),c.update(),c.__size=l,c}function a(e,t,n){function r(e){return e<128?1:-1}for(var i=t.width,a=t.height,o=e.canvas.width,s=e.canvas.height,u=i/o,c=a/s,l=e.createImageData(o,s),f=0;f=0;f--){var h;h=this.geometry.indices?this.geometry.indices[f]:f;var d=s[2*h],p=s[2*h+1],m=this.geometry.attributes.size.get(h)/this.sizeScale,g=m/2;if(e>d-g*c&&ep-g*l&&t=2e4},doSortVertices:function(e,t){var n=this.indices,r=o.create();if(!n){n=this.indices=this.vertexCount>65535?new Uint32Array(this.vertexCount):new Uint16Array(this.vertexCount);for(var i=0;i.05);else for(var i=0;i<3;i++)this._progressiveQuickSort(3*t+i);this.dirtyIndices()},_simpleSort:function(e){function t(e,t){return n[t]-n[e]}var n=this._zList,i=this.indices;e?Array.prototype.sort.call(i,t):r.a.sort(i,t,0,i.length-1)},_progressiveQuickSort:function(e){var t=this._zList,n=this.indices;this._quickSort=this._quickSort||new r.a,this._quickSort.step(n,function(e,n){return t[n]-t[e]},e)}}},function(e,t,n){"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,n){"use strict";var r=n(0),i=n.n(r),a=(n(236),n(237),n(240),n(16));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,n){"use strict";function r(e,t){p.copy(E,e[0]),p.copy(S,e[1]);var n=[],r=n[0]=_(),i=n[1]=_(),a=n[2]=_(),o=n[3]=_();t.dataToPoint(E,r),t.dataToPoint(S,o),m(x,r),v(b,o,r),m(b,b),g(w,b,x),m(w,w),g(b,x,w),y(i,x,b),m(i,i),m(x,o),v(b,r,o),m(b,b),g(w,b,x),m(w,w),g(b,x,w),y(a,x,b),m(a,a),y(T,r,o),m(T,T);var s=d.dot(r,T),u=d.dot(T,i),c=(Math.max(d.len(r),d.len(o))-s)/u*2;return d.scaleAndAdd(i,r,i,c),d.scaleAndAdd(a,o,a,c),n}function i(e,t,n){var r=[],i=r[0]=d.create(),a=r[1]=d.create(),o=r[2]=d.create(),s=r[3]=d.create();t.dataToPoint(e[0],i),t.dataToPoint(e[1],s);var u=d.dist(i,s);return d.lerp(a,i,s,.3),d.lerp(o,i,s,.3),d.scaleAndAdd(a,a,n,Math.min(.1*u,10)),d.scaleAndAdd(o,o,n,Math.min(.1*u,10)),r}function a(e,t){for(var n=new Float32Array(3*e.length),r=0,i=[],a=0;a0&&i[0]instanceof Array))throw new Error("Invalid coords "+JSON.stringify(i)+". Lines must have 2d coords array in data item.");t.push(i)}),{coordsList:t}}function s(e,t){var n=e.getData(),i=e.get("polyline");n.setLayout("lineType",i?"polyline":"cubicBezier");var s=o(n);n.each(function(e){var o=s.coordsList[e],u=i?a:r;n.setItemLayout(e,u(o,t))})}function u(e,t,n){var r=e.getData(),s=e.get("polyline"),u=o(r);r.setLayout("lineType",s?"polyline":"cubicBezier"),r.each(function(e){var o=u.coordsList[e],c=s?a(o,t):i(o,t,n);r.setItemLayout(e,c)})}var c=n(0),l=n.n(c),f=n(1),h=n.n(f),d=h.a.vec3,p=h.a.vec2,m=d.normalize,g=d.cross,v=d.sub,y=d.add,_=d.create,x=_(),b=_(),w=_(),T=_(),E=[],S=[];l.a.registerLayout(function(e,t){e.eachSeriesByType("lines3D",function(e){var t=e.coordinateSystem;"globe"===t.type?s(e,t):"geo3D"===t.type?u(e,t,[0,1,0]):"mapbox3D"!==t.type&&"maptalks3D"!==t.type||u(e,t,[0,0,1])})})},function(e,t,n){"use strict";function r(e){return null!=e.radius?e.radius:null!=e.size?Math.max(e.size[0],e.size[1],e.size[2]):100}var i=n(0),a=n.n(i),o=n(2),s=n(22),u=n(238),c=n(40);o.a.Shader.import(c.a);a.a.extendChartView({type:"lines3D",__ecgl__:!0,init:function(e,t){this.groupGL=new o.a.Node,this._meshLinesMaterial=new o.a.Material({shader:o.a.createShader("ecgl.meshLines3D"),transparent:!0,depthMask:!1}),this._linesMesh=new o.a.Mesh({geometry:new s.a,material:this._meshLinesMaterial,$ignorePicking:!0}),this._trailMesh=new u.a},render:function(e,t,n){this.groupGL.add(this._linesMesh);var r=e.coordinateSystem,i=e.getData();if(r&&r.viewGL){r.viewGL.add(this.groupGL),this._updateLines(e,t,n);var a=r.viewGL.isLinearSpace()?"define":"undefine";this._linesMesh.material[a]("fragment","SRGB_DECODE"),this._trailMesh.material[a]("fragment","SRGB_DECODE")}var s=this._trailMesh;if(s.stopAnimation(),e.get("effect.show")){this.groupGL.add(s),s.updateData(i,n,this._linesMesh.geometry),s.__time=s.__time||0;this._curveEffectsAnimator=s.animate("",{loop:!0}).when(36e5,{__time:36e5}).during(function(){s.setAnimationTime(s.__time)}).start()}else this.groupGL.remove(s),this._curveEffectsAnimator=null;this._linesMesh.material.blend=this._trailMesh.material.blend="lighter"===e.get("blendMode")?o.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,n){var i=e.getData(),a=e.coordinateSystem,s=this._linesMesh.geometry,u=e.get("polyline");s.expandLine=!0;var c=r(a);s.segmentScale=c/20;var l="lineStyle.width".split("."),f=n.getDevicePixelRatio(),h=0;i.each(function(e){var t=i.getItemModel(e),n=t.get(l);null==n&&(n=1),i.setItemVisual(e,"lineWidth",n),h=Math.max(n,h)}),s.useNativeLine=!1;var d=0,p=0;i.each(function(e){var t=i.getItemLayout(e);u?(d+=s.getPolylineVertexCount(t),p+=s.getPolylineTriangleCount(t)):(d+=s.getCubicCurveVertexCount(t[0],t[1],t[2],t[3]),p+=s.getCubicCurveTriangleCount(t[0],t[1],t[2],t[3]))}),s.setVertexCount(d),s.setTriangleCount(p),s.resetOffset();var m=[];i.each(function(e){var t=i.getItemLayout(e),n=i.getItemVisual(e,"color"),r=i.getItemVisual(e,"opacity"),a=i.getItemVisual(e,"lineWidth")*f;null==r&&(r=1),m=o.a.parseColor(n,m),m[3]*=r,u?s.addPolyline(t,m,a):s.addCubicCurve(t[0],t[1],t[2],t[3],m,a)}),s.dirty()},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll()}})},function(e,t,n){"use strict";function r(e){return e>0?1:-1}var i=n(0),a=(n.n(i),n(2)),o=n(1),s=n.n(o),u=n(22),c=n(239),l=s.a.vec3;a.a.Shader.import(c.a),t.a=a.a.Mesh.extend(function(){var e=new a.a.Material({shader:new a.a.Shader(a.a.Shader.source("ecgl.trail2.vertex"),a.a.Shader.source("ecgl.trail2.fragment")),transparent:!0,depthMask:!1}),t=new u.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(e,t,n){var i=e.hostModel,o=this.geometry,s=i.getModel("effect"),u=s.get("trailWidth")*t.getDevicePixelRatio(),c=s.get("trailLength"),f=i.get("effect.constantSpeed"),h=1e3*i.get("effect.period"),d=null!=f;this.getScene()||console.error("TrailMesh must been add to scene before updateData"),d?this.material.set("speed",f/1e3):this.material.set("period",h),this.material[d?"define":"undefine"]("vertex","CONSTANT_SPEED");var p=i.get("polyline");o.trailLength=c,this.material.set("trailLength",c),o.resetOffset(),["position","positionPrev","positionNext"].forEach(function(e){o.attributes[e].value=n.attributes[e].value}),["dist","distAll","start","offset","color"].forEach(function(e){o.attributes[e].init(o.vertexCount)}),o.indices=n.indices;var m=[],g=s.get("trailColor"),v=s.get("trailOpacity"),y=null!=g,_=null!=v;this.updateWorldTransform();var x=this.worldTransform.x.len(),b=this.worldTransform.y.len(),w=this.worldTransform.z.len(),T=0,E=0;e.each(function(t){var i=e.getItemLayout(t),s=_?v:e.getItemVisual(t,"opacity"),c=e.getItemVisual(t,"color");null==s&&(s=1),m=a.a.parseColor(y?g:c,m),m[3]*=s;for(var f=p?n.getPolylineVertexCount(i):n.getCubicCurveVertexCount(i[0],i[1],i[2],i[3]),S=0,C=[],M=[],A=T;AT&&(S+=l.dist(C,M)),o.attributes.dist.set(A,S),l.copy(M,C);E=Math.max(E,S);for(var O=Math.random()*(d?S:h),A=T;A 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,n){"use strict";var r=n(0),i=n.n(r);i.a.extendSeriesModel({type:"series.lines3D",dependencies:["globe"],visualColorAccessPath:"lineStyle.color",getInitialData:function(e,t){var n=new i.a.List(["value"],this);return n.hasItemOption=!1,n.initData(e.data,[],function(e,t,r,i){if(e instanceof Array)return NaN;n.hasItemOption=!0;var a=e.value;return null!=a?a instanceof Array?a[i]:a:void 0}),n},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,n){"use strict";var r=n(0),i=n.n(r),a=(n(242),n(243),n(16));i.a.registerVisual(Object(a.a)("polygons3D"))},function(e,t,n){"use strict";function r(e,t){for(var n=[],r=0;r0;this._updateSurfaceMesh(this._surfaceMesh,e,f,p);var m=this._surfaceMesh.material;p?(m.define("WIREFRAME_QUAD"),m.set("wireframeLineWidth",d),m.set("wireframeLineColor",o.a.parseColor(h.get("lineStyle.color")))):m.undefine("WIREFRAME_QUAD"),this._initHandler(e,n),this._updateAnimation(e)},_updateAnimation:function(e){o.a.updateVertexAnimation([["prevPosition","position"],["prevNormal","normal"]],this._prevSurfaceMesh,this._surfaceMesh,e)},_createSurfaceMesh:function(){var e=new o.a.Mesh({geometry:new o.a.Geometry({dynamic:!0,sortTriangles:!0}),shadowDepthMaterial:new o.a.Material({shader:new o.a.Shader(o.a.Shader.source("ecgl.sm.depth.vertex"),o.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),a.a.util.extend(e.geometry,c.a),e},_initHandler:function(e,t){function n(e,t){for(var n=1/0,r=-1,a=[],o=0;o=0){var u=[];i.geometry.attributes.position.get(s,u);for(var c=a.pointToData(u),f=1/0,h=-1,d=[],p=0;p65535?Uint32Array:Uint16Array)((v-1)*(y-1)*6),S=function(e,t,n){n[1]=e*y+t,n[0]=e*y+t+1,n[3]=(e+1)*y+t+1,n[2]=(e+1)*y+t},C=!1;if(f){var M=[],A=[],O=0;x?d.init(a.vertexCount):d.value=null;for(var P=[[],[],[]],L=[],N=[],D=l.create(),R=function(e,t,n){var r=3*t;return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n},I=new Float32Array(u.length),k=new Float32Array(u.length/3*4),F=0;F ")),a.value&&(l+=" : "+i.a.format.encodeHTML(a.value)),l}return s.superApply(this,"formatTooltip",arguments)},_updateCategoriesData:function(){var e=(this.option.categories||[]).map(function(e){return null!=e.value?e:i.a.util.extend({value:0},e)}),t=new i.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 "+g)),d++)}var v,y=i.a.helper.completeDimensions(["value"],e);v=new i.a.List(y,n),v.initData(e);var _=new i.a.List(["value"],n);return _.initData(h,f),a&&a(v,_),u()({mainData:v,struct:s,structAttr:"graph",datas:{node:v,edge:_},datasAttr:{node:"data",edge:"edgeData"}}),s.update(),s}},function(e,t,n){function r(e){return"_EC_"+e}function i(e,t){this.id=null==e?"":e,this.inEdges=[],this.outEdges=[],this.edges=[],this.hostGraph,this.dataIndex=null==t?-1:t}function a(e,t,n){this.node1=e,this.node2=t,this.dataIndex=null==n?-1:n}var o=n(97),s=(o.__DEV__,n(12)),u=n(258),c=u.enableClassCheck,l=function(e){this._directed=e||!1,this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this.data,this.edgeData},f=l.prototype;f.type="graph",f.isDirected=function(){return this._directed},f.addNode=function(e,t){e=e||""+t;var n=this._nodesMap;if(!n[r(e)]){var a=new i(e,t);return a.hostGraph=this,this.nodes.push(a),n[r(e)]=a,a}},f.getNodeByIndex=function(e){var t=this.data.getRawIndex(e);return this.nodes[t]},f.getNodeById=function(e){return this._nodesMap[r(e)]},f.addEdge=function(e,t,n){var o=this._nodesMap,s=this._edgesMap;if("number"==typeof e&&(e=this.nodes[e]),"number"==typeof t&&(t=this.nodes[t]),i.isInstance(e)||(e=o[r(e)]),i.isInstance(t)||(t=o[r(t)]),e&&t){var u=e.id+"-"+t.id;if(!s[u]){var c=new a(e,t,n);return c.hostGraph=this,this._directed&&(e.outEdges.push(c),t.inEdges.push(c)),e.edges.push(c),e!==t&&t.edges.push(c),this.edges.push(c),s[u]=c,c}}},f.getEdgeByIndex=function(e){var t=this.edgeData.getRawIndex(e);return this.edges[t]},f.getEdge=function(e,t){i.isInstance(e)&&(e=e.id),i.isInstance(t)&&(t=t.id);var n=this._edgesMap;return this._directed?n[e+"-"+t]:n[e+"-"+t]||n[t+"-"+e]},f.eachNode=function(e,t){for(var n=this.nodes,r=n.length,i=0;i=0&&e.call(t,n[i],i)},f.eachEdge=function(e,t){for(var n=this.edges,r=n.length,i=0;i=0&&n[i].node1.dataIndex>=0&&n[i].node2.dataIndex>=0&&e.call(t,n[i],i)},f.breadthFirstTraverse=function(e,t,n,a){if(i.isInstance(t)||(t=this._nodesMap[r(t)]),t){for(var o="out"===n?"outEdges":"in"===n?"inEdges":"edges",s=0;s=0&&n.node2.dataIndex>=0});for(var i=0,a=r.length;i=0&&this[e][t].setItemVisual(this.dataIndex,n,r)},getVisual:function(n,r){return this[e][t].getItemVisual(this.dataIndex,n,r)},setLayout:function(n,r){this.dataIndex>=0&&this[e][t].setItemLayout(this.dataIndex,n,r)},getLayout:function(){return this[e][t].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[e][t].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[e][t].getRawIndex(this.dataIndex)}}};s.mixin(i,h("hostGraph","data")),s.mixin(a,h("hostGraph","edgeData")),l.Node=i,l.Edge=a,c(i),c(a);var d=l;e.exports=d},function(e,t,n){function r(e){var t={main:"",sub:""};return e&&(e=e.split(d),t.main=e[0]||"",t.sub=e[1]||""),t}function i(e){h.assert(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(e),'componentType "'+e+'" illegal')}function a(e,t){e.$constructor=e,e.extend=function(e){var t=this,n=function(){e.$constructor?e.$constructor.apply(this,arguments):t.apply(this,arguments)};return h.extend(n.prototype,e),n.extend=this.extend,n.superCall=s,n.superApply=u,h.inherits(n,this),n.superClass=t,n}}function o(e){var t=["__\0is_clz",m++,Math.random().toFixed(3)].join("_");e.prototype[t]=!0,e.isInstance=function(e){return!(!e||!e[t])}}function s(e,t){var n=h.slice(arguments,2);return this.superClass.prototype[t].apply(e,n)}function u(e,t,n){return this.superClass.prototype[t].apply(e,n)}function c(e,t){function n(e){var t=a[e.main];return t&&t[p]||(t=a[e.main]={},t[p]=!0),t}t=t||{};var a={};if(e.registerClass=function(e,t){if(t)if(i(t),t=r(t),t.sub){if(t.sub!==p){var o=n(t);o[t.sub]=e}}else a[t.main]=e;return e},e.getClass=function(e,t,n){var r=a[e];if(r&&r[p]&&(r=t?r[t]:null),n&&!r)throw new Error(t?"Component "+e+"."+(t||"")+" not exists. Load it first.":e+".type should be specified.");return r},e.getClassesByMainType=function(e){e=r(e);var t=[],n=a[e.main];return n&&n[p]?h.each(n,function(e,n){n!==p&&t.push(e)}):t.push(n),t},e.hasClass=function(e){return e=r(e),!!a[e.main]},e.getAllClassMainTypes=function(){var e=[];return h.each(a,function(t,n){e.push(n)}),e},e.hasSubTypes=function(e){e=r(e);var t=a[e.main];return t&&t[p]},e.parseClassType=r,t.registerWhenExtend){var o=e.extend;o&&(e.extend=function(t){var n=o.call(this,t);return e.registerClass(n,t.type)})}return e}function l(e,t){}var f=n(97),h=(f.__DEV__,n(12)),d=".",p="___EC__COMPONENT__CONTAINER___",m=0;t.parseClassType=r,t.enableClassExtend=a,t.enableClassCheck=o,t.enableClassManagement=c,t.setReadOnly=l},function(e,t,n){function r(e){var t=e.mainData,n=e.datas;n||(n={main:t},e.datasAttr={main:"data"}),e.datas=e.mainData=null,c(t,n,e),h(n,function(n){h(t.TRANSFERABLE_METHODS,function(t){n.wrapMethod(t,f.curry(i,e))})}),t.wrapMethod("cloneShallow",f.curry(o,e)),h(t.CHANGABLE_METHODS,function(n){t.wrapMethod(n,f.curry(a,e))}),f.assert(n[t.dataType]===t)}function i(e,t){if(u(this)){var n=f.extend({},this[d]);n[this.dataType]=t,c(t,n,e)}else l(t,this.dataType,this[p],e);return t}function a(e,t){return e.struct&&e.struct.update(this),t}function o(e,t){return h(t[d],function(n,r){n!==t&&l(n.cloneShallow(),r,t,e)}),t}function s(e){var t=this[p];return null==e||null==t?t:t[d][e]}function u(e){return e[p]===e}function c(e,t,n){e[d]={},h(t,function(t,r){l(t,r,e,n)})}function l(e,t,n,r){n[d][t]=e,e[p]=n,e.dataType=t,r.struct&&(e[r.structAttr]=r.struct,r.struct[r.datasAttr[t]]=e),e.getLinkedData=s}var f=n(12),h=f.each,d="\0__link_datas",p="\0__link_mainData",m=r;e.exports=m},function(e,t,n){"use strict";var r=n(0),i=n.n(r),a=n(41),o=n.n(a),s=n(2),u=n(19),c=n(98),l=n(3),f=n(261),h=n(263),d=n(72),p=n.n(d),m=n(1),g=n.n(m),v=n(265),y=n(62),_=n(266),x=g.a.vec2;s.a.Shader.import(_.a);var b=1;i.a.extendChartView({type:"graphGL",__ecgl__:!0,init:function(e,t){this.groupGL=new s.a.Node,this.viewGL=new u.a("orthographic"),this.viewGL.camera.left=this.viewGL.camera.right=0,this.viewGL.add(this.groupGL),this._pointsBuilder=new y.a(!0,t),this._forceEdgesMesh=new s.a.Mesh({material:new s.a.Material({shader:s.a.createShader("ecgl.forceAtlas2.edges"),transparent:!0,depthMask:!1,depthTest:!1}),$ignorePicking:!0,geometry:new s.a.Geometry({attributes:{node:new s.a.Geometry.Attribute("node","float",2),color:new s.a.Geometry.Attribute("color","float",4,"COLOR")},dynamic:!0,mainAttribute:"node"}),renderOrder:-1,mode:s.a.Mesh.LINES}),this._edgesMesh=new s.a.Mesh({material:new s.a.Material({shader:s.a.createShader("ecgl.meshLines2D"),transparent:!0,depthMask:!1,depthTest:!1}),$ignorePicking:!0,geometry:new c.a({useNativeLine:!1,dynamic:!0}),renderOrder:-1,culling:!1}),this._layoutId=0,this._control=new v.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,n){this.groupGL.add(this._pointsBuilder.rootNode),this._model=e,this._api=n,this._initLayout(e,t,n),this._pointsBuilder.update(e,t,n),this._forceLayoutInstance instanceof f.a||this.groupGL.remove(this._forceEdgesMesh),this._updateCamera(e,n),this._control.off("update"),this._control.on("update",function(){n.dispatchAction({type:"graphGLRoam",seriesId:e.id,zoom:this._control.getZoom(),offset:this._control.getOffset()}),this._pointsBuilder.updateView(this.viewGL.camera)},this),this._control.setZoom(l.a.firstNotNull(e.get("zoom"),1)),this._control.setOffset(e.get("offset")||[0,0]);var r=this._pointsBuilder.getPointsMesh();if(r.off("mousemove",this._mousemoveHandler),r.off("mouseout",this._mouseOutHandler,this),n.getZr().off("click",this._clickHandler),this._pointsBuilder.highlightOnMouseover=!0,e.get("focusNodeAdjacency")){var i=e.get("focusNodeAdjacencyOn");"click"===i?n.getZr().on("click",this._clickHandler):"mouseover"===i?(r.on("mousemove",this._mousemoveHandler,this),r.on("mouseout",this._mouseOutHandler,this),this._pointsBuilder.highlightOnMouseover=!1):console.warn("Unkown focusNodeAdjacencyOn value s"+i)}this._lastMouseOverDataIndex=-1},_clickHandler:function(e){if(!this._layouting){var t=this._pointsBuilder.getPointsMesh().dataIndex;t>=0?this._api.dispatchAction({type:"graphGLFocusNodeAdjacency",seriesId:this._model.id,dataIndex:t}):this._api.dispatchAction({type:"graphGLUnfocusNodeAdjacency",seriesId:this._model.id})}},_mousemoveHandler:function(e){if(!this._layouting){var t=this._pointsBuilder.getPointsMesh().dataIndex;t>=0?t!==this._lastMouseOverDataIndex&&this._api.dispatchAction({type:"graphGLFocusNodeAdjacency",seriesId:this._model.id,dataIndex:t}):this._mouseOutHandler(e),this._lastMouseOverDataIndex=t}},_mouseOutHandler:function(e){this._layouting||(this._api.dispatchAction({type:"graphGLUnfocusNodeAdjacency",seriesId:this._model.id}),this._lastMouseOverDataIndex=-1)},_updateForceEdgesGeometry:function(e,t){var n=this._forceEdgesMesh.geometry,r=t.getEdgeData(),i=0,a=this._forceLayoutInstance,o=2*r.count();n.attributes.node.init(o),n.attributes.color.init(o),r.each(function(t){var o=e[t];n.attributes.node.set(i,a.getNodeUV(o.node1)),n.attributes.node.set(i+1,a.getNodeUV(o.node2));var u=r.getItemVisual(o.dataIndex,"color"),c=s.a.parseColor(u);c[3]*=l.a.firstNotNull(r.getItemVisual(o.dataIndex,"opacity"),1),n.attributes.color.set(i,c),n.attributes.color.set(i+1,c),i+=2}),n.dirty()},_updateMeshLinesGeometry:function(){var e=this._model.getEdgeData(),t=this._edgesMesh.geometry,e=this._model.getEdgeData(),n=this._model.getData().getLayout("points");t.resetOffset(),t.setVertexCount(e.count()*t.getLineVertexCount()),t.setTriangleCount(e.count()*t.getLineTriangleCount());var r=[],i=[],a=["lineStyle","width"];this._originalEdgeColors=new Float32Array(4*e.count()),this._edgeIndicesMap=new Float32Array(e.count()),e.each(function(o){var u=e.graph.getEdgeByIndex(o),c=2*u.node1.dataIndex,f=2*u.node2.dataIndex;r[0]=n[c],r[1]=n[c+1],i[0]=n[f],i[1]=n[f+1];var h=e.getItemVisual(u.dataIndex,"color"),d=s.a.parseColor(h);d[3]*=l.a.firstNotNull(e.getItemVisual(u.dataIndex,"opacity"),1);var p=e.getItemModel(u.dataIndex),m=l.a.firstNotNull(p.get(a),1)*this._api.getDevicePixelRatio();t.addLine(r,i,d,m);for(var g=0;g<4;g++)this._originalEdgeColors[4*u.dataIndex+g]=d[g];this._edgeIndicesMap[u.dataIndex]=o},this),t.dirty()},_updateForceNodesGeometry:function(e){for(var t=this._pointsBuilder.getPointsMesh(),n=[],r=0;r=d&&(u._syncNodePosition(e),h=0),n.getZr().refresh(),p()(function(){m(t)})})};p()(function(){u._forceLayoutInstanceToDispose&&(u._forceLayoutInstanceToDispose.dispose(i.layer.renderer),u._forceLayoutInstanceToDispose=null),m(c)}),this._layouting=!0}}},stopLayout:function(e,t,n,r){r&&null!=r.from&&r.from!==this.uid||(this._layoutId=0,this.groupGL.remove(this._forceEdgesMesh),this.groupGL.add(this._edgesMesh),this._forceLayoutInstance&&this.viewGL.layer&&(r&&r.beforeLayout||(this._syncNodePosition(e),this._updateAfterLayout(e,t,n)),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,n){this._updateMeshLinesGeometry(),this._pointsBuilder.removePositionTexture(),this._pointsBuilder.updateLayout(e,t,n),this._pointsBuilder.updateView(this.viewGL.camera),this._pointsBuilder.updateLabels(),this._pointsBuilder.showLabels()},focusNodeAdjacency:function(e,t,n,r){var i=this._model.getData();this._downplayAll();var a=r.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 c=[];u.edges.forEach(function(e){e.dataIndex>=0&&(this._highlightEdge(e.dataIndex),c.push(e))},this),this._focusNodes=s,this._focusEdges=c},unfocusNodeAdjacency:function(e,t,n,r){this._downplayAll(),this._pointsBuilder.fadeInAll(),this._fadeInEdgesAll(),this._pointsBuilder.updateLabels()},_highlightEdge:function(e){var t=this._model.getEdgeData().getItemModel(e),n=s.a.parseColor(t.get("emphasis.lineStyle.color")||t.get("lineStyle.color")),r=l.a.firstNotNull(t.get("emphasis.lineStyle.opacity"),t.get("lineStyle.opacity"),1);n[3]*=r,this._edgesMesh.geometry.setItemColor(this._edgeIndicesMap[e],n)},_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:function(){var e=[];return function(t,n){this._getColor(t,e),e[3]*=n,this._edgesMesh.geometry.setItemColor(this._edgeIndicesMap[t],e)}}(),_getColor:function(e,t){for(var n=0;n<4;n++)t[n]=this._originalEdgeColors[4*e+n];return t},_fadeOutEdgesAll:function(e){this._model.getData().graph.eachEdge(function(t){this._setEdgeFade(t.dataIndex,e)},this)},_fadeInEdgesAll:function(){this._fadeOutEdgesAll(1)},_updateCamera:function(e,t){this.viewGL.setViewport(0,0,t.getWidth(),t.getHeight(),t.getDevicePixelRatio());for(var n=this.viewGL.camera,r=e.getData(),i=r.getLayout("points"),a=x.create(1/0,1/0),o=x.create(-1/0,-1/0),s=[],u=0;un.left&&ln.top)){var f=Math.max(o[0]-a[0],10),h=f/t.getWidth()*t.getHeight();f*=1.4,h*=1.4,a[0]-=.2*f,n.left=a[0],n.top=c-h/2,n.bottom=c+h/2,n.right=f+a[0],n.near=0,n.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,n){"use strict";function r(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")});var n=function(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:n,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:n,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=n(0),a=n.n(i),o=n(2),s=n(14),u=n(10),c=n(262);o.a.Shader.import(c.a);var l={repulsionByDegree:!0,linLogMode:!1,strongGravityMode:!1,gravity:1,scaling:1,edgeWeightInfluence:1,jitterTolerence:.1,preventOverlap:!1,dissuadeHubs:!1,gravityCenter:null};r.prototype.updateOption=function(e){for(var t in l)this[t]=l[t];var n=this._nodes.length;if(this.jitterTolerence=n>5e4?10:n>5e3?1:.1,this.scaling=n>100?2:10,e)for(var t in l)null!=e[t]&&(this[t]=e[t]);if(this.repulsionByDegree)for(var r=this._positionSourceTex.pixels,i=0;ie},r.prototype._swapTexture=function(){var e=this._positionPrevTex;this._positionPrevTex=this._positionTex,this._positionTex=e;var e=this._forcePrevTex;this._forcePrevTex=this._forceTex,this._forceTex=e;var e=this._globalSpeedPrevTex;this._globalSpeedPrevTex=this._globalSpeedTex,this._globalSpeedTex=e},r.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)},r.prototype._resize=function(e,t){["_positionSourceTex","_positionTex","_positionPrevTex","_forceTex","_forcePrevTex"].forEach(function(n){this[n].width=e,this[n].height=t,this[n].dirty()},this)},r.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=r,t.a=r},function(e,t,n){"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,n){"use strict";var r=n(5),i=n(6),a=n(264),o=a.a.toString();o=o.slice(o.indexOf("{")+1,o.lastIndexOf("}"));var s={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},u=function(e){for(var t in s)this[t]=s[t];if(e)for(var t in e)this[t]=e[t];this._nodes=[],this._edges=[],this._disposed=!1,this._positionTex=new r.a({type:i.a.FLOAT,flipY:!1,minFilter:i.a.NEAREST,magFilter:i.a.NEAREST})};u.prototype.initData=function(e,t){var n=new Blob([o]),r=window.URL.createObjectURL(n);this._worker=new Worker(r),this._worker.onmessage=this._$onupdate.bind(this),this._nodes=e,this._edges=t,this._frame=0;for(var i=e.length,a=t.length,s=new Float32Array(2*i),u=new Float32Array(i),c=new Float32Array(i),l=new Float32Array(2*a),f=new Float32Array(a),h=0;h5e4?10:a>5e3?1:.1,t.scaling=a>100?2:10,t.barnesHutOptimize=a>1e3,e)for(var n in s)null!=e[n]&&(t[n]=e[n]);if(!t.gravityCenter){for(var o=[1/0,1/0],u=[-1/0,-1/0],c=0;ce},u.prototype.getNodePosition=function(e,t){if(t||(t=new Float32Array(2*this._nodes.length)),this._positionArr)for(var n=0;n0&&(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,n){return e[0]=t,e[1]=n,e}},a=e.prototype;a.beforeUpdate=function(){for(var e=0;e=e&&this.bbox[1]<=t&&this.bbox[3]>=t},a.setBBox=function(e,t,n,r){this.bbox[0]=e,this.bbox[1]=t,this.bbox[2]=n,this.bbox[3]=r,this.size=(n-e+r-t)/2},a._newSubRegion=function(){var t=this.subRegions[this.nSubRegions];return t||(t=new e,this.subRegions[this.nSubRegions]=t),this.nSubRegions++,t},a._addNodeToSubRegion=function(e){var t=this.findSubRegion(e.position[0],e.position[1]),n=this.bbox;if(!t){var r=(n[0]+n[2])/2,i=(n[1]+n[3])/2,a=(n[2]-n[0])/2,o=(n[3]-n[1])/2,s=e.position[0]>=r?1:0,u=e.position[1]>=i?1:0,t=this._newSubRegion();t.setBBox(s*a+n[0],u*o+n[1],(s+1)*a+n[0],(u+1)*o+n[1])}t.addNode(e)},a._updateCenterOfMass=function(e){null==this.centerOfMass&&(this.centerOfMass=new Float32Array(2));var t=this.centerOfMass[0]*this.mass,n=this.centerOfMass[1]*this.mass;t+=e.position[0]*e.mass,n+=e.position[1]*e.mass,this.mass+=e.mass,this.centerOfMass[0]=t/this.mass,this.centerOfMass[1]=n/this.mass};var o=r.prototype;o.initNodes=function(e,n,r){var i=n.length;this.nodes.length=0;for(var a=void 0!==r,o=0;o0&&(this.strongGravityMode?this.applyNodeStrongGravity(r):this.applyNodeGravity(r))}for(var t=0;t0&&(f=Math.min(f/this._globalSpeed,1.5)*this._globalSpeed),this._globalSpeed=f;for(var t=0;t0&&(h=Math.min(d*h,10)/d,i.scaleAndAdd(n.position,n.position,n.force,h))}},o.applyRegionToNodeRepulsion=function(){var e=i.create();return function(t,n){if(t.node)this.applyNodeToNodeRepulsion(t.node,n,!0);else{i.sub(e,n.position,t.centerOfMass);var r=e[0]*e[0]+e[1]*e[1];if(r>this.barnesHutTheta*t.size*t.size){var a=this.scaling*n.mass*t.mass/r;i.scaleAndAdd(n.force,n.force,e,a)}else for(var o=0;o0)o=this.scaling*t.mass*n.mass/(s*s);else{if(!(s<0))return;o=100*this.scaling*t.mass*n.mass}}else o=this.scaling*t.mass*n.mass/a;i.scaleAndAdd(t.force,t.force,e,o),i.scaleAndAdd(n.force,n.force,e,-o)}}}}(),o.applyEdgeAttraction=function(){var e=i.create();return function(t){var n=t.source,r=t.target;i.sub(e,n.position,r.position);var a,o=i.len(e);a=0===this.edgeWeightInfluence?1:1===this.edgeWeightInfluence?t.weight:Math.pow(t.weight,this.edgeWeightInfluence);var s;this.preventOverlap&&(o=o-n.size-r.size)<=0||(s=this.linLogMode?-a*Math.log(o+1)/(o+1):-a,i.scaleAndAdd(n.force,n.force,e,s),i.scaleAndAdd(r.force,r.force,e,-s))}}(),o.applyNodeGravity=function(){var e=i.create();return function(t){i.sub(e,this.gravityCenter,t.position);var n=i.len(e);i.scaleAndAdd(t.force,t.force,e,this.gravity*t.mass/(n+1))}}(),o.applyNodeStrongGravity=function(){var e=i.create();return function(t){i.sub(e,this.gravityCenter,t.position),i.scaleAndAdd(t.force,t.force,e,this.gravity*t.mass)}}(),o.updateBBox=function(){for(var e=1/0,t=1/0,n=-1/0,r=-1/0,i=0;i0?1.1:.9,a=Math.max(Math.min(this._zoom*i,this.maxZoom),this.minZoom);i=a/this._zoom;var o=this._convertPos(n,r),s=(o.x-this._dx)*(i-1),u=(o.y-this._dy)*(i-1);this._dx-=s,this._dy-=u,this._zoom=a,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,n){"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,n){"use strict";var r=n(0);n.n(r),n(268),n(272)},function(e,t,n){"use strict";var r=n(0),i=n.n(r),a=n(2),o=n(3),s=n(19),u=n(269);i.a.extendChartView({type:"flowGL",__ecgl__:!0,init:function(e,t){this.viewGL=new s.a("orthographic"),this.groupGL=new a.a.Node,this.viewGL.add(this.groupGL),this._particleSurface=new u.a;var n=new a.a.Mesh({geometry:new a.a.PlaneGeometry,material:new a.a.Material({shader:new a.a.Shader({vertex:a.a.Shader.source("ecgl.color.vertex"),fragment:a.a.Shader.source("ecgl.color.fragment")}),transparent:!0})});n.material.enableTexture("diffuseMap"),this.groupGL.add(n),this._planeMesh=n},render:function(e,t,n){var r=this._particleSurface;r.setParticleType(e.get("particleType")),r.setSupersampling(e.get("supersampling")),this._updateData(e,n),this._updateCamera(n.getWidth(),n.getHeight(),n.getDevicePixelRatio());var i=o.a.firstNotNull(e.get("particleDensity"),128);r.setParticleDensity(i,i);var s=this._planeMesh,u=+new Date,c=this,l=!0;s.__percent=0,s.stopAnimation(),s.animate("",{loop:!0}).when(1e5,{__percent:1}).during(function(){var e=+new Date,t=Math.min(e-u,20);u+=t,c._renderer&&(r.update(c._renderer,n,t/1e3,l),s.material.set("diffuseMap",r.getSurfaceTexture())),l=!1}).start();var f=e.getModel("itemStyle"),h=a.a.parseColor(f.get("color"));h[3]*=o.a.firstNotNull(f.get("opacity"),1),s.material.set("color",h),r.setColorTextureImage(e.get("colorTexture"),n),r.setParticleSize(e.get("particleSize")),r.particleSpeedScaling=e.get("particleSpeed"),r.motionBlurFactor=1-Math.pow(.1,e.get("particleTrail"))},updateTransform:function(e,t,n){this._updateData(e,n)},afterRender:function(e,t,n,r){var i=r.renderer;this._renderer=i},_updateData:function(e,t){var n=e.coordinateSystem,r=n.dimensions.map(function(t){return e.coordDimToDataDim(t)[0]}),i=e.getData(),a=i.getDataExtent(r[0]),o=i.getDataExtent(r[1]),s=e.get("gridWidth"),u=e.get("gridHeight");if(null==s||"auto"===s){var c=(a[1]-a[0])/(o[1]-o[0]);s=Math.round(Math.sqrt(c*i.count()))}null!=u&&"auto"!==u||(u=Math.ceil(i.count()/s));var l=this._particleSurface.vectorFieldTexture,f=l.pixels;if(f&&f.length===u*s*4)for(var h=0;h=359&&(i[0]>0&&(i[0]=0),a[0]0?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 c.a),this._spriteTexture.image&&this._spriteTexture.image.width===e||(this._spriteTexture.image=r(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 n=this._downsampleTextures,r=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;s65535?new Uint32Array(3*r):new Uint16Array(3*r))},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,n){"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,n){"use strict";var r=n(0),i=n.n(r);i.a.extendSeriesModel({type:"series.flowGL",dependencies:["geo","grid","bmap"],visualColorAccessPath:"itemStyle.color",getInitialData:function(e,t){var n=i.a.getCoordinateSystemDimensions(this.get("coordinateSystem"))||["x","y"];if(n.length>2)throw new Error("flowGL can only be used on 2d coordinate systems.");n.push("vx","vy");var r=i.a.helper.completeDimensions(n,this.getSource(),{encodeDef:this.get("encode"),dimsDef:this.get("dimensions")}),a=new i.a.List(r,this);return a.initData(this.getSource()),a},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,n){"use strict";var r=n(0),i=n.n(r),a=(n(274),n(275),n(16));i.a.registerVisual(Object(a.a)("linesGL"))},function(e,t,n){"use strict";var r=n(0),i=n.n(r),a=n(12),o=(n.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),n=t.option instanceof Array?t.option:t.getShallow("coords");if(!(n instanceof Array&&n.length>0&&n[0]instanceof Array))throw new Error("Invalid coords "+JSON.stringify(n)+". Lines must have 2d coords array in data item.");return n},getLineCoordsCount:function(e){return this._flatCoordsOffset?this._flatCoordsOffset[2*e+1]:this._getCoordsFromItemModel(e).length},getLineCoords:function(e,t){if(this._flatCoordsOffset){for(var n=this._flatCoordsOffset[2*e],r=this._flatCoordsOffset[2*e+1],i=0;in)throw new Error("Invalid data format.")}}return{flatCoordsOffset:new Uint32Array(r.buffer,0,o),flatCoords:i,count:s}}return{flatCoordsOffset:null,flatCoords:null,count:e.length}},getInitialData:function(e,t){var n=new i.a.List(["value"],this);return n.hasItemOption=!1,n.initData(e.data,[],function(e,t,r,i){if(e instanceof Array)return NaN;n.hasItemOption=!0;var a=e.value;return null!=a?a instanceof Array?a[i]:a:void 0}),n},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,n){"use strict";var r=n(0),i=n.n(r),a=n(2),o=n(19),s=n(98),u=n(96),c=n(3);i.a.extendChartView({type:"linesGL",__ecgl__:!0,init:function(e,t){this.groupGL=new a.a.Node,this.viewGL=new o.a("orthographic"),this.viewGL.add(this.groupGL),this._glViewHelper=new u.a(this.viewGL),this._nativeLinesShader=a.a.createShader("ecgl.lines3D"),this._meshLinesShader=a.a.createShader("ecgl.meshLines3D"),this._linesMeshes=[],this._currentStep=0},render:function(e,t,n){this.groupGL.removeAll(),this._glViewHelper.reset(e,n);var r=this._linesMeshes[0];r||(r=this._linesMeshes[0]=this._createLinesMesh(e)),this._linesMeshes.length=1,this.groupGL.add(r),this._updateLinesMesh(e,r,0,e.getData().count()),this.viewGL.setPostEffect(e.getModel("postEffect"),n)},incrementalPrepareRender:function(e,t,n){this.groupGL.removeAll(),this._glViewHelper.reset(e,n),this._currentStep=0,this.viewGL.setPostEffect(e.getModel("postEffect"),n)},incrementalRender:function(e,t,n,r){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),r.getZr().refresh(),this._currentStep++},updateTransform:function(e,t,n){e.coordinateSystem.getRoamTransform&&this._glViewHelper.updateTransform(e,n)},_createLinesMesh:function(e){return new a.a.Mesh({$ignorePicking:!0,material:new a.a.Material({shader:a.a.createShader("ecgl.lines3D"),transparent:!0,depthMask:!1,depthTest:!1}),geometry:new s.a({segmentScale:10,useNativeLine:!0,dynamic:!1}),mode:a.a.Mesh.LINES,culling:!1})},_updateLinesMesh:function(e,t,n,r){function i(){g[0]=m[0]*b+y[0]*x-(m[1]-y[1])*s,g[1]=m[1]*b+y[1]*x-(y[0]-m[0])*s,v[0]=m[0]*x+y[0]*b-(m[1]-y[1])*s,v[1]=m[1]*x+y[1]*b-(y[0]-m[0])*s}var o=e.getData();t.material.blend="lighter"===e.get("blendMode")?a.a.additiveBlend:null;var s=e.get("lineStyle.curveness")||0,u=e.get("polyline"),l=t.geometry,f=e.coordinateSystem,h=c.a.firstNotNull(e.get("lineStyle.width"),1);h>1?(t.material.shader!==this._meshLinesShader&&t.material.attachShader(this._meshLinesShader),t.mode=a.a.Mesh.TRIANGLES):(t.material.shader!==this._nativeLinesShader&&t.material.attachShader(this._nativeLinesShader),t.mode=a.a.Mesh.LINES),n=n||0,r=r||o.count(),l.resetOffset();var d=0,p=0,m=[],g=[],v=[],y=[],_=[],x=.3,b=.7;if(u||0!==s)for(var w=n;w{c} {b}"},toolbox:{show:!0,feature:{mark:{show:!0},restore:{show:!0},saveAsImage:{show:!0}}},series:[{name:"速度",type:"gauge",min:0,max:220,splitNumber:11,radius:"50%",axisLine:{lineStyle:{color:[[.09,"lime"],[.82,"#1e90ff"],[1,"#ff4500"]],width:3,shadowColor:"#fff",shadowBlur:10}},axisLabel:{textStyle:{fontWeight:"bolder",color:"#fff",shadowColor:"#fff",shadowBlur:10}},axisTick:{length:15,lineStyle:{color:"auto",shadowColor:"#fff",shadowBlur:10}},splitLine:{length:25,lineStyle:{width:3,color:"#fff",shadowColor:"#fff",shadowBlur:10}},pointer:{shadowColor:"#fff",shadowBlur:5},title:{textStyle:{fontWeight:"bolder",fontSize:20,fontStyle:"italic",color:"#fff",shadowColor:"#fff",shadowBlur:10}},detail:{backgroundColor:"rgba(30,144,255,0.8)",borderWidth:1,borderColor:"#fff",shadowColor:"#fff",shadowBlur:5,offsetCenter:[0,"50%"],textStyle:{fontWeight:"bolder",color:"#fff"}},data:[{value:40,name:"km/h"}]},{name:"转速",type:"gauge",center:["25%","55%"],radius:"30%",min:0,max:7,endAngle:45,splitNumber:7,axisLine:{lineStyle:{color:[[.29,"lime"],[.86,"#1e90ff"],[1,"#ff4500"]],width:2,shadowColor:"#fff",shadowBlur:10}},axisLabel:{textStyle:{fontWeight:"bolder",color:"#fff",shadowColor:"#fff",shadowBlur:10}},axisTick:{length:12,lineStyle:{color:"auto",shadowColor:"#fff",shadowBlur:10}},splitLine:{length:20,lineStyle:{width:3,color:"#fff",shadowColor:"#fff",shadowBlur:10}},pointer:{width:5,shadowColor:"#fff",shadowBlur:5},title:{offsetCenter:[0,"-30%"],textStyle:{fontWeight:"bolder",fontStyle:"italic",color:"#fff",shadowColor:"#fff",shadowBlur:10}},detail:{borderColor:"#fff",shadowColor:"#fff",shadowBlur:5,width:80,height:30,offsetCenter:[25,"20%"],textStyle:{fontWeight:"bolder",color:"#fff"}},data:[{value:1.5,name:"x1000 r/min"}]},{name:"油表",type:"gauge",center:["75%","50%"],radius:"30%",min:0,max:2,startAngle:135,endAngle:45,splitNumber:2,axisLine:{lineStyle:{color:[[.2,"lime"],[.8,"#1e90ff"],[1,"#ff4500"]],width:2,shadowColor:"#fff",shadowBlur:10}},axisTick:{length:12,lineStyle:{color:"auto",shadowColor:"#fff",shadowBlur:10}},axisLabel:{textStyle:{fontWeight:"bolder",color:"#fff",shadowColor:"#fff",shadowBlur:10},formatter:function(e){switch(e+""){case"0":return"E";case"1":return"Gas";case"2":return"F"}}},splitLine:{length:15,lineStyle:{width:3,color:"#fff",shadowColor:"#fff",shadowBlur:10}},pointer:{width:2,shadowColor:"#fff",shadowBlur:5},title:{show:!1},detail:{show:!1},data:[{value:.5,name:"gas"}]},{name:"水表",type:"gauge",center:["75%","50%"],radius:"30%",min:0,max:2,startAngle:315,endAngle:225,splitNumber:2,axisLine:{lineStyle:{color:[[.2,"lime"],[.8,"#1e90ff"],[1,"#ff4500"]],width:2,shadowColor:"#fff",shadowBlur:10}},axisTick:{show:!1},axisLabel:{textStyle:{fontWeight:"bolder",color:"#fff",shadowColor:"#fff",shadowBlur:10},formatter:function(e){switch(e+""){case"0":return"H";case"1":return"Water";case"2":return"C"}}},splitLine:{length:15,lineStyle:{width:3,color:"#fff",shadowColor:"#fff",shadowBlur:10}},pointer:{width:2,shadowColor:"#fff",shadowBlur:5},title:{show:!1},detail:{show:!1},data:[{value:.5,name:"gas"}]}]}},n.timeTicket=null,n.getInitialState=function(){return{option:n.getOption()}},n.state=n.getInitialState(),n}return o(t,e),s(t,[{key:"componentDidMount",value:function(){var e=this;this.timeTicket&&clearInterval(this.timeTicket),this.timeTicket=setInterval(function(){var t=(0,f.default)(e.state.option);t.series[0].data[0].value=(100*Math.random()).toFixed(2)-0,t.series[1].data[0].value=(7*Math.random()).toFixed(2)-0,t.series[2].data[0].value=(2*Math.random()).toFixed(2)-0,t.series[3].data[0].value=(2*Math.random()).toFixed(2)-0,e.setState({option:t})},1e3)}},{key:"componentWillUnmount",value:function(){this.timeTicket&&clearInterval(this.timeTicket)}},{key:"render",value:function(){return c.default.createElement("div",{className:"examples"},c.default.createElement("div",{className:"parent"},c.default.createElement("label",null," render a car gauge chart. "),c.default.createElement(d.default,{option:this.state.option,style:{height:"500px",width:"100%"},className:"react_for_echarts"})))}}]),t}(u.Component);t.default=p},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s=function(){function e(e,t){for(var n=0;n'+n.encodeHTML(i.join("/"))+"","Disk Usage: "+n.addCommas(t)+" KB"].join("")}},series:[{name:"Disk Usage",type:"treemap",visibleMin:300,label:{show:!0,formatter:"{b}"},itemStyle:{normal:{borderColor:"#fff"}},levels:e(),data:t}]}},o=n,a(r,o)}return o(t,e),s(t,[{key:"render",value:function(){return c.default.createElement("div",{className:"examples"},c.default.createElement("div",{className:"parent"},c.default.createElement("label",null," render a disk usage treemap. "),c.default.createElement(f.default,{option:this.getOption(),style:{height:"500px",width:"100%"},className:"react_for_echarts"})))}}]),t}(u.PureComponent);t.default=p},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s=function(){function e(e,t){for(var n=0;n"))))}}]),t}(u.PureComponent);t.default=h},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s=function(){function e(e,t){for(var n=0;n"))))}}]),t}(u.PureComponent);t.default=h}]);
\ No newline at end of file
+function r(e,t){if(!a.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,r=n in document;if(!r){var o=document.createElement("div");o.setAttribute(n,"return;"),r="function"==typeof o[n]}return!r&&i&&"wheel"===e&&(r=document.implementation.hasFeature("Events.wheel","3.0")),r}var i,a=n(20);a.canUseDOM&&(i=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")),e.exports=r},function(e,t,n){"use strict";function r(e){var t=this,n=t.nativeEvent;if(n.getModifierState)return n.getModifierState(e);var r=a[e];return!!r&&!!n[r]}function i(e){return r}var a={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};e.exports=i},function(e,t,n){"use strict";function r(e,t){return Array.isArray(t)&&(t=t[1]),t?t.nextSibling:e.firstChild}function i(e,t,n){l.insertTreeBefore(e,t,n)}function a(e,t,n){Array.isArray(t)?s(e,t[0],t[1],n):m(e,t,n)}function o(e,t){if(Array.isArray(t)){var n=t[1];t=t[0],u(e,t,n),e.removeChild(n)}e.removeChild(t)}function s(e,t,n,r){for(var i=t;;){var a=i.nextSibling;if(m(e,i,r),i===n)break;i=a}}function u(e,t,n){for(;;){var r=t.nextSibling;if(r===n)break;e.removeChild(r)}}function c(e,t,n){var r=e.parentNode,i=e.nextSibling;i===t?n&&m(r,document.createTextNode(n),i):n?(p(i,n),u(r,i,t)):u(r,e,t)}var l=n(69),f=n(300),h=(n(11),n(30),n(121)),d=n(89),p=n(183),m=h(function(e,t,n){e.insertBefore(t,n)}),g=f.dangerouslyReplaceNodeWithMarkup,v={dangerouslyReplaceNodeWithMarkup:g,replaceDelimitedText:c,processUpdates:function(e,t){for(var n=0;n0&&r.length<20?n+" (keys: "+r.join(", ")+")":n}function a(e,t){var n=s.get(e);if(!n){return null}return n}var o=n(8),s=(n(42),n(81)),u=(n(30),n(34)),c=(n(2),n(7),{isMounted:function(e){var t=s.get(e);return!!t&&!!t._renderedComponent},enqueueCallback:function(e,t,n){c.validateCallback(t,n);var i=a(e);if(!i)return null;i._pendingCallbacks?i._pendingCallbacks.push(t):i._pendingCallbacks=[t],r(i)},enqueueCallbackInternal:function(e,t){e._pendingCallbacks?e._pendingCallbacks.push(t):e._pendingCallbacks=[t],r(e)},enqueueForceUpdate:function(e){var t=a(e,"forceUpdate");t&&(t._pendingForceUpdate=!0,r(t))},enqueueReplaceState:function(e,t,n){var i=a(e,"replaceState");i&&(i._pendingStateQueue=[t],i._pendingReplaceState=!0,void 0!==n&&null!==n&&(c.validateCallback(n,"replaceState"),i._pendingCallbacks?i._pendingCallbacks.push(n):i._pendingCallbacks=[n]),r(i))},enqueueSetState:function(e,t){var n=a(e,"setState");if(n){(n._pendingStateQueue||(n._pendingStateQueue=[])).push(t),r(n)}},enqueueElementInternal:function(e,t,n){e._pendingElement=t,e._context=n,r(e)},validateCallback:function(e,t){e&&"function"!=typeof e&&o("122",t,i(e))}});e.exports=c},function(e,t,n){"use strict";var r=(n(10),n(25)),i=(n(7),r);e.exports=i},function(e,t,n){"use strict";function r(e){var t,n=e.keyCode;return"charCode"in e?0===(t=e.charCode)&&13===n&&(t=13):t=n,t>=32||13===t?t:0}e.exports=r},function(e,t,n){"use strict";function r(e){if(!Object(o.a)(e)||Object(i.a)(e)!=s)return!1;var t=Object(a.a)(e);if(null===t)return!0;var n=f.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&l.call(n)==h}var i=n(362),a=n(367),o=n(369),s="[object Object]",u=Function.prototype,c=Object.prototype,l=u.toString,f=c.hasOwnProperty,h=l.call(Object);t.a=r},function(e,t,n){"use strict";function r(e){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e);try{throw new Error(e)}catch(e){}}t.a=r},function(e,t,n){"use strict";function r(e){return a.q.channel(e)?"channel":Array.isArray(e)?String(e.map(function(e){return String(e)})):String(e)}function i(e,t){function n(t,n){if(u===s)return o;if(n)throw u=s,n;i&&i(t);var r=e[u](),a=r[0],c=r[1],l=r[2];return u=a,i=l,u===s?o:c}var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"iterator",i=void 0,u=t;return Object(a.t)(n,function(e){return n(null,e)},r,!0)}n.d(t,"b",function(){return s}),t.c=r,t.a=i;var a=n(26),o={done:!0,value:void 0},s={}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="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};t.get=function(e,t){var n="string"==typeof t?t.replace(/(\[\d+\])/g,function(e){return"."+e.slice(1,-1)}).split("."):t,r=e,i=!0,a=!1,o=void 0;try{for(var s,u=n[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var c=s.value;if(void 0===r)break;r=r[c]}}catch(e){a=!0,o=e}finally{try{!i&&u.return&&u.return()}finally{if(a)throw o}}return r},t.size=function(e){return e?Array.isArray(e)?e.length:"object"===(void 0===e?"undefined":r(e))?Object.keys(e).length:0:0},t.mapValue=function(e,t){var n={};return Object.keys(e).forEach(function(r){n[r]=t(e[r],r)}),n},t.mapKey=function(e,t){var n={},r=Object.keys(e),i=!0,a=!1,o=void 0;try{for(var s,u=r[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var c=s.value;n[t(c,e[c])]=e[c]}}catch(e){a=!0,o=e}finally{try{!i&&u.return&&u.return()}finally{if(a)throw o}}return n}},function(e,t,n){var r=n(6),i=n(4).document,a=r(i)&&r(i.createElement);e.exports=function(e){return a?i.createElement(e):{}}},function(e,t,n){var r=n(4),i=n(35),a=n(54),o=n(219),s=n(13).f;e.exports=function(e){var t=i.Symbol||(i.Symbol=a?{}:r.Symbol||{});"_"==e.charAt(0)||e in t||s(t,e,{value:o.f(e)})}},function(e,t,n){var r=n(95)("keys"),i=n(53);e.exports=function(e){return r[e]||(r[e]=i(e))}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var r=n(4).document;e.exports=r&&r.documentElement},function(e,t,n){var r=n(6),i=n(3),a=function(e,t){if(i(e),!r(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,r){try{r=n(31)(Function.call,n(28).f(Object.prototype,"__proto__").set,2),r(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,n){return a(e,n),t?e.__proto__=n:r(e,n),e}}({},!1):void 0),check:a}},function(e,t){e.exports="\t\n\v\f\r \u2028\u2029\ufeff"},function(e,t,n){var r=n(6),i=n(139).set;e.exports=function(e,t,n){var a,o=t.constructor;return o!==n&&"function"==typeof o&&(a=o.prototype)!==n.prototype&&r(a)&&i&&i(e,a),e}},function(e,t,n){"use strict";var r=n(38),i=n(37);e.exports=function(e){var t=String(i(this)),n="",a=r(e);if(a<0||a==1/0)throw RangeError("Count can't be negative");for(;a>0;(a>>>=1)&&(t+=t))1&a&&(n+=t);return n}},function(e,t){e.exports=Math.sign||function(e){return 0==(e=+e)||e!=e?e:e<0?-1:1}},function(e,t){var n=Math.expm1;e.exports=!n||n(10)>22025.465794806718||n(10)<22025.465794806718||-2e-17!=n(-2e-17)?function(e){return 0==(e=+e)?e:e>-1e-6&&e<1e-6?e+e*e/2:Math.exp(e)-1}:n},function(e,t,n){var r=n(38),i=n(37);e.exports=function(e){return function(t,n){var a,o,s=String(i(t)),u=r(n),c=s.length;return u<0||u>=c?e?"":void 0:(a=s.charCodeAt(u),a<55296||a>56319||u+1===c||(o=s.charCodeAt(u+1))<56320||o>57343?e?s.charAt(u):a:e?s.slice(u,u+2):o-56320+(a-55296<<10)+65536)}}},function(e,t,n){"use strict";var r=n(54),i=n(0),a=n(23),o=n(22),s=n(21),u=n(73),c=n(147),l=n(71),f=n(29),h=n(9)("iterator"),d=!([].keys&&"next"in[].keys()),p=function(){return this};e.exports=function(e,t,n,m,g,v,y){c(n,t,m);var _,x,b,w=function(e){if(!d&&e in C)return C[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},T=t+" Iterator",E="values"==g,S=!1,C=e.prototype,M=C[h]||C["@@iterator"]||g&&C[g],A=!d&&M||w(g),O=g?E?w("entries"):A:void 0,P="Array"==t?C.entries||M:M;if(P&&(b=f(P.call(new e)))!==Object.prototype&&b.next&&(l(b,T,!0),r||s(b,h)||o(b,h,p)),E&&M&&"values"!==M.name&&(S=!0,A=function(){return M.call(this)}),r&&!y||!d&&!S&&C[h]||o(C,h,A),u[t]=A,u[T]=p,g)if(_={values:E?A:w("values"),keys:v?A:w("keys"),entries:O},y)for(x in _)x in C||a(C,x,_[x]);else i(i.P+i.F*(d||S),t,_);return _}},function(e,t,n){"use strict";var r=n(57),i=n(52),a=n(71),o={};n(22)(o,n(9)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(o,{next:i(1,n)}),a(e,t+" Iterator")}},function(e,t,n){var r=n(99),i=n(37);e.exports=function(e,t,n){if(r(t))throw TypeError("String#"+n+" doesn't accept regex!");return String(i(e))}},function(e,t,n){var r=n(9)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[r]=!1,!"/./"[e](t)}catch(e){}}return!0}},function(e,t,n){var r=n(73),i=n(9)("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||a[i]===e)}},function(e,t,n){"use strict";var r=n(13),i=n(52);e.exports=function(e,t,n){t in e?r.f(e,t,i(0,n)):e[t]=n}},function(e,t,n){var r=n(85),i=n(9)("iterator"),a=n(73);e.exports=n(35).getIteratorMethod=function(e){if(void 0!=e)return e[i]||e["@@iterator"]||a[r(e)]}},function(e,t,n){var r=n(491);e.exports=function(e,t){return new(r(e))(t)}},function(e,t,n){"use strict";var r=n(15),i=n(56),a=n(14);e.exports=function(e){for(var t=r(this),n=a(t.length),o=arguments.length,s=i(o>1?arguments[1]:void 0,n),u=o>2?arguments[2]:void 0,c=void 0===u?n:i(u,n);c>s;)t[s++]=e;return t}},function(e,t,n){"use strict";var r=n(47),i=n(235),a=n(73),o=n(27);e.exports=n(146)(Array,"Array",function(e,t){this._t=o(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,i(1)):"keys"==t?i(0,n):"values"==t?i(0,e[n]):i(0,[n,e[n]])},"values"),a.Arguments=a.Array,r("keys"),r("values"),r("entries")},function(e,t,n){var r,i,a,o=n(31),s=n(225),u=n(138),c=n(134),l=n(4),f=l.process,h=l.setImmediate,d=l.clearImmediate,p=l.MessageChannel,m=l.Dispatch,g=0,v={},y=function(){var e=+this;if(v.hasOwnProperty(e)){var t=v[e];delete v[e],t()}},_=function(e){y.call(e.data)};h&&d||(h=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return v[++g]=function(){s("function"==typeof e?e:Function(e),t)},r(g),g},d=function(e){delete v[e]},"process"==n(32)(f)?r=function(e){f.nextTick(o(y,e,1))}:m&&m.now?r=function(e){m.now(o(y,e,1))}:p?(i=new p,a=i.port2,i.port1.onmessage=_,r=o(a.postMessage,a,1)):l.addEventListener&&"function"==typeof postMessage&&!l.importScripts?(r=function(e){l.postMessage(e+"","*")},l.addEventListener("message",_,!1)):r="onreadystatechange"in c("script")?function(e){u.appendChild(c("script")).onreadystatechange=function(){u.removeChild(this),y.call(e)}}:function(e){setTimeout(o(y,e,1),0)}),e.exports={set:h,clear:d}},function(e,t,n){var r=n(4),i=n(156).set,a=r.MutationObserver||r.WebKitMutationObserver,o=r.process,s=r.Promise,u="process"==n(32)(o);e.exports=function(){var e,t,n,c=function(){var r,i;for(u&&(r=o.domain)&&r.exit();e;){i=e.fn,e=e.next;try{i()}catch(r){throw e?n():t=void 0,r}}t=void 0,r&&r.enter()};if(u)n=function(){o.nextTick(c)};else if(!a||r.navigator&&r.navigator.standalone)if(s&&s.resolve){var l=s.resolve();n=function(){l.then(c)}}else n=function(){i.call(r,c)};else{var f=!0,h=document.createTextNode("");new a(c).observe(h,{characterData:!0}),n=function(){h.data=f=!f}}return function(r){var i={fn:r,next:void 0};t&&(t.next=i),e||(e=i,n()),t=i}}},function(e,t,n){"use strict";function r(e){var t,n;this.promise=new e(function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r}),this.resolve=i(t),this.reject=i(n)}var i=n(19);e.exports.f=function(e){return new r(e)}},function(e,t,n){"use strict";function r(e,t,n){var r,i,a,o=new Array(n),s=8*n-t-1,u=(1<>1,l=23===t?B(2,-24)-B(2,-77):0,f=0,h=e<0||0===e&&1/e<0?1:0;for(e=F(e),e!=e||e===I?(i=e!=e?1:0,r=u):(r=U(j(e)/G),e*(a=B(2,-r))<1&&(r--,a*=2),e+=r+c>=1?l/a:l*B(2,1-c),e*a>=2&&(r++,a/=2),r+c>=u?(i=0,r=u):r+c>=1?(i=(e*a-1)*B(2,t),r+=c):(i=e*B(2,c-1)*B(2,t),r=0));t>=8;o[f++]=255&i,i/=256,t-=8);for(r=r<0;o[f++]=255&r,r/=256,s-=8);return o[--f]|=128*h,o}function i(e,t,n){var r,i=8*n-t-1,a=(1<>1,s=i-7,u=n-1,c=e[u--],l=127&c;for(c>>=7;s>0;l=256*l+e[u],u--,s-=8);for(r=l&(1<<-s)-1,l>>=-s,s+=t;s>0;r=256*r+e[u],u--,s-=8);if(0===l)l=1-o;else{if(l===a)return r?NaN:c?-I:I;r+=B(2,t),l-=o}return(c?-1:1)*r*B(2,l-t)}function a(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]}function o(e){return[255&e]}function s(e){return[255&e,e>>8&255]}function u(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]}function c(e){return r(e,52,8)}function l(e){return r(e,23,4)}function f(e,t,n){C(e[O],t,{get:function(){return this[n]}})}function h(e,t,n,r){var i=+n,a=E(i);if(a+t>e[V])throw R(P);var o=e[z]._b,s=a+e[H],u=o.slice(s,s+t);return r?u:u.reverse()}function d(e,t,n,r,i,a){var o=+n,s=E(o);if(s+t>e[V])throw R(P);for(var u=e[z]._b,c=s+e[H],l=r(+i),f=0;fY;)(W=X[Y++])in N||y(N,W,k[W]);g||(q.constructor=N)}var Z=new L(new N(2)),K=L[O].setInt8;Z.setInt8(0,2147483648),Z.setInt8(1,2147483649),!Z.getInt8(0)&&Z.getInt8(1)||_(L[O],{setInt8:function(e,t){K.call(this,e,t<<24>>24)},setUint8:function(e,t){K.call(this,e,t<<24>>24)}},!0)}else N=function(e){b(this,N,"ArrayBuffer");var t=E(e);this._b=M.call(new Array(t),0),this[V]=t},L=function(e,t,n){b(this,L,"DataView"),b(e,N,"DataView");var r=e[V],i=w(t);if(i<0||i>r)throw R("Wrong offset!");if(n=void 0===n?r-i:T(n),i+n>r)throw R("Wrong length!");this[z]=e,this[H]=i,this[V]=n},m&&(f(N,"byteLength","_l"),f(L,"buffer","_b"),f(L,"byteLength","_l"),f(L,"byteOffset","_o")),_(L[O],{getInt8:function(e){return h(this,1,e)[0]<<24>>24},getUint8:function(e){return h(this,1,e)[0]},getInt16:function(e){var t=h(this,2,e,arguments[1]);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=h(this,2,e,arguments[1]);return t[1]<<8|t[0]},getInt32:function(e){return a(h(this,4,e,arguments[1]))},getUint32:function(e){return a(h(this,4,e,arguments[1]))>>>0},getFloat32:function(e){return i(h(this,4,e,arguments[1]),23,4)},getFloat64:function(e){return i(h(this,8,e,arguments[1]),52,8)},setInt8:function(e,t){d(this,1,e,o,t)},setUint8:function(e,t){d(this,1,e,o,t)},setInt16:function(e,t){d(this,2,e,s,t,arguments[2])},setUint16:function(e,t){d(this,2,e,s,t,arguments[2])},setInt32:function(e,t){d(this,4,e,u,t,arguments[2])},setUint32:function(e,t){d(this,4,e,u,t,arguments[2])},setFloat32:function(e,t){d(this,4,e,l,t,arguments[2])},setFloat64:function(e,t){d(this,8,e,c,t,arguments[2])}});A(N,"ArrayBuffer"),A(L,"DataView"),y(L[O],v.VIEW,!0),t.ArrayBuffer=N,t.DataView=L},function(e,t,n){var r=n(4),i=r.navigator;e.exports=i&&i.userAgent||""},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.router=t.routes=t.route=t.components=t.component=t.location=t.history=t.falsy=t.locationShape=t.routerShape=void 0;var i=n(1),a=n(109),o=(r(a),n(63)),s=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(o),u=n(17),c=(r(u),i.PropTypes.func),l=i.PropTypes.object,f=i.PropTypes.shape,h=i.PropTypes.string,d=t.routerShape=f({push:c.isRequired,replace:c.isRequired,go:c.isRequired,goBack:c.isRequired,goForward:c.isRequired,setRouteLeaveHook:c.isRequired,isActive:c.isRequired}),p=t.locationShape=f({pathname:h.isRequired,search:h.isRequired,state:l,action:h.isRequired,key:h}),m=t.falsy=s.falsy,g=t.history=s.history,v=t.location=p,y=t.component=s.component,_=t.components=s.components,x=t.route=s.route,b=(t.routes=s.routes,t.router=d),w={falsy:m,history:g,location:v,component:y,components:_,route:x,router:b};t.default=w},function(e,t,n){"use strict";function r(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function i(e,t,n){e.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n)}function a(){return window.location.href.split("#")[1]||""}function o(e){window.location.replace(window.location.pathname+window.location.search+"#"+e)}function s(){return window.location.pathname+window.location.search+window.location.hash}function u(e){e&&window.history.go(e)}function c(e,t){t(window.confirm(e))}function l(){var e=navigator.userAgent;return(-1===e.indexOf("Android 2.")&&-1===e.indexOf("Android 4.0")||-1===e.indexOf("Mobile Safari")||-1!==e.indexOf("Chrome")||-1!==e.indexOf("Windows Phone"))&&(window.history&&"pushState"in window.history)}function f(){return-1===navigator.userAgent.indexOf("Firefox")}t.__esModule=!0,t.addEventListener=r,t.removeEventListener=i,t.getHashPath=a,t.replaceHashPath=o,t.getWindowPath=s,t.go=u,t.getUserConfirmation=c,t.supportsHistory=l,t.supportsGoWithoutReloadUsingHash=f},function(e,t,n){"use strict";function r(e,t,n){var r=e(t,n);e.length<2&&n(r)}t.__esModule=!0;var i=n(41);!function(e){e&&e.__esModule}(i);t.default=r,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){return function(){return e.apply(this,arguments)}}t.__esModule=!0;var i=n(41);!function(e){e&&e.__esModule}(i);t.default=r,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1}function a(e,t){function n(t){var n=!(arguments.length<=1||void 0===arguments[1])&&arguments[1],r=arguments.length<=2||void 0===arguments[2]?null:arguments[2],i=void 0;return n&&!0!==n||null!==r?(t={pathname:t,query:n},i=r||!1):(t=e.createLocation(t),i=n),(0,h.default)(t,i,_.location,_.routes,_.params)}function r(e,n){x&&x.location===e?a(x,n):(0,g.default)(t,e,function(t,r){t?n(t):r?a(o({},r,{location:e}),n):n()})}function a(e,t){function n(n,i){if(n||i)return r(n,i);(0,p.default)(e,function(n,r){n?t(n):t(null,null,_=o({},e,{components:r}))})}function r(e,n){e?t(e):t(null,n)}var i=(0,c.default)(_,e),a=i.leaveRoutes,s=i.changeRoutes,u=i.enterRoutes;(0,l.runLeaveHooks)(a,_),a.filter(function(e){return-1===u.indexOf(e)}).forEach(m),(0,l.runChangeHooks)(s,_,e,function(t,i){if(t||i)return r(t,i);(0,l.runEnterHooks)(u,e,n)})}function s(e){var t=arguments.length<=1||void 0===arguments[1]||arguments[1];return e.__id__||t&&(e.__id__=b++)}function u(e){return e.reduce(function(e,t){return e.push.apply(e,w[s(t)]),e},[])}function f(e,n){(0,g.default)(t,e,function(t,r){if(null==r)return void n();x=o({},r,{location:e});for(var i=u((0,c.default)(_,x).leaveRoutes),a=void 0,s=0,l=i.length;null==a&&s=e&&u&&(o=!0,n())}}var a=0,o=!1,s=!1,u=!1,c=void 0;i()}function i(e,t,n){function r(e,t,r){o||(t?(o=!0,n(t)):(a[e]=r,(o=++s===i)&&n(null,a)))}var i=e.length,a=[];if(0===i)return n(null,a);var o=!1,s=0;e.forEach(function(e,n){t(e,n,function(e,t){r(n,e,t)})})}t.__esModule=!0,t.loopAsync=r,t.mapAsync=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.effects=t.saga=t.update=t.connect=t.Module=t.Application=void 0;var r=n(270);Object.defineProperty(t,"Application",{enumerable:!0,get:function(){return r.Application}});var i=n(393);Object.defineProperty(t,"Module",{enumerable:!0,get:function(){return i.Module}});var a=n(205);Object.defineProperty(t,"connect",{enumerable:!0,get:function(){return a.connect}});var o=n(210);Object.defineProperty(t,"effects",{enumerable:!0,get:function(){return o.effects}});var s=n(396),u=function(e){return e&&e.__esModule?e:{default:e}}(s),c=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(o);t.update=u.default,t.saga=c},function(e,t,n){"use strict";function r(e,t,n){this.props=e,this.context=t,this.refs=c,this.updater=n||u}function i(e,t,n){this.props=e,this.context=t,this.refs=c,this.updater=n||u}function a(){}var o=n(77),s=n(10),u=n(169),c=(n(170),n(86));n(2),n(271);r.prototype.isReactComponent={},r.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e&&o("85"),this.updater.enqueueSetState(this,e),t&&this.updater.enqueueCallback(this,t,"setState")},r.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this),e&&this.updater.enqueueCallback(this,e,"forceUpdate")};a.prototype=r.prototype,i.prototype=new a,i.prototype.constructor=i,s(i.prototype,r.prototype),i.prototype.isPureReactComponent=!0,e.exports={Component:r,PureComponent:i}},function(e,t,n){"use strict";var r=(n(7),{isMounted:function(e){return!1},enqueueCallback:function(e,t){},enqueueForceUpdate:function(e){},enqueueReplaceState:function(e,t){},enqueueSetState:function(e,t){}});e.exports=r},function(e,t,n){"use strict";var r=!1;e.exports=r},function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;e.exports=r},function(e,t,n){"use strict";var r=n(279);e.exports=function(e){return r(e,!1)}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";var r={hasCachedChildNodes:1};e.exports=r},function(e,t,n){"use strict";function r(e,t){return null==t&&i("30"),null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}var i=n(8);n(2);e.exports=r},function(e,t,n){"use strict";function r(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}e.exports=r},function(e,t,n){"use strict";function r(){return!a&&i.canUseDOM&&(a="textContent"in document.documentElement?"textContent":"innerText"),a}var i=n(20),a=null;e.exports=r},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=n(8),a=n(50),o=(n(2),function(){function e(t){r(this,e),this._callbacks=null,this._contexts=null,this._arg=t}return e.prototype.enqueue=function(e,t){this._callbacks=this._callbacks||[],this._callbacks.push(e),this._contexts=this._contexts||[],this._contexts.push(t)},e.prototype.notifyAll=function(){var e=this._callbacks,t=this._contexts,n=this._arg;if(e&&t){e.length!==t.length&&i("24"),this._callbacks=null,this._contexts=null;for(var r=0;r1)for(var n=1;n.":"function"==typeof t?" Instead of passing a class like Foo, pass React.createElement(Foo) or .":null!=t&&void 0!==t.props?" This may be caused by unintentionally loading two independent copies of React.":"");var o,s=g.createElement(B,{child:t});if(e){var u=w.get(e);o=u._processChildContext(u._context)}else o=M;var l=h(n);if(l){var f=l._currentElement,p=f.props.child;if(P(p,t)){var m=l._renderedComponent.getPublicInstance(),v=r&&function(){r.call(m)};return U._updateRootComponent(l,s,o,n,v),m}U.unmountComponentAtNode(n)}var y=i(n),_=y&&!!a(y),x=c(n),b=_&&!l&&!x,T=U._renderNewRootComponent(s,n,b,o)._renderedComponent.getPublicInstance();return r&&r.call(T),T},render:function(e,t,n){return U._renderSubtreeIntoContainer(null,e,t,n)},unmountComponentAtNode:function(e){l(e)||d("40");var t=h(e);if(!t){c(e),1===e.nodeType&&e.hasAttribute(L);return!1}return delete k[t._instance.rootID],C.batchedUpdates(u,t,e,!1),!0},_mountImageIntoNode:function(e,t,n,a,o){if(l(t)||d("41"),a){var s=i(t);if(T.canReuseMarkup(e,s))return void y.precacheNode(n,s);var u=s.getAttribute(T.CHECKSUM_ATTR_NAME);s.removeAttribute(T.CHECKSUM_ATTR_NAME);var c=s.outerHTML;s.setAttribute(T.CHECKSUM_ATTR_NAME,u);var f=e,h=r(f,c),m=" (client) "+f.substring(h-20,h+20)+"\n (server) "+c.substring(h-20,h+20);t.nodeType===R&&d("42",m)}if(t.nodeType===R&&d("43"),o.useCreateElement){for(;t.lastChild;)t.removeChild(t.lastChild);p.insertTreeBefore(t,e,null)}else O(t,e),y.precacheNode(n,t.firstChild)}};e.exports=U},function(e,t,n){"use strict";function r(e){for(var t;(t=e._renderedNodeType)===i.COMPOSITE;)e=e._renderedComponent;return t===i.HOST?e._renderedComponent:t===i.EMPTY?null:void 0}var i=n(190);e.exports=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(201),i=n(373),a=n(374),o=n(375),s=n(204);n(203);n.d(t,"createStore",function(){return r.b}),n.d(t,"combineReducers",function(){return i.a}),n.d(t,"bindActionCreators",function(){return a.a}),n.d(t,"applyMiddleware",function(){return o.a}),n.d(t,"compose",function(){return s.a})},function(e,t,n){"use strict";function r(e,t,n){function s(){v===g&&(v=g.slice())}function u(){return m}function c(e){if("function"!=typeof e)throw new Error("Expected listener to be a function.");var t=!0;return s(),v.push(e),function(){if(t){t=!1,s();var n=v.indexOf(e);v.splice(n,1)}}}function l(e){if(!Object(i.a)(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(y)throw new Error("Reducers may not dispatch actions.");try{y=!0,m=p(m,e)}finally{y=!1}for(var t=g=v,n=0;n=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function s(){}function u(e,t){var n={run:function(r){try{var i=e(t.getState(),r);(i!==n.props||n.error)&&(n.shouldComponentUpdate=!0,n.props=i,n.error=null)}catch(e){n.shouldComponentUpdate=!0,n.error=e}}};return n}function c(e){var t,n,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=c.getDisplayName,h=void 0===l?function(e){return"ConnectAdvanced("+e+")"}:l,x=c.methodName,b=void 0===x?"connectAdvanced":x,w=c.renderCountProp,T=void 0===w?void 0:w,E=c.shouldHandleStateChanges,S=void 0===E||E,C=c.storeKey,M=void 0===C?"store":C,A=c.withRef,O=void 0!==A&&A,P=o(c,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef"]),N=M+"Subscription",L=y++,D=(t={},t[M]=g.a,t[N]=g.b,t),R=(n={},n[N]=g.b,n);return function(t){d()("function"==typeof t,"You must pass a component to the function returned by "+b+". Instead received "+JSON.stringify(t));var n=t.displayName||t.name||"Component",o=h(n),c=v({},P,{getDisplayName:h,methodName:b,renderCountProp:T,shouldHandleStateChanges:S,storeKey:M,withRef:O,displayName:o,wrappedComponentName:n,WrappedComponent:t}),l=function(n){function l(e,t){r(this,l);var a=i(this,n.call(this,e,t));return a.version=L,a.state={},a.renderCount=0,a.store=e[M]||t[M],a.propsMode=Boolean(e[M]),a.setWrappedInstance=a.setWrappedInstance.bind(a),d()(a.store,'Could not find "'+M+'" in either the context or props of "'+o+'". Either wrap the root component in a , or explicitly pass "'+M+'" as a prop to "'+o+'".'),a.initSelector(),a.initSubscription(),a}return a(l,n),l.prototype.getChildContext=function(){var e,t=this.propsMode?null:this.subscription;return e={},e[N]=t||this.context[N],e},l.prototype.componentDidMount=function(){S&&(this.subscription.trySubscribe(),this.selector.run(this.props),this.selector.shouldComponentUpdate&&this.forceUpdate())},l.prototype.componentWillReceiveProps=function(e){this.selector.run(e)},l.prototype.shouldComponentUpdate=function(){return this.selector.shouldComponentUpdate},l.prototype.componentWillUnmount=function(){this.subscription&&this.subscription.tryUnsubscribe(),this.subscription=null,this.notifyNestedSubs=s,this.store=null,this.selector.run=s,this.selector.shouldComponentUpdate=!1},l.prototype.getWrappedInstance=function(){return d()(O,"To access the wrapped instance, you need to specify { withRef: true } in the options argument of the "+b+"() call."),this.wrappedInstance},l.prototype.setWrappedInstance=function(e){this.wrappedInstance=e},l.prototype.initSelector=function(){var t=e(this.store.dispatch,c);this.selector=u(t,this.store),this.selector.run(this.props)},l.prototype.initSubscription=function(){if(S){var e=(this.propsMode?this.props:this.context)[N];this.subscription=new m.a(this.store,e,this.onStateChange.bind(this)),this.notifyNestedSubs=this.subscription.notifyNestedSubs.bind(this.subscription)}},l.prototype.onStateChange=function(){this.selector.run(this.props),this.selector.shouldComponentUpdate?(this.componentDidUpdate=this.notifyNestedSubsOnComponentDidUpdate,this.setState(_)):this.notifyNestedSubs()},l.prototype.notifyNestedSubsOnComponentDidUpdate=function(){this.componentDidUpdate=void 0,this.notifyNestedSubs()},l.prototype.isSubscribed=function(){return Boolean(this.subscription)&&this.subscription.isSubscribed()},l.prototype.addExtraProps=function(e){if(!(O||T||this.propsMode&&this.subscription))return e;var t=v({},e);return O&&(t.ref=this.setWrappedInstance),T&&(t[T]=this.renderCount++),this.propsMode&&this.subscription&&(t[N]=this.subscription),t},l.prototype.render=function(){var e=this.selector;if(e.shouldComponentUpdate=!1,e.error)throw e.error;return Object(p.createElement)(t,this.addExtraProps(e.props))},l}(p.Component);return l.WrappedComponent=t,l.displayName=o,l.childContextTypes=R,l.contextTypes=D,l.propTypes=D,f()(l,t)}}t.a=c;var l=n(378),f=n.n(l),h=n(16),d=n.n(h),p=n(1),m=(n.n(p),n(379)),g=n(206),v=Object.assign||function(e){for(var t=1;t2?n-2:0),o=2;o2&&void 0!==arguments[2]?arguments[2]:"",i=arguments[3],a=Object(u.y)();X&&X.effectTriggered({effectId:a,parentEffectId:t,label:r,effect:e});var o=void 0;n.cancel=u.u,i.cancel=function(){if(!o){o=!0;try{n.cancel()}catch(e){Q(e)}n.cancel=u.u,X&&X.effectCancelled(a)}};var s=void 0;return u.q.promise(e)?b(e,n):u.q.helper(e)?M(_(e),a,n):u.q.iterator(e)?w(e,a,H,n):u.q.array(e)?q(e,a,n):(s=l.d.take(e))?T(s,n):(s=l.d.put(e))?E(s,n):(s=l.d.all(e))?P(s,a,n):(s=l.d.race(e))?N(s,a,n):(s=l.d.call(e))?S(s,a,n):(s=l.d.cps(e))?C(s,n):(s=l.d.fork(e))?M(s,a,n):(s=l.d.join(e))?A(s,n):(s=l.d.cancel(e))?O(s,n):(s=l.d.select(e))?L(s,n):(s=l.d.actionChannel(e))?D(s,n):(s=l.d.flush(e))?I(s,n):(s=l.d.cancelled(e))?R(s,n):(s=l.d.getContext(e))?k(s,n):(s=l.d.setContext(e))?F(s,n):n(e)}function b(e,t){var n=e[u.a];u.q.func(n)?t.cancel=n:u.q.func(e.abort)&&(t.cancel=function(){return e.abort()}),e.then(t,function(e){return t(e,!0)})}function w(e,t,n,r){s(e,B,U,j,$,z,t,n,r)}function T(e,t){var n=e.channel,r=e.pattern,a=e.maybe;n=n||J;var o=function(e){return e instanceof Error?t(e,!0):t(Object(f.e)(e)&&!a?g:e)};try{n.take(o,i(r))}catch(e){return t(e,!0)}t.cancel=o.cancel}function E(e,t){var n=e.channel,r=e.action,i=e.resolve;Object(c.a)(function(){var e=void 0;try{e=(n?n.put:U)(r)}catch(e){if(n||i)return t(e,!0);Q(e)}if(!i||!u.q.promise(e))return t(e);b(e,t)})}function S(e,t,n){var r=e.context,i=e.fn,a=e.args,o=void 0;try{o=i.apply(r,a)}catch(e){return n(e,!0)}return u.q.promise(o)?b(o,n):u.q.iterator(o)?w(o,t,i.name,n):n(o)}function C(e,t){var n=e.context,r=e.fn,i=e.args;try{var a=function(e,n){return u.q.undef(e)?t(n):t(e,!0)};r.apply(n,i.concat(a)),a.cancel&&(t.cancel=function(){return a.cancel()})}catch(e){return t(e,!0)}}function M(e,t,n){var r=e.context,i=e.fn,a=e.args,l=e.detached,f=o({context:r,fn:i,args:a});try{Object(c.c)();var h=s(f,B,U,j,$,z,t,i.name,l?null:u.u);l?n(h):f._isRunning?(ne.addTask(h),n(h)):f._error?ne.abort(f._error):n(h)}finally{Object(c.b)()}}function A(e,t){if(e.isRunning()){var n={task:ee,cb:t};t.cancel=function(){return Object(u.w)(e.joiners,n)},e.joiners.push(n)}else e.isAborted()?t(e.error(),!0):t(e.result())}function O(e,t){e===u.d&&(e=ee),e.isRunning()&&e.cancel(),t()}function P(e,t,n){function r(){a===i.length&&(o=!0,n(u.q.array(e)?u.f.from(d({},s,{length:i.length})):s))}var i=Object.keys(e);if(!i.length)return n(u.q.array(e)?[]:{});var a=0,o=void 0,s={},c={};i.forEach(function(e){var t=function(t,i){o||(i||Object(f.e)(t)||t===g||t===v?(n.cancel(),n(t,i)):(s[e]=t,a++,r()))};t.cancel=u.u,c[e]=t}),n.cancel=function(){o||(o=!0,i.forEach(function(e){return c[e].cancel()}))},i.forEach(function(n){return x(e[n],t,n,c[n])})}function N(e,t,n){var r=void 0,i=Object.keys(e),a={};i.forEach(function(t){var o=function(a,o){if(!r)if(o)n.cancel(),n(a,!0);else if(!Object(f.e)(a)&&a!==g&&a!==v){var s;n.cancel(),r=!0;var c=(s={},s[t]=a,s);n(u.q.array(e)?[].slice.call(d({},c,{length:i.length})):c)}};o.cancel=u.u,a[t]=o}),n.cancel=function(){r||(r=!0,i.forEach(function(e){return a[e].cancel()}))},i.forEach(function(n){r||x(e[n],t,n,a[n])})}function L(e,t){var n=e.selector,r=e.args;try{var i=n.apply(void 0,[j()].concat(r));t(i)}catch(e){t(e,!0)}}function D(e,t){var n=e.pattern,r=e.buffer,a=i(n);a.pattern=n,t(Object(f.d)(B,r||h.a.fixed(),a))}function R(e,t){t(!!te.isCancelled)}function I(e,t){e.flush(t)}function k(e,t){t($[e])}function F(e,t){u.v.assign($,e),t()}var B=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return u.u},U=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u.u,j=arguments.length>3&&void 0!==arguments[3]?arguments[3]:u.u,G=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},z=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},V=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,H=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"anonymous",W=arguments[8];Object(u.h)(e,u.q.iterator,m);var q=Object(u.n)(P,Object(u.z)("[...effects]","all([...effects])")),X=z.sagaMonitor,Y=z.logger,Z=z.onError,K=Y||u.s,Q=function(e){var t=e.sagaStack;!t&&e.stack&&(t=-1!==e.stack.split("\n")[0].indexOf(e.message)?e.stack:"Error: "+e.message+"\n"+e.stack),K("error","uncaught at "+H,t||e.message||e)},J=Object(f.f)(B),$=Object.create(G);p.cancel=u.u;var ee=function(e,t,i,a){var o,s,c;return i._deferredEnd=null,s={},s[u.e]=!0,s.id=e,s.name=t,o="done",c={},c[o]=c[o]||{},c[o].get=function(){if(i._deferredEnd)return i._deferredEnd.promise;var e=Object(u.l)();return i._deferredEnd=e,i._isRunning||(i._error?e.reject(i._error):e.resolve(i._result)),e.promise},s.cont=a,s.joiners=[],s.cancel=n,s.isRunning=function(){return i._isRunning},s.isCancelled=function(){return i._isCancelled},s.isAborted=function(){return i._isAborted},s.result=function(){return i._result},s.error=function(){return i._error},s.setContext=function(e){Object(u.h)(e,u.q.object,Object(u.k)("task",e)),u.v.assign($,e)},r(s,c),s}(V,H,e,W),te={name:H,cancel:t,isRunning:!0},ne=a(H,te,y);return W&&(W.cancel=n),e._isRunning=!0,p(),ee}n.d(t,"a",function(){return g}),t.b=s;var u=n(26),c=n(211),l=n(51),f=n(70),h=n(93),d=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:n,r=arguments[1],i=t[r.type];return i?i(e,r.payload):e}};t.reducerCreator=function(e){var t={};return e.forEach(function(e){t[e.namespace]=a(e)}),t},t.reducerWithNamespace=function(e,t){return(0,r.mapKey)(e,function(e){return(0,i.addPrefix)(e,t)})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;iu;)r(s,n=t[u++])&&(~a(c,n)||c.push(n));return c}},function(e,t,n){var r=n(13),i=n(3),a=n(55);e.exports=n(12)?Object.defineProperties:function(e,t){i(e);for(var n,o=a(t),s=o.length,u=0;s>u;)r.f(e,n=o[u++],t[n]);return e}},function(e,t,n){var r=n(27),i=n(58).f,a={}.toString,o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function(e){try{return i(e)}catch(e){return o.slice()}};e.exports.f=function(e){return o&&"[object Window]"==a.call(e)?s(e):i(r(e))}},function(e,t,n){"use strict";var r=n(55),i=n(97),a=n(84),o=n(15),s=n(83),u=Object.assign;e.exports=!u||n(5)(function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach(function(e){t[e]=e}),7!=u({},e)[n]||Object.keys(u({},t)).join("")!=r})?function(e,t){for(var n=o(e),u=arguments.length,c=1,l=i.f,f=a.f;u>c;)for(var h,d=s(arguments[c++]),p=l?r(d).concat(l(d)):r(d),m=p.length,g=0;m>g;)f.call(d,h=p[g++])&&(n[h]=d[h]);return n}:u},function(e,t,n){"use strict";var r=n(19),i=n(6),a=n(225),o=[].slice,s={},u=function(e,t,n){if(!(t in s)){for(var r=[],i=0;i>>0||(o.test(n)?16:10))}:r},function(e,t,n){var r=n(4).parseFloat,i=n(72).trim;e.exports=1/r(n(140)+"-0")!=-1/0?function(e){var t=i(String(e),3),n=r(t);return 0===n&&"-"==t.charAt(0)?-0:n}:r},function(e,t,n){var r=n(32);e.exports=function(e,t){if("number"!=typeof e&&"Number"!=r(e))throw TypeError(t);return+e}},function(e,t,n){var r=n(6),i=Math.floor;e.exports=function(e){return!r(e)&&isFinite(e)&&i(e)===e}},function(e,t){e.exports=Math.log1p||function(e){return(e=+e)>-1e-8&&e<1e-8?e-e*e/2:Math.log(1+e)}},function(e,t,n){var r=n(143),i=Math.pow,a=i(2,-52),o=i(2,-23),s=i(2,127)*(2-o),u=i(2,-126),c=function(e){return e+1/a-1/a};e.exports=Math.fround||function(e){var t,n,i=Math.abs(e),l=r(e);return is||n!=n?l*(1/0):l*n)}},function(e,t,n){var r=n(3);e.exports=function(e,t,n,i){try{return i?t(r(n)[0],n[1]):t(n)}catch(t){var a=e.return;throw void 0!==a&&r(a.call(e)),t}}},function(e,t,n){var r=n(19),i=n(15),a=n(83),o=n(14);e.exports=function(e,t,n,s,u){r(t);var c=i(e),l=a(c),f=o(c.length),h=u?f-1:0,d=u?-1:1;if(n<2)for(;;){if(h in l){s=l[h],h+=d;break}if(h+=d,u?h<0:f<=h)throw TypeError("Reduce of empty array with no initial value")}for(;u?h>=0:f>h;h+=d)h in l&&(s=t(s,l[h],h,c));return s}},function(e,t,n){"use strict";var r=n(15),i=n(56),a=n(14);e.exports=[].copyWithin||function(e,t){var n=r(this),o=a(n.length),s=i(e,o),u=i(t,o),c=arguments.length>2?arguments[2]:void 0,l=Math.min((void 0===c?o:i(c,o))-u,o-s),f=1;for(u0;)u in n?n[s]=n[u]:delete n[s],s+=f,u+=f;return n}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){n(12)&&"g"!=/./g.flags&&n(13).f(RegExp.prototype,"flags",{configurable:!0,get:n(101)})},function(e,t){e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},function(e,t,n){var r=n(3),i=n(6),a=n(158);e.exports=function(e,t){if(r(e),i(t)&&t.constructor===e)return t;var n=a.f(e);return(0,n.resolve)(t),n.promise}},function(e,t,n){"use strict";var r=n(240),i=n(74);e.exports=n(104)("Map",function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{get:function(e){var t=r.getEntry(i(this,"Map"),e);return t&&t.v},set:function(e,t){return r.def(i(this,"Map"),0===e?0:e,t)}},r,!0)},function(e,t,n){"use strict";var r=n(13).f,i=n(57),a=n(62),o=n(31),s=n(60),u=n(61),c=n(146),l=n(235),f=n(59),h=n(12),d=n(46).fastKey,p=n(74),m=h?"_s":"size",g=function(e,t){var n,r=d(t);if("F"!==r)return e._i[r];for(n=e._f;n;n=n.n)if(n.k==t)return n};e.exports={getConstructor:function(e,t,n,c){var l=e(function(e,r){s(e,l,t,"_i"),e._t=t,e._i=i(null),e._f=void 0,e._l=void 0,e[m]=0,void 0!=r&&u(r,n,e[c],e)});return a(l.prototype,{clear:function(){for(var e=p(this,t),n=e._i,r=e._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete n[r.i];e._f=e._l=void 0,e[m]=0},delete:function(e){var n=p(this,t),r=g(n,e);if(r){var i=r.n,a=r.p;delete n._i[r.i],r.r=!0,a&&(a.n=i),i&&(i.p=a),n._f==r&&(n._f=i),n._l==r&&(n._l=a),n[m]--}return!!r},forEach:function(e){p(this,t);for(var n,r=o(e,arguments.length>1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function(e){return!!g(p(this,t),e)}}),h&&r(l.prototype,"size",{get:function(){return p(this,t)[m]}}),l},def:function(e,t,n){var r,i,a=g(e,t);return a?a.v=n:(e._l=a={i:i=d(t,!0),k:t,v:n,p:r=e._l,n:void 0,r:!1},e._f||(e._f=a),r&&(r.n=a),e[m]++,"F"!==i&&(e._i[i]=a)),e},getEntry:g,setStrong:function(e,t,n){c(e,t,function(e,n){this._t=p(e,t),this._k=n,this._l=void 0},function(){for(var e=this,t=e._k,n=e._l;n&&n.r;)n=n.p;return e._t&&(e._l=n=n?n.n:e._t._f)?"keys"==t?l(0,n.k):"values"==t?l(0,n.v):l(0,[n.k,n.v]):(e._t=void 0,l(1))},n?"entries":"values",!n,!0),f(t)}}},function(e,t,n){"use strict";var r=n(240),i=n(74);e.exports=n(104)("Set",function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{add:function(e){return r.def(i(this,"Set"),e=0===e?0:e,e)}},r)},function(e,t,n){"use strict";var r,i=n(40)(0),a=n(23),o=n(46),s=n(223),u=n(243),c=n(6),l=n(5),f=n(74),h=o.getWeak,d=Object.isExtensible,p=u.ufstore,m={},g=function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},v={get:function(e){if(c(e)){var t=h(e);return!0===t?p(f(this,"WeakMap")).get(e):t?t[this._i]:void 0}},set:function(e,t){return u.def(f(this,"WeakMap"),e,t)}},y=e.exports=n(104)("WeakMap",g,v,u,!0,!0);l(function(){return 7!=(new y).set((Object.freeze||Object)(m),7).get(m)})&&(r=u.getConstructor(g,"WeakMap"),s(r.prototype,v),o.NEED=!0,i(["delete","has","get","set"],function(e){var t=y.prototype,n=t[e];a(t,e,function(t,i){if(c(t)&&!d(t)){this._f||(this._f=new r);var a=this._f[e](t,i);return"set"==e?this:a}return n.call(this,t,i)})}))},function(e,t,n){"use strict";var r=n(62),i=n(46).getWeak,a=n(3),o=n(6),s=n(60),u=n(61),c=n(40),l=n(21),f=n(74),h=c(5),d=c(6),p=0,m=function(e){return e._l||(e._l=new g)},g=function(){this.a=[]},v=function(e,t){return h(e.a,function(e){return e[0]===t})};g.prototype={get:function(e){var t=v(this,e);if(t)return t[1]},has:function(e){return!!v(this,e)},set:function(e,t){var n=v(this,e);n?n[1]=t:this.a.push([e,t])},delete:function(e){var t=d(this.a,function(t){return t[0]===e});return~t&&this.a.splice(t,1),!!~t}},e.exports={getConstructor:function(e,t,n,a){var c=e(function(e,r){s(e,c,t,"_i"),e._t=t,e._i=p++,e._l=void 0,void 0!=r&&u(r,n,e[a],e)});return r(c.prototype,{delete:function(e){if(!o(e))return!1;var n=i(e);return!0===n?m(f(this,t)).delete(e):n&&l(n,this._i)&&delete n[this._i]},has:function(e){if(!o(e))return!1;var n=i(e);return!0===n?m(f(this,t)).has(e):n&&l(n,this._i)}}),c},def:function(e,t,n){var r=i(a(t),!0);return!0===r?m(e).set(t,n):r[e._i]=n,e},ufstore:m}},function(e,t,n){var r=n(38),i=n(14);e.exports=function(e){if(void 0===e)return 0;var t=r(e),n=i(t);if(t!==n)throw RangeError("Wrong length!");return n}},function(e,t,n){var r=n(58),i=n(97),a=n(3),o=n(4).Reflect;e.exports=o&&o.ownKeys||function(e){var t=r.f(a(e)),n=i.f;return n?t.concat(n(e)):t}},function(e,t,n){"use strict";function r(e,t,n,c,l,f,h,d){for(var p,m,g=l,v=0,y=!!h&&s(h,d,3);v0)g=r(e,t,p,o(p.length),g,f-1)-1;else{if(g>=9007199254740991)throw TypeError();e[g]=p}g++}v++}return g}var i=n(98),a=n(6),o=n(14),s=n(31),u=n(9)("isConcatSpreadable");e.exports=r},function(e,t,n){var r=n(14),i=n(142),a=n(37);e.exports=function(e,t,n,o){var s=String(a(e)),u=s.length,c=void 0===n?" ":String(n),l=r(t);if(l<=u||""==c)return s;var f=l-u,h=i.call(c,Math.ceil(f/c.length));return h.length>f&&(h=h.slice(0,f)),o?h+s:s+h}},function(e,t,n){var r=n(55),i=n(27),a=n(84).f;e.exports=function(e){return function(t){for(var n,o=i(t),s=r(o),u=s.length,c=0,l=[];u>c;)a.call(o,n=s[c++])&&l.push(e?[n,o[n]]:o[n]);return l}}},function(e,t,n){var r=n(85),i=n(250);e.exports=function(e){return function(){if(r(this)!=e)throw TypeError(e+"#toJSON isn't generic");return i(this)}}},function(e,t,n){var r=n(61);e.exports=function(e,t){var n=[];return r(e,!1,n.push,n,t),n}},function(e,t){e.exports=Math.scale||function(e,t,n,r,i){return 0===arguments.length||e!=e||t!=t||n!=n||r!=r||i!=i?NaN:e===1/0||e===-1/0?e:(e-t)*(i-r)/(n-t)+r}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.createMemoryHistory=t.hashHistory=t.browserHistory=t.applyRouterMiddleware=t.formatPattern=t.useRouterHistory=t.match=t.routerShape=t.locationShape=t.PropTypes=t.RoutingContext=t.RouterContext=t.createRoutes=t.useRoutes=t.RouteContext=t.Lifecycle=t.History=t.Route=t.Redirect=t.IndexRoute=t.IndexRedirect=t.withRouter=t.IndexLink=t.Link=t.Router=void 0;var i=n(48);Object.defineProperty(t,"createRoutes",{enumerable:!0,get:function(){return i.createRoutes}});var a=n(161);Object.defineProperty(t,"locationShape",{enumerable:!0,get:function(){return a.locationShape}}),Object.defineProperty(t,"routerShape",{enumerable:!0,get:function(){return a.routerShape}});var o=n(75);Object.defineProperty(t,"formatPattern",{enumerable:!0,get:function(){return o.formatPattern}});var s=n(603),u=r(s),c=n(259),l=r(c),f=n(617),h=r(f),d=n(618),p=r(d),m=n(620),g=r(m),v=n(621),y=r(v),_=n(260),x=r(_),b=n(622),w=r(b),T=n(623),E=r(T),S=n(624),C=r(S),M=n(625),A=r(M),O=n(626),P=r(O),N=n(112),L=r(N),D=n(627),R=r(D),I=r(a),k=n(628),F=r(k),B=n(263),U=r(B),j=n(630),G=r(j),z=n(631),V=r(z),H=n(633),W=r(H),q=n(261),X=r(q);t.Router=u.default,t.Link=l.default,t.IndexLink=h.default,t.withRouter=p.default,t.IndexRedirect=g.default,t.IndexRoute=y.default,t.Redirect=x.default,t.Route=w.default,t.History=E.default,t.Lifecycle=C.default,t.RouteContext=A.default,t.useRoutes=P.default,t.RouterContext=L.default,t.RoutingContext=R.default,t.PropTypes=I.default,t.match=F.default,t.useRouterHistory=U.default,t.applyRouterMiddleware=G.default,t.browserHistory=V.default,t.hashHistory=W.default,t.createMemoryHistory=X.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){return"string"==typeof e&&"/"===e.charAt(0)}function a(){var e=v.getHashPath();return!!i(e)||(v.replaceHashPath("/"+e),!1)}function o(e,t,n){return e+(-1===e.indexOf("?")?"?":"&")+t+"="+n}function s(e,t){return e.replace(new RegExp("[?&]?"+t+"=[a-zA-Z0-9]+"),"")}function u(e,t){var n=e.match(new RegExp("\\?.*?\\b"+t+"=(.+?)\\b"));return n&&n[1]}function c(){function e(){var e=v.getHashPath(),t=void 0,n=void 0;M?(t=u(e,M),e=s(e,M),t?n=y.readState(t):(n=null,t=A.createKey(),v.replaceHashPath(o(e,M,t)))):t=n=null;var r=m.parsePath(e);return A.createLocation(l({},r,{state:n}),void 0,t)}function t(t){function n(){a()&&r(e())}var r=t.transitionTo;return a(),v.addEventListener(window,"hashchange",n),function(){v.removeEventListener(window,"hashchange",n)}}function n(e){var t=e.basename,n=e.pathname,r=e.search,i=e.state,a=e.action,s=e.key;if(a!==p.POP){var u=(t||"")+n+r;M?(u=o(u,M,s),y.saveState(s,i)):e.key=e.state=null;var c=v.getHashPath();a===p.PUSH?c!==u&&(window.location.hash=u):c!==u&&v.replaceHashPath(u)}}function r(e){1==++O&&(P=t(A));var n=A.listenBefore(e);return function(){n(),0==--O&&P()}}function i(e){1==++O&&(P=t(A));var n=A.listen(e);return function(){n(),0==--O&&P()}}function c(e){A.push(e)}function f(e){A.replace(e)}function h(e){A.go(e)}function _(e){return"#"+A.createHref(e)}function w(e){1==++O&&(P=t(A)),A.registerTransitionHook(e)}function T(e){A.unregisterTransitionHook(e),0==--O&&P()}function E(e,t){A.pushState(e,t)}function S(e,t){A.replaceState(e,t)}var C=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];g.canUseDOM||d.default(!1);var M=C.queryKey;(void 0===M||M)&&(M="string"==typeof M?M:b);var A=x.default(l({},C,{getCurrentLocation:e,finishTransition:n,saveState:y.saveState})),O=0,P=void 0;v.supportsGoWithoutReloadUsingHash();return l({},A,{listenBefore:r,listen:i,push:c,replace:f,go:h,createHref:_,registerTransitionHook:w,unregisterTransitionHook:T,pushState:E,replaceState:S})}t.__esModule=!0;var l=Object.assign||function(e){for(var t=1;t