12345678910111213 |
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(window,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=224)}([function(e,t){e.exports={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,FUNC_ADD:32774,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,BLEND_COLOR:32773,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,VENDOR:7936,RENDERER:7937,VERSION:7938,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,BROWSER_DEFAULT_WEBGL:37444,STATIC_DRAW:35044,STREAM_DRAW:35040,DYNAMIC_DRAW:35048,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,CULL_FACE:2884,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,BLEND:3042,DEPTH_TEST:2929,DITHER:3024,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,SCISSOR_TEST:3089,STENCIL_TEST:2960,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CONTEXT_LOST_WEBGL:37442,CW:2304,CCW:2305,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,COMPILE_STATUS:35713,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_ATTRIBUTES:35721,ACTIVE_UNIFORMS:35718,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,ALWAYS:519,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,GEQUAL:518,NOTEQUAL:517,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,TEXTURE_WIDTH:4096,TEXTURE_HEIGHT:4097,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,MAX_3D_TEXTURE_SIZE:32883,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,MAX_TEXTURE_LOD_BIAS:34045,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,RASTERIZER_DISCARD:35977,VERTEX_ARRAY_BINDING:34229,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,MAX_ELEMENT_INDEX:36203,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,RGB9_E5:35901,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,RGB10_A2UI:36975,TEXTURE_IMMUTABLE_FORMAT:37167,TEXTURE_IMMUTABLE_LEVELS:33503,UNSIGNED_INT_2_10_10_10_REV:33640,UNSIGNED_INT_10F_11F_11F_REV:35899,UNSIGNED_INT_5_9_9_9_REV:35902,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,UNSIGNED_INT_24_8:34042,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,INT_2_10_10_10_REV:36255,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,MAX_SAMPLES:36183,SAMPLER_BINDING:35097,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,UNSIGNED_NORMALIZED:35863,SIGNED_NORMALIZED:36764,VERTEX_ATTRIB_ARRAY_INTEGER:35069,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,DEPTH24_STENCIL8:35056,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,COLOR:6144,DEPTH:6145,STENCIL:6146,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,INVALID_INDEX:4294967295,TIMEOUT_IGNORED:-1,MAX_CLIENT_WAIT_TIMEOUT_WEBGL:37447,VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE:35070,UNMASKED_VENDOR_WEBGL:37445,UNMASKED_RENDERER_WEBGL:37446,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047,TEXTURE_MAX_ANISOTROPY_EXT:34046,COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_RGBA8_ETC2_EAC:37493,COMPRESSED_SRGB8_ETC2:37494,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37495,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37496,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37497,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGB_ATC_WEBGL:35986,COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL:35986,COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL:34798,UNSIGNED_INT_24_8_WEBGL:34042,HALF_FLOAT_OES:36193,RGBA32F_EXT:34836,RGB32F_EXT:34837,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT:33297,UNSIGNED_NORMALIZED_EXT:35863,MIN_EXT:32775,MAX_EXT:32776,SRGB_EXT:35904,SRGB_ALPHA_EXT:35906,SRGB8_ALPHA8_EXT:35907,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT:33296,FRAGMENT_SHADER_DERIVATIVE_HINT_OES:35723,COLOR_ATTACHMENT0_WEBGL:36064,COLOR_ATTACHMENT1_WEBGL:36065,COLOR_ATTACHMENT2_WEBGL:36066,COLOR_ATTACHMENT3_WEBGL:36067,COLOR_ATTACHMENT4_WEBGL:36068,COLOR_ATTACHMENT5_WEBGL:36069,COLOR_ATTACHMENT6_WEBGL:36070,COLOR_ATTACHMENT7_WEBGL:36071,COLOR_ATTACHMENT8_WEBGL:36072,COLOR_ATTACHMENT9_WEBGL:36073,COLOR_ATTACHMENT10_WEBGL:36074,COLOR_ATTACHMENT11_WEBGL:36075,COLOR_ATTACHMENT12_WEBGL:36076,COLOR_ATTACHMENT13_WEBGL:36077,COLOR_ATTACHMENT14_WEBGL:36078,COLOR_ATTACHMENT15_WEBGL:36079,DRAW_BUFFER0_WEBGL:34853,DRAW_BUFFER1_WEBGL:34854,DRAW_BUFFER2_WEBGL:34855,DRAW_BUFFER3_WEBGL:34856,DRAW_BUFFER4_WEBGL:34857,DRAW_BUFFER5_WEBGL:34858,DRAW_BUFFER6_WEBGL:34859,DRAW_BUFFER7_WEBGL:34860,DRAW_BUFFER8_WEBGL:34861,DRAW_BUFFER9_WEBGL:34862,DRAW_BUFFER10_WEBGL:34863,DRAW_BUFFER11_WEBGL:34864,DRAW_BUFFER12_WEBGL:34865,DRAW_BUFFER13_WEBGL:34866,DRAW_BUFFER14_WEBGL:34867,DRAW_BUFFER15_WEBGL:34868,MAX_COLOR_ATTACHMENTS_WEBGL:36063,MAX_DRAW_BUFFERS_WEBGL:34852,VERTEX_ARRAY_BINDING_OES:34229,QUERY_COUNTER_BITS_EXT:34916,CURRENT_QUERY_EXT:34917,QUERY_RESULT_EXT:34918,QUERY_RESULT_AVAILABLE_EXT:34919,TIME_ELAPSED_EXT:35007,TIMESTAMP_EXT:36392,GPU_DISJOINT_EXT:36795}},function(e,t,n){"use strict";n.r(t);var r={};function i(e){"epsilon"in e&&(r.EPSILON=e.epsilon),"debug"in e&&(r.debug=e.debug)}function o(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(e));return e}function a(e){return Math.round(e/r.EPSILON)*r.EPSILON}function s(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).precision,n=void 0===t?r.precision||4:t;return e=a(e),parseFloat(e.toPrecision(n))}function u(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&void 0!==e.length}function l(e){return e.clone?e.clone():new Array(e)}function c(e,t){if(u(e)){for(var n=l(e),r=0;r<n.length;++r)n[r]=t(n[r],r,n);return n}return t(e)}function f(e){return c(e,function(e){return e/180*Math.PI})}function h(e){return c(e,function(e){return 180*e/Math.PI})}function d(e){return c(e,function(e){return Math.sin(e)})}function p(e){return c(e,function(e){return Math.cos(e)})}function v(e){return c(e,function(e){return Math.tan(e)})}function g(e){return c(e,function(e){return Math.asin(e)})}function y(e){return c(e,function(e){return Math.acos(e)})}function _(e){return c(e,function(e){return Math.atan(e)})}function m(e,t,n){return c(e,function(e){return Math.max(t,Math.min(n,e))})}function b(e,t,n){return Array.isArray(e)?e.map(function(e,r){return b(e,t[r],n)}):n*t+(1-n)*e}function E(e,t){if(Array.isArray(e)&&Array.isArray(t)){if(e===t)return!0;if(e.length!==t.length)return!1;for(var n=0;n<e.length;++n)if(!E(e[n],t[n]))return!1;return!0}return Math.abs(e-t)<=r.EPSILON*Math.max(1,Math.abs(e),Math.abs(t))}function w(e){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function S(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function P(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function T(e,t){return!t||"object"!==w(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function A(e){function t(){var t=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(t,Object.getPrototypeOf(this)),t}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}r.EPSILON=1e-12,r.debug=!0,r.precision=4,r.printTypes=!1,r.printDegrees=!1,r.printRowMajor=!0;var x=function(e){function t(){return S(this,t),T(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}var n,i,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");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)}(t,A(Array)),n=t,(i=[{key:"clone",value:function(){return(new this.constructor).copy(this).check()}},{key:"copy",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]=e[t];return this.check()}},{key:"set",value:function(){for(var e=0;e<this.ELEMENTS;++e)this[e]=(e<0||arguments.length<=e?void 0:arguments[e])||0;return this.check()}},{key:"fromArray",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<this.ELEMENTS;++n)this[n]=e[n+t];return this.check()}},{key:"toString",value:function(){return this.formatString(r)}},{key:"formatString",value:function(e){for(var t="",n=0;n<this.ELEMENTS;++n)t+=(n>0?", ":"")+s(this[n],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(t,"]")}},{key:"toArray",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<this.ELEMENTS;++n)e[t+n]=this[n];return e}},{key:"toFloat32Array",value:function(){return new Float32Array(this)}},{key:"equals",value:function(e){if(!e||this.length!==e.length)return!1;for(var t=0;t<this.ELEMENTS;++t)if(!E(this[t],e[t]))return!1;return!0}},{key:"exactEquals",value:function(e){if(!e||this.length!==e.length)return!1;for(var t=0;t<this.ELEMENTS;++t)if(this[t]!==e[t])return!1;return!0}},{key:"negate",value:function(){for(var e=0;e<this.ELEMENTS;++e)this[e]=-this[e];return this.check()}},{key:"inverse",value:function(){for(var e=0;e<this.ELEMENTS;++e)this[e]=1/this[e];return this.check()}},{key:"lerp",value:function(e,t,n){void 0===n&&(n=t,t=e,e=this);for(var r=0;r<this.ELEMENTS;++r){var i=e[r];this[r]=i+n*(t[r]-i)}return this.check()}},{key:"min",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]=Math.min(e[t],this[t]);return this.check()}},{key:"max",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]=Math.max(e[t],this[t]);return this.check()}},{key:"clamp",value:function(e,t){for(var n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],e[n]),t[n]);return this.check()}},{key:"validate",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this,t=e&&e.length===this.ELEMENTS,n=0;n<this.ELEMENTS;++n)t=t&&Number.isFinite(e[n]);return t}},{key:"check",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;if(r.debug&&!this.validate(e))throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}},{key:"sub",value:function(e){return this.subtract(e)}},{key:"setScalar",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]=e;return this.check()}},{key:"addScalar",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]+=e;return this.check()}},{key:"subScalar",value:function(e){return this.addScalar(-e)}},{key:"multiplyScalar",value:function(e){return this.scale(e)}},{key:"divideScalar",value:function(e){return this.scale(1/e)}},{key:"clampScalar",value:function(e,t){for(var n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],e),t);return this.check()}}])&&P(n.prototype,i),o&&P(n,o),t}();function O(e){return(O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function R(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function C(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function k(e,t){return!t||"object"!==O(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}var M=function(e,t){if(!e)throw new Error(t)},I=function(e){function t(){return R(this,t),k(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}var n,r,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");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)}(t,x),n=t,(r=[{key:"len",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"magnitude",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"lengthSquared",value:function(){for(var e=0,t=0;t<this.ELEMENTS;++t)e+=this[t]*this[t];return e}},{key:"distance",value:function(e){return Math.sqrt(this.distanceSquared(e))}},{key:"distanceSquared",value:function(e){for(var t=0,n=0;n<this.ELEMENTS;++n){var r=this[n]-e[n];t+=r*r}return o(t)}},{key:"dot",value:function(e){for(var t=0,n=0;n<this.ELEMENTS;++n)t+=this[n]*e[n];return o(t)}},{key:"normalize",value:function(){var e=this.magnitude();if(0!==e)for(var t=0;t<this.ELEMENTS;++t)this[t]/=e;return this.check()}},{key:"add",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r=0;r<t.length;r++)for(var i=t[r],o=0;o<this.ELEMENTS;++o)this[o]+=i[o];return this.check()}},{key:"subtract",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r=0;r<t.length;r++)for(var i=t[r],o=0;o<this.ELEMENTS;++o)this[o]-=i[o];return this.check()}},{key:"multiply",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r=0;r<t.length;r++)for(var i=t[r],o=0;o<this.ELEMENTS;++o)this[o]*=i[o];return this.check()}},{key:"divide",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r=0;r<t.length;r++)for(var i=t[r],o=0;o<this.ELEMENTS;++o)this[o]/=i[o];return this.check()}},{key:"scale",value:function(e){if(Array.isArray(e))return this.multiply(e);for(var t=0;t<this.ELEMENTS;++t)this[t]*=e;return this.check()}},{key:"scaleAndAdd",value:function(e,t){for(var n=0;n<this.ELEMENTS;++n)this[n]=this[n]*t+e[n];return this.check()}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"distanceTo",value:function(e){return this.distance(e)}},{key:"distanceToSquared",value:function(e){return this.distanceSquared(e)}},{key:"getComponent",value:function(e){return M(e>=0&&e<this.ELEMENTS,"index is out of range"),o(this[e])}},{key:"setComponent",value:function(e,t){return M(e>=0&&e<this.ELEMENTS,"index is out of range"),this[e]=t,this.check()}},{key:"addVectors",value:function(e,t){return this.copy(e).add(t)}},{key:"subVectors",value:function(e,t){return this.copy(e).subtract(t)}},{key:"multiplyVectors",value:function(e,t){return this.copy(e).multiply(t)}},{key:"addScaledVector",value:function(e,t){return this.add(new this.constructor(e).multiplyScalar(t))}}])&&C(n.prototype,r),i&&C(n,i),t}(),L=n(114),N=n.n(L);function F(e){return(F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function j(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function D(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function B(e,t){return!t||"object"!==F(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}var U=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return j(this,t),e=B(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,r),e}var n,r,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");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)}(t,I),n=t,(r=[{key:"cross",value:function(e){return N()(this,this,e),this.check()}},{key:"horizontalAngle",value:function(){return Math.atan2(this.y,this.x)}},{key:"verticalAngle",value:function(){return Math.atan2(this.x,this.y)}},{key:"operation",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.apply(void 0,[this,this].concat(n)),this.check()}},{key:"ELEMENTS",get:function(){return 2}},{key:"x",get:function(){return this[0]},set:function(e){return this[0]=o(e)}},{key:"y",get:function(){return this[1]},set:function(e){return this[1]=o(e)}}])&&D(n.prototype,r),i&&D(n,i),t}(),G=n(113),V=n.n(G),z=n(50),X=n.n(z),W=n(112),H=n.n(W),Y=n(111),K=n.n(Y),Z=n(110),q=n.n(Z);function Q(e){return(Q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function J(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function $(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ee(e,t){return!t||"object"!==Q(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}var te=[0,0,0],ne=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return J(this,t),e=ee(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,r,i),e}var n,r,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");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)}(t,I),n=t,(r=[{key:"angle",value:function(e){return V()(this,e)}},{key:"cross",value:function(e){return X()(this,this,e),this.check()}},{key:"rotateX",value:function(e){var t=e.radians,n=e.origin,r=void 0===n?te:n;return H()(this,this,r,t),this.check()}},{key:"rotateY",value:function(e){var t=e.radians,n=e.origin,r=void 0===n?te:n;return K()(this,this,r,t),this.check()}},{key:"rotateZ",value:function(e){var t=e.radians,n=e.origin,r=void 0===n?te:n;return q()(this,this,r,t),this.check()}},{key:"operation",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.apply(void 0,[this,this].concat(n)),this.check()}},{key:"ELEMENTS",get:function(){return 3}},{key:"x",get:function(){return this[0]},set:function(e){return this[0]=o(e)}},{key:"y",get:function(){return this[1]},set:function(e){return this[1]=o(e)}},{key:"z",get:function(){return this[2]},set:function(e){return this[2]=o(e)}}])&&$(n.prototype,r),i&&$(n,i),t}();function re(e){return(re="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ie(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function oe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ae(e,t){return!t||"object"!==re(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}var se=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return ie(this,t),e=ae(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,r,i,o),e}var n,r,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");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)}(t,I),n=t,(r=[{key:"applyMatrix4",value:function(e){return e.transformVector(this,this),this}},{key:"ELEMENTS",get:function(){return 4}},{key:"x",get:function(){return this[0]},set:function(e){return this[0]=o(e)}},{key:"y",get:function(){return this[1]},set:function(e){return this[1]=o(e)}},{key:"z",get:function(){return this[2]},set:function(e){return this[2]=o(e)}},{key:"w",get:function(){return this[3]},set:function(e){return this[3]=o(e)}}])&&oe(n.prototype,r),i&&oe(n,i),t}(),ue=n(109),le=n.n(ue),ce=n(108),fe=n.n(ce),he=n(107),de=n.n(he),pe=n(18),ve=n.n(pe),ge=n(49),ye=n.n(ge),_e=n(17),me=n.n(_e),be=n(106),Ee=n.n(be),we=n(34),Se=n.n(we),Pe=n(13),Te=n.n(Pe),Ae=n(105),xe=n.n(Ae),Oe=n(16),Re=n.n(Oe),Ce=n(15),ke=n.n(Ce),Me=n(104),Ie=n.n(Me),Le=n(103),Ne=n.n(Le),Fe=n(9),je=n.n(Fe),De=n(27),Be=n.n(De),Ue=n(33),Ge=n.n(Ue),Ve=n(26),ze=n.n(Ve);function Xe(e){return(Xe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function We(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function He(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function Ye(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function Ke(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ze(e,t){return!t||"object"!==Xe(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}var qe=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function Qe(e,t){return e.length===t&&e.every(Number.isFinite)}var Je=function(e){function t(){for(var e,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ye(this,t),e=Ze(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),Array.isArray(r[0])&&1===arguments.length?e.copy(r[0]):e.identity(),e}var n,r,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");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)}(t,x),n=t,(r=[{key:"setRowMajor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,u=arguments.length>8&&void 0!==arguments[8]?arguments[8]:0,l=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,c=arguments.length>10&&void 0!==arguments[10]?arguments[10]:1,f=arguments.length>11&&void 0!==arguments[11]?arguments[11]:0,h=arguments.length>12&&void 0!==arguments[12]?arguments[12]:0,d=arguments.length>13&&void 0!==arguments[13]?arguments[13]:0,p=arguments.length>14&&void 0!==arguments[14]?arguments[14]:0,v=arguments.length>15&&void 0!==arguments[15]?arguments[15]:1;return this[0]=e,this[1]=i,this[2]=u,this[3]=h,this[4]=t,this[5]=o,this[6]=l,this[7]=d,this[8]=n,this[9]=a,this[10]=c,this[11]=p,this[12]=r,this[13]=s,this[14]=f,this[15]=v,this.check()}},{key:"setColumnMajor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,u=arguments.length>8&&void 0!==arguments[8]?arguments[8]:0,l=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,c=arguments.length>10&&void 0!==arguments[10]?arguments[10]:1,f=arguments.length>11&&void 0!==arguments[11]?arguments[11]:0,h=arguments.length>12&&void 0!==arguments[12]?arguments[12]:0,d=arguments.length>13&&void 0!==arguments[13]?arguments[13]:0,p=arguments.length>14&&void 0!==arguments[14]?arguments[14]:0,v=arguments.length>15&&void 0!==arguments[15]?arguments[15]:1;return this[0]=e,this[1]=t,this[2]=n,this[3]=r,this[4]=i,this[5]=o,this[6]=a,this[7]=s,this[8]=u,this[9]=l,this[10]=c,this[11]=f,this[12]=h,this[13]=d,this[14]=p,this[15]=v,this.check()}},{key:"copy",value:function(e){return this.setColumnMajor.apply(this,He(e))}},{key:"set",value:function(){return this.setColumnMajor.apply(this,arguments)}},{key:"getElement",value:function(e,t){return arguments.length>2&&void 0!==arguments[2]&&arguments[2]?this[e][t]:this[t][e]}},{key:"setElement",value:function(e,t,n){arguments.length>3&&void 0!==arguments[3]&&arguments[3];return this[t][e]=o(n),this}},{key:"determinant",value:function(){return le()(this)}},{key:"identity",value:function(){return this.copy(qe)}},{key:"fromQuaternion",value:function(e){return fe()(this,e),this.check()}},{key:"frustum",value:function(e){var t=e.left,n=e.right,r=e.bottom,i=e.top,o=e.near,a=e.far;return de()(this,t,n,r,i,o,a),this.check()}},{key:"lookAt",value:function(e){var t=e.eye,n=e.center,r=void 0===n?[0,0,0]:n,i=e.up,o=void 0===i?[0,1,0]:i;return ve()(this,t,r,o),this.check()}},{key:"ortho",value:function(e){var t=e.left,n=e.right,r=e.bottom,i=e.top,o=e.near,a=void 0===o?.1:o,s=e.far,u=void 0===s?500:s;return ye()(this,t,n,r,i,a,u),this.check()}},{key:"orthographic",value:function(e){var n=e.fovy,r=void 0===n?45*Math.PI/180:n,i=e.aspect,o=void 0===i?1:i,a=e.focalDistance,s=void 0===a?1:a,u=e.near,l=void 0===u?.1:u,c=e.far,f=void 0===c?500:c;if(r>2*Math.PI)throw Error("radians");var h=r/2,d=s*Math.tan(h),p=d*o;return(new t).ortho({left:-p,right:p,bottom:-d,top:d,near:l,far:f})}},{key:"perspective",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.fovy,n=e.fov,r=void 0===n?45*Math.PI/180:n,i=e.aspect,o=void 0===i?1:i,a=e.near,s=void 0===a?.1:a,u=e.far,l=void 0===u?500:u;if((t=t||r)>2*Math.PI)throw Error("radians");return me()(this,t,o,s,l),this.check()}},{key:"transpose",value:function(){return Ee()(this,this),this.check()}},{key:"invert",value:function(){return Se()(this,this),this.check()}},{key:"multiplyLeft",value:function(e){return Te()(this,e,this),this.check()}},{key:"multiplyRight",value:function(e){return Te()(this,this,e),this.check()}},{key:"rotateX",value:function(e){return Be()(this,this,e),this.check()}},{key:"rotateY",value:function(e){return Ge()(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return ze()(this,this,e),this.check()}},{key:"rotateXYZ",value:function(e){var t=We(e,3),n=t[0],r=t[1],i=t[2];return this.rotateX(n).rotateY(r).rotateZ(i)}},{key:"rotateAxis",value:function(e,t){return xe()(this,this,e,t),this.check()}},{key:"scale",value:function(e){return Re()(this,this,e),this.check()}},{key:"translate",value:function(e){return ke()(this,this,e),this.check()}},{key:"transformVector2",value:function(e,t){return t=t||new U,Ie()(t,e,this),Qe(t,2),t}},{key:"transformVector3",value:function(e,t){return t=t||new ne,Ne()(t,e,this),Qe(t,3),t}},{key:"transformVector4",value:function(e,t){return t=t||new se,je()(t,e,this),Qe(t,4),t.check()}},{key:"transformVector",value:function(e,t){switch(e.length){case 2:return this.transformVector2(e,t);case 3:return this.transformVector3(e,t);case 4:return this.transformVector4(e,t);default:throw new Error("Illegal vector")}}},{key:"transformDirection",value:function(e,t){return this._transformVector(e,t,0)}},{key:"transformPoint",value:function(e,t){return this._transformVector(e,t,1)}},{key:"_transformVector",value:function(e,t,n){switch(e.length){case 2:t=t||new U,je()(t,[e[0],e[1],0,n],this),t.length=2,Qe(t,2);break;case 3:t=t||new ne,je()(t,[e[0],e[1],e[2],n],this),t.length=3,Qe(t,3);break;case 4:if(Boolean(n)!==Boolean(e[3]))throw new Error("math.gl: Matrix4.transformPoint - invalid vector");t=t||new se,je()(t,e,this),Qe(t,4);break;default:throw new Error("Illegal vector")}return t}},{key:"makeRotationX",value:function(e){return this.identity().rotateX(e)}},{key:"makeTranslation",value:function(e,t,n){return this.identity().translate([e,t,n])}},{key:"ELEMENTS",get:function(){return 16}}])&&Ke(n.prototype,r),i&&Ke(n,i),t}(),$e=n(102),et=n.n($e),tt=n(101),nt=n.n(tt),rt=n(100),it=n.n(rt),ot=n(99),at=n.n(ot),st=n(98),ut=n.n(st),lt=n(97),ct=n.n(lt),ft=n(96),ht=n.n(ft),dt=n(95),pt=n.n(dt),vt=n(94),gt=n.n(vt),yt=n(93),_t=n.n(yt),mt=n(92),bt=n.n(mt),Et=n(91),wt=n.n(Et),St=n(47),Pt=n.n(St),Tt=n(90),At=n.n(Tt),xt=n(89),Ot=n.n(xt),Rt=n(88),Ct=n.n(Rt),kt=n(87),Mt=n.n(kt),It=n(86),Lt=n.n(It),Nt=n(46),Ft=n.n(Nt),jt=n(85),Dt=n.n(jt);function Bt(e){return(Bt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ut(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function Gt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Vt(e,t){return!t||"object"!==Bt(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}var zt=[0,0,0,1];var Xt=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return Ut(this,t),e=Vt(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,r,i,o),e}var n,r,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");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)}(t,x),n=t,(r=[{key:"fromMatrix3",value:function(e){return et()(this,e),this.check()}},{key:"fromValues",value:function(e,t,n,r){return this.set(e,t,n,r)}},{key:"identity",value:function(){return nt()(this),this.check()}},{key:"length",value:function(){return it()(this)}},{key:"squaredLength",value:function(e){return at()(this)}},{key:"dot",value:function(e,t){if(void 0!==t)throw new Error("Quaternion.dot only takes one argument");return ut()(this,e)}},{key:"rotationTo",value:function(e,t){return ct()(this,e,t),this.check()}},{key:"add",value:function(e,t){if(void 0!==t)throw new Error("Quaternion.add only takes one argument");return ht()(this,e),this.check()}},{key:"calculateW",value:function(){return pt()(this,this),this.check()}},{key:"conjugate",value:function(){return gt()(this,this),this.check()}},{key:"invert",value:function(){return _t()(this,this),this.check()}},{key:"lerp",value:function(e,t,n){return bt()(this,e,t,n),this.check()}},{key:"multiply",value:function(e,t){if(void 0!==t)throw new Error("Quaternion.multiply only takes one argument");return wt()(this,this,t),this.check()}},{key:"normalize",value:function(){return Pt()(this,this),this.check()}},{key:"rotateX",value:function(e){return At()(this,this,e),this.check()}},{key:"rotateY",value:function(e){return Ot()(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return Ct()(this,this,e),this.check()}},{key:"scale",value:function(e){return Mt()(this,this,e),this.check()}},{key:"set",value:function(e,t,n,r){return Lt()(this,e,t,n,r),this.check()}},{key:"setAxisAngle",value:function(e,t){return Ft()(this,e,t),this.check()}},{key:"slerp",value:function(e){var t=e.start,n=void 0===t?zt:t,r=e.target,i=e.ratio;return Dt()(this,n,r,i),this.check()}},{key:"ELEMENTS",get:function(){return 4}},{key:"x",get:function(){return this[0]},set:function(e){return this[0]=o(e)}},{key:"y",get:function(){return this[1]},set:function(e){return this[1]=o(e)}},{key:"z",get:function(){return this[2]},set:function(e){return this[2]=o(e)}},{key:"w",get:function(){return this[3]},set:function(e){return this[3]=o(e)}}])&&Gt(n.prototype,r),i&&Gt(n,i),t}(),Wt=n(48),Ht=n.n(Wt);function Yt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Kt(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function Zt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var qt=6371e3,Qt=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.phi,r=t.theta,i=t.radius,o=t.bearing,a=t.pitch,s=(t.altitude,t.radiusScale),u=void 0===s?qt:s;Kt(this,e),0===arguments.length?(this.phi=0,this.theta=0,this.radius=1):Number.isFinite(n)||Number.isFinite(r)?(this.phi=n||0,this.theta=r||0):(Number.isFinite(o)||Number.isFinite(a))&&(this.bearing=o||0,this.pitch=a||0),this.radius=i||1,this.radiusScale=u||1,this.check()}var t,n,i;return t=e,(n=[{key:"toString",value:function(){return this.formatString(r)}},{key:"formatString",value:function(e){var t=e.printTypes,n=(e.printDegrees,s);return"".concat(t?"Spherical":"","[rho:").concat(n(this.radius),",theta:").concat(n(this.theta),",phi:").concat(n(this.phi),"]")}},{key:"equals",value:function(e){return E(this.radius,e.radius)&&E(this.theta,e.theta)&&E(this.phi,e.phi)}},{key:"exactEquals",value:function(e){return this.radius===e.radius&&this.theta===e.theta&&this.phi===e.phi}},{key:"set",value:function(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this.check()}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this.check()}},{key:"fromLngLatZ",value:function(e){var t=Yt(e,3),n=t[0],r=t[1],i=t[2];this.radius=1+i/this.radiusScale,this.phi=f(r),this.theta=f(n)}},{key:"fromVector3",value:function(e){return this.radius=Ht()(e),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e[0],e[1]),this.phi=Math.acos(m(e[2]/this.radius,-1,1))),this.check()}},{key:"toVector3",value:function(){return new ne(0,0,this.radius).rotateX({radians:this.theta}).rotateZ({radians:this.phi})}},{key:"makeSafe",value:function(){this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi))}},{key:"check",value:function(){if(!(Number.isFinite(this.phi)&&Number.isFinite(this.theta)&&this.radius>0))throw new Error("SphericalCoordinates: some fields set to invalid numbers");return this}},{key:"bearing",get:function(){return 180-h(this.phi)},set:function(e){this.phi=Math.PI-f(e)}},{key:"pitch",get:function(){return h(this.theta)},set:function(e){this.theta=f(e)}},{key:"longitude",get:function(){return h(this.phi)}},{key:"latitude",get:function(){return h(this.theta)}},{key:"lng",get:function(){return h(this.phi)}},{key:"lat",get:function(){return h(this.theta)}},{key:"z",get:function(){return(this.radius-1)*this.radiusScale}}])&&Zt(t.prototype,n),i&&Zt(t,i),e}();function Jt(e){return(Jt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $t(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function en(e,t){return!t||"object"!==Jt(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function tn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function nn(e,t,n){return t&&tn(e.prototype,t),n&&tn(e,n),e}var rn="Unknown Euler angle order";var on=function(e){function t(){var e,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.DefaultOrder;($t(this,t),e=en(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),arguments.length>0&&Array.isArray(arguments[0]))?(n=e).fromVector3.apply(n,arguments):e.set(r,i,o,a);return e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");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)}(t,x),nn(t,[{key:"ELEMENTS",get:function(){return 4}}],[{key:"rotationOrder",value:function(e){return t.RotationOrders[e]}},{key:"ZYX",get:function(){return 0}},{key:"YXZ",get:function(){return 1}},{key:"XZY",get:function(){return 2}},{key:"ZXY",get:function(){return 3}},{key:"YZX",get:function(){return 4}},{key:"XYZ",get:function(){return 5}},{key:"RollPitchYaw",get:function(){return 0}},{key:"DefaultOrder",get:function(){return t.ZYX}},{key:"RotationOrders",get:function(){return["ZYX","YXZ","XZY","ZXY","YZX","XYZ"]}}]),nn(t,[{key:"copy",value:function(e){for(var t=0;t<3;++t)this[t]=e[t];return this[3]=Number.isFinite(e[3])||this.order,this.check()}},{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3?arguments[3]:void 0;return this[0]=e,this[1]=t,this[2]=n,this[3]=Number.isFinite(r)?r:this[3],this.check()}},{key:"validate",value:function(){return(e=this[3])>=0&&e<6&&Number.isFinite(this[0])&&Number.isFinite(this[1])&&Number.isFinite(this[2]);var e}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this[0],e[t+1]=this[1],e[t+2]=this[2],e}},{key:"toArray4",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this[0],e[t+1]=this[1],e[t+2]=this[2],e[t+3]=this[3],e}},{key:"toVector3",value:function(e){return e?e.set(this[0],this[1],this[2]):new ne(this[0],this[1],this[2])}},{key:"fromVector3",value:function(e,t){return this.set(e[0],e[1],e[2],Number.isFinite(t)?t:this[3])}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this[0]=e[0+t],this[1]=e[1+t],this[2]=e[2+t],void 0!==e[3]&&(this[3]=e[3]),this.check()}},{key:"fromRollPitchYaw",value:function(e,n,r){return this.set(e,n,r,t.ZYX)}},{key:"fromQuaternion",value:function(e,t){return this._fromRotationMatrix(Je.fromQuaternion(e),t),this.check()}},{key:"fromRotationMatrix",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.DefaultOrder;return this._fromRotationMatrix(e,n),this.check()}},{key:"getRotationMatrix",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Je;return this._getRotationMatrix(e),e}},{key:"getQuaternion",value:function(){var e=new Xt;switch(this[4]){case t.XYZ:return e.rotateX(this[0]).rotateY(this[1]).rotateZ(this[2]);case t.YXZ:return e.rotateY(this[0]).rotateX(this[1]).rotateZ(this[2]);case t.ZXY:return e.rotateZ(this[0]).rotateX(this[1]).rotateY(this[2]);case t.ZYX:return e.rotateZ(this[0]).rotateY(this[1]).rotateX(this[2]);case t.YZX:return e.rotateY(this[0]).rotateZ(this[1]).rotateX(this[2]);case t.XZY:return e.rotateX(this[0]).rotateZ(this[1]).rotateY(this[2]);default:throw new Error(rn)}}},{key:"_fromRotationMatrix",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.DefaultOrder,r=e.elements,i=r[0],o=r[4],a=r[8],s=r[1],u=r[5],l=r[9],c=r[2],f=r[6],h=r[10];switch(n=n||this[3]){case t.XYZ:this[1]=Math.asin(m(a,-1,1)),Math.abs(a)<.99999?(this[0]=Math.atan2(-l,h),this[2]=Math.atan2(-o,i)):(this[0]=Math.atan2(f,u),this[2]=0);break;case t.YXZ:this[0]=Math.asin(-m(l,-1,1)),Math.abs(l)<.99999?(this[1]=Math.atan2(a,h),this[2]=Math.atan2(s,u)):(this[1]=Math.atan2(-c,i),this[2]=0);break;case t.ZXY:this[0]=Math.asin(m(f,-1,1)),Math.abs(f)<.99999?(this[1]=Math.atan2(-c,h),this[2]=Math.atan2(-o,u)):(this[1]=0,this[2]=Math.atan2(s,i));break;case t.ZYX:this[1]=Math.asin(-m(c,-1,1)),Math.abs(c)<.99999?(this[0]=Math.atan2(f,h),this[2]=Math.atan2(s,i)):(this[0]=0,this[2]=Math.atan2(-o,u));break;case t.YZX:this[2]=Math.asin(m(s,-1,1)),Math.abs(s)<.99999?(this[0]=Math.atan2(-l,u),this[1]=Math.atan2(-c,i)):(this[0]=0,this[1]=Math.atan2(a,h));break;case t.XZY:this[2]=Math.asin(-m(o,-1,1)),Math.abs(o)<.99999?(this[0]=Math.atan2(f,u),this[1]=Math.atan2(a,i)):(this[0]=Math.atan2(-l,h),this[1]=0);break;default:throw new Error(rn)}return this[3]=n,this}},{key:"_getRotationMatrix",value:function(){var e=new Je,n=this.x,r=this.y,i=this.z,o=Math.cos(n),a=Math.cos(r),s=Math.cos(i),u=Math.sin(n),l=Math.sin(r),c=Math.sin(i);switch(this[3]){case t.XYZ:var f=o*s,h=o*c,d=u*s,p=u*c;e[0]=a*s,e[4]=-a*c,e[8]=l,e[1]=h+d*l,e[5]=f-p*l,e[9]=-u*a,e[2]=p-f*l,e[6]=d+h*l,e[10]=o*a;break;case t.YXZ:var v=a*s,g=a*c,y=l*s,_=l*c;e[0]=v+_*u,e[4]=y*u-g,e[8]=o*l,e[1]=o*c,e[5]=o*s,e[9]=-u,e[2]=g*u-y,e[6]=_+v*u,e[10]=o*a;break;case t.ZXY:var m=a*s,b=a*c,E=l*s,w=l*c;e[0]=m-w*u,e[4]=-o*c,e[8]=E+b*u,e[1]=b+E*u,e[5]=o*s,e[9]=w-m*u,e[2]=-o*l,e[6]=u,e[10]=o*a;break;case t.ZYX:var S=o*s,P=o*c,T=u*s,A=u*c;e[0]=a*s,e[4]=T*l-P,e[8]=S*l+A,e[1]=a*c,e[5]=A*l+S,e[9]=P*l-T,e[2]=-l,e[6]=u*a,e[10]=o*a;break;case t.YZX:var x=o*a,O=o*l,R=u*a,C=u*l;e[0]=a*s,e[4]=C-x*c,e[8]=R*c+O,e[1]=c,e[5]=o*s,e[9]=-u*s,e[2]=-l*s,e[6]=O*c+R,e[10]=x-C*c;break;case t.XZY:var k=o*a,M=o*l,I=u*a,L=u*l;e[0]=a*s,e[4]=-c,e[8]=l*s,e[1]=k*c+L,e[5]=o*s,e[9]=M*c-I,e[2]=I*c-M,e[6]=u*s,e[10]=L*c+k;break;default:throw new Error(rn)}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}},{key:"x",get:function(){return this[0]},set:function(e){return this[0]=o(e)}},{key:"y",get:function(){return this[1]},set:function(e){return this[1]=o(e)}},{key:"z",get:function(){return this[2]},set:function(e){return this[2]=o(e)}},{key:"alpha",get:function(){return this[0]},set:function(e){return this[0]=o(e)}},{key:"beta",get:function(){return this[1]},set:function(e){return this[1]=o(e)}},{key:"gamma",get:function(){return this[2]},set:function(e){return this[2]=o(e)}},{key:"phi",get:function(){return this[0]},set:function(e){return this[0]=o(e)}},{key:"theta",get:function(){return this[1]},set:function(e){return this[1]=o(e)}},{key:"psi",get:function(){return this[2]},set:function(e){return this[2]=o(e)}},{key:"roll",get:function(){return this[0]},set:function(e){return this[0]=o(e)}},{key:"pitch",get:function(){return this[1]},set:function(e){return this[1]=o(e)}},{key:"yaw",get:function(){return this[2]},set:function(e){return this[2]=o(e)}},{key:"order",get:function(){return this[3]},set:function(e){return this[3]=function(e){if(e<0&&e>=6)throw new Error(rn);return e}(e)}}]),t}();function an(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function sn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var un=function(){function e(t){var n=t.x,r=void 0===n?0:n,i=t.y,o=void 0===i?0:i,a=t.z,s=void 0===a?0:a,u=t.roll,l=void 0===u?0:u,c=t.pitch,f=void 0===c?0:c,h=t.yaw,d=void 0===h?0:h;an(this,e),this.position=new ne(r,o,s),this.orientation=new on(l,f,d,on.RollPitchYaw)}var t,n,r;return t=e,(n=[{key:"getPosition",value:function(){return this.position}},{key:"getOrientation",value:function(){return this.orientation}},{key:"getTransformationMatrix",value:function(){var e=Math.sin(this.roll),t=Math.sin(this.pitch),n=Math.sin(this.yaw),r=Math.cos(this.roll),i=Math.cos(this.pitch),o=Math.cos(this.yaw);return(new Je).setRowMajor(o*i,-n*r+o*t*e,n*e+o*t*r,this.x,n*i,o*r+n*t*e,-o*e+n*t*r,this.y,-t,i*e,i*r,this.z,0,0,0,1)}},{key:"getTransformationMatrixFromPose",value:function(e){return(new Je).multiplyRight(this.getTransformationMatrix()).multiplyRight(e.getTransformationMatrix().invert())}},{key:"getTransformationMatrixToPose",value:function(e){return(new Je).multiplyRight(e.getTransformationMatrix()).multiplyRight(this.getTransformationMatrix().invert())}},{key:"x",get:function(){return this.position.x},set:function(e){return this.position.x=e}},{key:"y",get:function(){return this.position.y},set:function(e){return this.position.y=e}},{key:"z",get:function(){return this.position.z},set:function(e){return this.position.z=e}},{key:"roll",get:function(){return this.orientation.roll},set:function(e){return this.orientation.roll=e}},{key:"pitch",get:function(){return this.orientation.pitch},set:function(e){return this.orientation.pitch=e}},{key:"yaw",get:function(){return this.orientation.yaw},set:function(e){return this.orientation.yaw=e}}])&&sn(t.prototype,n),r&&sn(t,r),e}();function ln(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function cn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var fn=function(){function e(t){ln(this,e),this.points=t,this.isClosed=E(this.points[this.points.length-1],this.points[0]),Object.freeze(this)}var t,n,r;return t=e,(n=[{key:"getSignedArea",value:function(){var e=0;return this.forEachSegment(function(t,n){e+=(t[0]+n[0])*(t[1]-n[1])}),e/2}},{key:"getArea",value:function(){return Math.abs(this.getSignedArea())}},{key:"getWindingDirection",value:function(){return Math.sign(this.getSignedArea())}},{key:"forEachSegment",value:function(e){for(var t=this.points.length,n=0;n<t-1;n++)e(this.points[n],this.points[n+1],n,n+1);this.isPolygon&&!this.isClosed()&&e(this.points[t-1],this.points[0],t-1,0)}}])&&cn(t.prototype,n),r&&cn(t,r),e}();n.d(t,"experimental",function(){return hn}),n.d(t,"Vector2",function(){return U}),n.d(t,"Vector3",function(){return ne}),n.d(t,"Vector4",function(){return se}),n.d(t,"Matrix4",function(){return Je}),n.d(t,"Quaternion",function(){return Xt}),n.d(t,"config",function(){return r}),n.d(t,"checkNumber",function(){return o}),n.d(t,"configure",function(){return i}),n.d(t,"formatValue",function(){return s}),n.d(t,"isArray",function(){return u}),n.d(t,"clone",function(){return l}),n.d(t,"radians",function(){return f}),n.d(t,"degrees",function(){return h}),n.d(t,"sin",function(){return d}),n.d(t,"cos",function(){return p}),n.d(t,"tan",function(){return v}),n.d(t,"asin",function(){return g}),n.d(t,"acos",function(){return y}),n.d(t,"atan",function(){return _}),n.d(t,"clamp",function(){return m}),n.d(t,"lerp",function(){return b}),n.d(t,"equals",function(){return E});var hn={SphericalCoordinates:Qt,Euler:on,Pose:un,Polygon:fn}},function(e,t,n){"use strict";n.r(t);var r=n(8);function i(e){return"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame(e):setTimeout(e,1e3/60)}function o(e){return"undefined"!=typeof window&&window.cancelAnimationFrame?window.cancelAnimationFrame(e):clearTimeout(e)}var a=35632,s=35633;function u(e){var t=e.match(/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/);return t?t[1]:"unnamed"}function l(e,t,n){for(var r=e.split(/\r?\n/),i={},o={},l=u(t)||"(unnamed)",h="".concat(function(e){switch(e){case a:return"fragment";case s:return"vertex";default:return"unknown type"}}(n)," shader ").concat(l),d=0;d<r.length;d++){var p=r[d];if(!(p.length<=1)){var v=p.split(":"),g=v[0],y=parseInt(v[2],10);if(isNaN(y))throw new Error("GLSL compilation error in ".concat(h,": ").concat(e));"WARNING"!==g?i[y]=p:o[y]=p}}var _=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:": ",r=e.split(/\r?\n/),i=String(r.length+t-1).length;return r.map(function(e,r){var o=r+t,a=String(o).length,s=f(o,i-a);return s+n+e})}(t);return{shaderName:h,errors:c(i,_),warnings:c(o,_)}}function c(e,t){for(var n="",r=0;r<t.length;r++){var i=t[r];if((e[r+3]||e[r+2]||e[r+1])&&(n+="".concat(i,"\n"),e[r+1])){var o=e[r+1],a=o.split(":",3),s=a[0],u=parseInt(a[1],10)||0,l=o.substring(a.join(":").length+1).trim();n+=f("^^^ ".concat(s,": ").concat(l,"\n\n"),u)}}return n}function f(e,t){for(var n="",r=0;r<t;++r)n+=" ";return"".concat(n).concat(e)}var h=5120,d=5121,p=5122,v=5123,g=5124,y=5125,_=5126,m=32819,b=32820,E=33635,w="Failed to deduce GL constant from typed array";function S(e){switch(ArrayBuffer.isView(e)?e.constructor:e){case Float32Array:return _;case Uint16Array:return v;case Uint32Array:return y;case Uint8Array:case Uint8ClampedArray:return d;case Int8Array:return h;case Int16Array:return p;case Int32Array:return g;default:throw new Error(w)}}function P(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).clamped,n=void 0===t||t;switch(e){case _:return Float32Array;case v:case E:case m:case b:return Uint16Array;case y:return Uint32Array;case d:return n?Uint8ClampedArray:Uint8Array;case h:return Int8Array;case p:return Int16Array;case g:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}function T(e){for(var t=e.data,n=e.width,r=e.height,i=Math.round(n/2),o=Math.round(r/2),a=new Uint8Array(i*o*4),s=0;s<o;s++)for(var u=0;u<i;u++)for(var l=0;l<4;l++)a[4*(s*i+u)+l]=t[4*(2*s*n+2*u)+l];return{data:a,width:i,height:o}}function A(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}function x(e,t){if("string"!=typeof t)return t;var n=Number(t);if(!isNaN(n))return n;var r=e[t=t.replace(/^.*\./,"")];return A(void 0!==r,"Accessing undefined constant GL.".concat(t)),r}function O(e,t){for(var n in t=Number(t),e)if(e[n]===t)return"gl.".concat(n);return String(t)}var R=n(0),C=n.n(R);function k(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?t[Symbol.hasInstance](e):e instanceof t}var M=34962,I=32874,L="Invalid WebGLRenderingContext",N="Requires WebGL2";function F(e){return Boolean(e&&(k(e,r.c)||e.ARRAY_BUFFER===M))}function j(e){return Boolean(e&&(k(e,r.a)||e.TEXTURE_BINDING_3D===I))}function D(e){A(F(e),L)}function B(e){A(j(e),N)}var U=n(35),G=n(10),V=n(4);var z={};function X(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id";z[e]=z[e]||1;var t=z[e]++;return"".concat(e,"-").concat(t)}function W(e){return A("number"==typeof e,"Input must be a number"),e&&0==(e&e-1)}function H(e){var t=!0;for(var n in e){t=!1;break}return t}var Y=n(29);function K(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.isInteger,r=void 0!==n&&n;if(Array.isArray(e)||ArrayBuffer.isView(e))return function(e,t){for(var n=t.maxElts,r=void 0===n?16:n,i=t.size,o=void 0===i?1:i,a="[",s=0;s<e.length&&s<r;++s)s>0&&(a+=",".concat(s%o==0?" ":"")),a+=K(e[s],t);var u=e.length>r?"...":"]";return"".concat(a).concat(u)}(e,t);if(!Number.isFinite(e))return String(e);if(Math.abs(e)<1e-16)return r?"0":"0.";if(r)return e.toFixed(0);if(Math.abs(e)>100&&Math.abs(e)<1e4)return e.toFixed(0);var i=e.toPrecision(2);return i.indexOf(".0")===i.length-2?i.slice(0,-1):i}var Z,q,Q,J=G.a&&"undefined"!=typeof document,$=J&&"complete"===document.readyState,ee=J?new Promise(function(e,t){$?e(document):window.onload=function(){$=!0,e(document)}}):Promise.resolve({});function te(){return ee}function ne(e){var t=e.width,n=void 0===t?800:t,r=e.height,i=void 0===r?600:r,o=e.id,a=void 0===o?"gl-canvas":o,s=e.insert,u=void 0===s||s,l=document.createElement("canvas");return l.id=a,l.style.width=Number.isFinite(n)?"".concat(n,"px"):"100%",l.style.height=Number.isFinite(i)?"".concat(i,"px"):"100%",u&&te().then(function(e){var t=e.body;t.insertBefore(l,t.firstChild)}),l}function re(e){var t=e.onContextCreate,n=void 0===t?function(){return null}:t,r=e.onContextCreated,i=void 0===r?function(){}:r;if(A(n||i),"undefined"!=typeof HTMLCanvasElement){var o=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=function(e,t){var r,a,s;return"webgl"===e&&(r=n({canvas:this,type:e,opts:t,getContext:o.bind(this)})),r=r||o.call(this,e,t),a=r,(null!=(s=WebGLRenderingContext)&&"undefined"!=typeof Symbol&&s[Symbol.hasInstance]?s[Symbol.hasInstance](a):a instanceof s)&&i({canvas:this,context:r,type:e,opts:t}),r}}}function ie(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function oe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ae,se=(oe(Z={},C.a.BLEND,!1),oe(Z,C.a.BLEND_COLOR,new Float32Array([0,0,0,0])),oe(Z,C.a.BLEND_EQUATION_RGB,C.a.FUNC_ADD),oe(Z,C.a.BLEND_EQUATION_ALPHA,C.a.FUNC_ADD),oe(Z,C.a.BLEND_SRC_RGB,C.a.ONE),oe(Z,C.a.BLEND_DST_RGB,C.a.ZERO),oe(Z,C.a.BLEND_SRC_ALPHA,C.a.ONE),oe(Z,C.a.BLEND_DST_ALPHA,C.a.ZERO),oe(Z,C.a.COLOR_CLEAR_VALUE,new Float32Array([0,0,0,0])),oe(Z,C.a.COLOR_WRITEMASK,[!0,!0,!0,!0]),oe(Z,C.a.CULL_FACE,!1),oe(Z,C.a.CULL_FACE_MODE,C.a.BACK),oe(Z,C.a.DEPTH_TEST,!1),oe(Z,C.a.DEPTH_CLEAR_VALUE,1),oe(Z,C.a.DEPTH_FUNC,C.a.LESS),oe(Z,C.a.DEPTH_RANGE,new Float32Array([0,1])),oe(Z,C.a.DEPTH_WRITEMASK,!0),oe(Z,C.a.DITHER,!0),oe(Z,C.a.FRAMEBUFFER_BINDING,null),oe(Z,C.a.FRONT_FACE,C.a.CCW),oe(Z,C.a.GENERATE_MIPMAP_HINT,C.a.DONT_CARE),oe(Z,C.a.LINE_WIDTH,1),oe(Z,C.a.POLYGON_OFFSET_FILL,!1),oe(Z,C.a.POLYGON_OFFSET_FACTOR,0),oe(Z,C.a.POLYGON_OFFSET_UNITS,0),oe(Z,C.a.SAMPLE_COVERAGE_VALUE,1),oe(Z,C.a.SAMPLE_COVERAGE_INVERT,!1),oe(Z,C.a.SCISSOR_TEST,!1),oe(Z,C.a.SCISSOR_BOX,new Int32Array([0,0,1024,1024])),oe(Z,C.a.STENCIL_TEST,!1),oe(Z,C.a.STENCIL_CLEAR_VALUE,0),oe(Z,C.a.STENCIL_WRITEMASK,4294967295),oe(Z,C.a.STENCIL_BACK_WRITEMASK,4294967295),oe(Z,C.a.STENCIL_FUNC,C.a.ALWAYS),oe(Z,C.a.STENCIL_REF,0),oe(Z,C.a.STENCIL_VALUE_MASK,4294967295),oe(Z,C.a.STENCIL_BACK_FUNC,C.a.ALWAYS),oe(Z,C.a.STENCIL_BACK_REF,0),oe(Z,C.a.STENCIL_BACK_VALUE_MASK,4294967295),oe(Z,C.a.STENCIL_FAIL,C.a.KEEP),oe(Z,C.a.STENCIL_PASS_DEPTH_FAIL,C.a.KEEP),oe(Z,C.a.STENCIL_PASS_DEPTH_PASS,C.a.KEEP),oe(Z,C.a.STENCIL_BACK_FAIL,C.a.KEEP),oe(Z,C.a.STENCIL_BACK_PASS_DEPTH_FAIL,C.a.KEEP),oe(Z,C.a.STENCIL_BACK_PASS_DEPTH_PASS,C.a.KEEP),oe(Z,C.a.VIEWPORT,new Int32Array([0,0,1024,1024])),oe(Z,C.a.PACK_ALIGNMENT,4),oe(Z,C.a.UNPACK_ALIGNMENT,4),oe(Z,C.a.UNPACK_FLIP_Y_WEBGL,!1),oe(Z,C.a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),oe(Z,C.a.UNPACK_COLORSPACE_CONVERSION_WEBGL,C.a.BROWSER_DEFAULT_WEBGL),oe(Z,C.a.FRAGMENT_SHADER_DERIVATIVE_HINT,C.a.DONT_CARE),oe(Z,C.a.READ_FRAMEBUFFER_BINDING,null),oe(Z,C.a.RASTERIZER_DISCARD,!1),oe(Z,C.a.PACK_ROW_LENGTH,0),oe(Z,C.a.PACK_SKIP_PIXELS,0),oe(Z,C.a.PACK_SKIP_ROWS,0),oe(Z,C.a.UNPACK_ROW_LENGTH,0),oe(Z,C.a.UNPACK_IMAGE_HEIGHT,0),oe(Z,C.a.UNPACK_SKIP_PIXELS,0),oe(Z,C.a.UNPACK_SKIP_ROWS,0),oe(Z,C.a.UNPACK_SKIP_IMAGES,0),Z),ue=function(e,t,n){return t?e.enable(n):e.disable(n)},le=function(e,t,n){return e.hint(n,t)},ce=function(e,t,n){return e.pixelStorei(n,t)},fe=(oe(q={},C.a.BLEND,ue),oe(q,C.a.BLEND_COLOR,function(e,t){return e.blendColor.apply(e,ie(t))}),oe(q,C.a.BLEND_EQUATION_RGB,"blendEquation"),oe(q,C.a.BLEND_EQUATION_ALPHA,"blendEquation"),oe(q,C.a.BLEND_SRC_RGB,"blendFunc"),oe(q,C.a.BLEND_DST_RGB,"blendFunc"),oe(q,C.a.BLEND_SRC_ALPHA,"blendFunc"),oe(q,C.a.BLEND_DST_ALPHA,"blendFunc"),oe(q,C.a.COLOR_CLEAR_VALUE,function(e,t){return e.clearColor.apply(e,ie(t))}),oe(q,C.a.COLOR_WRITEMASK,function(e,t){return e.colorMask.apply(e,ie(t))}),oe(q,C.a.CULL_FACE,ue),oe(q,C.a.CULL_FACE_MODE,function(e,t){return e.cullFace(t)}),oe(q,C.a.DEPTH_TEST,ue),oe(q,C.a.DEPTH_CLEAR_VALUE,function(e,t){return e.clearDepth(t)}),oe(q,C.a.DEPTH_FUNC,function(e,t){return e.depthFunc(t)}),oe(q,C.a.DEPTH_RANGE,function(e,t){return e.depthRange.apply(e,ie(t))}),oe(q,C.a.DEPTH_WRITEMASK,function(e,t){return e.depthMask(t)}),oe(q,C.a.DITHER,ue),oe(q,C.a.FRAGMENT_SHADER_DERIVATIVE_HINT,le),oe(q,C.a.FRAMEBUFFER_BINDING,function(e,t){var n=j(e)?C.a.DRAW_FRAMEBUFFER:C.a.FRAMEBUFFER;return e.bindFramebuffer(n,t)}),oe(q,C.a.FRONT_FACE,function(e,t){return e.frontFace(t)}),oe(q,C.a.GENERATE_MIPMAP_HINT,le),oe(q,C.a.LINE_WIDTH,function(e,t){return e.lineWidth(t)}),oe(q,C.a.POLYGON_OFFSET_FILL,ue),oe(q,C.a.POLYGON_OFFSET_FACTOR,"polygonOffset"),oe(q,C.a.POLYGON_OFFSET_UNITS,"polygonOffset"),oe(q,C.a.RASTERIZER_DISCARD,ue),oe(q,C.a.SAMPLE_COVERAGE_VALUE,"sampleCoverage"),oe(q,C.a.SAMPLE_COVERAGE_INVERT,"sampleCoverage"),oe(q,C.a.SCISSOR_TEST,ue),oe(q,C.a.SCISSOR_BOX,function(e,t){return e.scissor.apply(e,ie(t))}),oe(q,C.a.STENCIL_TEST,ue),oe(q,C.a.STENCIL_CLEAR_VALUE,function(e,t){return e.clearStencil(t)}),oe(q,C.a.STENCIL_WRITEMASK,function(e,t){return e.stencilMaskSeparate(C.a.FRONT,t)}),oe(q,C.a.STENCIL_BACK_WRITEMASK,function(e,t){return e.stencilMaskSeparate(C.a.BACK,t)}),oe(q,C.a.STENCIL_FUNC,"stencilFuncFront"),oe(q,C.a.STENCIL_REF,"stencilFuncFront"),oe(q,C.a.STENCIL_VALUE_MASK,"stencilFuncFront"),oe(q,C.a.STENCIL_BACK_FUNC,"stencilFuncBack"),oe(q,C.a.STENCIL_BACK_REF,"stencilFuncBack"),oe(q,C.a.STENCIL_BACK_VALUE_MASK,"stencilFuncBack"),oe(q,C.a.STENCIL_FAIL,"stencilOpFront"),oe(q,C.a.STENCIL_PASS_DEPTH_FAIL,"stencilOpFront"),oe(q,C.a.STENCIL_PASS_DEPTH_PASS,"stencilOpFront"),oe(q,C.a.STENCIL_BACK_FAIL,"stencilOpBack"),oe(q,C.a.STENCIL_BACK_PASS_DEPTH_FAIL,"stencilOpBack"),oe(q,C.a.STENCIL_BACK_PASS_DEPTH_PASS,"stencilOpBack"),oe(q,C.a.VIEWPORT,function(e,t){return e.viewport.apply(e,ie(t))}),oe(q,C.a.PACK_ALIGNMENT,ce),oe(q,C.a.UNPACK_ALIGNMENT,ce),oe(q,C.a.UNPACK_FLIP_Y_WEBGL,ce),oe(q,C.a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ce),oe(q,C.a.UNPACK_COLORSPACE_CONVERSION_WEBGL,ce),oe(q,C.a.PACK_ROW_LENGTH,ce),oe(q,C.a.PACK_SKIP_PIXELS,ce),oe(q,C.a.PACK_SKIP_ROWS,ce),oe(q,C.a.READ_FRAMEBUFFER_BINDING,function(e,t){return e.bindFramebuffer(C.a.READ_FRAMEBUFFER,t)}),oe(q,C.a.UNPACK_ROW_LENGTH,ce),oe(q,C.a.UNPACK_IMAGE_HEIGHT,ce),oe(q,C.a.UNPACK_SKIP_PIXELS,ce),oe(q,C.a.UNPACK_SKIP_ROWS,ce),oe(q,C.a.UNPACK_SKIP_IMAGES,ce),q),he={blendEquation:function(e,t){return e.blendEquationSeparate(t[C.a.BLEND_EQUATION_RGB],t[C.a.BLEND_EQUATION_ALPHA])},blendFunc:function(e,t){return e.blendFuncSeparate(t[C.a.BLEND_SRC_RGB],t[C.a.BLEND_DST_RGB],t[C.a.BLEND_SRC_ALPHA],t[C.a.BLEND_DST_ALPHA])},polygonOffset:function(e,t){return e.polygonOffset(t[C.a.POLYGON_OFFSET_FACTOR],t[C.a.POLYGON_OFFSET_UNITS])},sampleCoverage:function(e,t){return e.sampleCoverage(t[C.a.SAMPLE_COVERAGE_VALUE],t[C.a.SAMPLE_COVERAGE_INVERT])},stencilFuncFront:function(e,t){return e.stencilFuncSeparate(C.a.FRONT,t[C.a.STENCIL_FUNC],t[C.a.STENCIL_REF],t[C.a.STENCIL_VALUE_MASK])},stencilFuncBack:function(e,t){return e.stencilFuncSeparate(C.a.BACK,t[C.a.STENCIL_BACK_FUNC],t[C.a.STENCIL_BACK_REF],t[C.a.STENCIL_BACK_VALUE_MASK])},stencilOpFront:function(e,t){return e.stencilOpSeparate(C.a.FRONT,t[C.a.STENCIL_FAIL],t[C.a.STENCIL_PASS_DEPTH_FAIL],t[C.a.STENCIL_PASS_DEPTH_PASS])},stencilOpBack:function(e,t){return e.stencilOpSeparate(C.a.BACK,t[C.a.STENCIL_BACK_FAIL],t[C.a.STENCIL_BACK_PASS_DEPTH_FAIL],t[C.a.STENCIL_BACK_PASS_DEPTH_PASS])}},de=function(e,t){return e.isEnabled(t)},pe=(oe(Q={},C.a.BLEND,de),oe(Q,C.a.CULL_FACE,de),oe(Q,C.a.DEPTH_TEST,de),oe(Q,C.a.DITHER,de),oe(Q,C.a.POLYGON_OFFSET_FILL,de),oe(Q,C.a.SAMPLE_ALPHA_TO_COVERAGE,de),oe(Q,C.a.SAMPLE_COVERAGE,de),oe(Q,C.a.SCISSOR_TEST,de),oe(Q,C.a.STENCIL_TEST,de),oe(Q,C.a.RASTERIZER_DISCARD,de),Q),ve=function(e,t){if(e===t)return!0;var n=Array.isArray(e)||ArrayBuffer.isView(e),r=Array.isArray(t)||ArrayBuffer.isView(t);if(n&&r&&e.length===t.length){for(var i=0;i<e.length;++i)if(e[i]!==t[i])return!1;return!0}return!1};function ge(e,t,n){var r=pe[t],i=r?r(e,Number(t)):e.getParameter(Number(t)),o=fe[t];return A("function"==typeof o),o(e,n,Number(t)),i}function ye(e,t){var n={};for(var r in t){var i=Number(r),o=fe[r];o&&("string"==typeof o?n[o]=!0:o(e,t[r],i))}var a=e.state&&e.state.cache;if(a){var s=Object.assign({},a,t);for(var u in n){(0,he[u])(e,s)}}}function _e(e,t){var n=pe[t];return n?n(e,Number(t)):e.getParameter(Number(t))}function me(e,t){t=t||se;var n=Array.isArray(t)?t:Object.keys(t),r={},i=!0,o=!1,a=void 0;try{for(var s,u=n[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var l=s.value;r[l]=_e(e,l)}}catch(e){o=!0,a=e}finally{try{i||null==u.return||u.return()}finally{if(o)throw a}}return r}function be(e){ye(e,Object.assign({},se,{}))}function Ee(e){var t=me(se),n={};for(var r in se)ve(t[r],se[r])||(n[r]=t[r]);return n}function we(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Se,Pe=function(e){return Ae(e)?void 0:0},Te=(we(ae={},C.a.READ_BUFFER,function(e){return Ae(e)?void 0:C.a.COLOR_ATTACHMENT0}),we(ae,35723,function(e){return Ae(e)?void 0:4352}),we(ae,C.a.RASTERIZER_DISCARD,Pe),we(ae,C.a.SAMPLES,Pe),we(ae,36795,function(e,t){var n=Ae(e)?e.getExtension("EXT_disjoint_timer_query_webgl2"):e.getExtension("EXT_disjoint_timer_query");return n&&n.GPU_DISJOINT_EXT?t(n.GPU_DISJOINT_EXT):0}),we(ae,37445,function(e,t){var n=e.getExtension("WEBGL_debug_renderer_info");return t(n&&n.UNMASKED_VENDOR_WEBGL||C.a.VENDOR)}),we(ae,37446,function(e,t){var n=e.getExtension("WEBGL_debug_renderer_info");return t(n&&n.UNMASKED_RENDERER_WEBGL||C.a.RENDERER)}),we(ae,34047,function(e,t){var n=e.luma.extensions.EXT_texture_filter_anisotropic;return n?t(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1}),we(ae,C.a.MAX_3D_TEXTURE_SIZE,Pe),we(ae,C.a.MAX_ARRAY_TEXTURE_LAYERS,Pe),we(ae,C.a.MAX_CLIENT_WAIT_TIMEOUT_WEBGL,Pe),we(ae,C.a.MAX_COLOR_ATTACHMENTS,function(e,t){if(!Ae(e)){var n=e.getExtension("WEBGL_draw_buffers");return n?t(n.MAX_COLOR_ATTACHMENTS_WEBGL):0}}),we(ae,C.a.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS,Pe),we(ae,C.a.MAX_COMBINED_UNIFORM_BLOCKS,Pe),we(ae,C.a.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS,Pe),we(ae,C.a.MAX_DRAW_BUFFERS,function(e){if(!Ae(e)){var t=e.getExtension("WEBGL_draw_buffers");return t?t.MAX_DRAW_BUFFERS_WEBGL:0}}),we(ae,C.a.MAX_ELEMENT_INDEX,function(e){return e.getExtension("OES_element_index")?2147483647:65535}),we(ae,C.a.MAX_ELEMENTS_INDICES,function(e){return e.getExtension("OES_element_index")?16777216:65535}),we(ae,C.a.MAX_ELEMENTS_VERTICES,function(e){return 16777216}),we(ae,C.a.MAX_FRAGMENT_INPUT_COMPONENTS,Pe),we(ae,C.a.MAX_FRAGMENT_UNIFORM_BLOCKS,Pe),we(ae,C.a.MAX_FRAGMENT_UNIFORM_COMPONENTS,Pe),we(ae,C.a.MAX_SAMPLES,Pe),we(ae,C.a.MAX_SERVER_WAIT_TIMEOUT,Pe),we(ae,C.a.MAX_TEXTURE_LOD_BIAS,Pe),we(ae,C.a.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS,Pe),we(ae,C.a.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS,Pe),we(ae,C.a.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS,Pe),we(ae,C.a.MAX_UNIFORM_BLOCK_SIZE,Pe),we(ae,C.a.MAX_UNIFORM_BUFFER_BINDINGS,Pe),we(ae,C.a.MAX_VARYING_COMPONENTS,Pe),we(ae,C.a.MAX_VERTEX_OUTPUT_COMPONENTS,Pe),we(ae,C.a.MAX_VERTEX_UNIFORM_BLOCKS,Pe),we(ae,C.a.MAX_VERTEX_UNIFORM_COMPONENTS,Pe),we(ae,C.a.MIN_PROGRAM_TEXEL_OFFSET,Pe),we(ae,C.a.MAX_PROGRAM_TEXEL_OFFSET,Pe),we(ae,C.a.UNIFORM_BUFFER_OFFSET_ALIGNMENT,Pe),ae);function Ae(e){return e&&32874===e.TEXTURE_BINDING_3D}function xe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Oe(e){return e&&32874===e.TEXTURE_BINDING_3D}var Re=(xe(Se={},"OES_vertex_array_object",{meta:{suffix:"OES"},createVertexArray:function(){A(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:function(){},bindVertexArray:function(){},isVertexArray:function(){return!1}}),xe(Se,"ANGLE_instanced_arrays",{meta:{suffix:"ANGLE"},vertexAttribDivisor:function(e,t){A(0===t,"WebGL instanced rendering not supported")},drawElementsInstanced:function(){},drawArraysInstanced:function(){}}),xe(Se,"WEBGL_draw_buffers",{meta:{suffix:"WEBGL"},drawBuffers:function(){A(!1)}}),xe(Se,"EXT_disjoint_timer_query",{meta:{suffix:"EXT"},createQuery:function(){A(!1)},deleteQuery:function(){A(!1)},beginQuery:function(){A(!1)},endQuery:function(){},getQuery:function(e,t){return this.getQueryObject(e,t)},getQueryParameter:function(e,t){return this.getQueryObject(e,t)},queryCounter:function(){},getQueryObject:function(){}}),xe(Se,"EXT_disjoint_timer_query_webgl2",{meta:{suffix:"EXT"},queryCounter:null}),xe(Se,"OVERRIDES",{readBuffer:function(e,t,n){Oe(e)&&t(n)},getVertexAttrib:function(e,t,n,r){var i,o=function(e,t){return{webgl2:Oe(e),ext:e.getExtension(t)}}(e,"ANGLE_instanced_arrays"),a=o.webgl2,s=o.ext;switch(r){case 35069:i=!!a&&void 0;break;case 35070:i=a||s?void 0:0}return void 0!==i?i:t(n,r)},getProgramParameter:function(e,t,n,r){if(!Oe(e))switch(r){case 35967:return 35981;case 35971:case 35382:return 0}return t(n,r)},getInternalformatParameter:function(e,t,n,r,i){if(!Oe(e))switch(i){case 32937:return new Int32Array([0])}return e.getInternalformatParameter(n,r,i)},getTexParameter:function(e,t,n,r){switch(r){case 34046:var i=e.luma.extensions.EXT_texture_filter_anisotropic;r=i&&i.TEXTURE_MAX_ANISOTROPY_EXT||34046}return t(n,r)},getParameter:function(e,t,n){var r=Te[n],i="function"==typeof r?r(e,t,n):r;return void 0!==i?i:t(n)},hint:function(e,t,n,r){return t(n,r)}}),Se);function Ce(e,t){var n=t.extension,r=t.target,i=t.target2,o=Re[n];A(o);var a=o.meta,s=(void 0===a?{}:a).suffix,u=void 0===s?"":s,l=e.getExtension(n);Object.keys(o).forEach(function(t){var n="".concat(t).concat(u),a=null;"meta"===t||"function"==typeof e[t]||(l&&"function"==typeof l[n]?a=function(){return l[n].apply(l,arguments)}:"function"==typeof o[t]&&(a=o[t].bind(r))),a&&(r[t]=a,i[t]=a)})}function ke(e){if(e.luma=e.luma||{},function(e){e.luma.extensions={};var t=e.getSupportedExtensions(),n=!0,r=!1,i=void 0;try{for(var o,a=t[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;e.luma[s]=e.getExtension(s)}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}(e),!e.luma.polyfilled){for(var t in Re)"overrides"!==t&&Ce(e,{extension:t,target:e.luma,target2:e});!function(e,t){var n=t.target,r=t.target2,i=Re.OVERRIDES;Object.keys(i).forEach(function(t){if("function"==typeof i[t]){var o=e[t]?e[t].bind(e):function(){},a=i[t].bind(null,e,o);n[t]=a,r[t]=a}})}(e,{target:e.luma,target2:e}),e.luma.polyfilled=!0}return e}function Me(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function Ie(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Le(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ne=function(e,t){var n=Array.isArray(e)||ArrayBuffer.isView(e),r=Array.isArray(t)||ArrayBuffer.isView(t);if(n&&r&&e.length===t.length){for(var i=0;i<e.length;++i)if(e[i]!==t[i])return!1;return!0}return e===t},Fe={enable:function(e,t){return e(Le({},t,!0))},disable:function(e,t){return e(Le({},t,!1))},pixelStorei:function(e,t,n){return e(Le({},t,n))},hint:function(e,t,n){return e(Le({},t,n))},bindFramebuffer:function(e,t,n){var r;switch(t){case C.a.FRAMEBUFFER:return e((Le(r={},C.a.DRAW_FRAMEBUFFER_BINDING,n),Le(r,C.a.READ_FRAMEBUFFER_BINDING,n),r));case C.a.DRAW_FRAMEBUFFER:return e(Le({},C.a.DRAW_FRAMEBUFFER_BINDING,n));case C.a.READ_FRAMEBUFFER:return e(Le({},C.a.READ_FRAMEBUFFER_BINDING,n));default:return null}},blendColor:function(e,t,n,r,i){return e(Le({},C.a.BLEND_COLOR,new Float32Array([t,n,r,i])))},blendEquation:function(e,t){var n;return e((Le(n={},C.a.BLEND_EQUATION_RGB,t),Le(n,C.a.BLEND_EQUATION_ALPHA,t),n))},blendEquationSeparate:function(e,t,n){var r;return e((Le(r={},C.a.BLEND_EQUATION_RGB,t),Le(r,C.a.BLEND_EQUATION_ALPHA,n),r))},blendFunc:function(e,t,n){var r;return e((Le(r={},C.a.BLEND_SRC_RGB,t),Le(r,C.a.BLEND_DST_RGB,n),Le(r,C.a.BLEND_SRC_ALPHA,t),Le(r,C.a.BLEND_DST_ALPHA,n),r))},blendFuncSeparate:function(e,t,n,r,i){var o;return e((Le(o={},C.a.BLEND_SRC_RGB,t),Le(o,C.a.BLEND_DST_RGB,n),Le(o,C.a.BLEND_SRC_ALPHA,r),Le(o,C.a.BLEND_DST_ALPHA,i),o))},clearColor:function(e,t,n,r,i){return e(Le({},C.a.COLOR_CLEAR_VALUE,new Float32Array([t,n,r,i])))},clearDepth:function(e,t){return e(Le({},C.a.DEPTH_CLEAR_VALUE,t))},clearStencil:function(e,t){return e(Le({},C.a.STENCIL_CLEAR_VALUE,t))},colorMask:function(e,t,n,r,i){return e(Le({},C.a.COLOR_WRITEMASK,[t,n,r,i]))},cullFace:function(e,t){return e(Le({},C.a.CULL_FACE_MODE,t))},depthFunc:function(e,t){return e(Le({},C.a.DEPTH_FUNC,t))},depthRange:function(e,t,n){return e(Le({},C.a.DEPTH_RANGE,new Float32Array([t,n])))},depthMask:function(e,t){return e(Le({},C.a.DEPTH_WRITEMASK,t))},frontFace:function(e,t){return e(Le({},C.a.FRONT_FACE,t))},lineWidth:function(e,t){return e(Le({},C.a.LINE_WIDTH,t))},polygonOffset:function(e,t,n){var r;return e((Le(r={},C.a.POLYGON_OFFSET_FACTOR,t),Le(r,C.a.POLYGON_OFFSET_UNITS,n),r))},sampleCoverage:function(e,t,n){var r;return e((Le(r={},C.a.SAMPLE_COVERAGE_VALUE,t),Le(r,C.a.SAMPLE_COVERAGE_INVERT,n),r))},scissor:function(e,t,n,r,i){return e(Le({},C.a.SCISSOR_BOX,new Int32Array([t,n,r,i])))},stencilMask:function(e,t){var n;return e((Le(n={},C.a.STENCIL_WRITEMASK,t),Le(n,C.a.STENCIL_BACK_WRITEMASK,t),n))},stencilMaskSeparate:function(e,t,n){return e(Le({},t===C.a.FRONT?C.a.STENCIL_WRITEMASK:C.a.STENCIL_BACK_WRITEMASK,n))},stencilFunc:function(e,t,n,r){var i;return e((Le(i={},C.a.STENCIL_FUNC,t),Le(i,C.a.STENCIL_REF,n),Le(i,C.a.STENCIL_VALUE_MASK,r),Le(i,C.a.STENCIL_BACK_FUNC,t),Le(i,C.a.STENCIL_BACK_REF,n),Le(i,C.a.STENCIL_BACK_VALUE_MASK,r),i))},stencilFuncSeparate:function(e,t,n,r,i){var o;return e((Le(o={},t===C.a.FRONT?C.a.STENCIL_FUNC:C.a.STENCIL_BACK_FUNC,n),Le(o,t===C.a.FRONT?C.a.STENCIL_REF:C.a.STENCIL_BACK_REF,r),Le(o,t===C.a.FRONT?C.a.STENCIL_VALUE_MASK:C.a.STENCIL_BACK_VALUE_MASK,i),o))},stencilOp:function(e,t,n,r){var i;return e((Le(i={},C.a.STENCIL_FAIL,t),Le(i,C.a.STENCIL_PASS_DEPTH_FAIL,n),Le(i,C.a.STENCIL_PASS_DEPTH_PASS,r),Le(i,C.a.STENCIL_BACK_FAIL,t),Le(i,C.a.STENCIL_BACK_PASS_DEPTH_FAIL,n),Le(i,C.a.STENCIL_BACK_PASS_DEPTH_PASS,r),i))},stencilOpSeparate:function(e,t,n,r,i){var o;return e((Le(o={},t===C.a.FRONT?C.a.STENCIL_FAIL:C.a.STENCIL_BACK_FAIL,n),Le(o,t===C.a.FRONT?C.a.STENCIL_PASS_DEPTH_FAIL:C.a.STENCIL_BACK_PASS_DEPTH_FAIL,r),Le(o,t===C.a.FRONT?C.a.STENCIL_PASS_DEPTH_PASS:C.a.STENCIL_BACK_PASS_DEPTH_PASS,i),o))},viewport:function(e,t,n,r,i){return e(Le({},C.a.VIEWPORT,new Int32Array([t,n,r,i])))}};function je(e,t){var n=e[t].bind(e);e[t]=function(){var t=arguments.length<=0?void 0:arguments[0];return t in e.state.cache||(e.state.cache[t]=n.apply(void 0,arguments)),e.state.enable?e.state.cache[t]:n.apply(void 0,arguments)},Object.defineProperty(e[t],"name",{value:"".concat(t,"-from-cache"),configurable:!1})}function De(e,t,n){var r=e[t].bind(e);e[t]=function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];var s,u=n.apply(void 0,[e.state._updateCache].concat(o)),l=u.valueChanged,c=u.oldValue;l&&((s=e.state).log.apply(s,["gl.".concat(t)].concat(o)),r.apply(void 0,o));return c},Object.defineProperty(e[t],"name",{value:"".concat(t,"-to-cache"),configurable:!1})}var Be,Ue=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.copyState,i=void 0!==r&&r,o=n.log,a=void 0===o?function(){}:o;Me(this,e),this.gl=t,this.stateStack=[],this.enable=!0,this.cache=i?me(t):Object.assign({},se),this.log=a,this._updateCache=this._updateCache.bind(this),Object.seal(this)}var t,n,r;return t=e,(n=[{key:"push",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.stateStack.push({})}},{key:"pop",value:function(){A(this.stateStack.length>0);var e=this.stateStack[this.stateStack.length-1];ye(this.gl,e,this.cache),this.stateStack.pop()}},{key:"_updateCache",value:function(e){var t,n=!1,r=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(var i in e)A(void 0!==i),Ne(e[i],this.cache[i])||(n=!0,t=this.cache[i],!r||i in r||(r[i]=this.cache[i]),this.cache[i]=e[i]);return{valueChanged:n,oldValue:t}}}])&&Ie(t.prototype,n),r&&Ie(t,r),e}();function Ge(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.enable,r=void 0===n||n,i=t.copyState;if(A(void 0!==i),!e.state){for(var o in ke(e),e.state=new Ue(e,{copyState:i,enable:r}),Fe){De(e,o,Fe[o])}je(e,"getParameter"),je(e,"isEnabled")}return e.state.enable=r,e}function Ve(e){A(e.state),e.state.pop()}function ze(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function Xe(e){return e.luma=e.luma||{},e.luma}function We(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).debug;return null===e?null:void 0===t||t?function(e){if(null===e)return null;if(!V.a.WebGLDebug)return Y.a.warn('WebGL debug mode activation failed. import "luma.gl/debug" to enable.')(),e;var t=Xe(e);if(t.realContext)return e;if(t.debugContext)return t.debugContext;var n=V.a.WebGLDebug.makeDebugContext(e,Ye,Ke);return Object.assign(function e(){ze(this,e)}.prototype,n),t.debugContext=n,n.debug=!0,n.gl=e,Y.a.info("debug context actived."),n}(e):function(e){if(null===e)return null;var t=Xe(e);return t.realContext?t.realContext:e}(e)}function He(e,t){var n=V.a.WebGLDebug.glFunctionArgsToString(e,t);return n="".concat(n.slice(0,100)).concat(n.length>100?"...":""),"gl.".concat(e,"(").concat(n,")")}function Ye(e,t,n){var r=V.a.WebGLDebug.glEnumToString(e),i=V.a.WebGLDebug.glFunctionArgsToString(t,n),o="".concat(r," in gl.").concat(t,"(").concat(i,")");if(Y.a.throw)throw new Error(o);Y.a.error(o)()}function Ke(e,t){var n;if(Y.a.priority>=4&&(n=He(e,t),Y.a.info(4,n)()),Y.a.break){n=n||He(e,t);Y.a.break&&Y.a.break.every(function(e){return-1!==n.indexOf(e)})}var r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){if(void 0===a.value){if(n=n||He(e,t),Y.a.throw)throw new Error("Undefined argument: ".concat(n));Y.a.error("Undefined argument: ".concat(n))}}}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}}function Ze(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var qe=(Ze(Be={},C.a.ALIASED_LINE_WIDTH_RANGE,{gl1:new Float32Array([1,1])}),Ze(Be,C.a.ALIASED_POINT_SIZE_RANGE,{gl1:new Float32Array([1,1])}),Ze(Be,C.a.MAX_TEXTURE_SIZE,{gl1:64,gl2:2048}),Ze(Be,C.a.MAX_CUBE_MAP_TEXTURE_SIZE,{gl1:16}),Ze(Be,C.a.MAX_TEXTURE_IMAGE_UNITS,{gl1:8}),Ze(Be,C.a.MAX_COMBINED_TEXTURE_IMAGE_UNITS,{gl1:8}),Ze(Be,C.a.MAX_VERTEX_TEXTURE_IMAGE_UNITS,{gl1:0}),Ze(Be,C.a.MAX_RENDERBUFFER_SIZE,{gl1:1}),Ze(Be,C.a.MAX_VARYING_VECTORS,{gl1:8}),Ze(Be,C.a.MAX_VERTEX_ATTRIBS,{gl1:8}),Ze(Be,C.a.MAX_VERTEX_UNIFORM_VECTORS,{gl1:128}),Ze(Be,C.a.MAX_FRAGMENT_UNIFORM_VECTORS,{gl1:16}),Ze(Be,C.a.MAX_VIEWPORT_DIMS,{gl1:new Int32Array([0,0])}),Ze(Be,C.a.MAX_3D_TEXTURE_SIZE,{gl1:0,gl2:256}),Ze(Be,C.a.MAX_ARRAY_TEXTURE_LAYERS,{gl1:0,gl2:256}),Ze(Be,C.a.MAX_CLIENT_WAIT_TIMEOUT_WEBGL,{gl1:0,gl2:0}),Ze(Be,C.a.MAX_COLOR_ATTACHMENTS,{gl1:0,gl2:4}),Ze(Be,C.a.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS,{gl1:0,gl2:0}),Ze(Be,C.a.MAX_COMBINED_UNIFORM_BLOCKS,{gl1:0,gl2:0}),Ze(Be,C.a.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS,{gl1:0,gl2:0}),Ze(Be,C.a.MAX_DRAW_BUFFERS,{gl1:0,gl2:4}),Ze(Be,C.a.MAX_ELEMENT_INDEX,{gl1:0,gl2:0}),Ze(Be,C.a.MAX_ELEMENTS_INDICES,{gl1:0,gl2:0}),Ze(Be,C.a.MAX_ELEMENTS_VERTICES,{gl1:0,gl2:0}),Ze(Be,C.a.MAX_FRAGMENT_INPUT_COMPONENTS,{gl1:0,gl2:0}),Ze(Be,C.a.MAX_FRAGMENT_UNIFORM_BLOCKS,{gl1:0,gl2:0}),Ze(Be,C.a.MAX_FRAGMENT_UNIFORM_COMPONENTS,{gl1:0,gl2:0}),Ze(Be,C.a.MAX_SAMPLES,{gl1:0,gl2:0}),Ze(Be,C.a.MAX_SERVER_WAIT_TIMEOUT,{gl1:0,gl2:0}),Ze(Be,C.a.MAX_TEXTURE_LOD_BIAS,{gl1:0,gl2:0}),Ze(Be,C.a.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS,{gl1:0,gl2:0}),Ze(Be,C.a.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS,{gl1:0,gl2:0}),Ze(Be,C.a.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS,{gl1:0,gl2:0}),Ze(Be,C.a.MAX_UNIFORM_BLOCK_SIZE,{gl1:0,gl2:0}),Ze(Be,C.a.MAX_UNIFORM_BUFFER_BINDINGS,{gl1:0,gl2:0}),Ze(Be,C.a.MAX_VARYING_COMPONENTS,{gl1:0,gl2:0}),Ze(Be,C.a.MAX_VERTEX_OUTPUT_COMPONENTS,{gl1:0,gl2:0}),Ze(Be,C.a.MAX_VERTEX_UNIFORM_BLOCKS,{gl1:0,gl2:0}),Ze(Be,C.a.MAX_VERTEX_UNIFORM_COMPONENTS,{gl1:0,gl2:0}),Ze(Be,C.a.MIN_PROGRAM_TEXEL_OFFSET,{gl1:0,gl2:-8,negative:!0}),Ze(Be,C.a.MAX_PROGRAM_TEXEL_OFFSET,{gl1:0,gl2:7}),Ze(Be,C.a.UNIFORM_BUFFER_OFFSET_ALIGNMENT,{gl1:0,gl2:0}),Be);function Qe(e){if(e.luma=e.luma||{},!e.luma.limits){e.luma.limits={},e.luma.webgl1MinLimits={},e.luma.webgl2MinLimits={};var t=j(e);for(var n in qe){var r=qe[n],i=r.gl1,o="gl2"in r?r.gl2:r.gl1,a=t?o:i,s="gl2"in r&&!t||"extension"in r&&!e.getExtension(r.extension)?a:e.getParameter(n);e.luma.limits[n]=s,e.luma.webgl1MinLimits[n]=i,e.luma.webgl2MinLimits[n]=o}}return e.luma.limits}function Je(e){if(e.luma=e.luma||{},!e.luma.info){var t,n=e.getExtension("WEBGL_debug_renderer_info");e.luma.info=(Ze(t={},C.a.VENDOR,e.getParameter(C.a.VENDOR)),Ze(t,C.a.RENDERER,e.getParameter(C.a.RENDERER)),Ze(t,C.a.UNMASKED_VENDOR_WEBGL,e.getParameter(n&&n.UNMASKED_VENDOR_WEBGL||C.a.VENDOR)),Ze(t,C.a.UNMASKED_RENDERER_WEBGL,e.getParameter(n&&n.UNMASKED_RENDERER_WEBGL||C.a.RENDERER)),Ze(t,C.a.VERSION,e.getParameter(C.a.VERSION)),Ze(t,C.a.SHADING_LANGUAGE_VERSION,e.getParameter(C.a.SHADING_LANGUAGE_VERSION)),t)}return e.luma.info}var $e=37445,et=37446;function tt(e){var t=Qe(e),n=Je(e);return{vendor:n[$e]||n[C.a.VENDOR],renderer:n[et]||n[C.a.RENDERER],version:n[C.a.VERSION],shadingLanguageVersion:n[C.a.SHADING_LANGUAGE_VERSION],info:n,limits:t,webgl1MinLimits:e.luma.webgl1MinLimits,webgl2MinLimits:e.luma.webgl2MinLimits}}function nt(e){return function(e){var t=e.getParameter(C.a.VENDOR),n=e.getParameter(C.a.RENDERER),r=e.getExtension("WEBGL_debug_renderer_info"),i=r&&e.getParameter(r.UNMASKED_VENDOR_WEBGL||C.a.VENDOR),o=r&&e.getParameter(r.UNMASKED_RENDERER_WEBGL||C.a.RENDERER);return{vendor:i||t,renderer:o||n,vendorMasked:t,rendererMasked:n,version:e.getParameter(C.a.VERSION),shadingLanguageVersion:e.getParameter(C.a.SHADING_LANGUAGE_VERSION)}}(e)}function rt(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?t[Symbol.hasInstance](e):e instanceof t}function it(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var ot=function(e){return e},at=new(function(){function e(){!function(e,t){if(!rt(e,t))throw new TypeError("Cannot call a class as a function")}(this,e),this.pendingQueries=new Set,this.invalidQueryType=null,this.invalidErrorMessage="",this.checkInvalid=function(){return!1}}var t,n,r;return t=e,(n=[{key:"poll",value:function(e){this.cancelInvalidQueries(e);var t=!0,n=!1,r=void 0;try{for(var i,o=this.pendingQueries.values()[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value;if(a.isResultAvailable()){var s=a.getResult();this.resolveQuery(a,s)}}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}}},{key:"setInvalidator",value:function(e){var t=e.queryType,n=e.errorMessage,r=e.checkInvalid;this.invalidQueryType=t,this.invalidErrorMessage=n,this.checkInvalid=r}},{key:"beginQuery",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ot,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ot;this.cancelInvalidQueries(e.gl),this.cancelQuery(e);var r={};return e.promise=new Promise(function(e,t){r.resolve=e,r.reject=t}),Object.assign(e.promise,r),this.pendingQueries.add(e),e.promise.then(t).catch(n)}},{key:"resolveQuery",value:function(e,t){this.pendingQueries.delete(e),e.promise.resolve(t)}},{key:"rejectQuery",value:function(e,t){this.pendingQueries.delete(e),e.promise&&e.promise.reject(new Error(t))}},{key:"deleteQuery",value:function(e){return this.rejectQuery(e,"Query was deleted before result was available")}},{key:"cancelQuery",value:function(e){return this.rejectQuery(e,"Query was canceled before result was available")}},{key:"invalidateQuery",value:function(e){rt(e,this.invalidQueryType)&&this.rejectQuery(e,this.invalidErrorMessage)}},{key:"cancelInvalidQueries",value:function(e){if(this.checkInvalid(e)){var t=!0,n=!1,r=void 0;try{for(var i,o=this.pendingQueries.values()[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value;this.invalidateQuery(a)}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}}}}])&&it(t.prototype,n),r&&it(t,r),e}());function st(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?t[Symbol.hasInstance](e):e instanceof t}var ut=34962,lt=32874;function ct(e){return Boolean(e&&(st(e,r.c)||e.ARRAY_BUFFER===ut))}function ft(e){return Boolean(e&&(st(e,r.a)||e.TEXTURE_BINDING_3D===lt))}var ht={webgl2:!0,webgl1:!0,throwOnFailure:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function dt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.assign(ht,{width:1,height:1},e)}function pt(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t=Object.assign({},ht,t),r=n.canvas,i=n.width,o=n.height,a=n.throwOnError,s=n.manageState,u=n.debug;function l(e){if(a)throw new Error(e);return null}G.a?e=function(e){var t=e.canvas,n=e.opts,r=void 0===n?{}:n,i=e.onError,o=void 0===i?function(e){return null}:i;function a(e){o("WebGL context: ".concat(e.statusMessage||"Unknown error"))}t.addEventListener("webglcontextcreationerror",a,!1);var s=r.webgl1,u=void 0===s||s,l=r.webgl2,c=void 0===l||l,f=null;return c&&(f=(f=f||t.getContext("webgl2",r))||t.getContext("experimental-webgl2",r)),u&&(f=(f=f||t.getContext("webgl",r))||t.getContext("experimental-webgl",r)),t.removeEventListener("webglcontextcreationerror",a,!1),f||o("Failed to create ".concat(c&&!u?"WebGL2":"WebGL"," context"))}({canvas:function(e){var t,n=e.canvas,r=e.width,i=e.height,o=e.onError,a=void 0===o?function(){}:o;return"string"==typeof n?($||a("createGLContext called on canvas '".concat(n,"' before page was loaded")),t=document.getElementById(n)):t=n||ne({id:"lumagl-canvas",width:r,height:i,onError:a}),t}({canvas:r,width:i,height:o,onError:l}),opts:t}):e=Object(U.a)({width:i,height:o,opts:t,onError:l});return e?(s&&Ge(e,{copyState:!1,log:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Y.a.log.apply(Y.a,[1].concat(t))()}}),G.a&&u&&(e=We(e,{debug:u}),Y.a.priority=Math.max(Y.a.priority,1)),function(e){var t=ft(e)?"WebGL2":"WebGL1",n=nt(e),r=n?"(".concat(n.vendor,",").concat(n.renderer,")"):"",i=e.debug?" debug":"";Y.a.once(0,"".concat(t).concat(i," context ").concat(r))()}(e),e):null}function vt(e){var t=e.getExtension("STACKGL_destroy_context");t&&t.destroy()}function gt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.canvas){var n=t.useDevicePixels&&window.devicePixelRatio||1,r="width"in t?t.width:e.canvas.clientWidth,i="height"in t?t.height:e.canvas.clientHeight;return e.canvas.width=r*n,void(e.canvas.height=i*n)}var o=e.getExtension("STACKGL_resize_drawingbuffer");o&&"width"in t&&"height"in t&&o.resize(t.width,t.height)}function yt(e){at.poll(e)}function _t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function mt(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var bt={framebuffer:function(e,t){var n=t&&t.handle?t.handle:t;return e.bindFramebuffer(C.a.FRAMEBUFFER,n)},blend:function(e,t){return t?e.enable(C.a.BLEND):e.disable(C.a.BLEND)},blendColor:function(e,t){return e.blendColor.apply(e,mt(t))},blendEquation:function(e,t){t=Et(t)?t:[t,t],e.blendEquationSeparate.apply(e,mt(t))},blendFunc:function(e,t){t=Et(t)&&2===t.length?mt(t).concat(mt(t)):t,e.blendFuncSeparate.apply(e,mt(t))},clearColor:function(e,t){return e.clearColor.apply(e,mt(t))},clearDepth:function(e,t){return e.clearDepth(t)},clearStencil:function(e,t){return e.clearStencil(t)},colorMask:function(e,t){return e.colorMask.apply(e,mt(t))},cull:function(e,t){return t?e.enable(C.a.CULL_FACE):e.disable(C.a.CULL_FACE)},cullFace:function(e,t){return e.cullFace(t)},depthTest:function(e,t){return t?e.enable(C.a.DEPTH_TEST):e.disable(C.a.DEPTH_TEST)},depthFunc:function(e,t){return e.depthFunc(t)},depthMask:function(e,t){return e.depthMask(t)},depthRange:function(e,t){return e.depthRange.apply(e,mt(t))},dither:function(e,t){return t?e.enable(C.a.DITHER):e.disable(C.a.DITHER)},derivativeHint:function(e,t){e.hint(C.a.FRAGMENT_SHADER_DERIVATIVE_HINT,t)},frontFace:function(e,t){return e.frontFace(t)},mipmapHint:function(e,t){return e.hint(C.a.GENERATE_MIPMAP_HINT,t)},lineWidth:function(e,t){return e.lineWidth(t)},polygonOffsetFill:function(e,t){return t?e.enable(C.a.POLYGON_OFFSET_FILL):e.disable(C.a.POLYGON_OFFSET_FILL)},polygonOffset:function(e,t){return e.polygonOffset.apply(e,mt(t))},sampleCoverage:function(e,t){return e.sampleCoverage.apply(e,mt(t))},scissorTest:function(e,t){return t?e.enable(C.a.SCISSOR_TEST):e.disable(C.a.SCISSOR_TEST)},scissor:function(e,t){return e.scissor.apply(e,mt(t))},stencilTest:function(e,t){return t?e.enable(C.a.STENCIL_TEST):e.disable(C.a.STENCIL_TEST)},stencilMask:function(e,t){var n=_t(t=Et(t)?t:[t,t],2),r=n[0],i=n[1];e.stencilMaskSeparate(C.a.FRONT,r),e.stencilMaskSeparate(C.a.BACK,i)},stencilFunc:function(e,t){var n=_t(t=Et(t)&&3===t.length?mt(t).concat(mt(t)):t,6),r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],u=n[5];e.stencilFuncSeparate(C.a.FRONT,r,i,o),e.stencilFuncSeparate(C.a.BACK,a,s,u)},stencilOp:function(e,t){var n=_t(t=Et(t)&&3===t.length?mt(t).concat(mt(t)):t,6),r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],u=n[5];e.stencilOpSeparate(C.a.FRONT,r,i,o),e.stencilOpSeparate(C.a.BACK,a,s,u)},viewport:function(e,t){return e.viewport.apply(e,mt(t))}};function Et(e){return Array.isArray(e)||ArrayBuffer.isView(e)}function wt(e,t){for(var n in ye(e,t),t){var r=bt[n];r&&r(e,t[n],n)}}function St(e,t,n){if(H(t))return n(e);var r,i=t.nocatch,o=void 0===i||i;if(A(!t.frameBuffer),function(e){e.state||Ge(e,{copyState:!1}),e.state.push()}(e),wt(e,t),o)r=n(e),Ve(e);else try{r=n(e)}finally{Ve(e)}return r}var Pt={VERTEX_ARRAY_OBJECT:["OES_vertex_array_object",!0],TIMER_QUERY:["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"],INSTANCED_RENDERING:["ANGLE_instanced_arrays",!0],MULTIPLE_RENDER_TARGETS:["WEBGL_draw_buffers",!0],ELEMENT_INDEX_UINT32:["OES_element_index_uint",!0],BLEND_EQUATION_MINMAX:["EXT_blend_minmax",!0],COLOR_ENCODING_SRGB:["EXT_sRGB",!0],TEXTURE_DEPTH:["WEBGL_depth_texture",!0],TEXTURE_FLOAT:["OES_texture_float",!0],TEXTURE_HALF_FLOAT:["OES_texture_half_float",!0],TEXTURE_FILTER_LINEAR_FLOAT:["OES_texture_float_linear"],TEXTURE_FILTER_LINEAR_HALF_FLOAT:["OES_texture_half_float_linear"],TEXTURE_FILTER_ANISOTROPIC:["EXT_texture_filter_anisotropic"],COLOR_ATTACHMENT_RGBA32F:["WEBGL_color_buffer_float","EXT_color_buffer_float"],COLOR_ATTACHMENT_FLOAT:[!1,"EXT_color_buffer_float"],COLOR_ATTACHMENT_HALF_FLOAT:[!1,"EXT_color_buffer_half_float"],GLSL_FRAG_DATA:["WEBGL_draw_buffers",!0],GLSL_FRAG_DEPTH:["EXT_frag_depth",!0],GLSL_DERIVATIVES:["OES_standard_derivatives",!0],GLSL_TEXTURE_LOD:["EXT_shader_texture_lod",!0]},Tt={};Object.keys(Pt).forEach(function(e){Tt[e]=e});var At={};function xt(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Pt[t];if(A(r,t),!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=V.b.navigator||{},n=e.userAgent||t.userAgent,r=-1!==n.indexOf("MSIE "),i=-1!==n.indexOf("Trident/");return r||i}(n))return!0;if(t in At)return At[t];var i=r[0],o="#extension GL_".concat(i," : enable\nvoid main(void) {}"),a=e.createShader(e.VERTEX_SHADER);e.shaderSource(a,o),e.compileShader(a);var s=e.getShaderParameter(a,e.COMPILE_STATUS);return e.deleteShader(a),At[t]=s,s}function Ot(e,t){var n=Pt[t];A(n,t);var r=j(e)&&n[1]||n[0],i="string"==typeof r?Boolean(e.getExtension(r)):r;return A(!1===i||!0===i),i}function Rt(e,t){return Ct(e,t)}function Ct(e,t){return(t=Array.isArray(t)?t:[t]).every(function(t){return Ot(e,t)})}function kt(e){if(e.luma=e.luma||{},!e.luma.caps)for(var t in e.luma.caps={},e.luma.caps.webgl2=j(e),Pt)e.luma.caps[t]=Ot(e,t);return e.luma.caps}var Mt=n(36);function It(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function Lt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var Nt="Resource subclass must define virtual methods",Ft=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};It(this,e),D(t);var r=n.id,i=n.userData,o=void 0===i?{}:i;this.gl=t,this.ext=ke(t),this.id=r||X(this.constructor.name),this.userData=o,this.opts=n,this._handle=n.handle,void 0===this._handle&&(this._handle=this._createHandle()),this._addStats()}var t,n,r;return t=e,(n=[{key:"toString",value:function(){return"".concat(this.constructor.name,"(").concat(this.id,")")}},{key:"delete",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).deleteChildren,t=void 0!==e&&e,n=this._handle&&this._deleteHandle(this._handle);return this._handle=null,this._removeStats(),n&&t&&n.filter(Boolean).forEach(function(e){e.delete()}),this}},{key:"unbind",value:function(){this.bind(null)}},{key:"getParameter",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};A(e=x(this.gl,e));var n=(this.constructor.PARAMETERS||{})[e];if(n){var r=j(this.gl);if(!((!("webgl2"in n)||r)&&(!("extension"in n)||this.gl.getExtension(n.extension)))){var i=n.webgl1,o="webgl2"in n?n.webgl2:n.webgl1;return r?o:i}}return this._getParameter(e,t)}},{key:"getParameters",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={},n=t.parameters,r=t.keys,i=this.constructor.PARAMETERS||{},o=j(this.gl),a={},s=n||Object.keys(i),u=!0,l=!1,c=void 0;try{for(var f,h=s[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var d=f.value,p=i[d];if(p&&(!("webgl2"in p)||o)&&(!("extension"in p)||this.gl.getExtension(p.extension))){var v=r?O(this.gl,d):d;a[v]=this.getParameter(d,e),r&&"GLenum"===p.type&&(a[v]=O(this.gl,a[v]))}}}catch(e){l=!0,c=e}finally{try{u||null==h.return||h.return()}finally{if(l)throw c}}return a}},{key:"setParameter",value:function(e,t){A(e=x(this.gl,e));var n=(this.constructor.PARAMETERS||{})[e];if(n){var r=j(this.gl);if(!((!("webgl2"in n)||r)&&(!("extension"in n)||this.gl.getExtension(n.extension))))throw new Error("Parameter not available on this platform");"GLenum"===n.type&&(t=x(t))}return this._setParameter(e,t),this}},{key:"setParameters",value:function(e){for(var t in e)this.setParameter(t,e[t]);return this}},{key:"initialize",value:function(e){}},{key:"_createHandle",value:function(){throw new Error(Nt)}},{key:"_deleteHandle",value:function(){throw new Error(Nt)}},{key:"_getOptsFromHandle",value:function(){throw new Error(Nt)}},{key:"_getParameter",value:function(e,t){throw new Error(Nt)}},{key:"_setParameter",value:function(e,t){throw new Error(Nt)}},{key:"_context",value:function(){return this.gl.luma=this.gl.luma||{},this.gl.luma}},{key:"_addStats",value:function(){var e=this.constructor.name,t=Mt.default.stats;t.resourceCount=t.resourceCount||0,t.resourceMap=t.resourceMap||{},t.resourceCount++,t.resourceMap[e]=t.resourceMap[e]||{created:0,active:0},t.resourceMap[e].created++,t.resourceMap[e].active++}},{key:"_removeStats",value:function(){var e=this.constructor.name;Mt.default.stats.resourceMap[e].active--}},{key:"handle",get:function(){return this._handle}}])&&Lt(t.prototype,n),r&&Lt(t,r),e}();function jt(e){return(jt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Dt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Bt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ut(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}var Gt=36662,Vt=34962,zt=function(e){function t(e){var n,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Ut(this,t),r=this,(n=!(i=(t.__proto__||Object.getPrototypeOf(t)).call(this,e,o))||"object"!==jt(i)&&"function"!=typeof i?Bt(r):i).target=o.target||(n.gl.webgl2?Gt:Vt),n.setData(o),Object.seal(Bt(n)),n}var n,r,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");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)}(t,Ft),n=t,(r=[{key:"setDataLayout",value:function(e){var t=e.layout,n=e.type,r=e.size,i=void 0===r?1:r,o=e.offset,a=void 0===o?0:o,s=e.stride,u=void 0===s?0:s,l=e.normalized,c=void 0!==l&&l,f=e.integer,h=void 0!==f&&f,d=e.instanced,p=void 0===d?0:d;return this.layout=t||new function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.type,r=t.size,i=void 0===r?1:r,o=t.offset,a=void 0===o?0:o,s=t.stride,u=void 0===s?0:s,l=t.normalized,c=void 0!==l&&l,f=t.integer,h=void 0!==f&&f,d=t.instanced,p=void 0===d?0:d;Ut(this,e),this.type=n,this.size=i,this.offset=a,this.stride=u,this.normalized=c,this.integer=h,this.instanced=p}({type:n||this.type,size:i,offset:a,stride:u,normalized:c,integer:h,instanced:p}),this}},{key:"updateLayout",value:function(e){Object.assign(this.layout,e)}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.data,n=e.bytes,r=e.usage,i=void 0===r?35044:r,o=(e.layout,e.type),a=(e.size,e.offset,e.stride,e.normalized,e.integer,e.instanced,e.index),s=void 0===a?null:a,u=arguments[0];t?(o=o||S(t),n=t.byteLength,A(o)):(o=o||5126,n&&0!==n||(n=0,t=new Float32Array(0))),this.bytes=n,this.bytesUsed=n,this.data=t,this.type=o,this.usage=i,this.index=s,this.setDataLayout(Object.assign(u));var l=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(l,this.handle),this.gl.bufferData(l,t||n,i),this.gl.bindBuffer(l,null),this}},{key:"setData",value:function(e){return this.initialize(e)}},{key:"subData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.data,n=e.offset,r=void 0===n?0:n,i=e.srcOffset,o=void 0===i?0:i,a=e.length;A(t);var s=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(s,this.handle),0!==o||void 0!==a?(B(this.gl),this.gl.bufferSubData(this.target,r,t,o,a||0)):this.gl.bufferSubData(s,r,t),this.gl.bindBuffer(s,null),this}},{key:"copyData",value:function(e){var t=e.sourceBuffer,n=e.readOffset,r=void 0===n?0:n,i=e.writeOffset,o=void 0===i?0:i,a=e.size;return B(this.gl),this.gl.bindBuffer(Gt,t.handle),this.gl.bindBuffer(36663,this.handle),this.gl.copyBufferSubData(Gt,36663,r,o,a),this.gl.bindBuffer(Gt,null),this.gl.bindBuffer(36663,null),this}},{key:"getData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.dstData,n=void 0===t?null:t,r=e.srcByteOffset,i=void 0===r?0:r,o=e.dstOffset,a=void 0===o?0:o,s=e.length,u=void 0===s?0:s;B(this.gl);var l,c,f=P(this.type,{clamped:!1}),h=this._getAvailableElementCount(i),d=a;n?l=(c=n.length)-d:c=d+(l=Math.min(h,u||h));var p=Math.min(h,l);return A((u=u||p)<=p,"Invalid srcByteOffset, dstOffset and length combination"),n=n||new f(c),this.gl.bindBuffer(Gt,this.handle),this.gl.getBufferSubData(Gt,i,n,a,u),this.gl.bindBuffer(Gt,null),n}},{key:"bind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,n=void 0===t?this.target:t,r=e.index,i=void 0===r?this.index:r,o=e.offset,a=void 0===o?0:o,s=e.size;switch(35345===n||35982===n?void 0!==s?"ranged":"indexed":"non-indexed"){case"non-indexed":this.gl.bindBuffer(n,this.handle);break;case"indexed":B(this.gl),A(0===a),this.gl.bindBufferBase(n,i,this.handle);break;case"ranged":B(this.gl),this.gl.bindBufferRange(n,i,this.handle,a,s);break;default:A(!1)}return this}},{key:"unbind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,n=void 0===t?this.target:t,r=e.index,i=void 0===r?this.index:r;return 35345===n||35982===n?this.gl.bindBufferBase(n,i,null):this.gl.bindBuffer(n,null),this}},{key:"getIndexedParameter",value:function(e,t){var n=this.gl.webgl2?Gt:this.target;return this.gl.bindBuffer(n,t),this.gl.getIndexedParameter(e,t)}},{key:"_createHandle",value:function(){return this.gl.createBuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteBuffer(this.handle)}},{key:"_getParameter",value:function(e){this.gl.bindBuffer(this.target,this.handle);var t=this.gl.getBufferParameter(this.target,e);return this.gl.bindBuffer(this.target,null),t}},{key:"_getAvailableElementCount",value:function(e){var t=P(this.type,{clamped:!1});return this.bytes/t.BYTES_PER_ELEMENT-e/t.BYTES_PER_ELEMENT}}])&&Dt(n.prototype,r),i&&Dt(n,i),t}();function Xt(e){return(Xt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Wt(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function Ht(e,t){return!t||"object"!==Xt(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Yt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Kt(e,t,n){return t&&Yt(e.prototype,t),n&&Yt(e,n),e}function Zt(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");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)}var qt="Shader: GLSL source code must be a JavaScript string",Qt=35632,Jt=35633,$t=function(e){function t(e,n,r){var i;return Wt(this,t),D(e),A("string"==typeof n,qt),(i=Ht(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,{id:u(n)||X(t.getTypeName(r))}))).shaderType=r,i.source=n,i.opts.source=n,i.initialize(i.opts),i}return Zt(t,Ft),Kt(t,null,[{key:"getTypeName",value:function(e){switch(e){case Jt:return"vertex-shader";case Qt:return"fragment-shader";default:return A(!1),"unknown"}}}]),Kt(t,[{key:"initialize",value:function(e){var t=e.source,n=u(t);n&&(this.id=X(n)),this._compile(t),this.opts.source=t}},{key:"getParameter",value:function(e){return this.gl.getShaderParameter(this.handle,e)}},{key:"toString",value:function(){return"".concat(this.getTypeName(this.shaderType),":").concat(this.id)}},{key:"getName",value:function(){return u(this.opts.source)||"unnamed-shader"}},{key:"getSource",value:function(){return this.gl.getShaderSource(this.handle)}},{key:"getTranslatedSource",value:function(){var e=this.gl.getExtension("WEBGL_debug_shaders");return e?e.getTranslatedShaderSource(this.handle):"No translated source available. WEBGL_debug_shaders not implemented"}},{key:"_compile",value:function(){if(this.gl.shaderSource(this.handle,this.source),this.gl.compileShader(this.handle),!this.getParameter(35713)){var e=l(this.gl.getShaderInfoLog(this.handle),this.source,this.shaderType),t=e.shaderName,n=e.errors,r=e.warnings;throw Y.a.error("GLSL compilation errors in ".concat(t,"\n").concat(n))(),Y.a.warn("GLSL compilation warnings in ".concat(t,"\n").concat(r))(),new Error("GLSL compilation errors in ".concat(t))}}},{key:"_deleteHandle",value:function(){this.gl.deleteShader(this.handle)}},{key:"_getOptsFromHandle",value:function(){return{type:this.getParameter(35663),source:this.getSource()}}}]),t}(),en=function(e){function t(e,n){return Wt(this,t),Ht(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,Jt))}return Zt(t,$t),Kt(t,[{key:"_createHandle",value:function(){return this.gl.createShader(Jt)}}]),t}(),tn=function(e){function t(e,n){return Wt(this,t),Ht(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,Qt))}return Zt(t,$t),Kt(t,[{key:"_createHandle",value:function(){return this.gl.createShader(Qt)}}]),t}();function nn(e){return(nn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function rn(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function on(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function an(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function sn(e,t,n){return t&&an(e.prototype,t),n&&an(e,n),e}function un(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var ln,cn=[34338,34339,34340,34341,34922,34373,34975,35069,35070],fn=function(e){function t(e){var n,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return on(this,t),r=this,(n=!(i=(t.__proto__||Object.getPrototypeOf(t)).call(this,e,o))||"object"!==nn(i)&&"function"!=typeof i?un(r):i).elements=null,n.buffers={},n.locations={},n.names={},n.drawParameters={},n._bound=!1,n._filledLocations={},Object.seal(un(n)),n.initialize(o),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");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)}(t,Ft),sn(t,[{key:"MAX_ATTRIBUTES",get:function(){return this.gl.getParameter(this.gl.MAX_VERTEX_ATTRIBS)}}],[{key:"isSupported",value:function(e){return j(e)||e.getExtension("OES_vertex_array_object")}},{key:"getDefaultArray",value:function(e){return e.luma=e.luma||{},e.luma.defaultVertexArray||(e.luma.defaultVertexArray=new t(e,{handle:null})),e.luma.defaultVertexArray}},{key:"getMaxAttributes",value:function(e){return e.getParameter(e.MAX_VERTEX_ATTRIBS)}}]),sn(t,[{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.buffers,n=void 0===t?{}:t,r=e.elements,i=void 0===r?null:r,o=e.locations,a=void 0===o?{}:o;this.setLocations(a),this.setBuffers(n,{clear:!0}),this.setElements(i)}},{key:"setBuffer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.location,n=e.buffer,r=e.target,i=e.layout,o=this.gl;r=void 0!==r?r:n.target,i=void 0!==i?i:n.layout,A(r,"setBuffer needs target"),A(i,"setBuffer called on uninitialized buffer"),this._filledLocations[t]=!0,this.bind(function(){n.bind({target:o.ARRAY_BUFFER});var e=i,r=e.size,a=e.type,s=e.normalized,u=e.stride,l=e.offset;i.integer?(A(j(o)),o.vertexAttribIPointer(t,r,a,u,l)):o.vertexAttribPointer(t,r,a,s,u,l)})}},{key:"setBuffers",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).clear;(void 0===t||t)&&this.clearBindings();var n=this._getLocations(e),r=n.locations,i=n.elements;for(var o in this.ext.bindVertexArray(this.handle),r){var a=r[o];if(a){var s=this._getBufferAndLayout(a),u=s.buffer,l=s.layout;this.setBuffer({location:o,buffer:u,layout:l}),this.setDivisor(o,l.instanced?1:0),this.enable(o)}else this.disable(o)}this.buffers=e,this.ext.bindVertexArray(null),i&&this.setElements(i)}},{key:"setLocations",value:function(e){this.locations=e,this.names={}}},{key:"setElements",value:function(e){return A(!e||34963===e.target,"elements must be GL.ELEMENT_ARRAY_BUFFER"),this.ext.bindVertexArray(this.handle),this.gl.bindBuffer(34963,e&&e.handle),this.ext.bindVertexArray(null),this.elements=e,this}},{key:"clearBindings",value:function(){var e=this,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).disableZero,n=void 0!==t&&t;this.bind(function(){for(var t in e._filledLocations)e._filledLocations[t]&&(t>0||n)&&e.gl.disableVertexAttribArray(t);e._filledLocations={}})}},{key:"enable",value:function(e){var t=this;this.bind(function(){t.gl.enableVertexAttribArray(e)})}},{key:"disable",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];(e>0||n)&&this.bind(function(){t.gl.disableVertexAttribArray(e)})}},{key:"setDivisor",value:function(e,t){var n=this;this.bind(function(){n.ext.vertexAttribDivisor(e,t)})}},{key:"setGeneric",value:function(e){var t=e.location,n=e.array;switch(this._filledLocations[t]=!0,n.constructor){case Float32Array:this._setGenericFloatArray(t,n);break;case Int32Array:this._setGenericIntArray(t,n);break;case Uint32Array:this._setGenericUintArray(t,n);break;default:this.setGenericValues.apply(this,[t].concat(rn(n)))}}},{key:"setGenericValues",value:function(e,t,n,r,i){var o=this.gl;switch(arguments.length-1){case 1:o.vertexAttrib1f(e,t);break;case 2:o.vertexAttrib2f(e,t,n);break;case 3:o.vertexAttrib3f(e,t,n,r);break;case 4:o.vertexAttrib4f(e,t,n,r,i);break;default:A(!1)}}},{key:"bind",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.handle;return"function"!=typeof t?(this.bindVertexArray(t),this):(this._bound?e=t():(this.ext.bindVertexArray(this.handle),this._bound=!0,e=t(),this.ext.bindVertexArray(null),this._bound=!1),e)}},{key:"_deduceDrawParameters",value:function(){var e=!1,t=!1,n=null;return this.elements&&(t=!0,n=this.elements.layout.type),this.buffers.forEach(function(t){t.layout.instanced>0&&(e=!0)}),{isInstanced:e,isIndexed:t,indexType:n}}},{key:"_getLocations",value:function(e){var t=null,n={};for(var r in e){var i=e[r];i&&34963===i.target&&(A(!t,"Duplicate GL.ELEMENT_ARRAY_BUFFER"),t=i);var o=Number(r);Number.isFinite(o)||(o=this.locations[r]),A(Number.isFinite(o)),A(!n[o],"Duplicate attribute for binding point ".concat(o)),n[o]=i}return{locations:n,elements:t}}},{key:"_sortBuffersByLocation",value:function(e){var t=null,n=new Array(this._attributeCount).fill(null);for(var r in e){var i=e[r];34963===i.target?(A(!t,"Duplicate GL.ELEMENT_ARRAY_BUFFER"),t=i):this._warn[r]||(Y.a.warn(2,"".concat(this._print(r)," not used"))(),this._warn[r]=!0);var o=Number(r);Number.isFinite(o)||(o=this.locations[r]),n[o]=r,A(null===n[o],"Duplicate attribute for binding point ".concat(o)),n[o]=o}return{locations:n,elements:t}}},{key:"_getBufferAndLayout",value:function(e){var t,n;return e.handle?(t=e,n=e.layout):(t=e.buffer,n=Object.assign({},t.layout,e.layout||{},e)),{buffer:t,layout:n}}},{key:"_setGenericFloatArray",value:function(e,t){var n=this.gl;switch(t.length){case 1:n.vertexAttrib1fv(e,t);break;case 2:n.vertexAttrib2fv(e,t);break;case 3:n.vertexAttrib3fv(e,t);break;case 4:n.vertexAttrib4fv(e,t);break;default:A(!1)}}},{key:"_setGenericIntArray",value:function(e,t){var n=this.gl;switch(A(j(n)),t.length){case 1:n.vertexAttribI1iv(e,t);break;case 2:n.vertexAttribI2iv(e,t);break;case 3:n.vertexAttribI3iv(e,t);break;case 4:n.vertexAttribI4iv(e,t);break;default:A(!1)}}},{key:"_setGenericUintArray",value:function(e,t){var n=this.gl;switch(A(j(n)),t.length){case 1:n.vertexAttribI1uiv(e,t);break;case 2:n.vertexAttribI2uiv(e,t);break;case 3:n.vertexAttribI3uiv(e,t);break;case 4:n.vertexAttribI4uiv(e,t);break;default:A(!1)}}},{key:"_createHandle",value:function(){return this.ext.createVertexArray()}},{key:"_deleteHandle",value:function(e){return this.ext.deleteVertexArray(e),[this.elements]}},{key:"_getParameter",value:function(e,t){var n,r=t.location;switch(A(Number.isFinite(r)),this.ext.bindVertexArray(this.handle),e){case 34373:n=this.gl.getVertexAttribOffset(r,e);break;default:n=this.ext.getVertexAttrib(r,e)}return this.ext.bindVertexArray(null),n}},{key:"_getData",value:function(){var e=this;return new Array(this.MAX_ATTRIBUTES).fill(0).map(function(t,n){var r={};return cn.forEach(function(t){r[O(e.gl,t)]=e.getParameter(t,{location:n})}),r})}},{key:"_bind",value:function(e){this.ext.bindVertexArray(e)}},{key:"filledLocations",get:function(){return this._filledLocations}}]),t}();function hn(e){return(hn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function dn(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?t[Symbol.hasInstance](e):e instanceof t}function pn(e,t){return!t||"object"!==hn(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function vn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function gn(e,t,n){return t&&vn(e.prototype,t),n&&vn(e,n),e}function yn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var _n=[C.a.LINEAR,C.a.NEAREST],mn=(yn(ln={},C.a.RGB,{dataFormat:C.a.RGB,types:[C.a.UNSIGNED_BYTE,C.a.UNSIGNED_SHORT_5_6_5]}),yn(ln,C.a.RGBA,{dataFormat:C.a.RGBA,types:[C.a.UNSIGNED_BYTE,C.a.UNSIGNED_SHORT_4_4_4_4,C.a.UNSIGNED_SHORT_5_5_5_1]}),yn(ln,C.a.ALPHA,{dataFormat:C.a.ALPHA,types:[C.a.UNSIGNED_BYTE]}),yn(ln,C.a.LUMINANCE,{dataFormat:C.a.LUMINANCE,types:[C.a.UNSIGNED_BYTE]}),yn(ln,C.a.LUMINANCE_ALPHA,{dataFormat:C.a.LUMINANCE_ALPHA,types:[C.a.UNSIGNED_BYTE]}),ln);var bn=function(e){function t(e,n){var r;!function(e,t){if(!dn(e,t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=n.id,o=void 0===i?X("texture"):i,a=n.handle,s=n.target;return(r=pn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,{id:o,handle:a}))).target=s,r.hasFloatTexture=e.getExtension("OES_texture_float"),r.textureUnit=void 0,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");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)}(t,Ft),gn(t,null,[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.format,r=t.linearFiltering,i=!0;return n&&(i=(i=i&&function(e,t){var n=mn[t];if(!n)return!1;if(void 0===n.gl1&&void 0===n.gl2)return!0;var r=j(e)&&n.gl2||n.gl1;return"string"==typeof r?e.getExtension(r):r}(e,n))&&(!r||function(e,t){var n=mn[t];switch(n&&n.types[0]){case C.a.FLOAT:return e.getExtension("OES_texture_float_linear");case C.a.HALF_FLOAT:return e.getExtension("OES_texture_half_float_linear");default:return!0}}(e,n))),i}}]),gn(t,[{key:"toString",value:function(){return"Texture(".concat(this.id,",").concat(this.width,"x").concat(this.height,")")}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.data,n=e.pixels,r=void 0===n?null:n,i=e.format,o=void 0===i?C.a.RGBA:i,a=e.type,s=void 0===a?C.a.UNSIGNED_BYTE:a,u=e.border,l=void 0===u?0:u,c=e.recreate,f=void 0!==c&&c,h=e.parameters,d=void 0===h?{}:h,p=e.pixelStore,v=void 0===p?{}:p,g=e.unpackFlipY,y=void 0===g||g,_=e.mipmaps,m=void 0===_||_;t||(t=r);var b=e.width,E=e.height,w=e.dataFormat,S=this._deduceParameters({format:o,type:s,dataFormat:w,compressed:!1,data:t,width:b,height:E});b=S.width,E=S.height,w=S.dataFormat,this.width=b,this.height=E,this.format=o,this.type=s,this.dataFormat=w,this.border=l,this.mipmaps=m;var P=yn({},C.a.UNPACK_FLIP_Y_WEBGL,y),T=Object.assign({},P,v);this._isNPOT()&&(Y.a.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),m=!1,this._updateForNPOT(d)),this.setImageData({data:t,width:b,height:E,format:o,type:s,dataFormat:w,border:l,mipmaps:m,parameters:T}),m&&this.generateMipmap(),this.setParameters(d),f&&(this.data=t)}},{key:"resize",value:function(e){var t=e.width,n=e.height;return t!==this.width||n!==this.height?this.initialize({width:t,height:n,format:this.format,type:this.type,dataFormat:this.dataFormat,border:this.border,mipmaps:!1}):this}},{key:"generateMipmap",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.gl.bindTexture(this.target,this.handle),St(this.gl,t,function(){e.gl.generateMipmap(e.target)}),this.gl.bindTexture(this.target,null),this}},{key:"setImageData",value:function(e){var t=this,n=e.target,r=void 0===n?this.target:n,i=e.pixels,o=void 0===i?null:i,a=e.data,s=void 0===a?null:a,u=e.width,l=e.height,c=e.level,f=void 0===c?0:c,h=e.format,d=void 0===h?C.a.RGBA:h,p=e.type,v=e.dataFormat,g=e.offset,y=void 0===g?0:g,_=e.border,m=void 0===_?0:_,b=e.compressed,E=void 0!==b&&b,w=e.parameters,S=void 0===w?{}:w;s||(s=o);var P=this._deduceParameters({format:d,type:p,dataFormat:v,compressed:E,data:s,width:u,height:l});p=P.type,v=P.dataFormat,E=P.compressed,u=P.width,l=P.height;var T=this.gl;T.bindTexture(this.target,this.handle);var x,O=this._getDataType({data:s,compressed:E});s=O.data,x=O.dataType,St(this.gl,S,function(){switch(x){case"null":T.texImage2D(r,f,d,u,l,m,v,p,s);break;case"typed-array":T.texImage2D(r,f,d,u,l,m,v,p,s,y);break;case"buffer":B(T),T.bindBuffer(C.a.PIXEL_UNPACK_BUFFER,s.handle||s),T.texImage2D(r,f,d,u,l,m,d,p,y);break;case"browser-object":T.texImage2D(r,f,d,d,p,s);break;case"compressed":T.compressedTexImage2D(t.target,f,d,u,l,m,s);break;default:A(!1,"Unknown image data type")}})}},{key:"setSubImageData",value:function(e){var t=this,n=e.target,i=void 0===n?this.target:n,o=e.pixels,a=void 0===o?null:o,s=e.data,u=void 0===s?null:s,l=e.x,c=void 0===l?0:l,f=e.y,h=void 0===f?0:f,d=e.width,p=e.height,v=e.level,g=void 0===v?0:v,y=e.format,_=void 0===y?C.a.RGBA:y,m=e.type,b=e.dataFormat,E=e.compressed,w=void 0!==E&&E,S=e.offset,P=void 0===S?0:S,T=e.border,A=void 0===T?0:T,x=e.parameters,O=void 0===x?{}:x,R=this._deduceParameters({format:_,type:m,dataFormat:b,compressed:w,data:u,width:d,height:p});if(m=R.type,b=R.dataFormat,w=R.compressed,d=R.width,p=R.height,u||(u=a),u&&u.data){var k=u;u=k.data,d=k.shape[0],p=k.shape[1]}dn(u,zt)&&(u=u.handle),this.gl.bindTexture(this.target,this.handle),St(this.gl,O,function(){w?t.gl.compressedTexSubImage2D(i,g,c,h,d,p,_,u):null===u?t.gl.texSubImage2D(i,g,_,d,p,A,b,m,null):ArrayBuffer.isView(u)?t.gl.texSubImage2D(i,g,c,h,d,p,_,m,u,P):dn(u,r.b)?(B(t.gl),t.gl.bindBuffer(C.a.PIXEL_UNPACK_BUFFER,u),t.gl.texSubImage2D(i,g,_,d,p,A,_,m,P),t.gl.bindBuffer(C.a.GL_PIXEL_UNPACK_BUFFER,null)):t.gl.texSubImage2D(i,g,c,h,_,m,u)}),this.gl.bindTexture(this.target,null)}},{key:"copyFramebuffer",value:function(e){var t=e.target,n=(void 0===t&&this.target,e.framebuffer),r=(e.offset,e.x),i=void 0===r?0:r,o=e.y,a=void 0===o?0:o,s=e.width,u=e.height,l=e.level,c=void 0===l?0:l,f=e.internalFormat,h=void 0===f?C.a.RGBA:f,d=e.border,p=void 0===d?0:d;n&&n.bind(),this.bind(),this.gl.copyTexImage2D(this.target,c,h,i,a,s,u,p),this.unbind(),n&&n.unbind()}},{key:"getActiveUnit",value:function(){return this.gl.getParameter(C.a.ACTIVE_TEXTURE)-C.a.TEXTURE0}},{key:"bind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit;if(void 0===e)throw new Error("Texture.bind: must specify texture unit");return this.textureUnit=e,this.gl.activeTexture(C.a.TEXTURE0+e),this.gl.bindTexture(this.target,this.handle),e}},{key:"unbind",value:function(){if(void 0===this.textureUnit)throw new Error("Texture.unbind: texture unit not specified");return this.gl.activeTexture(C.a.TEXTURE0+this.textureUnit),this.gl.bindTexture(this.target,null),this.textureUnit}},{key:"_getDataType",value:function(e){var t=e.data,n=e.compressed;return void 0!==n&&n?{data:t,dataType:"compressed"}:null===t?{data:t,dataType:"null"}:ArrayBuffer.isView(t)?{data:t,dataType:"typed-array"}:dn(t,zt)?{data:t.handle,dataType:"buffer"}:dn(t,r.b)?{data:t,dataType:"buffer"}:{data:t,dataType:"browser-object"}}},{key:"setImage3D",value:function(e){var t=e.level,n=void 0===t?0:t,r=e.internalformat,i=void 0===r?C.a.RGBA:r,o=e.width,a=e.height,s=e.depth,u=void 0===s?1:s,l=e.border,c=void 0===l?0:l,f=e.format,h=e.type,d=void 0===h?C.a.UNSIGNED_BYTE:h,p=e.offset,v=void 0===p?0:p,g=e.pixels;return ArrayBuffer.isView(g)?(this.gl.texImage3D(this.target,n,i,o,a,u,c,f,d,g),this):(dn(g,zt)&&(this.gl.bindBuffer(C.a.PIXEL_UNPACK_BUFFER,g.handle),this.gl.texImage3D(this.target,n,i,o,a,u,c,f,d,v)),this)}},{key:"_deduceParameters",value:function(e){var t=e.format,n=e.data,r=e.width,i=e.height,o=e.dataFormat,a=e.type,s=e.compressed,u=mn[t];o=o||u&&u.dataFormat,a=a||u&&u.types[0],s=s||u&&u.compressed;var l=this._deduceImageSize({data:n,width:r,height:i});return{dataFormat:o,type:a,compressed:s,width:r=l.width,height:i=l.height,format:t,data:n}}},{key:"_deduceImageSize",value:function(e){var t,n=e.data,r=e.width,i=e.height;return A(t="undefined"!=typeof ImageData&&dn(n,ImageData)?{width:n.width,height:n.height}:"undefined"!=typeof HTMLImageElement&&dn(n,HTMLImageElement)?{width:n.naturalWidth,height:n.naturalHeight}:"undefined"!=typeof HTMLCanvasElement&&dn(n,HTMLCanvasElement)?{width:n.width,height:n.height}:"undefined"!=typeof HTMLVideoElement&&dn(n,HTMLVideoElement)?{width:n.videoWidth,height:n.videoHeight}:n?{width:r,height:i}:{width:r>=0?r:1,height:i>=0?i:1},"Could not deduced texture size"),A(void 0===r||t.width===r,"Deduced texture width does not match supplied width"),A(void 0===i||t.height===i,"Deduced texture height does not match supplied height"),t}},{key:"_createHandle",value:function(){return this.gl.createTexture()}},{key:"_deleteHandle",value:function(){this.gl.deleteTexture(this.handle)}},{key:"_getParameter",value:function(e){switch(e){case C.a.TEXTURE_WIDTH:return this.width;case C.a.TEXTURE_HEIGHT:return this.height;default:this.gl.bindTexture(this.target,this.handle);var t=this.gl.getTexParameter(this.target,e);return this.gl.bindTexture(this.target,null),t}}},{key:"_setParameter",value:function(e,t){switch(this.gl.bindTexture(this.target,this.handle),t=this._getNPOTParam(e,t),e){case C.a.TEXTURE_MIN_LOD:case C.a.TEXTURE_MAX_LOD:this.gl.texParameterf(this.handle,e,t);break;case C.a.TEXTURE_WIDTH:case C.a.TEXTURE_HEIGHT:throw new Error("Cannot set emulated parameter");default:this.gl.texParameteri(this.target,e,t)}return this.gl.bindTexture(this.target,null),this}},{key:"_isNPOT",value:function(){return!(j(this.gl)||W(this.width)&&W(this.height))}},{key:"_updateForNPOT",value:function(e){void 0===e[this.gl.TEXTURE_MIN_FILTER]&&(Y.a.warn("texture: ".concat(this," is Non-Power-Of-Two, forcing TEXTURE_MIN_FILTER to LINEAR"))(),e[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===e[this.gl.TEXTURE_WRAP_S]&&(Y.a.warn("texture: ".concat(this," is Non-Power-Of-Two, forcing TEXTURE_WRAP_S to CLAMP_TO_EDGE"))(),e[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===e[this.gl.TEXTURE_WRAP_T]&&(Y.a.warn("texture: ".concat(this," is Non-Power-Of-Two, forcing TEXTURE_WRAP_T to CLAMP_TO_EDGE"))(),e[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}},{key:"_getNPOTParam",value:function(e,t){if(this._isNPOT())switch(e){case C.a.TEXTURE_MIN_FILTER:-1===_n.indexOf(t)&&(Y.a.warn("texture: ".concat(this," is Non-Power-Of-Two, forcing TEXTURE_MIN_FILTER to LINEAR"))(),t=C.a.LINEAR);break;case C.a.TEXTURE_WRAP_S:case C.a.TEXTURE_WRAP_T:t!==C.a.CLAMP_TO_EDGE&&(Y.a.warn("texture: ".concat(this," is Non-Power-Of-Two, ").concat(O(this.gl,e)," to CLAMP_TO_EDGE"))(),t=C.a.CLAMP_TO_EDGE)}return t}}]),t}();function En(e){return(En="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function wn(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function Sn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Pn(e,t,n){return t&&Sn(e.prototype,t),n&&Sn(e,n),e}function Tn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var An,xn=function(e){function t(e){var n,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return wn(this,t),D(e),r=this,(n=!(i=(t.__proto__||Object.getPrototypeOf(t)).call(this,e,Object.assign({},o,{target:e.TEXTURE_2D})))||"object"!==En(i)&&"function"!=typeof i?Tn(r):i).initialize(o),Object.seal(Tn(n)),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");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)}(t,bn),Pn(t,null,[{key:"isSupported",value:function(e,t){return bn.isSupported(e,t)}}]),Pn(t,[{key:"bind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,t=this.gl;if(void 0===e)throw new Error("Texture.bind: must specify texture unit");return this.textureUnit=e,t.activeTexture(t.TEXTURE0+e),t.bindTexture(this.target,this.handle),e}},{key:"unbind",value:function(){var e=this.gl;if(void 0===this.textureUnit)throw new Error("Texture.unbind: texture unit not specified");return e.activeTexture(e.TEXTURE0+this.textureUnit),e.bindTexture(this.target,null),this.textureUnit}},{key:"getActiveUnit",value:function(){return this.gl.getParameter(C.a.ACTIVE_TEXTURE)-C.a.TEXTURE0}}]),t}();function On(e){return(On="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Rn(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function Cn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function kn(e,t,n){return t&&Cn(e.prototype,t),n&&Cn(e,n),e}function Mn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function In(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ln="EXT_color_buffer_float",Nn=(In(An={},C.a.DEPTH_COMPONENT16,{}),In(An,C.a.DEPTH_COMPONENT24,{gl2:!0}),In(An,C.a.DEPTH_COMPONENT32F,{gl2:!0}),In(An,C.a.STENCIL_INDEX8,{}),In(An,C.a.DEPTH_STENCIL,{}),In(An,C.a.DEPTH24_STENCIL8,{gl2:!0}),In(An,C.a.DEPTH32F_STENCIL8,{gl2:!0}),In(An,C.a.RGBA4,{}),In(An,C.a.RGB565,{}),In(An,C.a.RGB5_A1,{}),In(An,C.a.R8,{gl2:!0}),In(An,C.a.R8UI,{gl2:!0}),In(An,C.a.R8I,{gl2:!0}),In(An,C.a.R16UI,{gl2:!0}),In(An,C.a.R16I,{gl2:!0}),In(An,C.a.R32UI,{gl2:!0}),In(An,C.a.R32I,{gl2:!0}),In(An,C.a.RG8,{gl2:!0}),In(An,C.a.RG8UI,{gl2:!0}),In(An,C.a.RG8I,{gl2:!0}),In(An,C.a.RG16UI,{gl2:!0}),In(An,C.a.RG16I,{gl2:!0}),In(An,C.a.RG32UI,{gl2:!0}),In(An,C.a.RG32I,{gl2:!0}),In(An,C.a.RGB8,{gl2:!0}),In(An,C.a.RGBA8,{gl2:!0}),In(An,C.a.RGB10_A2,{gl2:!0}),In(An,C.a.RGBA8UI,{gl2:!0}),In(An,C.a.RGBA8I,{gl2:!0}),In(An,C.a.RGB10_A2UI,{gl2:!0}),In(An,C.a.RGBA16UI,{gl2:!0}),In(An,C.a.RGBA16I,{gl2:!0}),In(An,C.a.RGBA32I,{gl2:!0}),In(An,C.a.RGBA32UI,{gl2:!0}),In(An,C.a.R16F,{gl2:Ln}),In(An,C.a.RG16F,{gl2:Ln}),In(An,C.a.RGBA16F,{gl2:Ln}),In(An,C.a.R32F,{gl2:Ln}),In(An,C.a.RG32F,{gl2:Ln}),In(An,C.a.RGBA32F,{gl2:Ln}),In(An,C.a.R11F_G11F_B10F,{gl2:Ln}),An);var Fn=function(e){function t(e){var n,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Rn(this,t),r=this,(n=!(i=(t.__proto__||Object.getPrototypeOf(t)).call(this,e,o))||"object"!==On(i)&&"function"!=typeof i?Mn(r):i).initialize(o),Object.seal(Mn(n)),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");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)}(t,Ft),kn(t,null,[{key:"isSupported",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).format;return!t||function(e,t,n){var r=n[t];if(!r)return!1;var i=j(e)&&r.gl2||r.gl1;return"string"==typeof i?e.getExtension(i):i}(e,t,Nn)}},{key:"getSamplesForFormat",value:function(e,t){var n=t.format;return e.getInternalformatParameter(36161,n,32937)}}]),kn(t,[{key:"initialize",value:function(e){var t=e.format,n=e.width,r=void 0===n?1:n,i=e.height,o=void 0===i?1:i,a=e.samples,s=void 0===a?0:a;return A(t,"Needs format"),this.gl.bindRenderbuffer(36161,this.handle),0!==s&&j(this.gl)?this.gl.renderbufferStorageMultisample(36161,s,t,r,o):this.gl.renderbufferStorage(36161,t,r,o),this.format=t,this.width=r,this.height=o,this.samples=s,this}},{key:"resize",value:function(e){var t=e.width,n=e.height;return t!==this.width||n!==this.height?this.initialize({width:t,height:n,format:this.format,samples:this.samples}):this}},{key:"_createHandle",value:function(){return this.gl.createRenderbuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteRenderbuffer(this.handle)}},{key:"_syncHandle",value:function(e){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}},{key:"_getParameter",value:function(e){return this.gl.bindRenderbuffer(36161,this.handle),this.gl.getRenderbufferParameter(36161,e)}}]),t}();function jn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var Dn=256,Bn=1024,Un=16384,Gn=6144,Vn=6145,zn=6146,Xn=34041,Wn="clear: bad arguments";function Hn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.framebuffer,r=void 0===n?null:n,i=t.color,o=void 0===i?null:i,a=t.depth,s=void 0===a?null:a,u=t.stencil,l=void 0===u?null:u,c={};r&&(c.framebuffer=r);var f=0;o&&(f|=Un,!0!==o&&(c.clearColor=o)),s&&(f|=Dn,!0!==s&&(c.clearDepth=s)),l&&(f|=Bn,!0!==s&&(c.clearStencil=s)),A(0!==f,Wn),St(e,c,function(){e.clear(f)})}function Yn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.framebuffer,r=void 0===n?null:n,i=t.buffer,o=void 0===i?Gn:i,a=t.drawBuffer,s=void 0===a?0:a,u=t.value,l=void 0===u?[0,0,0,0]:u;B(e),St(e,{framebuffer:r},function(){switch(o){case Gn:switch(l.constructor){case Int32Array:e.clearBufferiv(o,s,l);break;case Uint32Array:e.clearBufferuiv(o,s,l);break;case Float32Array:default:e.clearBufferfv(o,s,l)}break;case Vn:e.clearBufferfv(Vn,0,[l]);break;case zn:e.clearBufferiv(zn,0,[l]);break;case Xn:var t=jn(l,2),n=t[0],r=t[1];e.clearBufferfi(Xn,0,n,r);break;default:A(!1,Wn)}})}var Kn=6406,Zn=6407,qn=6408,Qn=5121,Jn=32819,$n=32820,er=33635,tr=5126;function nr(e){switch(e){case Kn:return 1;case Zn:return 3;case qn:return 4;default:return A(!1),0}}function rr(e){return(rr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ir(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function or(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function ar(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?t[Symbol.hasInstance](e):e instanceof t}function sr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ur(e,t,n){return t&&sr(e.prototype,t),n&&sr(e,n),e}function lr(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var cr=36064,fr=34069,hr=function(e){function t(e){var n,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(e,t){if(!ar(e,t))throw new TypeError("Cannot call a class as a function")}(this,t),r=this,(n=!(i=(t.__proto__||Object.getPrototypeOf(t)).call(this,e,o))||"object"!==rr(i)&&"function"!=typeof i?lr(r):i).width=null,n.height=null,n.attachments={},n.readBuffer=cr,n.drawBuffers=[cr],n.initialize(o),Object.seal(lr(n)),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");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)}(t,Ft),ur(t,[{key:"MAX_COLOR_ATTACHMENTS",get:function(){return this.gl.getParameter(this.gl.MAX_COLOR_ATTACHMENTS)}},{key:"MAX_DRAW_BUFFERS",get:function(){return this.gl.getParameter(this.gl.MAX_DRAW_BUFFERS)}}],[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.colorBufferFloat,r=t.colorBufferHalfFloat;return n&&e.getExtension(j(e)?"EXT_color_buffer_float":"WEBGL_color_buffer_float"),r&&e.getExtension(j(e)?"EXT_color_buffer_float":"EXT_color_buffer_half_float")}},{key:"getDefaultFramebuffer",value:function(e){return e.luma=e.luma||{},e.luma.defaultFramebuffer||(e.luma.defaultFramebuffer=new t(e,{handle:null,attachments:{}})),e.luma.defaultFramebuffer}}]),ur(t,[{key:"initialize",value:function(e){var t=e.width,n=void 0===t?1:t,r=e.height,i=void 0===r?1:r,o=e.attachments,a=void 0===o?null:o,s=e.color,u=void 0===s||s,l=e.depth,c=void 0===l||l,f=e.stencil,h=void 0!==f&&f,d=e.check,p=void 0===d||d,v=e.readBuffer,g=e.drawBuffers;if(A(n>=0&&i>=0,"Width and height need to be integers"),this.width=n,this.height=i,a)for(var y in a){var _=a[y];(Array.isArray(_)?_[0]:_).resize({width:n,height:i})}else a=this._createDefaultAttachments({color:u,depth:c,stencil:h,width:n,height:i});this.update({clearAttachments:!0,attachments:a,readBuffer:v,drawBuffers:g}),a&&p&&this.checkStatus()}},{key:"update",value:function(e){var t=e.attachments,n=void 0===t?{}:t,r=e.readBuffer,i=e.drawBuffers,o=e.clearAttachments,a=void 0!==o&&o;this.attach(n,{clearAttachments:a});var s=this.gl,u=s.bindFramebuffer(36160,this.handle);return r&&this._setReadBuffer(r),i&&this._setDrawBuffers(i),s.bindFramebuffer(36160,u||null),this}},{key:"resize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.width,n=e.height;if(null===this.handle)return A(void 0===t&&void 0===n),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;for(var r in void 0===t&&(t=this.gl.drawingBufferWidth),void 0===n&&(n=this.gl.drawingBufferHeight),t!==this.width&&n!==this.height&&Y.a.log(2,"Resizing framebuffer ".concat(this.id," to ").concat(t,"x").concat(n)),this.attachments)this.attachments[r].resize({width:t,height:n});return this.width=t,this.height=n,this}},{key:"attach",value:function(e){var t=this,n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).clearAttachments,r={};void 0!==n&&n&&Object.keys(this.attachments).forEach(function(e){r[e]=null}),Object.assign(r,e);var i=this.gl.bindFramebuffer(36160,this.handle);for(var o in r){A("undefined"!==o,"Misspelled framebuffer binding point?");var a=r[o],s=a;if(s)if(ar(s,Fn))this._attachRenderbuffer({attachment:o,renderbuffer:s});else if(Array.isArray(a)){var u=or(a,3),l=u[0],c=u[1],f=void 0===c?0:c,h=u[2],d=void 0===h?0:h;s=l,this._attachTexture({attachment:o,texture:l,layer:f,level:d})}else this._attachTexture({attachment:o,texture:s,layer:0,level:0});else this._unattach({attachment:o});s&&s.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,i||null),Object.assign(this.attachments,e),Object.keys(this.attachments).filter(function(e){return!t.attachments[e]}).forEach(function(e){delete t.attachments[e]})}},{key:"checkStatus",value:function(){var e=this.gl,t=e.bindFramebuffer(36160,this.handle),n=e.checkFramebufferStatus(36160);if(e.bindFramebuffer(36160,t||null),n!==e.FRAMEBUFFER_COMPLETE)throw new Error(function(e){return(hr.STATUS||{})[e]||"Framebuffer error ".concat(e)}(n));return this}},{key:"clear",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.color,n=e.depth,r=e.stencil,i=e.drawBuffers,o=void 0===i?[]:i,a=this.gl.bindFramebuffer(36160,this.handle);return(t||n||r)&&Hn(this.gl,{color:t,depth:n,stencil:r}),o.forEach(function(e,t){Yn({drawBuffer:t,value:e})}),this.gl.bindFramebuffer(36160,a||null),this}},{key:"readPixels",value:function(e){var t=e.x,n=void 0===t?0:t,r=e.y,i=void 0===r?0:r,o=e.width,a=void 0===o?this.width:o,s=e.height,u=void 0===s?this.height:s,l=e.format,c=void 0===l?C.a.RGBA:l,f=e.type,h=e.pixelArray,d=void 0===h?null:h,p=e.attachment,v=void 0===p?cr:p,g=this.gl;if(v===C.a.COLOR_ATTACHMENT0&&null===this.handle&&(v=C.a.FRONT),!d){var y=P(f=f||g.UNSIGNED_BYTE,{clamped:!1}),_=nr(c);d=d||new y(a*u*_)}f=f||S(d);var m=this.gl.bindFramebuffer(36160,this.handle);return this.gl.readPixels(n,i,a,u,c,f,d),this.gl.bindFramebuffer(36160,m||null),d}},{key:"readPixelsToBuffer",value:function(e){var t=e.x,n=void 0===t?0:t,r=e.y,i=void 0===r?0:r,o=e.width,a=void 0===o?this.width:o,s=e.height,u=void 0===s?this.height:s,l=e.format,c=void 0===l?C.a.RGBA:l,f=e.type,h=e.buffer,d=void 0===h?null:h,p=e.byteOffset,v=void 0===p?0:p,g=this.gl;if(B(g),f=f||(d?d.type:C.a.UNSIGNED_BYTE),!d){var y=nr(c),_=function(e){switch(e){case Qn:return 1;case er:case Jn:case $n:return 2;case tr:return 4;default:return A(!1),0}}(f);d=new zt(g,{bytes:v+a*u*y*_,type:f,size:y})}return d.bind({target:C.a.PIXEL_PACK_BUFFER}),St(g,{framebuffer:this},function(){g.readPixels(n,i,a,u,c,f,v)}),d.unbind({target:C.a.PIXEL_PACK_BUFFER}),d}},{key:"copyToDataUrl",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.attachment,n=void 0===t?cr:t,r=e.maxHeight,i=void 0===r?Number.MAX_SAFE_INTEGER:r,o=this.readPixels({attachment:n}),a=this.width,s=this.height;s>i;){var u=T({data:o,width:a,height:s});o=u.data,a=u.width,s=u.height}!function(e){var t=e.data,n=e.width,r=e.height,i=e.bytesPerPixel,o=void 0===i?4:i,a=e.temp,s=n*o;a=a||new Uint8Array(s);for(var u=0;u<r/2;++u){var l=u*s,c=(r-u-1)*s;a.set(t.subarray(l,l+s)),t.copyWithin(l,c,c+s),t.set(a,c)}}({data:o,width:a,height:s});var l=document.createElement("canvas");l.width=a,l.height=s;var c=l.getContext("2d"),f=c.createImageData(a,s);return f.data.set(o),c.putImageData(f,0,0),l.toDataURL()}},{key:"copyToImage",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.image,n=void 0===t?null:t,r=e.attachment,i=void 0===r?cr:r,o=e.maxHeight,a=(void 0===o&&Number.MAX_SAFE_INTEGER,this.readDataUrl({attachment:i}));return(n=n||new Image).src=a,n}},{key:"copyToTexture",value:function(e){var t=e.texture,n=e.target,r=e.xoffset,i=void 0===r?0:r,o=e.yoffset,a=void 0===o?0:o,s=e.zoffset,u=void 0===s?0:s,l=e.mipmapLevel,c=void 0===l?0:l,f=e.attachment,h=void 0===f?cr:f,d=e.x,p=void 0===d?0:d,v=e.y,g=void 0===v?0:v,y=e.width,_=e.height,m=this.gl,b=m.bindFramebuffer(36160,this.handle),E=m.readBuffer(h);switch(y=Number.isFinite(y)?y:t.width,_=Number.isFinite(_)?_:t.height,t.target){case 3553:case 34067:m.copyTexSubImage2D(n||t.target,c,i,a,p,g,y,_);break;case 35866:case 32879:m.copyTexSubImage3D(n||t.target,c,i,a,u,p,g,y,_)}return m.readBuffer(E),m.bindFramebuffer(36160,b||null),t}},{key:"blit",value:function(e){var t=e.srcFramebuffer,n=e.attachment,r=void 0===n?cr:n,i=e.srcX0,o=void 0===i?0:i,a=e.srcY0,s=void 0===a?0:a,u=e.srcX1,l=e.srcY1,c=e.dstX0,f=void 0===c?0:c,h=e.dstY0,d=void 0===h?0:h,p=e.dstX1,v=e.dstY1,g=e.color,y=void 0===g||g,_=e.depth,m=void 0!==_&&_,b=e.stencil,E=void 0!==b&&b,w=e.mask,S=void 0===w?0:w,P=e.filter,T=void 0===P?C.a.NEAREST:P,x=this.gl;B(x),t.handle||r!==cr||(r=C.a.FRONT),y&&(S|=16384),m&&(S|=256),E&&(S|=1024),A(S),u=void 0===u?t.width:u,l=void 0===l?t.height:l,p=void 0===p?this.width:p,v=void 0===v?this.height:v;var O=x.bindFramebuffer(36008,this.handle),R=x.bindFramebuffer(36009,t.handle);return x.readBuffer(r),x.blitFramebuffer(o,s,u,l,f,d,p,v,S,T),x.readBuffer(this.readBuffer),x.bindFramebuffer(36009,R||null),x.bindFramebuffer(36008,O||null),this}},{key:"invalidate",value:function(e){var t=e.attachments,n=void 0===t?[]:t,r=e.x,i=void 0===r?0:r,o=e.y,a=void 0===o?0:o,s=e.width,u=e.height,l=this.gl;B(l);var c=l.bindFramebuffer(36009,this.handle);return 0===i&&0===a&&void 0===s&&void 0===u?l.invalidateFramebuffer(36009,n):l.invalidateFramebuffer(36009,n,i,a,s,u),l.bindFramebuffer(36009,c),this}},{key:"getAttachmentParameter",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.attachment,n=void 0===t?cr:t,r=e.pname,i=this._getAttachmentParameterFallback(r);return null===i&&(this.gl.bindTexture(36160,this.handle),i=this.gl.getFramebufferAttachmentParameter(36160,n,r),this.gl.bindTexture(36160,null)),i}},{key:"getAttachmentParameters",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.constructor.ATTACHMENT_PARAMETERS||{},t={};for(var n in e)t[n]=this.getAttachmentParameter(n);return this}},{key:"show",value:function(){return"undefined"!=typeof window&&window.open(this.copyToDataUrl(),"luma-debug-texture"),this}},{key:"log",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.priority,n=void 0===t?0:t,r=e.message,i=void 0===r?"":r;if(n>Y.a.priority||"undefined"==typeof window)return this;i=i||"Framebuffer ".concat(this.id);var o=this.copyToDataUrl({maxHeight:100});return Y.a.image({priority:n,message:i,image:o},i)(),this}},{key:"bind",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).target,t=void 0===e?36160:e;return this.gl.bindFramebuffer(t,this.handle),this}},{key:"unbind",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).target,t=void 0===e?36160:e;return this.gl.bindFramebuffer(t,null),this}},{key:"_createDefaultAttachments",value:function(e){var t,n=e.color,r=e.depth,i=(e.stencil,e.width),o=e.height,a=null;n&&((a=a||{})[cr]=new xn(this.gl,{pixels:null,format:C.a.RGBA,type:C.a.UNSIGNED_BYTE,width:i,height:o,mipmaps:!1,parameters:(t={},ir(t,C.a.TEXTURE_MIN_FILTER,C.a.NEAREST),ir(t,C.a.TEXTURE_MAG_FILTER,C.a.NEAREST),ir(t,C.a.TEXTURE_WRAP_S,C.a.CLAMP_TO_EDGE),ir(t,C.a.TEXTURE_WRAP_T,C.a.CLAMP_TO_EDGE),t)}));return r&&((a=a||{})[36096]=new Fn(this.gl,{format:C.a.DEPTH_COMPONENT16,width:i,height:o})),a}},{key:"_unattach",value:function(e){var t=e.attachment;this.gl.bindRenderbuffer(36161,this.handle),this.gl.framebufferRenderbuffer(36160,t,36161,null),delete this.attachments[t]}},{key:"_attachRenderbuffer",value:function(e){var t=e.attachment,n=void 0===t?cr:t,r=e.renderbuffer;this.gl.framebufferRenderbuffer(36160,n,36161,r.handle),this.attachments[n]=r}},{key:"_attachTexture",value:function(e){var t=e.attachment,n=void 0===t?cr:t,r=e.texture,i=e.layer,o=e.level,a=this.gl;switch(a.bindTexture(r.target,r.handle),r.target){case 35866:case 32879:a.framebufferTextureLayer(36160,n,r.target,o,i);break;case 34067:var s=function(e){return e<fr?e+fr:e}(i);a.framebufferTexture2D(36160,n,s,r.handle,o);break;case 3553:a.framebufferTexture2D(36160,n,3553,r.handle,o);break;default:A(!1,"Illegal texture type")}a.bindTexture(r.target,null),this.attachments[n]=r}},{key:"_setReadBuffer",value:function(e,t){j(e)?e.readBuffer(t):A(t===cr||t===C.a.BACK,"Multiple render targets not supported"),this.readBuffer=t}},{key:"_setDrawBuffers",value:function(e,t){if(j(e))e.drawBuffers(t);else{var n=e.getExtension("WEBGL_draw_buffers");n?n.drawBuffersWEBGL(t):A(1===t.length&&(t[0]===cr||t[0]===C.a.BACK),"Multiple render targets not supported")}this.drawBuffers=t}},{key:"_getAttachmentParameterFallback",value:function(e){var t=kt(this.gl);switch(e){case C.a.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:return t.webgl2?null:0;case C.a.FRAMEBUFFER_ATTACHMENT_RED_SIZE:case C.a.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:case C.a.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:case C.a.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:case C.a.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:case C.a.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:return t.webgl2?null:8;case C.a.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:return t.webgl2?null:C.a.UNSIGNED_INT;case C.a.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:return t.webgl2||t.EXT_sRGB?null:C.a.LINEAR;default:return null}}},{key:"_createHandle",value:function(){return this.gl.createFramebuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteFramebuffer(this.handle)}},{key:"color",get:function(){return this.attachments[cr]||null}},{key:"texture",get:function(){return this.attachments[cr]||null}},{key:"depth",get:function(){return this.attachments[36096]||null}},{key:"stencil",get:function(){return this.attachments[36128]||null}}]),t}();function dr(e){return(dr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function pr(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function vr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function gr(e,t,n){return t&&vr(e.prototype,t),n&&vr(e,n),e}function yr(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var _r,mr=function(e){function t(e,n){var r,i,o;return pr(this,t),B(e),i=this,r=!(o=(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n))||"object"!==dr(o)&&"function"!=typeof o?yr(i):o,Object.seal(yr(r)),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");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)}(t,Ft),gr(t,null,[{key:"isSupported",value:function(e){return j(e)}},{key:"isHandle",value:function(e){return this.gl.isSampler(this.handle)}}]),gr(t,[{key:"bind",value:function(e){return this.gl.bindSampler(e,this.handle),this}},{key:"unbind",value:function(e){return this.gl.bindSampler(e,null),this}},{key:"_createHandle",value:function(){return this.gl.createSampler()}},{key:"_deleteHandle",value:function(){this.gl.deleteSampler(this.handle)}},{key:"_getParameter",value:function(e){return this.gl.getSamplerParameter(this.handle,e)}},{key:"_setParameter",value:function(e,t){switch(e){case C.a.TEXTURE_MIN_LOD:case C.a.TEXTURE_MAX_LOD:this.gl.samplerParameterf(this.handle,e,t);break;default:this.gl.samplerParameteri(this.handle,e,t)}return this}}]),t}();function br(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?t[Symbol.hasInstance](e):e instanceof t}function Er(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var wr=(Er(_r={},5126,function(e,t,n){return e.uniform1f(t,n)}),Er(_r,35664,function(e,t,n){return e.uniform2fv(t,xr(n,2))}),Er(_r,35665,function(e,t,n){return e.uniform3fv(t,xr(n,3))}),Er(_r,35666,function(e,t,n){return e.uniform4fv(t,xr(n,4))}),Er(_r,5124,function(e,t,n){return e.uniform1i(t,n)}),Er(_r,35667,function(e,t,n){return e.uniform2iv(t,Or(n,2))}),Er(_r,35668,function(e,t,n){return e.uniform3iv(t,Or(n,3))}),Er(_r,35669,function(e,t,n){return e.uniform4iv(t,Or(n,4))}),Er(_r,35670,function(e,t,n){return e.uniform1i(t,n)}),Er(_r,35671,function(e,t,n){return e.uniform2iv(t,Or(n,2))}),Er(_r,35672,function(e,t,n){return e.uniform3iv(t,Or(n,3))}),Er(_r,35673,function(e,t,n){return e.uniform4iv(t,Or(n,4))}),Er(_r,35674,function(e,t,n){return e.uniformMatrix2fv(t,!1,xr(n,4))}),Er(_r,35675,function(e,t,n){return e.uniformMatrix3fv(t,!1,xr(n,9))}),Er(_r,35676,function(e,t,n){return e.uniformMatrix4fv(t,!1,xr(n,16))}),Er(_r,35678,function(e,t,n){return e.uniform1i(t,n)}),Er(_r,35680,function(e,t,n){return e.uniform1i(t,n)}),Er(_r,5125,function(e,t,n){return e.uniform1ui(t,n)}),Er(_r,36294,function(e,t,n){return e.uniform2uiv(t,Rr(n,2))}),Er(_r,36295,function(e,t,n){return e.uniform3uiv(t,Rr(n,3))}),Er(_r,36296,function(e,t,n){return e.uniform4uiv(t,Rr(n,4))}),Er(_r,35685,function(e,t,n){return e.uniformMatrix2x3fv(t,!1,xr(n,6))}),Er(_r,35686,function(e,t,n){return e.uniformMatrix2x4fv(t,!1,xr(n,8))}),Er(_r,35687,function(e,t,n){return e.uniformMatrix3x2fv(t,!1,xr(n,6))}),Er(_r,35688,function(e,t,n){return e.uniformMatrix3x4fv(t,!1,xr(n,12))}),Er(_r,35689,function(e,t,n){return e.uniformMatrix4x2fv(t,!1,xr(n,8))}),Er(_r,35690,function(e,t,n){return e.uniformMatrix4x3fv(t,!1,xr(n,12))}),Er(_r,35679,function(e,t,n){return e.uniform1i(t,n)}),Er(_r,35682,function(e,t,n){return e.uniform1i(t,n)}),Er(_r,36289,function(e,t,n){return e.uniform1i(t,n)}),Er(_r,36292,function(e,t,n){return e.uniform1i(t,n)}),Er(_r,36293,function(e,t,n){return e.uniform1i(t,n)}),Er(_r,36298,function(e,t,n){return e.uniform1i(t,n)}),Er(_r,36299,function(e,t,n){return e.uniform1i(t,n)}),Er(_r,36300,function(e,t,n){return e.uniform1i(t,n)}),Er(_r,36303,function(e,t,n){return e.uniform1i(t,n)}),Er(_r,36306,function(e,t,n){return e.uniform1i(t,n)}),Er(_r,36307,function(e,t,n){return e.uniform1i(t,n)}),Er(_r,36308,function(e,t,n){return e.uniform1i(t,n)}),Er(_r,36311,function(e,t,n){return e.uniform1i(t,n)}),_r),Sr={},Pr={},Tr={};function Ar(e,t,n,r){var i=e.length;if(i%t&&Y.a.warn("Uniform size should be multiples of ".concat(t),e)(),br(e,n))return e;var o=r[i];o||(o=new n(i),r[i]=o);for(var a=0;a<i;a++)o[a]=e[a];return o}function xr(e,t){return Ar(e,t,Float32Array,Sr)}function Or(e,t){return Ar(e,t,Int32Array,Pr)}function Rr(e,t){return Ar(e,t,Uint32Array,Tr)}function Cr(e){var t=e.match(/([^\[]*)(\[[0-9]+\])?/);if(!t||t.length<2)throw new Error("Failed to parse GLSL uniform name ".concat(e));return{name:t[1],length:t[2]||1,isArray:Boolean(t[2])}}function kr(e,t,n){var r=wr[n.type];if(!r)throw new Error("Unknown GLSL uniform type ".concat(n.type));return r.bind(null,e,t)}function Mr(e){return Array.isArray(e)||ArrayBuffer.isView(e)?function(e){if(0===e.length)return!1;for(var t=Math.min(e.length,16),n=0;n<t;++n)if(!Number.isFinite(e[n]))return!1;return!0}(e):!!isFinite(e)||(!0===e||!1===e||(!(!br(e,bn)&&!br(e,mr))||!!br(e,hr)&&Boolean(e.texture)))}function Ir(e,t){if(Array.isArray(e)||ArrayBuffer.isView(e)){if(!t)return!1;var n=e.length;if(t.length!==n)return!1;for(var r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}return e===t}function Lr(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.header,n=void 0===t?"Uniforms":t,r=e.program,i=e.uniforms,o=e.undefinedOnly,a=void 0!==o&&o;A(r);var s=r._uniformSetters,u={},l=Object.keys(s).sort(),c=0,f=!0,h=!1,d=void 0;try{for(var p,v=l[Symbol.iterator]();!(f=(p=v.next()).done);f=!0){var g=p.value;g.match(".*_.*")||g.match(".*Matrix")||Nr({table:u,header:n,uniforms:i,uniformName:g,undefinedOnly:a})&&c++}}catch(e){h=!0,d=e}finally{try{f||null==v.return||v.return()}finally{if(h)throw d}}var y=!0,_=!1,m=void 0;try{for(var b,E=l[Symbol.iterator]();!(y=(b=E.next()).done);y=!0){var w=b.value;w.match(".*Matrix")&&Nr({table:u,header:n,uniforms:i,uniformName:w,undefinedOnly:a})&&c++}}catch(e){_=!0,m=e}finally{try{y||null==E.return||E.return()}finally{if(_)throw m}}var S=!0,P=!1,T=void 0;try{for(var x,O=l[Symbol.iterator]();!(S=(x=O.next()).done);S=!0){var R=x.value;u[R]||Nr({table:u,header:n,uniforms:i,uniformName:R,undefinedOnly:a})&&c++}}catch(e){P=!0,T=e}finally{try{S||null==O.return||O.return()}finally{if(P)throw T}}var C=0,k={};if(!a)for(var M in i){var I=i[M];u[M]||(C++,k[M]=Er({Type:"NOT USED: ".concat(I)},n,K(I)))}return{table:u,count:c,unusedTable:k,unusedCount:C}}function Nr(e){var t,n=e.table,r=e.header,i=e.uniforms,o=e.uniformName,a=e.undefinedOnly,s=i[o],u=function(e){return void 0!==e&&null!==e}(s);return(!a||!u)&&(n[o]=(Er(t={},r,u?K(s):"N/A"),Er(t,"Uniform Type",u?s:"NOT PROVIDED"),t),!0)}var Fr=0,jr=1,Dr=2,Br=3,Ur=4,Gr=5,Vr=6;function zr(e){switch(e){case Fr:return Fr;case jr:case Br:case Dr:return jr;case Ur:case Gr:case Vr:return Ur;default:return A(!1),0}}function Xr(e){return(Xr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Wr(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?t[Symbol.hasInstance](e):e instanceof t}function Hr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Yr(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var Kr=35980,Zr=35981,qr=function(e){function t(e){var n,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(e,t){if(!Wr(e,t))throw new TypeError("Cannot call a class as a function")}(this,t),r=this,(n=!(i=(t.__proto__||Object.getPrototypeOf(t)).call(this,e,o))||"object"!==Xr(i)&&"function"!=typeof i?Yr(r):i).initialize(o),n.vertexAttributes=fn.getDefaultArray(e),Object.seal(Yr(n)),n._setId(o.id),n}var n,r,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");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)}(t,Ft),n=t,(r=[{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vs,n=e.fs,r=e.defaultUniforms,i=e.varyings,o=e.bufferMode,a=void 0===o?Zr:o;return this.vs="string"==typeof t?new en(this.gl,t):t,this.fs="string"==typeof n?new tn(this.gl,n):n,A(Wr(this.vs,en),"Program: bad vertex shader"),A(Wr(this.fs,tn),"Program: bad fragment shader"),this.defaultUniforms=r,i?(B(this.gl),this.varyings=i,this.gl.transformFeedbackVaryings(this.handle,i,a),this.varyingMap=function(e,t){var n={},r=0;A(t===Zr||t===Kr);var i=t===Zr?1:0,o=!0,a=!1,s=void 0;try{for(var u,l=e[Symbol.iterator]();!(o=(u=l.next()).done);o=!0){var c=u.value;n[c]=r,r+=i}}catch(e){a=!0,s=e}finally{try{o||null==l.return||l.return()}finally{if(a)throw s}}return n}(i,a)):this.varyingMap={},this._compileAndLink(),this._isCached=!1,this}},{key:"checkAttributeBindings",value:function(e){var t=e.vertexArray,n=t?t.filledLocations:this.vertexAttributes.filledLocations;for(var r in this._attributeToLocationMap){var i=this._attributeToLocationMap[r];n[i]||this._warnedLocations[i]||(Y.a.warn("Program ".concat(this.id,": Attribute ").concat(i,":").concat(r," not supplied"))(),this._warnedLocations[i]=!0)}return this}},{key:"delete",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isCached?this:function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,r)}if("value"in i)return i.value;var a=i.get;return void 0!==a?a.call(r):void 0}(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"delete",this).call(this,e)}},{key:"reset",value:function(){this.unsetBuffers()}},{key:"use",value:function(){return this.gl.useProgram(this.handle),this}},{key:"draw",value:function(e){var t=this,n=e.drawMode,r=void 0===n?C.a.TRIANGLES:n,i=e.vertexCount,o=e.offset,a=void 0===o?0:o,s=e.start,u=e.end,l=e.isIndexed,c=void 0!==l&&l,f=e.indexType,h=void 0===f?C.a.UNSIGNED_SHORT:f,d=e.isInstanced,p=void 0!==d&&d,v=e.instanceCount,g=void 0===v?0:v,y=e.vertexArray,_=void 0===y?null:y,m=e.transformFeedback,b=void 0===m?null:m,E=e.uniforms,w=void 0===E?{}:E,S=e.samplers,P=void 0===S?{}:S,T=e.parameters,A=void 0===T?{}:T;return(_=_||fn.getDefaultArray(this.gl)).bind(function(){if(t.gl.useProgram(t.handle),b){var e=zr(r);b.begin(e)}t.setUniforms(w,P),St(t.gl,A,function(){c&&p?t.ext.drawElementsInstanced(r,i,h,a,g):c&&j(t.gl)&&!isNaN(s)&&!isNaN(u)?t.gl.drawElementsRange(r,s,u,i,h,a):c?t.gl.drawElements(r,i,h,a):p?t.ext.drawArraysInstanced(r,a,i,g):t.gl.drawArrays(r,a,i)}),b&&b.end()}),this}},{key:"setAttributes",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.clear,r=void 0===n||n,i=t.drawParams,o=void 0===i?{}:i;r&&this.vertexAttributes.clearBindings(),o.isInstanced=!1,o.isIndexed=!1,o.indexType=null;for(var a=this._sortBuffersByLocation(e),s=a.locations,u=a.elements,l=0;l<s.length;++l){var c=e[s[l]];c?c.isGeneric?this._setAttributeToGeneric({location:l,array:c.value}):(this._setAttributeToBuffer({location:l,buffer:c.getBuffer(),layout:c}),Object.assign(o,{isInstanced:c.instanced>0})):this.vertexAttributes.disable(l)}if(u){var f=e[u];f.getBuffer().bind(),o.isIndexed=!0,o.indexType=f.type}return this}},{key:"setBuffers",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.clear,r=void 0===n||n,i=t.drawParams,o=void 0===i?{}:i;Y.a.deprecated("Program: `setBuffers`","`setAttributes`"),r&&this.vertexAttributes.clearBindings(),o.isInstanced=!1,o.isIndexed=!1,o.indexType=null;for(var a=this._sortBuffersByLocation(e),s=a.locations,u=a.elements,l=0;l<s.length;++l){var c=e[s[l]];c?Wr(c,zt)?(this._setAttributeToBuffer({location:l,buffer:c,layout:c.layout}),Object.assign(o,{isInstanced:c.layout.instanced>0})):this._setAttributeToGeneric({location:l,array:c}):this.vertexAttributes.disable(l)}if(u){var f=e[u];f.bind(),o.isIndexed=!0,o.indexType=f.layout.type}return this}},{key:"unsetBuffers",value:function(){for(var e=this._attributeCount,t=1;t<e;++t)this.vertexAttributes.disable(t);return this.gl.bindBuffer(C.a.ELEMENT_ARRAY_BUFFER,null),this}},{key:"setUniforms",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(var n in e){var r=e[n],i=this._uniformSetters[n],o=t[n];if(i)if(Wr(r,hr)&&(r=r.texture),Wr(r,bn)){void 0===i.textureIndex&&(i.textureIndex=this._textureIndexCounter++);var a=r,s=i.textureIndex;a.bind(s),o&&o.bind(s),i(s)}else i(r)}return this}},{key:"uniformBlockBinding",value:function(e,t){B(this.gl),this.gl.uniformBlockBinding(this.handle,e,t)}},{key:"getAttributeCount",value:function(){return this._getParameter(C.a.ACTIVE_ATTRIBUTES)}},{key:"getAttributeLocation",value:function(e){return this.gl.getAttribLocation(this.handle,e)}},{key:"getAttributeInfo",value:function(e){return this.gl.getActiveAttrib(this.handle,e)}},{key:"getUniformCount",value:function(){return this._getParameter(C.a.ACTIVE_UNIFORMS)}},{key:"getUniformInfo",value:function(e){return this.gl.getActiveUniform(this.handle,e)}},{key:"getUniformLocation",value:function(e){return this.gl.getUniformLocation(this.handle,e)}},{key:"getUniformValue",value:function(e){return this.gl.getUniform(this.handle,e)}},{key:"getActiveUniforms",value:function(e,t){return this.gl.getActiveUniforms(this.handle,e,t)}},{key:"getVarying",value:function(e,t){return this.gl.getTransformFeedbackVarying(e,t)}},{key:"getFragDataLocation",value:function(e){return B(this.gl),this.gl.getFragDataLocation(this.handle,e)}},{key:"getAttachedShaders",value:function(){return this.gl.getAttachedShaders(this.handle)}},{key:"getUniformBlockIndex",value:function(e){return B(this.gl),this.gl.getUniformBlockIndex(this.handle,e)}},{key:"getActiveUniformBlockParameter",value:function(e,t){return B(this.gl),this.gl.getActiveUniformBlockParameter(this.handle,e,t)}},{key:"_setAttributeToGeneric",value:function(e){var t=e.location,n=e.array;this.vertexAttributes.setGeneric({location:t,array:n}),this.vertexAttributes.disable(t,!0)}},{key:"_setAttributeToBuffer",value:function(e){var t=e.location,n=e.buffer,r=e.layout,i=r.instanced?1:0;this.vertexAttributes.setBuffer({location:t,buffer:n,layout:r}),this.vertexAttributes.setDivisor(t,i),this.vertexAttributes.enable(t)}},{key:"_compileAndLink",value:function(){var e=this.gl;if((e.attachShader(this.handle,this.vs.handle),e.attachShader(this.handle,this.fs.handle),Y.a.time(3,"linkProgram for ".concat(this._getName()))(),e.linkProgram(this.handle),Y.a.timeEnd(3,"linkProgram for ".concat(this._getName()))(),e.debug||Y.a.priority>0)&&(e.validateProgram(this.handle),!e.getProgramParameter(this.handle,e.LINK_STATUS)))throw new Error("Error linking ".concat(e.getProgramInfoLog(this.handle)));this._queryAttributeLocations(),this._queryUniformLocations()}},{key:"_sortBuffersByLocation",value:function(e){var t=null,n=[];if(H(e))return{locations:n,elements:t};for(var r in n=new Array(this._attributeCount),e){var i=e[r],o=this._attributeToLocationMap[r];if(void 0===o){if(i.target===C.a.ELEMENT_ARRAY_BUFFER&&t)throw new Error("".concat(this._print(r)," duplicate GL.ELEMENT_ARRAY_BUFFER"));i.target===C.a.ELEMENT_ARRAY_BUFFER?t=r:this._warnedLocations[o]||(Y.a.log(2,"".concat(this._print(r)," not used"))(),this._warnedLocations[o]=!0)}else{if(i.target===C.a.ELEMENT_ARRAY_BUFFER)throw new Error("".concat(this._print(r),":").concat(o," ")+"has both location and type gl.ELEMENT_ARRAY_BUFFER");n[o]=r}}return{locations:n,elements:t}}},{key:"_areAllAttributesEnabled",value:function(){for(var e=this._attributeCount,t=0;t<e;++t)if(!this.vertexAttributes.isEnabled(t))return!1;return!0}},{key:"_print",value:function(e){return"Program ".concat(this.id,": Attribute ").concat(e)}},{key:"_createHandle",value:function(){return this.gl.createProgram()}},{key:"_deleteHandle",value:function(){this.gl.deleteProgram(this.handle)}},{key:"_getName",value:function(){var e=this.vs.getName()||this.fs.getName();return e=(e=e.replace(/shader/i,""))?"".concat(e,"-program"):"program"}},{key:"_getOptionsFromHandle",value:function(e){var t=this.gl.getAttachedShaders(e),n={},r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var u=a.value;switch(this.gl.getShaderParameter(this.handle,C.a.SHADER_TYPE)){case C.a.VERTEX_SHADER:n.vs=new en({handle:u});break;case C.a.FRAGMENT_SHADER:n.fs=new tn({handle:u})}}}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}},{key:"_getParameter",value:function(e){return this.gl.getProgramParameter(this.handle,e)}},{key:"_queryAttributeLocations",value:function(){this._attributeToLocationMap={},this._attributeCount=this.getAttributeCount();for(var e=0;e<this._attributeCount;e++){var t=this.getAttributeInfo(e).name;this._attributeToLocationMap[t]=this.getAttributeLocation(t)}this._warnedLocations={}}},{key:"_queryUniformLocations",value:function(){var e=this.gl;this._uniformSetters={},this._uniformCount=this.getUniformCount();for(var t=0;t<this._uniformCount;t++){var n=this.getUniformInfo(t),r=Cr(n.name),i=this.getUniformLocation(r.name);this._uniformSetters[r.name]=kr(e,i,n,r.isArray)}this._textureIndexCounter=0}},{key:"_setId",value:function(e){if(!e){var t=this._getName();this.id=X(t)}}}])&&Hr(n.prototype,r),i&&Hr(n,i),t}();function Qr(e){return(Qr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Jr(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function $r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ei(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var ti=[C.a.TEXTURE_CUBE_MAP_POSITIVE_X,C.a.TEXTURE_CUBE_MAP_NEGATIVE_X,C.a.TEXTURE_CUBE_MAP_POSITIVE_Y,C.a.TEXTURE_CUBE_MAP_NEGATIVE_Y,C.a.TEXTURE_CUBE_MAP_POSITIVE_Z,C.a.TEXTURE_CUBE_MAP_NEGATIVE_Z],ni=function(e){function t(e){var n,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Jr(this,t),r=this,(n=!(i=(t.__proto__||Object.getPrototypeOf(t)).call(this,e,Object.assign({},o,{target:C.a.TEXTURE_CUBE_MAP})))||"object"!==Qr(i)&&"function"!=typeof i?ei(r):i).initialize(o),Object.seal(ei(n)),n}var n,r,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");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)}(t,bn),n=t,(r=[{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.format,n=void 0===t?C.a.RGBA:t,r=e.mipmaps,i=void 0===r||r,o=e.width,a=void 0===o?1:o,s=e.height,u=void 0===s?1:s,l=e.type,c=void 0===l?C.a.UNSIGNED_BYTE:l,f=e.dataFormat,h=this._deduceParameters({format:n,type:c,dataFormat:f});c=h.type,f=h.dataFormat;var d=this._deduceImageSize({data:e[C.a.TEXTURE_CUBE_MAP_POSITIVE_X],width:a,height:u});A((a=d.width)===(u=d.height)),this.setCubeMapImageData(e),i&&this.generateMipmap(e),this.opts=e}},{key:"subImage",value:function(e){var t=e.face,n=e.data,r=e.x,i=void 0===r?0:r,o=e.y,a=void 0===o?0:o,s=e.mipmapLevel,u=void 0===s?0:s;return this._subImage({target:t,data:n,x:i,y:a,mipmapLevel:u})}},{key:"setCubeMapImageData",value:function(e){var t=e.width,n=e.height,r=e.pixels,i=e.data,o=e.border,a=void 0===o?0:o,s=e.format,u=void 0===s?C.a.RGBA:s,l=e.type,c=void 0===l?C.a.UNSIGNED_BYTE:l,f=(e.generateMipmap,this.gl);if(r=r||i,this.bind(),this.width||this.height)for(var h=0;h<ti.length;h++){var d=ti[h];f.texImage2D(d,0,u,t,n,a,u,c,r[d])}else for(var p=0;p<ti.length;p++){var v=ti[p];f.texImage2D(v,0,u,u,c,r[v])}}},{key:"bind",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).index;return void 0!==e&&this.gl.activeTexture(C.a.TEXTURE0+e),this.gl.bindTexture(C.a.TEXTURE_CUBE_MAP,this.handle),e}},{key:"unbind",value:function(){return this.gl.bindTexture(C.a.TEXTURE_CUBE_MAP,null),this}}])&&$r(n.prototype,r),i&&$r(n,i),t}();function ri(e,t){var n=t.drawMode,r=void 0===n?C.a.TRIANGLES:n,i=t.vertexCount,o=t.offset,a=void 0===o?0:o,s=t.isIndexed,u=void 0!==s&&s,l=t.indexType,c=void 0===l?C.a.UNSIGNED_SHORT:l,f=t.isInstanced,h=void 0!==f&&f,d=t.instanceCount,p=void 0===d?0:d;D(e);e.getExtension("ANGLE_instanced_arrays");if(h){var v=isWebGL2(e),g=e.getExtension("ANGLE_instanced_arrays"),y=v?e:g,_=v?"":"ANGLE",m="drawArraysInstanced"+_;u?y["drawElementsInstanced"+_](r,i,c,a,p):y[m](r,a,i,p)}else u?e.drawElements(r,i,c,a):e.drawArrays(r,a,i)}function ii(e,t){var n=t.x,r=t.y,i=t.width,o=void 0===i?1:i,a=t.height,s=void 0===a?1:a,u=t.data,l=t.dataOffset,c=void 0===l?0:l,f=t.type,h=void 0===f?C.a.UNSIGNED_BYTE:f,d=t.sourceHeight,p=t.format,v=void 0===p?C.a.RGBA:p;return u=u||new Uint8Array(4*o*s),r=d?d-r:r,c?(B(e),e.readPixels(n,r,o,s,v,h,u,c)):e.readPixels(n,r,o,s,v,h,u),u}function oi(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function ai(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}ni.FACES=ti;var si=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oi(this,e);var r=n.id,i=void 0===r?"unnamed-attribute":r,o=n.type,a=n.isIndexed,s=void 0!==a&&a;this.gl=t,this.id=i,this.isIndexed=s,this.target=s?C.a.ELEMENT_ARRAY_BUFFER:C.a.ARRAY_BUFFER,this.type=o,this.value=null,this.externalBuffer=null,this.buffer=null,this.userData={},this.update(n),Object.seal(this),this._validateAttributeDefinition()}var t,n,r;return t=e,(n=[{key:"delete",value:function(){this.buffer&&(this.buffer.delete(),this.buffer=null)}},{key:"update",value:function(e){var t=e.value,n=e.buffer,r=e.size,i=void 0===r?this.size:r,o=e.offset,a=void 0===o?this.offset||0:o,s=e.stride,u=void 0===s?this.stride||0:s,l=e.normalized,c=void 0===l?this.normalized||!1:l,f=e.integer,h=void 0===f?this.integer||!1:f,d=e.instanced,p=void 0===d?this.instanced||0:d,v=e.isGeneric,g=void 0===v?this.isGeneric||!1:v,y=e.isInstanced;this.size=i,this.offset=a,this.stride=u,this.normalized=c,this.integer=h,this.isGeneric=g,this.instanced=void 0!==y?y?1:0:p,n?(this.externalBuffer=n,this.type=n.type):t&&(this.externalBuffer=null,this.value=t,g||(this.buffer=this.buffer||new zt(this.gl,{target:this.target,type:this.type}),this.buffer.setData({data:t}),this.type=this.buffer.type))}},{key:"getBuffer",value:function(){return this.isGeneric?null:this.externalBuffer||this.buffer}},{key:"_validateAttributeDefinition",value:function(){A(this.size>=1&&this.size<=4,"Attribute definition for ".concat(this.id," invalid size"))}}])&&ai(t.prototype,n),r&&ai(t,r),e}();function ui(e){return(ui="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function li(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function ci(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function fi(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var hi=function(e){function t(e,n){var r,i,o;return li(this,t),B(e),i=this,(r=!(o=(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n))||"object"!==ui(o)&&"function"!=typeof o?fi(i):o).promise=null,Object.seal(fi(r)),r}var n,r,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");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)}(t,Ft),n=t,(r=[{key:"wait",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.flags,n=void 0===t?0:t,r=e.timeout,i=void 0===r?C.a.TIMEOUT_IGNORED:r;return this.gl.waitSync(this.handle,n,i),this}},{key:"clientWait",value:function(e){var t=e.flags,n=void 0===t?C.a.SYNC_FLUSH_COMMANDS_BIT:t,r=e.timeout,i=this.gl.clientWaitSync(this.handle,n,r);switch(i){case C.a.ALREADY_SIGNALED:case C.a.TIMEOUT_EXPIRED:case C.a.CONDITION_SATISFIED:case C.a.WAIT_FAILED:}return i}},{key:"cancel",value:function(){at.cancelQuery(this)}},{key:"isSignaled",value:function(){return this.getParameter(C.a.SYNC_STATUS)===C.a.SIGNALED}},{key:"isResultAvailable",value:function(){return this.isSignaled()}},{key:"getResult",value:function(){return this.isSignaled()}},{key:"getParameter",value:function(e){return this.gl.getSyncParameter(this.handle,e)}},{key:"_createHandle",value:function(){return this.gl.fenceSync(C.a.SYNC_GPU_COMMANDS_COMPLETE,0)}},{key:"_deleteHandle",value:function(){at.deleteQuery(this),this.gl.deleteSync(this.handle)}}])&&ci(n.prototype,r),i&&ci(n,i),t}();function di(e){return(di="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function pi(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function vi(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function gi(e,t,n){return t&&vi(e.prototype,t),n&&vi(e,n),e}function yi(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var _i=function(e){return e},mi=function(e){function t(e){var n,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};pi(this,t),r=this,n=!(i=(t.__proto__||Object.getPrototypeOf(t)).call(this,e,o))||"object"!==di(i)&&"function"!=typeof i?yi(r):i;var a=o.onComplete,s=void 0===a?_i:a,u=o.onError,l=void 0===u?_i:u;return n.target=null,n.onComplete=s,n.onError=l,n.promise=null,Object.seal(yi(n)),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");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)}(t,Ft),gi(t,null,[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.queries,r=void 0!==n&&n,i=t.timers,o=void 0!==i&&i,a=t.timestamps,s=void 0!==a&&a,u=j(e),l=Ct(e,Tt.TIMER_QUERY),c=u||l;if(r&&(c=c&&u),o&&(c=c&&l),s){ke(e);var f=e.getQuery(36392,34916);c=c&&f>0}return c}}]),gi(t,[{key:"beginTimeElapsedQuery",value:function(){return this.begin(35007)}},{key:"beginOcclusionQuery",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).conservative,t=void 0!==e&&e;return this.begin(t?36202:35887)}},{key:"beginTransformFeedbackQuery",value:function(){return this.begin(35976)}},{key:"getTimestamp",value:function(){at.beginQuery(this,this.onComplete,this.onError);try{this.gl.queryCounter(this.handle,36392)}catch(e){at.rejectQuery(this,'Timer queries require "EXT_disjoint_timer_query" extension')}return this}},{key:"begin",value:function(e){at.beginQuery(this,this.onComplete,this.onError),this.target=e;try{this.gl.beginQuery(this.target,this.handle)}catch(e){at.rejectQuery(this,"Query not supported")}return this}},{key:"end",value:function(){return this.target&&(this.ext.endQuery(this.target),this.target=null),this}},{key:"cancel",value:function(){return this.end(),at.cancelQuery(this),this}},{key:"isResultAvailable",value:function(){return this.gl.getQueryParameter(this.handle,34919)}},{key:"getResult",value:function(){var e=this.gl.getQueryParameter(this.handle,34918);return Number.isFinite(e)?e/1e6:0}},{key:"_createHandle",value:function(){return t.isSupported(this.gl)?this.gl.createQuery():null}},{key:"_deleteHandle",value:function(){at.deleteQuery(this),this.gl.deleteQuery(this.handle)}}],[{key:"poll",value:function(e){at.poll(e)}}]),t}();function bi(e){return(bi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ei(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?t[Symbol.hasInstance](e):e instanceof t}function wi(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Si(e,t,n){return t&&wi(e.prototype,t),n&&wi(e,n),e}function Pi(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}at.setInvalidator({queryType:mi,errorMessage:"Disjoint GPU operation invalidated timer queries",checkInvalid:function(e){return e.getParameter(36795)}});var Ti=function(e){function t(e){var n,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(e,t){if(!Ei(e,t))throw new TypeError("Cannot call a class as a function")}(this,t),B(e),r=this,(n=!(i=(t.__proto__||Object.getPrototypeOf(t)).call(this,e,Object.assign({},o,{target:o.target||C.a.TEXTURE_3D})))||"object"!==bi(i)&&"function"!=typeof i?Pi(r):i).width=null,n.height=null,n.depth=null,Object.seal(Pi(n)),n.setImageData(o),o.generateMipmap&&n.generateMipmap(),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");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)}(t,bn),Si(t,null,[{key:"isSupported",value:function(e){return j(e)}}]),Si(t,[{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.opts=Object.assign({},this.opts,t);var n=this.opts,r=n.pixels,i=n.settings;i&&(St(i,function(){r&&e.setImage3D(e.opts)}),this.setParameters(t))}},{key:"setImage3D",value:function(e){var t=e.level,n=void 0===t?0:t,r=e.internalformat,i=void 0===r?C.a.RGBA:r,o=e.width,a=e.height,s=e.depth,u=void 0===s?1:s,l=e.border,c=void 0===l?0:l,f=e.format,h=e.type,d=void 0===h?C.a.UNSIGNED_BYTE:h,p=e.offset,v=void 0===p?0:p,g=e.pixels;ArrayBuffer.isView(g)?this.gl.texImage3D(this.target,n,i,o,a,u,c,f,d,g):Ei(g,zt)&&(this.gl.bindBuffer(C.a.PIXEL_UNPACK_BUFFER,g.handle),this.gl.texImage3D(this.target,n,i,o,a,u,c,f,d,v),this.gl.bindBuffer(C.a.PIXEL_UNPACK_BUFFER,g.handle))}}]),t}();function Ai(e){return(Ai="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function xi(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function Oi(e,t){return!t||"object"!==Ai(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ri(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var Ci=function(e){var t,n,r;function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};throw xi(this,i),Oi(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,e,t)),new Error("Texture2DArray not yet implemented")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");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)}(i,bn),t=i,r=[{key:"isSupported",value:function(e){return j(e)}}],(n=null)&&Ri(t.prototype,n),r&&Ri(t,r),i}();function ki(e){return(ki="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Mi(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function Ii(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Li(e,t,n){return t&&Ii(e.prototype,t),n&&Ii(e,n),e}function Ni(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var Fi,ji=function(e){function t(e){var n,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Mi(this,t),B(e),r=this,(n=!(i=(t.__proto__||Object.getPrototypeOf(t)).call(this,e,o))||"object"!==ki(i)&&"function"!=typeof i?Ni(r):i).buffers={},Object.seal(Ni(n)),n.initialize(o),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");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)}(t,Ft),Li(t,null,[{key:"isSupported",value:function(e){return j(e)}},{key:"isHandle",value:function(e){return this.gl.isTransformFeedback(this.handle)}}]),Li(t,[{key:"initialize",value:function(e){var t=e.buffers,n=void 0===t?{}:t,r=e.varyingMap,i=void 0===r?{}:r;this.bindBuffers(n,{clear:!0,varyingMap:i})}},{key:"bindBuffers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.clear,r=void 0!==n&&n,i=t.varyingMap,o=void 0===i?{}:i;for(var a in r&&(this._unbindBuffers(),this.buffers={}),e){var s=e[a],u=Number.isFinite(Number(a))?Number(a):o[a];A(Number.isFinite(u)),this.buffers[u]=s}}},{key:"begin",value:function(e){return this._bindBuffers(),this.gl.bindTransformFeedback(36386,this.handle),this.gl.beginTransformFeedback(e),this}},{key:"pause",value:function(){return this.gl.bindTransformFeedback(36386,this.handle),this.gl.pauseTransformFeedback(),this.gl.bindTransformFeedback(36386,null),this._unbindBuffers(),this}},{key:"resume",value:function(){return this._bindBuffers(),this.gl.bindTransformFeedback(36386,this.handle),this.gl.resumeTransformFeedback(),this}},{key:"end",value:function(){return this.gl.bindTransformFeedback(36386,this.handle),this.gl.endTransformFeedback(),this.gl.bindTransformFeedback(36386,null),this._unbindBuffers(),this}},{key:"bindBuffer",value:function(e){var t=e.index,n=e.buffer,r=e.offset,i=void 0===r?0:r,o=e.size;return n.unbind(),this.gl.bindTransformFeedback(36386,this.handle),void 0===o?this.gl.bindBufferBase(35982,t,n.handle):this.gl.bindBufferRange(35982,t,n.handle,i,o),this}},{key:"unbindBuffer",value:function(e){var t=e.index;return this.gl.bindTransformFeedback(36386,this.handle),this.gl.bindBufferBase(35982,t,null),this}},{key:"_bindBuffers",value:function(){for(var e in this.buffers)this.bindBuffer({buffer:this.buffers[e],index:Number(e)})}},{key:"_unbindBuffers",value:function(){for(var e in this.buffers)this.unbindBuffer({buffer:this.buffers[e],index:Number(e)})}},{key:"_createHandle",value:function(){return this.gl.createTransformFeedback()}},{key:"_deleteHandle",value:function(){this.gl.deleteTransformFeedback(this.handle)}}]),t}();function Di(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Bi(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function Ui(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Gi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Vi=5124,zi=5126,Xi=5125,Wi=(Gi(Fi={},zi,[zi,1]),Gi(Fi,35664,[zi,2]),Gi(Fi,35665,[zi,3]),Gi(Fi,35666,[zi,4]),Gi(Fi,Vi,[Vi,1]),Gi(Fi,35667,[Vi,2]),Gi(Fi,35668,[Vi,3]),Gi(Fi,35669,[Vi,4]),Gi(Fi,Xi,[Xi,1]),Gi(Fi,36294,[Xi,2]),Gi(Fi,36295,[Xi,3]),Gi(Fi,36296,[Xi,4]),Gi(Fi,35670,[zi,1]),Gi(Fi,35671,[zi,2]),Gi(Fi,35672,[zi,3]),Gi(Fi,35673,[zi,4]),Gi(Fi,35674,[zi,8]),Gi(Fi,35685,[zi,8]),Gi(Fi,35686,[zi,8]),Gi(Fi,35675,[zi,12]),Gi(Fi,35687,[zi,12]),Gi(Fi,35688,[zi,12]),Gi(Fi,35676,[zi,16]),Gi(Fi,35689,[zi,16]),Gi(Fi,35690,[zi,16]),Fi),Hi=function(){function e(t){var n;for(var r in Bi(this,e),this.layout={},this.size=0,t)this._addUniform(r,t[r]);var i=new Float32Array(this.size);this.typedArray=(Gi(n={},zi,i),Gi(n,Vi,new Int32Array(i.buffer)),Gi(n,Xi,new Uint32Array(i.buffer)),n)}var t,n,r;return t=e,(n=[{key:"getBytes",value:function(){return 4*this.size}},{key:"getData",value:function(){return this.typedArray[zi]}},{key:"getSubData",value:function(e){var t,n;if(void 0===e)t=this.data,n=0;else{var r=this.offsets[e],i=r+this.sizes[e];t=this.data.subarray(r,i),n=4*r}return{data:t,offset:n}}},{key:"setUniforms",value:function(e){for(var t in e)this._setValue(t,e[t]);return this}},{key:"_setValue",value:function(e,t){var n=this.layout[e];A(n,"UniformLayoutStd140 illegal argument");var r=this.typedArray[n.type];1===n.size?r[n.offset]=t:r.set(t,n.offset)}},{key:"_addUniform",value:function(e,t){var n=Wi[t];A(n,"UniformBufferLayout illegal argument");var r=Di(n,2),i=r[0],o=r[1];this.size=this._alignTo(this.size,o);var a=this.size;this.size+=o,this.layout[e]={type:i,size:o,offset:a}}},{key:"_alignTo",value:function(e,t){switch(t){case 1:return e;case 2:return e+e%2;default:return e+(4-e%4)%4}}}])&&Ui(t.prototype,n),r&&Ui(t,r),e}();function Yi(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?t[Symbol.hasInstance](e):e instanceof t}function Ki(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var Zi={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};function qi(e){var t="string"==typeof e?Zi[e]||Zi.TRIANGLES:e;return A(t>=0&&t<=Zi.TRIANGLE_FAN,"Illegal drawMode"),t}var Qi=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!Yi(e,t))throw new TypeError("Cannot call a class as a function")}(this,e);var n=t.id,r=t.drawMode,i=void 0===r?Zi.TRIANGLES:r,o=t.vertexCount,a=void 0===o?void 0:o,s=t.attributes;this.id=n||X(this.constructor.name),this.drawMode=qi(i),this.vertexCount=a,this.attributes={},this.needsRedraw=!0,this.userData={},Object.seal(this),s&&this.setAttributes(s)}var t,n,r;return t=e,(n=[{key:"setNeedsRedraw",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.needsRedraw=e,this}},{key:"getNeedsRedraw",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).clearRedrawFlags,t=void 0!==e&&e,n=!1;return n=n||this.needsRedraw,this.needsRedraw=this.needsRedraw&&!t,n}},{key:"setVertexCount",value:function(e){this.vertexCount=e}},{key:"getVertexCount",value:function(){return void 0!==this.vertexCount?this.vertexCount:this.attributes.indices?this.attributes.indices.value.length:this.attributes.vertices?this.attributes.vertices.value.length/3:!!this.attributes.positions&&this.attributes.positions.value.length/3}},{key:"hasAttribute",value:function(e){return Boolean(this.attributes[e])}},{key:"getAttribute",value:function(e){var t=this.attributes[e];return A(t),t.value}},{key:"getArray",value:function(e){var t=this.attributes[e];return A(t),t.value}},{key:"getAttributes",value:function(){return this.attributes}},{key:"setAttributes",value:function(e){for(var t in e){var n=e[t];n=ArrayBuffer.isView(n)?{value:n}:n,A(ArrayBuffer.isView(n.value),"".concat(this._print(t),": must be typed array or object with value as typed array")),this._autoDetectAttribute(t,n),this.attributes[t]=Object.assign({},n,{instanced:n.instanced||0})}return this.setNeedsRedraw(),this}},{key:"_autoDetectAttribute",value:function(e,t){var n;switch(e){case"indices":n=n||"indices";break;case"texCoords":case"texCoord1":case"texCoord2":case"texCoord3":n="uvs";break;case"vertices":case"positions":case"normals":case"pickingColors":n="vectors"}switch(n){case"vectors":t.size=t.size||3;break;case"uvs":t.size=t.size||2;break;case"indices":t.size=t.size||1,t.isIndexed=void 0===t.isIndexed||t.isIndexed,A(Yi(t.value,Uint16Array)||Yi(t.value,Uint32Array),'attribute array for "indices" must be of integer type')}A(t.size,"attribute ".concat(e," needs size"))}},{key:"_print",value:function(e){return"Geometry ".concat(this.id," attribute ").concat(e)}}])&&Ki(t.prototype,n),r&&Ki(t,r),e}(),Ji=n(1);function $i(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function eo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var to=function(){function e(t){var n=t.id;t.display;$i(this,e),this.position=new Ji.Vector3,this.rotation=new Ji.Vector3,this.scale=new Ji.Vector3(1,1,1),this.matrix=new Ji.Matrix4,this.id=n||X(this.constructor.name),this.display=!0,this.userData={}}var t,n,r;return t=e,(n=[{key:"setPosition",value:function(e){return A(3===e.length,"setPosition requires vector argument"),this.position=e,this}},{key:"setRotation",value:function(e){return A(3===e.length,"setRotation requires vector argument"),this.rotation=e,this}},{key:"setScale",value:function(e){return A(3===e.length,"setScale requires vector argument"),this.scale=e,this}},{key:"setMatrixComponents",value:function(e){var t=e.position,n=e.rotation,r=e.scale,i=e.update,o=void 0===i||i;return t&&this.setPosition(t),n&&this.setRotation(n),r&&this.setScale(r),o&&this.updateMatrix(),this}},{key:"updateMatrix",value:function(){var e=this.position,t=this.rotation,n=this.scale;return this.matrix.identity(),this.matrix.translate(e),this.matrix.rotateXYZ(t),this.matrix.scale(n),this}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.position,n=e.rotation,r=e.scale;return t&&this.setPosition(t),n&&this.setRotation(n),r&&this.setScale(r),this.updateMatrix(),this}},{key:"getCoordinateUniforms",value:function(e,t){A(e),t=t||this.matrix;var n=new Ji.Matrix4(e).multiplyRight(t),r=n.invert();return{viewMatrix:e,modelMatrix:t,objectMatrix:t,worldMatrix:n,worldInverseMatrix:r,worldInverseTransposeMatrix:r.transpose()}}},{key:"transform",value:function(){if(this.parent){var e=this.parent;this.endPosition.set(this.position.add(e.endPosition)),this.endRotation.set(this.rotation.add(e.endRotation)),this.endScale.set(this.scale.add(e.endScale))}else this.endPosition.set(this.position),this.endRotation.set(this.rotation),this.endScale.set(this.scale);for(var t=this.children,n=0;n<t.length;++n)t[n].transform();return this}}])&&eo(t.prototype,n),r&&eo(t,r),e}(),no="#define SHADER_NAME luma_modular_vertex\n\n// object attributes\nattribute vec3 positions;\nattribute vec3 normals;\nattribute vec4 colors;\nattribute vec2 texCoords;\nattribute vec3 pickingColors;\n\nvoid main(void) {\n\n // Set up position\n#ifdef MODULE_GEOMETRY\n geometry_setPosition(positions);\n geometry_setNormal(normals);\n#endif\n\n#ifdef MODULE_PROJECT\n project_setPositionAndNormal_Model(positions, normals);\n gl_Position = project_model_to_clipspace(positions);\n#endif\n\n // Set up depth\n#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n\n#ifdef MODULE_DIFFUSE\n diffuse_setTextureCoordinate(texCoords);\n#endif\n\n // Set up color calculations\n#ifdef MODULE_MATERIAL\n material_setDiffuseColor(colors);\n material_setDiffuseTextureCoordinates(texCoords);\n#endif\n\n#ifdef MODULE_LIGHTING\n lighting_setPositionAndNormal(positions, normals);\n lighting_apply_light(positions);\n lighting_apply_reflection(positions);\n#endif\n\n#ifdef MODULE_PICKING\n picking_setPickingColor(pickingColors);\n#endif\n\n}\n",ro="#define SHADER_NAME luma-modular-fragment\n\n#ifdef GL_ES\nprecision highp float;\n#endif\n\n// varyings\nvarying vec4 vColor;\n\nvoid main(){\n gl_FragColor = vec4(1., 0., 1., 1.);\n\n#ifdef MODULE_DIFFUSE\n gl_FragColor = diffuse_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth(gl_Position);\n#endif\n}\n",io={},oo=[];function ao(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).ignoreMultipleRegistrations,n=void 0!==t&&t,r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){co(a.value,{ignoreMultipleRegistrations:n})}}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}}function so(e){oo=e}function uo(e){if("string"!=typeof e){var t=e;return A("string"==typeof t.name),co(t,{ignoreMultipleRegistrations:!0}),t}var n=io[e];return n||A(!1,"Unknown shader module ".concat(e)),n}function lo(e){return function(e){var t={};return function e(t){var n=t.modules,r=t.level,i=t.result;if(r>=5)throw new Error("Possible loop in shader dependency graph");var o=!0,a=!1,s=void 0;try{for(var u,l=n[Symbol.iterator]();!(o=(u=l.next()).done);o=!0){var c=u.value,f=uo(c);(void 0===i[f.name]||i[f.name]<r)&&(i[f.name]=r)}}catch(e){a=!0,s=e}finally{try{o||null==l.return||l.return()}finally{if(a)throw s}}var h=!0,d=!1,p=void 0;try{for(var v,g=n[Symbol.iterator]();!(h=(v=g.next()).done);h=!0){var y=v.value,_=uo(y);_.dependencies&&e({modules:_.dependencies,level:r+1,result:i})}}catch(e){d=!0,p=e}finally{try{h||null==g.return||g.return()}finally{if(d)throw p}}return i}({modules:e=e.concat(oo),level:0,result:t}),Object.keys(t).sort(function(e,n){return t[n]-t[e]})}(e.map(function(e){return"string"!=typeof e?(ao([e],{ignoreMultipleRegistrations:!0}),e.name):e}))}function co(e,t){var n=t.ignoreMultipleRegistrations,r=void 0!==n&&n;if(A(e.name,"shader module has no name"),!r&&io[e.name])throw new Error("shader module ".concat(e.name," already registered"));io[e.name]=e,e.dependencies=e.dependencies||[],e.deprecations=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.forEach(function(e){switch(e.type){case"function":e.regex=new RegExp("\\b".concat(e.old,"\\("));break;default:e.regex=new RegExp("".concat(e.type," ").concat(e.old,";"))}}),e}(e.deprecations)}function fo(e,t){var n,r=e.vendor,i=e.renderer;switch(t){case"nvidia":n=r.match(/NVIDIA/i)||i.match(/NVIDIA/i);break;case"intel":n=r.match(/INTEL/i)||i.match(/INTEL/i);break;case"amd":n=r.match(/AMD/i)||i.match(/AMD/i)||r.match(/ATI/i)||i.match(/ATI/i);break;default:n=!1}return n}var ho,po;function vo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var go="vs",yo="fs",_o=(vo(ho={},go,"vertex"),vo(ho,yo,"fragment"),ho),mo=(vo(po={},go,"#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n"),vo(po,yo,"#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth();\n#endif\n"),po),bo="#ifdef GL_ES\nprecision highp float;\n#endif\n\n";function Eo(e,t){uo(e).deprecations.forEach(function(e){e.regex.test(t)&&(e.deprecated?Y.a.deprecated(e.old,e.new)():Y.a.removed(e.old,e.new)())})}function wo(e,t){var n,r=uo(e);switch(t){case go:n=r.vs||r.vertexShader;break;case yo:n=r.fs||r.fragmentShader;break;default:A(!1)}return"string"!=typeof n?"":"#define MODULE_".concat(e.toUpperCase(),"\n").concat(n,"// END MODULE_").concat(e,"\n\n")}function So(e,t){var n=t.id,r=t.source,i=t.type,o=t.modules,a=void 0===o?[]:o,s=t.defines,u=void 0===s?{}:s;A("string"==typeof r,"shader source must be a string");var l=r.split("\n"),c="",f=r;0===l[0].indexOf("#version ")&&(c=l[0],f=l.slice(1).join("\n"));var h="".concat(function(e){var t=e.id,n=e.source,r=e.type;return t&&"string"==typeof t&&-1===n.indexOf("SHADER_NAME")?"\n#define SHADER_NAME ".concat(t,"_").concat(_o[r],"\n\n"):""}({id:n,source:r,type:i}),"\n").concat(function(e){var t="",n=tt(e);return fo(n,"nvidia")?t+="#define NVIDIA_GPU\n// Nvidia optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n":fo(n,"intel")?t+="#define INTEL_GPU\n// Intel optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n":fo(n,"amd")?t+="#define AMD_GPU\n":t+="#define DEFAULT_GPU\n// Prevent driver from optimizing away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n",t}(e),"\n").concat(function(e){var t="// Defines for shader portability\n#if (__VERSION__ > 120)\n# define attribute in\n# define varying out\n# define FRAG_DEPTH\n# define DERIVATIVES\n# define DRAW_BUFFERS\n# define TEXTURE_LOD\n#else\n// # define in attribute\n// # define out varying\n#endif // __VERSION\n";return Rt(e,Tt.GLSL_FRAG_DEPTH)&&(t+="// FRAG_DEPTH => gl_FragDepth is available\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n# define FRAG_DEPTH\n# define gl_FragDepth gl_FragDepthEXT\n#endif\n"),Rt(e,Tt.GLSL_DERIVATIVES)&&xt(e,Tt.GLSL_DERIVATIVES)&&(t+="// DERIVATIVES => dxdF, dxdY and fwidth are available\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n# define DERIVATIVES\n#endif\n"),Rt(e,Tt.GLSL_FRAG_DATA)&&(t+="// DRAW_BUFFERS => gl_FragData[] is available\n#ifdef GL_EXT_draw_buffers\n#extension GL_EXT_draw_buffers : require\n#define DRAW_BUFFERS\n#endif\n"),Rt(e,Tt.GLSL_TEXTURE_LOD)&&(t+="// TEXTURE_LOD => texture2DLod etc are available\n#ifdef GL_EXT_shader_texture_lod\n#extension GL_EXT_shader_texture_lod : enable\n# define TEXTURE_LOD\n#define texture2DLod texture2DLodEXT\n#define texture2DProjLod texture2DProjLodEXT\n#define texture2DProjLod texture2DProjLodEXT\n#define textureCubeLod textureCubeLodEXT\n#define texture2DGrad texture2DGradEXT\n#define texture2DProjGrad texture2DProjGradEXT\n#define texture2DProjGrad texture2DProjGradEXT\n#define textureCubeGrad textureCubeGradEXT\n#endif\n"),t}(e),"\n").concat(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=0,n="";for(var r in e)0===t&&(n+="\n// APPLICATION DEFINES\n"),t++,n+="#define ".concat(r.toUpperCase()," ").concat(e[r],"\n");return 0===t&&(n+="\n"),n}(u),"\n").concat(i===yo?bo:"","\n"),d=!1,p=!0,v=!1,g=void 0;try{for(var y,_=a[Symbol.iterator]();!(p=(y=_.next()).done);p=!0){var m=y.value;switch(m){case"inject":d=!0;break;default:Eo(m,f),h+=wo(m,i)}}}catch(e){v=!0,g=e}finally{try{p||null==_.return||_.return()}finally{if(v)throw g}}return h=c+h+f,d&&h.replace("}s*$",mo),h}function Po(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.vs,r=t.fs,i=lo(t.modules||[]);return{gl:e,vs:So(e,Object.assign({},t,{source:n,type:go,modules:i})),fs:So(e,Object.assign({},t,{source:r,type:yo,modules:i})),getUniforms:function(e){return function(t){var n={},r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var u=uo(a.value),l=u.getUniforms?u.getUniforms(t,n):{};Object.assign(n,l)}}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}}(i),modules:function(e){var t={},n=!0,r=!1,i=void 0;try{for(var o,a=e[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value,u=uo(s);t[s]=u}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return t}(i)}}function To(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function Ao(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var xo=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.gl,r=t._cachePrograms,i=void 0!==r&&r;To(this,e),A(n),this.gl=n,this.vertexShaders={},this.fragmentShaders={},this.programs={},this._cachePrograms=i}var t,n,r;return t=e,(n=[{key:"delete",value:function(){return this}},{key:"getVertexShader",value:function(e,t){A("string"==typeof t),A(this._compareContexts(e,this.gl));var n=this.vertexShaders[t];return n||(n=new en(e,t),this.vertexShaders[t]=n),n}},{key:"getFragmentShader",value:function(e,t){A("string"==typeof t),A(this._compareContexts(e,this.gl));var n=this.fragmentShaders[t];return n||(n=new tn(e,t),this.fragmentShaders[t]=n),n}},{key:"getProgram",value:function(e,t){A(this._compareContexts(e,this.gl)),A("string"==typeof t.vs),A("string"==typeof t.fs),A("string"==typeof t.id);var n=this._getProgramKey(t),r=this.programs[n];return r?(this._resetProgram(r),r):(r=this._createNewProgram(e,t),this._cachePrograms&&this._checkProgramProp(r)&&(r._isCached=!0,this.programs[n]=r),r)}},{key:"_getProgramKey",value:function(e){return"".concat(e.id,"-").concat(e.vs,"-").concat(e.fs)}},{key:"_checkProgramProp",value:function(e){return!e.varyings}},{key:"_createNewProgram",value:function(e,t){var n=t.vs,r=t.fs,i=this.getVertexShader(e,n),o=this.getFragmentShader(e,r);return new qr(this.gl,Object.assign({},t,{vs:i,fs:o}))}},{key:"_resetProgram",value:function(e,t){e.reset()}},{key:"_compareContexts",value:function(e,t){return(e.gl||e)===(t.gl||t)}}])&&Ao(t.prototype,n),r&&Ao(t,r),e}(),Oo=n(11),Ro=n.n(Oo),Co={},ko=function e(t,n,r){t&&(n.length>1?e(t[n[0]],n.slice(1),r):t[n[0]]=r)},Mo=new Map;function Io(e){return(Io="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Lo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function No(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?t[Symbol.hasInstance](e):e instanceof t}function Fo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function jo(e,t){return!t||"object"!==Io(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}Ro.a.listenFor("luma.gl",function(e){var t=Co[e.itemKey];if(t&&"edit"===e.type&&"uniforms"===e.valuePath[0]){var n=e.valuePath.slice(1);!function(e,t,n){V.b.__SEER_INITIALIZED__&&(Mo.has(e)||Mo.set(e,new Map),Mo.get(e).set(t,n))}(e.itemKey,n,e.value);var r=t.getUniforms();ko(r,n,e.value),t.setUniforms(r)}});var Do=["renderPickingBuffer","pickingEnabled"],Bo=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(e,t){if(!No(e,t))throw new TypeError("Cannot call a class as a function")}(this,t),n=jo(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,r)),A(F(e)),n.gl=e,n.init(r),n}var n,r,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");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)}(t,to),n=t,(r=[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vs,n=void 0===t?null:t,r=e.fs,i=void 0===r?null:r,o=e.modules,a=void 0===o?null:o,s=e.defines,u=void 0===s?{}:s,l=e.moduleSettings,c=void 0===l?{}:l,f=e.defaultUniforms,h=e.program,d=void 0===h?null:h,p=e.shaderCache,v=void 0===p?null:p,g=e.isInstanced,y=void 0!==g&&g,_=e.instanced,m=e.vertexCount,b=void 0===m?void 0:m,E=e.instanceCount,w=void 0===E?0:E,S=e.drawMode,P=e.uniforms,T=void 0===P?{}:P,x=e.attributes,O=void 0===x?{}:x,R=e.geometry,k=void 0===R?null:R,M=e.pickable,I=void 0===M||M,L=e.pick,N=void 0===L?null:L,F=(e.render,e.onBeforeRender),j=void 0===F?function(){}:F,D=e.onAfterRender,B=void 0===D?function(){}:D,U=e.varyings,G=void 0===U?null:U,V=e.bufferMode,z=void 0===V?C.a.SEPARATE_ATTRIBS:V,X=e.timerQueryEnabled,W=void 0!==X&&X;this._initializeProgram({vs:n,fs:i,modules:a,defines:u,moduleSettings:c,defaultUniforms:f,program:d,shaderCache:v,varyings:G,bufferMode:z}),this.uniforms={},T=Object.assign({},this.program.defaultUniforms,T),this.setUniforms(T),this.setUniforms(this.getModuleUniforms()),this.setUniforms(this.getModuleUniforms(c)),_&&(console.warn('Warning: Model constructor: parameter "instanced" renamed to "isInstanced".\nThis will become a hard error in a future version of luma.gl.'),y=y||_),this._attributes={},this.attributes={},this.samplers={},this.userData={},this.drawParams={},this.dynamic=!1,this.needsRedraw=!0,k&&this.setGeometry(k),this.setAttributes(O),void 0!==S&&(this.drawMode=qi(S)),void 0!==b&&(this.vertexCount=b),this.isInstanced=y,this.instanceCount=w,this.pickable=Boolean(I),this.pick=N||function(){return!1},this.onBeforeRender=j,this.onAfterRender=B,A(void 0!==this.drawMode&&Number.isFinite(this.vertexCount),"Model needs drawMode and vertexCount"),this.timerQueryEnabled=W&&mi.isSupported(this.gl,{timer:!0}),this.timeElapsedQuery=void 0,this.lastQueryReturned=!0,this.stats={accumulatedFrameTime:0,averageFrameTime:0,profileFrameCount:0}}},{key:"delete",value:function(){for(var e in this._attributes)this._attributes[e]!==this.attributes[e]&&this._attributes[e].delete();var t;this.program.delete(),t=this.id,delete Co[t],Ro.a.deleteItem("luma.gl",t)}},{key:"destroy",value:function(){this.delete()}},{key:"setNeedsRedraw",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.needsRedraw=e,this}},{key:"getNeedsRedraw",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).clearRedrawFlags,t=void 0!==e&&e,n=!1;return n=n||this.needsRedraw,this.needsRedraw=this.needsRedraw&&!t,this.geometry&&(n=n||this.geometry.getNeedsRedraw({clearRedrawFlags:t})),n}},{key:"setDrawMode",value:function(e){return this.drawMode=qi(e),this}},{key:"getDrawMode",value:function(){return this.drawMode}},{key:"setVertexCount",value:function(e){return A(Number.isFinite(e)),this.vertexCount=e,this}},{key:"getVertexCount",value:function(){return this.vertexCount}},{key:"setInstanceCount",value:function(e){return A(Number.isFinite(e)),this.instanceCount=e,this}},{key:"getInstanceCount",value:function(){return this.instanceCount}},{key:"getProgram",value:function(){return this.program}},{key:"setGeometry",value:function(e){return this.geometry=e,this.vertexCount=e.getVertexCount(),this.drawMode=e.drawMode,this._createBuffersFromAttributeDescriptors(this.geometry.getAttributes()),this.setNeedsRedraw(),this}},{key:"getAttributes",value:function(){return this.attributes}},{key:"setAttributes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return H(e)?this:(Object.assign(this.attributes,e),this._createBuffersFromAttributeDescriptors(e),this.setNeedsRedraw(),this)}},{key:"getUniforms",value:function(){return this.uniforms}},{key:"setUniforms",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=!1;for(var n in e)if(!Ir(this.uniforms[n],e[n])){t=!0;break}return t&&(!function(e,t){for(var n in e){var r=e[n];if(!Mr(r))throw t=t?"".concat(t," "):"",console.error("".concat(t," Bad uniform ").concat(n),r),new Error("".concat(t," Bad uniform ").concat(n))}}(e,this.id),Object.assign(this.uniforms,e),this.setNeedsRedraw()),this}},{key:"updateModuleSettings",value:function(e){var t=this.getModuleUniforms(e);return this.setUniforms(t)}},{key:"draw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.moduleSettings,n=void 0===t?null:t,r=e.uniforms,i=void 0===r?{}:r,o=e.attributes,a=void 0===o?{}:o,s=e.samplers,u=void 0===s?{}:s,l=e.parameters,c=void 0===l?{}:l,f=e.settings,h=e.framebuffer,d=void 0===h?null:h,p=e.vertexArray,v=void 0===p?null:p,g=e.transformFeedback,y=void 0===g?null:g;return f&&(Y.a.deprecated("settings","parameters")(),c=f),n&&this.updateModuleSettings(n),d&&(c=Object.assign(c,{framebuffer:d})),this.render(i,a,u,y,c,v),d&&d.log({priority:2,message:"Rendered to ".concat(d.id)}),this}},{key:"render",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null;Co[(e=this).id]||(Co[e.id]=e,Ro.a.listItem("luma.gl",e.id));var s=this.addViewUniforms(t);!function(e,t){if(V.b.__SEER_INITIALIZED__&&e){var n=Mo.get(e);n&&n.forEach(function(e,n){ko(t,n,e)})}}(this.id,s),this.setUniforms(s),this.setAttributes(n),Object.assign(this.samplers,r),Y.a.group(2,">>> RENDERING MODEL ".concat(this.id),{collapsed:Y.a.priority<=2})(),this.setProgramState({vertexArray:a}),this._logAttributesAndUniforms(2,s),this.onBeforeRender();var u=this.drawParams;u.isInstanced&&!this.isInstanced&&Y.a.warn("Found instanced attributes on non-instanced model")();var l=u.isIndexed,c=u.indexType,f=this.isInstanced,h=this.instanceCount;return this._timerQueryStart(),this.program.draw({parameters:o,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:a,transformFeedback:i,isIndexed:l,indexType:c,isInstanced:f,instanceCount:h}),this._timerQueryEnd(),this.onAfterRender(),this.unsetProgramState(),this.setNeedsRedraw(!1),Y.a.groupEnd(2,">>> RENDERING MODEL ".concat(this.id))(),this}},{key:"setProgramState",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).vertexArray,t=void 0===e?null:e,n=this.program;return n.use(),this.drawParams={},n.setAttributes(this._attributes,{drawParams:this.drawParams}),n.checkAttributeBindings({vertexArray:t}),n.setUniforms(this.uniforms,this.samplers),this}},{key:"unsetProgramState",value:function(){return this.program.unsetBuffers(),this}},{key:"addViewUniforms",value:function(e){var t=e.camera,n=e.viewMatrix,r=e.modelMatrix,i=t?t.getUniforms():{},o=n?this.getCoordinateUniforms(n,r):{};return Object.assign({},e,i,o)}},{key:"_initializeProgram",value:function(e){var t=e.vs,n=e.fs,r=e.modules,i=e.defines,o=(e.moduleSettings,e.defaultUniforms,e.program),a=e.shaderCache,s=e.varyings,u=e.bufferMode;if(this.getModuleUniforms=function(e){},!o){t||(t=no),n||(n=ro);var l=Po(this.gl,{vs:t,fs:n,modules:r,defines:i});t=l.vs,n=l.fs,o=a?a.getProgram(this.gl,{vs:t,fs:n,id:this.id}):new qr(this.gl,{vs:t,fs:n,varyings:s,bufferMode:u});var c=l.getUniforms;this.getModuleUniforms=c||function(e){}}this.program=o,A(No(this.program,qr),"Model needs a program")}},{key:"_checkForDeprecatedUniforms",value:function(e){Do.forEach(function(t){t in e&&Y.a.deprecated(t,"use picking shader module and Model class updateModuleSettings()")()})}},{key:"_timerQueryStart",value:function(){!0===this.timerQueryEnabled&&(this.timeElapsedQuery||(this.timeElapsedQuery=new mi(this.gl)),this.lastQueryReturned&&(this.lastQueryReturned=!1,this.timeElapsedQuery.beginTimeElapsedQuery()))}},{key:"_timerQueryEnd",value:function(){if(!0===this.timerQueryEnabled&&(this.timeElapsedQuery.end(),this.timeElapsedQuery.isResultAvailable())){this.lastQueryReturned=!0;var e=this.timeElapsedQuery.getResult();this.stats.lastFrameTime=e,this.stats.accumulatedFrameTime+=e,this.stats.profileFrameCount++,this.stats.averageFrameTime=this.stats.accumulatedFrameTime/this.stats.profileFrameCount,Y.a.log(2,"GPU time ".concat(this.program.id,": ").concat(this.stats.lastFrameTime,"ms average ").concat(this.stats.averageFrameTime,"ms accumulated: ").concat(this.stats.accumulatedFrameTime,"ms count: ").concat(this.stats.profileFrameCount))()}}},{key:"_createBuffersFromAttributeDescriptors",value:function(e){var t=this.program.gl;for(var n in e){var r=e[n],i=this._attributes[n];No(r,si)?i=r:No(r,zt)?(i=i||new si(t,Object.assign({},r.layout,{id:n}))).update({isGeneric:!1,buffer:r}):i?i.update(r):i=new si(t,r),this._attributes[n]=i}return this}},{key:"_logAttributesAndUniforms",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Y.a.priority>=e){var n=this._getAttributesTable({header:"".concat(this.id," attributes"),program:this.program,attributes:this._attributes});Y.a.table(e,n)();var r=Lr({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.uniforms,t)}),i=r.table,o=r.unusedTable,a=r.unusedCount;Y.a.table(e,i)(),Y.a.log(e,"".concat(a||"No"," unused uniforms "),o)()}else{var s=Lr({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.uniforms,t),undefinedOnly:!0}),u=s.table;s.count>0&&Y.a.table(e,u)()}!function(e,t){if(Ro.a.isReady()&&!Ro.a.throttle("luma.gl:".concat(e.id),1e3)){var n=e.geometry?Object.assign({},e.geometry.attributes,e.attributes):e.attributes,r=Object.assign({},e.uniforms,t);Ro.a.multiUpdate("luma.gl",e.id,[{path:"objects.uniforms",data:r},{path:"objects.attributes",data:n}])}}(this,t)}},{key:"_getAttributesTable",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.attributes,n=e.header,r=void 0===n?"Attributes":n,i=(e.instanced,e.program);A(i);var o=i._attributeToLocationMap,a={};for(var s in t){var u=t[s];u.isIndexed&&this._createAttributeEntry(u,"ELEMENT_ARRAY_BUFFER",r)}for(var l in o){var c=t[l],f=o[l];a[l]=this._createAttributeEntry(c,f,r)}for(var h in t){var d=t[h];a[h]||(a[h]=this._createAttributeEntry(d,null,r))}return a}},{key:"_createAttributeEntry",value:function(e,t,n){var r,i,o="NOT PROVIDED",a=0,s="N/A",u="N/A",l="N/A",c="N/A";return e&&null===t&&(t=e.isIndexed?"ELEMENT_ARRAY_BUFFER":"NOT USED"),e&&(o=e.type,a=e.instanced,s=e.size,e.externalBuffer?(c=e.externalBuffer.data,u=(l=e.externalBuffer.bytes)/c.BYTES_PER_ELEMENT):e.value&&(c=e.value,i=c.length/s,u=Math.round(10*i)/10,l=c.length*c.BYTES_PER_ELEMENT)),Lo(r={},n,K(c,{size:s,isInteger:-1!==(o=String(o).replace("Array","")).indexOf("nt")})),Lo(r,"Memory Size and Layout","".concat(a?"I ":"P "," ").concat(u," (x").concat(s,"=").concat(l,"bytes ").concat(o,") loc=").concat(t)),r}},{key:"isPickable",value:function(){return this.pickable}},{key:"setPickable",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.pickable=Boolean(e),this}},{key:"getGeometry",value:function(){return this.geometry}},{key:"varyingMap",get:function(){return this.program.varyingMap}}])&&Fo(n.prototype,r),i&&Fo(n,i),t}();function Uo(e){return(Uo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Go(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function Vo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var zo={preserveDrawingBuffer:!0},Xo=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Go(this,e);var n=t.onCreateContext,r=void 0===n?function(e){return pt(e)}:n,i=t.onInitialize,o=void 0===i?function(){}:i,a=t.onRender,s=void 0===a?function(){}:a,u=t.onFinalize,l=void 0===u?function(){}:u,c=t.offScreen,f=void 0!==c&&c,h=t.gl,d=void 0===h?null:h,p=t.glOptions,v=void 0===p?{}:p,g=t.debug,y=void 0!==g&&g,_=t.createFramebuffer,m=void 0!==_&&_,b=t.autoResizeViewport,E=void 0===b||b,w=t.autoResizeDrawingBuffer,S=void 0===w||w,P=t.useDevicePixels,T=void 0===P||P;return"useDevicePixelRatio"in t&&(Y.a.deprecated("useDevicePixelRatio","useDevicePixels")(),T=t.useDevicePixelRatio),this.props={onCreateContext:r,onInitialize:o,onRender:s,onFinalize:l,gl:d,glOptions:v,debug:y,createFramebuffer:m},this.gl=d,this.offScreen=f,this.needsRedraw=null,this.setProps({autoResizeViewport:E,autoResizeDrawingBuffer:S,useDevicePixels:T}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._renderFrame=this._renderFrame.bind(this),this}var t,n,r;return t=e,(n=[{key:"setNeedsRedraw",value:function(e){return A("string"==typeof e),this.needsRedraw=this.needsRedraw||e,this}},{key:"setProps",value:function(e){return"autoResizeViewport"in e&&(this.autoResizeViewport=e.autoResizeViewport),"autoResizeDrawingBuffer"in e&&(this.autoResizeDrawingBuffer=e.autoResizeDrawingBuffer),"useDevicePixels"in e&&(this.useDevicePixels=e.useDevicePixels),this}},{key:"start",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._stopped=!1,this._animationFrameId||(this._startPromise=ee.then(function(){return e._stopped?null:(e._createWebGLContext(t),e._createFramebuffer(),e._initializeCallbackData(),e._updateCallbackData(),e._resizeCanvasDrawingBuffer(),e._resizeViewport(),e.props.onInitialize(e._callbackData))}).then(function(t){e._stopped||(e._addCallbackData(t||{}),!1===t||e._animationFrameId||(e._animationFrameId=i(e._renderFrame)))})),this}},{key:"stop",value:function(){return this._animationFrameId&&(this._finalizeCallbackData(),o(this._animationFrameId),this._animationFrameId=null,this._stopped=!0),this}},{key:"setViewParameters",value:function(e){var t=e.autoResizeDrawingBuffer,n=void 0===t||t,r=e.autoResizeCanvas,i=void 0===r||r,o=e.autoResizeViewport,a=void 0===o||o,s=e.useDevicePixels,u=void 0===s||s,l=e.useDevicePixelRatio,c=void 0===l?null:l;return Y.a.deprecated("AnimationLoop.setViewParameters","AnimationLoop.setProps")(),this.autoResizeViewport=a,this.autoResizeCanvas=i,this.autoResizeDrawingBuffer=n,this.useDevicePixels=u,null!==c&&(Y.a.deprecated("useDevicePixelRatio","useDevicePixels")(),this.useDevicePixels=c),this}},{key:"_setupFrame",value:function(){this._onSetupFrame?this._onSetupFrame(this._callbackData):(this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._resizeFramebuffer())}},{key:"_renderFrame",value:function(){this._stopped||(this._setupFrame(),this._updateCallbackData(),this.props.onRender(this._callbackData),this.offScreen?this.gl.commit().then(this._renderFrame):this._animationFrameId=i(this._renderFrame))}},{key:"_initializeCallbackData",value:function(){this._callbackData={gl:this.gl,canvas:this.gl.canvas,framebuffer:this.framebuffer,stop:this.stop,useDevicePixels:this.useDevicePixels,needsRedraw:null,tick:0,tock:0}}},{key:"_updateCallbackData",value:function(){var e=this.gl.drawingBufferWidth,t=this.gl.drawingBufferHeight;e===this._callbackData.width&&t===this._callbackData.height||this.setNeedsRedraw("drawing buffer resized"),this._callbackData.width=e,this._callbackData.height=t,this._callbackData.aspect=e/t,this._callbackData.needsRedraw=this.needsRedraw,this._callbackData.offScreen=this.offScreen,this._callbackData.needsRedraw=this.needsRedraw,this.needsRedraw=null,this._callbackData.tick++}},{key:"_finalizeCallbackData",value:function(){this.props.onFinalize(this._callbackData)}},{key:"_addCallbackData",value:function(e){"object"===Uo(e)&&null!==e&&(this._callbackData=Object.assign({},this._callbackData,e))}},{key:"_createWebGLContext",value:function(e){if(e=Object.assign({},e,zo,this.props.glOptions),this.gl=this.props.gl||this.props.onCreateContext(e),!F(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");this.props.debug&&(this.gl=We(this.gl)),be(this.gl)}},{key:"_resizeViewport",value:function(){this.autoResizeViewport&&this.gl.viewport(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}},{key:"_resizeCanvasDrawingBuffer",value:function(){this.autoResizeDrawingBuffer&>(this.gl,{useDevicePixels:this.useDevicePixels})}},{key:"_createFramebuffer",value:function(){this.props.createFramebuffer&&(this.framebuffer=new hr(this.gl))}},{key:"_resizeFramebuffer",value:function(){this.framebuffer&&this.framebuffer.resize({width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight})}}])&&Vo(t.prototype,n),r&&Vo(t,r),e}();function Wo(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function Ho(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Yo(e,t,n){return t&&Ho(e.prototype,t),n&&Ho(e,n),e}var Ko=function(){function e(t){var n=t.worker,r=t.onInitialize,i=void 0===r?function(){}:r,o=t.onFinalize,a=void 0===o?function(){}:o,s=t.useDevicePixels,u=void 0===s||s,l=t.autoResizeDrawingBuffer,c=void 0===l||l;Wo(this,e),this.props={worker:n,onInitialize:i,onFinalize:a,autoResizeDrawingBuffer:c,useDevicePixels:u},this.canvas=null,this.width=null,this.height=null,this._stopped=!0,this._animationFrameId=null,this._startPromise=null,this._updateFrame=this._updateFrame.bind(this)}return Yo(e,null,[{key:"createWorker",value:function(e){return function(t){t.animationLoop=new Xo(Object.assign({},e,{offScreen:!0,useDevicePixels:!1,autoResizeDrawingBuffer:!1})),t.canvas=null,t.addEventListener("message",function(e){var n=t.animationLoop;switch(e.data.command){case"start":t.canvas=e.data.opts.canvas,n.start(e.data.opts);break;case"stop":n.stop();break;case"resize":t.canvas.width=e.data.width,t.canvas.height=e.data.height}})}}}]),Yo(e,[{key:"start",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._stopped=!1,this._animationFrameId||(this._startPromise=te().then(function(){return e._createAndTransferCanvas(t),e.props.onInitialize(e)}).then(function(){e._stopped||(e._animationFrameId=i(e._updateFrame))})),this}},{key:"stop",value:function(){return this._animationFrameId&&(o(this._animationFrameId),this._animationFrameId=null,this._stopped=!0,this.props.onFinalize(this)),this.props.worker.postMessage({command:"stop"}),this}},{key:"_updateFrame",value:function(){this._resizeCanvasDrawingBuffer(),this._animationFrameId=i(this._updateFrame)}},{key:"_createAndTransferCanvas",value:function(e){var t=ne(e);t.transferControlToOffscreen||onError("OffscreenCanvas is not available. Enable Experimental canvas features in chrome://flags");var n=t.transferControlToOffscreen();this.props.worker.postMessage({command:"start",opts:Object.assign({},e,{canvas:n})},[n]),this.canvas=t}},{key:"_resizeCanvasDrawingBuffer",value:function(){if(this.props.autoResizeDrawingBuffer){var e=this.props.useDevicePixels&&window.devicePixelRatio||1,t=this.canvas.clientWidth*e,n=this.canvas.clientHeight*e;this.width===t&&this.height===n||(this.width=t,this.height=n,this.props.worker.postMessage({command:"resize",width:t,height:n}))}}}]),e}();function Zo(e){return(Zo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function qo(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function Qo(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?t[Symbol.hasInstance](e):e instanceof t}function Jo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function $o(e,t){return!t||"object"!==Zo(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}var ea=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!Qo(e,t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=n.children,i=void 0===r?[]:r;return i.every(function(e){return A(Qo(e,to))}),(e=$o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,n))).children=i,e}var n,r,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");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)}(t,to),n=t,(r=[{key:"add",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r=0;r<t.length;r++){var i=t[r];Array.isArray(i)?this.add.apply(this,qo(i)):this.children.push(i)}return this}},{key:"remove",value:function(e){var t=this.children,n=t.indexOf(e);return n>-1&&t.splice(n,1),this}},{key:"removeAll",value:function(){return this.children=[],this}},{key:"traverse",value:function(e){var n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).modelMatrix,r=void 0===n?new Ji.Matrix4:n,i=!0,o=!1,a=void 0;try{for(var s,u=this.children[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var l=s.value,c=l.matrix;r=r.multiplyRight(c);var f=void 0;if(f=Qo(l,t)?l.traverse(e,{modelMatrix:r}):e(l,{}))return f}}catch(e){o=!0,a=e}finally{try{i||null==u.return||u.return()}finally{if(o)throw a}}return null}},{key:"traverseReverse",value:function(e){for(var n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).modelMatrix,r=void 0===n?new Ji.Matrix4:n,i=this.children.length-1;i>=0;--i){var o=this.children[i],a=o.matrix;r=r.multiplyRight(a);var s=void 0;if(s=Qo(o,t)?o.traverseReverse(e,{modelMatrix:r}):e(o,{}))return s}return null}}])&&Jo(n.prototype,r),i&&Jo(n,i),t}();function ta(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var na="Illegal argument to pick";function ra(e,t){var n=t.models,r=t.position,i=t.uniforms,o=void 0===i?{}:i,a=t.parameters,s=void 0===a?{}:a,u=t.settings,l=t.useDevicePixelRatio,c=void 0===l?null:l,f=t.useDevicePixels,h=void 0===f||f,d=t.framebuffer;A(ct(e),na),A(d,na),A(r,na),null!==c&&(Y.a.deprecated("useDevicePixelRatio","useDevicePixels")(),h=c);var p=ta(r,2),v=p[0],g=p[1];d.resize({width:e.canvas.width,height:e.canvas.height});var y=h&&"undefined"!=typeof window?window.devicePixelRatio:1,_=v*y,m=e.canvas.height-g*y;return new ea({children:n}).traverseReverse(function(t){if(t.isPickable()){Hn(e,{framebuffer:d,color:!0,depth:!0}),t.setUniforms({picking_uActive:1}),t.draw({uniforms:o,parameters:s,settings:u,framebuffer:d}),t.setUniforms({picking_uActive:0});var n=d.readPixels({x:_,y:m,width:1,height:1,format:e.RGBA,type:e.UNSIGNED_BYTE});if(0!==n[0]||0!==n[1]||0!==n[2])return{model:t,color:n,x:v,y:g,deviceX:_,deviceY:m}}return null})}function ia(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var oa=new Uint8Array([0,0,0]);function aa(e){return[e+1&255,e+1>>8&255,e+1>>16&255]}function sa(e){var t=ia(e,3);return t[0]+256*t[1]+65536*t[2]-1}function ua(){return oa}function la(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function ca(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function fa(){}function ha(e){return!0!==e&&e}function da(e){var t=e.getBoundingClientRect();return{x:t.left,y:t.top,bbox:t}}function pa(e){var t=e.which||e.keyCode,n=function(e){var t=ya;for(var n in t)if(t[n]===e)return n;return null}(t),r=t-111;return r>0&&r<13&&(n="f".concat(r)),{code:t,key:n=n||String.fromCharCode(t).toLowerCase(),shift:e.shiftKey,control:e.ctrlKey,alt:e.altKey,meta:e.metaKey}}var va=function(){function e(t,n){la(this,e),this.scene=n.scene,this.domElem=t,this.pos=da(t),this.opt=this.callbacks=n,this.size={width:t.width||t.offsetWidth,height:t.height||t.offsetHeight},this.attachEvents()}var t,n,r;return t=e,(n=[{key:"attachEvents",value:function(){var e=this,t=this.domElem,n=this.opt;if(n.disableContextMenu&&(t.oncontextmenu=function(){return!1}),n.enableMouse){["mouseup","mousedown","mousemove","mouseover","mouseout"].forEach(function(n){t.addEventListener(n,function(t,r){e[n](e.eventInfo(n,t,r))},!1)});var r="";r=document.getBoxObjectFor||null!==window.mozInnerScreenX?"DOMMouseScroll":"mousewheel",t.addEventListener(r,function(t,n){e.mousewheel(e.eventInfo("mousewheel",t,n))},!1)}n.enableTouch&&["touchstart","touchmove","touchend"].forEach(function(n){t.addEventListener(n,function(t,r){e[n](e.eventInfo(n,t,r))},!1)}),n.enableKeyboard&&["keydown","keyup"].forEach(function(t){document.addEventListener(t,function(n,r){e[t](e.eventInfo(t,n,r))},!1)})}},{key:"eventInfo",value:function(e,t,n){for(var r,i,o,a=this.domElem,s=this.scene,u=this.opt,l=this.getSize(),c=u.relative,f=u.centerOrigin,h=u.cachePosition&&this.pos||da(a),d=function(e,t){return t=t||window,e||t.event}(t,n),p=function(e,t){t=t||window,e=e||t.event;var n=t.document;if(n=n.documentElement||n.body,e.touches&&e.touches.length){for(var r,i=[],o=e.touches.length,a=0;a<o;++a)r=e.touches[a],i.push({x:r.pageX||r.clientX+n.scrollLeft,y:r.pageY||r.clientY+n.scrollTop});return i}return[{x:e.pageX||e.clientX+n.scrollLeft,y:e.pageY||e.clientY+n.scrollTop}]}(t,n),v=p[0].x,g=p[0].y,y={},_=0,m=p.length;_<m;++_)r=p[_].x,i=p[_].y,c&&(r-=h.x,i-=h.y,f&&(r-=l.width/2,i-=l.height/2,i*=-1)),p[_].x=r,p[_].y=i;switch(e){case"mousewheel":y.wheel=function(e){return e.wheelDelta?e.wheelDelta/120:-(e.detail||0)/3}(d);break;case"keydown":case"keyup":Object.assign(y,pa(d));break;case"mouseup":y.isRightClick=function(e){return 3===e.which||2===e.button}(d)}return Object.assign(y,{x:p[0].x,y:p[0].y,posArray:p,cache:!1,stop:function(){var e;(e=d).stopPropagation&&e.stopPropagation(),e.cancelBubble=!0,e.preventDefault?e.preventDefault():e.returnValue=!1},getTarget:function(){return o||(o=u.picking&&s.pick(v-h.x,g-h.y)||!0)}}),y.event=d,y}},{key:"getSize",value:function(){if(this.cacheSize)return this.size;var e=this.domElem;return{width:e.width||e.offsetWidth,height:e.height||e.offsetHeight}}},{key:"mouseup",value:function(e){this.moved||(e.isRightClick?this.callbacks.onRightClick(e,this.hovered):this.callbacks.onClick(e,ha(this.pressed))),this.pressed&&(this.moved?this.callbacks.onDragEnd(e,ha(this.pressed)):this.callbacks.onDragCancel(e,ha(this.pressed)),this.pressed=this.moved=!1)}},{key:"mouseout",value:function(e){for(var t=e.relatedTarget,n=this.domElem;t&&t.parentNode;){if(n===t.parentNode)return;t=t.parentNode}this.hovered&&(this.callbacks.onMouseLeave(e,this.hovered),this.hovered=!1),this.pressed&&this.moved&&(this.callbacks.onDragEnd(e),this.pressed=this.moved=!1)}},{key:"mouseover",value:function(e){}},{key:"mousemove",value:function(e){if(this.pressed)return this.moved=!0,void this.callbacks.onDragMove(e,ha(this.pressed));if(this.hovered){var t=ha(e.getTarget());t&&t.hash===this.hash?this.callbacks.onMouseMove(e,this.hovered):(this.callbacks.onMouseLeave(e,this.hovered),this.hovered=t,this.hash=t,t&&(this.hash=t.hash,this.callbacks.onMouseEnter(e,this.hovered)))}else this.hovered=ha(e.getTarget()),this.hash=this.hovered,this.hovered&&(this.hash=this.hovered.hash,this.callbacks.onMouseEnter(e,this.hovered));this.opt.picking||this.callbacks.onMouseMove(e)}},{key:"mousewheel",value:function(e){this.callbacks.onMouseWheel(e)}},{key:"mousedown",value:function(e){this.pressed=e.getTarget(),this.callbacks.onDragStart(e,ha(this.pressed))}},{key:"touchstart",value:function(e){this.touched=e.getTarget(),this.touchedLastPosition={x:e.x,y:e.y},this.callbacks.onTouchStart(e,ha(this.touched))}},{key:"touchmove",value:function(e){this.touched&&(this.touchMoved=!0,this.callbacks.onTouchMove(e,ha(this.touched)))}},{key:"touchend",value:function(e){this.touched&&(this.touchMoved?this.callbacks.onTouchEnd(e,ha(this.touched)):(e.x=isNaN(e.x)?this.touchedLastPosition.x:e.x,e.y=isNaN(e.y)?this.touchedLastPosition.y:e.y,this.callbacks.onTap(e,ha(this.touched)),this.callbacks.onTouchCancel(e,ha(this.touched))),this.touched=this.touchMoved=!1)}},{key:"keydown",value:function(e){this.callbacks.onKeyDown(e)}},{key:"keyup",value:function(e){this.callbacks.onKeyUp(e)}}])&&ca(t.prototype,n),r&&ca(t,r),e}();Object.assign(va.prototype,{hovered:!1,pressed:!1,touched:!1,touchedLastPosition:{x:0,y:0},touchMoved:!1,moved:!1});var ga={cachePosition:!0,cacheSize:!0,relative:!0,centerOrigin:!0,disableContextMenu:!0,bind:!1,picking:!1,enableTouch:!0,enableMouse:!0,enableKeyboard:!0,onClick:fa,onRightClick:fa,onDragStart:fa,onDragMove:fa,onDragEnd:fa,onDragCancel:fa,onTouchStart:fa,onTouchMove:fa,onTouchEnd:fa,onTouchCancel:fa,onTap:fa,onMouseMove:fa,onMouseEnter:fa,onMouseLeave:fa,onMouseWheel:fa,onKeyDown:fa,onKeyUp:fa},ya={enter:13,up:38,down:40,left:37,right:39,esc:27,space:32,backspace:8,tab:9,delete:46};function _a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(t=Object.assign({},ga,t)).bind;if(n)for(var r in t)r.match(/^on[a-zA-Z0-9]+$/)&&function(e,r){t[e]=function(){r.apply(n,Array.prototype.slice.call(arguments))}}(r,t[r]);return new va(e,t)}function ma(e){return(ma="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ba(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function Ea(e,t){return!t||"object"!==ma(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}var wa={x:[2,0,1],y:[0,1,2],z:[1,2,0]},Sa=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};ba(this,t);for(var n=e.bottomRadius,r=void 0===n?0:n,i=e.topRadius,o=void 0===i?0:i,a=e.height,s=void 0===a?1:a,u=e.nradial,l=void 0===u?10:u,c=e.nvertical,f=void 0===c?10:c,h=e.verticalAxis,d=void 0===h?"y":h,p=e.topCap,v=void 0!==p&&p,g=e.bottomCap,y=void 0!==g&&g,_=(v?2:0)+(y?2:0),m=(l+1)*(f+1+_),b=Math.atan2(r-o,s),E=Math.sin,w=Math.cos,S=Math.PI,P=w(b),T=E(b),A=v?-2:0,x=f+(y?2:0),O=l+1,R=new Float32Array(3*m),C=new Float32Array(3*m),k=new Float32Array(2*m),M=new Uint16Array(l*(f+_)*6),I=wa[d],L=0,N=0,F=A;F<=x;F++){var j=F/f,D=s*j,B=void 0;F<0?(D=0,j=1,B=r):F>f?(D=s,j=1,B=o):B=r+F/f*(o-r),-2!==F&&F!==f+2||(B=0,j=0),D-=s/2;for(var U=0;U<O;U++){var G=E(U*S*2/l),V=w(U*S*2/l);R[L+I[0]]=G*B,R[L+I[1]]=D,R[L+I[2]]=V*B,C[L+I[0]]=F<0||F>f?0:G*P,C[L+I[1]]=F<0?-1:F>f?1:T,C[L+I[2]]=F<0||F>f?0:V*P,k[N+0]=U/l,k[N+1]=j,N+=2,L+=3}}for(var z=0;z<f+_;z++)for(var X=0;X<l;X++){var W=6*(z*l+X);M[W+0]=O*(z+0)+0+X,M[W+1]=O*(z+0)+1+X,M[W+2]=O*(z+1)+1+X,M[W+3]=O*(z+0)+0+X,M[W+4]=O*(z+1)+1+X,M[W+5]=O*(z+1)+0+X}return Ea(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,Object.assign({},e,{attributes:{positions:R,normals:C,texCoords:k,indices:M}})))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");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)}(t,Qi),t}();function Pa(e){return(Pa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ta(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function Aa(e,t){return!t||"object"!==Pa(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}var xa=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Ta(this,t);var n=e.radius,r=void 0===n?1:n,i=e.cap,o=void 0===i||i;return Aa(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,Object.assign({},e,{topRadius:0,topCap:Boolean(o),bottomCap:Boolean(o),bottomRadius:r})))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");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)}(t,Sa),t}();function Oa(e){return(Oa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ra(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function Ca(e,t){return!t||"object"!==Oa(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}var ka=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Ra(this,t);var n=e.id,r=void 0===n?X("cube-geometry"):n;return Ca(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,Object.assign({},e,{id:r,attributes:{indices:new Uint16Array(Ma),positions:new Float32Array(Ia),normals:new Float32Array(La),texCoords:new Float32Array(Na)}})))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");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)}(t,Qi),t}(),Ma=new Uint16Array([0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]),Ia=new Float32Array([-1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,1,1,1,1,1,1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1]),La=new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0]),Na=new Float32Array([0,0,1,0,1,1,0,1,1,0,1,1,0,1,0,0,0,1,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,0,1]);function Fa(e){return(Fa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ja(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function Da(e,t){return!t||"object"!==Fa(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}var Ba=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};ja(this,t);var n=e.radius,r=void 0===n?1:n;return Da(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,Object.assign({},e,{bottomRadius:r,topRadius:r})))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");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)}(t,Sa),t}();function Ua(e){return(Ua="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ga(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function Va(e,t){return!t||"object"!==Ua(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}var za=[-1,0,0,0,1,0,0,0,-1,0,0,1,0,-1,0,1,0,0],Xa=[3,4,5,3,5,1,3,1,0,3,0,4,4,0,2,4,2,5,2,0,1,5,2,1],Wa=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Ga(this,t);var n=e.iterations,r=void 0===n?0:n,i=Math.PI,o=2*i,a=za.concat(),s=Xa.concat();a.push(),s.push();for(var u,l=(u={},function(e,t){var n=(e*=3)>(t*=3)?e:t,r="".concat(e<t?e:t,"|").concat(n);if(r in u)return u[r];var i=a[e],o=a[e+1],s=a[e+2],l=(i+a[t])/2,c=(o+a[t+1])/2,f=(s+a[t+2])/2,h=Math.sqrt(l*l+c*c+f*f);return l/=h,c/=h,f/=h,a.push(l,c,f),u[r]=a.length/3-1}),c=0;c<r;c++){for(var f=[],h=0;h<s.length;h+=3){var d=l(s[h+0],s[h+1]),p=l(s[h+1],s[h+2]),v=l(s[h+2],s[h+0]);f.push(v,s[h+0],d,d,s[h+1],p,p,s[h+2],v,d,p,v)}s=f}for(var g=new Array(3*s.length),y=new Array(2*s.length),_=s.length-3;_>=0;_-=3){var m=s[_+0],b=s[_+1],E=s[_+2],w=3*m,S=3*b,P=3*E,T=2*m,A=2*b,x=2*E,O=a[w+0],R=a[w+1],C=a[w+2],k=Math.acos(C/Math.sqrt(O*O+R*R+C*C))/i,M=1-(Math.atan2(R,O)+i)/o,I=a[S+0],L=a[S+1],N=a[S+2],F=Math.acos(N/Math.sqrt(I*I+L*L+N*N))/i,j=1-(Math.atan2(L,I)+i)/o,D=a[P+0],B=a[P+1],U=a[P+2],G=Math.acos(U/Math.sqrt(D*D+B*B+U*U))/i,V=1-(Math.atan2(B,D)+i)/o,z=[D-I,B-L,U-N],X=[O-I,R-L,C-N],W=new Ji.Vector3(z).cross(X).normalize(),H=void 0;(0===M||0===j||0===V)&&(0===M||M>.5)&&(0===j||j>.5)&&(0===V||V>.5)&&(a.push(a[w+0],a[w+1],a[w+2]),H=a.length/3-1,s.push(H),y[2*H+0]=1,y[2*H+1]=k,g[3*H+0]=W.x,g[3*H+1]=W.y,g[3*H+2]=W.z,a.push(a[S+0],a[S+1],a[S+2]),H=a.length/3-1,s.push(H),y[2*H+0]=1,y[2*H+1]=F,g[3*H+0]=W.x,g[3*H+1]=W.y,g[3*H+2]=W.z,a.push(a[P+0],a[P+1],a[P+2]),H=a.length/3-1,s.push(H),y[2*H+0]=1,y[2*H+1]=G,g[3*H+0]=W.x,g[3*H+1]=W.y,g[3*H+2]=W.z),g[w+0]=g[S+0]=g[P+0]=W.x,g[w+1]=g[S+1]=g[P+1]=W.y,g[w+2]=g[S+2]=g[P+2]=W.z,y[T+0]=M,y[T+1]=k,y[A+0]=j,y[A+1]=F,y[x+0]=V,y[x+1]=G}return Va(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,Object.assign({},e,{attributes:{positions:new Float32Array(a),normals:new Float32Array(g),texCoords:new Float32Array(y),indices:new Uint16Array(s)}})))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");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)}(t,Qi),t}();function Ha(e){return(Ha="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ya(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function Ka(e,t){return!t||"object"!==Ha(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}var Za=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Ya(this,t);var n=e.type,r=void 0===n?"x,y":n,i=e.offset,o=void 0===i?0:i,a=e.flipCull,s=void 0!==a&&a,u=e.unpack,l=void 0!==u&&u,c=e.id,f=void 0===c?X("plane-geometry"):c,h=r.split(","),d=e["".concat(h[0],"len")],p=e["".concat(h[1],"len")],v=e["n".concat(h[0])]||1,g=e["n".concat(h[1])]||1,y=(v+1)*(g+1),_=new Float32Array(3*y),m=new Float32Array(3*y),b=new Float32Array(2*y);s&&(d=-d);for(var E=0,w=0,S=0;S<=g;S++)for(var P=0;P<=v;P++){var T=P/v,A=S/g;switch(b[E+0]=s?1-T:T,b[E+1]=A,r){case"x,y":_[w+0]=d*T-.5*d,_[w+1]=p*A-.5*p,_[w+2]=o,m[w+0]=0,m[w+1]=0,m[w+2]=s?1:-1;break;case"x,z":_[w+0]=d*T-.5*d,_[w+1]=o,_[w+2]=p*A-.5*p,m[w+0]=0,m[w+1]=s?1:-1,m[w+2]=0;break;case"y,z":_[w+0]=o,_[w+1]=d*T-.5*d,_[w+2]=p*A-.5*p,m[w+0]=s?1:-1,m[w+1]=0,m[w+2]=0}E+=2,w+=3}for(var x=v+1,O=new Uint16Array(v*g*6),R=0;R<g;R++)for(var C=0;C<v;C++){var k=6*(R*v+C);O[k+0]=(R+0)*x+C,O[k+1]=(R+1)*x+C,O[k+2]=(R+0)*x+C+1,O[k+3]=(R+1)*x+C,O[k+4]=(R+1)*x+C+1,O[k+5]=(R+0)*x+C+1}if(l){for(var M=new Float32Array(3*O.length),I=new Float32Array(3*O.length),L=new Float32Array(2*O.length),N=0;N<O.length;++N){var F=O[N];M[3*N+0]=_[3*F+0],M[3*N+1]=_[3*F+1],M[3*N+2]=_[3*F+2],I[3*N+0]=m[3*F+0],I[3*N+1]=m[3*F+1],I[3*N+2]=m[3*F+2],L[2*N+0]=b[2*F+0],L[2*N+1]=b[2*F+1]}_=M,m=I,b=L,O=void 0}var j={positions:_,normals:m,texCoords:b};return O&&(j.indices=O),Ka(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,Object.assign({},e,{attributes:j,id:f})))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");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)}(t,Qi),t}();function qa(e){return(qa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Qa(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function Ja(e,t){return!t||"object"!==qa(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}var $a=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Qa(this,t);var n=e.nlat,r=void 0===n?10:n,i=e.nlong,o=void 0===i?10:i,a=e.radius,s=void 0===a?1:a,u=e.id,l=void 0===u?X("sphere-geometry"):u;return Ja(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,Object.assign({},e,{id:l,attributes:function(e,t,n){var r=Math.PI-0,i=2*Math.PI-0,o=(e+1)*(t+1);if("number"==typeof n){var a=n;n=function(e,t,n,r,i){return a}}for(var s=new Float32Array(3*o),u=new Float32Array(3*o),l=new Float32Array(2*o),c=new Uint16Array(e*t*6),f=0;f<=e;f++)for(var h=0;h<=t;h++){var d=h/t,p=f/e,v=h+f*(t+1),g=2*v,y=3*v,_=i*d,m=r*p,b=Math.sin(_),E=Math.cos(_),w=Math.sin(m),S=Math.cos(m),P=E*w,T=S,A=b*w,x=n(P,T,A,d,p);s[y+0]=x*P,s[y+1]=x*T,s[y+2]=x*A,u[y+0]=P,u[y+1]=T,u[y+2]=A,l[g+0]=d,l[g+1]=p}for(var O=e+1,R=0;R<e;R++)for(var C=0;C<t;C++){var k=6*(R*t+C);c[k+0]=C*O+R,c[k+1]=C*O+R+1,c[k+2]=(C+1)*O+R,c[k+3]=(C+1)*O+R,c[k+4]=C*O+R+1,c[k+5]=(C+1)*O+R+1}return{positions:s,indices:c,normals:u,texCoords:l}}(r,o,s)})))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");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)}(t,Qi),t}();function es(e){return(es="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ts(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function ns(e,t){return!t||"object"!==es(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}var rs=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ts(this,t),ns(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,Object.assign({},n,{geometry:new xa(n)})))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");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)}(t,Bo),t}();function is(e){return(is="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function os(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function as(e,t){return!t||"object"!==is(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}var ss=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};os(this,t);var r=n.id,i=void 0===r?X("cube"):r;return as(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,Object.assign({},n,{id:i,geometry:new ka(n)})))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");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)}(t,Bo),t}();function us(e){return(us="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ls(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function cs(e,t){return!t||"object"!==us(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}var fs=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ls(this,t),cs(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,Object.assign({},n,{geometry:new Ba(n)})))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");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)}(t,Bo),t}();function hs(e){return(hs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ds(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function ps(e,t){return!t||"object"!==hs(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}var vs=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ds(this,t),ps(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,Object.assign({},n,{geometry:new Wa(n)})))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");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)}(t,Bo),t}();function gs(e){return(gs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ys(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function _s(e,t){return!t||"object"!==gs(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}var ms=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ys(this,t);var r=n.id,i=void 0===r?X("plane"):r;return _s(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,Object.assign({},n,{id:i,geometry:new Za(n)})))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");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)}(t,Bo),t}();function bs(e){return(bs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Es(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function ws(e,t){return!t||"object"!==bs(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}var Ss=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Es(this,t);var r=n.id,i=void 0===r?X("sphere"):r;return ws(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,Object.assign({},n,{id:i,geometry:new $a(n)})))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");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)}(t,Bo),t}();function Ps(e){return(Ps="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ts(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function As(e,t){return!t||"object"!==Ps(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}var xs=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Ts(this,t),As(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,Object.assign({},n,{geometry:new Sa(n)})))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");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)}(t,Bo),t}();function Os(e){return(Os="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Rs(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function Cs(e,t){return!t||"object"!==Os(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}var ks="attribute vec2 aClipSpacePosition;\nattribute vec2 aTexCoord;\nattribute vec2 aCoordinate;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main(void) {\n gl_Position = vec4(aClipSpacePosition, 0., 1.);\n position = aClipSpacePosition;\n coordinate = aCoordinate;\n uv = aTexCoord;\n}\n",Ms=[-1,-1,1,-1,-1,1,1,1],Is=function(e){function t(e,n){var r;Rs(this,t);var i=Ms.map(function(e){return-1===e?0:e});return(r=Cs(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,Object.assign({},n,{vs:ks,geometry:new Qi({drawMode:C.a.TRIANGLE_STRIP,vertexCount:4,attributes:{aClipSpacePosition:{size:2,value:new Float32Array(Ms)},aTexCoord:{size:2,value:new Float32Array(i)},aCoordinate:{size:2,value:new Float32Array(i)}}})})))).setVertexCount(4),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");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)}(t,Bo),t}();function Ls(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}function Ns(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Fs(){}var js=4,Ds=function(){function e(t){var n=t.url,r=t.path,i=void 0===r?null:r,o=t.method,a=void 0===o?"GET":o,s=t.asynchronous,u=void 0===s||s,l=t.noCache,c=void 0!==l&&l,f=t.sendAsBinary,h=void 0!==f&&f,d=t.responseType,p=void 0!==d&&d,v=t.onProgress,g=void 0===v?Fs:v,y=t.onError,_=void 0===y?Fs:y,m=t.onAbort,b=void 0===m?Fs:m,E=t.onComplete,w=void 0===E?Fs:E;Ls(this,e),this.url=i?i.join(i,n):n,this.method=a,this.async=u,this.noCache=c,this.sendAsBinary=h,this.responseType=p,this.req=new XMLHttpRequest,this.req.onload=function(e){return w(e)},this.req.onerror=function(e){return _(e)},this.req.onabort=function(e){return b(e)},this.req.onprogress=function(e){e.lengthComputable?g(e,Math.round(e.loaded/e.total*100)):g(e,-1)}}var t,n,r;return t=e,(n=[{key:"setRequestHeader",value:function(e,t){return this.req.setRequestHeader(e,t),this}},{key:"sendAsync",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.body||null;return new Promise(function(n,r){try{var i=e.req,o=e.method,a=e.noCache,s=e.sendAsBinary,u=e.responseType,l=a?e.url+(e.url.indexOf("?")>=0?"&":"?")+Date.now():e.url;i.open(o,l,e.async),u&&(i.responseType=u),e.async&&(i.onreadystatechange=function(e){i.readyState===js&&(200===i.status?n(i.responseType?i.response:i.responseText):r(new Error("".concat(i.status,": ").concat(l))))}),s?i.sendAsBinary(t):i.send(t),e.async||(200===i.status?n(i.responseType?i.response:i.responseText):r(new Error("".concat(i.status,": ").concat(l))))}catch(e){r(e)}})}}])&&Ns(t.prototype,n),r&&Ns(t,r),e}();var Bs="";function Us(e){Bs=e}function Gs(e,t){return"string"==typeof e||t||(e=(t=e).url),t.url=Bs?Bs+e:e,function(e){return new Ds(e).sendAsync()}(t)}function Vs(e,t){return e=Bs?Bs+e:e,new Promise(function(n,r){try{var i=new Image;i.onload=function(){return n(i)},i.onerror=function(){return r(new Error("Could not load image ".concat(e,".")))},i.crossOrigin=t&&t.crossOrigin||"anonymous",i.src=e}catch(e){r(e)}})}function zs(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Xs(){}function Ws(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.urls,n=e.onProgress,r=void 0===n?Xs:n;A(t.every(function(e){return"string"==typeof e}),"loadImages: {urls} must be array of strings");var i=0;return Promise.all(t.map(function(n){var o=Gs(Object.assign({url:n},e));return o.then(function(e){return r({progress:++i/t.length,count:i,total:t.length,url:n})}),o}))}function Hs(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.urls,n=e.onProgress,r=void 0===n?Xs:n;A(t.every(function(e){return"string"==typeof e}),"loadImages: {urls} must be array of strings");var i=0;return Promise.all(t.map(function(n){var o=Vs(n,e);return o.then(function(e){return r({progress:++i/t.length,count:i,total:t.length,url:n})}),o}))}function Ys(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.urls,r=t.onProgress,i=void 0===r?Xs:r;return A(n.every(function(e){return"string"==typeof e}),"loadTextures: {urls} must be array of strings"),Hs(Object.assign({urls:n,onProgress:i},t)).then(function(r){return r.map(function(r,i){var o=Array.isArray(t.parameters)?t.parameters[i]:t.parameters;return o=void 0===o?{}:o,new xn(e,Object.assign({id:n[i]},o,{data:r}))})})}function Ks(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.vs,r=t.fs,i=t.onProgress,o=void 0===i?Xs:i;return Ws(Object.assign({urls:[n,r],onProgress:o},t)).then(function(n){var r=zs(n,2),i=r[0],o=r[1];return new qr(e,Object.assign({vs:i,fs:o},t))})}function Zs(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.url,r=t.onProgress,i=void 0===r?Xs:r;return Ws(Object.assign({urls:[n],onProgress:i},t)).then(function(n){var r=zs(n,1)[0];return qs(e,Object.assign({file:r},t))})}function qs(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.file,r=t.program,i=void 0===r?new qr(e):r,o="string"==typeof n?function(e){try{return JSON.parse(e)}catch(e){throw new Error("Failed to parse JSON: ".concat(e))}}(n):n,a={},s={};for(var u in o){var l=o[u];Array.isArray(l)?a[u]="indices"===u?new Uint16Array(l):new Float32Array(l):s[u]=l}return new Bo(e,Object.assign({program:i,geometry:new Qi({attributes:a})},s,t))}var Qs={name:"fp32",vs:"#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n\n// All these functions are for substituting tan() function from Intel GPU only\nconst float TWO_PI = 6.2831854820251465;\nconst float PI_2 = 1.5707963705062866;\nconst float PI_16 = 0.1963495463132858;\n\nconst float SIN_TABLE_0 = 0.19509032368659973;\nconst float SIN_TABLE_1 = 0.3826834261417389;\nconst float SIN_TABLE_2 = 0.5555702447891235;\nconst float SIN_TABLE_3 = 0.7071067690849304;\n\nconst float COS_TABLE_0 = 0.9807852506637573;\nconst float COS_TABLE_1 = 0.9238795042037964;\nconst float COS_TABLE_2 = 0.8314695954322815;\nconst float COS_TABLE_3 = 0.7071067690849304;\n\nconst float INVERSE_FACTORIAL_3 = 1.666666716337204e-01; // 1/3!\nconst float INVERSE_FACTORIAL_5 = 8.333333767950535e-03; // 1/5!\nconst float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04; // 1/7!\nconst float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06; // 1/9!\n\nfloat sin_taylor_fp32(float a) {\n float r, s, t, x;\n\n if (a == 0.0) {\n return 0.0;\n }\n\n x = -a * a;\n s = a;\n r = a;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_3;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_5;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_7;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_9;\n s = s + t;\n\n return s;\n}\n\nvoid sincos_taylor_fp32(float a, out float sin_t, out float cos_t) {\n if (a == 0.0) {\n sin_t = 0.0;\n cos_t = 1.0;\n }\n sin_t = sin_taylor_fp32(a);\n cos_t = sqrt(1.0 - sin_t * sin_t);\n}\n\nfloat tan_taylor_fp32(float a) {\n float sin_a;\n float cos_a;\n\n if (a == 0.0) {\n return 0.0;\n }\n\n // 2pi range reduction\n float z = floor(a / TWO_PI);\n float r = a - TWO_PI * z;\n\n float t;\n float q = floor(r / PI_2 + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return 0.0 / 0.0;\n }\n\n t = r - PI_2 * q;\n\n q = floor(t / PI_16 + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return 0.0 / 0.0;\n } else {\n t = t - PI_16 * q;\n }\n\n float u = 0.0;\n float v = 0.0;\n\n float sin_t, cos_t;\n float s, c;\n sincos_taylor_fp32(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0;\n v = SIN_TABLE_0;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1;\n v = SIN_TABLE_1;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2;\n v = SIN_TABLE_2;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3;\n v = SIN_TABLE_3;\n }\n if (k > 0) {\n s = u * sin_t + v * cos_t;\n c = u * cos_t - v * sin_t;\n } else {\n s = u * sin_t - v * cos_t;\n c = u * cos_t + v * sin_t;\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return sin_a / cos_a;\n}\n#endif\n\nfloat tan_fp32(float a) {\n#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n return tan_taylor_fp32(a);\n#else\n return tan(a);\n#endif\n}\n",fs:null};function Js(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=Math.fround(e),i=e-r;return t[n]=r,t[n+1]=i,t}var $s="uniform float ONE;\n\n/*\nAbout LUMA_FP64_CODE_ELIMINATION_WORKAROUND\n\nThe purpose of this workaround is to prevent shader compilers from\noptimizing away necessary arithmetic operations by swapping their sequences\nor transform the equation to some 'equivalent' from.\n\nThe method is to multiply an artifical variable, ONE, which will be known to\nthe compiler to be 1 only at runtime. The whole expression is then represented\nas a polynomial with respective to ONE. In the coefficients of all terms, only one a\nand one b should appear\n\nerr = (a + b) * ONE^6 - a * ONE^5 - (a + b) * ONE^4 + a * ONE^3 - b - (a + b) * ONE^2 + a * ONE\n*/\n\n// Divide float number to high and low floats to extend fraction bits\nvec2 split(float a) {\n const float SPLIT = 4097.0;\n float t = a * SPLIT;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float a_hi = t * ONE - (t - a);\n float a_lo = a * ONE - a_hi;\n#else\n float a_hi = t - (t - a);\n float a_lo = a - a_hi;\n#endif\n return vec2(a_hi, a_lo);\n}\n\n// Divide float number again when high float uses too many fraction bits\nvec2 split2(vec2 a) {\n vec2 b = split(a.x);\n b.y += a.y;\n return b;\n}\n\n// Special sum operation when a > b\nvec2 quickTwoSum(float a, float b) {\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float sum = (a + b) * ONE;\n float err = b - (sum - a) * ONE;\n#else\n float sum = a + b;\n float err = b - (sum - a);\n#endif\n return vec2(sum, err);\n}\n\n// General sum operation\nvec2 twoSum(float a, float b) {\n float s = (a + b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float v = (s * ONE - a) * ONE;\n float err = (a - (s - v) * ONE) * ONE * ONE * ONE + (b - v);\n#else\n float v = s - a;\n float err = (a - (s - v)) + (b - v);\n#endif\n return vec2(s, err);\n}\n\nvec2 twoSub(float a, float b) {\n float s = (a - b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float v = (s * ONE - a) * ONE;\n float err = (a - (s - v) * ONE) * ONE * ONE * ONE - (b + v);\n#else\n float v = s - a;\n float err = (a - (s - v)) - (b + v);\n#endif\n return vec2(s, err);\n}\n\nvec2 twoSqr(float a) {\n float prod = a * a;\n vec2 a_fp64 = split(a);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float err = ((a_fp64.x * a_fp64.x - prod) * ONE + 2.0 * a_fp64.x *\n a_fp64.y * ONE * ONE) + a_fp64.y * a_fp64.y * ONE * ONE * ONE;\n#else\n float err = ((a_fp64.x * a_fp64.x - prod) + 2.0 * a_fp64.x * a_fp64.y) + a_fp64.y * a_fp64.y;\n#endif\n return vec2(prod, err);\n}\n\nvec2 twoProd(float a, float b) {\n float prod = a * b;\n vec2 a_fp64 = split(a);\n vec2 b_fp64 = split(b);\n float err = ((a_fp64.x * b_fp64.x - prod) + a_fp64.x * b_fp64.y +\n a_fp64.y * b_fp64.x) + a_fp64.y * b_fp64.y;\n return vec2(prod, err);\n}\n\nvec2 sum_fp64(vec2 a, vec2 b) {\n vec2 s, t;\n s = twoSum(a.x, b.x);\n t = twoSum(a.y, b.y);\n s.y += t.x;\n s = quickTwoSum(s.x, s.y);\n s.y += t.y;\n s = quickTwoSum(s.x, s.y);\n return s;\n}\n\nvec2 sub_fp64(vec2 a, vec2 b) {\n vec2 s, t;\n s = twoSub(a.x, b.x);\n t = twoSub(a.y, b.y);\n s.y += t.x;\n s = quickTwoSum(s.x, s.y);\n s.y += t.y;\n s = quickTwoSum(s.x, s.y);\n return s;\n}\n\nvec2 mul_fp64(vec2 a, vec2 b) {\n vec2 prod = twoProd(a.x, b.x);\n // y component is for the error\n prod.y += a.x * b.y;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n prod = split2(prod);\n#endif\n prod = quickTwoSum(prod.x, prod.y);\n prod.y += a.y * b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n prod = split2(prod);\n#endif\n prod = quickTwoSum(prod.x, prod.y);\n return prod;\n}\n\nvec2 div_fp64(vec2 a, vec2 b) {\n float xn = 1.0 / b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n vec2 yn = mul_fp64(a, vec2(xn, 0));\n#else\n vec2 yn = a * xn;\n#endif\n float diff = (sub_fp64(a, mul_fp64(b, yn))).x;\n vec2 prod = twoProd(xn, diff);\n return sum_fp64(yn, prod);\n}\n\nvec2 sqrt_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) return vec2(0.0, 0.0);\n if (a.x < 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);\n\n float x = 1.0 / sqrt(a.x);\n float yn = a.x * x;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n vec2 yn_sqr = twoSqr(yn) * ONE;\n#else\n vec2 yn_sqr = twoSqr(yn);\n#endif\n float diff = sub_fp64(a, yn_sqr).x;\n vec2 prod = twoProd(x * 0.5, diff);\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n return sum_fp64(split(yn), prod);\n#else\n return sum_fp64(vec2(yn, 0.0), prod);\n#endif\n}\n",eu="".concat($s,"\n").concat("const vec2 E_FP64 = vec2(2.7182817459106445e+00, 8.254840366817007e-08);\nconst vec2 LOG2_FP64 = vec2(0.6931471824645996e+00, -1.9046542121259336e-09);\nconst vec2 PI_FP64 = vec2(3.1415927410125732, -8.742278012618954e-8);\nconst vec2 TWO_PI_FP64 = vec2(6.2831854820251465, -1.7484556025237907e-7);\nconst vec2 PI_2_FP64 = vec2(1.5707963705062866, -4.371139006309477e-8);\nconst vec2 PI_4_FP64 = vec2(0.7853981852531433, -2.1855695031547384e-8);\nconst vec2 PI_16_FP64 = vec2(0.19634954631328583, -5.463923757886846e-9);\nconst vec2 PI_16_2_FP64 = vec2(0.39269909262657166, -1.0927847515773692e-8);\nconst vec2 PI_16_3_FP64 = vec2(0.5890486240386963, -1.4906100798128818e-9);\nconst vec2 PI_180_FP64 = vec2(0.01745329238474369, 1.3519960498364902e-10);\n\nconst vec2 SIN_TABLE_0_FP64 = vec2(0.19509032368659973, -1.6704714833615242e-9);\nconst vec2 SIN_TABLE_1_FP64 = vec2(0.3826834261417389, 6.22335089017767e-9);\nconst vec2 SIN_TABLE_2_FP64 = vec2(0.5555702447891235, -1.1769521357507529e-8);\nconst vec2 SIN_TABLE_3_FP64 = vec2(0.7071067690849304, 1.2101617041793133e-8);\n\nconst vec2 COS_TABLE_0_FP64 = vec2(0.9807852506637573, 2.9739473106360492e-8);\nconst vec2 COS_TABLE_1_FP64 = vec2(0.9238795042037964, 2.8307490351764386e-8);\nconst vec2 COS_TABLE_2_FP64 = vec2(0.8314695954322815, 1.6870263741530778e-8);\nconst vec2 COS_TABLE_3_FP64 = vec2(0.7071067690849304, 1.2101617152815436e-8);\n\nconst vec2 INVERSE_FACTORIAL_3_FP64 = vec2(1.666666716337204e-01, -4.967053879312289e-09); // 1/3!\nconst vec2 INVERSE_FACTORIAL_4_FP64 = vec2(4.16666679084301e-02, -1.2417634698280722e-09); // 1/4!\nconst vec2 INVERSE_FACTORIAL_5_FP64 = vec2(8.333333767950535e-03, -4.34617203337595e-10); // 1/5!\nconst vec2 INVERSE_FACTORIAL_6_FP64 = vec2(1.3888889225199819e-03, -3.3631094437103215e-11); // 1/6!\nconst vec2 INVERSE_FACTORIAL_7_FP64 = vec2(1.9841270113829523e-04, -2.725596874933456e-12); // 1/7!\nconst vec2 INVERSE_FACTORIAL_8_FP64 = vec2(2.4801587642286904e-05, -3.406996025904184e-13); // 1/8!\nconst vec2 INVERSE_FACTORIAL_9_FP64 = vec2(2.75573188446287533e-06, 3.7935713937038186e-14); // 1/9!\nconst vec2 INVERSE_FACTORIAL_10_FP64 = vec2(2.755731998149713e-07, -7.575112367869873e-15); // 1/10!\n\nfloat nint(float d) {\n if (d == floor(d)) return d;\n return floor(d + 0.5);\n}\n\nvec2 nint_fp64(vec2 a) {\n float hi = nint(a.x);\n float lo;\n vec2 tmp;\n if (hi == a.x) {\n lo = nint(a.y);\n tmp = quickTwoSum(hi, lo);\n } else {\n lo = 0.0;\n if (abs(hi - a.x) == 0.5 && a.y < 0.0) {\n hi -= 1.0;\n }\n tmp = vec2(hi, lo);\n }\n return tmp;\n}\n\n/* k_power controls how much range reduction we would like to have\nRange reduction uses the following method:\nassume a = k_power * r + m * log(2), k and m being integers.\nSet k_power = 4 (we can choose other k to trade accuracy with performance.\nwe only need to calculate exp(r) and using exp(a) = 2^m * exp(r)^k_power;\n*/\n\nvec2 exp_fp64(vec2 a) {\n // We need to make sure these two numbers match\n // as bit-wise shift is not available in GLSL 1.0\n const int k_power = 4;\n const float k = 16.0;\n\n const float inv_k = 1.0 / k;\n\n if (a.x <= -88.0) return vec2(0.0, 0.0);\n if (a.x >= 88.0) return vec2(1.0 / 0.0, 1.0 / 0.0);\n if (a.x == 0.0 && a.y == 0.0) return vec2(1.0, 0.0);\n if (a.x == 1.0 && a.y == 0.0) return E_FP64;\n\n float m = floor(a.x / LOG2_FP64.x + 0.5);\n vec2 r = sub_fp64(a, mul_fp64(LOG2_FP64, vec2(m, 0.0))) * inv_k;\n vec2 s, t, p;\n\n p = mul_fp64(r, r);\n s = sum_fp64(r, p * 0.5);\n p = mul_fp64(p, r);\n t = mul_fp64(p, INVERSE_FACTORIAL_3_FP64);\n\n s = sum_fp64(s, t);\n p = mul_fp64(p, r);\n t = mul_fp64(p, INVERSE_FACTORIAL_4_FP64);\n\n s = sum_fp64(s, t);\n p = mul_fp64(p, r);\n t = mul_fp64(p, INVERSE_FACTORIAL_5_FP64);\n\n // s = sum_fp64(s, t);\n // p = mul_fp64(p, r);\n // t = mul_fp64(p, INVERSE_FACTORIAL_6_FP64);\n\n // s = sum_fp64(s, t);\n // p = mul_fp64(p, r);\n // t = mul_fp64(p, INVERSE_FACTORIAL_7_FP64);\n\n s = sum_fp64(s, t);\n\n\n // At this point, s = exp(r) - 1; but after following 4 recursions, we will get exp(r) ^ 512 - 1.\n for (int i = 0; i < k_power; i++) {\n s = sum_fp64(s * 2.0, mul_fp64(s, s));\n }\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n s = sum_fp64(s, vec2(ONE, 0.0));\n#else\n s = sum_fp64(s, vec2(1.0, 0.0));\n#endif\n\n return s * pow(2.0, m);\n// return r;\n}\n\nvec2 log_fp64(vec2 a)\n{\n if (a.x == 1.0 && a.y == 0.0) return vec2(0.0, 0.0);\n if (a.x <= 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);\n vec2 x = vec2(log(a.x), 0.0);\n vec2 s;\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n s = vec2(ONE, 0.0);\n#else\n s = vec2(1.0, 0.0);\n#endif\n\n x = sub_fp64(sum_fp64(x, mul_fp64(a, exp_fp64(-x))), s);\n return x;\n}\n\nvec2 sin_taylor_fp64(vec2 a) {\n vec2 r, s, t, x;\n\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(0.0, 0.0);\n }\n\n x = -mul_fp64(a, a);\n s = a;\n r = a;\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_3_FP64);\n s = sum_fp64(s, t);\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_5_FP64);\n s = sum_fp64(s, t);\n\n /* keep the following commented code in case we need them\n for extra accuracy from the Taylor expansion*/\n\n // r = mul_fp64(r, x);\n // t = mul_fp64(r, INVERSE_FACTORIAL_7_FP64);\n // s = sum_fp64(s, t);\n\n // r = mul_fp64(r, x);\n // t = mul_fp64(r, INVERSE_FACTORIAL_9_FP64);\n // s = sum_fp64(s, t);\n\n return s;\n}\n\nvec2 cos_taylor_fp64(vec2 a) {\n vec2 r, s, t, x;\n\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(1.0, 0.0);\n }\n\n x = -mul_fp64(a, a);\n r = x;\n s = sum_fp64(vec2(1.0, 0.0), r * 0.5);\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_4_FP64);\n s = sum_fp64(s, t);\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_6_FP64);\n s = sum_fp64(s, t);\n\n /* keep the following commented code in case we need them\n for extra accuracy from the Taylor expansion*/\n\n // r = mul_fp64(r, x);\n // t = mul_fp64(r, INVERSE_FACTORIAL_8_FP64);\n // s = sum_fp64(s, t);\n\n // r = mul_fp64(r, x);\n // t = mul_fp64(r, INVERSE_FACTORIAL_10_FP64);\n // s = sum_fp64(s, t);\n\n return s;\n}\n\nvoid sincos_taylor_fp64(vec2 a, out vec2 sin_t, out vec2 cos_t) {\n if (a.x == 0.0 && a.y == 0.0) {\n sin_t = vec2(0.0, 0.0);\n cos_t = vec2(1.0, 0.0);\n }\n\n sin_t = sin_taylor_fp64(a);\n cos_t = sqrt_fp64(sub_fp64(vec2(1.0, 0.0), mul_fp64(sin_t, sin_t)));\n}\n\nvec2 sin_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(0.0, 0.0);\n }\n\n // 2pi range reduction\n vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n vec2 t;\n float q = floor(r.x / PI_2_FP64.x + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n }\n\n t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n q = floor(t.x / PI_16_FP64.x + 0.5);\n int k = int(q);\n\n if (k == 0) {\n if (j == 0) {\n return sin_taylor_fp64(t);\n } else if (j == 1) {\n return cos_taylor_fp64(t);\n } else if (j == -1) {\n return -cos_taylor_fp64(t);\n } else {\n return -sin_taylor_fp64(t);\n }\n }\n\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n } else {\n t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n }\n\n vec2 u = vec2(0.0, 0.0);\n vec2 v = vec2(0.0, 0.0);\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#else\n if (abs_k == 1) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs_k == 2) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs_k == 3) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs_k == 4) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#endif\n\n vec2 sin_t, cos_t;\n sincos_taylor_fp64(t, sin_t, cos_t);\n\n\n\n vec2 result = vec2(0.0, 0.0);\n if (j == 0) {\n if (k > 0) {\n result = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n }\n } else if (j == 1) {\n if (k > 0) {\n result = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n } else {\n result = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n } else if (j == -1) {\n if (k > 0) {\n result = sub_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n } else {\n result = -sum_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n }\n } else {\n if (k > 0) {\n result = -sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(v, cos_t), mul_fp64(u, sin_t));\n }\n }\n\n return result;\n}\n\nvec2 cos_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(1.0, 0.0);\n }\n\n // 2pi range reduction\n vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n vec2 t;\n float q = floor(r.x / PI_2_FP64.x + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n }\n\n t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n q = floor(t.x / PI_16_FP64.x + 0.5);\n int k = int(q);\n\n if (k == 0) {\n if (j == 0) {\n return cos_taylor_fp64(t);\n } else if (j == 1) {\n return -sin_taylor_fp64(t);\n } else if (j == -1) {\n return sin_taylor_fp64(t);\n } else {\n return -cos_taylor_fp64(t);\n }\n }\n\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n } else {\n t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n }\n\n vec2 u = vec2(0.0, 0.0);\n vec2 v = vec2(0.0, 0.0);\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#else\n if (abs_k == 1) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs_k == 2) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs_k == 3) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs_k == 4) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#endif\n\n vec2 sin_t, cos_t;\n sincos_taylor_fp64(t, sin_t, cos_t);\n\n vec2 result = vec2(0.0, 0.0);\n if (j == 0) {\n if (k > 0) {\n result = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n } else {\n result = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n } else if (j == 1) {\n if (k > 0) {\n result = -sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(v, cos_t), mul_fp64(u, sin_t));\n }\n } else if (j == -1) {\n if (k > 0) {\n result = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n }\n } else {\n if (k > 0) {\n result = sub_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n } else {\n result = -sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n }\n\n return result;\n}\n\nvec2 tan_fp64(vec2 a) {\n vec2 sin_a;\n vec2 cos_a;\n\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(0.0, 0.0);\n }\n\n // 2pi range reduction\n vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n vec2 t;\n float q = floor(r.x / PI_2_FP64.x + 0.5);\n int j = int(q);\n\n\n if (j < -2 || j > 2) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n }\n\n t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n q = floor(t.x / PI_16_FP64.x + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n // We just can't get PI/16 * 3.0 very accurately.\n // so let's just store it\n if (abs_k > 4) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n } else {\n t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n }\n\n\n vec2 u = vec2(0.0, 0.0);\n vec2 v = vec2(0.0, 0.0);\n\n vec2 sin_t, cos_t;\n vec2 s, c;\n sincos_taylor_fp64(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#else\n if (abs_k == 1) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs_k == 2) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs_k == 3) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs_k == 4) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#endif\n if (k > 0) {\n s = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n c = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n } else {\n s = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n c = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return div_fp64(sin_a, cos_a);\n}\n\nvec2 radians_fp64(vec2 degree) {\n return mul_fp64(degree, PI_180_FP64);\n}\n\nvec2 mix_fp64(vec2 a, vec2 b, float x) {\n vec2 range = sub_fp64(b, a);\n return sum_fp64(a, mul_fp64(range, vec2(x, 0.0)));\n}\n\n// Vector functions\n// vec2 functions\nvoid vec2_sum_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = sum_fp64(a[0], b[0]);\n out_val[1] = sum_fp64(a[1], b[1]);\n}\n\nvoid vec2_sub_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = sub_fp64(a[0], b[0]);\n out_val[1] = sub_fp64(a[1], b[1]);\n}\n\nvoid vec2_mul_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = mul_fp64(a[0], b[0]);\n out_val[1] = mul_fp64(a[1], b[1]);\n}\n\nvoid vec2_div_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = div_fp64(a[0], b[0]);\n out_val[1] = div_fp64(a[1], b[1]);\n}\n\nvoid vec2_mix_fp64(vec2 x[2], vec2 y[2], float a, out vec2 out_val[2]) {\n vec2 range[2];\n vec2_sub_fp64(y, x, range);\n vec2 portion[2];\n portion[0] = range[0] * a;\n portion[1] = range[1] * a;\n vec2_sum_fp64(x, portion, out_val);\n}\n\nvec2 vec2_length_fp64(vec2 x[2]) {\n return sqrt_fp64(sum_fp64(mul_fp64(x[0], x[0]), mul_fp64(x[1], x[1])));\n}\n\nvoid vec2_normalize_fp64(vec2 x[2], out vec2 out_val[2]) {\n vec2 length = vec2_length_fp64(x);\n vec2 length_vec2[2];\n length_vec2[0] = length;\n length_vec2[1] = length;\n\n vec2_div_fp64(x, length_vec2, out_val);\n}\n\nvec2 vec2_distance_fp64(vec2 x[2], vec2 y[2]) {\n vec2 diff[2];\n vec2_sub_fp64(x, y, diff);\n return vec2_length_fp64(diff);\n}\n\nvec2 vec2_dot_fp64(vec2 a[2], vec2 b[2]) {\n vec2 v[2];\n\n v[0] = mul_fp64(a[0], b[0]);\n v[1] = mul_fp64(a[1], b[1]);\n\n return sum_fp64(v[0], v[1]);\n}\n\n// vec3 functions\nvoid vec3_sub_fp64(vec2 a[3], vec2 b[3], out vec2 out_val[3]) {\n for (int i = 0; i < 3; i++) {\n out_val[i] = sum_fp64(a[i], b[i]);\n }\n}\n\nvoid vec3_sum_fp64(vec2 a[3], vec2 b[3], out vec2 out_val[3]) {\n for (int i = 0; i < 3; i++) {\n out_val[i] = sum_fp64(a[i], b[i]);\n }\n}\n\nvec2 vec3_length_fp64(vec2 x[3]) {\n return sqrt_fp64(sum_fp64(sum_fp64(mul_fp64(x[0], x[0]), mul_fp64(x[1], x[1])),\n mul_fp64(x[2], x[2])));\n}\n\nvec2 vec3_distance_fp64(vec2 x[3], vec2 y[3]) {\n vec2 diff[3];\n vec3_sub_fp64(x, y, diff);\n return vec3_length_fp64(diff);\n}\n\n// vec4 functions\nvoid vec4_fp64(vec4 a, out vec2 out_val[4]) {\n out_val[0].x = a[0];\n out_val[0].y = 0.0;\n\n out_val[1].x = a[1];\n out_val[1].y = 0.0;\n\n out_val[2].x = a[2];\n out_val[2].y = 0.0;\n\n out_val[3].x = a[3];\n out_val[3].y = 0.0;\n}\n\nvoid vec4_scalar_mul_fp64(vec2 a[4], vec2 b, out vec2 out_val[4]) {\n out_val[0] = mul_fp64(a[0], b);\n out_val[1] = mul_fp64(a[1], b);\n out_val[2] = mul_fp64(a[2], b);\n out_val[3] = mul_fp64(a[3], b);\n}\n\nvoid vec4_sum_fp64(vec2 a[4], vec2 b[4], out vec2 out_val[4]) {\n for (int i = 0; i < 4; i++) {\n out_val[i] = sum_fp64(a[i], b[i]);\n }\n}\n\nvoid vec4_dot_fp64(vec2 a[4], vec2 b[4], out vec2 out_val) {\n vec2 v[4];\n\n v[0] = mul_fp64(a[0], b[0]);\n v[1] = mul_fp64(a[1], b[1]);\n v[2] = mul_fp64(a[2], b[2]);\n v[3] = mul_fp64(a[3], b[3]);\n\n out_val = sum_fp64(sum_fp64(v[0], v[1]), sum_fp64(v[2], v[3]));\n}\n\nvoid mat4_vec4_mul_fp64(vec2 b[16], vec2 a[4], out vec2 out_val[4]) {\n vec2 tmp[4];\n\n for (int i = 0; i < 4; i++)\n {\n for (int j = 0; j < 4; j++)\n {\n tmp[j] = b[j + i * 4];\n }\n vec4_dot_fp64(a, tmp, out_val[i]);\n }\n}\n"),tu={name:"fp64",vs:eu,fs:null,fp64ify:Js,fp64LowPart:function(e){return e-Math.fround(e)},fp64ifyMatrix4:function(e){for(var t=new Float32Array(32),n=0;n<4;++n)for(var r=0;r<4;++r){var i=4*n+r;Js(e[4*r+n],t,2*i)}return t}},nu=("".concat($s),[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),ru={modelMatrix:nu,viewMatrix:nu,projectionMatrix:nu,cameraPositionWorld:[0,0,0]};var iu="varying vec4 project_vPositionWorld;\nvarying vec3 project_vNormalWorld;\n\nvec4 project_getPosition_World() {\n return project_vPositionWorld;\n}\n\nvec3 project_getNormal_World() {\n return project_vNormalWorld;\n}\n",ou={name:"project",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ru,t=(arguments.length>1&&void 0!==arguments[1]&&arguments[1],{});return void 0!==e.modelMatrix&&(t.modelMatrix=e.modelMatrix),void 0!==e.viewMatrix&&(t.viewMatrix=e.viewMatrix),void 0!==e.projectionMatrix&&(t.projectionMatrix=e.projectionMatrix),void 0!==e.cameraPositionWorld&&(t.cameraPositionWorld=e.cameraPositionWorld),void 0===e.projectionMatrix&&void 0===e.viewMatrix||(t.viewProjectionMatrix=new Ji.Matrix4(e.projectionMatrix).multiplyRight(e.viewMatrix)),t},vs:"".concat(iu,"\n\n// Unprefixed uniforms\nuniform mat4 modelMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewProjectionMatrix;\nuniform vec3 cameraPositionWorld;\n\nstruct World {\n vec3 position;\n vec3 normal;\n};\n\nWorld world;\n\nvoid project_setPosition(vec4 position) {\n project_vPositionWorld = position;\n}\n\nvoid project_setNormal(vec3 normal) {\n project_vNormalWorld = normal;\n}\n\nvoid project_setPositionAndNormal_World(vec3 position, vec3 normal) {\n world.position = position;\n world.normal = normal;\n}\n\nvoid project_setPositionAndNormal_Model(vec3 position, vec3 normal) {\n world.position = (modelMatrix * vec4(position, 1.)).xyz;\n world.normal = mat3(modelMatrix) * normal;\n}\n\nvec4 project_model_to_clipspace(vec4 position) {\n return viewProjectionMatrix * modelMatrix * position;\n}\n\nvec4 project_model_to_clipspace(vec3 position) {\n return viewProjectionMatrix * modelMatrix * vec4(position, 1.);\n}\n\nvec4 project_world_to_clipspace(vec3 position) {\n return viewProjectionMatrix * vec4(position, 1.);\n}\n\nvec4 project_view_to_clipspace(vec3 position) {\n return projectionMatrix * vec4(position, 1.);\n}\n\nvec4 project_to_clipspace(vec3 position) {\n return viewProjectionMatrix * vec4(position, 1.);\n}\n"),fs:"\n".concat(iu)};var au={name:"lighting",vs:"".concat(" // empty\n","\n").concat("#define LIGHT_MAX 4\n\n/*\n// lighting configuration\nuniform bool enableLights;\nuniform vec3 ambientColor;\nuniform vec3 directionalColor;\nuniform vec3 lightingDirection;\n\n// point lights configuration\nuniform vec3 pointLocation[LIGHT_MAX];\nuniform vec3 pointColor[LIGHT_MAX];\nuniform int numberPoints;\n\n// reflection / refraction configuration\nuniform bool useReflection;\n*/\n\nuniform bool lighting_uEnableLights;\nuniform vec3 lighting_uAmbientColor;\nuniform vec3 lighting_uDirection;\nuniform vec3 lighting_uDirectionalColor;\n\n// point lights configuration\nuniform int lighting_uPointCount;\nuniform vec3 lighting_uPointLocation[LIGHT_MAX];\nuniform vec3 lighting_uPointColor[LIGHT_MAX];\n\n// reflection / refraction configuration\nuniform bool lighting_uEnableReflections;\n\n// varyings\nvarying vec4 lighting_vPosition;\nvarying vec4 lighting_vNormal;\nvarying vec3 lighting_vColor;\nvarying vec3 lighting_vLightWeighting;\nvarying vec3 lighting_vReflection;\n\nvoid lighting_setPositionAndNormal(vec3 position, vec3 normal) {\n lighting_vPosition = worldMatrix * vec4(position, 1.);\n lighting_vNormal = worldInverseTransposeMatrix * vec4(normal, 1.);;\n}\n\nvoid lighting__getLightWeigting() {\n float directionalLightWeighting = max(dot(lighting_vNormal.xyz, lighting_uDirection), 0.);\n vec3 pointWeight = vec3(0., 0., 0.);\n for (int i = 0; i < LIGHT_MAX; i++) {\n if (i < numberPoints) {\n vec4 mvLightPosition = viewMatrix * vec4(lighting_uPointLocation[i], 1.);\n vec3 pointLightDirection = normalize(mvLightPosition.xyz - lighting_vPosition.xyz);\n pointWeight += max(dot(lighting_vNormal.xyz, pointLightDirection), 0.) * pointColor[i];\n } else {\n break;\n }\n }\n return ambientColor + (directionalColor * directionalLightWeighting) + pointWeight;\n}\n\nvoid lighting_apply(vec3 position, vec3 normal) {\n lighting_setPositionAndNormal(position, normal);\n\n // lighting code\n if(!lighting_uEnableLights) {\n lighting_vLightWeighting = vec3(1., 1., 1.);\n } else {\n lighting_vLightWeighting = lighting__getLightWeighting();\n }\n}\n\nvoid lighting_set_reflection(vec3 position) {\n // refraction / reflection code\n if (lighting_uEnableReflections) {\n lighting_vReflection = (viewInverseMatrix[3] - (worldMatrix * vec4(position, 1.))).xyz;\n } else {\n lighting_vReflection = vec3(1., 1., 1.);\n }\n}\n","\n"),fs:"".concat(" // empty\n","\n").concat("#ifdef GL_ES\nprecision highp float;\n#endif\n\n#define LIGHT_MAX 4\n\nvarying vec3 lighting_vLightWeighting;\n\nvec4 lighting_apply(vec4 color) {\n // set color from texture\n return vec4(color.rgb * lighting_vLightWeighting, color.a);\n}\n\n// spec-map.fs\n\nuniform mat4 viewMatrix;\n\n\nvarying vec4 lighting_vColor;\nvarying vec4 lighting_vTransformedNormal;\nvarying vec4 lighting_vPosition;\n\nuniform float shininess;\nuniform bool enableSpecularMap;\nuniform bool enableLights;\n\nuniform vec3 ambientColor;\nuniform vec3 directionalColor;\nuniform vec3 lightingDirection;\n\nuniform vec3 lighting_uPointLocation[LIGHT_MAX];\nuniform vec3 lighting_uPointColor[LIGHT_MAX];\nuniform float lighting_uPointSpecularEnable[LIGHT_MAX];\nuniform vec3 lighting_uPointSpecularColor[LIGHT_MAX];\nuniform int numberPoints;\n\n\nvec3 lighting__calculate_light_weighting() {\n\treturn lighting__calculate_light_weighting(shininess);\n}\n\nvec3 lighting__calculate_light_weighting(shininess) {\n vec3 normal = vTransformedNormal.xyz;\n vec3 eyeDirection = normalize(-vPosition.xyz);\n\n vec3 specularLight = vec3(0., 0., 0.);\n vec3 diffuseLight = vec3(0., 0., 0.);\n\n for (int i = 0; i < LIGHT_MAX; i++) {\n if (i < numberPoints) {\n vec3 transformedPointLocation = (viewMatrix * vec4(lighting_uPointLocation[i], 1.0)).xyz;\n vec3 lightDirection = normalize(transformedPointLocation - vPosition.xyz);\n\n if (lighting_uPointSpecularEnable > 0.) {\n vec3 reflectionDirection = reflect(-lightDirection, normal);\n float specularLightWeighting =\n pow(max(dot(reflectionDirection, eyeDirection), 0.0), shininessVal);\n specularLight += specularLightWeighting * lighting_uPointSpecularColor[i];\n }\n\n float diffuseLightWeighting = max(dot(normal, lightDirection), 0.0);\n diffuseLight += diffuseLightWeighting * lighting_uPointColor[i];\n } else {\n break;\n }\n }\n\n return ambientColor + diffuseLight + specularLight;\n}\n\nvoid lighting_filterColor(fragmentColor) {\n if (!lighting_enable) {\n \treturn fragmentColor;\n } else {\n \tvec3 lightWeighting = lighting__calculate_light_weighting();\n \treturn vec4(fragmentColor.rgb * lightWeighting, fragmentColor.a);\n }\n}\n\n// render-tex.fs\n\nuniform vec3 material_uAmbientColor;\nuniform vec3 material_uDiffuseColor;\nuniform vec3 material_uSpecularColor;\nuniform vec3 material_uEmissiveColor;\n\nuniform bool hasTexture1;\nuniform sampler2D sampler1;\n\nuniform mat4 viewMatrix;\n\nvoid apply_lighting(color) {\n vec3 ambientLightWeighting = ambientColor;\n\n vec3 normal = vTransformedNormal.xyz;\n vec3 eyeDirection = normalize(-vPosition.xyz);\n\n vec3 specularLight = vec3(0.0, 0.0, 0.0);\n vec3 diffuseLight = vec3(0.0, 0.0, 0.0);\n\n for (int i = 0; i < LIGHT_MAX; i++) {\n if (i < numberPoints) {\n vec3 transformedPointLocation = (viewMatrix * vec4(pointLocation[i], 1.0)).xyz;\n vec3 lightDirection = normalize(transformedPointLocation - vPosition.xyz);\n\n if (enableSpecularHighlights) {\n vec3 reflectionDirection = reflect(-lightDirection, normal);\n float specularLightWeighting =\n pow(max(dot(reflectionDirection, eyeDirection), 0.0), shininess);\n specularLight += specularLightWeighting * pointSpecularColor[i];\n }\n\n float diffuseLightWeighting = max(dot(normal, lightDirection), 0.0);\n diffuseLight += diffuseLightWeighting * pointColor[i];\n } else {\n break;\n }\n }\n\n vec3 matAmbientColor = material_uAmbientColor * color.rgb;\n vec3 matDiffuseColor = material_uDiffuseColor * color.rgb;\n vec3 matSpecularColor = material_uSpecularColor * color.rgb;\n vec3 matEmissiveColor = material_uEmissiveColor * color.rgb;\n gl_FragColor = vec4(\n matAmbientColor * ambientLightWeighting\n + matDiffuseColor * diffuseLightWeighting\n + matSpecularColor * specularLightWeighting\n + matEmissiveColor,\n color.a\n );\n}\n\n/// frag-lighting\n\n vec3 lightWeighting;\n if (!enableLights) {\n lightWeighting = vec3(1.0, 1.0, 1.0);\n } else {\n vec3 lightDirection;\n float specularLightWeighting = 0.0;\n float diffuseLightWeighting = 0.0;\n vec3 specularLight = vec3(0.0, 0.0, 0.0);\n vec3 diffuseLight = vec3(0.0, 0.0, 0.0);\n\n vec3 transformedPointLocation;\n vec3 normal = vTransformedNormal.xyz;\n\n vec3 eyeDirection = normalize(-vPosition.xyz);\n vec3 reflectionDirection;\n\n vec3 pointWeight = vec3(0.0, 0.0, 0.0);\n\n for (int i = 0; i < LIGHT_MAX; i++) {\n if (i < numberPoints) {\n transformedPointLocation = (viewMatrix * vec4(pointLocation[i], 1.0)).xyz;\n lightDirection = normalize(transformedPointLocation - vPosition.xyz);\n\n if (enableSpecular[i] > 0.0) {\n reflectionDirection = reflect(-lightDirection, normal);\n specularLightWeighting = pow(max(dot(reflectionDirection, eyeDirection), 0.0), shininess);\n specularLight += specularLightWeighting * pointSpecularColor[i];\n }\n\n diffuseLightWeighting = max(dot(normal, lightDirection), 0.0);\n diffuseLight += diffuseLightWeighting * pointColor[i];\n } else {\n break;\n }\n }\n\n lightWeighting = ambientColor + diffuseLight + specularLight;\n }\n\n// reflection / refraction configs\nuniform float reflection;\nuniform float refraction;\n\n///\n // has cube texture then apply reflection\n // if (hasTextureCube1) {\n // vec3 nReflection = normalize(vReflection);\n // vec3 reflectionValue;\n // if (refraction > 0.0) {\n // reflectionValue = refract(nReflection, vNormal.xyz, refraction);\n // } else {\n // reflectionValue = -reflect(nReflection, vNormal.xyz);\n // }\n\n // // TODO(nico): check whether this is right.\n // vec4 cubeColor = textureCube(samplerCube1,\n // vec3(-reflectionValue.x, -reflectionValue.y, reflectionValue.z));\n // gl_FragColor = vec4(mix(gl_FragColor.xyz, cubeColor.xyz, reflection), 1.0);\n // }\n","\n"),getUniforms:function(e){var t,n,r,i,o=e.lightingEnable,a=void 0!==o&&o,s=e.lightingAmbientColor,u=void 0===s?[.2,.2,.2]:s,l=e.lightingDirection,c=void 0===l?[1,1,1]:l,f=(e.lightingDirectionalColor,e.lightingPointLights),h=void 0===f?[]:f;return Object.assign({lightingEnable:a,lightingAmbientColor:u},(n=(t=c).color,r=t.direction,i=new Ji.Vector3(r.x,r.y,r.z).normalize().scale(-1,-1,-1),{directionalColor:[n.r,n.g,n.b],lightingDirection:[i.x,i.y,i.z]}),function(e){var t,n,r=(t=e,n=Array,e=(null!=n&&"undefined"!=typeof Symbol&&n[Symbol.hasInstance]?n[Symbol.hasInstance](t):t instanceof n)?e:[e]).length,i=[],o=[],a=[],s=[],u=!0,l=!1,c=void 0;try{for(var f,h=e[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var d=f.value,p=d.position,v=d.color,g=d.diffuse,y=d.specular,_=v||g;i.push(p.x,p.y,p.z),o.push(_.r,_.g,_.b),a.push(Number(Boolean(y))),y?s.push(y.r,y.g,y.b):s.push(0,0,0)}}catch(e){l=!0,c=e}finally{try{u||null==h.return||h.return()}finally{if(l)throw c}}return{numberPoints:r,pointLocation:i,pointColor:o,enableSpecular:a,pointSpecularColor:s}}(h))}},su={lightDirection:new Float32Array([1,1,2])};var uu={name:"dirlight",vs:null,fs:"uniform vec3 dirlight_uLightDirection;\n\n/*\n * Returns color attenuated by angle from light source\n */\nvec4 dirlight_filterColor(vec4 color) {\n vec3 normal = project_getNormal_World();\n float d = abs(dot(normalize(normal), normalize(dirlight_uLightDirection)));\n return vec4(color.rgb * d, color.a);\n}\n",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:su,t={};return e.lightDirection&&(t.dirlight_uLightDirection=e.lightDirection),t},dependencies:[ou]},lu={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingThreshold:1,pickingActive:!1};var cu={name:"picking",vs:"uniform vec3 picking_uSelectedColor;\nuniform float picking_uThreshold;\nuniform bool picking_uSelectedColorValid;\n\nvarying vec4 picking_vRGBcolor_Aselected;\n\nconst float COLOR_SCALE = 1. / 255.;\n\nbool isVertexPicked(vec3 vertexColor) {\n return\n picking_uSelectedColorValid &&\n abs(vertexColor.r - picking_uSelectedColor.r) < picking_uThreshold &&\n abs(vertexColor.g - picking_uSelectedColor.g) < picking_uThreshold &&\n abs(vertexColor.b - picking_uSelectedColor.b) < picking_uThreshold;\n}\n\nvoid picking_setPickingColor(vec3 pickingColor) {\n // Do the comparison with selected item color in vertex shader as it should mean fewer compares\n picking_vRGBcolor_Aselected.a =\n float(isVertexPicked(pickingColor));\n\n // Stores the picking color so that the fragment shader can render it during picking\n picking_vRGBcolor_Aselected.rgb = pickingColor * COLOR_SCALE;\n}\n",fs:"uniform bool picking_uActive; // true during rendering to offscreen picking buffer\nuniform vec3 picking_uSelectedColor;\nuniform vec4 picking_uHighlightColor;\n\nvarying vec4 picking_vRGBcolor_Aselected;\n\nconst float COLOR_SCALE = 1. / 255.;\n\n/*\n * Returns highlight color if this item is selected.\n */\nvec4 picking_filterHighlightColor(vec4 color) {\n bool selected = bool(picking_vRGBcolor_Aselected.a);\n return selected ? (picking_uHighlightColor * COLOR_SCALE) : color;\n}\n\n/*\n * Returns picking color if picking enabled else unmodified argument.\n */\nvec4 picking_filterPickingColor(vec4 color) {\n vec3 pickingColor = picking_vRGBcolor_Aselected.rgb;\n if (picking_uActive && length(pickingColor) < 0.001) {\n discard;\n }\n return picking_uActive ? vec4(pickingColor, 1.0) : color;\n}\n\n/*\n * Returns picking color if picking is enabled if not\n * highlight color if this item is selected, otherwise unmodified argument.\n */\nvec4 picking_filterColor(vec4 color) {\n vec4 highightColor = picking_filterHighlightColor(color);\n return picking_filterPickingColor(highightColor);\n}\n\n",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:lu,t={};if(void 0!==e.pickingSelectedColor)if(null===e.pickingSelectedColor)t.picking_uSelectedColorValid=0;else{var n=[e.pickingSelectedColor[0],e.pickingSelectedColor[1],e.pickingSelectedColor[2]];t.picking_uSelectedColorValid=1,t.picking_uSelectedColor=n}return void 0!==e.pickingHighlightColor&&(t.picking_uHighlightColor=e.pickingHighlightColor),void 0!==e.pickingThreshold&&(t.picking_uThreshold=e.pickingThreshold),void 0!==e.pickingActive&&(t.picking_uActive=e.pickingActive?1:0),t}},fu={diffuseTexture:null,diffuseColor:[.5,.5,.5,1]};var hu={name:"diffuse",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:fu,t={};return void 0!==e.diffuseTexture&&(t.diffuse_uHasTexture=Boolean(e.diffuseTexture),t.diffuse_uTexture=e.diffuseTexture),void 0!==e.diffuseColor&&(t.diffuse_uColor=e.diffuseColor),t},vs:"varying vec2 diffuse_vTexCoord;\n\n/* Set the UV coordinate from attributes */\nvoid diffuse_setTextureCoordinate(vec2 uv) {\n diffuse_vTexCoord = uv;\n}\n",fs:"uniform vec4 diffuse_uColor;\nuniform bool diffuse_uHasTexture;\nuniform sampler2D diffuse_uTexture;\n\nvarying vec2 diffuse_vTexCoord;\n\n// Gets diffuse color of material from uniform\n// If we have a standard (diffuse) texture, set color to texture\n// return (vec4) - rgba\n//\nvec4 diffuse_getColor() {\n vec2 texCoord = diffuse_vTexCoord;\n return diffuse_uHasTexture ?\n texture2D(diffuse_uTexture, vec2(texCoord.s, texCoord.t)) :\n diffuse_uColor;\n}\n\nvec4 diffuse_filterColor(vec4 color) {\n return diffuse_getColor();\n}\n"};function du(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?t[Symbol.hasInstance](e):e instanceof t}function pu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function vu(e,t,n){return t&&pu(e.prototype,t),n&&pu(e,n),e}var gu=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!du(e,t))throw new TypeError("Cannot call a class as a function")}(this,e),B(t),this.gl=t,this.model=null,this._buffersSwapable=!1,this.currentIndex=0,this.sourceBuffers=new Array(2),this.destinationBuffers=new Array(2),this.transformFeedbacks=new Array(2),this._buffersToDelete=[],this.initialize(n),Object.seal(this)}return vu(e,null,[{key:"isSupported",value:function(e){return j(e)}}]),vu(e,[{key:"delete",value:function(){var e=!0,t=!1,n=void 0;try{for(var r,i=this._buffersToDelete[Symbol.iterator]();!(e=(r=i.next()).done);e=!0){r.value.delete()}}catch(e){t=!0,n=e}finally{try{e||null==i.return||i.return()}finally{if(t)throw n}}this.model.delete()}},{key:"initialize",value:function(e){var t=e.sourceBuffers,n=void 0===t?null:t,r=e.destinationBuffers,i=void 0===r?null:r,o=e.vs,a=void 0===o?null:o,s=e.sourceDestinationMap,u=void 0===s?null:s,l=e.varyings,c=void 0===l?null:l,f=e.drawMode,h=void 0===f?C.a.POINTS:f,d=e.elementCount,p=void 0===d?null:d;A(n&&a&&c&&p),A(i||u),u&&(this.sourceDestinationMap=u,this._buffersSwapable=!0);var v=0;this.varyings=[],this.varyingMap={};var g=!0,y=!1,_=void 0;try{for(var m,b=c[Symbol.iterator]();!(g=(m=b.next()).done);g=!0){var E=m.value;this.varyings[v]=E,this.varyingMap[E]=v,v++}}catch(e){y=!0,_=e}finally{try{g||null==b.return||b.return()}finally{if(y)throw _}}this._bindBuffers({sourceBuffers:n,destinationBuffers:i}),this._buildModel({vs:a,drawMode:h,elementCount:p})}},{key:"update",value:function(e){var t=e.sourceBuffers,n=void 0===t?null:t,r=e.destinationBuffers,i=void 0===r?null:r,o=e.elementCount,a=void 0===o?this.elementCount:o;if(!n&&!i)return Y.a.warn("Transform : no buffers updated")(),this;this.model.setVertexCount(a);var s=this.currentIndex,u=this.varyingMap,l=this._buffersSwapable,c=this.transformFeedbacks;for(var f in i)A(du(i[f],zt));if(Object.assign(this.sourceBuffers[s],n),Object.assign(this.destinationBuffers[s],i),c[s].bindBuffers(this.destinationBuffers[s],{varyingMap:u}),l){var h=(s+1)%2;for(var d in this.sourceDestinationMap){var p=this.sourceDestinationMap[d];this.sourceBuffers[h][d]=this.destinationBuffers[s][p],this.destinationBuffers[h][p]=this.sourceBuffers[s][d],A(du(this.destinationBuffers[h][p],zt))}c[h].bindBuffers(this.destinationBuffers[h],{varyingMap:u})}return this}},{key:"run",value:function(){var e,t,n,r=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).uniforms,i=void 0===r?{}:r,o=this.model,a=this.transformFeedbacks,s=this.sourceBuffers,u=this.currentIndex;o.setAttributes(s[u]),o.draw({transformFeedback:a[u],uniforms:i,parameters:(e={},t=C.a.RASTERIZER_DISCARD,n=!0,t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e)})}},{key:"swapBuffers",value:function(){A(this._buffersSwapable),this.currentIndex=(this.currentIndex+1)%2}},{key:"getBuffer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=this.destinationBuffers,n=this.currentIndex;return A(e&&t[n][e]),t[n][e]}},{key:"_bindBuffers",value:function(e){var t=e.sourceBuffers,n=void 0===t?null:t,r=e.destinationBuffers,i=void 0===r?null:r,o=this._buffersSwapable;for(var a in i)A(du(i[a],zt));if(this.sourceBuffers[0]=Object.assign({},n),this.destinationBuffers[0]=Object.assign({},i),o)for(var s in this.sourceBuffers[1]={},this.destinationBuffers[1]={},this.sourceDestinationMap){var u=this.sourceDestinationMap[s];if(!this.destinationBuffers[0][u]){var l=this.sourceBuffers[0][s],c=l.bytes,f=l.type,h=l.usage,d=l.layout;this.destinationBuffers[0][u]=new zt(this.gl,{bytes:c,type:f,usage:h,layout:d}),this._buffersToDelete.push(this.destinationBuffers[0][u])}this.sourceBuffers[1][s]=this.destinationBuffers[0][u],this.destinationBuffers[1][u]=this.sourceBuffers[0][s],A(du(this.destinationBuffers[1][u],zt))}}},{key:"_buildModel",value:function(e){var t=e.vs,n=e.drawMode,r=e.elementCount,i=this.varyings,o=this.varyingMap,a=this._buffersSwapable,s="void main()\n{\n}\n",u=t.split("\n");0===u[0].indexOf("#version ")&&(s="".concat(u[0],"\n").concat("void main()\n{\n}\n","\n")),this.model=new Bo(this.gl,{vs:t,fs:s,varyings:i,drawMode:n,vertexCount:r}),this.transformFeedbacks[0]=new ji(this.gl,{buffers:this.destinationBuffers[0],varyingMap:o}),a&&(this.transformFeedbacks[1]=new ji(this.gl,{buffers:this.destinationBuffers[1],varyingMap:this.varyingMap}))}},{key:"elementCount",get:function(){return this.model.getVertexCount()}}]),e}();C.a;function yu(e){return x(C.a,e)}function _u(e){return O(C.a,e)}n.d(t,"experimental",function(){return mu}),n.d(t,"isWebGL",function(){return F}),n.d(t,"isWebGL2",function(){return j}),n.d(t,"getKeyValue",function(){return x}),n.d(t,"getKey",function(){return O}),n.d(t,"createGLContext",function(){return pt}),n.d(t,"destroyGLContext",function(){return vt}),n.d(t,"resizeGLContext",function(){return gt}),n.d(t,"pollGLContext",function(){return yt}),n.d(t,"setContextDefaults",function(){return dt}),n.d(t,"trackContextCreation",function(){return re}),n.d(t,"trackContextState",function(){return Ge}),n.d(t,"resetParameters",function(){return be}),n.d(t,"getParameter",function(){return _e}),n.d(t,"getParameters",function(){return me}),n.d(t,"setParameter",function(){return ge}),n.d(t,"setParameters",function(){return wt}),n.d(t,"withParameters",function(){return St}),n.d(t,"getModifiedParameters",function(){return Ee}),n.d(t,"getContextInfo",function(){return tt}),n.d(t,"getGLContextInfo",function(){return Je}),n.d(t,"getContextLimits",function(){return Qe}),n.d(t,"glGetDebugInfo",function(){return nt}),n.d(t,"FEATURES",function(){return Tt}),n.d(t,"hasFeature",function(){return Rt}),n.d(t,"hasFeatures",function(){return Ct}),n.d(t,"getFeatures",function(){return kt}),n.d(t,"canCompileGLGSExtension",function(){return xt}),n.d(t,"makeDebugContext",function(){return We}),n.d(t,"Buffer",function(){return zt}),n.d(t,"Shader",function(){return $t}),n.d(t,"VertexShader",function(){return en}),n.d(t,"FragmentShader",function(){return tn}),n.d(t,"Program",function(){return qr}),n.d(t,"Framebuffer",function(){return hr}),n.d(t,"Renderbuffer",function(){return Fn}),n.d(t,"Texture2D",function(){return xn}),n.d(t,"TextureCube",function(){return ni}),n.d(t,"draw",function(){return ri}),n.d(t,"clear",function(){return Hn}),n.d(t,"clearBuffer",function(){return Yn}),n.d(t,"FenceSync",function(){return hi}),n.d(t,"Query",function(){return mi}),n.d(t,"Sampler",function(){return mr}),n.d(t,"Texture3D",function(){return Ti}),n.d(t,"Texture2DArray",function(){return Ci}),n.d(t,"TransformFeedback",function(){return ji}),n.d(t,"VertexArray",function(){return fn}),n.d(t,"UniformBufferLayout",function(){return Hi}),n.d(t,"Model",function(){return Bo}),n.d(t,"AnimationLoop",function(){return Xo}),n.d(t,"AnimationLoopProxy",function(){return Ko}),n.d(t,"pickModels",function(){return ra}),n.d(t,"encodePickingColor",function(){return aa}),n.d(t,"decodePickingColor",function(){return sa}),n.d(t,"getNullPickingColor",function(){return ua}),n.d(t,"addEvents",function(){return _a}),n.d(t,"Geometry",function(){return Qi}),n.d(t,"ConeGeometry",function(){return xa}),n.d(t,"CubeGeometry",function(){return ka}),n.d(t,"CylinderGeometry",function(){return Ba}),n.d(t,"IcoSphereGeometry",function(){return Wa}),n.d(t,"PlaneGeometry",function(){return Za}),n.d(t,"SphereGeometry",function(){return $a}),n.d(t,"TruncatedConeGeometry",function(){return Sa}),n.d(t,"Cone",function(){return rs}),n.d(t,"Cube",function(){return ss}),n.d(t,"Cylinder",function(){return fs}),n.d(t,"IcoSphere",function(){return vs}),n.d(t,"Plane",function(){return ms}),n.d(t,"Sphere",function(){return Ss}),n.d(t,"TruncatedCone",function(){return xs}),n.d(t,"ClipSpaceQuad",function(){return Is}),n.d(t,"setPathPrefix",function(){return Us}),n.d(t,"loadFile",function(){return Gs}),n.d(t,"loadImage",function(){return Vs}),n.d(t,"loadFiles",function(){return Ws}),n.d(t,"loadImages",function(){return Hs}),n.d(t,"loadTextures",function(){return Ys}),n.d(t,"loadProgram",function(){return Ks}),n.d(t,"loadModel",function(){return Zs}),n.d(t,"parseModel",function(){return qs}),n.d(t,"ShaderCache",function(){return xo}),n.d(t,"assembleShaders",function(){return Po}),n.d(t,"registerShaderModules",function(){return ao}),n.d(t,"setDefaultShaderModules",function(){return so}),n.d(t,"fp32",function(){return Qs}),n.d(t,"fp64",function(){return tu}),n.d(t,"project",function(){return ou}),n.d(t,"lighting",function(){return au}),n.d(t,"dirlight",function(){return uu}),n.d(t,"picking",function(){return cu}),n.d(t,"diffuse",function(){return hu}),n.d(t,"GL",function(){return C.a}),n.d(t,"glGet",function(){return yu}),n.d(t,"glKey",function(){return _u}),n.d(t,"deleteGLContext",function(){return vt}),n.d(t,"pollContext",function(){return yt}),n.d(t,"radians",function(){return Ji.radians}),n.d(t,"degrees",function(){return Ji.degrees}),n.d(t,"Vector2",function(){return Ji.Vector2}),n.d(t,"Vector3",function(){return Ji.Vector3}),n.d(t,"Vector4",function(){return Ji.Vector4}),n.d(t,"Matrix4",function(){return Ji.Matrix4}),n.d(t,"Quaternion",function(){return Ji.Quaternion}),n.d(t,"readPixels",function(){return ii}),n.d(t,"FramebufferObject",function(){return hr}),n(36);var mu={clearBuffer:Yn,Transform:gu,Attribute:si}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(!e)throw new Error(t||"deck.gl: assertion failed.")}},function(e,t,n){"use strict";(function(e){n.d(t,"b",function(){return i}),n.d(t,"a",function(){return o});var r={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==e&&e,document:"undefined"!=typeof document&&document},i=r.window||r.self||r.global,o=r.global||r.self||r.window}).call(this,n(25))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(28);t.default=new r.Log({id:"deck"})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.experimental=t.OrthographicViewport=t.PerspectiveViewport=t.log=t.MapController=t.Controller=t.OrthographicView=t.PerspectiveView=t.OrbitView=t.ThirdPersonView=t.FirstPersonView=t.MapView=t.View=t.lighting=t.project64=t.project=t.WebMercatorViewport=t.Viewport=t.CompositeLayer=t.Layer=t.AttributeManager=t.LayerManager=t.Deck=t.COORDINATE_SYSTEM=void 0;var r=n(23);Object.defineProperty(t,"COORDINATE_SYSTEM",{enumerable:!0,get:function(){return r.COORDINATE_SYSTEM}});var i=n(206);Object.defineProperty(t,"Deck",{enumerable:!0,get:function(){return G(i).default}});var o=n(77);Object.defineProperty(t,"LayerManager",{enumerable:!0,get:function(){return G(o).default}});var a=n(76);Object.defineProperty(t,"AttributeManager",{enumerable:!0,get:function(){return G(a).default}});var s=n(45);Object.defineProperty(t,"Layer",{enumerable:!0,get:function(){return G(s).default}});var u=n(187);Object.defineProperty(t,"CompositeLayer",{enumerable:!0,get:function(){return G(u).default}});var l=n(7);Object.defineProperty(t,"Viewport",{enumerable:!0,get:function(){return G(l).default}});var c=n(41);Object.defineProperty(t,"WebMercatorViewport",{enumerable:!0,get:function(){return G(c).default}});var f=n(20);Object.defineProperty(t,"project",{enumerable:!0,get:function(){return G(f).default}});var h=n(60);Object.defineProperty(t,"project64",{enumerable:!0,get:function(){return G(h).default}});var d=n(59);Object.defineProperty(t,"lighting",{enumerable:!0,get:function(){return G(d).default}});var p=n(12);Object.defineProperty(t,"View",{enumerable:!0,get:function(){return G(p).default}});var v=n(66);Object.defineProperty(t,"MapView",{enumerable:!0,get:function(){return G(v).default}});var g=n(179);Object.defineProperty(t,"FirstPersonView",{enumerable:!0,get:function(){return G(g).default}});var y=n(178);Object.defineProperty(t,"ThirdPersonView",{enumerable:!0,get:function(){return G(y).default}});var _=n(177);Object.defineProperty(t,"OrbitView",{enumerable:!0,get:function(){return G(_).default}});var m=n(176);Object.defineProperty(t,"PerspectiveView",{enumerable:!0,get:function(){return G(m).default}});var b=n(175);Object.defineProperty(t,"OrthographicView",{enumerable:!0,get:function(){return G(b).default}});var E=n(30);Object.defineProperty(t,"Controller",{enumerable:!0,get:function(){return G(E).default}});var w=n(64);Object.defineProperty(t,"MapController",{enumerable:!0,get:function(){return G(w).default}});var S=n(5);Object.defineProperty(t,"log",{enumerable:!0,get:function(){return G(S).default}});var P=n(174);Object.defineProperty(t,"PerspectiveViewport",{enumerable:!0,get:function(){return G(P).default}});var T=n(173);Object.defineProperty(t,"OrthographicViewport",{enumerable:!0,get:function(){return G(T).default}}),n(172),n(58);var A=G(n(169)),x=G(n(168)),O=G(n(65)),R=G(n(40)),C=n(62),k=G(n(39)),M=G(n(167)),I=G(n(166)),L=G(n(163)),N=n(162),F=n(161),j=n(22),D=G(n(160)),B=G(n(159)),U=G(n(57));function G(e){return e&&e.__esModule?e:{default:e}}t.experimental={FirstPersonController:A.default,OrbitController:x.default,FirstPersonViewport:D.default,ThirdPersonViewport:B.default,OrbitViewport:U.default,EffectManager:O.default,Effect:R.default,TRANSITION_EVENTS:C.TRANSITION_EVENTS,LinearInterpolator:k.default,ViewportFlyToInterpolator:M.default,BinSorter:L.default,linearScale:F.linearScale,getLinearScale:F.getLinearScale,quantizeScale:F.quantizeScale,getQuantizeScale:F.getQuantizeScale,defaultColorRange:N.defaultColorRange,flattenVertices:j.flattenVertices,fillArray:j.fillArray,ReflectionEffect:I.default}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=p(n(5)),a=n(43),s=n(1),u=p(n(16)),l=p(n(15)),c=p(n(13)),f=p(n(34)),h=n(21),d=p(n(3));function p(e){return e&&e.__esModule?e:{default:e}}var v=Math.PI/180,g=(0,a.createMat4)(),y=[0,0,0],_={pixelsPerMeter:[1,1,1],metersPerPixel:[1,1,1],pixelsPerDegree:[1,1,1],degreesPerPixel:[1,1,1]},m=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var n=t.id,r=void 0===n?null:n,i=t.x,o=void 0===i?0:i,a=t.y,s=void 0===a?0:a,u=t.width,l=void 0===u?1:u,c=t.height,f=void 0===c?1:c;this.id=r||this.constructor.displayName||"viewport",this.x=o,this.y=s,this.width=l||1,this.height=f||1,this.option=t.viewState.option,this._initViewMatrix(t),this._initProjectionMatrix(t),this._initPixelMatrices(),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this),this.getMatrices=this.getMatrices.bind(this)}return i(e,[{key:"equals",value:function(t){return t instanceof e&&(t.width===this.width&&t.height===this.height&&(0,s.equals)(t.projectionMatrix,this.projectionMatrix)&&(0,s.equals)(t.viewMatrix,this.viewMatrix))}},{key:"project",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).topLeft,n=void 0===t||t,i=r(e,3),o=i[0],a=i[1],s=i[2],u=void 0===s?0:s,l=this.projectFlat([o,a]),c=r(l,2),f=c[0],d=c[1],p=(0,h.worldToPixels)([f,d,u],this.pixelProjectionMatrix),v=r(p,2),g=v[0],y=v[1],_=n?y:this.height-y;return 2===e.length?[g,_]:[g,_,p[2]]}},{key:"unproject",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.topLeft,i=void 0===n||n,o=t.targetZ,a=r(e,3),s=a[0],u=a[1],l=a[2],c=i?u:this.height-u,f=(0,h.pixelsToWorld)([s,c,l],this.pixelUnprojectionMatrix,o),d=this.unprojectFlat(f),p=r(d,2),v=p[0],g=p[1];return Number.isFinite(l)?[v,g,f[2]]:Number.isFinite(o)?[v,g,o]:[v,g]}},{key:"projectFlat",value:function(e){var t=r(e,2);t[0],t[1],arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return this._projectFlat.apply(this,arguments)}},{key:"unprojectFlat",value:function(e){arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return this._unprojectFlat.apply(this,arguments)}},{key:"_projectFlat",value:function(e){arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return e}},{key:"_unprojectFlat",value:function(e){arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return e}},{key:"getMercatorParams",value:function(){var e=this._addMetersToLngLat([this.longitude||0,this.latitude||0],this.meterOffset);return{longitude:e[0],latitude:e[1]}}},{key:"isMapSynched",value:function(){return!1}},{key:"getDistanceScales",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e?(0,h.getDistanceScales)({longitude:e[0],latitude:e[1],scale:this.scale,highPrecision:!0},this.option):this.distanceScales}},{key:"getMatrices",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).modelMatrix,t=void 0===e?null:e,n=this.viewProjectionMatrix,r=this.pixelProjectionMatrix,i=this.pixelUnprojectionMatrix;return t&&(n=(0,c.default)([],this.viewProjectionMatrix,t),r=(0,c.default)([],this.pixelProjectionMatrix,t),i=(0,f.default)([],r)),Object.assign({modelViewProjectionMatrix:n,viewProjectionMatrix:this.viewProjectionMatrix,viewMatrix:this.viewMatrix,projectionMatrix:this.projectionMatrix,pixelProjectionMatrix:r,pixelUnprojectionMatrix:i,width:this.width,height:this.height,scale:this.scale})}},{key:"getCameraPosition",value:function(){return this.cameraPosition}},{key:"getCameraDirection",value:function(){return this.cameraDirection}},{key:"getCameraUp",value:function(){return this.cameraUp}},{key:"_addMetersToLngLat",value:function(e,t){var n=r(e,3),i=n[0],o=n[1],a=n[2],s=void 0===a?0:a,u=this._metersToLngLatDelta(t),l=r(u,3),c=l[0],f=l[1],h=l[2],d=void 0===h?0:h;return 2===e.length?[i+c,o+f]:[i+c,o+f,s+d]}},{key:"_metersToLngLatDelta",value:function(e){var t=r(e,3),n=t[0],i=t[1],o=t[2],a=void 0===o?0:o;(0,d.default)(Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(a),"Illegal argument to Viewport");var s=this.distanceScales,u=s.pixelsPerMeter,l=s.degreesPerPixel,c=n*u[0]*l[0],f=i*u[1]*l[1];return 2===e.length?[c,f]:[c,f,a]}},{key:"_createProjectionMatrix",value:function(e){var t=e.orthographic,n=e.fovyRadians,r=e.aspect,i=e.focalDistance,o=e.near,a=e.far;return(0,d.default)(Number.isFinite(n)),t?(new s.Matrix4).orthographic({fovy:n,aspect:r,focalDistance:i,near:o,far:a}):(new s.Matrix4).perspective({fovy:n,aspect:r,near:o,far:a})}},{key:"_initViewMatrix",value:function(e){var t=e.viewMatrix,n=void 0===t?g:t,r=e.longitude,i=void 0===r?null:r,o=e.latitude,a=void 0===o?null:o,u=e.zoom,l=void 0===u?null:u,c=e.position,f=void 0===c?null:c,d=e.modelMatrix,p=void 0===d?null:d,v=e.focalDistance,m=void 0===v?1:v,b=e.distanceScales,E=void 0===b?null:b;this.isGeospatial=Number.isFinite(a)&&Number.isFinite(i),this.zoom=l,Number.isFinite(this.zoom)||(this.zoom=this.isGeospatial?(0,h.getMeterZoom)({latitude:a})+Math.log2(m):0),this.scale=Math.pow(2,this.zoom),this.distanceScales=this.isGeospatial?(0,h.getDistanceScales)({latitude:a,longitude:i,scale:this.scale},this.option):E||_,this.focalDistance=m,this.distanceScales.metersPerPixel=new s.Vector3(this.distanceScales.metersPerPixel),this.distanceScales.pixelsPerMeter=new s.Vector3(this.distanceScales.pixelsPerMeter),this.position=y,this.meterOffset=y,f&&(this.position=f,this.modelMatrix=p,this.meterOffset=p?p.transformVector(f):f),this.viewMatrixUncentered=n,this.isGeospatial?(this.center=(0,h.getWorldPosition)({longitude:i,latitude:a,scale:this.scale,distanceScales:this.distanceScales,meterOffset:this.meterOffset},this.option),this.viewMatrix=(new s.Matrix4).multiplyRight(this.viewMatrixUncentered).scale([1,-1,1]).translate(new s.Vector3(this.center||y).negate())):(this.center=f,this.viewMatrix=n)}},{key:"_initProjectionMatrix",value:function(e){var t=e.projectionMatrix,n=void 0===t?null:t,r=e.orthographic,i=void 0!==r&&r,o=e.fovyRadians,a=e.fovyDegrees,s=e.fovy,u=e.near,l=void 0===u?.1:u,c=e.far,f=void 0===c?1e3:c,h=e.focalDistance,d=void 0===h?1:h,p=e.orthographicFocalDistance,g=o||(a||s||75)*v;this.projectionMatrix=n||this._createProjectionMatrix({orthographic:i,fovyRadians:g,aspect:this.width/this.height,focalDistance:p||d,near:l,far:f})}},{key:"_initPixelMatrices",value:function(){var e=(0,a.createMat4)();(0,c.default)(e,e,this.projectionMatrix),(0,c.default)(e,e,this.viewMatrix),this.viewProjectionMatrix=e,this.viewMatrixInverse=(0,f.default)([],this.viewMatrix)||this.viewMatrix;var t=(0,a.extractCameraVectors)({viewMatrix:this.viewMatrix,viewMatrixInverse:this.viewMatrixInverse}),n=t.eye,r=t.direction,i=t.up;this.cameraPosition=n,this.cameraDirection=r,this.cameraUp=i;var s=(0,a.createMat4)();(0,u.default)(s,s,[this.width/2,-this.height/2,1]),(0,l.default)(s,s,[1,-1,0]),(0,c.default)(s,s,this.viewProjectionMatrix),this.pixelProjectionMatrix=s,this.pixelUnprojectionMatrix=(0,f.default)((0,a.createMat4)(),this.pixelProjectionMatrix),this.pixelUnprojectionMatrix||o.default.warn("Pixel project matrix not invertible")()}}]),e}();t.default=m,m.displayName="Viewport"},function(e,t,n){"use strict";(function(e){n.d(t,"c",function(){return l}),n.d(t,"b",function(){return f}),n.d(t,"a",function(){return h});var r=n(4);function i(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r))throw new TypeError("Cannot call a class as a function");var n,r}var o=null;if(!n(10).a){try{o=e.require("gl/wrap")}catch(e){console.error("".concat(e.message))}console.warn(o&&o.WebGLRenderingContext)}var a=function e(){i(this,e)},s=o||r.a,u=s.WebGLRenderingContext,l=void 0===u?a:u,c=(s.WebGLProgram,s.WebGLShader,s.WebGLBuffer),f=void 0===c?a:c;s.WebGLFramebuffer,s.WebGLRenderbuffer,s.WebGLTexture,s.WebGLUniformLocation,s.WebGLActiveInfo,s.WebGLShaderPrecisionFormat;var h=r.a.WebGL2RenderingContext||function e(){i(this,e)};r.a.Image}).call(this,n(81)(e))},function(e,t){e.exports=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3];return e[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,e[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,e[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,e[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,e}},function(e,t,n){"use strict";(function(e){var r=n(115);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o=!("object"===(void 0===e?"undefined":i(e))&&"[object process]"===String(e)&&!e.browser)||r.a;t.a=o}).call(this,n(24))},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},i="undefined"!=typeof window&&window.addEventListener,o=new Map,a=function(){return i&&window.__SEER_INITIALIZED__},s=function(e,t){var n=o.get(e),r=Date.now();return!!(n&&r-n<t)||(o.set(e,r),!1)},u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(i&&a()){var n=new Set,o=JSON.stringify(t,function(e){return function(t,n){if(!n||"object"!==(void 0===n?"undefined":r(n))||!e.has(n))return e.add(n),Object.prototype.toString.call(n).slice(8,-1).includes("Array")?Array.prototype.slice.call(n,0,20):n}}(n));try{window.postMessage({type:e,payload:o,source:"seer-agent"},"*")}catch(e){if(s("seer-log",2e3))return;console.log(e)}}},l=new Map,c=function(e){if(e&&e.data&&"seer-core"===e.data.source){var t=e.data,n=t.type,r=t.payload,i=l.get(n);i&&i.forEach(function(e){return e(r)})}},f=function(){i&&!window.__SEER_LISTENER__&&(window.addEventListener("message",c),window.__SEER_LISTENER__=!0)};t.default={send:u,throttle:s,isReady:a,list:function(e,t){return u("LIST",{key:e,data:t})},listItem:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u("LIST_ITEM",{key:e,itemKey:t,data:n})},updateItem:function(e,t,n,r){return u("UPDATE_ITEM",{key:e,itemKey:t,path:n,data:r})},multiUpdate:function(e,t,n){return u("MULTI_UPDATE_ITEM",{key:e,itemKey:t,array:n})},deleteItem:function(e,t){return u("DELETE_ITEM",{key:e,itemKey:t})},addLog:function(e,t,n){return u("ADD_LOG",{key:e,itemKey:t,msg:n})},listeners:l,listenFor:function(e,t){if(i){if(!e||!t)throw new Error("Please provide a type and callback");l.has(e)||l.set(e,[]),window.__SEER_LISTENER__||f(),l.get(e).push(t)}},removeListener:function(e){l.forEach(function(t,n){l.set(n,t.filter(function(t){return t!==e}))})},init:f,clean:function(){i&&window.__SEER_LISTENER__&&(window.removeEventListener("message",c),delete window.__SEER_LISTENER__)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=u(n(7)),o=n(189),a=n(71),s=u(n(3));function u(e){return e&&e.__esModule?e:{default:e}}var l=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var n=t.id,r=void 0===n?null:n,o=t.x,a=void 0===o?0:o,u=t.y,l=void 0===u?0:u,c=t.width,f=void 0===c?"100%":c,h=t.height,d=void 0===h?"100%":h,p=t.projectionMatrix,v=void 0===p?null:p,g=t.fovy,y=void 0===g?75:g,_=t.near,m=void 0===_?.1:_,b=t.far,E=void 0===b?1e3:b,w=t.modelMatrix,S=void 0===w?null:w,P=t.viewportInstance,T=void 0===P?null:P,A=t.type,x=void 0===A?i.default:A;(0,s.default)(!T||T instanceof i.default),this.viewportInstance=T,this.id=r||this.constructor.displayName||"view",this.type=x,this.props=Object.assign({},t,{projectionMatrix:v,fovy:y,near:m,far:E,modelMatrix:S}),this._parseDimensions({x:a,y:l,width:f,height:d}),this.equals=this.equals.bind(this),Object.seal(this)}return r(e,[{key:"equals",value:function(e){return this===e||(this.viewportInstance?e.viewportInstance&&this.viewportInstance.equals(e.viewportInstance):(0,a.deepEqual)(this,e))}},{key:"makeViewport",value:function(e){var t=e.width,n=e.height,r=e.viewState;if(this.viewportInstance)return this.viewportInstance;var i=this.getDimensions({width:t,height:n}),o=Object.assign({viewState:r},r,this.props,i);return this._getViewport(o)}},{key:"getDimensions",value:function(e){var t=e.width,n=e.height;return{x:(0,o.getPosition)(this._x,t),y:(0,o.getPosition)(this._y,n),width:(0,o.getPosition)(this._width,t),height:(0,o.getPosition)(this._height,n)}}},{key:"_getViewport",value:function(e){return new(0,this.type)(e)}},{key:"_parseDimensions",value:function(e){var t=e.x,n=e.y,r=e.width,i=e.height;this._x=(0,o.parsePosition)(t),this._y=(0,o.parsePosition)(n),this._width=(0,o.parsePosition)(r),this._height=(0,o.parsePosition)(i)}}]),e}();t.default=l},function(e,t){e.exports=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],u=t[5],l=t[6],c=t[7],f=t[8],h=t[9],d=t[10],p=t[11],v=t[12],g=t[13],y=t[14],_=t[15],m=n[0],b=n[1],E=n[2],w=n[3];return e[0]=m*r+b*s+E*f+w*v,e[1]=m*i+b*u+E*h+w*g,e[2]=m*o+b*l+E*d+w*y,e[3]=m*a+b*c+E*p+w*_,m=n[4],b=n[5],E=n[6],w=n[7],e[4]=m*r+b*s+E*f+w*v,e[5]=m*i+b*u+E*h+w*g,e[6]=m*o+b*l+E*d+w*y,e[7]=m*a+b*c+E*p+w*_,m=n[8],b=n[9],E=n[10],w=n[11],e[8]=m*r+b*s+E*f+w*v,e[9]=m*i+b*u+E*h+w*g,e[10]=m*o+b*l+E*d+w*y,e[11]=m*a+b*c+E*p+w*_,m=n[12],b=n[13],E=n[14],w=n[15],e[12]=m*r+b*s+E*f+w*v,e[13]=m*i+b*u+E*h+w*g,e[14]=m*o+b*l+E*d+w*y,e[15]=m*a+b*c+E*p+w*_,e}},function(e,t,n){(function(t,n){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},i="object"!==(void 0===t?"undefined":r(t))||"[object process]"!==String(t)||t.browser,o="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"";e.exports={window:"undefined"!=typeof window?window:n,global:void 0!==n?n:window,document:"undefined"!=typeof document?document:{},isBrowser:i,userAgent:o}}).call(this,n(24),n(25))},function(e,t){e.exports=function(e,t,n){var r,i,o,a,s,u,l,c,f,h,d,p,v=n[0],g=n[1],y=n[2];t===e?(e[12]=t[0]*v+t[4]*g+t[8]*y+t[12],e[13]=t[1]*v+t[5]*g+t[9]*y+t[13],e[14]=t[2]*v+t[6]*g+t[10]*y+t[14],e[15]=t[3]*v+t[7]*g+t[11]*y+t[15]):(r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],u=t[5],l=t[6],c=t[7],f=t[8],h=t[9],d=t[10],p=t[11],e[0]=r,e[1]=i,e[2]=o,e[3]=a,e[4]=s,e[5]=u,e[6]=l,e[7]=c,e[8]=f,e[9]=h,e[10]=d,e[11]=p,e[12]=r*v+s*g+f*y+t[12],e[13]=i*v+u*g+h*y+t[13],e[14]=o*v+l*g+d*y+t[14],e[15]=a*v+c*g+p*y+t[15]);return e}},function(e,t){e.exports=function(e,t,n){var r=n[0],i=n[1],o=n[2];return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*o,e[9]=t[9]*o,e[10]=t[10]*o,e[11]=t[11]*o,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}},function(e,t){e.exports=function(e,t,n,r,i){var o=1/Math.tan(t/2),a=1/(r-i);return e[0]=o/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=(i+r)*a,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*i*r*a,e[15]=0,e}},function(e,t,n){var r=n(214);e.exports=function(e,t,n,i){var o,a,s,u,l,c,f,h,d,p,v=t[0],g=t[1],y=t[2],_=i[0],m=i[1],b=i[2],E=n[0],w=n[1],S=n[2];if(Math.abs(v-E)<1e-6&&Math.abs(g-w)<1e-6&&Math.abs(y-S)<1e-6)return r(e);f=v-E,h=g-w,d=y-S,p=1/Math.sqrt(f*f+h*h+d*d),o=m*(d*=p)-b*(h*=p),a=b*(f*=p)-_*d,s=_*h-m*f,(p=Math.sqrt(o*o+a*a+s*s))?(o*=p=1/p,a*=p,s*=p):(o=0,a=0,s=0);u=h*s-d*a,l=d*o-f*s,c=f*a-h*o,(p=Math.sqrt(u*u+l*l+c*c))?(u*=p=1/p,l*=p,c*=p):(u=0,l=0,c=0);return e[0]=o,e[1]=u,e[2]=f,e[3]=0,e[4]=a,e[5]=l,e[6]=h,e[7]=0,e[8]=s,e[9]=c,e[10]=d,e[11]=0,e[12]=-(o*v+a*g+s*y),e[13]=-(u*v+l*g+c*y),e[14]=-(f*v+h*g+d*y),e[15]=1,e}},function(e,t,n){"use strict";(function(e,n){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},i="object"!==(void 0===e?"undefined":r(e))||"[object process]"!=e+""||e.browser,o="undefined"==typeof window?n:window,a="undefined"==typeof document?{}:document,s=void 0===n?window:n,u="object"===(void 0===e?"undefined":r(e))?e:{};t.window=o,t.document=a,t.global=s,t.process=u,t.console=console,t.isBrowser=i,t.VERSION="1.0.1"}).call(this,n(24),n(25))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),i=s(n(186)),o=s(n(185)),a=n(184);function s(e){return e&&e.__esModule?e:{default:e}}var u={};t.default={name:"project",dependencies:[r.fp32],vs:""+i.default+o.default,getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u;return e.viewport?(0,a.getUniformsFromViewport)(e):{}},deprecations:[{type:"uniform vec3",old:"selectedPickingColor",new:"luma.gl's picking module"},{type:"uniform float",old:"renderPickingBuffer",new:"luma.gl's picking module"},{type:"uniform float",old:"pickingEnabled",new:"luma.gl's picking module"},{type:"uniform float",old:"projectionMode",new:"project_uCoordinateSystem"},{type:"uniform vec4",old:"projectionCenter",new:"project_uCenter"},{type:"uniform vec2",old:"projectionOrigin"},{type:"uniform mat4",old:"modelMatrix",new:"project_uModelMatrix"},{type:"uniform mat4",old:"viewMatrix"},{type:"uniform mat4",old:"projectionMatrix",new:"project_uViewProjectionMatrix"},{type:"uniform vec3",old:"projectionPixelsPerUnit",new:"project_uPixelsPerUnit"},{type:"uniform float",old:"projectionScale",new:"project_uScale"},{type:"uniform vec2",old:"viewportSize",new:"project_uViewportSize"},{type:"uniform float",old:"devicePixelRatio",new:"project_uDevicePixelRatio"},{type:"uniform vec3",old:"cameraPos",new:"project_uCameraPosition"},{type:"function",old:"scale",new:"project_scale",deprecated:1},{type:"function",old:"preproject",new:"project_position",deprecated:1},{type:"function",old:"project",new:"project_to_clipspace",deprecated:1}]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(42);Object.defineProperty(t,"default",{enumerable:!0,get:function(){return u(r).default}}),Object.defineProperty(t,"WebMercatorViewport",{enumerable:!0,get:function(){return u(r).default}});var i=n(69);Object.defineProperty(t,"fitBounds",{enumerable:!0,get:function(){return u(i).default}});var o=n(191);Object.defineProperty(t,"normalizeViewportProps",{enumerable:!0,get:function(){return u(o).default}});var a=n(190);Object.defineProperty(t,"flyToViewport",{enumerable:!0,get:function(){return u(a).default}});var s=n(31);function u(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"lngLatToWorld",{enumerable:!0,get:function(){return s.lngLatToWorld}}),Object.defineProperty(t,"worldToLngLat",{enumerable:!0,get:function(){return s.worldToLngLat}}),Object.defineProperty(t,"worldToPixels",{enumerable:!0,get:function(){return s.worldToPixels}}),Object.defineProperty(t,"pixelsToWorld",{enumerable:!0,get:function(){return s.pixelsToWorld}}),Object.defineProperty(t,"getMeterZoom",{enumerable:!0,get:function(){return s.getMeterZoom}}),Object.defineProperty(t,"getDistanceScales",{enumerable:!0,get:function(){return s.getDistanceScales}}),Object.defineProperty(t,"getWorldPosition",{enumerable:!0,get:function(){return s.getWorldPosition}}),Object.defineProperty(t,"getViewMatrix",{enumerable:!0,get:function(){return s.getViewMatrix}}),Object.defineProperty(t,"getProjectionMatrix",{enumerable:!0,get:function(){return s.getProjectionMatrix}}),Object.defineProperty(t,"getProjectionParameters",{enumerable:!0,get:function(){return s.getProjectionParameters}}),Object.defineProperty(t,"PerspectiveMercatorViewport",{enumerable:!0,get:function(){return u(r).default}}),Object.defineProperty(t,"getUncenteredViewMatrix",{enumerable:!0,get:function(){return s.getViewMatrix}}),Object.defineProperty(t,"projectFlat",{enumerable:!0,get:function(){return s.lngLatToWorld}}),Object.defineProperty(t,"unprojectFlat",{enumerable:!0,get:function(){return s.worldToLngLat}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flatten=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.filter,r=void 0===n?function(){return!0}:n,i=t.map,o=void 0===i?function(e){return e}:i,a=t.result,s=void 0===a?[]:a;if(!Array.isArray(e))return r(e)?[o(e)]:[];return function e(t,n,r,i){var o=-1;for(;++o<t.length;){var a=t[o];Array.isArray(a)?e(a,n,r,i):n(a)&&i.push(r(a))}return i}(e,r,o,s)},t.countVertices=function e(t){var n=0;var r=-1;for(;++r<t.length;){var i=t[r];Array.isArray(i)||ArrayBuffer.isView(i)?n+=e(i):n++}return n},t.flattenVertices=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.result,i=void 0===r?[]:r,o=n.dimensions,a=void 0===o?3:o;var s=-1;var u=0;for(;++s<t.length;){var l=t[s];Array.isArray(l)||ArrayBuffer.isView(l)?e(l,{result:i,dimensions:a}):u<a&&(i.push(l),u++)}u>0&&u<a&&i.push(0);return i},t.fillArray=function(e){for(var t=e.target,n=e.source,r=e.start,i=void 0===r?0:r,o=e.count,a=void 0===o?1:o,s=n.length,u=a*s,l=0,c=i;l<s;l++)t[c++]=n[l];for(;l<u;)l<u-l?(t.copyWithin(i+l,i,i+l),l*=2):(t.copyWithin(i+l,i,i+u-l),l=u);return t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.COORDINATE_SYSTEM={LNGLAT:1,METER_OFFSETS:2,METERS:2,LNGLAT_OFFSETS:3,IDENTITY:0}},function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var u,l=[],c=!1,f=-1;function h(){c&&u&&(c=!1,u.length?l=u.concat(l):f=-1,l.length&&d())}function d(){if(!c){var e=s(h);c=!0;for(var t=l.length;t;){for(u=l,l=[];++f<t;)u&&u[f].run();f=-1,t=l.length}u=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function v(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new p(e,t)),1!==l.length||c||s(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=v,i.addListener=v,i.once=v,i.off=v,i.removeListener=v,i.removeAllListeners=v,i.emit=v,i.prependListener=v,i.prependOnceListener=v,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){e.exports=function(e,t,n){var r=Math.sin(n),i=Math.cos(n),o=t[0],a=t[1],s=t[2],u=t[3],l=t[4],c=t[5],f=t[6],h=t[7];t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]);return e[0]=o*i+l*r,e[1]=a*i+c*r,e[2]=s*i+f*r,e[3]=u*i+h*r,e[4]=l*i-o*r,e[5]=c*i-a*r,e[6]=f*i-s*r,e[7]=h*i-u*r,e}},function(e,t){e.exports=function(e,t,n){var r=Math.sin(n),i=Math.cos(n),o=t[4],a=t[5],s=t[6],u=t[7],l=t[8],c=t[9],f=t[10],h=t[11];t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]);return e[4]=o*i+l*r,e[5]=a*i+c*r,e[6]=s*i+f*r,e[7]=u*i+h*r,e[8]=l*i-o*r,e[9]=c*i-a*r,e[10]=f*i-s*r,e[11]=h*i-u*r,e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.experimental=t.Stats=t.COLOR=t.Log=t.VERSION=void 0;var r=n(19);Object.defineProperty(t,"VERSION",{enumerable:!0,get:function(){return r.VERSION}});var i=n(223);Object.defineProperty(t,"Log",{enumerable:!0,get:function(){return l(i).default}});var o=n(82);Object.defineProperty(t,"COLOR",{enumerable:!0,get:function(){return o.COLOR}});var a=n(218);Object.defineProperty(t,"Stats",{enumerable:!0,get:function(){return l(a).default}}),n(217);var s=n(216),u=l(i);function l(e){return e&&e.__esModule?e:{default:e}}t.experimental={enableDOMLogging:s.enableDOMLogging};t.default=new u.default({id:"probe.gl"})},function(e,t,n){"use strict";var r=n(28);t.a=new r.Log({id:"luma"}).enable()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=l(n(39)),a=n(62),s=l(a),u=l(n(3));function l(e){return e&&e.__esModule?e:{default:e}}var c={transitionDuration:0},f={transitionDuration:300,transitionEasing:function(e){return e},transitionInterpolator:new o.default,transitionInterruption:a.TRANSITION_EVENTS.BREAK},h=["wheel"],d=["panstart","panmove","panend"],p=["pinchstart","pinchmove","pinchend"],v=["doubletap"],g=["keydown"],y=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),(0,u.default)(t),this.ControllerState=t,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new s.default(t,n),this._events=null,this._state={isDragging:!1},this.events=[],this.onViewportChange=null,this.onViewStateChange=null,this.onStateChange=null,this.invertPan=!1,this.handleEvent=this.handleEvent.bind(this),this.setProps(n)}return i(e,[{key:"finalize",value:function(){}},{key:"handleEvent",value:function(e){var t=this.ControllerState;switch(this.controllerState=new t(Object.assign({},this.controllerStateProps,this._state)),e.type){case"panstart":return console.info("panstart"),this._onPanStart(e);case"panmove":return console.info("panmove"),this._onPan(e);case"panend":return console.info("panend"),this._onPanEnd(e);case"pinchstart":return console.info("pinchstart"),this._onPinchStart(e);case"pinchmove":return console.info("pinchmove"),this._onPinch(e);case"pinchend":return console.info("pinchend"),this._onPinchEnd(e);case"doubletap":return console.info("doubletap"),this._onDoubleTap(e);case"wheel":return console.info("wheel"),this._onWheel(e);case"keydown":return console.info("keydown"),this._onKeyDown(e);default:return!1}}},{key:"getCenter",value:function(e){var t=e.offsetCenter;return[t.x,t.y]}},{key:"isFunctionKeyPressed",value:function(e){var t=e.srcEvent;return Boolean(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}},{key:"isDragging",value:function(){return this._state.isDragging}},{key:"setProps",value:function(e){"onViewportChange"in e&&(this.onViewportChange=e.onViewportChange),"onViewStateChange"in e&&(this.onViewStateChange=e.onViewStateChange),"onStateChange"in e&&(this.onStateChange=e.onStateChange),this.controllerStateProps="viewState"in e?Object.assign({},e,e.viewState):e,"eventManager"in e&&this.eventManager!==e.eventManager&&(this.eventManager=e.eventManager,this._events={},this.toggleEvents(this.events,!0)),this.transitionManager.processViewStateChange(this.controllerStateProps);var t=e.scrollZoom,n=void 0===t||t,r=e.dragPan,i=void 0===r||r,o=e.dragRotate,a=void 0===o||o,s=e.doubleClickZoom,u=void 0===s||s,l=e.touchZoom,c=void 0===l||l,f=e.touchRotate,y=void 0!==f&&f,_=e.keyboard,m=void 0===_||_,b=Boolean(this.onViewportChange||this.onViewStateChange);this.toggleEvents(h,b&&n),this.toggleEvents(d,b&&(i||a)),this.toggleEvents(p,b&&(c||y)),this.toggleEvents(v,b&&u),this.toggleEvents(g,b&&m),this.scrollZoom=n,this.dragPan=i,this.dragRotate=a,this.doubleClickZoom=u,this.touchZoom=c,this.touchRotate=y,this.keyboard=m}},{key:"toggleEvents",value:function(e,t){var n=this;this.eventManager&&e.forEach(function(e){n._events[e]!==t&&(n._events[e]=t,t?n.eventManager.on(e,n.handleEvent):n.eventManager.off(e,n.handleEvent))})}},{key:"setOptions",value:function(e){return this.setProps(e)}},{key:"updateViewport",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Object.assign({},e.getViewportProps(),t),i=this.controllerState?this.controllerState.getViewportProps():null;this.onViewportChange&&this.onViewportChange(r,n,i),this.onViewStateChange&&this.onViewStateChange({viewState:r,interactionState:n,oldViewState:i}),Object.assign(this._state,Object.assign({},e.getInteractiveState(),n)),this.onStateChange&&this.onStateChange(this._state)}},{key:"_onPanStart",value:function(e){var t=this.getCenter(e),n=this.controllerState.panStart({pos:t}).rotateStart({pos:t});return this.updateViewport(n,c,{isDragging:!0})}},{key:"_onPan",value:function(e){var t=this.isFunctionKeyPressed(e)||e.rightButton;return(t=this.invertPan?!t:t)?this._onPanMove(e):this._onPanRotate(e)}},{key:"_onPanEnd",value:function(e){var t=this.controllerState.panEnd().rotateEnd();return this.updateViewport(t,null,{isDragging:!1})}},{key:"_onPanMove",value:function(e){if(!this.dragPan)return!1;var t=this.getCenter(e),n=this.controllerState.pan({pos:t});return this.updateViewport(n,c,{isDragging:!0})}},{key:"_onPanRotate",value:function(e){return!!this.dragRotate&&(this.invertPan?this._onPanRotateMap(e):this._onPanRotateStandard(e))}},{key:"_onPanRotateStandard",value:function(e){var t=e.deltaX,n=e.deltaY,r=this.controllerState.getViewportProps(),i=t/r.width,o=n/r.height,a=this.controllerState.rotate({deltaScaleX:i,deltaScaleY:o});return this.updateViewport(a,c,{isDragging:!0})}},{key:"_onPanRotateMap",value:function(e){var t=e.deltaX,n=e.deltaY,i=this.getCenter(e),o=r(i,2)[1],a=o-n,s=this.controllerState.getViewportProps(),u=s.width,l=s.height,f=t/u,h=0;n>0?Math.abs(l-a)>5&&(h=n/(a-l)*1.2):n<0&&a>5&&(h=1-o/a),h=Math.min(1,Math.max(-1,h));var d=this.controllerState.rotate({deltaScaleX:f,deltaScaleY:h});return this.updateViewport(d,c,{isDragging:!0})}},{key:"_onWheel",value:function(e){if(!this.scrollZoom)return!1;var t=this.getCenter(e),n=e.delta,r=2/(1+Math.exp(-Math.abs(.01*n)));n<0&&0!==r&&(r=1/r);var i=this.controllerState.zoom({pos:t,scale:r});return this.updateViewport(i,c)}},{key:"_onPinchStart",value:function(e){var t=this.getCenter(e),n=this.controllerState.zoomStart({pos:t}).rotateStart({pos:t});return this._state.startPinchRotation=e.rotation,this.updateViewport(n,c,{isDragging:!0})}},{key:"_onPinch",value:function(e){if(!this.touchZoom&&!this.touchRotate)return!1;var t=this.controllerState;if(this.touchZoom){var n=e.scale,r=this.getCenter(e);t=t.zoom({pos:r,scale:n})}if(this.touchRotate){var i=e.rotation,o=this._state.startPinchRotation;t=t.rotate({deltaScaleX:-(i-o)/180})}return this.updateViewport(t,c,{isDragging:!0})}},{key:"_onPinchEnd",value:function(e){var t=this.controllerState.zoomEnd().rotateEnd();return this._state.startPinchRotation=0,this.updateViewport(t,null,{isDragging:!1})}},{key:"_onDoubleTap",value:function(e){if(!this.doubleClickZoom)return!1;var t=this.getCenter(e),n=this.isFunctionKeyPressed(e),r=this.controllerState.zoom({pos:t,scale:n?.5:2});return this.updateViewport(r,f)}},{key:"_onKeyDown",value:function(e){if(!this.keyboard)return!1;var t=this.isFunctionKeyPressed(e),n=this.controllerState,r=void 0;switch(e.srcEvent.keyCode){case 189:r=t?n.zoomOut().zoomOut():n.zoomOut();break;case 187:r=t?n.zoomIn().zoomIn():n.zoomIn();break;case 37:r=t?n.rotateLeft():n.moveLeft();break;case 39:r=t?n.rotateRight():n.moveRight();break;case 38:r=t?n.rotateUp():n.moveUp();break;case 40:r=t?n.rotateDown():n.moveDown();break;default:return!1}return this.updateViewport(r,f)}}]),e}();t.default=y},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.zoomToScale=E,t.scaleToZoom=w,t.lngLatToWorld=S,t.worldToLngLat=function(e,t,n){var i=r(e,2),o=i[0],a=i[1];if(n&&("m"===n.units||n.topTileExtent[3]>n.topTileExtent[0]&&n.topTileExtent[3]-n.topTileExtent[0]<721)){var s=o/(t*=_)*(n.topTileExtent[2]-n.topTileExtent[0])+n.topTileExtent[0],u=n.topTileExtent[3]-a/t*(n.topTileExtent[3]-n.topTileExtent[1]);return[s,u]}var l=o/(t*=_)*(2*p)-p,c=2*(Math.atan(Math.exp(p-a/t*(2*p)))-v);return[l*y,c*y]},t.getMeterZoom=function(e){var t=e.latitude;(0,h.default)(Number.isFinite(t));var n=Math.cos(t*g);return w(m*n)-9},t.getDistanceScales=P,t.getWorldPosition=function(e,t){var n=e.longitude,r=e.latitude,o=e.zoom,a=e.scale,s=e.meterOffset,u=e.distanceScales,l=void 0===u?null:u;a=void 0!==a?a:E(o);var c=S([n,r],a,t),f=new i.Vector3(c[0],c[1],0);if(s){l=l||P({latitude:r,longitude:n,scale:a},t);var h=new i.Vector3(s).scale(l.pixelsPerMeter).scale([1,-1,1]);f.add(h)}return f},t.getViewMatrix=function(e){var t=e.height,n=e.pitch,r=e.bearing,a=e.altitude,f=e.center,h=void 0===f?null:f,d=e.flipY,p=void 0!==d&&d,v=(0,o.createMat4)();(0,u.default)(v,v,[0,0,-a]),(0,s.default)(v,v,[1,1,1/t]),(0,l.default)(v,v,-n*g),(0,c.default)(v,v,r*g),p&&(0,s.default)(v,v,[1,-1,1]);h&&(0,u.default)(v,v,new i.Vector3(h).negate());return v},t.getProjectionParameters=T,t.getProjectionMatrix=function(e){var t=e.width,n=e.height,r=e.pitch,i=e.altitude,o=e.farZMultiplier,s=void 0===o?10:o,u=T({width:t,height:n,altitude:i,pitch:r,farZMultiplier:s}),l=u.fov,c=u.aspect,f=u.near,h=u.far;return(0,a.default)([],l,c,f,h)},t.worldToPixels=function(e,t){var n=r(e,3),i=n[0],a=n[1],s=n[2],u=void 0===s?0:s;return(0,h.default)(Number.isFinite(i)&&Number.isFinite(a)&&Number.isFinite(u)),(0,o.transformVector)(t,[i,a,u,1])},t.pixelsToWorld=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=r(e,3),a=i[0],s=i[1],u=i[2];if((0,h.default)(Number.isFinite(a)&&Number.isFinite(s)),Number.isFinite(u)){var l=(0,o.transformVector)(t,[a,s,u,1]);return l}var c=(0,o.transformVector)(t,[a,s,0,1]),d=(0,o.transformVector)(t,[a,s,1,1]),p=c[2],v=d[2],g=p===v?0:((n||0)-p)/(v-p);return(0,f.default)([],c,d,g)};var i=n(1),o=n(32),a=d(n(17)),s=d(n(16)),u=d(n(15)),l=d(n(27)),c=d(n(26)),f=d(n(192)),h=d(n(70));function d(e){return e&&e.__esModule?e:{default:e}}var p=Math.PI,v=p/4,g=p/180,y=180/p,_=512,m=4003e4,b=1.5;function E(e){return Math.pow(2,e)}function w(e){return Math.log2(e)}function S(e,t,n){var i=r(e,2),o=i[0],a=i[1];if(n&&("m"===n.units||n.topTileExtent[3]>n.topTileExtent[0]&&n.topTileExtent[3]-n.topTileExtent[0]<721))return t*=_,[(o-n.topTileExtent[0])*t/(n.topTileExtent[2]-n.topTileExtent[0]),(n.topTileExtent[3]-a)*t/(n.topTileExtent[3]-n.topTileExtent[1])];var s=a*g;return[(t*=_)*(o*g+p)/(2*p),t*(p-Math.log(Math.tan(v+.5*s)))/(2*p)]}function P(e,t){var n=e.latitude,r=e.longitude,i=e.zoom,o=e.scale,a=e.highPrecision,s=void 0!==a&&a;o=void 0!==o?o:E(i),(0,h.default)(Number.isFinite(n)&&Number.isFinite(r)&&Number.isFinite(o));var u={},l=_*o,c=Math.cos(n*g),f=l/360,d=f/c,p=void 0;if(p=t&&("m"===t.units||t.topTileExtent[3]>t.topTileExtent[0]&&t.topTileExtent[3]-t.topTileExtent[0]<721)?l/(t.topTileExtent[2]-t.topTileExtent[0]):l/m/c,u.pixelsPerMeter=[p,p,p],u.metersPerPixel=[1/p,1/p,1/p],u.pixelsPerDegree=[f,d,p],u.degreesPerPixel=[1/f,1/d,1/p],s){var v=g*Math.tan(n*g)/c,y=f*v/2,b=l/m*v,w=b/d*p;u.pixelsPerDegree2=[0,y,b],u.pixelsPerMeter2=[w,0,w]}if(t&&"degrees"===t.units){var S=l/m/c;u.pixelsPerMeter[2]=S,u.metersPerPixel[2]=1/S,u.pixelsPerDegree[2]=S,u.degreesPerPixel[2]=1/S,u.pixelsPerDegree2=u.pixelsPerMeter,u.pixelsPerMeter2=[0,0,0]}return u}function T(e){var t=e.width,n=e.height,r=e.altitude,i=void 0===r?b:r,o=e.pitch,a=void 0===o?0:o,s=e.farZMultiplier,u=void 0===s?1:s,l=a*g,c=Math.atan(.5/i),f=Math.sin(c)*i/Math.sin(Math.PI/2-l-c),h=Math.cos(Math.PI/2-l)*f+i;return{fov:2*Math.atan(n/2/i),aspect:t/n,focalDistance:i,near:.1,far:h*u}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMat4=function(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},t.transformVector=function(e,t){var n=(0,i.default)([],t,e);return(0,r.default)(n,n,1/n[3]),n},t.mod=function(e,t){var n=e%t;return n<0?t+n:n},t.lerp=function(e,t,n){return n*t+(1-n)*e};var r=o(n(78)),i=o(n(9));function o(e){return e&&e.__esModule?e:{default:e}}},function(e,t){e.exports=function(e,t,n){var r=Math.sin(n),i=Math.cos(n),o=t[0],a=t[1],s=t[2],u=t[3],l=t[8],c=t[9],f=t[10],h=t[11];t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]);return e[0]=o*i-l*r,e[1]=a*i-c*r,e[2]=s*i-f*r,e[3]=u*i-h*r,e[8]=o*r+l*i,e[9]=a*r+c*i,e[10]=s*r+f*i,e[11]=u*r+h*i,e}},function(e,t){e.exports=function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],l=t[7],c=t[8],f=t[9],h=t[10],d=t[11],p=t[12],v=t[13],g=t[14],y=t[15],_=n*s-r*a,m=n*u-i*a,b=n*l-o*a,E=r*u-i*s,w=r*l-o*s,S=i*l-o*u,P=c*v-f*p,T=c*g-h*p,A=c*y-d*p,x=f*g-h*v,O=f*y-d*v,R=h*y-d*g,C=_*R-m*O+b*x+E*A-w*T+S*P;if(!C)return null;return C=1/C,e[0]=(s*R-u*O+l*x)*C,e[1]=(i*O-r*R-o*x)*C,e[2]=(v*S-g*w+y*E)*C,e[3]=(h*w-f*S-d*E)*C,e[4]=(u*A-a*R-l*T)*C,e[5]=(n*R-i*A+o*T)*C,e[6]=(g*b-p*S-y*m)*C,e[7]=(c*S-h*b+d*m)*C,e[8]=(a*O-s*A+l*P)*C,e[9]=(r*A-n*O-o*P)*C,e[10]=(p*w-v*b+y*_)*C,e[11]=(f*b-c*w-d*_)*C,e[12]=(s*T-a*x-u*P)*C,e[13]=(n*x-r*T+i*P)*C,e[14]=(v*m-p*E-g*_)*C,e[15]=(c*E-f*m+h*_)*C,e}},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return s});var r=n(10),i="Failed to create WebGL context in Node.js, headless gl not available",o="Failed to create WebGL context in Node.js, headless gl returned null",a=null;if(!r.a)try{a=e.require("gl")}catch(e){console.error(),console.error("".concat('WebGL not available in Node.js, install using "npm install gl".',"\n").concat(e.message))}r.a;function s(e){var t=e.width,n=e.height,r=e.opts,s=e.onError,u=r.webgl1;if(r.webgl2&&!u)return s("headless-gl does not support WebGL2");if(!a)return s(i);var l=a(t,n,r);return l||s(o)}}).call(this,n(81)(e))},function(e,t,n){"use strict";n.r(t);var r=n(10),i=n(4);n.d(t,"global",function(){return i.a});var o=n(29);if(i.a.luma&&"5.3.0"!==i.a.luma.VERSION)throw new Error("luma.gl - multiple VERSIONs detected: ".concat(i.a.luma.VERSION," vs ").concat("5.3.0"));i.a.luma||(r.a&&o.a.log(0,"luma.gl ".concat("5.3.0"," - ").concat("set luma.log.priority=1 (or higher) to trace rendering"))(),i.a.luma=i.a.luma||{VERSION:"5.3.0",version:"5.3.0",log:o.a,stats:{},globals:{modules:{},nodeIO:{}}}),t.default=i.a.luma},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(6),o=n(2),a=l(n(132)),s=l(n(131)),u=l(n(130));function l(e){return e&&e.__esModule?e:{default:e}}var c=o.fp64.fp64LowPart,f=[0,0,0,255],h={widthScale:1,widthMinPixels:0,widthMaxPixels:Number.MAX_SAFE_INTEGER,rounded:!1,miterLimit:4,fp64:!1,dashJustified:!1,getPath:function(e){return e.path},getColor:function(e){return e.color||f},getWidth:function(e){return e.width||1},getDashArray:null},d=function(e){var t=e[0],n=e[e.length-1];return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]},p=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(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)}(t,i.Layer),r(t,[{key:"getShaders",value:function(){return this.is64bitEnabled()?{vs:s.default,fs:u.default,modules:["project64","picking"]}:{vs:a.default,fs:u.default,modules:["picking"]}}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instanceStartPositions:{size:3,update:this.calculateStartPositions},instanceEndPositions:{size:3,update:this.calculateEndPositions},instanceLeftDeltas:{size:3,update:this.calculateLeftDeltas},instanceRightDeltas:{size:3,update:this.calculateRightDeltas},instanceStrokeWidths:{size:1,accessor:"getWidth",update:this.calculateStrokeWidths,defaultValue:1},instanceDashArrays:{size:2,accessor:"getDashArray",update:this.calculateDashArrays},instanceColors:{size:4,type:o.GL.UNSIGNED_BYTE,accessor:"getColor",update:this.calculateColors,defaultValue:f},instancePickingColors:{size:3,type:o.GL.UNSIGNED_BYTE,update:this.calculatePickingColors}})}},{key:"updateAttribute",value:function(e){var t=e.props,n=e.oldProps;e.changeFlags;if(t.fp64!==n.fp64){var r=this.getAttributeManager();r.invalidateAll(),t.fp64&&t.coordinateSystem===i.COORDINATE_SYSTEM.LNGLAT?r.addInstanced({instanceStartEndPositions64xyLow:{size:4,update:this.calculateInstanceStartEndPositions64xyLow}}):r.remove(["instanceStartEndPositions64xyLow"])}}},{key:"updateState",value:function(e){var n=e.oldProps,r=e.props,i=e.changeFlags;(function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,r)}if("value"in i)return i.value;var a=i.get;return void 0!==a?a.call(r):void 0})(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateState",this).call(this,{props:r,oldProps:n,changeFlags:i});var o=this.props.getPath,a=this.getAttributeManager();if(r.fp64!==n.fp64){var s=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(s)})}if(this.updateAttribute({props:r,oldProps:n,changeFlags:i}),i.dataChanged||i.updateTriggersChanged&&(i.updateTriggersChanged.all||i.updateTriggersChanged.getPath)){var u=r.data.map(o),l=u.reduce(function(e,t){return e+t.length-1},0);this.setState({paths:u,numInstances:l}),a.invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.props,r=n.rounded,i=n.miterLimit,o=n.widthScale,a=n.widthMinPixels,s=n.widthMaxPixels,u=n.dashJustified;this.state.model.render(Object.assign({},t,{jointType:Number(r),alignMode:Number(u),widthScale:o,miterLimit:i,widthMinPixels:a,widthMaxPixels:s}))}},{key:"_getModel",value:function(e){return new o.Model(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new o.Geometry({drawMode:o.GL.TRIANGLES,attributes:{indices:new Uint16Array([0,2,1,1,2,4,1,4,3,3,4,5]),positions:new Float32Array([0,0,1,0,-1,0,0,1,0,1,-1,0,1,1,0,1,0,1])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateStartPositions",value:function(e){var t=this.state.paths,n=e.value,r=0;t.forEach(function(e){for(var t=e.length-1,i=0;i<t;i++){var o=e[i];n[r++]=o[0],n[r++]=o[1],n[r++]=o[2]||0}})}},{key:"calculateEndPositions",value:function(e){var t=this.state.paths,n=e.value,r=0;t.forEach(function(e){for(var t=1;t<e.length;t++){var i=e[t];n[r++]=i[0],n[r++]=i[1],n[r++]=i[2]||0}})}},{key:"calculateInstanceStartEndPositions64xyLow",value:function(e){var t=this.state.paths,n=e.value,r=0;t.forEach(function(e){for(var t=e.length-1,i=0;i<t;i++){var o=e[i],a=e[i+1];n[r++]=c(o[0]),n[r++]=c(o[1]),n[r++]=c(a[0]),n[r++]=c(a[1])}})}},{key:"calculateLeftDeltas",value:function(e){var t=this.state.paths,n=e.value,r=0;t.forEach(function(e){for(var t=e.length-1,i=d(e)?e[e.length-2]:e[0],o=0;o<t;o++){var a=e[o];n[r++]=a[0]-i[0],n[r++]=a[1]-i[1],n[r++]=a[2]-i[2]||0,i=a}})}},{key:"calculateRightDeltas",value:function(e){var t=this.state.paths,n=e.value,r=0;t.forEach(function(e){for(var t=1;t<e.length;t++){var i=e[t],o=e[t+1];o||(o=d(e)?e[1]:i),n[r++]=o[0]-i[0],n[r++]=o[1]-i[1],n[r++]=o[2]-i[2]||0}})}},{key:"calculateStrokeWidths",value:function(e){var t=this.props,n=t.data,r=t.getWidth,i=this.state.paths,o=e.value,a=0;i.forEach(function(e,t){for(var i=r(n[t],t),s=1;s<e.length;s++)o[a++]=i})}},{key:"calculateDashArrays",value:function(e){var t=this.props,n=t.data,r=t.getDashArray;if(r){var i=this.state.paths,o=e.value,a=0;i.forEach(function(e,t){for(var i=r(n[t],t),s=1;s<e.length;s++)o[a++]=i[0],o[a++]=i[1]})}}},{key:"calculateColors",value:function(e){var t=this.props,n=t.data,r=t.getColor,i=this.state.paths,o=e.value,a=0;i.forEach(function(e,t){var i=r(n[t],t);isNaN(i[3])&&(i[3]=255);for(var s=1;s<e.length;s++)o[a++]=i[0],o[a++]=i[1],o[a++]=i[2],o[a++]=i[3]})}},{key:"calculatePickingColors",value:function(e){var t=this,n=this.state.paths,r=e.value,i=0;n.forEach(function(e,n){for(var o=t.encodePickingColor(n),a=1;a<e.length;a++)r[i++]=o[0],r[i++]=o[1],r[i++]=o[2]})}}]),t}();t.default=p,p.layerName="PathLayer",p.defaultProps=h},function(e,t,n){"use strict";function r(e,t){if(e===t)return!0;if(Array.isArray(e)){var n=e.length;if(!t||t.length!==n)return!1;for(var r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}return!1}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t={},n=void 0;return function(i){for(var o in i)if(!r(i[o],t[o])){n=e(i),t=i;break}return n}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(63),a=(r=o)&&r.__esModule?r:{default:r},s=n(1);var u=["longitude","latitude","zoom","bearing","pitch"],l=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return function(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)}(t,a.default),i(t,[{key:"interpolateProps",value:function(e,t,n){var r={};for(var i in t)r[i]=(0,s.lerp)(e[i],t[i],n);return r}}]),t}();t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var i=0,o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id="effect",this.count=i++,this.visible=!0,this.priority=0,this.needsRedraw=!1}return r(e,[{key:"initialize",value:function(e){e.gl,e.layerManager}},{key:"finalize",value:function(e){e.gl,e.layerManager}},{key:"preDraw",value:function(e){e.gl,e.layerManager}},{key:"draw",value:function(e){e.gl,e.layerManager}},{key:"setNeedsRedraw",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.needsRedraw=e}}]),e}();t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=c(n(7)),a=n(21),s=c(n(68)),u=c(n(67)),l=c(n(3));function c(e){return e&&e.__esModule?e:{default:e}}var f="Illegal argument to WebMercatorViewport",h=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.latitude,r=void 0===n?0:n,i=e.longitude,o=void 0===i?0:i,s=e.zoom,u=void 0===s?11:s,l=e.pitch,c=void 0===l?0:l,f=e.bearing,h=void 0===f?0:f,d=e.farZMultiplier,p=void 0===d?10:d,v=e.orthographic,g=void 0!==v&&v,y=e.width,_=e.height,m=e.altitude,b=void 0===m?1.5:m;y=y||1,_=_||1,b=Math.max(.75,b);var E=(0,a.getProjectionParameters)({width:y,height:_,pitch:c,altitude:b,farZMultiplier:p}),w=E.fov,S=E.aspect,P=E.focalDistance,T=E.near,A=E.far,x=(0,a.getViewMatrix)({height:_,pitch:c,bearing:h,altitude:b}),O=e.position&&[e.position[0],e.position[1],0],R=Object.assign({},e,{width:y,height:_,viewMatrix:x,longitude:o,latitude:r,zoom:u,position:O,orthographic:g,fovyRadians:w,aspect:S,orthographicFocalDistance:P,near:T,far:A}),C=function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,R));return C.latitude=r,C.longitude=o,C.zoom=u,C.pitch=c,C.bearing=h,C.altitude=b,C.orthographic=g,C.metersToLngLatDelta=C.metersToLngLatDelta.bind(C),C.lngLatDeltaToMeters=C.lngLatDeltaToMeters.bind(C),C.addMetersToLngLat=C.addMetersToLngLat.bind(C),Object.freeze(C),C}return function(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)}(t,o.default),i(t,[{key:"metersToLngLatDelta",value:function(e){var t=r(e,3),n=t[0],i=t[1],o=t[2],a=void 0===o?0:o;(0,l.default)(Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(a),f);var s=this.distanceScales,u=s.pixelsPerMeter,c=s.degreesPerPixel,h=n*u[0]*c[0],d=i*u[1]*c[1];return 2===e.length?[h,d]:[h,d,a]}},{key:"lngLatDeltaToMeters",value:function(e){var t=r(e,3),n=t[0],i=t[1],o=t[2],a=void 0===o?0:o;(0,l.default)(Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(a),f);var s=this.distanceScales,u=s.pixelsPerDegree,c=s.metersPerPixel,h=n*u[0]*c[0],d=i*u[1]*c[1];return 2===e.length?[h,d]:[h,d,a]}},{key:"addMetersToLngLat",value:function(e,t){var n=r(e,3),i=n[0],o=n[1],a=n[2],s=void 0===a?0:a,u=this.metersToLngLatDelta(t),l=r(u,3),c=l[0],f=l[1],h=l[2],d=void 0===h?0:h;return 2===e.length?[i+c,o+f]:[i+c,o+f,s+d]}},{key:"getMapCenterByLngLatPosition",value:function(e){var t=e.lngLat,n=e.pos,r=(0,a.pixelsToWorld)(n,this.pixelUnprojectionMatrix),i=(0,a.lngLatToWorld)(t,this.scale,this.option),o=(0,s.default)([],i,(0,u.default)([],r)),l=(0,s.default)([],this.center,o);return(0,a.worldToLngLat)(l,this.scale,this.option)}},{key:"getLocationAtPoint",value:function(e){var t=e.lngLat,n=e.pos;return this.getMapCenterByLngLatPosition({lngLat:t,pos:n})}},{key:"fitBounds",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.width,i=this.height,o=(0,a.fitBounds)(Object.assign({width:r,height:i,bounds:e},n));return new t({width:r,height:i,longitude:o.longitude,latitude:o.latitude,zoom:o.zoom})}},{key:"isMapSynched",value:function(){var e=60,t=40,n=this.pitch,r=this.zoom;return n<=e+1e-6&&r<=t+1e-6}},{key:"_projectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return(0,a.lngLatToWorld)(e,t,this.option)}},{key:"_unprojectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return(0,a.worldToLngLat)(e,t,this.option)}}]),t}();t.default=h,h.displayName="WebMercatorViewport"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=l(n(193)),o=n(31),a=l(n(69)),s=l(n(68)),u=l(n(67));function l(e){return e&&e.__esModule?e:{default:e}}var c=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.width,r=e.height,i=e.latitude,a=void 0===i?0:i,s=e.longitude,u=void 0===s?0:s,l=e.zoom,c=void 0===l?0:l,f=e.pitch,h=void 0===f?0:f,d=e.bearing,p=void 0===d?0:d,v=e.altitude,g=void 0===v?1.5:v,y=e.farZMultiplier,_=void 0===y?10:y;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),n=n||1,r=r||1;var m=(0,o.zoomToScale)(c);g=Math.max(.75,g);var b=(0,o.getWorldPosition)({longitude:u,latitude:a,scale:m}),E=(0,o.getProjectionMatrix)({width:n,height:r,pitch:h,bearing:p,altitude:g,farZMultiplier:_}),w=(0,o.getViewMatrix)({height:r,center:b,pitch:h,bearing:p,altitude:g,flipY:!0}),S=function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{width:n,height:r,viewMatrix:w,projectionMatrix:E}));return S.latitude=a,S.longitude=u,S.zoom=c,S.pitch=h,S.bearing=p,S.altitude=g,S.scale=m,S.center=b,Object.freeze(S),S}return function(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)}(t,i.default),r(t,[{key:"projectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return(0,o.lngLatToWorld)(e,t)}},{key:"unprojectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return(0,o.worldToLngLat)(e,t)}},{key:"getMapCenterByLngLatPosition",value:function(e){var t=e.lngLat,n=e.pos,r=(0,o.pixelsToWorld)(n,this.pixelUnprojectionMatrix),i=(0,o.lngLatToWorld)(t,this.scale),a=(0,s.default)([],i,(0,u.default)([],r)),l=(0,s.default)([],this.center,a);return(0,o.worldToLngLat)(l,this.scale)}},{key:"getLocationAtPoint",value:function(e){var t=e.lngLat,n=e.pos;return this.getMapCenterByLngLatPosition({lngLat:t,pos:n})}},{key:"fitBounds",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.width,i=this.height,o=(0,a.default)(Object.assign({width:r,height:i,bounds:e},n));return new t({width:r,height:i,longitude:o.longitude,latitude:o.latitude,zoom:o.zoom})}}]),t}();t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.transformVector=function(e,t){if(!e)return null;var n=(0,i.default)([0,0,0,0],t,e),o=1/n[3];return(0,r.default)(n,n,[o,o,o,o]),n},t.createMat4=function(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},t.extractCameraVectors=function(e){var t=e.viewMatrix,n=e.viewMatrixInverse;return{eye:[n[12],n[13],n[14]],direction:[t[2],t[6],t[10]],up:[t[1],t[5],t[9]]}},t.mod=function(e,t){(0,o.default)(Number.isFinite(e)&&Number.isFinite(t));var n=e%t;return n<0?t+n:n};var r=a(n(194)),i=a(n(9)),o=a(n(3));function a(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeLayerInSeer=t.updateLayerInSeer=t.initLayerInSeer=t.seerInitListener=t.layerEditListener=t.applyPropOverrides=t.setPropOverrides=void 0;var r,i=n(11),o=(r=i)&&r.__esModule?r:{default:r};var a=new Map;t.setPropOverrides=function(e,t,n){o.default.isReady()&&(a.has(e)||a.set(e,new Map),a.get(e).set(t,n))},t.applyPropOverrides=function(e){if(o.default.isReady()&&e.id){var t=a.get(e.id);t&&t.forEach(function(t,n){!function e(t,n,r){t&&(n.length>1?e(t[n[0]],n.slice(1),r):t[n[0]]=r)}(e,n,t),"data"===n[0]&&(e.data=[].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(e.data)))})}},t.layerEditListener=function(e){o.default.isReady()&&o.default.listenFor("deck.gl",e)},t.seerInitListener=function(e){o.default.isReady()&&o.default.listenFor("init",e)},t.initLayerInSeer=function(e){if(o.default.isReady()&&e){var t=[e.constructor.layerName];o.default.listItem("deck.gl",e.id,{badges:t,links:e.state&&e.state.model?["luma.gl:"+e.state.model.id]:void 0,parent:e.parent?e.parent.id:void 0})}},t.updateLayerInSeer=function(e){if(o.default.isReady()&&!o.default.throttle("deck.gl:"+e.id,1e3)){var t=function(e){var t=[{path:"objects.props",data:e.props}],n=[e.constructor.layerName];if(e.state){if(e.getAttributeManager()){var r=e.getAttributeManager().getAttributes();t.push({path:"objects.attributes",data:r}),n.push(e.getAttributeManager().stats.getTimeString())}if(e.state.model){e.state.model.timerQueryEnabled=!0;var i=e.state.model.stats.lastFrameTime;i&&n.push((1e3*i).toFixed(0)+"μs")}}return t.push({path:"badges",data:n}),t}(e);o.default.multiUpdate("deck.gl",e.id,t)}},t.removeLayerInSeer=function(e){o.default.isReady()&&e&&o.default.deleteItem("deck.gl",e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(23),a=v(n(76)),s=n(44),u=n(202),l=n(201),c=v(n(5)),f=n(2),h=v(n(3)),d=v(n(200)),p=v(n(197));function v(e){return e&&e.__esModule?e:{default:e}}var g=function(){},y={data:{type:"data",value:Object.freeze([]),async:!0},dataComparator:null,dataTransform:function(e){return e},fetch:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(e){return fetch(e).then(function(e){return e.json()})}),updateTriggers:{},numInstances:void 0,visible:!0,pickable:!1,opacity:{type:"number",min:0,max:1,value:.8},onHover:g,onClick:g,coordinateSystem:o.COORDINATE_SYSTEM.LNGLAT,coordinateOrigin:[0,0,0],parameters:{},uniforms:{},framebuffer:null,animation:null,getPolygonOffset:function(e){return[0,100*-e.layerIndex]},highlightedObjectIndex:null,autoHighlight:!1,highlightColor:[0,0,128,128]},_=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(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)}(t,d.default),i(t,[{key:"toString",value:function(){return(this.constructor.layerName||this.constructor.name)+"({id: '"+this.props.id+"'})"}},{key:"setState",value:function(e){Object.assign(this.state,e),this.setNeedsRedraw()}},{key:"setNeedsRedraw",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.internalState&&(this.internalState.needsRedraw=e)}},{key:"setLayerNeedsUpdate",value:function(){this.context.layerManager.setNeedsUpdate(String(this))}},{key:"getNeedsRedraw",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).clearRedrawFlags,t=void 0!==e&&e;return this._getNeedsRedraw(t)}},{key:"needsUpdate",value:function(){return this.shouldUpdateState(this._getUpdateParams())}},{key:"isPickable",value:function(){return this.props.pickable&&this.props.visible}},{key:"getModels",value:function(){return this.state&&(this.state.models||(this.state.model?[this.state.model]:[]))}},{key:"getSingleModel",value:function(){return this.state&&this.state.model}},{key:"getAttributeManager",value:function(){return this.internalState&&this.internalState.attributeManager}},{key:"getCurrentLayer",value:function(){return this.internalState&&this.internalState.layer}},{key:"getFirstObject",value:function(){var e=this.props.data,t=!0,n=!1,r=void 0;try{for(var i,o=e[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){return i.value}}catch(e){n=!0,r=e}finally{try{!t&&o.return&&o.return()}finally{if(n)throw r}}return null}},{key:"project",value:function(e){var t=this.context.viewport;return(0,h.default)(Array.isArray(e)),t.project(e)}},{key:"unproject",value:function(e){var t=this.context.viewport;return(0,h.default)(Array.isArray(e)),t.unproject(e)}},{key:"projectFlat",value:function(e){var t=this.context.viewport;return(0,h.default)(Array.isArray(e)),t.projectFlat(e)}},{key:"unprojectFlat",value:function(e){var t=this.context.viewport;return(0,h.default)(Array.isArray(e)),t.unprojectFlat(e)}},{key:"is64bitEnabled",value:function(){if(this.props.fp64){if(this.props.coordinateSystem===o.COORDINATE_SYSTEM.LNGLAT)return!0;c.default.once(0,"64-bit mode only works with coordinateSystem set to\n COORDINATE_SYSTEM.LNGLAT. Rendering in 32-bit mode instead")}return!1}},{key:"screenToDevicePixels",value:function(e){return c.default.deprecated("screenToDevicePixels","DeckGL prop useDevicePixels for conversion")(),e*("undefined"!=typeof window?window.devicePixelRatio:1)}},{key:"nullPickingColor",value:function(){return[0,0,0]}},{key:"encodePickingColor",value:function(e){return(0,h.default)(0==(e+1>>24&255),"index out of picking color range"),[e+1&255,e+1>>8&255,e+1>>8>>8&255]}},{key:"decodePickingColor",value:function(e){(0,h.default)(e instanceof Uint8Array);var t=r(e,3);return t[0]+256*t[1]+65536*t[2]-1}},{key:"initializeState",value:function(){throw new Error("Layer "+this+" has not defined initializeState")}},{key:"shouldUpdateState",value:function(e){e.oldProps,e.props,e.context;return e.changeFlags.propsOrDataChanged}},{key:"updateState",value:function(e){e.oldProps,e.props,e.context;var t=e.changeFlags,n=this.getAttributeManager();t.dataChanged&&n&&n.invalidateAll()}},{key:"finalizeState",value:function(){var e=!0,t=!1,n=void 0;try{for(var r,i=this.getModels()[Symbol.iterator]();!(e=(r=i.next()).done);e=!0){r.value.delete()}}catch(e){t=!0,n=e}finally{try{!e&&i.return&&i.return()}finally{if(t)throw n}}this.getAttributeManager().finalize()}},{key:"draw",value:function(e){var t=!0,n=!1,r=void 0;try{for(var i,o=this.getModels()[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){i.value.draw(e)}}catch(e){n=!0,r=e}finally{try{!t&&o.return&&o.return()}finally{if(n)throw r}}}},{key:"getPickingInfo",value:function(e){var t=e.info,n=(e.mode,t.index);return n>=0&&Array.isArray(this.props.data)&&(t.object=this.props.data[n]),t}},{key:"invalidateAttribute",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=this.getAttributeManager();n&&("all"===e?(c.default.log(1,"updateTriggers invalidating all attributes: "+t)(),n.invalidateAll()):(c.default.log(1,"updateTriggers invalidating attribute "+e+": "+t)(),n.invalidate(e)))}},{key:"updateAttributes",value:function(e){var t=this.getAttributeManager();if(t){var n=this.getNumInstances(e);t.update({data:e.data,numInstances:n,props:e,transitions:e.transitions,buffers:e,context:this,ignoreUnknownAttributes:!0});var r=this.getSingleModel();if(r){var i=t.getChangedAttributes({clearChangedFlags:!0});r.setAttributes(i)}}}},{key:"updateTransition",value:function(){var e=this.getSingleModel(),t=this.getAttributeManager(),n=t&&t.updateTransition();e&&n&&e.setAttributes(t.getChangedAttributes({transition:!0}))}},{key:"calculateInstancePickingColors",value:function(e,t){for(var n=t.numInstances,r=e.value,i=e.size,o=0;o<n;o++){var a=this.encodePickingColor(o);r[o*i+0]=a[0],r[o*i+1]=a[1],r[o*i+2]=a[2]}}},{key:"_clearInstancePickingColor",value:function(e){var t=this.getAttributeManager().attributes.instancePickingColors.state,n=t.value,r=t.size,i=this.decodePickingColor(e);n[i*r+0]=0,n[i*r+1]=0,n[i*r+2]=0;var o=this.getModels();o&&o.forEach(function(e){return e.setAttributes({instancePickingColors:t})})}},{key:"_clearPickingColor",value:function(e){for(var t=this.getAttributeManager().attributes.pickingColors.state,n=t.value,r=0;r<n.length;r+=3)n[r+0]===e[0]&&n[r+1]===e[1]&&n[r+2]===e[2]&&(n[r+0]=0,n[r+1]=0,n[r+2]=0);var i=this.getModels();i&&i.forEach(function(e){return e.setAttributes({pickingColors:t})})}},{key:"clearPickingColor",value:function(e){this.getAttributeManager().attributes.pickingColors?this._clearPickingColor(e):this._clearInstancePickingColor(e)}},{key:"copyPickingColors",value:function(){var e=this.getAttributeManager().attributes,t=e.pickingColors,n=e.instancePickingColors;return new Uint8ClampedArray((t||n).value)}},{key:"restorePickingColors",value:function(e){var t=this.getAttributeManager().attributes,n=t.pickingColors,r=t.instancePickingColors,i=n||r;i.value.set(e),i.setNeedsUpdate(),this.updateAttributes(this.props)}},{key:"getNumInstances",value:function(e){if(e=e||this.props,this.state&&void 0!==this.state.numInstances)return this.state.numInstances;if(void 0!==e.numInstances)return e.numInstances;var t=this.props.data;return(0,l.count)(t)}},{key:"_initialize",value:function(){(0,h.default)(this.context.gl),this._initState(),this.initializeState(this.context),this.state.attributeManager=this.getAttributeManager(),this.setChangeFlags({dataChanged:!0,propsChanged:!0,viewportChanged:!0}),this._updateState();var e=this.getSingleModel();e&&(e.id=this.props.id,e.program.id=this.props.id+"-program",e.geometry.id=this.props.id+"-geometry",e.setAttributes(this.getAttributeManager().getAttributes()))}},{key:"_update",value:function(){this.needsUpdate()&&this._updateState()}},{key:"_updateState",value:function(){var e=this._getUpdateParams();this.updateState(e),this.isComposite&&this._renderLayers(e),this.updateAttributes(this.props),this._updateBaseUniforms(),this._updateModuleSettings(),this.state.model&&this.state.model.setInstanceCount(this.getNumInstances()),this.clearChangeFlags(),this.internalState.resetOldProps()}},{key:"_finalize",value:function(){(0,h.default)(this.internalState&&this.state),this.finalizeState(this.context),(0,s.removeLayerInSeer)(this.id)}},{key:"drawLayer",value:function(e){var t=this,n=e.moduleParameters,r=void 0===n?null:n,i=e.uniforms,o=void 0===i?{}:i,a=e.parameters,s=void 0===a?{}:a;if(o.picking_uActive||this.updateTransition(),r){var u=!0,l=!1,c=void 0;try{for(var h,d=this.getModels()[Symbol.iterator]();!(u=(h=d.next()).done);u=!0){h.value.updateModuleSettings(r)}}catch(e){l=!0,c=e}finally{try{!u&&d.return&&d.return()}finally{if(l)throw c}}}var p=this.props.getPolygonOffset,v=p&&p(o)||[0,0];s.polygonOffset=v,(0,f.withParameters)(this.context.gl,s,function(){t.draw({moduleParameters:r,uniforms:o,parameters:s,context:t.context})})}},{key:"pickLayer",value:function(e){return this.getPickingInfo(e)}},{key:"getChangeFlags",value:function(){return this.internalState.changeFlags}},{key:"setChangeFlags",value:function(e){var t=this;this.internalState.changeFlags=this.internalState.changeFlags||{};var n=this.internalState.changeFlags;e.dataChanged&&!n.dataChanged&&(n.dataChanged=e.dataChanged,c.default.log(2,function(){return"dataChanged: "+e.dataChanged+" in "+t.id})()),e.updateTriggersChanged&&!n.updateTriggersChanged&&(n.updateTriggersChanged=n.updateTriggersChanged&&e.updateTriggersChanged?Object.assign({},e.updateTriggersChanged,n.updateTriggersChanged):e.updateTriggersChanged||n.updateTriggersChanged,c.default.log(2,function(){return"updateTriggersChanged: "+Object.keys(e.updateTriggersChanged).join(", ")+" in "+t.id})()),e.propsChanged&&!n.propsChanged&&(n.propsChanged=e.propsChanged,c.default.log(2,function(){return"propsChanged: "+e.propsChanged+" in "+t.id})()),e.viewportChanged&&!n.viewportChanged&&(n.viewportChanged=e.viewportChanged,c.default.log(3,function(){return"viewportChanged: "+e.viewportChanged+" in "+t.id})());var r=e.dataChanged||e.updateTriggersChanged||e.propsChanged;n.propsOrDataChanged=n.propsOrDataChanged||r,n.somethingChanged=n.somethingChanged||r||e.viewportChanged}},{key:"clearChangeFlags",value:function(){this.internalState.changeFlags={dataChanged:!1,propsChanged:!1,updateTriggersChanged:!1,viewportChanged:!1,propsOrDataChanged:!1,somethingChanged:!1}}},{key:"printChangeFlags",value:function(){var e=this.internalState.changeFlags;return(e.dataChanged?"data ":"")+(e.propsChanged?"props ":"")+(e.updateTriggersChanged?"triggers ":"")+(e.viewportChanged?"viewport":"")}},{key:"diffProps",value:function(e,t){var n=(0,u.diffProps)(e,t);if(n.updateTriggersChanged)for(var r in n.updateTriggersChanged)n.updateTriggersChanged[r]&&this._activeUpdateTrigger(r);return this.setChangeFlags(n)}},{key:"_getUpdateParams",value:function(){return{props:this.props,oldProps:this.internalState.getOldProps(),context:this.context,changeFlags:this.internalState.changeFlags}}},{key:"_getNeedsRedraw",value:function(e){if(!this.internalState)return!1;var t=!1;t=t||this.internalState.needsRedraw&&this.id,this.internalState.needsRedraw=this.internalState.needsRedraw&&!e;var n=this.getAttributeManager(),r=n&&n.getNeedsRedraw({clearRedrawFlags:e});t=t||r;var i=!0,o=!1,a=void 0;try{for(var s,u=this.getModels()[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var l=s.value,c=l.getNeedsRedraw({clearRedrawFlags:e});c&&"string"!=typeof c&&(c="model "+l.id),t=t||c}}catch(e){o=!0,a=e}finally{try{!i&&u.return&&u.return()}finally{if(o)throw a}}return t}},{key:"_initState",value:function(){(0,h.default)(!this.internalState&&!this.state);var e=new a.default(this.context.gl,{id:this.props.id,stats:this.context.stats});e.addInstanced({instancePickingColors:{type:f.GL.UNSIGNED_BYTE,size:3,update:this.calculateInstancePickingColors}}),this.internalState=new p.default({attributeManager:e,layer:this}),this.state={},this.state.attributeManager=this.getAttributeManager(),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props)}},{key:"_transferState",value:function(e){var t=e.state,n=e.internalState;if((0,h.default)(t&&n),this!==e){this.internalState=n,this.internalState.component=this,this.state=t,t.layer=this,this.internalState.setAsyncProps(this.props);var r=!0,i=!1,o=void 0;try{for(var a,s=this.getModels()[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){a.value.userData.layer=this}}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}this.internalState.setAsyncProps(this.props),this.diffProps(this.props,this.internalState.getOldProps())}}},{key:"_onAsyncPropUpdated",value:function(){this.diffProps(this.props,this.internalState.getOldProps()),this.setLayerNeedsUpdate()}},{key:"_activeUpdateTrigger",value:function(e){this.invalidateAttribute(e)}},{key:"_checkRequiredProp",value:function(e,t){var n=this.props[e];if(void 0===n)throw new Error("Property "+e+" undefined in layer "+this);if(t&&!t(n))throw new Error("Bad property "+e+" in layer "+this)}},{key:"_updateBaseUniforms",value:function(){var e={opacity:Math.pow(this.props.opacity,1/2.2),ONE:1},t=!0,n=!1,r=void 0;try{for(var i,o=this.getModels()[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){i.value.setUniforms(e)}}catch(e){n=!0,r=e}finally{try{!t&&o.return&&o.return()}finally{if(n)throw r}}this.setNeedsRedraw()}},{key:"_updateModuleSettings",value:function(){var e={pickingHighlightColor:this.props.highlightColor},t=!0,n=!1,r=void 0;try{for(var i,o=this.getModels()[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){i.value.updateModuleSettings(e)}}catch(e){n=!0,r=e}finally{try{!t&&o.return&&o.return()}finally{if(n)throw r}}}},{key:"setUniforms",value:function(e){var t=!0,n=!1,r=void 0;try{for(var i,o=this.getModels()[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){i.value.setUniforms(e)}}catch(e){n=!0,r=e}finally{try{!t&&o.return&&o.return()}finally{if(n)throw r}}this.setNeedsRedraw(),c.default.deprecated("layer.setUniforms","model.setUniforms")()}}]),t}();t.default=_,_.layerName="Layer",_.defaultProps=y},function(e,t){e.exports=function(e,t,n){n*=.5;var r=Math.sin(n);return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=Math.cos(n),e}},function(e,t,n){e.exports=n(210)},function(e,t){e.exports=function(e){var t=e[0],n=e[1],r=e[2];return Math.sqrt(t*t+n*n+r*r)}},function(e,t){e.exports=function(e,t,n,r,i,o,a){var s=1/(t-n),u=1/(r-i),l=1/(o-a);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*u,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*l,e[11]=0,e[12]=(t+n)*s,e[13]=(i+r)*u,e[14]=(a+o)*l,e[15]=1,e}},function(e,t){e.exports=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=n[0],s=n[1],u=n[2];return e[0]=i*u-o*s,e[1]=o*a-r*u,e[2]=r*s-i*a,e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSimple=u,t.normalize=l,t.getVertexCount=function(e){return u(e)?e.length:e.reduce(function(e,t){return e+t.length},0)},t.getTriangleCount=function(e){var t=0,n=!0,r=!0,i=!1,o=void 0;try{for(var a,s=l(e)[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var u=a.value,c=u.length;t+=n?c>=3?c-2:0:c+1,n=!1}}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return t},t.forEachVertex=function(e,t){if(u(e))return void e.forEach(t);e.forEach(function(e){e.forEach(t)})},t.getSurfaceIndices=function(e){var t=function(e){var t=null;if(e.length>1){var n=0;t=[],e.forEach(function(e){n+=e.length,t.push(n)}),t.pop()}return t}(e),n=s(e,{dimensions:2,result:[]});return(0,a.default)(n,t,2)};var r,i=n(6),o=n(127),a=(r=o)&&r.__esModule?r:{default:r};var s=i.experimental.flattenVertices;function u(e){return e.length>=1&&e[0].length>=2&&Number.isFinite(e[0][0])}function l(e){(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).dimensions;return u(e)?[e]:e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(6),o=n(2),a=n(128),s=l(n(126)),u=l(n(125));function l(e){return e&&e.__esModule?e:{default:e}}var c=[0,0,0,255],f=[0,0,0,255],h={filled:!0,extruded:!1,wireframe:!1,fp64:!1,elevationScale:1,getPolygon:function(e){return e.polygon},getElevation:function(e){return e.elevation||0},getFillColor:function(e){return e.fillColor||f},getLineColor:function(e){return e.lineColor||c},lightSettings:{}},d=new Float32Array([0,1,0,0,1,1,1,0]),p=new Float32Array([1,1,0,1,0,0,1,0]),v={TOP:null,SIDE:{instanced:1},WIRE:{instanced:1}},g={TOP:{indices:"indices",positions:"positions",positions64xyLow:"positions64xyLow",elevations:"elevations",colors:"fillColors",pickingColors:"pickingColors"},SIDE:{positions:"positions",positions64xyLow:"positions64xyLow",nextPositions:"nextPositions",nextPositions64xyLow:"nextPositions64xyLow",elevations:"elevations",colors:"fillColors",pickingColors:"pickingColors"},WIRE:{positions:"positions",positions64xyLow:"positions64xyLow",nextPositions:"nextPositions",nextPositions64xyLow:"nextPositions64xyLow",elevations:"elevations",colors:"lineColors",pickingColors:"pickingColors"}},y=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(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)}(t,i.Layer),r(t,[{key:"getShaders",value:function(){var e=this.is64bitEnabled()?"project64":"project32";return{vs:s.default,fs:u.default,modules:[e,"lighting","picking"]}}},{key:"initializeState",value:function(){var e=this.context.gl;this.setState({numInstances:0,IndexType:(0,o.hasFeature)(e,o.FEATURES.ELEMENT_INDEX_UINT32)?Uint32Array:Uint16Array});this.getAttributeManager().add({indices:{size:1,isIndexed:!0,update:this.calculateIndices,noAlloc:!0},positions:{size:3,accessor:["extruded","fp64"],update:this.calculatePositions,noAlloc:!0},positions64xyLow:{size:2,accessor:"fp64",update:this.calculatePositionsLow},nextPositions:{size:3,accessor:["extruded","fp64"],update:this.calculateNextPositions,noAlloc:!0},nextPositions64xyLow:{size:2,accessor:"fp64",update:this.calculateNextPositionsLow},elevations:{size:1,accessor:["extruded","getElevation"],update:this.calculateElevations,noAlloc:!0},fillColors:{alias:"colors",size:4,type:o.GL.UNSIGNED_BYTE,accessor:"getFillColor",update:this.calculateFillColors,defaultValue:f,noAlloc:!0},lineColors:{alias:"colors",size:4,type:o.GL.UNSIGNED_BYTE,accessor:"getLineColor",update:this.calculateLineColors,defaultValue:c,noAlloc:!0},pickingColors:{size:3,type:o.GL.UNSIGNED_BYTE,update:this.calculatePickingColors,noAlloc:!0}})}},{key:"draw",value:function(e){var t=e.uniforms,n=this.props,r=n.extruded,i=n.elevationScale,o=Object.assign({},t,{extruded:r?1:0,elevationScale:i});this.state.models.forEach(function(e){e.render(o)})}},{key:"updateState",value:function(e){(function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,r)}if("value"in i)return i.value;var a=i.get;return void 0!==a?a.call(r):void 0})(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateState",this).call(this,e),this.updateGeometry(e);var n=e.props,r=e.oldProps;(n.fp64!==r.fp64||n.filled!==r.filled||n.extruded!==r.extruded||n.wireframe!==r.wireframe)&&(this.state.models&&this.state.models.forEach(function(e){return e.delete()}),this.setState(Object.assign({modelsChanged:!0},this._getModels(this.context.gl)))),n.extruded!==r.extruded&&this.state.attributeManager.invalidate("extruded"),n.fp64!==r.fp64&&this.state.attributeManager.invalidate("fp64")}},{key:"updateGeometry",value:function(e){var t=e.props,n=e.oldProps,r=e.changeFlags,i=r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getPolygon);if(i){var o=t.data.map(t.getPolygon);this.setState({polygonTesselator:new a.PolygonTesselator({polygons:o,IndexType:this.state.IndexType})}),this.state.attributeManager.invalidateAll()}(i||t.extruded!==n.extruded||t.fp64!==n.fp64)&&this.state.polygonTesselator.updatePositions({fp64:t.fp64,extruded:t.extruded})}},{key:"updateAttributes",value:function(e){var t=this.state,n=t.attributeManager,r=t.modelsChanged;if(n.update({data:e.data,numInstances:0,props:e,buffers:e,context:this,ignoreUnknownAttributes:!0}),r)this._updateAttributes(n.getAttributes()),this.setState({modelsChanged:!1});else{var i=n.getChangedAttributes({clearChangedFlags:!0});this._updateAttributes(i)}}},{key:"_updateAttributes",value:function(e){var t=this.state.modelsByName;for(var n in t){var r=t[n];"TOP"===n?r.setVertexCount(this.state.numVertex):r.setInstanceCount(this.state.numInstances);var i=g[n],o=v[n],a={};for(var s in i){var u=e[i[s]];u&&(a[s]=o?Object.assign({},u,o,{buffer:u.getBuffer()}):u)}r.setAttributes(a)}}},{key:"_getModels",value:function(e){var t=this.props,n=t.id,r=t.filled,i=t.extruded,a=t.wireframe,s={};return r&&(s.TOP=new o.Model(e,Object.assign({},this.getShaders(),{id:n+"-top",geometry:new o.Geometry({drawMode:o.GL.TRIANGLES,attributes:{vertexPositions:{size:2,isGeneric:!0,value:new Float32Array([0,1])},nextPositions:{size:3,isGeneric:!0,value:new Float32Array(3)},nextPositions64xyLow:{size:2,isGeneric:!0,value:new Float32Array(2)}}}),uniforms:{isSideVertex:0},vertexCount:0,isIndexed:!0,shaderCache:this.context.shaderCache}))),r&&i&&(s.SIDE=new o.Model(e,Object.assign({},this.getShaders(),{id:n+"-side",geometry:new o.Geometry({drawMode:o.GL.TRIANGLE_STRIP,vertexCount:4,attributes:{vertexPositions:{size:2,value:d}}}),uniforms:{isSideVertex:1},isInstanced:1,shaderCache:this.context.shaderCache}))),i&&a&&(s.WIRE=new o.Model(e,Object.assign({},this.getShaders(),{id:n+"-wire",geometry:new o.Geometry({drawMode:o.GL.LINE_STRIP,vertexCount:4,attributes:{vertexPositions:{size:2,value:p}}}),uniforms:{isSideVertex:1},isInstanced:1,shaderCache:this.context.shaderCache}))),{models:[s.WIRE,s.SIDE,s.TOP].filter(Boolean),modelsByName:s}}},{key:"calculateIndices",value:function(e){e.value=this.state.polygonTesselator.indices();var t=e.value.length/e.size;this.setState({numVertex:t})}},{key:"calculatePositions",value:function(e){e.value=this.state.polygonTesselator.positions();var t=e.value.length/e.size;this.setState({numInstances:t})}},{key:"calculatePositionsLow",value:function(e){var t=this.is64bitEnabled();e.isGeneric=!t,e.value=t?this.state.polygonTesselator.positions64xyLow():new Float32Array(2)}},{key:"calculateNextPositions",value:function(e){e.value=this.state.polygonTesselator.nextPositions()}},{key:"calculateNextPositionsLow",value:function(e){var t=this.is64bitEnabled();e.isGeneric=!t,e.value=t?this.state.polygonTesselator.nextPositions64xyLow():new Float32Array(2)}},{key:"calculateElevations",value:function(e){var t=this,n=this.props,r=n.extruded,i=n.getElevation;if(r&&"function"==typeof i)e.isGeneric=!1,e.value=this.state.polygonTesselator.elevations({getElevation:function(e){return i(t.props.data[e])}});else{var o=r?i:0;e.isGeneric=!0,e.value=new Float32Array([o])}}},{key:"calculateFillColors",value:function(e){var t=this;e.value=this.state.polygonTesselator.colors({key:"fillColors",getColor:function(e){return t.props.getFillColor(t.props.data[e])}})}},{key:"calculateLineColors",value:function(e){var t=this;e.value=this.state.polygonTesselator.colors({key:"lineColors",getColor:function(e){return t.props.getLineColor(t.props.data[e])}})}},{key:"calculatePickingColors",value:function(e){e.value=this.state.polygonTesselator.pickingColors()}}]),t}();t.default=y,y.layerName="SolidPolygonLayer",y.defaultProps=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(6),o=n(2),a=u(n(135)),s=u(n(134));function u(e){return e&&e.__esModule?e:{default:e}}var l=o.fp64.fp64LowPart,c=[255,0,255,255],f=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=!1;return e.hexagonVertices||e.radius&&Number.isFinite(e.angle)?e.hexagonVertices&&(!Array.isArray(e.hexagonVertices)||e.hexagonVertices.length<6)&&(i.log.once(0,"HexagonCellLayer: hexagonVertices needs to be an array of 6 points")(),n=!0):(i.log.once(0,"HexagonCellLayer: Either hexagonVertices or radius and angle are needed to calculate primitive hexagon.")(),n=!0),n&&(i.log.once(0,"Now using 1000 meter as default radius, 0 as default angle")(),e.radius=1e3,e.angle=0),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return function(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)}(t,i.Layer),r(t,[{key:"getShaders",value:function(){var e=this.is64bitEnabled()?"project64":"project32";return{vs:a.default,fs:s.default,modules:[e,"lighting","picking"]}}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:2,transition:!0,accessor:"getCentroid"},instanceElevations:{size:1,transition:!0,accessor:"getElevation"},instancePositions64xyLow:{size:2,accessor:"getCentroid",update:this.calculateInstancePositions64xyLow},instanceColors:{size:4,type:o.GL.UNSIGNED_BYTE,transition:!0,accessor:"getColor",defaultValue:c}})}},{key:"updateState",value:function(e){var n=e.props,r=e.oldProps,i=e.changeFlags;if(function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,r)}if("value"in i)return i.value;var a=i.get;return void 0!==a?a.call(r):void 0}(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateState",this).call(this,{props:n,oldProps:r,changeFlags:i}),n.fp64!==r.fp64){var o=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(o)}),this.state.attributeManager.invalidateAll()}n.hexagonVertices===r.hexagonVertices&&n.radius===r.radius&&n.angle===r.angle||this.updateRadiusAngle()}},{key:"updateRadiusAngle",value:function(){var e=this.props,t=e.angle,n=e.radius,r=this.props.hexagonVertices;if(Array.isArray(r)&&r.length>=6){var i=this.props.hexagonVertices,o=i[0],a=i[3],s=this.context.viewport.getDistanceScales().pixelsPerMeter,u=this.projectFlat(o),l=this.projectFlat(a),c=u[0]-l[0],f=u[1]-l[1],h=Math.sqrt(c*c+f*f);t=Math.acos(c/h)*-Math.sign(f)+Math.PI/2,n=h/2/s[0]}this.setState({angle:t,radius:n})}},{key:"getCylinderGeometry",value:function(e){return new o.CylinderGeometry({radius:e,topRadius:e,bottomRadius:e,topCap:!0,bottomCap:!0,height:1,verticalAxis:"z",nradial:6,nvertical:1})}},{key:"_getModel",value:function(e){return new o.Model(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:this.getCylinderGeometry(1),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"draw",value:function(e){var t=e.uniforms,n=this.props,r=n.elevationScale,i=n.extruded,o=n.coverage,a=this.state,s=a.radius,u=a.angle;this.state.model.render(Object.assign({},t,{radius:s,angle:u,extruded:i,coverage:o,elevationScale:r}))}},{key:"calculateInstancePositions64xyLow",value:function(e){var t=this.is64bitEnabled();if(e.isGeneric=!t,t){var n=this.props,r=n.data,i=n.getCentroid,o=e.value,a=0,s=!0,u=!1,c=void 0;try{for(var f,h=r[Symbol.iterator]();!(s=(f=h.next()).done);s=!0){var d=i(f.value);o[a++]=l(d[0]),o[a++]=l(d[1])}}catch(e){u=!0,c=e}finally{try{!s&&h.return&&h.return()}finally{if(u)throw c}}}else e.value=new Float32Array(2)}}]),t}();t.default=f,f.layerName="HexagonCellLayer",f.defaultProps={hexagonVertices:null,radius:null,angle:null,coverage:{type:"number",min:0,max:1,value:1},elevationScale:{type:"number",min:0,value:1},extruded:!0,fp64:!1,getCentroid:function(e){return e.centroid},getColor:function(e){return e.color},getElevation:function(e){return e.elevation},lightSettings:{}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(6),o=n(2),a=u(n(139)),s=u(n(138));function u(e){return e&&e.__esModule?e:{default:e}}var l=o.fp64.fp64LowPart,c=[255,0,255,255],f=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(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)}(t,i.Layer),r(t,[{key:"getShaders",value:function(){var e=this.is64bitEnabled()?"project64":"project32";return{vs:a.default,fs:s.default,modules:[e,"lighting","picking"]}}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instanceElevations:{size:1,transition:!0,accessor:"getElevation"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceColors:{size:4,type:o.GL.UNSIGNED_BYTE,transition:!0,accessor:"getColor",defaultValue:c}})}},{key:"updateState",value:function(e){var n=e.props,r=e.oldProps,i=e.changeFlags;if(function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,r)}if("value"in i)return i.value;var a=i.get;return void 0!==a?a.call(r):void 0}(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateState",this).call(this,{props:n,oldProps:r,changeFlags:i}),n.fp64!==r.fp64){var o=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(o)}),this.state.attributeManager.invalidateAll()}}},{key:"_getModel",value:function(e){return new o.Model(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new o.CubeGeometry,isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"draw",value:function(e){var t=e.uniforms,n=this.props,r=n.cellSize,i=n.extruded,o=n.elevationScale,a=n.coverage;this.state.model.render(Object.assign({},t,{cellSize:r,extruded:i,elevationScale:o,coverage:a}))}},{key:"calculateInstancePositions64xyLow",value:function(e){var t=this.is64bitEnabled();if(e.isGeneric=!t,t){var n=this.props,r=n.data,i=n.getPosition,o=e.value,a=0,s=!0,u=!1,c=void 0;try{for(var f,h=r[Symbol.iterator]();!(s=(f=h.next()).done);s=!0){var d=i(f.value);o[a++]=l(d[0]),o[a++]=l(d[1])}}catch(e){u=!0,c=e}finally{try{!s&&h.return&&h.return()}finally{if(u)throw c}}}else e.value=new Float32Array(2)}}]),t}();t.default=f,f.layerName="GridCellLayer",f.defaultProps={cellSize:{type:"number",min:0,max:1e3,value:1e3},coverage:{type:"number",min:0,max:1,value:1},elevationScale:{type:"number",min:0,value:1},extruded:!0,fp64:!1,getPosition:function(e){return e.position},getElevation:function(e){return e.elevation},getColor:function(e){return e.color},lightSettings:{}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(6),o=n(2),a=u(n(145)),s=u(n(144));function u(e){return e&&e.__esModule?e:{default:e}}var l=o.fp64.fp64LowPart,c=[0,0,0,255],f={radiusScale:1,radiusMinPixels:0,radiusMaxPixels:Number.MAX_SAFE_INTEGER,strokeWidth:1,outline:!1,fp64:!1,getPosition:function(e){return e.position},getRadius:function(e){return e.radius||1},getColor:function(e){return e.color||c}},h=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(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)}(t,i.Layer),r(t,[{key:"getShaders",value:function(e){var t=this.is64bitEnabled()?"project64":"project32";return{vs:a.default,fs:s.default,modules:[t,"picking"]}}},{key:"initializeState",value:function(){this.state.attributeManager.addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceRadius:{size:1,transition:!0,accessor:"getRadius",defaultValue:1},instanceColors:{size:4,transition:!0,type:o.GL.UNSIGNED_BYTE,accessor:"getColor",defaultValue:[0,0,0,255]}})}},{key:"updateState",value:function(e){var n=e.props,r=e.oldProps,i=e.changeFlags;if(function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,r)}if("value"in i)return i.value;var a=i.get;return void 0!==a?a.call(r):void 0}(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateState",this).call(this,{props:n,oldProps:r,changeFlags:i}),n.fp64!==r.fp64){var o=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(o)}),this.state.attributeManager.invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.props,r=n.radiusScale,i=n.radiusMinPixels,o=n.radiusMaxPixels,a=n.outline,s=n.strokeWidth;this.state.model.render(Object.assign({},t,{outline:a?1:0,strokeWidth:s,radiusScale:r,radiusMinPixels:i,radiusMaxPixels:o}))}},{key:"_getModel",value:function(e){return new o.Model(e,Object.assign(this.getShaders(),{id:this.props.id,geometry:new o.Geometry({drawMode:o.GL.TRIANGLE_FAN,attributes:{positions:new Float32Array([-1,-1,0,-1,1,0,1,1,0,1,-1,0])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateInstancePositions64xyLow",value:function(e){var t=this.is64bitEnabled();if(e.isGeneric=!t,t){var n=this.props,r=n.data,i=n.getPosition,o=e.value,a=0,s=!0,u=!1,c=void 0;try{for(var f,h=r[Symbol.iterator]();!(s=(f=h.next()).done);s=!0){var d=i(f.value);o[a++]=l(d[0]),o[a++]=l(d[1])}}catch(e){u=!0,c=e}finally{try{!s&&h.return&&h.return()}finally{if(u)throw c}}}else e.value=new Float32Array(2)}}]),t}();t.default=h,h.layerName="ScatterplotLayer",h.defaultProps=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(6),a=n(2),s=l(n(153)),u=l(n(152));function l(e){return e&&e.__esModule?e:{default:e}}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var f=a.fp64.fp64LowPart,h=[0,0,0,255],d=a.GL.LINEAR_MIPMAP_LINEAR,p=a.GL.LINEAR,v={iconAtlas:null,iconMapping:{},sizeScale:1,fp64:!1,getPosition:function(e){return e.position},getIcon:function(e){return e.icon},getColor:function(e){return e.color||h},getSize:function(e){return e.size||1},getAngle:function(e){return e.angle||0}},g=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(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)}(t,o.Layer),i(t,[{key:"getShaders",value:function(){var e=this.is64bitEnabled()?"project64":"project32";return{vs:s.default,fs:u.default,modules:[e,"picking"]}}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceOffsets:{size:2,accessor:"getIcon",update:this.calculateInstanceOffsets},instanceIconFrames:{size:4,accessor:"getIcon",update:this.calculateInstanceIconFrames},instanceColorModes:{size:1,type:a.GL.UNSIGNED_BYTE,accessor:"getIcon",update:this.calculateInstanceColorMode},instanceColors:{size:4,type:a.GL.UNSIGNED_BYTE,transition:!0,accessor:"getColor",defaultValue:h},instanceAngles:{size:1,transition:!0,accessor:"getAngle",defaultValue:0}})}},{key:"updateState",value:function(e){var n=this,i=e.oldProps,o=e.props,s=e.changeFlags;(function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,r)}if("value"in i)return i.value;var a=i.get;return void 0!==a?a.call(r):void 0})(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateState",this).call(this,{props:o,oldProps:i,changeFlags:s});var u,l=o.iconAtlas,f=o.iconMapping;if(i.iconMapping!==f){var h=this.getAttributeManager();h.invalidate("instanceOffsets"),h.invalidate("instanceIconFrames"),h.invalidate("instanceColorModes")}i.iconAtlas!==l&&(l instanceof a.Texture2D?(l.setParameters((c(u={},a.GL.TEXTURE_MIN_FILTER,d),c(u,a.GL.TEXTURE_MAG_FILTER,p),u)),this.setState({iconsTexture:l})):"string"==typeof l&&(0,a.loadTextures)(this.context.gl,{urls:[l]}).then(function(e){var t,i=r(e,1)[0];i.setParameters((c(t={},a.GL.TEXTURE_MIN_FILTER,d),c(t,a.GL.TEXTURE_MAG_FILTER,p),t)),n.setState({iconsTexture:i})}));if(o.fp64!==i.fp64){var v=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(v)}),this.state.attributeManager.invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.props.sizeScale,r=this.state.iconsTexture;r&&this.state.model.render(Object.assign({},t,{iconsTexture:r,iconsTextureDim:[r.width,r.height],sizeScale:n}))}},{key:"_getModel",value:function(e){return new a.Model(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new a.Geometry({drawMode:a.GL.TRIANGLE_FAN,attributes:{positions:new Float32Array([-1,-1,0,-1,1,0,1,1,0,1,-1,0])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateInstancePositions64xyLow",value:function(e){var t=this.is64bitEnabled();if(e.isGeneric=!t,t){var n=this.props,r=n.data,i=n.getPosition,o=e.value,a=0,s=!0,u=!1,l=void 0;try{for(var c,h=r[Symbol.iterator]();!(s=(c=h.next()).done);s=!0){var d=i(c.value);o[a++]=f(d[0]),o[a++]=f(d[1])}}catch(e){u=!0,l=e}finally{try{!s&&h.return&&h.return()}finally{if(u)throw l}}}else e.value=new Float32Array(2)}},{key:"calculateInstanceOffsets",value:function(e){var t=this.props,n=t.data,r=t.iconMapping,i=t.getIcon,o=e.value,a=0,s=!0,u=!1,l=void 0;try{for(var c,f=n[Symbol.iterator]();!(s=(c=f.next()).done);s=!0){var h=r[i(c.value)]||{};o[a++]=h.width/2-h.anchorX||0,o[a++]=h.height/2-h.anchorY||0}}catch(e){u=!0,l=e}finally{try{!s&&f.return&&f.return()}finally{if(u)throw l}}}},{key:"calculateInstanceColorMode",value:function(e){var t=this.props,n=t.data,r=t.iconMapping,i=t.getIcon,o=e.value,a=0,s=!0,u=!1,l=void 0;try{for(var c,f=n[Symbol.iterator]();!(s=(c=f.next()).done);s=!0){var h=i(c.value),d=r[h]&&r[h].mask;o[a++]=d?1:0}}catch(e){u=!0,l=e}finally{try{!s&&f.return&&f.return()}finally{if(u)throw l}}}},{key:"calculateInstanceIconFrames",value:function(e){var t=this.props,n=t.data,r=t.iconMapping,i=t.getIcon,o=e.value,a=0,s=!0,u=!1,l=void 0;try{for(var c,f=n[Symbol.iterator]();!(s=(c=f.next()).done);s=!0){var h=r[i(c.value)]||{};o[a++]=h.x||0,o[a++]=h.y||0,o[a++]=h.width||0,o[a++]=h.height||0}}catch(e){u=!0,l=e}finally{try{!s&&f.return&&f.return()}finally{if(u)throw l}}}}]),t}();t.default=g,g.layerName="IconLayer",g.defaultProps=v},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=v(n(7)),a=n(43),s=v(n(13)),u=v(n(18)),l=v(n(16)),c=v(n(17)),f=v(n(15)),h=v(n(27)),d=v(n(33)),p=v(n(26));function v(e){return e&&e.__esModule?e:{default:e}}var g=Math.PI/180,y=function(e){function t(e){var n=e.id,r=void 0===n?"orbit-viewport":n,i=e.width,o=e.height,v=e.distance,y=e.rotationX,_=void 0===y?0:y,m=e.rotationOrbit,b=void 0===m?0:m,E=e.orbitAxis,w=void 0===E?"Z":E,S=e.lookAt,P=void 0===S?[0,0,0]:S,T=e.up,A=void 0===T?[0,1,0]:T,x=e.fov,O=void 0===x?75:x,R=e.near,C=void 0===R?1:R,k=e.far,M=void 0===k?100:k,I=e.zoom,L=void 0===I?1:I;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var N=(0,h.default)([],(0,a.createMat4)(),-_/180*Math.PI);"Z"===w?(0,p.default)(N,N,-b/180*Math.PI):(0,d.default)(N,N,-b/180*Math.PI);var F=(0,a.createMat4)();(0,l.default)(F,F,[L,L,L]),(0,f.default)(F,F,[-P[0],-P[1],-P[2]]);var j=(0,u.default)([],[0,0,v],[0,0,0],A),D=O*g,B=i/o,U=(0,c.default)([],D,B,C,M),G=function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{id:r,viewMatrix:(0,s.default)(j,j,(0,s.default)(N,N,F)),projectionMatrix:U,width:i,height:o}));return G.width=i,G.height=o,G.distance=v,G.rotationX=_,G.rotationOrbit=b,G.orbitAxis=w,G.lookAt=P,G.up=A,G.fov=O,G.near=C,G.far=M,G.zoom=L,G}return function(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)}(t,o.default),i(t,[{key:"project",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).topLeft,n=void 0!==t&&t,i=(0,a.transformVector)(this.pixelProjectionMatrix,[].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(e),[1])),o=r(i,3),s=o[0],u=o[1],l=o[2];return[s,n?this.height-u:u,l]}},{key:"unproject",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).topLeft,n=void 0!==t&&t,i=r(e,3),o=i[0],s=i[1],u=i[2],l=n?this.height-s:s;return(0,a.transformVector)(this.pixelUnprojectionMatrix,[o,l,u,1])}},{key:"getDistance",value:function(e){var t=e.boundingBox,n=e.fov;return Math.max(t[0],t[1],t[2])/2/Math.tan(n/180*Math.PI/2)}},{key:"fitBounds",value:function(e){var n=this.width,r=this.height,i=this.rotationX,o=this.rotationOrbit,a=this.orbitAxis,s=this.lookAt,u=this.up,l=this.fov;return new t({width:n,height:r,rotationX:i,rotationOrbit:o,orbitAxis:a,up:u,fov:l,near:this.near,far:this.far,zoom:this.zoom,lookAt:s,distance:this.getDistance({boundingBox:e,fov:l})})}}]),t}();t.default=y,y.displayName="OrbitViewport"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lighting=t.project64=t.project=t.picking=t.fp64=t.fp32=void 0,t.initializeShaderModules=l;var r=n(2),i=u(n(20)),o=u(n(170)),a=u(n(60)),s=u(n(59));function u(e){return e&&e.__esModule?e:{default:e}}function l(){(0,r.registerShaderModules)([r.fp32,r.fp64,i.default,o.default,a.default,s.default,r.picking]),(0,r.setDefaultShaderModules)([i.default])}l(),t.fp32=r.fp32,t.fp64=r.fp64,t.picking=r.picking,t.project=i.default,t.project64=a.default,t.lighting=s.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=u(n(182)),i=u(n(20)),o=n(23),a=n(181),s=u(n(38));function u(e){return e&&e.__esModule?e:{default:e}}t.default={name:"lighting",dependencies:[i.default],vs:r.default,getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l;if(!e.lightSettings)return{};var t=e.lightSettings,n=t.numberOfLights,r=void 0===n?1:n,i=t.lightsPosition,a=void 0===i?c:i,s=t.lightsStrength,u=void 0===s?f:s,y=t.coordinateSystem,_=void 0===y?o.COORDINATE_SYSTEM.LNGLAT:y,m=t.coordinateOrigin,b=void 0===m?v:m,E=t.modelMatrix,w=void 0===E?null:E,S=t.ambientRatio,P=void 0===S?h:S,T=t.diffuseRatio,A=void 0===T?d:T,x=t.specularRatio,O=void 0===x?p:x;return{lighting_lightPositions:g({lightsPosition:a,numberOfLights:r,viewport:e.viewport,modelMatrix:w,coordinateSystem:e.coordinateSystem,coordinateOrigin:e.coordinateOrigin,fromCoordinateSystem:_,fromCoordinateOrigin:b}),lighting_lightStrengths:u,lighting_ambientRatio:P,lighting_diffuseRatio:A,lighting_specularRatio:O,lighting_numberOfLights:r}},deprecations:[{type:"function",old:"getLightWeight",new:"lighting_getLightWeight",deprecated:!0}]};var l={},c=[-122.45,37.75,8e3],f=[2,0],h=.4,d=.6,p=.8,v=[0,0,0],g=(0,s.default)(function(e){for(var t=e.lightsPosition,n=e.numberOfLights,r=e.viewport,i=e.modelMatrix,o=e.coordinateSystem,s=e.coordinateOrigin,u=e.fromCoordinateSystem,l=e.fromCoordinateOrigin,c={viewport:r,modelMatrix:i,coordinateSystem:o,coordinateOrigin:s,fromCoordinateSystem:u,fromCoordinateOrigin:l},f=[],h=0;h<n;h++){var d=(0,a.projectPosition)(t.slice(3*h,3*h+3),c);f[3*h]=d[0],f[3*h+1]=d[1],f[3*h+2]=d[2]}return f})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),i=s(n(20)),o=s(n(38)),a=s(n(183));function s(e){return e&&e.__esModule?e:{default:e}}var u=r.fp64.fp64ify,l=r.fp64.fp64ifyMatrix4;t.default={name:"project64",dependencies:[i.default,r.fp64],vs:a.default,getUniforms:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=e.project_uViewProjectionMatrix,n=e.project_uScale;if(t&&n)return c({project_uViewProjectionMatrix:t,project_uScale:n});return{}},deprecations:[{type:"uniform vec2",old:"projectionFP64[16]",new:"project_uViewProjectionMatrixFP64"},{type:"uniform vec2",old:"projectionScaleFP64",new:"project64_uScale"}]};var c=(0,o.default)(function(e){var t=e.project_uViewProjectionMatrix,n=e.project_uScale,r=l(t),i=u(n);return{project_uViewProjectionMatrixFP64:r,project64_uViewProjectionMatrix:r,project64_uScale:i}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(1),a=n(3),s=(r=a)&&r.__esModule?r:{default:r};var u=o.experimental.SphericalCoordinates,l={position:[0,0,0],lookAt:[0,0,0],up:[0,0,1],rotationX:0,rotationY:0,fov:50,near:1,far:100},c=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var n=t.width,r=t.height,i=t.position,a=void 0===i?l.position:i;(0,s.default)(Number.isFinite(n),"`width` must be supplied"),(0,s.default)(Number.isFinite(r),"`height` must be supplied"),this._viewportProps=this._applyConstraints(Object.assign({},t,{position:new o.Vector3(a)}))}return i(e,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getDirection",value:function(){return new u({bearing:this._viewportProps.bearing,pitch:this._viewportProps.pitch}).toVector3().normalize()}},{key:"getDirectionFromBearing",value:function(e){return new u({bearing:e,pitch:90}).toVector3().normalize()}},{key:"shortestPathFrom",value:function(e){return this._viewportProps}},{key:"_applyConstraints",value:function(e){return e}}]),e}();t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TRANSITION_EVENTS=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=s(n(39)),o=s(n(75)),a=s(n(3));function s(e){return e&&e.__esModule?e:{default:e}}var u=function(){},l=t.TRANSITION_EVENTS={BREAK:1,SNAP_TO_END:2,IGNORE:3},c={transitionDuration:0,transitionEasing:function(e){return e},transitionInterpolator:new i.default,transitionInterruption:l.BREAK,onTransitionStart:u,onTransitionInterrupt:u,onTransitionEnd:u},f=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),(0,a.default)(t),this.ControllerState=t,this.props=Object.assign({},c,n),this.animation=null,this.propsInTransition=null,this.transition=new o.default,this._onTransitionFrame=this._onTransitionFrame.bind(this),this._onTransitionUpdate=this._onTransitionUpdate.bind(this)}return r(e,[{key:"getViewportInTransition",value:function(){return this.propsInTransition}},{key:"processViewStateChange",value:function(e){var t=!1,n=this.props;if(e=Object.assign({},this.props,e),this.props=e,this._shouldIgnoreViewportChange(n,e))return t;if(this._isTransitionEnabled(e)){var r=Object.assign({},n,this.transition.interruption===l.SNAP_TO_END?this.transition.endProps:this.propsInTransition||n);this._triggerTransition(r,e),t=!0}else this.transition.cancel();return t}},{key:"_isTransitionEnabled",value:function(e){return e.transitionDuration>0&&e.transitionInterpolator}},{key:"_isUpdateDueToCurrentTransition",value:function(e){return!!this.transition.inProgress&&this.transition.interpolator.arePropsEqual(e,this.propsInTransition)}},{key:"_shouldIgnoreViewportChange",value:function(e,t){return this.transition.inProgress?this.transition.interruption===l.IGNORE||this._isUpdateDueToCurrentTransition(t):!this._isTransitionEnabled(t)||t.transitionInterpolator.arePropsEqual(e,t)}},{key:"_triggerTransition",value:function(e,t){(0,a.default)(this._isTransitionEnabled(t),"Transition is not enabled"),cancelAnimationFrame(this.animation);var n=new this.ControllerState(e),r=new this.ControllerState(t).shortestPathFrom(n),i=t.transitionInterpolator.initializeProps(e,r);this.propsInTransition={},this.transition.start({duration:t.transitionDuration,easing:t.transitionEasing,interpolator:t.transitionInterpolator,interruption:t.transitionInterruption,startProps:i.start,endProps:i.end,onStart:t.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(t.onTransitionInterrupt),onEnd:this._onTransitionEnd(t.onTransitionEnd)}),this._onTransitionFrame()}},{key:"_onTransitionFrame",value:function(){this.animation=requestAnimationFrame(this._onTransitionFrame),this.transition.update(Date.now())}},{key:"_onTransitionEnd",value:function(e){var t=this;return function(n){cancelAnimationFrame(t.animation),t.propsInTransition=null,e(n)}}},{key:"_onTransitionUpdate",value:function(e){var t=e.interpolator,n=e.startProps,r=e.endProps,i=e.time,o=t.interpolateProps(n,r,i);this.propsInTransition=new this.ControllerState(Object.assign({},this.props,o)).getViewportProps(),this.props.onViewportChange&&this.props.onViewportChange(this.propsInTransition,{inTransition:!0}),this.props.onViewStateChange&&this.props.onViewStateChange({viewState:this.propsInTransition},{inTransition:!0})}}]),e}();t.default=f,f.defaultProps=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(1),a=n(3),s=(r=a)&&r.__esModule?r:{default:r};var u=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Array.isArray(t)&&(t={compare:t,extract:t,required:t});var n=t,r=n.compare,i=n.extract,o=n.required;this._propsToCompare=r,this._propsToExtract=i,this._requiredProps=o}return i(e,[{key:"arePropsEqual",value:function(e,t){var n=!0,r=!1,i=void 0;try{for(var a,s=(this._propsToCompare||Object.keys(t))[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=a.value;if(!(0,o.equals)(e[u],t[u]))return!1}}catch(e){r=!0,i=e}finally{try{!n&&s.return&&s.return()}finally{if(r)throw i}}return!0}},{key:"initializeProps",value:function(e,t){var n=void 0;if(this._propsToExtract){var r={},i={},o=!0,a=!1,s=void 0;try{for(var u,l=this._propsToExtract[Symbol.iterator]();!(o=(u=l.next()).done);o=!0){var c=u.value;r[c]=e[c],i[c]=t[c]}}catch(e){a=!0,s=e}finally{try{!o&&l.return&&l.return()}finally{if(a)throw s}}n={start:r,end:i}}else n={start:e,end:t};return this._checkRequiredProps(n.start),this._checkRequiredProps(n.end),n}},{key:"interpolateProps",value:function(e,t,n){(0,s.default)(!1,"interpolateProps is not implemented")}},{key:"_checkRequiredProps",value:function(e){this._requiredProps&&this._requiredProps.forEach(function(t){var n=e[t];(0,s.default)(Number.isFinite(n)||Array.isArray(n),t+" is required for transition")})}}]),e}();t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.testExports=t.MAPBOX_LIMITS=void 0;var r=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(1),a=f(n(30)),s=f(n(61)),u=n(21),l=f(u),c=f(n(3));function f(e){return e&&e.__esModule?e:{default:e}}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(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 p(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)}var v=t.MAPBOX_LIMITS={minZoom:0,maxZoom:20,minPitch:0,maxPitch:60},g={pitch:0,bearing:0,altitude:1.5},y=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.width,r=e.height,i=e.latitude,o=e.longitude,a=e.zoom,s=e.bearing,u=void 0===s?g.bearing:s,l=e.pitch,f=void 0===l?g.pitch:l,p=e.altitude,y=void 0===p?g.altitude:p,_=e.maxZoom,m=void 0===_?v.maxZoom:_,b=e.minZoom,E=void 0===b?v.minZoom:b,w=e.maxPitch,S=void 0===w?v.maxPitch:w,P=e.minPitch,T=void 0===P?v.minPitch:P,A=e.startPanLngLat,x=e.startZoomLngLat,O=e.startBearing,R=e.startPitch,C=e.startZoom,k=e.option;h(this,t),(0,c.default)(Number.isFinite(o),"`longitude` must be supplied"),(0,c.default)(Number.isFinite(i),"`latitude` must be supplied"),(0,c.default)(Number.isFinite(a),"`zoom` must be supplied");var M=d(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{width:n,height:r,latitude:i,longitude:o,zoom:a,bearing:u,pitch:f,altitude:y,maxZoom:m,minZoom:E,maxPitch:S,minPitch:T,option:k}));return M._interactiveState={startPanLngLat:A,startZoomLngLat:x,startBearing:O,startPitch:R,startZoom:C},M}return p(t,s.default),i(t,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"panStart",value:function(e){var t=e.pos;return this._getUpdatedState({startPanLngLat:this._unproject(t)})}},{key:"pan",value:function(e){var t=e.pos,n=e.startPos,i=this._interactiveState.startPanLngLat||this._unproject(n);if(!i)return this;var o=this._calculateNewLngLat({startPanLngLat:i,pos:t}),a=r(o,2),s=a[0],u=a[1];return this._getUpdatedState({longitude:s,latitude:u})}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanLngLat:null})}},{key:"rotateStart",value:function(e){e.pos;return this._getUpdatedState({startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}},{key:"rotate",value:function(e){var t=e.deltaScaleX,n=void 0===t?0:t,r=e.deltaScaleY,i=void 0===r?0:r,o=this._interactiveState,a=o.startBearing,s=o.startPitch;if(!Number.isFinite(a)||!Number.isFinite(s))return this;var u=this._calculateNewPitchAndBearing({deltaScaleX:n,deltaScaleY:i,startBearing:a,startPitch:s}),l=u.pitch,c=u.bearing;return this._getUpdatedState({bearing:c,pitch:l})}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startBearing:null,startPitch:null})}},{key:"zoomStart",value:function(e){var t=e.pos;return this._getUpdatedState({startZoomLngLat:this._unproject(t),startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(e){var t=e.pos,n=e.startPos,i=e.scale;(0,c.default)(i>0,"`scale` must be a positive number");var o=this._interactiveState,a=o.startZoom,s=o.startZoomLngLat;Number.isFinite(a)||(a=this._viewportProps.zoom,s=this._unproject(n)||this._unproject(t)),(0,c.default)(s,"`startZoomLngLat` prop is required for zoom behavior to calculate where to position the map.");var u=this._calculateNewZoom({scale:i,startZoom:a}),f=new l.default(Object.assign({},this._viewportProps,{zoom:u})).getLocationAtPoint({lngLat:s,pos:t}),h=r(f,2),d=h[0],p=h[1];return this._getUpdatedState({zoom:u,longitude:d,latitude:p})}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}},{key:"zoomIn",value:function(){return this._zoomFromCenter(2)}},{key:"zoomOut",value:function(){return this._zoomFromCenter(.5)}},{key:"moveLeft",value:function(){return this._panFromCenter([100,0])}},{key:"moveRight",value:function(){return this._panFromCenter([-100,0])}},{key:"moveUp",value:function(){return this._panFromCenter([0,100])}},{key:"moveDown",value:function(){return this._panFromCenter([0,-100])}},{key:"rotateLeft",value:function(){return this._getUpdatedState({bearing:this._viewportProps.bearing-15})}},{key:"rotateRight",value:function(){return this._getUpdatedState({bearing:this._viewportProps.bearing+15})}},{key:"rotateUp",value:function(){return this._getUpdatedState({pitch:this._viewportProps.pitch+10})}},{key:"rotateDown",value:function(){return this._getUpdatedState({pitch:this._viewportProps.pitch-10})}},{key:"shortestPathFrom",value:function(e){var t=e.getViewportProps(),n=Object.assign({},this._viewportProps),r=n.bearing,i=n.longitude;return Math.abs(r-t.bearing)>180&&(n.bearing=r<0?r+360:r-360),Math.abs(i-t.longitude)>180&&(n.longitude=i<0?i+360:i-360),n}},{key:"_zoomFromCenter",value:function(e){var t=this._viewportProps,n=t.width,r=t.height;return this.zoom({pos:[n/2,r/2],scale:e})}},{key:"_panFromCenter",value:function(e){var t=this._viewportProps,n=t.width,r=t.height;return this.pan({startPos:[n/2,r/2],pos:[n/2+e[0],r/2+e[1]]})}},{key:"_getUpdatedState",value:function(e){return new t(Object.assign({},this._viewportProps,this._interactiveState,e))}},{key:"_applyConstraints",value:function(e){var t=e.maxZoom,n=e.minZoom,r=e.zoom;e.zoom=(0,o.clamp)(r,n,t);var i=e.maxPitch,a=e.minPitch,s=e.pitch;return e.pitch=(0,o.clamp)(s,a,i),Object.assign(e,(0,u.normalizeViewportProps)(e)),e}},{key:"_unproject",value:function(e){var t=new l.default(this._viewportProps);return e&&t.unproject(e)}},{key:"_calculateNewLngLat",value:function(e){var t=e.startPanLngLat,n=e.pos;return new l.default(this._viewportProps).getMapCenterByLngLatPosition({lngLat:t,pos:n})}},{key:"_calculateNewZoom",value:function(e){var t=e.scale,n=e.startZoom,r=this._viewportProps,i=r.maxZoom,a=r.minZoom,s=n+Math.log2(t);return(0,o.clamp)(s,a,i)}},{key:"_calculateNewPitchAndBearing",value:function(e){var t=e.deltaScaleX,n=e.deltaScaleY,r=e.startBearing,i=e.startPitch;n=(0,o.clamp)(n,-1,1);var a=this._viewportProps,s=a.minPitch,u=a.maxPitch,l=i;return n>0?l=i+n*(u-i):n<0&&(l=i-n*(s-i)),{pitch:l,bearing:r+180*t}}}]),t}(),_=function(e){function t(e){h(this,t);var n=d(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,y,e));return n.invertPan=!0,n}return p(t,a.default),t}();t.default=_;t.testExports={MapState:y}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var i=function(){function e(t){var n=t.gl,r=t.layerManager;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.gl=n,this.layerManager=r,this._effects=[]}return r(e,[{key:"addEffect",value:function(e){this._effects.push(e),this._sortEffects(),e.initialize({gl:this.gl,layerManager:this.layerManager})}},{key:"removeEffect",value:function(e){var t=this._effects.indexOf(e);return t>=0&&(e.finalize({gl:this.gl,layerManager:this.layerManager}),this._effects.splice(t,1),!0)}},{key:"preDraw",value:function(){var e=!0,t=!1,n=void 0;try{for(var r,i=this._effects[Symbol.iterator]();!(e=(r=i.next()).done);e=!0){var o=r.value;o.needsRedraw&&o.preDraw({gl:this.gl,layerManager:this.layerManager})}}catch(e){t=!0,n=e}finally{try{!e&&i.return&&i.return()}finally{if(t)throw n}}}},{key:"draw",value:function(){var e=!0,t=!1,n=void 0;try{for(var r,i=this._effects[Symbol.iterator]();!(e=(r=i.next()).done);e=!0){var o=r.value;o.needsRedraw&&o.draw({gl:this.gl,layerManager:this.layerManager})}}catch(e){t=!0,n=e}finally{try{!e&&i.return&&i.return()}finally{if(t)throw n}}}},{key:"_sortEffects",value:function(){this._effects.sort(function(e,t){return e.priority>t.priority?-1:e.priority<t.priority?1:e.count-t.count})}}]),e}();t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(12)),i=o(n(41));function o(e){return e&&e.__esModule?e:{default:e}}var a=function(e){function t(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,Object.assign({},e,{type:i.default})))}return function(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)}(t,r.default),t}();t.default=a,a.displayName="MapView"},function(e,t){e.exports=function(e,t){return e[0]=-t[0],e[1]=-t[1],e}},function(e,t){e.exports=function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.default=function(e){var t=e.width,n=e.height,a=e.bounds,s=e.padding,u=void 0===s?0:s,l=e.offset,c=void 0===l?[0,0]:l,f=r(a,2),h=r(f[0],2),d=h[0],p=h[1],v=r(f[1],2),g=v[0],y=v[1];if(Number.isFinite(u)){var _=u;u={top:_,bottom:_,left:_,right:_}}else(0,o.default)(Number.isFinite(u.top)&&Number.isFinite(u.bottom)&&Number.isFinite(u.left)&&Number.isFinite(u.right));var m=new i.default({width:t,height:n,longitude:0,latitude:0,zoom:0}),b=m.project([d,y]),E=m.project([g,p]),w=[Math.abs(E[0]-b[0]),Math.abs(E[1]-b[1])],S=[t-u.left-u.right-2*Math.abs(c[0]),n-u.top-u.bottom-2*Math.abs(c[1])];(0,o.default)(S[0]>0&&S[1]>0);var P=S[0]/w[0],T=S[1]/w[1],A=(u.right-u.left)/2/P,x=(u.bottom-u.top)/2/T,O=[(E[0]+b[0])/2+A,(E[1]+b[1])/2+x],R=m.unproject(O),C=m.zoom+Math.log2(Math.abs(Math.min(P,T)));return{longitude:R[0],latitude:R[1],zoom:C}};var i=a(n(42)),o=a(n(70));function a(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(!e)throw new Error("viewport-mercator-project: assertion failed.")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deepEqual=function e(t,n){return Object.keys(t).some(function(r){return Array.isArray(t[r])&&Array.isArray(n[r])?e(t[r],n[r]):t[r]===n[r]})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPixelRatio=void 0,t.drawLayers=f,t.drawPickingBuffer=function(e,t){var n=t.layers,i=t.viewports,o=t.onViewportActive,a=t.useDevicePixels,s=t.pickingFBO,u=t.deviceRect,l=u.x,c=u.y,h=u.width,d=u.height,p=t.layerFilter,v=void 0===p?null:p,g=t.redrawReason,y=void 0===g?"":g;return(0,r.withParameters)(e,{framebuffer:s,scissorTest:!0,scissor:[l,c,h,d],clearColor:[0,0,0,0]},function(){f(e,{layers:n,viewports:i,onViewportActive:o,useDevicePixels:a,drawPickingColors:!0,layerFilter:v,pass:"picking",redrawReason:y,parameters:{blend:!0,blendFunc:[e.ONE,e.ZERO,e.CONSTANT_ALPHA,e.ZERO],blendEquation:e.FUNC_ADD,blendColor:[0,0,0,0]}})})};var r=n(2),i=a(n(5)),o=a(n(3));function a(e){return e&&e.__esModule?e:{default:e}}var s=2,u=0,l=t.getPixelRatio=function(e){var t=e.useDevicePixels;return(0,o.default)("boolean"==typeof t,"Invalid useDevicePixels"),t&&"undefined"!=typeof window?window.devicePixelRatio:1},c=function(e,t){var n=t.viewport,r=t.pixelRatio,i=e.canvas?e.canvas.clientHeight:100,o=n;return[o.x*r,(i-o.y-o.height)*r,o.width*r,o.height*r]};function f(e,t){var n=t.layers,o=t.viewports,a=t.onViewportActive,f=t.useDevicePixels,h=t.drawPickingColors,d=void 0!==h&&h,p=t.deviceRect,v=void 0===p?null:p,g=t.parameters,y=void 0===g?{}:g,_=t.layerFilter,m=void 0===_?null:_,b=t.pass,E=void 0===b?"draw":b,w=t.redrawReason,S=void 0===w?"":w,P=t.stats;!function(e,t){t.useDevicePixels;var n=e.drawingBufferWidth,i=e.drawingBufferHeight;(0,r.withParameters)(e,{viewport:[0,0,n,i]},function(){e.clear(r.GL.COLOR_BUFFER_BIT|r.GL.DEPTH_BUFFER_BIT)})}(e,{useDevicePixels:f}),o.forEach(function(t,o){var h=function(e){return e.viewport?e.viewport:e}(t);a(h),function(e,t){var n=t.layers,o=t.viewport,a=t.useDevicePixels,f=t.drawPickingColors,h=void 0!==f&&f,d=(t.deviceRect,t.parameters),p=void 0===d?{}:d,v=t.layerFilter,g=t.pass,y=void 0===g?"draw":g,_=t.redrawReason,m=void 0===_?"":_,b=t.stats,E=l({useDevicePixels:a}),w=c(e,{viewport:o,pixelRatio:E}),S={totalCount:n.length,visibleCount:0,compositeCount:0,pickableCount:0};(0,r.setParameters)(e,p||{}),n.forEach(function(t,n){var r=t.props.visible;h&&(r=r&&t.props.pickable),r&&v&&(r=v({layer:t,viewport:o,isPicking:h})),r&&t.props.pickable&&S.pickableCount++,t.isComposite&&S.compositeCount++,r&&(t.isComposite||S.visibleCount++,function(e){e.gl;var t=e.layer,n=e.layerIndex,r=e.drawPickingColors,i=e.pixelRatio,o=e.glViewport,a=e.parameters,s=Object.assign(Object.create(t.props),{viewport:t.context.viewport,pickingActive:r?1:0,devicePixelRatio:i}),u=Object.assign({},t.context.uniforms,{layerIndex:n}),l=Object.assign({},t.props.parameters||{},a);Object.assign(l,{viewport:o}),r?Object.assign(l,{blendColor:[0,0,0,(n+1)/255]}):Object.assign(s,function(e){if(Number.isInteger(e.props.highlightedObjectIndex)){var t=e.props.highlightedObjectIndex>=0?e.encodePickingColor(e.props.highlightedObjectIndex):null;return{pickingSelectedColor:t}}return null}(t));t.drawLayer({moduleParameters:s,uniforms:u,parameters:l})}({gl:e,layer:t,layerIndex:n,drawPickingColors:h,pixelRatio:E,glViewport:w,parameters:p}))}),u++,function(e){var t=e.renderStats,n=e.pass,r=e.redrawReason,o=e.stats;if(i.default.priority>=s){var a=t.totalCount,l=t.visibleCount,c=t.compositeCount,f=t.pickableCount,h=a-c,d=h-l,p="";p+="RENDER #"+u+" "+l+" (of "+a+" layers) to "+n+" because "+r+" ",i.default.priority>s&&(p+="("+d+" hidden, "+c+" composite "+f+" pickable)"),i.default.log(s,p)(),o&&o.increment("redraw layers",l)}}({renderStats:S,pass:y,redrawReason:m,stats:b})}(e,{layers:n,viewport:h,useDevicePixels:f,drawPickingColors:d,deviceRect:v,parameters:y,layerFilter:m,pass:E,redrawReason:S,stats:P})})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=a(n(5)),o=a(n(3));function a(e){return e&&e.__esModule?e:{default:e}}var s=Object.freeze({}),u=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.component=t,this.asyncProps={},this.onAsyncPropUpdated=function(){},this.oldProps=s,this.oldAsyncProps=null}return r(e,[{key:"getOldProps",value:function(){return this.oldAsyncProps||this.oldProps}},{key:"resetOldProps",value:function(){this.oldAsyncProps=null,this.oldProps=this.component.props}},{key:"freezeAsyncOldProps",value:function(){if(!this.oldAsyncProps)for(var e in this.oldProps=this.oldProps||this.component.props,this.oldAsyncProps={},this.oldProps)this.oldAsyncProps[e]=this.oldProps[e]}},{key:"hasAsyncProp",value:function(e){return e in this.asyncProps}},{key:"getAsyncProp",value:function(e){var t=this.asyncProps[e];return t&&t.resolvedValue}},{key:"isAsyncPropLoading",value:function(e){var t=this.asyncProps[e];return Boolean(t&&t.pendingLoadCount>0&&t.pendingLoadCount!==t.resolvedLoadCount)}},{key:"setAsyncProps",value:function(e){var t=e._asyncPropResolvedValues||{},n=e._asyncPropOriginalValues||e,r=e._asyncPropDefaultValues||{};for(var i in t){var o=t[i];this._createAsyncPropData(i,o,r[i]),this._updateAsyncProp(i,o)}for(var a in n){var s=n[a];this._createAsyncPropData(a,s,r[a]),this._updateAsyncProp(a,s)}}},{key:"_updateAsyncProp",value:function(e,t){if(this._didAsyncInputValueChange(e,t)){if("string"==typeof t)t=(0,this.layer.props.fetch)(t);t instanceof Promise?this._watchPromise(e,t):this._setPropValue(e,t)}}},{key:"_didAsyncInputValueChange",value:function(e,t){var n=this.asyncProps[e];return t!==n.lastValue&&(n.lastValue=t,!0)}},{key:"_setPropValue",value:function(e,t){var n=this.asyncProps[e];n.value=t,n.resolvedValue=t,n.pendingLoadCount++,n.resolvedLoadCount=n.pendingLoadCount}},{key:"_setAsyncPropValue",value:function(e,t,n){var r=this.asyncProps[e];r&&n>=r.resolvedLoadCount&&((0,o.default)(void 0!==t),this.freezeAsyncOldProps(),t=this._postProcessValue(e,t),r.resolvedValue=t,r.resolvedLoadCount=n,this.onAsyncPropUpdated(e,t))}},{key:"_watchPromise",value:function(e,t){var n=this,r=this.asyncProps[e];r.pendingLoadCount++;var o=r.pendingLoadCount;t.then(function(t){return n._setAsyncPropValue(e,t,o)}).catch(function(e){return i.default.error(e)})}},{key:"_postProcessValue",value:function(e,t){var n=(this.component?this.component.props:{}).dataTransform;return"data"===e&&n&&(t=n(t)),t}},{key:"_createAsyncPropData",value:function(e,t,n){this.asyncProps[e]||(this.asyncProps[e]={lastValue:null,resolvedValue:n,pendingLoadCount:0,resolvedLoadCount:0})}}]),e}();t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.LIFECYCLE={NO_STATE:"Awaiting state",MATCHED:"Matched. State transferred from previous layer",INITIALIZED:"Initialized",AWAITING_GC:"Discarded. Awaiting garbage collection",AWAITING_FINALIZATION:"No longer matched. Awaiting garbage collection",FINALIZED:"Finalized! Awaiting garbage collection"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var i=t.TRANSITION_STATE={NONE:"none",PENDING:"pending",IN_PROGRESS:"in_progress",ENDED:"ended"};function o(){}var a=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._startTime=null,this._state=i.NONE,this.duration=1,this.easing=function(e){return e},this.onStart=o,this.onUpdate=o,this.onInterrupt=o,this.onEnd=o,Object.assign(this,t)}return r(e,[{key:"start",value:function(e){this.inProgress&&this.onInterrupt(this),Object.assign(this,e),this._setState(i.PENDING)}},{key:"cancel",value:function(){this.inProgress&&(this.onInterrupt(this),this._setState(i.NONE))}},{key:"update",value:function(e){if(this.state===i.PENDING&&(this._startTime=e,this._setState(i.IN_PROGRESS)),this.state===i.IN_PROGRESS){var t=!1,n=(e-this._startTime)/this.duration;return n>=1&&(n=1,t=!0),this.time=this.easing(n),this.onUpdate(this),t&&this._setState(i.ENDED),!0}return!1}},{key:"_setState",value:function(e){if(this._state!==e)switch(this._state=e,e){case i.PENDING:this.onStart(this);break;case i.ENDED:this.onEnd(this)}}},{key:"state",get:function(){return this._state}},{key:"inProgress",get:function(){return this._state===i.PENDING||this._state===i.IN_PROGRESS}}]),e}();t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=u(n(205)),o=u(n(5)),a=u(n(3)),s=u(n(204));function u(e){return e&&e.__esModule?e:{default:e}}function l(){}var c={savedMessages:null,timeStart:null,onLog:function(e){var t=e.level,n=e.message;o.default.log(t,n)()},onUpdateStart:function(e){e.level,e.numInstances;c.savedMessages=[],c.timeStart=new Date},onUpdate:function(e){e.level;var t=e.message;c.savedMessages&&c.savedMessages.push(t)},onUpdateEnd:function(e){var t=e.level,n=e.id,r=e.numInstances,i=Math.round(new Date-c.timeStart)+"ms";o.default.group(t,"Updated attributes for "+r+" instances in "+n+" in "+i,{collapsed:!0})();var a=!0,s=!1,u=void 0;try{for(var l,f=c.savedMessages[Symbol.iterator]();!(a=(l=f.next()).done);a=!0){var h=l.value;o.default.log(t,h)()}}catch(e){s=!0,u=e}finally{try{!a&&f.return&&f.return()}finally{if(s)throw u}}o.default.groupEnd(t,"Updated attributes for "+r+" instances in "+n+" in "+i)(),c.savedMessages=null}},f=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.id,i=void 0===r?"attribute-manager":r,o=n.stats;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=i,this.gl=t,this.attributes={},this.updateTriggers={},this.accessors={},this.needsRedraw=!0,this.userData={},this.stats=o,this.attributeTransitionManager=new s.default(t,{id:i+"-transitions"}),Object.seal(this)}return r(e,null,[{key:"setDefaultLogFunctions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.onLog,n=e.onUpdateStart,r=e.onUpdate,i=e.onUpdateEnd;void 0!==t&&(c.onLog=t||l),void 0!==n&&(c.onUpdateStart=n||l),void 0!==r&&(c.onUpdate=r||l),void 0!==i&&(c.onUpdateEnd=i||l)}}]),r(e,[{key:"finalize",value:function(){for(var e in this.attributes)this.attributes[e].delete();this.attributeTransitionManager.finalize()}},{key:"getNeedsRedraw",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).clearRedrawFlags,t=void 0!==e&&e,n=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!t,n&&this.id}},{key:"setNeedsRedraw",value:function(){!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.needsRedraw=!0,this}},{key:"add",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._add(e,t)}},{key:"addInstanced",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._add(e,t,{instanced:1})}},{key:"remove",value:function(e){for(var t=0;t<e.length;t++){var n=e[t];void 0!==this.attributes[n]&&(this.attributes[n].delete(),delete this.attributes[n])}}},{key:"invalidate",value:function(e){var t=this._invalidateTrigger(e);c.onLog({level:3,message:"invalidated attributes "+t+" ("+e+") for "+this.id})}},{key:"invalidateAll",value:function(){for(var e in this.attributes)this.attributes[e].setNeedsUpdate();c.onLog({level:3,message:"invalidated all attributes for "+this.id})}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.data,n=e.numInstances,r=e.transitions,i=e.props,o=void 0===i?{}:i,a=e.buffers,s=void 0===a?{}:a,u=e.context,l=void 0===u?{}:u,f=e.ignoreUnknownAttributes,h=void 0!==f&&f;this._checkExternalBuffers({buffers:s,ignoreUnknownAttributes:h}),this._setExternalBuffers(s),this._setGenericAttributes({data:t,props:o,context:l}),this._checkIfBuffersNeedUpdating({numInstances:n})&&(c.onUpdateStart({level:2,id:this.id,numInstances:n}),this.stats&&this.stats.timeStart("attribute updates",this.id),this._allocateBuffers({numInstances:n,data:t,props:o,context:l}),this._updateBuffers({numInstances:n,data:t,props:o,context:l}),this.stats&&this.stats.timeEnd("attribute updates",this.id),c.onUpdateEnd({level:2,id:this.id,numInstances:n})),this.attributeTransitionManager.update({attributes:this.attributes,numInstances:n,transitions:r})}},{key:"updateTransition",value:function(){var e=this.attributeTransitionManager.setCurrentTime(Date.now());return this.needsRedraw=this.needsRedraw||e,e}},{key:"getAttributes",value:function(){return this.attributes}},{key:"getChangedAttributes",value:function(e){var t=e.transition,n=void 0!==t&&t,r=(e.clearChangedFlags,this.attributes),i=this.attributeTransitionManager;if(n)return i.getAttributes();var o={};for(var a in r){var s=r[a];s.needsRedraw({clearChangedFlags:!0})&&(i.hasAttribute(a)||(o[a]=s))}return o}},{key:"getAccessors",value:function(){return this.updateTriggers}},{key:"_add",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t&&o.default.removed("AttributeManager.add({updaters}) - updater map no longer supported");var r={};for(var a in e){var s=e[a];r[a]=new i.default(this.gl,Object.assign({},s,{id:a,isGeneric:s.isGeneric||!1,isIndexed:s.isIndexed||s.elements,size:s.elements?1:s.size,value:s.value||null,instanced:s.instanced||n.instanced}))}Object.assign(this.attributes,r),this._mapUpdateTriggersToAttributes()}},{key:"_mapUpdateTriggersToAttributes",value:function(){var e=this,t={},n=function(n){e.attributes[n].getUpdateTriggers().forEach(function(e){t[e]||(t[e]=[]),t[e].push(n)})};for(var r in this.attributes)n(r);this.updateTriggers=t}},{key:"_invalidateTrigger",value:function(e){var t=this.attributes,n=this.updateTriggers[e];if(n)n.forEach(function(e){var n=t[e];n&&n.setNeedsUpdate()});else{var r="invalidating non-existent trigger "+e+" for "+this.id+"\n";r+="Valid triggers: "+Object.keys(t).join(", "),o.default.warn(r,n)()}return n}},{key:"_setExternalBuffers",value:function(e){for(var t in this.attributes){var n=this.attributes[t],r=e[t];n.setExternalBuffer(r,this.numInstances),this.needsRedraw|=n.needsRedraw()}}},{key:"_checkExternalBuffers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.buffers,n=void 0===t?{}:t,r=e.ignoreUnknownAttributes,i=void 0!==r&&r,o=this.attributes;for(var a in n){if(!o[a]&&!i)throw new Error("Unknown attribute prop "+a)}}},{key:"_checkIfBuffersNeedUpdating",value:function(e){var t=e.numInstances;(0,a.default)(void 0!==t,"numInstances not defined");var n=!1;for(var r in this.attributes){var i=this.attributes[r];i.setNumInstances(t),n=n||i.needsUpdate()}return n}},{key:"_setGenericAttributes",value:function(e){e.data;var t=e.props,n=(e.context,this.attributes);for(var r in n){n[r].setGenericValue({props:t})}}},{key:"_allocateBuffers",value:function(e){var t=e.numInstances,n=(e.data,e.props,e.context,this.attributes);for(var r in n){n[r].allocate(t)&&c.onUpdate({level:3,message:r+" allocated "+t,id:this.id})}}},{key:"_updateBuffers",value:function(e){var t=e.numInstances,n=e.data,r=e.props,i=e.context;for(var o in this.attributes){var a=this.attributes[o],s=Date.now();if(a.updateBuffer({numInstances:t,data:n,props:r,context:i})){this.needsRedraw=!0;var u=Math.round(Date.now()-s);c.onUpdate({level:3,message:o+" updated "+t+" in "+u+"ms"})}}}}]),e}();t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=y(n(3)),o=n(2),a=y(n(11)),s=y(n(45)),u=n(72),l=n(196),c=n(74),f=y(n(195)),h=y(n(66)),d=y(n(5)),p=n(22),v=n(28),g=n(44);function y(e){return e&&e.__esModule?e:{default:e}}var _=Object.seal({layerManager:null,gl:null,useDevicePixels:!0,stats:null,viewport:null,shaderCache:null,pickingFBO:null,lastPickedInfo:{index:-1,layerId:null},userData:{}}),m=function(e){return e instanceof s.default?""+e:e?"invalid":"null"},b=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.eventManager,i=n.stats;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.lastRenderedLayers=[],this.layers=[],this.context=Object.assign({},_,{layerManager:this,gl:t,shaderCache:new o.ShaderCache({gl:t,_cachePrograms:!0}),stats:i||new v.Stats({id:"deck.gl"})}),this.viewManager=new f.default,this.layerFilter=null,this.drawPickingColors=!1,this._needsRedraw="Initial render",this._needsUpdate=!1,this._pickingRadius=0,this._eventManager=null,this._onLayerClick=null,this._onLayerHover=null,this._onClick=this._onClick.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._onPointerLeave=this._onPointerLeave.bind(this),this._pickAndCallback=this._pickAndCallback.bind(this),this._initSeer=this._initSeer.bind(this),this._editSeer=this._editSeer.bind(this),this.width=100,this.height=100,Object.seal(this),(0,g.seerInitListener)(this._initSeer),(0,g.layerEditListener)(this._editSeer),r&&this._initEventHandling(r),this.setViews()}return r(e,[{key:"finalize",value:function(){a.default.removeListener(this._initSeer),a.default.removeListener(this._editSeer)}},{key:"needsRedraw",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).clearRedrawFlags,t=void 0===e||e;return this._checkIfNeedsRedraw(t)}},{key:"needsUpdate",value:function(){return this._needsUpdate}},{key:"setNeedsRedraw",value:function(e){this._needsRedraw=this._needsRedraw||e}},{key:"setNeedsUpdate",value:function(e){this._needsUpdate=this._needsUpdate||e}},{key:"getLayers",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).layerIds,t=void 0===e?null:e;return t?this.layers.filter(function(e){return t.find(function(t){return 0===e.id.indexOf(t)})}):this.layers}},{key:"getViews",value:function(){return this.viewManager.views}},{key:"getViewports",value:function(){var e=this.viewManager.getViewports();return e.length&&this._activateViewport(e[0]),e}},{key:"setProps",value:function(e){"eventManager"in e&&this._initEventHandling(e.eventManager),("pickingRadius"in e||"onLayerClick"in e||"onLayerHover"in e)&&this._setEventHandlingParameters(e),("width"in e||"height"in e)&&(this.viewManager.setSize(e.width,e.height),this.width=e.width,this.height=e.height),"views"in e&&this.setViews(e.views),"viewState"in e&&this.viewManager.setViewState(e.viewState),"layers"in e&&this.setLayers(e.layers),"layerFilter"in e&&this.layerFilter!==e.layerFilter&&(this.layerFilter=e.layerFilter,this.setNeedsRedraw("layerFilter changed")),"drawPickingColors"in e&&e.drawPickingColors!==this.drawPickingColors&&(this.drawPickingColors=e.drawPickingColors,this.setNeedsRedraw("drawPickingColors changed")),"userData"in e&&(this.context.userData=e.userData),"useDevicePixels"in e&&(this.context.useDevicePixels=e.useDevicePixels)}},{key:"setViews",value:function(e){e&&0!==e.length||(e=[new h.default({id:"default-view"})]),this.viewManager.setViews(e)}},{key:"setLayers",value:function(e){if(this.getViewports(),(0,i.default)(this.context.viewport,"LayerManager.updateLayers: viewport not set"),e===this.lastRenderedLayers)return d.default.log(3,"Ignoring layer update due to layer array not changed")(),this;this.lastRenderedLayers=e,e=(0,p.flatten)(e,{filter:Boolean});var t=!0,n=!1,r=void 0;try{for(var o,a=e[Symbol.iterator]();!(t=(o=a.next()).done);t=!0){o.value.context=this.context}}catch(e){n=!0,r=e}finally{try{!t&&a.return&&a.return()}finally{if(n)throw r}}var s=this._updateLayers({oldLayers:this.layers,newLayers:e}),u=s.error,l=s.generatedLayers;if(this.layers=l,u)throw u;return this}},{key:"updateLayers",value:function(){var e=this.needsUpdate();e&&(this.setNeedsRedraw("updating layers: "+e),this.setLayers([].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(this.lastRenderedLayers))))}},{key:"drawLayers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.pass,n=void 0===t?"render to screen":t,r=e.redrawReason,i=void 0===r?"unknown reason":r,o=this.drawPickingColors,a=this.context,s=a.gl,l=a.useDevicePixels;(0,u.drawLayers)(s,{layers:this.layers,viewports:this.getViewports(),onViewportActive:this._activateViewport.bind(this),useDevicePixels:l,drawPickingColors:o,pass:n,layerFilter:this.layerFilter,redrawReason:i})}},{key:"pickObject",value:function(e){var t=e.x,n=e.y,r=e.mode,i=e.radius,o=void 0===i?0:i,a=e.layerIds,s=e.layerFilter,u=e.depth,c=void 0===u?1:u,f=this.context,h=f.gl,d=f.useDevicePixels,p=this.getLayers({layerIds:a});return(0,l.pickObject)(h,{x:t,y:n,radius:o,layers:p,mode:r,layerFilter:s,depth:c,viewports:this.getViewports(),onViewportActive:this._activateViewport.bind(this),pickingFBO:this._getPickingBuffer(),lastPickedInfo:this.context.lastPickedInfo,useDevicePixels:d})}},{key:"pickObjects",value:function(e){var t=e.x,n=e.y,r=e.width,i=e.height,o=e.layerIds,a=e.layerFilter,s=this.context,u=s.gl,c=s.useDevicePixels,f=this.getLayers({layerIds:o});return(0,l.pickVisibleObjects)(u,{x:t,y:n,width:r,height:i,layers:f,layerFilter:a,mode:"pickObjects",viewports:this.getViewports(),onViewportActive:this._activateViewport.bind(this),pickingFBO:this._getPickingBuffer(),useDevicePixels:c})}},{key:"setParameters",value:function(e){return this.setProps(e)}},{key:"setSize",value:function(e,t){this.setProps({width:e,height:t})}},{key:"setViewState",value:function(e){this.setProps({viewState:e})}},{key:"setViewports",value:function(e){return d.default.deprecated("setViewport","setViews")(),this.setViews(e),this}},{key:"setViewport",value:function(e){return d.default.deprecated("setViewport","setViews")(),this.setViews([e]),this}},{key:"_checkIfNeedsRedraw",value:function(e){var t=this._needsRedraw;e&&(this._needsRedraw=!1),t=t||this.viewManager.needsRedraw();var n=!0,r=!1,i=void 0;try{for(var o,a=this.layers[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value.getNeedsRedraw({clearRedrawFlags:e});t=t||s}}catch(e){r=!0,i=e}finally{try{!n&&a.return&&a.return()}finally{if(r)throw i}}return t}},{key:"_initEventHandling",value:function(e){this._eventManager=e,this._eventManager.on({click:this._onClick,pointermove:this._onPointerMove,pointerleave:this._onPointerLeave})}},{key:"_setEventHandlingParameters",value:function(e){var t=e.pickingRadius,n=e.onLayerClick,r=e.onLayerHover;isNaN(t)||(this._pickingRadius=t),void 0!==n&&(this._onLayerClick=n),void 0!==r&&(this._onLayerHover=r),this._validateEventHandling()}},{key:"_activateViewport",value:function(e){var t=this.context.viewport;if(!t||!e.equals(t)){d.default.log(4,"Viewport changed",e)(),this.context.viewport=e;var n=!0,r=!1,o=void 0;try{for(var a,s=this.layers[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=a.value;u.setChangeFlags({viewportChanged:"Viewport changed"}),this._updateLayer(u)}}catch(e){r=!0,o=e}finally{try{!n&&s.return&&s.return()}finally{if(r)throw o}}}return(0,i.default)(this.context.viewport,"LayerManager: viewport not set"),this}},{key:"_getPickingBuffer",value:function(){var e=this.context.gl;return this.context.pickingFBO=this.context.pickingFBO||new o.Framebuffer(e),this.context.pickingFBO.resize({width:e.canvas.width,height:e.canvas.height}),this.context.pickingFBO}},{key:"_updateLayers",value:function(e){var t=e.oldLayers,n=e.newLayers,r={},i=!0,o=!1,a=void 0;try{for(var s,u=t[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var l=s.value;r[l.id]?d.default.warn("Multiple old layers with same id "+m(l))():r[l.id]=l}}catch(e){o=!0,a=e}finally{try{!i&&u.return&&u.return()}finally{if(o)throw a}}var c=[],f=this._updateSublayersRecursively({newLayers:n,oldLayerMap:r,generatedLayers:c}),h=this._finalizeOldLayers(r);return this._needsUpdate=!1,{error:f||h,generatedLayers:c}}},{key:"_updateSublayersRecursively",value:function(e){var t=e.newLayers,n=e.oldLayerMap,r=e.generatedLayers,i=null,o=!0,a=!1,s=void 0;try{for(var u,l=t[Symbol.iterator]();!(o=(u=l.next()).done);o=!0){var c=u.value;c.context=this.context;var f=n[c.id];null===f&&d.default.warn("Multiple new layers with same id "+m(c))(),n[c.id]=null;var h=null;try{f?(this._transferLayerState(f,c),this._updateLayer(c),(0,g.updateLayerInSeer)(c)):(this._initializeLayer(c),(0,g.initLayerInSeer)(c)),r.push(c),h=c.isComposite&&c.getSubLayers()}catch(e){d.default.warn("error during matching of "+m(c),e),i=i||e}h&&this._updateSublayersRecursively({newLayers:h,oldLayerMap:n,generatedLayers:r})}}catch(e){a=!0,s=e}finally{try{!o&&l.return&&l.return()}finally{if(a)throw s}}return i}},{key:"_finalizeOldLayers",value:function(e){var t=null;for(var n in e){var r=e[n];r&&(t=t||this._finalizeLayer(r))}return t}},{key:"_initializeLayer",value:function(e){d.default.log(2,"initializing "+m(e))();var t=null;try{e._initialize(),e.lifecycle=c.LIFECYCLE.INITIALIZED}catch(n){d.default.warn("error while initializing "+m(e)+"\n",n)(),t=t||n}e.internalState.layer=e;var n=!0,r=!1,i=void 0;try{for(var o,a=e.getModels()[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){o.value.userData.layer=e}}catch(e){r=!0,i=e}finally{try{!n&&a.return&&a.return()}finally{if(r)throw i}}return t}},{key:"_transferLayerState",value:function(e,t){t._transferState(e),t.lifecycle=c.LIFECYCLE.MATCHED,t!==e?(d.default.log(4,"matched "+m(t),e,"->",t)(),e.lifecycle=c.LIFECYCLE.AWAITING_GC):d.default.log(4,"Matching layer is unchanged "+t.id)()}},{key:"_updateLayer",value:function(e){d.default.log(4,"updating "+e+" because: "+e.printChangeFlags())();var t=null;try{e._update()}catch(n){d.default.warn("error during update of "+m(e),n)(),t=n}return t}},{key:"_finalizeLayer",value:function(e){(0,i.default)(e.lifecycle!==c.LIFECYCLE.AWAITING_FINALIZATION),e.lifecycle=c.LIFECYCLE.AWAITING_FINALIZATION;var t=null;this.setNeedsRedraw("finalized "+m(e));try{e._finalize()}catch(n){d.default.warn("error during finalization of "+m(e),n)(),t=n}return e.lifecycle=c.LIFECYCLE.FINALIZED,d.default.log(2,"finalizing "+m(e)),t}},{key:"_validateEventHandling",value:function(){(this.onLayerClick||this.onLayerHover)&&this.layers.length&&!this.layers.some(function(e){return e.props.pickable})&&d.default.warn("You have supplied a top-level input event handler (e.g. `onLayerClick`), but none of your layers have set the `pickable` flag.")()}},{key:"_onClick",value:function(e){e.offsetCenter&&this._pickAndCallback({callback:this._onLayerClick,event:e,mode:"click"})}},{key:"_onPointerMove",value:function(e){e.leftButton||e.rightButton||this._pickAndCallback({callback:this._onLayerHover,event:e,mode:"hover"})}},{key:"_onPointerLeave",value:function(e){this.pickObject({x:-1,y:-1,radius:this._pickingRadius,mode:"hover"})}},{key:"_pickAndCallback",value:function(e){var t=e.event.offsetCenter,n=this._pickingRadius,r=this.pickObject({x:t.x,y:t.y,radius:n,mode:e.mode});if(e.callback){var i=r.find(function(e){return e.index>=0})||null;e.callback(i,r,e.event.srcEvent)}}},{key:"_initSeer",value:function(){this.layers.forEach(function(e){(0,g.initLayerInSeer)(e),(0,g.updateLayerInSeer)(e)})}},{key:"_editSeer",value:function(e){if("edit"===e.type&&"props"===e.valuePath[0]){(0,g.setPropOverrides)(e.itemKey,e.valuePath.slice(1),e.value);var t=this.layers.map(function(e){return new e.constructor(e.props)});this.updateLayers({newLayers:t})}}}]),e}();t.default=b},function(e,t){e.exports=function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}},function(e,t){e.exports=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}},function(e,t){e.exports=function(e,t){var n=t[0],r=t[1],i=t[2],o=n*n+r*r+i*i;o>0&&(o=1/Math.sqrt(o),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o);return e}},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.COLOR=void 0,t.addColor=function(e,t,n){return r.isBrowser||"string"!=typeof e||(t&&(t=o(t),e="["+t+"m"+e+"[39m"),n&&(t=o(n),e="["+(n+10)+"m"+e+"[49m")),e};var r=n(19),i=t.COLOR={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function o(e){return"string"==typeof e?i[e.toUpperCase()]||i.WHITE:e}},function(e,t,n){"use strict";function r(e){var t={0:"",1:"K",2:"M",3:"G","-1":"m","-2":"µ","-3":"n"},n=e+"";return n in t?t[n]:"e"+3*e}function i(e){var t=Math.abs,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},r=n.isInteger,o=void 0!==r&&r;if(Array.isArray(e)||ArrayBuffer.isView(e))return function(e,t){for(var n=t.maxElts,r=void 0===n?16:n,o=t.size,a=void 0===o?1:o,s="[",u=0;u<e.length&&u<r;++u)0<u&&(s+=","+(0==u%a?" ":"")),s+=i(e[u],t);var l=e.length>r?"...":"]";return""+s+l}(e,n);if(!Number.isFinite(e))return e+"";if(t(e)<1e-16)return o?"0":"0.";if(o)return e.toFixed(0);if(100<t(e)&&1e4>t(e))return e.toFixed(0);var a=e.toPrecision(2);return a.indexOf(".0")===a.length-2?a.slice(0,-1):a}Object.defineProperty(t,"__esModule",{value:!0}),t.formatTime=function(e){return 10>e?e.toFixed(2)+"ms":100>e?e.toFixed(1)+"ms":1e3>e?e.toFixed(0)+"ms":(e/1e3).toFixed(2)+"s"},t.leftPad=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:8,n=Math.max(t-e.length,0);return""+" ".repeat(n)+e},t.rightPad=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:8,n=Math.max(t-e.length,0);return""+e+" ".repeat(n)},t.getSISuffix=r,t.formatSI=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:3,n=function(e){var t=e,n=0;if(0!==e){for(;10<=t||-10>=t;)t/=10,n++;for(;1>t&&-1<t;)t*=10,n--}return{base:t,exponent:n}}(e),i=n.base,o=n.exponent,a=Math.floor(o/3);return""+(i*Math.pow(10,o-3*a)).toPrecision(t)+r(a)},t.formatValue=i,t.formatImage=function(e,t,n){var r=Math.floor,i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:600,o=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>i&&(n=Math.min(n,i/e.width));var a=e.width*n,s=e.height*n,u=["font-size:1px;","padding:"+r(s/2)+"px "+r(a/2)+"px;","line-height:"+s+"px;","background:url("+o+");","background-size:"+a+"px "+s+"px;","color:transparent;"].join("");return[t+" %c+",u]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.startTimestamp=void 0,t.getTimestamp=i;var r=n(19);function i(){if(!r.isBrowser){var e=r.process.hrtime();return e[0]+e[1]/1e6}return r.window.performance?r.window.performance.now():Date.now()}t.startTimestamp=i()},function(e,t){e.exports=function(e,t,n,r){var i,o,a,s,u,l=t[0],c=t[1],f=t[2],h=t[3],d=n[0],p=n[1],v=n[2],g=n[3];(o=l*d+c*p+f*v+h*g)<0&&(o=-o,d=-d,p=-p,v=-v,g=-g);1-o>1e-6?(i=Math.acos(o),a=Math.sin(i),s=Math.sin((1-r)*i)/a,u=Math.sin(r*i)/a):(s=1-r,u=r);return e[0]=s*l+u*d,e[1]=s*c+u*p,e[2]=s*f+u*v,e[3]=s*h+u*g,e}},function(e,t,n){e.exports=n(207)},function(e,t,n){e.exports=n(78)},function(e,t){e.exports=function(e,t,n){n*=.5;var r=t[0],i=t[1],o=t[2],a=t[3],s=Math.sin(n),u=Math.cos(n);return e[0]=r*u+i*s,e[1]=i*u-r*s,e[2]=o*u+a*s,e[3]=a*u-o*s,e}},function(e,t){e.exports=function(e,t,n){n*=.5;var r=t[0],i=t[1],o=t[2],a=t[3],s=Math.sin(n),u=Math.cos(n);return e[0]=r*u-o*s,e[1]=i*u+a*s,e[2]=o*u+r*s,e[3]=a*u-i*s,e}},function(e,t){e.exports=function(e,t,n){n*=.5;var r=t[0],i=t[1],o=t[2],a=t[3],s=Math.sin(n),u=Math.cos(n);return e[0]=r*u+a*s,e[1]=i*u+o*s,e[2]=o*u-i*s,e[3]=a*u-r*s,e}},function(e,t){e.exports=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=n[0],u=n[1],l=n[2],c=n[3];return e[0]=r*c+a*s+i*l-o*u,e[1]=i*c+a*u+o*s-r*l,e[2]=o*c+a*l+r*u-i*s,e[3]=a*c-r*s-i*u-o*l,e}},function(e,t,n){e.exports=n(208)},function(e,t){e.exports=function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n*n+r*r+i*i+o*o,s=a?1/a:0;return e[0]=-n*s,e[1]=-r*s,e[2]=-i*s,e[3]=o*s,e}},function(e,t){e.exports=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}},function(e,t){e.exports=function(e,t){var n=t[0],r=t[1],i=t[2];return e[0]=n,e[1]=r,e[2]=i,e[3]=Math.sqrt(Math.abs(1-n*n-r*r-i*i)),e}},function(e,t,n){e.exports=n(209)},function(e,t,n){var r=n(79),i=n(50),o=n(48),a=n(80),s=n(47),u=n(46);e.exports=function(e,t,n){var h=r(t,n);return h<-.999999?(i(l,c,t),o(l)<1e-6&&i(l,f,t),a(l,l),u(e,l,Math.PI),e):h>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(i(l,t,n),e[0]=l[0],e[1]=l[1],e[2]=l[2],e[3]=1+h,s(e,e))};var l=[0,0,0],c=[1,0,0],f=[0,1,0]},function(e,t,n){e.exports=n(211)},function(e,t,n){e.exports=n(212)},function(e,t,n){e.exports=n(213)},function(e,t){e.exports=function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}},function(e,t){e.exports=function(e,t){var n,r=t[0]+t[4]+t[8];if(r>0)n=Math.sqrt(r+1),e[3]=.5*n,n=.5/n,e[0]=(t[5]-t[7])*n,e[1]=(t[6]-t[2])*n,e[2]=(t[1]-t[3])*n;else{var i=0;t[4]>t[0]&&(i=1),t[8]>t[3*i+i]&&(i=2);var o=(i+1)%3,a=(i+2)%3;n=Math.sqrt(t[3*i+i]-t[3*o+o]-t[3*a+a]+1),e[i]=.5*n,n=.5/n,e[3]=(t[3*o+a]-t[3*a+o])*n,e[o]=(t[3*o+i]+t[3*i+o])*n,e[a]=(t[3*a+i]+t[3*i+a])*n}return e}},function(e,t){e.exports=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return a=a||1,e[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/a,e[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,e[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,e}},function(e,t){e.exports=function(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[4]*i+n[12],e[1]=n[1]*r+n[5]*i+n[13],e}},function(e,t){e.exports=function(e,t,n,r){var i,o,a,s,u,l,c,f,h,d,p,v,g,y,_,m,b,E,w,S,P,T,A,x,O=r[0],R=r[1],C=r[2],k=Math.sqrt(O*O+R*R+C*C);if(Math.abs(k)<1e-6)return null;O*=k=1/k,R*=k,C*=k,i=Math.sin(n),o=Math.cos(n),a=1-o,s=t[0],u=t[1],l=t[2],c=t[3],f=t[4],h=t[5],d=t[6],p=t[7],v=t[8],g=t[9],y=t[10],_=t[11],m=O*O*a+o,b=R*O*a+C*i,E=C*O*a-R*i,w=O*R*a-C*i,S=R*R*a+o,P=C*R*a+O*i,T=O*C*a+R*i,A=R*C*a-O*i,x=C*C*a+o,e[0]=s*m+f*b+v*E,e[1]=u*m+h*b+g*E,e[2]=l*m+d*b+y*E,e[3]=c*m+p*b+_*E,e[4]=s*w+f*S+v*P,e[5]=u*w+h*S+g*P,e[6]=l*w+d*S+y*P,e[7]=c*w+p*S+_*P,e[8]=s*T+f*A+v*x,e[9]=u*T+h*A+g*x,e[10]=l*T+d*A+y*x,e[11]=c*T+p*A+_*x,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]);return e}},function(e,t){e.exports=function(e,t){if(e===t){var n=t[1],r=t[2],i=t[3],o=t[6],a=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=o,e[11]=t[14],e[12]=i,e[13]=a,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}},function(e,t){e.exports=function(e,t,n,r,i,o,a){var s=1/(n-t),u=1/(i-r),l=1/(o-a);return e[0]=2*o*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*o*u,e[6]=0,e[7]=0,e[8]=(n+t)*s,e[9]=(i+r)*u,e[10]=(a+o)*l,e[11]=-1,e[12]=0,e[13]=0,e[14]=a*o*2*l,e[15]=0,e}},function(e,t){e.exports=function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n+n,s=r+r,u=i+i,l=n*a,c=r*a,f=r*s,h=i*a,d=i*s,p=i*u,v=o*a,g=o*s,y=o*u;return e[0]=1-f-p,e[1]=c+y,e[2]=h-g,e[3]=0,e[4]=c-y,e[5]=1-l-p,e[6]=d+v,e[7]=0,e[8]=h+g,e[9]=d-v,e[10]=1-l-f,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},function(e,t){e.exports=function(e){var t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],u=e[7],l=e[8],c=e[9],f=e[10],h=e[11],d=e[12],p=e[13],v=e[14],g=e[15];return(t*a-n*o)*(f*g-h*v)-(t*s-r*o)*(c*g-h*p)+(t*u-i*o)*(c*v-f*p)+(n*s-r*a)*(l*g-h*d)-(n*u-i*a)*(l*v-f*d)+(r*u-i*s)*(l*p-c*d)}},function(e,t){e.exports=function(e,t,n,r){var i=n[0],o=n[1],a=t[0]-i,s=t[1]-o,u=Math.sin(r),l=Math.cos(r);return e[0]=i+a*l-s*u,e[1]=o+a*u+s*l,e[2]=t[2],e}},function(e,t){e.exports=function(e,t,n,r){var i=n[0],o=n[2],a=t[0]-i,s=t[2]-o,u=Math.sin(r),l=Math.cos(r);return e[0]=i+s*u+a*l,e[1]=t[1],e[2]=o+s*l-a*u,e}},function(e,t){e.exports=function(e,t,n,r){var i=n[1],o=n[2],a=t[1]-i,s=t[2]-o,u=Math.sin(r),l=Math.cos(r);return e[0]=t[0],e[1]=i+a*l-s*u,e[2]=o+a*u+s*l,e}},function(e,t,n){e.exports=function(e,t){var n=r(e[0],e[1],e[2]),a=r(t[0],t[1],t[2]);i(n,n),i(a,a);var s=o(n,a);return s>1?0:Math.acos(s)};var r=n(215),i=n(80),o=n(79)},function(e,t){e.exports=function(e,t,n){var r=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=r,e}},function(e,t,n){"use strict";(function(e){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}t.a="undefined"!=typeof window&&"object"===n(window.process)&&"renderer"===window.process.type||!(void 0===e||"object"!==n(e.versions)||!Boolean(e.versions.electron))||"object"===("undefined"==typeof navigator?"undefined":n(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent.indexOf("Electron")>=0}).call(this,n(24))},function(e,t,n){"use strict";n.r(t);var r=Math.PI/3,i=[0,r,2*r,3*r,4*r,5*r];function o(e){return e[0]}function a(e){return e[1]}var s=function(){var e,t,n,s=0,u=0,l=1,c=1,f=o,h=a;function d(e){var r,i={},o=[],a=e.length;for(r=0;r<a;++r)if(!isNaN(u=+f.call(null,s=e[r],r,e))&&!isNaN(l=+h.call(null,s,r,e))){var s,u,l,c=Math.round(l/=n),d=Math.round(u=u/t-(1&c)/2),p=l-c;if(3*Math.abs(p)>1){var v=u-d,g=d+(u<d?-1:1)/2,y=c+(l<c?-1:1),_=u-g,m=l-y;v*v+p*p>_*_+m*m&&(d=g+(1&c?1:-1)/2,c=y)}var b=d+"-"+c,E=i[b];E?E.push(s):(o.push(E=i[b]=[s]),E.x=(d+(1&c)/2)*t,E.y=c*n)}return o}function p(e){var t=0,n=0;return i.map(function(r){var i=Math.sin(r)*e,o=-Math.cos(r)*e,a=i-t,s=o-n;return t=i,n=o,[a,s]})}return d.hexagon=function(t){return"m"+p(null==t?e:+t).join("l")+"z"},d.centers=function(){for(var r=[],i=Math.round(u/n),o=Math.round(s/t),a=i*n;a<c+e;a+=n,++i)for(var f=o*t+(1&i)*t/2;f<l+t/2;f+=t)r.push([f,a]);return r},d.mesh=function(){var t=p(e).slice(0,4).join("l");return d.centers().map(function(e){return"M"+e+"m"+t}).join("")},d.x=function(e){return arguments.length?(f=e,d):f},d.y=function(e){return arguments.length?(h=e,d):h},d.radius=function(i){return arguments.length?(t=2*(e=+i)*Math.sin(r),n=1.5*e,d):e},d.size=function(e){return arguments.length?(s=u=0,l=+e[0],c=+e[1],d):[l-s,c-u]},d.extent=function(e){return arguments.length?(s=+e[0][0],u=+e[0][1],l=+e[1][0],c=+e[1][1],d):[[s,u],[l,c]]},d.radius(1)};n.d(t,"hexbin",function(){return s})},function(e,t,n){"use strict";n.r(t);var r=n(14),i=1,o=2,a=4,s={mousedown:i,mousemove:o,mouseup:a};var u,l,c=void 0;r.isBrowser&&(c=n(188)),c&&(u=c.PointerEventInput,l=u.prototype.handler,u.prototype.handler=function(e){var t=this.store;e.button>0&&(function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return!0;return!1}(t,function(t){return t.pointerId===e.pointerId})||t.push(e)),l.call(this,e)},c.MouseInput.prototype.handler=function(e){var t=s[e.type];t&i&&e.button>=0&&(this.pressed=!0),t&o&&0===e.which&&(t=a),this.pressed&&(t&a&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:"mouse",srcEvent:e}))});var f=c?c.Manager:function(e){var t={},n=function(){return t};return t.get=function(){return null},t.set=n,t.on=n,t.off=n,t.destroy=n,t.emit=n,t},h=c,d=h?[[h.Rotate,{enable:!1}],[h.Pinch,{enable:!1}],[h.Swipe,{enable:!1}],[h.Pan,{threshold:0,enable:!1}],[h.Press,{enable:!1}],[h.Tap,{event:"doubletap",taps:2,enable:!1}],[h.Tap,{enable:!1}]]:null,p={rotate:["pinch"]},v={doubletap:["tap"]},g={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},y=["keydown","keyup"],_=["mousedown","mousemove","mouseup","mouseleave"],m=["wheel","mousewheel","DOMMouseScroll"],b={tap:"tap",doubletap:"doubletap",press:"press",pinch:"pinch",pinchin:"pinch",pinchout:"pinch",pinchstart:"pinch",pinchmove:"pinch",pinchend:"pinch",pinchcancel:"pinch",rotate:"rotate",rotatestart:"rotate",rotatemove:"rotate",rotateend:"rotate",rotatecancel:"rotate",pan:"pan",panstart:"pan",panmove:"pan",panup:"pan",pandown:"pan",panleft:"pan",panright:"pan",panend:"pan",pancancel:"pan",swipe:"swipe",swipeleft:"swipe",swiperight:"swipe",swipeup:"swipe",swipedown:"swipe"},E={click:"tap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseleave:"pointerleave"},w=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var S=-1!==r.userAgent.indexOf("firefox"),P=m,T=function(){function e(t,n){var r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.element=t,this.callback=n,this.options=Object.assign({enable:!0},i),this.events=P.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(function(e){return t.addEventListener(e,r.handleEvent)})}return w(e,[{key:"destroy",value:function(){var e=this;this.events.forEach(function(t){return e.element.removeEventListener(t,e.handleEvent)})}},{key:"enableEventType",value:function(e,t){"wheel"===e&&(this.options.enable=t)}},{key:"handleEvent",value:function(e){if(this.options.enable){this.options.legacyBlockScroll&&e.preventDefault();var t=e.deltaY;r.window.WheelEvent&&(S&&e.deltaMode===r.window.WheelEvent.DOM_DELTA_PIXEL&&(t/=r.window.devicePixelRatio),e.deltaMode===r.window.WheelEvent.DOM_DELTA_LINE&&(t*=40));var n={x:e.clientX,y:e.clientY};0!==t&&t%4.000244140625==0&&(t=Math.floor(t/4.000244140625)),e.shiftKey&&t&&(t*=.25),this._onWheel(e,-t,n)}}},{key:"_onWheel",value:function(e,t,n){this.callback({type:"wheel",center:n,delta:t,srcEvent:e,pointerType:"mouse",target:e.target})}}]),e}(),A=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var x=_,O=function(){function e(t,n){var r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.element=t,this.callback=n,this.pressed=!1,this.options=Object.assign({enable:!0},i),this.enableMoveEvent=this.options.enable,this.enableLeaveEvent=this.options.enable,this.events=x.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(function(e){return t.addEventListener(e,r.handleEvent)})}return A(e,[{key:"destroy",value:function(){var e=this;this.events.forEach(function(t){return e.element.removeEventListener(t,e.handleEvent)})}},{key:"enableEventType",value:function(e,t){"pointermove"===e&&(this.enableMoveEvent=t),"pointerleave"===e&&(this.enableLeaveEvent=t)}},{key:"handleEvent",value:function(e){if(this.enableLeaveEvent&&"mouseleave"===e.type&&this.callback({type:"pointerleave",srcEvent:e,pointerType:"mouse",target:e.target}),this.enableMoveEvent)switch(e.type){case"mousedown":e.button>=0&&(this.pressed=!0);break;case"mousemove":0===e.which&&(this.pressed=!1),this.pressed||this.callback({type:"pointermove",srcEvent:e,pointerType:"mouse",target:e.target});break;case"mouseup":this.pressed=!1}}}]),e}(),R=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var C=y,k=function(){function e(t,n){var r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.element=t,this.callback=n,this.options=Object.assign({enable:!0},i),this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=C.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),t.tabIndex=1,t.style.outline="none",this.events.forEach(function(e){return t.addEventListener(e,r.handleEvent)})}return R(e,[{key:"destroy",value:function(){var e=this;this.events.forEach(function(t){return e.element.removeEventListener(t,e.handleEvent)})}},{key:"enableEventType",value:function(e,t){"keydown"===e&&(this.enableDownEvent=t),"keyup"===e&&(this.enableUpEvent=t)}},{key:"handleEvent",value:function(e){var t=e.target||e.srcElement;"INPUT"===t.tagName&&"text"===t.type||"TEXTAREA"===t.tagName||(this.enableDownEvent&&"keydown"===e.type&&this.callback({type:"keydown",srcEvent:e,key:e.key,target:e.target}),this.enableUpEvent&&"keyup"===e.type&&this.callback({type:"keyup",srcEvent:e,key:e.key,target:e.target}))}}]),e}(),M=1,I=2,L=4,N={pointerdown:M,pointermove:I,pointerup:L,mousedown:M,mousemove:I,mouseup:L},F=1,j=2,D=3,B=0,U=1,G=2,V=1,z=2,X=4;var W=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var H={events:null,recognizers:null,Manager:f,rightButton:!1,legacyBlockScroll:!0};function Y(e){e.preventDefault()}var K=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.options=Object.assign({},H,n),this.eventHandlers=[],this._onBasicInput=this._onBasicInput.bind(this),this._onOtherEvent=this._onOtherEvent.bind(this),this.setElement(t);var r=n.events;r&&this.on(r)}return W(e,[{key:"setElement",value:function(e){var t=this;if(this.element&&this.destroy(),this.element=e,e){var n=this.options,r=n.Manager;this.manager=new r(e,{recognizers:n.recognizers||d}).on("hammer.input",this._onBasicInput),n.recognizers||Object.keys(p).forEach(function(e){var n=t.manager.get(e);n&&p[e].forEach(function(e){n.recognizeWith(e)})}),this.wheelInput=new T(e,this._onOtherEvent,{enable:!1,legacyBlockScroll:n.legacyBlockScroll}),this.moveInput=new O(e,this._onOtherEvent,{enable:!1}),this.keyInput=new k(e,this._onOtherEvent,{enable:!1}),n.rightButton&&e.addEventListener("contextmenu",Y),this.eventHandlers.forEach(function(e){var n=e.recognizerName,r=e.eventAlias,i=e.wrappedHandler;t._toggleRecognizer(n,!0),t.manager.on(r,i)})}}},{key:"destroy",value:function(){this.element&&(this.element.removeEventListener("contextmenu",Y),this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.manager.destroy(),this.wheelInput=null,this.moveInput=null,this.keyInput=null,this.manager=null,this.element=null)}},{key:"on",value:function(e,t,n){if("string"==typeof e)this._addEventHandler(e,t,n);else for(var r in n=t,e)this._addEventHandler(r,e[r],n)}},{key:"off",value:function(e,t){if("string"==typeof e)this._removeEventHandler(e,t);else for(var n in e)this._removeEventHandler(n,e[n])}},{key:"_toggleRecognizer",value:function(e,t){var n=this.manager;if(n){var r=n.get(e);if(r){r.set({enable:t});var i=v[e];i&&!this.options.recognizers&&i.forEach(function(r){var i=n.get(r);t?i.requireFailure(e):i.dropRequireFailure(e)})}this.wheelInput.enableEventType(e,t),this.moveInput.enableEventType(e,t),this.keyInput.enableEventType(e,t)}}},{key:"_addEventHandler",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=this.manager,i=this.eventHandlers,o=this._wrapEventHandler(e,t,n),a=E[e]||e,s=b[a]||a;this._toggleRecognizer(s,!0);var u=i.filter(function(e){return e.eventAlias===a&&e.srcElement!==n&&(!e.srcElement||e.srcElement.contains(n))});i.push({event:e,eventAlias:a,recognizerName:s,srcElement:n,handler:t,wrappedHandler:o}),u.forEach(function(e){return r.off(a,e.wrappedHandler)}),r&&r.on(a,o),u.forEach(function(e){return r.on(a,e.wrappedHandler)})}},{key:"_removeEventHandler",value:function(e,t){for(var n=this.manager,r=this.eventHandlers,i=!1,o=r.length;o--;){var a=r[o];a.event===e&&a.handler===t&&(n&&n.off(a.eventAlias,a.wrappedHandler),r.splice(o,1),i=!0)}if(i){var s=E[e]||e,u=b[s]||s;r.find(function(e){return e.recognizerName===u})||this._toggleRecognizer(u,!1)}}},{key:"_wrapEventHandler",value:function(e,t,n){var r=this;return function(i){var o=i.mjolnirEvent;(o||(o=r._normalizeEvent(i),i.mjolnirEvent=o),o.handled&&o.handled!==n)||(!n||n.contains(i.srcEvent.target))&&t(Object.assign({},o,{type:e,stopPropagation:function(){o.handled||(o.handled=n)}}))}}},{key:"_normalizeEvent",value:function(e){var t=this.element;return Object.assign({},e,function(e){var t=N[e.srcEvent.type];if(!t)return null;var n=e.srcEvent,r=n.buttons,i=n.button,o=n.which,a=!1,s=!1,u=!1;return t===L||t===I&&!Number.isFinite(r)?(a=o===F,s=o===j,u=o===D):t===I?(a=Boolean(r&V),s=Boolean(r&X),u=Boolean(r&z)):t===M&&(a=i===B,s=i===U,u=i===G),{leftButton:a,middleButton:s,rightButton:u}}(e),function(e,t){var n=e.srcEvent;if(!e.center&&!Number.isFinite(n.clientX))return null;var r=e.center||{x:n.clientX,y:n.clientY},i=t.getBoundingClientRect(),o=i.width/t.offsetWidth,a=i.height/t.offsetHeight;return{center:r,offsetCenter:{x:(r.x-i.left-t.clientLeft)/o,y:(r.y-i.top-t.clientTop)/a}}}(e,t),{handled:!1,rootElement:t})}},{key:"_onBasicInput",value:function(e){var t=e.srcEvent,n=g[t.type];n&&this.manager.emit(n,e)}},{key:"_onOtherEvent",value:function(e){this.manager.emit(e.type,e)}}]),e}();n.d(t,"EventManager",function(){return K})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(6);var o={position:"absolute",left:0,top:0,width:"100%",height:"100%"};function a(e){var t=e.transform;return{width:t.width,height:t.height,latitude:t.center.lat,longitude:t.center.lng,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch,option:{units:"m"===e.units?"m":"degrees",topTileExtent:e._tileExtent?e._tileExtent:[0,0,0,0]}}}var s=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),"undefined"==typeof document)throw Error("Deck can only be used in the browser");var n=e.geoMap,r=e.container,s=void 0===r?document.body:r;if("string"==typeof s&&(s=document.getElementById(s)),!s)throw Error("Deck: container not found");var u=document.createElement("canvas");s.appendChild(u),Object.assign(u.style,o),e.initialViewState=a(n);var l=i.MapController,c=function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,Object.assign({},e,{width:"100%",height:"100%",canvas:u,controller:e.controller||l,viewState:e.initialViewState})));return c._map=n,["load","zoom","rotate","drag","pitch","move"].forEach(function(e){c._map.on(e,function(){var e=a(c._map);c.setProps({viewState:e})})}),c}return function(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)}(t,i.Deck),r(t,[{key:"getMapboxMap",value:function(){return this._map}}]),t}();t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_CHAR_SET=void 0,t.makeFontAtlas=function(e,t){var n,h=t.fontFamily,p=t.characterSet,v=void 0===p?f:p,g=t.fontSize,y=void 0===g?l:g,_=t.padding,m=void 0===_?c:_,b=document.createElement("canvas"),E=b.getContext("2d");d(E,h,y,!0);var w=0,S=0,P=E.measureText(v[0]).fontBoundingBoxDescent,T=P||y,A=Boolean(P),x={};for(var O in Array.from(v).forEach(function(e){var t=E.measureText(e).width;S+t>u&&(S=0,w++),x[e]={x:S,y:w*(T+m),width:t,height:T,mask:!0},S+=t+m}),b.width=u,b.height=(w+1)*(T+m),d(E,h,y,A),x)E.fillText(O,x[O].x,x[O].y);return{scale:T/y,mapping:x,texture:new r.Texture2D(e,{pixels:b,parameters:(n={},i(n,o,s),i(n,a,s),n)})}};var r=n(2);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}for(var o=10242,a=10243,s=33071,u=1024,l=64,c=4,f=t.DEFAULT_CHAR_SET=[],h=32;h<128;h++)f.push(String.fromCharCode(h));function d(e,t,n,r){e.font=n+"px "+t,e.fillStyle="#000",e.textBaseline=r?"top":"hanging",e.textAlign="left"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default='#define SHADER_NAME multi-icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xyLow;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\n\n// the following three attributes are for the multi-icon layer\nattribute vec2 instancePixelOffset;\n\nuniform float sizeScale;\nuniform vec2 iconsTextureDim;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n vec2 iconSize = instanceIconFrames.zw;\n // scale icon height to match instanceSize\n float instanceScale = iconSize.y == 0.0 ? 0.0 : instanceSizes / iconSize.y;\n\n // scale and rotate vertex in "pixel" value and convert back to fraction in clipspace\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * sizeScale * instanceScale;\n pixelOffset += instancePixelOffset;\n pixelOffset.y *= -1.0;\n\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, vec3(0.0));\n gl_Position += project_pixel_to_clipspace(pixelOffset);\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vTextureCoords.y = 1.0 - vTextureCoords.y;\n\n vColor = instanceColors / 255.;\n picking_setPickingColor(instancePickingColors);\n\n vColorMode = instanceColorModes;\n}\n'},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,r)}if("value"in i)return i.value;var a=i.get;return void 0!==a?a.call(r):void 0},o=s(n(56)),a=s(n(120));function s(e){return e&&e.__esModule?e:{default:e}}var u=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(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)}(t,o.default),r(t,[{key:"getShaders",value:function(){return Object.assign({},i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"getShaders",this).call(this),{vs:a.default})}},{key:"initializeState",value:function(){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"initializeState",this).call(this),this.getAttributeManager().addInstanced({instancePixelOffset:{size:2,transition:!0,accessor:"getPixelOffset"}})}},{key:"updateState",value:function(e){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateState",this).call(this,e);var n=e.changeFlags;n.updateTriggersChanged&&(n.updateTriggersChanged.getAnchorX||n.updateTriggersChanged.getAnchorY)&&this.getAttributeManager().invalidate("instanceOffsets")}},{key:"calculateInstanceOffsets",value:function(e){var t=this.props,n=t.data,r=t.iconMapping,i=t.getIcon,o=t.getAnchorX,a=t.getAnchorY,s=t.getLengthOfQueue,u=t.getShiftInQueue,l=e.value,c=0,f=!0,h=!1,d=void 0;try{for(var p,v=n[Symbol.iterator]();!(f=(p=v.next()).done);f=!0){var g=p.value,y=r[i(g)]||{},_=s(g),m=u(g);l[c++]=(o(g)-1)*_/2+y.width/2+m||0,l[c++]=y.height/2*a(g)||0}}catch(e){h=!0,d=e}finally{try{!f&&v.return&&v.return()}finally{if(h)throw d}}}}]),t}();t.default=u,u.layerName="MultiIconLayer",u.defaultProps={getShiftInQueue:function(e){return e.shift||0},getLengthOfQueue:function(e){return e.len||1},getAnchorX:function(e){return e.anchorX||0},getAnchorY:function(e){return e.anchorY||0},getPixelOffset:function(e){return e.pixelOffset||[0,0]}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(6),a=n(121),s=(r=a)&&r.__esModule?r:{default:r},u=n(119);var l={start:1,middle:0,end:-1},c={top:1,center:0,bottom:-1},f=[0,0,0,255],h={fp64:!1,sizeScale:1,fontFamily:"Monaco, monospace",characterSet:u.DEFAULT_CHAR_SET,getText:function(e){return e.text},getPosition:function(e){return e.position},getColor:function(e){return e.color||f},getSize:function(e){return e.size||32},getAngle:function(e){return e.angle||0},getTextAnchor:function(e){return e.textAnchor||"middle"},getAlignmentBaseline:function(e){return e.alignmentBaseline||"center"},getPixelOffset:function(e){return e.offset||e.pixelOffset||[0,0]}},d=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(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)}(t,o.CompositeLayer),i(t,[{key:"updateState",value:function(e){var t=e.props,n=e.oldProps,r=e.changeFlags,i=n.fontFamily!==t.fontFamily||n.characterSet!==t.characterSet;i&&this.updateFontAtlas(t.fontFamily,t.characterSet),(r.dataChanged||i||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getText))&&this.transformStringToLetters()}},{key:"updateFontAtlas",value:function(e,t){var n=this.context.gl,r=(0,u.makeFontAtlas)(n,{fontFamily:e,characterSet:t}),i=r.scale,o=r.mapping,a=r.texture;this.setState({scale:i,iconAtlas:a,iconMapping:o})}},{key:"getPickingInfo",value:function(e){var t=e.info;return Object.assign(t,{object:t.object&&t.object.object})}},{key:"transformStringToLetters",value:function(){var e=this.props,t=e.data,n=e.getText,r=this.state.iconMapping;if(t&&0!==t.length){var i=[];t.forEach(function(e){var t=n(e);if(t){var a=[0],s=0;Array.from(t).forEach(function(n,u){var l={text:n,index:u,offsets:a,len:t.length,object:e},c=r[n];c?s+=c.width:(o.log.warn("Missing character: "+n)(),s+=32),a.push(s),i.push(l)})}}),this.setState({data:i})}}},{key:"getLetterOffset",value:function(e){return e.offsets[e.index]}},{key:"getTextLength",value:function(e){return e.offsets[e.offsets.length-1]}},{key:"_getAccessor",value:function(e){return"function"==typeof e?function(t){return e(t.object)}:e}},{key:"getAnchorXFromTextAnchor",value:function(e){return function(t){var n="function"==typeof e?e(t.object):e;if(!l.hasOwnProperty(n))throw new Error("Invalid text anchor parameter: "+n);return l[n]}}},{key:"getAnchorYFromAlignmentBaseline",value:function(e){return function(t){var n="function"==typeof e?e(t.object):e;if(!c.hasOwnProperty(n))throw new Error("Invalid alignment baseline parameter: "+n);return c[n]}}},{key:"renderLayers",value:function(){var e=this,t=this.state,n=t.data,r=t.scale,i=t.iconAtlas,o=t.iconMapping;if(!o||!i||!n)return null;var a=this.props,u=a.getPosition,l=a.getColor,c=a.getSize,f=a.getAngle,h=a.getTextAnchor,d=a.getAlignmentBaseline,p=a.getPixelOffset,v=a.fp64,g=a.sizeScale,y=a.transitions,_=a.updateTriggers;return[new s.default(this.getSubLayerProps({id:"text-multi-icon-layer",data:n,iconAtlas:i,iconMapping:o,getIcon:function(e){return e.text},getPosition:function(e){return u(e.object)},getShiftInQueue:function(t){return e.getLetterOffset(t)},getLengthOfQueue:function(t){return e.getTextLength(t)},getColor:this._getAccessor(l),getSize:this._getAccessor(c),getAngle:this._getAccessor(f),getAnchorX:this.getAnchorXFromTextAnchor(h),getAnchorY:this.getAnchorYFromAlignmentBaseline(d),getPixelOffset:this._getAccessor(p),fp64:v,sizeScale:g*r,transitions:y&&{getPosition:y.getPosition,getAngle:y.getAngle,getColor:y.getColor,getSize:y.getSize,getPixelOffset:_.getPixelOffset},updateTriggers:{getPosition:_.getPosition,getAngle:_.getAngle,getColor:_.getColor,getSize:_.getSize,getPixelOffset:_.getPixelOffset,getAnchorX:_.getTextAnchor,getAnchorY:_.getAlignmentBaseline}}))]}}]),t}();t.default=d,d.layerName="TextLayer",d.defaultProps=h},function(e,t,n){"use strict";function r(e,t){if(!e)throw new Error("deck.gl: "+t)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,t.getGeojsonFeatures=function(e){if(Array.isArray(e))return e;switch(r(e.type,"GeoJSON does not have type"),e.type){case"GeometryCollection":return r(Array.isArray(e.geometries),"GeoJSON does not have geometries array"),e.geometries.map(function(e){return{geometry:e}});case"Feature":return[e];case"FeatureCollection":return r(Array.isArray(e.features),"GeoJSON does not have features array"),e.features;default:return[{geometry:e}]}},t.separateGeojsonFeatures=function(e){var t=[],n=[],o=[],a=[];return e.forEach(function(e){r(e&&e.geometry,"GeoJSON does not have geometry");var s=e.geometry,u=s.type,l=s.coordinates,c=e.properties;switch(function(e,t){var n=i[e];for(r(n,"Unknown GeoJSON type "+e);t&&--n>0;)t=t[0];r(t&&Number.isFinite(t[0]),e+" coordinates are malformed")}(u,l),u){case"Point":t.push(e);break;case"MultiPoint":l.forEach(function(n){t.push({geometry:{coordinates:n},properties:c,feature:e})});break;case"LineString":n.push(e);break;case"MultiLineString":l.forEach(function(t){n.push({geometry:{coordinates:t},properties:c,feature:e})});break;case"Polygon":o.push(e),l.forEach(function(t){a.push({geometry:{coordinates:t},properties:c,feature:e})});break;case"MultiPolygon":l.forEach(function(t){o.push({geometry:{coordinates:t},properties:c,feature:e}),t.forEach(function(t){a.push({geometry:{coordinates:t},properties:c,feature:e})})})}}),{pointFeatures:t,lineFeatures:n,polygonFeatures:o,polygonOutlineFeatures:a}};var i={Point:1,MultiPoint:2,LineString:2,MultiLineString:3,Polygon:3,MultiPolygon:4}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(6),o=l(n(55)),a=l(n(37)),s=l(n(52)),u=n(123);function l(e){return e&&e.__esModule?e:{default:e}}var c=[0,0,0,255],f=[0,0,0,255],h={stroked:!0,filled:!0,extruded:!1,wireframe:!1,lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,lineJointRounded:!1,lineMiterLimit:4,elevationScale:1,pointRadiusScale:1,pointRadiusMinPixels:0,pointRadiusMaxPixels:Number.MAX_SAFE_INTEGER,fp64:!1,getLineColor:function(e){return e.properties&&e.properties.lineColor||c},getFillColor:function(e){return e.properties&&e.properties.fillColor||f},getRadius:function(e){return e.properties&&(e.properties.radius||e.properties.size)||1},getLineWidth:function(e){return e.properties&&e.properties.lineWidth||1},getElevation:function(e){return e.properties&&e.properties.elevation||1e3},subLayers:{PointLayer:o.default,LineLayer:a.default,PolygonLayer:s.default},lightSettings:{}},d=function(e){return e.geometry.coordinates},p=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(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)}(t,i.CompositeLayer),r(t,[{key:"initializeState",value:function(){this.state={features:{}}}},{key:"updateState",value:function(e){e.oldProps;var t=e.props;if(e.changeFlags.dataChanged){var n=t.data,r=(0,u.getGeojsonFeatures)(n);this.state.features=(0,u.separateGeojsonFeatures)(r)}}},{key:"getPickingInfo",value:function(e){var t=e.info;return Object.assign(t,{object:t.object&&t.object.feature||t.object})}},{key:"renderLayers",value:function(){var e=this.state.features,t=e.pointFeatures,n=e.lineFeatures,r=e.polygonFeatures,i=e.polygonOutlineFeatures,o=this.props,a=o.stroked,s=o.filled,u=o.extruded,l=o.wireframe,c=o.subLayers,f=o.lightSettings,h=this.props,p=h.lineWidthScale,v=h.lineWidthMinPixels,g=h.lineWidthMaxPixels,y=h.lineJointRounded,_=h.lineMiterLimit,m=h.pointRadiusScale,b=h.pointRadiusMinPixels,E=h.pointRadiusMaxPixels,w=h.elevationScale,S=h.fp64,P=this.props,T=P.getLineColor,A=P.getFillColor,x=P.getRadius,O=P.getLineWidth,R=P.getElevation,C=P.updateTriggers,k=t&&t.length>0,M=n&&n.length>0,I=i&&i.length>0,L=r&&r.length>0&&new c.PolygonLayer(this.getSubLayerProps({id:"polygon-fill",updateTriggers:{getElevation:C.getElevation,getFillColor:C.getFillColor,getLineColor:C.getLineColor}}),{data:r,fp64:S,extruded:u,elevationScale:w,filled:s,wireframe:l,lightSettings:f,getPolygon:d,getElevation:R,getFillColor:A,getLineColor:T}),N=!u&&a&&I&&new c.LineLayer(this.getSubLayerProps({id:"polygon-outline",updateTriggers:{getColor:C.getLineColor,getWidth:C.getLineWidth}}),{data:i,fp64:S,widthScale:p,widthMinPixels:v,widthMaxPixels:g,rounded:y,miterLimit:_,getPath:d,getColor:T,getWidth:O}),F=M&&new c.LineLayer(this.getSubLayerProps({id:"line-paths",updateTriggers:{getColor:C.getLineColor,getWidth:C.getLineWidth}}),{data:n,fp64:S,widthScale:p,widthMinPixels:v,widthMaxPixels:g,rounded:y,miterLimit:_,getPath:d,getColor:T,getWidth:O}),j=k&&new c.PointLayer(this.getSubLayerProps({id:"points",updateTriggers:{getColor:C.getFillColor,getRadius:C.getRadius}}),{data:t,fp64:S,radiusScale:m,radiusMinPixels:b,radiusMaxPixels:E,getPosition:d,getColor:A,getRadius:x});return[!u&&L,N,F,j,u&&L]}}]),t}();t.default=p,p.layerName="GeoJsonLayer",p.defaultProps=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="#define SHADER_NAME solid-polygon-layer-fragment-shader\n\n#ifdef GL_ES\nprecision highp float;\n#endif\n\nvarying vec4 vColor;\n\nvoid main(void) {\n gl_FragColor = vColor;\n\n // use highlight color if this fragment belongs to the selected object.\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n\n // use picking color if rendering to picking FBO.\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n}\n"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="#define SHADER_NAME solid-polygon-layer-vertex-shader\n\nattribute vec2 vertexPositions;\nattribute vec3 positions;\nattribute vec2 positions64xyLow;\nattribute vec3 nextPositions;\nattribute vec2 nextPositions64xyLow;\nattribute float elevations;\nattribute vec4 colors;\nattribute vec3 pickingColors;\n\nuniform float isSideVertex;\nuniform float extruded;\nuniform float elevationScale;\nuniform float opacity;\n\nvarying vec4 vColor;\n\nvoid main(void) {\n vec3 pos;\n vec2 pos64xyLow;\n vec3 normal;\n\n if (isSideVertex > 0.5) {\n pos = mix(positions, nextPositions, vertexPositions.x);\n pos64xyLow = mix(positions64xyLow, nextPositions64xyLow, vertexPositions.x);\n } else {\n pos = positions;\n pos64xyLow = positions64xyLow;\n }\n if (extruded > 0.5) {\n pos.z += elevations * vertexPositions.y;\n }\n pos.z *= elevationScale;\n\n vec4 position_worldspace;\n gl_Position = project_position_to_clipspace(pos, pos64xyLow, vec3(0.), position_worldspace);\n\n float lightWeight = 1.0;\n \n if (extruded > 0.5) {\n if (isSideVertex > 0.5) {\n normal = vec3(positions.y - nextPositions.y, nextPositions.x - positions.x, 0.0);\n normal = project_normal(normal);\n } else {\n normal = vec3(0.0, 0.0, 1.0);\n }\n\n lightWeight = lighting_getLightWeight(position_worldspace.xyz, normal);\n }\n\n vec3 lightWeightedColor = lightWeight * colors.rgb;\n vColor = vec4(lightWeightedColor, colors.a * opacity) / 255.0;\n\n // Set color to be rendered to picking fbo (also used to check for selection highlight).\n picking_setPickingColor(pickingColors);\n}\n"},function(e,t,n){"use strict";function r(e,t,n){n=n||2;var r,s,u,l,c,d,v,g=t&&t.length,y=g?t[0]*n:e.length,_=i(e,0,y,n,!0),m=[];if(!_)return m;if(g&&(_=function(e,t,n,r){var a,s,u,l,c,d=[];for(a=0,s=t.length;a<s;a++)u=t[a]*r,l=a<s-1?t[a+1]*r:e.length,(c=i(e,u,l,r,!1))===c.next&&(c.steiner=!0),d.push(p(c));for(d.sort(f),a=0;a<d.length;a++)h(d[a],n),n=o(n,n.next);return n}(e,t,_,n)),e.length>80*n){r=u=e[0],s=l=e[1];for(var b=n;b<y;b+=n)c=e[b],d=e[b+1],c<r&&(r=c),d<s&&(s=d),c>u&&(u=c),d>l&&(l=d);v=0!==(v=Math.max(u-r,l-s))?1/v:0}return a(_,m,n,r,s,v),m}function i(e,t,n,r,i){var o,a;if(i===T(e,t,n,r)>0)for(o=t;o<n;o+=r)a=w(o,e[o],e[o+1],a);else for(o=n-r;o>=t;o-=r)a=w(o,e[o],e[o+1],a);return a&&_(a,a.next)&&(S(a),a=a.next),a}function o(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!_(r,r.next)&&0!==y(r.prev,r,r.next))r=r.next;else{if(S(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function a(e,t,n,r,i,f,h){if(e){!h&&f&&function(e,t,n,r){var i=e;do{null===i.z&&(i.z=d(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,function(e){var t,n,r,i,o,a,s,u,l=1;do{for(n=e,e=null,o=null,a=0;n;){for(a++,r=n,s=0,t=0;t<l&&(s++,r=r.nextZ);t++);for(u=l;s>0||u>0&&r;)0!==s&&(0===u||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,u--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;n=r}o.nextZ=null,l*=2}while(a>1)}(i)}(e,r,i,f);for(var p,v,g=e;e.prev!==e.next;)if(p=e.prev,v=e.next,f?u(e,r,i,f):s(e))t.push(p.i/n),t.push(e.i/n),t.push(v.i/n),S(e),e=v.next,g=v.next;else if((e=v)===g){h?1===h?a(e=l(e,t,n),t,n,r,i,f,2):2===h&&c(e,t,n,r,i,f):a(o(e),t,n,r,i,f,1);break}}}function s(e){var t=e.prev,n=e,r=e.next;if(y(t,n,r)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(v(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&y(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function u(e,t,n,r){var i=e.prev,o=e,a=e.next;if(y(i,o,a)>=0)return!1;for(var s=i.x<o.x?i.x<a.x?i.x:a.x:o.x<a.x?o.x:a.x,u=i.y<o.y?i.y<a.y?i.y:a.y:o.y<a.y?o.y:a.y,l=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,c=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,f=d(s,u,t,n,r),h=d(l,c,t,n,r),p=e.prevZ,g=e.nextZ;p&&p.z>=f&&g&&g.z<=h;){if(p!==e.prev&&p!==e.next&&v(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&y(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,g!==e.prev&&g!==e.next&&v(i.x,i.y,o.x,o.y,a.x,a.y,g.x,g.y)&&y(g.prev,g,g.next)>=0)return!1;g=g.nextZ}for(;p&&p.z>=f;){if(p!==e.prev&&p!==e.next&&v(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&y(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;g&&g.z<=h;){if(g!==e.prev&&g!==e.next&&v(i.x,i.y,o.x,o.y,a.x,a.y,g.x,g.y)&&y(g.prev,g,g.next)>=0)return!1;g=g.nextZ}return!0}function l(e,t,n){var r=e;do{var i=r.prev,o=r.next.next;!_(i,o)&&m(i,r,r.next,o)&&b(i,o)&&b(o,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(o.i/n),S(r),S(r.next),r=e=o),r=r.next}while(r!==e);return r}function c(e,t,n,r,i,s){var u=e;do{for(var l=u.next.next;l!==u.prev;){if(u.i!==l.i&&g(u,l)){var c=E(u,l);return u=o(u,u.next),c=o(c,c.next),a(u,t,n,r,i,s),void a(c,t,n,r,i,s)}l=l.next}u=u.next}while(u!==e)}function f(e,t){return e.x-t.x}function h(e,t){if(t=function(e,t){var n,r=t,i=e.x,o=e.y,a=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>a){if(a=s,s===i){if(o===r.y)return r;if(o===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(i===a)return n.prev;var u,l=n,c=n.x,f=n.y,h=1/0;r=n.next;for(;r!==l;)i>=r.x&&r.x>=c&&i!==r.x&&v(o<f?i:a,o,c,f,o<f?a:i,o,r.x,r.y)&&((u=Math.abs(o-r.y)/(i-r.x))<h||u===h&&r.x>n.x)&&b(r,e)&&(n=r,h=u),r=r.next;return n}(e,t)){var n=E(t,e);o(n,n.next)}}function d(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function p(e){var t=e,n=e;do{t.x<n.x&&(n=t),t=t.next}while(t!==e);return n}function v(e,t,n,r,i,o,a,s){return(i-a)*(t-s)-(e-a)*(o-s)>=0&&(e-a)*(r-s)-(n-a)*(t-s)>=0&&(n-a)*(o-s)-(i-a)*(r-s)>=0}function g(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(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&&m(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&b(e,t)&&b(t,e)&&function(e,t){var n=e,r=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)}function y(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function _(e,t){return e.x===t.x&&e.y===t.y}function m(e,t,n,r){return!!(_(e,t)&&_(n,r)||_(e,r)&&_(n,t))||y(e,t,n)>0!=y(e,t,r)>0&&y(n,r,e)>0!=y(n,r,t)>0}function b(e,t){return y(e.prev,e,e.next)<0?y(e,t,e.next)>=0&&y(e,e.prev,t)>=0:y(e,t,e.prev)<0||y(e,e.next,t)<0}function E(e,t){var n=new P(e.i,e.x,e.y),r=new P(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function w(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 S(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 T(e,t,n,r){for(var i=0,o=t,a=n-r;o<n;o+=r)i+=(e[a]-e[o])*(e[o+1]+e[a+1]),a=o;return i}e.exports=r,e.exports.default=r,r.deviation=function(e,t,n,r){var i=t&&t.length,o=i?t[0]*n:e.length,a=Math.abs(T(e,0,o,n));if(i)for(var s=0,u=t.length;s<u;s++){var l=t[s]*n,c=s<u-1?t[s+1]*n:e.length;a-=Math.abs(T(e,l,c,n))}var f=0;for(s=0;s<r.length;s+=3){var h=r[s]*n,d=r[s+1]*n,p=r[s+2]*n;f+=Math.abs((e[h]-e[p])*(e[d+1]-e[h+1])-(e[h]-e[d])*(e[p+1]-e[h+1]))}return 0===a&&0===f?0:Math.abs((f-a)/a)},r.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,i=0;i<e.length;i++){for(var o=0;o<e[i].length;o++)for(var a=0;a<t;a++)n.vertices.push(e[i][o][a]);i>0&&(r+=e[i-1].length,n.holes.push(r))}return n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PolygonTesselator=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=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}(n(51)),o=n(6),a=n(2);var s=o.experimental.fillArray,u=a.fp64.fp64LowPart;var l=[0,0,0,255];t.PolygonTesselator=function(){function e(t){var n=t.polygons,r=t.IndexType;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var o=function(e){return e.reduce(function(e,t){return e+i.getVertexCount(t)},0)}(n=n.map(function(e){return i.normalize(e)}));if(this.polygons=n,this.pointCount=o,this.IndexType=r,r===Uint16Array&&o>65535)throw new Error("Vertex count exceeds browser's limit");this.attributes={pickingColors:function(e){var t=e.polygons,n=e.pointCount,r=new Uint8ClampedArray(3*n),o=0;return t.forEach(function(e,t){var n,a=(n=t,[255&++n,n>>8&255,n>>16&255]),u=i.getVertexCount(e);s({target:r,source:a,start:o,count:u}),o+=a.length*u}),r}({polygons:n,pointCount:o})}}return r(e,[{key:"updatePositions",value:function(e){var t=e.fp64,n=e.extruded,r=this.attributes,o=this.polygons,a=this.pointCount;r.positions=r.positions||new Float32Array(3*a),r.nextPositions=r.nextPositions||new Float32Array(3*a),t&&(r.positions64xyLow=r.positions64xyLow||new Float32Array(2*a),r.nextPositions64xyLow=r.nextPositions64xyLow||new Float32Array(2*a)),function(e){var t=e.cache,n=t.positions,r=t.positions64xyLow,o=t.nextPositions,a=t.nextPositions64xyLow,s=e.polygons,l=e.extruded,c=e.fp64,f=0,h=0,d=null,p=function(){d&&(o[3*h]=d.x,o[3*h+1]=d.y,o[3*h+2]=d.z,c&&(a[2*h]=d.xLow,a[2*h+1]=d.yLow),h++),d=null};s.forEach(function(e,t){i.forEachVertex(e,function(e,t){var i=e[0],s=e[1],v=e[2]||0,g=void 0,y=void 0;n[3*f]=i,n[3*f+1]=s,n[3*f+2]=v,c&&(g=u(i),y=u(s),r[2*f]=g,r[2*f+1]=y),f++,l&&t>0&&(o[3*h]=i,o[3*h+1]=s,o[3*h+2]=v,c&&(a[2*h]=g,a[2*h+1]=y),h++),0===t&&(p(),function(e,t,n,r,i){l&&(d={x:e,y:t,z:n,xLow:r,yLow:i})}(i,s,v,g,y))})}),p()}({cache:r,polygons:o,extruded:n,fp64:t})}},{key:"indices",value:function(){return function(e){var t=e.polygons,n=e.IndexType,r=void 0===n?Uint32Array:n,o=3*function(e){return e.reduce(function(e,t){return e+i.getTriangleCount(t)},0)}(t),a=function(e){var t=new Array(e.length+1);t[0]=0;var n=0;return e.forEach(function(e,r){n+=i.getVertexCount(e),t[r+1]=n}),t}(t),s=new r(o),u=0;return t.forEach(function(e,t){var n=!0,r=!1,o=void 0;try{for(var l,c=i.getSurfaceIndices(e)[Symbol.iterator]();!(n=(l=c.next()).done);n=!0){var f=l.value;s[u++]=f+a[t]}}catch(e){r=!0,o=e}finally{try{!n&&c.return&&c.return()}finally{if(r)throw o}}}),s}({polygons:this.polygons,IndexType:this.IndexType})}},{key:"positions",value:function(){return this.attributes.positions}},{key:"positions64xyLow",value:function(){return this.attributes.positions64xyLow}},{key:"nextPositions",value:function(){return this.attributes.nextPositions}},{key:"nextPositions64xyLow",value:function(){return this.attributes.nextPositions64xyLow}},{key:"elevations",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.key,n=void 0===t?"elevations":t,r=e.getElevation,o=void 0===r?function(e){return 100}:r,a=this.attributes,u=this.polygons,l=this.pointCount,c=function(e){var t=e.cache,n=e.polygons,r=e.pointCount,o=e.getElevation,a=t||new Float32Array(r),u=0;return n.forEach(function(e,t){var n=o(t),r=i.getVertexCount(e);s({target:a,source:[n],start:u,count:r}),u+=r}),a}({cache:a[n],polygons:u,pointCount:l,getElevation:o});return a[n]=c,c}},{key:"colors",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.key,n=void 0===t?"colors":t,r=e.getColor,o=void 0===r?function(e){return l}:r,a=this.attributes,u=this.polygons,c=this.pointCount,f=function(e){var t=e.cache,n=e.polygons,r=e.pointCount,o=e.getColor,a=t||new Uint8ClampedArray(4*r),u=0;return n.forEach(function(e,t){var n=o(t);isNaN(n[3])&&(n[3]=255);var r=i.getVertexCount(e);s({target:a,source:n,start:u,count:r}),u+=n.length*r}),a}({cache:a[n],polygons:u,pointCount:c,getColor:o});return a[n]=f,f}},{key:"pickingColors",value:function(){return this.attributes.pickingColors}}]),e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(6),o=u(n(52)),a=u(n(37)),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}(n(51));function u(e){return e&&e.__esModule?e:{default:e}}var l=[0,0,0,255],c=[0,0,0,255],f={stroked:!0,filled:!0,extruded:!1,elevationScale:1,wireframe:!1,lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,lineJointRounded:!1,lineMiterLimit:4,lineDashJustified:!1,fp64:!1,getPolygon:function(e){return e.polygon},getFillColor:function(e){return e.fillColor||c},getLineColor:function(e){return e.lineColor||l},getLineWidth:function(e){return e.lineWidth||1},getLineDashArray:null,getElevation:function(e){return e.elevation||1e3},lightSettings:{}},h=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(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)}(t,i.CompositeLayer),r(t,[{key:"initializeState",value:function(){this.state={paths:[]}}},{key:"updateState",value:function(e){var t=this,n=(e.oldProps,e.props,e.changeFlags);if(n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getPolygon)){var r=this.props,i=r.data,o=r.getPolygon;this.state.paths=[],i.forEach(function(e){s.normalize(o(e)).forEach(function(n){return t.state.paths.push({path:n,object:e})})})}}},{key:"getPickingInfo",value:function(e){var t=e.info;return Object.assign(t,{object:t.object&&t.object.object||t.object})}},{key:"_getAccessor",value:function(e){return"function"==typeof e?function(t){return e(t.object)}:e}},{key:"renderLayers",value:function(){var e=this.props,t=e.data,n=e.stroked,r=e.filled,i=e.extruded,s=e.wireframe,u=e.elevationScale,l=this.props,c=l.lineWidthScale,f=l.lineWidthMinPixels,h=l.lineWidthMaxPixels,d=l.lineJointRounded,p=l.lineMiterLimit,v=l.lineDashJustified,g=l.fp64,y=this.props,_=y.getFillColor,m=y.getLineColor,b=y.getLineWidth,E=y.getLineDashArray,w=y.getElevation,S=y.getPolygon,P=y.updateTriggers,T=y.lightSettings,A=this.state.paths,x=t&&t.length>0,O=x&&new o.default(this.getSubLayerProps({id:"fill",updateTriggers:{getElevation:P.getElevation,getFillColor:P.getFillColor,getLineColor:P.getLineColor}}),{data:t,extruded:i,elevationScale:u,fp64:g,filled:r,wireframe:s,getPolygon:S,getElevation:w,getFillColor:_,getLineColor:m,lightSettings:T}),R=!i&&n&&x&&new a.default(this.getSubLayerProps({id:"stroke",updateTriggers:{getWidth:P.getLineWidth,getColor:P.getLineColor,getDashArray:P.getLineDashArray}}),{data:A,fp64:g,widthScale:c,widthMinPixels:f,widthMaxPixels:h,rounded:d,miterLimit:p,dashJustified:v,getPath:function(e){return e.path},getColor:this._getAccessor(m),getWidth:this._getAccessor(b),getDashArray:this._getAccessor(E)});return[!i&&O,R,i&&O]}}]),t}();t.default=h,h.layerName="PolygonLayer",h.defaultProps=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="#define SHADER_NAME path-layer-fragment-shader\n\n#ifdef GL_ES\nprecision highp float;\n#endif\n\nuniform float jointType;\nuniform float miterLimit;\nuniform float alignMode;\n\nvarying vec4 vColor;\nvarying vec2 vCornerOffset;\nvarying float vMiterLength;\nvarying vec2 vDashArray;\nvarying float vPathPosition;\nvarying float vPathLength;\n\n// mod doesn't work correctly for negative numbers\nfloat mod2(float a, float b) {\n return a - floor(a / b) * b;\n}\n\nfloat round(float x) {\n return floor(x + 0.5);\n}\n\n// if given position is in the gap part of the dashed line\n// dashArray.x: solid stroke length, relative to width\n// dashArray.y: gap length, relative to width\n// alignMode:\n// 0 - no adjustment\n// o---- ---- ---- ---- o---- -o---- ---- o\n// 1 - stretch to fit, draw half dash at each end for nicer joints\n// o-- ---- ---- ---- --o-- --o-- ---- --o\nbool dash_isFragInGap() {\n float solidLength = vDashArray.x;\n float gapLength = vDashArray.y;\n\n float unitLength = solidLength + gapLength;\n\n if (unitLength == 0.0) {\n return false;\n }\n\n unitLength = mix(\n unitLength,\n vPathLength / round(vPathLength / unitLength),\n alignMode\n );\n\n float offset = alignMode * solidLength / 2.0;\n\n return gapLength > 0.0 &&\n vPathPosition >= 0.0 &&\n vPathPosition <= vPathLength &&\n mod2(vPathPosition + offset, unitLength) > solidLength;\n}\n\nvoid main(void) {\n // if joint is rounded, test distance from the corner\n if (jointType > 0.0 && vMiterLength > 0.0 && length(vCornerOffset) > 1.0) {\n // Enable to debug joints\n // gl_FragColor = vec4(0., 1., 0., 1.);\n // return;\n discard;\n }\n if (jointType == 0.0 && vMiterLength > miterLimit) {\n // Enable to debug joints\n // gl_FragColor = vec4(0., 0., 1., 1.);\n // return;\n discard;\n }\n if (vColor.a == 0.0 || dash_isFragInGap()) {\n // Enable to debug joints\n // gl_FragColor = vec4(0., 1., 1., 1.);\n // return;\n discard;\n }\n gl_FragColor = vColor;\n\n // use highlight color if this fragment belongs to the selected object.\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n\n // use picking color if rendering to picking FBO.\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n}\n"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="\n#define SHADER_NAME path-layer-vertex-shader\n\nattribute vec3 positions;\n\nattribute vec3 instanceStartPositions;\nattribute vec3 instanceEndPositions;\nattribute vec4 instanceStartEndPositions64xyLow;\nattribute vec3 instanceLeftDeltas;\nattribute vec3 instanceRightDeltas;\nattribute float instanceStrokeWidths;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec2 instanceDashArrays;\n\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform float jointType;\nuniform float miterLimit;\n\nuniform float opacity;\n\nvarying vec4 vColor;\nvarying vec2 vCornerOffset;\nvarying float vMiterLength;\nvarying vec2 vDashArray;\nvarying float vPathPosition;\nvarying float vPathLength;\n\nconst float EPSILON = 0.001;\nconst float PIXEL_EPSILON = 0.1;\n\nfloat flipIfTrue(bool flag) {\n return -(float(flag) * 2. - 1.);\n}\n\nvec3 lineJoin(vec2 prevPoint64[2], vec2 currPoint64[2], vec2 nextPoint64[2]) {\n\n float width = clamp(project_scale(instanceStrokeWidths * widthScale),\n widthMinPixels, widthMaxPixels) / 2.0;\n\n vec2 deltaA64[2];\n vec2 deltaB64[2];\n\n vec2_sub_fp64(currPoint64, prevPoint64, deltaA64);\n vec2_sub_fp64(nextPoint64, currPoint64, deltaB64);\n\n vec2 lengthA64 = vec2_length_fp64(deltaA64);\n vec2 lengthB64 = vec2_length_fp64(deltaB64);\n\n vec2 deltaA = vec2(deltaA64[0].x, deltaA64[1].x);\n vec2 deltaB = vec2(deltaB64[0].x, deltaB64[1].x);\n\n float lenA = lengthA64.x;\n float lenB = lengthB64.x;\n\n vec2 offsetVec;\n float offsetScale;\n float offsetDirection;\n\n // when two points are closer than PIXEL_EPSILON in pixels,\n // assume they are the same point to avoid precision issue\n lenA = lenA > PIXEL_EPSILON ? lenA : 0.0;\n lenB = lenB > PIXEL_EPSILON ? lenB : 0.0;\n vec2 dirA = lenA > 0. ? deltaA / lenA : vec2(0.0, 0.0);\n vec2 dirB = lenB > 0. ? deltaB / lenB : vec2(0.0, 0.0);\n\n vec2 perpA = vec2(-dirA.y, dirA.x);\n vec2 perpB = vec2(-dirB.y, dirB.x);\n\n // tangent of the corner\n vec2 tangent = vec2(dirA + dirB);\n tangent = length(tangent) > 0. ? normalize(tangent) : perpA;\n // direction of the corner\n vec2 miterVec = vec2(-tangent.y, tangent.x);\n // width offset from current position\n vec2 perp = mix(perpB, perpA, positions.x);\n float L = mix(lenB, lenA, positions.x);\n\n // cap super sharp angles\n float sinHalfA = abs(dot(miterVec, perp));\n float cosHalfA = abs(dot(dirA, miterVec));\n bool turnsRight = dirA.x * dirB.y > dirA.y * dirB.x;\n\n // relative position to the corner:\n // -1: inside (smaller side of the angle)\n // 0: center\n // 1: outside (bigger side of the angle)\n float cornerPosition = mix(\n flipIfTrue(turnsRight == (positions.y > 0.0)),\n 0.0,\n positions.z\n );\n\n offsetScale = 1.0 / max(sinHalfA, EPSILON);\n\n // do not bevel if line segment is too short\n cornerPosition *= float(cornerPosition <= 0.0 || sinHalfA < min(lenA, lenB) / width * cosHalfA);\n // trim if inside corner extends further than the line segment\n offsetScale = mix(\n offsetScale,\n min(offsetScale, L / width / max(cosHalfA, EPSILON)),\n float(cornerPosition < 0.0)\n );\n\n vMiterLength = mix(\n offsetScale * cornerPosition,\n mix(offsetScale, 0.0, cornerPosition),\n step(0.0, cornerPosition)\n ) - sinHalfA * jointType;\n offsetDirection = mix(\n positions.y,\n mix(\n flipIfTrue(turnsRight),\n positions.y * flipIfTrue(turnsRight == (positions.x == 1.)),\n cornerPosition\n ),\n step(0.0, cornerPosition)\n );\n offsetVec = mix(miterVec, -tangent, step(0.5, cornerPosition));\n offsetScale = mix(offsetScale, 1.0 / max(cosHalfA, 0.001), step(0.5, cornerPosition));\n\n // special treatment for start cap and end cap\n // using a small number as the limit for determining if the lenA or lenB is 0\n float isStartCap = step(lenA, 1.0e-5);\n float isEndCap = step(lenB, 1.0e-5);\n float isCap = max(isStartCap, isEndCap);\n\n // 0: center, 1: side\n cornerPosition = isCap * (1.0 - positions.z);\n\n // start of path: use next - curr\n offsetVec = mix(offsetVec, mix(dirB, perpB, cornerPosition), isStartCap);\n // end of path: use curr - prev\n offsetVec = mix(offsetVec, mix(dirA, perpA, cornerPosition), isEndCap);\n\n // extend out a triangle to envelope the round cap\n offsetScale = mix(\n offsetScale,\n mix(4.0 * jointType, 1.0, cornerPosition),\n isCap\n );\n vMiterLength = mix(vMiterLength, 1.0 - cornerPosition, isCap);\n\n offsetDirection = mix(\n offsetDirection,\n mix(flipIfTrue(isStartCap > 0.), positions.y, cornerPosition),\n isCap\n );\n\n vCornerOffset = offsetVec * offsetDirection * offsetScale;\n\n // Generate variables for dash calculation\n vDashArray = instanceDashArrays;\n vPathLength = L / width;\n float isEnd = positions.x;\n vec2 offsetFromStartOfPath = mix(vCornerOffset, vCornerOffset + deltaA / width, isEnd);\n vec2 dir = mix(dirB, dirA, isEnd);\n vPathPosition = dot(offsetFromStartOfPath, dir);\n\n return vec3(vCornerOffset * width, 0.0);\n}\n\nvoid main() {\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity) / 255.;\n\n // Set color to be rendered to picking fbo (also used to check for selection highlight).\n picking_setPickingColor(instancePickingColors);\n\n float isEnd = positions.x;\n\n // Calculate current position 64bit\n\n vec3 currPosition = mix(instanceStartPositions, instanceEndPositions, isEnd);\n vec2 currPosition64xyLow = mix(instanceStartEndPositions64xyLow.xy, instanceStartEndPositions64xyLow.zw, isEnd);\n vec2 projected_curr_position[2];\n project_position_fp64(currPosition.xy, currPosition64xyLow, projected_curr_position);\n float projected_curr_position_z = project_scale(currPosition.z);\n\n // Calculate previous position\n\n vec3 prevPosition = mix(-instanceLeftDeltas, vec3(0.0), isEnd) + instanceStartPositions;\n\n // Calculate prev position 64bit\n\n vec2 projected_prev_position[2];\n project_position_fp64(prevPosition.xy, instanceStartEndPositions64xyLow.xy, projected_prev_position);\n\n // Calculate next positions\n vec3 nextPosition = mix(vec3(0.0), instanceRightDeltas, isEnd) + instanceEndPositions;\n\n // Calculate next position 64bit\n\n vec2 projected_next_position[2];\n project_position_fp64(nextPosition.xy, instanceStartEndPositions64xyLow.zw, projected_next_position);\n\n vec3 pos = lineJoin(projected_prev_position, projected_curr_position, projected_next_position);\n vec2 vertex_pos_modelspace[4];\n\n vertex_pos_modelspace[0] = sum_fp64(vec2(pos.x, 0.0), projected_curr_position[0]);\n vertex_pos_modelspace[1] = sum_fp64(vec2(pos.y, 0.0), projected_curr_position[1]);\n vertex_pos_modelspace[2] = vec2(pos.z + projected_curr_position_z, 0.0);\n vertex_pos_modelspace[3] = vec2(1.0, 0.0);\n\n gl_Position = project_to_clipspace_fp64(vertex_pos_modelspace);\n}\n"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="#define SHADER_NAME path-layer-vertex-shader-64\n\nattribute vec3 positions;\n\nattribute vec3 instanceStartPositions;\nattribute vec3 instanceEndPositions;\nattribute vec3 instanceLeftDeltas;\nattribute vec3 instanceRightDeltas;\nattribute float instanceStrokeWidths;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec2 instanceDashArrays;\n\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform float jointType;\nuniform float miterLimit;\n\nuniform float opacity;\n\nvarying vec4 vColor;\nvarying vec2 vCornerOffset;\nvarying float vMiterLength;\nvarying vec2 vDashArray;\nvarying float vPathPosition;\nvarying float vPathLength;\n\nconst float EPSILON = 0.001;\nconst float PIXEL_EPSILON = 0.1;\n\nfloat flipIfTrue(bool flag) {\n return -(float(flag) * 2. - 1.);\n}\n\n// calculate line join positions\nvec3 lineJoin(\n vec3 prevPoint, vec3 currPoint, vec3 nextPoint,\n float relativePosition, bool isEnd, bool isJoint,\n float width\n) {\n vec2 deltaA = currPoint.xy - prevPoint.xy;\n vec2 deltaB = nextPoint.xy - currPoint.xy;\n\n float lenA = length(deltaA);\n float lenB = length(deltaB);\n\n // when two points are closer than PIXEL_EPSILON in pixels,\n // assume they are the same point to avoid precision issue\n lenA = lenA > PIXEL_EPSILON ? lenA : 0.0;\n lenB = lenB > PIXEL_EPSILON ? lenB : 0.0;\n\n vec2 dirA = lenA > 0. ? normalize(deltaA) : vec2(0.0, 0.0);\n vec2 dirB = lenB > 0. ? normalize(deltaB) : vec2(0.0, 0.0);\n\n vec2 perpA = vec2(-dirA.y, dirA.x);\n vec2 perpB = vec2(-dirB.y, dirB.x);\n\n // tangent of the corner\n vec2 tangent = vec2(dirA + dirB);\n tangent = length(tangent) > 0. ? normalize(tangent) : perpA;\n // direction of the corner\n vec2 miterVec = vec2(-tangent.y, tangent.x);\n // width offset from current position\n vec2 perp = isEnd ? perpA : perpB;\n float L = isEnd ? lenA : lenB;\n\n // cap super sharp angles\n float sinHalfA = abs(dot(miterVec, perp));\n float cosHalfA = abs(dot(dirA, miterVec));\n\n bool turnsRight = dirA.x * dirB.y > dirA.y * dirB.x;\n\n float offsetScale = 1.0 / max(sinHalfA, EPSILON);\n\n float cornerPosition = isJoint ?\n 0.0 :\n flipIfTrue(turnsRight == (relativePosition > 0.0));\n\n // do not bevel if line segment is too short\n cornerPosition *=\n float(cornerPosition <= 0.0 || sinHalfA < min(lenA, lenB) / width * cosHalfA);\n\n // trim if inside corner extends further than the line segment\n if (cornerPosition < 0.0) {\n offsetScale = min(offsetScale, L / width / max(cosHalfA, EPSILON));\n }\n\n vMiterLength = cornerPosition >= 0.0 ?\n mix(offsetScale, 0.0, cornerPosition) :\n offsetScale * cornerPosition;\n vMiterLength -= sinHalfA * jointType;\n\n float offsetDirection = mix(\n positions.y,\n mix(\n flipIfTrue(turnsRight),\n positions.y * flipIfTrue(turnsRight == (positions.x == 1.)),\n cornerPosition\n ),\n step(0.0, cornerPosition)\n );\n\n vec2 offsetVec = mix(miterVec, -tangent, step(0.5, cornerPosition));\n offsetScale = mix(offsetScale, 1.0 / max(cosHalfA, 0.001), step(0.5, cornerPosition));\n\n // special treatment for start cap and end cap\n // TODO - This has an issue. len is always positive because it is length.\n // Step returns zero if -lenA<0, so practically this is a comparison of\n // lenA with zero, with lots of problems because of the -lenA. Can we use EPSILON?\n bool isStartCap = step(0.0, -lenA) > 0.5;\n bool isEndCap = step(0.0, -lenB) > 0.5;\n bool isCap = isStartCap || isEndCap;\n\n // 0: center, 1: side\n cornerPosition = isCap ? (1.0 - positions.z) : 0.;\n\n // start of path: use next - curr\n if (isStartCap) {\n offsetVec = mix(dirB, perpB, cornerPosition);\n }\n\n // end of path: use curr - prev\n if (isEndCap) {\n offsetVec = mix(dirA, perpA, cornerPosition);\n }\n\n // extend out a triangle to envelope the round cap\n if (isCap) {\n offsetScale = mix(4.0 * jointType, 1.0, cornerPosition);\n vMiterLength = 1.0 - cornerPosition;\n offsetDirection = mix(flipIfTrue(isStartCap), positions.y, cornerPosition);\n }\n\n vCornerOffset = offsetVec * offsetDirection * offsetScale;\n\n // Generate variables for dash calculation\n vDashArray = instanceDashArrays;\n vPathLength = L / width;\n // vec2 offsetFromStartOfPath = isEnd ? vCornerOffset + deltaA / width : vCornerOffset;\n vec2 offsetFromStartOfPath = vCornerOffset;\n if (isEnd) {\n offsetFromStartOfPath += deltaA / width;\n }\n vec2 dir = isEnd ? dirA : dirB;\n vPathPosition = dot(offsetFromStartOfPath, dir);\n\n return currPoint + vec3(vCornerOffset * width, 0.0);\n}\n\n// calculate line join positions\n// extract params from attributes and uniforms\nvec3 lineJoin(vec3 prevPoint, vec3 currPoint, vec3 nextPoint) {\n\n // relative position to the corner:\n // -1: inside (smaller side of the angle)\n // 0: center\n // 1: outside (bigger side of the angle)\n\n float relativePosition = positions.y;\n bool isEnd = positions.x > EPSILON;\n bool isJoint = positions.z > EPSILON;\n\n float width = clamp(project_scale(instanceStrokeWidths * widthScale),\n widthMinPixels, widthMaxPixels) / 2.0;\n\n return lineJoin(\n prevPoint, currPoint, nextPoint,\n relativePosition, isEnd, isJoint,\n width\n );\n}\n\nvoid main() {\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity) / 255.;\n\n // Set color to be rendered to picking fbo (also used to check for selection highlight).\n picking_setPickingColor(instancePickingColors);\n\n float isEnd = positions.x;\n\n vec3 prevPosition = mix(-instanceLeftDeltas, vec3(0.0), isEnd) + instanceStartPositions;\n prevPosition = project_position(prevPosition);\n\n vec3 currPosition = mix(instanceStartPositions, instanceEndPositions, isEnd);\n currPosition = project_position(currPosition);\n\n vec3 nextPosition = mix(vec3(0.0), instanceRightDeltas, isEnd) + instanceEndPositions;\n nextPosition = project_position(nextPosition);\n\n vec3 pos = lineJoin(prevPosition, currPosition, nextPosition);\n\n gl_Position = project_to_clipspace(vec4(pos, 1.0));\n}\n"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pointToHexbin=function(e,t){var n=e.data,o=e.radius,a=e.getPosition,s=i(o,t),u=n.map(function(e){return Object.assign({screenCoord:t.projectFlat(a(e))},e)});return{hexagons:(0,r.hexbin)().radius(s).x(function(e){return e.screenCoord[0]}).y(function(e){return e.screenCoord[1]})(u).map(function(e,n){return{centroid:t.unprojectFlat([e.x,e.y]),points:e,index:n}})}},t.getRadiusInPixel=i;var r=n(116);function i(e,t){return e*t.getDistanceScales().pixelsPerMeter[2]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="#define SHADER_NAME hexagon-cell-layer-fragment-shader\n\n#ifdef GL_ES\nprecision highp float;\n#endif\n\nvarying vec4 vColor;\n\nvoid main(void) {\n gl_FragColor = vColor;\n\n // use highlight color if this fragment belongs to the selected object.\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n\n // use picking color if rendering to picking FBO.\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n}\n"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="\n#define SHADER_NAME hexagon-cell-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 normals;\n\nattribute vec2 instancePositions;\nattribute float instanceElevations;\nattribute vec2 instancePositions64xyLow;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\n\n// Custom uniforms\nuniform float opacity;\nuniform float radius;\nuniform float angle;\nuniform float extruded;\nuniform float coverage;\nuniform float elevationScale;\n\n// Result\nvarying vec4 vColor;\n\n// A magic number to scale elevation so that 1 unit approximate to 1 meter.\n#define ELEVATION_SCALE 0.8\n\nvoid main(void) {\n\n // rotate primitive position and normal\n mat2 rotationMatrix = mat2(cos(angle), sin(angle), -sin(angle), cos(angle));\n\n // calculate elevation, if 3d not enabled set to 0\n // cylindar gemoetry height are between -0.5 to 0.5, transform it to between 0, 1\n float elevation = 0.0;\n\n if (extruded > 0.5) {\n elevation = instanceElevations * (positions.z + 0.5) *\n ELEVATION_SCALE * elevationScale;\n }\n\n // if ahpha == 0.0 or z < 0.0, do not render element\n float noRender = float(instanceColors.a == 0.0 || instanceElevations < 0.0);\n float dotRadius = project_scale(radius) * mix(coverage, 0.0, noRender);\n\n // project center of hexagon\n vec3 centroidPosition = vec3(instancePositions, elevation);\n vec2 centroidPosition64xyLow = instancePositions64xyLow;\n vec3 offset = vec3(rotationMatrix * positions.xy * dotRadius, 0.);\n\n vec4 position_worldspace;\n gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64xyLow, offset, position_worldspace);\n\n // Light calculations\n // Worldspace is the linear space after Mercator projection\n\n vec3 normals_worldspace = vec3(rotationMatrix * normals.xy, normals.z);\n\n float lightWeight = 1.0;\n\n if (extruded > 0.5) {\n lightWeight = lighting_getLightWeight(\n position_worldspace.xyz, // the w component is always 1.0\n normals_worldspace\n );\n }\n\n vec3 lightWeightedColor = lightWeight * instanceColors.rgb;\n\n // opacity-multiplied instance color\n vColor = vec4(lightWeightedColor, opacity * instanceColors.a) / 255.0;\n\n // Set color to be rendered to picking fbo (also used to check for selection highlight).\n picking_setPickingColor(instancePickingColors);\n}\n"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(6),a=n(53),s=(r=a)&&r.__esModule?r:{default:r},u=n(133);var l=o.experimental.BinSorter,c=o.experimental.getQuantizeScale,f=o.experimental.getLinearScale;function h(){}var d={colorDomain:null,colorRange:o.experimental.defaultColorRange,getColorValue:function(e){return e.length},lowerPercentile:0,upperPercentile:100,onSetColorDomain:h,elevationDomain:null,elevationRange:[0,1e3],getElevationValue:function(e){return e.length},elevationLowerPercentile:0,elevationUpperPercentile:100,elevationScale:{type:"number",min:0,value:1},onSetElevationDomain:h,radius:1e3,coverage:{type:"number",min:0,max:1,value:1},extruded:!1,hexagonAggregator:u.pointToHexbin,getPosition:function(e){return e.position},fp64:!1,lightSettings:{}},p=function(e){function t(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),e.hexagonAggregator||e.radius||(o.log.once(0,"HexagonLayer: Default hexagonAggregator requires radius prop to be set, Now using 1000 meter as default")(),e.radius=d.radius),Number.isFinite(e.upperPercentile)&&(e.upperPercentile>100||e.upperPercentile<0)&&(o.log.once(0,"HexagonLayer: upperPercentile should be between 0 and 100. Assign to 100 by default")(),e.upperPercentile=d.upperPercentile),Number.isFinite(e.lowerPercentile)&&(e.lowerPercentile>100||e.lowerPercentile<0)&&(o.log.once(0,"HexagonLayer: lowerPercentile should be between 0 and 100. Assign to 0 by default")(),e.lowerPercentile=d.upperPercentile),e.lowerPercentile>=e.upperPercentile&&(o.log.once(0,"HexagonLayer: lowerPercentile should not be bigger than upperPercentile. Assign to 0 by default")(),e.lowerPercentile=d.lowerPercentile),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return function(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)}(t,o.CompositeLayer),i(t,[{key:"initializeState",value:function(){this.state={hexagons:[],hexagonVertices:null,sortedColorBins:null,sortedElevationBins:null,colorValueDomain:null,elevationValueDomain:null,colorScaleFunc:h,elevationScaleFunc:h,dimensionUpdaters:this.getDimensionUpdaters()}}},{key:"updateState",value:function(e){var t=this,n=e.oldProps,r=e.props,i=e.changeFlags,o=this.getDimensionChanges(n,r);i.dataChanged||this.needsReProjectPoints(n,r)?this.getHexagons():o&&o.forEach(function(e){return"function"==typeof e&&e.apply(t)})}},{key:"needsReProjectPoints",value:function(e,t){return e.radius!==t.radius||e.hexagonAggregator!==t.hexagonAggregator}},{key:"getDimensionUpdaters",value:function(){return{getColor:[{id:"value",triggers:["getColorValue"],updater:this.getSortedColorBins},{id:"domain",triggers:["lowerPercentile","upperPercentile"],updater:this.getColorValueDomain},{id:"scaleFunc",triggers:["colorDomain","colorRange"],updater:this.getColorScale}],getElevation:[{id:"value",triggers:["getElevationValue"],updater:this.getSortedElevationBins},{id:"domain",triggers:["elevationLowerPercentile","elevationUpperPercentile"],updater:this.getElevationValueDomain},{id:"scaleFunc",triggers:["elevationDomain","elevationRange"],updater:this.getElevationScale}]}}},{key:"getDimensionChanges",value:function(e,t){var n=this.state.dimensionUpdaters,r=[];for(var i in n){var o=n[i].find(function(n){return n.triggers.some(function(n){return e[n]!==t[n]})});o&&r.push(o.updater)}return r.length?r:null}},{key:"getHexagons",value:function(){var e=this.props.hexagonAggregator,t=this.context.viewport,n=e(this.props,t),r=n.hexagons,i=n.hexagonVertices;this.setState({hexagons:r,hexagonVertices:i}),this.getSortedBins()}},{key:"getPickingInfo",value:function(e){var t=e.info,n=this.state,r=n.sortedColorBins,i=n.sortedElevationBins,o=null;if(t.picked&&t.index>-1){var a=this.state.hexagons[t.index],s=r.binMap[a.index]&&r.binMap[a.index].value,u=i.binMap[a.index]&&i.binMap[a.index].value;o=Object.assign({colorValue:s,elevationValue:u},a)}return Object.assign(t,{picked:Boolean(o),object:o})}},{key:"getUpdateTriggers",value:function(){var e=this,t=this.state.dimensionUpdaters,n={},r=function(r){n[r]={};var i=!0,o=!1,a=void 0;try{for(var s,u=t[r][Symbol.iterator]();!(i=(s=u.next()).done);i=!0){s.value.triggers.forEach(function(t){n[r][t]=e.props[t]})}}catch(e){o=!0,a=e}finally{try{!i&&u.return&&u.return()}finally{if(o)throw a}}};for(var i in t)r(i);return n}},{key:"getValueDomain",value:function(){this.getColorValueDomain(),this.getElevationValueDomain()}},{key:"getSortedBins",value:function(){this.getSortedColorBins(),this.getSortedElevationBins()}},{key:"getSortedColorBins",value:function(){var e=this.props.getColorValue,t=new l(this.state.hexagons||[],e);this.setState({sortedColorBins:t}),this.getColorValueDomain()}},{key:"getSortedElevationBins",value:function(){var e=this.props.getElevationValue,t=new l(this.state.hexagons||[],e);this.setState({sortedElevationBins:t}),this.getElevationValueDomain()}},{key:"getColorValueDomain",value:function(){var e=this.props,t=e.lowerPercentile,n=e.upperPercentile,r=e.onSetColorDomain;this.state.colorValueDomain=this.state.sortedColorBins.getValueRange([t,n]),"function"==typeof r&&r(this.state.colorValueDomain),this.getColorScale()}},{key:"getElevationValueDomain",value:function(){var e=this.props,t=e.elevationLowerPercentile,n=e.elevationUpperPercentile,r=e.onSetElevationDomain;this.state.elevationValueDomain=this.state.sortedElevationBins.getValueRange([t,n]),"function"==typeof r&&r(this.state.elevationValueDomain),this.getElevationScale()}},{key:"getColorScale",value:function(){var e=this.props.colorRange,t=this.props.colorDomain||this.state.colorValueDomain;this.state.colorScaleFunc=c(t,e)}},{key:"getElevationScale",value:function(){var e=this.props.elevationRange,t=this.props.elevationDomain||this.state.elevationValueDomain;this.state.elevationScaleFunc=f(t,e)}},{key:"_onGetSublayerColor",value:function(e){var t=this.state,n=t.sortedColorBins,r=t.colorScaleFunc,i=t.colorValueDomain,o=n.binMap[e.index]&&n.binMap[e.index].value,a=this.props.colorDomain||i,s=o>=a[0]&&o<=a[a.length-1]?r(o):[0,0,0,0];return s[3]=Number.isFinite(s[3])?s[3]:255,s}},{key:"_onGetSublayerElevation",value:function(e){var t=this.state,n=t.sortedElevationBins,r=t.elevationScaleFunc,i=t.elevationValueDomain,o=n.binMap[e.index]&&n.binMap[e.index].value,a=this.props.elevationDomain||i;return o>=a[0]&&o<=a[a.length-1]?r(o):-1}},{key:"getSubLayerProps",value:function(){var e=this.props,n=e.radius,r=e.elevationScale,i=e.extruded,o=e.coverage,a=e.lightSettings,s=e.fp64,u=e.transitions;return function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,r)}if("value"in i)return i.value;var a=i.get;return void 0!==a?a.call(r):void 0}(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"getSubLayerProps",this).call(this,{id:"hexagon-cell",data:this.state.hexagons,fp64:s,hexagonVertices:this.state.hexagonVertices,radius:n,elevationScale:r,angle:Math.PI/2,extruded:i,coverage:o,lightSettings:a,getColor:this._onGetSublayerColor.bind(this),getElevation:this._onGetSublayerElevation.bind(this),transitions:u&&{getColor:u.getColorValue,getElevation:u.getElevationValue},updateTriggers:this.getUpdateTriggers()})}},{key:"getSubLayerClass",value:function(){return s.default}},{key:"renderLayers",value:function(){return new(this.getSubLayerClass())(this.getSubLayerProps())}}]),t}();t.default=p,p.layerName="HexagonLayer",p.defaultProps=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pointToDensityGridData=function(e,t,n){var i=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1],n=arguments[2],i=1/0,o=-1/0,a=void 0,s=0;s<e.length;s++)a=n(e[s])[1],Number.isFinite(a)&&(i=a<i?a:i,o=a>o?a:o);var u=function(e,t){var n=(s=e,s/r*(180/Math.PI)),i=(o=t,a=e,a/r*(180/Math.PI)/Math.cos(o*Math.PI/180));var o,a;var s;return{yOffset:n,xOffset:i}}(t,(i+o)/2);if(u.xOffset<=0||u.yOffset<=0)return{gridHash:{},gridOffset:u};return{gridHash:e.reduce(function(e,t){var r=n(t)[1],i=n(t)[0];if(!Number.isFinite(r)||!Number.isFinite(i))return e;var o=Math.floor((r+90)/u.yOffset),a=Math.floor((i+180)/u.xOffset),s=o+"-"+a;return e[s]=e[s]||{count:0,points:[]},e[s].count+=1,e[s].points.push(t),e},{}),gridOffset:u}}(e,t,n),o=i.gridHash,a=i.gridOffset,s=function(e,t){return Object.keys(e).reduce(function(n,r,i){var o=r.split("-"),a=parseInt(o[0],10),s=parseInt(o[1],10);return n.push(Object.assign({index:i,position:[t.xOffset*s-180,t.yOffset*a-90]},e[r])),n},[])}(o,a);return{gridOffset:a,layerData:s}};var r=6378e3},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="#define SHADER_NAME grid-cell-layer-fragment-shader\n\n#ifdef GL_ES\nprecision highp float;\n#endif\n\nvarying vec4 vColor;\n\nvoid main(void) {\n gl_FragColor = vColor;\n\n // use highlight color if this fragment belongs to the selected object.\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n\n // use picking color if rendering to picking FBO.\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n}\n"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="#define SHADER_NAME grid-cell-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 normals;\n\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xyLow;\nattribute float instanceElevations;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\n\n// Custom uniforms\nuniform float extruded;\nuniform float cellSize;\nuniform float coverage;\nuniform float opacity;\nuniform float elevationScale;\n\n// A magic number to scale elevation so that 1 unit approximate to 1 meter\n#define ELEVATION_SCALE 0.8\n\n// Result\nvarying vec4 vColor;\n\nvoid main(void) {\n\n // if ahpha == 0.0 or z < 0.0, do not render element\n float noRender = float(instanceColors.a == 0.0 || instanceElevations < 0.0);\n float finalCellSize = project_scale(cellSize) * mix(1.0, 0.0, noRender);\n\n float elevation = 0.0;\n\n if (extruded > 0.5) {\n elevation = instanceElevations * (positions.z + 1.0) *\n ELEVATION_SCALE * elevationScale;\n }\n\n // cube geometry vertics are between -1 to 1, scale and transform it to between 0, 1\n vec3 extrudedPosition = vec3(instancePositions.xy, elevation);\n vec2 extrudedPosition64xyLow = instancePositions64xyLow;\n vec3 offset = vec3(\n (positions.x * coverage + 1.0) / 2.0 * finalCellSize,\n (positions.y * coverage - 1.0) / 2.0 * finalCellSize,\n 1.0);\n\n // extrude positions\n vec4 position_worldspace;\n gl_Position = project_position_to_clipspace(extrudedPosition, extrudedPosition64xyLow, offset, position_worldspace);\n\n float lightWeight = 1.0;\n\n if (extruded > 0.5) {\n lightWeight = lighting_getLightWeight(\n position_worldspace.xyz, // the w component is always 1.0\n normals\n );\n }\n\n vec3 lightWeightedColor = lightWeight * instanceColors.rgb;\n vec4 color = vec4(lightWeightedColor, instanceColors.a * opacity) / 255.0;\n vColor = color;\n\n // Set color to be rendered to picking fbo (also used to check for selection highlight).\n picking_setPickingColor(instancePickingColors);\n}\n"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(6),a=n(54),s=(r=a)&&r.__esModule?r:{default:r},u=n(137);var l=o.experimental.BinSorter,c=o.experimental.defaultColorRange,f=o.experimental.getQuantizeScale,h=o.experimental.getLinearScale;function d(){}var p={colorDomain:null,colorRange:c,getColorValue:function(e){return e.length},lowerPercentile:{type:"number",min:0,max:100,value:0},upperPercentile:{type:"number",min:0,max:100,value:100},onSetColorDomain:d,elevationDomain:null,elevationRange:[0,1e3],getElevationValue:function(e){return e.length},elevationLowerPercentile:{type:"number",min:0,max:100,value:0},elevationUpperPercentile:{type:"number",min:0,max:100,value:100},elevationScale:1,onSetElevationDomain:d,cellSize:{type:"number",min:0,max:1e3,value:1e3},coverage:{type:"number",min:0,max:1,value:1},getPosition:function(e){return e.position},extruded:!1,fp64:!1,lightSettings:{}},v=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(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)}(t,o.CompositeLayer),i(t,[{key:"initializeState",value:function(){this.state={layerData:[],sortedColorBins:null,sortedElevationBins:null,colorValueDomain:null,elevationValueDomain:null,colorScaleFunc:d,elevationScaleFunc:d,dimensionUpdaters:this.getDimensionUpdaters()}}},{key:"updateState",value:function(e){var t=this,n=e.oldProps,r=e.props,i=e.changeFlags,o=this.needsReProjectPoints(n,r);i.dataChanged||o?this.getLayerData():(this.getDimensionChanges(n,r)||[]).forEach(function(e){return"function"==typeof e&&e.apply(t)})}},{key:"needsReProjectPoints",value:function(e,t){return e.cellSize!==t.cellSize}},{key:"getDimensionUpdaters",value:function(){return{getColor:[{id:"value",triggers:["getColorValue"],updater:this.getSortedColorBins},{id:"domain",triggers:["lowerPercentile","upperPercentile"],updater:this.getColorValueDomain},{id:"scaleFunc",triggers:["colorDomain","colorRange"],updater:this.getColorScale}],getElevation:[{id:"value",triggers:["getElevationValue"],updater:this.getSortedElevationBins},{id:"domain",triggers:["elevationLowerPercentile","elevationUpperPercentile"],updater:this.getElevationValueDomain},{id:"scaleFunc",triggers:["elevationDomain","elevationRange"],updater:this.getElevationScale}]}}},{key:"getDimensionChanges",value:function(e,t){var n=this.state.dimensionUpdaters,r=[];for(var i in n){var o=n[i].find(function(n){return n.triggers.some(function(n){return e[n]!==t[n]})});o&&r.push(o.updater)}return r.length?r:null}},{key:"getPickingInfo",value:function(e){var t=e.info,n=this.state,r=n.sortedColorBins,i=n.sortedElevationBins,o=null;if(t.picked&&t.index>-1){var a=this.state.layerData[t.index],s=r.binMap[a.index]&&r.binMap[a.index].value,u=i.binMap[a.index]&&i.binMap[a.index].value;o=Object.assign({colorValue:s,elevationValue:u},a)}return Object.assign(t,{picked:Boolean(o),object:o})}},{key:"getUpdateTriggers",value:function(){var e=this,t=this.state.dimensionUpdaters,n={},r=function(r){n[r]={};var i=!0,o=!1,a=void 0;try{for(var s,u=t[r][Symbol.iterator]();!(i=(s=u.next()).done);i=!0){s.value.triggers.forEach(function(t){n[r][t]=e.props[t]})}}catch(e){o=!0,a=e}finally{try{!i&&u.return&&u.return()}finally{if(o)throw a}}};for(var i in t)r(i);return n}},{key:"getLayerData",value:function(){var e=this.props,t=e.data,n=e.cellSize,r=e.getPosition,i=(0,u.pointToDensityGridData)(t,n,r).layerData;this.setState({layerData:i}),this.getSortedBins()}},{key:"getValueDomain",value:function(){this.getColorValueDomain(),this.getElevationValueDomain()}},{key:"getSortedBins",value:function(){this.getSortedColorBins(),this.getSortedElevationBins()}},{key:"getSortedColorBins",value:function(){var e=this.props.getColorValue,t=new l(this.state.layerData||[],e);this.setState({sortedColorBins:t}),this.getColorValueDomain()}},{key:"getSortedElevationBins",value:function(){var e=this.props.getElevationValue,t=new l(this.state.layerData||[],e);this.setState({sortedElevationBins:t}),this.getElevationValueDomain()}},{key:"getColorValueDomain",value:function(){var e=this.props,t=e.lowerPercentile,n=e.upperPercentile,r=e.onSetColorDomain;this.state.colorValueDomain=this.state.sortedColorBins.getValueRange([t,n]),"function"==typeof r&&r(this.state.colorValueDomain),this.getColorScale()}},{key:"getElevationValueDomain",value:function(){var e=this.props,t=e.elevationLowerPercentile,n=e.elevationUpperPercentile,r=e.onSetElevationDomain;this.state.elevationValueDomain=this.state.sortedElevationBins.getValueRange([t,n]),"function"==typeof r&&r(this.state.elevationValueDomain),this.getElevationScale()}},{key:"getColorScale",value:function(){var e=this.props.colorRange,t=this.props.colorDomain||this.state.colorValueDomain;this.state.colorScaleFunc=f(t,e)}},{key:"getElevationScale",value:function(){var e=this.props.elevationRange,t=this.props.elevationDomain||this.state.elevationValueDomain;this.state.elevationScaleFunc=h(t,e)}},{key:"_onGetSublayerColor",value:function(e){var t=this.state,n=t.sortedColorBins,r=t.colorScaleFunc,i=t.colorValueDomain,o=n.binMap[e.index]&&n.binMap[e.index].value,a=this.props.colorDomain||i,s=o>=a[0]&&o<=a[a.length-1]?r(o):[0,0,0,0];return s[3]=Number.isFinite(s[3])?s[3]:255,s}},{key:"_onGetSublayerElevation",value:function(e){var t=this.state,n=t.sortedElevationBins,r=t.elevationScaleFunc,i=t.elevationValueDomain,o=n.binMap[e.index]&&n.binMap[e.index].value,a=this.props.elevationDomain||i;return o>=a[0]&&o<=a[a.length-1]?r(o):-1}},{key:"getSubLayerProps",value:function(){var e=this.props,n=e.elevationScale,r=e.fp64,i=e.extruded,o=e.cellSize,a=e.coverage,s=e.lightSettings,u=e.transitions;return function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,r)}if("value"in i)return i.value;var a=i.get;return void 0!==a?a.call(r):void 0}(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"getSubLayerProps",this).call(this,{id:"grid-cell",data:this.state.layerData,fp64:r,cellSize:o,coverage:a,lightSettings:s,elevationScale:n,extruded:i,getColor:this._onGetSublayerColor.bind(this),getElevation:this._onGetSublayerElevation.bind(this),transitions:u&&{getColor:u.getColorValue,getElevation:u.getElevationValue},updateTriggers:this.getUpdateTriggers()})}},{key:"getSubLayerClass",value:function(){return s.default}},{key:"renderLayers",value:function(){return new(this.getSubLayerClass())(this.getSubLayerProps())}}]),t}();t.default=v,v.layerName="GridLayer",v.defaultProps=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="#define SHADER_NAME screen-grid-layer-fragment-shader\n\n#ifdef GL_ES\nprecision highp float;\n#endif\n\nvarying vec4 vColor;\n\nvoid main(void) {\n gl_FragColor = vColor;\n\n // use highlight color if this fragment belongs to the selected object.\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n\n // use picking color if rendering to picking FBO.\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n}\n"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="#define SHADER_NAME screen-grid-layer-vertex-shader\n\nattribute vec3 vertices;\nattribute vec3 instancePositions;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\n\nuniform float opacity;\nuniform vec3 cellScale;\n\nvarying vec4 vColor;\n\nvoid main(void) {\n vec4 color = instanceColors / 255.;\n\n vColor = vec4(color.rgb, color.a * opacity);\n\n // Set color to be rendered to picking fbo (also used to check for selection highlight).\n picking_setPickingColor(instancePickingColors);\n\n gl_Position = vec4(instancePositions + vertices * cellScale, 1.);\n}\n"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(6),o=n(2),a=n(1),s=l(n(142)),u=l(n(141));function l(e){return e&&e.__esModule?e:{default:e}}var c=i.experimental.defaultColorRange,f=i.experimental.quantizeScale,h=[0,0,0,255],d=[0,255,0,255],p={cellSizePixels:100,colorDomain:null,colorRange:c,getPosition:function(e){return e.position},getWeight:function(e){return 1}},v=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(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)}(t,i.Layer),r(t,[{key:"getShaders",value:function(){return{vs:s.default,fs:u.default,modules:["picking"]}}},{key:"initializeState",value:function(){var e=this.getAttributeManager(),t=this.context.gl;e.addInstanced({instancePositions:{size:3,update:this.calculateInstancePositions},instanceColors:{size:4,type:o.GL.UNSIGNED_BYTE,transition:!0,accessor:["getPosition","getWeight"],update:this.calculateInstanceColors}}),this.setState({model:this._getModel(t)})}},{key:"shouldUpdateState",value:function(e){return e.changeFlags.somethingChanged}},{key:"updateState",value:function(e){var n=e.oldProps,r=e.props,i=e.changeFlags;(function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,r)}if("value"in i)return i.value;var a=i.get;return void 0!==a?a.call(r):void 0})(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateState",this).call(this,{props:r,oldProps:n,changeFlags:i}),(r.cellSizePixels!==n.cellSizePixels||i.viewportChanged)&&this.updateCell()}},{key:"draw",value:function(e){var t=e.uniforms,n=this.props.parameters,r=void 0===n?{}:n,i=this.state,o=i.model,a=i.cellScale;t=Object.assign({},t,{cellScale:a}),o.draw({uniforms:t,parameters:Object.assign({depthTest:!1,depthMask:!1},r)})}},{key:"_getModel",value:function(e){return new o.Model(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new o.Geometry({drawMode:o.GL.TRIANGLE_FAN,attributes:{vertices:new Float32Array([0,0,0,1,0,0,1,1,0,0,1,0])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"updateCell",value:function(){var e=this.context.viewport,t=e.width,n=e.height,r=this.props.cellSizePixels,i=new Float32Array([(r-2)/t*2,-(r-2)/n*2,1]),o=Math.ceil(t/r),a=Math.ceil(n/r);this.setState({cellScale:i,numCol:o,numRow:a,numInstances:o*a}),this.getAttributeManager().invalidateAll()}},{key:"calculateInstancePositions",value:function(e,t){for(var n=t.numInstances,r=this.context.viewport,i=r.width,o=r.height,a=this.props.cellSizePixels,s=this.state.numCol,u=e.value,l=e.size,c=0;c<n;c++){var f=c%s,h=Math.floor(c/s);u[c*l+0]=f*a/i*2-1,u[c*l+1]=1-h*a/o*2,u[c*l+2]=0}}},{key:"calculateInstanceColors",value:function(e){var t=this.props,n=t.data,r=t.cellSizePixels,i=t.getPosition,o=t.getWeight,a=this.state,s=a.numCol,u=a.numRow,l=a.numInstances,c=e.value,f=e.size,h=new Array(l),d=0;h.fill(0);var p=!0,v=!1,g=void 0;try{for(var y,_=n[Symbol.iterator]();!(p=(y=_.next()).done);p=!0){var m=y.value,b=this.project(i(m)),E=Math.floor(b[0]/r),w=Math.floor(b[1]/r);if(E>=0&&E<s&&w>=0&&w<u){var S=E+w*s;h[S]+=o(m),h[S]>d&&(d=h[S])}}}catch(e){v=!0,g=e}finally{try{!p&&_.return&&_.return()}finally{if(v)throw g}}this.setState({maxCount:d});for(var P=0;P<l;P++){var T=this._getColor(h[P],d),A=P*f;c[A+0]=T[0],c[A+1]=T[1],c[A+2]=T[2],c[A+3]=T[3]}}},{key:"_getColor",value:function(e,t){var n=void 0,r=this.props,i=r.minColor,o=r.maxColor,s=r.colorRange;if(this._shouldUseMinMax()){var u=e/t;return n=(0,a.lerp)(i||h,o||d,u)}var l=this.props.colorDomain||[1,t];return e<l[0]||e>l[1]?[0,0,0,0]:((n=f(l,s,e))[3]=Number.isFinite(n[3])?n[3]:255,n)}},{key:"_shouldUseMinMax",value:function(){var e=this.props,t=e.minColor,n=e.maxColor,r=e.colorDomain,i=e.colorRange;return!(!t&&!n)||!r&&!i}}]),t}();t.default=v,v.layerName="ScreenGridLayer",v.defaultProps=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="#define SHADER_NAME scatterplot-layer-fragment-shader\n\n#ifdef GL_ES\nprecision highp float;\n#endif\n\nvarying vec4 vColor;\nvarying vec2 unitPosition;\nvarying float innerUnitRadius;\n\nvoid main(void) {\n\n float distToCenter = length(unitPosition);\n\n if (distToCenter > 1.0 || distToCenter < innerUnitRadius) {\n discard;\n }\n gl_FragColor = vColor;\n\n // use highlight color if this fragment belongs to the selected object.\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n\n // use picking color if rendering to picking FBO.\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n}\n"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="#define SHADER_NAME scatterplot-layer-vertex-shader\n\nattribute vec3 positions;\n\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xyLow;\nattribute float instanceRadius;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\n\nuniform float opacity;\nuniform float radiusScale;\nuniform float radiusMinPixels;\nuniform float radiusMaxPixels;\nuniform float outline;\nuniform float strokeWidth;\n\nvarying vec4 vColor;\nvarying vec2 unitPosition;\nvarying float innerUnitRadius;\n\nvoid main(void) {\n // Multiply out radius and clamp to limits\n float outerRadiusPixels = clamp(\n project_scale(radiusScale * instanceRadius),\n radiusMinPixels, radiusMaxPixels\n );\n\n // outline is centered at the radius\n // outer radius needs to offset by half stroke width\n outerRadiusPixels += outline * strokeWidth / 2.0;\n\n // position on the containing square in [-1, 1] space\n unitPosition = positions.xy;\n // 0 - solid circle, 1 - stroke with lineWidth=0\n innerUnitRadius = outline * (1.0 - strokeWidth / outerRadiusPixels);\n\n vec3 offset = positions * outerRadiusPixels;\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, offset);\n\n // Apply opacity to instance color, or return instance picking color\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity) / 255.;\n\n // Set color to be rendered to picking fbo (also used to check for selection highlight).\n picking_setPickingColor(instancePickingColors);\n}\n"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="#define SHADER_NAME point-cloud-layer-fragment-shader\n\n#ifdef GL_ES\nprecision highp float;\n#endif\n\nvarying vec4 vColor;\nvarying vec2 unitPosition;\n\nvoid main(void) {\n\n float distToCenter = length(unitPosition);\n\n if (distToCenter > 1.0) {\n discard;\n }\n\n gl_FragColor = vColor;\n\n // use highlight color if this fragment belongs to the selected object.\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n\n // use picking color if rendering to picking FBO.\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n}\n"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="#define SHADER_NAME point-cloud-layer-vertex-shader\n\nattribute vec3 positions;\n\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xyLow;\nattribute vec3 instanceNormals;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\n\nuniform float opacity;\nuniform float radiusPixels;\n\nvarying vec4 vColor;\nvarying vec2 unitPosition;\n\nvoid main(void) {\n // position on the containing square in [-1, 1] space\n unitPosition = positions.xy;\n\n // Find the center of the point and add the current vertex\n vec4 position_worldspace;\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, vec3(0.), position_worldspace);\n gl_Position += project_pixel_to_clipspace(positions.xy * radiusPixels);\n\n // Apply lighting\n float lightWeight = lighting_getLightWeight(position_worldspace.xyz, // the w component is always 1.0\n project_normal(instanceNormals));\n\n // Apply opacity to instance color, or return instance picking color\n vColor = vec4(lightWeight * instanceColors.rgb, instanceColors.a * opacity) / 255.;\n\n // Set color to be rendered to picking fbo (also used to check for selection highlight).\n picking_setPickingColor(instancePickingColors);\n}\n"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(6),o=n(2),a=u(n(147)),s=u(n(146));function u(e){return e&&e.__esModule?e:{default:e}}var l=o.fp64.fp64LowPart,c=[0,0,0,255],f={radiusPixels:10,fp64:!1,getPosition:function(e){return e.position},getNormal:function(e){return e.normal},getColor:function(e){return e.color||c},lightSettings:{}},h=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(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)}(t,i.Layer),r(t,[{key:"getShaders",value:function(e){var t=this.is64bitEnabled()?"project64":"project32";return{vs:a.default,fs:s.default,modules:[t,"lighting","picking"]}}},{key:"initializeState",value:function(){this.state.attributeManager.addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceNormals:{size:3,transition:!0,accessor:"getNormal",defaultValue:[0,0,1]},instanceColors:{size:4,type:o.GL.UNSIGNED_BYTE,transition:!0,accessor:"getColor",defaultValue:[0,0,0,255]}})}},{key:"updateState",value:function(e){var n=e.props,r=e.oldProps,i=e.changeFlags;if(function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,r)}if("value"in i)return i.value;var a=i.get;return void 0!==a?a.call(r):void 0}(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateState",this).call(this,{props:n,oldProps:r,changeFlags:i}),n.fp64!==r.fp64){var o=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(o)}),this.state.attributeManager.invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.props.radiusPixels;this.state.model.render(Object.assign({},t,{radiusPixels:n}))}},{key:"_getModel",value:function(e){for(var t=[],n=0;n<3;n++){var r=n/3*Math.PI*2;t.push(2*Math.cos(r),2*Math.sin(r),0)}return new o.Model(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new o.Geometry({drawMode:o.GL.TRIANGLES,attributes:{positions:new Float32Array(t)}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateInstancePositions64xyLow",value:function(e){var t=this.is64bitEnabled();if(e.isGeneric=!t,t){var n=this.props,r=n.data,i=n.getPosition,o=e.value,a=0,s=!0,u=!1,c=void 0;try{for(var f,h=r[Symbol.iterator]();!(s=(f=h.next()).done);s=!0){var d=i(f.value);o[a++]=l(d[0]),o[a++]=l(d[1])}}catch(e){u=!0,c=e}finally{try{!s&&h.return&&h.return()}finally{if(u)throw c}}}else e.value=new Float32Array(2)}}]),t}();t.default=h,h.layerName="PointCloudLayer",h.defaultProps=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="#define SHADER_NAME line-layer-fragment-shader\n\n#ifdef GL_ES\nprecision highp float;\n#endif\n\nvarying vec4 vColor;\n\nvoid main(void) {\n gl_FragColor = vColor;\n\n // use highlight color if this fragment belongs to the selected object.\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n\n // use picking color if rendering to picking FBO.\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n}\n"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="#define SHADER_NAME line-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 instanceSourcePositions;\nattribute vec3 instanceTargetPositions;\nattribute vec4 instanceSourceTargetPositions64xyLow;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\n\nuniform float opacity;\n\nvarying vec4 vColor;\n\n// offset vector by strokeWidth pixels\n// offset_direction is -1 (left) or 1 (right)\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n vec2 offset_screenspace = dir_screenspace * offset_direction * instanceWidths / 2.0;\n vec2 offset_clipspace = project_pixel_to_clipspace(offset_screenspace).xy;\n\n return offset_clipspace;\n}\n\nvoid main(void) {\n // Position\n vec4 source = project_position_to_clipspace(instanceSourcePositions, instanceSourceTargetPositions64xyLow.xy, vec3(0.));\n vec4 target = project_position_to_clipspace(instanceTargetPositions, instanceSourceTargetPositions64xyLow.zw, vec3(0.));\n\n // linear interpolation of source & target to pick right coord\n float segmentIndex = positions.x;\n vec4 p = mix(source, target, segmentIndex);\n\n // extrude\n vec2 offset = getExtrusionOffset(target.xy - source.xy, positions.y);\n gl_Position = p + vec4(offset, 0.0, 0.0);\n\n // Color\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity) / 255.;\n\n // Set color to be rendered to picking fbo (also used to check for selection highlight).\n picking_setPickingColor(instancePickingColors);\n}\n"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(6),o=n(2),a=u(n(150)),s=u(n(149));function u(e){return e&&e.__esModule?e:{default:e}}var l=o.fp64.fp64LowPart,c=[0,0,0,255],f={fp64:!1,getSourcePosition:function(e){return e.sourcePosition},getTargetPosition:function(e){return e.targetPosition},getColor:function(e){return e.color||c},getStrokeWidth:1},h=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=null;return Number.isFinite(e.strokeWidth)&&(i.log.deprecated("LineLayer: `strokeWidth`","`getStrokeWidth`"),n={getStrokeWidth:e.strokeWidth}),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n))}return function(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)}(t,i.Layer),r(t,[{key:"getShaders",value:function(){var e=this.is64bitEnabled()?"project64":"project32";return{vs:a.default,fs:s.default,modules:[e,"picking"]}}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instanceSourcePositions:{size:3,transition:!0,accessor:"getSourcePosition"},instanceTargetPositions:{size:3,transition:!0,accessor:"getTargetPosition"},instanceSourceTargetPositions64xyLow:{size:4,accessor:["getSourcePosition","getTargetPosition"],update:this.calculateInstanceSourceTargetPositions64xyLow},instanceColors:{size:4,type:o.GL.UNSIGNED_BYTE,transition:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceWidths:{size:1,transition:!0,accessor:"getStrokeWidth",defaultValue:1}})}},{key:"updateState",value:function(e){var n=e.props,r=e.oldProps,i=e.changeFlags;if(function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,r)}if("value"in i)return i.value;var a=i.get;return void 0!==a?a.call(r):void 0}(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateState",this).call(this,{props:n,oldProps:r,changeFlags:i}),n.fp64!==r.fp64){var o=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(o)}),this.state.attributeManager.invalidateAll()}}},{key:"_getModel",value:function(e){return new o.Model(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new o.Geometry({drawMode:o.GL.TRIANGLE_STRIP,attributes:{positions:new Float32Array([0,-1,0,0,1,0,1,-1,0,1,1,0])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateInstanceSourceTargetPositions64xyLow",value:function(e){var t=this.is64bitEnabled();if(e.isGeneric=!t,t){var n=this.props,r=n.data,i=n.getSourcePosition,o=n.getTargetPosition,a=e.value,s=e.size,u=0,c=!0,f=!1,h=void 0;try{for(var d,p=r[Symbol.iterator]();!(c=(d=p.next()).done);c=!0){var v=d.value,g=i(v),y=o(v);a[u+0]=l(g[0]),a[u+1]=l(g[1]),a[u+2]=l(y[0]),a[u+3]=l(y[1]),u+=s}}catch(e){f=!0,h=e}finally{try{!c&&p.return&&p.return()}finally{if(f)throw h}}}else e.value=new Float32Array(4)}}]),t}();t.default=h,h.layerName="LineLayer",h.defaultProps=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="#define SHADER_NAME icon-layer-fragment-shader\n\n#ifdef GL_ES\nprecision highp float;\n#endif\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\n\nconst float MIN_ALPHA = 0.05;\n\nvoid main(void) {\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n\n // if colorMode == 0, use pixel color from the texture\n // if colorMode == 1 or rendering picking buffer, use texture as transparency mask\n vec3 color = mix(texColor.rgb, vColor.rgb, vColorMode);\n float a = texColor.a * opacity * mix(1.0, vColor.a, vColorMode);\n\n if (a < MIN_ALPHA) {\n discard;\n }\n\n gl_FragColor = vec4(color, a);\n\n // use highlight color if this fragment belongs to the selected object.\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n\n // use picking color if rendering to picking FBO.\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n}\n"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default='#define SHADER_NAME icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xyLow;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\n\nuniform float sizeScale;\nuniform vec2 iconsTextureDim;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n vec2 iconSize = instanceIconFrames.zw;\n // scale icon height to match instanceSize\n float instanceScale = iconSize.y == 0.0 ? 0.0 : instanceSizes / iconSize.y;\n\n // scale and rotate vertex in "pixel" value and convert back to fraction in clipspace\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * sizeScale * instanceScale;\n pixelOffset.y *= -1.0;\n\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, vec3(0.0));\n gl_Position += project_pixel_to_clipspace(pixelOffset);\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vTextureCoords.y = 1.0 - vTextureCoords.y;\n\n vColor = instanceColors / 255.;\n\n vColorMode = instanceColorModes;\n\n // Set color to be rendered to picking fbo (also used to check for selection highlight).\n picking_setPickingColor(instancePickingColors);\n}\n'},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="#define SHADER_NAME arc-layer-fragment-shader\n\n#ifdef GL_ES\nprecision highp float;\n#endif\n\nvarying vec4 vColor;\n\nvoid main(void) {\n gl_FragColor = vColor;\n\n // use highlight color if this fragment belongs to the selected object.\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n\n // use picking color if rendering to picking FBO.\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n}\n"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="#define SHADER_NAME arc-layer-vertex-shader-64\n\nattribute vec3 positions;\nattribute vec4 instanceSourceColors;\nattribute vec4 instanceTargetColors;\n\nattribute vec4 instancePositions;\nattribute vec4 instancePositions64Low;\n\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\n\nuniform float numSegments;\nuniform float opacity;\n\nvarying vec4 vColor;\n\nvec2 paraboloid_fp64(vec2 source[2], vec2 target[2], float ratio) {\n\n vec2 x[2];\n vec2_mix_fp64(source, target, ratio, x);\n vec2 center[2];\n vec2_mix_fp64(source, target, 0.5, center);\n\n vec2 dSourceCenter = vec2_distance_fp64(source, center);\n vec2 dXCenter = vec2_distance_fp64(x, center);\n return mul_fp64(sum_fp64(dSourceCenter, dXCenter), sub_fp64(dSourceCenter, dXCenter));\n}\n\n// offset vector by strokeWidth pixels\n// offset_direction is -1 (left) or 1 (right)\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n vec2 offset_screenspace = dir_screenspace * offset_direction * instanceWidths / 2.0;\n vec2 offset_clipspace = project_pixel_to_clipspace(offset_screenspace).xy;\n\n return offset_clipspace;\n}\n\nfloat getSegmentRatio(float index) {\n return smoothstep(0.0, 1.0, index / (numSegments - 1.0));\n}\n\nvoid get_pos_fp64(vec2 source[2], vec2 target[2], float segmentRatio, out vec2 position[4]) {\n\n vec2 vertex_height = paraboloid_fp64(source, target, segmentRatio);\n\n vec2 position_temp[2];\n\n vec2_mix_fp64(source, target, segmentRatio, position_temp);\n\n position[0] = position_temp[0];\n position[1] = position_temp[1];\n\n if (vertex_height.x < 0.0 || (vertex_height.x == 0.0 && vertex_height.y <= 0.0)) {\n vertex_height = vec2(0.0, 0.0);\n }\n\n position[2] = sqrt_fp64(vertex_height);\n position[3] = vec2(1.0, 0.0);\n}\n\nvoid main(void) {\n vec2 projected_source_coord[2];\n vec2 projected_target_coord[2];\n\n project_position_fp64(instancePositions.xy, instancePositions64Low.xy, projected_source_coord);\n project_position_fp64(instancePositions.zw, instancePositions64Low.zw, projected_target_coord);\n\n float segmentIndex = positions.x;\n float segmentRatio = getSegmentRatio(segmentIndex);\n\n // if it's the first point, use next - current as direction\n // otherwise use current - prev\n float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);\n\n vec2 curr_pos_modelspace[4];\n\n get_pos_fp64(projected_source_coord, projected_target_coord, segmentRatio,\n curr_pos_modelspace);\n\n vec2 next_pos_modelspace[4];\n\n get_pos_fp64(projected_source_coord, projected_target_coord, nextSegmentRatio,\n next_pos_modelspace);\n\n vec4 curr_pos_clipspace = project_to_clipspace_fp64(curr_pos_modelspace);\n vec4 next_pos_clipspace = project_to_clipspace_fp64(next_pos_modelspace);\n\n vec2 offset = getExtrusionOffset(next_pos_clipspace.xy - curr_pos_clipspace.xy, positions.y);\n\n gl_Position = curr_pos_clipspace + vec4(offset, 0.0, 0.0);\n\n vec4 color = mix(instanceSourceColors, instanceTargetColors, segmentRatio) / 255.;\n vColor = vec4(color.rgb, color.a * opacity);\n\n // Set color to be rendered to picking fbo (also used to check for selection highlight).\n picking_setPickingColor(instancePickingColors);\n}\n"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="#define SHADER_NAME arc-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec4 instanceSourceColors;\nattribute vec4 instanceTargetColors;\nattribute vec4 instancePositions;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\n\nuniform float numSegments;\nuniform float opacity;\n\nvarying vec4 vColor;\n\nfloat paraboloid(vec2 source, vec2 target, float ratio) {\n\n vec2 x = mix(source, target, ratio);\n vec2 center = mix(source, target, 0.5);\n\n float dSourceCenter = distance(source, center);\n float dXCenter = distance(x, center);\n return (dSourceCenter + dXCenter) * (dSourceCenter - dXCenter);\n}\n\n// offset vector by strokeWidth pixels\n// offset_direction is -1 (left) or 1 (right)\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n vec2 offset_screenspace = dir_screenspace * offset_direction * instanceWidths / 2.0;\n vec2 offset_clipspace = project_pixel_to_clipspace(offset_screenspace).xy;\n\n return offset_clipspace;\n}\n\nfloat getSegmentRatio(float index) {\n return smoothstep(0.0, 1.0, index / (numSegments - 1.0));\n}\n\nvec3 getPos(vec2 source, vec2 target, float segmentRatio) {\n float vertex_height = paraboloid(source, target, segmentRatio);\n\n return vec3(\n mix(source, target, segmentRatio),\n sqrt(max(0.0, vertex_height))\n );\n}\n\nvoid main(void) {\n vec2 source = project_position(instancePositions.xy);\n vec2 target = project_position(instancePositions.zw);\n\n float segmentIndex = positions.x;\n float segmentRatio = getSegmentRatio(segmentIndex);\n // if it's the first point, use next - current as direction\n // otherwise use current - prev\n float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);\n\n vec3 currPos = getPos(source, target, segmentRatio);\n vec3 nextPos = getPos(source, target, nextSegmentRatio);\n vec4 curr = project_to_clipspace(vec4(currPos, 1.0));\n vec4 next = project_to_clipspace(vec4(nextPos, 1.0));\n\n // extrude\n vec2 offset = getExtrusionOffset((next.xy - curr.xy) * indexDir, positions.y);\n gl_Position = curr + vec4(offset, 0.0, 0.0);\n\n vec4 color = mix(instanceSourceColors, instanceTargetColors, segmentRatio) / 255.;\n vColor = vec4(color.rgb, color.a * opacity);\n\n // Set color to be rendered to picking fbo (also used to check for selection highlight).\n picking_setPickingColor(instancePickingColors);\n}\n"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(6),o=n(2),a=l(n(156)),s=l(n(155)),u=l(n(154));function l(e){return e&&e.__esModule?e:{default:e}}var c=o.fp64.fp64LowPart,f=[0,0,0,255],h={fp64:!1,getSourcePosition:function(e){return e.sourcePosition},getTargetPosition:function(e){return e.targetPosition},getSourceColor:function(e){return e.color||f},getTargetColor:function(e){return e.color||f},getStrokeWidth:1},d=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=null;return Number.isFinite(e.strokeWidth)&&(i.log.deprecated("ArcLayer: `strokeWidth`","`getStrokeWidth`"),n={getStrokeWidth:e.strokeWidth}),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n))}return function(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)}(t,i.Layer),r(t,[{key:"getShaders",value:function(){return this.is64bitEnabled()?{vs:s.default,fs:u.default,modules:["project64","picking"]}:{vs:a.default,fs:u.default,modules:["picking"]}}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:4,transition:!0,accessor:["getSourcePosition","getTargetPosition"],update:this.calculateInstancePositions},instanceSourceColors:{size:4,type:o.GL.UNSIGNED_BYTE,transition:!0,accessor:"getSourceColor",defaultValue:f},instanceTargetColors:{size:4,type:o.GL.UNSIGNED_BYTE,transition:!0,accessor:"getTargetColor",defaultValue:f},instanceWidths:{size:1,transition:!0,accessor:"getStrokeWidth",defaultValue:1}})}},{key:"updateAttribute",value:function(e){var t=e.props,n=e.oldProps;e.changeFlags;if(t.fp64!==n.fp64){var r=this.getAttributeManager();r.invalidateAll(),t.fp64&&t.coordinateSystem===i.COORDINATE_SYSTEM.LNGLAT?r.addInstanced({instancePositions64Low:{size:4,accessor:["getSourcePosition","getTargetPosition"],update:this.calculateInstancePositions64Low}}):r.remove(["instancePositions64Low"])}}},{key:"updateState",value:function(e){var n=e.props,r=e.oldProps,i=e.changeFlags;if(function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,r)}if("value"in i)return i.value;var a=i.get;return void 0!==a?a.call(r):void 0}(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateState",this).call(this,{props:n,oldProps:r,changeFlags:i}),n.fp64!==r.fp64){var o=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(o)})}this.updateAttribute({props:n,oldProps:r,changeFlags:i})}},{key:"_getModel",value:function(e){for(var t=[],n=0;n<50;n++)t=t.concat([n,-1,0,n,1,0]);var r=new o.Model(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new o.Geometry({drawMode:o.GL.TRIANGLE_STRIP,attributes:{positions:new Float32Array(t)}}),isInstanced:!0,shaderCache:this.context.shaderCache}));return r.setUniforms({numSegments:50}),r}},{key:"calculateInstancePositions",value:function(e){var t=this.props,n=t.data,r=t.getSourcePosition,i=t.getTargetPosition,o=e.value,a=e.size,s=0,u=!0,l=!1,c=void 0;try{for(var f,h=n[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var d=f.value,p=r(d),v=i(d);o[s+0]=p[0],o[s+1]=p[1],o[s+2]=v[0],o[s+3]=v[1],s+=a}}catch(e){l=!0,c=e}finally{try{!u&&h.return&&h.return()}finally{if(l)throw c}}}},{key:"calculateInstancePositions64Low",value:function(e){var t=this.props,n=t.data,r=t.getSourcePosition,i=t.getTargetPosition,o=e.value,a=e.size,s=0,u=!0,l=!1,f=void 0;try{for(var h,d=n[Symbol.iterator]();!(u=(h=d.next()).done);u=!0){var p=h.value,v=r(p),g=i(p);o[s+0]=c(v[0]),o[s+1]=c(v[1]),o[s+2]=c(g[0]),o[s+3]=c(g[1]),s+=a}}catch(e){l=!0,f=e}finally{try{!u&&d.return&&d.return()}finally{if(l)throw f}}}}]),t}();t.default=d,d.layerName="ArcLayer",d.defaultProps=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(157);Object.defineProperty(t,"ArcLayer",{enumerable:!0,get:function(){return y(r).default}});var i=n(56);Object.defineProperty(t,"IconLayer",{enumerable:!0,get:function(){return y(i).default}});var o=n(151);Object.defineProperty(t,"LineLayer",{enumerable:!0,get:function(){return y(o).default}});var a=n(148);Object.defineProperty(t,"PointCloudLayer",{enumerable:!0,get:function(){return y(a).default}});var s=n(55);Object.defineProperty(t,"ScatterplotLayer",{enumerable:!0,get:function(){return y(s).default}});var u=n(143);Object.defineProperty(t,"ScreenGridLayer",{enumerable:!0,get:function(){return y(u).default}});var l=n(140);Object.defineProperty(t,"GridLayer",{enumerable:!0,get:function(){return y(l).default}});var c=n(54);Object.defineProperty(t,"GridCellLayer",{enumerable:!0,get:function(){return y(c).default}});var f=n(136);Object.defineProperty(t,"HexagonLayer",{enumerable:!0,get:function(){return y(f).default}});var h=n(53);Object.defineProperty(t,"HexagonCellLayer",{enumerable:!0,get:function(){return y(h).default}});var d=n(37);Object.defineProperty(t,"PathLayer",{enumerable:!0,get:function(){return y(d).default}});var p=n(129);Object.defineProperty(t,"PolygonLayer",{enumerable:!0,get:function(){return y(p).default}});var v=n(124);Object.defineProperty(t,"GeoJsonLayer",{enumerable:!0,get:function(){return y(v).default}});var g=n(122);function y(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"TextLayer",{enumerable:!0,get:function(){return y(g).default}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(7)),i=a(n(5)),o=n(1);function a(e){return e&&e.__esModule?e:{default:e}}var s=o.experimental.SphericalCoordinates;var u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i.default.deprecated("ThirdPersonViewport","ThirdPersonView")();var n=e.bearing,r=e.pitch,a=e.position,u=e.up,l=50*e.zoom,c=function(e){var t=e.bearing,n=e.pitch;return new s({bearing:t,pitch:n}).toVector3().normalize()}({bearing:n,pitch:r}).scale(-l).multiply(new o.Vector3(1,1,-1)),f=(new o.Matrix4).multiplyRight((new o.Matrix4).lookAt({eye:c,center:a,up:u}));return function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,Object.assign({},e,{zoom:null,viewMatrix:f})))}return function(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)}(t,r.default),t}();t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(7)),i=a(n(5)),o=n(1);function a(e){return e&&e.__esModule?e:{default:e}}var s=o.experimental.SphericalCoordinates;var u=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i.default.deprecated("FirstPersonViewport","FirstPersonView")();var n=e.modelMatrix,r=void 0===n?null:n,a=e.bearing,u=e.up,l=void 0===u?[0,0,1]:u,c=function(e){var t=e.bearing,n=e.pitch;return new s({bearing:t,pitch:n}).toVector3().normalize()}({bearing:a,pitch:89}),f=r?r.transformDirection(c):c,h=(new o.Matrix4).lookAt({eye:[0,0,0],center:f,up:l});return function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,Object.assign({},e,{zoom:null,viewMatrix:h})))}return function(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)}(t,r.default),t}();t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.linearScale=function(e,t,n){return(n-e[0])/(e[1]-e[0])*(t[1]-t[0])+t[0]},t.quantizeScale=a,t.getQuantizeScale=function(e,t){return function(n){return a(e,t,n)}},t.getLinearScale=function(e,t){return function(n){return(n-e[0])/(e[1]-e[0])*(t[1]-t[0])+t[0]}};var r,i=n(5),o=(r=i)&&r.__esModule?r:{default:r};function a(e,t,n){var r=e[1]-e[0];if(r<=0)return o.default.warn("quantizeScale: invalid domain, returning range[0]"),t[0];var i=r/t.length,a=Math.floor((n-e[0])/i);return t[Math.max(Math.min(a,t.length-1),0)]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.defaultColorRange=[[255,255,178],[254,217,118],[254,178,76],[253,141,60],[240,59,32],[189,0,38]]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var o=function(e){return e.length},a=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.sortedBins=this.getSortedBins(t,n),this.maxCount=this.getMaxCount(),this.binMap=this.getBinMap()}return i(e,[{key:"getSortedBins",value:function(e,t){return e.reduce(function(e,n,r){var i=t(n.points);return null!==i&&void 0!==i&&e.push({i:Number.isFinite(n.index)?n.index:r,value:i,counts:n.points.length}),e},[]).sort(function(e,t){return e.value-t.value})}},{key:"getValueRange",value:function(e){var t=r(e,2),n=t[0],i=t[1],o=this.sortedBins.length;if(!o)return[0,0];var a=Math.ceil(n/100*(o-1)),s=Math.floor(i/100*(o-1));return[this.sortedBins[a].value,this.sortedBins[s].value]}},{key:"getMaxCount",value:function(){var e=0;return this.sortedBins.forEach(function(t){return e=e>t.counts?e:t.counts}),e}},{key:"getBinMap",value:function(){return this.sortedBins.reduce(function(e,t){return Object.assign(e,(n={},r=t.i,i=t,r in n?Object.defineProperty(n,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[r]=i,n));var n,r,i},{})}}]),e}();t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default='#define SHADER_NAME reflection-effect-fs\n\n#ifdef GL_ES\nprecision highp float;\n#endif\n\nuniform sampler2D reflectionTexture;\nuniform int reflectionTextureWidth;\nuniform int reflectionTextureHeight;\n\nuniform float reflectivity;\nuniform float blur;\n\n\nvarying vec2 uv;\n\n#define KERNEL_SIZE 7\n\n/*\n * Samples from tex with a gaussian-shaped patch, centered at uv and\n * with standard deviation sigma. The size of the texture in\n * pixels must be specified by dim\n */\nvec4 sample_gaussian(sampler2D tex, vec2 dim, vec2 uv, float sigma) {\n if (sigma == 0.0) {\n return texture2D(tex, uv);\n }\n\n vec2 delta = 1.0 / dim;\n vec2 top_left = uv - delta * float(KERNEL_SIZE+1) / 2.0;\n\n vec4 color = vec4(0);\n float sum = 0.0;\n for (int i = 0; i < KERNEL_SIZE; ++i) {\n for (int j = 0; j < KERNEL_SIZE; ++j) {\n vec2 uv2 = top_left + vec2(i, j) * delta;\n float d = length((uv2 - uv) * dim);\n float f = exp(-(d*d) / (2.0*sigma * sigma));\n color += f * texture2D(tex, uv2);\n sum += f;\n }\n }\n return color / sum;\n}\n\nvoid main(void) {\n //map blur in [0, 1] to sigma in [0, inf]\n //alpha will determine the "steepness" of our curve.\n //this was picked just to make the scale feel "natural"\n //if our image is 1000 pixels wide, a blur of 0.5 should correspond\n //to a sigma of 1 pixels\n float alpha = 1000.0;\n float sigma = blur / (alpha * (1.0 - blur));\n //let this be our standard deviation in terms of screen-widths.\n //rewrite this in terms of pixels.\n sigma *= float(reflectionTextureWidth);\n\n\n gl_FragColor = sample_gaussian(reflectionTexture, vec2(reflectionTextureWidth,\n reflectionTextureHeight), vec2(uv.x, 1. - uv.y), sigma);\n //because our canvas expects alphas to be pre-multiplied, we multiply by whole\n //color vector by reflectivity, not just the alpha channel\n gl_FragColor *= reflectivity;\n}\n'},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="#define SHADER_NAME reflection-effect-vs\n\nattribute vec3 vertices;\n\nvarying vec2 uv;\n\nvoid main(void) {\n uv = vertices.xy;\n gl_Position = vec4(2. * vertices.xy - vec2(1., 1.), 1., 1.);\n}\n"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(2),o=l(n(40)),a=l(n(41)),s=l(n(165)),u=l(n(164));function l(e){return e&&e.__esModule?e:{default:e}}var c=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.5,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r.reflectivity=e,r.blur=n,r.framebuffer=null,r.setNeedsRedraw(),r}return function(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)}(t,o.default),r(t,[{key:"getShaders",value:function(){return{vs:s.default,fs:u.default,modules:[],shaderCache:this.context.shaderCache}}},{key:"initialize",value:function(e){var t=e.gl;e.layerManager;this.unitQuad=new i.Model(t,Object.assign({},this.getShaders(),{id:"reflection-effect",geometry:new i.Geometry({drawMode:i.GL.TRIANGLE_FAN,vertices:new Float32Array([0,0,0,1,0,0,1,1,0,0,1,0])})})),this.framebuffer=new i.Framebuffer(t,{depth:!0})}},{key:"preDraw",value:function(e){var t=e.gl,n=e.layerManager,r=n.context.viewport,o="undefined"!=typeof window&&window.devicePixelRatio||1;this.framebuffer.resize({width:o*r.width,height:o*r.height});var s=r.pitch;this.framebuffer.bind(),n.setViewport(new a.default(Object.assign({},r,{pitch:-180-s}))),t.clear(i.GL.COLOR_BUFFER_BIT|i.GL.DEPTH_BUFFER_BIT),n.drawLayers({pass:"reflection"}),n.setViewport(r),this.framebuffer.unbind()}},{key:"draw",value:function(e){e.gl,e.layerManager;this.unitQuad.render({reflectionTexture:this.framebuffer.texture,reflectionTextureWidth:this.framebuffer.width,reflectionTextureHeight:this.framebuffer.height,reflectivity:this.reflectivity,blur:this.blur})}},{key:"finalize",value:function(e){e.gl,e.layerManager}}]),t}();t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(63),a=(r=o)&&r.__esModule?r:{default:r},s=n(1),u=n(21);var l=["bearing","pitch"],c=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{compare:["longitude","latitude","zoom","bearing","pitch"],extract:["width","height","longitude","latitude","zoom","bearing","pitch"],required:["width","height","latitude","longitude","zoom"]}))}return function(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)}(t,a.default),i(t,[{key:"interpolateProps",value:function(e,t,n){var r=(0,u.flyToViewport)(e,t,n),i=!0,o=!1,a=void 0;try{for(var c,f=l[Symbol.iterator]();!(i=(c=f.next()).done);i=!0){var h=c.value;r[h]=(0,s.lerp)(e[h]||0,t[h]||0,n)}}catch(e){o=!0,a=e}finally{try{!i&&f.return&&f.return()}finally{if(o)throw a}}return r}}]),t}();t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(1),o=u(n(30)),a=u(n(57)),s=u(n(3));function u(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var c={lookAt:[0,0,0],rotationX:0,rotationOrbit:0,fov:50,near:1,far:100,translationX:0,translationY:0,zoom:1},f={minZoom:0,maxZoom:1/0};function h(e,t){return Number.isFinite(e)?e:t}var d=function(){function e(t){var n=t.width,r=t.height,i=t.distance,o=t.rotationX,a=t.rotationOrbit,u=t.orbitAxis,d=t.bounds,p=t.lookAt,v=t.fov,g=t.near,y=t.far,_=t.translationX,m=t.translationY,b=t.zoom,E=t.minZoom,w=t.maxZoom,S=t.startPanViewport,P=t.startPanPos,T=t.isPanning,A=t.startRotateViewport,x=t.isRotating,O=t.startZoomViewport,R=t.startZoomPos;l(this,e),(0,s.default)(Number.isFinite(n),"`width` must be supplied"),(0,s.default)(Number.isFinite(r),"`height` must be supplied"),(0,s.default)(Number.isFinite(i),"`distance` must be supplied"),this._viewportProps=this._applyConstraints({width:n,height:r,distance:i,rotationX:h(o,c.rotationX),rotationOrbit:h(a,c.rotationOrbit),orbitAxis:u,bounds:d,lookAt:p||c.lookAt,fov:h(v,c.fov),near:h(g,c.near),far:h(y,c.far),translationX:h(_,c.translationX),translationY:h(m,c.translationY),zoom:h(b,c.zoom),minZoom:h(E,f.minZoom),maxZoom:h(w,f.maxZoom)}),this._interactiveState={startPanViewport:S,startPanPos:P,isPanning:T,startRotateViewport:A,isRotating:x,startZoomViewport:O,startZoomPos:R}}return r(e,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"panStart",value:function(e){var t=e.pos,n=new a.default(this._viewportProps);return this._getUpdatedOrbitState({startPanPos:t,startPanViewport:n})}},{key:"pan",value:function(e){var t=e.pos,n=e.startPos;if(this._interactiveState.isRotating)return this._getUpdatedOrbitState();var r=this._interactiveState.startPanPos||n;(0,s.default)(r,"`startPanPos` props is required");var i=this._interactiveState.startPanViewport||new a.default(this._viewportProps),o=t[0]-r[0],u=t[1]-r[1],l=i.project(i.lookAt),c=i.unproject([l[0]-o,l[1]-u,l[2]]);return this._getUpdatedOrbitState({lookAt:c,isPanning:!0})}},{key:"panEnd",value:function(){return this._getUpdatedOrbitState({startPanViewport:null,startPanPos:null,isPanning:null})}},{key:"rotateStart",value:function(e){e.pos;var t=new a.default(this._viewportProps);return this._getUpdatedOrbitState({startRotateViewport:t})}},{key:"rotate",value:function(e){var t=e.deltaScaleX,n=e.deltaScaleY;if(this._interactiveState.isPanning)return this._getUpdatedOrbitState();var r=this._interactiveState.startRotateViewport||{},o=r.rotationX,a=r.rotationOrbit;o=h(o,this._viewportProps.rotationX),a=h(a,this._viewportProps.rotationOrbit);var s=(0,i.clamp)(o-180*n,-89.999,89.999),u=(a-180*t)%360;return this._getUpdatedOrbitState({rotationX:s,rotationOrbit:u,isRotating:!0})}},{key:"rotateEnd",value:function(){return this._getUpdatedOrbitState({startRotateViewport:null,isRotating:null})}},{key:"zoomStart",value:function(e){var t=e.pos,n=new a.default(this._viewportProps);return this._getUpdatedOrbitState({startZoomViewport:n,startZoomPos:t})}},{key:"zoom",value:function(e){var t=e.pos,n=e.startPos,r=e.scale,o=this._viewportProps,s=o.zoom,u=o.minZoom,l=o.maxZoom,c=o.width,f=o.height,h=this._interactiveState.startZoomPos||n||t,d=this._interactiveState.startZoomViewport||new a.default(this._viewportProps),p=(0,i.clamp)(s*r,u,l),v=t[0]-h[0],g=t[1]-h[1],y=h[0]-c/2,_=f/2-h[1],m=d.project(d.lookAt),b=m[0]-y+y*p/s+v,E=m[1]+_-_*p/s-g,w=d.unproject([b,E,m[2]]);return this._getUpdatedOrbitState({lookAt:w,zoom:p})}},{key:"zoomEnd",value:function(){return this._getUpdatedOrbitState({startZoomPos:null})}},{key:"_getUpdatedOrbitState",value:function(t){return new e(Object.assign({},this._viewportProps,this._interactiveState,t))}},{key:"_applyConstraints",value:function(e){var t=e.maxZoom,n=e.minZoom,r=e.zoom;return e.zoom=r>t?t:r,e.zoom=r<n?n:r,e}}]),e}(),p=function(e){function t(e){return l(this,t),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,d,e))}return function(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)}(t,o.default),t}();t.default=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=l(n(30)),a=l(n(61)),s=n(1),u=l(n(3));function l(e){return e&&e.__esModule?e:{default:e}}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(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 h(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)}function d(e,t){return Number.isFinite(e)?e:t}var p=function(e){function t(e){var n=e.width,r=e.height,i=e.position,o=e.bearing,a=e.pitch,s=e.longitude,u=e.latitude,l=e.zoom,h=(e.syncBearing,e.bounds,e.startPanEventPosition),d=e.startPanPosition,p=e.startRotateCenter,v=e.startRotateViewport,g=e.startZoomPos,y=e.startZoom;c(this,t);var _=f(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{width:n,height:r,position:i,bearing:o,pitch:a,longitude:s,latitude:u,zoom:l}));return _._interactiveState={startPanEventPosition:h,startPanPosition:d,startRotateCenter:p,startRotateViewport:v,startZoomPos:g,startZoom:y},_}return h(t,a.default),i(t,[{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"panStart",value:function(e){var t=e.pos,n=this._viewportProps,r=n.translationX,i=n.translationY;return this._getUpdatedState({startPanPosition:[r,i],startPanEventPosition:t})}},{key:"pan",value:function(e){var t=e.pos,n=e.startPos,i=this._interactiveState.startPanEventPosition||n;(0,u.default)(i,"`startPanEventPosition` props is required");var o=this._interactiveState.startPanPosition||[],a=r(o,2),s=a[0],l=a[1];s=d(s,this._viewportProps.translationX),l=d(l,this._viewportProps.translationY);var c=t[0]-i[0],f=t[1]-i[1];return this._getUpdatedState({translationX:s+c,translationY:l-f})}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanPosition:null,startPanPos:null})}},{key:"rotateStart",value:function(e){e.pos;return this._getUpdatedState({startRotateCenter:this._viewportProps.position,startRotateViewport:this._viewportProps})}},{key:"rotate",value:function(e){var t=e.deltaScaleX,n=e.deltaScaleY,r=this._viewportProps,i=r.bearing,o=r.pitch;return this._getUpdatedState({bearing:i+10*t,pitch:o-10*n})}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startRotateCenter:null,startRotateViewport:null})}},{key:"zoomStart",value:function(e){var t=e.pos;return this._getUpdatedState({startZoomPos:t,startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(e){var t=e.pos,n=e.startPos,r=e.scale,i=this._viewportProps,o=i.zoom,a=i.minZoom,u=i.maxZoom,l=i.width,c=i.height,f=(i.translationX,i.translationY,this._interactiveState.startZoomPos||n||t),h=(0,s.clamp)(o*r,a,u);t[0],f[0],t[1],f[1],f[0],f[1];return h/o<1?this.moveBackward():this.moveForward()}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomPos:null,startZoom:null})}},{key:"moveLeft",value:function(){var e=this._viewportProps.bearing-2;return this._getUpdatedState({bearing:e})}},{key:"moveRight",value:function(){var e=this._viewportProps.bearing+2;return this._getUpdatedState({bearing:e})}},{key:"moveForward",value:function(){var e=this._viewportProps.position,t=this.getDirection(),n=new s.Vector3(t).normalize().scale(1);return this._getUpdatedState({position:new s.Vector3(e).add(n)})}},{key:"moveBackward",value:function(){var e=this._viewportProps.position,t=this.getDirection(),n=new s.Vector3(t).normalize().scale(-1);return this._getUpdatedState({position:new s.Vector3(e).add(n)})}},{key:"moveUp",value:function(){var e=this._viewportProps.position;return this._getUpdatedState({position:new s.Vector3(e).add([0,0,1])})}},{key:"moveDown",value:function(){var e=this._viewportProps.position,t=e[2]>=1?[0,0,-1]:[0,0,0];return this._getUpdatedState({position:new s.Vector3(e).add(t)})}},{key:"zoomIn",value:function(){return this._getUpdatedState({zoom:this._viewportProps.zoom+.2})}},{key:"zoomOut",value:function(){return this._getUpdatedState({zoom:this._viewportProps.zoom-.2})}},{key:"_getUpdatedState",value:function(e){return new t(Object.assign({},this._viewportProps,this._interactiveState,e))}}]),t}(),v=function(e){function t(e){return c(this,t),f(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,p,e))}return h(t,o.default),t}();t.default=v},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(20),o=(r=i)&&r.__esModule?r:{default:r};t.default={name:"project32",dependencies:[o.default],vs:"\nvec4 project_position_to_clipspace(\n vec3 position, vec2 position64xyLow, vec3 offset, out vec4 worldPosition\n) {\n vec3 projectedPosition = project_position(position);\n worldPosition = vec4(projectedPosition + offset, 1.0);\n return project_to_clipspace(worldPosition);\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec2 position64xyLow, vec3 offset\n) {\n vec4 worldPosition;\n return project_position_to_clipspace(position, position64xyLow, offset, worldPosition);\n}\n"}},function(e,t,n){"use strict";(function(t,n){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},i="object"!==(void 0===t?"undefined":r(t))||"[object process]"!==String(t)||t.browser;e.exports={window:"undefined"!=typeof window?window:n,global:void 0!==n?n:window,document:"undefined"!=typeof document?document:{},isBrowser:i}}).call(this,n(24),n(25))},function(e,t,n){"use strict";var r,i=n(171),o=n(5),a=(r=o)&&r.__esModule?r:{default:r};if(i.global.deck&&"5.3.1"!==i.global.deck.VERSION)throw new Error("deck.gl - multiple versions detected: "+i.global.deck.VERSION+" vs 5.3.1");i.global.deck||(a.default.log(0,"deck.gl 5.3.1 - set deck.log.priority=1 (or higher) to trace attribute updates")(),i.global.deck=i.global.deck||{VERSION:"5.3.1",version:"5.3.1",log:a.default}),console.table||(console.table=function(){}),n(58)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=s(n(7)),i=s(n(5)),o=s(n(18)),a=s(n(49));function s(e){return e&&e.__esModule?e:{default:e}}var u=function(e){function t(e){var n=e.width,r=e.height,s=e.eye,u=void 0===s?[0,0,1]:s,l=e.lookAt,c=void 0===l?[0,0,0]:l,f=e.up,h=void 0===f?[0,1,0]:f,d=e.near,p=void 0===d?1:d,v=e.far,g=void 0===v?100:v,y=e.left,_=e.top,m=e.right,b=void 0===m?null:m,E=e.bottom,w=void 0===E?null:E;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i.default.deprecated("OrthographicViewport","OrthographicView")(),b=Number.isFinite(b)?b:y+n,w=Number.isFinite(w)?w:_+r,function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{viewMatrix:(0,o.default)([],u,c,h),projectionMatrix:(0,a.default)([],y,b,w,_,p,g),width:n,height:r}))}return function(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)}(t,r.default),t}();t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=s(n(7)),i=s(n(5)),o=s(n(18)),a=s(n(17));function s(e){return e&&e.__esModule?e:{default:e}}var u=Math.PI/180,l=function(e){function t(e){var n=e.width,r=e.height,s=e.eye,l=e.lookAt,c=void 0===l?[0,0,0]:l,f=e.up,h=void 0===f?[0,1,0]:f,d=e.fovy,p=void 0===d?75:d,v=e.near,g=void 0===v?1:v,y=e.far,_=void 0===y?100:y,m=e.aspect,b=void 0===m?null:m;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i.default.deprecated("PerspectiveViewport","PerspectiveView")();var E=p*u;return b=Number.isFinite(b)?b:n/r,function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{viewMatrix:(0,o.default)([],s,c,h),projectionMatrix:(0,a.default)([],E,b,g,_),width:n,height:r}))}return function(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)}(t,r.default),t}();t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=s(n(12)),o=s(n(7)),a=n(1);function s(e){return e&&e.__esModule?e:{default:e}}var u=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(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)}(t,i.default),r(t,[{key:"_getViewport",value:function(e){var t=e.x,n=e.y,r=e.width,i=e.height,s=e.viewState,u=s.eye,l=void 0===u?[0,0,1]:u,c=s.lookAt,f=void 0===c?[0,0,0]:c,h=s.up,d=void 0===h?[0,1,0]:h;r=r||1,i=i||1;var p=this.props,v=p.left,g=void 0===v?-r/2:v,y=p.top,_=void 0===y?-i/2:y,m=p.near,b=void 0===m?1:m,E=p.far,w=void 0===E?100:E,S=this.props,P=S.right,T=void 0===P?null:P,A=S.bottom,x=void 0===A?null:A;return T=Number.isFinite(T)?T:g+r,x=Number.isFinite(x)?x:_+i,new o.default({id:this.id,x:t,y:n,width:r,height:i,viewMatrix:(new a.Matrix4).lookAt({eye:l,lookAt:f,up:d}),projectionMatrix:(new a.Matrix4).ortho({left:g,right:T,bottom:x,top:_,near:b,far:w})})}}]),t}();t.default=u,u.displayName="OrthographicView"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=u(n(12)),o=u(n(7)),a=u(n(18)),s=u(n(17));function u(e){return e&&e.__esModule?e:{default:e}}var l=Math.PI/180,c=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(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)}(t,i.default),r(t,[{key:"_getViewport",value:function(e){var t=e.x,n=e.y,r=e.width,i=e.height,u=e.viewState,c=u.eye,f=u.lookAt,h=void 0===f?[0,0,0]:f,d=u.up,p=void 0===d?[0,1,0]:d,v=e.fovy||u.fovy||75,g=e.near||u.near||1,y=e.far||u.far||100,_=Number.isFinite(u.aspect)?u.aspect:r/i,m=v*l;return new o.default({id:this.id,x:t,y:n,width:r,height:i,viewMatrix:(0,a.default)([],c,h,p),projectionMatrix:(0,s.default)([],m,_,g,y)})}}]),t}();t.default=c,c.displayName="PerspectiveView"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=g(n(12)),a=g(n(7)),s=n(43),u=g(n(13)),l=g(n(18)),c=g(n(16)),f=g(n(17)),h=g(n(15)),d=g(n(27)),p=g(n(33)),v=g(n(26));function g(e){return e&&e.__esModule?e:{default:e}}function y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _(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 m(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)}var b=Math.PI/180,E=function(e){function t(){return y(this,t),_(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return m(t,a.default),i(t,[{key:"project",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).topLeft,n=void 0!==t&&t,i=(0,s.transformVector)(this.pixelProjectionMatrix,[].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(e),[1])),o=r(i,3),a=o[0],u=o[1],l=o[2];return[a,n?this.height-u:u,l]}},{key:"unproject",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).topLeft,n=void 0!==t&&t,i=r(e,3),o=i[0],a=i[1],u=i[2],l=n?this.height-a:a;return(0,s.transformVector)(this.pixelUnprojectionMatrix,[o,l,u,1])}}]),t}(),w=function(e){function t(){return y(this,t),_(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return m(t,o.default),i(t,[{key:"_getViewport",value:function(e){var t=e.viewState,n=e.width||1,r=e.height||1,i=e.fov||e.fovy||t.fovy||75,o=e.near||t.near||1,a=e.far||t.far||100,s=Number.isFinite(t.aspect)?t.aspect:n/r,u=i*b;return new E({id:this.id,viewMatrix:this._getViewMatrix(e.viewState),projectionMatrix:(0,f.default)([],u,s,o,a),x:e.x,y:e.y,width:n,height:r})}},{key:"_getViewMatrix",value:function(e){var t=e.distance,n=e.rotationX,r=void 0===n?0:n,i=e.rotationOrbit,o=void 0===i?0:i,a=e.orbitAxis,f=void 0===a?"Z":a,g=e.lookAt,y=void 0===g?[0,0,0]:g,_=e.up,m=void 0===_?[0,1,0]:_,b=e.zoom,E=void 0===b?1:b,w=(0,d.default)([],(0,s.createMat4)(),-r/180*Math.PI);"Z"===f?(0,v.default)(w,w,-o/180*Math.PI):(0,p.default)(w,w,-o/180*Math.PI);var S=(0,s.createMat4)();(0,c.default)(S,S,[E,E,E]),(0,h.default)(S,S,[-y[0],-y[1],-y[2]]);var P=(0,l.default)([],[0,0,t],[0,0,0],m);return(0,u.default)(P,P,(0,u.default)(w,w,S)),P}},{key:"fitBounds",value:function(e,t){var n=this.width,r=this.height,i=this.fov,o=this.near,a=this.far;return this._getViewport({width:n,height:r,fov:i,near:o,far:a})}}],[{key:"getDistance",value:function(e){var t=e.boundingBox,n=e.fov;return Math.max(t[0],t[1],t[2])/2/Math.tan(n/180*Math.PI/2)}}]),t}();t.default=w,w.displayName="OrbitView"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=s(n(12)),o=s(n(7)),a=n(1);function s(e){return e&&e.__esModule?e:{default:e}}var u=a.experimental.SphericalCoordinates;var l=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(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)}(t,i.default),r(t,[{key:"_getViewport",value:function(e){var t=e.viewState,n=t.bearing,r=t.pitch,i=t.position,s=t.up,l=50*t.zoom,c=function(e){var t=e.bearing,n=e.pitch;return new u({bearing:t,pitch:n}).toVector3().normalize()}({bearing:n,pitch:r}).scale(-l).multiply(new a.Vector3(1,1,-1)),f=(new a.Matrix4).multiplyRight((new a.Matrix4).lookAt({eye:c,center:i,up:s}));return new o.default(Object.assign({},e,{id:this.id,zoom:null,viewMatrix:f}))}}]),t}();t.default=l,l.displayName="ThirdPersonView"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=s(n(12)),o=s(n(7)),a=n(1);function s(e){return e&&e.__esModule?e:{default:e}}var u=a.experimental.SphericalCoordinates;var l=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(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)}(t,i.default),r(t,[{key:"_getViewport",value:function(e){var t=e.viewState,n=t.modelMatrix,r=void 0===n?null:n,i=t.bearing,s=t.up,l=void 0===s?[0,0,1]:s,c=function(e){var t=e.bearing,n=e.pitch;return new u({bearing:t,pitch:n}).toVector3().normalize()}({bearing:i,pitch:89}),f=r?r.transformDirection(c):c,h=(new a.Matrix4).lookAt({eye:[0,0,0],center:f,up:l});return new o.default(Object.assign({},e,{zoom:null,viewMatrix:h}))}}]),t}();t.default=l,l.displayName="FirstPersonView"},function(e,t){e.exports=function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.projectPosition=function(e,t){var n=t.viewport,s=t.coordinateSystem,l=t.coordinateOrigin,c=t.modelMatrix,f=t.fromCoordinateSystem,h=t.fromCoordinateOrigin,d=r(e,3),p=d[0],v=d[1],g=d[2],y=void 0;if(c){var _=(0,o.default)([],[p,v,g,1],c),m=r(_,3);p=m[0],v=m[1],g=m[2]}void 0===f&&(f=s);void 0===h&&(h=l);switch(f){case i.COORDINATE_SYSTEM.LNGLAT:y=u([p,v,g],n);break;case i.COORDINATE_SYSTEM.LNGLAT_OFFSETS:y=u([p+h[0],v+h[1],g+(h[2]||0)],n);break;case i.COORDINATE_SYSTEM.METER_OFFSETS:y=u(n.addMetersToLngLat(h,[p,v,g]),n);break;default:y=[p,v,g]}switch(s){case i.COORDINATE_SYSTEM.LNGLAT_OFFSETS:case i.COORDINATE_SYSTEM.METER_OFFSETS:var b=u(l,n);(0,a.default)(y,y,b),y[1]=-y[1]}return y};var i=n(23),o=s(n(9)),a=s(n(180));function s(e){return e&&e.__esModule?e:{default:e}}function u(e,t){var n=t.projectFlat(e),i=r(n,2);return[i[0],i[1],(e[2]||0)*t.distanceScales.pixelsPerMeter[2]]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="#define MAX_NUM_OF_LIGHTS 5\n\n// TODO these should be using lighting_ prefix\nuniform vec3 lighting_lightPositions[MAX_NUM_OF_LIGHTS];\nuniform vec2 lighting_lightStrengths[MAX_NUM_OF_LIGHTS];\nuniform float lighting_ambientRatio;\nuniform float lighting_diffuseRatio;\nuniform float lighting_specularRatio;\nuniform int lighting_numberOfLights;\n\nfloat lighting_getLightWeight(vec3 position_worldspace_vec3, vec3 normals_worldspace) {\n float lightWeight = 0.0;\n\n vec3 normals_worldspace_vec3 = normals_worldspace.xyz;\n\n vec3 camera_pos_worldspace = project_uCameraPosition;\n vec3 view_direction = normalize(camera_pos_worldspace - position_worldspace_vec3);\n\n for (int i = 0; i < MAX_NUM_OF_LIGHTS; i++) {\n if (i >= lighting_numberOfLights) {\n break;\n }\n vec3 light_position_worldspace = lighting_lightPositions[i];\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace_vec3);\n\n vec3 halfway_direction = normalize(light_direction + view_direction);\n float lambertian = dot(light_direction, normals_worldspace_vec3);\n float specular = 0.0;\n if (lambertian > 0.0) {\n float specular_angle = max(dot(normals_worldspace_vec3, halfway_direction), 0.0);\n specular = pow(specular_angle, 32.0);\n }\n lambertian = max(lambertian, 0.0);\n lightWeight += (lighting_ambientRatio + lambertian * lighting_diffuseRatio + specular * lighting_specularRatio) *\n lighting_lightStrengths[i].x;\n }\n\n return lightWeight;\n}\n\n// DEPRECATED - Backwards compatibility\n\nfloat getLightWeight(vec3 position_worldspace_vec3, vec3 normals_worldspace) {\n return lighting_getLightWeight(position_worldspace_vec3, normals_worldspace);\n}\n"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="\nconst vec2 WORLD_SCALE_FP64 = vec2(81.4873275756836, 0.0000032873668232014097);\n\nuniform vec2 project64_uScale;\nuniform vec2 project_uViewProjectionMatrixFP64[16];\n\n// longitude: lnglat_fp64.xy; latitude: lnglat_fp64.zw\nvoid mercatorProject_fp64(vec4 lnglat_fp64, out vec2 out_val[2]) {\n\n // #if defined(NVIDIA_FP64_WORKAROUND)\n // out_val[0] = sub_fp64(lnglat_fp64.xy, vec2((-5123200.0),0.0) * ONE);\n // #else \n // out_val[0] = sub_fp64(lnglat_fp64.xy, vec2((-5123200.0),0.0));\n // #endif \n // out_val[1] = sub_fp64(vec2(10002100.0,0.0), lnglat_fp64.zw);\n // return;\n\n float units = geo_units;\n vec4 extent = geo_extent;\n if (units > 0.0 || (extent.w > extent.x && extent.w - extent.x < 721.0)) {\n #if defined(NVIDIA_FP64_WORKAROUND)\n out_val[0] = sub_fp64(lnglat_fp64.xy, vec2(extent.x,0.0) * ONE);\n #else \n out_val[0] = sub_fp64(lnglat_fp64.xy, vec2(extent.x,0.0));\n #endif \n out_val[1] = sub_fp64(vec2(extent.w,0.0), lnglat_fp64.zw);\n return;\n } else {\n #if defined(NVIDIA_FP64_WORKAROUND)\n out_val[0] = sum_fp64(radians_fp64(lnglat_fp64.xy), PI_FP64 * ONE);\n #else\n out_val[0] = sum_fp64(radians_fp64(lnglat_fp64.xy), PI_FP64);\n #endif\n out_val[1] = sub_fp64(PI_FP64,\n log_fp64(tan_fp64(sum_fp64(PI_4_FP64, radians_fp64(lnglat_fp64.zw) / 2.0))));\n return;\n }\n}\n\nvoid project_position_fp64(vec4 position_fp64, out vec2 out_val[2]) {\n vec2 pos_fp64[2];\n mercatorProject_fp64(position_fp64, pos_fp64);\n vec2 x_fp64 = mul_fp64(pos_fp64[0], project64_uScale);\n vec2 y_fp64 = mul_fp64(pos_fp64[1], project64_uScale);\n\n // out_val[0] = mul_fp64(x_fp64, vec2(512.0/ (4884338.499256626 - (-5123200.0)),0.0));\n // out_val[1] = mul_fp64(y_fp64, vec2(512.0/ (4884338.499256626 - (-5123200.0)),0.0));\n // return;\n\n float units = geo_units;\n vec4 extent = geo_extent;\n if(units > 0.0 || (extent.w > extent.x && extent.w - extent.x < 721.0)) {\n out_val[0] = mul_fp64(x_fp64, vec2(TILE_SIZE/(extent.z - extent.x), 0.0));\n out_val[1] = mul_fp64(y_fp64, vec2(TILE_SIZE/(extent.z - extent.x), 0.0));\n } else {\n out_val[0] = mul_fp64(x_fp64, WORLD_SCALE_FP64);\n out_val[1] = mul_fp64(y_fp64, WORLD_SCALE_FP64);\n }\n return;\n}\n\nvoid project_position_fp64(vec2 position, vec2 position64xyLow, out vec2 out_val[2]) {\n vec4 position64xy = vec4(\n position.x, position64xyLow.x,\n position.y, position64xyLow.y);\n\n project_position_fp64(position64xy, out_val);\n}\n\nvec4 project_to_clipspace_fp64(vec2 vertex_pos_modelspace[4]) {\n vec2 vertex_pos_clipspace[4];\n mat4_vec4_mul_fp64(project_uViewProjectionMatrixFP64, vertex_pos_modelspace,\n vertex_pos_clipspace);\n return vec4(\n vertex_pos_clipspace[0].x,\n vertex_pos_clipspace[1].x,\n vertex_pos_clipspace[2].x,\n vertex_pos_clipspace[3].x\n );\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec2 position64xyLow, vec3 offset, out vec4 worldPosition\n) {\n // This is the local offset to the instance position\n vec2 offset64[4];\n vec4_fp64(vec4(offset, 0.0), offset64);\n\n float z = project_scale(position.z);\n\n // Apply web mercator projection (depends on coordinate system imn use)\n vec2 projectedPosition64xy[2];\n project_position_fp64(position.xy, position64xyLow, projectedPosition64xy);\n\n vec2 worldPosition64[4];\n worldPosition64[0] = sum_fp64(offset64[0], projectedPosition64xy[0]);\n worldPosition64[1] = sum_fp64(offset64[1], projectedPosition64xy[1]);\n worldPosition64[2] = sum_fp64(offset64[2], vec2(z, 0.0));\n worldPosition64[3] = vec2(1.0, 0.0);\n\n worldPosition = vec4(projectedPosition64xy[0].x, projectedPosition64xy[1].x, z, 1.0);\n\n return project_to_clipspace_fp64(worldPosition64);\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec2 position64xyLow, vec3 offset\n) {\n vec4 worldPosition;\n return project_position_to_clipspace(\n position, position64xyLow, offset, worldPosition\n );\n}\n"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getUniformsFromViewport=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.viewport,n=e.devicePixelRatio,r=void 0===n?1:n,i=e.modelMatrix,a=void 0===i?null:i,l=e.coordinateSystem,c=void 0===l?o.COORDINATE_SYSTEM.LNGLAT:l,f=e.coordinateOrigin,h=void 0===f?v:f,p=e.projectionMode,y=e.positionOrigin;(0,u.default)(t),void 0!==p&&s.default.removed("projectionMode","coordinateSystem");void 0!==y&&s.default.removed("positionOrigin","coordinateOrigin");return Object.assign({project_uModelMatrix:a||d},g({viewport:t,devicePixelRatio:r,coordinateSystem:c,coordinateOrigin:h}))};var r=c(n(13)),i=c(n(9)),o=n(23),a=c(n(38)),s=c(n(5)),u=c(n(3)),l=n(21);function c(e){return e&&e.__esModule?e:{default:e}}var f=[0,0,0,0],h=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],d=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],p=[0,0,0],v=[0,0,0],g=(0,a.default)(function(e){var t=e.viewport,n=e.devicePixelRatio,a=e.coordinateSystem,s=e.coordinateOrigin,c=t.zoom;(0,u.default)(c>=0);var d=function(e){var t=e.viewport,n=e.coordinateSystem,a=e.coordinateOrigin,s=e.coordinateZoom,u=t.viewMatrixUncentered,c=t.viewMatrix,d=t.projectionMatrix,p=t.viewProjectionMatrix,v=void 0;switch(n){case o.COORDINATE_SYSTEM.IDENTITY:case o.COORDINATE_SYSTEM.LNGLAT:v=f;break;case o.COORDINATE_SYSTEM.LNGLAT_OFFSETS:case o.COORDINATE_SYSTEM.METER_OFFSETS:var g=(0,l.lngLatToWorld)(a,Math.pow(2,s),t.option);v=(0,i.default)([],[g[0],g[1],0,1],p),c=u||c,p=(0,r.default)([],d,c),p=(0,r.default)([],p,h);break;default:throw new Error("Unknown projection mode")}return{viewMatrix:c,viewProjectionMatrix:p,projectionCenter:v,cameraPos:t.cameraPosition}}({coordinateSystem:a,coordinateOrigin:s,coordinateZoom:c,viewport:t}),v=d.projectionCenter,g=d.viewProjectionMatrix,y=d.cameraPos;(0,u.default)(g,"Viewport missing modelViewProjectionMatrix");var _=t.getDistanceScales(),m=[t.width*n,t.height*n],b={project_uCoordinateSystem:a,project_uCenter:v,project_uViewportSize:m,project_uDevicePixelRatio:n,project_uFocalDistance:t.focalDistance||1,project_uPixelsPerMeter:_.pixelsPerMeter,project_uPixelsPerDegree:_.pixelsPerDegree,project_uPixelsPerUnit:_.pixelsPerMeter,project_uPixelsPerUnit2:p,project_uScale:t.scale,project_uViewProjectionMatrix:g,project_uCameraPosition:y,geo_units:0,geo_extent:[0,0,0,0]};if(a===o.COORDINATE_SYSTEM.METER_OFFSETS){var E=t.getDistanceScales(s);b.project_uPixelsPerUnit=E.pixelsPerMeter,b.project_uPixelsPerUnit2=E.pixelsPerMeter2}if(a===o.COORDINATE_SYSTEM.LNGLAT_OFFSETS){var w=t.getDistanceScales(s);b.project_uPixelsPerUnit=w.pixelsPerDegree,b.project_uPixelsPerUnit2=w.pixelsPerDegree2}t.option&&(b.geo_units="m"===t.option.units?1:0,b.geo_extent=[Number(t.option.topTileExtent[0]),Number(t.option.topTileExtent[1]),Number(t.option.topTileExtent[2]),Number(t.option.topTileExtent[3])]);return b})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="float scale(float position) {\n return project_scale(position);\n}\n\nvec2 scale(vec2 position) {\n return project_scale(position);\n}\n\nvec3 scale(vec3 position) {\n return project_scale(position);\n}\n\nvec4 scale(vec4 position) {\n return project_scale(position);\n}\n\nvec2 preproject(vec2 position) {\n return project_position(position);\n}\n\nvec3 preproject(vec3 position) {\n return project_position(position);\n}\n\nvec4 preproject(vec4 position) {\n return project_position(position);\n}\n\nvec4 project(vec4 position) {\n return project_to_clipspace(position);\n}\n"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default='// EXTERNAL CONSTANTS: these must match JavaScript constants in "src/core/lib/constants.js"\nconst float COORDINATE_SYSTEM_IDENTITY = 0.;\nconst float COORDINATE_SYSTEM_LNG_LAT = 1.;\nconst float COORDINATE_SYSTEM_METER_OFFSETS = 2.;\nconst float COORDINATE_SYSTEM_LNGLAT_OFFSETS = 3.;\n\nuniform float project_uCoordinateSystem;\nuniform float project_uScale;\nuniform vec3 project_uPixelsPerMeter;\nuniform vec3 project_uPixelsPerDegree;\nuniform vec3 project_uPixelsPerUnit;\nuniform vec3 project_uPixelsPerUnit2;\nuniform vec4 project_uCenter;\nuniform mat4 project_uModelMatrix;\nuniform mat4 project_uViewProjectionMatrix;\nuniform vec2 project_uViewportSize;\nuniform float project_uDevicePixelRatio;\nuniform float project_uFocalDistance;\nuniform vec3 project_uCameraPosition;\n\nuniform float geo_units;\nuniform vec4 geo_extent;\n\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / (PI * 2.0);\n\n//\n// Scaling offsets - scales meters to "pixels"\n// Note the scalar version of project_scale is for scaling the z component only\n//\nfloat project_scale(float meters) {\n return meters * project_uPixelsPerMeter.z;\n}\n\nvec2 project_scale(vec2 meters) {\n return meters * project_uPixelsPerMeter.xy;\n}\n\nvec3 project_scale(vec3 meters) {\n return meters * project_uPixelsPerMeter;\n}\n\nvec4 project_scale(vec4 meters) {\n return vec4(meters.xyz * project_uPixelsPerMeter, meters.w);\n}\n\n//\n// Projecting normal - transform deltas from current coordinate system to\n// normals in the worldspace\n//\nvec3 project_normal(vec3 vector) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNG_LAT ||\n project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSETS) {\n return normalize(vector * project_uPixelsPerDegree);\n }\n // Apply model matrix\n vec4 normal_modelspace = project_uModelMatrix * vec4(vector, 0.0);\n return normalize(normal_modelspace.xyz * project_uPixelsPerMeter);\n}\n\nvec4 project_offset_(vec4 offset) {\n vec3 pixelsPerUnit = project_uPixelsPerUnit + project_uPixelsPerUnit2 * offset.y;\n return vec4(offset.xyz * pixelsPerUnit, offset.w);\n}\n\n//\n// Projecting positions - non-linear projection: lnglats => unit tile [0-1, 0-1]\n//\nvec2 project_mercator_(vec2 lnglat) {\n // return vec2(\n // lnglat.x - (-5123200.0),\n // 10002100.0 - lnglat.y\n // );\n float units = geo_units;\n vec4 extent = geo_extent;\n if (units > 0.0 || (extent.w > extent.x && extent.w - extent.x < 721.0)) {\n return vec2(\n lnglat.x - extent.x,\n extent.w - lnglat.y\n );\n } else {\n return vec2(\n radians(lnglat.x) + PI,\n PI - log(tan_fp32(PI * 0.25 + radians(lnglat.y) * 0.5))\n );\n }\n}\n\n//\n// Projects lnglats (or meter offsets, depending on mode) to pixels\n//\nvec4 project_position(vec4 position) {\n // TODO - why not simply subtract center and fall through?\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNG_LAT) {\n // return project_uModelMatrix * vec4(\n // project_mercator_(position.xy) * TILE_SIZE * project_uScale / (4884338.499256626 - (-5123200.0)),\n // project_scale(position.z),\n // position.w\n // );\n float units = geo_units;\n vec4 extent = geo_extent;\n if (units > 0.0 || (extent.w > extent.x && extent.w - extent.x < 721.0)) {\n return project_uModelMatrix * vec4(\n project_mercator_(position.xy) * TILE_SIZE * project_uScale / (extent.z - extent.x),\n project_scale(position.z),\n position.w\n );\n } else {\n return project_uModelMatrix * vec4(\n project_mercator_(position.xy) * WORLD_SCALE * project_uScale,\n project_scale(position.z),\n position.w\n );\n }\n }\n\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSETS) {\n return project_offset_(position);\n }\n\n // METER_OFFSETS or IDENTITY\n // Apply model matrix\n vec4 position_modelspace = project_uModelMatrix * position;\n return project_offset_(position_modelspace);\n}\n\nvec3 project_position(vec3 position) {\n vec4 projected_position = project_position(vec4(position, 1.0));\n return projected_position.xyz;\n}\n\nvec2 project_position(vec2 position) {\n vec4 projected_position = project_position(vec4(position, 0.0, 1.0));\n return projected_position.xy;\n}\n\n//\n// Projects from "world" coordinates to clip space.\n// Uses project_uViewProjectionMatrix\n//\nvec4 project_to_clipspace(vec4 position) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_METER_OFFSETS ||\n project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSETS) {\n // Needs to be divided with project_uPixelsPerMeter\n position.w *= project_uPixelsPerMeter.z;\n }\n return project_uViewProjectionMatrix * position + project_uCenter;\n}\n\n// Returns a clip space offset that corresponds to a given number of **non-device** pixels\nvec4 project_pixel_to_clipspace(vec2 pixels) {\n vec2 offset = pixels / project_uViewportSize * project_uDevicePixelRatio;\n return vec4(offset * project_uFocalDistance, 0.0, 0.0);\n}\n'},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=s(n(45)),o=s(n(5)),a=n(22);function s(e){return e&&e.__esModule?e:{default:e}}var u=function(e){function t(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return function(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)}(t,i.default),r(t,[{key:"getSubLayers",value:function(){return this.internalState&&this.internalState.subLayers||[]}},{key:"initializeState",value:function(){}},{key:"getPickingInfo",value:function(e){return e.info}},{key:"renderLayers",value:function(){return null}},{key:"getSubLayerProps",value:function(e){var t=this.props,n={opacity:t.opacity,pickable:t.pickable,visible:t.visible,parameters:t.parameters,getPolygonOffset:t.getPolygonOffset,highlightedObjectIndex:t.highlightedObjectIndex,autoHighlight:t.autoHighlight,highlightColor:t.highlightColor,coordinateSystem:t.coordinateSystem,coordinateOrigin:t.coordinateOrigin,modelMatrix:t.modelMatrix};return e&&Object.assign(n,e,{id:this.props.id+"-"+e.id,updateTriggers:Object.assign({all:this.props.updateTriggers.all},e.updateTriggers)}),n}},{key:"_renderLayers",value:function(){var e=this.internalState.subLayers;e&&!this.needsUpdate()?o.default.log(3,"Composite layer reused subLayers "+this,this.internalState.subLayers)():(e=this.renderLayers(),e=(0,a.flatten)(e,{filter:Boolean}),this.internalState.subLayers=e,o.default.log(2,"Composite layer rendered new subLayers "+this,e)());var t=!0,n=!1,r=void 0;try{for(var i,s=e[Symbol.iterator]();!(t=(i=s.next()).done);t=!0){i.value.parent=this}}catch(e){n=!0,r=e}finally{try{!t&&s.return&&s.return()}finally{if(n)throw r}}}},{key:"isComposite",get:function(){return!0}}]),t}();t.default=u,u.layerName="CompositeLayer"},function(e,t,n){var r;
- /*! Hammer.JS - v2.0.7 - 2016-04-22
- * http://hammerjs.github.io/
- *
- * Copyright (c) 2016 Jorik Tangelder;
- * Licensed under the MIT license */
- /*! Hammer.JS - v2.0.7 - 2016-04-22
- * http://hammerjs.github.io/
- *
- * Copyright (c) 2016 Jorik Tangelder;
- * Licensed under the MIT license */
- !function(i,o,a,s){"use strict";var u,l=["","webkit","Moz","MS","ms","o"],c=o.createElement("div"),f="function",h=Math.round,d=Math.abs,p=Date.now;function v(e,t,n){return setTimeout(w(e,n),t)}function g(e,t,n){return!!Array.isArray(e)&&(y(e,n[t],n),!0)}function y(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==s)for(r=0;r<e.length;)t.call(n,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r,e)}function _(e,t,n){var r="DEPRECATED METHOD: "+t+"\n"+n+" AT \n";return function(){var t=new Error("get-stack-trace"),n=t&&t.stack?t.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=i.console&&(i.console.warn||i.console.log);return o&&o.call(i.console,r,n),e.apply(this,arguments)}}u="function"!=typeof Object.assign?function(e){if(e===s||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(r!==s&&null!==r)for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])}return t}:Object.assign;var m=_(function(e,t,n){for(var r=Object.keys(t),i=0;i<r.length;)(!n||n&&e[r[i]]===s)&&(e[r[i]]=t[r[i]]),i++;return e},"extend","Use `assign`."),b=_(function(e,t){return m(e,t,!0)},"merge","Use `assign`.");function E(e,t,n){var r,i=t.prototype;(r=e.prototype=Object.create(i)).constructor=e,r._super=i,n&&u(r,n)}function w(e,t){return function(){return e.apply(t,arguments)}}function S(e,t){return typeof e==f?e.apply(t&&t[0]||s,t):e}function P(e,t){return e===s?t:e}function T(e,t,n){y(R(t),function(t){e.addEventListener(t,n,!1)})}function A(e,t,n){y(R(t),function(t){e.removeEventListener(t,n,!1)})}function x(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function O(e,t){return e.indexOf(t)>-1}function R(e){return e.trim().split(/\s+/g)}function C(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;r<e.length;){if(n&&e[r][n]==t||!n&&e[r]===t)return r;r++}return-1}function k(e){return Array.prototype.slice.call(e,0)}function M(e,t,n){for(var r=[],i=[],o=0;o<e.length;){var a=t?e[o][t]:e[o];C(i,a)<0&&r.push(e[o]),i[o]=a,o++}return n&&(r=t?r.sort(function(e,n){return e[t]>n[t]}):r.sort()),r}function I(e,t){for(var n,r,i=t[0].toUpperCase()+t.slice(1),o=0;o<l.length;){if((r=(n=l[o])?n+i:t)in e)return r;o++}return s}var L=1;function N(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow||i}var F="ontouchstart"in i,j=I(i,"PointerEvent")!==s,D=F&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),B=25,U=1,G=2,V=4,z=8,X=1,W=2,H=4,Y=8,K=16,Z=W|H,q=Y|K,Q=Z|q,J=["x","y"],$=["clientX","clientY"];function ee(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){S(e.options.enable,[e])&&n.handler(t)},this.init()}function te(e,t,n){var r=n.pointers.length,i=n.changedPointers.length,o=t&U&&r-i==0,a=t&(V|z)&&r-i==0;n.isFirst=!!o,n.isFinal=!!a,o&&(e.session={}),n.eventType=t,function(e,t){var n=e.session,r=t.pointers,i=r.length;n.firstInput||(n.firstInput=ne(t));i>1&&!n.firstMultiple?n.firstMultiple=ne(t):1===i&&(n.firstMultiple=!1);var o=n.firstInput,a=n.firstMultiple,u=a?a.center:o.center,l=t.center=re(r);t.timeStamp=p(),t.deltaTime=t.timeStamp-o.timeStamp,t.angle=se(u,l),t.distance=ae(u,l),function(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},o=e.prevInput||{};t.eventType!==U&&o.eventType!==V||(i=e.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y});t.deltaX=i.x+(n.x-r.x),t.deltaY=i.y+(n.y-r.y)}(n,t),t.offsetDirection=oe(t.deltaX,t.deltaY);var c=ie(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=c.x,t.overallVelocityY=c.y,t.overallVelocity=d(c.x)>d(c.y)?c.x:c.y,t.scale=a?(f=a.pointers,h=r,ae(h[0],h[1],$)/ae(f[0],f[1],$)):1,t.rotation=a?function(e,t){return se(t[1],t[0],$)+se(e[1],e[0],$)}(a.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,r,i,o,a=e.lastInterval||t,u=t.timeStamp-a.timeStamp;if(t.eventType!=z&&(u>B||a.velocity===s)){var l=t.deltaX-a.deltaX,c=t.deltaY-a.deltaY,f=ie(u,l,c);r=f.x,i=f.y,n=d(f.x)>d(f.y)?f.x:f.y,o=oe(l,c),e.lastInterval=t}else n=a.velocity,r=a.velocityX,i=a.velocityY,o=a.direction;t.velocity=n,t.velocityX=r,t.velocityY=i,t.direction=o}(n,t);var f,h;var v=e.element;x(t.srcEvent.target,v)&&(v=t.srcEvent.target);t.target=v}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function ne(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:h(e.pointers[n].clientX),clientY:h(e.pointers[n].clientY)},n++;return{timeStamp:p(),pointers:t,center:re(t),deltaX:e.deltaX,deltaY:e.deltaY}}function re(e){var t=e.length;if(1===t)return{x:h(e[0].clientX),y:h(e[0].clientY)};for(var n=0,r=0,i=0;i<t;)n+=e[i].clientX,r+=e[i].clientY,i++;return{x:h(n/t),y:h(r/t)}}function ie(e,t,n){return{x:t/e||0,y:n/e||0}}function oe(e,t){return e===t?X:d(e)>=d(t)?e<0?W:H:t<0?Y:K}function ae(e,t,n){n||(n=J);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function se(e,t,n){n||(n=J);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return 180*Math.atan2(i,r)/Math.PI}ee.prototype={handler:function(){},init:function(){this.evEl&&T(this.element,this.evEl,this.domHandler),this.evTarget&&T(this.target,this.evTarget,this.domHandler),this.evWin&&T(N(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&A(this.element,this.evEl,this.domHandler),this.evTarget&&A(this.target,this.evTarget,this.domHandler),this.evWin&&A(N(this.element),this.evWin,this.domHandler)}};var ue={mousedown:U,mousemove:G,mouseup:V},le="mousedown",ce="mousemove mouseup";function fe(){this.evEl=le,this.evWin=ce,this.pressed=!1,ee.apply(this,arguments)}E(fe,ee,{handler:function(e){var t=ue[e.type];t&U&&0===e.button&&(this.pressed=!0),t&G&&1!==e.which&&(t=V),this.pressed&&(t&V&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:"mouse",srcEvent:e}))}});var he={pointerdown:U,pointermove:G,pointerup:V,pointercancel:z,pointerout:z},de={2:"touch",3:"pen",4:"mouse",5:"kinect"},pe="pointerdown",ve="pointermove pointerup pointercancel";function ge(){this.evEl=pe,this.evWin=ve,ee.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}i.MSPointerEvent&&!i.PointerEvent&&(pe="MSPointerDown",ve="MSPointerMove MSPointerUp MSPointerCancel"),E(ge,ee,{handler:function(e){var t=this.store,n=!1,r=e.type.toLowerCase().replace("ms",""),i=he[r],o=de[e.pointerType]||e.pointerType,a="touch"==o,s=C(t,e.pointerId,"pointerId");i&U&&(0===e.button||a)?s<0&&(t.push(e),s=t.length-1):i&(V|z)&&(n=!0),s<0||(t[s]=e,this.callback(this.manager,i,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),n&&t.splice(s,1))}});var ye={touchstart:U,touchmove:G,touchend:V,touchcancel:z},_e="touchstart",me="touchstart touchmove touchend touchcancel";function be(){this.evTarget=_e,this.evWin=me,this.started=!1,ee.apply(this,arguments)}E(be,ee,{handler:function(e){var t=ye[e.type];if(t===U&&(this.started=!0),this.started){var n=function(e,t){var n=k(e.touches),r=k(e.changedTouches);t&(V|z)&&(n=M(n.concat(r),"identifier",!0));return[n,r]}.call(this,e,t);t&(V|z)&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:"touch",srcEvent:e})}}});var Ee={touchstart:U,touchmove:G,touchend:V,touchcancel:z},we="touchstart touchmove touchend touchcancel";function Se(){this.evTarget=we,this.targetIds={},ee.apply(this,arguments)}E(Se,ee,{handler:function(e){var t=Ee[e.type],n=function(e,t){var n=k(e.touches),r=this.targetIds;if(t&(U|G)&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,o,a=k(e.changedTouches),s=[],u=this.target;if(o=n.filter(function(e){return x(e.target,u)}),t===U)for(i=0;i<o.length;)r[o[i].identifier]=!0,i++;i=0;for(;i<a.length;)r[a[i].identifier]&&s.push(a[i]),t&(V|z)&&delete r[a[i].identifier],i++;if(!s.length)return;return[M(o.concat(s),"identifier",!0),s]}.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:"touch",srcEvent:e})}});var Pe=2500,Te=25;function Ae(){ee.apply(this,arguments);var e=w(this.handler,this);this.touch=new Se(this.manager,e),this.mouse=new fe(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function xe(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY};this.lastTouches.push(n);var r=this.lastTouches;setTimeout(function(){var e=r.indexOf(n);e>-1&&r.splice(e,1)},Pe)}}E(Ae,ee,{handler:function(e,t,n){var r="touch"==n.pointerType,i="mouse"==n.pointerType;if(!(i&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(r)(function(e,t){e&U?(this.primaryTouch=t.changedPointers[0].identifier,xe.call(this,t)):e&(V|z)&&xe.call(this,t)}).call(this,t,n);else if(i&&function(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],o=Math.abs(t-i.x),a=Math.abs(n-i.y);if(o<=Te&&a<=Te)return!0}return!1}.call(this,n))return;this.callback(e,t,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var Oe=I(c.style,"touchAction"),Re=Oe!==s,Ce="auto",ke="manipulation",Me="none",Ie="pan-x",Le="pan-y",Ne=function(){if(!Re)return!1;var e={},t=i.CSS&&i.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(n){e[n]=!t||i.CSS.supports("touch-action",n)}),e}();function Fe(e,t){this.manager=e,this.set(t)}Fe.prototype={set:function(e){"compute"==e&&(e=this.compute()),Re&&this.manager.element.style&&Ne[e]&&(this.manager.element.style[Oe]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return y(this.manager.recognizers,function(t){S(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))}),function(e){if(O(e,Me))return Me;var t=O(e,Ie),n=O(e,Le);if(t&&n)return Me;if(t||n)return t?Ie:Le;if(O(e,ke))return ke;return Ce}(e.join(" "))},preventDefaults:function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var r=this.actions,i=O(r,Me)&&!Ne[Me],o=O(r,Le)&&!Ne[Le],a=O(r,Ie)&&!Ne[Ie];if(i){var s=1===e.pointers.length,u=e.distance<2,l=e.deltaTime<250;if(s&&u&&l)return}if(!a||!o)return i||o&&n&Z||a&&n&q?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var je=1,De=2,Be=4,Ue=8,Ge=Ue,Ve=16;function ze(e){this.options=u({},this.defaults,e||{}),this.id=L++,this.manager=null,this.options.enable=P(this.options.enable,!0),this.state=je,this.simultaneous={},this.requireFail=[]}function Xe(e){return e&Ve?"cancel":e&Ue?"end":e&Be?"move":e&De?"start":""}function We(e){return e==K?"down":e==Y?"up":e==W?"left":e==H?"right":""}function He(e,t){var n=t.manager;return n?n.get(e):e}function Ye(){ze.apply(this,arguments)}function Ke(){Ye.apply(this,arguments),this.pX=null,this.pY=null}function Ze(){Ye.apply(this,arguments)}function qe(){ze.apply(this,arguments),this._timer=null,this._input=null}function Qe(){Ye.apply(this,arguments)}function Je(){Ye.apply(this,arguments)}function $e(){ze.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function et(e,t){return(t=t||{}).recognizers=P(t.recognizers,et.defaults.preset),new tt(e,t)}ze.prototype={defaults:{},set:function(e){return u(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(g(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=He(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return g(e,"dropRecognizeWith",this)?this:(e=He(e,this),delete this.simultaneous[e.id],this)},requireFailure:function(e){if(g(e,"requireFailure",this))return this;var t=this.requireFail;return-1===C(t,e=He(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(g(e,"dropRequireFailure",this))return this;e=He(e,this);var t=C(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function r(n){t.manager.emit(n,e)}n<Ue&&r(t.options.event+Xe(n)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),n>=Ue&&r(t.options.event+Xe(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=32},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(this.requireFail[e].state&(32|je)))return!1;e++}return!0},recognize:function(e){var t=u({},e);if(!S(this.options.enable,[this,t]))return this.reset(),void(this.state=32);this.state&(Ge|Ve|32)&&(this.state=je),this.state=this.process(t),this.state&(De|Be|Ue|Ve)&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},E(Ye,ze,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,n=e.eventType,r=t&(De|Be),i=this.attrTest(e);return r&&(n&z||!i)?t|Ve:r||i?n&V?t|Ue:t&De?t|Be:De:32}}),E(Ke,Ye,{defaults:{event:"pan",threshold:10,pointers:1,direction:Q},getTouchAction:function(){var e=this.options.direction,t=[];return e&Z&&t.push(Le),e&q&&t.push(Ie),t},directionTest:function(e){var t=this.options,n=!0,r=e.distance,i=e.direction,o=e.deltaX,a=e.deltaY;return i&t.direction||(t.direction&Z?(i=0===o?X:o<0?W:H,n=o!=this.pX,r=Math.abs(e.deltaX)):(i=0===a?X:a<0?Y:K,n=a!=this.pY,r=Math.abs(e.deltaY))),e.direction=i,n&&r>t.threshold&&i&t.direction},attrTest:function(e){return Ye.prototype.attrTest.call(this,e)&&(this.state&De||!(this.state&De)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=We(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),E(Ze,Ye,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Me]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||this.state&De)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),E(qe,ze,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Ce]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime>t.time;if(this._input=e,!r||!n||e.eventType&(V|z)&&!i)this.reset();else if(e.eventType&U)this.reset(),this._timer=v(function(){this.state=Ge,this.tryEmit()},t.time,this);else if(e.eventType&V)return Ge;return 32},reset:function(){clearTimeout(this._timer)},emit:function(e){this.state===Ge&&(e&&e.eventType&V?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=p(),this.manager.emit(this.options.event,this._input)))}}),E(Qe,Ye,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Me]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||this.state&De)}}),E(Je,Ye,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Z|q,pointers:1},getTouchAction:function(){return Ke.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return n&(Z|q)?t=e.overallVelocity:n&Z?t=e.overallVelocityX:n&q&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&d(t)>this.options.velocity&&e.eventType&V},emit:function(e){var t=We(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),E($e,ze,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ke]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime<t.time;if(this.reset(),e.eventType&U&&0===this.count)return this.failTimeout();if(r&&i&&n){if(e.eventType!=V)return this.failTimeout();var o=!this.pTime||e.timeStamp-this.pTime<t.interval,a=!this.pCenter||ae(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,a&&o?this.count+=1:this.count=1,this._input=e,0===this.count%t.taps)return this.hasRequireFailures()?(this._timer=v(function(){this.state=Ge,this.tryEmit()},t.interval,this),De):Ge}return 32},failTimeout:function(){return this._timer=v(function(){this.state=32},this.options.interval,this),32},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==Ge&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),et.VERSION="2.0.7",et.defaults={domEvents:!1,touchAction:"compute",enable:!0,inputTarget:null,inputClass:null,preset:[[Qe,{enable:!1}],[Ze,{enable:!1},["rotate"]],[Je,{direction:Z}],[Ke,{direction:Z},["swipe"]],[$e],[$e,{event:"doubletap",taps:2},["tap"]],[qe]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function tt(e,t){var n;this.options=u({},et.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new((n=this).options.inputClass||(j?ge:D?Se:F?Ae:fe))(n,te),this.touchAction=new Fe(this,this.options.touchAction),nt(this,!0),y(this.options.recognizers,function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])},this)}function nt(e,t){var n,r=e.element;r.style&&(y(e.options.cssProps,function(i,o){n=I(r.style,o),t?(e.oldCssProps[n]=r.style[n],r.style[n]=i):r.style[n]=e.oldCssProps[n]||""}),t||(e.oldCssProps={}))}tt.prototype={set:function(e){return u(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?2:1},recognize:function(e){var t=this.session;if(!t.stopped){var n;this.touchAction.preventDefaults(e);var r=this.recognizers,i=t.curRecognizer;(!i||i&&i.state&Ge)&&(i=t.curRecognizer=null);for(var o=0;o<r.length;)n=r[o],2===t.stopped||i&&n!=i&&!n.canRecognizeWith(i)?n.reset():n.recognize(e),!i&&n.state&(De|Be|Ue)&&(i=t.curRecognizer=n),o++}},get:function(e){if(e instanceof ze)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event==e)return t[n];return null},add:function(e){if(g(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(g(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,n=C(t,e);-1!==n&&(t.splice(n,1),this.touchAction.update())}return this},on:function(e,t){if(e!==s&&t!==s){var n=this.handlers;return y(R(e),function(e){n[e]=n[e]||[],n[e].push(t)}),this}},off:function(e,t){if(e!==s){var n=this.handlers;return y(R(e),function(e){t?n[e]&&n[e].splice(C(n[e],t),1):delete n[e]}),this}},emit:function(e,t){this.options.domEvents&&function(e,t){var n=o.createEvent("Event");n.initEvent(e,!0,!0),n.gesture=t,t.target.dispatchEvent(n)}(e,t);var n=this.handlers[e]&&this.handlers[e].slice();if(n&&n.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var r=0;r<n.length;)n[r](t),r++}},destroy:function(){this.element&&nt(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},u(et,{INPUT_START:U,INPUT_MOVE:G,INPUT_END:V,INPUT_CANCEL:z,STATE_POSSIBLE:je,STATE_BEGAN:De,STATE_CHANGED:Be,STATE_ENDED:Ue,STATE_RECOGNIZED:Ge,STATE_CANCELLED:Ve,STATE_FAILED:32,DIRECTION_NONE:X,DIRECTION_LEFT:W,DIRECTION_RIGHT:H,DIRECTION_UP:Y,DIRECTION_DOWN:K,DIRECTION_HORIZONTAL:Z,DIRECTION_VERTICAL:q,DIRECTION_ALL:Q,Manager:tt,Input:ee,TouchAction:Fe,TouchInput:Se,MouseInput:fe,PointerEventInput:ge,TouchMouseInput:Ae,SingleTouchInput:be,Recognizer:ze,AttrRecognizer:Ye,Tap:$e,Pan:Ke,Swipe:Je,Pinch:Ze,Rotate:Qe,Press:qe,on:T,off:A,each:y,merge:b,extend:m,assign:u,inherit:E,bindFn:w,prefixed:I}),(void 0!==i?i:"undefined"!=typeof self?self:{}).Hammer=et,(r=function(){return et}.call(t,n,t,e))===s||(e.exports=r)}(window,document)},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.parsePosition=function(e){switch(void 0===e?"undefined":r(e)){case"number":return{position:e,relative:!1};case"string":var t=e.match(i);if(t&&t.length>=3){var n="%"===t[2],o=parseFloat(t[1]);return{position:n?o/100:o,relative:n}}default:throw new Error("Could not parse position string "+e)}},t.getPosition=function(e,t){return e.relative?Math.round(e.position*t):e.position};var i=/([0-9]+\.?[0-9]*)(%|px)/},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){var u={},l=e.zoom,c=[e.longitude,e.latitude],f=(0,o.zoomToScale)(l),h=t.zoom,d=[t.longitude,t.latitude],p=(0,o.zoomToScale)(h-l),v=new r.Vector2((0,o.lngLatToWorld)(c,f)),g=new r.Vector2((0,o.lngLatToWorld)(d,f)).subtract(v),y=Math.max(e.width,e.height),_=y/p,m=Math.sqrt(g.x*g.x+g.y*g.y);if(Math.abs(m)<a){var b=!0,E=!1,w=void 0;try{for(var S,P=s[Symbol.iterator]();!(b=(S=P.next()).done);b=!0){var T=S.value,A=e[T],x=t[T];u[T]=(0,i.lerp)(A,x,n)}}catch(e){E=!0,w=e}finally{try{!b&&P.return&&P.return()}finally{if(E)throw w}}return u}var O=1.414*1.414,R=(_*_-y*y+O*O*m*m)/(2*y*O*m),C=(_*_-y*y-O*O*m*m)/(2*_*O*m),k=Math.log(Math.sqrt(R*R+1)-R),M=Math.log(Math.sqrt(C*C+1)-C),I=n*((M-k)/1.414),L=Math.cosh(k)/Math.cosh(k+1.414*I),N=y*((Math.cosh(k)*Math.tanh(k+1.414*I)-Math.sinh(k))/O)/m,F=1/L,j=l+(0,o.scaleToZoom)(F),D=(0,o.worldToLngLat)(v.add(g.scale(N)).scale(F),(0,o.zoomToScale)(j));return u.longitude=D[0],u.latitude=D[1],u.zoom=j,u};var r=n(1),i=n(32),o=n(31),a=.01,s=["longitude","latitude","zoom"]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.width,n=e.height,r=e.longitude,i=e.latitude,l=e.zoom,c=e.pitch,f=void 0===c?0:c,h=e.bearing,d=void 0===h?0:h;(r<-180||r>180)&&(r=(0,a.mod)(r+180,360)-180);(d<-180||d>180)&&(d=(0,a.mod)(d+180,360)-180);var p=new o.default({width:t,height:n,longitude:r,latitude:i,zoom:l}),v=p.project([r,s])[1],g=p.project([r,u])[1],y=0;g-v<n&&(l+=Math.log2(n/(g-v)),p=new o.default({width:t,height:n,longitude:r,latitude:i,zoom:l}),v=p.project([r,s])[1],g=p.project([r,u])[1]);v>0?y=v:g<n&&(y=g-n);y&&(i=p.unproject([t/2,n/2+y])[1]);return{width:t,height:n,longitude:r,latitude:i,zoom:l,pitch:f,bearing:d}};var r,i=n(42),o=(r=i)&&r.__esModule?r:{default:r},a=n(32);var s=85.05113,u=-85.05113},function(e,t){e.exports=function(e,t,n,r){var i=t[0],o=t[1];return e[0]=i+r*(n[0]-i),e[1]=o+r*(n[1]-o),e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(1),a=n(32),s=n(31),u=h(n(16)),l=h(n(15)),c=h(n(13)),f=h(n(34));function h(e){return e&&e.__esModule?e:{default:e}}var d=(0,a.createMat4)(),p=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width,r=t.height,i=t.viewMatrix,o=void 0===i?d:i,s=t.projectionMatrix,h=void 0===s?d:s;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.width=n||1,this.height=r||1,this.scale=1,this.viewMatrix=o,this.projectionMatrix=h;var p=(0,a.createMat4)();(0,c.default)(p,p,this.projectionMatrix),(0,c.default)(p,p,this.viewMatrix),this.viewProjectionMatrix=p;var v=(0,a.createMat4)();(0,u.default)(v,v,[this.width/2,-this.height/2,1]),(0,l.default)(v,v,[1,-1,0]),(0,c.default)(v,v,this.viewProjectionMatrix);var g=(0,f.default)((0,a.createMat4)(),v);if(!g)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=v,this.pixelUnprojectionMatrix=g,this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this)}return i(e,[{key:"equals",value:function(t){return t instanceof e&&(t.width===this.width&&t.height===this.height&&(0,o.equals)(t.projectionMatrix,this.projectionMatrix)&&(0,o.equals)(t.viewMatrix,this.viewMatrix))}},{key:"project",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).topLeft,n=void 0===t||t,i=r(e,3),o=i[0],a=i[1],u=i[2],l=this.projectFlat([o,a]),c=r(l,2),f=c[0],h=c[1],d=(0,s.worldToPixels)([f,h,u],this.pixelProjectionMatrix),p=r(d,2),v=p[0],g=p[1],y=n?g:this.height-g;return 2===e.length?[v,y]:[v,y,d[2]]}},{key:"unproject",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.topLeft,i=void 0===n||n,o=t.targetZ,a=r(e,3),u=a[0],l=a[1],c=a[2],f=i?l:this.height-l,h=(0,s.pixelsToWorld)([u,f,c],this.pixelUnprojectionMatrix,o),d=this.unprojectFlat(h),p=r(d,2),v=p[0],g=p[1];return Number.isFinite(c)?[v,g,h[2]]:Number.isFinite(o)?[v,g,o]:[v,g]}},{key:"projectFlat",value:function(e){arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return e}},{key:"unprojectFlat",value:function(e){arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return e}}]),e}();t.default=p},function(e,t){e.exports=function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=c(n(3)),o=n(71),a=c(n(12)),s=c(n(7)),u=c(n(5)),l=n(22);function c(e){return e&&e.__esModule?e:{default:e}}var f={latitude:0,longitude:0,zoom:1},h=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.views=[],this.width=100,this.height=100,this.viewState=f,this._viewports=[],this._needsRedraw="Initial render",this._needsUpdate=!0,Object.seal(this),this.setProps(t)}return r(e,[{key:"finalize",value:function(){}},{key:"needsRedraw",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).clearRedrawFlags,t=void 0===e||e,n=this._needsRedraw;return t&&(this._needsRedraw=!1),n}},{key:"setNeedsRedraw",value:function(e){this._needsRedraw=this._needsRedraw||e}},{key:"setNeedsUpdate",value:function(e){this._needsUpdate=this._needsUpdate||e,this._needsRedraw=this._needsRedraw||e}},{key:"getViewports",value:function(){return this._rebuildViewportsFromViews(),this._viewports}},{key:"project",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{topLeft:!0},n=this.getViewports(),r=n.length-1;r>=0;--r){var i=n[r];if(i.contains(e,t))return i.project(e,t)}return null}},{key:"unproject",value:function(e,t){for(var n=this.getViewports(),r=n.length-1;r>=0;--r){var i=n[r];if(i.containsPixel(e,t))return i.unproject(e)}return null}},{key:"setProps",value:function(e){"views"in e&&this.setViews(e.views),"viewState"in e&&this.setViewState(e.viewState),("width"in e||"height"in e)&&this.setSize(e.width,e.height),"useDevicePixels"in e&&(this.context.useDevicePixels=e.useDevicePixels)}},{key:"setSize",value:function(e,t){(0,i.default)(Number.isFinite(e)&&Number.isFinite(t)),e===this.width&&t===this.height||(this.width=e,this.height=t,this.setNeedsUpdate("Size changed"))}},{key:"setViews",value:function(e){e=(0,l.flatten)(e,{filter:Boolean}).map(function(e){return e instanceof s.default?new a.default({viewportInstance:e}):e}),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}},{key:"setViewState",value:function(e){e?((0,o.deepEqual)(e,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):u.default.warn("setting null viewState")()}},{key:"_rebuildViewportsFromViews",value:function(){if(this._needsUpdate){var e=this.width,t=this.height,n=this.views,r=this.viewState;this._viewports=n.map(function(n){return n.makeViewport({width:e,height:t,viewState:r})}),this._needsUpdate=!1}}},{key:"_diffViews",value:function(e,t){return e.length!==t.length||e.some(function(n,r){return!e[r].equals(t[r])})}}]),e}();t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pickObject=function(e,t){for(var n=t.layers,i=t.viewports,o=t.x,a=t.y,f=t.radius,h=t.layerFilter,d=t.depth,p=void 0===d?1:d,v=t.mode,g=t.onViewportActive,y=t.pickingFBO,_=t.lastPickedInfo,m=t.useDevicePixels,b=(0,r.getPixelRatio)({useDevicePixels:m}),E=Math.round(o*b),w=Math.round(e.canvas.height-a*b),S=Math.round(f*b),P=function(e){var t=e.deviceX,n=e.deviceY,r=e.deviceRadius,i=e.deviceWidth,o=e.deviceHeight;if(!(t>=0&&n>=0&&t<i&&n<o))return null;var a=Math.max(0,t-r),s=Math.max(0,n-r),u=Math.min(i,t+r)-a+1,l=Math.min(o,n+r)-s+1;return{x:a,y:s,width:u,height:l}}({deviceX:E,deviceY:w,deviceRadius:S,deviceWidth:y.width,deviceHeight:y.height}),T=[],A={},x=0;x<p;x++){var O=P&&u(e,{layers:n,viewports:i,onViewportActive:g,useDevicePixels:m,pickingFBO:y,deviceRect:P,layerFilter:h,redrawReason:v}),R=O&&c(e,{pickedColors:O,layers:n,deviceX:E,deviceY:w,deviceRadius:S,deviceRect:P})||s;if(R.pickedColor&&x+1<p){var C=R.pickedColor[3]-1;A[C]||(A[C]=n[C].copyPickingColors()),n[C].clearPickingColor(R.pickedColor)}var k=l({pickInfo:R,lastPickedInfo:_,mode:v,layers:n,viewports:i,x:o,y:a,deviceX:E,deviceY:w,pixelRatio:b});if(k&&k.forEach(function(e){return T.push(e)}),!R.pickedColor)break}return Object.keys(A).forEach(function(e){return n[e].restorePickingColors(A[e])}),T},t.pickVisibleObjects=function(e,t){var n=t.layers,o=t.viewports,a=t.x,s=t.y,l=t.width,c=t.height,h=t.mode,d=t.layerFilter,p=t.onViewportActive,v=t.pickingFBO,g=t.useDevicePixels,y=(0,r.getPixelRatio)({useDevicePixels:g}),_=Math.round(a*y),m=Math.round(e.canvas.height-s*y),b=Math.round((a+l)*y),E=Math.round(e.canvas.height-(s+c)*y),w=u(e,{layers:n,viewports:o,onViewportActive:p,pickingFBO:v,useDevicePixels:g,deviceRect:{x:_,y:E,width:b-_,height:m-E},layerFilter:d,redrawReason:h}),S=function(e,t){var n=t.pickedColors,r=t.layers,o=new Map;if(n)for(var a=0;a<n.length;a+=4){var s=n[a+3]-1;if(s>=0){var u=n.slice(a,a+4),l=u.join(",");if(!o.has(l)){var c=r[s];c?o.set(l,{pickedColor:u,pickedLayer:c,pickedObjectIndex:c.decodePickingColor(u)}):i.default.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(o.values())}(0,{pickedColors:w,layers:n}),P=new Map;return S.forEach(function(e){var t={color:e.pickedColor,layer:null,index:e.pickedObjectIndex,picked:!0,x:a,y:s,width:l,height:c,pixelRatio:y};t=f({layer:e.pickedLayer,info:t,mode:h}),P.has(t.object)||P.set(t.object,t)}),Array.from(P.values())},t.getClosestFromPickingBuffer=c;var r=n(72),i=a(n(5)),o=a(n(3));function a(e){return e&&e.__esModule?e:{default:e}}var s={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function u(e,t){var n=t.layers,i=t.viewports,a=t.onViewportActive,s=t.useDevicePixels,u=t.pickingFBO,l=t.deviceRect,c=t.layerFilter,f=t.redrawReason;if((0,o.default)(l),(0,o.default)(Number.isFinite(l.width)&&l.width>0,"`width` must be > 0"),(0,o.default)(Number.isFinite(l.height)&&l.height>0,"`height` must be > 0"),n.filter(function(e){return e.isPickable()}).length<1)return null;(0,r.drawPickingBuffer)(e,{layers:n,viewports:i,onViewportActive:a,useDevicePixels:s,pickingFBO:u,deviceRect:l,layerFilter:c,redrawReason:f});var h=l.x,d=l.y,p=l.width,v=l.height,g=new Uint8Array(p*v*4);return u.readPixels({x:h,y:d,width:p,height:v,pixelArray:g}),g}function l(e){var t=e.pickInfo,n=e.lastPickedInfo,r=e.mode,i=e.layers,o=e.viewports,a=e.x,s=e.y,u=e.deviceX,l=e.deviceY,c=e.pixelRatio,h=t.pickedColor,d=t.pickedLayer,p=t.pickedObjectIndex,v=d?[d]:[];if("hover"===r){var g=n.index,y=n.layerId,_=d&&d.props.id;if(_!==y||p!==g){if(_!==y){var m=i.find(function(e){return e.props.id===y});m&&v.unshift(m)}n.layerId=_,n.index=p}}var b={color:null,layer:null,index:-1,picked:!1,x:a,y:s,pixel:[a,s],lngLat:{viewports:o}.viewports[0].unproject([a,s]),devicePixel:[u,l],pixelRatio:c},E=new Map;return v.forEach(function(e){var t=Object.assign({},b);e===d&&(t.color=h,t.index=p,t.picked=!0),(t=f({layer:e,info:t,mode:r}))&&E.set(t.layer.id,t);var n={pickingSelectedColor:e.props.autoHighlight&&d===e?h:null},i=!0,o=!1,a=void 0;try{for(var s,u=e.getModels()[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){s.value.updateModuleSettings(n)}}catch(e){o=!0,a=e}finally{try{!i&&u.return&&u.return()}finally{if(o)throw a}}}),function(e,t){var n=[];return e.forEach(function(e){var r=!1;switch(t){case"click":r=e.layer.props.onClick(e);break;case"hover":r=e.layer.props.onHover(e);break;case"query":break;default:throw new Error("unknown pick type")}r||n.push(e)}),n}(E,r)}function c(e,t){var n=t.pickedColors,r=t.layers,a=t.deviceX,u=t.deviceY,l=t.deviceRadius,c=t.deviceRect;(0,o.default)(n);for(var f=c.x,h=c.y,d=c.width,p=c.height,v=l*l,g=-1,y=0,_=0;_<p;_++){var m=_+h-u,b=m*m;if(b>v)y+=4*d;else for(var E=0;E<d;E++){if(n[y+3]-1>=0){var w=E+f-a,S=w*w+b;S<=v&&(v=S,g=y)}y+=4}}if(g>=0){var P=n[g+3]-1,T=n.slice(g,g+4),A=r[P];if(A)return{pickedColor:T,pickedLayer:A,pickedObjectIndex:A.decodePickingColor(T)};i.default.error("Picked non-existent layer. Is picking buffer corrupt?")()}return s}function f(e){for(var t=e.layer,n=e.info,r=e.mode;t&&n;){var i=n.layer||t;n.layer=t,n=t.pickLayer({info:n,mode:r,sourceLayer:i}),t=t.parent}return n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(73),a=(r=o)&&r.__esModule?r:{default:r};var s=function(e){function t(e){var n=e.attributeManager,r=e.layer;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,r));return i.attributeManager=n,i.model=null,i.needsRedraw=!0,i.subLayers=null,i}return function(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)}(t,a.default),i(t,[{key:"layer",get:function(){return this.component},set:function(e){this.component=e}}]),t}();t.default=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},i=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.parsePropTypes=function(e){var t={},n={},r=!0,o=!1,a=void 0;try{for(var s,u=Object.entries(e)[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=i(s.value,2),f=c[0],h=c[1],d=l(f,h);t[f]=d,n[f]=d.value}}catch(e){o=!0,a=e}finally{try{!r&&u.return&&u.return()}finally{if(o)throw a}}return{propTypes:t,defaultProps:n}};var o,a=n(3),s=(o=a)&&o.__esModule?o:{default:o};var u={boolean:{validate:function(e,t){return!0}},number:{validateType:function(e,t){return"value"in t&&(!("max"in t)||Number.isFinite(t.max))&&(!("min"in t)||Number.isFinite(t.min))},validate:function(e,t){return Number.isFinite(e)&&(!("max"in t)||e<=t.max)&&(!("min"in t)||e>=t.min)}}};function l(e,t){switch(c(t)){case"object":return function(e){var t=e.type,n=(u[t]||{}).typeValidator;n&&(0,s.default)(n(e),"Illegal prop type");return e}(t=function(e,t){if(!("type"in t))return"value"in t?Object.assign({name:e,type:c(t.value)},t):{name:e,type:"object",value:t};return Object.assign({name:e},t)}(e,t));case"array":return function(e,t){if(/color/i.test(e)&&(3===t.length||4===t.length))return{name:e,type:"color",value:t};return{name:e,type:"array",value:t}}(e,t);case"boolean":return{name:e,type:"boolean",value:t};case"number":return function(e,t){var n=/radius|scale|width|height|pixel|size|miter/i.test(e)&&/^((?!scale).)*$/.test(e)?100:1;return{name:e,type:"number",max:Math.max(t,n),min:Math.min(t,0),value:t}}(e,t);case"function":return{name:e,type:"function",value:t};default:return{name:e,type:"unknown",value:t}}}function c(e){return Array.isArray(e)||ArrayBuffer.isView(e)?"array":null===e?"null":void 0===e?"undefined":r(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createProps=function(){for(var e=u(this.constructor).defaultProps,t=Object.create(e,{_component:{enumerable:!1,value:this},_asyncPropOriginalValues:{enumerable:!1,value:{}},_asyncPropResolvedValues:{enumerable:!1,value:{}}}),n=0;n<arguments.length;++n)Object.assign(t,arguments[n]);return(0,i.applyPropOverrides)(t),Object.freeze(t),t};var r,i=n(44),o=n(5),a=(r=o)&&r.__esModule?r:{default:r},s=n(198);function u(e){var t=c(e,"_mergedDefaultProps");return t?{defaultProps:t,propTypes:c(e,"_propTypes")}:function(e){var t=e.prototype;if(!t)return{defaultProps:{}};var n=Object.getPrototypeOf(e),r=t&&u(n)||null,i=c(e,"defaultProps")||{},o=(0,s.parsePropTypes)(i),f=Object.assign({},r&&r.propTypes,o.propTypes),h=function(e,t,n,r){var i=Object.create(null);Object.assign(i,t,e);var o=function(e){var t=c(e,"layerName")||c(e,"componentName");t||a.default.once(0,e.name+".componentName not specified");return t||e.name}(r);return delete e.id,Object.defineProperties(i,{id:{configurable:!1,writable:!0,value:o}}),function(e,t){var n={},r={_asyncPropDefaultValues:{enumerable:!1,value:n},_asyncPropOriginalValues:{enumerable:!1,value:{}}};for(var i in t){var o=t[i],a=o.name,s=o.value;o.async&&(n[a]=s,r[a]=l(a))}Object.defineProperties(e,r)}(i,n),i}(o.defaultProps,r&&r.defaultProps,f,e);return e._mergedDefaultProps=h,e._propTypes=f,{propTypes:f,defaultProps:h}}(e)}function l(e){return{configurable:!1,enumerable:!0,set:function(t){"string"==typeof t||t instanceof Promise?this._asyncPropOriginalValues[e]=t:this._asyncPropResolvedValues[e]=t},get:function(){if(this._asyncPropResolvedValues){if(e in this._asyncPropResolvedValues){var t=this._asyncPropResolvedValues[e];return"data"===e?t||this._asyncPropDefaultValues[e]:t}var n=this._component&&this._component.internalState;if(n&&n.hasAsyncProp(e))return n.getAsyncProp(e)}return this._asyncPropDefaultValues[e]}}}function c(e,t){return Object.prototype.hasOwnProperty.call(e,t)&&e[t]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(74),a=n(199),s=n(73),u=(r=s)&&r.__esModule?r:{default:r};var l=0,c=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.props=a.createProps.apply(this,arguments),this.id=this.props.id,this.count=l++,this.lifecycle=o.LIFECYCLE.NO_STATE,this.parent=null,this.context=null,this.state=null,this.internalState=null,Object.seal(this)}return i(e,[{key:"clone",value:function(e){return new this.constructor(Object.assign({},this.props,e))}},{key:"_initState",value:function(){this.internalState=new u.default({})}},{key:"stats",get:function(){return this.internalState.stats}}]),e}();t.default=c,c.defaultProps={}},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.count=function(e){if(t=e,null===t||"object"!==(void 0===t?"undefined":r(t)))throw new Error(i);var t;if("function"==typeof e.count)return e.count();if(Number.isFinite(e.size))return e.size;if(Number.isFinite(e.length))return e.length;if(function(e){return null!==e&&"object"===(void 0===e?"undefined":r(e))&&e.constructor===Object}(e))return Object.keys(e).length;throw new Error(o)};var i="count(): argument not an object",o="count(): argument not a container"},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.diffProps=function(e,t){var n=s({newProps:e,oldProps:t,ignoreProps:{data:null,updateTriggers:null}}),r=function(e,t){if(null===t)return"oldProps is null, initial diff";var n=e.dataComparator;if(n){if(!n(e.data,t.data))return"Data comparator detected a change"}else if(e.data!==t.data)return"A new data container was supplied";return null}(e,t),i=!1;r||(i=function(e,t){if(null===t)return"oldProps is null, initial diff";if("all"in e.updateTriggers){var n=u(t,e,"all");if(n)return{all:!0}}var r={},i=!1;for(var o in e.updateTriggers)if("all"!==o){var a=u(t,e,o);a&&(r[o]=!0,i=r)}return i}(e,t));return{dataChanged:r,propsChanged:n,updateTriggersChanged:i}},t.compareProps=s;var i,o=n(3),a=(i=o)&&i.__esModule?i:{default:i};function s(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.newProps,n=e.oldProps,i=e.ignoreProps,o=void 0===i?{}:i,s=e.shallowCompareProps,u=void 0===s?{}:s,l=e.triggerName,c=void 0===l?"props":l;if((0,a.default)(void 0!==n&&void 0!==t,"compareProps args"),n===t)return null;if("object"!==(void 0===t?"undefined":r(t))||null===t)return c+" changed shallowly";if("object"!==(void 0===n?"undefined":r(n))||null===n)return c+" changed shallowly";for(var f in n)if(!(f in o)){if(!(f in t))return c+"."+f+" dropped: "+n[f]+" -> undefined";var h=t[f]&&n[f]&&t[f].equals;if(h&&!h.call(t[f],n[f]))return c+"."+f+" changed deeply: "+n[f]+" -> "+t[f];if(f in u)"function"===r(t[f])&&"function"==typeof n[f]&&(h=!0);if(!h&&n[f]!==t[f])return c+"."+f+" changed shallowly: "+n[f]+" -> "+t[f]}for(var d in t)if(!(d in o||d in n))return c+"."+d+" added: undefined -> "+t[d];return null}function u(e,t,n){var r=e.updateTriggers[n]||{};return s({oldProps:t.updateTriggers[n]||{},newProps:r,triggerName:n})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getShaders=function(e){var t=[],n=[],r=[],i=[],a=[];for(var s in e){var u=e[s],l=o[u.attribute.size];l&&(u.bufferIndex=t.length,t.push(s),n.push("attribute "+l+" "+s+"From;"),n.push("attribute "+l+" "+s+"To;"),r.push("uniform float "+s+"Time;"),i.push("varying "+l+" "+s+";"),a.push(s+" = mix("+s+"From, "+s+"To,\n "+s+"Time);"))}var c="\n#define SHADER_NAME feedback-vertex-shader\n"+n.join("\n")+"\n"+r.join("\n")+"\n"+i.join("\n")+"\n\nvoid main(void) {\n "+a.join("\n")+"\n gl_Position = vec4(0.0);\n}\n",f="#define SHADER_NAME feedback-fragment-shader\n\n#ifdef GL_ES\nprecision highp float;\n#endif\n\n"+i.join("\n")+"\n\nvoid main(void) {\n gl_FragColor = vec4(0.0);\n}\n";return{vs:c,fs:f,varyings:t}},t.getBuffers=function(e){var t={},n={};for(var r in e){var i=e[r],o=i.fromState,a=i.toState,s=i.buffer;t[r+"From"]=o,t[r+"To"]=a,n[""+r]=s}return{sourceBuffers:t,destinationBuffers:n}},t.padBuffer=function(e){var t=e.fromState,n=e.toState,o=e.fromLength,a=e.toLength;if(o>=a||!(t instanceof r.Buffer))return;var s=new Float32Array(a);s.set(t.getData({})),n.isGeneric?(0,i.fillArray)({target:s,source:n.value,start:o,count:(a-o)/n.size}):s.set(n.buffer.data.subarray(o),o);t.setData({data:s})};var r=n(2),i=n(22),o={1:"float",2:"vec2",3:"vec3",4:"vec4"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(2),o=n(203),a=l(n(75)),s=l(n(5)),u=l(n(3));function l(e){return e&&e.__esModule?e:{default:e}}var c=i.experimental.Transform,f=function(){},h=function(){function e(t,n){var r=n.id;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=r,this.gl=t,this.attributeTransitions={},this.needsRedraw=!1,this.transform=null,this.numInstances=0,c.isSupported(t)?this.isSupported=!0:s.default.warn("WebGL2 not supported by this browser. Transition animation is disabled.")()}return r(e,[{key:"finalize",value:function(){for(var e in this.transform&&this.transform.delete(),this.attributeTransitions)this._removeTransition(e)}},{key:"update",value:function(e){var t=e.attributes,n=e.transitions,r=void 0===n?{}:n,i=e.numInstances;if(this.opts=r,this.numInstances=i,this.isSupported){var a=this.attributeTransitions,s={};for(var u in t){this._updateAttribute(u,t[u])&&(s[u]=a[u])}for(var l in a){var c=t[l];c&&c.supportsTransition()||this._removeTransition(l)}if(this.transform){if(this.transform){var f=(0,o.getBuffers)(s),h=f.sourceBuffers,d=f.destinationBuffers;this.transform.update({elementCount:this.numInstances,sourceBuffers:h,destinationBuffers:d})}}else this._createModel()}}},{key:"hasAttribute",value:function(e){return e in this.attributeTransitions}},{key:"getAttributes",value:function(){var e={};for(var t in this.attributeTransitions){var n=this.attributeTransitions[t];n.buffer&&(e[t]=n.buffer)}return e}},{key:"setCurrentTime",value:function(e){if(!this.transform)return!1;var t={},n=this.needsRedraw;for(var r in this.needsRedraw=!1,this.attributeTransitions){var i=this.attributeTransitions[r];i.update(e)&&(t[r+"Time"]=i.time,n=!0)}return n&&this.transform.run({uniforms:t}),n}},{key:"_createTransition",value:function(e,t){var n=this.attributeTransitions[e];return n?null:(n=new a.default({name:e,attribute:t}),this.attributeTransitions[e]=n,this._invalidateModel(),n)}},{key:"_removeTransition",value:function(e){var t=this.attributeTransitions[e];t&&(t.buffer&&t.buffer.delete(),t._swapBuffer&&t._swapBuffer.delete(),delete this.attributeTransitions[e],this._invalidateModel())}},{key:"_updateAttribute",value:function(e,t){var n=this._getTransitionSettings(t);if(n){var r=void 0,i=this.attributeTransitions[e];if(i?r=t.needsRedraw():(i=this._createTransition(e,t),r=!0),r)return this._triggerTransition(i,n),!0}return!1}},{key:"_invalidateModel",value:function(){this.transform&&(this.transform.delete(),this.transform=null)}},{key:"_createModel",value:function(){0!==Object.keys(this.attributeTransitions).length&&(this.transform=new c(this.gl,Object.assign({elementCount:this.numInstances},(0,o.getBuffers)(this.attributeTransitions),(0,o.getShaders)(this.attributeTransitions))))}},{key:"_getNextTransitionStates",value:function(e){var t=e.attribute,n=t.size,r=void 0;r=t.isGeneric?{isGeneric:!0,value:t.value,size:n}:{isGeneric:!1,buffer:t.getBuffer(),size:n};var a=e.buffer||r,s=this.numInstances*n,u=a.data&&a.data.length||s,l=e._swapBuffer;return e._swapBuffer=e.buffer,l||(l=new i.Buffer(this.gl,{size:n,data:new Float32Array(s),usage:i.GL.DYNAMIC_COPY})),l.data.length<s&&l.setData({data:new Float32Array(s)}),(0,o.padBuffer)({fromState:a,toState:r,fromLength:u,toLength:s}),{fromState:a,toState:r,buffer:l}}},{key:"_getTransitionSettings",value:function(e){var t=this.opts,n=e.userData,r=n.transition,i=n.accessor;return r?Array.isArray(i)?i.map(function(e){return t[e]}).find(Boolean):t[i]:null}},{key:"_normalizeTransitionSettings",value:function(e){return Number.isFinite(e)&&(e={duration:e}),(0,u.default)(e&&e.duration>0),{duration:e.duration,easing:e.easing||function(e){return e},onStart:e.onStart||f,onEnd:e.onEnd||f,onInterrupt:e.onInterrupt||f}}},{key:"_triggerTransition",value:function(e,t){this.needsRedraw=!0;var n=this._normalizeTransitionSettings(t);e.start(Object.assign({},this._getNextTransitionStates(e),n))}}]),e}();t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t.glArrayFromType=f;var i,o=n(3),a=(i=o)&&i.__esModule?i:{default:i},s=n(2);var u=s.experimental.Attribute,l={isExternalBuffer:!1,needsAlloc:!1,needsUpdate:!1,needsRedraw:!1,allocedInstances:-1},c=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n)),i=n.transition,o=void 0!==i&&i,a=n.noAlloc,s=void 0!==a&&a,u=n.update,c=void 0===u?null:u,f=n.accessor,h=void 0===f?null:f,d=n.defaultValue,p=void 0===d?[0,0,0,0]:d;return p=Array.isArray(p)?p:[p],Object.assign(r.userData,l,n,{transition:o,noAlloc:s,update:c,accessor:h,defaultValue:p}),Object.seal(r.userData),r._validateAttributeUpdaters(),r}return function(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)}(t,u),r(t,[{key:"needsUpdate",value:function(){return this.userData.needsUpdate}},{key:"needsRedraw",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).clearChangedFlags,t=void 0!==e&&e,n=this.userData.needsRedraw;return this.userData.needsRedraw=this.userData.needsRedraw&&!t,n}},{key:"getInstanceCount",value:function(){return null!==this.value?this.value.length/this.size:0}},{key:"getUpdateTriggers",value:function(){var e=this.userData.accessor;return[this.id].concat(e||[])}},{key:"supportsTransition",value:function(){return this.userData.transition}},{key:"setNeedsUpdate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id;this.userData.needsUpdate=this.userData.needsUpdate||e}},{key:"setNeedsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id;this.userData.needsRedraw=this.userData.needsRedraw||e}},{key:"setNumInstances",value:function(e){var t=this.userData;if(!t.isExternalBuffer&&!t.noAlloc){var n=this.getInstanceCount();(0===n||n<e)&&(t.update||t.accessor)&&(t.needsAlloc=!0,this.setNeedsUpdate(this.id))}}},{key:"allocate",value:function(e){this.setNumInstances(e);var t=this.userData;if(t.needsAlloc){var n=Math.max(e,1),r=f(this.type||s.GL.FLOAT);return this.isGeneric=!1,this.value=new r(this.size*n),t.needsAlloc=!1,t.needsUpdate=!0,t.allocedInstances=n,!0}return!1}},{key:"updateBuffer",value:function(e){var t=e.numInstances,n=e.data,r=e.props,i=e.context;if(!this.needsUpdate())return!1;var o=this.userData,a=o.update,s=o.accessor,u=!0;return a?(a.call(i,this,{data:n,props:r,numInstances:t}),this.update({value:this.value,isGeneric:this.isGeneric}),this._checkAttributeArray()):s?(this._updateBufferViaStandardAccessor(n,r),this._checkAttributeArray()):u=!1,o.needsUpdate=!1,o.needsRedraw=!0,u}},{key:"setGenericValue",value:function(e){var t=e.props,n=this.userData,r=t[n.accessor];if(void 0!==r&&"function"!=typeof r){r=this._normalizeValue(r);var i=!this.isGeneric||!this._areValuesEqual(r,this.value);i&&this.update({isGeneric:!0,value:r}),n.needsRedraw=n.needsUpdate||i,n.needsUpdate=!1,n.isExternalBuffer=!0}}},{key:"setExternalBuffer",value:function(e,t){var n=this.userData;if(e)if(n.isExternalBuffer=!0,n.needsUpdate=!1,e instanceof s.Buffer)this.externalBuffer!==e&&(this.update({isGeneric:!1,buffer:e}),n.needsRedraw=!0);else{var r=f(this.type||s.GL.FLOAT);if(!(e instanceof r))throw new Error("Attribute "+this.id+" must be of type "+r.name);if(n.auto&&e.length<=t*this.size)throw new Error("Attribute prop array must match length and size");this.value!==e&&(this.update({value:e}),n.needsRedraw=!0)}else n.isExternalBuffer=!1}},{key:"_normalizeValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.size,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.userData.defaultValue;switch(Array.isArray(e)||ArrayBuffer.isView(e)||(e=[e]),t){case 4:e[3]=Number.isFinite(e[3])?e[3]:n[3];case 3:e[2]=Number.isFinite(e[2])?e[2]:n[2];case 2:e[1]=Number.isFinite(e[1])?e[1]:n[1];case 1:e[0]=Number.isFinite(e[0])?e[0]:n[0]}return e}},{key:"_areValuesEqual",value:function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.size,r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}},{key:"_updateBufferViaStandardAccessor",value:function(e,t){var n=this.userData,r=n.accessor,i=n.defaultValue,o=this.value,s=this.size,u=t[r];(0,a.default)("function"==typeof u,'accessor "'+r+'" is not a function');var l=0,c=!0,f=!1,h=void 0;try{for(var d,p=e[Symbol.iterator]();!(c=(d=p.next()).done);c=!0){var v=u(d.value);v=this._normalizeValue(v,s,i);for(var g=0;g<s;g++)o[l++]=v[g]}}catch(e){f=!0,h=e}finally{try{!c&&p.return&&p.return()}finally{if(f)throw h}}this.update({value:o})}},{key:"_validateAttributeUpdaters",value:function(){var e=this.userData;if(!(e.noAlloc||"function"==typeof e.update||"string"==typeof e.accessor))throw new Error("Attribute "+this.id+" missing update or accessor")}},{key:"_checkAttributeArray",value:function(){var e=this.value;if(e&&e.length>=4&&!(Number.isFinite(e[0])&&Number.isFinite(e[1])&&Number.isFinite(e[2])&&Number.isFinite(e[3])))throw new Error("Illegal attribute generated for "+this.id)}}]),t}();function f(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).clamped,n=void 0===t||t;switch(e){case s.GL.FLOAT:return Float32Array;case s.GL.UNSIGNED_SHORT:case s.GL.UNSIGNED_SHORT_5_6_5:case s.GL.UNSIGNED_SHORT_4_4_4_4:case s.GL.UNSIGNED_SHORT_5_5_5_1:return Uint16Array;case s.GL.UNSIGNED_INT:return Uint32Array;case s.GL.UNSIGNED_BYTE:return n?Uint8ClampedArray:Uint8Array;case s.GL.BYTE:return Int8Array;case s.GL.SHORT:return Int16Array;case s.GL.INT:return Int32Array;default:throw new Error("Failed to deduce type from array")}}t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=d(n(77)),o=d(n(65)),a=d(n(40)),s=d(n(5)),u=n(2),l=n(28),c=n(117),f=d(n(3)),h=n(64);function d(e){return e&&e.__esModule?e:{default:e}}function p(){}var v={id:"deckgl-overlay",width:"100%",height:"100%",pickingRadius:0,layerFilter:null,glOptions:{},gl:null,layers:[],effects:[],views:null,controller:null,onWebGLInitialized:p,onBeforeRender:p,onAfterRender:p,onLayerClick:null,onLayerHover:null,useDevicePixels:!0,debug:!1,drawPickingColors:!1},g={GRABBING:"-webkit-grabbing",GRAB:"-webkit-grab",POINTER:"pointer"},y=Object.assign({},h.MAPBOX_LIMITS,{scrollZoom:!0,dragPan:!0,dragRotate:!0,doubleClickZoom:!0,touchZoomRotate:!0,getCursor:function(e){return e.isDragging?g.GRABBING:g.GRAB}}),_=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t=Object.assign({},v,t),this.width=0,this.height=0,this.needsRedraw=!0,this.layerManager=null,this.effectManager=null,this.controller=null,this.stats=new l.Stats({id:"deck.gl"}),this.viewState=t.initialViewState||null,this.interactiveState={isDragging:!1},this._onRendererInitialized=this._onRendererInitialized.bind(this),this._onRenderFrame=this._onRenderFrame.bind(this),this._onViewStateChange=this._onViewStateChange.bind(this),this._onInteractiveStateChange=this._onInteractiveStateChange.bind(this),this.canvas=this._createCanvas(t),this.controller=this._createController(t),this.animationLoop=this._createAnimationLoop(t),this.setProps(t),this.animationLoop.start()}return r(e,[{key:"finalize",value:function(){this.animationLoop.stop(),this.animationLoop=null,this.layerManager&&(this.layerManager.finalize(),this.layerManager=null),this.controller&&(this.controller.finalize(),this.controller=null),this.eventManager&&this.eventManager.destroy()}},{key:"setProps",value:function(e){this.stats.timeStart("deck.setProps"),e=Object.assign({},this.props,e),this.props=e,this._setCanvasSize(e);var t=Object.assign({},e,{viewState:this._getViewState(e),width:this.width,height:this.height});this.layerManager&&this.layerManager.setParameters(t),this.animationLoop&&this.animationLoop.setProps(t),this.controller&&this.controller.setProps(Object.assign(t,{onViewStateChange:this._onViewStateChange})),this.stats.timeEnd("deck.setProps")}},{key:"pickObject",value:function(e){var t=e.x,n=e.y,r=e.radius,i=void 0===r?0:r,o=e.layerIds,a=void 0===o?null:o;this.stats.timeStart("deck.pickObject");var s=this.layerManager.pickObject({x:t,y:n,radius:i,layerIds:a,mode:"query",depth:1});return this.stats.timeEnd("deck.pickObject"),s.length?s[0]:null}},{key:"pickMultipleObjects",value:function(e){var t=e.x,n=e.y,r=e.radius,i=void 0===r?0:r,o=e.layerIds,a=void 0===o?null:o,s=e.depth,u=void 0===s?10:s;this.stats.timeStart("deck.pickMultipleObjects");var l=this.layerManager.pickObject({x:t,y:n,radius:i,layerIds:a,mode:"query",depth:u});return this.stats.timeEnd("deck.pickMultipleObjects"),l}},{key:"pickObjects",value:function(e){var t=e.x,n=e.y,r=e.width,i=void 0===r?1:r,o=e.height,a=void 0===o?1:o,s=e.layerIds,u=void 0===s?null:s;this.stats.timeStart("deck.pickObjects");var l=this.layerManager.pickObjects({x:t,y:n,width:i,height:a,layerIds:u});return this.stats.timeEnd("deck.pickObjects"),l}},{key:"getViewports",value:function(){return this.layerManager?this.layerManager.getViewports():[]}},{key:"_createCanvas",value:function(e){var t=e.canvas;("string"==typeof t&&(t=document.getElementById(t),(0,f.default)(t)),t)||(t=document.createElement("canvas"),(e.parent||document.body).appendChild(t));var n=e.id,r=e.style;return t.id=n,Object.assign(t.style,r),t}},{key:"_setCanvasSize",value:function(e){var t=this.canvas,n=e.width,r=e.height;(n||0===n)&&(n=Number.isFinite(n)?n+"px":n,t.style.width=n),(r||0===r)&&(r=Number.isFinite(r)?r+"px":r,t.style.position="absolute",t.style.height=r)}},{key:"_updateCanvasSize",value:function(){if(this._checkForCanvasSizeChange()){var e=this.width,t=this.height;this.layerManager.setParameters({width:e,height:t}),this.controller&&this.controller.setProps({viewState:this._getViewState(this.props),width:this.width,height:this.height}),this.props.onResize&&this.props.onResize({width:this.width,height:this.height})}}},{key:"_checkForCanvasSizeChange",value:function(){var e=this.canvas;return!(!e||this.width===e.clientWidth&&this.height===e.clientHeight)&&(this.width=e.clientWidth,this.height=e.clientHeight,!0)}},{key:"_createController",value:function(e){var t=null;e.controller&&(t=new(0,e.controller)(e)).setProps(Object.assign({},this.props,y,{eventManager:this.eventManager,viewState:this._getViewState(e),onViewStateChange:this._onViewStateChange,onStateChange:this._onInteractiveStateChange}));return t}},{key:"_createAnimationLoop",value:function(e){var t=this,n=e.width,r=e.height,i=e.gl,o=e.glOptions,a=e.debug,s=e.useDevicePixels,l=e.autoResizeDrawingBuffer;return new u.AnimationLoop({width:n,height:r,useDevicePixels:s,autoResizeDrawingBuffer:l,onCreateContext:function(e){return i||(0,u.createGLContext)(Object.assign({},o,{canvas:t.canvas,debug:a}))},onInitialize:this._onRendererInitialized,onRender:this._onRenderFrame,onBeforeRender:e.onBeforeRender,onAfterRender:e.onAfterRender})}},{key:"_getViewState",value:function(e){return Object.assign({},e.viewState||this.viewState||{},{width:this.width,height:this.height})}},{key:"_onViewStateChange",value:function(e){var t=e.viewState;if(this.props.onViewStateChange){for(var n,r=arguments.length,i=Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];t=(n=this.props).onViewStateChange.apply(n,[{viewState:t}].concat(i))||t}this.viewState&&(this.viewState=t,this.layerManager.setParameters({viewState:t}),this.controller.setProps({viewState:t}))}},{key:"_onInteractiveStateChange",value:function(e){var t=e.isDragging,n=void 0!==t&&t;n!==this.interactiveState.isDragging&&(this.interactiveState.isDragging=n,this.props.getCursor&&(this.canvas.style.cursor=this.props.getCursor(this.interactiveState)))}},{key:"_onRendererInitialized",value:function(e){var t=e.gl,n=e.canvas;(0,u.setParameters)(t,{blend:!0,blendFunc:[u.GL.SRC_ALPHA,u.GL.ONE_MINUS_SRC_ALPHA,u.GL.ONE,u.GL.ONE_MINUS_SRC_ALPHA],polygonOffsetFill:!0,depthTest:!0,depthFunc:u.GL.LEQUAL}),this.props.onWebGLInitialized(t),this.props.geoMap?this.eventManager=new c.EventManager(this.props.geoMap.getContainer()):this.eventManager=new c.EventManager(n),this.layerManager=new i.default(t,{eventManager:this.eventManager,stats:this.stats}),this.effectManager=new o.default({gl:t,layerManager:this.layerManager});var r=!0,a=!1,s=void 0;try{for(var l,f=this.props.effects[Symbol.iterator]();!(r=(l=f.next()).done);r=!0){var h=l.value;this.effectManager.addEffect(h)}}catch(e){a=!0,s=e}finally{try{!r&&f.return&&f.return()}finally{if(a)throw s}}this.setProps(this.props),this._updateCanvasSize()}},{key:"_onRenderFrame",value:function(e){var t=e.gl;if(this.stats.oneSecondPassed()){var n=this.stats.getStatsTable();this.stats.reset(),s.default.table(1,n)()}this._updateCanvasSize(),this.layerManager.updateLayers(),this.stats.bump("fps");var r=this.layerManager.needsRedraw({clearRedrawFlags:!0});r&&(this.stats.bump("render-fps"),this.props.onBeforeRender&&this.props.onBeforeRender({gl:t}),this.layerManager.drawLayers({pass:"screen",redrawReason:r,drawPickingColors:this.props.drawPickingColors}),this.props.onAfterRender&&this.props.onAfterRender({gl:t}))}}]),e}();t.default=_,_.displayName="Deck",_.getPropTypes=function(e){return{id:e.string,width:e.oneOfType([e.number,e.string]),height:e.oneOfType([e.number,e.string]),layers:e.oneOfType([e.object,e.array]),layerFilter:e.func,views:e.oneOfType([e.object,e.array]),viewState:e.object,controller:e.func,onViewStateChange:e.func,effects:e.arrayOf(e.instanceOf(a.default)),glOptions:e.object,gl:e.object,pickingRadius:e.number,onWebGLInitialized:e.func,onResize:e.func,onBeforeRender:e.func,onAfterRender:e.func,onLayerClick:e.func,onLayerHover:e.func,useDevicePixels:e.bool,debug:e.bool,drawPickingColors:e.bool}},_.defaultProps=v},function(e,t){e.exports=function(e,t,n,r,i){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e}},function(e,t){e.exports=function(e,t,n,r){var i=t[0],o=t[1],a=t[2],s=t[3];return e[0]=i+r*(n[0]-i),e[1]=o+r*(n[1]-o),e[2]=a+r*(n[2]-a),e[3]=s+r*(n[3]-s),e}},function(e,t){e.exports=function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}},function(e,t){e.exports=function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n*n+r*r+i*i+o*o;a>0&&(a=1/Math.sqrt(a),e[0]=n*a,e[1]=r*a,e[2]=i*a,e[3]=o*a);return e}},function(e,t){e.exports=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}},function(e,t){e.exports=function(e){var t=e[0],n=e[1],r=e[2],i=e[3];return t*t+n*n+r*r+i*i}},function(e,t){e.exports=function(e){var t=e[0],n=e[1],r=e[2],i=e[3];return Math.sqrt(t*t+n*n+r*r+i*i)}},function(e,t){e.exports=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},function(e,t){e.exports=function(e,t,n){var r=new Float32Array(3);return r[0]=e,r[1]=t,r[2]=n,r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.enableDOMLogging=o,t.logLineToDOM=s;var r=n(19),i=null;function o(){var e=!(0<arguments.length&&void 0!==arguments[0])||arguments[0];e&&!i&&(i=r.console.log.bind(r.console),r.console.log=function(){s.apply(void 0,arguments),i.apply(void 0,arguments)}),!e&&i&&(r.console.log=i,i=null)}var a=null;function s(e){if(!a){var t=r.global.probe.markdown;a=r.document.createElement(t?"pre":"div")}var n=r.document.body.childNodes;r.document.body.insertBefore(a,n&&n[0]),"string"==typeof e&&(a.innerHTML+=e+"<br />")}t.default=o},function(e,t,n){"use strict";n(19).global.probe={}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n,r=0;r<t.length;r++)(n=t[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(84),o=n(83);var a=function(){function e(t){var n=t.id;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.id=n,this.time=(0,i.getTimestamp)(),this.counters={},Object.seal(this)}var t=Math.round;return r(e,[{key:"addCounter",value:function(e){return this._getCounter(e),this}},{key:"bump",value:function(e){var t=this._getCounter(e);return t.call++,t.count++,this}},{key:"increment",value:function(e,t){var n=this._getCounter(e);return n.call++,n.count+=t,this}},{key:"addTimer",value:function(e){return this._getCounter(e).time=0,this}},{key:"addTime",value:function(e,t){var n=this._getCounter(e);return n.time+=t,n.count++,this}},{key:"timeStart",value:function(e){this._getCounter(e)._startTime=(0,i.getTimestamp)()}},{key:"timeEnd",value:function(e){var t=this._getCounter(e);this.addTime(e,(0,i.getTimestamp)()-t._startTime)}},{key:"reset",value:function(){for(var e in this.time=(0,i.getTimestamp)(),this.counters){var t=this.counters[e];t.count=0,t.time=0}return this}},{key:"hasTimeElapsed",value:function(){return!(0<arguments.length&&void 0!==arguments[0])||arguments[0],1e3<(0,i.getTimestamp)()-this.time}},{key:"getStats",value:function(){var e=((0,i.getTimestamp)()-this.time)/1e3,n={};for(var r in this.counters){var a=this.counters[r];n[a.title]={total:a.count,fps:t(a.count/e)},a.time&&(n[a.title].totalTime=(0,o.formatTime)(a.time),n[a.title].avgTime=(0,o.formatTime)(a.time/a.count))}return n}},{key:"getStatsTable",value:function(){var e=this.getStats();for(var t in e)0===e[t].total&&delete e[t];return e}},{key:"getStatNames",value:function(){return Object.keys(this.counters)}},{key:"get",value:function(e){return this._getCounter(e).count}},{key:"getCount",value:function(e){return this._getCounter(e).count}},{key:"getFPS",value:function(e){var n=this._getCounter(e),r=((0,i.getTimestamp)()-this.time)/1e3;return t(n.count/r)}},{key:"getTimeString",value:function(){return this.id+":"+(0,o.formatTime)(this.time)+"("+this.count+")"}},{key:"oneSecondPassed",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:1e3;return this.hasTimeElapsed(e)}},{key:"_getCounter",value:function(e){var t=this.counters[e];return t||(t={title:e,unit:"",timer:!1,count:0,time:0,totalTime:0,averageTime:0},this.counters[e]=t),t}},{key:"_incrementTimer",value:function(e,t,n){e.count+=n,e.totalTime+=t,e.averageTime=e.totalTime/n}}]),e}();t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(!e)throw new Error("Assertion failed. "+t)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.autobind=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:["constructor"],n=Object.getPrototypeOf(e),r=Object.getOwnPropertyNames(n),i=!0,o=!1,a=void 0;try{for(var s,u=function(){var n=s.value;"function"!=typeof e[n]||t.find(function(e){return n===e})||(e[n]=e[n].bind(e))},l=r[Symbol.iterator]();!(i=(s=l.next()).done);i=!0)u()}catch(e){o=!0,a=e}finally{try{!i&&l.return&&l.return()}finally{if(o)throw a}}}},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n,r=0;r<t.length;r++)(n=t[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(t,n){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"sessionStorage";(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.storage=function(e){try{var t=window[e],n="__storage_test__";return t.setItem(n,n),t.removeItem(n),t}catch(e){return null}}(r),this.id=t,this.config={},Object.assign(this.config,n),this._loadConfiguration()}return r(e,[{key:"getConfiguration",value:function(){return this.config}},{key:"setConfiguration",value:function(e){return this.config={},this.updateConfiguration(e)}},{key:"updateConfiguration",value:function(e){if(Object.assign(this.config,e),this.storage){var t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}return this}},{key:"_loadConfiguration",value:function(){var e={};if(this.storage){var t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}]),e}();t.default=i},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){"use strict";(function(e){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},i=function(){function e(e,t){for(var n,r=0;r<t.length;r++)(n=t[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(19),a=h(n(221)),s=n(84),u=n(83),l=n(82),c=n(220),f=h(n(219));function h(e){return e&&e.__esModule?e:{default:e}}function d(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var p={debug:o.isBrowser&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},v={enabled:!1,priority:0};function g(){}var y={};var _=function(){function t(){var e=(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{}).id;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,t),this.id=e,this.VERSION=o.VERSION,this._startTs=(0,s.getTimestamp)(),this._deltaTs=(0,s.getTimestamp)(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new a.default("__probe-"+this.id+"__",v),this.userData={},this.timeStamp(this.id+" started"),(0,c.autobind)(this),Object.seal(this)}return i(t,[{key:"isEnabled",value:function(){return this._storage.config.enabled}},{key:"getPriority",value:function(){return this._storage.config.priority}},{key:"getLevel",value:function(){return this._storage.config.priority}},{key:"getTotal",value:function(){return+((0,s.getTimestamp)()-this._startTs).toPrecision(10)}},{key:"getDelta",value:function(){return+((0,s.getTimestamp)()-this._deltaTs).toPrecision(10)}},{key:"enable",value:function(){var e=!(0<arguments.length&&void 0!==arguments[0])||arguments[0];return this._storage.updateConfiguration({enabled:e}),this}},{key:"setLevel",value:function(e){return this._storage.updateConfiguration({priority:e}),this}},{key:"warn",value:function(e){for(var t=arguments.length,n=Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return this._getLogFunction({message:e,args:n,method:p.warn,once:!0})}},{key:"error",value:function(e){for(var t=arguments.length,n=Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return this._getLogFunction({message:e,args:n,method:p.error})}},{key:"deprecated",value:function(e,t){return this.warn("`"+e+"` is deprecated and will be removed in a later version. Use `"+t+"` instead")}},{key:"removed",value:function(e,t){return this.error("`"+e+"` has been removed. Use `"+t+"` instead")}},{key:"probe",value:function(e,t){for(var n=arguments.length,r=Array(2<n?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return this._getLogFunction({priority:e,message:t,args:r,method:p.log,time:!0})}},{key:"log",value:function(e,t){for(var n=arguments.length,r=Array(2<n?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return this._getLogFunction({priority:e,message:t,args:r,method:p.debug})}},{key:"info",value:function(e,t){for(var n=arguments.length,r=Array(2<n?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return this._getLogFunction({priority:e,message:t,args:r,method:console.info})}},{key:"once",value:function(e,t){for(var n=arguments.length,r=Array(2<n?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return this._getLogFunction({priority:e,message:t,args:r,method:p.debug||p.info,once:!0})}},{key:"table",value:function(e,t,n){if(t){var r=function(e){for(var t in e)for(var n in e[t])return n||"untitled";return"empty"}(t);return this._getLogFunction({priority:e,message:t,args:n&&[n],tag:r,method:console.table||g})}return g}},{key:"image",value:function(e){var t=e.priority,n=e.image,r=e.message,i=void 0===r?"":r,a=e.scale,s=void 0===a?1:a;return t>this.getPriority()?g:o.isBrowser?this._logImageInBrowser({image:n,message:i,scale:s}):this._logImageInNode({image:n,message:i,scale:s})}},{key:"_logImageInNode",value:function(t){var n=t.image,r=(t.message,t.scale),i=void 0===r?1:r,o=e.require("asciify-image");return o?function(){return o(n,{fit:"box",width:Math.round(80*i)+"%"}).then(function(e){return console.log(e)})}:g}},{key:"_logImageInBrowser",value:function(e){var t=e.image,n=e.message,r=void 0===n?"":n,i=e.scale,o=void 0===i?1:i;if("string"==typeof t){var a=new Image;return a.onload=function(){var e,t=(0,u.formatImage)(a,r,o);(e=console).log.apply(e,d(t))},a.src=t,g}var s,l=t.nodeName||"";if("img"===l.toLowerCase())return(s=console).log.apply(s,d((0,u.formatImage)(t,r,o))),g;if("canvas"===l.toLowerCase()){var c=new Image;return c.onload=function(){var e;return(e=console).log.apply(e,d((0,u.formatImage)(c,r,o)))},c.src=t.toDataURL(),g}return g}},{key:"time",value:function(e,t){return this._getLogFunction({priority:e,message:t,method:console.time?console.time:console.info})}},{key:"timeEnd",value:function(e,t){return this._getLogFunction({priority:e,message:t,method:console.timeEnd?console.timeEnd:console.info})}},{key:"timeStamp",value:function(e,t){return this._getLogFunction({priority:e,message:t,method:console.timeStamp||g})}},{key:"group",value:function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{collapsed:!1},r=(n=this._normalizeArguments({priority:e,message:t,opts:n})).collapsed;return this._getLogFunction({priority:e,message:t,opts:n,method:(r?console.groupCollapsed:console.group)||console.info})}},{key:"groupCollapsed",value:function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};return this.group(e,t,Object.assign({},n,{collapsed:!0}))}},{key:"groupEnd",value:function(e){return this._getLogFunction({priority:e,message:"",method:console.groupEnd||g})}},{key:"withGroup",value:function(e,t,n){var r=this._normalizeArguments({priority:e,message:t});this.group(r);try{n()}finally{this.groupEnd(r.message)}}},{key:"trace",value:function(){console.trace&&console.trace()}},{key:"_shouldLog",value:function(e){return 0===(e=this._normalizePriority(e))||this.isEnabled()&&this.getPriority()>=e}},{key:"_getElapsedTime",value:function(){var e=this.getTotal(),t=this.getDelta();return this._deltaTs=(0,s.getTimestamp)(),{total:e,delta:t}}},{key:"_getLogFunction",value:function(e){if(this._shouldLog(e.priority)){var t=e.method;e=this._parseArguments(e),(0,f.default)(t);var n=e.message,r=e.tag||e.message;if(e.once){if(y[r])return g;y[r]=(0,s.getTimestamp)()}return n=this._decorateMessage(n,e),t.bind.apply(t,[console,n].concat(d(e.args)))}return g}},{key:"_parseArguments",value:function(e){var t=this._normalizeArguments(e),n=this._getElapsedTime(),r=n.delta,i=n.total;return Object.assign(e,t,{delta:r,total:i})}},{key:"_normalizePriority",value:function(e){var t;switch(void 0===e?"undefined":r(e)){case"number":t=e;break;case"object":t=e.priority||0;break;default:t=0}return(0,f.default)(Number.isFinite(t)&&0<=t),t}},{key:"_normalizeArguments",value:function(e){var t=e.priority,n=e.message,i=e.args,o=void 0===i?[]:i,a=e.opts,s={priority:this._normalizePriority(t),message:n,args:o};switch(void 0===t?"undefined":r(t)){case"string":case"function":void 0!==n&&o.unshift(n),Object.assign(s,{message:t});break;case"object":Object.assign(s,t)}return"function"==typeof s.message&&(s.message=this._shouldLog(s.priority)?s.message():""),(0,f.default)("string"==typeof s.message||"object"===r(s.message)),Object.assign(s,a)}},{key:"_decorateMessage",value:function(e,t){if("string"==typeof e){var n="";if(t.time){var r=this._getElapsedTime().total;n=(0,u.leftPad)((0,u.formatTime)(r))}e=t.time?this.id+": "+n+" "+e:this.id+": "+e,e=(0,l.addColor)(e,t.color,t.background)}return e}},{key:"priority",set:function(e){return this._storage.updateConfiguration({priority:e}),this},get:function(){return this._storage.config.priority}}]),t}();t.default=_,_.VERSION=o.VERSION}).call(this,n(222)(e))},function(e,t,n){"use strict";(function(t){var r=n(2),i=n(6),o=n(158),a=n(118).default,s="undefined"==typeof window?t:window;s.deck=Object.assign({},s.deck,i,o,{DeckGL:a}),s.luma=Object.assign({},s.luma,r),e.exports=s.deck}).call(this,n(25))}])});
- //# sourceMappingURL=deckgl.min.js.map
|