1(()=>{var e=globalThis,t={},i={},o=e.parcelRequirea466;null==o&&((o=function(e){if(e in t)return t[e].exports;if(e in i){var o=i[e];delete i[e];var r={id:e,exports:{}};return t[e]=r,o.call(r.exports,r,r.exports),r.exports}var a=Error("Cannot find module '"+e+"'");throw a.code="MODULE_NOT_FOUND",a}).register=function(e,t){i[e]=t},e.parcelRequirea466=o),(0,o.register)("j7tv4",function(e,t){let i;function o(){if(void 0!==i)return i;let e=document.createElement("canvas").getContext("webgl",{failIfMajorPerformanceCaveat:!0});if(!e)return i=!1;let t=e.getExtension("WEBGL_debug_renderer_info"),o=String(e.getParameter(t?t.UNMASKED_RENDERER_WEBGL:e.RENDERER)||"");return e.getExtension("WEBGL_lose_context")?.loseContext(),i=!/swiftshader|llvmpipe|softpipe|software|basic render/i.test(o)}Object.defineProperty(e.exports,"hasGpuWebGL",{get:()=>o,set:void 0,enumerable:!0,configurable:!0})});let r=` 2#define TWO_PI 6.28318530718 3#define PI 3.14159265358979323846 4`,a=` 5 float hash11(float p) { 6 p = fract(p * 0.3183099) + 0.1; 7 p *= p + 19.19; 8 return fract(p * p); 9 } 10`,s=` 11 float hash21(vec2 p) { 12 p = fract(p * vec2(0.3183099, 0.3678794)) + 0.1; 13 p += dot(p, p + 19.19); 14 return fract(p.x * p.y); 15 } 16`,n=` 17vec3 permute(vec3 x) { return mod(((x * 34.0) + 1.0) * x, 289.0); } 18float snoise(vec2 v) { 19 const vec4 C = vec4(0.211324865405187, 0.366025403784439, 20 -0.577350269189626, 0.024390243902439); 21 vec2 i = floor(v + dot(v, C.yy)); 22 vec2 x0 = v - i + dot(i, C.xx); 23 vec2 i1; 24 i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0); 25 vec4 x12 = x0.xyxy + C.xxzz; 26 x12.xy -= i1; 27 i = mod(i, 289.0); 28 vec3 p = permute(permute(i.y + vec3(0.0, i1.y, 1.0)) 29 + i.x + vec3(0.0, i1.x, 1.0)); 30 vec3 m = max(0.5 - vec3(dot(x0, x0), dot(x12.xy, x12.xy), 31 dot(x12.zw, x12.zw)), 0.0); 32 m = m * m; 33 m = m * m; 34 vec3 x = 2.0 * fract(p * C.www) - 1.0; 35 vec3 h = abs(x) - 0.5; 36 vec3 ox = floor(x + 0.5); 37 vec3 a0 = x - ox; 38 m *= 1.79284291400159 - 0.85373472095314 * (a0 * a0 + h * h); 39 vec3 g; 40 g.x = a0.x * x0.x + h.x * x0.y; 41 g.yz = a0.yz * x12.xz + h.yz * x12.yw; 42 return 130.0 * dot(m, g); 43} 44`,l=`#version 300 es 45precision mediump float; 46 47uniform float u_time; 48 49uniform vec2 u_resolution; 50uniform float u_pixelRatio; 51uniform float u_originX; 52uniform float u_originY; 53uniform float u_worldWidth; 54uniform float u_worldHeight; 55uniform float u_fit; 56uniform float u_scale; 57uniform float u_rotation; 58uniform float u_offsetX; 59uniform float u_offsetY; 60 61uniform float u_pxSize; 62uniform vec4 u_colorBack; 63uniform vec4 u_colorFront; 64uniform float u_shape; 65uniform float u_type; 66 67out vec4 fragColor; 68 69${n} 70${r} 71${a} 72${s} 73 74float getSimplexNoise(vec2 uv, float t) { 75 float noise = .5 * snoise(uv - vec2(0., .3 * t)); 76 noise += .5 * snoise(2. * uv + vec2(0., .32 * t)); 77 78 return noise; 79} 80 81const int bayer2x2[4] = int[4](0, 2, 3, 1); 82const int bayer4x4[16] = int[16]( 830, 8, 2, 10, 8412, 4, 14, 6, 853, 11, 1, 9, 8615, 7, 13, 5 87); 88 89const int bayer8x8[64] = int[64]( 900, 32, 8, 40, 2, 34, 10, 42, 9148, 16, 56, 24, 50, 18, 58, 26, 9212, 44, 4, 36, 14, 46, 6, 38, 9360, 28, 52, 20, 62, 30, 54, 22, 943, 35, 11, 43, 1, 33, 9, 41, 9551, 19, 59, 27, 49, 17, 57, 25, 9615, 47, 7, 39, 13, 45, 5, 37, 9763, 31, 55, 23, 61, 29, 53, 21 98); 99 100float getBayerValue(vec2 uv, int size) { 101 ivec2 pos = ivec2(fract(uv / float(size)) * float(size)); 102 int index = pos.y * size + pos.x; 103 104 if (size == 2) { 105 return float(bayer2x2[index]) / 4.0; 106 } else if (size == 4) { 107 return float(bayer4x4[index]) / 16.0; 108 } else if (size == 8) { 109 return float(bayer8x8[index]) / 64.0; 110 } 111 return 0.0; 112} 113 114 115void main() { 116 float t = .5 * u_time; 117 118 float pxSize = u_pxSize * u_pixelRatio; 119 vec2 pxSizeUV = gl_FragCoord.xy - .5 * u_resolution; 120 pxSizeUV /= pxSize; 121 vec2 canvasPixelizedUV = (floor(pxSizeUV) + .5) * pxSize; 122 vec2 normalizedUV = canvasPixelizedUV / u_resolution; 123 124 vec2 ditheringNoiseUV = canvasPixelizedUV; 125 vec2 shapeUV = normalizedUV; 126 127 vec2 boxOrigin = vec2(.5 - u_originX, u_originY - .5); 128 vec2 givenBoxSize = vec2(u_worldWidth, u_worldHeight); 129 givenBoxSize = max(givenBoxSize, vec2(1.)) * u_pixelRatio; 130 float r = u_rotation * PI / 180.; 131 mat2 graphicRotation = mat2(cos(r), sin(r), -sin(r), cos(r)); 132 vec2 graphicOffset = vec2(-u_offsetX, u_offsetY); 133 134 float patternBoxRatio = givenBoxSize.x / givenBoxSize.y; 135 vec2 boxSize = vec2( 136 (u_worldWidth == 0.) ? u_resolution.x : givenBoxSize.x, 137 (u_worldHeight == 0.) ? u_resolution.y : givenBoxSize.y 138 ); 139 140 if (u_shape > 3.5) { 141 vec2 objectBoxSize = vec2(0.);
142 // fit = none 143 objectBoxSize.x = min(boxSize.x, boxSize.y); 144 if (u_fit == 1.) { // fit = contain 145 objectBoxSize.x = min(u_resolution.x, u_resolution.y); 146 } else if (u_fit == 2.) { // fit = cover 147 objectBoxSize.x = max(u_resolution.x, u_resolution.y); 148 } 149 objectBoxSize.y = objectBoxSize.x; 150 vec2 objectWorldScale = u_resolution.xy / objectBoxSize; 151 152 shapeUV *= objectWorldScale; 153 shapeUV += boxOrigin * (objectWorldScale - 1.); 154 shapeUV += vec2(-u_offsetX, u_offsetY); 155 shapeUV /= u_scale; 156 shapeUV = graphicRotation * shapeUV; 157 } else { 158 vec2 patternBoxSize = vec2(0.); 159 // fit = none 160 patternBoxSize.x = patternBoxRatio * min(boxSize.x / patternBoxRatio, boxSize.y); 161 float patternWorldNoFitBoxWidth = patternBoxSize.x; 162 if (u_fit == 1.) { // fit = contain 163 patternBoxSize.x = patternBoxRatio * min(u_resolution.x / patternBoxRatio, u_resolution.y); 164 } else if (u_fit == 2.) { // fit = cover 165 patternBoxSize.x = patternBoxRatio * max(u_resolution.x / patternBoxRatio, u_resolution.y); 166 } 167 patternBoxSize.y = patternBoxSize.x / patternBoxRatio; 168 vec2 patternWorldScale = u_resolution.xy / patternBoxSize; 169 170 shapeUV += vec2(-u_offsetX, u_offsetY) / patternWorldScale; 171 shapeUV += boxOrigin; 172 shapeUV -= boxOrigin / patternWorldScale; 173 shapeUV *= u_resolution.xy; 174 shapeUV /= u_pixelRatio; 175 if (u_fit > 0.) { 176 shapeUV *= (patternWorldNoFitBoxWidth / patternBoxSize.x); 177 } 178 shapeUV /= u_scale; 179 shapeUV = graphicRotation * shapeUV; 180 shapeUV += boxOrigin / patternWorldScale; 181 shapeUV -= boxOrigin; 182 shapeUV += .5; 183 } 184 185 float shape = 0.; 186 if (u_shape < 1.5) { 187 // Simplex noise 188 shapeUV *= .001; 189 190 shape = 0.5 + 0.5 * getSimplexNoise(shapeUV, t); 191 shape = smoothstep(0.3, 0.9, shape); 192 193 } else if (u_shape < 2.5) { 194 // Warp 195 shapeUV *= .003; 196 197 for (float i = 1.0; i < 6.0; i++) { 198 shapeUV.x += 0.6 / i * cos(i * 2.5 * shapeUV.y + t); 199 shapeUV.y += 0.6 / i * cos(i * 1.5 * shapeUV.x + t); 200 } 201 202 shape = .15 / max(0.001, abs(sin(t - shapeUV.y - shapeUV.x))); 203 shape = smoothstep(0.02, 1., shape); 204 205 } else if (u_shape < 3.5) { 206 // Dots 207 shapeUV *= .05; 208 209 float stripeIdx = floor(2. * shapeUV.x / TWO_PI); 210 float rand = hash11(stripeIdx * 10.); 211 rand = sign(rand - .5) * pow(.1 + abs(rand), .4); 212 shape = sin(shapeUV.x) * cos(shapeUV.y - 5. * rand * t); 213 shape = pow(abs(shape), 6.); 214 215 } else if (u_shape < 4.5) { 216 // Sine wave 217 shapeUV *= 4.; 218 219 float wave = cos(.5 * shapeUV.x - 2. * t) * sin(1.5 * shapeUV.x + t) * (.75 + .25 * cos(3. * t)); 220 shape = 1. - smoothstep(-1., 1., shapeUV.y + wave); 221 222 } else if (u_shape < 5.5) { 223 // Ripple 224 225 float dist = length(shapeUV); 226 float waves = sin(pow(dist, 1.7) * 7. - 3. * t) * .5 + .5; 227 shape = waves; 228 229 } else if (u_shape < 6.5) { 230 // Swirl 231 232 float l = length(shapeUV); 233 float angle = 6. * atan(shapeUV.y, shapeUV.x) + 4. * t; 234 float twist = 1.2; 235 float offset = 1. / pow(max(l, 1e-6), twist) + angle / TWO_PI; 236 float mid = smoothstep(0., 1., pow(l, twist)); 237 shape = mix(0., fract(offset), mid); 238 239 } else { 240 // Sphere 241 shapeUV *= 2.; 242 243 float d = 1. - pow(length(shapeUV), 2.); 244 vec3 pos = vec3(shapeUV, sqrt(max(0., d))); 245 vec3 lightPos = normalize(vec3(cos(1.5 * t), .8, sin(1.25 * t))); 246 shape = .5 + .5 * dot(lightPos, pos); 247 shape *= step(0., d); 248 } 249 250 251 int type = int(floor(u_type)); 252 float dithering = 0.0; 253 254 switch (type) { 255 case 1: { 256 dithering = step(hash21(ditheringNoiseUV), shape); 257 } break; 258 case 2: 259 dithering = getBayerValue(pxSizeUV, 2); 260 break; 261 case 3: 262 dithering = getBayerValue(pxSizeUV, 4); 263 break; 264 default : 265 dithering = getBayerValue(pxSizeUV, 8); 266 break; 267 } 268 269 dithering -= .5; 270 float res = step(.5, shape + dithering); 271 272 vec3 fgColor = u_colorFront.rgb * u_colorFront.a; 273 float fgOpacity = u_colorFront.a; 274 vec3 bgColor = u_colorBack.rgb * u_colorBack.a; 275 float bgOpacity = u_colorBack.a; 276 277 vec3 color = fgColor * res; 278 float opacity = fgOpacity * res; 279 280 color += bgColor * (1. - opacity); 281 opacity += bgOpacity * (1. - opacity); 282 283 fragColor = vec4(color, opacity); 284} 285`,h=`#version 300 es 286precision mediump float; 287 288layout(location = 0) in vec4 a_position; 289 290uniform vec2 u_resolution; 291uniform float u_pixelRatio; 292uniform float u_imageAspectRatio; 293uniform float u_originX; 294uniform float u_originY; 295uniform float u_worldWidth; 296uniform float u_worldHeight; 297uniform float u_fit; 298uniform float u_scale; 299uniform float u_rotation; 300uniform float u_offsetX; 301uniform float u_offsetY; 302 303out vec2 v_objectUV; 304out vec2 v_objectBoxSize; 305out vec2 v_responsiveUV; 306out vec2 v_responsiveBoxGivenSize; 307out vec2 v_patternUV; 308out vec2 v_patternBoxSize; 309out vec2 v_imageUV; 310 311vec3 getBoxSize(float boxRatio, vec2 givenBoxSize) { 312 vec2 box = vec2(0.);
313 // fit = none 314 box.x = boxRatio * min(givenBoxSize.x / boxRatio, givenBoxSize.y); 315 float noFitBoxWidth = box.x; 316 if (u_fit == 1.) { // fit = contain 317 box.x = boxRatio * min(u_resolution.x / boxRatio, u_resolution.y); 318 } else if (u_fit == 2.) { // fit = cover 319 box.x = boxRatio * max(u_resolution.x / boxRatio, u_resolution.y); 320 } 321 box.y = box.x / boxRatio; 322 return vec3(box, noFitBoxWidth); 323} 324 325void main() { 326 gl_Position = a_position; 327 328 vec2 uv = gl_Position.xy * .5; 329 vec2 boxOrigin = vec2(.5 - u_originX, u_originY - .5); 330 vec2 givenBoxSize = vec2(u_worldWidth, u_worldHeight); 331 givenBoxSize = max(givenBoxSize, vec2(1.)) * u_pixelRatio; 332 float r = u_rotation * 3.14159265358979323846 / 180.; 333 mat2 graphicRotation = mat2(cos(r), sin(r), -sin(r), cos(r)); 334 vec2 graphicOffset = vec2(-u_offsetX, u_offsetY); 335 336 337 // =================================================== 338 339 float fixedRatio = 1.; 340 vec2 fixedRatioBoxGivenSize = vec2( 341 (u_worldWidth == 0.) ? u_resolution.x : givenBoxSize.x, 342 (u_worldHeight == 0.) ? u_resolution.y : givenBoxSize.y 343 ); 344 345 v_objectBoxSize = getBoxSize(fixedRatio, fixedRatioBoxGivenSize).xy; 346 vec2 objectWorldScale = u_resolution.xy / v_objectBoxSize; 347 348 v_objectUV = uv; 349 v_objectUV *= objectWorldScale; 350 v_objectUV += boxOrigin * (objectWorldScale - 1.); 351 v_objectUV += graphicOffset; 352 v_objectUV /= u_scale; 353 v_objectUV = graphicRotation * v_objectUV; 354 355 // =================================================== 356 357 v_responsiveBoxGivenSize = vec2( 358 (u_worldWidth == 0.) ? u_resolution.x : givenBoxSize.x, 359 (u_worldHeight == 0.) ? u_resolution.y : givenBoxSize.y 360 ); 361 float responsiveRatio = v_responsiveBoxGivenSize.x / v_responsiveBoxGivenSize.y; 362 vec2 responsiveBoxSize = getBoxSize(responsiveRatio, v_responsiveBoxGivenSize).xy; 363 vec2 responsiveBoxScale = u_resolution.xy / responsiveBoxSize; 364 365 #ifdef ADD_HELPERS 366 v_responsiveHelperBox = uv; 367 v_responsiveHelperBox *= responsiveBoxScale; 368 v_responsiveHelperBox += boxOrigin * (responsiveBoxScale - 1.); 369 #endif 370 371 v_responsiveUV = uv; 372 v_responsiveUV *= responsiveBoxScale; 373 v_responsiveUV += boxOrigin * (responsiveBoxScale - 1.); 374 v_responsiveUV += graphicOffset; 375 v_responsiveUV /= u_scale; 376 v_responsiveUV.x *= responsiveRatio; 377 v_responsiveUV = graphicRotation * v_responsiveUV; 378 v_responsiveUV.x /= responsiveRatio; 379 380 // =================================================== 381 382 float patternBoxRatio = givenBoxSize.x / givenBoxSize.y; 383 vec2 patternBoxGivenSize = vec2( 384 (u_worldWidth == 0.) ? u_resolution.x : givenBoxSize.x, 385 (u_worldHeight == 0.) ? u_resolution.y : givenBoxSize.y 386 ); 387 patternBoxRatio = patternBoxGivenSize.x / patternBoxGivenSize.y; 388 389 vec3 boxSizeData = getBoxSize(patternBoxRatio, patternBoxGivenSize); 390 v_patternBoxSize = boxSizeData.xy; 391 float patternBoxNoFitBoxWidth = boxSizeData.z; 392 vec2 patternBoxScale = u_resolution.xy / v_patternBoxSize; 393 394 v_patternUV = uv; 395 v_patternUV += graphicOffset / patternBoxScale; 396 v_patternUV += boxOrigin; 397 v_patternUV -= boxOrigin / patternBoxScale; 398 v_patternUV *= u_resolution.xy; 399 v_patternUV /= u_pixelRatio; 400 if (u_fit > 0.) { 401 v_patternUV *= (patternBoxNoFitBoxWidth / v_patternBoxSize.x); 402 } 403 v_patternUV /= u_scale; 404 v_patternUV = graphicRotation * v_patternUV; 405 v_patternUV += boxOrigin / patternBoxScale; 406 v_patternUV -= boxOrigin; 407 // x100 is a default multiplier between vertex and fragmant shaders 408 // we use it to avoid UV presision issues 409 v_patternUV *= .01; 410 411 // =================================================== 412 413 vec2 imageBoxSize; 414 if (u_fit == 1.) { // contain 415 imageBoxSize.x = min(u_resolution.x / u_imageAspectRatio, u_resolution.y) * u_imageAspectRatio; 416 } else if (u_fit == 2.) { // cover 417 imageBoxSize.x = max(u_resolution.x / u_imageAspectRatio, u_resolution.y) * u_imageAspectRatio; 418 } else { 419 imageBoxSize.x = min(10.0, 10.0 / u_imageAspectRatio * u_imageAspectRatio); 420 } 421 imageBoxSize.y = imageBoxSize.x / u_imageAspectRatio; 422 vec2 imageBoxScale = u_resolution.xy / imageBoxSize; 423 424 v_imageUV = uv; 425 v_imageUV *= imageBoxScale; 426 v_imageUV += boxOrigin * (imageBoxScale - 1.); 427 v_imageUV += graphicOffset; 428 v_imageUV /= u_scale; 429 v_imageUV.x *= u_imageAspectRatio; 430 v_imageUV = graphicRotation * v_imageUV; 431 v_imageUV.x /= u_imageAspectRatio; 432 433 v_imageUV += .5; 434 v_imageUV.y = 1. - v_imageUV.y; 435}`,u=8294400;class p{parentElement;canvasElement;gl;program=null;uniformLocations={};fragmentShader;rafId=null;lastRenderTime=0;currentFrame=0;speed=0;currentSpeed=0;providedUniforms;mipmaps=[];hasBeenDisposed=!1;resolutionChanged=!0;textures=new Map;minPixelRatio;maxPixelCount;isSafari=(function(){let e=navigator.userAgent.toLowerCase();return e.includes("safari")&&!e.includes("chrome")&&!e.includes("android")})();uniformCache={};textureUnitMap=new Map;ownerDocument;
435constructor(e,t,i,o,r=0,a=0,s=2,n=u,l=[]){if(e?.nodeType===1)this.parentElement=e;else throw Error("Paper Shaders: parent element must be an HTMLElement");if(this.ownerDocument=e.ownerDocument,!this.ownerDocument.querySelector("style[data-paper-shader]")){const e=this.ownerDocument.createElement("style");e.innerHTML=f,e.setAttribute("data-paper-shader",""),this.ownerDocument.head.prepend(e)}const h=this.ownerDocument.createElement("canvas");this.canvasElement=h,this.parentElement.prepend(h),this.fragmentShader=t,this.providedUniforms=i,this.mipmaps=l,this.currentFrame=a,this.minPixelRatio=s,this.maxPixelCount=n;const p=h.getContext("webgl2",o);if(!p)throw Error("Paper Shaders: WebGL is not supported in this browser");this.gl=p,this.initProgram(),this.setupPositionAttribute(),this.setupUniforms(),this.setUniformValues(this.providedUniforms),this.setupResizeObserver(),visualViewport?.addEventListener("resize",this.handleVisualViewportChange),this.setupIntersectionObserver(),this.setSpeed(r),this.parentElement.setAttribute("data-paper-shader",""),this.parentElement.paperShaderMount=this,this.ownerDocument.addEventListener("visibilitychange",this.handleDocumentVisibilityChange)}initProgram=()=>{let e=function(e,t,i){let o=e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT),r=o?o.precision:null;r&&r<23&&(t=t.replace(/precision\s+(lowp|mediump)\s+float;/g,"precision highp float;"),i=i.replace(/precision\s+(lowp|mediump)\s+float/g,"precision highp float").replace(/\b(uniform|varying|attribute)\s+(lowp|mediump)\s+(\w+)/g,"$1 highp $3"));let a=c(e,e.VERTEX_SHADER,t),s=c(e,e.FRAGMENT_SHADER,i);if(!a||!s)return null;let n=e.createProgram();return n?(e.attachShader(n,a),e.attachShader(n,s),e.linkProgram(n),e.getProgramParameter(n,e.LINK_STATUS))?(e.detachShader(n,a),e.detachShader(n,s),e.deleteShader(a),e.deleteShader(s),n):(console.error("Unable to initialize the shader program: "+e.getProgramInfoLog(n)),e.deleteProgram(n),e.deleteShader(a),e.deleteShader(s),null):null}(this.gl,h,this.fragmentShader);e&&(this.program=e)};setupPositionAttribute=()=>{let e=this.gl.getAttribLocation(this.program,"a_position"),t=this.gl.createBuffer();this.gl.bindBuffer(this.gl.ARRAY_BUFFER,t),this.gl.bufferData(this.gl.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),this.gl.STATIC_DRAW),this.gl.enableVertexAttribArray(e),this.gl.vertexAttribPointer(e,2,this.gl.FLOAT,!1,0,0)};setupUniforms=()=>{let e={u_time:this.gl.getUniformLocation(this.program,"u_time"),u_pixelRatio:this.gl.getUniformLocation(this.program,"u_pixelRatio"),u_resolution:this.gl.getUniformLocation(this.program,"u_resolution")};Object.entries(this.providedUniforms).forEach(([t,i])=>{if(e[t]=this.gl.getUniformLocation(this.program,t),i instanceof HTMLImageElement){let i=`${t}AspectRatio`;e[i]=this.gl.getUniformLocation(this.program,i)}}),this.uniformLocations=e};renderScale=1;parentWidth=0;parentHeight=0;parentDevicePixelWidth=0;parentDevicePixelHeight=0;devicePixelsSupported=!1;intersectionObserver=null;isInViewport=!0;resizeObserver=null;setupResizeObserver=()=>{this.resizeObserver=new ResizeObserver(([e])=>{if(e?.borderBoxSize[0]){let t=e.devicePixelContentBoxSize?.[0];void 0!==t&&(this.devicePixelsSupported=!0,this.parentDevicePixelWidth=t.inlineSize,this.parentDevicePixelHeight=t.blockSize),this.parentWidth=e.borderBoxSize[0].inlineSize,this.parentHeight=e.borderBoxSize[0].blockSize}this.handleResize()}),this.resizeObserver.observe(this.parentElement)};setupIntersectionObserver=()=>{let e=this.ownerDocument.defaultView;e?.IntersectionObserver&&(this.intersectionObserver=new e.IntersectionObserver(([e])=>{this.isInViewport=e?.isIntersecting??!0,this.updateCurrentSpeed()}),this.intersectionObserver.observe(this.parentElement))};handleVisualViewportChange=()=>{this.resizeObserver?.disconnect(),this.setupResizeObserver()};handleResize=()=>{let e=0,t=0,i=Math.max(1,window.devicePixelRatio),o=visualViewport?.scale??1;if(this.devicePixelsSupported){let r=Math.max(1,this.minPixelRatio/i);e=this.parentDevicePixelWidth*r*o,t=this.parentDevicePixelHeight*r*o}else{var r;let a,s,n=Math.max(i,this.minPixelRatio)*o;this.isSafari&&(n*=Math.max(1,(r=this.ownerDocument,(s=Math.round(100*(a=outerWidth/((visualVie
435wport?.scale??1)*(visualViewport?.width??window.innerWidth)+(window.innerWidth-r.documentElement.clientWidth)))))%5==0?s/100:33===s?1/3:67===s?2/3:133===s?4/3:a))),e=Math.round(this.parentWidth)*n,t=Math.round(this.parentHeight)*n}let a=Math.min(1,Math.sqrt(this.maxPixelCount)/Math.sqrt(e*t)),s=Math.round(e*a),n=Math.round(t*a),l=s/Math.round(this.parentWidth);(this.canvasElement.width!==s||this.canvasElement.height!==n||this.renderScale!==l)&&(this.renderScale=l,this.canvasElement.width=s,this.canvasElement.height=n,this.resolutionChanged=!0,this.gl.viewport(0,0,this.gl.canvas.width,this.gl.canvas.height),this.render(performance.now()))};render=e=>{if(this.hasBeenDisposed)return;if(null===this.program)return void console.warn("Tried to render before program or gl was initialized");let t=e-this.lastRenderTime;this.lastRenderTime=e,0!==this.currentSpeed&&(this.currentFrame+=t*this.currentSpeed),this.gl.clear(this.gl.COLOR_BUFFER_BIT),this.gl.useProgram(this.program),this.gl.uniform1f(this.uniformLocations.u_time,.001*this.currentFrame),this.resolutionChanged&&(this.gl.uniform2f(this.uniformLocations.u_resolution,this.gl.canvas.width,this.gl.canvas.height),this.gl.uniform1f(this.uniformLocations.u_pixelRatio,this.renderScale),this.resolutionChanged=!1),this.gl.drawArrays(this.gl.TRIANGLES,0,6),0!==this.currentSpeed?this.requestRender():this.rafId=null};requestRender=()=>{null!==this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame(this.render)};setTextureUniform=(e,t)=>{if(!t.complete||0===t.naturalWidth)throw Error(`Paper Shaders: image for uniform ${e} must be fully loaded`);let i=this.textures.get(e);i&&this.gl.deleteTexture(i),this.textureUnitMap.has(e)||this.textureUnitMap.set(e,this.textureUnitMap.size);let o=this.textureUnitMap.get(e);this.gl.activeTexture(this.gl.TEXTURE0+o);let r=this.gl.createTexture();this.gl.bindTexture(this.gl.TEXTURE_2D,r),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MAG_FILTER,this.gl.LINEAR),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,this.gl.RGBA,this.gl.UNSIGNED_BYTE,t),this.mipmaps.includes(e)&&(this.gl.generateMipmap(this.gl.TEXTURE_2D),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR_MIPMAP_LINEAR));let a=this.gl.getError();if(a!==this.gl.NO_ERROR||null===r)return void console.error("Paper Shaders: WebGL error when uploading texture:",a);this.textures.set(e,r);let s=this.uniformLocations[e];if(s){this.gl.uniform1i(s,o);let i=`${e}AspectRatio`,r=this.uniformLocations[i];if(r){let e=t.naturalWidth/t.naturalHeight;this.gl.uniform1f(r,e)}}};areUniformValuesEqual=(e,t)=>e===t||!!(Array.isArray(e)&&Array.isArray(t))&&e.length===t.length&&e.every((e,i)=>this.areUniformValuesEqual(e,t[i]));setUniformValues=e=>{this.gl.useProgram(this.program),Object.entries(e).forEach(([e,t])=>{let i=t;if(t instanceof HTMLImageElement&&(i=`${t.src.slice(0,200)}|${t.naturalWidth}x${t.naturalHeight}`),this.areUniformValuesEqual(this.uniformCache[e],i))return;this.uniformCache[e]=i;let o=this.uniformLocations[e];if(!o)return void console.warn(`Uniform location for ${e} not found`);if(t instanceof HTMLImageElement)this.setTextureUniform(e,t);else if(Array.isArray(t)){let i=null,r=null;if(void 0!==t[0]&&Array.isArray(t[0])){let o=t[0].length;if(!t.every(e=>e.length===o))return void console.warn(`All child arrays must be the same length for ${e}`);i=t.flat(),r=o}else r=(i=t).length;switch(r){case 2:this.gl.uniform2fv(o,i);break;case 3:this.gl.uniform3fv(o,i);break;case 4:this.gl.uniform4fv(o,i);break;case 9:this.gl.uniformMatrix3fv(o,!1,i);break;case 16:this.gl.uniformMatrix4fv(o,!1,i);break;default:console.warn(`Unsupported uniform array length: ${r}`)}}else"number"==typeof t?this.gl.uniform1f(o,t):"boolean"==typeof t?this.gl.uniform1i(o,+!!t):console.warn(`Unsupported uniform type for ${e}: ${typeof t}`)})};getCurrentFrame=()=>this.currentFrame;setFrame=e=>{this.currentFrame=e,this.lastRenderTime=performance.now(),this.render(performance.now())};setSpeed=(e=1)=>{this.speed=e,this.updateCurrentSpeed()};updateCurrentSpeed=()=>{this.setCurrentSpeed(this.ownerDocument.hidden||!this.isInViewport?0:this.speed)};setCurrentSpeed=e=>{this.currentSpeed=e,null===this.rafId&&0!==e&&(this.lastRenderTime=performance.now(),this.rafId=requestAnimationFrame(this.render)),null!==this.rafId&&0===e&&(cancelAnimationFrame(this.rafId),this.rafId=null)};setMaxPixelCount=(e=u)=>{this.maxPixelCount=e,this.handleResize()};setMinPixelRatio=(e=2)=>{this.minPixelRatio=e,this.handleResize()};setUniforms=e=>{this.setUniformValues(e),this.providedUniforms={...this.providedUniforms,...e},this.render(performance.now())};handleDocumentVisibilityChange=()=>{this.updateCurrentSpeed()};dispose=()=>{this.hasBeenDisposed=!0,null!==this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.gl&&this.program&&(this.textures.forEac
435h(e=>{this.gl.deleteTexture(e)}),this.textures.clear(),this.gl.deleteProgram(this.program),this.program=null,this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null),this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,null),this.gl.bindRenderbuffer(this.gl.RENDERBUFFER,null),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,null),this.gl.getError()),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),visualViewport?.removeEventListener("resize",this.handleVisualViewportChange),this.ownerDocument.removeEventListener("visibilitychange",this.handleDocumentVisibilityChange),this.uniformLocations={},this.canvasElement.remove(),delete this.parentElement.paperShaderMount}}function c(e,t,i){let o=e.createShader(t);return o?(e.shaderSource(o,i),e.compileShader(o),e.getShaderParameter(o,e.COMPILE_STATUS))?o:(console.error("An error occurred compiling the shaders: "+e.getShaderInfoLog(o)),e.deleteShader(o),null):null}let f=`@layer paper-shaders { 436 :where([data-paper-shader]) { 437 isolation: isolate; 438 position: relative; 439 440 & canvas { 441 contain: strict; 442 display: block; 443 position: absolute; 444 inset: 0; 445 z-index: -1; 446 width: 100%; 447 height: 100%; 448 border-radius: inherit; 449 corner-shape: inherit; 450 } 451 } 452}`;function x(e){if(Array.isArray(e))return 4===e.length?e:3===e.length?[...e,1]:g;if("string"!=typeof e)return g;let t,i,o,r=1;if(e.startsWith("#")){var a;(3===(a=(a=e).replace(/^#/,"")).length||4===a.length)&&(a=a.split("").map(e=>e+e).join("")),6===a.length&&(a+="ff"),[t,i,o,r]=/^[0-9a-f]{8}$/i.test(a)?[parseInt(a.slice(0,2),16)/255,parseInt(a.slice(2,4),16)/255,parseInt(a.slice(4,6),16)/255,parseInt(a.slice(6,8),16)/255]:(console.warn("Invalid hex color"),g)}else if(e.startsWith("rgb")){let a,s=(a=e.match(/^rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([0-9.]+))?\s*\)$/i))?[parseInt(a[1]??"0")/255,parseInt(a[2]??"0")/255,parseInt(a[3]??"0")/255,void 0===a[4]?1:parseFloat(a[4])]:null;if(null===s)return g;[t,i,o,r]=s}else{let a;if(!e.startsWith("hsl"))return console.error("Unsupported color format",e),g;let s=(a=e.match(/^hsla?\s*\(\s*(\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(?:,\s*([0-9.]+))?\s*\)$/i))?[parseInt(a[1]??"0"),parseInt(a[2]??"0"),parseInt(a[3]??"0"),void 0===a[4]?1:parseFloat(a[4])]:null;if(null===s)return g;[t,i,o,r]=function(e){let t,i,o,[r,a,s,n]=e,l=r/360,h=a/100,u=s/100;if(0===a)t=i=o=u;else{let e=(e,t,i)=>(i<0&&(i+=1),i>1&&(i-=1),i<1/6)?e+(t-e)*6*i:i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e,r=u<.5?u*(1+h):u+h-u*h,a=2*u-r;t=e(a,r,l+1/3),i=e(a,r,l),o=e(a,r,l-1/3)}return[t,i,o,n]}(s)}return[d(t,0,1),d(i,0,1),d(o,0,1),d(r,0,1)]}let d=(e,t,i)=>Math.min(Math.max(e,t),i),g=[.5,.5,.5,1],v="#000B5A",m="#142384";var _=o("j7tv4");let S=document.documentElement.classList.contains("canopy-edit"),b=window.matchMedia("(prefers-reduced-motion: reduce)").matches,U=S||b?0:.22;function R(){let e=document.querySelectorAll("[data-hero-shader]:not([data-shader-mounted])");e.length&&(0,_.hasGpuWebGL)()&&e.forEach(e=>{if(!e.dataset.shaderMounted){e.dataset.shaderMounted="true";try{new p(e,l,function({back:e=v,front:t=m,size:i=1.4}={}){return{u_colorBack:x(e),u_colorFront:x(t),u_shape:2,u_type:3,u_pxSize:i,u_fit:0,u_scale:1,u_rotation:88,u_originX:.5,u_originY:.5,u_offsetX:-.56,u_offsetY:.62,u_worldWidth:0,u_worldHeight:0}}({back:e.dataset.shaderBack||v,front:e.dataset.shaderFront||m}),void 0,U,0,1,2073600)}catch{}}})}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",R):R()})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.