export declare const RECT_VERT = "#version 300 es\nprecision highp float;\n\n// Per-vertex: unit quad (0,0)\u2192(1,1)\nlayout(location = 0) in vec2 a_position;\n\n// Per-instance\nlayout(location = 1) in vec4 a_rect; // x, y, w, h (CSS pixels)\nlayout(location = 2) in vec4 a_color; // r, g, b, a (0\u20131)\n\nuniform vec2 u_resolution; // viewport size in CSS pixels\n\nout vec4 v_color;\n\nvoid main() {\n vec2 pos = a_rect.xy + a_position * a_rect.zw;\n // Convert CSS pixels \u2192 clip space: [0, width] \u2192 [-1, 1]\n vec2 clip = (pos / u_resolution) * 2.0 - 1.0;\n clip.y = -clip.y; // flip Y (canvas convention: top=0)\n gl_Position = vec4(clip, 0.0, 1.0);\n v_color = a_color;\n}\n"; export declare const RECT_FRAG = "#version 300 es\nprecision highp float;\n\nin vec4 v_color;\nout vec4 fragColor;\n\nvoid main() {\n fragColor = v_color;\n}\n"; export declare const LINE_VERT = "#version 300 es\nprecision highp float;\n\n// Per-instance: line segment\nlayout(location = 0) in vec2 a_p0; // start point (CSS px)\nlayout(location = 1) in vec2 a_p1; // end point (CSS px)\nlayout(location = 2) in float a_width; // line width (CSS px)\nlayout(location = 3) in vec4 a_color; // rgba (0\u20131)\nlayout(location = 4) in float a_vertex; // vertex index 0\u20133 (quad corners)\n\nuniform vec2 u_resolution;\n\nout vec4 v_color;\n\nvoid main() {\n vec2 dir = a_p1 - a_p0;\n float len = length(dir);\n vec2 norm = len > 0.001 ? vec2(-dir.y, dir.x) / len : vec2(0.0, 1.0);\n float hw = a_width * 0.5;\n\n // Quad corners: 0=p0-n, 1=p0+n, 2=p1-n, 3=p1+n\n int vi = int(a_vertex);\n vec2 base = (vi < 2) ? a_p0 : a_p1;\n float side = (vi == 0 || vi == 2) ? -1.0 : 1.0;\n vec2 pos = base + norm * hw * side;\n\n vec2 clip = (pos / u_resolution) * 2.0 - 1.0;\n clip.y = -clip.y;\n gl_Position = vec4(clip, 0.0, 1.0);\n v_color = a_color;\n}\n"; export declare const LINE_FRAG = "#version 300 es\nprecision highp float;\n\nin vec4 v_color;\nout vec4 fragColor;\n\nvoid main() {\n fragColor = v_color;\n}\n"; export declare const TEXT_VERT = "#version 300 es\nprecision highp float;\n\nlayout(location = 0) in vec2 a_position; // unit quad vertex\nlayout(location = 1) in vec4 a_rect; // screen rect: x, y, w, h\nlayout(location = 2) in vec4 a_uv; // texture rect: u0, v0, u1, v1\n\nuniform vec2 u_resolution;\n\nout vec2 v_uv;\n\nvoid main() {\n vec2 pos = a_rect.xy + a_position * a_rect.zw;\n vec2 clip = (pos / u_resolution) * 2.0 - 1.0;\n clip.y = -clip.y;\n gl_Position = vec4(clip, 0.0, 1.0);\n\n // Interpolate UV\n v_uv = mix(a_uv.xy, a_uv.zw, a_position);\n}\n"; export declare const TEXT_FRAG = "#version 300 es\nprecision highp float;\n\nuniform sampler2D u_texture;\n\nin vec2 v_uv;\nout vec4 fragColor;\n\nvoid main() {\n fragColor = texture(u_texture, v_uv);\n}\n"; export declare const CANDLE_VERT = "#version 300 es\nprecision highp float;\n\n// Per-instance: raw OHLC data\nlayout(location = 0) in float a_open;\nlayout(location = 1) in float a_high;\nlayout(location = 2) in float a_low;\nlayout(location = 3) in float a_close;\nlayout(location = 4) in float a_barIndex; // relative bar index (float)\n\n// Uniforms\nuniform vec2 u_resolution; // viewport CSS pixels\nuniform float u_chartHeight; // chart area height\nuniform float u_priceMin; // visible price range min\nuniform float u_priceRange; // max - min\nuniform float u_barSpacing; // pixels per bar\nuniform float u_offsetX; // scroll offset\nuniform float u_bodyWidth; // candle body width (pixels)\nuniform vec4 u_bullColor; // bull body RGBA\nuniform vec4 u_bearColor; // bear body RGBA\nuniform vec4 u_bullWickColor; // bull wick RGBA\nuniform vec4 u_bearWickColor; // bear wick RGBA\n\nout vec4 v_color;\n\n// 12 vertices per candle:\n// 0-5: body quad (two triangles)\n// 6-11: wick quad (two triangles, 1px wide)\n\nfloat priceToY(float price) {\n return u_chartHeight * (1.0 - (price - u_priceMin) / u_priceRange);\n}\n\nvoid main() {\n int vid = gl_VertexID % 12;\n bool isWick = vid >= 6;\n int quadVid = isWick ? vid - 6 : vid;\n\n float centerX = a_barIndex * u_barSpacing + u_offsetX + u_barSpacing * 0.5;\n\n bool isBull = a_close >= a_open;\n float bodyTop = priceToY(isBull ? a_close : a_open);\n float bodyBot = priceToY(isBull ? a_open : a_close);\n // Ensure min 1px body\n if (bodyBot - bodyTop < 1.0) bodyBot = bodyTop + 1.0;\n\n float highY = priceToY(a_high);\n float lowY = priceToY(a_low);\n\n float hw = isWick ? 0.5 : u_bodyWidth * 0.5;\n float top = isWick ? highY : bodyTop;\n float bot = isWick ? lowY : bodyBot;\n\n // Quad: 6 verts (2 tris) \u2014 TL, TR, BL, TR, BR, BL\n vec2 pos;\n float left = floor(centerX - hw + 0.5);\n float right = left + (isWick ? 1.0 : u_bodyWidth);\n float topy = top;\n float boty = bot;\n\n if (quadVid == 0) pos = vec2(left, topy); // TL\n else if (quadVid == 1) pos = vec2(right, topy); // TR\n else if (quadVid == 2) pos = vec2(left, boty); // BL\n else if (quadVid == 3) pos = vec2(right, topy); // TR\n else if (quadVid == 4) pos = vec2(right, boty); // BR\n else pos = vec2(left, boty); // BL\n\n vec2 clip = (pos / u_resolution) * 2.0 - 1.0;\n clip.y = -clip.y;\n gl_Position = vec4(clip, 0.0, 1.0);\n\n if (isWick) {\n v_color = isBull ? u_bullWickColor : u_bearWickColor;\n } else {\n v_color = isBull ? u_bullColor : u_bearColor;\n }\n}\n"; export declare const CANDLE_FRAG = "#version 300 es\nprecision highp float;\n\nin vec4 v_color;\nout vec4 fragColor;\n\nvoid main() {\n fragColor = v_color;\n}\n"; export declare const VOLUME_VERT = "#version 300 es\nprecision highp float;\n\nlayout(location = 0) in float a_volume;\nlayout(location = 1) in float a_isBull; // 1.0 = bull, 0.0 = bear\nlayout(location = 2) in float a_barIndex;\n\nuniform vec2 u_resolution;\nuniform float u_chartHeight;\nuniform float u_maxVolume;\nuniform float u_barSpacing;\nuniform float u_offsetX;\nuniform float u_bodyWidth;\nuniform float u_volumeZoneHeight;\nuniform vec4 u_bullColor;\nuniform vec4 u_bearColor;\n\nout vec4 v_color;\n\nvoid main() {\n int vid = gl_VertexID % 6;\n\n float centerX = a_barIndex * u_barSpacing + u_offsetX + u_barSpacing * 0.5;\n float hw = u_bodyWidth * 0.5;\n float left = floor(centerX - hw + 0.5);\n float right = left + u_bodyWidth;\n\n float barH = (a_volume / u_maxVolume) * u_volumeZoneHeight;\n float top = u_chartHeight - barH;\n float bot = u_chartHeight;\n\n vec2 pos;\n if (vid == 0) pos = vec2(left, top);\n else if (vid == 1) pos = vec2(right, top);\n else if (vid == 2) pos = vec2(left, bot);\n else if (vid == 3) pos = vec2(right, top);\n else if (vid == 4) pos = vec2(right, bot);\n else pos = vec2(left, bot);\n\n vec2 clip = (pos / u_resolution) * 2.0 - 1.0;\n clip.y = -clip.y;\n gl_Position = vec4(clip, 0.0, 1.0);\n\n v_color = a_isBull > 0.5 ? u_bullColor : u_bearColor;\n}\n"; export declare const VOLUME_FRAG = "#version 300 es\nprecision highp float;\n\nin vec4 v_color;\nout vec4 fragColor;\n\nvoid main() {\n fragColor = v_color;\n}\n"; export declare const GRADIENT_RECT_VERT = "#version 300 es\nprecision highp float;\n\nlayout(location = 0) in vec2 a_position; // unit quad\nlayout(location = 1) in vec4 a_rect; // x, y, w, h\nlayout(location = 2) in vec4 a_colorTop; // top color\nlayout(location = 3) in vec4 a_colorBot; // bottom color\n\nuniform vec2 u_resolution;\n\nout vec4 v_color;\n\nvoid main() {\n vec2 pos = a_rect.xy + a_position * a_rect.zw;\n vec2 clip = (pos / u_resolution) * 2.0 - 1.0;\n clip.y = -clip.y;\n gl_Position = vec4(clip, 0.0, 1.0);\n v_color = mix(a_colorTop, a_colorBot, a_position.y);\n}\n"; export declare const GRADIENT_RECT_FRAG = "#version 300 es\nprecision highp float;\n\nin vec4 v_color;\nout vec4 fragColor;\n\nvoid main() {\n fragColor = v_color;\n}\n";