@razorpay/blade 12.95.0 → 12.95.2

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.
Files changed (67) hide show
  1. package/build/lib/native/components/Card/Card.js +1 -1
  2. package/build/lib/native/components/Card/Card.js.map +1 -1
  3. package/build/lib/native/components/Input/BaseInput/baseInputStyles.js +1 -1
  4. package/build/lib/native/components/Input/BaseInput/baseInputStyles.js.map +1 -1
  5. package/build/lib/native/components/Spark/RazorSenseGradient/shader.js +10 -3
  6. package/build/lib/native/components/Spark/RazorSenseGradient/shader.js.map +1 -1
  7. package/build/lib/native/components/Spark/RzpGlass/RzpGlass.js +5 -4
  8. package/build/lib/native/components/Spark/RzpGlass/RzpGlass.js.map +1 -1
  9. package/build/lib/native/components/Spark/RzpGlass/RzpGlassMount.js +2 -1
  10. package/build/lib/native/components/Spark/RzpGlass/RzpGlassMount.js.map +1 -1
  11. package/build/lib/native/components/Spark/RzpGlass/rzpGlassShader.js +8 -5
  12. package/build/lib/native/components/Spark/RzpGlass/rzpGlassShader.js.map +1 -1
  13. package/build/lib/native/components/Spark/RzpGlass/utils.js +4 -2
  14. package/build/lib/native/components/Spark/RzpGlass/utils.js.map +1 -1
  15. package/build/lib/web/development/components/Card/Card.js +7 -1
  16. package/build/lib/web/development/components/Card/Card.js.map +1 -1
  17. package/build/lib/web/development/components/Dropdown/DropdownOverlay.web.js +0 -1
  18. package/build/lib/web/development/components/Dropdown/DropdownOverlay.web.js.map +1 -1
  19. package/build/lib/web/development/components/Input/BaseInput/baseInputStyles.js +1 -0
  20. package/build/lib/web/development/components/Input/BaseInput/baseInputStyles.js.map +1 -1
  21. package/build/lib/web/development/components/Modal/Modal.web.js +31 -28
  22. package/build/lib/web/development/components/Modal/Modal.web.js.map +1 -1
  23. package/build/lib/web/development/components/SideNav/SideNavItems/SideNavItem.web.js +1 -1
  24. package/build/lib/web/development/components/SideNav/SideNavItems/SideNavItem.web.js.map +1 -1
  25. package/build/lib/web/development/components/Spark/RazorSenseGradient/shader.js +1 -1
  26. package/build/lib/web/development/components/Spark/RazorSenseGradient/shader.js.map +1 -1
  27. package/build/lib/web/development/components/Spark/RzpGlass/RzpGlass.js +14 -103
  28. package/build/lib/web/development/components/Spark/RzpGlass/RzpGlass.js.map +1 -1
  29. package/build/lib/web/development/components/Spark/RzpGlass/RzpGlassMount.js +8 -6
  30. package/build/lib/web/development/components/Spark/RzpGlass/RzpGlassMount.js.map +1 -1
  31. package/build/lib/web/development/components/Spark/RzpGlass/rzpGlassShader.js +1 -1
  32. package/build/lib/web/development/components/Spark/RzpGlass/rzpGlassShader.js.map +1 -1
  33. package/build/lib/web/development/components/Spark/RzpGlass/utils.js +68 -1
  34. package/build/lib/web/development/components/Spark/RzpGlass/utils.js.map +1 -1
  35. package/build/lib/web/development/components/TopNav/TabNav/TabNavItem.web.js +3 -2
  36. package/build/lib/web/development/components/TopNav/TabNav/TabNavItem.web.js.map +1 -1
  37. package/build/lib/web/production/_virtual/flatten.js +1 -1
  38. package/build/lib/web/production/_virtual/flatten3.js +1 -1
  39. package/build/lib/web/production/components/Card/Card.js +7 -1
  40. package/build/lib/web/production/components/Card/Card.js.map +1 -1
  41. package/build/lib/web/production/components/Dropdown/DropdownOverlay.web.js +0 -1
  42. package/build/lib/web/production/components/Dropdown/DropdownOverlay.web.js.map +1 -1
  43. package/build/lib/web/production/components/Input/BaseInput/baseInputStyles.js +1 -0
  44. package/build/lib/web/production/components/Input/BaseInput/baseInputStyles.js.map +1 -1
  45. package/build/lib/web/production/components/Modal/Modal.web.js +31 -28
  46. package/build/lib/web/production/components/Modal/Modal.web.js.map +1 -1
  47. package/build/lib/web/production/components/SideNav/SideNavItems/SideNavItem.web.js +1 -1
  48. package/build/lib/web/production/components/SideNav/SideNavItems/SideNavItem.web.js.map +1 -1
  49. package/build/lib/web/production/components/Spark/RazorSenseGradient/shader.js +1 -1
  50. package/build/lib/web/production/components/Spark/RazorSenseGradient/shader.js.map +1 -1
  51. package/build/lib/web/production/components/Spark/RzpGlass/RzpGlass.js +14 -103
  52. package/build/lib/web/production/components/Spark/RzpGlass/RzpGlass.js.map +1 -1
  53. package/build/lib/web/production/components/Spark/RzpGlass/RzpGlassMount.js +8 -6
  54. package/build/lib/web/production/components/Spark/RzpGlass/RzpGlassMount.js.map +1 -1
  55. package/build/lib/web/production/components/Spark/RzpGlass/rzpGlassShader.js +1 -1
  56. package/build/lib/web/production/components/Spark/RzpGlass/rzpGlassShader.js.map +1 -1
  57. package/build/lib/web/production/components/Spark/RzpGlass/utils.js +68 -1
  58. package/build/lib/web/production/components/Spark/RzpGlass/utils.js.map +1 -1
  59. package/build/lib/web/production/components/TopNav/TabNav/TabNavItem.web.js +3 -2
  60. package/build/lib/web/production/components/TopNav/TabNav/TabNavItem.web.js.map +1 -1
  61. package/build/lib/web/production/node_modules/es-toolkit/dist/array/flatten.js +1 -1
  62. package/build/lib/web/production/node_modules/es-toolkit/dist/compat/array/flatten.js +1 -1
  63. package/build/lib/web/production/node_modules/es-toolkit/dist/compat/array/sortBy.js +2 -2
  64. package/build/lib/web/production/node_modules/es-toolkit/dist/compat/object/omit.js +2 -2
  65. package/build/types/components/index.d.ts +40 -0
  66. package/build/types/components/index.native.d.ts +39 -0
  67. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"rzpGlassShader.js","sources":["../../../../../../src/components/Spark/RzpGlass/rzpGlassShader.ts"],"sourcesContent":["const rzpGlassVertexShader = /* glsl */ `\nprecision mediump float;\n\nattribute vec2 position;\nattribute vec2 uv;\n\n// Zoom & Pan uniforms (computed in vertex shader for efficiency)\nuniform float uZoom;\nuniform vec2 uPan; // vec2(uPanX, uPanY)\n\n// Output varyings\nvarying vec2 vUv; // Raw screen UV (for screen-space effects like feathering)\nvarying vec2 vContentUv; // Transformed UV for video/content sampling (zoom + pan applied)\n\nvoid main() {\n // Raw screen UV for screen-space effects\n vUv = uv;\n \n // Compute zoomed/panned UV for content sampling\n // Zoom: scale around center (0.5, 0.5)\n // Pan: offset the view\n vContentUv = (uv - 0.5) / uZoom + 0.5;\n vContentUv += uPan;\n \n gl_Position = vec4(position, 0, 1);\n}\n`;\n\nconst rzpGlassFragmentShader = /* glsl */ `\nprecision mediump float;\n\nuniform float uTime;\nuniform vec2 iResolution;\nuniform float uDpr;\nuniform sampler2D uVideoTexture;\nuniform sampler2D uGradientMap;\nuniform sampler2D uGradientMap2; // Second gradient map for cross-fade blending\nuniform sampler2D uCenterGradientMap; // Separate gradient map for center ellipse\n\n// Layer toggles (enable/disable actual effects)\nuniform float uEnableDisplacement;\nuniform float uEnableColorama;\nuniform float uEnableBloom;\nuniform float uEnableLightSweep;\n\n// ============================================\n// COLORAMA UNIFORMS (Adobe AE v5 Pipeline)\n// Pipeline: Scalar → Remap → Warp → Wrap → Lookup → Blend\n// ============================================\n\n// --- 1. INPUT PHASE (Scalar Index Generation) ---\nuniform float uInputMin; // Input range min (default 0.0)\nuniform float uInputMax; // Input range max (default 1.0)\n\n// --- 2. MODIFY PHASE (Index Space Warping) ---\nuniform float uModifyGamma; // Gamma curve: <1 = brights, >1 = darks (default 1.0)\nuniform float uPosterizeLevels; // 0 = off, >0 = number of discrete steps\nuniform float uCycleRepetitions; // Stretch/compress the index (default 1.0)\nuniform float uPhaseShift; // Static offset (default 0.0)\nuniform float uCycleSpeed; // Cycling animation speed (default 0.0)\n\n// --- 3. OUTPUT CYCLE (Wrap & Lookup) ---\nuniform float uWrapMode; // 0 = clamp, 1 = wrap/fract (default 1.0)\nuniform float uReverse; // 0 = normal, 1 = reverse gradient (default 0.0)\n\n// --- 4. COMPOSITE ---\nuniform float uBlendWithOriginal; // 0 = full effect, 1 = original (default 0.0)\nuniform float uGradientMapBlend; // 0 = uGradientMap, 1 = uGradientMap2 (default 0.0)\n\n// --- 5. LIGHT EFFECT ---\nuniform float uLightIntensity; // Strength of light sweep effect\nuniform float uFrameCount; // Current frame number\nuniform float uLightStartFrame; // Frame when light effect starts\n\n// --- 6. DISPLACEMENT ---\nuniform float uNumSegments; // Number of glass slits (default 45.0)\nuniform float uSlitAngle; // Angle of slits in radians (default 0.13)\nuniform float uDisplacementX; // X displacement amount (default -12.0)\nuniform float uDisplacementY; // Y displacement amount (default -20.0)\n\n// --- 7. CENTER ELEMENT ---\nuniform float uEnableCenterElement; // Toggle center element (0 = off, 1 = on)\nuniform float uCenterAnimDuration; // Duration of one animation cycle in seconds\nuniform float uCenterAnimTime; // Current animation time in seconds (resets with video loop)\n\n// --- 8. COLOR CORRECTION ---\nuniform float uCCBlackPoint; // Levels black point (default 0.0)\nuniform float uCCWhitePoint; // Levels white point (default 1.0)\nuniform float uCCMidtoneGamma; // Midtone gamma (default 1.2)\nuniform float uCCGamma; // Output gamma (default 1.2)\nuniform float uCCContrast; // Contrast boost (default 0.0)\n\n// --- 9. ZOOM & PAN ---\nuniform float uZoom; // Zoom level (1.0 = normal, 2.0 = 2x zoom) - still needed for edge feather check\nuniform vec4 uEdgeFeather; // Per-side feathering: vec4(top, right, bottom, left) clockwise, 0 = none, 1 = max\nuniform vec2 uRefResolution; // Reference resolution for zoom-independent displacement\nuniform vec4 uVisibleUvBounds; // vec4(minX, minY, maxX, maxY) - visible portion of canvas in container\n\n// --- 10. BACKGROUND COLOR ---\nuniform vec3 uBackgroundColor; // Background color to blend with (RGB 0-1)\n\n// UV coordinates from the vertex shader\nvarying vec2 vUv; // Raw screen UV (for screen-space effects)\nvarying vec2 vContentUv; // Transformed UV with zoom/pan applied (for content sampling)\n\n// ============================================\n// UTILITY FUNCTIONS\n// ============================================\n// Rec. 709 luminance calculation\nfloat luminance(vec3 color) {\n return dot(color, vec3(0.2126, 0.7152, 0.0722));\n}\n\n// ============================================\n// COLORAMA EFFECT (Adobe After Effects v5 Pipeline)\n// ============================================\n//\n// Pipeline:\n// Image → Scalar Field (0-1) → Warp/Animate → Gradient Lookup → Composite\n//\n// This matches AE's indexed gradient remapping with time-domain cycling.\nvec3 applyColoramaWithGradient(\n sampler2D gradientMap, // Gradient map texture to sample from\n float rawIntensity, // Raw luminance from pixel\n float inputMin, // Input range min\n float inputMax, // Input range max\n float gamma, // Gamma curve (pow)\n float posterizeLevels, // 0 = off, else discrete steps\n float cycleReps, // Cycle repetitions (stretch)\n float phaseShift, // Static offset\n float cycleSpeed, // Time-based cycling\n float wrapMode, // 0 = clamp, 1 = wrap\n float reverse // 0 = normal, 1 = flip\n) {\n // ─────────────────────────────────────────────\n // STEP 1: INPUT PHASE - Scalar Index Generation\n // ─────────────────────────────────────────────\n // Normalize intensity to input range\n float t = clamp((rawIntensity - inputMin) / (inputMax - inputMin), 0.0, 1.0);\n\n // ─────────────────────────────────────────────\n // STEP 2: MODIFY PHASE - Index Space Warping\n // ─────────────────────────────────────────────\n\n // a) Gamma / Curves - reshape the intensity distribution\n t = pow(t, gamma);\n\n // b) Posterize - quantize to discrete levels (branchless)\n // When posterizeLevels <= 0, keeps t unchanged\n float posterized = floor(t * posterizeLevels + 0.0001) / max(posterizeLevels, 0.0001);\n t = mix(t, posterized, step(0.001, posterizeLevels));\n\n // c) Cycle Repetitions - stretch/compress across gradient\n t = t * cycleReps;\n\n // d) Phase Shift - static offset\n t = t + phaseShift;\n\n // e) Cycling Animation - time-based offset\n t = t + cycleSpeed * uTime;\n\n // ─────────────────────────────────────────────\n // STEP 3: OUTPUT CYCLE - Wrap & Lookup (branchless)\n // ─────────────────────────────────────────────\n\n // Wrap (fract) vs Clamp - branchless selection\n t = mix(clamp(t, 0.0, 1.0), fract(t), step(0.5, wrapMode));\n\n // Reverse direction - branchless\n t = mix(t, 1.0 - t, step(0.5, reverse));\n\n // Gradient lookup (1D texture sample)\n return texture2D(gradientMap, vec2(t, 0.5)).rgb;\n}\n\n// ============================================\n// DISPLACEMENT FUNCTIONS\n// ============================================\n// Create striped displacement map for glass refraction effect\n// Returns: x = signed displacement (-1 to 1), y = local UV x position within segment\n// gradientStart: gradient value at left edge (typically 1.0 for white)\n// gradientEnd: gradient value at right edge (typically 0.0 for black)\n// gradientPower: power curve for falloff (1.0 = linear, <1.0 = steeper, >1.0 = gentler)\n// centerPoint: center value for signed conversion (typically 0.5)\n// aspect: screen aspect ratio (width/height) for consistent slit angle\nvec2 createStripedDisplacement(\n vec2 uv,\n float numSegments,\n float angle,\n float gradientStart,\n float gradientEnd,\n float gradientPower,\n float centerPoint,\n float aspect\n) {\n // Work in aspect-corrected UV space where x and y have equal visual scale\n // This ensures consistent slit angle regardless of viewport dimensions\n vec2 aspectUV = uv * vec2(aspect, 1.0);\n \n // Apply slant in aspect-corrected space\n float slantedX = aspectUV.x - aspectUV.y * tan(angle);\n\n // Calculate segment properties (account for aspect-scaled x range)\n float segmentWidth = aspect / numSegments;\n float localUVx = fract(slantedX / segmentWidth); // 0-1 within each segment\n\n // Create the displacement map gradient\n // Use smoothstep for smoother interpolation\n float smoothUVx = smoothstep(0.0, 1.0, localUVx);\n // Interpolate from gradientEnd (left) to gradientStart (right)\n float rawGradient = mix(gradientEnd, gradientStart, smoothUVx);\n\n // Apply power curve for falloff control\n rawGradient = pow(rawGradient, gradientPower);\n\n // Convert to signed displacement (-1 to 1) using centerPoint\n // centerPoint is the neutral value (typically 0.5)\n float signedDisplacement = (rawGradient - centerPoint) / centerPoint;\n\n return vec2(signedDisplacement, localUVx);\n}\n\n// Apply displacement offset to UV coordinates\nvec2 applyDisplacement(vec2 uv, float signedDisplacement, vec2 maxDisplacement, vec2 resolution) {\n vec2 displaceOffset = vec2(\n signedDisplacement * maxDisplacement.x / resolution.x,\n signedDisplacement * maxDisplacement.y / resolution.y\n );\n return uv + displaceOffset;\n}\n\n// Create thin slanted stripes with multi-stop gradient color\n// Returns RGB color: gradient stripes with 3 color stops\n// Stop 1 (0%): colorStart, Stop 2 (stopPosition): colorMid, Stop 3 (100%): transparent\nvec4 createStripes(\n vec2 uv,\n float numSegments,\n float angle,\n float stopPosition, // Position of middle stop (0.0 to 1.0)\n vec4 colorStart, // Color at 0% (left edge)\n vec4 colorMid, // Color at stopPosition\n float aspect // Screen aspect ratio for consistent angle\n) {\n // Work in aspect-corrected UV space where x and y have equal visual scale\n vec2 aspectUV = uv * vec2(aspect, 1.0);\n \n // Apply slant in aspect-corrected space\n float slantedX = aspectUV.x - aspectUV.y * tan(angle);\n\n // Calculate segment properties (account for aspect-scaled x range)\n float segmentWidth = aspect / numSegments;\n float localUVx = 1.0 - fract(slantedX / segmentWidth); // 0-1 within each segment, reversed\n\n // Multi-stop gradient:\n // 0% -> colorStart (green)\n // stopPosition -> colorMid (white)\n // 100% -> transparent (black with 0 opacity)\n\n vec4 gradientColor;\n float opacity;\n\n if (localUVx < stopPosition) {\n float t = localUVx / stopPosition;\n gradientColor = mix(colorMid, colorStart, t);\n opacity = 0.5;\n } else {\n float t = (localUVx - stopPosition) / (1.0 - stopPosition);\n gradientColor = mix(vec4(0.0), colorMid, t);\n opacity = 0.5 - t * 0.5;\n }\n\n return gradientColor * opacity;\n}\n\n// Sample texture with displacement applied\nvec4 sampleWithDisplacement(\n sampler2D tex,\n vec2 uv,\n float signedDisplacement,\n vec2 maxDisplacement,\n vec2 resolution\n) {\n vec2 displacedUV = applyDisplacement(uv, signedDisplacement, maxDisplacement, resolution);\n return texture2D(tex, displacedUV);\n}\n\n// ============================================\n// POST-PROCESSING EFFECTS\n// ============================================\nvec3 applyBloom(vec3 color, float intensity, float innerMask) {\n const float whiteCoreThresholdMin = 0.5; // Start of white core mask\n const float whiteCoreThresholdMax = 0.85; // End of white core mask\n const float whiteCoreBlendStrength = 0.85; // How much to blend towards pure white\n\n const float bloomThresholdMin = 0.3; // Start of bloom glow\n const float bloomThresholdMax = 0.7; // End of bloom glow\n const vec3 bloomColor = vec3(1.0, 0.99, 0.97); // Warm white bloom tint\n const float bloomStrength = 0.10; // Intensity of bloom glow\n // -------------------------------\n\n // Calculate how much we're in the \"center\" bright area\n // Use a tighter threshold for the white core\n float whiteCoreMask = smoothstep(whiteCoreThresholdMin, whiteCoreThresholdMax, intensity) * innerMask;\n\n // Pure white target\n vec3 pureWhite = vec3(1.0);\n\n // Blend the center towards pure white (not additive, but replacement blend)\n // This ensures the very center goes to white, not gray\n color = mix(color, pureWhite, whiteCoreMask * whiteCoreBlendStrength);\n\n // Additional soft bloom glow around the white core\n float bloomBase = smoothstep(bloomThresholdMin, bloomThresholdMax, intensity);\n float bloomAmount = bloomBase * innerMask;\n color += bloomColor * bloomAmount * bloomStrength;\n\n return color;\n}\n\n// ============================================\n// ANIMATED POLYGON SHAPE\n// ============================================\n// Struct to return shape data\nstruct ShapeData {\n float shape; // The shape value (0 = outside, 1 = center)\n float gradient; // Gradient from gray (edge) to white (center)\n};\n\n// Signed distance function for a regular polygon\n// p: point to test, r: radius, n: number of sides\nfloat sdPolygon(vec2 p, float r, float n) {\n // Angle and radius\n float an = 3.141593 / n;\n vec2 acs = vec2(cos(an), sin(an));\n\n // Reduce to first sector\n float bn = mod(atan(p.x, p.y), 2.0 * an) - an;\n p = length(p) * vec2(cos(bn), abs(sin(bn)));\n\n // Line sdf\n p -= r * acs;\n p.y += clamp(-p.y, 0.0, r * acs.y);\n\n return length(p) * sign(p.x);\n}\n\n// Fast signed distance function for an ellipse\n// Approximation that avoids expensive acos(), cube roots, and branching\n// Accurate enough for visual effects, ~5x faster than exact version\nfloat sdEllipse(vec2 p, vec2 ab) {\n // Normalize point by ellipse radii\n vec2 q = p / ab;\n float k1 = length(q);\n \n // Early out for points very close to center (avoid division issues)\n if (k1 < 0.0001) return -min(ab.x, ab.y);\n \n // Gradient-based distance approximation\n vec2 q2 = q / ab; // Second normalization for gradient\n float k2 = length(q2);\n \n return k1 * (k1 - 1.0) / k2;\n}\n\n// Helper: Calculate a single shape instance at a given animation phase\nShapeData calculateSingleShape(\n vec2 uv,\n float linearT, // Animation phase 0-1\n float solidCoreMask,\n vec2 resolution,\n // Shape parameters\n float shapeType,\n float shapeWidth,\n float shapeHeight,\n float centerY,\n float animRange,\n float edgeSoftness,\n float grayLevel,\n float shapeAngleStart,\n float shapeAngleEnd,\n float shapeSize\n) {\n // Map 0-1 to position range (left to right)\n float posOffset = (linearT * 2.0 - 1.0) * animRange;\n float centerX = 0.5 + posOffset;\n\n // Animate rotation\n float animatedAngle = mix(shapeAngleStart, shapeAngleEnd, linearT);\n\n // Correct for aspect ratio\n float aspect = resolution.x / resolution.y;\n\n // Calculate position relative to center\n vec2 shapeCenter = vec2(centerX, centerY);\n vec2 delta = uv - shapeCenter;\n\n // Rotate delta by animated angle FIRST\n float cosA = cos(animatedAngle);\n float sinA = sin(animatedAngle);\n vec2 rotatedDelta = vec2(\n delta.x * cosA - delta.y * sinA,\n delta.x * sinA + delta.y * cosA\n );\n\n // Apply aspect correction AFTER rotation\n rotatedDelta.x *= aspect;\n\n // Calculate distance based on shape type\n float dist;\n if (shapeType < 0.5) {\n dist = sdEllipse(rotatedDelta, vec2(shapeWidth, shapeHeight));\n } else {\n vec2 scaledDelta = rotatedDelta / vec2(shapeWidth, shapeHeight);\n dist = sdPolygon(scaledDelta, shapeSize / min(shapeWidth, shapeHeight), shapeType);\n dist *= min(shapeWidth, shapeHeight);\n }\n\n // Normalize distance for gradient\n float normalizedDist;\n if (shapeType < 0.5) {\n normalizedDist = dist / max(shapeWidth, shapeHeight) + 1.0;\n } else {\n normalizedDist = (dist / shapeSize) + 1.0;\n }\n normalizedDist = clamp(normalizedDist, 0.0, 1.0);\n\n // Create soft shape mask\n float shapeMask = 1.0 - smoothstep(-edgeSoftness * 0.1, edgeSoftness * 0.05, dist);\n\n // Create gradient\n float gradient = mix(1.0, grayLevel, smoothstep(0.0, 1.0, normalizedDist));\n\n // Apply solid core mask\n shapeMask *= solidCoreMask;\n\n ShapeData result;\n result.shape = shapeMask;\n result.gradient = gradient;\n return result;\n}\n\n// Creates two staggered animated shapes that move left-to-right\n// When one reaches the far edge, another appears from the left\nShapeData calculateAnimatedShape(\n vec2 uv,\n float time, // Current animation time in seconds\n float solidCoreMask,\n vec2 resolution\n) {\n // --- Configurable parameters ---\n const float shapeType = 3.0; // 0 = ellipse, 3 = triangle, 4 = square, 5 = pentagon, etc.\n const float shapeWidth = 0.1; // Width/horizontal scale (wide)\n const float shapeHeight = 0.8; // Height/vertical scale (short)\n const float centerY = 0.4; // Vertical center position\n float cycleDuration = uCenterAnimDuration; // Seconds per animation cycle (from uniform)\n const float animRange = 0.7; // How far left/right it travels\n const float edgeSoftness = 0.5; // Softness of shape edge\n const float grayLevel = 0.5; // Gray color at shape edge\n const float shapeAngleStart = 0.6; // Rotation angle at start (slight tilt)\n const float shapeAngleEnd = 0.1; // Rotation angle at end (opposite tilt)\n const float shapeSize = 0.4; // Overall size for polygon mode\n const float staggerOffset = 0.4; // Offset between the two shapes (0.5 = half cycle apart)\n const float shape2Scale = 1.3; // Scale multiplier for 2nd shape (1.0 = same size)\n // -------------------------------\n\n // Time-based animation: time / cycleDuration gives progress through cycle\n float linearT1 = fract(time / cycleDuration); // Shape 1: 0->1 repeating\n float linearT2 = fract(time / cycleDuration + staggerOffset); // Shape 2: offset by staggerOffset\n\n // Calculate both shapes (shape 2 is slightly larger)\n ShapeData shape1 = calculateSingleShape(\n uv, linearT1, solidCoreMask, resolution,\n shapeType, shapeWidth, shapeHeight, centerY, animRange,\n edgeSoftness, grayLevel, shapeAngleStart, shapeAngleEnd, shapeSize\n );\n\n ShapeData shape2 = calculateSingleShape(\n uv, linearT2, solidCoreMask, resolution,\n shapeType, shapeWidth * shape2Scale, shapeHeight * shape2Scale, centerY, animRange,\n edgeSoftness, grayLevel, shapeAngleStart, shapeAngleEnd, shapeSize * shape2Scale\n );\n\n // Combine both shapes (take max of masks, blend gradients)\n ShapeData result;\n result.shape = max(shape1.shape, shape2.shape);\n // Weighted average of gradients based on shape masks\n float totalMask = shape1.shape + shape2.shape;\n if (totalMask > 0.001) {\n result.gradient = (shape1.gradient * shape1.shape + shape2.gradient * shape2.shape) / totalMask;\n } else {\n result.gradient = 0.5;\n }\n\n return result;\n}\n\n// Apply shape effect to intensity (for colorama/displacement pipeline)\nfloat applyShapeToIntensity(\n float baseIntensity,\n ShapeData shapeData,\n float effectStrength\n) {\n // Blend the shape gradient into the base intensity\n // This makes the shape area brighter/differently colored through colorama\n float shapeContribution = shapeData.gradient * shapeData.shape;\n return mix(baseIntensity, shapeContribution, shapeData.shape * effectStrength);\n}\n\n\n// AE-style color processing (levels, gamma, contrast). Used in both ripple and normal mode.\nvec3 applyColorCorrection(vec3 color) {\n color = (color - uCCBlackPoint) / (uCCWhitePoint - uCCBlackPoint);\n color = pow(max(color, vec3(0.0)), vec3(1.0 / (uCCMidtoneGamma * uCCGamma)));\n color = color * (1.0 + uCCContrast) - uCCContrast * 0.5;\n return clamp(color, 0.0, 1.0);\n}\n\n// Feather at container edges (visible bounds). Used in both ripple and normal mode.\nvec3 applyEdgeFeathering(vec3 color) {\n // Apply edge feathering when zoomed in\n // Feathering is applied at the container edges (visible bounds), not canvas edges\n // uEdgeFeather = vec4(top, right, bottom, left) — clockwise like CSS\n if (any(greaterThan(uEdgeFeather, vec4(0.0)))) {\n vec2 screenUV = vUv;\n\n // Get visible UV bounds (where container clips the canvas)\n float visMinX = uVisibleUvBounds.x;\n float visMinY = uVisibleUvBounds.y;\n float visMaxX = uVisibleUvBounds.z;\n float visMaxY = uVisibleUvBounds.w;\n\n // Calculate visible dimensions in UV space for aspect-correct feathering on X axis\n float visibleWidth = visMaxX - visMinX;\n float visibleHeight = visMaxY - visMinY;\n float visibleAspect = visibleWidth / visibleHeight;\n\n // Per-side feather amounts (X sides get aspect correction for pixel-equal width)\n float featherTop = uEdgeFeather.x * 0.15 / visibleAspect;\n float featherRight = uEdgeFeather.y * 0.15 / visibleAspect;\n float featherBottom = uEdgeFeather.z * 0.15 / visibleAspect;\n float featherLeft = uEdgeFeather.w * 0.15 / visibleAspect;\n\n // Apply feathering at container edges (visible bounds)\n float left = smoothstep(visMinX, visMinX + featherLeft, screenUV.x);\n float right = smoothstep(visMaxX, visMaxX - featherRight, screenUV.x);\n float bottom = smoothstep(visMinY, visMinY + featherBottom, screenUV.y);\n float top = smoothstep(visMaxY, visMaxY - featherTop, screenUV.y);\n\n float edgeMask = left * right * bottom * top;\n color = mix(vec3(1.0), color, edgeMask);\n }\n return color;\n}\n\nvoid main() {\n // ============================================\n // LAYER 1: Base glass effect (fine slits, whole image)\n // ============================================\n float numSegments = uNumSegments;\n float angle = uSlitAngle;\n const float blurRadius = 9.0;\n const float sigma = 4.0;\n\n // Calculate aspect ratio for consistent slit angles\n float aspect = iResolution.x / iResolution.y;\n\n // Displacement parameters (in pixels, scaled by DPR)\n // Scale displacement by reference resolution ratio to maintain consistency across browser zoom levels\n float resolutionScale = iResolution.x / uRefResolution.x;\n vec2 maxDisplacement = vec2(uDisplacementX, uDisplacementY) * uDpr * resolutionScale;\n\n // Use pre-computed UV from vertex shader (zoom + pan already applied)\n vec2 uv = vContentUv;\n\n // Base displacement (fine slits)\n // Use raw screen UV (vUv) so slit positions stay fixed on screen regardless of pan/zoom\n float gradientStart = 1.0;\n float gradientEnd = 0.0;\n float gradientPower = 1.0;\n float centerPoint = 0.5;\n vec2 displacementData = createStripedDisplacement(\n vUv,\n numSegments,\n angle,\n gradientStart,\n gradientEnd,\n gradientPower,\n centerPoint,\n aspect\n );\n float signedDisplacement = displacementData.x;\n float localUVx = displacementData.y;\n\n // ============================================\n // LAYER 2: Inner glass effect (larger slits, center only, STATIC)\n // ============================================\n // Inner segments are a divisor of outer segments for perfect alignment\n // 45 / 5 = 9 segments (5x larger slits that align with outer grid)\n float innerNumSegments = numSegments;\n float innerAngle = angle; // Same angle as outer\n\n // Inner slits are STATIC - use raw screen UV so slits stay fixed on screen\n vec2 innerDisplacementData = createStripedDisplacement(\n vUv,\n innerNumSegments,\n innerAngle,\n gradientStart,\n gradientEnd,\n gradientPower,\n centerPoint,\n aspect\n );\n float innerSignedDisplacement = innerDisplacementData.x;\n float innerLocalUVx = innerDisplacementData.y;\n\n // ============================================\n // COMPUTE SOLID CORE MASK EARLY (needed for light & displacement masking)\n // ============================================\n vec4 videoFrameSample = texture2D(uVideoTexture, uv);\n float maskIntensity = luminance(videoFrameSample.rgb);\n float solidCoreMask = smoothstep(0.4, 0.7, maskIntensity);\n\n // Store original displacement for shape refraction (before masking)\n float originalInnerDisplacement = innerSignedDisplacement;\n\n // Mask inner displacement by solidCoreMask - no inner displacement in center\n innerSignedDisplacement *= (1.0 - solidCoreMask);\n\n // Inner layer displacement uses same values (scaled by resolutionScale for zoom independence)\n vec2 innerMaxDisplacement = vec2(30.0, 0.0) * uDpr * resolutionScale;\n\n // ============================================\n // CENTER ELEMENT (Static Ellipse + Animated Shapes)\n // ============================================\n float staticEllipseMask = 0.0;\n float staticEllipseGradient = 0.0;\n ShapeData shapeData;\n shapeData.shape = 0.0;\n shapeData.gradient = 0.0;\n\n float centerFadeInDuration = 10.0;\n float centerFramesSinceStart = uFrameCount - uLightStartFrame;\n float centerEffectActivation = clamp(centerFramesSinceStart / centerFadeInDuration, 0.0, 1.0);\n\n if (uEnableCenterElement > 0.5) {\n // Calculate static ellipse mask\n {\n const float ellipseCenterX = 0.3;\n const float ellipseCenterY = -0.15;\n const float ellipseWidth = 0.5;\n const float ellipseHeight = 0.8;\n const float ellipseAngle = 0.3;\n const float ellipseSoftness = 1.0;\n const float ellipseGrayLevel = 0.5;\n\n float aspect = iResolution.x / iResolution.y;\n\n // Use RAW UV (no displacement) for the mask calculation\n vec2 delta = uv - vec2(ellipseCenterX, ellipseCenterY);\n\n // Rotate\n float cosA = cos(ellipseAngle);\n float sinA = sin(ellipseAngle);\n vec2 rotatedDelta = vec2(\n delta.x * cosA - delta.y * sinA,\n delta.x * sinA + delta.y * cosA\n );\n rotatedDelta.x *= aspect;\n\n // Calculate ellipse distance\n float ellipseDist = sdEllipse(rotatedDelta, vec2(ellipseWidth, ellipseHeight));\n\n // Soft shape mask\n staticEllipseMask = 1.0 - smoothstep(-ellipseSoftness * 0.1, ellipseSoftness * 0.05, ellipseDist);\n\n // Gradient\n float normalizedDist = ellipseDist / max(ellipseWidth, ellipseHeight) + 1.0;\n normalizedDist = clamp(normalizedDist, 0.0, 1.0);\n staticEllipseGradient = mix(1.0, ellipseGrayLevel, smoothstep(0.0, 1.0, normalizedDist));\n\n // Apply solid core mask\n staticEllipseMask *= solidCoreMask;\n }\n\n // Block displacement inside the static ellipse\n originalInnerDisplacement *= (1.0 - staticEllipseMask);\n innerSignedDisplacement *= (1.0 - staticEllipseMask);\n signedDisplacement *= (1.0 - staticEllipseMask);\n\n\n\n // Calculate displaced UV for shape - use inner displacement for the shape refraction\n vec2 shapeDisplacedUV = applyDisplacement(uv, originalInnerDisplacement, innerMaxDisplacement, iResolution);\n\n // Calculate animated shape using DISPLACED UVs so glass slits refract through it\n shapeData = calculateAnimatedShape(\n shapeDisplacedUV, // Use displaced UVs!\n uCenterAnimTime, // Time-based animation in seconds (resets with video loop)\n solidCoreMask,\n iResolution\n );\n\n // Combine static ellipse with animated shapes\n {\n float combinedShape = max(shapeData.shape, staticEllipseMask) * centerEffectActivation;\n float totalMask = shapeData.shape + staticEllipseMask;\n float combinedGradient = shapeData.gradient;\n if (totalMask > 0.001) {\n combinedGradient = (shapeData.gradient * shapeData.shape + staticEllipseGradient * staticEllipseMask) / totalMask;\n }\n shapeData.shape = combinedShape;\n shapeData.gradient = combinedGradient;\n }\n }\n\n // ============================================\n // INNER EFFECT ACTIVATION - starts after uLightStartFrame\n // ============================================\n float innerFadeInDuration = 10.0; // Slower fade-in for inner effect\n float innerFramesSinceStart = uFrameCount - uLightStartFrame;\n float innerEffectActivation = clamp(innerFramesSinceStart / innerFadeInDuration, 0.0, 1.0);\n\n // Create edge mask (solidCoreMask already computed earlier for light masking)\n float edgeMask = smoothstep(0.3, 0.6, maskIntensity); // Where shape starts\n\n // Blend outer and inner slits on the edges\n // Inner contribution is multiplied by activation (fades in after frame 200)\n float outerContribution = 1.0 - edgeMask * 0.5 * innerEffectActivation;\n float innerContribution = edgeMask * innerEffectActivation;\n\n // Combined displacement: inner effect fades in over time\n float combinedDisplacement = signedDisplacement * outerContribution +\n innerSignedDisplacement * innerContribution;\n\n // Blend max displacement smoothly\n vec2 combinedMaxDisplacement = maxDisplacement * outerContribution +\n innerMaxDisplacement * innerContribution;\n\n // For the CENTER area (solidCoreMask): use 100% inner (larger) slits displacement\n // For the EDGES: use the combined displacement (blended outer + inner)\n // This ensures the logo center always has the larger slits\n combinedDisplacement = mix(combinedDisplacement, originalInnerDisplacement, solidCoreMask);\n combinedMaxDisplacement = mix(combinedMaxDisplacement, innerMaxDisplacement, solidCoreMask);\n\n // ============================================\n // LAYER 1: DISPLACEMENT (toggleable)\n // ============================================\n vec4 textureSample;\n if (uEnableDisplacement > 0.5) {\n textureSample = sampleWithDisplacement(\n uVideoTexture, uv,\n combinedDisplacement, combinedMaxDisplacement,\n iResolution\n );\n } else {\n // No displacement - sample directly\n textureSample = texture2D(uVideoTexture, uv);\n }\n\n // Blend localUVx for highlights - also fades in with activation\n float combinedLocalUVx = localUVx * outerContribution + innerLocalUVx * innerContribution;\n localUVx = combinedLocalUVx;\n\n // Store innerMask for later use (bloom, etc.) - also tied to activation\n float innerMask = edgeMask * innerEffectActivation;\n\n // Get Phase From: Intensity (Rec. 709 luminance)\n float baseIntensity = luminance(textureSample.rgb);\n\n // Boost intensity in center areas to push them more towards white\n float centerWhiteBoost = 0.1;\n baseIntensity = baseIntensity + innerMask * centerWhiteBoost;\n baseIntensity = clamp(baseIntensity, 0.0, 1.0);\n\n // Keep base intensity for outer colorama (using uGradientMap)\n float outerIntensity = baseIntensity;\n\n // ============================================\n // CENTER GREEN STRIPES OVERLAY (before colorama)\n // ============================================\n float stripeFadeOutDuration = 10.0;\n float stripeFramesSinceStart = uFrameCount - uLightStartFrame;\n // Effect is active UNTIL uLightStartFrame, then fades out\n float stripeEffectActivation = 1.0 - clamp(stripeFramesSinceStart / stripeFadeOutDuration, 0.0, 1.0);\n\n // Animated vertical height mask - grows from 0 to full height\n // Height animation: starts at center (0.5) and expands outward\n float stripeHeightDelay = 15.0; // frames to wait before starting\n float stripeHeightGrowDuration = 80.0; // frames to reach full height\n float stripeHeightProgress = clamp((uFrameCount - stripeHeightDelay) / stripeHeightGrowDuration, 0.0, 1.0);\n // Ease the progress for smoother animation\n float easedHeightProgress = 1.0 - pow(1.0 - stripeHeightProgress, 2.0);\n \n // Calculate animated bounds - expand from center (0.5) outward\n float heightHalfSpan = 0.2 * easedHeightProgress; // 0.06 = half of the 0.12 total height (0.44 to 0.56)\n float softEdge = 0.1 * easedHeightProgress; // Soft edge also scales with progress\n float bottomEdge = 0.5 - heightHalfSpan - softEdge;\n float bottomFull = 0.5 - heightHalfSpan;\n float topFull = 0.5 + heightHalfSpan;\n float topEdge = 0.5 + heightHalfSpan + softEdge;\n \n // When progress is 0, force mask to 0 to avoid glitchy edge at y=0.5\n float stripeHeightMask = easedHeightProgress > 0.001 \n ? smoothstep(bottomEdge, bottomFull, uv.y) * smoothstep(topEdge, topFull, uv.y)\n : 0.0;\n\n vec4 centerGreenSlantedLines = createStripes(\n vUv + vec2(-0.0035, 0.0), // slight offset to avoid moiré\n numSegments,\n uSlitAngle,\n 0.15, // stopPosition (20%)\n vec4(20.0/255.0, 200.0/255.0, 20.0/255.0, 0.2), // colorStart (green at 0%)\n vec4(0.0, 0.0, 0.0, 0.0), // colorMid (white at 20%)\n aspect // aspect ratio for consistent angle\n ) * solidCoreMask * stripeHeightMask;\n\n // Overlay green stripes on center element area\n float stripeOverlayMask = solidCoreMask * stripeEffectActivation;\n // Modify baseIntensity/outerIntensity with stripes before colorama\n vec4 stripedTexture = vec4(textureSample.rgb, 1.0) - centerGreenSlantedLines*0.7 * stripeOverlayMask;\n stripedTexture = clamp(stripedTexture, 0.0, 1.0);\n\n // Update intensity for colorama input\n float stripedIntensity = luminance(stripedTexture.rgb);\n outerIntensity = mix(baseIntensity, stripedIntensity, stripeOverlayMask);\n\n // ============================================\n // LAYER 2: COLORAMA (toggleable)\n // ============================================\n vec3 color;\n if (uEnableColorama > 0.5) {\n // OUTER colorama: uses base intensity, cross-fades between uGradientMap and uGradientMap2\n vec3 outerColoramaResult1 = applyColoramaWithGradient(\n uGradientMap, outerIntensity,\n uInputMin, uInputMax, uModifyGamma, uPosterizeLevels,\n uCycleRepetitions, uPhaseShift, uCycleSpeed,\n uWrapMode, uReverse\n );\n vec3 outerColoramaResult2 = applyColoramaWithGradient(\n uGradientMap2, outerIntensity,\n uInputMin, uInputMax, uModifyGamma, uPosterizeLevels,\n uCycleRepetitions, uPhaseShift, uCycleSpeed,\n uWrapMode, uReverse\n );\n vec3 outerColoramaResult = mix(outerColoramaResult1, outerColoramaResult2, uGradientMapBlend);\n\n // Start with outer colorama as base\n vec3 blendedColorama = outerColoramaResult;\n\n // CENTER colorama: only compute when inside shape (skip texture sample otherwise)\n // This saves a texture lookup + specular pow() for ~90% of pixels\n if (shapeData.shape > 0.001) {\n vec3 centerColoramaResult = applyColoramaWithGradient(\n uCenterGradientMap, shapeData.gradient,\n uInputMin, uInputMax, uModifyGamma, uPosterizeLevels,\n uCycleRepetitions, uPhaseShift, uCycleSpeed,\n uWrapMode, uReverse\n );\n\n // Add specular highlight to center (shiny reflection effect)\n float specularPower = 8.0; // Higher = tighter/smaller highlight\n float specularIntensity = 1.9; // Brightness of the specular\n float specular = pow(shapeData.gradient, specularPower) * specularIntensity;\n centerColoramaResult += vec3(specular); // Add bright highlight\n\n // Blend between outer and center colorama based on shape\n blendedColorama = mix(outerColoramaResult, centerColoramaResult, shapeData.shape);\n }\n\n color = mix(blendedColorama, textureSample.rgb, uBlendWithOriginal);\n } else {\n color = textureSample.rgb;\n }\n\n // Store intensity for bloom (use the blended value)\n float intensity = mix(outerIntensity, shapeData.gradient, shapeData.shape);\n\n // ============================================\n // LAYER 3: BLOOM (toggleable)\n // ============================================\n if (uEnableBloom > 0.5) {\n color = applyBloom(color, intensity, innerMask);\n }\n\n // ============================================\n // LAYER 4: SHAPE HIGHLIGHT (toggleable via light sweep toggle)\n // ============================================\n if (uEnableLightSweep > 0.5) {\n float lightFadeInDuration = 30.0;\n float framesSinceStart = uFrameCount - uLightStartFrame;\n float lightActivation = clamp(framesSinceStart / lightFadeInDuration, 0.0, 1.0);\n\n // Add subtle brightness boost at shape center\n float shapeHighlight = pow(shapeData.gradient, 2.0) * shapeData.shape;\n color += vec3(1.0) * shapeHighlight * 0.15 * uLightIntensity * lightActivation;\n }\n\n // Color correction and edge feathering (shared with ripple mode)\n color = applyColorCorrection(color);\n color = applyEdgeFeathering(color);\n\n // Blend with background color if provided (uBackgroundColor.r < 0 means not set)\n if (uBackgroundColor.r >= 0.0) {\n // Calculate luminance to determine how bright the pixel is\n float brightness = luminance(color);\n \n // Blend white/bright areas with background color\n // Bright areas (close to white) become the background color\n float blendStart = 0.98; // Start blending at this brightness\n float blendEnd = 1.0; // Fully background color at this brightness\n float blendAmount = smoothstep(blendStart, blendEnd, brightness);\n \n // Mix the shader color with background color\n color = mix(color, uBackgroundColor, blendAmount);\n }\n\n gl_FragColor = vec4(color, 1.0);\n}\n`;\n\nexport { rzpGlassFragmentShader, rzpGlassVertexShader };\n"],"names":["rzpGlassVertexShader","rzpGlassFragmentShader"],"mappings":"AAAM,IAAAA,oBAAoB,CAAc,CAAA;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAEM,IAAAC,sBAAsB,CAAc,CAAA;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}
1
+ {"version":3,"file":"rzpGlassShader.js","sources":["../../../../../../src/components/Spark/RzpGlass/rzpGlassShader.ts"],"sourcesContent":["const rzpGlassVertexShader = /* glsl */ `\nprecision mediump float;\n\nattribute vec2 position;\nattribute vec2 uv;\n\n// Zoom & Pan uniforms (computed in vertex shader for efficiency)\nuniform float uZoom;\nuniform vec2 uPan; // vec2(uPanX, uPanY)\n\n// Output varyings\nvarying vec2 vUv; // Raw screen UV (for screen-space effects like feathering)\nvarying vec2 vContentUv; // Transformed UV for video/content sampling (zoom + pan applied)\n\nvoid main() {\n // Raw screen UV for screen-space effects\n vUv = uv;\n \n // Compute zoomed/panned UV for content sampling\n // Zoom: scale around center (0.5, 0.5)\n // Pan: offset the view\n vContentUv = (uv - 0.5) / uZoom + 0.5;\n vContentUv += uPan;\n \n gl_Position = vec4(position, 0, 1);\n}\n`;\n\nconst rzpGlassFragmentShader = /* glsl */ `\nprecision mediump float;\n\nuniform float uTime;\nuniform vec2 iResolution;\nuniform float uDpr;\nuniform sampler2D uVideoTexture;\nuniform sampler2D uGradientMap;\nuniform sampler2D uGradientMap2; // Second gradient map for cross-fade blending\nuniform sampler2D uCenterGradientMap; // Separate gradient map for center ellipse\n\n// Layer toggles (enable/disable actual effects)\nuniform float uEnableDisplacement;\nuniform float uEnableColorama;\nuniform float uEnableBloom;\nuniform float uEnableLightSweep;\n\n// ============================================\n// COLORAMA UNIFORMS (Adobe AE v5 Pipeline)\n// Pipeline: Scalar → Remap → Warp → Wrap → Lookup → Blend\n// ============================================\n\n// --- 1. INPUT PHASE (Scalar Index Generation) ---\nuniform float uInputMin; // Input range min (default 0.0)\nuniform float uInputMax; // Input range max (default 1.0)\n\n// --- 2. MODIFY PHASE (Index Space Warping) ---\nuniform float uModifyGamma; // Gamma curve: <1 = brights, >1 = darks (default 1.0)\nuniform float uPosterizeLevels; // 0 = off, >0 = number of discrete steps\nuniform float uCycleRepetitions; // Stretch/compress the index (default 1.0)\nuniform float uPhaseShift; // Static offset (default 0.0)\nuniform float uCycleSpeed; // Cycling animation speed (default 0.0)\n\n// --- 3. OUTPUT CYCLE (Wrap & Lookup) ---\nuniform float uWrapMode; // 0 = clamp, 1 = wrap/fract (default 1.0)\nuniform float uReverse; // 0 = normal, 1 = reverse gradient (default 0.0)\n\n// --- 4. COMPOSITE ---\nuniform float uBlendWithOriginal; // 0 = full effect, 1 = original (default 0.0)\nuniform float uGradientMapBlend; // 0 = uGradientMap, 1 = uGradientMap2 (default 0.0)\n\n// --- 5. LIGHT EFFECT ---\nuniform float uLightIntensity; // Strength of light sweep effect\nuniform float uFrameCount; // Current frame number\nuniform float uLightStartFrame; // Frame when light effect starts\n\n// --- 6. DISPLACEMENT ---\nuniform float uNumSegments; // Number of glass slits (default 45.0)\nuniform float uSlitAngle; // Angle of slits in radians (default 0.13)\nuniform float uDisplacementX; // X displacement amount (default -12.0)\nuniform float uDisplacementY; // Y displacement amount (default -20.0)\n\n// --- 7. CENTER ELEMENT ---\nuniform float uEnableCenterElement; // Toggle center element (0 = off, 1 = on)\nuniform float uCenterAnimDuration; // Duration of one animation cycle in seconds\nuniform float uCenterAnimTime; // Current animation time in seconds (resets with video loop)\n\n// --- 8. COLOR CORRECTION ---\nuniform float uCCBlackPoint; // Levels black point (default 0.0)\nuniform float uCCWhitePoint; // Levels white point (default 1.0)\nuniform float uCCMidtoneGamma; // Midtone gamma (default 1.2)\nuniform float uCCGamma; // Output gamma (default 1.2)\nuniform float uCCContrast; // Contrast boost (default 0.0)\n\n// --- 9. ZOOM & PAN ---\nuniform float uZoom; // Zoom level (1.0 = normal, 2.0 = 2x zoom) - still needed for edge feather check\nuniform vec4 uEdgeFeather; // Per-side feathering: vec4(top, right, bottom, left) clockwise, 0 = none, 1 = max\nuniform vec2 uRefResolution; // Reference resolution for zoom-independent displacement\nuniform vec4 uVisibleUvBounds; // vec4(minX, minY, maxX, maxY) - visible portion of canvas in container\n\n// --- 10. BACKGROUND COLOR ---\nuniform vec3 uBackgroundColor; // Background color to blend with (RGB 0-1)\n\n// UV coordinates from the vertex shader\nvarying vec2 vUv; // Raw screen UV (for screen-space effects)\nvarying vec2 vContentUv; // Transformed UV with zoom/pan applied (for content sampling)\n\n// ============================================\n// UTILITY FUNCTIONS\n// ============================================\n// Rec. 709 luminance calculation\nfloat luminance(vec3 color) {\n return dot(color, vec3(0.2126, 0.7152, 0.0722));\n}\n\n// ============================================\n// COLORAMA EFFECT (Adobe After Effects v5 Pipeline)\n// ============================================\n//\n// Pipeline:\n// Image → Scalar Field (0-1) → Warp/Animate → Gradient Lookup → Composite\n//\n// This matches AE's indexed gradient remapping with time-domain cycling.\nvec3 applyColoramaWithGradient(\n sampler2D gradientMap, // Gradient map texture to sample from\n float rawIntensity, // Raw luminance from pixel\n float inputMin, // Input range min\n float inputMax, // Input range max\n float gamma, // Gamma curve (pow)\n float posterizeLevels, // 0 = off, else discrete steps\n float cycleReps, // Cycle repetitions (stretch)\n float phaseShift, // Static offset\n float cycleSpeed, // Time-based cycling\n float wrapMode, // 0 = clamp, 1 = wrap\n float reverse // 0 = normal, 1 = flip\n) {\n // ─────────────────────────────────────────────\n // STEP 1: INPUT PHASE - Scalar Index Generation\n // ─────────────────────────────────────────────\n // Normalize intensity to input range\n float t = clamp((rawIntensity - inputMin) / (inputMax - inputMin), 0.0, 1.0);\n\n // ─────────────────────────────────────────────\n // STEP 2: MODIFY PHASE - Index Space Warping\n // ─────────────────────────────────────────────\n\n // a) Gamma / Curves - reshape the intensity distribution\n t = pow(t, gamma);\n\n // b) Posterize - quantize to discrete levels (branchless)\n // When posterizeLevels <= 0, keeps t unchanged\n float posterized = floor(t * posterizeLevels + 0.0001) / max(posterizeLevels, 0.0001);\n t = mix(t, posterized, step(0.001, posterizeLevels));\n\n // c) Cycle Repetitions - stretch/compress across gradient\n t = t * cycleReps;\n\n // d) Phase Shift - static offset\n t = t + phaseShift;\n\n // e) Cycling Animation - time-based offset\n t = t + cycleSpeed * uTime;\n\n // ─────────────────────────────────────────────\n // STEP 3: OUTPUT CYCLE - Wrap & Lookup (branchless)\n // ─────────────────────────────────────────────\n\n // Wrap (fract) vs Clamp - branchless selection\n t = mix(clamp(t, 0.0, 1.0), fract(t), step(0.5, wrapMode));\n\n // Reverse direction - branchless\n t = mix(t, 1.0 - t, step(0.5, reverse));\n\n // Gradient lookup (1D texture sample)\n return texture2D(gradientMap, vec2(t, 0.5)).rgb;\n}\n\n// ============================================\n// DISPLACEMENT FUNCTIONS\n// ============================================\n// Create striped displacement map for glass refraction effect\n// Returns: x = signed displacement (-1 to 1), y = local UV x position within segment\n// gradientStart: gradient value at left edge (typically 1.0 for white)\n// gradientEnd: gradient value at right edge (typically 0.0 for black)\n// gradientPower: power curve for falloff (1.0 = linear, <1.0 = steeper, >1.0 = gentler)\n// centerPoint: center value for signed conversion (typically 0.5)\n// aspect: screen aspect ratio (width/height) for consistent slit angle\nvec2 createStripedDisplacement(\n vec2 uv,\n float numSegments,\n float angle,\n float gradientStart,\n float gradientEnd,\n float gradientPower,\n float centerPoint,\n float aspect\n) {\n // Work in aspect-corrected UV space where x and y have equal visual scale\n // This ensures consistent slit angle regardless of viewport dimensions\n vec2 aspectUV = uv * vec2(aspect, 1.0);\n \n // Apply slant in aspect-corrected space\n float slantedX = aspectUV.x - aspectUV.y * tan(angle);\n\n // Calculate segment properties (account for aspect-scaled x range)\n float segmentWidth = aspect / numSegments;\n float localUVx = fract(slantedX / segmentWidth); // 0-1 within each segment\n\n // Create the displacement map gradient\n // Use smoothstep for smoother interpolation\n float smoothUVx = smoothstep(0.0, 1.0, localUVx);\n // Interpolate from gradientEnd (left) to gradientStart (right)\n float rawGradient = mix(gradientEnd, gradientStart, smoothUVx);\n\n // Apply power curve for falloff control\n rawGradient = pow(rawGradient, gradientPower);\n\n // Convert to signed displacement (-1 to 1) using centerPoint\n // centerPoint is the neutral value (typically 0.5)\n float signedDisplacement = (rawGradient - centerPoint) / centerPoint;\n\n return vec2(signedDisplacement, localUVx);\n}\n\n// Apply displacement offset to UV coordinates\nvec2 applyDisplacement(vec2 uv, float signedDisplacement, vec2 maxDisplacement, vec2 resolution) {\n vec2 displaceOffset = vec2(\n signedDisplacement * maxDisplacement.x / resolution.x,\n signedDisplacement * maxDisplacement.y / resolution.y\n );\n return uv + displaceOffset;\n}\n\n// Create thin slanted stripes with multi-stop gradient color\n// Returns RGB color: gradient stripes with 3 color stops\n// Stop 1 (0%): colorStart, Stop 2 (stopPosition): colorMid, Stop 3 (100%): transparent\nvec4 createStripes(\n vec2 uv,\n float numSegments,\n float angle,\n float stopPosition, // Position of middle stop (0.0 to 1.0)\n vec4 colorStart, // Color at 0% (left edge)\n vec4 colorMid, // Color at stopPosition\n float aspect // Screen aspect ratio for consistent angle\n) {\n // Work in aspect-corrected UV space where x and y have equal visual scale\n vec2 aspectUV = uv * vec2(aspect, 1.0);\n \n // Apply slant in aspect-corrected space\n float slantedX = aspectUV.x - aspectUV.y * tan(angle);\n\n // Calculate segment properties (account for aspect-scaled x range)\n float segmentWidth = aspect / numSegments;\n float localUVx = 1.0 - fract(slantedX / segmentWidth); // 0-1 within each segment, reversed\n\n // Multi-stop gradient:\n // 0% -> colorStart (green)\n // stopPosition -> colorMid (white)\n // 100% -> transparent (black with 0 opacity)\n\n vec4 gradientColor;\n float opacity;\n\n if (localUVx < stopPosition) {\n float t = localUVx / stopPosition;\n gradientColor = mix(colorMid, colorStart, t);\n opacity = 0.5;\n } else {\n float t = (localUVx - stopPosition) / (1.0 - stopPosition);\n gradientColor = mix(vec4(0.0), colorMid, t);\n opacity = 0.5 - t * 0.5;\n }\n\n return gradientColor * opacity;\n}\n\n// Sample texture with displacement applied\nvec4 sampleWithDisplacement(\n sampler2D tex,\n vec2 uv,\n float signedDisplacement,\n vec2 maxDisplacement,\n vec2 resolution\n) {\n vec2 displacedUV = applyDisplacement(uv, signedDisplacement, maxDisplacement, resolution);\n return texture2D(tex, displacedUV);\n}\n\n// ============================================\n// POST-PROCESSING EFFECTS\n// ============================================\nvec3 applyBloom(vec3 color, float intensity, float innerMask) {\n const float whiteCoreThresholdMin = 0.5; // Start of white core mask\n const float whiteCoreThresholdMax = 0.85; // End of white core mask\n const float whiteCoreBlendStrength = 0.85; // How much to blend towards pure white\n\n const float bloomThresholdMin = 0.3; // Start of bloom glow\n const float bloomThresholdMax = 0.7; // End of bloom glow\n const vec3 bloomColor = vec3(1.0, 0.99, 0.97); // Warm white bloom tint\n const float bloomStrength = 0.10; // Intensity of bloom glow\n // -------------------------------\n\n // Calculate how much we're in the \"center\" bright area\n // Use a tighter threshold for the white core\n float whiteCoreMask = smoothstep(whiteCoreThresholdMin, whiteCoreThresholdMax, intensity) * innerMask;\n\n // Pure white target\n vec3 pureWhite = vec3(1.0);\n\n // Blend the center towards pure white (not additive, but replacement blend)\n // This ensures the very center goes to white, not gray\n color = mix(color, pureWhite, whiteCoreMask * whiteCoreBlendStrength);\n\n // Additional soft bloom glow around the white core\n float bloomBase = smoothstep(bloomThresholdMin, bloomThresholdMax, intensity);\n float bloomAmount = bloomBase * innerMask;\n color += bloomColor * bloomAmount * bloomStrength;\n\n return color;\n}\n\n// ============================================\n// ANIMATED POLYGON SHAPE\n// ============================================\n// Struct to return shape data\nstruct ShapeData {\n float shape; // The shape value (0 = outside, 1 = center)\n float gradient; // Gradient from gray (edge) to white (center)\n};\n\n// Signed distance function for a regular polygon\n// p: point to test, r: radius, n: number of sides\nfloat sdPolygon(vec2 p, float r, float n) {\n // Angle and radius\n float an = 3.141593 / n;\n vec2 acs = vec2(cos(an), sin(an));\n\n // Reduce to first sector\n float bn = mod(atan(p.x, p.y), 2.0 * an) - an;\n p = length(p) * vec2(cos(bn), abs(sin(bn)));\n\n // Line sdf\n p -= r * acs;\n p.y += clamp(-p.y, 0.0, r * acs.y);\n\n return length(p) * sign(p.x);\n}\n\n// Fast signed distance function for an ellipse\n// Approximation that avoids expensive acos(), cube roots, and branching\n// Accurate enough for visual effects, ~5x faster than exact version\nfloat sdEllipse(vec2 p, vec2 ab) {\n // Normalize point by ellipse radii\n vec2 q = p / ab;\n float k1 = length(q);\n \n // Early out for points very close to center (avoid division issues)\n if (k1 < 0.0001) return -min(ab.x, ab.y);\n \n // Gradient-based distance approximation\n vec2 q2 = q / ab; // Second normalization for gradient\n float k2 = length(q2);\n \n return k1 * (k1 - 1.0) / k2;\n}\n\n// Helper: Calculate a single shape instance at a given animation phase\nShapeData calculateSingleShape(\n vec2 uv,\n float linearT, // Animation phase 0-1\n float solidCoreMask,\n vec2 resolution,\n // Shape parameters\n float shapeType,\n float shapeWidth,\n float shapeHeight,\n float centerY,\n float animRange,\n float edgeSoftness,\n float grayLevel,\n float shapeAngleStart,\n float shapeAngleEnd,\n float shapeSize\n) {\n // Map 0-1 to position range (left to right)\n float posOffset = (linearT * 2.0 - 1.0) * animRange;\n float centerX = 0.5 + posOffset;\n\n // Animate rotation\n float animatedAngle = mix(shapeAngleStart, shapeAngleEnd, linearT);\n\n // Correct for aspect ratio\n float aspect = resolution.x / resolution.y;\n\n // Calculate position relative to center\n vec2 shapeCenter = vec2(centerX, centerY);\n vec2 delta = uv - shapeCenter;\n\n // Rotate delta by animated angle FIRST\n float cosA = cos(animatedAngle);\n float sinA = sin(animatedAngle);\n vec2 rotatedDelta = vec2(\n delta.x * cosA - delta.y * sinA,\n delta.x * sinA + delta.y * cosA\n );\n\n // Apply aspect correction AFTER rotation\n rotatedDelta.x *= aspect;\n\n // Calculate distance based on shape type\n float dist;\n if (shapeType < 0.5) {\n dist = sdEllipse(rotatedDelta, vec2(shapeWidth, shapeHeight));\n } else {\n vec2 scaledDelta = rotatedDelta / vec2(shapeWidth, shapeHeight);\n dist = sdPolygon(scaledDelta, shapeSize / min(shapeWidth, shapeHeight), shapeType);\n dist *= min(shapeWidth, shapeHeight);\n }\n\n // Normalize distance for gradient\n float normalizedDist;\n if (shapeType < 0.5) {\n normalizedDist = dist / max(shapeWidth, shapeHeight) + 1.0;\n } else {\n normalizedDist = (dist / shapeSize) + 1.0;\n }\n normalizedDist = clamp(normalizedDist, 0.0, 1.0);\n\n // Create soft shape mask\n float shapeMask = 1.0 - smoothstep(-edgeSoftness * 0.1, edgeSoftness * 0.05, dist);\n\n // Create gradient\n float gradient = mix(1.0, grayLevel, smoothstep(0.0, 1.0, normalizedDist));\n\n // Apply solid core mask\n shapeMask *= solidCoreMask;\n\n ShapeData result;\n result.shape = shapeMask;\n result.gradient = gradient;\n return result;\n}\n\n// Creates two staggered animated shapes that move left-to-right\n// When one reaches the far edge, another appears from the left\nShapeData calculateAnimatedShape(\n vec2 uv,\n float time, // Current animation time in seconds\n float solidCoreMask,\n vec2 resolution\n) {\n // --- Configurable parameters ---\n const float shapeType = 3.0; // 0 = ellipse, 3 = triangle, 4 = square, 5 = pentagon, etc.\n const float shapeWidth = 0.1; // Width/horizontal scale (wide)\n const float shapeHeight = 0.8; // Height/vertical scale (short)\n const float centerY = 0.4; // Vertical center position\n float cycleDuration = uCenterAnimDuration; // Seconds per animation cycle (from uniform)\n const float animRange = 0.7; // How far left/right it travels\n const float edgeSoftness = 0.5; // Softness of shape edge\n const float grayLevel = 0.5; // Gray color at shape edge\n const float shapeAngleStart = 0.6; // Rotation angle at start (slight tilt)\n const float shapeAngleEnd = 0.1; // Rotation angle at end (opposite tilt)\n const float shapeSize = 0.4; // Overall size for polygon mode\n const float staggerOffset = 0.4; // Offset between the two shapes (0.5 = half cycle apart)\n const float shape2Scale = 1.3; // Scale multiplier for 2nd shape (1.0 = same size)\n // -------------------------------\n\n // Time-based animation: time / cycleDuration gives progress through cycle\n float linearT1 = fract(time / cycleDuration); // Shape 1: 0->1 repeating\n float linearT2 = fract(time / cycleDuration + staggerOffset); // Shape 2: offset by staggerOffset\n\n // Calculate both shapes (shape 2 is slightly larger)\n ShapeData shape1 = calculateSingleShape(\n uv, linearT1, solidCoreMask, resolution,\n shapeType, shapeWidth, shapeHeight, centerY, animRange,\n edgeSoftness, grayLevel, shapeAngleStart, shapeAngleEnd, shapeSize\n );\n\n ShapeData shape2 = calculateSingleShape(\n uv, linearT2, solidCoreMask, resolution,\n shapeType, shapeWidth * shape2Scale, shapeHeight * shape2Scale, centerY, animRange,\n edgeSoftness, grayLevel, shapeAngleStart, shapeAngleEnd, shapeSize * shape2Scale\n );\n\n // Combine both shapes (take max of masks, blend gradients)\n ShapeData result;\n result.shape = max(shape1.shape, shape2.shape);\n // Weighted average of gradients based on shape masks\n float totalMask = shape1.shape + shape2.shape;\n if (totalMask > 0.001) {\n result.gradient = (shape1.gradient * shape1.shape + shape2.gradient * shape2.shape) / totalMask;\n } else {\n result.gradient = 0.5;\n }\n\n return result;\n}\n\n// Apply shape effect to intensity (for colorama/displacement pipeline)\nfloat applyShapeToIntensity(\n float baseIntensity,\n ShapeData shapeData,\n float effectStrength\n) {\n // Blend the shape gradient into the base intensity\n // This makes the shape area brighter/differently colored through colorama\n float shapeContribution = shapeData.gradient * shapeData.shape;\n return mix(baseIntensity, shapeContribution, shapeData.shape * effectStrength);\n}\n\n\n// AE-style color processing (levels, gamma, contrast). Used in both ripple and normal mode.\nvec3 applyColorCorrection(vec3 color) {\n color = (color - uCCBlackPoint) / (uCCWhitePoint - uCCBlackPoint);\n color = pow(max(color, vec3(0.0)), vec3(1.0 / (uCCMidtoneGamma * uCCGamma)));\n color = color * (1.0 + uCCContrast) - uCCContrast * 0.5;\n return clamp(color, 0.0, 1.0);\n}\n\n// Feather at container edges (visible bounds). Used in both ripple and normal mode.\nvec3 applyEdgeFeathering(vec3 color, vec3 bgColor) {\n // Apply edge feathering when zoomed in\n // Feathering is applied at the container edges (visible bounds), not canvas edges\n // uEdgeFeather = vec4(top, right, bottom, left) — clockwise like CSS\n if (any(greaterThan(uEdgeFeather, vec4(0.0)))) {\n vec2 screenUV = vUv;\n\n // Get visible UV bounds (where container clips the canvas)\n float visMinX = uVisibleUvBounds.x;\n float visMinY = uVisibleUvBounds.y;\n float visMaxX = uVisibleUvBounds.z;\n float visMaxY = uVisibleUvBounds.w;\n\n // Calculate visible dimensions in UV space for aspect-correct feathering on X axis\n float visibleWidth = visMaxX - visMinX;\n float visibleHeight = visMaxY - visMinY;\n float visibleAspect = visibleWidth / visibleHeight;\n\n // Per-side feather amounts (X sides get aspect correction for pixel-equal width)\n float featherTop = uEdgeFeather.x * 0.15 / visibleAspect;\n float featherRight = uEdgeFeather.y * 0.15 / visibleAspect;\n float featherBottom = uEdgeFeather.z * 0.15 / visibleAspect;\n float featherLeft = uEdgeFeather.w * 0.15 / visibleAspect;\n\n // Apply feathering at container edges (visible bounds)\n float left = smoothstep(visMinX, visMinX + featherLeft, screenUV.x);\n float right = smoothstep(visMaxX, visMaxX - featherRight, screenUV.x);\n float bottom = smoothstep(visMinY, visMinY + featherBottom, screenUV.y);\n float top = smoothstep(visMaxY, visMaxY - featherTop, screenUV.y);\n\n float edgeMask = left * right * bottom * top;\n // Blend towards background color instead of white to avoid visible edges\n color = mix(bgColor, color, edgeMask);\n }\n return color;\n}\n\nvoid main() {\n // ============================================\n // LAYER 1: Base glass effect (fine slits, whole image)\n // ============================================\n float numSegments = uNumSegments;\n float angle = uSlitAngle;\n const float blurRadius = 9.0;\n const float sigma = 4.0;\n\n // Calculate aspect ratio for consistent slit angles\n float aspect = iResolution.x / iResolution.y;\n\n // Displacement parameters (in pixels, scaled by DPR)\n // Scale displacement by reference resolution ratio to maintain consistency across browser zoom levels\n float resolutionScale = iResolution.x / uRefResolution.x;\n vec2 maxDisplacement = vec2(uDisplacementX, uDisplacementY) * uDpr * resolutionScale;\n\n // Use pre-computed UV from vertex shader (zoom + pan already applied)\n vec2 uv = vContentUv;\n\n // Base displacement (fine slits)\n // Use raw screen UV (vUv) so slit positions stay fixed on screen regardless of pan/zoom\n float gradientStart = 1.0;\n float gradientEnd = 0.0;\n float gradientPower = 1.0;\n float centerPoint = 0.5;\n vec2 displacementData = createStripedDisplacement(\n vUv,\n numSegments,\n angle,\n gradientStart,\n gradientEnd,\n gradientPower,\n centerPoint,\n aspect\n );\n float signedDisplacement = displacementData.x;\n float localUVx = displacementData.y;\n\n // ============================================\n // LAYER 2: Inner glass effect (larger slits, center only, STATIC)\n // ============================================\n // Inner segments are a divisor of outer segments for perfect alignment\n // 45 / 5 = 9 segments (5x larger slits that align with outer grid)\n float innerNumSegments = numSegments;\n float innerAngle = angle; // Same angle as outer\n\n // Inner slits are STATIC - use raw screen UV so slits stay fixed on screen\n vec2 innerDisplacementData = createStripedDisplacement(\n vUv,\n innerNumSegments,\n innerAngle,\n gradientStart,\n gradientEnd,\n gradientPower,\n centerPoint,\n aspect\n );\n float innerSignedDisplacement = innerDisplacementData.x;\n float innerLocalUVx = innerDisplacementData.y;\n\n // ============================================\n // COMPUTE SOLID CORE MASK EARLY (needed for light & displacement masking)\n // ============================================\n vec4 videoFrameSample = texture2D(uVideoTexture, uv);\n float maskIntensity = luminance(videoFrameSample.rgb);\n float solidCoreMask = smoothstep(0.4, 0.7, maskIntensity);\n\n // Store original displacement for shape refraction (before masking)\n float originalInnerDisplacement = innerSignedDisplacement;\n\n // Mask inner displacement by solidCoreMask - no inner displacement in center\n innerSignedDisplacement *= (1.0 - solidCoreMask);\n\n // Inner layer displacement uses same values (scaled by resolutionScale for zoom independence)\n vec2 innerMaxDisplacement = vec2(30.0, 0.0) * uDpr * resolutionScale;\n\n // ============================================\n // CENTER ELEMENT (Static Ellipse + Animated Shapes)\n // ============================================\n float staticEllipseMask = 0.0;\n float staticEllipseGradient = 0.0;\n ShapeData shapeData;\n shapeData.shape = 0.0;\n shapeData.gradient = 0.0;\n\n float centerFadeInDuration = 10.0;\n float centerFramesSinceStart = uFrameCount - uLightStartFrame;\n float centerEffectActivation = clamp(centerFramesSinceStart / centerFadeInDuration, 0.0, 1.0);\n\n if (uEnableCenterElement > 0.5) {\n // Calculate static ellipse mask\n {\n const float ellipseCenterX = 0.3;\n const float ellipseCenterY = -0.15;\n const float ellipseWidth = 0.5;\n const float ellipseHeight = 0.8;\n const float ellipseAngle = 0.3;\n const float ellipseSoftness = 1.0;\n const float ellipseGrayLevel = 0.5;\n\n float aspect = iResolution.x / iResolution.y;\n\n // Use RAW UV (no displacement) for the mask calculation\n vec2 delta = uv - vec2(ellipseCenterX, ellipseCenterY);\n\n // Rotate\n float cosA = cos(ellipseAngle);\n float sinA = sin(ellipseAngle);\n vec2 rotatedDelta = vec2(\n delta.x * cosA - delta.y * sinA,\n delta.x * sinA + delta.y * cosA\n );\n rotatedDelta.x *= aspect;\n\n // Calculate ellipse distance\n float ellipseDist = sdEllipse(rotatedDelta, vec2(ellipseWidth, ellipseHeight));\n\n // Soft shape mask\n staticEllipseMask = 1.0 - smoothstep(-ellipseSoftness * 0.1, ellipseSoftness * 0.05, ellipseDist);\n\n // Gradient\n float normalizedDist = ellipseDist / max(ellipseWidth, ellipseHeight) + 1.0;\n normalizedDist = clamp(normalizedDist, 0.0, 1.0);\n staticEllipseGradient = mix(1.0, ellipseGrayLevel, smoothstep(0.0, 1.0, normalizedDist));\n\n // Apply solid core mask\n staticEllipseMask *= solidCoreMask;\n }\n\n // Block displacement inside the static ellipse\n originalInnerDisplacement *= (1.0 - staticEllipseMask);\n innerSignedDisplacement *= (1.0 - staticEllipseMask);\n signedDisplacement *= (1.0 - staticEllipseMask);\n\n\n\n // Calculate displaced UV for shape - use inner displacement for the shape refraction\n vec2 shapeDisplacedUV = applyDisplacement(uv, originalInnerDisplacement, innerMaxDisplacement, iResolution);\n\n // Calculate animated shape using DISPLACED UVs so glass slits refract through it\n shapeData = calculateAnimatedShape(\n shapeDisplacedUV, // Use displaced UVs!\n uCenterAnimTime, // Time-based animation in seconds (resets with video loop)\n solidCoreMask,\n iResolution\n );\n\n // Combine static ellipse with animated shapes\n {\n float combinedShape = max(shapeData.shape, staticEllipseMask) * centerEffectActivation;\n float totalMask = shapeData.shape + staticEllipseMask;\n float combinedGradient = shapeData.gradient;\n if (totalMask > 0.001) {\n combinedGradient = (shapeData.gradient * shapeData.shape + staticEllipseGradient * staticEllipseMask) / totalMask;\n }\n shapeData.shape = combinedShape;\n shapeData.gradient = combinedGradient;\n }\n }\n\n // ============================================\n // INNER EFFECT ACTIVATION - starts after uLightStartFrame\n // ============================================\n float innerFadeInDuration = 10.0; // Slower fade-in for inner effect\n float innerFramesSinceStart = uFrameCount - uLightStartFrame;\n float innerEffectActivation = clamp(innerFramesSinceStart / innerFadeInDuration, 0.0, 1.0);\n\n // Create edge mask (solidCoreMask already computed earlier for light masking)\n float edgeMask = smoothstep(0.3, 0.6, maskIntensity); // Where shape starts\n\n // Blend outer and inner slits on the edges\n // Inner contribution is multiplied by activation (fades in after frame 200)\n float outerContribution = 1.0 - edgeMask * 0.5 * innerEffectActivation;\n float innerContribution = edgeMask * innerEffectActivation;\n\n // Combined displacement: inner effect fades in over time\n float combinedDisplacement = signedDisplacement * outerContribution +\n innerSignedDisplacement * innerContribution;\n\n // Blend max displacement smoothly\n vec2 combinedMaxDisplacement = maxDisplacement * outerContribution +\n innerMaxDisplacement * innerContribution;\n\n // For the CENTER area (solidCoreMask): use 100% inner (larger) slits displacement\n // For the EDGES: use the combined displacement (blended outer + inner)\n // This ensures the logo center always has the larger slits\n combinedDisplacement = mix(combinedDisplacement, originalInnerDisplacement, solidCoreMask);\n combinedMaxDisplacement = mix(combinedMaxDisplacement, innerMaxDisplacement, solidCoreMask);\n\n // ============================================\n // LAYER 1: DISPLACEMENT (toggleable)\n // ============================================\n vec4 textureSample;\n if (uEnableDisplacement > 0.5) {\n textureSample = sampleWithDisplacement(\n uVideoTexture, uv,\n combinedDisplacement, combinedMaxDisplacement,\n iResolution\n );\n } else {\n // No displacement - sample directly\n textureSample = texture2D(uVideoTexture, uv);\n }\n\n // Blend localUVx for highlights - also fades in with activation\n float combinedLocalUVx = localUVx * outerContribution + innerLocalUVx * innerContribution;\n localUVx = combinedLocalUVx;\n\n // Store innerMask for later use (bloom, etc.) - also tied to activation\n float innerMask = edgeMask * innerEffectActivation;\n\n // Get Phase From: Intensity (Rec. 709 luminance)\n float baseIntensity = luminance(textureSample.rgb);\n\n // Boost intensity in center areas to push them more towards white\n float centerWhiteBoost = 0.1;\n baseIntensity = baseIntensity + innerMask * centerWhiteBoost;\n baseIntensity = clamp(baseIntensity, 0.0, 1.0);\n\n // Keep base intensity for outer colorama (using uGradientMap)\n float outerIntensity = baseIntensity;\n\n // ============================================\n // CENTER GREEN STRIPES OVERLAY (before colorama)\n // ============================================\n float stripeFadeOutDuration = 10.0;\n float stripeFramesSinceStart = uFrameCount - uLightStartFrame;\n // Effect is active UNTIL uLightStartFrame, then fades out\n float stripeEffectActivation = 1.0 - clamp(stripeFramesSinceStart / stripeFadeOutDuration, 0.0, 1.0);\n\n // Animated vertical height mask - grows from 0 to full height\n // Height animation: starts at center (0.5) and expands outward\n float stripeHeightDelay = 15.0; // frames to wait before starting\n float stripeHeightGrowDuration = 80.0; // frames to reach full height\n float stripeHeightProgress = clamp((uFrameCount - stripeHeightDelay) / stripeHeightGrowDuration, 0.0, 1.0);\n // Ease the progress for smoother animation\n float easedHeightProgress = 1.0 - pow(1.0 - stripeHeightProgress, 2.0);\n \n // Calculate animated bounds - expand from center (0.5) outward\n float heightHalfSpan = 0.2 * easedHeightProgress; // 0.06 = half of the 0.12 total height (0.44 to 0.56)\n float softEdge = 0.1 * easedHeightProgress; // Soft edge also scales with progress\n float bottomEdge = 0.5 - heightHalfSpan - softEdge;\n float bottomFull = 0.5 - heightHalfSpan;\n float topFull = 0.5 + heightHalfSpan;\n float topEdge = 0.5 + heightHalfSpan + softEdge;\n \n // When progress is 0, force mask to 0 to avoid glitchy edge at y=0.5\n float stripeHeightMask = easedHeightProgress > 0.001 \n ? smoothstep(bottomEdge, bottomFull, uv.y) * smoothstep(topEdge, topFull, uv.y)\n : 0.0;\n\n vec4 centerGreenSlantedLines = createStripes(\n vUv + vec2(-0.0035, 0.0), // slight offset to avoid moiré\n numSegments,\n uSlitAngle,\n 0.15, // stopPosition (20%)\n vec4(20.0/255.0, 200.0/255.0, 20.0/255.0, 0.2), // colorStart (green at 0%)\n vec4(0.0, 0.0, 0.0, 0.0), // colorMid (white at 20%)\n aspect // aspect ratio for consistent angle\n ) * solidCoreMask * stripeHeightMask;\n\n // Overlay green stripes on center element area\n float stripeOverlayMask = solidCoreMask * stripeEffectActivation;\n // Modify baseIntensity/outerIntensity with stripes before colorama\n vec4 stripedTexture = vec4(textureSample.rgb, 1.0) - centerGreenSlantedLines*0.7 * stripeOverlayMask;\n stripedTexture = clamp(stripedTexture, 0.0, 1.0);\n\n // Update intensity for colorama input\n float stripedIntensity = luminance(stripedTexture.rgb);\n outerIntensity = mix(baseIntensity, stripedIntensity, stripeOverlayMask);\n\n // ============================================\n // LAYER 2: COLORAMA (toggleable)\n // ============================================\n vec3 color;\n if (uEnableColorama > 0.5) {\n // OUTER colorama: uses base intensity, cross-fades between uGradientMap and uGradientMap2\n vec3 outerColoramaResult1 = applyColoramaWithGradient(\n uGradientMap, outerIntensity,\n uInputMin, uInputMax, uModifyGamma, uPosterizeLevels,\n uCycleRepetitions, uPhaseShift, uCycleSpeed,\n uWrapMode, uReverse\n );\n vec3 outerColoramaResult2 = applyColoramaWithGradient(\n uGradientMap2, outerIntensity,\n uInputMin, uInputMax, uModifyGamma, uPosterizeLevels,\n uCycleRepetitions, uPhaseShift, uCycleSpeed,\n uWrapMode, uReverse\n );\n vec3 outerColoramaResult = mix(outerColoramaResult1, outerColoramaResult2, uGradientMapBlend);\n\n // Start with outer colorama as base\n vec3 blendedColorama = outerColoramaResult;\n\n // CENTER colorama: only compute when inside shape (skip texture sample otherwise)\n // This saves a texture lookup + specular pow() for ~90% of pixels\n if (shapeData.shape > 0.001) {\n vec3 centerColoramaResult = applyColoramaWithGradient(\n uCenterGradientMap, shapeData.gradient,\n uInputMin, uInputMax, uModifyGamma, uPosterizeLevels,\n uCycleRepetitions, uPhaseShift, uCycleSpeed,\n uWrapMode, uReverse\n );\n\n // Add specular highlight to center (shiny reflection effect)\n float specularPower = 8.0; // Higher = tighter/smaller highlight\n float specularIntensity = 1.9; // Brightness of the specular\n float specular = pow(shapeData.gradient, specularPower) * specularIntensity;\n centerColoramaResult += vec3(specular); // Add bright highlight\n\n // Blend between outer and center colorama based on shape\n blendedColorama = mix(outerColoramaResult, centerColoramaResult, shapeData.shape);\n }\n\n color = mix(blendedColorama, textureSample.rgb, uBlendWithOriginal);\n } else {\n color = textureSample.rgb;\n }\n\n // Store intensity for bloom (use the blended value)\n float intensity = mix(outerIntensity, shapeData.gradient, shapeData.shape);\n\n // ============================================\n // LAYER 3: BLOOM (toggleable)\n // ============================================\n if (uEnableBloom > 0.5) {\n color = applyBloom(color, intensity, innerMask);\n }\n\n // ============================================\n // LAYER 4: SHAPE HIGHLIGHT (toggleable via light sweep toggle)\n // ============================================\n if (uEnableLightSweep > 0.5) {\n float lightFadeInDuration = 30.0;\n float framesSinceStart = uFrameCount - uLightStartFrame;\n float lightActivation = clamp(framesSinceStart / lightFadeInDuration, 0.0, 1.0);\n\n // Add subtle brightness boost at shape center\n float shapeHighlight = pow(shapeData.gradient, 2.0) * shapeData.shape;\n color += vec3(1.0) * shapeHighlight * 0.15 * uLightIntensity * lightActivation;\n }\n\n // Color correction and edge feathering (shared with ripple mode)\n color = applyColorCorrection(color);\n // Blend with background color if provided (uBackgroundColor.r < 0 means not set)\n if (uBackgroundColor.r >= 0.0) {\n // Calculate luminance to determine how bright the pixel is\n float brightness = luminance(color);\n \n // Blend white/bright areas with background color\n // Bright areas (close to white) become the background color\n float blendStart = 0.94; // Start blending at this brightness\n float blendEnd = 1.0; // Fully background color at this brightness\n float blendAmount = smoothstep(blendStart, blendEnd, brightness);\n \n // Mix the shader color with background color\n color = mix(color, uBackgroundColor, blendAmount);\n }\n\n // Use background color for feathering if set, otherwise default to white\n vec3 featherColor = uBackgroundColor.r >= 0.0 ? uBackgroundColor : vec3(1.0);\n color = applyEdgeFeathering(color, featherColor);\n\n gl_FragColor = vec4(color, 1.0);\n}\n`;\n\nexport { rzpGlassFragmentShader, rzpGlassVertexShader };\n"],"names":["rzpGlassVertexShader","rzpGlassFragmentShader"],"mappings":"AAAM,IAAAA,oBAAoB,CAAc,CAAA;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAEM,IAAAC,sBAAsB,CAAc,CAAA;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}
@@ -1,7 +1,9 @@
1
1
  import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
2
+ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
3
+ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
2
4
  import { getPresets } from './presets.js';
3
5
 
4
- var DEFAULT_CDN_PATH='https://cdn.jsdelivr.net/npm/@razorpay/blade/assets/spark';var getDefaultAssets=function getDefaultAssets(assetsPath){return {videoSrc:`${assetsPath}/spark-base-video.mp4`,imageSrc:`${assetsPath}/bottom-frame.jpg`,gradientMapSrc:`${assetsPath}/colorama-gradient-map-green.jpg`,gradientMap2Src:`${assetsPath}/colorama-gradient-map-blue.jpg`,centerGradientMapSrc:`${assetsPath}/colorama-center-gradient-map.jpg`};};function loadImage(src){return new Promise(function(resolve,reject){var img=new Image();img.crossOrigin='anonymous';img.onload=function(){return resolve(img);};img.onerror=function(){return reject(new Error(`Failed to load image: ${src}`));};img.src=src;});}function loadVideo(src){return new Promise(function(resolve,reject){var video=document.createElement('video');video.src=src;video.crossOrigin='anonymous';video.loop=true;video.muted=true;video.playsInline=true;video.preload='auto';video.oncanplaythrough=function(){return resolve(video);};video.onerror=function(){return reject(new Error(`Failed to load video: ${src}`));};video.load();});}function isSafari(){var ua=navigator.userAgent.toLowerCase();return ua.includes('safari')&&!ua.includes('chrome')&&!ua.includes('android');}function bestGuessBrowserZoom(){var _visualViewport$scale,_visualViewport,_visualViewport$width,_visualViewport2;var viewportScale=(_visualViewport$scale=(_visualViewport=visualViewport)==null?void 0:_visualViewport.scale)!=null?_visualViewport$scale:1;var viewportWidth=(_visualViewport$width=(_visualViewport2=visualViewport)==null?void 0:_visualViewport2.width)!=null?_visualViewport$width:window.innerWidth;var scrollbarWidth=window.innerWidth-document.documentElement.clientWidth;var innerWidth=viewportScale*viewportWidth+scrollbarWidth;var ratio=outerWidth/innerWidth;var zoomPercentageRounded=Math.round(100*ratio);if(zoomPercentageRounded%5===0){return zoomPercentageRounded/100;}if(zoomPercentageRounded===33)return 1/3;if(zoomPercentageRounded===67)return 2/3;if(zoomPercentageRounded===133)return 4/3;return ratio;}function preloadRazorSenseAssets(){return _preloadRazorSenseAssets.apply(this,arguments);}function _preloadRazorSenseAssets(){_preloadRazorSenseAssets=_asyncToGenerator(function*(){var _presetDef$videoSrc,_presetDef$gradientMa,_presetDef$gradientMa2,_presetDef$centerGrad;var preset=arguments.length>0&&arguments[0]!==undefined?arguments[0]:'default';var assetsPath=arguments.length>1&&arguments[1]!==undefined?arguments[1]:DEFAULT_CDN_PATH;var presets=getPresets(assetsPath);var presetDef=presets[preset]||{};var defaultAssets=getDefaultAssets(assetsPath);var videoSrc=(_presetDef$videoSrc=presetDef.videoSrc)!=null?_presetDef$videoSrc:defaultAssets.videoSrc;var imageSrc=presetDef.imageSrc;var gradientMapSrc=(_presetDef$gradientMa=presetDef.gradientMapSrc)!=null?_presetDef$gradientMa:defaultAssets.gradientMapSrc;var gradientMap2Src=(_presetDef$gradientMa2=presetDef.gradientMap2Src)!=null?_presetDef$gradientMa2:defaultAssets.gradientMap2Src;var centerGradientMapSrc=(_presetDef$centerGrad=presetDef.centerGradientMapSrc)!=null?_presetDef$centerGrad:defaultAssets.centerGradientMapSrc;var loadPromises=[];if(imageSrc){loadPromises.push(loadImage(imageSrc));}else if(videoSrc){loadPromises.push(loadVideo(videoSrc));}loadPromises.push(loadImage(gradientMapSrc),loadImage(gradientMap2Src),loadImage(centerGradientMapSrc));yield Promise.all(loadPromises);});return _preloadRazorSenseAssets.apply(this,arguments);}
6
+ var _excluded=["width","height","className","style","onLoad","onError","preset","assetsPath","gradientMapSrc","gradientMap2Src","gradientMapCanvas","imageSrc"];var DEFAULT_CDN_PATH='https://cdn.jsdelivr.net/npm/@razorpay/blade/assets/spark';var getDefaultAssets=function getDefaultAssets(assetsPath){return {videoSrc:`${assetsPath}/spark-base-video.mp4`,imageSrc:`${assetsPath}/bottom-frame.jpg`,gradientMapSrc:`${assetsPath}/colorama-gradient-map-green.jpg`,gradientMap2Src:`${assetsPath}/colorama-gradient-map-blue.jpg`,centerGradientMapSrc:`${assetsPath}/colorama-center-gradient-map.jpg`};};function extractConfig(props){props.width;props.height;props.className;props.style;props.onLoad;props.onError;props.preset;props.assetsPath;props.gradientMapSrc;props.gradientMap2Src;props.gradientMapCanvas;props.imageSrc;var config=_objectWithoutProperties(props,_excluded);return Object.fromEntries(Object.entries(config).filter(function(_ref){var _ref2=_slicedToArray(_ref,2),v=_ref2[1];return v!==undefined;}));}var ASSET_KEYS=new Set(['videoSrc','imageSrc','gradientMapSrc','gradientMap2Src','centerGradientMapSrc']);function getPresetDefinition(preset,assetsPath){var presets=getPresets(assetsPath);if(preset&&preset in presets)return Object.assign({},presets[preset]);return {};}function getPresetConfig(preset,assetsPath){var def=getPresetDefinition(preset,assetsPath);return Object.fromEntries(Object.entries(def).filter(function(_ref3){var _ref4=_slicedToArray(_ref3,1),k=_ref4[0];return !ASSET_KEYS.has(k);}));}function getPresetAssets(preset,assetsPath){var def=getPresetDefinition(preset,assetsPath);return Object.fromEntries(Object.entries(def).filter(function(_ref5){var _ref6=_slicedToArray(_ref5,1),k=_ref6[0];return ASSET_KEYS.has(k);}));}function resolveConfig(props,assetsPath){return Object.assign({},getPresetConfig(props.preset,assetsPath),extractConfig(props));}function loadImage(src){return new Promise(function(resolve,reject){var img=new Image();img.crossOrigin='anonymous';img.onload=function(){return resolve(img);};img.onerror=function(){return reject(new Error(`Failed to load image: ${src}`));};img.src=src;});}function loadVideo(src){return new Promise(function(resolve,reject){var video=document.createElement('video');video.src=src;video.crossOrigin='anonymous';video.loop=true;video.muted=true;video.playsInline=true;video.preload='auto';video.oncanplaythrough=function(){return resolve(video);};video.onerror=function(){return reject(new Error(`Failed to load video: ${src}`));};video.load();});}function isSafari(){var ua=navigator.userAgent.toLowerCase();return ua.includes('safari')&&!ua.includes('chrome')&&!ua.includes('android');}function bestGuessBrowserZoom(){var _visualViewport$scale,_visualViewport,_visualViewport$width,_visualViewport2;var viewportScale=(_visualViewport$scale=(_visualViewport=visualViewport)==null?void 0:_visualViewport.scale)!=null?_visualViewport$scale:1;var viewportWidth=(_visualViewport$width=(_visualViewport2=visualViewport)==null?void 0:_visualViewport2.width)!=null?_visualViewport$width:window.innerWidth;var scrollbarWidth=window.innerWidth-document.documentElement.clientWidth;var innerWidth=viewportScale*viewportWidth+scrollbarWidth;var ratio=outerWidth/innerWidth;var zoomPercentageRounded=Math.round(100*ratio);if(zoomPercentageRounded%5===0){return zoomPercentageRounded/100;}if(zoomPercentageRounded===33)return 1/3;if(zoomPercentageRounded===67)return 2/3;if(zoomPercentageRounded===133)return 4/3;return ratio;}function preloadRazorSenseAssets(){return _preloadRazorSenseAssets.apply(this,arguments);}function _preloadRazorSenseAssets(){_preloadRazorSenseAssets=_asyncToGenerator(function*(){var _presetDef$videoSrc,_presetDef$gradientMa,_presetDef$gradientMa2,_presetDef$centerGrad;var preset=arguments.length>0&&arguments[0]!==undefined?arguments[0]:'default';var assetsPath=arguments.length>1&&arguments[1]!==undefined?arguments[1]:DEFAULT_CDN_PATH;var presets=getPresets(assetsPath);var presetDef=presets[preset]||{};var defaultAssets=getDefaultAssets(assetsPath);var videoSrc=(_presetDef$videoSrc=presetDef.videoSrc)!=null?_presetDef$videoSrc:defaultAssets.videoSrc;var imageSrc=presetDef.imageSrc;var gradientMapSrc=(_presetDef$gradientMa=presetDef.gradientMapSrc)!=null?_presetDef$gradientMa:defaultAssets.gradientMapSrc;var gradientMap2Src=(_presetDef$gradientMa2=presetDef.gradientMap2Src)!=null?_presetDef$gradientMa2:defaultAssets.gradientMap2Src;var centerGradientMapSrc=(_presetDef$centerGrad=presetDef.centerGradientMapSrc)!=null?_presetDef$centerGrad:defaultAssets.centerGradientMapSrc;var loadPromises=[];if(imageSrc){loadPromises.push(loadImage(imageSrc));}else if(videoSrc){loadPromises.push(loadVideo(videoSrc));}loadPromises.push(loadImage(gradientMapSrc),loadImage(gradientMap2Src),loadImage(centerGradientMapSrc));yield Promise.all(loadPromises);});return _preloadRazorSenseAssets.apply(this,arguments);}
5
7
 
6
- export { bestGuessBrowserZoom, isSafari, loadImage, loadVideo, preloadRazorSenseAssets };
8
+ export { DEFAULT_CDN_PATH, bestGuessBrowserZoom, getDefaultAssets, getPresetAssets, isSafari, loadImage, loadVideo, preloadRazorSenseAssets, resolveConfig };
7
9
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../../../../../../src/components/Spark/RzpGlass/utils.ts"],"sourcesContent":["/**\n * RzpGlass Utility Functions\n */\n\nimport type { RzpGlassPreset } from './presets';\nimport { getPresets } from './presets';\n\nconst DEFAULT_CDN_PATH = 'https://cdn.jsdelivr.net/npm/@razorpay/blade/assets/spark';\n\nconst getDefaultAssets = (assetsPath: string): Record<string, string> => ({\n videoSrc: `${assetsPath}/spark-base-video.mp4`,\n imageSrc: `${assetsPath}/bottom-frame.jpg`,\n gradientMapSrc: `${assetsPath}/colorama-gradient-map-green.jpg`,\n gradientMap2Src: `${assetsPath}/colorama-gradient-map-blue.jpg`,\n centerGradientMapSrc: `${assetsPath}/colorama-center-gradient-map.jpg`,\n});\n\n/**\n * Load an image from URL\n */\nexport function loadImage(src: string): Promise<HTMLImageElement> {\n return new Promise((resolve, reject) => {\n const img = new Image();\n img.crossOrigin = 'anonymous';\n img.onload = () => resolve(img);\n img.onerror = () => reject(new Error(`Failed to load image: ${src}`));\n img.src = src;\n });\n}\n\n/**\n * Load a video from URL\n */\nexport function loadVideo(src: string): Promise<HTMLVideoElement> {\n return new Promise((resolve, reject) => {\n const video = document.createElement('video');\n video.src = src;\n video.crossOrigin = 'anonymous';\n video.loop = true;\n video.muted = true;\n video.playsInline = true;\n video.preload = 'auto';\n video.oncanplaythrough = () => resolve(video);\n video.onerror = () => reject(new Error(`Failed to load video: ${src}`));\n video.load();\n });\n}\n\n/**\n * Check if browser is Safari\n */\nexport function isSafari(): boolean {\n const ua = navigator.userAgent.toLowerCase();\n return ua.includes('safari') && !ua.includes('chrome') && !ua.includes('android');\n}\n\n/**\n * Best guess browser zoom level (for Safari which doesn't include zoom in devicePixelRatio)\n */\nexport function bestGuessBrowserZoom(): number {\n const viewportScale = visualViewport?.scale ?? 1;\n const viewportWidth = visualViewport?.width ?? window.innerWidth;\n const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth;\n const innerWidth = viewportScale * viewportWidth + scrollbarWidth;\n\n const ratio = outerWidth / innerWidth;\n const zoomPercentageRounded = Math.round(100 * ratio);\n\n // Common zoom levels divisible by 5%\n if (zoomPercentageRounded % 5 === 0) {\n return zoomPercentageRounded / 100;\n }\n\n // Handle special zoom levels\n if (zoomPercentageRounded === 33) return 1 / 3;\n if (zoomPercentageRounded === 67) return 2 / 3;\n if (zoomPercentageRounded === 133) return 4 / 3;\n\n return ratio;\n}\n\n/**\n * Preload all assets for a given RazorSense preset.\n * This ensures videos and images are fully loaded before the component mounts,\n * preventing frame skipping in one-shot animations.\n *\n * @param preset - The preset name to preload assets for\n * @param assetsPath - Optional CDN path for assets (defaults to Blade CDN)\n * @returns Promise that resolves when all assets are loaded\n *\n * @example\n * ```tsx\n * // Preload before showing the animation\n * await preloadRazorSenseAssets('circleSlideUp');\n *\n * // Now mount the component - assets are already cached\n * <RazorSense preset=\"circleSlideUp\" />\n * ```\n */\nexport async function preloadRazorSenseAssets(\n preset: RzpGlassPreset = 'default',\n assetsPath: string = DEFAULT_CDN_PATH,\n): Promise<void> {\n const presets = getPresets(assetsPath);\n const presetDef = presets[preset] || {};\n const defaultAssets = getDefaultAssets(assetsPath);\n\n const videoSrc = presetDef.videoSrc ?? defaultAssets.videoSrc;\n const imageSrc = presetDef.imageSrc;\n const gradientMapSrc = presetDef.gradientMapSrc ?? defaultAssets.gradientMapSrc;\n const gradientMap2Src = presetDef.gradientMap2Src ?? defaultAssets.gradientMap2Src;\n const centerGradientMapSrc = presetDef.centerGradientMapSrc ?? defaultAssets.centerGradientMapSrc;\n\n const loadPromises: Promise<unknown>[] = [];\n\n if (imageSrc) {\n loadPromises.push(loadImage(imageSrc));\n } else if (videoSrc) {\n loadPromises.push(loadVideo(videoSrc));\n }\n\n loadPromises.push(\n loadImage(gradientMapSrc),\n loadImage(gradientMap2Src),\n loadImage(centerGradientMapSrc),\n );\n\n await Promise.all(loadPromises);\n}\n"],"names":["DEFAULT_CDN_PATH","getDefaultAssets","assetsPath","videoSrc","imageSrc","gradientMapSrc","gradientMap2Src","centerGradientMapSrc","loadImage","src","Promise","resolve","reject","img","Image","crossOrigin","onload","onerror","Error","loadVideo","video","document","createElement","loop","muted","playsInline","preload","oncanplaythrough","load","isSafari","ua","navigator","userAgent","toLowerCase","includes","bestGuessBrowserZoom","_visualViewport$scale","_visualViewport","_visualViewport$width","_visualViewport2","viewportScale","visualViewport","scale","viewportWidth","width","window","innerWidth","scrollbarWidth","documentElement","clientWidth","ratio","outerWidth","zoomPercentageRounded","Math","round","preloadRazorSenseAssets","_preloadRazorSenseAssets","apply","arguments","_asyncToGenerator","_presetDef$videoSrc","_presetDef$gradientMa","_presetDef$gradientMa2","_presetDef$centerGrad","preset","length","undefined","presets","getPresets","presetDef","defaultAssets","loadPromises","push","all"],"mappings":";;;AAOA,IAAMA,gBAAgB,CAAG,2DAA2D,CAEpF,IAAMC,gBAAgB,CAAG,SAAnBA,gBAAgBA,CAAIC,UAAkB,CAAA,CAAA,OAA8B,CACxEC,QAAQ,CAAE,CAAGD,EAAAA,UAAU,CAAuB,qBAAA,CAAA,CAC9CE,QAAQ,CAAE,CAAA,EAAGF,UAAU,CAAA,iBAAA,CAAmB,CAC1CG,cAAc,CAAE,GAAGH,UAAU,CAAA,gCAAA,CAAkC,CAC/DI,eAAe,CAAE,CAAGJ,EAAAA,UAAU,iCAAiC,CAC/DK,oBAAoB,CAAE,CAAA,EAAGL,UAAU,CACrC,iCAAA,CAAA,CAAC,CAAC,CAAA,CAKc,SAAAM,SAASA,CAACC,GAAW,CAA6B,CAChE,OAAO,IAAIC,OAAO,CAAC,SAACC,OAAO,CAAEC,MAAM,CAAK,CACtC,IAAMC,GAAG,CAAG,IAAIC,KAAK,EAAE,CACvBD,GAAG,CAACE,WAAW,CAAG,WAAW,CAC7BF,GAAG,CAACG,MAAM,CAAG,UAAM,CAAA,OAAAL,OAAO,CAACE,GAAG,CAAC,CAAA,CAAA,CAC/BA,GAAG,CAACI,OAAO,CAAG,UAAA,CAAA,O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AG,CAACF,YAAY,CAAC,CACjC,CAAC,CAAA,CAAA,OAAAf,wBAAA,CAAAC,KAAA,MAAAC,SAAA,CAAA,CAAA;;;;"}
1
+ {"version":3,"file":"utils.js","sources":["../../../../../../src/components/Spark/RzpGlass/utils.ts"],"sourcesContent":["/**\n * RzpGlass Utility Functions\n */\n\nimport type { RzpGlassPreset } from './presets';\nimport { getPresets } from './presets';\nimport type {\n RzpGlassAssets,\n RzpGlassConfig,\n RzpGlassPresetDefinition,\n RzpGlassProps,\n} from './types';\n\nconst DEFAULT_CDN_PATH = 'https://cdn.jsdelivr.net/npm/@razorpay/blade/assets/spark';\n\nconst getDefaultAssets = (assetsPath: string): Required<RzpGlassAssets> => ({\n videoSrc: `${assetsPath}/spark-base-video.mp4`,\n imageSrc: `${assetsPath}/bottom-frame.jpg`,\n gradientMapSrc: `${assetsPath}/colorama-gradient-map-green.jpg`,\n gradientMap2Src: `${assetsPath}/colorama-gradient-map-blue.jpg`,\n centerGradientMapSrc: `${assetsPath}/colorama-center-gradient-map.jpg`,\n});\n\n/**\n * Extract config from props (exclude non-config props).\n * Strips undefined values so they don't clobber preset defaults.\n */\nfunction extractConfig(props: RzpGlassProps): Partial<RzpGlassConfig> {\n const {\n width: _width,\n height: _height,\n className: _className,\n style: _style,\n onLoad: _onLoad,\n onError: _onError,\n preset: _preset,\n assetsPath: _assetsPath,\n gradientMapSrc: _gradientMapSrc,\n gradientMap2Src: _gradientMap2Src,\n gradientMapCanvas: _gradientMapCanvas,\n imageSrc: _imageSrc,\n ...config\n } = props;\n\n // Drop keys with undefined values so preset config isn't overridden by unset props\n return Object.fromEntries(\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n Object.entries(config).filter(([, v]) => v !== undefined),\n ) as Partial<RzpGlassConfig>;\n}\n\nconst ASSET_KEYS = new Set<string>([\n 'videoSrc',\n 'imageSrc',\n 'gradientMapSrc',\n 'gradientMap2Src',\n 'centerGradientMapSrc',\n]);\n\n/* eslint-disable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-return */\nfunction getPresetDefinition(\n preset: RzpGlassPreset | undefined,\n assetsPath: string,\n): RzpGlassPresetDefinition {\n const presets = getPresets(assetsPath);\n if (preset && preset in presets) return { ...presets[preset] };\n return {};\n}\n\nfunction getPresetConfig(\n preset: RzpGlassPreset | undefined,\n assetsPath: string,\n): Partial<RzpGlassConfig> {\n const def = getPresetDefinition(preset, assetsPath) as Record<string, unknown>;\n return Object.fromEntries(\n Object.entries(def).filter(([k]) => !ASSET_KEYS.has(k)),\n ) as Partial<RzpGlassConfig>;\n}\n\nfunction getPresetAssets(\n preset: RzpGlassPreset | undefined,\n assetsPath: string,\n): Partial<RzpGlassAssets> {\n const def = getPresetDefinition(preset, assetsPath) as Record<string, unknown>;\n return Object.fromEntries(\n Object.entries(def).filter(([k]) => ASSET_KEYS.has(k)),\n ) as Partial<RzpGlassAssets>;\n}\n\n/**\n * Merge preset config with user-provided config.\n * Preset values are used as base; any explicit prop overrides them.\n */\nfunction resolveConfig(props: RzpGlassProps, assetsPath: string): Partial<RzpGlassConfig> {\n return {\n ...getPresetConfig(props.preset, assetsPath),\n ...extractConfig(props),\n };\n}\n\n/**\n * Load an image from URL\n */\nfunction loadImage(src: string): Promise<HTMLImageElement> {\n return new Promise((resolve, reject) => {\n const img = new Image();\n img.crossOrigin = 'anonymous';\n img.onload = () => resolve(img);\n img.onerror = () => reject(new Error(`Failed to load image: ${src}`));\n img.src = src;\n });\n}\n\n/**\n * Load a video from URL\n */\nfunction loadVideo(src: string): Promise<HTMLVideoElement> {\n return new Promise((resolve, reject) => {\n const video = document.createElement('video');\n video.src = src;\n video.crossOrigin = 'anonymous';\n video.loop = true;\n video.muted = true;\n video.playsInline = true;\n video.preload = 'auto';\n video.oncanplaythrough = () => resolve(video);\n video.onerror = () => reject(new Error(`Failed to load video: ${src}`));\n video.load();\n });\n}\n\n/**\n * Check if browser is Safari\n */\nfunction isSafari(): boolean {\n const ua = navigator.userAgent.toLowerCase();\n return ua.includes('safari') && !ua.includes('chrome') && !ua.includes('android');\n}\n\n/**\n * Best guess browser zoom level (for Safari which doesn't include zoom in devicePixelRatio)\n */\nfunction bestGuessBrowserZoom(): number {\n const viewportScale = visualViewport?.scale ?? 1;\n const viewportWidth = visualViewport?.width ?? window.innerWidth;\n const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth;\n const innerWidth = viewportScale * viewportWidth + scrollbarWidth;\n\n const ratio = outerWidth / innerWidth;\n const zoomPercentageRounded = Math.round(100 * ratio);\n\n // Common zoom levels divisible by 5%\n if (zoomPercentageRounded % 5 === 0) {\n return zoomPercentageRounded / 100;\n }\n\n // Handle special zoom levels\n if (zoomPercentageRounded === 33) return 1 / 3;\n if (zoomPercentageRounded === 67) return 2 / 3;\n if (zoomPercentageRounded === 133) return 4 / 3;\n\n return ratio;\n}\n\n/**\n * Preload all assets for a given RazorSense preset.\n * This ensures videos and images are fully loaded before the component mounts,\n * preventing frame skipping in one-shot animations.\n *\n * @param preset - The preset name to preload assets for\n * @param assetsPath - Optional CDN path for assets (defaults to Blade CDN)\n * @returns Promise that resolves when all assets are loaded\n *\n * @example\n * ```tsx\n * // Preload before showing the animation\n * await preloadRazorSenseAssets('circleSlideUp');\n *\n * // Now mount the component - assets are already cached\n * <RazorSense preset=\"circleSlideUp\" />\n * ```\n */\nasync function preloadRazorSenseAssets(\n preset: RzpGlassPreset = 'default',\n assetsPath: string = DEFAULT_CDN_PATH,\n): Promise<void> {\n const presets = getPresets(assetsPath);\n const presetDef = presets[preset] || {};\n const defaultAssets = getDefaultAssets(assetsPath);\n\n const videoSrc = presetDef.videoSrc ?? defaultAssets.videoSrc;\n const imageSrc = presetDef.imageSrc;\n const gradientMapSrc = presetDef.gradientMapSrc ?? defaultAssets.gradientMapSrc;\n const gradientMap2Src = presetDef.gradientMap2Src ?? defaultAssets.gradientMap2Src;\n const centerGradientMapSrc = presetDef.centerGradientMapSrc ?? defaultAssets.centerGradientMapSrc;\n\n const loadPromises: Promise<unknown>[] = [];\n\n if (imageSrc) {\n loadPromises.push(loadImage(imageSrc));\n } else if (videoSrc) {\n loadPromises.push(loadVideo(videoSrc));\n }\n\n loadPromises.push(\n loadImage(gradientMapSrc),\n loadImage(gradientMap2Src),\n loadImage(centerGradientMapSrc),\n );\n\n await Promise.all(loadPromises);\n}\n\nexport {\n DEFAULT_CDN_PATH,\n getDefaultAssets,\n loadImage,\n loadVideo,\n isSafari,\n bestGuessBrowserZoom,\n preloadRazorSenseAssets,\n getPresetAssets,\n resolveConfig,\n};\n"],"names":["DEFAULT_CDN_PATH","getDefaultAssets","assetsPath","videoSrc","imageSrc","gradientMapSrc","gradientMap2Src","centerGradientMapSrc","extractConfig","props","width","height","className","style","onLoad","onError","preset","gradientMapCanvas","config","_objectWithoutProperties","_excluded","Object","fromEntries","entries","filter","_ref","_ref2","_slicedToArray","v","undefined","ASSET_KEYS","Set","getPresetDefinition","presets","getPresets","assign","getPresetConfig","def","_ref3","_ref4","k","has","getPresetAssets","_ref5","_ref6","resolveConfig","loadImage","src","Promise","resolve","reject","img","Image","crossOrigin","onload","onerror","Error","loadVideo","video","document","createElement","loop","muted","playsInline","preload","oncanplaythrough","load","isSafari","ua","navigator","userAgent","toLowerCase","includes","bestGuessBrowserZoom","_visualViewport$scale","_visualViewport","_visualViewport$width","_visualViewport2","viewportScale","visualViewport","scale","viewportWidth","window","innerWidth","scrollbarWidth","documentElement","clientWidth","ratio","outerWidth","zoomPercentageRounded","Math","round","preloadRazorSenseAssets","_preloadRazorSenseAssets","apply","arguments","_asyncToGenerator","_presetDef$videoSrc","_presetDef$gradientMa","_presetDef$gradientMa2","_presetDef$centerGrad","length","presetDef","defaultAssets","loadPromises","push","all"],"mappings":";;;;;gKAaM,IAAAA,gBAAgB,CAAG,4DAEnB,IAAAC,gBAAgB,CAAG,SAAnBA,gBAAgBA,CAAIC,UAAkB,CAAgC,CAAA,OAAA,CAC1EC,QAAQ,CAAE,CAAGD,EAAAA,UAAU,CAAuB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YAAgC,CAAG,EAAE,CAE3C,GAAIpG,QAAQ,CAAE,CACZoG,YAAY,CAACC,IAAI,CAAC3D,SAAS,CAAC1C,QAAQ,CAAC,CAAC,CACxC,CAAC,KAAUD,GAAAA,QAAQ,CAAE,CACnBqG,YAAY,CAACC,IAAI,CAAChD,SAAS,CAACtD,QAAQ,CAAC,CAAC,CACxC,CAEAqG,YAAY,CAACC,IAAI,CACf3D,SAAS,CAACzC,cAAc,CAAC,CACzByC,SAAS,CAACxC,eAAe,CAAC,CAC1BwC,SAAS,CAACvC,oBAAoB,CAChC,CAAC,CAED,MAAMyC,OAAO,CAAC0D,GAAG,CAACF,YAAY,CAAC,CACjC,CAAC,CAAAX,CAAAA,OAAAA,wBAAA,CAAAC,KAAA,CAAAC,IAAAA,CAAAA,SAAA,CAED,CAAA;;;;"}
@@ -28,7 +28,7 @@ import { makeAnalyticsAttribute } from '../../utils/makeAnalyticsAttribute/makeA
28
28
  import { BaseBox } from '../Box/BaseBox/BaseBox.web.js';
29
29
  import { assignWithoutSideEffects } from '../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
30
30
 
31
- var _excluded = ["children", "backgroundColor", "borderRadius", "elevation", "testID", "padding", "width", "height", "minHeight", "minWidth", "maxWidth", "onClick", "isSelected", "accessibilityLabel", "shouldScaleOnHover", "onHover", "href", "target", "rel", "as", "size", "cursor", "opacity", "transition", "flexShrink"],
31
+ var _excluded = ["children", "backgroundColor", "borderRadius", "elevation", "testID", "padding", "width", "height", "minHeight", "minWidth", "maxWidth", "onClick", "isSelected", "accessibilityLabel", "shouldScaleOnHover", "onHover", "href", "target", "rel", "as", "size", "cursor", "opacity", "transition", "flexShrink", "overflow", "overflowX", "overflowY"],
32
32
  _excluded2 = ["height", "children", "testID"];
33
33
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
34
34
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -80,6 +80,9 @@ var _Card = function _Card(_ref, ref) {
80
80
  opacity = _ref.opacity,
81
81
  transition = _ref.transition,
82
82
  flexShrink = _ref.flexShrink,
83
+ overflow = _ref.overflow,
84
+ overflowX = _ref.overflowX,
85
+ overflowY = _ref.overflowY,
83
86
  rest = _objectWithoutProperties(_ref, _excluded);
84
87
  var _React$useState = React__default.useState(false),
85
88
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -154,6 +157,9 @@ var _Card = function _Card(_ref, ref) {
154
157
  backgroundColor: "surface.background.gray.intense",
155
158
  colorScheme: colorScheme,
156
159
  isSelected: isSelected,
160
+ overflow: overflow,
161
+ overflowX: overflowX,
162
+ overflowY: overflowY,
157
163
  children: [href ? /*#__PURE__*/jsx(LinkOverlay, _objectSpread({
158
164
  onClick: onClick,
159
165
  href: href,
@@ -1 +1 @@
1
- {"version":3,"file":"Card.js","sources":["../../../../../../src/components/Card/Card.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\nimport React from 'react';\nimport type { GestureResponderEvent } from 'react-native';\nimport type { CSSObject } from 'styled-components';\nimport { CardSurface } from './CardSurface';\nimport { CardProvider, useVerifyInsideCard } from './CardContext';\nimport { LinkOverlay } from './LinkOverlay';\nimport { CardRoot } from './CardRoot';\nimport type { CardSpacingValueType, LinkOverlayProps } from './types';\nimport { CARD_LINK_OVERLAY_ID } from './constants';\nimport BaseBox from '~components/Box/BaseBox';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport type { DataAnalyticsAttribute, BladeElementRef, TestID } from '~utils/types';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport type { Elevation } from '~tokens/global';\nimport type { BoxProps } from '~components/Box';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { useVerifyAllowedChildren } from '~utils/useVerifyAllowedChildren/useVerifyAllowedChildren';\nimport type { Platform } from '~utils';\nimport { isReactNative, useTheme } from '~utils';\nimport type { Theme } from '~components/BladeProvider';\nimport type { DotNotationToken } from '~utils/lodashButBetter/get';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\nimport { useCheckboxGroupContext } from '~components/Checkbox/CheckboxGroup/CheckboxGroupContext';\nimport { useRadioGroupContext } from '~components/Radio/RadioGroup/RadioContext';\nimport type { CheckboxGroupContextType } from '~components/Checkbox/CheckboxGroup/CheckboxGroupContext';\nimport type { RadioGroupContextType } from '~components/Radio/RadioGroup/RadioContext';\n\nexport const ComponentIds = {\n CardHeader: 'CardHeader',\n CardHeaderTrailing: 'CardHeaderTrailing',\n CardHeaderLeading: 'CardHeaderLeading',\n CardFooter: 'CardFooter',\n CardFooterTrailing: 'CardFooterTrailing',\n CardFooterLeading: 'CardFooterLeading',\n CardBody: 'CardBody',\n CardHeaderIcon: 'CardHeaderIcon',\n CardHeaderCounter: 'CardHeaderCounter',\n CardHeaderBadge: 'CardHeaderBadge',\n CardHeaderAmount: 'CardHeaderAmount',\n CardHeaderText: 'CardHeaderText',\n CardHeaderLink: 'CardHeaderLink',\n CardHeaderIconButton: 'CardHeaderIconButton',\n};\n\ntype CardSurfaceBackgroundColors = `surface.background.gray.${DotNotationToken<\n Theme['colors']['surface']['background']['gray']\n>}`;\n\nexport type CardProps = {\n /**\n * Card contents\n */\n children: React.ReactNode;\n /**\n * Sets the background color of the Card\n *\n * @default `surface.background.gray.intense`\n *\n * @deprecated The `backgroundColor` prop is deprecated and is a no-op. The Card always uses `surface.background.gray.intense`. This prop will be removed in a future major version.\n */\n backgroundColor?: CardSurfaceBackgroundColors;\n /**\n * Sets the border radius of the Card\n *\n * @default `medium`\n *\n * @deprecated The `borderRadius` prop is deprecated and is a no-op. The Card always uses `medium` borderRadius. This prop will be removed in a future major version.\n */\n borderRadius?: Extract<BoxProps['borderRadius'], 'medium' | 'large' | 'xlarge'>;\n /**\n * Sets the elevation for Cards\n *\n * **Links:**\n * - Docs: https://blade.razorpay.com/?path=/docs/tokens-elevation--docs\n *\n * @deprecated The `elevation` prop is deprecated and is a no-op. The Card always uses a custom elevation. This prop will be removed in a future major version.\n */\n elevation?: keyof Elevation;\n /**\n * Sets the padding equally on all sides. Only few `spacing` tokens are allowed deliberately\n * @default `spacing.7`\n *\n * **Links:**\n * - Docs: https://blade.razorpay.com/?path=/docs/tokens-spacing--docs\n */\n padding?: CardSpacingValueType;\n /**\n * Sets the width of the card\n */\n width?: BoxProps['width'];\n /**\n * Sets the height of the card\n */\n height?: BoxProps['height'];\n /**\n * Sets minimum height of the card\n */\n minHeight?: BoxProps['minHeight'];\n /**\n * Sets minimum width of the card\n */\n minWidth?: BoxProps['minWidth'];\n /**\n * Sets maximum width of the card\n */\n maxWidth?: BoxProps['maxWidth'];\n /**\n * If `true`, the card will be in selected state\n * Card will have a primary color border around it.\n *\n * @default false\n */\n isSelected?: boolean;\n /**\n * Makes the Card linkable by setting the `href` prop\n *\n * @default undefined\n */\n href?: string;\n /**\n * Sets the `target` attribute for the linkable card\n */\n target?: string;\n /**\n * Sets the `rel` attribute for the linkable card\n */\n rel?: string;\n /**\n * Sets the accessibility label for the card\n * This is useful when the card has an `href` or `onClick` prop\n * Setting this will announce the label when the card is focused\n */\n accessibilityLabel?: string;\n /**\n * If `true`, the card will scale up on hover\n *\n * On mobile devices it will scale down on press\n *\n * **This prop is deprecated in favour of motion presets released in v12**\n *\n * ### Migration\n *\n * ```diff\n * - <Card\n * - shouldScaleOnHover\n * - />\n *\n * + <Scale motionTriggers={['hover']}>\n * + <Card />\n * + </Scale>\n * ```\n *\n * @default false\n *\n * @deprecated This prop is deprecated in favour of motion presets released in v12\n */\n shouldScaleOnHover?: boolean;\n /**\n * Callback triggered when the card is hovered\n */\n onHover?: () => void;\n /**\n * Sets the size of the card header title\n *\n * @default 'large'\n */\n size?: 'large' | 'medium';\n /**\n * Callback triggered when the card is clicked\n */\n onClick?: (\n event: Platform.Select<{\n web: React.MouseEvent;\n native: GestureResponderEvent;\n }>,\n ) => void;\n /**\n * Sets the HTML element for the Card\n *\n * When `as` is set to `label`, the card will be rendered as a label element\n * This can be used to create a custom checkbox or radio button using the card\n *\n * @default undefined\n */\n as?: 'label';\n cursor?: Platform.Select<{\n web: CSSObject['cursor'];\n native: undefined;\n }>;\n opacity?: BoxProps['opacity'];\n transition?: BoxProps['transition'];\n flexShrink?: BoxProps['flexShrink'];\n} & TestID &\n DataAnalyticsAttribute &\n StyledPropsBlade;\n\nconst _Card: React.ForwardRefRenderFunction<BladeElementRef, CardProps> = (\n {\n children,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n backgroundColor,\n borderRadius = 'medium',\n elevation = 'lowRaised',\n testID,\n padding = 'spacing.7',\n width,\n height,\n minHeight,\n minWidth,\n maxWidth,\n onClick,\n isSelected = false,\n accessibilityLabel,\n shouldScaleOnHover = false,\n onHover,\n href,\n target,\n rel,\n as,\n size = 'large',\n cursor,\n opacity,\n transition,\n flexShrink,\n ...rest\n },\n ref,\n): React.ReactElement => {\n const [isFocused, setIsFocused] = React.useState(false);\n const { colorScheme } = useTheme();\n\n useVerifyAllowedChildren({\n children,\n componentName: 'Card',\n allowedComponents: [ComponentIds.CardHeader, ComponentIds.CardBody, ComponentIds.CardFooter],\n });\n\n const linkOverlayProps: LinkOverlayProps = {\n ...metaAttribute({ name: CARD_LINK_OVERLAY_ID }),\n ...makeAccessible({ label: accessibilityLabel, pressed: href ? undefined : isSelected }),\n onFocus: () => {\n setIsFocused(true);\n },\n onBlur: () => {\n setIsFocused(false);\n },\n };\n const defaultRel = target && target === '_blank' ? 'noreferrer noopener' : undefined;\n\n const checkboxGroupProps = useCheckboxGroupContext();\n const radioGroupProps = useRadioGroupContext();\n\n const getGroupProps = (): CheckboxGroupContextType | RadioGroupContextType | undefined => {\n if (Object.keys(checkboxGroupProps).length > 0) return checkboxGroupProps;\n if (Object.keys(radioGroupProps).length > 0) return radioGroupProps;\n return undefined;\n };\n\n const groupProps = getGroupProps();\n\n const _validationState = groupProps?.validationState;\n\n return (\n <CardProvider size={size}>\n <CardRoot\n as={as}\n ref={ref as never}\n display={'block' as never}\n borderRadius=\"medium\"\n onMouseEnter={onHover as never}\n shouldScaleOnHover={shouldScaleOnHover}\n isSelected={isSelected}\n isFocused={isFocused}\n // on react native we need to pass onClick to root, because we don't need the LinkOverlay in RN\n onClick={isReactNative() ? onClick : undefined}\n width={width}\n height={height}\n minHeight={minHeight}\n minWidth={minWidth}\n maxWidth={maxWidth}\n href={href}\n accessibilityLabel={accessibilityLabel}\n validationState={_validationState}\n cursor={isReactNative() ? undefined : cursor}\n opacity={opacity}\n transition={transition}\n flexShrink={flexShrink}\n {...metaAttribute({ name: MetaConstants.Card, testID })}\n {...getStyledProps(rest)}\n {...makeAnalyticsAttribute(rest)}\n >\n <CardSurface\n height={height}\n minHeight={minHeight}\n padding={padding}\n borderRadius=\"medium\"\n textAlign={'left' as never}\n backgroundColor=\"surface.background.gray.intense\"\n colorScheme={colorScheme}\n isSelected={isSelected}\n >\n {href ? (\n <LinkOverlay\n onClick={onClick}\n href={href}\n target={target}\n rel={rel ?? defaultRel}\n {...linkOverlayProps}\n />\n ) : null}\n {!href && onClick ? (\n <LinkOverlay as=\"button\" onClick={onClick} {...linkOverlayProps} />\n ) : null}\n {children}\n </CardSurface>\n </CardRoot>\n </CardProvider>\n );\n};\n\ntype CardBodyProps = {\n children: React.ReactNode;\n height?: BoxProps['height'];\n} & TestID &\n DataAnalyticsAttribute;\n\nconst _CardBody = ({ height, children, testID, ...rest }: CardBodyProps): React.ReactElement => {\n useVerifyInsideCard('CardBody');\n\n return (\n <BaseBox\n {...metaAttribute({ name: MetaConstants.CardBody, testID })}\n {...makeAnalyticsAttribute(rest)}\n height={height}\n >\n {children}\n </BaseBox>\n );\n};\n\nconst Card = React.forwardRef(_Card);\nconst CardBody = assignWithoutSideEffects(_CardBody, { componentId: ComponentIds.CardBody });\n\nexport { Card, CardBody };\n"],"names":["ComponentIds","CardHeader","CardHeaderTrailing","CardHeaderLeading","CardFooter","CardFooterTrailing","CardFooterLeading","CardBody","CardHeaderIcon","CardHeaderCounter","CardHeaderBadge","CardHeaderAmount","CardHeaderText","CardHeaderLink","CardHeaderIconButton","_Card","_ref","ref","children","backgroundColor","_ref$borderRadius","borderRadius","_ref$elevation","elevation","testID","_ref$padding","padding","width","height","minHeight","minWidth","maxWidth","onClick","_ref$isSelected","isSelected","accessibilityLabel","_ref$shouldScaleOnHov","shouldScaleOnHover","onHover","href","target","rel","as","_ref$size","size","cursor","opacity","transition","flexShrink","rest","_objectWithoutProperties","_excluded","_React$useState","React","useState","_React$useState2","_slicedToArray","isFocused","setIsFocused","_useTheme","useTheme","colorScheme","useVerifyAllowedChildren","componentName","allowedComponents","linkOverlayProps","_objectSpread","metaAttribute","name","CARD_LINK_OVERLAY_ID","makeAccessible","label","pressed","undefined","onFocus","onBlur","defaultRel","checkboxGroupProps","useCheckboxGroupContext","radioGroupProps","useRadioGroupContext","getGroupProps","Object","keys","length","groupProps","_validationState","validationState","_jsx","CardProvider","CardRoot","display","onMouseEnter","isReactNative","MetaConstants","Card","getStyledProps","makeAnalyticsAttribute","_jsxs","CardSurface","textAlign","LinkOverlay","_CardBody","_ref2","_excluded2","useVerifyInsideCard","BaseBox","forwardRef","assignWithoutSideEffects","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BO,IAAMA,YAAY,GAAG;AAC1BC,EAAAA,UAAU,EAAE,YAAY;AACxBC,EAAAA,kBAAkB,EAAE,o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A3E3E,MAAM,GAAA2E,KAAA,CAAN3E,MAAM;IAAEV,QAAQ,GAAAqF,KAAA,CAARrF,QAAQ;IAAEM,MAAM,GAAA+E,KAAA,CAAN/E,MAAM;AAAKyB,IAAAA,IAAI,GAAAC,wBAAA,CAAAqD,KAAA,EAAAC,UAAA,CAAA,CAAA;EACpDC,mBAAmB,CAAC,UAAU,CAAC,CAAA;EAE/B,oBACEjB,GAAA,CAACkB,OAAO,EAAAxC,aAAA,CAAAA,aAAA,CAAAA,aAAA,CACFC,EAAAA,EAAAA,aAAa,CAAC;IAAEC,IAAI,EAAE0B,aAAa,CAACvF,QAAQ;AAAEiB,IAAAA,MAAM,EAANA,MAAAA;AAAO,GAAC,CAAC,CAAA,EACvDyE,sBAAsB,CAAChD,IAAI,CAAC,CAAA,EAAA,EAAA,EAAA;AAChCrB,IAAAA,MAAM,EAAEA,MAAO;AAAAV,IAAAA,QAAA,EAEdA,QAAAA;AAAQ,GAAA,CACF,CAAC,CAAA;AAEd,CAAC,CAAA;AAED,IAAM6E,IAAI,gBAAG1C,cAAK,CAACsD,UAAU,CAAC5F,KAAK,EAAC;AACpC,IAAMR,QAAQ,gBAAGqG,wBAAwB,CAACN,SAAS,EAAE;EAAEO,WAAW,EAAE7G,YAAY,CAACO,QAAAA;AAAS,CAAC;;;;"}
1
+ {"version":3,"file":"Card.js","sources":["../../../../../../src/components/Card/Card.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\nimport React from 'react';\nimport type { GestureResponderEvent } from 'react-native';\nimport type { CSSObject } from 'styled-components';\nimport { CardSurface } from './CardSurface';\nimport { CardProvider, useVerifyInsideCard } from './CardContext';\nimport { LinkOverlay } from './LinkOverlay';\nimport { CardRoot } from './CardRoot';\nimport type { CardSpacingValueType, LinkOverlayProps } from './types';\nimport { CARD_LINK_OVERLAY_ID } from './constants';\nimport BaseBox from '~components/Box/BaseBox';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport type { DataAnalyticsAttribute, BladeElementRef, TestID } from '~utils/types';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport type { Elevation } from '~tokens/global';\nimport type { BoxProps } from '~components/Box';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { useVerifyAllowedChildren } from '~utils/useVerifyAllowedChildren/useVerifyAllowedChildren';\nimport type { Platform } from '~utils';\nimport { isReactNative, useTheme } from '~utils';\nimport type { Theme } from '~components/BladeProvider';\nimport type { DotNotationToken } from '~utils/lodashButBetter/get';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\nimport { useCheckboxGroupContext } from '~components/Checkbox/CheckboxGroup/CheckboxGroupContext';\nimport { useRadioGroupContext } from '~components/Radio/RadioGroup/RadioContext';\nimport type { CheckboxGroupContextType } from '~components/Checkbox/CheckboxGroup/CheckboxGroupContext';\nimport type { RadioGroupContextType } from '~components/Radio/RadioGroup/RadioContext';\n\nexport const ComponentIds = {\n CardHeader: 'CardHeader',\n CardHeaderTrailing: 'CardHeaderTrailing',\n CardHeaderLeading: 'CardHeaderLeading',\n CardFooter: 'CardFooter',\n CardFooterTrailing: 'CardFooterTrailing',\n CardFooterLeading: 'CardFooterLeading',\n CardBody: 'CardBody',\n CardHeaderIcon: 'CardHeaderIcon',\n CardHeaderCounter: 'CardHeaderCounter',\n CardHeaderBadge: 'CardHeaderBadge',\n CardHeaderAmount: 'CardHeaderAmount',\n CardHeaderText: 'CardHeaderText',\n CardHeaderLink: 'CardHeaderLink',\n CardHeaderIconButton: 'CardHeaderIconButton',\n};\n\ntype CardSurfaceBackgroundColors = `surface.background.gray.${DotNotationToken<\n Theme['colors']['surface']['background']['gray']\n>}`;\n\nexport type CardProps = {\n /**\n * Card contents\n */\n children: React.ReactNode;\n /**\n * Sets the background color of the Card\n *\n * @default `surface.background.gray.intense`\n *\n * @deprecated The `backgroundColor` prop is deprecated and is a no-op. The Card always uses `surface.background.gray.intense`. This prop will be removed in a future major version.\n */\n backgroundColor?: CardSurfaceBackgroundColors;\n /**\n * Sets the border radius of the Card\n *\n * @default `medium`\n *\n * @deprecated The `borderRadius` prop is deprecated and is a no-op. The Card always uses `medium` borderRadius. This prop will be removed in a future major version.\n */\n borderRadius?: Extract<BoxProps['borderRadius'], 'medium' | 'large' | 'xlarge'>;\n /**\n * Sets the elevation for Cards\n *\n * **Links:**\n * - Docs: https://blade.razorpay.com/?path=/docs/tokens-elevation--docs\n *\n * @deprecated The `elevation` prop is deprecated and is a no-op. The Card always uses a custom elevation. This prop will be removed in a future major version.\n */\n elevation?: keyof Elevation;\n /**\n * Sets the padding equally on all sides. Only few `spacing` tokens are allowed deliberately\n * @default `spacing.7`\n *\n * **Links:**\n * - Docs: https://blade.razorpay.com/?path=/docs/tokens-spacing--docs\n */\n padding?: CardSpacingValueType;\n /**\n * Sets the width of the card\n */\n width?: BoxProps['width'];\n /**\n * Sets the height of the card\n */\n height?: BoxProps['height'];\n /**\n * Sets minimum height of the card\n */\n minHeight?: BoxProps['minHeight'];\n /**\n * Sets minimum width of the card\n */\n minWidth?: BoxProps['minWidth'];\n /**\n * Sets maximum width of the card\n */\n maxWidth?: BoxProps['maxWidth'];\n /**\n * If `true`, the card will be in selected state\n * Card will have a primary color border around it.\n *\n * @default false\n */\n isSelected?: boolean;\n /**\n * Makes the Card linkable by setting the `href` prop\n *\n * @default undefined\n */\n href?: string;\n /**\n * Sets the `target` attribute for the linkable card\n */\n target?: string;\n /**\n * Sets the `rel` attribute for the linkable card\n */\n rel?: string;\n /**\n * Sets the accessibility label for the card\n * This is useful when the card has an `href` or `onClick` prop\n * Setting this will announce the label when the card is focused\n */\n accessibilityLabel?: string;\n /**\n * If `true`, the card will scale up on hover\n *\n * On mobile devices it will scale down on press\n *\n * **This prop is deprecated in favour of motion presets released in v12**\n *\n * ### Migration\n *\n * ```diff\n * - <Card\n * - shouldScaleOnHover\n * - />\n *\n * + <Scale motionTriggers={['hover']}>\n * + <Card />\n * + </Scale>\n * ```\n *\n * @default false\n *\n * @deprecated This prop is deprecated in favour of motion presets released in v12\n */\n shouldScaleOnHover?: boolean;\n /**\n * Callback triggered when the card is hovered\n */\n onHover?: () => void;\n /**\n * Sets the size of the card header title\n *\n * @default 'large'\n */\n size?: 'large' | 'medium';\n /**\n * Callback triggered when the card is clicked\n */\n onClick?: (\n event: Platform.Select<{\n web: React.MouseEvent;\n native: GestureResponderEvent;\n }>,\n ) => void;\n /**\n * Sets the HTML element for the Card\n *\n * When `as` is set to `label`, the card will be rendered as a label element\n * This can be used to create a custom checkbox or radio button using the card\n *\n * @default undefined\n */\n as?: 'label';\n cursor?: Platform.Select<{\n web: CSSObject['cursor'];\n native: undefined;\n }>;\n opacity?: BoxProps['opacity'];\n transition?: BoxProps['transition'];\n flexShrink?: BoxProps['flexShrink'];\n /**\n * Sets the overflow behavior of the card content\n */\n overflow?: BoxProps['overflow'];\n /**\n * Sets the horizontal overflow behavior of the card content\n */\n overflowX?: BoxProps['overflowX'];\n /**\n * Sets the vertical overflow behavior of the card content\n */\n overflowY?: BoxProps['overflowY'];\n} & TestID &\n DataAnalyticsAttribute &\n StyledPropsBlade;\n\nconst _Card: React.ForwardRefRenderFunction<BladeElementRef, CardProps> = (\n {\n children,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n backgroundColor,\n borderRadius = 'medium',\n elevation = 'lowRaised',\n testID,\n padding = 'spacing.7',\n width,\n height,\n minHeight,\n minWidth,\n maxWidth,\n onClick,\n isSelected = false,\n accessibilityLabel,\n shouldScaleOnHover = false,\n onHover,\n href,\n target,\n rel,\n as,\n size = 'large',\n cursor,\n opacity,\n transition,\n flexShrink,\n overflow,\n overflowX,\n overflowY,\n ...rest\n },\n ref,\n): React.ReactElement => {\n const [isFocused, setIsFocused] = React.useState(false);\n const { colorScheme } = useTheme();\n\n useVerifyAllowedChildren({\n children,\n componentName: 'Card',\n allowedComponents: [ComponentIds.CardHeader, ComponentIds.CardBody, ComponentIds.CardFooter],\n });\n\n const linkOverlayProps: LinkOverlayProps = {\n ...metaAttribute({ name: CARD_LINK_OVERLAY_ID }),\n ...makeAccessible({ label: accessibilityLabel, pressed: href ? undefined : isSelected }),\n onFocus: () => {\n setIsFocused(true);\n },\n onBlur: () => {\n setIsFocused(false);\n },\n };\n const defaultRel = target && target === '_blank' ? 'noreferrer noopener' : undefined;\n\n const checkboxGroupProps = useCheckboxGroupContext();\n const radioGroupProps = useRadioGroupContext();\n\n const getGroupProps = (): CheckboxGroupContextType | RadioGroupContextType | undefined => {\n if (Object.keys(checkboxGroupProps).length > 0) return checkboxGroupProps;\n if (Object.keys(radioGroupProps).length > 0) return radioGroupProps;\n return undefined;\n };\n\n const groupProps = getGroupProps();\n\n const _validationState = groupProps?.validationState;\n\n return (\n <CardProvider size={size}>\n <CardRoot\n as={as}\n ref={ref as never}\n display={'block' as never}\n borderRadius=\"medium\"\n onMouseEnter={onHover as never}\n shouldScaleOnHover={shouldScaleOnHover}\n isSelected={isSelected}\n isFocused={isFocused}\n // on react native we need to pass onClick to root, because we don't need the LinkOverlay in RN\n onClick={isReactNative() ? onClick : undefined}\n width={width}\n height={height}\n minHeight={minHeight}\n minWidth={minWidth}\n maxWidth={maxWidth}\n href={href}\n accessibilityLabel={accessibilityLabel}\n validationState={_validationState}\n cursor={isReactNative() ? undefined : cursor}\n opacity={opacity}\n transition={transition}\n flexShrink={flexShrink}\n {...metaAttribute({ name: MetaConstants.Card, testID })}\n {...getStyledProps(rest)}\n {...makeAnalyticsAttribute(rest)}\n >\n <CardSurface\n height={height}\n minHeight={minHeight}\n padding={padding}\n borderRadius=\"medium\"\n textAlign={'left' as never}\n backgroundColor=\"surface.background.gray.intense\"\n colorScheme={colorScheme}\n isSelected={isSelected}\n overflow={overflow}\n overflowX={overflowX}\n overflowY={overflowY}\n >\n {href ? (\n <LinkOverlay\n onClick={onClick}\n href={href}\n target={target}\n rel={rel ?? defaultRel}\n {...linkOverlayProps}\n />\n ) : null}\n {!href && onClick ? (\n <LinkOverlay as=\"button\" onClick={onClick} {...linkOverlayProps} />\n ) : null}\n {children}\n </CardSurface>\n </CardRoot>\n </CardProvider>\n );\n};\n\ntype CardBodyProps = {\n children: React.ReactNode;\n height?: BoxProps['height'];\n} & TestID &\n DataAnalyticsAttribute;\n\nconst _CardBody = ({ height, children, testID, ...rest }: CardBodyProps): React.ReactElement => {\n useVerifyInsideCard('CardBody');\n\n return (\n <BaseBox\n {...metaAttribute({ name: MetaConstants.CardBody, testID })}\n {...makeAnalyticsAttribute(rest)}\n height={height}\n >\n {children}\n </BaseBox>\n );\n};\n\nconst Card = React.forwardRef(_Card);\nconst CardBody = assignWithoutSideEffects(_CardBody, { componentId: ComponentIds.CardBody });\n\nexport { Card, CardBody };\n"],"names":["ComponentIds","CardHeader","CardHeaderTrailing","CardHeaderLeading","CardFooter","CardFooterTrailing","CardFooterLeading","CardBody","CardHeaderIcon","CardHeaderCounter","CardHeaderBadge","CardHeaderAmount","CardHeaderText","CardHeaderLink","CardHeaderIconButton","_Card","_ref","ref","children","backgroundColor","_ref$borderRadius","borderRadius","_ref$elevation","elevation","testID","_ref$padding","padding","width","height","minHeight","minWidth","maxWidth","onClick","_ref$isSelected","isSelected","accessibilityLabel","_ref$shouldScaleOnHov","shouldScaleOnHover","onHover","href","target","rel","as","_ref$size","size","cursor","opacity","transition","flexShrink","overflow","overflowX","overflowY","rest","_objectWithoutProperties","_excluded","_React$useState","React","useState","_React$useState2","_slicedToArray","isFocused","setIsFocused","_useTheme","useTheme","colorScheme","useVerifyAllowedChildren","componentName","allowedComponents","linkOverlayProps","_objectSpread","metaAttribute","name","CARD_LINK_OVERLAY_ID","makeAccessible","label","pressed","undefined","onFocus","onBlur","defaultRel","checkboxGroupProps","useCheckboxGroupContext","radioGroupProps","useRadioGroupContext","getGroupProps","Object","keys","length","groupProps","_validationState","validationState","_jsx","CardProvider","CardRoot","display","onMouseEnter","isReactNative","MetaConstants","Card","getStyledProps","makeAnalyticsAttribute","_jsxs","CardSurface","textAlign","LinkOverlay","_CardBody","_ref2","_excluded2","useVerifyInsideCard","BaseBox","forwardRef","assignWithoutSideEffects","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BO,IAAMA,YAAY,GAAG;AAC1BC,EAAAA,UAAU,EAAE,YAAY;AACxBC,EAAAA,kBAAkB,EAAE,oBAAoB;AACxCC,EAAAA,iBAAiB,EAAE,mBAAmB;AACtCC,EAAAA,UAAU,EAAE,YAAY;AACxBC,EAAAA,kBAAkB,EAAE,oBAAoB;AACxCC,EAAAA,iBAAiB,EAAE,mBAAmB;AACtCC,EAAAA,QAAQ,EAAE,UAAU;AACpBC,EAAAA,cAAc,EAAE,gBAAgB;AAChCC,EAAAA,iBAAiB,EAAE,mBAAmB;AACtCC,EAAAA,eAAe,EAAE,iBAAiB;AAClCC,EAAAA,gBAAgB,EAAE,kBAAkB;AACpCC,EAAAA,cAAc,EAAE,gBAAgB;AAChCC,EAAAA,cAAc,EAAE,gBAAgB;AAChCC,EAAAA,oBAAoB,EAAE,sBAAA;AACxB,EAAC;AAsKD,IAAMC,KAAiE,GAAG,SAApEA,KAAiEA,CAAAC,IAAA,EAiCrEC,GAAG,EACoB;AAAA,EAAA,IAhCrBC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;IAERC,eAAe,GAAAH,IAAA,CAAfG,eAAe;IAAAC,iBAAA,GAAAJ,IAAA,CACfK,YAAY;AAAZA,IAAAA,YAAY,GAAAD,iBAAA,KAAG,KAAA,CAAA,GAAA,QAAQ,GAAAA,iBAAA;IAAAE,cAAA,GAAAN,IAAA,CACvBO,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAG,KAAA,CAAA,GAAA,WAAW,GAAAA,cAAA;IACvBE,MAAM,GAAAR,IAAA,CAANQ,MAAM;IAAAC,YAAA,GAAAT,IAAA,CACNU,OAAO;AAAPA,IAAAA,OAAO,GAAAD,YAAA,KAAG,KAA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EAAEO,WAAW,EAAEhH,YAAY,CAACO,QAAAA;AAAS,CAAC;;;;"}
@@ -137,7 +137,6 @@ var _DropdownOverlay = function _DropdownOverlay(_ref) {
137
137
  children: /*#__PURE__*/jsx(StyledDropdownOverlay, _objectSpread(_objectSpread(_objectSpread({
138
138
  isInBottomSheet: bottomSheetAndDropdownGlue === null || bottomSheetAndDropdownGlue === void 0 ? void 0 : bottomSheetAndDropdownGlue.dropdownHasBottomSheet,
139
139
  colorScheme: colorScheme,
140
- elevation: bottomSheetAndDropdownGlue !== null && bottomSheetAndDropdownGlue !== void 0 && bottomSheetAndDropdownGlue.dropdownHasBottomSheet ? undefined : 'midRaised',
141
140
  style: _objectSpread({}, styles),
142
141
  width: width ? width : '100%',
143
142
  minWidth: minWidth,
@@ -1 +1 @@
1
- {"version":3,"file":"DropdownOverlay.web.js","sources":["../../../../../../src/components/Dropdown/DropdownOverlay.web.tsx"],"sourcesContent":["import React from 'react';\nimport {\n autoUpdate,\n offset,\n size as sizeMiddleware,\n useFloating,\n useTransitionStyles,\n flip,\n FloatingPortal,\n useDismiss,\n useInteractions,\n} from '@floating-ui/react';\nimport { useDropdown } from './useDropdown';\nimport { StyledDropdownOverlay } from './StyledDropdownOverlay';\nimport type { DropdownOverlayProps } from './types';\nimport { dropdownComponentIds } from './dropdownComponentIds';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { makeSize } from '~utils';\nimport { size } from '~tokens/global';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\nimport { useTheme } from '~components/BladeProvider';\nimport { TopNavOverlayThemeOverride } from '~components/TopNav/TopNavOverlayThemeOverride';\n// Reading directly because its not possible to get theme object on top level to be used in keyframes\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { useBottomSheetAndDropdownGlue } from '~components/BottomSheet/BottomSheetContext';\nimport BaseBox from '~components/Box/BaseBox';\nimport { componentZIndices } from '~utils/componentZIndices';\nimport { OVERLAY_OFFSET, OVERLAY_TRANSITION_OFFSET } from '~components/BaseMenu/tokens';\nimport { OverlayContextReset } from '~components/OverlayContextReset';\n\nconst OVERLAY_PADDING: number = size['12']; // doesn't have to be exact. Just rough padding for floating ui to decide to show overlay on top or bottom\n\n/**\n * Overlay of dropdown\n *\n * Wrap your ActionList within this component\n */\nconst _DropdownOverlay = ({\n children,\n testID,\n zIndex = componentZIndices.dropdownOverlay,\n width,\n minWidth,\n maxWidth,\n referenceRef,\n defaultPlacement = 'bottom-start',\n _isNestedDropdown = false,\n ...dataAnalyticsProps\n}: DropdownOverlayProps): React.ReactElement | null => {\n const { isOpen, triggererRef, triggererWrapperRef, dropdownTriggerer, setIsOpen } = useDropdown();\n const { theme, colorScheme } = useTheme();\n const bottomSheetAndDropdownGlue = useBottomSheetAndDropdownGlue();\n\n const isMenu =\n (dropdownTriggerer !== dropdownComponentIds.triggers.SelectInput &&\n dropdownTriggerer !== dropdownComponentIds.triggers.SearchInput &&\n dropdownTriggerer !== dropdownComponentIds.triggers.AutoComplete &&\n referenceRef == undefined) ||\n _isNestedDropdown;\n\n const { refs, floatingStyles, context } = useFloating({\n open: isOpen,\n onOpenChange: setIsOpen,\n strategy: 'fixed',\n placement: defaultPlacement,\n elements: {\n // Input triggers have their ref on internal input element but we want width height of overall visible input hence wrapperRef is needed\n // We fallback to use `triggererRef` for triggers like button and link where wrapper is not needed\n // Checkout: https://github.com/razorpay/blade/pull/1559#discussion_r1305438920\n reference: (referenceRef?.current ??\n triggererWrapperRef.current ??\n triggererRef.current) as Element,\n },\n middleware: [\n offset({\n mainAxis: OVERLAY_OFFSET,\n }),\n flip({\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n padding: OVERLAY_OFFSET + OVERLAY_PADDING,\n }),\n sizeMiddleware({\n apply({ rects, elements }) {\n const overlayWidth = isMenu ? undefined : makeSize(rects.reference.width);\n const overlayMinWidth = isMenu ? makeSize(size['240']) : undefined;\n const overlayMaxWidth = isMenu ? makeSize(size['400']) : undefined;\n\n Object.assign(elements.floating.style, {\n // in menu, we have flexible width between min and max\n // in input triggers, we just take width of trigger\n width: width ?? overlayWidth,\n minWidth: minWidth ?? overlayMinWidth,\n maxWidth: maxWidth ?? overlayMaxWidth,\n });\n },\n }),\n ],\n whileElementsMounted: autoUpdate,\n });\n\n const dismiss = useDismiss(context);\n const { getFloatingProps } = useInteractions([dismiss]);\n\n const { isMounted, styles } = useTransitionStyles(context, {\n duration: theme.motion.duration.quick,\n initial: () => ({\n transform: `translateY(-${makeSize(OVERLAY_TRANSITION_OFFSET)})`,\n opacity: 0,\n }),\n });\n\n React.useEffect(() => {\n if (isOpen) {\n // On Safari clicking on a non input element doesn't focuses it https://bugs.webkit.org/show_bug.cgi?id=22261\n triggererRef.current?.focus();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isOpen]);\n\n return (\n <FloatingPortal>\n <TopNavOverlayThemeOverride>\n <OverlayContextReset>\n <BaseBox\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref={refs.setFloating as any}\n style={floatingStyles}\n zIndex={zIndex}\n display={isMounted ? 'flex' : 'none'}\n {...getFloatingProps()}\n >\n <StyledDropdownOverlay\n isInBottomSheet={bottomSheetAndDropdownGlue?.dropdownHasBottomSheet}\n colorScheme={colorScheme}\n elevation={\n bottomSheetAndDropdownGlue?.dropdownHasBottomSheet ? undefined : 'midRaised'\n }\n style={{ ...styles }}\n width={width ? width : '100%'}\n minWidth={minWidth}\n maxWidth={maxWidth}\n {...metaAttribute({ name: MetaConstants.DropdownOverlay, testID })}\n {...makeAnalyticsAttribute(dataAnalyticsProps)}\n >\n {children}\n </StyledDropdownOverlay>\n </BaseBox>\n </OverlayContextReset>\n </TopNavOverlayThemeOverride>\n </FloatingPortal>\n );\n};\n\nconst DropdownOverlay = assignWithoutSideEffects(_DropdownOverlay, {\n componentId: dropdownComponentIds.DropdownOverlay,\n});\n\nexport { DropdownOverlay };\n"],"names":["OVERLAY_PADDING","size","_DropdownOverlay","_ref","_ref2","_referenceRef$current","children","testID","_ref$zIndex","zIndex","componentZIndices","dropdownOverlay","width","minWidth","maxWidth","referenceRef","_ref$defaultPlacement","defaultPlacement","_ref$_isNestedDropdow","_isNestedDropdown","dataAnalyticsProps","_objectWithoutProperties","_excluded","_useDropdown","useDropdown","isOpen","triggererRef","triggererWrapperRef","dropdownTriggerer","setIsOpen","_useTheme","useTheme","theme","colorScheme","bottomSheetAndDropdownGlue","useBottomSheetAndDropdownGlue","isMenu","dropdownComponentIds","triggers","SelectInput","SearchInput","AutoComplete","undefined","_useFloating","useFloating","open","onOpenChange","strategy","placement","elements","reference","current","middleware","offset","mainAxis","OVERLAY_OFFSET","flip","padding","sizeMiddleware","apply","_ref3","rects","overlayWidth","makeSize","overlayMinWidth","overlayMaxWidth","Object","assign","floating","style","whileElementsMounted","autoUpdate","refs","floatingStyles","context","dismiss","useDismiss","_useInteractions","useInteractions","getFloatingProps","_useTransitionStyles","useTransitionStyles","duration","motion","quick","initial","transform","concat","OVERLAY_TRANSITION_OFFSET","opacity","isMounted","styles","React","useEffect","_triggererRef$current","focus","_jsx","FloatingPortal","TopNavOverlayThemeOverride","OverlayContextReset","BaseBox","_objectSpread","ref","setFloating","display","StyledDropdownOverlay","isInBottomSheet","dropdownHasBottomSheet","elevation","metaAttribute","name","MetaConstants","DropdownOverlay","makeAnalyticsAttribute","assignWithoutSideEffects","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,IAAMA,eAAuB,GAAGC,IAAI,CAAC,IAAI,CAAC,CAAC;;AAE3C;AACA;AACA;AACA;AACA;AACA,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAAC,IAAA,EAWiC;EAAA,IAAAC,KAAA,EAAAC,qBAAA,CAAA;AAAA,EAAA,IAVrDC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;IACRC,MAAM,GAAAJ,IAAA,CAANI,MAAM;IAAAC,WAAA,GAAAL,IAAA,CACNM,MAAM;AAANA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1BA,0BAA0B,CAAEyE,sBAAsB,GAAGjE,SAAS,GAAG,WAClE;AACD2B,YAAAA,KAAK,EAAAgC,aAAA,CAAOV,EAAAA,EAAAA,MAAM,CAAG;AACrB/E,YAAAA,KAAK,EAAEA,KAAK,GAAGA,KAAK,GAAG,MAAO;AAC9BC,YAAAA,QAAQ,EAAEA,QAAS;AACnBC,YAAAA,QAAQ,EAAEA,QAAAA;AAAS,WAAA,EACf+F,aAAa,CAAC;YAAEC,IAAI,EAAEC,aAAa,CAACC,eAAe;AAAEzG,YAAAA,MAAM,EAANA,MAAAA;AAAO,WAAC,CAAC,CAAA,EAC9D0G,sBAAsB,CAAC7F,kBAAkB,CAAC,CAAA,EAAA,EAAA,EAAA;AAAAd,YAAAA,QAAA,EAE7CA,QAAAA;WACoB,CAAA,CAAA;SAChB,CAAA,CAAA;OACU,CAAA;KACK,CAAA;AAAC,GACf,CAAC,CAAA;AAErB,CAAC,CAAA;AAED,IAAM0G,eAAe,gBAAGE,wBAAwB,CAAChH,gBAAgB,EAAE;EACjEiH,WAAW,EAAE9E,oBAAoB,CAAC2E,eAAAA;AACpC,CAAC;;;;"}
1
+ {"version":3,"file":"DropdownOverlay.web.js","sources":["../../../../../../src/components/Dropdown/DropdownOverlay.web.tsx"],"sourcesContent":["import React from 'react';\nimport {\n autoUpdate,\n offset,\n size as sizeMiddleware,\n useFloating,\n useTransitionStyles,\n flip,\n FloatingPortal,\n useDismiss,\n useInteractions,\n} from '@floating-ui/react';\nimport { useDropdown } from './useDropdown';\nimport { StyledDropdownOverlay } from './StyledDropdownOverlay';\nimport type { DropdownOverlayProps } from './types';\nimport { dropdownComponentIds } from './dropdownComponentIds';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { makeSize } from '~utils';\nimport { size } from '~tokens/global';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\nimport { useTheme } from '~components/BladeProvider';\nimport { TopNavOverlayThemeOverride } from '~components/TopNav/TopNavOverlayThemeOverride';\n// Reading directly because its not possible to get theme object on top level to be used in keyframes\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { useBottomSheetAndDropdownGlue } from '~components/BottomSheet/BottomSheetContext';\nimport BaseBox from '~components/Box/BaseBox';\nimport { componentZIndices } from '~utils/componentZIndices';\nimport { OVERLAY_OFFSET, OVERLAY_TRANSITION_OFFSET } from '~components/BaseMenu/tokens';\nimport { OverlayContextReset } from '~components/OverlayContextReset';\n\nconst OVERLAY_PADDING: number = size['12']; // doesn't have to be exact. Just rough padding for floating ui to decide to show overlay on top or bottom\n\n/**\n * Overlay of dropdown\n *\n * Wrap your ActionList within this component\n */\nconst _DropdownOverlay = ({\n children,\n testID,\n zIndex = componentZIndices.dropdownOverlay,\n width,\n minWidth,\n maxWidth,\n referenceRef,\n defaultPlacement = 'bottom-start',\n _isNestedDropdown = false,\n ...dataAnalyticsProps\n}: DropdownOverlayProps): React.ReactElement | null => {\n const { isOpen, triggererRef, triggererWrapperRef, dropdownTriggerer, setIsOpen } = useDropdown();\n const { theme, colorScheme } = useTheme();\n const bottomSheetAndDropdownGlue = useBottomSheetAndDropdownGlue();\n\n const isMenu =\n (dropdownTriggerer !== dropdownComponentIds.triggers.SelectInput &&\n dropdownTriggerer !== dropdownComponentIds.triggers.SearchInput &&\n dropdownTriggerer !== dropdownComponentIds.triggers.AutoComplete &&\n referenceRef == undefined) ||\n _isNestedDropdown;\n\n const { refs, floatingStyles, context } = useFloating({\n open: isOpen,\n onOpenChange: setIsOpen,\n strategy: 'fixed',\n placement: defaultPlacement,\n elements: {\n // Input triggers have their ref on internal input element but we want width height of overall visible input hence wrapperRef is needed\n // We fallback to use `triggererRef` for triggers like button and link where wrapper is not needed\n // Checkout: https://github.com/razorpay/blade/pull/1559#discussion_r1305438920\n reference: (referenceRef?.current ??\n triggererWrapperRef.current ??\n triggererRef.current) as Element,\n },\n middleware: [\n offset({\n mainAxis: OVERLAY_OFFSET,\n }),\n flip({\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n padding: OVERLAY_OFFSET + OVERLAY_PADDING,\n }),\n sizeMiddleware({\n apply({ rects, elements }) {\n const overlayWidth = isMenu ? undefined : makeSize(rects.reference.width);\n const overlayMinWidth = isMenu ? makeSize(size['240']) : undefined;\n const overlayMaxWidth = isMenu ? makeSize(size['400']) : undefined;\n\n Object.assign(elements.floating.style, {\n // in menu, we have flexible width between min and max\n // in input triggers, we just take width of trigger\n width: width ?? overlayWidth,\n minWidth: minWidth ?? overlayMinWidth,\n maxWidth: maxWidth ?? overlayMaxWidth,\n });\n },\n }),\n ],\n whileElementsMounted: autoUpdate,\n });\n\n const dismiss = useDismiss(context);\n const { getFloatingProps } = useInteractions([dismiss]);\n\n const { isMounted, styles } = useTransitionStyles(context, {\n duration: theme.motion.duration.quick,\n initial: () => ({\n transform: `translateY(-${makeSize(OVERLAY_TRANSITION_OFFSET)})`,\n opacity: 0,\n }),\n });\n\n React.useEffect(() => {\n if (isOpen) {\n // On Safari clicking on a non input element doesn't focuses it https://bugs.webkit.org/show_bug.cgi?id=22261\n triggererRef.current?.focus();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isOpen]);\n\n return (\n <FloatingPortal>\n <TopNavOverlayThemeOverride>\n <OverlayContextReset>\n <BaseBox\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref={refs.setFloating as any}\n style={floatingStyles}\n zIndex={zIndex}\n display={isMounted ? 'flex' : 'none'}\n {...getFloatingProps()}\n >\n <StyledDropdownOverlay\n isInBottomSheet={bottomSheetAndDropdownGlue?.dropdownHasBottomSheet}\n colorScheme={colorScheme}\n style={{ ...styles }}\n width={width ? width : '100%'}\n minWidth={minWidth}\n maxWidth={maxWidth}\n {...metaAttribute({ name: MetaConstants.DropdownOverlay, testID })}\n {...makeAnalyticsAttribute(dataAnalyticsProps)}\n >\n {children}\n </StyledDropdownOverlay>\n </BaseBox>\n </OverlayContextReset>\n </TopNavOverlayThemeOverride>\n </FloatingPortal>\n );\n};\n\nconst DropdownOverlay = assignWithoutSideEffects(_DropdownOverlay, {\n componentId: dropdownComponentIds.DropdownOverlay,\n});\n\nexport { DropdownOverlay };\n"],"names":["OVERLAY_PADDING","size","_DropdownOverlay","_ref","_ref2","_referenceRef$current","children","testID","_ref$zIndex","zIndex","componentZIndices","dropdownOverlay","width","minWidth","maxWidth","referenceRef","_ref$defaultPlacement","defaultPlacement","_ref$_isNestedDropdow","_isNestedDropdown","dataAnalyticsProps","_objectWithoutProperties","_excluded","_useDropdown","useDropdown","isOpen","triggererRef","triggererWrapperRef","dropdownTriggerer","setIsOpen","_useTheme","useTheme","theme","colorScheme","bottomSheetAndDropdownGlue","useBottomSheetAndDropdownGlue","isMenu","dropdownComponentIds","triggers","SelectInput","SearchInput","AutoComplete","undefined","_useFloating","useFloating","open","onOpenChange","strategy","placement","elements","reference","current","middleware","offset","mainAxis","OVERLAY_OFFSET","flip","padding","sizeMiddleware","apply","_ref3","rects","overlayWidth","makeSize","overlayMinWidth","overlayMaxWidth","Object","assign","floating","style","whileElementsMounted","autoUpdate","refs","floatingStyles","context","dismiss","useDismiss","_useInteractions","useInteractions","getFloatingProps","_useTransitionStyles","useTransitionStyles","duration","motion","quick","initial","transform","concat","OVERLAY_TRANSITION_OFFSET","opacity","isMounted","styles","React","useEffect","_triggererRef$current","focus","_jsx","FloatingPortal","TopNavOverlayThemeOverride","OverlayContextReset","BaseBox","_objectSpread","ref","setFloating","display","StyledDropdownOverlay","isInBottomSheet","dropdownHasBottomSheet","metaAttribute","name","MetaConstants","DropdownOverlay","makeAnalyticsAttribute","assignWithoutSideEffects","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,IAAMA,eAAuB,GAAGC,IAAI,CAAC,IAAI,CAAC,CAAC;;AAE3C;AACA;AACA;AACA;AACA;AACA,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAAC,IAAA,EAWiC;EAAA,IAAAC,KAAA,EAAAC,q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GAAAA,0BAA0B,CAAEyE,sBAAuB;AACpE1E,YAAAA,WAAW,EAAEA,WAAY;AACzBoC,YAAAA,KAAK,EAAAgC,aAAA,CAAOV,EAAAA,EAAAA,MAAM,CAAG;AACrB/E,YAAAA,KAAK,EAAEA,KAAK,GAAGA,KAAK,GAAG,MAAO;AAC9BC,YAAAA,QAAQ,EAAEA,QAAS;AACnBC,YAAAA,QAAQ,EAAEA,QAAAA;AAAS,WAAA,EACf8F,aAAa,CAAC;YAAEC,IAAI,EAAEC,aAAa,CAACC,eAAe;AAAExG,YAAAA,MAAM,EAANA,MAAAA;AAAO,WAAC,CAAC,CAAA,EAC9DyG,sBAAsB,CAAC5F,kBAAkB,CAAC,CAAA,EAAA,EAAA,EAAA;AAAAd,YAAAA,QAAA,EAE7CA,QAAAA;WACoB,CAAA,CAAA;SAChB,CAAA,CAAA;OACU,CAAA;KACK,CAAA;AAAC,GACf,CAAC,CAAA;AAErB,CAAC,CAAA;AAED,IAAMyG,eAAe,gBAAGE,wBAAwB,CAAC/G,gBAAgB,EAAE;EACjEgH,WAAW,EAAE7E,oBAAoB,CAAC0E,eAAAA;AACpC,CAAC;;;;"}
@@ -64,6 +64,7 @@ var getInputBackgroundAndBorderStyles = function getInputBackgroundAndBorderStyl
64
64
  return _objectSpread({
65
65
  backgroundColor: backgroundColor,
66
66
  borderRadius: makeBorderSize(isTableInputCell ? theme.border.radius.none : theme.border.radius[borderRadius !== null && borderRadius !== void 0 ? borderRadius : baseInputBorderRadius[size]]),
67
+ overflow: 'hidden',
67
68
  borderStyle: 'solid',
68
69
  display: 'flex',
69
70
  flexDirection: 'row',