@cosmos.gl/graph 3.0.0-beta.4 → 3.0.0-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,21 +1,22 @@
1
- import { select as z } from "d3-selection";
1
+ import { select as b } from "d3-selection";
2
2
  import "d3-transition";
3
- import { easeQuadIn as ie, easeQuadOut as oe, easeQuadInOut as se } from "d3-ease";
4
- import { textureFormatDecoder as ne, Texture as C, Buffer as S, UniformStore as x, luma as re } from "@luma.gl/core";
5
- import { webgl2Adapter as ae } from "@luma.gl/webgl";
6
- import { color as de } from "d3-color";
7
- import le from "dompurify";
8
- import { scaleLinear as j, scalePow as ce } from "d3-scale";
3
+ import { easeQuadIn as oe, easeQuadOut as se, easeQuadInOut as ne } from "d3-ease";
4
+ import { textureFormatDecoder as re, Texture as C, Buffer as S, UniformStore as x, luma as ae } from "@luma.gl/core";
5
+ import { webgl2Adapter as de } from "@luma.gl/webgl";
6
+ import { color as le } from "d3-color";
7
+ import ce from "dompurify";
8
+ import { scaleLinear as j, scalePow as fe } from "d3-scale";
9
9
  import { mat3 as V } from "gl-matrix";
10
10
  import { Random as he } from "random";
11
- import { Model as A } from "@luma.gl/engine";
12
- import fe from "gl-bench";
13
- import { range as ue } from "d3-array";
14
- import { zoomIdentity as W, zoom as Se } from "d3-zoom";
15
- import { drag as pe } from "d3-drag";
16
- const _e = "#b3b3b3", Te = void 0, Y = void 0, ge = 1, Ce = 4, Re = "#666666", Pe = 0.1, xe = 1, Ae = 1, ee = "#222222", h = {
11
+ import { Model as v } from "@luma.gl/engine";
12
+ import ue from "gl-bench";
13
+ import { range as Se } from "d3-array";
14
+ import { zoomIdentity as W, zoom as pe } from "d3-zoom";
15
+ import { drag as _e } from "d3-drag";
16
+ const Te = "#b3b3b3", ge = void 0, Y = void 0, Ce = 1, Pe = 4, Re = "#666666", xe = 0.1, ve = 1, Ae = 1, te = "#222222", f = {
17
17
  enableSimulation: !0,
18
- spaceSize: 8192,
18
+ /** Setting to 4096 because larger values crash the graph on iOS. More info: https://github.com/cosmosgl/graph/issues/203 */
19
+ spaceSize: 4096,
19
20
  pointSizeScale: 1,
20
21
  linkWidthScale: 1,
21
22
  linkArrowsSizeScale: 1,
@@ -59,19 +60,20 @@ const _e = "#b3b3b3", Te = void 0, Y = void 0, ge = 1, Ce = 4, Re = "#666666", P
59
60
  fitViewDelay: 250,
60
61
  fitViewPadding: 0.1,
61
62
  fitViewDuration: 250,
62
- pointSamplingDistance: 150,
63
+ pointSamplingDistance: 100,
64
+ linkSamplingDistance: 100,
63
65
  attribution: "",
64
66
  rescalePositions: void 0,
65
67
  enableRightClickRepulsion: !1
66
- }, ve = 0.7, Ie = 0.95, me = 3;
67
- var K;
68
+ }, me = 0.7, Ie = 0.95, ye = 3;
69
+ var L;
68
70
  (function(e) {
69
71
  e[e.DEPTH_BUFFER_BIT = 256] = "DEPTH_BUFFER_BIT", e[e.STENCIL_BUFFER_BIT = 1024] = "STENCIL_BUFFER_BIT", e[e.COLOR_BUFFER_BIT = 16384] = "COLOR_BUFFER_BIT", e[e.POINTS = 0] = "POINTS", e[e.LINES = 1] = "LINES", e[e.LINE_LOOP = 2] = "LINE_LOOP", e[e.LINE_STRIP = 3] = "LINE_STRIP", e[e.TRIANGLES = 4] = "TRIANGLES", e[e.TRIANGLE_STRIP = 5] = "TRIANGLE_STRIP", e[e.TRIANGLE_FAN = 6] = "TRIANGLE_FAN", e[e.ZERO = 0] = "ZERO", e[e.ONE = 1] = "ONE", e[e.SRC_COLOR = 768] = "SRC_COLOR", e[e.ONE_MINUS_SRC_COLOR = 769] = "ONE_MINUS_SRC_COLOR", e[e.SRC_ALPHA = 770] = "SRC_ALPHA", e[e.ONE_MINUS_SRC_ALPHA = 771] = "ONE_MINUS_SRC_ALPHA", e[e.DST_ALPHA = 772] = "DST_ALPHA", e[e.ONE_MINUS_DST_ALPHA = 773] = "ONE_MINUS_DST_ALPHA", e[e.DST_COLOR = 774] = "DST_COLOR", e[e.ONE_MINUS_DST_COLOR = 775] = "ONE_MINUS_DST_COLOR", e[e.SRC_ALPHA_SATURATE = 776] = "SRC_ALPHA_SATURATE", e[e.CONSTANT_COLOR = 32769] = "CONSTANT_COLOR", e[e.ONE_MINUS_CONSTANT_COLOR = 32770] = "ONE_MINUS_CONSTANT_COLOR", e[e.CONSTANT_ALPHA = 32771] = "CONSTANT_ALPHA", e[e.ONE_MINUS_CONSTANT_ALPHA = 32772] = "ONE_MINUS_CONSTANT_ALPHA", e[e.FUNC_ADD = 32774] = "FUNC_ADD", e[e.FUNC_SUBTRACT = 32778] = "FUNC_SUBTRACT", e[e.FUNC_REVERSE_SUBTRACT = 32779] = "FUNC_REVERSE_SUBTRACT", e[e.BLEND_EQUATION = 32777] = "BLEND_EQUATION", e[e.BLEND_EQUATION_RGB = 32777] = "BLEND_EQUATION_RGB", e[e.BLEND_EQUATION_ALPHA = 34877] = "BLEND_EQUATION_ALPHA", e[e.BLEND_DST_RGB = 32968] = "BLEND_DST_RGB", e[e.BLEND_SRC_RGB = 32969] = "BLEND_SRC_RGB", e[e.BLEND_DST_ALPHA = 32970] = "BLEND_DST_ALPHA", e[e.BLEND_SRC_ALPHA = 32971] = "BLEND_SRC_ALPHA", e[e.BLEND_COLOR = 32773] = "BLEND_COLOR", e[e.ARRAY_BUFFER_BINDING = 34964] = "ARRAY_BUFFER_BINDING", e[e.ELEMENT_ARRAY_BUFFER_BINDING = 34965] = "ELEMENT_ARRAY_BUFFER_BINDING", e[e.LINE_WIDTH = 2849] = "LINE_WIDTH", e[e.ALIASED_POINT_SIZE_RANGE = 33901] = "ALIASED_POINT_SIZE_RANGE", e[e.ALIASED_LINE_WIDTH_RANGE = 33902] = "ALIASED_LINE_WIDTH_RANGE", e[e.CULL_FACE_MODE = 2885] = "CULL_FACE_MODE", e[e.FRONT_FACE = 2886] = "FRONT_FACE", e[e.DEPTH_RANGE = 2928] = "DEPTH_RANGE", e[e.DEPTH_WRITEMASK = 2930] = "DEPTH_WRITEMASK", e[e.DEPTH_CLEAR_VALUE = 2931] = "DEPTH_CLEAR_VALUE", e[e.DEPTH_FUNC = 2932] = "DEPTH_FUNC", e[e.STENCIL_CLEAR_VALUE = 2961] = "STENCIL_CLEAR_VALUE", e[e.STENCIL_FUNC = 2962] = "STENCIL_FUNC", e[e.STENCIL_FAIL = 2964] = "STENCIL_FAIL", e[e.STENCIL_PASS_DEPTH_FAIL = 2965] = "STENCIL_PASS_DEPTH_FAIL", e[e.STENCIL_PASS_DEPTH_PASS = 2966] = "STENCIL_PASS_DEPTH_PASS", e[e.STENCIL_REF = 2967] = "STENCIL_REF", e[e.STENCIL_VALUE_MASK = 2963] = "STENCIL_VALUE_MASK", e[e.STENCIL_WRITEMASK = 2968] = "STENCIL_WRITEMASK", e[e.STENCIL_BACK_FUNC = 34816] = "STENCIL_BACK_FUNC", e[e.STENCIL_BACK_FAIL = 34817] = "STENCIL_BACK_FAIL", e[e.STENCIL_BACK_PASS_DEPTH_FAIL = 34818] = "STENCIL_BACK_PASS_DEPTH_FAIL", e[e.STENCIL_BACK_PASS_DEPTH_PASS = 34819] = "STENCIL_BACK_PASS_DEPTH_PASS", e[e.STENCIL_BACK_REF = 36003] = "STENCIL_BACK_REF", e[e.STENCIL_BACK_VALUE_MASK = 36004] = "STENCIL_BACK_VALUE_MASK", e[e.STENCIL_BACK_WRITEMASK = 36005] = "STENCIL_BACK_WRITEMASK", e[e.VIEWPORT = 2978] = "VIEWPORT", e[e.SCISSOR_BOX = 3088] = "SCISSOR_BOX", e[e.COLOR_CLEAR_VALUE = 3106] = "COLOR_CLEAR_VALUE", e[e.COLOR_WRITEMASK = 3107] = "COLOR_WRITEMASK", e[e.UNPACK_ALIGNMENT = 3317] = "UNPACK_ALIGNMENT", e[e.PACK_ALIGNMENT = 3333] = "PACK_ALIGNMENT", e[e.MAX_TEXTURE_SIZE = 3379] = "MAX_TEXTURE_SIZE", e[e.MAX_VIEWPORT_DIMS = 3386] = "MAX_VIEWPORT_DIMS", e[e.SUBPIXEL_BITS = 3408] = "SUBPIXEL_BITS", e[e.RED_BITS = 3410] = "RED_BITS", e[e.GREEN_BITS = 3411] = "GREEN_BITS", e[e.BLUE_BITS = 3412] = "BLUE_BITS", e[e.ALPHA_BITS = 3413] = "ALPHA_BITS", e[e.DEPTH_BITS = 3414] = "DEPTH_BITS", e[e.STENCIL_BITS = 3415] = "STENCIL_BITS", e[e.POLYGON_OFFSET_UNITS = 10752] = "POLYGON_OFFSET_UNITS", e[e.POLYGON_OFFSET_FACTOR = 32824] = "POLYGON_OFFSET_FACTOR", e[e.TEXTURE_BINDING_2D = 32873] = "TEXTURE_BINDING_2D", e[e.SAMPLE_BUFFERS = 32936] = "SAMPLE_BUFFERS", e[e.SAMPLES = 32937] = "SAMPLES", e[e.SAMPLE_COVERAGE_VALUE = 32938] = "SAMPLE_COVERAGE_VALUE", e[e.SAMPLE_COVERAGE_INVERT = 32939] = "SAMPLE_COVERAGE_INVERT", e[e.COMPRESSED_TEXTURE_FORMATS = 34467] = "COMPRESSED_TEXTURE_FORMATS", e[e.VENDOR = 7936] = "VENDOR", e[e.RENDERER = 7937] = "RENDERER", e[e.VERSION = 7938] = "VERSION", e[e.IMPLEMENTATION_COLOR_READ_TYPE = 35738] = "IMPLEMENTATION_COLOR_READ_TYPE", e[e.IMPLEMENTATION_COLOR_READ_FORMAT = 35739] = "IMPLEMENTATION_COLOR_READ_FORMAT", e[e.BROWSER_DEFAULT_WEBGL = 37444] = "BROWSER_DEFAULT_WEBGL", e[e.STATIC_DRAW = 35044] = "STATIC_DRAW", e[e.STREAM_DRAW = 35040] = "STREAM_DRAW", e[e.DYNAMIC_DRAW = 35048] = "DYNAMIC_DRAW", e[e.ARRAY_BUFFER = 34962] = "ARRAY_BUFFER", e[e.ELEMENT_ARRAY_BUFFER = 34963] = "ELEMENT_ARRAY_BUFFER", e[e.BUFFER_SIZE = 34660] = "BUFFER_SIZE", e[e.BUFFER_USAGE = 34661] = "BUFFER_USAGE", e[e.CURRENT_VERTEX_ATTRIB = 34342] = "CURRENT_VERTEX_ATTRIB", e[e.VERTEX_ATTRIB_ARRAY_ENABLED = 34338] = "VERTEX_ATTRIB_ARRAY_ENABLED", e[e.VERTEX_ATTRIB_ARRAY_SIZE = 34339] = "VERTEX_ATTRIB_ARRAY_SIZE", e[e.VERTEX_ATTRIB_ARRAY_STRIDE = 34340] = "VERTEX_ATTRIB_ARRAY_STRIDE", e[e.VERTEX_ATTRIB_ARRAY_TYPE = 34341] = "VERTEX_ATTRIB_ARRAY_TYPE", e[e.VERTEX_ATTRIB_ARRAY_NORMALIZED = 34922] = "VERTEX_ATTRIB_ARRAY_NORMALIZED", e[e.VERTEX_ATTRIB_ARRAY_POINTER = 34373] = "VERTEX_ATTRIB_ARRAY_POINTER", e[e.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 34975] = "VERTEX_ATTRIB_ARRAY_BUFFER_BINDING", e[e.CULL_FACE = 2884] = "CULL_FACE", e[e.FRONT = 1028] = "FRONT", e[e.BACK = 1029] = "BACK", e[e.FRONT_AND_BACK = 1032] = "FRONT_AND_BACK", e[e.BLEND = 3042] = "BLEND", e[e.DEPTH_TEST = 2929] = "DEPTH_TEST", e[e.DITHER = 3024] = "DITHER", e[e.POLYGON_OFFSET_FILL = 32823] = "POLYGON_OFFSET_FILL", e[e.SAMPLE_ALPHA_TO_COVERAGE = 32926] = "SAMPLE_ALPHA_TO_COVERAGE", e[e.SAMPLE_COVERAGE = 32928] = "SAMPLE_COVERAGE", e[e.SCISSOR_TEST = 3089] = "SCISSOR_TEST", e[e.STENCIL_TEST = 2960] = "STENCIL_TEST", e[e.NO_ERROR = 0] = "NO_ERROR", e[e.INVALID_ENUM = 1280] = "INVALID_ENUM", e[e.INVALID_VALUE = 1281] = "INVALID_VALUE", e[e.INVALID_OPERATION = 1282] = "INVALID_OPERATION", e[e.OUT_OF_MEMORY = 1285] = "OUT_OF_MEMORY", e[e.CONTEXT_LOST_WEBGL = 37442] = "CONTEXT_LOST_WEBGL", e[e.CW = 2304] = "CW", e[e.CCW = 2305] = "CCW", e[e.DONT_CARE = 4352] = "DONT_CARE", e[e.FASTEST = 4353] = "FASTEST", e[e.NICEST = 4354] = "NICEST", e[e.GENERATE_MIPMAP_HINT = 33170] = "GENERATE_MIPMAP_HINT", e[e.BYTE = 5120] = "BYTE", e[e.UNSIGNED_BYTE = 5121] = "UNSIGNED_BYTE", e[e.SHORT = 5122] = "SHORT", e[e.UNSIGNED_SHORT = 5123] = "UNSIGNED_SHORT", e[e.INT = 5124] = "INT", e[e.UNSIGNED_INT = 5125] = "UNSIGNED_INT", e[e.FLOAT = 5126] = "FLOAT", e[e.DOUBLE = 5130] = "DOUBLE", e[e.DEPTH_COMPONENT = 6402] = "DEPTH_COMPONENT", e[e.ALPHA = 6406] = "ALPHA", e[e.RGB = 6407] = "RGB", e[e.RGBA = 6408] = "RGBA", e[e.LUMINANCE = 6409] = "LUMINANCE", e[e.LUMINANCE_ALPHA = 6410] = "LUMINANCE_ALPHA", e[e.UNSIGNED_SHORT_4_4_4_4 = 32819] = "UNSIGNED_SHORT_4_4_4_4", e[e.UNSIGNED_SHORT_5_5_5_1 = 32820] = "UNSIGNED_SHORT_5_5_5_1", e[e.UNSIGNED_SHORT_5_6_5 = 33635] = "UNSIGNED_SHORT_5_6_5", e[e.FRAGMENT_SHADER = 35632] = "FRAGMENT_SHADER", e[e.VERTEX_SHADER = 35633] = "VERTEX_SHADER", e[e.COMPILE_STATUS = 35713] = "COMPILE_STATUS", e[e.DELETE_STATUS = 35712] = "DELETE_STATUS", e[e.LINK_STATUS = 35714] = "LINK_STATUS", e[e.VALIDATE_STATUS = 35715] = "VALIDATE_STATUS", e[e.ATTACHED_SHADERS = 35717] = "ATTACHED_SHADERS", e[e.ACTIVE_ATTRIBUTES = 35721] = "ACTIVE_ATTRIBUTES", e[e.ACTIVE_UNIFORMS = 35718] = "ACTIVE_UNIFORMS", e[e.MAX_VERTEX_ATTRIBS = 34921] = "MAX_VERTEX_ATTRIBS", e[e.MAX_VERTEX_UNIFORM_VECTORS = 36347] = "MAX_VERTEX_UNIFORM_VECTORS", e[e.MAX_VARYING_VECTORS = 36348] = "MAX_VARYING_VECTORS", e[e.MAX_COMBINED_TEXTURE_IMAGE_UNITS = 35661] = "MAX_COMBINED_TEXTURE_IMAGE_UNITS", e[e.MAX_VERTEX_TEXTURE_IMAGE_UNITS = 35660] = "MAX_VERTEX_TEXTURE_IMAGE_UNITS", e[e.MAX_TEXTURE_IMAGE_UNITS = 34930] = "MAX_TEXTURE_IMAGE_UNITS", e[e.MAX_FRAGMENT_UNIFORM_VECTORS = 36349] = "MAX_FRAGMENT_UNIFORM_VECTORS", e[e.SHADER_TYPE = 35663] = "SHADER_TYPE", e[e.SHADING_LANGUAGE_VERSION = 35724] = "SHADING_LANGUAGE_VERSION", e[e.CURRENT_PROGRAM = 35725] = "CURRENT_PROGRAM", e[e.NEVER = 512] = "NEVER", e[e.LESS = 513] = "LESS", e[e.EQUAL = 514] = "EQUAL", e[e.LEQUAL = 515] = "LEQUAL", e[e.GREATER = 516] = "GREATER", e[e.NOTEQUAL = 517] = "NOTEQUAL", e[e.GEQUAL = 518] = "GEQUAL", e[e.ALWAYS = 519] = "ALWAYS", e[e.KEEP = 7680] = "KEEP", e[e.REPLACE = 7681] = "REPLACE", e[e.INCR = 7682] = "INCR", e[e.DECR = 7683] = "DECR", e[e.INVERT = 5386] = "INVERT", e[e.INCR_WRAP = 34055] = "INCR_WRAP", e[e.DECR_WRAP = 34056] = "DECR_WRAP", e[e.NEAREST = 9728] = "NEAREST", e[e.LINEAR = 9729] = "LINEAR", e[e.NEAREST_MIPMAP_NEAREST = 9984] = "NEAREST_MIPMAP_NEAREST", e[e.LINEAR_MIPMAP_NEAREST = 9985] = "LINEAR_MIPMAP_NEAREST", e[e.NEAREST_MIPMAP_LINEAR = 9986] = "NEAREST_MIPMAP_LINEAR", e[e.LINEAR_MIPMAP_LINEAR = 9987] = "LINEAR_MIPMAP_LINEAR", e[e.TEXTURE_MAG_FILTER = 10240] = "TEXTURE_MAG_FILTER", e[e.TEXTURE_MIN_FILTER = 10241] = "TEXTURE_MIN_FILTER", e[e.TEXTURE_WRAP_S = 10242] = "TEXTURE_WRAP_S", e[e.TEXTURE_WRAP_T = 10243] = "TEXTURE_WRAP_T", e[e.TEXTURE_2D = 3553] = "TEXTURE_2D", e[e.TEXTURE = 5890] = "TEXTURE", e[e.TEXTURE_CUBE_MAP = 34067] = "TEXTURE_CUBE_MAP", e[e.TEXTURE_BINDING_CUBE_MAP = 34068] = "TEXTURE_BINDING_CUBE_MAP", e[e.TEXTURE_CUBE_MAP_POSITIVE_X = 34069] = "TEXTURE_CUBE_MAP_POSITIVE_X", e[e.TEXTURE_CUBE_MAP_NEGATIVE_X = 34070] = "TEXTURE_CUBE_MAP_NEGATIVE_X", e[e.TEXTURE_CUBE_MAP_POSITIVE_Y = 34071] = "TEXTURE_CUBE_MAP_POSITIVE_Y", e[e.TEXTURE_CUBE_MAP_NEGATIVE_Y = 34072] = "TEXTURE_CUBE_MAP_NEGATIVE_Y", e[e.TEXTURE_CUBE_MAP_POSITIVE_Z = 34073] = "TEXTURE_CUBE_MAP_POSITIVE_Z", e[e.TEXTURE_CUBE_MAP_NEGATIVE_Z = 34074] = "TEXTURE_CUBE_MAP_NEGATIVE_Z", e[e.MAX_CUBE_MAP_TEXTURE_SIZE = 34076] = "MAX_CUBE_MAP_TEXTURE_SIZE", e[e.TEXTURE0 = 33984] = "TEXTURE0", e[e.ACTIVE_TEXTURE = 34016] = "ACTIVE_TEXTURE", e[e.REPEAT = 10497] = "REPEAT", e[e.CLAMP_TO_EDGE = 33071] = "CLAMP_TO_EDGE", e[e.MIRRORED_REPEAT = 33648] = "MIRRORED_REPEAT", e[e.TEXTURE_WIDTH = 4096] = "TEXTURE_WIDTH", e[e.TEXTURE_HEIGHT = 4097] = "TEXTURE_HEIGHT", e[e.FLOAT_VEC2 = 35664] = "FLOAT_VEC2", e[e.FLOAT_VEC3 = 35665] = "FLOAT_VEC3", e[e.FLOAT_VEC4 = 35666] = "FLOAT_VEC4", e[e.INT_VEC2 = 35667] = "INT_VEC2", e[e.INT_VEC3 = 35668] = "INT_VEC3", e[e.INT_VEC4 = 35669] = "INT_VEC4", e[e.BOOL = 35670] = "BOOL", e[e.BOOL_VEC2 = 35671] = "BOOL_VEC2", e[e.BOOL_VEC3 = 35672] = "BOOL_VEC3", e[e.BOOL_VEC4 = 35673] = "BOOL_VEC4", e[e.FLOAT_MAT2 = 35674] = "FLOAT_MAT2", e[e.FLOAT_MAT3 = 35675] = "FLOAT_MAT3", e[e.FLOAT_MAT4 = 35676] = "FLOAT_MAT4", e[e.SAMPLER_2D = 35678] = "SAMPLER_2D", e[e.SAMPLER_CUBE = 35680] = "SAMPLER_CUBE", e[e.LOW_FLOAT = 36336] = "LOW_FLOAT", e[e.MEDIUM_FLOAT = 36337] = "MEDIUM_FLOAT", e[e.HIGH_FLOAT = 36338] = "HIGH_FLOAT", e[e.LOW_INT = 36339] = "LOW_INT", e[e.MEDIUM_INT = 36340] = "MEDIUM_INT", e[e.HIGH_INT = 36341] = "HIGH_INT", e[e.FRAMEBUFFER = 36160] = "FRAMEBUFFER", e[e.RENDERBUFFER = 36161] = "RENDERBUFFER", e[e.RGBA4 = 32854] = "RGBA4", e[e.RGB5_A1 = 32855] = "RGB5_A1", e[e.RGB565 = 36194] = "RGB565", e[e.DEPTH_COMPONENT16 = 33189] = "DEPTH_COMPONENT16", e[e.STENCIL_INDEX = 6401] = "STENCIL_INDEX", e[e.STENCIL_INDEX8 = 36168] = "STENCIL_INDEX8", e[e.DEPTH_STENCIL = 34041] = "DEPTH_STENCIL", e[e.RENDERBUFFER_WIDTH = 36162] = "RENDERBUFFER_WIDTH", e[e.RENDERBUFFER_HEIGHT = 36163] = "RENDERBUFFER_HEIGHT", e[e.RENDERBUFFER_INTERNAL_FORMAT = 36164] = "RENDERBUFFER_INTERNAL_FORMAT", e[e.RENDERBUFFER_RED_SIZE = 36176] = "RENDERBUFFER_RED_SIZE", e[e.RENDERBUFFER_GREEN_SIZE = 36177] = "RENDERBUFFER_GREEN_SIZE", e[e.RENDERBUFFER_BLUE_SIZE = 36178] = "RENDERBUFFER_BLUE_SIZE", e[e.RENDERBUFFER_ALPHA_SIZE = 36179] = "RENDERBUFFER_ALPHA_SIZE", e[e.RENDERBUFFER_DEPTH_SIZE = 36180] = "RENDERBUFFER_DEPTH_SIZE", e[e.RENDERBUFFER_STENCIL_SIZE = 36181] = "RENDERBUFFER_STENCIL_SIZE", e[e.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 36048] = "FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE", e[e.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 36049] = "FRAMEBUFFER_ATTACHMENT_OBJECT_NAME", e[e.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 36050] = "FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL", e[e.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 36051] = "FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE", e[e.COLOR_ATTACHMENT0 = 36064] = "COLOR_ATTACHMENT0", e[e.DEPTH_ATTACHMENT = 36096] = "DEPTH_ATTACHMENT", e[e.STENCIL_ATTACHMENT = 36128] = "STENCIL_ATTACHMENT", e[e.DEPTH_STENCIL_ATTACHMENT = 33306] = "DEPTH_STENCIL_ATTACHMENT", e[e.NONE = 0] = "NONE", e[e.FRAMEBUFFER_COMPLETE = 36053] = "FRAMEBUFFER_COMPLETE", e[e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 36054] = "FRAMEBUFFER_INCOMPLETE_ATTACHMENT", e[e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 36055] = "FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT", e[e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 36057] = "FRAMEBUFFER_INCOMPLETE_DIMENSIONS", e[e.FRAMEBUFFER_UNSUPPORTED = 36061] = "FRAMEBUFFER_UNSUPPORTED", e[e.FRAMEBUFFER_BINDING = 36006] = "FRAMEBUFFER_BINDING", e[e.RENDERBUFFER_BINDING = 36007] = "RENDERBUFFER_BINDING", e[e.READ_FRAMEBUFFER = 36008] = "READ_FRAMEBUFFER", e[e.DRAW_FRAMEBUFFER = 36009] = "DRAW_FRAMEBUFFER", e[e.MAX_RENDERBUFFER_SIZE = 34024] = "MAX_RENDERBUFFER_SIZE", e[e.INVALID_FRAMEBUFFER_OPERATION = 1286] = "INVALID_FRAMEBUFFER_OPERATION", e[e.UNPACK_FLIP_Y_WEBGL = 37440] = "UNPACK_FLIP_Y_WEBGL", e[e.UNPACK_PREMULTIPLY_ALPHA_WEBGL = 37441] = "UNPACK_PREMULTIPLY_ALPHA_WEBGL", e[e.UNPACK_COLORSPACE_CONVERSION_WEBGL = 37443] = "UNPACK_COLORSPACE_CONVERSION_WEBGL", e[e.READ_BUFFER = 3074] = "READ_BUFFER", e[e.UNPACK_ROW_LENGTH = 3314] = "UNPACK_ROW_LENGTH", e[e.UNPACK_SKIP_ROWS = 3315] = "UNPACK_SKIP_ROWS", e[e.UNPACK_SKIP_PIXELS = 3316] = "UNPACK_SKIP_PIXELS", e[e.PACK_ROW_LENGTH = 3330] = "PACK_ROW_LENGTH", e[e.PACK_SKIP_ROWS = 3331] = "PACK_SKIP_ROWS", e[e.PACK_SKIP_PIXELS = 3332] = "PACK_SKIP_PIXELS", e[e.TEXTURE_BINDING_3D = 32874] = "TEXTURE_BINDING_3D", e[e.UNPACK_SKIP_IMAGES = 32877] = "UNPACK_SKIP_IMAGES", e[e.UNPACK_IMAGE_HEIGHT = 32878] = "UNPACK_IMAGE_HEIGHT", e[e.MAX_3D_TEXTURE_SIZE = 32883] = "MAX_3D_TEXTURE_SIZE", e[e.MAX_ELEMENTS_VERTICES = 33e3] = "MAX_ELEMENTS_VERTICES", e[e.MAX_ELEMENTS_INDICES = 33001] = "MAX_ELEMENTS_INDICES", e[e.MAX_TEXTURE_LOD_BIAS = 34045] = "MAX_TEXTURE_LOD_BIAS", e[e.MAX_FRAGMENT_UNIFORM_COMPONENTS = 35657] = "MAX_FRAGMENT_UNIFORM_COMPONENTS", e[e.MAX_VERTEX_UNIFORM_COMPONENTS = 35658] = "MAX_VERTEX_UNIFORM_COMPONENTS", e[e.MAX_ARRAY_TEXTURE_LAYERS = 35071] = "MAX_ARRAY_TEXTURE_LAYERS", e[e.MIN_PROGRAM_TEXEL_OFFSET = 35076] = "MIN_PROGRAM_TEXEL_OFFSET", e[e.MAX_PROGRAM_TEXEL_OFFSET = 35077] = "MAX_PROGRAM_TEXEL_OFFSET", e[e.MAX_VARYING_COMPONENTS = 35659] = "MAX_VARYING_COMPONENTS", e[e.FRAGMENT_SHADER_DERIVATIVE_HINT = 35723] = "FRAGMENT_SHADER_DERIVATIVE_HINT", e[e.RASTERIZER_DISCARD = 35977] = "RASTERIZER_DISCARD", e[e.VERTEX_ARRAY_BINDING = 34229] = "VERTEX_ARRAY_BINDING", e[e.MAX_VERTEX_OUTPUT_COMPONENTS = 37154] = "MAX_VERTEX_OUTPUT_COMPONENTS", e[e.MAX_FRAGMENT_INPUT_COMPONENTS = 37157] = "MAX_FRAGMENT_INPUT_COMPONENTS", e[e.MAX_SERVER_WAIT_TIMEOUT = 37137] = "MAX_SERVER_WAIT_TIMEOUT", e[e.MAX_ELEMENT_INDEX = 36203] = "MAX_ELEMENT_INDEX", e[e.RED = 6403] = "RED", e[e.RGB8 = 32849] = "RGB8", e[e.RGBA8 = 32856] = "RGBA8", e[e.RGB10_A2 = 32857] = "RGB10_A2", e[e.TEXTURE_3D = 32879] = "TEXTURE_3D", e[e.TEXTURE_WRAP_R = 32882] = "TEXTURE_WRAP_R", e[e.TEXTURE_MIN_LOD = 33082] = "TEXTURE_MIN_LOD", e[e.TEXTURE_MAX_LOD = 33083] = "TEXTURE_MAX_LOD", e[e.TEXTURE_BASE_LEVEL = 33084] = "TEXTURE_BASE_LEVEL", e[e.TEXTURE_MAX_LEVEL = 33085] = "TEXTURE_MAX_LEVEL", e[e.TEXTURE_COMPARE_MODE = 34892] = "TEXTURE_COMPARE_MODE", e[e.TEXTURE_COMPARE_FUNC = 34893] = "TEXTURE_COMPARE_FUNC", e[e.SRGB = 35904] = "SRGB", e[e.SRGB8 = 35905] = "SRGB8", e[e.SRGB8_ALPHA8 = 35907] = "SRGB8_ALPHA8", e[e.COMPARE_REF_TO_TEXTURE = 34894] = "COMPARE_REF_TO_TEXTURE", e[e.RGBA32F = 34836] = "RGBA32F", e[e.RGB32F = 34837] = "RGB32F", e[e.RGBA16F = 34842] = "RGBA16F", e[e.RGB16F = 34843] = "RGB16F", e[e.TEXTURE_2D_ARRAY = 35866] = "TEXTURE_2D_ARRAY", e[e.TEXTURE_BINDING_2D_ARRAY = 35869] = "TEXTURE_BINDING_2D_ARRAY", e[e.R11F_G11F_B10F = 35898] = "R11F_G11F_B10F", e[e.RGB9_E5 = 35901] = "RGB9_E5", e[e.RGBA32UI = 36208] = "RGBA32UI", e[e.RGB32UI = 36209] = "RGB32UI", e[e.RGBA16UI = 36214] = "RGBA16UI", e[e.RGB16UI = 36215] = "RGB16UI", e[e.RGBA8UI = 36220] = "RGBA8UI", e[e.RGB8UI = 36221] = "RGB8UI", e[e.RGBA32I = 36226] = "RGBA32I", e[e.RGB32I = 36227] = "RGB32I", e[e.RGBA16I = 36232] = "RGBA16I", e[e.RGB16I = 36233] = "RGB16I", e[e.RGBA8I = 36238] = "RGBA8I", e[e.RGB8I = 36239] = "RGB8I", e[e.RED_INTEGER = 36244] = "RED_INTEGER", e[e.RGB_INTEGER = 36248] = "RGB_INTEGER", e[e.RGBA_INTEGER = 36249] = "RGBA_INTEGER", e[e.R8 = 33321] = "R8", e[e.RG8 = 33323] = "RG8", e[e.R16F = 33325] = "R16F", e[e.R32F = 33326] = "R32F", e[e.RG16F = 33327] = "RG16F", e[e.RG32F = 33328] = "RG32F", e[e.R8I = 33329] = "R8I", e[e.R8UI = 33330] = "R8UI", e[e.R16I = 33331] = "R16I", e[e.R16UI = 33332] = "R16UI", e[e.R32I = 33333] = "R32I", e[e.R32UI = 33334] = "R32UI", e[e.RG8I = 33335] = "RG8I", e[e.RG8UI = 33336] = "RG8UI", e[e.RG16I = 33337] = "RG16I", e[e.RG16UI = 33338] = "RG16UI", e[e.RG32I = 33339] = "RG32I", e[e.RG32UI = 33340] = "RG32UI", e[e.R8_SNORM = 36756] = "R8_SNORM", e[e.RG8_SNORM = 36757] = "RG8_SNORM", e[e.RGB8_SNORM = 36758] = "RGB8_SNORM", e[e.RGBA8_SNORM = 36759] = "RGBA8_SNORM", e[e.RGB10_A2UI = 36975] = "RGB10_A2UI", e[e.TEXTURE_IMMUTABLE_FORMAT = 37167] = "TEXTURE_IMMUTABLE_FORMAT", e[e.TEXTURE_IMMUTABLE_LEVELS = 33503] = "TEXTURE_IMMUTABLE_LEVELS", e[e.UNSIGNED_INT_2_10_10_10_REV = 33640] = "UNSIGNED_INT_2_10_10_10_REV", e[e.UNSIGNED_INT_10F_11F_11F_REV = 35899] = "UNSIGNED_INT_10F_11F_11F_REV", e[e.UNSIGNED_INT_5_9_9_9_REV = 35902] = "UNSIGNED_INT_5_9_9_9_REV", e[e.FLOAT_32_UNSIGNED_INT_24_8_REV = 36269] = "FLOAT_32_UNSIGNED_INT_24_8_REV", e[e.UNSIGNED_INT_24_8 = 34042] = "UNSIGNED_INT_24_8", e[e.HALF_FLOAT = 5131] = "HALF_FLOAT", e[e.RG = 33319] = "RG", e[e.RG_INTEGER = 33320] = "RG_INTEGER", e[e.INT_2_10_10_10_REV = 36255] = "INT_2_10_10_10_REV", e[e.CURRENT_QUERY = 34917] = "CURRENT_QUERY", e[e.QUERY_RESULT = 34918] = "QUERY_RESULT", e[e.QUERY_RESULT_AVAILABLE = 34919] = "QUERY_RESULT_AVAILABLE", e[e.ANY_SAMPLES_PASSED = 35887] = "ANY_SAMPLES_PASSED", e[e.ANY_SAMPLES_PASSED_CONSERVATIVE = 36202] = "ANY_SAMPLES_PASSED_CONSERVATIVE", e[e.MAX_DRAW_BUFFERS = 34852] = "MAX_DRAW_BUFFERS", e[e.DRAW_BUFFER0 = 34853] = "DRAW_BUFFER0", e[e.DRAW_BUFFER1 = 34854] = "DRAW_BUFFER1", e[e.DRAW_BUFFER2 = 34855] = "DRAW_BUFFER2", e[e.DRAW_BUFFER3 = 34856] = "DRAW_BUFFER3", e[e.DRAW_BUFFER4 = 34857] = "DRAW_BUFFER4", e[e.DRAW_BUFFER5 = 34858] = "DRAW_BUFFER5", e[e.DRAW_BUFFER6 = 34859] = "DRAW_BUFFER6", e[e.DRAW_BUFFER7 = 34860] = "DRAW_BUFFER7", e[e.DRAW_BUFFER8 = 34861] = "DRAW_BUFFER8", e[e.DRAW_BUFFER9 = 34862] = "DRAW_BUFFER9", e[e.DRAW_BUFFER10 = 34863] = "DRAW_BUFFER10", e[e.DRAW_BUFFER11 = 34864] = "DRAW_BUFFER11", e[e.DRAW_BUFFER12 = 34865] = "DRAW_BUFFER12", e[e.DRAW_BUFFER13 = 34866] = "DRAW_BUFFER13", e[e.DRAW_BUFFER14 = 34867] = "DRAW_BUFFER14", e[e.DRAW_BUFFER15 = 34868] = "DRAW_BUFFER15", e[e.MAX_COLOR_ATTACHMENTS = 36063] = "MAX_COLOR_ATTACHMENTS", e[e.COLOR_ATTACHMENT1 = 36065] = "COLOR_ATTACHMENT1", e[e.COLOR_ATTACHMENT2 = 36066] = "COLOR_ATTACHMENT2", e[e.COLOR_ATTACHMENT3 = 36067] = "COLOR_ATTACHMENT3", e[e.COLOR_ATTACHMENT4 = 36068] = "COLOR_ATTACHMENT4", e[e.COLOR_ATTACHMENT5 = 36069] = "COLOR_ATTACHMENT5", e[e.COLOR_ATTACHMENT6 = 36070] = "COLOR_ATTACHMENT6", e[e.COLOR_ATTACHMENT7 = 36071] = "COLOR_ATTACHMENT7", e[e.COLOR_ATTACHMENT8 = 36072] = "COLOR_ATTACHMENT8", e[e.COLOR_ATTACHMENT9 = 36073] = "COLOR_ATTACHMENT9", e[e.COLOR_ATTACHMENT10 = 36074] = "COLOR_ATTACHMENT10", e[e.COLOR_ATTACHMENT11 = 36075] = "COLOR_ATTACHMENT11", e[e.COLOR_ATTACHMENT12 = 36076] = "COLOR_ATTACHMENT12", e[e.COLOR_ATTACHMENT13 = 36077] = "COLOR_ATTACHMENT13", e[e.COLOR_ATTACHMENT14 = 36078] = "COLOR_ATTACHMENT14", e[e.COLOR_ATTACHMENT15 = 36079] = "COLOR_ATTACHMENT15", e[e.SAMPLER_3D = 35679] = "SAMPLER_3D", e[e.SAMPLER_2D_SHADOW = 35682] = "SAMPLER_2D_SHADOW", e[e.SAMPLER_2D_ARRAY = 36289] = "SAMPLER_2D_ARRAY", e[e.SAMPLER_2D_ARRAY_SHADOW = 36292] = "SAMPLER_2D_ARRAY_SHADOW", e[e.SAMPLER_CUBE_SHADOW = 36293] = "SAMPLER_CUBE_SHADOW", e[e.INT_SAMPLER_2D = 36298] = "INT_SAMPLER_2D", e[e.INT_SAMPLER_3D = 36299] = "INT_SAMPLER_3D", e[e.INT_SAMPLER_CUBE = 36300] = "INT_SAMPLER_CUBE", e[e.INT_SAMPLER_2D_ARRAY = 36303] = "INT_SAMPLER_2D_ARRAY", e[e.UNSIGNED_INT_SAMPLER_2D = 36306] = "UNSIGNED_INT_SAMPLER_2D", e[e.UNSIGNED_INT_SAMPLER_3D = 36307] = "UNSIGNED_INT_SAMPLER_3D", e[e.UNSIGNED_INT_SAMPLER_CUBE = 36308] = "UNSIGNED_INT_SAMPLER_CUBE", e[e.UNSIGNED_INT_SAMPLER_2D_ARRAY = 36311] = "UNSIGNED_INT_SAMPLER_2D_ARRAY", e[e.MAX_SAMPLES = 36183] = "MAX_SAMPLES", e[e.SAMPLER_BINDING = 35097] = "SAMPLER_BINDING", e[e.PIXEL_PACK_BUFFER = 35051] = "PIXEL_PACK_BUFFER", e[e.PIXEL_UNPACK_BUFFER = 35052] = "PIXEL_UNPACK_BUFFER", e[e.PIXEL_PACK_BUFFER_BINDING = 35053] = "PIXEL_PACK_BUFFER_BINDING", e[e.PIXEL_UNPACK_BUFFER_BINDING = 35055] = "PIXEL_UNPACK_BUFFER_BINDING", e[e.COPY_READ_BUFFER = 36662] = "COPY_READ_BUFFER", e[e.COPY_WRITE_BUFFER = 36663] = "COPY_WRITE_BUFFER", e[e.COPY_READ_BUFFER_BINDING = 36662] = "COPY_READ_BUFFER_BINDING", e[e.COPY_WRITE_BUFFER_BINDING = 36663] = "COPY_WRITE_BUFFER_BINDING", e[e.FLOAT_MAT2x3 = 35685] = "FLOAT_MAT2x3", e[e.FLOAT_MAT2x4 = 35686] = "FLOAT_MAT2x4", e[e.FLOAT_MAT3x2 = 35687] = "FLOAT_MAT3x2", e[e.FLOAT_MAT3x4 = 35688] = "FLOAT_MAT3x4", e[e.FLOAT_MAT4x2 = 35689] = "FLOAT_MAT4x2", e[e.FLOAT_MAT4x3 = 35690] = "FLOAT_MAT4x3", e[e.UNSIGNED_INT_VEC2 = 36294] = "UNSIGNED_INT_VEC2", e[e.UNSIGNED_INT_VEC3 = 36295] = "UNSIGNED_INT_VEC3", e[e.UNSIGNED_INT_VEC4 = 36296] = "UNSIGNED_INT_VEC4", e[e.UNSIGNED_NORMALIZED = 35863] = "UNSIGNED_NORMALIZED", e[e.SIGNED_NORMALIZED = 36764] = "SIGNED_NORMALIZED", e[e.VERTEX_ATTRIB_ARRAY_INTEGER = 35069] = "VERTEX_ATTRIB_ARRAY_INTEGER", e[e.VERTEX_ATTRIB_ARRAY_DIVISOR = 35070] = "VERTEX_ATTRIB_ARRAY_DIVISOR", e[e.TRANSFORM_FEEDBACK_BUFFER_MODE = 35967] = "TRANSFORM_FEEDBACK_BUFFER_MODE", e[e.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 35968] = "MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS", e[e.TRANSFORM_FEEDBACK_VARYINGS = 35971] = "TRANSFORM_FEEDBACK_VARYINGS", e[e.TRANSFORM_FEEDBACK_BUFFER_START = 35972] = "TRANSFORM_FEEDBACK_BUFFER_START", e[e.TRANSFORM_FEEDBACK_BUFFER_SIZE = 35973] = "TRANSFORM_FEEDBACK_BUFFER_SIZE", e[e.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = 35976] = "TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN", e[e.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 35978] = "MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS", e[e.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS = 35979] = "MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS", e[e.INTERLEAVED_ATTRIBS = 35980] = "INTERLEAVED_ATTRIBS", e[e.SEPARATE_ATTRIBS = 35981] = "SEPARATE_ATTRIBS", e[e.TRANSFORM_FEEDBACK_BUFFER = 35982] = "TRANSFORM_FEEDBACK_BUFFER", e[e.TRANSFORM_FEEDBACK_BUFFER_BINDING = 35983] = "TRANSFORM_FEEDBACK_BUFFER_BINDING", e[e.TRANSFORM_FEEDBACK = 36386] = "TRANSFORM_FEEDBACK", e[e.TRANSFORM_FEEDBACK_PAUSED = 36387] = "TRANSFORM_FEEDBACK_PAUSED", e[e.TRANSFORM_FEEDBACK_ACTIVE = 36388] = "TRANSFORM_FEEDBACK_ACTIVE", e[e.TRANSFORM_FEEDBACK_BINDING = 36389] = "TRANSFORM_FEEDBACK_BINDING", e[e.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 33296] = "FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING", e[e.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE = 33297] = "FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE", e[e.FRAMEBUFFER_ATTACHMENT_RED_SIZE = 33298] = "FRAMEBUFFER_ATTACHMENT_RED_SIZE", e[e.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE = 33299] = "FRAMEBUFFER_ATTACHMENT_GREEN_SIZE", e[e.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE = 33300] = "FRAMEBUFFER_ATTACHMENT_BLUE_SIZE", e[e.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE = 33301] = "FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE", e[e.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = 33302] = "FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE", e[e.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = 33303] = "FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE", e[e.FRAMEBUFFER_DEFAULT = 33304] = "FRAMEBUFFER_DEFAULT", e[e.DEPTH24_STENCIL8 = 35056] = "DEPTH24_STENCIL8", e[e.DRAW_FRAMEBUFFER_BINDING = 36006] = "DRAW_FRAMEBUFFER_BINDING", e[e.READ_FRAMEBUFFER_BINDING = 36010] = "READ_FRAMEBUFFER_BINDING", e[e.RENDERBUFFER_SAMPLES = 36011] = "RENDERBUFFER_SAMPLES", e[e.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 36052] = "FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER", e[e.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 36182] = "FRAMEBUFFER_INCOMPLETE_MULTISAMPLE", e[e.UNIFORM_BUFFER = 35345] = "UNIFORM_BUFFER", e[e.UNIFORM_BUFFER_BINDING = 35368] = "UNIFORM_BUFFER_BINDING", e[e.UNIFORM_BUFFER_START = 35369] = "UNIFORM_BUFFER_START", e[e.UNIFORM_BUFFER_SIZE = 35370] = "UNIFORM_BUFFER_SIZE", e[e.MAX_VERTEX_UNIFORM_BLOCKS = 35371] = "MAX_VERTEX_UNIFORM_BLOCKS", e[e.MAX_FRAGMENT_UNIFORM_BLOCKS = 35373] = "MAX_FRAGMENT_UNIFORM_BLOCKS", e[e.MAX_COMBINED_UNIFORM_BLOCKS = 35374] = "MAX_COMBINED_UNIFORM_BLOCKS", e[e.MAX_UNIFORM_BUFFER_BINDINGS = 35375] = "MAX_UNIFORM_BUFFER_BINDINGS", e[e.MAX_UNIFORM_BLOCK_SIZE = 35376] = "MAX_UNIFORM_BLOCK_SIZE", e[e.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 35377] = "MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS", e[e.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 35379] = "MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS", e[e.UNIFORM_BUFFER_OFFSET_ALIGNMENT = 35380] = "UNIFORM_BUFFER_OFFSET_ALIGNMENT", e[e.ACTIVE_UNIFORM_BLOCKS = 35382] = "ACTIVE_UNIFORM_BLOCKS", e[e.UNIFORM_TYPE = 35383] = "UNIFORM_TYPE", e[e.UNIFORM_SIZE = 35384] = "UNIFORM_SIZE", e[e.UNIFORM_BLOCK_INDEX = 35386] = "UNIFORM_BLOCK_INDEX", e[e.UNIFORM_OFFSET = 35387] = "UNIFORM_OFFSET", e[e.UNIFORM_ARRAY_STRIDE = 35388] = "UNIFORM_ARRAY_STRIDE", e[e.UNIFORM_MATRIX_STRIDE = 35389] = "UNIFORM_MATRIX_STRIDE", e[e.UNIFORM_IS_ROW_MAJOR = 35390] = "UNIFORM_IS_ROW_MAJOR", e[e.UNIFORM_BLOCK_BINDING = 35391] = "UNIFORM_BLOCK_BINDING", e[e.UNIFORM_BLOCK_DATA_SIZE = 35392] = "UNIFORM_BLOCK_DATA_SIZE", e[e.UNIFORM_BLOCK_ACTIVE_UNIFORMS = 35394] = "UNIFORM_BLOCK_ACTIVE_UNIFORMS", e[e.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 35395] = "UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES", e[e.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 35396] = "UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER", e[e.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 35398] = "UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER", e[e.OBJECT_TYPE = 37138] = "OBJECT_TYPE", e[e.SYNC_CONDITION = 37139] = "SYNC_CONDITION", e[e.SYNC_STATUS = 37140] = "SYNC_STATUS", e[e.SYNC_FLAGS = 37141] = "SYNC_FLAGS", e[e.SYNC_FENCE = 37142] = "SYNC_FENCE", e[e.SYNC_GPU_COMMANDS_COMPLETE = 37143] = "SYNC_GPU_COMMANDS_COMPLETE", e[e.UNSIGNALED = 37144] = "UNSIGNALED", e[e.SIGNALED = 37145] = "SIGNALED", e[e.ALREADY_SIGNALED = 37146] = "ALREADY_SIGNALED", e[e.TIMEOUT_EXPIRED = 37147] = "TIMEOUT_EXPIRED", e[e.CONDITION_SATISFIED = 37148] = "CONDITION_SATISFIED", e[e.WAIT_FAILED = 37149] = "WAIT_FAILED", e[e.SYNC_FLUSH_COMMANDS_BIT = 1] = "SYNC_FLUSH_COMMANDS_BIT", e[e.COLOR = 6144] = "COLOR", e[e.DEPTH = 6145] = "DEPTH", e[e.STENCIL = 6146] = "STENCIL", e[e.MIN = 32775] = "MIN", e[e.MAX = 32776] = "MAX", e[e.DEPTH_COMPONENT24 = 33190] = "DEPTH_COMPONENT24", e[e.STREAM_READ = 35041] = "STREAM_READ", e[e.STREAM_COPY = 35042] = "STREAM_COPY", e[e.STATIC_READ = 35045] = "STATIC_READ", e[e.STATIC_COPY = 35046] = "STATIC_COPY", e[e.DYNAMIC_READ = 35049] = "DYNAMIC_READ", e[e.DYNAMIC_COPY = 35050] = "DYNAMIC_COPY", e[e.DEPTH_COMPONENT32F = 36012] = "DEPTH_COMPONENT32F", e[e.DEPTH32F_STENCIL8 = 36013] = "DEPTH32F_STENCIL8", e[e.INVALID_INDEX = 4294967295] = "INVALID_INDEX", e[e.TIMEOUT_IGNORED = -1] = "TIMEOUT_IGNORED", e[e.MAX_CLIENT_WAIT_TIMEOUT_WEBGL = 37447] = "MAX_CLIENT_WAIT_TIMEOUT_WEBGL", e[e.UNMASKED_VENDOR_WEBGL = 37445] = "UNMASKED_VENDOR_WEBGL", e[e.UNMASKED_RENDERER_WEBGL = 37446] = "UNMASKED_RENDERER_WEBGL", e[e.MAX_TEXTURE_MAX_ANISOTROPY_EXT = 34047] = "MAX_TEXTURE_MAX_ANISOTROPY_EXT", e[e.TEXTURE_MAX_ANISOTROPY_EXT = 34046] = "TEXTURE_MAX_ANISOTROPY_EXT", e[e.R16_EXT = 33322] = "R16_EXT", e[e.RG16_EXT = 33324] = "RG16_EXT", e[e.RGB16_EXT = 32852] = "RGB16_EXT", e[e.RGBA16_EXT = 32859] = "RGBA16_EXT", e[e.R16_SNORM_EXT = 36760] = "R16_SNORM_EXT", e[e.RG16_SNORM_EXT = 36761] = "RG16_SNORM_EXT", e[e.RGB16_SNORM_EXT = 36762] = "RGB16_SNORM_EXT", e[e.RGBA16_SNORM_EXT = 36763] = "RGBA16_SNORM_EXT", e[e.COMPRESSED_RGB_S3TC_DXT1_EXT = 33776] = "COMPRESSED_RGB_S3TC_DXT1_EXT", e[e.COMPRESSED_RGBA_S3TC_DXT1_EXT = 33777] = "COMPRESSED_RGBA_S3TC_DXT1_EXT", e[e.COMPRESSED_RGBA_S3TC_DXT3_EXT = 33778] = "COMPRESSED_RGBA_S3TC_DXT3_EXT", e[e.COMPRESSED_RGBA_S3TC_DXT5_EXT = 33779] = "COMPRESSED_RGBA_S3TC_DXT5_EXT", e[e.COMPRESSED_SRGB_S3TC_DXT1_EXT = 35916] = "COMPRESSED_SRGB_S3TC_DXT1_EXT", e[e.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT = 35917] = "COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT", e[e.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT = 35918] = "COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT", e[e.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT = 35919] = "COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT", e[e.COMPRESSED_RED_RGTC1_EXT = 36283] = "COMPRESSED_RED_RGTC1_EXT", e[e.COMPRESSED_SIGNED_RED_RGTC1_EXT = 36284] = "COMPRESSED_SIGNED_RED_RGTC1_EXT", e[e.COMPRESSED_RED_GREEN_RGTC2_EXT = 36285] = "COMPRESSED_RED_GREEN_RGTC2_EXT", e[e.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT = 36286] = "COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT", e[e.COMPRESSED_RGBA_BPTC_UNORM_EXT = 36492] = "COMPRESSED_RGBA_BPTC_UNORM_EXT", e[e.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT = 36493] = "COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT", e[e.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT = 36494] = "COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT", e[e.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT = 36495] = "COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT", e[e.COMPRESSED_R11_EAC = 37488] = "COMPRESSED_R11_EAC", e[e.COMPRESSED_SIGNED_R11_EAC = 37489] = "COMPRESSED_SIGNED_R11_EAC", e[e.COMPRESSED_RG11_EAC = 37490] = "COMPRESSED_RG11_EAC", e[e.COMPRESSED_SIGNED_RG11_EAC = 37491] = "COMPRESSED_SIGNED_RG11_EAC", e[e.COMPRESSED_RGB8_ETC2 = 37492] = "COMPRESSED_RGB8_ETC2", e[e.COMPRESSED_RGBA8_ETC2_EAC = 37493] = "COMPRESSED_RGBA8_ETC2_EAC", e[e.COMPRESSED_SRGB8_ETC2 = 37494] = "COMPRESSED_SRGB8_ETC2", e[e.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 37495] = "COMPRESSED_SRGB8_ALPHA8_ETC2_EAC", e[e.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37496] = "COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2", e[e.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37497] = "COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2", e[e.COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 35840] = "COMPRESSED_RGB_PVRTC_4BPPV1_IMG", e[e.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 35842] = "COMPRESSED_RGBA_PVRTC_4BPPV1_IMG", e[e.COMPRESSED_RGB_PVRTC_2BPPV1_IMG = 35841] = "COMPRESSED_RGB_PVRTC_2BPPV1_IMG", e[e.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 35843] = "COMPRESSED_RGBA_PVRTC_2BPPV1_IMG", e[e.COMPRESSED_RGB_ETC1_WEBGL = 36196] = "COMPRESSED_RGB_ETC1_WEBGL", e[e.COMPRESSED_RGB_ATC_WEBGL = 35986] = "COMPRESSED_RGB_ATC_WEBGL", e[e.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL = 35986] = "COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL", e[e.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL = 34798] = "COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL", e[e.COMPRESSED_RGBA_ASTC_4x4_KHR = 37808] = "COMPRESSED_RGBA_ASTC_4x4_KHR", e[e.COMPRESSED_RGBA_ASTC_5x4_KHR = 37809] = "COMPRESSED_RGBA_ASTC_5x4_KHR", e[e.COMPRESSED_RGBA_ASTC_5x5_KHR = 37810] = "COMPRESSED_RGBA_ASTC_5x5_KHR", e[e.COMPRESSED_RGBA_ASTC_6x5_KHR = 37811] = "COMPRESSED_RGBA_ASTC_6x5_KHR", e[e.COMPRESSED_RGBA_ASTC_6x6_KHR = 37812] = "COMPRESSED_RGBA_ASTC_6x6_KHR", e[e.COMPRESSED_RGBA_ASTC_8x5_KHR = 37813] = "COMPRESSED_RGBA_ASTC_8x5_KHR", e[e.COMPRESSED_RGBA_ASTC_8x6_KHR = 37814] = "COMPRESSED_RGBA_ASTC_8x6_KHR", e[e.COMPRESSED_RGBA_ASTC_8x8_KHR = 37815] = "COMPRESSED_RGBA_ASTC_8x8_KHR", e[e.COMPRESSED_RGBA_ASTC_10x5_KHR = 37816] = "COMPRESSED_RGBA_ASTC_10x5_KHR", e[e.COMPRESSED_RGBA_ASTC_10x6_KHR = 37817] = "COMPRESSED_RGBA_ASTC_10x6_KHR", e[e.COMPRESSED_RGBA_ASTC_10x8_KHR = 37818] = "COMPRESSED_RGBA_ASTC_10x8_KHR", e[e.COMPRESSED_RGBA_ASTC_10x10_KHR = 37819] = "COMPRESSED_RGBA_ASTC_10x10_KHR", e[e.COMPRESSED_RGBA_ASTC_12x10_KHR = 37820] = "COMPRESSED_RGBA_ASTC_12x10_KHR", e[e.COMPRESSED_RGBA_ASTC_12x12_KHR = 37821] = "COMPRESSED_RGBA_ASTC_12x12_KHR", e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR = 37840] = "COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR", e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR = 37841] = "COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR", e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR = 37842] = "COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR", e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR = 37843] = "COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR", e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR = 37844] = "COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR", e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR = 37845] = "COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR", e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR = 37846] = "COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR", e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR = 37847] = "COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR", e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR = 37848] = "COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR", e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR = 37849] = "COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR", e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR = 37850] = "COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR", e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR = 37851] = "COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR", e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR = 37852] = "COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR", e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR = 37853] = "COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR", e[e.QUERY_COUNTER_BITS_EXT = 34916] = "QUERY_COUNTER_BITS_EXT", e[e.CURRENT_QUERY_EXT = 34917] = "CURRENT_QUERY_EXT", e[e.QUERY_RESULT_EXT = 34918] = "QUERY_RESULT_EXT", e[e.QUERY_RESULT_AVAILABLE_EXT = 34919] = "QUERY_RESULT_AVAILABLE_EXT", e[e.TIME_ELAPSED_EXT = 35007] = "TIME_ELAPSED_EXT", e[e.TIMESTAMP_EXT = 36392] = "TIMESTAMP_EXT", e[e.GPU_DISJOINT_EXT = 36795] = "GPU_DISJOINT_EXT", e[e.COMPLETION_STATUS_KHR = 37297] = "COMPLETION_STATUS_KHR", e[e.DEPTH_CLAMP_EXT = 34383] = "DEPTH_CLAMP_EXT", e[e.FIRST_VERTEX_CONVENTION_WEBGL = 36429] = "FIRST_VERTEX_CONVENTION_WEBGL", e[e.LAST_VERTEX_CONVENTION_WEBGL = 36430] = "LAST_VERTEX_CONVENTION_WEBGL", e[e.PROVOKING_VERTEX_WEBL = 36431] = "PROVOKING_VERTEX_WEBL", e[e.POLYGON_MODE_WEBGL = 2880] = "POLYGON_MODE_WEBGL", e[e.POLYGON_OFFSET_LINE_WEBGL = 10754] = "POLYGON_OFFSET_LINE_WEBGL", e[e.LINE_WEBGL = 6913] = "LINE_WEBGL", e[e.FILL_WEBGL = 6914] = "FILL_WEBGL", e[e.MAX_CLIP_DISTANCES_WEBGL = 3378] = "MAX_CLIP_DISTANCES_WEBGL", e[e.MAX_CULL_DISTANCES_WEBGL = 33529] = "MAX_CULL_DISTANCES_WEBGL", e[e.MAX_COMBINED_CLIP_AND_CULL_DISTANCES_WEBGL = 33530] = "MAX_COMBINED_CLIP_AND_CULL_DISTANCES_WEBGL", e[e.CLIP_DISTANCE0_WEBGL = 12288] = "CLIP_DISTANCE0_WEBGL", e[e.CLIP_DISTANCE1_WEBGL = 12289] = "CLIP_DISTANCE1_WEBGL", e[e.CLIP_DISTANCE2_WEBGL = 12290] = "CLIP_DISTANCE2_WEBGL", e[e.CLIP_DISTANCE3_WEBGL = 12291] = "CLIP_DISTANCE3_WEBGL", e[e.CLIP_DISTANCE4_WEBGL = 12292] = "CLIP_DISTANCE4_WEBGL", e[e.CLIP_DISTANCE5_WEBGL = 12293] = "CLIP_DISTANCE5_WEBGL", e[e.CLIP_DISTANCE6_WEBGL = 12294] = "CLIP_DISTANCE6_WEBGL", e[e.CLIP_DISTANCE7_WEBGL = 12295] = "CLIP_DISTANCE7_WEBGL", e[e.POLYGON_OFFSET_CLAMP_EXT = 36379] = "POLYGON_OFFSET_CLAMP_EXT", e[e.LOWER_LEFT_EXT = 36001] = "LOWER_LEFT_EXT", e[e.UPPER_LEFT_EXT = 36002] = "UPPER_LEFT_EXT", e[e.NEGATIVE_ONE_TO_ONE_EXT = 37726] = "NEGATIVE_ONE_TO_ONE_EXT", e[e.ZERO_TO_ONE_EXT = 37727] = "ZERO_TO_ONE_EXT", e[e.CLIP_ORIGIN_EXT = 37724] = "CLIP_ORIGIN_EXT", e[e.CLIP_DEPTH_MODE_EXT = 37725] = "CLIP_DEPTH_MODE_EXT", e[e.SRC1_COLOR_WEBGL = 35065] = "SRC1_COLOR_WEBGL", e[e.SRC1_ALPHA_WEBGL = 34185] = "SRC1_ALPHA_WEBGL", e[e.ONE_MINUS_SRC1_COLOR_WEBGL = 35066] = "ONE_MINUS_SRC1_COLOR_WEBGL", e[e.ONE_MINUS_SRC1_ALPHA_WEBGL = 35067] = "ONE_MINUS_SRC1_ALPHA_WEBGL", e[e.MAX_DUAL_SOURCE_DRAW_BUFFERS_WEBGL = 35068] = "MAX_DUAL_SOURCE_DRAW_BUFFERS_WEBGL", e[e.MIRROR_CLAMP_TO_EDGE_EXT = 34627] = "MIRROR_CLAMP_TO_EDGE_EXT";
70
- })(K || (K = {}));
71
- const Z = 1e-3, H = 64, ye = 4, q = 2;
72
+ })(L || (L = {}));
73
+ const K = 1e-3, H = 64, Fe = 4, q = 2;
72
74
  class Ee {
73
75
  constructor() {
74
- this.pointsTextureSize = 0, this.linksTextureSize = 0, this.alpha = 1, this.transform = V.create(), this.screenSize = [0, 0], this.mousePosition = [0, 0], this.screenMousePosition = [0, 0], this.selectedArea = [[0, 0], [0, 0]], this.isSimulationRunning = !1, this.simulationProgress = 0, this.selectedIndices = null, this.maxPointSize = H, this.hoveredPoint = void 0, this.focusedPoint = void 0, this.draggingPointIndex = void 0, this.hoveredLinkIndex = void 0, this.adjustedSpaceSize = h.spaceSize, this.isSpaceKeyPressed = !1, this.webglMaxTextureSize = 16384, this.hoveredPointRingColor = [1, 1, 1, ve], this.focusedPointRingColor = [1, 1, 1, Ie], this.hoveredLinkColor = [-1, -1, -1, -1], this.greyoutPointColor = [-1, -1, -1, -1], this.isDarkenGreyout = !1, this.isLinkHoveringEnabled = !1, this.alphaTarget = 0, this.scalePointX = j(), this.scalePointY = j(), this.random = new he(), this._backgroundColor = [0, 0, 0, 0], this.alphaDecay = (t) => 1 - Math.pow(Z, 1 / t);
76
+ this.pointsTextureSize = 0, this.linksTextureSize = 0, this.alpha = 1, this.transform = V.create(), this.screenSize = [0, 0], this.mousePosition = [0, 0], this.screenMousePosition = [0, 0], this.selectedArea = [[0, 0], [0, 0]], this.isSimulationRunning = !1, this.simulationProgress = 0, this.selectedIndices = null, this.maxPointSize = H, this.hoveredPoint = void 0, this.focusedPoint = void 0, this.draggingPointIndex = void 0, this.hoveredLinkIndex = void 0, this.adjustedSpaceSize = f.spaceSize, this.isSpaceKeyPressed = !1, this.webglMaxTextureSize = 16384, this.hoveredPointRingColor = [1, 1, 1, me], this.focusedPointRingColor = [1, 1, 1, Ie], this.hoveredLinkColor = [-1, -1, -1, -1], this.greyoutPointColor = [-1, -1, -1, -1], this.isDarkenGreyout = !1, this.isLinkHoveringEnabled = !1, this.alphaTarget = 0, this.scalePointX = j(), this.scalePointY = j(), this.random = new he(), this._backgroundColor = [0, 0, 0, 0], this.alphaDecay = (t) => 1 - Math.pow(K, 1 / t);
75
77
  }
76
78
  get backgroundColor() {
77
79
  return this._backgroundColor;
@@ -192,7 +194,7 @@ class Ee {
192
194
  }
193
195
  set backgroundColor(t) {
194
196
  this._backgroundColor = t;
195
- const i = Me(t[0], t[1], t[2]);
197
+ const i = Oe(t[0], t[1], t[2]);
196
198
  document.documentElement.style.setProperty("--cosmosgl-attribution-color", i > 0.65 ? "black" : "white"), document.documentElement.style.setProperty("--cosmosgl-error-message-color", i > 0.65 ? "black" : "white"), this.div && (this.div.style.backgroundColor = `rgba(${t[0] * 255}, ${t[1] * 255}, ${t[2] * 255}, ${t[3]})`), this.isDarkenGreyout = i < 0.65;
197
199
  }
198
200
  addRandomSeed(t) {
@@ -207,7 +209,7 @@ class Ee {
207
209
  * Ensures `spaceSize` is always a positive number >= 2 (required for Math.log2).
208
210
  */
209
211
  adjustSpaceSize(t, i) {
210
- (t <= 0 || !isFinite(t)) && (console.error(`Invalid spaceSize value: ${t}. Using default value of ${h.spaceSize}`), t = h.spaceSize);
212
+ (t <= 0 || !isFinite(t)) && (console.error(`Invalid spaceSize value: ${t}. Using default value of ${f.spaceSize}`), t = f.spaceSize);
211
213
  const o = 2;
212
214
  if (t < o && (console.warn(`spaceSize (${t}) is too small. Using minimum value of ${o}`), t = o), !Number.isFinite(i) || i <= 0 || i < o) {
213
215
  console.warn(`Invalid webglMaxTextureSize: ${i}. Using configSpaceSize without WebGL limit adjustment.`), this.adjustedSpaceSize = t;
@@ -232,11 +234,11 @@ class Ee {
232
234
  return this.scalePointY(t);
233
235
  }
234
236
  setHoveredPointRingColor(t) {
235
- const i = k(t);
237
+ const i = z(t);
236
238
  this.hoveredPointRingColor[0] = i[0], this.hoveredPointRingColor[1] = i[1], this.hoveredPointRingColor[2] = i[2];
237
239
  }
238
240
  setFocusedPointRingColor(t) {
239
- const i = k(t);
241
+ const i = z(t);
240
242
  this.focusedPointRingColor[0] = i[0], this.focusedPointRingColor[1] = i[1], this.focusedPointRingColor[2] = i[2];
241
243
  }
242
244
  setGreyoutPointColor(t) {
@@ -244,7 +246,7 @@ class Ee {
244
246
  this.greyoutPointColor = [-1, -1, -1, -1];
245
247
  return;
246
248
  }
247
- const i = k(t);
249
+ const i = z(t);
248
250
  this.greyoutPointColor[0] = i[0], this.greyoutPointColor[1] = i[1], this.greyoutPointColor[2] = i[2], this.greyoutPointColor[3] = i[3];
249
251
  }
250
252
  updateLinkHoveringEnabled(t) {
@@ -255,7 +257,7 @@ class Ee {
255
257
  this.hoveredLinkColor = [-1, -1, -1, -1];
256
258
  return;
257
259
  }
258
- const i = k(t);
260
+ const i = z(t);
259
261
  this.hoveredLinkColor[0] = i[0], this.hoveredLinkColor[1] = i[1], this.hoveredLinkColor[2] = i[2], this.hoveredLinkColor[3] = i[3];
260
262
  }
261
263
  setFocusedPoint(t) {
@@ -265,13 +267,13 @@ class Ee {
265
267
  return (this.alphaTarget - this.alpha) * this.alphaDecay(t);
266
268
  }
267
269
  }
268
- const Fe = (e) => typeof e == "function", te = (e) => Array.isArray(e), Ne = (e) => e instanceof Object, De = (e) => e instanceof Object ? e.constructor.name !== "Function" && e.constructor.name !== "Object" : !1, Q = (e) => Ne(e) && !te(e) && !Fe(e) && !De(e);
269
- function k(e) {
270
+ const Ne = (e) => typeof e == "function", ie = (e) => Array.isArray(e), Me = (e) => e instanceof Object, De = (e) => e instanceof Object ? e.constructor.name !== "Function" && e.constructor.name !== "Object" : !1, Q = (e) => Me(e) && !ie(e) && !Ne(e) && !De(e);
271
+ function z(e) {
270
272
  let t;
271
- if (te(e))
273
+ if (ie(e))
272
274
  t = e;
273
275
  else {
274
- const i = de(e), o = i == null ? void 0 : i.rgb();
276
+ const i = le(e), o = i == null ? void 0 : i.rgb();
275
277
  t = [(o == null ? void 0 : o.r) || 0, (o == null ? void 0 : o.g) || 0, (o == null ? void 0 : o.b) || 0, (i == null ? void 0 : i.opacity) ?? 1];
276
278
  }
277
279
  return [
@@ -281,10 +283,10 @@ function k(e) {
281
283
  t[3]
282
284
  ];
283
285
  }
284
- function Me(e, t, i) {
286
+ function Oe(e, t, i) {
285
287
  return 0.2126 * e + 0.7152 * t + 0.0722 * i;
286
288
  }
287
- function N(e, t, i = 0, o = 0, s, n) {
289
+ function y(e, t, i = 0, o = 0, s, n) {
288
290
  return e.readPixelsToArrayWebGL(t, {
289
291
  sourceX: i,
290
292
  sourceY: o,
@@ -295,7 +297,7 @@ function N(e, t, i = 0, o = 0, s, n) {
295
297
  function $(e, t) {
296
298
  switch (e.info.type) {
297
299
  case "webgl": {
298
- const i = e.gl.getParameter(K.ALIASED_POINT_SIZE_RANGE);
300
+ const i = e.gl.getParameter(L.ALIASED_POINT_SIZE_RANGE);
299
301
  return ((i == null ? void 0 : i[1]) ?? H) / t;
300
302
  }
301
303
  case "webgpu":
@@ -304,14 +306,14 @@ function $(e, t) {
304
306
  return H / t;
305
307
  }
306
308
  }
307
- function Oe(e, t, i) {
309
+ function Ue(e, t, i) {
308
310
  return Math.min(Math.max(e, t), i);
309
311
  }
310
- function D(e) {
312
+ function M(e) {
311
313
  return e != null && !Number.isNaN(e);
312
314
  }
313
- function Ue(e, t) {
314
- return le.sanitize(e, {
315
+ function Be(e, t) {
316
+ return ce.sanitize(e, {
315
317
  // Default configuration: allow common safe HTML elements and attributes
316
318
  ALLOWED_TAGS: ["a", "b", "i", "em", "strong", "span", "div", "p", "br"],
317
319
  ALLOWED_ATTR: ["href", "target", "class", "id", "style"],
@@ -319,9 +321,9 @@ function Ue(e, t) {
319
321
  ...t
320
322
  });
321
323
  }
322
- class Be {
324
+ class ke {
323
325
  constructor() {
324
- this.enableSimulation = h.enableSimulation, this.backgroundColor = ee, this.spaceSize = h.spaceSize, this.pointColor = _e, this.pointDefaultColor = void 0, this.pointGreyoutOpacity = Te, this.pointGreyoutColor = Y, this.pointSize = Ce, this.pointDefaultSize = void 0, this.pointOpacity = ge, this.pointSizeScale = h.pointSizeScale, this.hoveredPointCursor = h.hoveredPointCursor, this.hoveredLinkCursor = h.hoveredLinkCursor, this.renderHoveredPointRing = h.renderHoveredPointRing, this.hoveredPointRingColor = h.hoveredPointRingColor, this.focusedPointRingColor = h.focusedPointRingColor, this.focusedPointIndex = h.focusedPointIndex, this.linkColor = Re, this.linkDefaultColor = void 0, this.linkOpacity = xe, this.linkGreyoutOpacity = Pe, this.linkWidth = Ae, this.linkDefaultWidth = void 0, this.linkWidthScale = h.linkWidthScale, this.hoveredLinkColor = h.hoveredLinkColor, this.hoveredLinkWidthIncrease = h.hoveredLinkWidthIncrease, this.renderLinks = h.renderLinks, this.curvedLinks = h.curvedLinks, this.curvedLinkSegments = h.curvedLinkSegments, this.curvedLinkWeight = h.curvedLinkWeight, this.curvedLinkControlPointDistance = h.curvedLinkControlPointDistance, this.linkArrows = h.linkArrows, this.linkDefaultArrows = void 0, this.linkArrowsSizeScale = h.linkArrowsSizeScale, this.scaleLinksOnZoom = h.scaleLinksOnZoom, this.linkVisibilityDistanceRange = h.linkVisibilityDistanceRange, this.linkVisibilityMinTransparency = h.linkVisibilityMinTransparency, this.simulationDecay = h.simulation.decay, this.simulationGravity = h.simulation.gravity, this.simulationCenter = h.simulation.center, this.simulationRepulsion = h.simulation.repulsion, this.simulationRepulsionTheta = h.simulation.repulsionTheta, this.simulationLinkSpring = h.simulation.linkSpring, this.simulationLinkDistance = h.simulation.linkDistance, this.simulationLinkDistRandomVariationRange = h.simulation.linkDistRandomVariationRange, this.simulationRepulsionFromMouse = h.simulation.repulsionFromMouse, this.enableRightClickRepulsion = h.enableRightClickRepulsion, this.simulationFriction = h.simulation.friction, this.simulationCluster = h.simulation.cluster, this.onSimulationStart = void 0, this.onSimulationTick = void 0, this.onSimulationEnd = void 0, this.onSimulationPause = void 0, this.onSimulationRestart = void 0, this.onSimulationUnpause = void 0, this.onClick = void 0, this.onPointClick = void 0, this.onLinkClick = void 0, this.onBackgroundClick = void 0, this.onContextMenu = void 0, this.onPointContextMenu = void 0, this.onLinkContextMenu = void 0, this.onBackgroundContextMenu = void 0, this.onMouseMove = void 0, this.onPointMouseOver = void 0, this.onPointMouseOut = void 0, this.onLinkMouseOver = void 0, this.onLinkMouseOut = void 0, this.onZoomStart = void 0, this.onZoom = void 0, this.onZoomEnd = void 0, this.onDragStart = void 0, this.onDrag = void 0, this.onDragEnd = void 0, this.showFPSMonitor = h.showFPSMonitor, this.pixelRatio = h.pixelRatio, this.scalePointsOnZoom = h.scalePointsOnZoom, this.initialZoomLevel = void 0, this.enableZoom = h.enableZoom, this.enableSimulationDuringZoom = h.enableSimulationDuringZoom, this.enableDrag = h.enableDrag, this.fitViewOnInit = h.fitViewOnInit, this.fitViewDelay = h.fitViewDelay, this.fitViewPadding = h.fitViewPadding, this.fitViewDuration = h.fitViewDuration, this.fitViewByPointsInRect = void 0, this.fitViewByPointIndices = void 0, this.randomSeed = void 0, this.pointSamplingDistance = h.pointSamplingDistance, this.attribution = h.attribution, this.rescalePositions = h.rescalePositions;
326
+ this.enableSimulation = f.enableSimulation, this.backgroundColor = te, this.spaceSize = f.spaceSize, this.pointDefaultColor = Te, this.pointGreyoutOpacity = ge, this.pointGreyoutColor = Y, this.pointDefaultSize = Pe, this.pointOpacity = Ce, this.pointSizeScale = f.pointSizeScale, this.hoveredPointCursor = f.hoveredPointCursor, this.hoveredLinkCursor = f.hoveredLinkCursor, this.renderHoveredPointRing = f.renderHoveredPointRing, this.hoveredPointRingColor = f.hoveredPointRingColor, this.focusedPointRingColor = f.focusedPointRingColor, this.focusedPointIndex = f.focusedPointIndex, this.linkDefaultColor = Re, this.linkOpacity = ve, this.linkGreyoutOpacity = xe, this.linkDefaultWidth = Ae, this.linkWidthScale = f.linkWidthScale, this.hoveredLinkColor = f.hoveredLinkColor, this.hoveredLinkWidthIncrease = f.hoveredLinkWidthIncrease, this.renderLinks = f.renderLinks, this.curvedLinks = f.curvedLinks, this.curvedLinkSegments = f.curvedLinkSegments, this.curvedLinkWeight = f.curvedLinkWeight, this.curvedLinkControlPointDistance = f.curvedLinkControlPointDistance, this.linkDefaultArrows = f.linkArrows, this.linkArrowsSizeScale = f.linkArrowsSizeScale, this.scaleLinksOnZoom = f.scaleLinksOnZoom, this.linkVisibilityDistanceRange = f.linkVisibilityDistanceRange, this.linkVisibilityMinTransparency = f.linkVisibilityMinTransparency, this.simulationDecay = f.simulation.decay, this.simulationGravity = f.simulation.gravity, this.simulationCenter = f.simulation.center, this.simulationRepulsion = f.simulation.repulsion, this.simulationRepulsionTheta = f.simulation.repulsionTheta, this.simulationLinkSpring = f.simulation.linkSpring, this.simulationLinkDistance = f.simulation.linkDistance, this.simulationLinkDistRandomVariationRange = f.simulation.linkDistRandomVariationRange, this.simulationRepulsionFromMouse = f.simulation.repulsionFromMouse, this.enableRightClickRepulsion = f.enableRightClickRepulsion, this.simulationFriction = f.simulation.friction, this.simulationCluster = f.simulation.cluster, this.onSimulationStart = void 0, this.onSimulationTick = void 0, this.onSimulationEnd = void 0, this.onSimulationPause = void 0, this.onSimulationUnpause = void 0, this.onClick = void 0, this.onPointClick = void 0, this.onLinkClick = void 0, this.onBackgroundClick = void 0, this.onContextMenu = void 0, this.onPointContextMenu = void 0, this.onLinkContextMenu = void 0, this.onBackgroundContextMenu = void 0, this.onMouseMove = void 0, this.onPointMouseOver = void 0, this.onPointMouseOut = void 0, this.onLinkMouseOver = void 0, this.onLinkMouseOut = void 0, this.onZoomStart = void 0, this.onZoom = void 0, this.onZoomEnd = void 0, this.onDragStart = void 0, this.onDrag = void 0, this.onDragEnd = void 0, this.showFPSMonitor = f.showFPSMonitor, this.pixelRatio = f.pixelRatio, this.scalePointsOnZoom = f.scalePointsOnZoom, this.initialZoomLevel = void 0, this.enableZoom = f.enableZoom, this.enableSimulationDuringZoom = f.enableSimulationDuringZoom, this.enableDrag = f.enableDrag, this.fitViewOnInit = f.fitViewOnInit, this.fitViewDelay = f.fitViewDelay, this.fitViewPadding = f.fitViewPadding, this.fitViewDuration = f.fitViewDuration, this.fitViewByPointsInRect = void 0, this.fitViewByPointIndices = void 0, this.randomSeed = void 0, this.pointSamplingDistance = f.pointSamplingDistance, this.linkSamplingDistance = f.linkSamplingDistance, this.attribution = f.attribution, this.rescalePositions = f.rescalePositions;
325
327
  }
326
328
  init(t) {
327
329
  Object.keys(t).forEach((i) => {
@@ -376,7 +378,7 @@ void main() {
376
378
  gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
377
379
  gl_PointSize = 1.0;
378
380
  }
379
- `, ke = `#version 300 es
381
+ `, we = `#version 300 es
380
382
  precision highp float;
381
383
 
382
384
  uniform sampler2D positionsTexture;
@@ -422,11 +424,11 @@ function X(e) {
422
424
  }
423
425
  return t;
424
426
  }
425
- function T(e, t) {
426
- const i = ne.getInfo(e);
427
+ function g(e, t) {
428
+ const i = re.getInfo(e);
427
429
  return t * (i.bytesPerPixel ?? 0);
428
430
  }
429
- const M = `#version 300 es
431
+ const D = `#version 300 es
430
432
  #ifdef GL_ES
431
433
  precision highp float;
432
434
  #endif
@@ -440,7 +442,7 @@ void main() {
440
442
  gl_Position = vec4(vertexCoord, 0, 1);
441
443
  }
442
444
  `;
443
- class we extends w {
445
+ class Ve extends w {
444
446
  create() {
445
447
  var s;
446
448
  const { device: t, store: i } = this, { pointsTextureSize: o } = i;
@@ -452,7 +454,7 @@ class we extends w {
452
454
  usage: C.SAMPLE | C.RENDER | C.COPY_DST
453
455
  })), this.centermassTexture.copyImageData({
454
456
  data: new Float32Array(4).fill(0),
455
- bytesPerRow: T("rgba32float", 1),
457
+ bytesPerRow: g("rgba32float", 1),
456
458
  mipLevel: 0,
457
459
  x: 0,
458
460
  y: 0
@@ -490,7 +492,7 @@ class we extends w {
490
492
  alpha: "f32"
491
493
  }
492
494
  }
493
- })), this.calculateCentermassCommand || (this.calculateCentermassCommand = new A(t, {
495
+ })), this.calculateCentermassCommand || (this.calculateCentermassCommand = new v(t, {
494
496
  fs: be,
495
497
  vs: ze,
496
498
  topology: "point-list",
@@ -520,9 +522,9 @@ class we extends w {
520
522
  depthWriteEnabled: !1,
521
523
  depthCompare: "always"
522
524
  }
523
- })), this.calculateCentermassCommand.setVertexCount(this.data.pointsNumber ?? 0), this.runCommand || (this.runCommand = new A(t, {
524
- fs: ke,
525
- vs: M,
525
+ })), this.calculateCentermassCommand.setVertexCount(this.data.pointsNumber ?? 0), this.runCommand || (this.runCommand = new v(t, {
526
+ fs: we,
527
+ vs: D,
526
528
  topology: "triangle-strip",
527
529
  vertexCount: 4,
528
530
  attributes: {
@@ -583,7 +585,7 @@ class we extends w {
583
585
  (t = this.calculateCentermassCommand) == null || t.destroy(), this.calculateCentermassCommand = void 0, (i = this.runCommand) == null || i.destroy(), this.runCommand = void 0, this.centermassFbo && !this.centermassFbo.destroyed && this.centermassFbo.destroy(), this.centermassFbo = void 0, this.centermassTexture && !this.centermassTexture.destroyed && this.centermassTexture.destroy(), this.centermassTexture = void 0, (o = this.calculateUniformStore) == null || o.destroy(), this.calculateUniformStore = void 0, (s = this.forceUniformStore) == null || s.destroy(), this.forceUniformStore = void 0, this.pointIndices && !this.pointIndices.destroyed && this.pointIndices.destroy(), this.pointIndices = void 0, this.forceVertexCoordBuffer && !this.forceVertexCoordBuffer.destroyed && this.forceVertexCoordBuffer.destroy(), this.forceVertexCoordBuffer = void 0, this.previousPointsTextureSize = void 0;
584
586
  }
585
587
  }
586
- const Ve = `#version 300 es
588
+ const He = `#version 300 es
587
589
  precision highp float;
588
590
 
589
591
  uniform sampler2D positionsTexture;
@@ -623,7 +625,7 @@ void main() {
623
625
 
624
626
  fragColor = velocity;
625
627
  }`;
626
- class He extends w {
628
+ class Xe extends w {
627
629
  initPrograms() {
628
630
  const { device: t, points: i, store: o } = this;
629
631
  !i || !o.pointsTextureSize || (this.vertexCoordBuffer || (this.vertexCoordBuffer = t.createBuffer({
@@ -636,9 +638,9 @@ class He extends w {
636
638
  alpha: "f32"
637
639
  }
638
640
  }
639
- })), this.runCommand || (this.runCommand = new A(t, {
640
- fs: Ve,
641
- vs: M,
641
+ })), this.runCommand || (this.runCommand = new v(t, {
642
+ fs: He,
643
+ vs: D,
642
644
  topology: "triangle-strip",
643
645
  vertexCount: 4,
644
646
  attributes: {
@@ -689,7 +691,7 @@ class He extends w {
689
691
  (t = this.runCommand) == null || t.destroy(), this.runCommand = void 0, (i = this.uniformStore) == null || i.destroy(), this.uniformStore = void 0, this.vertexCoordBuffer && !this.vertexCoordBuffer.destroyed && this.vertexCoordBuffer.destroy(), this.vertexCoordBuffer = void 0;
690
692
  }
691
693
  }
692
- function Xe(e) {
694
+ function We(e) {
693
695
  return `#version 300 es
694
696
  precision highp float;
695
697
 
@@ -778,13 +780,13 @@ void main() {
778
780
  }
779
781
  `;
780
782
  }
781
- function g(e, t) {
783
+ function T(e, t) {
782
784
  return !e || e.length !== 2 ? t : [e[0], e[1]];
783
785
  }
784
- function I(e, t) {
786
+ function m(e, t) {
785
787
  return !e || e.length !== 4 ? t : [e[0], e[1], e[2], e[3]];
786
788
  }
787
- var L = /* @__PURE__ */ ((e) => (e.OUTGOING = "outgoing", e.INCOMING = "incoming", e))(L || {});
789
+ var Z = /* @__PURE__ */ ((e) => (e.OUTGOING = "outgoing", e.INCOMING = "incoming", e))(Z || {});
788
790
  class J extends w {
789
791
  constructor() {
790
792
  super(...arguments), this.linkFirstIndicesAndAmount = new Float32Array(), this.indices = new Float32Array(), this.maxPointDegree = 0;
@@ -794,19 +796,19 @@ class J extends w {
794
796
  const { device: i, store: { pointsTextureSize: o, linksTextureSize: s }, data: n } = this;
795
797
  if (!o || !s) return;
796
798
  this.linkFirstIndicesAndAmount = new Float32Array(o * o * 4), this.indices = new Float32Array(s * s * 4);
797
- const r = new Float32Array(s * s * 4), a = new Float32Array(s * s * 4), l = t === "incoming" ? n.sourceIndexToTargetIndices : n.targetIndexToSourceIndices;
799
+ const r = new Float32Array(s * s * 4), a = new Float32Array(s * s * 4), d = t === "incoming" ? n.sourceIndexToTargetIndices : n.targetIndexToSourceIndices;
798
800
  this.maxPointDegree = 0;
799
- let d = 0;
800
- l == null || l.forEach((u, _) => {
801
- u && (this.linkFirstIndicesAndAmount[_ * 4 + 0] = d % s, this.linkFirstIndicesAndAmount[_ * 4 + 1] = Math.floor(d / s), this.linkFirstIndicesAndAmount[_ * 4 + 2] = u.length ?? 0, u.forEach(([P, m]) => {
802
- var O, B, b;
803
- this.indices[d * 4 + 0] = P % o, this.indices[d * 4 + 1] = Math.floor(P / o);
804
- const R = ((O = n.degree) == null ? void 0 : O[P]) ?? 0, v = ((B = n.degree) == null ? void 0 : B[_]) ?? 0, y = R + v, U = y !== 0 ? R / y : 0.5, E = Math.min(R, v);
805
- let F = ((b = n.linkStrength) == null ? void 0 : b[m]) ?? 1 / Math.max(E, 1);
806
- F = Math.sqrt(F), r[d * 4 + 0] = U, r[d * 4 + 1] = F, a[d * 4] = this.store.getRandomFloat(0, 1), d += 1;
801
+ let l = 0;
802
+ d == null || d.forEach((u, _) => {
803
+ u && (this.linkFirstIndicesAndAmount[_ * 4 + 0] = l % s, this.linkFirstIndicesAndAmount[_ * 4 + 1] = Math.floor(l / s), this.linkFirstIndicesAndAmount[_ * 4 + 2] = u.length ?? 0, u.forEach(([R, I]) => {
804
+ var O, B, k;
805
+ this.indices[l * 4 + 0] = R % o, this.indices[l * 4 + 1] = Math.floor(R / o);
806
+ const P = ((O = n.degree) == null ? void 0 : O[R]) ?? 0, A = ((B = n.degree) == null ? void 0 : B[_]) ?? 0, F = P + A, U = F !== 0 ? P / F : 0.5, E = Math.min(P, A);
807
+ let N = ((k = n.linkStrength) == null ? void 0 : k[I]) ?? 1 / Math.max(E, 1);
808
+ N = Math.sqrt(N), r[l * 4 + 0] = U, r[l * 4 + 1] = N, a[l * 4] = this.store.getRandomFloat(0, 1), l += 1;
807
809
  }), this.maxPointDegree = Math.max(this.maxPointDegree, u.length ?? 0));
808
810
  });
809
- const c = !this.linkFirstIndicesAndAmountTexture || this.linkFirstIndicesAndAmountTexture.width !== o || this.linkFirstIndicesAndAmountTexture.height !== o, f = !this.indicesTexture || this.indicesTexture.width !== s || this.indicesTexture.height !== s;
811
+ const c = !this.linkFirstIndicesAndAmountTexture || this.linkFirstIndicesAndAmountTexture.width !== o || this.linkFirstIndicesAndAmountTexture.height !== o, h = !this.indicesTexture || this.indicesTexture.width !== s || this.indicesTexture.height !== s;
810
812
  c && (this.linkFirstIndicesAndAmountTexture && !this.linkFirstIndicesAndAmountTexture.destroyed && this.linkFirstIndicesAndAmountTexture.destroy(), this.linkFirstIndicesAndAmountTexture = i.createTexture({
811
813
  width: o,
812
814
  height: o,
@@ -814,11 +816,11 @@ class J extends w {
814
816
  usage: C.SAMPLE | C.COPY_DST
815
817
  })), this.linkFirstIndicesAndAmountTexture.copyImageData({
816
818
  data: this.linkFirstIndicesAndAmount,
817
- bytesPerRow: T("rgba32float", o),
819
+ bytesPerRow: g("rgba32float", o),
818
820
  mipLevel: 0,
819
821
  x: 0,
820
822
  y: 0
821
- }), f && (this.indicesTexture && !this.indicesTexture.destroyed && this.indicesTexture.destroy(), this.biasAndStrengthTexture && !this.biasAndStrengthTexture.destroyed && this.biasAndStrengthTexture.destroy(), this.randomDistanceTexture && !this.randomDistanceTexture.destroyed && this.randomDistanceTexture.destroy(), this.indicesTexture = i.createTexture({
823
+ }), h && (this.indicesTexture && !this.indicesTexture.destroyed && this.indicesTexture.destroy(), this.biasAndStrengthTexture && !this.biasAndStrengthTexture.destroyed && this.biasAndStrengthTexture.destroy(), this.randomDistanceTexture && !this.randomDistanceTexture.destroyed && this.randomDistanceTexture.destroy(), this.indicesTexture = i.createTexture({
822
824
  width: s,
823
825
  height: s,
824
826
  format: "rgba32float",
@@ -835,19 +837,19 @@ class J extends w {
835
837
  usage: C.SAMPLE | C.COPY_DST
836
838
  })), this.indicesTexture.copyImageData({
837
839
  data: this.indices,
838
- bytesPerRow: T("rgba32float", s),
840
+ bytesPerRow: g("rgba32float", s),
839
841
  mipLevel: 0,
840
842
  x: 0,
841
843
  y: 0
842
844
  }), this.biasAndStrengthTexture.copyImageData({
843
845
  data: r,
844
- bytesPerRow: T("rgba32float", s),
846
+ bytesPerRow: g("rgba32float", s),
845
847
  mipLevel: 0,
846
848
  x: 0,
847
849
  y: 0
848
850
  }), this.randomDistanceTexture.copyImageData({
849
851
  data: a,
850
- bytesPerRow: T("rgba32float", s),
852
+ bytesPerRow: g("rgba32float", s),
851
853
  mipLevel: 0,
852
854
  x: 0,
853
855
  y: 0
@@ -868,9 +870,9 @@ class J extends w {
868
870
  alpha: "f32"
869
871
  }
870
872
  }
871
- })), this.runCommand || (this.runCommand = new A(t, {
872
- fs: Xe(this.maxPointDegree),
873
- vs: M,
873
+ })), this.runCommand || (this.runCommand = new v(t, {
874
+ fs: We(this.maxPointDegree),
875
+ vs: D,
874
876
  topology: "triangle-strip",
875
877
  vertexCount: 4,
876
878
  attributes: {
@@ -902,7 +904,7 @@ class J extends w {
902
904
  forceLinkUniforms: {
903
905
  linkSpring: this.config.simulationLinkSpring ?? 0,
904
906
  linkDistance: this.config.simulationLinkDistance ?? 0,
905
- linkDistRandomVariationRange: g(this.config.simulationLinkDistRandomVariationRange, [0, 0]),
907
+ linkDistRandomVariationRange: T(this.config.simulationLinkDistRandomVariationRange, [0, 0]),
906
908
  pointsTextureSize: i.pointsTextureSize,
907
909
  linksTextureSize: i.linksTextureSize,
908
910
  alpha: i.alpha
@@ -929,7 +931,7 @@ class J extends w {
929
931
  (t = this.runCommand) == null || t.destroy(), this.runCommand = void 0, this.linkFirstIndicesAndAmountTexture && !this.linkFirstIndicesAndAmountTexture.destroyed && this.linkFirstIndicesAndAmountTexture.destroy(), this.linkFirstIndicesAndAmountTexture = void 0, this.indicesTexture && !this.indicesTexture.destroyed && this.indicesTexture.destroy(), this.indicesTexture = void 0, this.biasAndStrengthTexture && !this.biasAndStrengthTexture.destroyed && this.biasAndStrengthTexture.destroy(), this.biasAndStrengthTexture = void 0, this.randomDistanceTexture && !this.randomDistanceTexture.destroyed && this.randomDistanceTexture.destroy(), this.randomDistanceTexture = void 0, (i = this.uniformStore) == null || i.destroy(), this.uniformStore = void 0, this.vertexCoordBuffer && !this.vertexCoordBuffer.destroyed && this.vertexCoordBuffer.destroy(), this.vertexCoordBuffer = void 0;
930
932
  }
931
933
  }
932
- const We = `#version 300 es
934
+ const Ye = `#version 300 es
933
935
  precision highp float;
934
936
 
935
937
  in vec4 vColor;
@@ -937,7 +939,7 @@ out vec4 fragColor;
937
939
 
938
940
  void main() {
939
941
  fragColor = vColor;
940
- }`, Ye = `#version 300 es
942
+ }`, Le = `#version 300 es
941
943
  precision highp float;
942
944
 
943
945
  uniform sampler2D positionsTexture;
@@ -1171,7 +1173,7 @@ void main() {
1171
1173
 
1172
1174
  fragColor = velocity;
1173
1175
  }`;
1174
- class Le extends w {
1176
+ class je extends w {
1175
1177
  constructor() {
1176
1178
  super(...arguments), this.levels = 0, this.levelTargets = /* @__PURE__ */ new Map();
1177
1179
  }
@@ -1181,40 +1183,40 @@ class Le extends w {
1181
1183
  if (!i.pointsTextureSize) return;
1182
1184
  this.levels = Math.log2(i.adjustedSpaceSize);
1183
1185
  for (let a = 0; a < this.levels; a += 1) {
1184
- const l = Math.pow(2, a + 1), d = this.levelTargets.get(a);
1185
- if (d && d.texture.width === l && d.texture.height === l) {
1186
- d.texture.copyImageData({
1187
- data: new Float32Array(l * l * 4).fill(0),
1188
- bytesPerRow: T("rgba32float", l),
1186
+ const d = Math.pow(2, a + 1), l = this.levelTargets.get(a);
1187
+ if (l && l.texture.width === d && l.texture.height === d) {
1188
+ l.texture.copyImageData({
1189
+ data: new Float32Array(d * d * 4).fill(0),
1190
+ bytesPerRow: g("rgba32float", d),
1189
1191
  mipLevel: 0,
1190
1192
  x: 0,
1191
1193
  y: 0
1192
1194
  });
1193
1195
  continue;
1194
1196
  }
1195
- d && (d.fbo.destroyed || d.fbo.destroy(), d.texture.destroyed || d.texture.destroy());
1197
+ l && (l.fbo.destroyed || l.fbo.destroy(), l.texture.destroyed || l.texture.destroy());
1196
1198
  const c = t.createTexture({
1197
- width: l,
1198
- height: l,
1199
+ width: d,
1200
+ height: d,
1199
1201
  format: "rgba32float",
1200
1202
  usage: C.SAMPLE | C.RENDER | C.COPY_DST
1201
1203
  });
1202
1204
  c.copyImageData({
1203
- data: new Float32Array(l * l * 4).fill(0),
1204
- bytesPerRow: T("rgba32float", l),
1205
+ data: new Float32Array(d * d * 4).fill(0),
1206
+ bytesPerRow: g("rgba32float", d),
1205
1207
  mipLevel: 0,
1206
1208
  x: 0,
1207
1209
  y: 0
1208
1210
  });
1209
- const f = t.createFramebuffer({
1210
- width: l,
1211
- height: l,
1211
+ const h = t.createFramebuffer({
1212
+ width: d,
1213
+ height: d,
1212
1214
  colorAttachments: [c]
1213
1215
  });
1214
- this.levelTargets.set(a, { texture: c, fbo: f });
1216
+ this.levelTargets.set(a, { texture: c, fbo: h });
1215
1217
  }
1216
- for (const [a, l] of Array.from(this.levelTargets.entries()))
1217
- a >= this.levels && (l.fbo.destroyed || l.fbo.destroy(), l.texture.destroyed || l.texture.destroy(), this.levelTargets.delete(a));
1218
+ for (const [a, d] of Array.from(this.levelTargets.entries()))
1219
+ a >= this.levels && (d.fbo.destroyed || d.fbo.destroy(), d.texture.destroyed || d.texture.destroy(), this.levelTargets.delete(a));
1218
1220
  const o = i.pointsTextureSize * i.pointsTextureSize, s = new Float32Array(o * 4);
1219
1221
  for (let a = 0; a < o; ++a)
1220
1222
  s[a * 4] = i.getRandomFloat(-1, 1) * 1e-5, s[a * 4 + 1] = i.getRandomFloat(-1, 1) * 1e-5;
@@ -1225,7 +1227,7 @@ class Le extends w {
1225
1227
  usage: C.SAMPLE | C.COPY_DST
1226
1228
  })), this.randomValuesTexture.copyImageData({
1227
1229
  data: s,
1228
- bytesPerRow: T("rgba32float", i.pointsTextureSize),
1230
+ bytesPerRow: g("rgba32float", i.pointsTextureSize),
1229
1231
  mipLevel: 0,
1230
1232
  x: 0,
1231
1233
  y: 0
@@ -1256,9 +1258,9 @@ class Le extends w {
1256
1258
  cellSize: 0
1257
1259
  }
1258
1260
  }
1259
- })), this.calculateLevelsCommand || (this.calculateLevelsCommand = new A(t, {
1260
- fs: We,
1261
- vs: Ye,
1261
+ })), this.calculateLevelsCommand || (this.calculateLevelsCommand = new v(t, {
1262
+ fs: Ye,
1263
+ vs: Le,
1262
1264
  topology: "point-list",
1263
1265
  vertexCount: o.pointsNumber,
1264
1266
  attributes: {
@@ -1310,9 +1312,9 @@ class Le extends w {
1310
1312
  }
1311
1313
  })), this.forceVertexCoordBuffer || (this.forceVertexCoordBuffer = t.createBuffer({
1312
1314
  data: new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1])
1313
- })), this.forceCommand || (this.forceCommand = new A(t, {
1315
+ })), this.forceCommand || (this.forceCommand = new v(t, {
1314
1316
  fs: Ke,
1315
- vs: M,
1317
+ vs: D,
1316
1318
  topology: "triangle-strip",
1317
1319
  vertexCount: 4,
1318
1320
  attributes: {
@@ -1354,9 +1356,9 @@ class Le extends w {
1354
1356
  repulsion: this.config.simulationRepulsion ?? 0
1355
1357
  }
1356
1358
  }
1357
- })), this.forceFromItsOwnCentermassCommand || (this.forceFromItsOwnCentermassCommand = new A(t, {
1359
+ })), this.forceFromItsOwnCentermassCommand || (this.forceFromItsOwnCentermassCommand = new v(t, {
1358
1360
  fs: Ze,
1359
- vs: M,
1361
+ vs: D,
1360
1362
  topology: "triangle-strip",
1361
1363
  vertexCount: 4,
1362
1364
  attributes: {
@@ -1410,21 +1412,21 @@ class Le extends w {
1410
1412
  for (let n = 0; n < this.levels; n += 1) {
1411
1413
  const r = this.levelTargets.get(n);
1412
1414
  if (!r || r.fbo.destroyed || r.texture.destroyed) continue;
1413
- const a = Math.pow(2, n + 1), l = (i.adjustedSpaceSize ?? 0) / a;
1415
+ const a = Math.pow(2, n + 1), d = (i.adjustedSpaceSize ?? 0) / a;
1414
1416
  this.calculateLevelsUniformStore.setUniforms({
1415
1417
  calculateLevelsUniforms: {
1416
1418
  pointsTextureSize: i.pointsTextureSize ?? 0,
1417
1419
  levelTextureSize: a,
1418
- cellSize: l
1420
+ cellSize: d
1419
1421
  }
1420
1422
  }), this.calculateLevelsCommand.setVertexCount(o.pointsNumber), this.calculateLevelsCommand.setBindings({
1421
1423
  positionsTexture: s.previousPositionTexture
1422
1424
  });
1423
- const d = t.beginRenderPass({
1425
+ const l = t.beginRenderPass({
1424
1426
  framebuffer: r.fbo,
1425
1427
  clearColor: [0, 0, 0, 0]
1426
1428
  });
1427
- this.calculateLevelsCommand.draw(d), d.end();
1429
+ this.calculateLevelsCommand.draw(l), l.end();
1428
1430
  }
1429
1431
  }
1430
1432
  drawForces() {
@@ -1466,7 +1468,7 @@ class Le extends w {
1466
1468
  s.end();
1467
1469
  }
1468
1470
  }
1469
- const je = `#version 300 es
1471
+ const qe = `#version 300 es
1470
1472
  precision highp float;
1471
1473
 
1472
1474
  uniform sampler2D positionsTexture;
@@ -1501,7 +1503,7 @@ void main() {
1501
1503
 
1502
1504
  fragColor = velocity;
1503
1505
  }`;
1504
- class qe extends w {
1506
+ class Qe extends w {
1505
1507
  initPrograms() {
1506
1508
  const { device: t, points: i } = this;
1507
1509
  i && (this.vertexCoordBuffer || (this.vertexCoordBuffer = t.createBuffer({
@@ -1513,9 +1515,9 @@ class qe extends w {
1513
1515
  mousePos: "vec2<f32>"
1514
1516
  }
1515
1517
  }
1516
- })), this.runCommand || (this.runCommand = new A(t, {
1517
- fs: je,
1518
- vs: M,
1518
+ })), this.runCommand || (this.runCommand = new v(t, {
1519
+ fs: qe,
1520
+ vs: D,
1519
1521
  topology: "triangle-strip",
1520
1522
  vertexCount: 4,
1521
1523
  attributes: {
@@ -1545,7 +1547,7 @@ class qe extends w {
1545
1547
  this.uniformStore.setUniforms({
1546
1548
  forceMouseUniforms: {
1547
1549
  repulsion: this.config.simulationRepulsionFromMouse ?? 0,
1548
- mousePos: g(o.mousePosition, [0, 0])
1550
+ mousePos: T(o.mousePosition, [0, 0])
1549
1551
  }
1550
1552
  }), this.runCommand.setBindings({
1551
1553
  positionsTexture: i.previousPositionTexture
@@ -1565,7 +1567,7 @@ class qe extends w {
1565
1567
  (t = this.runCommand) == null || t.destroy(), this.runCommand = void 0, (i = this.uniformStore) == null || i.destroy(), this.uniformStore = void 0, this.vertexCoordBuffer && !this.vertexCoordBuffer.destroyed && this.vertexCoordBuffer.destroy(), this.vertexCoordBuffer = void 0;
1566
1568
  }
1567
1569
  }
1568
- const Qe = `#version 300 es
1570
+ const $e = `#version 300 es
1569
1571
  #ifdef GL_ES
1570
1572
  precision highp float;
1571
1573
  #endif
@@ -1576,7 +1578,7 @@ out vec4 fragColor;
1576
1578
 
1577
1579
  void main() {
1578
1580
  fragColor = rgba;
1579
- }`, $e = `#version 300 es
1581
+ }`, Je = `#version 300 es
1580
1582
  #ifdef GL_ES
1581
1583
  precision highp float;
1582
1584
  #endif
@@ -1614,7 +1616,7 @@ void main() {
1614
1616
  gl_Position = vec4(xy, 0.0, 1.0);
1615
1617
  gl_PointSize = 1.0;
1616
1618
  }
1617
- `, Je = `#version 300 es
1619
+ `, Ge = `#version 300 es
1618
1620
  #ifdef GL_ES
1619
1621
  precision highp float;
1620
1622
  #endif
@@ -1669,19 +1671,19 @@ void main() {
1669
1671
 
1670
1672
  fragColor = velocity;
1671
1673
  }`;
1672
- class Ge extends w {
1674
+ class et extends w {
1673
1675
  create() {
1674
- var f, p;
1676
+ var h, p;
1675
1677
  const { device: t, store: i, data: o } = this, { pointsTextureSize: s } = i;
1676
1678
  if (o.pointsNumber === void 0 || !o.pointClusters && !o.clusterPositions) return;
1677
1679
  this.clusterCount = (o.pointClusters ?? []).reduce((u, _) => _ === void 0 || _ < 0 ? u : Math.max(u, _), 0) + 1, this.clustersTextureSize = Math.ceil(Math.sqrt(this.clusterCount));
1678
- const n = this.previousPointsTextureSize !== s || this.previousClustersTextureSize !== this.clustersTextureSize || this.previousClusterCount !== this.clusterCount, r = s * s * 4, a = this.clustersTextureSize * this.clustersTextureSize * 4, l = new Float32Array(r), d = new Float32Array(a).fill(-1), c = new Float32Array(r).fill(1);
1680
+ const n = this.previousPointsTextureSize !== s || this.previousClustersTextureSize !== this.clustersTextureSize || this.previousClusterCount !== this.clusterCount, r = s * s * 4, a = this.clustersTextureSize * this.clustersTextureSize * 4, d = new Float32Array(r), l = new Float32Array(a).fill(-1), c = new Float32Array(r).fill(1);
1679
1681
  if (o.clusterPositions)
1680
1682
  for (let u = 0; u < this.clusterCount; ++u)
1681
- d[u * 4 + 0] = o.clusterPositions[u * 2 + 0] ?? -1, d[u * 4 + 1] = o.clusterPositions[u * 2 + 1] ?? -1;
1683
+ l[u * 4 + 0] = o.clusterPositions[u * 2 + 0] ?? -1, l[u * 4 + 1] = o.clusterPositions[u * 2 + 1] ?? -1;
1682
1684
  for (let u = 0; u < o.pointsNumber; ++u) {
1683
- const _ = (f = o.pointClusters) == null ? void 0 : f[u];
1684
- _ === void 0 ? (l[u * 4 + 0] = -1, l[u * 4 + 1] = -1) : (l[u * 4 + 0] = _ % this.clustersTextureSize, l[u * 4 + 1] = Math.floor(_ / this.clustersTextureSize)), o.clusterStrength && (c[u * 4 + 0] = o.clusterStrength[u] ?? 1);
1685
+ const _ = (h = o.pointClusters) == null ? void 0 : h[u];
1686
+ _ === void 0 ? (d[u * 4 + 0] = -1, d[u * 4 + 1] = -1) : (d[u * 4 + 0] = _ % this.clustersTextureSize, d[u * 4 + 1] = Math.floor(_ / this.clustersTextureSize)), o.clusterStrength && (c[u * 4 + 0] = o.clusterStrength[u] ?? 1);
1685
1687
  }
1686
1688
  if (!this.clusterTexture || n ? (this.clusterTexture && !this.clusterTexture.destroyed && this.clusterTexture.destroy(), this.clusterTexture = t.createTexture({
1687
1689
  width: s,
@@ -1689,14 +1691,14 @@ class Ge extends w {
1689
1691
  format: "rgba32float",
1690
1692
  usage: C.SAMPLE | C.RENDER | C.COPY_DST
1691
1693
  }), this.clusterTexture.copyImageData({
1692
- data: l,
1693
- bytesPerRow: T("rgba32float", s),
1694
+ data: d,
1695
+ bytesPerRow: g("rgba32float", s),
1694
1696
  mipLevel: 0,
1695
1697
  x: 0,
1696
1698
  y: 0
1697
1699
  })) : this.clusterTexture.copyImageData({
1698
- data: l,
1699
- bytesPerRow: T("rgba32float", s),
1700
+ data: d,
1701
+ bytesPerRow: g("rgba32float", s),
1700
1702
  mipLevel: 0,
1701
1703
  x: 0,
1702
1704
  y: 0
@@ -1706,14 +1708,14 @@ class Ge extends w {
1706
1708
  format: "rgba32float",
1707
1709
  usage: C.SAMPLE | C.RENDER | C.COPY_DST
1708
1710
  }), this.clusterPositionsTexture.copyImageData({
1709
- data: d,
1710
- bytesPerRow: T("rgba32float", this.clustersTextureSize),
1711
+ data: l,
1712
+ bytesPerRow: g("rgba32float", this.clustersTextureSize),
1711
1713
  mipLevel: 0,
1712
1714
  x: 0,
1713
1715
  y: 0
1714
1716
  })) : this.clusterPositionsTexture.copyImageData({
1715
- data: d,
1716
- bytesPerRow: T("rgba32float", this.clustersTextureSize),
1717
+ data: l,
1718
+ bytesPerRow: g("rgba32float", this.clustersTextureSize),
1717
1719
  mipLevel: 0,
1718
1720
  x: 0,
1719
1721
  y: 0
@@ -1724,13 +1726,13 @@ class Ge extends w {
1724
1726
  usage: C.SAMPLE | C.RENDER | C.COPY_DST
1725
1727
  }), this.clusterForceCoefficientTexture.copyImageData({
1726
1728
  data: c,
1727
- bytesPerRow: T("rgba32float", s),
1729
+ bytesPerRow: g("rgba32float", s),
1728
1730
  mipLevel: 0,
1729
1731
  x: 0,
1730
1732
  y: 0
1731
1733
  })) : this.clusterForceCoefficientTexture.copyImageData({
1732
1734
  data: c,
1733
- bytesPerRow: T("rgba32float", s),
1735
+ bytesPerRow: g("rgba32float", s),
1734
1736
  mipLevel: 0,
1735
1737
  x: 0,
1736
1738
  y: 0
@@ -1741,7 +1743,7 @@ class Ge extends w {
1741
1743
  usage: C.SAMPLE | C.RENDER | C.COPY_DST
1742
1744
  }), this.centermassTexture.copyImageData({
1743
1745
  data: new Float32Array(a).fill(0),
1744
- bytesPerRow: T("rgba32float", this.clustersTextureSize),
1746
+ bytesPerRow: g("rgba32float", this.clustersTextureSize),
1745
1747
  mipLevel: 0,
1746
1748
  x: 0,
1747
1749
  y: 0
@@ -1751,7 +1753,7 @@ class Ge extends w {
1751
1753
  colorAttachments: [this.centermassTexture]
1752
1754
  })) : this.centermassTexture.copyImageData({
1753
1755
  data: new Float32Array(a).fill(0),
1754
- bytesPerRow: T("rgba32float", this.clustersTextureSize),
1756
+ bytesPerRow: g("rgba32float", this.clustersTextureSize),
1755
1757
  mipLevel: 0,
1756
1758
  x: 0,
1757
1759
  y: 0
@@ -1780,9 +1782,9 @@ class Ge extends w {
1780
1782
  clustersTextureSize: this.clustersTextureSize ?? 0
1781
1783
  }
1782
1784
  }
1783
- })), this.calculateCentermassCommand || (this.calculateCentermassCommand = new A(t, {
1784
- fs: Qe,
1785
- vs: $e,
1785
+ })), this.calculateCentermassCommand || (this.calculateCentermassCommand = new v(t, {
1786
+ fs: $e,
1787
+ vs: Je,
1786
1788
  topology: "point-list",
1787
1789
  vertexCount: o.pointsNumber ?? 0,
1788
1790
  attributes: {
@@ -1828,9 +1830,9 @@ class Ge extends w {
1828
1830
  }
1829
1831
  })), this.applyForcesVertexCoordBuffer || (this.applyForcesVertexCoordBuffer = t.createBuffer({
1830
1832
  data: new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1])
1831
- })), this.applyForcesCommand || (this.applyForcesCommand = new A(t, {
1832
- fs: Je,
1833
- vs: M,
1833
+ })), this.applyForcesCommand || (this.applyForcesCommand = new v(t, {
1834
+ fs: Ge,
1835
+ vs: D,
1834
1836
  topology: "triangle-strip",
1835
1837
  vertexCount: 4,
1836
1838
  attributes: {
@@ -1901,7 +1903,7 @@ class Ge extends w {
1901
1903
  (t = this.calculateCentermassCommand) == null || t.destroy(), this.calculateCentermassCommand = void 0, (i = this.applyForcesCommand) == null || i.destroy(), this.applyForcesCommand = void 0, this.centermassFbo && !this.centermassFbo.destroyed && this.centermassFbo.destroy(), this.centermassFbo = void 0, this.clusterTexture && !this.clusterTexture.destroyed && this.clusterTexture.destroy(), this.clusterTexture = void 0, this.clusterPositionsTexture && !this.clusterPositionsTexture.destroyed && this.clusterPositionsTexture.destroy(), this.clusterPositionsTexture = void 0, this.clusterForceCoefficientTexture && !this.clusterForceCoefficientTexture.destroyed && this.clusterForceCoefficientTexture.destroy(), this.clusterForceCoefficientTexture = void 0, this.centermassTexture && !this.centermassTexture.destroyed && this.centermassTexture.destroy(), this.centermassTexture = void 0, (o = this.calculateCentermassUniformStore) == null || o.destroy(), this.calculateCentermassUniformStore = void 0, (s = this.applyForcesUniformStore) == null || s.destroy(), this.applyForcesUniformStore = void 0, this.pointIndices && !this.pointIndices.destroyed && this.pointIndices.destroy(), this.pointIndices = void 0, this.applyForcesVertexCoordBuffer && !this.applyForcesVertexCoordBuffer.destroyed && this.applyForcesVertexCoordBuffer.destroy(), this.applyForcesVertexCoordBuffer = void 0;
1902
1904
  }
1903
1905
  }
1904
- const et = `
1906
+ const tt = `
1905
1907
  #gl-bench {
1906
1908
  position:absolute;
1907
1909
  right:0;
@@ -1958,7 +1960,7 @@ class G {
1958
1960
  constructor(t) {
1959
1961
  this.destroy();
1960
1962
  const i = t.getContext("webgl") || t.getContext("experimental-webgl");
1961
- this.bench = new fe(i, { css: et });
1963
+ this.bench = new ue(i, { css: tt });
1962
1964
  }
1963
1965
  begin() {
1964
1966
  var t;
@@ -1969,11 +1971,11 @@ class G {
1969
1971
  (i = this.bench) == null || i.end("frame"), (o = this.bench) == null || o.nextFrame(t);
1970
1972
  }
1971
1973
  destroy() {
1972
- this.bench = void 0, z("#gl-bench").remove();
1974
+ this.bench = void 0, b("#gl-bench").remove();
1973
1975
  }
1974
1976
  }
1975
- var tt = /* @__PURE__ */ ((e) => (e[e.Circle = 0] = "Circle", e[e.Square = 1] = "Square", e[e.Triangle = 2] = "Triangle", e[e.Diamond = 3] = "Diamond", e[e.Pentagon = 4] = "Pentagon", e[e.Hexagon = 5] = "Hexagon", e[e.Star = 6] = "Star", e[e.Cross = 7] = "Cross", e[e.None = 8] = "None", e))(tt || {});
1976
- class it {
1977
+ var it = /* @__PURE__ */ ((e) => (e[e.Circle = 0] = "Circle", e[e.Square = 1] = "Square", e[e.Triangle = 2] = "Triangle", e[e.Diamond = 3] = "Diamond", e[e.Pentagon = 4] = "Pentagon", e[e.Hexagon = 5] = "Hexagon", e[e.Star = 6] = "Star", e[e.Cross = 7] = "Cross", e[e.None = 8] = "None", e))(it || {});
1978
+ class ot {
1977
1979
  constructor(t) {
1978
1980
  this._config = t;
1979
1981
  }
@@ -1994,7 +1996,7 @@ class it {
1994
1996
  this.pointColors = void 0;
1995
1997
  return;
1996
1998
  }
1997
- const t = k(this._config.pointDefaultColor ?? this._config.pointColor);
1999
+ const t = z(this._config.pointDefaultColor);
1998
2000
  if (this.inputPointColors === void 0 || this.inputPointColors.length / 4 !== this.pointsNumber) {
1999
2001
  this.pointColors = new Float32Array(this.pointsNumber * 4);
2000
2002
  for (let i = 0; i < this.pointColors.length / 4; i++)
@@ -2002,7 +2004,7 @@ class it {
2002
2004
  } else {
2003
2005
  this.pointColors = this.inputPointColors;
2004
2006
  for (let i = 0; i < this.pointColors.length / 4; i++)
2005
- D(this.pointColors[i * 4]) || (this.pointColors[i * 4] = t[0]), D(this.pointColors[i * 4 + 1]) || (this.pointColors[i * 4 + 1] = t[1]), D(this.pointColors[i * 4 + 2]) || (this.pointColors[i * 4 + 2] = t[2]), D(this.pointColors[i * 4 + 3]) || (this.pointColors[i * 4 + 3] = t[3]);
2007
+ M(this.pointColors[i * 4]) || (this.pointColors[i * 4] = t[0]), M(this.pointColors[i * 4 + 1]) || (this.pointColors[i * 4 + 1] = t[1]), M(this.pointColors[i * 4 + 2]) || (this.pointColors[i * 4 + 2] = t[2]), M(this.pointColors[i * 4 + 3]) || (this.pointColors[i * 4 + 3] = t[3]);
2006
2008
  }
2007
2009
  }
2008
2010
  /**
@@ -2013,13 +2015,13 @@ class it {
2013
2015
  this.pointSizes = void 0;
2014
2016
  return;
2015
2017
  }
2016
- const t = this._config.pointDefaultSize ?? this._config.pointSize;
2018
+ const t = this._config.pointDefaultSize;
2017
2019
  if (this.inputPointSizes === void 0 || this.inputPointSizes.length !== this.pointsNumber)
2018
2020
  this.pointSizes = new Float32Array(this.pointsNumber).fill(t);
2019
2021
  else {
2020
2022
  this.pointSizes = this.inputPointSizes;
2021
2023
  for (let i = 0; i < this.pointSizes.length; i++)
2022
- D(this.pointSizes[i]) || (this.pointSizes[i] = t);
2024
+ M(this.pointSizes[i]) || (this.pointSizes[i] = t);
2023
2025
  }
2024
2026
  }
2025
2027
  /**
@@ -2040,7 +2042,7 @@ class it {
2040
2042
  const i = this.pointShapes;
2041
2043
  for (let o = 0; o < i.length; o++) {
2042
2044
  const s = i[o];
2043
- (s == null || !D(s) || s < 0 || s > 8) && (i[o] = t);
2045
+ (s == null || !M(s) || s < 0 || s > 8) && (i[o] = t);
2044
2046
  }
2045
2047
  }
2046
2048
  }
@@ -2072,13 +2074,13 @@ class it {
2072
2074
  this.pointImageSizes = void 0;
2073
2075
  return;
2074
2076
  }
2075
- const t = this._config.pointDefaultSize ?? this._config.pointSize;
2077
+ const t = this._config.pointDefaultSize;
2076
2078
  if (this.inputPointImageSizes === void 0 || this.inputPointImageSizes.length !== this.pointsNumber)
2077
2079
  this.pointImageSizes = this.pointSizes ? new Float32Array(this.pointSizes) : new Float32Array(this.pointsNumber).fill(t);
2078
2080
  else {
2079
2081
  this.pointImageSizes = new Float32Array(this.inputPointImageSizes);
2080
2082
  for (let o = 0; o < this.pointImageSizes.length; o++)
2081
- D(this.pointImageSizes[o]) || (this.pointImageSizes[o] = ((i = this.pointSizes) == null ? void 0 : i[o]) ?? t);
2083
+ M(this.pointImageSizes[o]) || (this.pointImageSizes[o] = ((i = this.pointSizes) == null ? void 0 : i[o]) ?? t);
2082
2084
  }
2083
2085
  }
2084
2086
  updateLinks() {
@@ -2092,7 +2094,7 @@ class it {
2092
2094
  this.linkColors = void 0;
2093
2095
  return;
2094
2096
  }
2095
- const t = k(this._config.linkDefaultColor ?? this._config.linkColor);
2097
+ const t = z(this._config.linkDefaultColor);
2096
2098
  if (this.inputLinkColors === void 0 || this.inputLinkColors.length / 4 !== this.linksNumber) {
2097
2099
  this.linkColors = new Float32Array(this.linksNumber * 4);
2098
2100
  for (let i = 0; i < this.linkColors.length / 4; i++)
@@ -2100,7 +2102,7 @@ class it {
2100
2102
  } else {
2101
2103
  this.linkColors = this.inputLinkColors;
2102
2104
  for (let i = 0; i < this.linkColors.length / 4; i++)
2103
- D(this.linkColors[i * 4]) || (this.linkColors[i * 4] = t[0]), D(this.linkColors[i * 4 + 1]) || (this.linkColors[i * 4 + 1] = t[1]), D(this.linkColors[i * 4 + 2]) || (this.linkColors[i * 4 + 2] = t[2]), D(this.linkColors[i * 4 + 3]) || (this.linkColors[i * 4 + 3] = t[3]);
2105
+ M(this.linkColors[i * 4]) || (this.linkColors[i * 4] = t[0]), M(this.linkColors[i * 4 + 1]) || (this.linkColors[i * 4 + 1] = t[1]), M(this.linkColors[i * 4 + 2]) || (this.linkColors[i * 4 + 2] = t[2]), M(this.linkColors[i * 4 + 3]) || (this.linkColors[i * 4 + 3] = t[3]);
2104
2106
  }
2105
2107
  }
2106
2108
  /**
@@ -2111,13 +2113,13 @@ class it {
2111
2113
  this.linkWidths = void 0;
2112
2114
  return;
2113
2115
  }
2114
- const t = this._config.linkDefaultWidth ?? this._config.linkWidth;
2116
+ const t = this._config.linkDefaultWidth;
2115
2117
  if (this.inputLinkWidths === void 0 || this.inputLinkWidths.length !== this.linksNumber)
2116
2118
  this.linkWidths = new Float32Array(this.linksNumber).fill(t);
2117
2119
  else {
2118
2120
  this.linkWidths = this.inputLinkWidths;
2119
2121
  for (let i = 0; i < this.linkWidths.length; i++)
2120
- D(this.linkWidths[i]) || (this.linkWidths[i] = t);
2122
+ M(this.linkWidths[i]) || (this.linkWidths[i] = t);
2121
2123
  }
2122
2124
  }
2123
2125
  /**
@@ -2128,7 +2130,7 @@ class it {
2128
2130
  this.linkArrows = void 0;
2129
2131
  return;
2130
2132
  }
2131
- const t = this._config.linkDefaultArrows ?? this._config.linkArrows;
2133
+ const t = this._config.linkDefaultArrows;
2132
2134
  this.linkArrowsBoolean === void 0 || this.linkArrowsBoolean.length !== this.linksNumber ? this.linkArrows = new Array(this.linksNumber).fill(+t) : this.linkArrows = this.linkArrowsBoolean.map((i) => +i);
2133
2135
  }
2134
2136
  updateLinkStrength() {
@@ -2171,7 +2173,19 @@ class it {
2171
2173
  this.inDegree[n] = ((i = (t = this.targetIndexToSourceIndices) == null ? void 0 : t[n]) == null ? void 0 : i.length) ?? 0, this.outDegree[n] = ((s = (o = this.sourceIndexToTargetIndices) == null ? void 0 : o[n]) == null ? void 0 : s.length) ?? 0, this.degree[n] = (this.inDegree[n] ?? 0) + (this.outDegree[n] ?? 0);
2172
2174
  }
2173
2175
  }
2174
- const ot = `#version 300 es
2176
+ const st = (
2177
+ /* glsl */
2178
+ `
2179
+ vec2 conicParametricCurve(vec2 A, vec2 B, vec2 ControlPoint, float t, float w) {
2180
+ vec2 divident = (1.0 - t) * (1.0 - t) * A + 2.0 * (1.0 - t) * t * w * ControlPoint + t * t * B;
2181
+ float divisor = (1.0 - t) * (1.0 - t) + 2.0 * (1.0 - t) * t * w + t * t;
2182
+ return divident / divisor;
2183
+ }
2184
+ `
2185
+ ), ee = {
2186
+ name: "conicParametricCurve",
2187
+ vs: st
2188
+ }, nt = `#version 300 es
2175
2189
  #ifdef GL_ES
2176
2190
  precision highp float;
2177
2191
  #endif
@@ -2229,7 +2243,7 @@ void main() {
2229
2243
  }
2230
2244
  } else fragColor = vec4(color, opacity);
2231
2245
 
2232
- }`, st = `#version 300 es
2246
+ }`, rt = `#version 300 es
2233
2247
  #ifdef GL_ES
2234
2248
  precision highp float;
2235
2249
  #endif
@@ -2320,12 +2334,6 @@ float map(float value, float min1, float max1, float min2, float max2) {
2320
2334
  return min2 + (value - min1) * (max2 - min2) / (max1 - min1);
2321
2335
  }
2322
2336
 
2323
- vec2 conicParametricCurve(vec2 A, vec2 B, vec2 ControlPoint, float t, float w) {
2324
- vec2 divident = (1.0 - t) * (1.0 - t) * A + 2.0 * (1.0 - t) * t * w * ControlPoint + t * t * B;
2325
- float divisor = (1.0 - t) * (1.0 - t) + 2.0 * (1.0 - t) * t * w + t * t;
2326
- return divident / divisor;
2327
- }
2328
-
2329
2337
  float calculateLinkWidth(float width) {
2330
2338
  float linkWidth;
2331
2339
  if (scaleLinksOnZoom > 0.0) {
@@ -2476,7 +2484,100 @@ void main() {
2476
2484
  #endif
2477
2485
 
2478
2486
  gl_Position = vec4(final.rg, 0, 1);
2479
- }`, nt = `#version 300 es
2487
+ }`, at = `#version 300 es
2488
+ #ifdef GL_ES
2489
+ precision highp float;
2490
+ #endif
2491
+
2492
+ in vec4 rgba;
2493
+
2494
+ out vec4 fragColor;
2495
+
2496
+ void main() {
2497
+ fragColor = rgba;
2498
+ }
2499
+ `, dt = `#version 300 es
2500
+ #ifdef GL_ES
2501
+ precision highp float;
2502
+ #endif
2503
+
2504
+ in vec2 pointA;
2505
+ in vec2 pointB;
2506
+ in float linkIndices;
2507
+
2508
+ uniform sampler2D positionsTexture;
2509
+
2510
+ #ifdef USE_UNIFORM_BUFFERS
2511
+ layout(std140) uniform fillSampledLinksUniforms {
2512
+ float pointsTextureSize;
2513
+ mat4 transformationMatrix;
2514
+ float spaceSize;
2515
+ vec2 screenSize;
2516
+ float curvedWeight;
2517
+ float curvedLinkControlPointDistance;
2518
+ float curvedLinkSegments;
2519
+ } fillSampledLinks;
2520
+
2521
+ #define pointsTextureSize fillSampledLinks.pointsTextureSize
2522
+ #define transformationMatrix fillSampledLinks.transformationMatrix
2523
+ #define spaceSize fillSampledLinks.spaceSize
2524
+ #define screenSize fillSampledLinks.screenSize
2525
+ #define curvedWeight fillSampledLinks.curvedWeight
2526
+ #define curvedLinkControlPointDistance fillSampledLinks.curvedLinkControlPointDistance
2527
+ #define curvedLinkSegments fillSampledLinks.curvedLinkSegments
2528
+ #else
2529
+ uniform float pointsTextureSize;
2530
+ uniform float spaceSize;
2531
+ uniform vec2 screenSize;
2532
+ uniform float curvedWeight;
2533
+ uniform float curvedLinkControlPointDistance;
2534
+ uniform float curvedLinkSegments;
2535
+ uniform mat3 transformationMatrix;
2536
+ #endif
2537
+
2538
+ out vec4 rgba;
2539
+
2540
+ void main() {
2541
+ vec4 posA = texture(positionsTexture, (pointA + 0.5) / pointsTextureSize);
2542
+ vec4 posB = texture(positionsTexture, (pointB + 0.5) / pointsTextureSize);
2543
+ vec2 a = posA.rg;
2544
+ vec2 b = posB.rg;
2545
+
2546
+ vec2 tangent = b - a;
2547
+ float angle = -atan(tangent.y, tangent.x);
2548
+
2549
+ vec2 mid;
2550
+ if (curvedLinkSegments <= 1.0) {
2551
+ mid = (a + b) * 0.5;
2552
+ } else if (curvedLinkControlPointDistance != 0.0 && curvedWeight != 0.0) {
2553
+ vec2 xBasis = b - a;
2554
+ vec2 yBasis = normalize(vec2(-xBasis.y, xBasis.x));
2555
+ float linkDist = length(xBasis);
2556
+ float h = curvedLinkControlPointDistance;
2557
+ vec2 controlPoint = (a + b) / 2.0 + yBasis * linkDist * h;
2558
+ mid = conicParametricCurve(a, b, controlPoint, 0.5, curvedWeight);
2559
+ } else {
2560
+ mid = (a + b) * 0.5;
2561
+ }
2562
+
2563
+ vec2 p = 2.0 * mid / spaceSize - 1.0;
2564
+ p *= spaceSize / screenSize;
2565
+ #ifdef USE_UNIFORM_BUFFERS
2566
+ mat3 transformMat3 = mat3(transformationMatrix);
2567
+ vec3 final = transformMat3 * vec3(p, 1);
2568
+ #else
2569
+ vec3 final = transformationMatrix * vec3(p, 1);
2570
+ #endif
2571
+
2572
+ vec2 pointScreenPosition = (final.xy + 1.0) * screenSize / 2.0;
2573
+ rgba = vec4(linkIndices, mid.x, mid.y, angle);
2574
+ float i = (pointScreenPosition.x + 0.5) / screenSize.x;
2575
+ float j = (pointScreenPosition.y + 0.5) / screenSize.y;
2576
+ gl_Position = vec4(2.0 * vec2(i, j) - 1.0, 0.0, 1.0);
2577
+
2578
+ gl_PointSize = 1.0;
2579
+ }
2580
+ `, lt = `#version 300 es
2480
2581
  #ifdef GL_ES
2481
2582
  precision highp float;
2482
2583
  #endif
@@ -2516,7 +2617,7 @@ void main() {
2516
2617
  // No link at this position, output -1 to indicate no hover
2517
2618
  fragColor = vec4(-1.0, 0.0, 0.0, 0.0);
2518
2619
  }
2519
- } `, rt = `#version 300 es
2620
+ } `, ct = `#version 300 es
2520
2621
  #ifdef GL_ES
2521
2622
  precision highp float;
2522
2623
  #endif
@@ -2525,18 +2626,18 @@ in vec2 vertexCoord;
2525
2626
 
2526
2627
  void main() {
2527
2628
  gl_Position = vec4(vertexCoord, 0.0, 1.0);
2528
- } `, at = (e) => {
2529
- const t = ce().exponent(2).range([0, 1]).domain([-1, 1]), i = ue(0, e).map((s) => -0.5 + s / e);
2629
+ } `, ft = (e) => {
2630
+ const t = fe().exponent(2).range([0, 1]).domain([-1, 1]), i = Se(0, e).map((s) => -0.5 + s / e);
2530
2631
  i.push(0.5);
2531
2632
  const o = new Array(i.length * 2);
2532
2633
  return i.forEach((s, n) => {
2533
2634
  o[n * 2] = [t(s * 2), 0.5], o[n * 2 + 1] = [t(s * 2), -0.5];
2534
2635
  }), o;
2535
2636
  };
2536
- class dt extends w {
2637
+ class ht extends w {
2537
2638
  initPrograms() {
2538
- var n;
2539
- const { device: t, config: i, store: o } = this;
2639
+ var r;
2640
+ const { device: t, config: i, store: o, data: s } = this;
2540
2641
  this.updateLinkIndexFbo(), this.hoveredLineIndexTexture || (this.hoveredLineIndexTexture = t.createTexture({
2541
2642
  width: 1,
2542
2643
  height: 1,
@@ -2548,24 +2649,24 @@ class dt extends w {
2548
2649
  height: 1,
2549
2650
  colorAttachments: [this.hoveredLineIndexTexture]
2550
2651
  })), this.curveLineGeometry || this.updateCurveLineGeometry();
2551
- const s = this.data.linksNumber ?? 0;
2652
+ const n = this.data.linksNumber ?? 0;
2552
2653
  this.pointABuffer || (this.pointABuffer = t.createBuffer({
2553
- data: new Float32Array(s * 2),
2654
+ data: new Float32Array(n * 2),
2554
2655
  usage: S.VERTEX | S.COPY_DST
2555
2656
  })), this.pointBBuffer || (this.pointBBuffer = t.createBuffer({
2556
- data: new Float32Array(s * 2),
2657
+ data: new Float32Array(n * 2),
2557
2658
  usage: S.VERTEX | S.COPY_DST
2558
2659
  })), this.colorBuffer || (this.colorBuffer = t.createBuffer({
2559
- data: new Float32Array(s * 4),
2660
+ data: new Float32Array(n * 4),
2560
2661
  usage: S.VERTEX | S.COPY_DST
2561
2662
  })), this.widthBuffer || (this.widthBuffer = t.createBuffer({
2562
- data: new Float32Array(s),
2663
+ data: new Float32Array(n),
2563
2664
  usage: S.VERTEX | S.COPY_DST
2564
2665
  })), this.arrowBuffer || (this.arrowBuffer = t.createBuffer({
2565
- data: new Float32Array(s),
2666
+ data: new Float32Array(n),
2566
2667
  usage: S.VERTEX | S.COPY_DST
2567
2668
  })), this.linkIndexBuffer || (this.linkIndexBuffer = t.createBuffer({
2568
- data: new Float32Array(s),
2669
+ data: new Float32Array(n),
2569
2670
  usage: S.VERTEX | S.COPY_DST
2570
2671
  })), this.drawLineUniformStore || (this.drawLineUniformStore = new x({
2571
2672
  drawLineUniforms: {
@@ -2596,19 +2697,19 @@ class dt extends w {
2596
2697
  widthScale: i.linkWidthScale ?? 1,
2597
2698
  linkArrowsSizeScale: i.linkArrowsSizeScale ?? 1,
2598
2699
  spaceSize: o.adjustedSpaceSize ?? 0,
2599
- screenSize: g(o.screenSize, [0, 0]),
2600
- linkVisibilityDistanceRange: g(i.linkVisibilityDistanceRange, [0, 0]),
2700
+ screenSize: T(o.screenSize, [0, 0]),
2701
+ linkVisibilityDistanceRange: T(i.linkVisibilityDistanceRange, [0, 0]),
2601
2702
  linkVisibilityMinTransparency: i.linkVisibilityMinTransparency ?? 0,
2602
2703
  linkOpacity: i.linkOpacity ?? 1,
2603
2704
  greyoutOpacity: i.linkGreyoutOpacity ?? 1,
2604
2705
  curvedWeight: i.curvedLinkWeight ?? 0,
2605
2706
  curvedLinkControlPointDistance: i.curvedLinkControlPointDistance ?? 0,
2606
- curvedLinkSegments: i.curvedLinks ? i.curvedLinkSegments ?? h.curvedLinkSegments : 1,
2707
+ curvedLinkSegments: i.curvedLinks ? i.curvedLinkSegments ?? f.curvedLinkSegments : 1,
2607
2708
  scaleLinksOnZoom: i.scaleLinksOnZoom ?? !0 ? 1 : 0,
2608
2709
  maxPointSize: o.maxPointSize ?? 100,
2609
2710
  renderMode: 0,
2610
2711
  hoveredLinkIndex: o.hoveredLinkIndex ?? -1,
2611
- hoveredLinkColor: I(o.hoveredLinkColor, [-1, -1, -1, -1]),
2712
+ hoveredLinkColor: m(o.hoveredLinkColor, [-1, -1, -1, -1]),
2612
2713
  hoveredLinkWidthIncrease: i.hoveredLinkWidthIncrease ?? 0
2613
2714
  }
2614
2715
  },
@@ -2620,11 +2721,12 @@ class dt extends w {
2620
2721
  renderMode: 0
2621
2722
  }
2622
2723
  }
2623
- })), this.drawCurveCommand || (this.drawCurveCommand = new A(t, {
2624
- vs: st,
2625
- fs: ot,
2724
+ })), this.drawCurveCommand || (this.drawCurveCommand = new v(t, {
2725
+ vs: rt,
2726
+ fs: nt,
2727
+ modules: [ee],
2626
2728
  topology: "triangle-strip",
2627
- vertexCount: ((n = this.curveLineGeometry) == null ? void 0 : n.length) ?? 0,
2729
+ vertexCount: ((r = this.curveLineGeometry) == null ? void 0 : r.length) ?? 0,
2628
2730
  attributes: {
2629
2731
  ...this.curveLineBuffer && { position: this.curveLineBuffer },
2630
2732
  ...this.pointABuffer && { pointA: this.pointABuffer },
@@ -2684,13 +2786,13 @@ class dt extends w {
2684
2786
  screenSize: "vec2<f32>"
2685
2787
  },
2686
2788
  defaultUniforms: {
2687
- mousePosition: g(o.screenMousePosition, [0, 0]),
2688
- screenSize: g(o.screenSize, [0, 0])
2789
+ mousePosition: T(o.screenMousePosition, [0, 0]),
2790
+ screenSize: T(o.screenSize, [0, 0])
2689
2791
  }
2690
2792
  }
2691
- })), this.hoveredLineIndexCommand || (this.hoveredLineIndexCommand = new A(t, {
2692
- vs: rt,
2693
- fs: nt,
2793
+ })), this.hoveredLineIndexCommand || (this.hoveredLineIndexCommand = new v(t, {
2794
+ vs: ct,
2795
+ fs: lt,
2694
2796
  topology: "triangle-strip",
2695
2797
  vertexCount: 4,
2696
2798
  attributes: {
@@ -2708,7 +2810,55 @@ class dt extends w {
2708
2810
  hoveredLineIndexUniforms: this.hoveredLineIndexUniformStore.getManagedUniformBuffer(t, "hoveredLineIndexUniforms")
2709
2811
  // All texture bindings will be set dynamically in findHoveredLine() method
2710
2812
  }
2711
- }));
2813
+ })), this.fillSampledLinksUniformStore || (this.fillSampledLinksUniformStore = new x({
2814
+ fillSampledLinksUniforms: {
2815
+ uniformTypes: {
2816
+ pointsTextureSize: "f32",
2817
+ transformationMatrix: "mat4x4<f32>",
2818
+ spaceSize: "f32",
2819
+ screenSize: "vec2<f32>",
2820
+ curvedWeight: "f32",
2821
+ curvedLinkControlPointDistance: "f32",
2822
+ curvedLinkSegments: "f32"
2823
+ },
2824
+ defaultUniforms: {
2825
+ pointsTextureSize: o.pointsTextureSize ?? 0,
2826
+ transformationMatrix: o.transformationMatrix4x4,
2827
+ spaceSize: o.adjustedSpaceSize ?? 0,
2828
+ screenSize: T(o.screenSize, [0, 0]),
2829
+ curvedWeight: i.curvedLinkWeight ?? 0,
2830
+ curvedLinkControlPointDistance: i.curvedLinkControlPointDistance ?? 0,
2831
+ curvedLinkSegments: i.curvedLinks ? i.curvedLinkSegments ?? f.curvedLinkSegments : 1
2832
+ }
2833
+ }
2834
+ })), this.fillSampledLinksFboCommand || (this.fillSampledLinksFboCommand = new v(t, {
2835
+ fs: at,
2836
+ vs: dt,
2837
+ modules: [ee],
2838
+ topology: "point-list",
2839
+ vertexCount: s.linksNumber ?? 0,
2840
+ attributes: {
2841
+ ...this.pointABuffer && { pointA: this.pointABuffer },
2842
+ ...this.pointBBuffer && { pointB: this.pointBBuffer },
2843
+ ...this.linkIndexBuffer && { linkIndices: this.linkIndexBuffer }
2844
+ },
2845
+ bufferLayout: [
2846
+ { name: "pointA", format: "float32x2" },
2847
+ { name: "pointB", format: "float32x2" },
2848
+ { name: "linkIndices", format: "float32" }
2849
+ ],
2850
+ defines: {
2851
+ USE_UNIFORM_BUFFERS: !0
2852
+ },
2853
+ bindings: {
2854
+ fillSampledLinksUniforms: this.fillSampledLinksUniformStore.getManagedUniformBuffer(t, "fillSampledLinksUniforms")
2855
+ },
2856
+ parameters: {
2857
+ depthWriteEnabled: !1,
2858
+ depthCompare: "always",
2859
+ blend: !1
2860
+ }
2861
+ })), this.updateSampledLinksGrid();
2712
2862
  }
2713
2863
  draw(t) {
2714
2864
  const { config: i, points: o, store: s } = this;
@@ -2719,20 +2869,20 @@ class dt extends w {
2719
2869
  widthScale: i.linkWidthScale ?? 1,
2720
2870
  linkArrowsSizeScale: i.linkArrowsSizeScale ?? 1,
2721
2871
  spaceSize: s.adjustedSpaceSize ?? 0,
2722
- screenSize: g(s.screenSize, [0, 0]),
2723
- linkVisibilityDistanceRange: g(i.linkVisibilityDistanceRange, [0, 0]),
2872
+ screenSize: T(s.screenSize, [0, 0]),
2873
+ linkVisibilityDistanceRange: T(i.linkVisibilityDistanceRange, [0, 0]),
2724
2874
  linkVisibilityMinTransparency: i.linkVisibilityMinTransparency ?? 0,
2725
2875
  linkOpacity: i.linkOpacity ?? 1,
2726
2876
  greyoutOpacity: i.linkGreyoutOpacity ?? 1,
2727
2877
  curvedWeight: i.curvedLinkWeight ?? 0,
2728
2878
  curvedLinkControlPointDistance: i.curvedLinkControlPointDistance ?? 0,
2729
- curvedLinkSegments: i.curvedLinks ? i.curvedLinkSegments ?? h.curvedLinkSegments : 1,
2879
+ curvedLinkSegments: i.curvedLinks ? i.curvedLinkSegments ?? f.curvedLinkSegments : 1,
2730
2880
  scaleLinksOnZoom: i.scaleLinksOnZoom ?? !0 ? 1 : 0,
2731
2881
  maxPointSize: s.maxPointSize ?? 100,
2732
2882
  renderMode: 0,
2733
2883
  // Normal rendering
2734
2884
  hoveredLinkIndex: s.hoveredLinkIndex ?? -1,
2735
- hoveredLinkColor: I(s.hoveredLinkColor, [-1, -1, -1, -1]),
2885
+ hoveredLinkColor: m(s.hoveredLinkColor, [-1, -1, -1, -1]),
2736
2886
  hoveredLinkWidthIncrease: i.hoveredLinkWidthIncrease ?? 0
2737
2887
  },
2738
2888
  drawLineFragmentUniforms: {
@@ -2745,12 +2895,12 @@ class dt extends w {
2745
2895
  }), this.drawCurveCommand.setInstanceCount(this.data.linksNumber ?? 0), this.drawCurveCommand.draw(t))));
2746
2896
  }
2747
2897
  updateLinkIndexFbo() {
2748
- var a, l;
2898
+ var a, d;
2749
2899
  const { device: t, store: i } = this;
2750
2900
  if (!this.store.isLinkHoveringEnabled) return;
2751
2901
  const o = i.screenSize ?? [0, 0], s = o[0], n = o[1];
2752
2902
  if (!s || !n) return;
2753
- const r = ((a = this.previousScreenSize) == null ? void 0 : a[0]) !== s || ((l = this.previousScreenSize) == null ? void 0 : l[1]) !== n;
2903
+ const r = ((a = this.previousScreenSize) == null ? void 0 : a[0]) !== s || ((d = this.previousScreenSize) == null ? void 0 : d[1]) !== n;
2754
2904
  (!this.linkIndexTexture || r) && (this.linkIndexFbo && !this.linkIndexFbo.destroyed && this.linkIndexFbo.destroy(), this.linkIndexTexture && !this.linkIndexTexture.destroyed && this.linkIndexTexture.destroy(), this.linkIndexTexture = t.createTexture({
2755
2905
  width: s,
2756
2906
  height: n,
@@ -2758,7 +2908,7 @@ class dt extends w {
2758
2908
  usage: C.SAMPLE | C.RENDER | C.COPY_DST
2759
2909
  }), this.linkIndexTexture.copyImageData({
2760
2910
  data: new Float32Array(s * n * 4).fill(0),
2761
- bytesPerRow: T("rgba32float", s),
2911
+ bytesPerRow: g("rgba32float", s),
2762
2912
  mipLevel: 0,
2763
2913
  x: 0,
2764
2914
  y: 0
@@ -2768,16 +2918,27 @@ class dt extends w {
2768
2918
  colorAttachments: [this.linkIndexTexture]
2769
2919
  }), this.previousScreenSize = [s, n]);
2770
2920
  }
2921
+ updateSampledLinksGrid() {
2922
+ const { store: { screenSize: t }, config: { linkSamplingDistance: i }, device: o } = this;
2923
+ let s = i ?? Math.min(...t) / 2;
2924
+ s === 0 && (s = f.linkSamplingDistance);
2925
+ const n = Math.ceil(t[0] / s), r = Math.ceil(t[1] / s);
2926
+ n === 0 || r === 0 || (!this.sampledLinksFbo || this.sampledLinksFbo.width !== n || this.sampledLinksFbo.height !== r) && (this.sampledLinksFbo && !this.sampledLinksFbo.destroyed && this.sampledLinksFbo.destroy(), this.sampledLinksFbo = o.createFramebuffer({
2927
+ width: n,
2928
+ height: r,
2929
+ colorAttachments: ["rgba32float"]
2930
+ }));
2931
+ }
2771
2932
  updatePointsBuffer() {
2772
- var l;
2933
+ var d;
2773
2934
  const { device: t, data: i, store: o } = this;
2774
2935
  if (i.linksNumber === void 0 || i.links === void 0 || !o.pointsTextureSize) return;
2775
2936
  const s = new Float32Array(i.linksNumber * 2), n = new Float32Array(i.linksNumber * 2);
2776
- for (let d = 0; d < i.linksNumber; d++) {
2777
- const c = i.links[d * 2], f = i.links[d * 2 + 1], p = c % o.pointsTextureSize, u = Math.floor(c / o.pointsTextureSize), _ = f % o.pointsTextureSize, P = Math.floor(f / o.pointsTextureSize);
2778
- s[d * 2] = p, s[d * 2 + 1] = u, n[d * 2] = _, n[d * 2 + 1] = P;
2937
+ for (let l = 0; l < i.linksNumber; l++) {
2938
+ const c = i.links[l * 2], h = i.links[l * 2 + 1], p = c % o.pointsTextureSize, u = Math.floor(c / o.pointsTextureSize), _ = h % o.pointsTextureSize, R = Math.floor(h / o.pointsTextureSize);
2939
+ s[l * 2] = p, s[l * 2 + 1] = u, n[l * 2] = _, n[l * 2 + 1] = R;
2779
2940
  }
2780
- const r = (((l = this.pointABuffer) == null ? void 0 : l.byteLength) ?? 0) / (Float32Array.BYTES_PER_ELEMENT * 2);
2941
+ const r = (((d = this.pointABuffer) == null ? void 0 : d.byteLength) ?? 0) / (Float32Array.BYTES_PER_ELEMENT * 2);
2781
2942
  !this.pointABuffer || r !== i.linksNumber ? (this.pointABuffer && !this.pointABuffer.destroyed && this.pointABuffer.destroy(), this.pointABuffer = t.createBuffer({
2782
2943
  data: s,
2783
2944
  usage: S.VERTEX | S.COPY_DST
@@ -2786,8 +2947,8 @@ class dt extends w {
2786
2947
  usage: S.VERTEX | S.COPY_DST
2787
2948
  })) : this.pointBBuffer.write(n);
2788
2949
  const a = new Float32Array(i.linksNumber);
2789
- for (let d = 0; d < i.linksNumber; d++)
2790
- a[d] = d;
2950
+ for (let l = 0; l < i.linksNumber; l++)
2951
+ a[l] = l;
2791
2952
  !this.linkIndexBuffer || r !== i.linksNumber ? (this.linkIndexBuffer && !this.linkIndexBuffer.destroyed && this.linkIndexBuffer.destroy(), this.linkIndexBuffer = t.createBuffer({
2792
2953
  data: a,
2793
2954
  usage: S.VERTEX | S.COPY_DST
@@ -2795,7 +2956,11 @@ class dt extends w {
2795
2956
  pointA: this.pointABuffer,
2796
2957
  pointB: this.pointBBuffer,
2797
2958
  linkIndices: this.linkIndexBuffer
2798
- });
2959
+ }), this.fillSampledLinksFboCommand && this.fillSampledLinksFboCommand.setAttributes({
2960
+ pointA: this.pointABuffer,
2961
+ pointB: this.pointBBuffer,
2962
+ linkIndices: this.linkIndexBuffer
2963
+ }), this.updateSampledLinksGrid();
2799
2964
  }
2800
2965
  updateColor() {
2801
2966
  const { device: t, data: i } = this, o = i.linksNumber ?? 0, s = i.linkColors ?? new Float32Array(o * 4).fill(0);
@@ -2835,7 +3000,7 @@ class dt extends w {
2835
3000
  }
2836
3001
  updateCurveLineGeometry() {
2837
3002
  const { device: t, config: { curvedLinks: i, curvedLinkSegments: o } } = this;
2838
- this.curveLineGeometry = at(i ? o ?? h.curvedLinkSegments : 1);
3003
+ this.curveLineGeometry = ft(i ? o ?? f.curvedLinkSegments : 1);
2839
3004
  const s = new Float32Array(this.curveLineGeometry.length * 2);
2840
3005
  for (let n = 0; n < this.curveLineGeometry.length; n++)
2841
3006
  s[n * 2] = this.curveLineGeometry[n][0], s[n * 2 + 1] = this.curveLineGeometry[n][1];
@@ -2846,6 +3011,70 @@ class dt extends w {
2846
3011
  position: this.curveLineBuffer
2847
3012
  }), this.drawCurveCommand.setVertexCount(this.curveLineGeometry.length));
2848
3013
  }
3014
+ getSampledLinkPositionsMap() {
3015
+ const t = /* @__PURE__ */ new Map();
3016
+ if (!this.sampledLinksFbo || this.sampledLinksFbo.destroyed) return t;
3017
+ const i = this.points;
3018
+ if (!(i != null && i.currentPositionTexture) || i.currentPositionTexture.destroyed) return t;
3019
+ if (this.fillSampledLinksFboCommand && this.fillSampledLinksUniformStore && this.sampledLinksFbo) {
3020
+ this.fillSampledLinksFboCommand.setVertexCount(this.data.linksNumber ?? 0), this.fillSampledLinksUniformStore.setUniforms({
3021
+ fillSampledLinksUniforms: {
3022
+ pointsTextureSize: this.store.pointsTextureSize ?? 0,
3023
+ transformationMatrix: this.store.transformationMatrix4x4,
3024
+ spaceSize: this.store.adjustedSpaceSize ?? 0,
3025
+ screenSize: T(this.store.screenSize, [0, 0]),
3026
+ curvedWeight: this.config.curvedLinkWeight ?? 0,
3027
+ curvedLinkControlPointDistance: this.config.curvedLinkControlPointDistance ?? 0,
3028
+ curvedLinkSegments: this.config.curvedLinks ? this.config.curvedLinkSegments ?? f.curvedLinkSegments : 1
3029
+ }
3030
+ }), this.fillSampledLinksFboCommand.setBindings({
3031
+ positionsTexture: i.currentPositionTexture
3032
+ });
3033
+ const s = this.device.beginRenderPass({
3034
+ framebuffer: this.sampledLinksFbo,
3035
+ clearColor: [-1, -1, -1, -1]
3036
+ });
3037
+ this.fillSampledLinksFboCommand.draw(s), s.end();
3038
+ }
3039
+ const o = y(this.device, this.sampledLinksFbo);
3040
+ for (let s = 0; s < o.length / 4; s++) {
3041
+ const n = o[s * 4], r = o[s * 4 + 1], a = o[s * 4 + 2], d = o[s * 4 + 3];
3042
+ n !== void 0 && n >= 0 && r !== void 0 && a !== void 0 && d !== void 0 && t.set(Math.round(n), [r, a, d]);
3043
+ }
3044
+ return t;
3045
+ }
3046
+ getSampledLinks() {
3047
+ const t = [], i = [], o = [];
3048
+ if (!this.sampledLinksFbo || this.sampledLinksFbo.destroyed) return { indices: t, positions: i, angles: o };
3049
+ const s = this.points;
3050
+ if (!(s != null && s.currentPositionTexture) || s.currentPositionTexture.destroyed) return { indices: t, positions: i, angles: o };
3051
+ if (this.fillSampledLinksFboCommand && this.fillSampledLinksUniformStore && this.sampledLinksFbo) {
3052
+ this.fillSampledLinksFboCommand.setVertexCount(this.data.linksNumber ?? 0), this.fillSampledLinksUniformStore.setUniforms({
3053
+ fillSampledLinksUniforms: {
3054
+ pointsTextureSize: this.store.pointsTextureSize ?? 0,
3055
+ transformationMatrix: this.store.transformationMatrix4x4,
3056
+ spaceSize: this.store.adjustedSpaceSize ?? 0,
3057
+ screenSize: T(this.store.screenSize, [0, 0]),
3058
+ curvedWeight: this.config.curvedLinkWeight ?? 0,
3059
+ curvedLinkControlPointDistance: this.config.curvedLinkControlPointDistance ?? 0,
3060
+ curvedLinkSegments: this.config.curvedLinks ? this.config.curvedLinkSegments ?? f.curvedLinkSegments : 1
3061
+ }
3062
+ }), this.fillSampledLinksFboCommand.setBindings({
3063
+ positionsTexture: s.currentPositionTexture
3064
+ });
3065
+ const r = this.device.beginRenderPass({
3066
+ framebuffer: this.sampledLinksFbo,
3067
+ clearColor: [-1, -1, -1, -1]
3068
+ });
3069
+ this.fillSampledLinksFboCommand.draw(r), r.end();
3070
+ }
3071
+ const n = y(this.device, this.sampledLinksFbo);
3072
+ for (let r = 0; r < n.length / 4; r++) {
3073
+ const a = n[r * 4], d = n[r * 4 + 1], l = n[r * 4 + 2], c = n[r * 4 + 3];
3074
+ a !== void 0 && a >= 0 && d !== void 0 && l !== void 0 && c !== void 0 && (t.push(Math.round(a)), i.push(d, l), o.push(c));
3075
+ }
3076
+ return { indices: t, positions: i, angles: o };
3077
+ }
2849
3078
  findHoveredLine() {
2850
3079
  const { config: t, points: i, store: o } = this;
2851
3080
  if (!i || !i.currentPositionTexture || i.currentPositionTexture.destroyed || !i.greyoutStatusTexture || i.greyoutStatusTexture.destroyed || !this.data.linksNumber || !this.store.isLinkHoveringEnabled || !this.linkIndexFbo || !this.drawCurveCommand || !this.drawLineUniformStore || !this.linkIndexTexture || this.linkIndexTexture.destroyed) return;
@@ -2856,20 +3085,20 @@ class dt extends w {
2856
3085
  widthScale: t.linkWidthScale ?? 1,
2857
3086
  linkArrowsSizeScale: t.linkArrowsSizeScale ?? 1,
2858
3087
  spaceSize: o.adjustedSpaceSize ?? 0,
2859
- screenSize: g(o.screenSize, [0, 0]),
2860
- linkVisibilityDistanceRange: g(t.linkVisibilityDistanceRange, [0, 0]),
3088
+ screenSize: T(o.screenSize, [0, 0]),
3089
+ linkVisibilityDistanceRange: T(t.linkVisibilityDistanceRange, [0, 0]),
2861
3090
  linkVisibilityMinTransparency: t.linkVisibilityMinTransparency ?? 0,
2862
3091
  linkOpacity: t.linkOpacity ?? 1,
2863
3092
  greyoutOpacity: t.linkGreyoutOpacity ?? 1,
2864
3093
  curvedWeight: t.curvedLinkWeight ?? 0,
2865
3094
  curvedLinkControlPointDistance: t.curvedLinkControlPointDistance ?? 0,
2866
- curvedLinkSegments: t.curvedLinks ? t.curvedLinkSegments ?? h.curvedLinkSegments : 1,
3095
+ curvedLinkSegments: t.curvedLinks ? t.curvedLinkSegments ?? f.curvedLinkSegments : 1,
2867
3096
  scaleLinksOnZoom: t.scaleLinksOnZoom ?? !0 ? 1 : 0,
2868
3097
  maxPointSize: o.maxPointSize ?? 100,
2869
3098
  renderMode: 1,
2870
3099
  // Index rendering for picking
2871
3100
  hoveredLinkIndex: o.hoveredLinkIndex ?? -1,
2872
- hoveredLinkColor: I(o.hoveredLinkColor, [-1, -1, -1, -1]),
3101
+ hoveredLinkColor: m(o.hoveredLinkColor, [-1, -1, -1, -1]),
2873
3102
  hoveredLinkWidthIncrease: t.hoveredLinkWidthIncrease ?? 0
2874
3103
  },
2875
3104
  drawLineFragmentUniforms: {
@@ -2888,8 +3117,8 @@ class dt extends w {
2888
3117
  if (this.drawCurveCommand.draw(s), s.end(), this.hoveredLineIndexCommand && this.hoveredLineIndexFbo && this.hoveredLineIndexUniformStore) {
2889
3118
  this.hoveredLineIndexUniformStore.setUniforms({
2890
3119
  hoveredLineIndexUniforms: {
2891
- mousePosition: g(o.screenMousePosition, [0, 0]),
2892
- screenSize: g(o.screenSize, [0, 0])
3120
+ mousePosition: T(o.screenMousePosition, [0, 0]),
3121
+ screenSize: T(o.screenSize, [0, 0])
2893
3122
  }
2894
3123
  }), this.hoveredLineIndexCommand.setBindings({
2895
3124
  linkIndexTexture: this.linkIndexTexture
@@ -2905,11 +3134,11 @@ class dt extends w {
2905
3134
  * Models -> Framebuffers -> Textures -> UniformStores -> Buffers
2906
3135
  */
2907
3136
  destroy() {
2908
- var t, i, o, s;
2909
- (t = this.drawCurveCommand) == null || t.destroy(), this.drawCurveCommand = void 0, (i = this.hoveredLineIndexCommand) == null || i.destroy(), this.hoveredLineIndexCommand = void 0, this.linkIndexFbo && !this.linkIndexFbo.destroyed && this.linkIndexFbo.destroy(), this.linkIndexFbo = void 0, this.hoveredLineIndexFbo && !this.hoveredLineIndexFbo.destroyed && this.hoveredLineIndexFbo.destroy(), this.hoveredLineIndexFbo = void 0, this.linkIndexTexture && !this.linkIndexTexture.destroyed && this.linkIndexTexture.destroy(), this.linkIndexTexture = void 0, this.hoveredLineIndexTexture && !this.hoveredLineIndexTexture.destroyed && this.hoveredLineIndexTexture.destroy(), this.hoveredLineIndexTexture = void 0, (o = this.drawLineUniformStore) == null || o.destroy(), this.drawLineUniformStore = void 0, (s = this.hoveredLineIndexUniformStore) == null || s.destroy(), this.hoveredLineIndexUniformStore = void 0, this.pointABuffer && !this.pointABuffer.destroyed && this.pointABuffer.destroy(), this.pointABuffer = void 0, this.pointBBuffer && !this.pointBBuffer.destroyed && this.pointBBuffer.destroy(), this.pointBBuffer = void 0, this.colorBuffer && !this.colorBuffer.destroyed && this.colorBuffer.destroy(), this.colorBuffer = void 0, this.widthBuffer && !this.widthBuffer.destroyed && this.widthBuffer.destroy(), this.widthBuffer = void 0, this.arrowBuffer && !this.arrowBuffer.destroyed && this.arrowBuffer.destroy(), this.arrowBuffer = void 0, this.curveLineBuffer && !this.curveLineBuffer.destroyed && this.curveLineBuffer.destroy(), this.curveLineBuffer = void 0, this.linkIndexBuffer && !this.linkIndexBuffer.destroyed && this.linkIndexBuffer.destroy(), this.linkIndexBuffer = void 0, this.quadBuffer && !this.quadBuffer.destroyed && this.quadBuffer.destroy(), this.quadBuffer = void 0;
3137
+ var t, i, o, s, n, r;
3138
+ (t = this.drawCurveCommand) == null || t.destroy(), this.drawCurveCommand = void 0, (i = this.hoveredLineIndexCommand) == null || i.destroy(), this.hoveredLineIndexCommand = void 0, (o = this.fillSampledLinksFboCommand) == null || o.destroy(), this.fillSampledLinksFboCommand = void 0, this.linkIndexFbo && !this.linkIndexFbo.destroyed && this.linkIndexFbo.destroy(), this.linkIndexFbo = void 0, this.sampledLinksFbo && !this.sampledLinksFbo.destroyed && this.sampledLinksFbo.destroy(), this.sampledLinksFbo = void 0, this.hoveredLineIndexFbo && !this.hoveredLineIndexFbo.destroyed && this.hoveredLineIndexFbo.destroy(), this.hoveredLineIndexFbo = void 0, this.linkIndexTexture && !this.linkIndexTexture.destroyed && this.linkIndexTexture.destroy(), this.linkIndexTexture = void 0, this.hoveredLineIndexTexture && !this.hoveredLineIndexTexture.destroyed && this.hoveredLineIndexTexture.destroy(), this.hoveredLineIndexTexture = void 0, (s = this.drawLineUniformStore) == null || s.destroy(), this.drawLineUniformStore = void 0, (n = this.hoveredLineIndexUniformStore) == null || n.destroy(), this.hoveredLineIndexUniformStore = void 0, (r = this.fillSampledLinksUniformStore) == null || r.destroy(), this.fillSampledLinksUniformStore = void 0, this.pointABuffer && !this.pointABuffer.destroyed && this.pointABuffer.destroy(), this.pointABuffer = void 0, this.pointBBuffer && !this.pointBBuffer.destroyed && this.pointBBuffer.destroy(), this.pointBBuffer = void 0, this.colorBuffer && !this.colorBuffer.destroyed && this.colorBuffer.destroy(), this.colorBuffer = void 0, this.widthBuffer && !this.widthBuffer.destroyed && this.widthBuffer.destroy(), this.widthBuffer = void 0, this.arrowBuffer && !this.arrowBuffer.destroyed && this.arrowBuffer.destroy(), this.arrowBuffer = void 0, this.curveLineBuffer && !this.curveLineBuffer.destroyed && this.curveLineBuffer.destroy(), this.curveLineBuffer = void 0, this.linkIndexBuffer && !this.linkIndexBuffer.destroyed && this.linkIndexBuffer.destroy(), this.linkIndexBuffer = void 0, this.quadBuffer && !this.quadBuffer.destroyed && this.quadBuffer.destroy(), this.quadBuffer = void 0;
2910
3139
  }
2911
3140
  }
2912
- const lt = `#version 300 es
3141
+ const ut = `#version 300 es
2913
3142
  #ifdef GL_ES
2914
3143
  precision highp float;
2915
3144
  #endif
@@ -3168,7 +3397,7 @@ void main() {
3168
3397
  finalPointAlpha
3169
3398
  );
3170
3399
  }
3171
- `, ct = `#version 300 es
3400
+ `, St = `#version 300 es
3172
3401
  #ifdef GL_ES
3173
3402
  precision highp float;
3174
3403
  #endif
@@ -3370,7 +3599,7 @@ void main() {
3370
3599
  imageAtlasUV = atlasCoords;
3371
3600
  }
3372
3601
  #endif
3373
- } `, ht = `#version 300 es
3602
+ } `, pt = `#version 300 es
3374
3603
  #ifdef GL_ES
3375
3604
  precision highp float;
3376
3605
  #endif
@@ -3458,7 +3687,7 @@ void main() {
3458
3687
  }
3459
3688
  }
3460
3689
 
3461
- `, ft = `#version 300 es
3690
+ `, _t = `#version 300 es
3462
3691
  #ifdef GL_ES
3463
3692
  precision highp float;
3464
3693
  #endif
@@ -3546,7 +3775,7 @@ void main() {
3546
3775
  if (pointInPolygon(screenPos, polygonPathTexture, polygonPathLength)) {
3547
3776
  fragColor.r = 1.0;
3548
3777
  }
3549
- } `, ut = `#version 300 es
3778
+ } `, Tt = `#version 300 es
3550
3779
  #ifdef GL_ES
3551
3780
  precision highp float;
3552
3781
  #endif
@@ -3589,7 +3818,7 @@ void main () {
3589
3818
  float opacity = smoothstep(r, r * smoothing, 1.0);
3590
3819
  float stroke = smoothstep(width, width * smoothing, r);
3591
3820
  fragColor = vec4(rgbColor, opacity * stroke * pointOpacity);
3592
- }`, St = `#version 300 es
3821
+ }`, gt = `#version 300 es
3593
3822
  #ifdef GL_ES
3594
3823
  precision highp float;
3595
3824
  #endif
@@ -3733,7 +3962,7 @@ void main () {
3733
3962
  #endif
3734
3963
 
3735
3964
  gl_Position = vec4(final.rg, 0, 1);
3736
- }`, pt = `#version 300 es
3965
+ }`, Ct = `#version 300 es
3737
3966
  #ifdef GL_ES
3738
3967
  precision highp float;
3739
3968
  #endif
@@ -3747,7 +3976,7 @@ void main() {
3747
3976
  discard;
3748
3977
  }
3749
3978
  fragColor = rgba;
3750
- }`, _t = `#version 300 es
3979
+ }`, Pt = `#version 300 es
3751
3980
  #ifdef GL_ES
3752
3981
  precision highp float;
3753
3982
  #endif
@@ -3859,7 +4088,7 @@ void main() {
3859
4088
  }
3860
4089
 
3861
4090
  gl_PointSize = 1.0;
3862
- }`, Tt = `#version 300 es
4091
+ }`, Rt = `#version 300 es
3863
4092
  #ifdef GL_ES
3864
4093
  precision highp float;
3865
4094
  #endif
@@ -3870,7 +4099,7 @@ out vec4 fragColor;
3870
4099
 
3871
4100
  void main() {
3872
4101
  fragColor = rgba;
3873
- }`, gt = `#version 300 es
4102
+ }`, xt = `#version 300 es
3874
4103
  #ifdef GL_ES
3875
4104
  precision highp float;
3876
4105
  #endif
@@ -3920,7 +4149,7 @@ void main() {
3920
4149
  gl_Position = vec4(2.0 * vec2(i, j) - 1.0, 0.0, 1.0);
3921
4150
 
3922
4151
  gl_PointSize = 1.0;
3923
- }`, Ct = `#version 300 es
4152
+ }`, vt = `#version 300 es
3924
4153
  #ifdef GL_ES
3925
4154
  precision highp float;
3926
4155
  #endif
@@ -3970,7 +4199,7 @@ void main() {
3970
4199
  pointPosition.g = clamp(pointPosition.g, 0.0, spaceSize);
3971
4200
 
3972
4201
  fragColor = pointPosition;
3973
- }`, Rt = `#version 300 es
4202
+ }`, At = `#version 300 es
3974
4203
  #ifdef GL_ES
3975
4204
  precision highp float;
3976
4205
  #endif
@@ -4000,7 +4229,7 @@ void main() {
4000
4229
  fragColor = vec4(pointPosition.rg, 1.0, 1.0);
4001
4230
  }
4002
4231
 
4003
- `, Pt = `#version 300 es
4232
+ `, mt = `#version 300 es
4004
4233
  #ifdef GL_ES
4005
4234
  precision highp float;
4006
4235
  #endif
@@ -4034,12 +4263,12 @@ void main() {
4034
4263
 
4035
4264
  fragColor = pointPosition;
4036
4265
  }`;
4037
- function xt(e, t = 16384) {
4266
+ function It(e, t = 16384) {
4038
4267
  if (!(e != null && e.length))
4039
4268
  return null;
4040
4269
  let i = 0;
4041
- for (const d of e) {
4042
- const c = Math.max(d.width, d.height);
4270
+ for (const l of e) {
4271
+ const c = Math.max(l.width, l.height);
4043
4272
  c > i && (i = c);
4044
4273
  }
4045
4274
  if (i === 0)
@@ -4049,52 +4278,52 @@ function xt(e, t = 16384) {
4049
4278
  n > t && (r = t / n, i = Math.max(1, Math.floor(i * r)), n = Math.max(1, Math.floor(n * r)), console.warn(
4050
4279
  `🖼️ Atlas scaling required: Original size ${(o * s).toLocaleString()}px exceeds WebGL limit ${t.toLocaleString()}px. Scaling down to ${n.toLocaleString()}px (${Math.round(r * 100)}% of original quality)`
4051
4280
  ));
4052
- const a = new Uint8Array(n * n * 4).fill(0), l = new Float32Array(s * s * 4).fill(-1);
4053
- for (const [d, c] of e.entries()) {
4054
- const f = c.width, p = c.height;
4055
- if (f === 0 || p === 0)
4281
+ const a = new Uint8Array(n * n * 4).fill(0), d = new Float32Array(s * s * 4).fill(-1);
4282
+ for (const [l, c] of e.entries()) {
4283
+ const h = c.width, p = c.height;
4284
+ if (h === 0 || p === 0)
4056
4285
  continue;
4057
- const u = Math.min(1, i / Math.max(f, p)), _ = Math.floor(f * u), P = Math.floor(p * u), m = Math.floor(d / s), v = d % s * i, y = m * i;
4058
- l[d * 4] = v / n, l[d * 4 + 1] = y / n, l[d * 4 + 2] = (v + _) / n, l[d * 4 + 3] = (y + P) / n;
4059
- for (let U = 0; U < P; U++)
4286
+ const u = Math.min(1, i / Math.max(h, p)), _ = Math.floor(h * u), R = Math.floor(p * u), I = Math.floor(l / s), A = l % s * i, F = I * i;
4287
+ d[l * 4] = A / n, d[l * 4 + 1] = F / n, d[l * 4 + 2] = (A + _) / n, d[l * 4 + 3] = (F + R) / n;
4288
+ for (let U = 0; U < R; U++)
4060
4289
  for (let E = 0; E < _; E++) {
4061
- const F = Math.floor(E * (f / _)), B = (Math.floor(U * (p / P)) * f + F) * 4, b = ((y + U) * n + (v + E)) * 4;
4062
- a[b] = c.data[B] ?? 0, a[b + 1] = c.data[B + 1] ?? 0, a[b + 2] = c.data[B + 2] ?? 0, a[b + 3] = c.data[B + 3] ?? 255;
4290
+ const N = Math.floor(E * (h / _)), B = (Math.floor(U * (p / R)) * h + N) * 4, k = ((F + U) * n + (A + E)) * 4;
4291
+ a[k] = c.data[B] ?? 0, a[k + 1] = c.data[B + 1] ?? 0, a[k + 2] = c.data[B + 2] ?? 0, a[k + 3] = c.data[B + 3] ?? 255;
4063
4292
  }
4064
4293
  }
4065
4294
  return {
4066
4295
  atlasData: a,
4067
4296
  atlasSize: n,
4068
- atlasCoords: l,
4297
+ atlasCoords: d,
4069
4298
  atlasCoordsSize: s
4070
4299
  };
4071
4300
  }
4072
- class At extends w {
4301
+ class yt extends w {
4073
4302
  constructor() {
4074
4303
  super(...arguments), this.imageCount = 0, this.isPositionsUpToDate = !1, this.polygonPathLength = 0;
4075
4304
  }
4076
4305
  updatePositions() {
4077
4306
  const { device: t, store: i, data: o, config: { rescalePositions: s, enableSimulation: n } } = this, { pointsTextureSize: r } = i;
4078
4307
  if (!r || !o.pointPositions || o.pointsNumber === void 0) return;
4079
- const a = r * r * 4, l = new Float32Array(a), d = r * r * 4 * 4, c = l.byteLength;
4080
- c !== d && console.error("Texture data size mismatch:", {
4308
+ const a = r * r * 4, d = new Float32Array(a), l = r * r * 4 * 4, c = d.byteLength;
4309
+ c !== l && console.error("Texture data size mismatch:", {
4081
4310
  pointsTextureSize: r,
4082
- expectedBytes: d,
4311
+ expectedBytes: l,
4083
4312
  actualBytes: c,
4084
4313
  textureDataSize: a,
4085
- dataLength: l.length
4314
+ dataLength: d.length
4086
4315
  });
4087
- let f = s;
4088
- s === void 0 && !n && (f = !0), this.shouldSkipRescale && (f = !1), f ? this.rescaleInitialNodePositions() : this.shouldSkipRescale || (this.scaleX = void 0, this.scaleY = void 0), this.shouldSkipRescale = void 0;
4316
+ let h = s;
4317
+ s === void 0 && !n && (h = !0), this.shouldSkipRescale && (h = !1), h ? this.rescaleInitialNodePositions() : this.shouldSkipRescale || (this.scaleX = void 0, this.scaleY = void 0), this.shouldSkipRescale = void 0;
4089
4318
  for (let _ = 0; _ < o.pointsNumber; ++_)
4090
- l[_ * 4 + 0] = o.pointPositions[_ * 2 + 0], l[_ * 4 + 1] = o.pointPositions[_ * 2 + 1], l[_ * 4 + 2] = _;
4319
+ d[_ * 4 + 0] = o.pointPositions[_ * 2 + 0], d[_ * 4 + 1] = o.pointPositions[_ * 2 + 1], d[_ * 4 + 2] = _;
4091
4320
  if (!this.currentPositionTexture || this.currentPositionTexture.width !== r || this.currentPositionTexture.height !== r ? (this.currentPositionTexture && !this.currentPositionTexture.destroyed && this.currentPositionTexture.destroy(), this.currentPositionFbo && !this.currentPositionFbo.destroyed && this.currentPositionFbo.destroy(), this.currentPositionTexture = t.createTexture({
4092
4321
  width: r,
4093
4322
  height: r,
4094
4323
  format: "rgba32float"
4095
4324
  }), this.currentPositionTexture.copyImageData({
4096
- data: l,
4097
- bytesPerRow: T("rgba32float", r),
4325
+ data: d,
4326
+ bytesPerRow: g("rgba32float", r),
4098
4327
  mipLevel: 0,
4099
4328
  x: 0,
4100
4329
  y: 0
@@ -4103,8 +4332,8 @@ class At extends w {
4103
4332
  height: r,
4104
4333
  colorAttachments: [this.currentPositionTexture]
4105
4334
  })) : this.currentPositionTexture.copyImageData({
4106
- data: l,
4107
- bytesPerRow: T("rgba32float", r),
4335
+ data: d,
4336
+ bytesPerRow: g("rgba32float", r),
4108
4337
  mipLevel: 0,
4109
4338
  x: 0,
4110
4339
  y: 0
@@ -4113,8 +4342,8 @@ class At extends w {
4113
4342
  height: r,
4114
4343
  format: "rgba32float"
4115
4344
  }), this.previousPositionTexture.copyImageData({
4116
- data: l,
4117
- bytesPerRow: T("rgba32float", r),
4345
+ data: d,
4346
+ bytesPerRow: g("rgba32float", r),
4118
4347
  mipLevel: 0,
4119
4348
  x: 0,
4120
4349
  y: 0
@@ -4123,8 +4352,8 @@ class At extends w {
4123
4352
  height: r,
4124
4353
  colorAttachments: [this.previousPositionTexture]
4125
4354
  })) : this.previousPositionTexture.copyImageData({
4126
- data: l,
4127
- bytesPerRow: T("rgba32float", r),
4355
+ data: d,
4356
+ bytesPerRow: g("rgba32float", r),
4128
4357
  mipLevel: 0,
4129
4358
  x: 0,
4130
4359
  y: 0
@@ -4136,7 +4365,7 @@ class At extends w {
4136
4365
  format: "rgba32float"
4137
4366
  }), this.velocityTexture.copyImageData({
4138
4367
  data: _,
4139
- bytesPerRow: T("rgba32float", r),
4368
+ bytesPerRow: g("rgba32float", r),
4140
4369
  mipLevel: 0,
4141
4370
  x: 0,
4142
4371
  y: 0
@@ -4146,7 +4375,7 @@ class At extends w {
4146
4375
  colorAttachments: [this.velocityTexture]
4147
4376
  })) : this.velocityTexture.copyImageData({
4148
4377
  data: _,
4149
- bytesPerRow: T("rgba32float", r),
4378
+ bytesPerRow: g("rgba32float", r),
4150
4379
  mipLevel: 0,
4151
4380
  x: 0,
4152
4381
  y: 0
@@ -4157,8 +4386,8 @@ class At extends w {
4157
4386
  height: r,
4158
4387
  format: "rgba32float"
4159
4388
  }), this.selectedTexture.copyImageData({
4160
- data: l,
4161
- bytesPerRow: T("rgba32float", r),
4389
+ data: d,
4390
+ bytesPerRow: g("rgba32float", r),
4162
4391
  mipLevel: 0,
4163
4392
  x: 0,
4164
4393
  y: 0
@@ -4167,8 +4396,8 @@ class At extends w {
4167
4396
  height: r,
4168
4397
  colorAttachments: [this.selectedTexture]
4169
4398
  })) : this.selectedTexture.copyImageData({
4170
- data: l,
4171
- bytesPerRow: T("rgba32float", r),
4399
+ data: d,
4400
+ bytesPerRow: g("rgba32float", r),
4172
4401
  mipLevel: 0,
4173
4402
  x: 0,
4174
4403
  y: 0
@@ -4210,9 +4439,9 @@ class At extends w {
4210
4439
  spaceSize: o.adjustedSpaceSize ?? 0
4211
4440
  }
4212
4441
  }
4213
- })), this.updatePositionCommand || (this.updatePositionCommand = new A(t, {
4214
- fs: Ct,
4215
- vs: M,
4442
+ })), this.updatePositionCommand || (this.updatePositionCommand = new v(t, {
4443
+ fs: vt,
4444
+ vs: D,
4216
4445
  topology: "triangle-strip",
4217
4446
  vertexCount: 4,
4218
4447
  attributes: {
@@ -4240,13 +4469,13 @@ class At extends w {
4240
4469
  index: "f32"
4241
4470
  },
4242
4471
  defaultUniforms: {
4243
- mousePos: g(o.mousePosition, [0, 0]),
4472
+ mousePos: T(o.mousePosition, [0, 0]),
4244
4473
  index: ((n = o.hoveredPoint) == null ? void 0 : n.index) ?? -1
4245
4474
  }
4246
4475
  }
4247
- })), this.dragPointCommand || (this.dragPointCommand = new A(t, {
4248
- fs: Pt,
4249
- vs: M,
4476
+ })), this.dragPointCommand || (this.dragPointCommand = new v(t, {
4477
+ fs: mt,
4478
+ vs: D,
4250
4479
  topology: "triangle-strip",
4251
4480
  vertexCount: 4,
4252
4481
  attributes: {
@@ -4287,21 +4516,21 @@ class At extends w {
4287
4516
  },
4288
4517
  defaultUniforms: {
4289
4518
  // Order MUST match uniformTypes and shader declaration
4290
- ratio: i.pixelRatio ?? h.pixelRatio,
4519
+ ratio: i.pixelRatio ?? f.pixelRatio,
4291
4520
  transformationMatrix: (() => {
4292
- const l = o.transform ?? [1, 0, 0, 0, 1, 0, 0, 0, 1];
4521
+ const d = o.transform ?? [1, 0, 0, 0, 1, 0, 0, 0, 1];
4293
4522
  return [
4294
- l[0],
4295
- l[1],
4296
- l[2],
4523
+ d[0],
4524
+ d[1],
4525
+ d[2],
4297
4526
  0,
4298
- l[3],
4299
- l[4],
4300
- l[5],
4527
+ d[3],
4528
+ d[4],
4529
+ d[5],
4301
4530
  0,
4302
- l[6],
4303
- l[7],
4304
- l[8],
4531
+ d[6],
4532
+ d[7],
4533
+ d[8],
4305
4534
  0,
4306
4535
  0,
4307
4536
  0,
@@ -4312,9 +4541,9 @@ class At extends w {
4312
4541
  pointsTextureSize: o.pointsTextureSize ?? 0,
4313
4542
  sizeScale: i.pointSizeScale ?? 1,
4314
4543
  spaceSize: o.adjustedSpaceSize ?? 0,
4315
- screenSize: g(o.screenSize, [0, 0]),
4316
- greyoutColor: I(o.greyoutPointColor, [0, 0, 0, 1]),
4317
- backgroundColor: I(o.backgroundColor, [0, 0, 0, 1]),
4544
+ screenSize: T(o.screenSize, [0, 0]),
4545
+ greyoutColor: m(o.greyoutPointColor, [0, 0, 0, 1]),
4546
+ backgroundColor: m(o.backgroundColor, [0, 0, 0, 1]),
4318
4547
  scalePointsOnZoom: i.scalePointsOnZoom ?? !0 ? 1 : 0,
4319
4548
  // Convert boolean to float
4320
4549
  maxPointSize: o.maxPointSize ?? 100,
@@ -4342,12 +4571,12 @@ class At extends w {
4342
4571
  pointOpacity: i.pointOpacity ?? 1,
4343
4572
  isDarkenGreyout: o.isDarkenGreyout ?? !1 ? 1 : 0,
4344
4573
  // Convert boolean to float
4345
- backgroundColor: I(o.backgroundColor, [0, 0, 0, 1])
4574
+ backgroundColor: m(o.backgroundColor, [0, 0, 0, 1])
4346
4575
  }
4347
4576
  }
4348
- })), this.drawCommand || (this.drawCommand = new A(t, {
4349
- fs: lt,
4350
- vs: ct,
4577
+ })), this.drawCommand || (this.drawCommand = new v(t, {
4578
+ fs: ut,
4579
+ vs: St,
4351
4580
  topology: "point-list",
4352
4581
  vertexCount: s.pointsNumber ?? 0,
4353
4582
  attributes: {
@@ -4406,18 +4635,18 @@ class At extends w {
4406
4635
  defaultUniforms: {
4407
4636
  sizeScale: i.pointSizeScale ?? 1,
4408
4637
  spaceSize: o.adjustedSpaceSize ?? 0,
4409
- screenSize: g(o.screenSize, [0, 0]),
4410
- ratio: i.pixelRatio ?? h.pixelRatio,
4638
+ screenSize: T(o.screenSize, [0, 0]),
4639
+ ratio: i.pixelRatio ?? f.pixelRatio,
4411
4640
  transformationMatrix: o.transformationMatrix4x4,
4412
- selection0: g((r = o.selectedArea) == null ? void 0 : r[0], [0, 0]),
4413
- selection1: g((a = o.selectedArea) == null ? void 0 : a[1], [0, 0]),
4641
+ selection0: T((r = o.selectedArea) == null ? void 0 : r[0], [0, 0]),
4642
+ selection1: T((a = o.selectedArea) == null ? void 0 : a[1], [0, 0]),
4414
4643
  scalePointsOnZoom: i.scalePointsOnZoom ?? !0 ? 1 : 0,
4415
4644
  maxPointSize: o.maxPointSize ?? 100
4416
4645
  }
4417
4646
  }
4418
- })), this.findPointsOnAreaSelectionCommand || (this.findPointsOnAreaSelectionCommand = new A(t, {
4419
- fs: ht,
4420
- vs: M,
4647
+ })), this.findPointsOnAreaSelectionCommand || (this.findPointsOnAreaSelectionCommand = new v(t, {
4648
+ fs: pt,
4649
+ vs: D,
4421
4650
  topology: "triangle-strip",
4422
4651
  vertexCount: 4,
4423
4652
  attributes: {
@@ -4448,14 +4677,14 @@ class At extends w {
4448
4677
  },
4449
4678
  defaultUniforms: {
4450
4679
  spaceSize: o.adjustedSpaceSize ?? 0,
4451
- screenSize: g(o.screenSize, [0, 0]),
4680
+ screenSize: T(o.screenSize, [0, 0]),
4452
4681
  transformationMatrix: o.transformationMatrix4x4,
4453
4682
  polygonPathLength: this.polygonPathLength
4454
4683
  }
4455
4684
  }
4456
- })), this.findPointsOnPolygonSelectionCommand || (this.findPointsOnPolygonSelectionCommand = new A(t, {
4457
- fs: ft,
4458
- vs: M,
4685
+ })), this.findPointsOnPolygonSelectionCommand || (this.findPointsOnPolygonSelectionCommand = new v(t, {
4686
+ fs: _t,
4687
+ vs: D,
4459
4688
  topology: "triangle-strip",
4460
4689
  vertexCount: 4,
4461
4690
  attributes: {
@@ -4493,19 +4722,19 @@ class At extends w {
4493
4722
  pointsTextureSize: o.pointsTextureSize ?? 0,
4494
4723
  sizeScale: i.pointSizeScale ?? 1,
4495
4724
  spaceSize: o.adjustedSpaceSize ?? 0,
4496
- screenSize: g(o.screenSize, [0, 0]),
4497
- ratio: i.pixelRatio ?? h.pixelRatio,
4725
+ screenSize: T(o.screenSize, [0, 0]),
4726
+ ratio: i.pixelRatio ?? f.pixelRatio,
4498
4727
  transformationMatrix: o.transformationMatrix4x4,
4499
- mousePosition: g(o.screenMousePosition, [0, 0]),
4728
+ mousePosition: T(o.screenMousePosition, [0, 0]),
4500
4729
  scalePointsOnZoom: i.scalePointsOnZoom ?? !0 ? 1 : 0,
4501
4730
  maxPointSize: o.maxPointSize ?? 100,
4502
4731
  skipSelected: 0,
4503
4732
  skipUnselected: 0
4504
4733
  }
4505
4734
  }
4506
- })), this.findHoveredPointCommand || (this.findHoveredPointCommand = new A(t, {
4507
- fs: pt,
4508
- vs: _t,
4735
+ })), this.findHoveredPointCommand || (this.findHoveredPointCommand = new v(t, {
4736
+ fs: Ct,
4737
+ vs: Pt,
4509
4738
  topology: "point-list",
4510
4739
  vertexCount: s.pointsNumber ?? 0,
4511
4740
  attributes: {
@@ -4544,12 +4773,12 @@ class At extends w {
4544
4773
  pointsTextureSize: o.pointsTextureSize ?? 0,
4545
4774
  transformationMatrix: o.transformationMatrix4x4,
4546
4775
  spaceSize: o.adjustedSpaceSize ?? 0,
4547
- screenSize: g(o.screenSize, [0, 0])
4776
+ screenSize: T(o.screenSize, [0, 0])
4548
4777
  }
4549
4778
  }
4550
- })), this.fillSampledPointsFboCommand || (this.fillSampledPointsFboCommand = new A(t, {
4551
- fs: Tt,
4552
- vs: gt,
4779
+ })), this.fillSampledPointsFboCommand || (this.fillSampledPointsFboCommand = new v(t, {
4780
+ fs: Rt,
4781
+ vs: xt,
4553
4782
  topology: "point-list",
4554
4783
  vertexCount: s.pointsNumber ?? 0,
4555
4784
  attributes: {
@@ -4602,7 +4831,7 @@ class At extends w {
4602
4831
  pointsTextureSize: o.pointsTextureSize ?? 0,
4603
4832
  sizeScale: i.pointSizeScale ?? 1,
4604
4833
  spaceSize: o.adjustedSpaceSize ?? 0,
4605
- screenSize: g(o.screenSize, [0, 0]),
4834
+ screenSize: T(o.screenSize, [0, 0]),
4606
4835
  scalePointsOnZoom: i.scalePointsOnZoom ?? !0 ? 1 : 0,
4607
4836
  pointIndex: -1,
4608
4837
  maxPointSize: o.maxPointSize ?? 100,
@@ -4610,14 +4839,14 @@ class At extends w {
4610
4839
  universalPointOpacity: i.pointOpacity ?? 1,
4611
4840
  greyoutOpacity: i.pointGreyoutOpacity ?? -1,
4612
4841
  isDarkenGreyout: o.isDarkenGreyout ?? !1 ? 1 : 0,
4613
- backgroundColor: I(o.backgroundColor, [0, 0, 0, 1]),
4614
- greyoutColor: I(o.greyoutPointColor, [0, 0, 0, 1]),
4842
+ backgroundColor: m(o.backgroundColor, [0, 0, 0, 1]),
4843
+ greyoutColor: m(o.greyoutPointColor, [0, 0, 0, 1]),
4615
4844
  width: 0.85
4616
4845
  }
4617
4846
  }
4618
- })), this.drawHighlightedCommand || (this.drawHighlightedCommand = new A(t, {
4619
- fs: ut,
4620
- vs: St,
4847
+ })), this.drawHighlightedCommand || (this.drawHighlightedCommand = new v(t, {
4848
+ fs: Tt,
4849
+ vs: gt,
4621
4850
  topology: "triangle-strip",
4622
4851
  vertexCount: 4,
4623
4852
  attributes: {
@@ -4658,9 +4887,9 @@ class At extends w {
4658
4887
  pointsTextureSize: o.pointsTextureSize ?? 0
4659
4888
  }
4660
4889
  }
4661
- })), this.trackPointsCommand || (this.trackPointsCommand = new A(t, {
4662
- fs: Rt,
4663
- vs: M,
4890
+ })), this.trackPointsCommand || (this.trackPointsCommand = new v(t, {
4891
+ fs: At,
4892
+ vs: D,
4664
4893
  topology: "triangle-strip",
4665
4894
  vertexCount: 4,
4666
4895
  attributes: {
@@ -4704,13 +4933,13 @@ class At extends w {
4704
4933
  format: "rgba32float"
4705
4934
  }), this.greyoutStatusTexture.copyImageData({
4706
4935
  data: s,
4707
- bytesPerRow: T("rgba32float", o),
4936
+ bytesPerRow: g("rgba32float", o),
4708
4937
  mipLevel: 0,
4709
4938
  x: 0,
4710
4939
  y: 0
4711
4940
  })) : this.greyoutStatusTexture.copyImageData({
4712
4941
  data: s,
4713
- bytesPerRow: T("rgba32float", o),
4942
+ bytesPerRow: g("rgba32float", o),
4714
4943
  mipLevel: 0,
4715
4944
  x: 0,
4716
4945
  y: 0
@@ -4729,13 +4958,13 @@ class At extends w {
4729
4958
  format: "rgba32float"
4730
4959
  }), this.pinnedStatusTexture.copyImageData({
4731
4960
  data: s,
4732
- bytesPerRow: T("rgba32float", i),
4961
+ bytesPerRow: g("rgba32float", i),
4733
4962
  mipLevel: 0,
4734
4963
  x: 0,
4735
4964
  y: 0
4736
4965
  })) : this.pinnedStatusTexture.copyImageData({
4737
4966
  data: s,
4738
- bytesPerRow: T("rgba32float", i),
4967
+ bytesPerRow: g("rgba32float", i),
4739
4968
  mipLevel: 0,
4740
4969
  x: 0,
4741
4970
  y: 0
@@ -4760,13 +4989,13 @@ class At extends w {
4760
4989
  format: "rgba32float"
4761
4990
  }), this.sizeTexture.copyImageData({
4762
4991
  data: r,
4763
- bytesPerRow: T("rgba32float", i),
4992
+ bytesPerRow: g("rgba32float", i),
4764
4993
  mipLevel: 0,
4765
4994
  x: 0,
4766
4995
  y: 0
4767
4996
  })) : this.sizeTexture.copyImageData({
4768
4997
  data: r,
4769
- bytesPerRow: T("rgba32float", i),
4998
+ bytesPerRow: g("rgba32float", i),
4770
4999
  mipLevel: 0,
4771
5000
  x: 0,
4772
5001
  y: 0
@@ -4806,9 +5035,9 @@ class At extends w {
4806
5035
  });
4807
5036
  }
4808
5037
  createAtlas() {
4809
- var d;
5038
+ var l;
4810
5039
  const { device: t, data: i, store: o } = this;
4811
- if (!((d = i.inputImageData) != null && d.length)) {
5040
+ if (!((l = i.inputImageData) != null && l.length)) {
4812
5041
  this.imageCount = 0, this.imageAtlasCoordsTextureSize = 0, this.imageAtlasCoordsTexture || (this.imageAtlasCoordsTexture = t.createTexture({
4813
5042
  data: new Float32Array(4).fill(0),
4814
5043
  width: 1,
@@ -4822,32 +5051,32 @@ class At extends w {
4822
5051
  }));
4823
5052
  return;
4824
5053
  }
4825
- const s = xt(i.inputImageData, o.webglMaxTextureSize);
5054
+ const s = It(i.inputImageData, o.webglMaxTextureSize);
4826
5055
  if (!s) {
4827
5056
  console.warn("Failed to create atlas from image data");
4828
5057
  return;
4829
5058
  }
4830
5059
  this.imageCount = i.inputImageData.length;
4831
- const { atlasData: n, atlasSize: r, atlasCoords: a, atlasCoordsSize: l } = s;
4832
- this.imageAtlasCoordsTextureSize = l, this.imageAtlasTexture && !this.imageAtlasTexture.destroyed && this.imageAtlasTexture.destroy(), this.imageAtlasTexture = t.createTexture({
5060
+ const { atlasData: n, atlasSize: r, atlasCoords: a, atlasCoordsSize: d } = s;
5061
+ this.imageAtlasCoordsTextureSize = d, this.imageAtlasTexture && !this.imageAtlasTexture.destroyed && this.imageAtlasTexture.destroy(), this.imageAtlasTexture = t.createTexture({
4833
5062
  width: r,
4834
5063
  height: r,
4835
5064
  format: "rgba8unorm"
4836
5065
  }), this.imageAtlasTexture.copyImageData({
4837
5066
  data: n,
4838
- bytesPerRow: T("rgba8unorm", r),
5067
+ bytesPerRow: g("rgba8unorm", r),
4839
5068
  rowsPerImage: r,
4840
5069
  mipLevel: 0,
4841
5070
  x: 0,
4842
5071
  y: 0
4843
5072
  }), this.imageAtlasCoordsTexture && !this.imageAtlasCoordsTexture.destroyed && this.imageAtlasCoordsTexture.destroy(), this.imageAtlasCoordsTexture = t.createTexture({
4844
- width: l,
4845
- height: l,
5073
+ width: d,
5074
+ height: d,
4846
5075
  format: "rgba32float"
4847
5076
  }), this.imageAtlasCoordsTexture.copyImageData({
4848
5077
  data: a,
4849
- bytesPerRow: T("rgba32float", l),
4850
- rowsPerImage: l,
5078
+ bytesPerRow: g("rgba32float", d),
5079
+ rowsPerImage: d,
4851
5080
  mipLevel: 0,
4852
5081
  x: 0,
4853
5082
  y: 0
@@ -4856,9 +5085,9 @@ class At extends w {
4856
5085
  updateSampledPointsGrid() {
4857
5086
  const { store: { screenSize: t }, config: { pointSamplingDistance: i }, device: o } = this;
4858
5087
  let s = i ?? Math.min(...t) / 2;
4859
- s === 0 && (s = h.pointSamplingDistance);
5088
+ s === 0 && (s = f.pointSamplingDistance);
4860
5089
  const n = Math.ceil(t[0] / s), r = Math.ceil(t[1] / s);
4861
- (!this.sampledPointsFbo || this.sampledPointsFbo.width !== n || this.sampledPointsFbo.height !== r) && (this.sampledPointsFbo && !this.sampledPointsFbo.destroyed && this.sampledPointsFbo.destroy(), this.sampledPointsFbo = o.createFramebuffer({
5090
+ n === 0 || r === 0 || (!this.sampledPointsFbo || this.sampledPointsFbo.width !== n || this.sampledPointsFbo.height !== r) && (this.sampledPointsFbo && !this.sampledPointsFbo.destroyed && this.sampledPointsFbo.destroy(), this.sampledPointsFbo = o.createFramebuffer({
4862
5091
  width: n,
4863
5092
  height: r,
4864
5093
  colorAttachments: ["rgba32float"]
@@ -4881,20 +5110,20 @@ class At extends w {
4881
5110
  this.trackPointsCommand.draw(t), t.end();
4882
5111
  }
4883
5112
  draw(t) {
4884
- var a, l;
5113
+ var a, d;
4885
5114
  const { data: i, config: o, store: s } = this;
4886
5115
  if (this.colorBuffer || this.updateColor(), this.sizeBuffer || this.updateSize(), this.shapeBuffer || this.updateShape(), this.imageIndicesBuffer || this.updateImageIndices(), this.imageSizesBuffer || this.updateImageSizes(), !this.drawCommand || !this.drawUniformStore || !this.currentPositionTexture || this.currentPositionTexture.destroyed || !this.greyoutStatusTexture || this.greyoutStatusTexture.destroyed || (!this.imageAtlasTexture || !this.imageAtlasCoordsTexture) && (this.createAtlas(), !this.imageAtlasTexture || !this.imageAtlasCoordsTexture) || this.imageAtlasTexture.destroyed || this.imageAtlasCoordsTexture.destroyed || !i.pointsNumber || i.pointsNumber === 0 || !s.screenSize || s.screenSize[0] === 0 || s.screenSize[1] === 0)
4887
5116
  return;
4888
5117
  this.drawCommand.setVertexCount(i.pointsNumber);
4889
5118
  const n = {
4890
- ratio: o.pixelRatio ?? h.pixelRatio,
5119
+ ratio: o.pixelRatio ?? f.pixelRatio,
4891
5120
  transformationMatrix: s.transformationMatrix4x4,
4892
5121
  pointsTextureSize: s.pointsTextureSize ?? 0,
4893
5122
  sizeScale: o.pointSizeScale ?? 1,
4894
5123
  spaceSize: s.adjustedSpaceSize ?? 0,
4895
- screenSize: g(s.screenSize, [0, 0]),
4896
- greyoutColor: I(s.greyoutPointColor, [-1, -1, -1, -1]),
4897
- backgroundColor: I(s.backgroundColor, [0, 0, 0, 1]),
5124
+ screenSize: T(s.screenSize, [0, 0]),
5125
+ greyoutColor: m(s.greyoutPointColor, [-1, -1, -1, -1]),
5126
+ backgroundColor: m(s.backgroundColor, [0, 0, 0, 1]),
4898
5127
  scalePointsOnZoom: o.scalePointsOnZoom ?? !0 ? 1 : 0,
4899
5128
  // Convert boolean to float
4900
5129
  maxPointSize: s.maxPointSize ?? 100,
@@ -4909,7 +5138,7 @@ class At extends w {
4909
5138
  pointOpacity: o.pointOpacity ?? 1,
4910
5139
  isDarkenGreyout: s.isDarkenGreyout ?? !1 ? 1 : 0,
4911
5140
  // Convert boolean to float
4912
- backgroundColor: I(s.backgroundColor, [0, 0, 0, 1])
5141
+ backgroundColor: m(s.backgroundColor, [0, 0, 0, 1])
4913
5142
  };
4914
5143
  if (s.selectedIndices && s.selectedIndices.length > 0 ? (this.drawUniformStore.setUniforms({
4915
5144
  drawVertexUniforms: {
@@ -4955,24 +5184,24 @@ class At extends w {
4955
5184
  imageAtlasCoords: this.imageAtlasCoordsTexture
4956
5185
  }), this.drawCommand.draw(t)), o.renderHoveredPointRing && s.hoveredPoint && this.drawHighlightedCommand && this.drawHighlightedUniformStore) {
4957
5186
  if (!this.currentPositionTexture || this.currentPositionTexture.destroyed || !this.greyoutStatusTexture || this.greyoutStatusTexture.destroyed) return;
4958
- const d = ((a = i.pointSizes) == null ? void 0 : a[s.hoveredPoint.index]) ?? 1;
5187
+ const l = ((a = i.pointSizes) == null ? void 0 : a[s.hoveredPoint.index]) ?? 1;
4959
5188
  this.drawHighlightedUniformStore.setUniforms({
4960
5189
  drawHighlightedUniforms: {
4961
- size: d,
5190
+ size: l,
4962
5191
  transformationMatrix: s.transformationMatrix4x4,
4963
5192
  pointsTextureSize: s.pointsTextureSize ?? 0,
4964
5193
  sizeScale: o.pointSizeScale ?? 1,
4965
5194
  spaceSize: s.adjustedSpaceSize ?? 0,
4966
- screenSize: g(s.screenSize, [0, 0]),
5195
+ screenSize: T(s.screenSize, [0, 0]),
4967
5196
  scalePointsOnZoom: o.scalePointsOnZoom ?? !0 ? 1 : 0,
4968
5197
  pointIndex: s.hoveredPoint.index,
4969
5198
  maxPointSize: s.maxPointSize ?? 100,
4970
- color: I(s.hoveredPointRingColor, [0, 0, 0, 1]),
5199
+ color: m(s.hoveredPointRingColor, [0, 0, 0, 1]),
4971
5200
  universalPointOpacity: o.pointOpacity ?? 1,
4972
5201
  greyoutOpacity: o.pointGreyoutOpacity ?? -1,
4973
5202
  isDarkenGreyout: s.isDarkenGreyout ?? !1 ? 1 : 0,
4974
- backgroundColor: I(s.backgroundColor, [0, 0, 0, 1]),
4975
- greyoutColor: I(s.greyoutPointColor, [0, 0, 0, 1]),
5203
+ backgroundColor: m(s.backgroundColor, [0, 0, 0, 1]),
5204
+ greyoutColor: m(s.greyoutPointColor, [0, 0, 0, 1]),
4976
5205
  width: 0.85
4977
5206
  }
4978
5207
  }), this.drawHighlightedCommand.setBindings({
@@ -4982,24 +5211,24 @@ class At extends w {
4982
5211
  }
4983
5212
  if (s.focusedPoint && this.drawHighlightedCommand && this.drawHighlightedUniformStore) {
4984
5213
  if (!this.currentPositionTexture || this.currentPositionTexture.destroyed || !this.greyoutStatusTexture || this.greyoutStatusTexture.destroyed) return;
4985
- const d = ((l = i.pointSizes) == null ? void 0 : l[s.focusedPoint.index]) ?? 1;
5214
+ const l = ((d = i.pointSizes) == null ? void 0 : d[s.focusedPoint.index]) ?? 1;
4986
5215
  this.drawHighlightedUniformStore.setUniforms({
4987
5216
  drawHighlightedUniforms: {
4988
- size: d,
5217
+ size: l,
4989
5218
  transformationMatrix: s.transformationMatrix4x4,
4990
5219
  pointsTextureSize: s.pointsTextureSize ?? 0,
4991
5220
  sizeScale: o.pointSizeScale ?? 1,
4992
5221
  spaceSize: s.adjustedSpaceSize ?? 0,
4993
- screenSize: g(s.screenSize, [0, 0]),
5222
+ screenSize: T(s.screenSize, [0, 0]),
4994
5223
  scalePointsOnZoom: o.scalePointsOnZoom ?? !0 ? 1 : 0,
4995
5224
  pointIndex: s.focusedPoint.index,
4996
5225
  maxPointSize: s.maxPointSize ?? 100,
4997
- color: I(s.focusedPointRingColor, [0, 0, 0, 1]),
5226
+ color: m(s.focusedPointRingColor, [0, 0, 0, 1]),
4998
5227
  universalPointOpacity: o.pointOpacity ?? 1,
4999
5228
  greyoutOpacity: o.pointGreyoutOpacity ?? -1,
5000
5229
  isDarkenGreyout: s.isDarkenGreyout ?? !1 ? 1 : 0,
5001
- backgroundColor: I(s.backgroundColor, [0, 0, 0, 1]),
5002
- greyoutColor: I(s.greyoutPointColor, [0, 0, 0, 1]),
5230
+ backgroundColor: m(s.backgroundColor, [0, 0, 0, 1]),
5231
+ greyoutColor: m(s.greyoutPointColor, [0, 0, 0, 1]),
5003
5232
  width: 0.85
5004
5233
  }
5005
5234
  }), this.drawHighlightedCommand.setBindings({
@@ -5030,7 +5259,7 @@ class At extends w {
5030
5259
  if (!this.dragPointCommand || !this.dragPointUniformStore || !this.currentPositionFbo || this.currentPositionFbo.destroyed || !this.previousPositionTexture || this.previousPositionTexture.destroyed) return;
5031
5260
  this.dragPointUniformStore.setUniforms({
5032
5261
  dragPointUniforms: {
5033
- mousePos: g(this.store.mousePosition, [0, 0]),
5262
+ mousePos: T(this.store.mousePosition, [0, 0]),
5034
5263
  index: ((i = this.store.hoveredPoint) == null ? void 0 : i.index) ?? -1
5035
5264
  }
5036
5265
  }), this.dragPointCommand.setBindings({
@@ -5047,12 +5276,12 @@ class At extends w {
5047
5276
  this.findPointsOnAreaSelectionUniformStore.setUniforms({
5048
5277
  findPointsOnAreaSelectionUniforms: {
5049
5278
  spaceSize: this.store.adjustedSpaceSize ?? 0,
5050
- screenSize: g(this.store.screenSize, [0, 0]),
5279
+ screenSize: T(this.store.screenSize, [0, 0]),
5051
5280
  sizeScale: this.config.pointSizeScale ?? 1,
5052
5281
  transformationMatrix: this.store.transformationMatrix4x4,
5053
- ratio: this.config.pixelRatio ?? h.pixelRatio,
5054
- selection0: g((i = this.store.selectedArea) == null ? void 0 : i[0], [0, 0]),
5055
- selection1: g((o = this.store.selectedArea) == null ? void 0 : o[1], [0, 0]),
5282
+ ratio: this.config.pixelRatio ?? f.pixelRatio,
5283
+ selection0: T((i = this.store.selectedArea) == null ? void 0 : i[0], [0, 0]),
5284
+ selection1: T((o = this.store.selectedArea) == null ? void 0 : o[1], [0, 0]),
5056
5285
  scalePointsOnZoom: this.config.scalePointsOnZoom ?? !0 ? 1 : 0,
5057
5286
  // Convert boolean to number
5058
5287
  maxPointSize: this.store.maxPointSize ?? 100
@@ -5071,7 +5300,7 @@ class At extends w {
5071
5300
  this.findPointsOnPolygonSelectionUniformStore.setUniforms({
5072
5301
  findPointsOnPolygonSelectionUniforms: {
5073
5302
  spaceSize: this.store.adjustedSpaceSize ?? 0,
5074
- screenSize: g(this.store.screenSize, [0, 0]),
5303
+ screenSize: T(this.store.screenSize, [0, 0]),
5075
5304
  transformationMatrix: this.store.transformationMatrix4x4,
5076
5305
  polygonPathLength: this.polygonPathLength
5077
5306
  }
@@ -5092,8 +5321,8 @@ class At extends w {
5092
5321
  }
5093
5322
  const o = Math.ceil(Math.sqrt(t.length)), s = new Float32Array(o * o * 4);
5094
5323
  for (const [n, r] of t.entries()) {
5095
- const [a, l] = r;
5096
- s[n * 4] = a, s[n * 4 + 1] = l, s[n * 4 + 2] = 0, s[n * 4 + 3] = 0;
5324
+ const [a, d] = r;
5325
+ s[n * 4] = a, s[n * 4 + 1] = d, s[n * 4 + 2] = 0, s[n * 4 + 3] = 0;
5097
5326
  }
5098
5327
  !this.polygonPathTexture || this.polygonPathTexture.width !== o || this.polygonPathTexture.height !== o ? (this.polygonPathTexture && !this.polygonPathTexture.destroyed && this.polygonPathTexture.destroy(), this.polygonPathTexture = i.createTexture({
5099
5328
  width: o,
@@ -5101,13 +5330,13 @@ class At extends w {
5101
5330
  format: "rgba32float"
5102
5331
  }), this.polygonPathTexture.copyImageData({
5103
5332
  data: s,
5104
- bytesPerRow: T("rgba32float", o),
5333
+ bytesPerRow: g("rgba32float", o),
5105
5334
  mipLevel: 0,
5106
5335
  x: 0,
5107
5336
  y: 0
5108
5337
  })) : this.polygonPathTexture.copyImageData({
5109
5338
  data: s,
5110
- bytesPerRow: T("rgba32float", o),
5339
+ bytesPerRow: g("rgba32float", o),
5111
5340
  mipLevel: 0,
5112
5341
  x: 0,
5113
5342
  y: 0
@@ -5120,14 +5349,14 @@ class At extends w {
5120
5349
  ...this.sizeBuffer && { size: this.sizeBuffer }
5121
5350
  });
5122
5351
  const t = {
5123
- ratio: this.config.pixelRatio ?? h.pixelRatio,
5352
+ ratio: this.config.pixelRatio ?? f.pixelRatio,
5124
5353
  sizeScale: this.config.pointSizeScale ?? 1,
5125
5354
  pointsTextureSize: this.store.pointsTextureSize ?? 0,
5126
5355
  transformationMatrix: this.store.transformationMatrix4x4,
5127
5356
  spaceSize: this.store.adjustedSpaceSize ?? 0,
5128
- screenSize: g(this.store.screenSize, [0, 0]),
5357
+ screenSize: T(this.store.screenSize, [0, 0]),
5129
5358
  scalePointsOnZoom: this.config.scalePointsOnZoom ?? !0 ? 1 : 0,
5130
- mousePosition: g(this.store.screenMousePosition, [0, 0]),
5359
+ mousePosition: T(this.store.screenMousePosition, [0, 0]),
5131
5360
  maxPointSize: this.store.maxPointSize ?? 100
5132
5361
  }, i = {
5133
5362
  positionsTexture: this.currentPositionTexture,
@@ -5168,13 +5397,13 @@ class At extends w {
5168
5397
  format: "rgba32float"
5169
5398
  }), this.trackedIndicesTexture.copyImageData({
5170
5399
  data: n,
5171
- bytesPerRow: T("rgba32float", s),
5400
+ bytesPerRow: g("rgba32float", s),
5172
5401
  mipLevel: 0,
5173
5402
  x: 0,
5174
5403
  y: 0
5175
5404
  })) : this.trackedIndicesTexture.copyImageData({
5176
5405
  data: n,
5177
- bytesPerRow: T("rgba32float", s),
5406
+ bytesPerRow: g("rgba32float", s),
5178
5407
  mipLevel: 0,
5179
5408
  x: 0,
5180
5409
  y: 0
@@ -5198,10 +5427,10 @@ class At extends w {
5198
5427
  if ((!t || !i) && this.isPositionsUpToDate && this.trackedPositions)
5199
5428
  return this.trackedPositions;
5200
5429
  if (!this.trackedPositionsFbo || this.trackedPositionsFbo.destroyed) return /* @__PURE__ */ new Map();
5201
- const o = N(this.device, this.trackedPositionsFbo), s = /* @__PURE__ */ new Map();
5430
+ const o = y(this.device, this.trackedPositionsFbo), s = /* @__PURE__ */ new Map();
5202
5431
  for (let n = 0; n < o.length / 4; n += 1) {
5203
- const r = o[n * 4], a = o[n * 4 + 1], l = this.trackedIndices[n];
5204
- r !== void 0 && a !== void 0 && l !== void 0 && s.set(l, [r, a]);
5432
+ const r = o[n * 4], a = o[n * 4 + 1], d = this.trackedIndices[n];
5433
+ r !== void 0 && a !== void 0 && d !== void 0 && s.set(d, [r, a]);
5205
5434
  }
5206
5435
  return (!t || !i) && (this.trackedPositions = s, this.isPositionsUpToDate = !0), s;
5207
5436
  }
@@ -5215,7 +5444,7 @@ class At extends w {
5215
5444
  pointsTextureSize: this.store.pointsTextureSize ?? 0,
5216
5445
  transformationMatrix: this.store.transformationMatrix4x4,
5217
5446
  spaceSize: this.store.adjustedSpaceSize ?? 0,
5218
- screenSize: g(this.store.screenSize, [0, 0])
5447
+ screenSize: T(this.store.screenSize, [0, 0])
5219
5448
  }
5220
5449
  }), this.fillSampledPointsFboCommand.setBindings({
5221
5450
  positionsTexture: this.currentPositionTexture
@@ -5226,7 +5455,7 @@ class At extends w {
5226
5455
  });
5227
5456
  this.fillSampledPointsFboCommand.draw(o), o.end();
5228
5457
  }
5229
- const i = N(this.device, this.sampledPointsFbo);
5458
+ const i = y(this.device, this.sampledPointsFbo);
5230
5459
  for (let o = 0; o < i.length / 4; o++) {
5231
5460
  const s = i[o * 4], n = !!i[o * 4 + 1], r = i[o * 4 + 2], a = i[o * 4 + 3];
5232
5461
  n && s !== void 0 && r !== void 0 && a !== void 0 && t.set(s, [r, a]);
@@ -5243,7 +5472,7 @@ class At extends w {
5243
5472
  pointsTextureSize: this.store.pointsTextureSize ?? 0,
5244
5473
  transformationMatrix: this.store.transformationMatrix4x4,
5245
5474
  spaceSize: this.store.adjustedSpaceSize ?? 0,
5246
- screenSize: g(this.store.screenSize, [0, 0])
5475
+ screenSize: T(this.store.screenSize, [0, 0])
5247
5476
  }
5248
5477
  }), this.fillSampledPointsFboCommand.setBindings({
5249
5478
  positionsTexture: this.currentPositionTexture
@@ -5254,10 +5483,10 @@ class At extends w {
5254
5483
  });
5255
5484
  this.fillSampledPointsFboCommand.draw(s), s.end();
5256
5485
  }
5257
- const o = N(this.device, this.sampledPointsFbo);
5486
+ const o = y(this.device, this.sampledPointsFbo);
5258
5487
  for (let s = 0; s < o.length / 4; s++) {
5259
- const n = o[s * 4], r = !!o[s * 4 + 1], a = o[s * 4 + 2], l = o[s * 4 + 3];
5260
- r && n !== void 0 && a !== void 0 && l !== void 0 && (t.push(n), i.push(a, l));
5488
+ const n = o[s * 4], r = !!o[s * 4 + 1], a = o[s * 4 + 2], d = o[s * 4 + 3];
5489
+ r && n !== void 0 && a !== void 0 && d !== void 0 && (t.push(n), i.push(a, d));
5261
5490
  }
5262
5491
  return { indices: t, positions: i };
5263
5492
  }
@@ -5265,7 +5494,7 @@ class At extends w {
5265
5494
  const t = [];
5266
5495
  if (!this.trackedIndices || !this.trackedPositionsFbo || this.trackedPositionsFbo.destroyed) return t;
5267
5496
  t.length = this.trackedIndices.length * 2;
5268
- const i = N(this.device, this.trackedPositionsFbo);
5497
+ const i = y(this.device, this.trackedPositionsFbo);
5269
5498
  for (let o = 0; o < i.length / 4; o += 1) {
5270
5499
  const s = i[o * 4], n = i[o * 4 + 1], r = this.trackedIndices[o];
5271
5500
  s !== void 0 && n !== void 0 && r !== void 0 && (t[o * 2] = s, t[o * 2 + 1] = n);
@@ -5277,8 +5506,8 @@ class At extends w {
5277
5506
  * Models -> Framebuffers -> Textures -> UniformStores -> Buffers
5278
5507
  * */
5279
5508
  destroy() {
5280
- var t, i, o, s, n, r, a, l, d, c, f, p, u, _, P, m, R, v;
5281
- (t = this.drawCommand) == null || t.destroy(), this.drawCommand = void 0, (i = this.drawHighlightedCommand) == null || i.destroy(), this.drawHighlightedCommand = void 0, (o = this.updatePositionCommand) == null || o.destroy(), this.updatePositionCommand = void 0, (s = this.dragPointCommand) == null || s.destroy(), this.dragPointCommand = void 0, (n = this.findPointsOnAreaSelectionCommand) == null || n.destroy(), this.findPointsOnAreaSelectionCommand = void 0, (r = this.findPointsOnPolygonSelectionCommand) == null || r.destroy(), this.findPointsOnPolygonSelectionCommand = void 0, (a = this.findHoveredPointCommand) == null || a.destroy(), this.findHoveredPointCommand = void 0, (l = this.fillSampledPointsFboCommand) == null || l.destroy(), this.fillSampledPointsFboCommand = void 0, (d = this.trackPointsCommand) == null || d.destroy(), this.trackPointsCommand = void 0, this.currentPositionFbo && !this.currentPositionFbo.destroyed && this.currentPositionFbo.destroy(), this.currentPositionFbo = void 0, this.previousPositionFbo && !this.previousPositionFbo.destroyed && this.previousPositionFbo.destroy(), this.previousPositionFbo = void 0, this.velocityFbo && !this.velocityFbo.destroyed && this.velocityFbo.destroy(), this.velocityFbo = void 0, this.selectedFbo && !this.selectedFbo.destroyed && this.selectedFbo.destroy(), this.selectedFbo = void 0, this.hoveredFbo && !this.hoveredFbo.destroyed && this.hoveredFbo.destroy(), this.hoveredFbo = void 0, this.trackedPositionsFbo && !this.trackedPositionsFbo.destroyed && this.trackedPositionsFbo.destroy(), this.trackedPositionsFbo = void 0, this.sampledPointsFbo && !this.sampledPointsFbo.destroyed && this.sampledPointsFbo.destroy(), this.sampledPointsFbo = void 0, this.currentPositionTexture && !this.currentPositionTexture.destroyed && this.currentPositionTexture.destroy(), this.currentPositionTexture = void 0, this.previousPositionTexture && !this.previousPositionTexture.destroyed && this.previousPositionTexture.destroy(), this.previousPositionTexture = void 0, this.velocityTexture && !this.velocityTexture.destroyed && this.velocityTexture.destroy(), this.velocityTexture = void 0, this.selectedTexture && !this.selectedTexture.destroyed && this.selectedTexture.destroy(), this.selectedTexture = void 0, this.greyoutStatusTexture && !this.greyoutStatusTexture.destroyed && this.greyoutStatusTexture.destroy(), this.greyoutStatusTexture = void 0, this.sizeTexture && !this.sizeTexture.destroyed && this.sizeTexture.destroy(), this.sizeTexture = void 0, this.trackedIndicesTexture && !this.trackedIndicesTexture.destroyed && this.trackedIndicesTexture.destroy(), this.trackedIndicesTexture = void 0, this.polygonPathTexture && !this.polygonPathTexture.destroyed && this.polygonPathTexture.destroy(), this.polygonPathTexture = void 0, this.imageAtlasTexture && !this.imageAtlasTexture.destroyed && this.imageAtlasTexture.destroy(), this.imageAtlasTexture = void 0, this.imageAtlasCoordsTexture && !this.imageAtlasCoordsTexture.destroyed && this.imageAtlasCoordsTexture.destroy(), this.imageAtlasCoordsTexture = void 0, this.pinnedStatusTexture && !this.pinnedStatusTexture.destroyed && this.pinnedStatusTexture.destroy(), this.pinnedStatusTexture = void 0, (c = this.updatePositionUniformStore) == null || c.destroy(), this.updatePositionUniformStore = void 0, (f = this.dragPointUniformStore) == null || f.destroy(), this.dragPointUniformStore = void 0, (p = this.drawUniformStore) == null || p.destroy(), this.drawUniformStore = void 0, (u = this.findPointsOnAreaSelectionUniformStore) == null || u.destroy(), this.findPointsOnAreaSelectionUniformStore = void 0, (_ = this.findPointsOnPolygonSelectionUniformStore) == null || _.destroy(), this.findPointsOnPolygonSelectionUniformStore = void 0, (P = this.findHoveredPointUniformStore) == null || P.destroy(), this.findHoveredPointUniformStore = void 0, (m = this.fillSampledPointsUniformStore) == null || m.destroy(), this.fillSampledPointsUniformStore = void 0, (R = this.drawHighlightedUniformStore) == null || R.destroy(), this.drawHighlightedUniformStore = void 0, (v = this.trackPointsUniformStore) == null || v.destroy(), this.trackPointsUniformStore = void 0, this.colorBuffer && !this.colorBuffer.destroyed && this.colorBuffer.destroy(), this.colorBuffer = void 0, this.sizeBuffer && !this.sizeBuffer.destroyed && this.sizeBuffer.destroy(), this.sizeBuffer = void 0, this.shapeBuffer && !this.shapeBuffer.destroyed && this.shapeBuffer.destroy(), this.shapeBuffer = void 0, this.imageIndicesBuffer && !this.imageIndicesBuffer.destroyed && this.imageIndicesBuffer.destroy(), this.imageIndicesBuffer = void 0, this.imageSizesBuffer && !this.imageSizesBuffer.destroyed && this.imageSizesBuffer.destroy(), this.imageSizesBuffer = void 0, this.drawPointIndices && !this.drawPointIndices.destroyed && this.drawPointIndices.destroy(), this.drawPointIndices = void 0, this.hoveredPointIndices && !this.hoveredPointIndices.destroyed && this.hoveredPointIndices.destroy(), this.hoveredPointIndices = void 0, this.sampledPointIndices && !this.sampledPointIndices.destroyed && this.sampledPointIndices.destroy(), this.sampledPointIndices = void 0, this.updatePositionVertexCoordBuffer && !this.updatePositionVertexCoordBuffer.destroyed && this.updatePositionVertexCoordBuffer.destroy(), this.updatePositionVertexCoordBuffer = void 0, this.dragPointVertexCoordBuffer && !this.dragPointVertexCoordBuffer.destroyed && this.dragPointVertexCoordBuffer.destroy(), this.dragPointVertexCoordBuffer = void 0, this.findPointsOnAreaSelectionVertexCoordBuffer && !this.findPointsOnAreaSelectionVertexCoordBuffer.destroyed && this.findPointsOnAreaSelectionVertexCoordBuffer.destroy(), this.findPointsOnAreaSelectionVertexCoordBuffer = void 0, this.findPointsOnPolygonSelectionVertexCoordBuffer && !this.findPointsOnPolygonSelectionVertexCoordBuffer.destroyed && this.findPointsOnPolygonSelectionVertexCoordBuffer.destroy(), this.findPointsOnPolygonSelectionVertexCoordBuffer = void 0, this.drawHighlightedVertexCoordBuffer && !this.drawHighlightedVertexCoordBuffer.destroyed && this.drawHighlightedVertexCoordBuffer.destroy(), this.drawHighlightedVertexCoordBuffer = void 0, this.trackPointsVertexCoordBuffer && !this.trackPointsVertexCoordBuffer.destroyed && this.trackPointsVertexCoordBuffer.destroy(), this.trackPointsVertexCoordBuffer = void 0;
5509
+ var t, i, o, s, n, r, a, d, l, c, h, p, u, _, R, I, P, A;
5510
+ (t = this.drawCommand) == null || t.destroy(), this.drawCommand = void 0, (i = this.drawHighlightedCommand) == null || i.destroy(), this.drawHighlightedCommand = void 0, (o = this.updatePositionCommand) == null || o.destroy(), this.updatePositionCommand = void 0, (s = this.dragPointCommand) == null || s.destroy(), this.dragPointCommand = void 0, (n = this.findPointsOnAreaSelectionCommand) == null || n.destroy(), this.findPointsOnAreaSelectionCommand = void 0, (r = this.findPointsOnPolygonSelectionCommand) == null || r.destroy(), this.findPointsOnPolygonSelectionCommand = void 0, (a = this.findHoveredPointCommand) == null || a.destroy(), this.findHoveredPointCommand = void 0, (d = this.fillSampledPointsFboCommand) == null || d.destroy(), this.fillSampledPointsFboCommand = void 0, (l = this.trackPointsCommand) == null || l.destroy(), this.trackPointsCommand = void 0, this.currentPositionFbo && !this.currentPositionFbo.destroyed && this.currentPositionFbo.destroy(), this.currentPositionFbo = void 0, this.previousPositionFbo && !this.previousPositionFbo.destroyed && this.previousPositionFbo.destroy(), this.previousPositionFbo = void 0, this.velocityFbo && !this.velocityFbo.destroyed && this.velocityFbo.destroy(), this.velocityFbo = void 0, this.selectedFbo && !this.selectedFbo.destroyed && this.selectedFbo.destroy(), this.selectedFbo = void 0, this.hoveredFbo && !this.hoveredFbo.destroyed && this.hoveredFbo.destroy(), this.hoveredFbo = void 0, this.trackedPositionsFbo && !this.trackedPositionsFbo.destroyed && this.trackedPositionsFbo.destroy(), this.trackedPositionsFbo = void 0, this.sampledPointsFbo && !this.sampledPointsFbo.destroyed && this.sampledPointsFbo.destroy(), this.sampledPointsFbo = void 0, this.currentPositionTexture && !this.currentPositionTexture.destroyed && this.currentPositionTexture.destroy(), this.currentPositionTexture = void 0, this.previousPositionTexture && !this.previousPositionTexture.destroyed && this.previousPositionTexture.destroy(), this.previousPositionTexture = void 0, this.velocityTexture && !this.velocityTexture.destroyed && this.velocityTexture.destroy(), this.velocityTexture = void 0, this.selectedTexture && !this.selectedTexture.destroyed && this.selectedTexture.destroy(), this.selectedTexture = void 0, this.greyoutStatusTexture && !this.greyoutStatusTexture.destroyed && this.greyoutStatusTexture.destroy(), this.greyoutStatusTexture = void 0, this.sizeTexture && !this.sizeTexture.destroyed && this.sizeTexture.destroy(), this.sizeTexture = void 0, this.trackedIndicesTexture && !this.trackedIndicesTexture.destroyed && this.trackedIndicesTexture.destroy(), this.trackedIndicesTexture = void 0, this.polygonPathTexture && !this.polygonPathTexture.destroyed && this.polygonPathTexture.destroy(), this.polygonPathTexture = void 0, this.imageAtlasTexture && !this.imageAtlasTexture.destroyed && this.imageAtlasTexture.destroy(), this.imageAtlasTexture = void 0, this.imageAtlasCoordsTexture && !this.imageAtlasCoordsTexture.destroyed && this.imageAtlasCoordsTexture.destroy(), this.imageAtlasCoordsTexture = void 0, this.pinnedStatusTexture && !this.pinnedStatusTexture.destroyed && this.pinnedStatusTexture.destroy(), this.pinnedStatusTexture = void 0, (c = this.updatePositionUniformStore) == null || c.destroy(), this.updatePositionUniformStore = void 0, (h = this.dragPointUniformStore) == null || h.destroy(), this.dragPointUniformStore = void 0, (p = this.drawUniformStore) == null || p.destroy(), this.drawUniformStore = void 0, (u = this.findPointsOnAreaSelectionUniformStore) == null || u.destroy(), this.findPointsOnAreaSelectionUniformStore = void 0, (_ = this.findPointsOnPolygonSelectionUniformStore) == null || _.destroy(), this.findPointsOnPolygonSelectionUniformStore = void 0, (R = this.findHoveredPointUniformStore) == null || R.destroy(), this.findHoveredPointUniformStore = void 0, (I = this.fillSampledPointsUniformStore) == null || I.destroy(), this.fillSampledPointsUniformStore = void 0, (P = this.drawHighlightedUniformStore) == null || P.destroy(), this.drawHighlightedUniformStore = void 0, (A = this.trackPointsUniformStore) == null || A.destroy(), this.trackPointsUniformStore = void 0, this.colorBuffer && !this.colorBuffer.destroyed && this.colorBuffer.destroy(), this.colorBuffer = void 0, this.sizeBuffer && !this.sizeBuffer.destroyed && this.sizeBuffer.destroy(), this.sizeBuffer = void 0, this.shapeBuffer && !this.shapeBuffer.destroyed && this.shapeBuffer.destroy(), this.shapeBuffer = void 0, this.imageIndicesBuffer && !this.imageIndicesBuffer.destroyed && this.imageIndicesBuffer.destroy(), this.imageIndicesBuffer = void 0, this.imageSizesBuffer && !this.imageSizesBuffer.destroyed && this.imageSizesBuffer.destroy(), this.imageSizesBuffer = void 0, this.drawPointIndices && !this.drawPointIndices.destroyed && this.drawPointIndices.destroy(), this.drawPointIndices = void 0, this.hoveredPointIndices && !this.hoveredPointIndices.destroyed && this.hoveredPointIndices.destroy(), this.hoveredPointIndices = void 0, this.sampledPointIndices && !this.sampledPointIndices.destroyed && this.sampledPointIndices.destroy(), this.sampledPointIndices = void 0, this.updatePositionVertexCoordBuffer && !this.updatePositionVertexCoordBuffer.destroyed && this.updatePositionVertexCoordBuffer.destroy(), this.updatePositionVertexCoordBuffer = void 0, this.dragPointVertexCoordBuffer && !this.dragPointVertexCoordBuffer.destroyed && this.dragPointVertexCoordBuffer.destroy(), this.dragPointVertexCoordBuffer = void 0, this.findPointsOnAreaSelectionVertexCoordBuffer && !this.findPointsOnAreaSelectionVertexCoordBuffer.destroyed && this.findPointsOnAreaSelectionVertexCoordBuffer.destroy(), this.findPointsOnAreaSelectionVertexCoordBuffer = void 0, this.findPointsOnPolygonSelectionVertexCoordBuffer && !this.findPointsOnPolygonSelectionVertexCoordBuffer.destroyed && this.findPointsOnPolygonSelectionVertexCoordBuffer.destroy(), this.findPointsOnPolygonSelectionVertexCoordBuffer = void 0, this.drawHighlightedVertexCoordBuffer && !this.drawHighlightedVertexCoordBuffer.destroyed && this.drawHighlightedVertexCoordBuffer.destroy(), this.drawHighlightedVertexCoordBuffer = void 0, this.trackPointsVertexCoordBuffer && !this.trackPointsVertexCoordBuffer.destroyed && this.trackPointsVertexCoordBuffer.destroy(), this.trackPointsVertexCoordBuffer = void 0;
5282
5511
  }
5283
5512
  swapFbo() {
5284
5513
  if (!this.currentPositionTexture || this.currentPositionTexture.destroyed || !this.previousPositionTexture || this.previousPositionTexture.destroyed || !this.currentPositionFbo || this.currentPositionFbo.destroyed || !this.previousPositionFbo || this.previousPositionFbo.destroyed)
@@ -5291,24 +5520,24 @@ class At extends w {
5291
5520
  if (!this.data.pointPositions || !t) return;
5292
5521
  const i = this.data.pointPositions, o = i.length / 2;
5293
5522
  let s = 1 / 0, n = -1 / 0, r = 1 / 0, a = -1 / 0;
5294
- for (let R = 0; R < i.length; R += 2) {
5295
- const v = i[R], y = i[R + 1];
5296
- s = Math.min(s, v), n = Math.max(n, v), r = Math.min(r, y), a = Math.max(a, y);
5523
+ for (let P = 0; P < i.length; P += 2) {
5524
+ const A = i[P], F = i[P + 1];
5525
+ s = Math.min(s, A), n = Math.max(n, A), r = Math.min(r, F), a = Math.max(a, F);
5297
5526
  }
5298
- const l = n - s, d = a - r, c = Math.max(l, d);
5527
+ const d = n - s, l = a - r, c = Math.max(d, l);
5299
5528
  if (c > t) {
5300
5529
  this.scaleX = void 0, this.scaleY = void 0;
5301
5530
  return;
5302
5531
  }
5303
- const f = t * t * 1e-3, p = o > f ? t * Math.max(1.2, Math.sqrt(o) / t) : t * 0.1, u = p / c, _ = (t - p) / 2, P = (c - l) / 2 * u + _, m = (c - d) / 2 * u + _;
5304
- this.scaleX = (R) => (R - s) * u + P, this.scaleY = (R) => (R - r) * u + m;
5305
- for (let R = 0; R < o; R++)
5306
- this.data.pointPositions[R * 2] = this.scaleX(i[R * 2]), this.data.pointPositions[R * 2 + 1] = this.scaleY(i[R * 2 + 1]);
5532
+ const h = t * t * 1e-3, p = o > h ? t * Math.max(1.2, Math.sqrt(o) / t) : t * 0.1, u = p / c, _ = (t - p) / 2, R = (c - d) / 2 * u + _, I = (c - l) / 2 * u + _;
5533
+ this.scaleX = (P) => (P - s) * u + R, this.scaleY = (P) => (P - r) * u + I;
5534
+ for (let P = 0; P < o; P++)
5535
+ this.data.pointPositions[P * 2] = this.scaleX(i[P * 2]), this.data.pointPositions[P * 2 + 1] = this.scaleY(i[P * 2 + 1]);
5307
5536
  }
5308
5537
  }
5309
- class vt {
5538
+ class Ft {
5310
5539
  constructor(t, i) {
5311
- this.eventTransform = W, this.behavior = Se().scaleExtent([1e-3, 1 / 0]).on("start", (o) => {
5540
+ this.eventTransform = W, this.behavior = pe().scaleExtent([1e-3, 1 / 0]).on("start", (o) => {
5312
5541
  var n, r;
5313
5542
  this.isRunning = !0;
5314
5543
  const s = !!o.sourceEvent;
@@ -5316,11 +5545,11 @@ class vt {
5316
5545
  }).on("zoom", (o) => {
5317
5546
  var p, u;
5318
5547
  this.eventTransform = o.transform;
5319
- const { eventTransform: { x: s, y: n, k: r }, store: { transform: a, screenSize: l } } = this, d = l[0], c = l[1];
5320
- if (!d || !c) return;
5321
- V.projection(a, d, c), V.translate(a, a, [s, n]), V.scale(a, a, [r, r]), V.translate(a, a, [d / 2, c / 2]), V.scale(a, a, [d / 2, c / 2]), V.scale(a, a, [1, -1]);
5322
- const f = !!o.sourceEvent;
5323
- (u = (p = this.config) == null ? void 0 : p.onZoom) == null || u.call(p, o, f);
5548
+ const { eventTransform: { x: s, y: n, k: r }, store: { transform: a, screenSize: d } } = this, l = d[0], c = d[1];
5549
+ if (!l || !c) return;
5550
+ V.projection(a, l, c), V.translate(a, a, [s, n]), V.scale(a, a, [r, r]), V.translate(a, a, [l / 2, c / 2]), V.scale(a, a, [l / 2, c / 2]), V.scale(a, a, [1, -1]);
5551
+ const h = !!o.sourceEvent;
5552
+ (u = (p = this.config) == null ? void 0 : p.onZoom) == null || u.call(p, o, h);
5324
5553
  }).on("end", (o) => {
5325
5554
  var n, r;
5326
5555
  this.isRunning = !1;
@@ -5339,26 +5568,26 @@ class vt {
5339
5568
  getTransform(t, i, o = 0.1) {
5340
5569
  if (t.length === 0) return this.eventTransform;
5341
5570
  const { store: { screenSize: s } } = this, n = s[0], r = s[1];
5342
- let a = 1 / 0, l = -1 / 0, d = 1 / 0, c = -1 / 0;
5571
+ let a = 1 / 0, d = -1 / 0, l = 1 / 0, c = -1 / 0;
5343
5572
  for (let E = 0; E < t.length; E += 2) {
5344
- const F = t[E], O = t[E + 1];
5345
- F < a && (a = F), F > l && (l = F), O < d && (d = O), O > c && (c = O);
5573
+ const N = t[E], O = t[E + 1];
5574
+ N < a && (a = N), N > d && (d = N), O < l && (l = O), O > c && (c = O);
5346
5575
  }
5347
- const f = [this.store.scaleX(a), this.store.scaleX(l)], p = [this.store.scaleY(d), this.store.scaleY(c)];
5348
- f[0] === f[1] && (f[0] -= 0.5, f[1] += 0.5), p[0] === p[1] && (p[0] += 0.5, p[1] -= 0.5);
5349
- const u = n * (1 - o * 2) / (f[1] - f[0]), _ = r * (1 - o * 2) / (p[0] - p[1]), P = Oe(i ?? Math.min(u, _), ...this.behavior.scaleExtent()), m = (f[1] + f[0]) / 2, R = (p[1] + p[0]) / 2, v = n / 2 - m * P, y = r / 2 - R * P;
5350
- return W.translate(v, y).scale(P);
5576
+ const h = [this.store.scaleX(a), this.store.scaleX(d)], p = [this.store.scaleY(l), this.store.scaleY(c)];
5577
+ h[0] === h[1] && (h[0] -= 0.5, h[1] += 0.5), p[0] === p[1] && (p[0] += 0.5, p[1] -= 0.5);
5578
+ const u = n * (1 - o * 2) / (h[1] - h[0]), _ = r * (1 - o * 2) / (p[0] - p[1]), R = Ue(i ?? Math.min(u, _), ...this.behavior.scaleExtent()), I = (h[1] + h[0]) / 2, P = (p[1] + p[0]) / 2, A = n / 2 - I * R, F = r / 2 - P * R;
5579
+ return W.translate(A, F).scale(R);
5351
5580
  }
5352
5581
  getDistanceToPoint(t) {
5353
5582
  const { x: i, y: o, k: s } = this.eventTransform, n = this.getTransform(t, s), r = i - n.x, a = o - n.y;
5354
5583
  return Math.sqrt(r * r + a * a);
5355
5584
  }
5356
5585
  getMiddlePointTransform(t) {
5357
- const { store: { screenSize: i }, eventTransform: { x: o, y: s, k: n } } = this, r = i[0], a = i[1], l = (r / 2 - o) / n, d = (a / 2 - s) / n, c = this.store.scaleX(t[0]), f = this.store.scaleY(t[1]), p = (l + c) / 2, u = (d + f) / 2, _ = 1, P = r / 2 - p * _, m = a / 2 - u * _;
5358
- return W.translate(P, m).scale(_);
5586
+ const { store: { screenSize: i }, eventTransform: { x: o, y: s, k: n } } = this, r = i[0], a = i[1], d = (r / 2 - o) / n, l = (a / 2 - s) / n, c = this.store.scaleX(t[0]), h = this.store.scaleY(t[1]), p = (d + c) / 2, u = (l + h) / 2, _ = 1, R = r / 2 - p * _, I = a / 2 - u * _;
5587
+ return W.translate(R, I).scale(_);
5359
5588
  }
5360
5589
  convertScreenToSpacePosition(t) {
5361
- const { eventTransform: { x: i, y: o, k: s }, store: { screenSize: n } } = this, r = n[0], a = n[1], l = (t[0] - i) / s, d = (t[1] - o) / s, c = [l, a - d];
5590
+ const { eventTransform: { x: i, y: o, k: s }, store: { screenSize: n } } = this, r = n[0], a = n[1], d = (t[0] - i) / s, l = (t[1] - o) / s, c = [d, a - l];
5362
5591
  return c[0] -= (r - this.store.adjustedSpaceSize) / 2, c[1] -= (a - this.store.adjustedSpaceSize) / 2, c;
5363
5592
  }
5364
5593
  convertSpaceToScreenPosition(t) {
@@ -5371,9 +5600,9 @@ class vt {
5371
5600
  return i ? n *= s : n *= Math.min(5, Math.max(1, s * 0.01)), Math.min(n, o) / 2;
5372
5601
  }
5373
5602
  }
5374
- class It {
5603
+ class Et {
5375
5604
  constructor(t, i) {
5376
- this.isActive = !1, this.behavior = pe().subject((o) => this.store.hoveredPoint && !this.store.isSpaceKeyPressed ? { x: o.x, y: o.y } : void 0).on("start", (o) => {
5605
+ this.isActive = !1, this.behavior = _e().subject((o) => this.store.hoveredPoint && !this.store.isSpaceKeyPressed ? { x: o.x, y: o.y } : void 0).on("start", (o) => {
5377
5606
  var s, n;
5378
5607
  this.store.hoveredPoint && (this.store.draggingPointIndex = this.store.hoveredPoint.index, this.isActive = !0, (n = (s = this.config) == null ? void 0 : s.onDragStart) == null || n.call(s, o));
5379
5608
  }).on("drag", (o) => {
@@ -5385,48 +5614,50 @@ class It {
5385
5614
  }), this.store = t, this.config = i;
5386
5615
  }
5387
5616
  }
5388
- class Ht {
5617
+ class Lt {
5389
5618
  constructor(t, i, o) {
5390
- if (this.config = new Be(), this.graph = new it(this.config), this.requestAnimationFrameId = 0, this.isRightClickMouse = !1, this.store = new Ee(), this.zoomInstance = new vt(this.store, this.config), this.dragInstance = new It(this.store, this.config), this._findHoveredItemExecutionCount = 0, this._isMouseOnCanvas = !1, this._lastMouseX = 0, this._lastMouseY = 0, this._lastCheckedMouseX = 0, this._lastCheckedMouseY = 0, this._shouldForceHoverDetection = !1, this._isFirstRenderAfterInit = !0, this.isPointPositionsUpdateNeeded = !1, this.isPointColorUpdateNeeded = !1, this.isPointSizeUpdateNeeded = !1, this.isPointShapeUpdateNeeded = !1, this.isPointImageIndicesUpdateNeeded = !1, this.isLinksUpdateNeeded = !1, this.isLinkColorUpdateNeeded = !1, this.isLinkWidthUpdateNeeded = !1, this.isLinkArrowUpdateNeeded = !1, this.isPointClusterUpdateNeeded = !1, this.isForceManyBodyUpdateNeeded = !1, this.isForceLinkUpdateNeeded = !1, this.isForceCenterUpdateNeeded = !1, this.isPointImageSizesUpdateNeeded = !1, this._isDestroyed = !1, i && this.config.init(i), o)
5619
+ if (this.config = new ke(), this.graph = new ot(this.config), this.isReady = !1, this.requestAnimationFrameId = 0, this.isRightClickMouse = !1, this.store = new Ee(), this.zoomInstance = new Ft(this.store, this.config), this.dragInstance = new Et(this.store, this.config), this._findHoveredItemExecutionCount = 0, this._isMouseOnCanvas = !1, this._lastMouseX = 0, this._lastMouseY = 0, this._lastCheckedMouseX = 0, this._lastCheckedMouseY = 0, this._shouldForceHoverDetection = !1, this._isFirstRenderAfterInit = !0, this.isPointPositionsUpdateNeeded = !1, this.isPointColorUpdateNeeded = !1, this.isPointSizeUpdateNeeded = !1, this.isPointShapeUpdateNeeded = !1, this.isPointImageIndicesUpdateNeeded = !1, this.isLinksUpdateNeeded = !1, this.isLinkColorUpdateNeeded = !1, this.isLinkWidthUpdateNeeded = !1, this.isLinkArrowUpdateNeeded = !1, this.isPointClusterUpdateNeeded = !1, this.isForceManyBodyUpdateNeeded = !1, this.isForceLinkUpdateNeeded = !1, this.isForceCenterUpdateNeeded = !1, this.isPointImageSizesUpdateNeeded = !1, this._isDestroyed = !1, i && this.config.init(i), o)
5391
5620
  this.deviceInitPromise = o, this.shouldDestroyDevice = !1;
5392
5621
  else {
5393
- const s = document.createElement("canvas");
5394
- this.deviceInitPromise = this.createDevice(s), this.shouldDestroyDevice = !0;
5622
+ const n = document.createElement("canvas");
5623
+ this.deviceInitPromise = this.createDevice(n), this.shouldDestroyDevice = !0;
5395
5624
  }
5396
- this.deviceInitPromise.then((s) => {
5625
+ const s = this.deviceInitPromise.then((n) => {
5397
5626
  if (this._isDestroyed)
5398
- return this.shouldDestroyDevice && s.destroy(), s;
5399
- this.device = s;
5400
- const n = this.validateDevice(s);
5401
- o && n.setProps({ useDevicePixels: this.config.pixelRatio }), this.store.div = t;
5402
- const r = n.canvas;
5403
- r.parentNode !== this.store.div && (r.parentNode && r.parentNode.removeChild(r), this.store.div.appendChild(r)), this.addAttribution(), r.style.width = "100%", r.style.height = "100%", this.canvas = r;
5404
- const a = this.canvas.clientWidth, l = this.canvas.clientHeight;
5405
- return this.store.adjustSpaceSize(this.config.spaceSize, this.device.limits.maxTextureDimension2D), this.store.setWebGLMaxTextureSize(this.device.limits.maxTextureDimension2D), this.store.updateScreenSize(a, l), this.canvasD3Selection = z(this.canvas), this.canvasD3Selection.on("mouseenter.cosmos", (d) => {
5406
- this._isMouseOnCanvas = !0, this._lastMouseX = d.clientX, this._lastMouseY = d.clientY;
5407
- }).on("mousemove.cosmos", (d) => {
5408
- this._isMouseOnCanvas = !0, this._lastMouseX = d.clientX, this._lastMouseY = d.clientY;
5409
- }).on("mouseleave.cosmos", (d) => {
5410
- this._isMouseOnCanvas = !1, this.currentEvent = d, this.store.hoveredPoint !== void 0 && this.config.onPointMouseOut && this.config.onPointMouseOut(d), this.store.hoveredLinkIndex !== void 0 && this.config.onLinkMouseOut && this.config.onLinkMouseOut(d), this.isRightClickMouse = !1, this.store.hoveredPoint = void 0, this.store.hoveredLinkIndex = void 0, this.updateCanvasCursor();
5411
- }), z(document).on("keydown.cosmos", (d) => {
5412
- d.code === "Space" && (this.store.isSpaceKeyPressed = !0);
5413
- }).on("keyup.cosmos", (d) => {
5414
- d.code === "Space" && (this.store.isSpaceKeyPressed = !1);
5415
- }), this.zoomInstance.behavior.on("start.detect", (d) => {
5416
- this.currentEvent = d;
5417
- }).on("zoom.detect", (d) => {
5418
- !!d.sourceEvent && this.updateMousePosition(d.sourceEvent), this.currentEvent = d;
5419
- }).on("end.detect", (d) => {
5420
- this.currentEvent = d, this._shouldForceHoverDetection = !0;
5421
- }), this.dragInstance.behavior.on("start.detect", (d) => {
5422
- this.currentEvent = d, this.updateCanvasCursor();
5423
- }).on("drag.detect", (d) => {
5424
- this.dragInstance.isActive && this.updateMousePosition(d), this.currentEvent = d;
5425
- }).on("end.detect", (d) => {
5426
- this.currentEvent = d, this.updateCanvasCursor();
5427
- }), this.canvasD3Selection.call(this.dragInstance.behavior).call(this.zoomInstance.behavior).on("click", this.onClick.bind(this)).on("mousemove", this.onMouseMove.bind(this)).on("contextmenu", this.onContextMenu.bind(this)), (!this.config.enableZoom || !this.config.enableDrag) && this.updateZoomDragBehaviors(), this.setZoomLevel(this.config.initialZoomLevel ?? 1), this.store.maxPointSize = $(s, this.config.pixelRatio), this.store.isSimulationRunning = this.config.enableSimulation, this.points = new At(s, this.config, this.store, this.graph), this.lines = new dt(s, this.config, this.store, this.graph, this.points), this.config.enableSimulation && (this.forceGravity = new He(s, this.config, this.store, this.graph, this.points), this.forceCenter = new we(s, this.config, this.store, this.graph, this.points), this.forceManyBody = new Le(s, this.config, this.store, this.graph, this.points), this.forceLinkIncoming = new J(s, this.config, this.store, this.graph, this.points), this.forceLinkOutgoing = new J(s, this.config, this.store, this.graph, this.points), this.forceMouse = new qe(s, this.config, this.store, this.graph, this.points)), this.clusters = new Ge(s, this.config, this.store, this.graph, this.points), this.store.backgroundColor = k(this.config.backgroundColor), this.store.setHoveredPointRingColor(this.config.hoveredPointRingColor ?? h.hoveredPointRingColor), this.store.setFocusedPointRingColor(this.config.focusedPointRingColor ?? h.focusedPointRingColor), this.config.focusedPointIndex !== void 0 && this.store.setFocusedPoint(this.config.focusedPointIndex), this.store.setGreyoutPointColor(this.config.pointGreyoutColor ?? Y), this.store.setHoveredLinkColor(this.config.hoveredLinkColor ?? h.hoveredLinkColor), this.store.updateLinkHoveringEnabled(this.config), this.config.showFPSMonitor && (this.fpsMonitor = new G(this.canvas)), this.config.randomSeed !== void 0 && this.store.addRandomSeed(this.config.randomSeed), s;
5428
- }).catch((s) => {
5429
- throw console.error("Device initialization failed:", s), s;
5627
+ return this.shouldDestroyDevice && n.destroy(), n;
5628
+ this.device = n, this.isReady = !0;
5629
+ const r = this.validateDevice(n);
5630
+ o && r.setProps({ useDevicePixels: this.config.pixelRatio }), this.store.div = t;
5631
+ const a = r.canvas;
5632
+ a.parentNode !== this.store.div && (a.parentNode && a.parentNode.removeChild(a), this.store.div.appendChild(a)), this.addAttribution(), a.style.width = "100%", a.style.height = "100%", this.canvas = a;
5633
+ const d = this.canvas.clientWidth, l = this.canvas.clientHeight;
5634
+ return this.store.adjustSpaceSize(this.config.spaceSize, this.device.limits.maxTextureDimension2D), this.store.setWebGLMaxTextureSize(this.device.limits.maxTextureDimension2D), this.store.updateScreenSize(d, l), this.canvasD3Selection = b(this.canvas), this.canvasD3Selection.on("mouseenter.cosmos", (c) => {
5635
+ this._isMouseOnCanvas = !0, this._lastMouseX = c.clientX, this._lastMouseY = c.clientY;
5636
+ }).on("mousemove.cosmos", (c) => {
5637
+ this._isMouseOnCanvas = !0, this._lastMouseX = c.clientX, this._lastMouseY = c.clientY;
5638
+ }).on("mouseleave.cosmos", (c) => {
5639
+ this._isMouseOnCanvas = !1, this.currentEvent = c, this.store.hoveredPoint !== void 0 && this.config.onPointMouseOut && this.config.onPointMouseOut(c), this.store.hoveredLinkIndex !== void 0 && this.config.onLinkMouseOut && this.config.onLinkMouseOut(c), this.isRightClickMouse = !1, this.store.hoveredPoint = void 0, this.store.hoveredLinkIndex = void 0, this.updateCanvasCursor();
5640
+ }), b(document).on("keydown.cosmos", (c) => {
5641
+ c.code === "Space" && (this.store.isSpaceKeyPressed = !0);
5642
+ }).on("keyup.cosmos", (c) => {
5643
+ c.code === "Space" && (this.store.isSpaceKeyPressed = !1);
5644
+ }), this.zoomInstance.behavior.on("start.detect", (c) => {
5645
+ this.currentEvent = c;
5646
+ }).on("zoom.detect", (c) => {
5647
+ !!c.sourceEvent && this.updateMousePosition(c.sourceEvent), this.currentEvent = c;
5648
+ }).on("end.detect", (c) => {
5649
+ this.currentEvent = c, this._shouldForceHoverDetection = !0;
5650
+ }), this.dragInstance.behavior.on("start.detect", (c) => {
5651
+ this.currentEvent = c, this.updateCanvasCursor();
5652
+ }).on("drag.detect", (c) => {
5653
+ this.dragInstance.isActive && this.updateMousePosition(c), this.currentEvent = c;
5654
+ }).on("end.detect", (c) => {
5655
+ this.currentEvent = c, this.updateCanvasCursor();
5656
+ }), this.canvasD3Selection.call(this.dragInstance.behavior).call(this.zoomInstance.behavior).on("click", this.onClick.bind(this)).on("mousemove", this.onMouseMove.bind(this)).on("contextmenu", this.onContextMenu.bind(this)), (!this.config.enableZoom || !this.config.enableDrag) && this.updateZoomDragBehaviors(), this.setZoomLevel(this.config.initialZoomLevel ?? 1), this.store.maxPointSize = $(n, this.config.pixelRatio), this.store.isSimulationRunning = this.config.enableSimulation, this.points = new yt(n, this.config, this.store, this.graph), this.lines = new ht(n, this.config, this.store, this.graph, this.points), this.config.enableSimulation && (this.forceGravity = new Xe(n, this.config, this.store, this.graph, this.points), this.forceCenter = new Ve(n, this.config, this.store, this.graph, this.points), this.forceManyBody = new je(n, this.config, this.store, this.graph, this.points), this.forceLinkIncoming = new J(n, this.config, this.store, this.graph, this.points), this.forceLinkOutgoing = new J(n, this.config, this.store, this.graph, this.points), this.forceMouse = new Qe(n, this.config, this.store, this.graph, this.points)), this.clusters = new et(n, this.config, this.store, this.graph, this.points), this.store.backgroundColor = z(this.config.backgroundColor), this.store.setHoveredPointRingColor(this.config.hoveredPointRingColor ?? f.hoveredPointRingColor), this.store.setFocusedPointRingColor(this.config.focusedPointRingColor ?? f.focusedPointRingColor), this.config.focusedPointIndex !== void 0 && this.store.setFocusedPoint(this.config.focusedPointIndex), this.store.setGreyoutPointColor(this.config.pointGreyoutColor ?? Y), this.store.setHoveredLinkColor(this.config.hoveredLinkColor ?? f.hoveredLinkColor), this.store.updateLinkHoveringEnabled(this.config), this.config.showFPSMonitor && (this.fpsMonitor = new G(this.canvas)), this.config.randomSeed !== void 0 && this.store.addRandomSeed(this.config.randomSeed), n;
5657
+ }).catch((n) => {
5658
+ throw this.device = void 0, this.isReady = !1, console.error("Device initialization failed:", n), n;
5659
+ });
5660
+ this.ready = s.then(() => {
5430
5661
  });
5431
5662
  }
5432
5663
  /**
@@ -5453,10 +5684,10 @@ class Ht {
5453
5684
  * @param config Cosmos configuration object.
5454
5685
  */
5455
5686
  setConfig(t) {
5456
- var o, s, n, r, a, l, d, c, f;
5687
+ var o, s, n, r, a, d, l, c, h;
5457
5688
  if (this._isDestroyed || this.ensureDevice(() => this.setConfig(t))) return;
5458
5689
  const i = { ...this.config };
5459
- this.config.init(t), (i.pointDefaultColor !== this.config.pointDefaultColor || i.pointColor !== this.config.pointColor) && (this.graph.updatePointColor(), (o = this.points) == null || o.updateColor()), (i.pointDefaultSize !== this.config.pointDefaultSize || i.pointSize !== this.config.pointSize) && (this.graph.updatePointSize(), (s = this.points) == null || s.updateSize()), (i.linkDefaultColor !== this.config.linkDefaultColor || i.linkColor !== this.config.linkColor) && (this.graph.updateLinkColor(), (n = this.lines) == null || n.updateColor()), (i.linkDefaultWidth !== this.config.linkDefaultWidth || i.linkWidth !== this.config.linkWidth) && (this.graph.updateLinkWidth(), (r = this.lines) == null || r.updateWidth()), (i.linkDefaultArrows !== this.config.linkDefaultArrows || i.linkArrows !== this.config.linkArrows) && (this.graph.updateArrows(), (a = this.lines) == null || a.updateArrow()), (i.curvedLinkSegments !== this.config.curvedLinkSegments || i.curvedLinks !== this.config.curvedLinks) && ((l = this.lines) == null || l.updateCurveLineGeometry()), i.backgroundColor !== this.config.backgroundColor && (this.store.backgroundColor = k(this.config.backgroundColor ?? ee)), i.hoveredPointRingColor !== this.config.hoveredPointRingColor && this.store.setHoveredPointRingColor(this.config.hoveredPointRingColor ?? h.hoveredPointRingColor), i.focusedPointRingColor !== this.config.focusedPointRingColor && this.store.setFocusedPointRingColor(this.config.focusedPointRingColor ?? h.focusedPointRingColor), i.pointGreyoutColor !== this.config.pointGreyoutColor && this.store.setGreyoutPointColor(this.config.pointGreyoutColor ?? Y), i.hoveredLinkColor !== this.config.hoveredLinkColor && this.store.setHoveredLinkColor(this.config.hoveredLinkColor ?? h.hoveredLinkColor), i.focusedPointIndex !== this.config.focusedPointIndex && this.store.setFocusedPoint(this.config.focusedPointIndex), i.pixelRatio !== this.config.pixelRatio && (d = this.device) != null && d.canvasContext && (this.device.canvasContext.setProps({ useDevicePixels: this.config.pixelRatio }), this.store.maxPointSize = $(this.device, this.config.pixelRatio)), i.spaceSize !== this.config.spaceSize && (this.store.adjustSpaceSize(this.config.spaceSize, ((c = this.device) == null ? void 0 : c.limits.maxTextureDimension2D) ?? 4096), this.resizeCanvas(!0), this.update(this.store.isSimulationRunning ? this.store.alpha : 0)), i.showFPSMonitor !== this.config.showFPSMonitor && (this.config.showFPSMonitor ? this.fpsMonitor = new G(this.canvas) : ((f = this.fpsMonitor) == null || f.destroy(), this.fpsMonitor = void 0)), (i.enableZoom !== this.config.enableZoom || i.enableDrag !== this.config.enableDrag) && this.updateZoomDragBehaviors(), (i.onLinkClick !== this.config.onLinkClick || i.onLinkContextMenu !== this.config.onLinkContextMenu || i.onLinkMouseOver !== this.config.onLinkMouseOver || i.onLinkMouseOut !== this.config.onLinkMouseOut) && this.store.updateLinkHoveringEnabled(this.config);
5690
+ this.config.init(t), i.pointDefaultColor !== this.config.pointDefaultColor && (this.graph.updatePointColor(), (o = this.points) == null || o.updateColor()), i.pointDefaultSize !== this.config.pointDefaultSize && (this.graph.updatePointSize(), (s = this.points) == null || s.updateSize()), i.linkDefaultColor !== this.config.linkDefaultColor && (this.graph.updateLinkColor(), (n = this.lines) == null || n.updateColor()), i.linkDefaultWidth !== this.config.linkDefaultWidth && (this.graph.updateLinkWidth(), (r = this.lines) == null || r.updateWidth()), i.linkDefaultArrows !== this.config.linkDefaultArrows && (this.graph.updateArrows(), (a = this.lines) == null || a.updateArrow()), (i.curvedLinkSegments !== this.config.curvedLinkSegments || i.curvedLinks !== this.config.curvedLinks) && ((d = this.lines) == null || d.updateCurveLineGeometry()), i.backgroundColor !== this.config.backgroundColor && (this.store.backgroundColor = z(this.config.backgroundColor ?? te)), i.hoveredPointRingColor !== this.config.hoveredPointRingColor && this.store.setHoveredPointRingColor(this.config.hoveredPointRingColor ?? f.hoveredPointRingColor), i.focusedPointRingColor !== this.config.focusedPointRingColor && this.store.setFocusedPointRingColor(this.config.focusedPointRingColor ?? f.focusedPointRingColor), i.pointGreyoutColor !== this.config.pointGreyoutColor && this.store.setGreyoutPointColor(this.config.pointGreyoutColor ?? Y), i.hoveredLinkColor !== this.config.hoveredLinkColor && this.store.setHoveredLinkColor(this.config.hoveredLinkColor ?? f.hoveredLinkColor), i.focusedPointIndex !== this.config.focusedPointIndex && this.store.setFocusedPoint(this.config.focusedPointIndex), i.pixelRatio !== this.config.pixelRatio && (l = this.device) != null && l.canvasContext && (this.device.canvasContext.setProps({ useDevicePixels: this.config.pixelRatio }), this.store.maxPointSize = $(this.device, this.config.pixelRatio)), i.spaceSize !== this.config.spaceSize && (this.store.adjustSpaceSize(this.config.spaceSize, ((c = this.device) == null ? void 0 : c.limits.maxTextureDimension2D) ?? 4096), this.resizeCanvas(!0), this.update(this.store.isSimulationRunning ? this.store.alpha : 0)), i.showFPSMonitor !== this.config.showFPSMonitor && (this.config.showFPSMonitor ? this.fpsMonitor = new G(this.canvas) : ((h = this.fpsMonitor) == null || h.destroy(), this.fpsMonitor = void 0)), (i.enableZoom !== this.config.enableZoom || i.enableDrag !== this.config.enableDrag) && this.updateZoomDragBehaviors(), (i.onLinkClick !== this.config.onLinkClick || i.onLinkContextMenu !== this.config.onLinkContextMenu || i.onLinkMouseOver !== this.config.onLinkMouseOver || i.onLinkMouseOut !== this.config.onLinkMouseOut) && this.store.updateLinkHoveringEnabled(this.config);
5460
5691
  }
5461
5692
  /**
5462
5693
  * Sets the positions for the graph points.
@@ -5696,16 +5927,16 @@ class Ht {
5696
5927
  render(t) {
5697
5928
  if (this._isDestroyed || this.ensureDevice(() => this.render(t))) return;
5698
5929
  this.graph.update();
5699
- const { fitViewOnInit: i, fitViewDelay: o, fitViewPadding: s, fitViewDuration: n, fitViewByPointsInRect: r, fitViewByPointIndices: a, initialZoomLevel: l } = this.config;
5930
+ const { fitViewOnInit: i, fitViewDelay: o, fitViewPadding: s, fitViewDuration: n, fitViewByPointsInRect: r, fitViewByPointIndices: a, initialZoomLevel: d } = this.config;
5700
5931
  if (!this.graph.pointsNumber && !this.graph.linksNumber) {
5701
- this.stopFrames(), z(this.canvas).style("cursor", null), this.device && (this.device.beginRenderPass({
5932
+ this.stopFrames(), b(this.canvas).style("cursor", null), this.device && (this.device.beginRenderPass({
5702
5933
  clearColor: this.store.backgroundColor,
5703
5934
  clearDepth: 1,
5704
5935
  clearStencil: 0
5705
5936
  }).end(), this.device.submit());
5706
5937
  return;
5707
5938
  }
5708
- this._isFirstRenderAfterInit && i && l === void 0 && (this._fitViewOnInitTimeoutID = window.setTimeout(() => {
5939
+ this._isFirstRenderAfterInit && i && d === void 0 && (this._fitViewOnInitTimeoutID = window.setTimeout(() => {
5709
5940
  a ? this.fitViewByPointIndices(a, n, s) : r ? this.setZoomTransformByPointPositions(
5710
5941
  new Float32Array(this.flatten(r)),
5711
5942
  n,
@@ -5721,18 +5952,18 @@ class Ht {
5721
5952
  * @param scale Scale value to zoom in or out (`3` by default).
5722
5953
  * @param canZoomOut Set to `false` to prevent zooming out from the point (`true` by default).
5723
5954
  */
5724
- zoomToPointByIndex(t, i = 700, o = me, s = !0) {
5955
+ zoomToPointByIndex(t, i = 700, o = ye, s = !0) {
5725
5956
  if (this._isDestroyed || this.ensureDevice(() => this.zoomToPointByIndex(t, i, o, s)) || !this.device || !this.points || !this.canvasD3Selection) return;
5726
- const { store: { screenSize: n } } = this, r = N(this.device, this.points.currentPositionFbo);
5957
+ const { store: { screenSize: n } } = this, r = y(this.device, this.points.currentPositionFbo);
5727
5958
  if (t === void 0) return;
5728
- const a = r[t * 4 + 0], l = r[t * 4 + 1];
5729
- if (a === void 0 || l === void 0) return;
5730
- const d = this.zoomInstance.getDistanceToPoint([a, l]), c = s ? o : Math.max(this.getZoomLevel(), o);
5731
- if (d < Math.min(n[0], n[1]))
5732
- this.setZoomTransformByPointPositions(new Float32Array([a, l]), i, c);
5959
+ const a = r[t * 4 + 0], d = r[t * 4 + 1];
5960
+ if (a === void 0 || d === void 0) return;
5961
+ const l = this.zoomInstance.getDistanceToPoint([a, d]), c = s ? o : Math.max(this.getZoomLevel(), o);
5962
+ if (l < Math.min(n[0], n[1]))
5963
+ this.setZoomTransformByPointPositions(new Float32Array([a, d]), i, c);
5733
5964
  else {
5734
- const f = this.zoomInstance.getTransform([a, l], c), p = this.zoomInstance.getMiddlePointTransform([a, l]);
5735
- this.canvasD3Selection.transition().ease(ie).duration(i / 2).call(this.zoomInstance.behavior.transform, p).transition().ease(oe).duration(i / 2).call(this.zoomInstance.behavior.transform, f);
5965
+ const h = this.zoomInstance.getTransform([a, d], c), p = this.zoomInstance.getMiddlePointTransform([a, d]);
5966
+ this.canvasD3Selection.transition().ease(oe).duration(i / 2).call(this.zoomInstance.behavior.transform, p).transition().ease(se).duration(i / 2).call(this.zoomInstance.behavior.transform, h);
5736
5967
  }
5737
5968
  }
5738
5969
  /**
@@ -5765,7 +5996,7 @@ class Ht {
5765
5996
  getPointPositions() {
5766
5997
  if (this._isDestroyed || !this.device || !this.points) return [];
5767
5998
  if (this.graph.pointsNumber === void 0) return [];
5768
- const t = [], i = N(this.device, this.points.currentPositionFbo);
5999
+ const t = [], i = y(this.device, this.points.currentPositionFbo);
5769
6000
  t.length = this.graph.pointsNumber * 2;
5770
6001
  for (let o = 0; o < this.graph.pointsNumber; o += 1) {
5771
6002
  const s = i[o * 4 + 0], n = i[o * 4 + 1];
@@ -5781,7 +6012,7 @@ class Ht {
5781
6012
  if (this._isDestroyed || !this.device || !this.clusters) return [];
5782
6013
  if (this.graph.pointClusters === void 0 || this.clusters.clusterCount === void 0) return [];
5783
6014
  this.clusters.calculateCentermass();
5784
- const t = [], i = N(this.device, this.clusters.centermassFbo);
6015
+ const t = [], i = y(this.device, this.clusters.centermassFbo);
5785
6016
  t.length = this.clusters.clusterCount * 2;
5786
6017
  for (let o = 0; o < t.length / 2; o += 1) {
5787
6018
  const s = i[o * 4 + 0], n = i[o * 4 + 1], r = i[o * 4 + 2];
@@ -5832,7 +6063,7 @@ class Ht {
5832
6063
  if (this._isDestroyed || this.ensureDevice(() => this.setZoomTransformByPointPositions(t, i, o, s))) return;
5833
6064
  this.resizeCanvas();
5834
6065
  const n = this.zoomInstance.getTransform(t, o, s);
5835
- (r = this.canvasD3Selection) == null || r.transition().ease(se).duration(i).call(this.zoomInstance.behavior.transform, n);
6066
+ (r = this.canvasD3Selection) == null || r.transition().ease(ne).duration(i).call(this.zoomInstance.behavior.transform, n);
5836
6067
  }
5837
6068
  /**
5838
6069
  * Get points indices inside a rectangular area.
@@ -5844,18 +6075,7 @@ class Ht {
5844
6075
  getPointsInRect(t) {
5845
6076
  if (this._isDestroyed || !this.device || !this.points) return new Float32Array();
5846
6077
  const i = this.store.screenSize[1];
5847
- return this.store.selectedArea = [[t[0][0], i - t[1][1]], [t[1][0], i - t[0][1]]], this.points.findPointsOnAreaSelection(), N(this.device, this.points.selectedFbo).map((s, n) => n % 4 === 0 && s !== 0 ? n / 4 : -1).filter((s) => s !== -1);
5848
- }
5849
- /**
5850
- * Get points indices inside a rectangular area.
5851
- * @param selection - Array of two corner points `[[left, top], [right, bottom]]`.
5852
- * The `left` and `right` coordinates should be from 0 to the width of the canvas.
5853
- * The `top` and `bottom` coordinates should be from 0 to the height of the canvas.
5854
- * @returns A Float32Array containing the indices of points inside a rectangular area.
5855
- * @deprecated Use `getPointsInRect` instead. This method will be removed in a future version.
5856
- */
5857
- getPointsInRange(t) {
5858
- return this.getPointsInRect(t);
6078
+ return this.store.selectedArea = [[t[0][0], i - t[1][1]], [t[1][0], i - t[0][1]]], this.points.findPointsOnAreaSelection(), y(this.device, this.points.selectedFbo).map((s, n) => n % 4 === 0 && s !== 0 ? n / 4 : -1).filter((s) => s !== -1);
5859
6079
  }
5860
6080
  /**
5861
6081
  * Get points indices inside a polygon area.
@@ -5867,7 +6087,7 @@ class Ht {
5867
6087
  if (this._isDestroyed || !this.device || !this.points) return new Float32Array();
5868
6088
  if (t.length < 3) return new Float32Array();
5869
6089
  const i = this.store.screenSize[1], o = t.map(([n, r]) => [n, i - r]);
5870
- return this.points.updatePolygonPath(o), this.points.findPointsOnPolygonSelection(), N(this.device, this.points.selectedFbo).map((n, r) => r % 4 === 0 && n !== 0 ? r / 4 : -1).filter((n) => n !== -1);
6090
+ return this.points.updatePolygonPath(o), this.points.findPointsOnPolygonSelection(), y(this.device, this.points.selectedFbo).map((n, r) => r % 4 === 0 && n !== 0 ? r / 4 : -1).filter((n) => n !== -1);
5871
6091
  }
5872
6092
  /** Select points inside a rectangular area.
5873
6093
  * @param selection - Array of two corner points `[[left, top], [right, bottom]]`.
@@ -5878,22 +6098,13 @@ class Ht {
5878
6098
  if (t) {
5879
6099
  const i = this.store.screenSize[1];
5880
6100
  this.store.selectedArea = [[t[0][0], i - t[1][1]], [t[1][0], i - t[0][1]]], this.points.findPointsOnAreaSelection();
5881
- const o = N(this.device, this.points.selectedFbo);
6101
+ const o = y(this.device, this.points.selectedFbo);
5882
6102
  this.store.selectedIndices = o.map((s, n) => n % 4 === 0 && s !== 0 ? n / 4 : -1).filter((s) => s !== -1);
5883
6103
  } else
5884
6104
  this.store.selectedIndices = null;
5885
6105
  this.points.updateGreyoutStatus();
5886
6106
  }
5887
6107
  }
5888
- /** Select points inside a rectangular area.
5889
- * @param selection - Array of two corner points `[[left, top], [right, bottom]]`.
5890
- * The `left` and `right` coordinates should be from 0 to the width of the canvas.
5891
- * The `top` and `bottom` coordinates should be from 0 to the height of the canvas.
5892
- * @deprecated Use `selectPointsInRect` instead. This method will be removed in a future version.
5893
- */
5894
- selectPointsInRange(t) {
5895
- return this.selectPointsInRect(t);
5896
- }
5897
6108
  /** Select points inside a polygon area.
5898
6109
  * @param polygonPath - Array of points `[[x1, y1], [x2, y2], ..., [xn, yn]]` that defines the polygon.
5899
6110
  * The coordinates should be from 0 to the width/height of the canvas.
@@ -5907,7 +6118,7 @@ class Ht {
5907
6118
  }
5908
6119
  const i = this.store.screenSize[1], o = t.map(([n, r]) => [n, i - r]);
5909
6120
  this.points.updatePolygonPath(o), this.points.findPointsOnPolygonSelection();
5910
- const s = N(this.device, this.points.selectedFbo);
6121
+ const s = y(this.device, this.points.selectedFbo);
5911
6122
  this.store.selectedIndices = s.map((n, r) => r % 4 === 0 && n !== 0 ? r / 4 : -1).filter((n) => n !== -1);
5912
6123
  } else
5913
6124
  this.store.selectedIndices = null;
@@ -6034,6 +6245,24 @@ class Ht {
6034
6245
  getSampledPoints() {
6035
6246
  return this._isDestroyed || !this.points ? { indices: [], positions: [] } : this.points.getSampledPoints();
6036
6247
  }
6248
+ /**
6249
+ * For the links that are currently visible on the screen, get a sample of link indices with their midpoint coordinates and angle.
6250
+ * The resulting number of links will depend on the `linkSamplingDistance` configuration property,
6251
+ * and the sampled links will be evenly distributed (one link per grid cell, based on link midpoint in screen space).
6252
+ * Each value is [x, y, angle]: position in data space; angle in radians for screen-space rotation (0 = right, positive = clockwise, e.g. for CSS rotation).
6253
+ */
6254
+ getSampledLinkPositionsMap() {
6255
+ return this._isDestroyed || !this.lines ? /* @__PURE__ */ new Map() : this.lines.getSampledLinkPositionsMap();
6256
+ }
6257
+ /**
6258
+ * For the links that are currently visible on the screen, get a sample of link indices, midpoint positions, and angles.
6259
+ * The resulting number of links will depend on the `linkSamplingDistance` configuration property,
6260
+ * and the sampled links will be evenly distributed.
6261
+ * Positions are in data space; angles are in radians for screen-space rotation (0 = right, positive = clockwise, e.g. for CSS rotation).
6262
+ */
6263
+ getSampledLinks() {
6264
+ return this._isDestroyed || !this.lines ? { indices: [], positions: [], angles: [] } : this.lines.getSampledLinks();
6265
+ }
6037
6266
  /**
6038
6267
  * Gets the X-axis of rescaling function.
6039
6268
  *
@@ -6086,15 +6315,6 @@ class Ht {
6086
6315
  var t, i;
6087
6316
  this._isDestroyed || this.ensureDevice(() => this.unpause()) || (this.store.isSimulationRunning = !0, (i = (t = this.config).onSimulationUnpause) == null || i.call(t));
6088
6317
  }
6089
- /**
6090
- * Restart/Resume the simulation. This method unpauses a paused
6091
- * simulation and resumes its execution.
6092
- * @deprecated Use `unpause()` instead. This method will be removed in a future version.
6093
- */
6094
- restart() {
6095
- var t, i;
6096
- this._isDestroyed || this.ensureDevice(() => this.restart()) || (this.store.isSimulationRunning = !0, (i = (t = this.config).onSimulationRestart) == null || i.call(t));
6097
- }
6098
6318
  /**
6099
6319
  * Run one step of the simulation manually.
6100
6320
  * Works even when the simulation is paused.
@@ -6106,8 +6326,8 @@ class Ht {
6106
6326
  * Destroy this Cosmos instance.
6107
6327
  */
6108
6328
  destroy() {
6109
- var t, i, o, s, n, r, a, l, d, c, f, p, u;
6110
- this._isDestroyed || (this._isDestroyed = !0, window.clearTimeout(this._fitViewOnInitTimeoutID), this.stopFrames(), this.canvasD3Selection && this.canvasD3Selection.on("mouseenter.cosmos", null).on("mousemove.cosmos", null).on("mouseleave.cosmos", null).on("click", null).on("mousemove", null).on("contextmenu", null).on(".drag", null).on(".zoom", null), z(document).on("keydown.cosmos", null).on("keyup.cosmos", null), (t = this.zoomInstance) != null && t.behavior && this.zoomInstance.behavior.on("start.detect", null).on("zoom.detect", null).on("end.detect", null), (i = this.dragInstance) != null && i.behavior && this.dragInstance.behavior.on("start.detect", null).on("drag.detect", null).on("end.detect", null), (o = this.fpsMonitor) == null || o.destroy(), (s = this.points) == null || s.destroy(), (n = this.lines) == null || n.destroy(), (r = this.clusters) == null || r.destroy(), (a = this.forceGravity) == null || a.destroy(), (l = this.forceCenter) == null || l.destroy(), (d = this.forceManyBody) == null || d.destroy(), (c = this.forceLinkIncoming) == null || c.destroy(), (f = this.forceLinkOutgoing) == null || f.destroy(), (p = this.forceMouse) == null || p.destroy(), this.device && this.shouldDestroyDevice && (this.device.beginRenderPass({
6329
+ var t, i, o, s, n, r, a, d, l, c, h, p, u;
6330
+ this._isDestroyed || (this._isDestroyed = !0, this.isReady = !1, window.clearTimeout(this._fitViewOnInitTimeoutID), this.stopFrames(), this.canvasD3Selection && this.canvasD3Selection.on("mouseenter.cosmos", null).on("mousemove.cosmos", null).on("mouseleave.cosmos", null).on("click", null).on("mousemove", null).on("contextmenu", null).on(".drag", null).on(".zoom", null), b(document).on("keydown.cosmos", null).on("keyup.cosmos", null), (t = this.zoomInstance) != null && t.behavior && this.zoomInstance.behavior.on("start.detect", null).on("zoom.detect", null).on("end.detect", null), (i = this.dragInstance) != null && i.behavior && this.dragInstance.behavior.on("start.detect", null).on("drag.detect", null).on("end.detect", null), (o = this.fpsMonitor) == null || o.destroy(), (s = this.points) == null || s.destroy(), (n = this.lines) == null || n.destroy(), (r = this.clusters) == null || r.destroy(), (a = this.forceGravity) == null || a.destroy(), (d = this.forceCenter) == null || d.destroy(), (l = this.forceManyBody) == null || l.destroy(), (c = this.forceLinkIncoming) == null || c.destroy(), (h = this.forceLinkOutgoing) == null || h.destroy(), (p = this.forceMouse) == null || p.destroy(), this.device && this.shouldDestroyDevice && (this.device.beginRenderPass({
6111
6331
  clearColor: this.store.backgroundColor,
6112
6332
  clearDepth: 1,
6113
6333
  clearStencil: 0
@@ -6118,7 +6338,7 @@ class Ht {
6118
6338
  */
6119
6339
  create() {
6120
6340
  var t, i, o, s, n;
6121
- this._isDestroyed || this.ensureDevice(() => this.create()) || this.points && this.lines && (this.isPointPositionsUpdateNeeded && this.points.updatePositions(), this.isPointColorUpdateNeeded && this.points.updateColor(), this.isPointSizeUpdateNeeded && this.points.updateSize(), this.isPointShapeUpdateNeeded && this.points.updateShape(), this.isPointImageIndicesUpdateNeeded && this.points.updateImageIndices(), this.isPointImageSizesUpdateNeeded && this.points.updateImageSizes(), this.isLinksUpdateNeeded && this.lines.updatePointsBuffer(), this.isLinkColorUpdateNeeded && this.lines.updateColor(), this.isLinkWidthUpdateNeeded && this.lines.updateWidth(), this.isLinkArrowUpdateNeeded && this.lines.updateArrow(), this.isForceManyBodyUpdateNeeded && ((t = this.forceManyBody) == null || t.create()), this.isForceLinkUpdateNeeded && ((i = this.forceLinkIncoming) == null || i.create(L.INCOMING), (o = this.forceLinkOutgoing) == null || o.create(L.OUTGOING)), this.isForceCenterUpdateNeeded && ((s = this.forceCenter) == null || s.create()), this.isPointClusterUpdateNeeded && ((n = this.clusters) == null || n.create()), this.isPointPositionsUpdateNeeded = !1, this.isPointColorUpdateNeeded = !1, this.isPointSizeUpdateNeeded = !1, this.isPointShapeUpdateNeeded = !1, this.isPointImageIndicesUpdateNeeded = !1, this.isPointImageSizesUpdateNeeded = !1, this.isLinksUpdateNeeded = !1, this.isLinkColorUpdateNeeded = !1, this.isLinkWidthUpdateNeeded = !1, this.isLinkArrowUpdateNeeded = !1, this.isPointClusterUpdateNeeded = !1, this.isForceManyBodyUpdateNeeded = !1, this.isForceLinkUpdateNeeded = !1, this.isForceCenterUpdateNeeded = !1);
6341
+ this._isDestroyed || this.ensureDevice(() => this.create()) || this.points && this.lines && (this.isPointPositionsUpdateNeeded && this.points.updatePositions(), this.isPointColorUpdateNeeded && this.points.updateColor(), this.isPointSizeUpdateNeeded && this.points.updateSize(), this.isPointShapeUpdateNeeded && this.points.updateShape(), this.isPointImageIndicesUpdateNeeded && this.points.updateImageIndices(), this.isPointImageSizesUpdateNeeded && this.points.updateImageSizes(), this.isLinksUpdateNeeded && this.lines.updatePointsBuffer(), this.isLinkColorUpdateNeeded && this.lines.updateColor(), this.isLinkWidthUpdateNeeded && this.lines.updateWidth(), this.isLinkArrowUpdateNeeded && this.lines.updateArrow(), this.isForceManyBodyUpdateNeeded && ((t = this.forceManyBody) == null || t.create()), this.isForceLinkUpdateNeeded && ((i = this.forceLinkIncoming) == null || i.create(Z.INCOMING), (o = this.forceLinkOutgoing) == null || o.create(Z.OUTGOING)), this.isForceCenterUpdateNeeded && ((s = this.forceCenter) == null || s.create()), this.isPointClusterUpdateNeeded && ((n = this.clusters) == null || n.create()), this.isPointPositionsUpdateNeeded = !1, this.isPointColorUpdateNeeded = !1, this.isPointSizeUpdateNeeded = !1, this.isPointShapeUpdateNeeded = !1, this.isPointImageIndicesUpdateNeeded = !1, this.isPointImageSizesUpdateNeeded = !1, this.isLinksUpdateNeeded = !1, this.isLinkColorUpdateNeeded = !1, this.isLinkWidthUpdateNeeded = !1, this.isLinkArrowUpdateNeeded = !1, this.isPointClusterUpdateNeeded = !1, this.isForceManyBodyUpdateNeeded = !1, this.isForceLinkUpdateNeeded = !1, this.isForceCenterUpdateNeeded = !1);
6122
6342
  }
6123
6343
  /**
6124
6344
  * Converts an array of tuple positions to a single array containing all coordinates sequentially
@@ -6146,7 +6366,7 @@ class Ht {
6146
6366
  * @returns true if device was not ready and operation was queued, false if device is ready
6147
6367
  */
6148
6368
  ensureDevice(t) {
6149
- return this.device ? !1 : (this.deviceInitPromise.then(() => {
6369
+ return this.isReady ? !1 : (this.ready.then(() => {
6150
6370
  this._isDestroyed || t();
6151
6371
  }).catch((i) => {
6152
6372
  console.error("Device initialization failed", i);
@@ -6171,9 +6391,9 @@ class Ht {
6171
6391
  * Graph class decides what device to create with sensible defaults
6172
6392
  */
6173
6393
  async createDevice(t) {
6174
- return await re.createDevice({
6394
+ return await ae.createDevice({
6175
6395
  type: "webgl",
6176
- adapters: [ae],
6396
+ adapters: [de],
6177
6397
  createCanvasContext: {
6178
6398
  canvas: t,
6179
6399
  // Provide existing canvas
@@ -6205,15 +6425,15 @@ class Ht {
6205
6425
  * to respect pause/unpause state.
6206
6426
  */
6207
6427
  runSimulationStep(t = !1) {
6208
- var a, l, d, c, f, p, u, _, P, m, R, v, y, U, E, F, O, B, b;
6428
+ var a, d, l, c, h, p, u, _, R, I, P, A, F, U, E, N, O, B, k;
6209
6429
  const { config: { simulationGravity: i, simulationCenter: o, enableSimulation: s }, store: { isSimulationRunning: n } } = this;
6210
6430
  if (!s) return;
6211
- this.isRightClickMouse && this.config.enableRightClickRepulsion && ((a = this.forceMouse) == null || a.run(), (l = this.points) == null || l.updatePosition()), (t || n && !(this.zoomInstance.isRunning && !this.config.enableSimulationDuringZoom)) && (i && ((d = this.forceGravity) == null || d.run(), (c = this.points) == null || c.updatePosition()), o && ((f = this.forceCenter) == null || f.run(), (p = this.points) == null || p.updatePosition()), (u = this.forceManyBody) == null || u.run(), (_ = this.points) == null || _.updatePosition(), this.store.linksTextureSize && ((P = this.forceLinkIncoming) == null || P.run(), (m = this.points) == null || m.updatePosition(), (R = this.forceLinkOutgoing) == null || R.run(), (v = this.points) == null || v.updatePosition()), (this.graph.pointClusters || this.graph.clusterPositions) && ((y = this.clusters) == null || y.run(), (U = this.points) == null || U.updatePosition()), this.store.alpha += this.store.addAlpha(this.config.simulationDecay ?? h.simulation.decay), this.isRightClickMouse && this.config.enableRightClickRepulsion && (this.store.alpha = Math.max(this.store.alpha, 0.1)), this.store.simulationProgress = Math.sqrt(Math.min(1, Z / this.store.alpha)), (B = (O = this.config).onSimulationTick) == null || B.call(
6431
+ this.isRightClickMouse && this.config.enableRightClickRepulsion && ((a = this.forceMouse) == null || a.run(), (d = this.points) == null || d.updatePosition()), (t || n && !(this.zoomInstance.isRunning && !this.config.enableSimulationDuringZoom)) && (i && ((l = this.forceGravity) == null || l.run(), (c = this.points) == null || c.updatePosition()), o && ((h = this.forceCenter) == null || h.run(), (p = this.points) == null || p.updatePosition()), (u = this.forceManyBody) == null || u.run(), (_ = this.points) == null || _.updatePosition(), this.store.linksTextureSize && ((R = this.forceLinkIncoming) == null || R.run(), (I = this.points) == null || I.updatePosition(), (P = this.forceLinkOutgoing) == null || P.run(), (A = this.points) == null || A.updatePosition()), (this.graph.pointClusters || this.graph.clusterPositions) && ((F = this.clusters) == null || F.run(), (U = this.points) == null || U.updatePosition()), this.store.alpha += this.store.addAlpha(this.config.simulationDecay ?? f.simulation.decay), this.isRightClickMouse && this.config.enableRightClickRepulsion && (this.store.alpha = Math.max(this.store.alpha, 0.1)), this.store.simulationProgress = Math.sqrt(Math.min(1, K / this.store.alpha)), (B = (O = this.config).onSimulationTick) == null || B.call(
6212
6432
  O,
6213
6433
  this.store.alpha,
6214
6434
  (E = this.store.hoveredPoint) == null ? void 0 : E.index,
6215
- (F = this.store.hoveredPoint) == null ? void 0 : F.position
6216
- )), (b = this.points) == null || b.trackPoints();
6435
+ (N = this.store.hoveredPoint) == null ? void 0 : N.position
6436
+ )), (k = this.points) == null || k.trackPoints();
6217
6437
  }
6218
6438
  initPrograms() {
6219
6439
  var t, i, o, s, n, r;
@@ -6225,7 +6445,7 @@ class Ht {
6225
6445
  frame() {
6226
6446
  if (this._isDestroyed) return;
6227
6447
  const { store: { alpha: t, isSimulationRunning: i } } = this;
6228
- t < Z && i && this.end(), this.requestAnimationFrameId = window.requestAnimationFrame((o) => {
6448
+ t < K && i && this.end(), this.requestAnimationFrameId = window.requestAnimationFrame((o) => {
6229
6449
  this.renderFrame(o), this._isDestroyed || this.frame();
6230
6450
  });
6231
6451
  }
@@ -6234,17 +6454,17 @@ class Ht {
6234
6454
  * This does NOT schedule the next frame.
6235
6455
  */
6236
6456
  renderFrame(t) {
6237
- var i, o, s, n, r, a, l;
6457
+ var i, o, s, n, r, a, d;
6238
6458
  if (!this._isDestroyed && this.store.pointsTextureSize) {
6239
6459
  if ((i = this.fpsMonitor) == null || i.begin(), this.resizeCanvas(), this.dragInstance.isActive || this.findHoveredItem(), this.runSimulationStep(!1), this.device) {
6240
- const d = this.store.backgroundColor ?? [0, 0, 0, 1], c = this.device.beginRenderPass({
6241
- clearColor: d,
6460
+ const l = this.store.backgroundColor ?? [0, 0, 0, 1], c = this.device.beginRenderPass({
6461
+ clearColor: l,
6242
6462
  clearDepth: 1,
6243
6463
  clearStencil: 0
6244
- }), { config: { renderLinks: f } } = this;
6245
- f !== !1 && !!this.store.linksTextureSize && !!this.graph.linksNumber && this.graph.linksNumber > 0 && ((o = this.lines) == null || o.draw(c)), (s = this.points) == null || s.draw(c), this.dragInstance.isActive && ((n = this.points) == null || n.drag(), (r = this.points) == null || r.drag(), (a = this.points) == null || a.trackPoints()), c.end(), this.device.submit();
6464
+ }), { config: { renderLinks: h } } = this;
6465
+ h !== !1 && !!this.store.linksTextureSize && !!this.graph.linksNumber && this.graph.linksNumber > 0 && ((o = this.lines) == null || o.draw(c)), (s = this.points) == null || s.draw(c), this.dragInstance.isActive && ((n = this.points) == null || n.drag(), (r = this.points) == null || r.drag(), (a = this.points) == null || a.trackPoints()), c.end(), this.device.submit();
6246
6466
  }
6247
- (l = this.fpsMonitor) == null || l.end(t ?? performance.now()), this.currentEvent = void 0;
6467
+ (d = this.fpsMonitor) == null || d.end(t ?? performance.now()), this.currentEvent = void 0;
6248
6468
  }
6249
6469
  }
6250
6470
  stopFrames() {
@@ -6265,7 +6485,7 @@ class Ht {
6265
6485
  this.store.isSimulationRunning = !1, this.store.simulationProgress = 1, (i = (t = this.config).onSimulationEnd) == null || i.call(t), this._shouldForceHoverDetection = !0;
6266
6486
  }
6267
6487
  onClick(t) {
6268
- var i, o, s, n, r, a, l, d, c, f;
6488
+ var i, o, s, n, r, a, d, l, c, h;
6269
6489
  (n = (s = this.config).onClick) == null || n.call(
6270
6490
  s,
6271
6491
  (i = this.store.hoveredPoint) == null ? void 0 : i.index,
@@ -6276,11 +6496,11 @@ class Ht {
6276
6496
  this.store.hoveredPoint.index,
6277
6497
  this.store.hoveredPoint.position,
6278
6498
  t
6279
- ) : this.store.hoveredLinkIndex !== void 0 ? (d = (l = this.config).onLinkClick) == null || d.call(
6280
- l,
6499
+ ) : this.store.hoveredLinkIndex !== void 0 ? (l = (d = this.config).onLinkClick) == null || l.call(
6500
+ d,
6281
6501
  this.store.hoveredLinkIndex,
6282
6502
  t
6283
- ) : (f = (c = this.config).onBackgroundClick) == null || f.call(
6503
+ ) : (h = (c = this.config).onBackgroundClick) == null || h.call(
6284
6504
  c,
6285
6505
  t
6286
6506
  );
@@ -6300,7 +6520,7 @@ class Ht {
6300
6520
  );
6301
6521
  }
6302
6522
  onContextMenu(t) {
6303
- var i, o, s, n, r, a, l, d, c, f;
6523
+ var i, o, s, n, r, a, d, l, c, h;
6304
6524
  t.preventDefault(), (n = (s = this.config).onContextMenu) == null || n.call(
6305
6525
  s,
6306
6526
  (i = this.store.hoveredPoint) == null ? void 0 : i.index,
@@ -6311,22 +6531,22 @@ class Ht {
6311
6531
  this.store.hoveredPoint.index,
6312
6532
  this.store.hoveredPoint.position,
6313
6533
  t
6314
- ) : this.store.hoveredLinkIndex !== void 0 ? (d = (l = this.config).onLinkContextMenu) == null || d.call(
6315
- l,
6534
+ ) : this.store.hoveredLinkIndex !== void 0 ? (l = (d = this.config).onLinkContextMenu) == null || l.call(
6535
+ d,
6316
6536
  this.store.hoveredLinkIndex,
6317
6537
  t
6318
- ) : (f = (c = this.config).onBackgroundContextMenu) == null || f.call(
6538
+ ) : (h = (c = this.config).onBackgroundContextMenu) == null || h.call(
6319
6539
  c,
6320
6540
  t
6321
6541
  );
6322
6542
  }
6323
6543
  resizeCanvas(t = !1) {
6324
- var r, a, l;
6544
+ var r, a, d, l;
6325
6545
  if (this._isDestroyed) return;
6326
6546
  const i = this.canvas.clientWidth, o = this.canvas.clientHeight, [s, n] = this.store.screenSize;
6327
6547
  if (t || s !== i || n !== o) {
6328
- const { k: d } = this.zoomInstance.eventTransform, c = this.zoomInstance.convertScreenToSpacePosition([s / 2, n / 2]);
6329
- this.store.updateScreenSize(i, o), (r = this.canvasD3Selection) == null || r.call(this.zoomInstance.behavior.transform, this.zoomInstance.getTransform(c, d)), (a = this.points) == null || a.updateSampledPointsGrid(), this.store.isLinkHoveringEnabled && ((l = this.lines) == null || l.updateLinkIndexFbo());
6548
+ const { k: c } = this.zoomInstance.eventTransform, h = this.zoomInstance.convertScreenToSpacePosition([s / 2, n / 2]);
6549
+ this.store.updateScreenSize(i, o), (r = this.canvasD3Selection) == null || r.call(this.zoomInstance.behavior.transform, this.zoomInstance.getTransform(h, c)), (a = this.points) == null || a.updateSampledPointsGrid(), (d = this.lines) == null || d.updateSampledLinksGrid(), this.store.isLinkHoveringEnabled && ((l = this.lines) == null || l.updateLinkIndexFbo());
6330
6550
  }
6331
6551
  }
6332
6552
  updateZoomDragBehaviors() {
@@ -6335,7 +6555,7 @@ class Ht {
6335
6555
  }
6336
6556
  findHoveredItem() {
6337
6557
  if (this._isDestroyed || !this._isMouseOnCanvas) return;
6338
- if (this._findHoveredItemExecutionCount < ye) {
6558
+ if (this._findHoveredItemExecutionCount < Fe) {
6339
6559
  this._findHoveredItemExecutionCount += 1;
6340
6560
  return;
6341
6561
  }
@@ -6351,24 +6571,24 @@ class Ht {
6351
6571
  }
6352
6572
  }
6353
6573
  findHoveredPoint() {
6354
- var l, d, c, f, p;
6574
+ var d, l, c, h, p;
6355
6575
  if (this._isDestroyed || !this.device || !this.points) return;
6356
6576
  this.points.findHoveredPoint();
6357
6577
  let t = !1, i = !1;
6358
- const o = N(this.device, this.points.hoveredFbo, 0, 0, 2, 2), s = o[0], n = o[1], r = o[2], a = o[3];
6578
+ const o = y(this.device, this.points.hoveredFbo, 0, 0, 2, 2), s = o[0], n = o[1], r = o[2], a = o[3];
6359
6579
  n > 0 ? ((this.store.hoveredPoint === void 0 || this.store.hoveredPoint.index !== s) && (t = !0), this.store.hoveredPoint = {
6360
6580
  index: s,
6361
6581
  position: [r, a]
6362
- }) : (this.store.hoveredPoint && (i = !0), this.store.hoveredPoint = void 0), t && this.store.hoveredPoint && ((c = (d = this.config).onPointMouseOver) == null || c.call(
6363
- d,
6582
+ }) : (this.store.hoveredPoint && (i = !0), this.store.hoveredPoint = void 0), t && this.store.hoveredPoint && ((c = (l = this.config).onPointMouseOver) == null || c.call(
6583
+ l,
6364
6584
  this.store.hoveredPoint.index,
6365
6585
  this.store.hoveredPoint.position,
6366
6586
  this.currentEvent,
6367
- ((l = this.store.selectedIndices) == null ? void 0 : l.includes(this.store.hoveredPoint.index)) ?? !1
6368
- )), i && ((p = (f = this.config).onPointMouseOut) == null || p.call(f, this.currentEvent));
6587
+ ((d = this.store.selectedIndices) == null ? void 0 : d.includes(this.store.hoveredPoint.index)) ?? !1
6588
+ )), i && ((p = (h = this.config).onPointMouseOut) == null || p.call(h, this.currentEvent));
6369
6589
  }
6370
6590
  findHoveredLine() {
6371
- var n, r, a, l, d, c;
6591
+ var n, r, a, d, l, c;
6372
6592
  if (this._isDestroyed || !this.lines) return;
6373
6593
  if (this.store.hoveredPoint) {
6374
6594
  this.store.hoveredLinkIndex !== void 0 && (this.store.hoveredLinkIndex = void 0, (r = (n = this.config).onLinkMouseOut) == null || r.call(n, this.currentEvent));
@@ -6377,12 +6597,12 @@ class Ht {
6377
6597
  this.lines.findHoveredLine();
6378
6598
  let t = !1, i = !1;
6379
6599
  if (!this.device) return;
6380
- const s = N(this.device, this.lines.hoveredLineIndexFbo)[0];
6381
- s >= 0 ? (this.store.hoveredLinkIndex !== s && (t = !0), this.store.hoveredLinkIndex = s) : (this.store.hoveredLinkIndex !== void 0 && (i = !0), this.store.hoveredLinkIndex = void 0), t && this.store.hoveredLinkIndex !== void 0 && ((l = (a = this.config).onLinkMouseOver) == null || l.call(a, this.store.hoveredLinkIndex)), i && ((c = (d = this.config).onLinkMouseOut) == null || c.call(d, this.currentEvent));
6600
+ const s = y(this.device, this.lines.hoveredLineIndexFbo)[0];
6601
+ s >= 0 ? (this.store.hoveredLinkIndex !== s && (t = !0), this.store.hoveredLinkIndex = s) : (this.store.hoveredLinkIndex !== void 0 && (i = !0), this.store.hoveredLinkIndex = void 0), t && this.store.hoveredLinkIndex !== void 0 && ((d = (a = this.config).onLinkMouseOver) == null || d.call(a, this.store.hoveredLinkIndex)), i && ((c = (l = this.config).onLinkMouseOut) == null || c.call(l, this.currentEvent));
6382
6602
  }
6383
6603
  updateCanvasCursor() {
6384
6604
  const { hoveredPointCursor: t, hoveredLinkCursor: i } = this.config;
6385
- this.dragInstance.isActive ? z(this.canvas).style("cursor", "grabbing") : this.store.hoveredPoint ? !this.config.enableDrag || this.store.isSpaceKeyPressed ? z(this.canvas).style("cursor", t) : z(this.canvas).style("cursor", "grab") : this.store.isLinkHoveringEnabled && this.store.hoveredLinkIndex !== void 0 ? z(this.canvas).style("cursor", i) : z(this.canvas).style("cursor", null);
6605
+ this.dragInstance.isActive ? b(this.canvas).style("cursor", "grabbing") : this.store.hoveredPoint ? !this.config.enableDrag || this.store.isSpaceKeyPressed ? b(this.canvas).style("cursor", t) : b(this.canvas).style("cursor", "grab") : this.store.isLinkHoveringEnabled && this.store.hoveredLinkIndex !== void 0 ? b(this.canvas).style("cursor", i) : b(this.canvas).style("cursor", null);
6386
6606
  }
6387
6607
  addAttribution() {
6388
6608
  var t;
@@ -6395,26 +6615,40 @@ class Ht {
6395
6615
  margin: 0 0.6rem 0.6rem 0;
6396
6616
  font-size: 0.7rem;
6397
6617
  font-family: inherit;
6398
- `, this.attributionDivElement.innerHTML = Ue(this.config.attribution, {
6618
+ `, this.attributionDivElement.innerHTML = Be(this.config.attribution, {
6399
6619
  ALLOWED_TAGS: ["a", "b", "i", "em", "strong", "span", "div", "p", "br", "img"],
6400
6620
  ALLOWED_ATTR: ["href", "target", "class", "id", "style", "src", "alt", "title"]
6401
6621
  }), (t = this.store.div) == null || t.appendChild(this.attributionDivElement));
6402
6622
  }
6403
6623
  }
6404
6624
  export {
6405
- Ht as Graph,
6406
- tt as PointShape,
6407
- Oe as clamp,
6625
+ Lt as Graph,
6626
+ it as PointShape,
6627
+ Ue as clamp,
6628
+ te as defaultBackgroundColor,
6629
+ f as defaultConfigValues,
6630
+ xe as defaultGreyoutLinkOpacity,
6631
+ Y as defaultGreyoutPointColor,
6632
+ ge as defaultGreyoutPointOpacity,
6633
+ Re as defaultLinkColor,
6634
+ ve as defaultLinkOpacity,
6635
+ Ae as defaultLinkWidth,
6636
+ Te as defaultPointColor,
6637
+ Ce as defaultPointOpacity,
6638
+ Pe as defaultPointSize,
6639
+ ye as defaultScaleToZoom,
6640
+ Ie as focusedPointRingOpacity,
6408
6641
  $ as getMaxPointSize,
6409
- k as getRgbaColor,
6642
+ z as getRgbaColor,
6643
+ me as hoveredPointRingOpacity,
6410
6644
  De as isAClassInstance,
6411
- te as isArray,
6412
- Fe as isFunction,
6413
- D as isNumber,
6414
- Ne as isObject,
6645
+ ie as isArray,
6646
+ Ne as isFunction,
6647
+ M as isNumber,
6648
+ Me as isObject,
6415
6649
  Q as isPlainObject,
6416
- N as readPixels,
6417
- Me as rgbToBrightness,
6418
- Ue as sanitizeHtml
6650
+ y as readPixels,
6651
+ Oe as rgbToBrightness,
6652
+ Be as sanitizeHtml
6419
6653
  };
6420
6654
  //# sourceMappingURL=index.js.map