@wave3d/core 0.4.1 → 0.6.0

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 (37) hide show
  1. package/README.md +2 -6
  2. package/dist/config/model.d.ts +53 -2
  3. package/dist/config/model.js +133 -61
  4. package/dist/config/model.js.map +1 -1
  5. package/dist/core-loader.d.ts +0 -2
  6. package/dist/index.d.ts +2 -2
  7. package/dist/index.js +2 -2
  8. package/dist/presets.d.ts +0 -1
  9. package/dist/presets.js +105 -0
  10. package/dist/presets.js.map +1 -1
  11. package/dist/renderer/WaveGeometry.d.ts +0 -1
  12. package/dist/renderer/WaveGeometry.js.map +1 -1
  13. package/dist/renderer/WaveRenderer.d.ts +62 -14
  14. package/dist/renderer/WaveRenderer.js +126 -17
  15. package/dist/renderer/WaveRenderer.js.map +1 -1
  16. package/dist/renderer/heroPalette.d.ts +0 -1
  17. package/dist/renderer/index.d.ts +2 -2
  18. package/dist/renderer/index.js +2 -2
  19. package/dist/renderer/interaction.d.ts +0 -2
  20. package/dist/renderer/interaction.js +9 -0
  21. package/dist/renderer/interaction.js.map +1 -1
  22. package/dist/renderer/palette.d.ts +0 -1
  23. package/dist/renderer/shaders.js +46 -0
  24. package/dist/renderer/shaders.js.map +1 -1
  25. package/dist/shell/createWave.d.ts +0 -1
  26. package/dist/standalone/wave3d.standalone.js +501 -294
  27. package/dist/standalone.d.ts +2 -3
  28. package/dist/standalone.js +2 -2
  29. package/dist/studio/StudioWaveRenderer.d.ts +4 -1
  30. package/dist/studio/StudioWaveRenderer.js +10 -3
  31. package/dist/studio/StudioWaveRenderer.js.map +1 -1
  32. package/dist/studio/randomize.d.ts +0 -1
  33. package/dist/studio/thumbnail.d.ts +0 -1
  34. package/dist/studio/thumbnail.js +5 -1
  35. package/dist/studio/thumbnail.js.map +1 -1
  36. package/package.json +5 -3
  37. package/skills/wave3d/SKILL.md +30 -12
@@ -11413,10 +11413,16 @@ function xl() {
11413
11413
  z: 6.33
11414
11414
  },
11415
11415
  twistMotion: !1,
11416
+ helixTurns: 0,
11417
+ helixRadius: 0,
11418
+ helixRoll: 0,
11419
+ helixPhase: 0,
11416
11420
  theme: "solid",
11417
11421
  lineAmount: 425,
11418
11422
  lineThickness: 1,
11419
11423
  lineDerivativePower: .95,
11424
+ rungAmount: 0,
11425
+ rungThickness: 1,
11420
11426
  maxWidth: 1232,
11421
11427
  position: {
11422
11428
  x: -24.3,
@@ -11490,6 +11496,8 @@ function wl() {
11490
11496
  z: 0
11491
11497
  },
11492
11498
  cameraZoom: 1,
11499
+ cameraFit: "cover",
11500
+ cameraMinVisibleWidth: 0,
11493
11501
  grain: 1.1,
11494
11502
  blur: .02,
11495
11503
  blurSamples: 6,
@@ -11518,7 +11526,7 @@ function wl() {
11518
11526
  }
11519
11527
  function Tl(e) {
11520
11528
  let t = e.palette;
11521
- t.length > 0 && typeof t[0] == "string" && (e.palette = vl(t)), e.gradientType !== "radial" && e.gradientType !== "conic" && e.gradientType !== "mesh" && e.gradientType !== "linear" && (e.gradientType = "linear");
11529
+ !Array.isArray(t) || t.length === 0 ? e.palette = xl().palette : typeof t[0] == "string" && (e.palette = vl(t)), e.gradientType !== "radial" && e.gradientType !== "conic" && e.gradientType !== "mesh" && e.gradientType !== "linear" && (e.gradientType = "linear");
11522
11530
  let n = e.meshGradientPoints;
11523
11531
  if (!Array.isArray(n) || n.length < 2) e.meshGradientPoints = yl();
11524
11532
  else {
@@ -11542,7 +11550,7 @@ function Tl(e) {
11542
11550
  }, e.paletteTextureScale.x = pl(Number(e.paletteTextureScale.x) || 1, .1, 8), e.paletteTextureScale.y = pl(Number(e.paletteTextureScale.y) || 1, .1, 8), e.paletteTextureOffset.x = pl(Number(e.paletteTextureOffset.x) || 0, -4, 4), e.paletteTextureOffset.y = pl(Number(e.paletteTextureOffset.y) || 0, -4, 4), e.paletteTextureRotation = pl(Number(e.paletteTextureRotation) || 0, -180, 180);
11543
11551
  }
11544
11552
  function El(e) {
11545
- e.backgroundMode !== "gradient" && e.backgroundMode !== "image" && e.backgroundMode !== "color" && (e.backgroundMode = "color");
11553
+ typeof e.background != "string" && (e.background = "#ffffff"), typeof e.transparentBackground != "boolean" && (e.transparentBackground = !0), e.backgroundMode !== "gradient" && e.backgroundMode !== "image" && e.backgroundMode !== "color" && (e.backgroundMode = "color");
11546
11554
  let t = e.backgroundPalette;
11547
11555
  !t || t.length < 2 ? e.backgroundPalette = vl([
11548
11556
  "#0a2540",
@@ -11551,7 +11559,7 @@ function El(e) {
11551
11559
  "#f6f9fc"
11552
11560
  ]) : typeof t[0] == "string" && (e.backgroundPalette = vl(t)), e.backgroundGradientType !== "radial" && e.backgroundGradientType !== "conic" && e.backgroundGradientType !== "mesh" && e.backgroundGradientType !== "linear" && (e.backgroundGradientType = "linear");
11553
11561
  let n = e.backgroundMeshPoints;
11554
- (!Array.isArray(n) || n.length < 2) && (e.backgroundMeshPoints = yl()), Number.isFinite(e.backgroundMeshSoftness) || (e.backgroundMeshSoftness = .62), e.backgroundMeshSoftness = ml(e.backgroundMeshSoftness), typeof e.backgroundGradientAngle != "number" && (e.backgroundGradientAngle = 135), typeof e.backgroundGradientSource != "string" && (e.backgroundGradientSource = "stops"), typeof e.backgroundImageSource != "string" && (e.backgroundImageSource = "vaporwave"), e.backgroundImageFit !== "contain" && e.backgroundImageFit !== "stretch" && e.backgroundImageFit !== "cover" && (e.backgroundImageFit = "cover"), typeof e.backgroundImageZoom != "number" && (e.backgroundImageZoom = 1), e.backgroundImageZoom = pl(e.backgroundImageZoom, .1, 8), e.backgroundImagePosition ||= {
11562
+ (!Array.isArray(n) || n.length < 2) && (e.backgroundMeshPoints = yl()), Number.isFinite(e.backgroundMeshSoftness) || (e.backgroundMeshSoftness = .62), e.backgroundMeshSoftness = ml(e.backgroundMeshSoftness), Number.isFinite(e.backgroundGradientAngle) || (e.backgroundGradientAngle = 135), typeof e.backgroundGradientSource != "string" && (e.backgroundGradientSource = "stops"), typeof e.backgroundImageSource != "string" && (e.backgroundImageSource = "vaporwave"), e.backgroundImageFit !== "contain" && e.backgroundImageFit !== "stretch" && e.backgroundImageFit !== "cover" && (e.backgroundImageFit = "cover"), Number.isFinite(e.backgroundImageZoom) || (e.backgroundImageZoom = 1), e.backgroundImageZoom = pl(e.backgroundImageZoom, .1, 8), e.backgroundImagePosition ||= {
11555
11563
  x: 0,
11556
11564
  y: 0
11557
11565
  }, typeof e.backgroundImagePosition.x != "number" && (e.backgroundImagePosition.x = 0), typeof e.backgroundImagePosition.y != "number" && (e.backgroundImagePosition.y = 0), e.backgroundImagePosition.x = pl(e.backgroundImagePosition.x, -100, 100), e.backgroundImagePosition.y = pl(e.backgroundImagePosition.y, -100, 100);
@@ -11565,13 +11573,13 @@ function Dl(e) {
11565
11573
  x: 0,
11566
11574
  y: 0,
11567
11575
  z: 0
11568
- }, typeof e.cameraZoom != "number" && (e.cameraZoom = 1);
11576
+ }, Number.isFinite(e.cameraZoom) || (e.cameraZoom = 1), Wl.includes(e.cameraFit) || (e.cameraFit = "cover"), e.cameraMinVisibleWidth = typeof e.cameraMinVisibleWidth == "number" ? pl(e.cameraMinVisibleWidth, 0, 1) : 0;
11569
11577
  }
11570
11578
  function Ol(e) {
11571
- Tl(e), typeof e.gradientAngle != "number" && (e.gradientAngle = 90), typeof e.gradientShift != "number" && (e.gradientShift = .15), typeof e.usePaletteTexture != "boolean" && (e.usePaletteTexture = !0), typeof e.paletteSource != "string" && (e.paletteSource = "hero"), typeof e.paletteEdgeColor != "string" && (e.paletteEdgeColor = "#8e9dff"), typeof e.paletteEdgeAmount != "number" && (e.paletteEdgeAmount = .3), typeof e.paletteDriftX != "number" && (e.paletteDriftX = 0), typeof e.paletteDriftY != "number" && (e.paletteDriftY = 0), typeof e.hueShift != "number" && (e.hueShift = 0), typeof e.colorContrast != "number" && (e.colorContrast = 1), typeof e.colorSaturation != "number" && (e.colorSaturation = 1), typeof e.fiberCount != "number" && (e.fiberCount = 600), typeof e.fiberStrength != "number" && (e.fiberStrength = .2), Array.isArray(e.noiseBands) || (e.noiseBands = []), typeof e.texture != "number" && (e.texture = 0), typeof e.creaseLight != "number" && (e.creaseLight = .6), typeof e.creaseSharpness != "number" && (e.creaseSharpness = .589), typeof e.creaseSoftness != "number" && (e.creaseSoftness = 1), typeof e.sheen != "number" && (e.sheen = 0), typeof e.roundness != "number" && (e.roundness = 0), typeof e.iridescence != "number" && (e.iridescence = 0), typeof e.edgeFade != "number" && (e.edgeFade = .04), typeof e.edgeFeather != "number" && (e.edgeFeather = .1), typeof e.depthTint != "number" && (e.depthTint = 0), typeof e.depthTintColor != "string" && (e.depthTintColor = "#0a2540"), e.displaceFrequency ||= {
11579
+ Tl(e), Number.isFinite(e.gradientAngle) || (e.gradientAngle = 90), Number.isFinite(e.gradientShift) || (e.gradientShift = .15), typeof e.usePaletteTexture != "boolean" && (e.usePaletteTexture = !0), typeof e.paletteSource != "string" && (e.paletteSource = "hero"), typeof e.paletteEdgeColor != "string" && (e.paletteEdgeColor = "#8e9dff"), Number.isFinite(e.paletteEdgeAmount) || (e.paletteEdgeAmount = .3), Number.isFinite(e.paletteDriftX) || (e.paletteDriftX = 0), Number.isFinite(e.paletteDriftY) || (e.paletteDriftY = 0), Number.isFinite(e.hueShift) || (e.hueShift = 0), Number.isFinite(e.colorContrast) || (e.colorContrast = 1), Number.isFinite(e.colorSaturation) || (e.colorSaturation = 1), Number.isFinite(e.fiberCount) || (e.fiberCount = 600), Number.isFinite(e.fiberStrength) || (e.fiberStrength = .2), Array.isArray(e.noiseBands) || (e.noiseBands = []), Nl(e), Number.isFinite(e.texture) || (e.texture = 0), Number.isFinite(e.creaseLight) || (e.creaseLight = .6), Number.isFinite(e.creaseSharpness) || (e.creaseSharpness = .589), Number.isFinite(e.creaseSoftness) || (e.creaseSoftness = 1), Number.isFinite(e.sheen) || (e.sheen = 0), Number.isFinite(e.roundness) || (e.roundness = 0), Number.isFinite(e.iridescence) || (e.iridescence = 0), Number.isFinite(e.edgeFade) || (e.edgeFade = .04), Number.isFinite(e.edgeFeather) || (e.edgeFeather = .1), Number.isFinite(e.depthTint) || (e.depthTint = 0), typeof e.depthTintColor != "string" && (e.depthTintColor = "#0a2540"), e.displaceFrequency ||= {
11572
11580
  x: .003234,
11573
11581
  y: .00799
11574
- }, typeof e.displaceAmount != "number" && (e.displaceAmount = 6.051), typeof e.detailFrequency != "number" && (e.detailFrequency = .04), typeof e.detailAmount != "number" && (e.detailAmount = 0), e.twistFrequency ||= {
11582
+ }, Number.isFinite(e.displaceAmount) || (e.displaceAmount = 6.051), Number.isFinite(e.detailFrequency) || (e.detailFrequency = .04), Number.isFinite(e.detailAmount) || (e.detailAmount = 0), e.twistFrequency ||= {
11575
11583
  x: -.055,
11576
11584
  y: .077,
11577
11585
  z: -.518
@@ -11579,7 +11587,7 @@ function Ol(e) {
11579
11587
  x: 3.95,
11580
11588
  y: 5.85,
11581
11589
  z: 6.33
11582
- }, typeof e.theme != "string" && (e.theme = "solid"), typeof e.lineAmount != "number" && (e.lineAmount = 425), typeof e.lineThickness != "number" && (e.lineThickness = 1), typeof e.lineDerivativePower != "number" && (e.lineDerivativePower = .95), typeof e.maxWidth != "number" && (e.maxWidth = 1232), e.position ||= {
11590
+ }, typeof e.twistMotion != "boolean" && (e.twistMotion = !1), Number.isFinite(e.helixTurns) || (e.helixTurns = 0), Number.isFinite(e.helixRadius) || (e.helixRadius = 0), Number.isFinite(e.helixRoll) || (e.helixRoll = 0), Number.isFinite(e.helixPhase) || (e.helixPhase = 0), typeof e.theme != "string" && (e.theme = "solid"), Number.isFinite(e.lineAmount) || (e.lineAmount = 425), Number.isFinite(e.lineThickness) || (e.lineThickness = 1), Number.isFinite(e.lineDerivativePower) || (e.lineDerivativePower = .95), Number.isFinite(e.rungAmount) || (e.rungAmount = 0), Number.isFinite(e.rungThickness) || (e.rungThickness = 1), Number.isFinite(e.maxWidth) || (e.maxWidth = 1232), e.position ||= {
11583
11591
  x: 0,
11584
11592
  y: 0,
11585
11593
  z: 0
@@ -11591,25 +11599,38 @@ function Ol(e) {
11591
11599
  x: 10,
11592
11600
  y: 10,
11593
11601
  z: 7
11594
- }, typeof e.blendMode != "string" && (e.blendMode = "squared"), typeof e.speed != "number" && (e.speed = .04), typeof e.opacity != "number" && (e.opacity = 1), typeof e.seed != "number" && (e.seed = 0), e.interaction && Nl(e);
11602
+ }, typeof e.blendMode != "string" && (e.blendMode = "squared"), Number.isFinite(e.speed) || (e.speed = .04), Number.isFinite(e.opacity) || (e.opacity = 1), Number.isFinite(e.seed) || (e.seed = 0), e.interaction && Il(e);
11595
11603
  }
11596
11604
  function kl(e) {
11597
- El(e), Dl(e), typeof e.ambient != "number" && (e.ambient = .45), Array.isArray(e.lights) || (e.lights = []), typeof e.quality != "number" && (e.quality = 1), typeof e.dprMax != "number" && (e.dprMax = 2), typeof e.grain != "number" && (e.grain = 1.1), typeof e.blur != "number" && (e.blur = .02), typeof e.blurSamples != "number" && (e.blurSamples = 6), typeof e.bloomStrength != "number" && (e.bloomStrength = 0), typeof e.bloomRadius != "number" && (e.bloomRadius = .4), typeof e.bloomThreshold != "number" && (e.bloomThreshold = .85), typeof e.dither != "number" && (e.dither = 0), typeof e.ditherScale != "number" && (e.ditherScale = 2), typeof e.ditherSteps != "number" && (e.ditherSteps = 4), typeof e.innerLight != "number" && (e.innerLight = 0), typeof e.innerLightDensity != "number" && (e.innerLightDensity = .5), typeof e.innerLightDecay != "number" && (e.innerLightDecay = .95), typeof e.innerLightX != "number" && (e.innerLightX = .5), typeof e.innerLightY != "number" && (e.innerLightY = .15), typeof e.halftone != "number" && (e.halftone = 0), typeof e.halftoneCell != "number" && (e.halftoneCell = 6), typeof e.halftoneAngle != "number" && (e.halftoneAngle = .4), typeof e.heatmap != "number" && (e.heatmap = 0), typeof e.paperTexture != "number" && (e.paperTexture = 0), typeof e.paperTextureScale != "number" && (e.paperTextureScale = 2), typeof e.halftoneCmyk != "number" && (e.halftoneCmyk = 0), typeof e.halftoneCmykCell != "number" && (e.halftoneCmykCell = 6), typeof e.showCameraRig != "boolean" && (e.showCameraRig = !1), typeof e.paused != "boolean" && (e.paused = !1), typeof e.loopSeconds != "number" && (e.loopSeconds = 0), typeof e.mirrorH != "boolean" && (e.mirrorH = !1), typeof e.mirrorV != "boolean" && (e.mirrorV = !1);
11605
+ El(e), Dl(e), Number.isFinite(e.ambient) || (e.ambient = .45), Array.isArray(e.lights) || (e.lights = []), Ml(e), Number.isFinite(e.quality) || (e.quality = 1), Number.isFinite(e.dprMax) || (e.dprMax = 2), Number.isFinite(e.grain) || (e.grain = 1.1), Number.isFinite(e.blur) || (e.blur = .02), Number.isFinite(e.blurSamples) || (e.blurSamples = 6), Number.isFinite(e.bloomStrength) || (e.bloomStrength = 0), Number.isFinite(e.bloomRadius) || (e.bloomRadius = .4), Number.isFinite(e.bloomThreshold) || (e.bloomThreshold = .85), Number.isFinite(e.dither) || (e.dither = 0), Number.isFinite(e.ditherScale) || (e.ditherScale = 2), Number.isFinite(e.ditherSteps) || (e.ditherSteps = 4), Number.isFinite(e.innerLight) || (e.innerLight = 0), Number.isFinite(e.innerLightDensity) || (e.innerLightDensity = .5), Number.isFinite(e.innerLightDecay) || (e.innerLightDecay = .95), Number.isFinite(e.innerLightX) || (e.innerLightX = .5), Number.isFinite(e.innerLightY) || (e.innerLightY = .15), Number.isFinite(e.halftone) || (e.halftone = 0), Number.isFinite(e.halftoneCell) || (e.halftoneCell = 6), Number.isFinite(e.halftoneAngle) || (e.halftoneAngle = .4), Number.isFinite(e.heatmap) || (e.heatmap = 0), Number.isFinite(e.paperTexture) || (e.paperTexture = 0), Number.isFinite(e.paperTextureScale) || (e.paperTextureScale = 2), Number.isFinite(e.halftoneCmyk) || (e.halftoneCmyk = 0), Number.isFinite(e.halftoneCmykCell) || (e.halftoneCmykCell = 6), typeof e.showCameraRig != "boolean" && (e.showCameraRig = !1), typeof e.paused != "boolean" && (e.paused = !1), Number.isFinite(e.timeOffset) || (e.timeOffset = 0), Number.isFinite(e.loopSeconds) || (e.loopSeconds = 0), typeof e.mirrorH != "boolean" && (e.mirrorH = !1), typeof e.mirrorV != "boolean" && (e.mirrorV = !1);
11598
11606
  }
11599
11607
  function Al(e, t, n, r) {
11600
11608
  let i = Number(e);
11601
11609
  return Number.isFinite(i) ? pl(i, t, n) : r;
11602
11610
  }
11603
- function jl(e) {
11604
- return typeof e == "string" && (Hl.includes(e) || e.startsWith("custom:") && e.length > 7);
11611
+ function jl(e, t) {
11612
+ let n = Number(e);
11613
+ return Number.isFinite(n) ? n : t;
11605
11614
  }
11606
- function Ml(e, t) {
11615
+ function Ml(e) {
11616
+ e.lights = e.lights.filter((e) => typeof e == "object" && !!e);
11617
+ for (let t of e.lights) (typeof t.position != "object" || t.position === null) && (t.position = { ...Gl }), t.position.x = jl(t.position.x, Gl.x), t.position.y = jl(t.position.y, Gl.y), t.position.z = jl(t.position.z, Gl.z), typeof t.color != "string" && (t.color = "#ffffff"), t.intensity = jl(t.intensity, 1);
11618
+ }
11619
+ function Nl(e) {
11620
+ e.noiseBands = e.noiseBands.filter((e) => typeof e == "object" && !!e);
11621
+ let t = _l();
11622
+ for (let n of e.noiseBands) n.startX = jl(n.startX, t.startX), n.endX = jl(n.endX, t.endX), n.startY = jl(n.startY, t.startY), n.endY = jl(n.endY, t.endY), n.feather = jl(n.feather, t.feather), n.strength = jl(n.strength, t.strength), n.frequency = jl(n.frequency, t.frequency), n.colorAttenuation = jl(n.colorAttenuation, t.colorAttenuation), n.parabolaPower = jl(n.parabolaPower, t.parabolaPower);
11623
+ }
11624
+ function Pl(e) {
11625
+ return typeof e == "string" && (Kl.includes(e) || e.startsWith("custom:") && e.length > 7);
11626
+ }
11627
+ function Fl(e, t) {
11607
11628
  let n = [];
11608
11629
  if (!Array.isArray(e)) return n;
11609
11630
  for (let r of e) {
11610
11631
  if (!r || typeof r != "object") continue;
11611
11632
  let e = r;
11612
- if (!jl(e.source) || !t.includes(e.target)) continue;
11633
+ if (!Pl(e.source) || !t.includes(e.target)) continue;
11613
11634
  let i = Number(e.to);
11614
11635
  if (!Number.isFinite(i)) continue;
11615
11636
  let a = {
@@ -11625,26 +11646,31 @@ function Ml(e, t) {
11625
11646
  }
11626
11647
  return n;
11627
11648
  }
11628
- function Nl(e) {
11649
+ function Il(e) {
11629
11650
  let t = e.interaction;
11630
11651
  if (!t) return;
11631
11652
  let n = t.hover;
11632
- n && (n.agitate !== void 0 && (n.agitate = Al(n.agitate, 0, 60, 0)), n.push !== void 0 && (n.push = Al(n.push, -40, 40, 0)), n.wake !== void 0 && (n.wake = Al(n.wake, 0, 40, 0)), n.thin !== void 0 && (n.thin = Al(n.thin, 0, 1, 0)), n.hueShift !== void 0 && (n.hueShift = Al(n.hueShift, -360, 360, 0)), n.lighten !== void 0 && (n.lighten = Al(n.lighten, -1, 1, 0)), n.smoothing !== void 0 && (n.smoothing = Al(n.smoothing, 0, 2, .12))), t.press && t.press.ripple !== void 0 && (t.press.ripple = Al(t.press.ripple, 0, 60, 0)), t.bindings !== void 0 && (t.bindings = Ml(t.bindings, Ul));
11653
+ n && (n.agitate !== void 0 && (n.agitate = Al(n.agitate, 0, 60, 0)), n.push !== void 0 && (n.push = Al(n.push, -40, 40, 0)), n.wake !== void 0 && (n.wake = Al(n.wake, 0, 40, 0)), n.thin !== void 0 && (n.thin = Al(n.thin, 0, 1, 0)), n.hueShift !== void 0 && (n.hueShift = Al(n.hueShift, -360, 360, 0)), n.lighten !== void 0 && (n.lighten = Al(n.lighten, -1, 1, 0)), n.smoothing !== void 0 && (n.smoothing = Al(n.smoothing, 0, 2, .12))), t.press && t.press.ripple !== void 0 && (t.press.ripple = Al(t.press.ripple, 0, 60, 0)), t.bindings !== void 0 && (t.bindings = Fl(t.bindings, ql));
11633
11654
  }
11634
- function Pl(e) {
11655
+ function Ll(e) {
11635
11656
  let t = e.interaction;
11636
- t && (t.radius !== void 0 && (t.radius = Al(t.radius, .02, 2, .3)), t.ribbonFlow !== void 0 && (t.ribbonFlow = Al(t.ribbonFlow, 0, 1, .8)), t.bindings !== void 0 && (t.bindings = Ml(t.bindings, Wl)));
11657
+ t && (t.radius !== void 0 && (t.radius = Al(t.radius, .02, 2, .3)), t.ribbonFlow !== void 0 && (t.ribbonFlow = Al(t.ribbonFlow, 0, 1, .8)), t.bindings !== void 0 && (t.bindings = Fl(t.bindings, Jl)));
11637
11658
  }
11638
- function Fl(e) {
11659
+ function Rl(e) {
11639
11660
  let t = e;
11640
- return kl(t), (!Array.isArray(t.waves) || t.waves.length === 0) && (t.waves = [Sl()]), t.waves.forEach(Ol), t.waveCount = t.waves.length, t.interaction && Pl(t), t;
11641
- }
11642
- var Il, Ll, Rl, zl, Bl, Vl, Hl, Ul, Wl, Gl = t((() => {
11643
- hl(), Il = 8, Ll = 8, Rl = 8, zl = 4, Bl = 6, Vl = {
11661
+ return kl(t), (!Array.isArray(t.waves) || t.waves.length === 0) && (t.waves = [Sl()]), t.waves.forEach(Ol), t.waveCount = t.waves.length, t.interaction && Ll(t), t;
11662
+ }
11663
+ var zl, Bl, Vl, Hl, Ul, Wl, Gl, Kl, ql, Jl, Yl = t((() => {
11664
+ hl(), zl = 8, Bl = 8, Vl = 8, Hl = 4, Ul = 6, Wl = [
11665
+ "cover",
11666
+ "contain",
11667
+ "width",
11668
+ "height"
11669
+ ], Gl = {
11644
11670
  x: 800,
11645
11671
  y: 900,
11646
11672
  z: 1100
11647
- }, Hl = [
11673
+ }, Kl = [
11648
11674
  "scroll",
11649
11675
  "hover",
11650
11676
  "pointerX",
@@ -11653,7 +11679,7 @@ var Il, Ll, Rl, zl, Bl, Vl, Hl, Ul, Wl, Gl = t((() => {
11653
11679
  "press",
11654
11680
  "scrollVelocity",
11655
11681
  "appear"
11656
- ], Ul = [
11682
+ ], ql = [
11657
11683
  "displaceAmount",
11658
11684
  "detailAmount",
11659
11685
  "twistPowerX",
@@ -11662,6 +11688,9 @@ var Il, Ll, Rl, zl, Bl, Vl, Hl, Ul, Wl, Gl = t((() => {
11662
11688
  "twistFrequencyX",
11663
11689
  "twistFrequencyY",
11664
11690
  "twistFrequencyZ",
11691
+ "helixPhase",
11692
+ "helixTurns",
11693
+ "helixRadius",
11665
11694
  "hueShift",
11666
11695
  "gradientShift",
11667
11696
  "colorSaturation",
@@ -11673,15 +11702,47 @@ var Il, Ll, Rl, zl, Bl, Vl, Hl, Ul, Wl, Gl = t((() => {
11673
11702
  "iridescence",
11674
11703
  "positionX",
11675
11704
  "positionY"
11676
- ], Wl = [
11705
+ ], Jl = [
11677
11706
  "timeOffset",
11678
11707
  "cameraZoom",
11679
11708
  "blur",
11680
11709
  "grain"
11681
11710
  ];
11682
- })), Kl, ql, Jl, Yl, Xl, Zl, Ql, $l, eu, tu, nu, ru, iu, au, ou = t((() => {
11683
- Gl(), Kl = "\nfloat xxhash(vec2 x){\n uvec2 t = floatBitsToUint(x);\n uint h = 0xc2b2ae3du * t.x + 0x165667b9u;\n h = (h << 17u | h >> 15u) * 0x27d4eb2fu;\n h += 0xc2b2ae3du * t.y;\n h = (h << 17u | h >> 15u) * 0x27d4eb2fu;\n h ^= h >> 15u;\n h *= 0x85ebca77u;\n h ^= h >> 13u;\n h *= 0xc2b2ae3du;\n h ^= h >> 16u;\n return uintBitsToFloat(h >> 9u | 0x3f800000u) - 1.0;\n}\nvec2 hash(vec2 x){\n float k = 6.283185307 * xxhash(x);\n return vec2(cos(k), sin(k));\n}\nfloat simplexNoise(in vec2 p){\n const float K1 = 0.366025404; // (sqrt(3)-1)/2\n const float K2 = 0.211324865; // (3-sqrt(3))/6\n vec2 i = floor(p + (p.x + p.y) * K1);\n vec2 a = p - i + (i.x + i.y) * K2;\n float m = step(a.y, a.x);\n vec2 o = vec2(m, 1.0 - m);\n vec2 b = a - o + K2;\n vec2 c = a - 1.0 + 2.0 * K2;\n vec3 h = max(0.5 - vec3(dot(a, a), dot(b, b), dot(c, c)), 0.0);\n vec3 n = h * h * h * vec3(dot(a, hash(i + 0.0)), dot(b, hash(i + o)), dot(c, hash(i + 1.0)));\n return dot(n, vec3(32.99)); // analytic factor (= 2916*sqrt(2)/125)\n}\n", ql = "\nuniform vec3 uColors[MAX_COLORS];\nuniform float uColorPos[MAX_COLORS];\nuniform int uColorCount;\nuniform int uGradType;\nuniform float uGradAngle;\nuniform float uGradShift;\nuniform vec2 uMeshPointPos[MAX_MESH_POINTS];\nuniform vec3 uMeshPointColor[MAX_MESH_POINTS];\nuniform float uMeshPointInfluence[MAX_MESH_POINTS];\nuniform int uMeshPointCount;\nuniform float uMeshSoftness;\nuniform sampler2D uPalette; // baked 2D palette texture\nuniform float uUsePalette; // >0.5 = sample the texture; else procedural grad()\nuniform float uPaletteRaw; // >0.5 = sample palette by raw (uv.x,uv.y), not gradCoord\nuniform vec2 uPaletteScale;\nuniform vec2 uPaletteOffset;\nuniform float uPaletteRotation;\nuniform float uHueShift;\nuniform float uContrast;\nuniform float uSaturation;\nuniform float uOpacity;\nuniform float uSquared; // 1 = square the output colour (the deep \"squared\" hero look)\n", Jl = "\nvec3 contrastFn(vec3 v, float a){ return (v - 0.5) * a + 0.5; }\nvec3 desaturate(vec3 color, float factor){\n vec3 gray = vec3(dot(vec3(0.299, 0.587, 0.114), color));\n return mix(color, gray, factor);\n}\nvec3 hueShift(vec3 color, float shift){\n vec3 g = vec3(0.57735);\n vec3 proj = g * dot(g, color);\n vec3 U = color - proj;\n vec3 W = cross(g, U);\n return U * cos(shift) + W * sin(shift) + proj;\n}\n\n// Our gradient: interpolate stops by their positions (uColorPos sorted ascending).\nvec3 grad(float u){\n u = clamp(u, 0.0, 1.0);\n vec3 col = uColors[0];\n for (int i = 0; i < MAX_COLORS - 1; i++){\n if (i >= uColorCount - 1) break;\n float p0 = uColorPos[i];\n float p1 = uColorPos[i + 1];\n if (u >= p0){\n float t = clamp((u - p0) / max(p1 - p0, 1e-5), 0.0, 1.0);\n col = mix(uColors[i], uColors[i + 1], t);\n }\n }\n return col;\n}\n\n// iOS-style 2D colour field. Each control point contributes an inverse-distance\n// weight; normalising the sum fills the whole surface without dark seams.\nvec3 meshGradient(vec2 uv){\n vec3 colorSum = vec3(0.0);\n float weightSum = 0.0;\n float exponent = mix(4.8, 1.35, clamp(uMeshSoftness, 0.0, 1.0));\n for (int i = 0; i < MAX_MESH_POINTS; i++){\n if (i >= uMeshPointCount) break;\n float influence = max(uMeshPointInfluence[i], 0.05);\n float distanceFromPoint = length(uv - uMeshPointPos[i]) / influence;\n float weight = 1.0 / (pow(max(distanceFromPoint, 0.012), exponent) + 0.002);\n colorSum += uMeshPointColor[i] * weight;\n weightSum += weight;\n }\n return colorSum / max(weightSum, 0.0001);\n}\n\n// Map a surface uv to the 0–1 gradient coordinate per gradient type. uGradShift\n// adds a low-frequency simplex warp so the colour varies in 2D (along the length\n// as well as across the width) — a 2D palette feel instead\n// of flat 1-D bands.\nfloat gradCoord(vec2 uv){\n float warp = uGradShift * simplexNoise(uv * 1.6 + 4.0);\n if (uGradType == 1){ return clamp(length(uv - 0.5) * 2.0 + warp, 0.0, 1.0); } // radial\n if (uGradType == 2){ return fract(atan(uv.y - 0.5, uv.x - 0.5) / (2.0 * PI) + 0.5 + warp); } // conic\n vec2 dir = vec2(sin(uGradAngle), cos(uGradAngle)); // linear, angled\n return clamp(dot(uv - 0.5, dir) + 0.5 + warp, 0.0, 1.0);\n}\n\n// One base-colour sample for the whole surface: rotate/scale/offset the raw-palette uv,\n// then pick the mesh field / baked 2D texture / procedural stops by mode. The raw palette\n// is sampled by (uv.x, uv.y) directly; the stops-generated texture is sampled via\n// gradCoord so its angle/type/warp still apply.\nvec3 waveBaseColor(vec2 uv){\n float gc = gradCoord(uv);\n vec2 mediaUv = uv - 0.5;\n float mediaCos = cos(uPaletteRotation);\n float mediaSin = sin(uPaletteRotation);\n mediaUv = vec2(\n mediaCos * mediaUv.x + mediaSin * mediaUv.y,\n -mediaSin * mediaUv.x + mediaCos * mediaUv.y\n );\n mediaUv = mediaUv * uPaletteScale + 0.5 + uPaletteOffset;\n vec2 puv = uPaletteRaw > 0.5\n ? clamp(mediaUv, 0.0, 1.0)\n : vec2(gc, clamp(uv.y, 0.0, 1.0));\n return uGradType == 3\n ? meshGradient(uv)\n : (uUsePalette > 0.5 ? texture2D(uPalette, puv).rgb : grad(gc));\n}\n\n// The shared colour grade: contrast → desaturate → hue rotate (degrees).\nvec3 applyColorGrade(vec3 c){\n c = contrastFn(c, uContrast);\n c = desaturate(c, 1.0 - uSaturation);\n return hueShift(c, radians(uHueShift));\n}\n", Yl = `
11684
- ${Kl}
11711
+ })), Xl, Zl, Ql, $l, eu, tu, nu = t((() => {
11712
+ Vc(), Xl = 400, Zl = 16, Ql = Xl / 4, $l = new K(1, 0, 0), eu = new K(0, 1, 0), tu = class {
11713
+ geometry;
11714
+ segments = -1;
11715
+ constructor(e) {
11716
+ this.geometry = new Rr(), this.resize(e);
11717
+ }
11718
+ resize(e) {
11719
+ if (e === this.segments) return;
11720
+ this.segments = e;
11721
+ let t = Gt.clamp(Math.round(e), 48, 200), n = t * 2, r = new wi(Xl, Xl, t, n), i = r.attributes.position, a = r.attributes.uv, o = new K();
11722
+ for (let e = 0; e < i.count; e++) {
11723
+ o.fromBufferAttribute(i, e);
11724
+ let t = a.getY(e), n = 4 - 2 * (4 * t * (1 - t)) ** 9.5;
11725
+ o.x < -16 ? o.z += n : o.x < Zl ? (o.z = Math.cos(Gt.mapLinear(o.x, -16, Zl, 0, Math.PI)) * n, o.x = Math.cos(Gt.mapLinear(o.x, -16, Zl, -Math.PI / 2, Math.PI / 2)) * n - Zl) : (o.z -= n, o.x = -o.x), o.x += Ql, o.applyAxisAngle($l, -Math.PI / 2), o.applyAxisAngle(eu, -Math.PI / 2), i.setXYZ(e, o.x, o.y, o.z);
11726
+ }
11727
+ i.needsUpdate = !0;
11728
+ let s = t + 1, c = r.getIndex(), l = c ? Array.from(c.array) : [];
11729
+ for (let e = 0; e < n; e++) {
11730
+ let n = e * s, r = (e + 1) * s, i = n + t, a = r + t;
11731
+ l.push(n, i, r, r, i, a);
11732
+ }
11733
+ for (let e of [0, n]) {
11734
+ let n = e * s;
11735
+ for (let r = 1; r < t; r++) l.push(n, e * s + r, e * s + r + 1);
11736
+ }
11737
+ r.setIndex(l), r.computeVertexNormals(), this.geometry.setIndex(r.getIndex()), this.geometry.setAttribute("position", r.getAttribute("position")), this.geometry.setAttribute("uv", r.getAttribute("uv")), this.geometry.setAttribute("normal", r.getAttribute("normal")), this.geometry.computeBoundingSphere(), r.dispose();
11738
+ }
11739
+ dispose() {
11740
+ this.geometry.dispose();
11741
+ }
11742
+ };
11743
+ })), ru, iu, au, ou, su, cu, lu, uu, du, fu, pu, mu, hu, gu, _u = t((() => {
11744
+ Yl(), nu(), ru = "\nfloat xxhash(vec2 x){\n uvec2 t = floatBitsToUint(x);\n uint h = 0xc2b2ae3du * t.x + 0x165667b9u;\n h = (h << 17u | h >> 15u) * 0x27d4eb2fu;\n h += 0xc2b2ae3du * t.y;\n h = (h << 17u | h >> 15u) * 0x27d4eb2fu;\n h ^= h >> 15u;\n h *= 0x85ebca77u;\n h ^= h >> 13u;\n h *= 0xc2b2ae3du;\n h ^= h >> 16u;\n return uintBitsToFloat(h >> 9u | 0x3f800000u) - 1.0;\n}\nvec2 hash(vec2 x){\n float k = 6.283185307 * xxhash(x);\n return vec2(cos(k), sin(k));\n}\nfloat simplexNoise(in vec2 p){\n const float K1 = 0.366025404; // (sqrt(3)-1)/2\n const float K2 = 0.211324865; // (3-sqrt(3))/6\n vec2 i = floor(p + (p.x + p.y) * K1);\n vec2 a = p - i + (i.x + i.y) * K2;\n float m = step(a.y, a.x);\n vec2 o = vec2(m, 1.0 - m);\n vec2 b = a - o + K2;\n vec2 c = a - 1.0 + 2.0 * K2;\n vec3 h = max(0.5 - vec3(dot(a, a), dot(b, b), dot(c, c)), 0.0);\n vec3 n = h * h * h * vec3(dot(a, hash(i + 0.0)), dot(b, hash(i + o)), dot(c, hash(i + 1.0)));\n return dot(n, vec3(32.99)); // analytic factor (= 2916*sqrt(2)/125)\n}\n", iu = "\nuniform vec3 uColors[MAX_COLORS];\nuniform float uColorPos[MAX_COLORS];\nuniform int uColorCount;\nuniform int uGradType;\nuniform float uGradAngle;\nuniform float uGradShift;\nuniform vec2 uMeshPointPos[MAX_MESH_POINTS];\nuniform vec3 uMeshPointColor[MAX_MESH_POINTS];\nuniform float uMeshPointInfluence[MAX_MESH_POINTS];\nuniform int uMeshPointCount;\nuniform float uMeshSoftness;\nuniform sampler2D uPalette; // baked 2D palette texture\nuniform float uUsePalette; // >0.5 = sample the texture; else procedural grad()\nuniform float uPaletteRaw; // >0.5 = sample palette by raw (uv.x,uv.y), not gradCoord\nuniform vec2 uPaletteScale;\nuniform vec2 uPaletteOffset;\nuniform float uPaletteRotation;\nuniform float uHueShift;\nuniform float uContrast;\nuniform float uSaturation;\nuniform float uOpacity;\nuniform float uSquared; // 1 = square the output colour (the deep \"squared\" hero look)\n", au = "\nvec3 contrastFn(vec3 v, float a){ return (v - 0.5) * a + 0.5; }\nvec3 desaturate(vec3 color, float factor){\n vec3 gray = vec3(dot(vec3(0.299, 0.587, 0.114), color));\n return mix(color, gray, factor);\n}\nvec3 hueShift(vec3 color, float shift){\n vec3 g = vec3(0.57735);\n vec3 proj = g * dot(g, color);\n vec3 U = color - proj;\n vec3 W = cross(g, U);\n return U * cos(shift) + W * sin(shift) + proj;\n}\n\n// Our gradient: interpolate stops by their positions (uColorPos sorted ascending).\nvec3 grad(float u){\n u = clamp(u, 0.0, 1.0);\n vec3 col = uColors[0];\n for (int i = 0; i < MAX_COLORS - 1; i++){\n if (i >= uColorCount - 1) break;\n float p0 = uColorPos[i];\n float p1 = uColorPos[i + 1];\n if (u >= p0){\n float t = clamp((u - p0) / max(p1 - p0, 1e-5), 0.0, 1.0);\n col = mix(uColors[i], uColors[i + 1], t);\n }\n }\n return col;\n}\n\n// iOS-style 2D colour field. Each control point contributes an inverse-distance\n// weight; normalising the sum fills the whole surface without dark seams.\nvec3 meshGradient(vec2 uv){\n vec3 colorSum = vec3(0.0);\n float weightSum = 0.0;\n float exponent = mix(4.8, 1.35, clamp(uMeshSoftness, 0.0, 1.0));\n for (int i = 0; i < MAX_MESH_POINTS; i++){\n if (i >= uMeshPointCount) break;\n float influence = max(uMeshPointInfluence[i], 0.05);\n float distanceFromPoint = length(uv - uMeshPointPos[i]) / influence;\n float weight = 1.0 / (pow(max(distanceFromPoint, 0.012), exponent) + 0.002);\n colorSum += uMeshPointColor[i] * weight;\n weightSum += weight;\n }\n return colorSum / max(weightSum, 0.0001);\n}\n\n// Map a surface uv to the 0–1 gradient coordinate per gradient type. uGradShift\n// adds a low-frequency simplex warp so the colour varies in 2D (along the length\n// as well as across the width) — a 2D palette feel instead\n// of flat 1-D bands.\nfloat gradCoord(vec2 uv){\n float warp = uGradShift * simplexNoise(uv * 1.6 + 4.0);\n if (uGradType == 1){ return clamp(length(uv - 0.5) * 2.0 + warp, 0.0, 1.0); } // radial\n if (uGradType == 2){ return fract(atan(uv.y - 0.5, uv.x - 0.5) / (2.0 * PI) + 0.5 + warp); } // conic\n vec2 dir = vec2(sin(uGradAngle), cos(uGradAngle)); // linear, angled\n return clamp(dot(uv - 0.5, dir) + 0.5 + warp, 0.0, 1.0);\n}\n\n// One base-colour sample for the whole surface: rotate/scale/offset the raw-palette uv,\n// then pick the mesh field / baked 2D texture / procedural stops by mode. The raw palette\n// is sampled by (uv.x, uv.y) directly; the stops-generated texture is sampled via\n// gradCoord so its angle/type/warp still apply.\nvec3 waveBaseColor(vec2 uv){\n float gc = gradCoord(uv);\n vec2 mediaUv = uv - 0.5;\n float mediaCos = cos(uPaletteRotation);\n float mediaSin = sin(uPaletteRotation);\n mediaUv = vec2(\n mediaCos * mediaUv.x + mediaSin * mediaUv.y,\n -mediaSin * mediaUv.x + mediaCos * mediaUv.y\n );\n mediaUv = mediaUv * uPaletteScale + 0.5 + uPaletteOffset;\n vec2 puv = uPaletteRaw > 0.5\n ? clamp(mediaUv, 0.0, 1.0)\n : vec2(gc, clamp(uv.y, 0.0, 1.0));\n return uGradType == 3\n ? meshGradient(uv)\n : (uUsePalette > 0.5 ? texture2D(uPalette, puv).rgb : grad(gc));\n}\n\n// The shared colour grade: contrast → desaturate → hue rotate (degrees).\nvec3 applyColorGrade(vec3 c){\n c = contrastFn(c, uContrast);\n c = desaturate(c, 1.0 - uSaturation);\n return hueShift(c, radians(uHueShift));\n}\n", ou = `
11745
+ ${ru}
11685
11746
 
11686
11747
  uniform float uTime, uSpeed, uSeed;
11687
11748
  uniform float uDispFreqX, uDispFreqZ, uDispAmount;
@@ -11689,6 +11750,15 @@ uniform float uDetailFreq, uDetailAmount; // 2nd displacement octave (only read
11689
11750
  uniform float uTwFreqX, uTwFreqY, uTwFreqZ, uTwPowX, uTwPowY, uTwPowZ;
11690
11751
  uniform float uLoopSeconds; // seamless-loop period (only read under LOOP_MOTION)
11691
11752
 
11753
+ // Helix (optional). Behind HELIX so a wave without one compiles the exact same program — same
11754
+ // byte-identity contract as the pointer block below.
11755
+ #ifdef HELIX
11756
+ uniform float uHelixTurns; // full turns from one end of the ribbon to the other
11757
+ uniform float uHelixRadius; // orbit radius: carries the whole ribbon around the axis
11758
+ uniform float uHelixRoll; // cross-section roll, as a fraction of the turns (1 = rigid ladder)
11759
+ uniform float uHelixPhase; // degrees
11760
+ #endif
11761
+
11692
11762
  varying vec2 vUv;
11693
11763
  varying vec3 vWorldPos;
11694
11764
  varying vec3 vViewDir;
@@ -11777,6 +11847,28 @@ void main(){
11777
11847
  #endif
11778
11848
  #endif
11779
11849
 
11850
+ #ifdef HELIX
11851
+ // Helix — the one shape the three twists below cannot reach. Their angle is freq * expStep(uv),
11852
+ // a MONOTONE falloff, so it can only ramp once; this one is periodic in uv.y (the length), so
11853
+ // uHelixTurns full turns land evenly from end to end. Runs AFTER the displacement so the noise
11854
+ // above still samples the undeformed pos.x/pos.z (byte-identical sampling), and BEFORE the twist
11855
+ // so the two compose.
11856
+ // roll rolls the ribbon's own cross-section about the axis in step with the sweep, swinging
11857
+ // its two long edges onto opposite sides — one wave becomes a ladder whose edges are
11858
+ // both strands (pair with the wireframe theme's rungs for the rungs between them).
11859
+ // radius carries the whole ribbon around the axis instead, orientation intact — a narrow ribbon
11860
+ // then reads as ONE strand, and a second wave at phase+180 is the other.
11861
+ float hAng = 6.28318530718 * uHelixTurns * uv.y + radians(uHelixPhase);
11862
+ // Roll about the ribbon's width centre, not the origin — see RIBBON_Z_CENTER in WaveGeometry.
11863
+ float rollA = hAng * uHelixRoll;
11864
+ float rollC = cos(rollA), rollS = sin(rollA);
11865
+ vec2 rel = vec2(pos.y, pos.z - ${(-8).toFixed(1)});
11866
+ pos.y = rel.x * rollC - rel.y * rollS;
11867
+ pos.z = ${(-8).toFixed(1)} + rel.x * rollS + rel.y * rollC;
11868
+ pos.y += uHelixRadius * cos(hAng);
11869
+ pos.z += uHelixRadius * sin(hAng);
11870
+ #endif
11871
+
11780
11872
  // The X-twist frequency feeding rotB. Two modes: by default uTwFreqX is used
11781
11873
  // directly; the variant (used by the Wave 4 preset) modulates it with
11782
11874
  // simplex noise indexed along the ribbon (uv.y) so the twist breathes over time.
@@ -11884,16 +11976,16 @@ void main(){
11884
11976
  gl_Position = projectionMatrix * viewMatrix * world;
11885
11977
  vClipPosition = gl_Position;
11886
11978
  }
11887
- `, Xl = `
11979
+ `, su = `
11888
11980
  #define MAX_COLORS 8
11889
11981
  #define MAX_MESH_POINTS 8
11890
11982
  #define MAX_LIGHTS 8
11891
11983
  #define MAX_NOISE_BANDS 4
11892
11984
  #define PI 3.14159265359
11893
11985
 
11894
- ${Kl}
11986
+ ${ru}
11895
11987
 
11896
- ${ql}
11988
+ ${iu}
11897
11989
  uniform float uDebug; // dev: 1 = show crease, 2 = show derivative normal
11898
11990
  uniform float uSheen; // white-lift on the flat (low-crease) areas (1 = full)
11899
11991
  uniform float uRoundness; // pose-robust normal-based roundness/thickness strength
@@ -11940,7 +12032,7 @@ float grainHash(vec2 p){ return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758
11940
12032
  float parabola(float x, float k){ return pow(4.0 * x * (1.0 - x), k); }
11941
12033
  float mapLinear(float v, float a, float b, float c, float d){ return c + (v - a) * (d - c) / (b - a); }
11942
12034
 
11943
- ${Jl}
12035
+ ${au}
11944
12036
 
11945
12037
  // Striations: a subtle high-frequency simplex-noise grain ADDED to the
11946
12038
  // colour — colour-matched (weaker where blue is high), only near folds (crease), and
@@ -12089,18 +12181,23 @@ void main(){
12089
12181
  gl_FragColor.rgb *= gl_FragColor.a;
12090
12182
  #endif
12091
12183
  }
12092
- `, Zl = `
12184
+ `, cu = `
12093
12185
  #define MAX_COLORS 8
12094
12186
  #define MAX_MESH_POINTS 8
12095
12187
  #define PI 3.14159265359
12096
12188
 
12097
- ${Kl}
12189
+ ${ru}
12098
12190
 
12099
- ${ql}
12191
+ ${iu}
12100
12192
  uniform float uLineAmount; // default 425
12101
12193
  uniform float uLineThickness; // default 1
12102
12194
  uniform float uLineDerivativePower; // default 0.95
12103
12195
  uniform float uMaxWidth; // default 1232
12196
+ // Cross-wise rungs (optional) — behind RUNGS so a wave without them compiles the same program.
12197
+ #ifdef RUNGS
12198
+ uniform float uRungAmount; // frequency across the ribbon (rungs ≈ amount / π)
12199
+ uniform float uRungThickness; // rung width in pixels
12200
+ #endif
12104
12201
  uniform vec3 uClearColor; // = page background colour (shown between the lines)
12105
12202
 
12106
12203
  varying vec2 vUv;
@@ -12112,7 +12209,7 @@ uniform float uPointerLighten; // -1..1 local brightness lift near the cursor
12112
12209
  varying float vPointerFall; // falloff × presence, written by the vertex shader
12113
12210
  #endif
12114
12211
 
12115
- ${Jl}
12212
+ ${au}
12116
12213
 
12117
12214
  void main(){
12118
12215
  // Same 2D palette sample + colour ops as the solid theme.
@@ -12132,6 +12229,16 @@ void main(){
12132
12229
  float a = abs(sin(vUv.x * uLineAmount));
12133
12230
  a = smoothstep(lineThickness, 0.0, a);
12134
12231
 
12232
+ #ifdef RUNGS
12233
+ // Rungs: the same carve at constant uv.y instead of uv.x, so this family runs ACROSS the ribbon
12234
+ // where the one above runs along it — together they read as a ladder. Width comes from fwidth()
12235
+ // rather than the lengthwise term's dFdy(vUv).x, which is the derivative of the wrong axis for
12236
+ // this direction: |sin| climbs by ~uRungAmount·fwidth(vUv.y) per pixel, so scaling by that keeps
12237
+ // a rung uRungThickness pixels wide at any zoom or ribbon scale.
12238
+ float rung = abs(sin(vUv.y * uRungAmount));
12239
+ a = max(a, smoothstep(uRungThickness * uRungAmount * fwidth(vUv.y), 0.0, rung));
12240
+ #endif
12241
+
12135
12242
  // Depth fade: the wave recedes into the background colour with depth. Watch the
12136
12243
  // argument order: clamp(0.0, 1.0, z*6) is a swapped-args trap — it clamps the
12137
12244
  // constant 0.0 into [1.0, z*6], i.e. min(1.0, z*6), which (with our ortho clip.z
@@ -12145,151 +12252,128 @@ void main(){
12145
12252
  gl_FragColor.rgb *= gl_FragColor.a;
12146
12253
  #endif
12147
12254
  }
12148
- `, Ql = "\nvarying vec2 vUv;\nvoid main(){\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n", $l = "\nuniform sampler2D tDiffuse;\nuniform vec2 uResolution;\nuniform float uBlurAmount;\nuniform int uBlurSamples;\nuniform float uGrainAmount;\nuniform float uTime;\nvarying vec2 vUv;\n\nfloat random2(vec2 st){ return fract(sin(dot(st.xy, vec2(12.9898, 78.233))) * 43758.5453); }\n\n// Angular (spin) blur: rotate the sample coord around the centre and\n// accumulate — a tangential smear that grows toward the edges. Carries alpha so a\n// transparent background survives the post pass.\nvec4 blurAngular(sampler2D tex, vec2 uv, float angle, int samples){\n vec4 total = vec4(0.0);\n vec2 coord = uv - 0.5;\n float dist = 1.0 / float(samples);\n vec2 dir = vec2(cos(angle * dist), sin(angle * dist));\n mat2 rot = mat2(dir.x, dir.y, -dir.y, dir.x);\n for (int i = 0; i < 64; i++){\n if (i >= samples) break;\n total += texture2D(tex, coord + 0.5);\n coord = coord * rot; // row-vector order (coord * rot) sets the spin direction\n }\n return total * dist;\n}\n\nvoid main(){\n vec4 sceneColor = texture2D(tDiffuse, vUv);\n vec4 blurColor = blurAngular(tDiffuse, vUv, uBlurAmount, uBlurSamples);\n // blurPower: keep a sharp band weighted to the middle, blurring toward top & bottom.\n float blurPower = smoothstep(0.0, 0.7, vUv.y) - smoothstep(0.2, 1.0, vUv.y);\n vec4 color = mix(blurColor, sceneColor, blurPower);\n // Static film grain: keyed off gl_FragCoord only (no uTime), so it doesn't flicker.\n color.rgb += mix(uGrainAmount, -uGrainAmount, random2(gl_FragCoord.xy * 0.01)) * (4.0 / 255.0);\n gl_FragColor = color; // preserve alpha → transparent background works\n}\n", eu = "\nuniform sampler2D tDiffuse;\nuniform vec2 uResolution;\nuniform float uDitherStrength; // 0..1 mix back toward the original\nuniform float uDitherScale; // pixel-block size in device px (paper: u_pxSize)\nuniform float uDitherSteps; // quantization levels (paper: u_colorSteps)\nvarying vec2 vUv;\n\nconst int bayer2x2[4] = int[4](0, 2, 3, 1);\nconst int bayer4x4[16] = int[16](0, 8, 2, 10, 12, 4, 14, 6, 3, 11, 1, 9, 15, 7, 13, 5);\nconst int bayer8x8[64] = int[64](\n 0, 32, 8, 40, 2, 34, 10, 42, 48, 16, 56, 24, 50, 18, 58, 26,\n 12, 44, 4, 36, 14, 46, 6, 38, 60, 28, 52, 20, 62, 30, 54, 22,\n 3, 35, 11, 43, 1, 33, 9, 41, 51, 19, 59, 27, 49, 17, 57, 25,\n 15, 47, 7, 39, 13, 45, 5, 37, 63, 31, 55, 23, 61, 29, 53, 21\n);\nfloat getBayerValue(vec2 uv, int size){\n ivec2 pos = ivec2(fract(uv / float(size)) * float(size));\n int index = pos.y * size + pos.x;\n if (size == 2) return float(bayer2x2[index]) / 4.0;\n else if (size == 4) return float(bayer4x4[index]) / 16.0;\n else if (size == 8) return float(bayer8x8[index]) / 64.0;\n return 0.0;\n}\n\nvoid main(){\n float pxSize = max(uDitherScale, 1.0);\n vec2 pxSizeUV = gl_FragCoord.xy / pxSize;\n vec2 sampleUV = (floor(gl_FragCoord.xy / pxSize) + 0.5) * pxSize / max(uResolution, vec2(1.0));\n vec4 image = texture2D(tDiffuse, sampleUV);\n\n float lum = dot(vec3(0.2126, 0.7152, 0.0722), image.rgb);\n float colorSteps = max(floor(uDitherSteps), 1.0);\n\n float dithering = getBayerValue(pxSizeUV, 8) - 0.5; // paper's default 8x8 ordered screen\n float brightness = clamp(lum + dithering / colorSteps, 0.0, 1.0);\n brightness = mix(0.0, brightness, image.a);\n float quantLum = floor(brightness * colorSteps + 0.5) / colorSteps;\n\n // paper's \"original colours\" path: keep the source hue, quantize luminance.\n vec3 color = image.rgb / max(lum, 0.001) * quantLum;\n float quantAlpha = floor(image.a * colorSteps + 0.5) / colorSteps;\n float opacity = mix(quantLum, 1.0, quantAlpha);\n\n gl_FragColor = mix(image, vec4(color, opacity), clamp(uDitherStrength, 0.0, 1.0));\n}\n", tu = "\nuniform sampler2D tDiffuse;\nuniform float uInnerLight; // 0..1 strength of the added light\nuniform float uInnerLightDensity; // ray length / spread\nuniform float uInnerLightDecay; // per-sample falloff (<1)\nuniform vec2 uInnerLightCenter; // light source, UV (0..1)\nvarying vec2 vUv;\n\nconst int LIGHT_SAMPLES = 24;\n\nfloat luma(vec3 c){ return dot(c, vec3(0.2126, 0.7152, 0.0722)); }\n\nvoid main(){\n vec4 src = texture2D(tDiffuse, vUv);\n vec2 delta = (vUv - uInnerLightCenter) * (uInnerLightDensity / float(LIGHT_SAMPLES));\n vec2 coord = vUv;\n float decay = 1.0;\n vec3 rays = vec3(0.0);\n for (int i = 0; i < LIGHT_SAMPLES; i++){\n coord -= delta;\n vec4 s = texture2D(tDiffuse, coord);\n rays += s.rgb * s.a * decay; // only opaque (wave) pixels emit light\n decay *= uInnerLightDecay;\n }\n rays /= float(LIGHT_SAMPLES);\n vec3 outc = src.rgb + rays * uInnerLight;\n float outA = max(src.a, luma(rays) * uInnerLight); // shafts stay visible over the transparent bg\n gl_FragColor = vec4(outc, clamp(outA, 0.0, 1.0));\n}\n", nu = "\nuniform sampler2D tDiffuse;\nuniform vec2 uResolution;\nuniform float uHalftone; // 0..1 mix\nuniform float uHalftoneCell; // dot cell size in device px (paper: u_size)\nuniform float uHalftoneAngle; // screen rotation (radians, paper: u_rotation)\nvarying vec2 vUv;\n\nfloat sigmoid(float x, float k){ return 1.0 / (1.0 + exp(-k * (x - 0.5))); }\n// paper's classic dot: radius grows as the sampled cell darkens (1 - lum), soft edge via fwidth.\nfloat getCircle(vec2 uv, float lum, float baseR){\n float r = mix(0.25 * baseR, 0.0, lum);\n float d = length(uv - 0.5);\n float aa = fwidth(d);\n return 1.0 - smoothstep(r - aa, r + aa, d);\n}\n\nvoid main(){\n float ca = cos(uHalftoneAngle);\n float sa = sin(uHalftoneAngle);\n mat2 rot = mat2(ca, sa, -sa, ca);\n float cell = max(uHalftoneCell, 2.0);\n vec2 gridPx = rot * gl_FragCoord.xy; // rotate the screen into the dot grid\n vec2 cellId = floor(gridPx / cell);\n vec2 inCell = fract(gridPx / cell); // position within the cell (0..1)\n vec2 centrePx = transpose(rot) * ((cellId + 0.5) * cell); // cell centre, back in screen px\n vec4 tex = texture2D(tDiffuse, centrePx / max(uResolution, vec2(1.0)));\n\n float k = 2.0; // sigmoid contrast (paper default)\n vec3 c = vec3(sigmoid(tex.r, k), sigmoid(tex.g, k), sigmoid(tex.b, k));\n float lum = dot(vec3(0.2126, 0.7152, 0.0722), c);\n lum = mix(1.0, lum, tex.a);\n float dot = getCircle(inCell, lum, 1.3); // baseR 1.3 ≈ paper original-colours default\n vec4 dots = vec4(tex.rgb, tex.a * dot); // wave-coloured dots, transparent between\n gl_FragColor = mix(texture2D(tDiffuse, vUv), dots, clamp(uHalftone, 0.0, 1.0));\n}\n", ru = "\nuniform sampler2D tDiffuse;\nuniform float uHeatmap; // 0..1 mix\nvarying vec2 vUv;\nvec3 heat(float t){\n t = clamp(t, 0.0, 1.0);\n vec3 c = mix(vec3(0.0, 0.0, 0.4), vec3(0.0, 0.6, 1.0), smoothstep(0.0, 0.25, t));\n c = mix(c, vec3(0.0, 1.0, 0.4), smoothstep(0.25, 0.5, t));\n c = mix(c, vec3(1.0, 1.0, 0.0), smoothstep(0.5, 0.75, t));\n c = mix(c, vec3(1.0, 0.1, 0.0), smoothstep(0.75, 1.0, t));\n return c;\n}\nvoid main(){\n vec4 src = texture2D(tDiffuse, vUv);\n float l = dot(src.rgb, vec3(0.299, 0.587, 0.114));\n gl_FragColor = vec4(mix(src.rgb, heat(l), clamp(uHeatmap, 0.0, 1.0)), src.a);\n}\n", iu = "\nuniform sampler2D tDiffuse;\nuniform float uPaper; // 0..1 strength\nuniform float uPaperScale; // grain scale\nvarying vec2 vUv;\nfloat h21(vec2 p){ return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453); }\nvoid main(){\n vec4 src = texture2D(tDiffuse, vUv);\n vec2 p = gl_FragCoord.xy / max(uPaperScale, 0.5);\n float fiber = h21(floor(p)) * 0.5 + h21(floor(p * vec2(0.3, 3.0))) * 0.5; // directional fibers\n float tex = mix(fiber, h21(gl_FragCoord.xy), 0.3); // + fine speckle\n float shade = 1.0 - (tex - 0.5) * 0.35;\n gl_FragColor = vec4(src.rgb * mix(1.0, shade, clamp(uPaper, 0.0, 1.0)), src.a);\n}\n", au = "\nuniform sampler2D tDiffuse;\nuniform float uHalftoneCmyk; // 0..1 mix\nuniform float uHalftoneCmykCell; // dot cell size in device px\nvarying vec2 vUv;\n// One rotated halftone dot screen for a channel value.\nfloat dotScreen(vec2 coord, float value, float angle, float cell){\n float ca = cos(angle);\n float sa = sin(angle);\n vec2 r = mat2(ca, sa, -sa, ca) * coord;\n vec2 c = fract(r / max(cell, 2.0)) - 0.5;\n float radius = sqrt(clamp(value, 0.0, 1.0)) * 0.5;\n return smoothstep(radius, radius - 0.06, length(c));\n}\nvoid main(){\n vec4 src = texture2D(tDiffuse, vUv);\n float k = 1.0 - max(max(src.r, src.g), src.b); // RGB → CMYK\n float invK = max(1.0 - k, 1e-3);\n float cyan = (1.0 - src.r - k) / invK;\n float mag = (1.0 - src.g - k) / invK;\n float yel = (1.0 - src.b - k) / invK;\n vec2 coord = gl_FragCoord.xy;\n float cell = uHalftoneCmykCell;\n float dc = dotScreen(coord, cyan, 1.309, cell); // 75°\n float dm = dotScreen(coord, mag, 0.262, cell); // 15°\n float dy = dotScreen(coord, yel, 0.0, cell); // 0°\n float dk = dotScreen(coord, k, 0.785, cell); // 45°\n // Subtractive: cyan ink absorbs red, magenta absorbs green, yellow absorbs blue, black absorbs all.\n vec3 outc = vec3(1.0) - vec3(dc, 0.0, 0.0) - vec3(0.0, dm, 0.0) - vec3(0.0, 0.0, dy) - vec3(dk);\n outc = clamp(outc, 0.0, 1.0);\n gl_FragColor = vec4(mix(src.rgb, outc, clamp(uHalftoneCmyk, 0.0, 1.0)), src.a);\n}\n";
12149
- })), su, cu, lu, uu, du, fu, pu = t((() => {
12150
- Vc(), su = 400, cu = 16, lu = su / 4, uu = new K(1, 0, 0), du = new K(0, 1, 0), fu = class {
12151
- geometry;
12152
- segments = -1;
12153
- constructor(e) {
12154
- this.geometry = new Rr(), this.resize(e);
12155
- }
12156
- resize(e) {
12157
- if (e === this.segments) return;
12158
- this.segments = e;
12159
- let t = Gt.clamp(Math.round(e), 48, 200), n = t * 2, r = new wi(su, su, t, n), i = r.attributes.position, a = r.attributes.uv, o = new K();
12160
- for (let e = 0; e < i.count; e++) {
12161
- o.fromBufferAttribute(i, e);
12162
- let t = a.getY(e), n = 4 - 2 * (4 * t * (1 - t)) ** 9.5;
12163
- o.x < -16 ? o.z += n : o.x < cu ? (o.z = Math.cos(Gt.mapLinear(o.x, -16, cu, 0, Math.PI)) * n, o.x = Math.cos(Gt.mapLinear(o.x, -16, cu, -Math.PI / 2, Math.PI / 2)) * n - cu) : (o.z -= n, o.x = -o.x), o.x += lu, o.applyAxisAngle(uu, -Math.PI / 2), o.applyAxisAngle(du, -Math.PI / 2), i.setXYZ(e, o.x, o.y, o.z);
12164
- }
12165
- i.needsUpdate = !0;
12166
- let s = t + 1, c = r.getIndex(), l = c ? Array.from(c.array) : [];
12167
- for (let e = 0; e < n; e++) {
12168
- let n = e * s, r = (e + 1) * s, i = n + t, a = r + t;
12169
- l.push(n, i, r, r, i, a);
12170
- }
12171
- for (let e of [0, n]) {
12172
- let n = e * s;
12173
- for (let r = 1; r < t; r++) l.push(n, e * s + r, e * s + r + 1);
12174
- }
12175
- r.setIndex(l), r.computeVertexNormals(), this.geometry.setIndex(r.getIndex()), this.geometry.setAttribute("position", r.getAttribute("position")), this.geometry.setAttribute("uv", r.getAttribute("uv")), this.geometry.setAttribute("normal", r.getAttribute("normal")), this.geometry.computeBoundingSphere(), r.dispose();
12176
- }
12177
- dispose() {
12178
- this.geometry.dispose();
12179
- }
12180
- };
12255
+ `, lu = "\nvarying vec2 vUv;\nvoid main(){\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n", uu = "\nuniform sampler2D tDiffuse;\nuniform vec2 uResolution;\nuniform float uBlurAmount;\nuniform int uBlurSamples;\nuniform float uGrainAmount;\nuniform float uTime;\nvarying vec2 vUv;\n\nfloat random2(vec2 st){ return fract(sin(dot(st.xy, vec2(12.9898, 78.233))) * 43758.5453); }\n\n// Angular (spin) blur: rotate the sample coord around the centre and\n// accumulate — a tangential smear that grows toward the edges. Carries alpha so a\n// transparent background survives the post pass.\nvec4 blurAngular(sampler2D tex, vec2 uv, float angle, int samples){\n vec4 total = vec4(0.0);\n vec2 coord = uv - 0.5;\n float dist = 1.0 / float(samples);\n vec2 dir = vec2(cos(angle * dist), sin(angle * dist));\n mat2 rot = mat2(dir.x, dir.y, -dir.y, dir.x);\n for (int i = 0; i < 64; i++){\n if (i >= samples) break;\n total += texture2D(tex, coord + 0.5);\n coord = coord * rot; // row-vector order (coord * rot) sets the spin direction\n }\n return total * dist;\n}\n\nvoid main(){\n vec4 sceneColor = texture2D(tDiffuse, vUv);\n vec4 blurColor = blurAngular(tDiffuse, vUv, uBlurAmount, uBlurSamples);\n // blurPower: keep a sharp band weighted to the middle, blurring toward top & bottom.\n float blurPower = smoothstep(0.0, 0.7, vUv.y) - smoothstep(0.2, 1.0, vUv.y);\n vec4 color = mix(blurColor, sceneColor, blurPower);\n // Static film grain: keyed off gl_FragCoord only (no uTime), so it doesn't flicker.\n color.rgb += mix(uGrainAmount, -uGrainAmount, random2(gl_FragCoord.xy * 0.01)) * (4.0 / 255.0);\n gl_FragColor = color; // preserve alpha → transparent background works\n}\n", du = "\nuniform sampler2D tDiffuse;\nuniform vec2 uResolution;\nuniform float uDitherStrength; // 0..1 mix back toward the original\nuniform float uDitherScale; // pixel-block size in device px (paper: u_pxSize)\nuniform float uDitherSteps; // quantization levels (paper: u_colorSteps)\nvarying vec2 vUv;\n\nconst int bayer2x2[4] = int[4](0, 2, 3, 1);\nconst int bayer4x4[16] = int[16](0, 8, 2, 10, 12, 4, 14, 6, 3, 11, 1, 9, 15, 7, 13, 5);\nconst int bayer8x8[64] = int[64](\n 0, 32, 8, 40, 2, 34, 10, 42, 48, 16, 56, 24, 50, 18, 58, 26,\n 12, 44, 4, 36, 14, 46, 6, 38, 60, 28, 52, 20, 62, 30, 54, 22,\n 3, 35, 11, 43, 1, 33, 9, 41, 51, 19, 59, 27, 49, 17, 57, 25,\n 15, 47, 7, 39, 13, 45, 5, 37, 63, 31, 55, 23, 61, 29, 53, 21\n);\nfloat getBayerValue(vec2 uv, int size){\n ivec2 pos = ivec2(fract(uv / float(size)) * float(size));\n int index = pos.y * size + pos.x;\n if (size == 2) return float(bayer2x2[index]) / 4.0;\n else if (size == 4) return float(bayer4x4[index]) / 16.0;\n else if (size == 8) return float(bayer8x8[index]) / 64.0;\n return 0.0;\n}\n\nvoid main(){\n float pxSize = max(uDitherScale, 1.0);\n vec2 pxSizeUV = gl_FragCoord.xy / pxSize;\n vec2 sampleUV = (floor(gl_FragCoord.xy / pxSize) + 0.5) * pxSize / max(uResolution, vec2(1.0));\n vec4 image = texture2D(tDiffuse, sampleUV);\n\n float lum = dot(vec3(0.2126, 0.7152, 0.0722), image.rgb);\n float colorSteps = max(floor(uDitherSteps), 1.0);\n\n float dithering = getBayerValue(pxSizeUV, 8) - 0.5; // paper's default 8x8 ordered screen\n float brightness = clamp(lum + dithering / colorSteps, 0.0, 1.0);\n brightness = mix(0.0, brightness, image.a);\n float quantLum = floor(brightness * colorSteps + 0.5) / colorSteps;\n\n // paper's \"original colours\" path: keep the source hue, quantize luminance.\n vec3 color = image.rgb / max(lum, 0.001) * quantLum;\n float quantAlpha = floor(image.a * colorSteps + 0.5) / colorSteps;\n float opacity = mix(quantLum, 1.0, quantAlpha);\n\n gl_FragColor = mix(image, vec4(color, opacity), clamp(uDitherStrength, 0.0, 1.0));\n}\n", fu = "\nuniform sampler2D tDiffuse;\nuniform float uInnerLight; // 0..1 strength of the added light\nuniform float uInnerLightDensity; // ray length / spread\nuniform float uInnerLightDecay; // per-sample falloff (<1)\nuniform vec2 uInnerLightCenter; // light source, UV (0..1)\nvarying vec2 vUv;\n\nconst int LIGHT_SAMPLES = 24;\n\nfloat luma(vec3 c){ return dot(c, vec3(0.2126, 0.7152, 0.0722)); }\n\nvoid main(){\n vec4 src = texture2D(tDiffuse, vUv);\n vec2 delta = (vUv - uInnerLightCenter) * (uInnerLightDensity / float(LIGHT_SAMPLES));\n vec2 coord = vUv;\n float decay = 1.0;\n vec3 rays = vec3(0.0);\n for (int i = 0; i < LIGHT_SAMPLES; i++){\n coord -= delta;\n vec4 s = texture2D(tDiffuse, coord);\n rays += s.rgb * s.a * decay; // only opaque (wave) pixels emit light\n decay *= uInnerLightDecay;\n }\n rays /= float(LIGHT_SAMPLES);\n vec3 outc = src.rgb + rays * uInnerLight;\n float outA = max(src.a, luma(rays) * uInnerLight); // shafts stay visible over the transparent bg\n gl_FragColor = vec4(outc, clamp(outA, 0.0, 1.0));\n}\n", pu = "\nuniform sampler2D tDiffuse;\nuniform vec2 uResolution;\nuniform float uHalftone; // 0..1 mix\nuniform float uHalftoneCell; // dot cell size in device px (paper: u_size)\nuniform float uHalftoneAngle; // screen rotation (radians, paper: u_rotation)\nvarying vec2 vUv;\n\nfloat sigmoid(float x, float k){ return 1.0 / (1.0 + exp(-k * (x - 0.5))); }\n// paper's classic dot: radius grows as the sampled cell darkens (1 - lum), soft edge via fwidth.\nfloat getCircle(vec2 uv, float lum, float baseR){\n float r = mix(0.25 * baseR, 0.0, lum);\n float d = length(uv - 0.5);\n float aa = fwidth(d);\n return 1.0 - smoothstep(r - aa, r + aa, d);\n}\n\nvoid main(){\n float ca = cos(uHalftoneAngle);\n float sa = sin(uHalftoneAngle);\n mat2 rot = mat2(ca, sa, -sa, ca);\n float cell = max(uHalftoneCell, 2.0);\n vec2 gridPx = rot * gl_FragCoord.xy; // rotate the screen into the dot grid\n vec2 cellId = floor(gridPx / cell);\n vec2 inCell = fract(gridPx / cell); // position within the cell (0..1)\n vec2 centrePx = transpose(rot) * ((cellId + 0.5) * cell); // cell centre, back in screen px\n vec4 tex = texture2D(tDiffuse, centrePx / max(uResolution, vec2(1.0)));\n\n float k = 2.0; // sigmoid contrast (paper default)\n vec3 c = vec3(sigmoid(tex.r, k), sigmoid(tex.g, k), sigmoid(tex.b, k));\n float lum = dot(vec3(0.2126, 0.7152, 0.0722), c);\n lum = mix(1.0, lum, tex.a);\n float dot = getCircle(inCell, lum, 1.3); // baseR 1.3 ≈ paper original-colours default\n vec4 dots = vec4(tex.rgb, tex.a * dot); // wave-coloured dots, transparent between\n gl_FragColor = mix(texture2D(tDiffuse, vUv), dots, clamp(uHalftone, 0.0, 1.0));\n}\n", mu = "\nuniform sampler2D tDiffuse;\nuniform float uHeatmap; // 0..1 mix\nvarying vec2 vUv;\nvec3 heat(float t){\n t = clamp(t, 0.0, 1.0);\n vec3 c = mix(vec3(0.0, 0.0, 0.4), vec3(0.0, 0.6, 1.0), smoothstep(0.0, 0.25, t));\n c = mix(c, vec3(0.0, 1.0, 0.4), smoothstep(0.25, 0.5, t));\n c = mix(c, vec3(1.0, 1.0, 0.0), smoothstep(0.5, 0.75, t));\n c = mix(c, vec3(1.0, 0.1, 0.0), smoothstep(0.75, 1.0, t));\n return c;\n}\nvoid main(){\n vec4 src = texture2D(tDiffuse, vUv);\n float l = dot(src.rgb, vec3(0.299, 0.587, 0.114));\n gl_FragColor = vec4(mix(src.rgb, heat(l), clamp(uHeatmap, 0.0, 1.0)), src.a);\n}\n", hu = "\nuniform sampler2D tDiffuse;\nuniform float uPaper; // 0..1 strength\nuniform float uPaperScale; // grain scale\nvarying vec2 vUv;\nfloat h21(vec2 p){ return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453); }\nvoid main(){\n vec4 src = texture2D(tDiffuse, vUv);\n vec2 p = gl_FragCoord.xy / max(uPaperScale, 0.5);\n float fiber = h21(floor(p)) * 0.5 + h21(floor(p * vec2(0.3, 3.0))) * 0.5; // directional fibers\n float tex = mix(fiber, h21(gl_FragCoord.xy), 0.3); // + fine speckle\n float shade = 1.0 - (tex - 0.5) * 0.35;\n gl_FragColor = vec4(src.rgb * mix(1.0, shade, clamp(uPaper, 0.0, 1.0)), src.a);\n}\n", gu = "\nuniform sampler2D tDiffuse;\nuniform float uHalftoneCmyk; // 0..1 mix\nuniform float uHalftoneCmykCell; // dot cell size in device px\nvarying vec2 vUv;\n// One rotated halftone dot screen for a channel value.\nfloat dotScreen(vec2 coord, float value, float angle, float cell){\n float ca = cos(angle);\n float sa = sin(angle);\n vec2 r = mat2(ca, sa, -sa, ca) * coord;\n vec2 c = fract(r / max(cell, 2.0)) - 0.5;\n float radius = sqrt(clamp(value, 0.0, 1.0)) * 0.5;\n return smoothstep(radius, radius - 0.06, length(c));\n}\nvoid main(){\n vec4 src = texture2D(tDiffuse, vUv);\n float k = 1.0 - max(max(src.r, src.g), src.b); // RGB → CMYK\n float invK = max(1.0 - k, 1e-3);\n float cyan = (1.0 - src.r - k) / invK;\n float mag = (1.0 - src.g - k) / invK;\n float yel = (1.0 - src.b - k) / invK;\n vec2 coord = gl_FragCoord.xy;\n float cell = uHalftoneCmykCell;\n float dc = dotScreen(coord, cyan, 1.309, cell); // 75°\n float dm = dotScreen(coord, mag, 0.262, cell); // 15°\n float dy = dotScreen(coord, yel, 0.0, cell); // 0°\n float dk = dotScreen(coord, k, 0.785, cell); // 45°\n // Subtractive: cyan ink absorbs red, magenta absorbs green, yellow absorbs blue, black absorbs all.\n vec3 outc = vec3(1.0) - vec3(dc, 0.0, 0.0) - vec3(0.0, dm, 0.0) - vec3(0.0, 0.0, dy) - vec3(dk);\n outc = clamp(outc, 0.0, 1.0);\n gl_FragColor = vec4(mix(src.rgb, outc, clamp(uHalftoneCmyk, 0.0, 1.0)), src.a);\n}\n";
12181
12256
  }));
12182
12257
  //#endregion
12183
12258
  //#region src/renderer/interaction.ts
12184
- function mu(e, t) {
12259
+ function vu(e, t) {
12185
12260
  return e > 0 ? 1 - Math.exp(-t / e) : 1;
12186
12261
  }
12187
- function hu(e, t, n, r, i, a) {
12262
+ function yu(e, t, n, r, i, a) {
12188
12263
  if (a <= 0) return;
12189
- let o = a > ju ? Math.min(Math.ceil(a / ju), Mu) : 1, s = a / o, c = r * r, l = 2 * i * r;
12264
+ let o = a > Fu ? Math.min(Math.ceil(a / Fu), Iu) : 1, s = a / o, c = r * r, l = 2 * i * r;
12190
12265
  for (let r = 0; r < o; r++) t.x += (c * (n.x - e.x) - l * t.x) * s, t.y += (c * (n.y - e.y) - l * t.y) * s, e.x += t.x * s, e.y += t.y * s;
12191
12266
  }
12192
- function gu(e) {
12267
+ function bu(e) {
12193
12268
  return e.interaction?.enabled !== !1;
12194
12269
  }
12195
- function _u(e) {
12270
+ function xu(e) {
12196
12271
  let t = e.interaction;
12197
12272
  return !!t && (!!t.hover || (t.press?.ripple ?? 0) > 0);
12198
12273
  }
12199
- function vu(e, t) {
12200
- return gu(e) && _u(t);
12274
+ function Su(e, t) {
12275
+ return bu(e) && xu(t);
12201
12276
  }
12202
- function yu(e, t) {
12203
- return gu(e) && (t.interaction?.press?.ripple ?? 0) > 0;
12277
+ function Cu(e, t) {
12278
+ return bu(e) && (t.interaction?.press?.ripple ?? 0) > 0;
12204
12279
  }
12205
- function bu(e) {
12206
- return gu(e) && e.waves.some(_u);
12280
+ function wu(e) {
12281
+ return bu(e) && e.waves.some(xu);
12207
12282
  }
12208
- function xu(e) {
12209
- return gu(e) ? (e.interaction?.bindings?.length ?? 0) > 0 ? !0 : e.waves.some((e) => {
12283
+ function Tu(e) {
12284
+ return bu(e) ? (e.interaction?.bindings?.length ?? 0) > 0 ? !0 : e.waves.some((e) => {
12210
12285
  let t = e.interaction;
12211
12286
  return !!t && (!!t.hover || (t.press?.ripple ?? 0) > 0 || (t.bindings?.length ?? 0) > 0);
12212
12287
  }) : !1;
12213
12288
  }
12214
- var Su, Cu, wu, Tu, Eu, Du, Ou, ku, Au, ju, Mu, Nu, Pu, Fu, Iu, Lu, Ru = t((() => {
12215
- Vc(), hl(), Su = 1.5, Cu = .08, wu = 4, Tu = 2, Eu = .15, Du = .12, Ou = .25, ku = .7, Au = .02, ju = 1 / 120, Mu = 6, Nu = (e, t) => ({
12289
+ var Eu, Du, Ou, ku, Au, ju, Mu, Nu, Pu, Fu, Iu, Lu, Ru, zu, Bu, Vu, Hu = t((() => {
12290
+ Vc(), hl(), Eu = 1.5, Du = .08, Ou = 4, ku = 2, Au = .15, ju = .12, Mu = .25, Nu = .7, Pu = .02, Fu = 1 / 120, Iu = 6, Lu = (e, t) => ({
12216
12291
  base: e,
12217
12292
  apply: t
12218
- }), Pu = (e, t) => ({
12293
+ }), Ru = (e, t) => ({
12219
12294
  base: e,
12220
12295
  apply: t
12221
- }), Fu = {
12222
- displaceAmount: Nu((e) => e.displaceAmount, (e, t) => {
12296
+ }), zu = {
12297
+ displaceAmount: Lu((e) => e.displaceAmount, (e, t) => {
12223
12298
  t.u.uDispAmount.value = e;
12224
12299
  }),
12225
- detailAmount: Nu((e) => e.detailAmount ?? 0, (e, t) => {
12300
+ detailAmount: Lu((e) => e.detailAmount ?? 0, (e, t) => {
12226
12301
  t.u.uDetailAmount.value = e;
12227
12302
  }),
12228
- twistPowerX: Nu((e) => e.twistPower.x, (e, t) => {
12303
+ twistPowerX: Lu((e) => e.twistPower.x, (e, t) => {
12229
12304
  t.u.uTwPowX.value = e;
12230
12305
  }),
12231
- twistPowerY: Nu((e) => e.twistPower.y, (e, t) => {
12306
+ twistPowerY: Lu((e) => e.twistPower.y, (e, t) => {
12232
12307
  t.u.uTwPowY.value = e;
12233
12308
  }),
12234
- twistPowerZ: Nu((e) => e.twistPower.z, (e, t) => {
12309
+ twistPowerZ: Lu((e) => e.twistPower.z, (e, t) => {
12235
12310
  t.u.uTwPowZ.value = e;
12236
12311
  }),
12237
- twistFrequencyX: Nu((e) => e.twistFrequency.x, (e, t) => {
12312
+ twistFrequencyX: Lu((e) => e.twistFrequency.x, (e, t) => {
12238
12313
  t.u.uTwFreqX.value = e;
12239
12314
  }),
12240
- twistFrequencyY: Nu((e) => e.twistFrequency.y, (e, t) => {
12315
+ twistFrequencyY: Lu((e) => e.twistFrequency.y, (e, t) => {
12241
12316
  t.u.uTwFreqY.value = e;
12242
12317
  }),
12243
- twistFrequencyZ: Nu((e) => e.twistFrequency.z, (e, t) => {
12318
+ twistFrequencyZ: Lu((e) => e.twistFrequency.z, (e, t) => {
12244
12319
  t.u.uTwFreqZ.value = e;
12245
12320
  }),
12246
- hueShift: Nu((e) => e.hueShift, (e, t) => {
12321
+ hueShift: Lu((e) => e.hueShift, (e, t) => {
12247
12322
  t.u.uHueShift.value = e;
12248
12323
  }),
12249
- gradientShift: Nu((e) => e.gradientShift ?? 0, (e, t) => {
12324
+ gradientShift: Lu((e) => e.gradientShift ?? 0, (e, t) => {
12250
12325
  t.u.uGradShift.value = e;
12251
12326
  }),
12252
- colorSaturation: Nu((e) => e.colorSaturation, (e, t) => {
12327
+ colorSaturation: Lu((e) => e.colorSaturation, (e, t) => {
12253
12328
  t.u.uSaturation.value = e;
12254
12329
  }),
12255
- opacity: Nu((e) => e.opacity, (e, t) => {
12330
+ opacity: Lu((e) => e.opacity, (e, t) => {
12256
12331
  t.u.uOpacity.value = e;
12257
12332
  }),
12258
- lineThickness: Nu((e) => e.lineThickness ?? 1, (e, t) => {
12333
+ lineThickness: Lu((e) => e.lineThickness ?? 1, (e, t) => {
12259
12334
  t.u.uLineThickness.value = e;
12260
12335
  }),
12261
- lineAmount: Nu((e) => e.lineAmount ?? 425, (e, t) => {
12336
+ lineAmount: Lu((e) => e.lineAmount ?? 425, (e, t) => {
12262
12337
  t.u.uLineAmount.value = e;
12263
12338
  }),
12264
- fiberStrength: Nu((e) => e.fiberStrength, (e, t) => {
12339
+ fiberStrength: Lu((e) => e.fiberStrength, (e, t) => {
12265
12340
  t.u.uFiberStrength.value = e;
12266
12341
  }),
12267
- sheen: Nu((e) => e.sheen ?? 1, (e, t) => {
12342
+ sheen: Lu((e) => e.sheen ?? 1, (e, t) => {
12268
12343
  t.u.uSheen.value = e;
12269
12344
  }),
12270
- iridescence: Nu((e) => e.iridescence ?? 0, (e, t) => {
12345
+ iridescence: Lu((e) => e.iridescence ?? 0, (e, t) => {
12271
12346
  t.u.uIridescence.value = e;
12272
12347
  }),
12273
- positionX: Nu((e) => e.position.x, (e, t) => {
12348
+ helixPhase: Lu((e) => e.helixPhase ?? 0, (e, t) => {
12349
+ t.u.uHelixPhase.value = e;
12350
+ }),
12351
+ helixTurns: Lu((e) => e.helixTurns ?? 0, (e, t) => {
12352
+ t.u.uHelixTurns.value = e;
12353
+ }),
12354
+ helixRadius: Lu((e) => e.helixRadius ?? 0, (e, t) => {
12355
+ t.u.uHelixRadius.value = e;
12356
+ }),
12357
+ positionX: Lu((e) => e.position.x, (e, t) => {
12274
12358
  t.mesh.position.x = e;
12275
12359
  }),
12276
- positionY: Nu((e) => e.position.y, (e, t) => {
12360
+ positionY: Lu((e) => e.position.y, (e, t) => {
12277
12361
  t.mesh.position.y = e;
12278
12362
  })
12279
- }, Iu = {
12280
- timeOffset: Pu((e) => e.timeOffset ?? 0, (e, t) => {
12363
+ }, Bu = {
12364
+ timeOffset: Ru((e) => e.timeOffset ?? 0, (e, t) => {
12281
12365
  t.out.timeOffset = e;
12282
12366
  }),
12283
- cameraZoom: Pu((e) => e.cameraZoom ?? 1, (e, t) => {
12367
+ cameraZoom: Ru((e) => e.cameraZoom ?? 1, (e, t) => {
12284
12368
  t.out.zoom = e;
12285
12369
  }),
12286
- blur: Pu((e) => e.blur, (e, t) => {
12370
+ blur: Ru((e) => e.blur, (e, t) => {
12287
12371
  t.post.uBlurAmount.value = e;
12288
12372
  }),
12289
- grain: Pu((e) => e.grain, (e, t) => {
12373
+ grain: Ru((e) => e.grain, (e, t) => {
12290
12374
  t.post.uGrainAmount.value = e;
12291
12375
  })
12292
- }, Lu = class {
12376
+ }, Vu = class {
12293
12377
  container;
12294
12378
  cfg;
12295
12379
  scrollOverride = null;
@@ -12367,12 +12451,12 @@ var Su, Cu, wu, Tu, Eu, Du, Ou, ku, Au, ju, Mu, Nu, Pu, Fu, Iu, Lu, Ru = t((() =
12367
12451
  update(e) {
12368
12452
  let t = this.cfg();
12369
12453
  if (!t) return;
12370
- let n = Math.max(e, 0), r = mu(Du, n);
12454
+ let n = Math.max(e, 0), r = vu(ju, n);
12371
12455
  if (this.ndcPrev.copy(this.ndc), this.ndc.lerp(this.ndcTarget, r), this.presence += (this.presenceTarget - this.presence) * r, this.press += (this.pressTarget - this.press) * r, n > 1e-5) {
12372
- let e = mu(Cu, n);
12456
+ let e = vu(Du, n);
12373
12457
  this.velNdc.x += ((this.ndc.x - this.ndcPrev.x) / n - this.velNdc.x) * e, this.velNdc.y += ((this.ndc.y - this.ndcPrev.y) / n - this.velNdc.y) * e;
12374
12458
  }
12375
- this.pointerSpeed = this.presence * ml(this.velNdc.length() / wu);
12459
+ this.pointerSpeed = this.presence * ml(this.velNdc.length() / Ou);
12376
12460
  let i = t.waves;
12377
12461
  this.fields.length > i.length && (this.fields.length = i.length);
12378
12462
  for (let e = 0; e < i.length; e++) {
@@ -12382,19 +12466,19 @@ var Su, Cu, wu, Tu, Eu, Du, Ou, ku, Au, ju, Mu, Nu, Pu, Fu, Iu, Lu, Ru = t((() =
12382
12466
  vel: new G(),
12383
12467
  presence: this.presenceTarget
12384
12468
  }, this.fields[e] = t);
12385
- let r = Math.max(i[e].interaction?.hover?.smoothing ?? Du, Au);
12386
- hu(t.ndc, t.vel, this.ndcTarget, 1 / r, ku, n), t.presence += (this.presenceTarget - t.presence) * mu(r, n);
12469
+ let r = Math.max(i[e].interaction?.hover?.smoothing ?? ju, Pu);
12470
+ yu(t.ndc, t.vel, this.ndcTarget, 1 / r, Nu, n), t.presence += (this.presenceTarget - t.presence) * vu(r, n);
12387
12471
  }
12388
12472
  let a = this.scrollOverride ?? this.computeScroll();
12389
12473
  if (n > 1e-5) {
12390
12474
  let e = Math.abs(a - this.scrollPrev) / n;
12391
- this.scrollVel += (e - this.scrollVel) * mu(Eu, n);
12475
+ this.scrollVel += (e - this.scrollVel) * vu(Au, n);
12392
12476
  }
12393
12477
  this.scrollPrev = a, this.scroll = a, this.appearLatched = !0;
12394
12478
  for (let e of this.ripples) {
12395
12479
  if (!e.active) continue;
12396
12480
  e.age += n;
12397
- let t = Math.max(0, 1 - e.age / Su);
12481
+ let t = Math.max(0, 1 - e.age / Eu);
12398
12482
  e.amp = t * t, e.amp <= 0 && (e.active = !1);
12399
12483
  }
12400
12484
  this.updateBindings(t, n);
@@ -12416,7 +12500,7 @@ var Su, Cu, wu, Tu, Eu, Du, Ou, ku, Au, ju, Mu, Nu, Pu, Fu, Iu, Lu, Ru = t((() =
12416
12500
  (!r || r.source !== e.source) && (r = {
12417
12501
  value: e.source === "appear" ? 0 : n,
12418
12502
  source: e.source
12419
- }, this.bindingState.set(e, r)), r.value += (n - r.value) * mu(e.smoothing ?? Ou, t);
12503
+ }, this.bindingState.set(e, r)), r.value += (n - r.value) * vu(e.smoothing ?? Mu, t);
12420
12504
  }
12421
12505
  bindingValue(e) {
12422
12506
  return this.bindingState.get(e)?.value ?? 0;
@@ -12429,7 +12513,7 @@ var Su, Cu, wu, Tu, Eu, Du, Ou, ku, Au, ju, Mu, Nu, Pu, Fu, Iu, Lu, Ru = t((() =
12429
12513
  case "pointerY": return (this.ndc.y + 1) * .5;
12430
12514
  case "pointerSpeed": return this.pointerSpeed;
12431
12515
  case "press": return this.press;
12432
- case "scrollVelocity": return ml(this.scrollVel / Tu);
12516
+ case "scrollVelocity": return ml(this.scrollVel / ku);
12433
12517
  case "appear": return +!!this.appearLatched;
12434
12518
  default: return this.customInputs.get(e.slice(7)) ?? 0;
12435
12519
  }
@@ -12494,42 +12578,42 @@ var Su, Cu, wu, Tu, Eu, Du, Ou, ku, Au, ju, Mu, Nu, Pu, Fu, Iu, Lu, Ru = t((() =
12494
12578
  }));
12495
12579
  //#endregion
12496
12580
  //#region src/renderer/palette.ts
12497
- function zu(e) {
12581
+ function Uu(e) {
12498
12582
  return e * e * (3 - 2 * e);
12499
12583
  }
12500
- function Bu(e, t) {
12584
+ function Wu(e, t) {
12501
12585
  let n = new X(e).clone().convertLinearToSRGB();
12502
12586
  return `rgba(${Math.round(n.r * 255)}, ${Math.round(n.g * 255)}, ${Math.round(n.b * 255)}, ${t})`;
12503
12587
  }
12504
- function Vu(e) {
12588
+ function Gu(e) {
12505
12589
  let t = document.createElement("canvas");
12506
- t.width = od, t.height = sd;
12590
+ t.width = ud, t.height = dd;
12507
12591
  let n = t.getContext("2d");
12508
12592
  if (!n) return t;
12509
- let r = [...e.stops].sort((e, t) => e.pos - t.pos), i = n.createLinearGradient(0, 0, od, 0);
12593
+ let r = [...e.stops].sort((e, t) => e.pos - t.pos), i = n.createLinearGradient(0, 0, ud, 0);
12510
12594
  if (r.length === 0) i.addColorStop(0, "#ffffff");
12511
12595
  else for (let e of r) i.addColorStop(ml(e.pos), e.color);
12512
- n.fillStyle = i, n.fillRect(0, 0, od, sd);
12596
+ n.fillStyle = i, n.fillRect(0, 0, ud, dd);
12513
12597
  let a = ml(e.edgeAmount);
12514
12598
  if (a > .001) {
12515
- let t = n.createLinearGradient(0, 0, 0, sd);
12516
- t.addColorStop(0, Bu(e.edgeColor, a)), t.addColorStop(.5, Bu(e.edgeColor, 0)), t.addColorStop(1, Bu(e.edgeColor, a)), n.fillStyle = t, n.fillRect(0, 0, od, sd);
12599
+ let t = n.createLinearGradient(0, 0, 0, dd);
12600
+ t.addColorStop(0, Wu(e.edgeColor, a)), t.addColorStop(.5, Wu(e.edgeColor, 0)), t.addColorStop(1, Wu(e.edgeColor, a)), n.fillStyle = t, n.fillRect(0, 0, ud, dd);
12517
12601
  }
12518
12602
  return t;
12519
12603
  }
12520
- function Hu(e) {
12604
+ function Ku(e) {
12521
12605
  return `${e.stops.map((e) => `${e.color}@${e.pos.toFixed(3)}`).join(",")}|${e.edgeColor}|${e.edgeAmount.toFixed(3)}`;
12522
12606
  }
12523
- function Uu(e) {
12607
+ function qu(e) {
12524
12608
  return e.colorSpace = At, e.minFilter = z, e.magFilter = z, e.wrapS = he, e.wrapT = he, e.generateMipmaps = !1, e;
12525
12609
  }
12526
- function Wu(e) {
12527
- return Uu(new yi(e));
12610
+ function Ju(e) {
12611
+ return qu(new yi(e));
12528
12612
  }
12529
- function Gu(e) {
12530
- return Wu(Vu(e));
12613
+ function Yu(e) {
12614
+ return Ju(Gu(e));
12531
12615
  }
12532
- function Ku(e) {
12616
+ function Xu(e) {
12533
12617
  let t = document.createElement("canvas");
12534
12618
  t.width = Math.max(1, Math.round(e.width)), t.height = Math.max(1, Math.round(e.height));
12535
12619
  let n = t.getContext("2d");
@@ -12546,11 +12630,11 @@ function Ku(e) {
12546
12630
  else for (let e of l) c.addColorStop(ml(e.pos), e.color);
12547
12631
  return n.fillStyle = c, n.fillRect(0, 0, r, i), t;
12548
12632
  }
12549
- function qu(e) {
12633
+ function Zu(e) {
12550
12634
  let t = ml(e), n = t <= .0031308 ? t * 12.92 : 1.055 * t ** (1 / 2.4) - .055;
12551
12635
  return Math.round(ml(n) * 255);
12552
12636
  }
12553
- function Ju(e, t, n, r) {
12637
+ function Qu(e, t, n, r) {
12554
12638
  let i = Math.max(1, Math.round(n)), a = Math.max(1, Math.round(r)), o = new ImageData(i, a), s = o.data, c = e.length >= 2 ? e : yl(), l = c.map((e) => new X(e.color)), u = 4.8 + -3.4499999999999997 * ml(t);
12555
12639
  for (let e = 0; e < a; e++) {
12556
12640
  let t = 1 - e / Math.max(1, a - 1);
@@ -12561,12 +12645,12 @@ function Ju(e, t, n, r) {
12561
12645
  a += l[e].r * s, o += l[e].g * s, d += l[e].b * s, f += s;
12562
12646
  }
12563
12647
  let p = Math.max(f, 1e-4), m = (e * i + n) * 4;
12564
- s[m] = qu(a / p), s[m + 1] = qu(o / p), s[m + 2] = qu(d / p), s[m + 3] = 255;
12648
+ s[m] = Zu(a / p), s[m + 1] = Zu(o / p), s[m + 2] = Zu(d / p), s[m + 3] = 255;
12565
12649
  }
12566
12650
  }
12567
12651
  return o;
12568
12652
  }
12569
- function Yu(e, t, n, r) {
12653
+ function $u(e, t, n, r) {
12570
12654
  let i = document.createElement("canvas");
12571
12655
  i.width = Math.max(1, Math.round(n)), i.height = Math.max(1, Math.round(r));
12572
12656
  let a = i.getContext("2d");
@@ -12574,42 +12658,42 @@ function Yu(e, t, n, r) {
12574
12658
  let o = Math.min(1, 320 / Math.max(i.width, i.height)), s = Math.max(2, Math.round(i.width * o)), c = Math.max(2, Math.round(i.height * o)), l = document.createElement("canvas");
12575
12659
  l.width = s, l.height = c;
12576
12660
  let u = l.getContext("2d");
12577
- return u ? (u.putImageData(Ju(e, t, s, c), 0, 0), a.imageSmoothingEnabled = !0, a.imageSmoothingQuality = "high", a.drawImage(l, 0, 0, s, c, 0, 0, i.width, i.height), i) : i;
12661
+ return u ? (u.putImageData(Qu(e, t, s, c), 0, 0), a.imageSmoothingEnabled = !0, a.imageSmoothingQuality = "high", a.drawImage(l, 0, 0, s, c, 0, 0, i.width, i.height), i) : i;
12578
12662
  }
12579
- function Xu(e, t, n, r, i, a, o, s = 1, c = 0, l = 0) {
12663
+ function ed(e, t, n, r, i, a, o, s = 1, c = 0, l = 0) {
12580
12664
  let u = document.createElement("canvas");
12581
- return u.width = Math.max(1, Math.round(r)), u.height = Math.max(1, Math.round(i)), Zu(u, e, t, n, a, o, s, c, l), u;
12665
+ return u.width = Math.max(1, Math.round(r)), u.height = Math.max(1, Math.round(i)), td(u, e, t, n, a, o, s, c, l), u;
12582
12666
  }
12583
- function Zu(e, t, n, r, i, a, o = 1, s = 0, c = 0) {
12667
+ function td(e, t, n, r, i, a, o = 1, s = 0, c = 0) {
12584
12668
  let l = e.getContext("2d");
12585
12669
  if (!l) return;
12586
12670
  l.fillStyle = a, l.fillRect(0, 0, e.width, e.height);
12587
12671
  let u = Math.max(.1, o), d = i === "stretch" ? e.width : n * (i === "contain" ? Math.min(e.width / n, e.height / r) : Math.max(e.width / n, e.height / r)), f = i === "stretch" ? e.height : r * (i === "contain" ? Math.min(e.width / n, e.height / r) : Math.max(e.width / n, e.height / r)), p = d * u, m = f * u, h = s / 100 * e.width, g = c / 100 * e.height;
12588
12672
  l.drawImage(t, (e.width - p) / 2 + h, (e.height - m) / 2 + g, p, m);
12589
12673
  }
12590
- function Qu(e) {
12674
+ function nd(e) {
12591
12675
  let t = (t, n) => {
12592
12676
  let r = t * 374761393 + n * 668265263 + e * 1442695041 | 0;
12593
12677
  return r = Math.imul(r ^ r >>> 13, 1274126177), ((r ^ r >>> 16) >>> 0) / 4294967295;
12594
12678
  };
12595
12679
  return (e, n) => {
12596
- let r = Math.floor(e), i = Math.floor(n), a = zu(e - r), o = zu(n - i), s = t(r, i), c = t(r + 1, i), l = t(r, i + 1), u = t(r + 1, i + 1);
12680
+ let r = Math.floor(e), i = Math.floor(n), a = Uu(e - r), o = Uu(n - i), s = t(r, i), c = t(r + 1, i), l = t(r, i + 1), u = t(r + 1, i + 1);
12597
12681
  return s * (1 - a) * (1 - o) + c * a * (1 - o) + l * (1 - a) * o + u * a * o;
12598
12682
  };
12599
12683
  }
12600
- function $u(e, t, n, r) {
12684
+ function rd(e, t, n, r) {
12601
12685
  let i = 0, a = .5, o = 1, s = 0;
12602
12686
  for (let c = 0; c < r; c++) i += a * e(t * o, n * o), s += a, o *= 2, a *= .5;
12603
12687
  return i / s;
12604
12688
  }
12605
- function ed(e = 220) {
12606
- let t = Math.max(64, Math.min(1280, Math.round(e))), n = ld.get(t);
12689
+ function id(e = 220) {
12690
+ let t = Math.max(64, Math.min(1280, Math.round(e))), n = pd.get(t);
12607
12691
  if (n) return n;
12608
12692
  let r = document.createElement("canvas");
12609
12693
  r.width = t, r.height = t;
12610
12694
  let i = r.getContext("2d");
12611
12695
  if (!i) return r;
12612
- let a = i.createImageData(t, t), o = Qu(11), s = Qu(91), c = Qu(47), l = [
12696
+ let a = i.createImageData(t, t), o = nd(11), s = nd(91), c = nd(47), l = [
12613
12697
  [0, [
12614
12698
  34,
12615
12699
  26,
@@ -12653,24 +12737,24 @@ function ed(e = 220) {
12653
12737
  return l[l.length - 1][1];
12654
12738
  };
12655
12739
  for (let e = 0; e < t; e++) for (let n = 0; n < t; n++) {
12656
- let r = n / t * 3, i = e / t * 3, l = r + .7 * s(r * .7 + 5, i * .7), d = i + .7 * s(r * .7, i * .7 + 9), [f, p, m] = u($u(o, l, d, 4)), h = Math.max(0, $u(c, l * 1.6 + 3, d * 1.6, 3) - .55) * 1.7;
12740
+ let r = n / t * 3, i = e / t * 3, l = r + .7 * s(r * .7 + 5, i * .7), d = i + .7 * s(r * .7, i * .7 + 9), [f, p, m] = u(rd(o, l, d, 4)), h = Math.max(0, rd(c, l * 1.6 + 3, d * 1.6, 3) - .55) * 1.7;
12657
12741
  f = f * (1 - h) + 70 * h, p = p * (1 - h) + 210 * h, m = m * (1 - h) + 200 * h;
12658
12742
  let g = (e * t + n) * 4;
12659
12743
  a.data[g] = f, a.data[g + 1] = p, a.data[g + 2] = m, a.data[g + 3] = 255;
12660
12744
  }
12661
- return i.putImageData(a, 0, 0), ld.set(t, r), r;
12745
+ return i.putImageData(a, 0, 0), pd.set(t, r), r;
12662
12746
  }
12663
- function td(e, t, n, r) {
12664
- let i = `${e}|${t}x${n}`, a = ud.get(i);
12747
+ function ad(e, t, n, r) {
12748
+ let i = `${e}|${t}x${n}`, a = md.get(i);
12665
12749
  if (a) return a;
12666
12750
  let o = document.createElement("canvas");
12667
12751
  o.width = t, o.height = n;
12668
12752
  let s = o.getContext("2d");
12669
- return s && r(s, t, n), ud.set(i, o), o;
12753
+ return s && r(s, t, n), md.set(i, o), o;
12670
12754
  }
12671
- function nd(e = 240) {
12755
+ function od(e = 240) {
12672
12756
  let t = Math.max(120, Math.min(2048, Math.round(e)));
12673
- return td("vaporwave", t, Math.round(t * 2 / 3), (e, t, n) => {
12757
+ return ad("vaporwave", t, Math.round(t * 2 / 3), (e, t, n) => {
12674
12758
  let r = t / 240, i = e.createLinearGradient(0, 0, 0, n);
12675
12759
  i.addColorStop(0, "#120638"), i.addColorStop(.56, "#8e2de2"), i.addColorStop(1, "#ff2fa8"), e.fillStyle = i, e.fillRect(0, 0, t, n);
12676
12760
  let a = n * .48, o = n * .28, s = e.createLinearGradient(0, a - o, 0, a + o);
@@ -12686,9 +12770,9 @@ function nd(e = 240) {
12686
12770
  e.globalAlpha = 1;
12687
12771
  });
12688
12772
  }
12689
- function rd(e = 220) {
12773
+ function sd(e = 220) {
12690
12774
  let t = Math.max(110, Math.min(2048, Math.round(e)));
12691
- return td("kaleidoscope", t, t, (e, t, n) => {
12775
+ return ad("kaleidoscope", t, t, (e, t, n) => {
12692
12776
  let r = t / 220, i = [
12693
12777
  "#00e5ff",
12694
12778
  "#6c3bff",
@@ -12704,25 +12788,25 @@ function rd(e = 220) {
12704
12788
  for (let t = 1; t <= 4; t++) e.strokeStyle = t % 2 ? "rgba(255,255,255,.55)" : "rgba(8,5,35,.6)", e.lineWidth = 5 * r, e.beginPath(), e.arc(a, o, t * 25 * r, 0, Math.PI * 2), e.stroke();
12705
12789
  });
12706
12790
  }
12707
- function id(e, t) {
12708
- return e.build ? e.build(t) : Vu({
12791
+ function cd(e, t) {
12792
+ return e.build ? e.build(t) : Gu({
12709
12793
  stops: e.stops ?? [],
12710
12794
  edgeColor: e.edgeColor ?? "#8e9dff",
12711
12795
  edgeAmount: e.edgeAmount ?? 0
12712
12796
  });
12713
12797
  }
12714
- function ad(e) {
12715
- return Uu(new Zi().load(e));
12798
+ function ld(e) {
12799
+ return qu(new Zi().load(e));
12716
12800
  }
12717
- var od, sd, cd, ld, ud, dd, fd = t((() => {
12718
- Vc(), hl(), Gl(), od = 256, sd = 64, cd = (e) => e.map(([e, t]) => ({
12801
+ var ud, dd, fd, pd, md, hd, gd = t((() => {
12802
+ Vc(), hl(), Yl(), ud = 256, dd = 64, fd = (e) => e.map(([e, t]) => ({
12719
12803
  color: e,
12720
12804
  pos: t
12721
- })), ld = /* @__PURE__ */ new Map(), ud = /* @__PURE__ */ new Map(), dd = {
12805
+ })), pd = /* @__PURE__ */ new Map(), md = /* @__PURE__ */ new Map(), hd = {
12722
12806
  palestine: {
12723
12807
  label: "Palestine",
12724
12808
  kind: "gradient",
12725
- stops: cd([
12809
+ stops: fd([
12726
12810
  ["#000000", 0],
12727
12811
  ["#f7f7f2", .34],
12728
12812
  ["#149954", .67],
@@ -12734,7 +12818,7 @@ var od, sd, cd, ld, ud, dd, fd = t((() => {
12734
12818
  spain: {
12735
12819
  label: "Spain",
12736
12820
  kind: "gradient",
12737
- stops: cd([
12821
+ stops: fd([
12738
12822
  ["#aa151b", 0],
12739
12823
  ["#aa151b", .24],
12740
12824
  ["#f1bf00", .34],
@@ -12748,7 +12832,7 @@ var od, sd, cd, ld, ud, dd, fd = t((() => {
12748
12832
  grandLine: {
12749
12833
  label: "Grand Line",
12750
12834
  kind: "gradient",
12751
- stops: cd([
12835
+ stops: fd([
12752
12836
  ["#071b33", 0],
12753
12837
  ["#087ea4", .22],
12754
12838
  ["#45d4c5", .4],
@@ -12763,22 +12847,22 @@ var od, sd, cd, ld, ud, dd, fd = t((() => {
12763
12847
  vaporwave: {
12764
12848
  label: "Vaporwave Sunset",
12765
12849
  kind: "image",
12766
- build: nd
12850
+ build: od
12767
12851
  },
12768
12852
  kaleidoscope: {
12769
12853
  label: "Kaleidoscope",
12770
12854
  kind: "image",
12771
- build: rd
12855
+ build: sd
12772
12856
  },
12773
12857
  nebula: {
12774
12858
  label: "Nebula (2D)",
12775
12859
  kind: "image",
12776
- build: ed
12860
+ build: id
12777
12861
  },
12778
12862
  sunset: {
12779
12863
  label: "Sunset",
12780
12864
  kind: "gradient",
12781
- stops: cd([
12865
+ stops: fd([
12782
12866
  ["#3b1c6b", 0],
12783
12867
  ["#8b2fa0", .3],
12784
12868
  ["#e0457a", .56],
@@ -12791,7 +12875,7 @@ var od, sd, cd, ld, ud, dd, fd = t((() => {
12791
12875
  aurora: {
12792
12876
  label: "Aurora",
12793
12877
  kind: "gradient",
12794
- stops: cd([
12878
+ stops: fd([
12795
12879
  ["#0b3d4f", 0],
12796
12880
  ["#1fb89e", .3],
12797
12881
  ["#5ee0a0", .52],
@@ -12804,7 +12888,7 @@ var od, sd, cd, ld, ud, dd, fd = t((() => {
12804
12888
  ocean: {
12805
12889
  label: "Ocean",
12806
12890
  kind: "gradient",
12807
- stops: cd([
12891
+ stops: fd([
12808
12892
  ["#0a1f4d", 0],
12809
12893
  ["#1f6fb8", .36],
12810
12894
  ["#2bd0d0", .66],
@@ -12816,7 +12900,7 @@ var od, sd, cd, ld, ud, dd, fd = t((() => {
12816
12900
  ember: {
12817
12901
  label: "Ember",
12818
12902
  kind: "gradient",
12819
- stops: cd([
12903
+ stops: fd([
12820
12904
  ["#2a0707", 0],
12821
12905
  ["#a81e1e", .34],
12822
12906
  ["#ff5a2e", .64],
@@ -12828,7 +12912,7 @@ var od, sd, cd, ld, ud, dd, fd = t((() => {
12828
12912
  iris: {
12829
12913
  label: "Iris",
12830
12914
  kind: "gradient",
12831
- stops: cd([
12915
+ stops: fd([
12832
12916
  ["#2e1065", 0],
12833
12917
  ["#7c3aed", .34],
12834
12918
  ["#db2777", .64],
@@ -12840,7 +12924,7 @@ var od, sd, cd, ld, ud, dd, fd = t((() => {
12840
12924
  mono: {
12841
12925
  label: "Mono",
12842
12926
  kind: "gradient",
12843
- stops: cd([
12927
+ stops: fd([
12844
12928
  ["#16161e", 0],
12845
12929
  ["#6b7280", .4],
12846
12930
  ["#c2c8d2", .72],
@@ -12853,39 +12937,55 @@ var od, sd, cd, ld, ud, dd, fd = t((() => {
12853
12937
  }));
12854
12938
  //#endregion
12855
12939
  //#region src/util/base64.ts
12856
- function pd(e) {
12940
+ function _d(e) {
12857
12941
  let t = atob(e.replace(/-/g, "+").replace(/_/g, "/")), n = new Uint8Array(new ArrayBuffer(t.length));
12858
12942
  for (let e = 0; e < t.length; e++) n[e] = t.charCodeAt(e);
12859
12943
  return n;
12860
12944
  }
12861
- var md = t((() => {}));
12945
+ var vd = t((() => {}));
12862
12946
  //#endregion
12863
12947
  //#region src/renderer/heroPalette.ts
12864
- function hd() {
12948
+ function yd() {
12865
12949
  let e = document.createElement("canvas");
12866
- e.width = _d, e.height = _d;
12950
+ e.width = xd, e.height = xd;
12867
12951
  let t = e.getContext("2d");
12868
12952
  if (t) {
12869
- let e = pd(vd);
12870
- t.putImageData(new ImageData(new Uint8ClampedArray(e.buffer), _d, _d), 0, 0);
12953
+ let e = _d(Sd);
12954
+ t.putImageData(new ImageData(new Uint8ClampedArray(e.buffer), xd, xd), 0, 0);
12871
12955
  }
12872
12956
  return e;
12873
12957
  }
12874
- function gd() {
12875
- let e = Uu(new ci(pd(vd), _d, _d, U, Se));
12958
+ function bd() {
12959
+ let e = qu(new ci(_d(Sd), xd, xd, U, Se));
12876
12960
  return e.needsUpdate = !0, e;
12877
12961
  }
12878
- var _d, vd, yd = t((() => {
12879
- Vc(), md(), fd(), _d = 32, vd = "7PP//97s///O4/7/xt77/8vc7f/Y1sr/5c2f/+/EcP/2vEX/+rQp//2xGP/+rRv//J5M//uUf//7jp7/+4a3//2Ax//9g83//4vD//2bu//5kpv/83V+//Nbb//3VnT/81Sf/+tdxf/pid3/56Pr/+a58v/q1/P/6On3/+Xy/P/o8f//2ur+/8/j/P/O4ff/1tzc/+PSr//sx4X/879d//i3Of/8siD//rEP//6vD//9nz7//JJ4//uNnP/6h7f//IDJ//yEz//+jMX//Jq8//aOnf/xa3n/9Fxq//dief/1Y5v/8G62/+2K0v/tq+b/6Lby/+rP8v/q5fb/5vH7/+Pv///X6P7/0uT6/9bi8P/h2sf/682R//LCa//3ukn/+rQs//yxGv/+sQ7//q4T//2eRP/8knv/+o2e//eIuf/6g8v/+obR//yMx//6mb3/84uh//Bnef/1YWn/+nVx//lzj//1g6X/8pjC//Gz3f/stO//6cDx/+rf9P/m8fv/3uz//9Xm/f/V4vj/3d/r/+fWtP/xyHT/9r9R//m3N//7siP//bAW//6xDv/+qxr//ZpP//yPf//4jZ//9Yq6//eHzP/4itL/+o/K//iYvv/wiab/7mZ9//Zpbv/7gG///Il+//iYk//1pa//9LTO//Cx5v/qru7/69fy/+fw+v/Y6f7/1eL7/9nb9v/h2Of/7M+n//XCW//5uj3/+7Ur//yxHf/9rhX//q8Q//6mJP/9k1f/+4x///aNnv/zjbr/9Y3N//aR1f/4lM7/+JnC//COrv/ua4f/9m5y//uGc//8k3z/+qKI//aupP/1tMT/8J3b/+iJ6v/qzfD/6O75/9fl/f/Y3vn/3NPz/+TM4P/uxpr/+LxJ//u3MP/8syX//a8c//2sF//+rBb//p8w//2OX//7ioD/9o6e//KQu//zk8//9ZjX//ec0//4nsn/85i7//B3mf/1cHz/+oZ4//uSgf/6oYX/97Kg//Wpvv/vcdH/5W7n/+vG7f/p6vf/1d78/9nX9//fyu3/6MDN//O8fv/6uDv/+7Qr//yxJf/9rB///akd//6oIP/+mz3//oxm//uMg//2kaD/8pW9//Ob0f/2oNj/+aPX//ul1P/4o83/9Iyy//d7kP/6in3/+5OB//qhgv/5rpX/9pyy/+9czf/kZ+D/7L7q/+vk9f/S0/v/2s30/+O+4//ttK3/+LRW//u0Mf/8si7//K8q//2pJv/9pSj//qMu//6WSP/+jWv/+46F//aVo//zmr//9KHS//em2v/8qNr//qra//2q2P/5n8z/+Iuv//uOjP/7loH//KGA//ukjf/5kab/8VjD/+dq2P/tt+b/7t3y/9XJ+P/gwvD/6bPa//Osmf/6sEn/+7E1//ywNf/8ri///agu//2jNf/+nz3//pRT//6Pb//8k4j/95um//Shwv/1p9T/+Krc//yr2//+rdv//q3c//yp2v/5mM3/+pKp//ubhv/8oIH//J6L//yPmv/2a7D/63fL/++z4//w1u7/48D0/+257f/zr9n/96ic//urU//8rT//+689//yyMv/9ry///qk///6jUP/+nGT//pt6//yfj//4pKz/9ajG//at1v/6r9z//azb//+u3f//r93//q7e//ug3P/6lcn/+52g//ujhP/9nIz//ZKb//qJpP/zjrr/8rHc//PN6v/zuO//+7Ts//uw4f/7qK7//KVo//ynTf/7rEb//bU0//27Jv/9tz3//bJj//6weP/+sIj//a+a//mwsv/2scn/+LTY//uz3f/9rtz//7De//6w3//+reL//aXl//ya4P/8nML//KSZ//2cm//9mrD//aGz//uitf/4r87/9sPk//u07f//tO3//rLo//ymwP/8nYL//J9g//unU//8skL//b0v//zBQP/8xHD//saJ//7FlP/9waP/+725//i5y//5u9j/+rjd//yv3f/+r9///q7i//6r5v/9quj//aTp//2e2v/9oLr//aC1//2ouv/+s7b//rSz//ywwP/6uNn//bPs//6z6//+ruP//J7G//uRmv/7knn/+51m//yrUv/9tkb//MBZ//3Lf//+0pP//tSa//7PqP/8yb7/+sLM//vC1v/6v9z/+bHd//io4v/7pej//arp//2x6P/8ren//KHg//2hxf/9p7v//rC3//+4s///u7D//rS5//2x0f//tO3//7Lr//6n3f/8ksL/+oKl//mDkf/5kXz//KNi//2vWP/+vnH//suQ//7Umv/+2Zz//tan//7SwP/9ysn//srO//vF1P/3sdH/7p7b/+2c6P/2o+3/9Kvs//Gn7f/xn+L//KXF//6uuv//sLj//7S1//+5sf/+tLn//q7Q//+z7f//sen//p/W//uEuv/5daf/9ned//aFjv/6l3f//adp//65ff/+ypr//tGh//7Vn//+1af//ta9///Rv///0r///cvD//m1uP/vn8n/5Jff/96b6//Um/H/zZvy/9Wb6v/ypc7//6+8//+xuf//tLb//7mx//22vf/+rtT//q/q//2n4v/9jsr/+3Wy//drqP/0cKL/9H2Z//iOhv/8oHT//rV///7Hnv/+zqf//tGm//7Uqv/+2Ln//9az///Xsv/90bT//MSj//m6r//tqcn/0aDh/76a8v+9m/b/vZn0/9ue4f/8q8L//rO0//+5rv/+vqn//LrB//6v2v/8qef//JnY//x7vv/6Zq3/9mSn//NtpP/ze53/94qN//yceP/+sn3//sWb//7Oqf/+0an//tas//7cuf//27D//96r//7aqv/+1Jz//tSe//rLrP/htc3/waPr/7if9v+ymvn/zJzt//eoxf/+t6D//8WV//7Kmf/8v8L//a/c//yk5f/7jtL/+224//lcqv/2X6b/9Gyj//R8mv/4jIr//J53//6zfv/+xZr//s2o//7Sqf/+2K7//uC8///htf//46z//t2m//7XnP/+2Z///tmh//XLt//Osdr/s6Lx/7Kd9v/Ro+z/9qvH//64mf//y4j//s+S//zBwf/9sNv//aHk//uI0P/7Zbf/+Feq//Vdpv/0bqD/+IKR//uWfv/+qHf//rqI//7Gnv/+zaf//tSp//7bsP/+477//+W4///mrv//3qT//tic//7Yn//+2qH//NWr/967zP+6pOj/waTt/+Gt4P/4r8j//bWi///Hiv/+zpP//cDB//6v2//9oOT/+4bR//pkuf/3WK3/9F+o//Vynf/6jIX//qR1//61fv/+v5H//seg//7Npv/+1an//t2y//7kwP//5rj//+ex///fpv/+2J3//tie//7ZoP/91qb/5r7E/8am3//Yq97/9LbN//qzxf/8sa///r+R//7MlP/9vcL//q7b//yh5f/6iNP/+Gi8//Vdr//0Zan/93qW//yXev/+rXH//rp///6/kf/+xp///s6l//7WrP/+37j//uXE///kuP//57X//+Os//7Znv/+2J3//tme//3Sof/vu7z/4KvW/+6xz//7tsP/+7PC//uruf/9rJ7//bWd//yzxv/+rtv/+6Ll//iM1P/2b77/9GWw//Vvpf/5hoz//KBy//6ya//+unn//r+Q//7HoP/+z6n//tmz//7iwv/+58j//+K2///mt//+5rT//9ui//7Wnv/+057//smg//u5rv/4ssX/+rTF//u0wP/7sL//+p+7//mRrf/5lK3/+qXL//6u2//4o+X/9JDU//R5vf/1cq7/93ud//qQhf/7pW///bJm//67dP/+wY///smj//7Sr//+3Lz//uXK//7ny///37T//+O0//7isv/+0Jb//8WH///AjP/+upf//rSh//2zsf/7tLz/+7S7//yttf/6lbX/94Oz//WEtv/2n8///a7c//Gn5f/wltH/9IO5//h+pv/7h5X/+5WD//ukcP/9smL//r1t//7Dif/+yaD//tOy//7gw//+6M3//ujM///dsv//3q3//tur//7Agf//r2j//6px//+og//+pY3//qiX//ywov/8r6f//Kei//yVo//6hKv/9Ie3//Og0P/8rtz/563k/+mZzv/zibP/+oag//qLlf/5k4n/+6Jx//2zXf/+vWL//sJ5//7Hkv/+0av//uDC//3pyv/96Mz//tux///apf/+1qb//7h+//+lZf//nGf//5dt//+Tc///lXn//qN+//unjP/5nJ3//JWb//2Knv/2i7L/8KLR//uu3P/druT/4ZXN/+2FtP/1g6X/94Wd//iMj//6nXX//a5f//64Xv/+vW3//sKB//7KmP/+2bP//ebE//3nzf/+2bH//tWf//7Vpf/+toX//5xk//+RW///iFj//4Nc//+FYv/+l2j/+599//eQmv/3iKT/94aj/++HtP/tn9H/+q7d/9aq5f/ajND/5Hq7/+13rv/yeaL/9YCU//mPgf/8oW3//q1m//60a//+uHb//sKJ//7Spv/+48D//ufO//7Xsv/+0Zr//tSk//68kv//mGn//4ZP//9+S///elD//oJa//2Qav/5kIT/9YOX//N7pP/ueK7/5nu7/+iX0//5rd3/0aXp/9KB1v/ba8P/5Wa2/+xoqf/yb5v/936M//uUef/9pWz//qxr//6ucf/+u4X//tGl//7jwv/959H//tez//7PmP/+0KL//sWh//6rh//+i2D//3xQ//59VP/+iF///It1//d9j//ybpv/7Wmn/+Zmtv/dasP/447W//es3v/LpO7/yHnd/89czf/bU8H/5VW1/+5dpv/1cJT/+419//6ibf/+pWj//qZt//63hf/+0ar//eTJ//3o1f/+1rX//c2X//3Lof/+x6b//cCh//6dev/+hlz//ohd//6TZP/8iXn/9m2V/+5apv/mVbb/20/B/89YzP/ahdv/9are/8eo8v+/eeX/xFXW/9FIzP/fSML/6VC0//Nlnv/7ioH//qFt//6jaP/+q3H//rqL//3Ssf/95s///efa//7WuP/8y5j//Mik//7FqP/9xan//a6J//6caf/+kmL//ptn//yKe//0X5//6ky2/99Ew//RQcv/wk/V/9CB4f/yq+D/x7L3/76I7f/AZOH/zFXX/9pS0P/mVsb/8Guw//mRkP/8p3z//K15//y4hP/8w5v/+9W7//vm1v/75t///NbC//nMpP/6yq7//Mmy//vIs//7vZv//LWC//yldf/8o3X/+paM//FgtP/kT8n/20zR/8pN1v+9W+D/y4jn//Cs4f/Pw/v/xqL0/8aF6//PeeT/23Xf/+V32P/uhsf/9qWs//i3mv/4v5j/+Meh//jPsv/43Mn/9+jf//fm5v/31tb/9dXB//XWyP/31sr/99XI//fOt//3yqj/98Of//e9nv/2r6//7oXO/+R63f/beeH/z3vl/8aF7P/Soe3/8bHj/w==";
12962
+ var xd, Sd, Cd = t((() => {
12963
+ Vc(), vd(), gd(), xd = 32, Sd = "7PP//97s///O4/7/xt77/8vc7f/Y1sr/5c2f/+/EcP/2vEX/+rQp//2xGP/+rRv//J5M//uUf//7jp7/+4a3//2Ax//9g83//4vD//2bu//5kpv/83V+//Nbb//3VnT/81Sf/+tdxf/pid3/56Pr/+a58v/q1/P/6On3/+Xy/P/o8f//2ur+/8/j/P/O4ff/1tzc/+PSr//sx4X/879d//i3Of/8siD//rEP//6vD//9nz7//JJ4//uNnP/6h7f//IDJ//yEz//+jMX//Jq8//aOnf/xa3n/9Fxq//dief/1Y5v/8G62/+2K0v/tq+b/6Lby/+rP8v/q5fb/5vH7/+Pv///X6P7/0uT6/9bi8P/h2sf/682R//LCa//3ukn/+rQs//yxGv/+sQ7//q4T//2eRP/8knv/+o2e//eIuf/6g8v/+obR//yMx//6mb3/84uh//Bnef/1YWn/+nVx//lzj//1g6X/8pjC//Gz3f/stO//6cDx/+rf9P/m8fv/3uz//9Xm/f/V4vj/3d/r/+fWtP/xyHT/9r9R//m3N//7siP//bAW//6xDv/+qxr//ZpP//yPf//4jZ//9Yq6//eHzP/4itL/+o/K//iYvv/wiab/7mZ9//Zpbv/7gG///Il+//iYk//1pa//9LTO//Cx5v/qru7/69fy/+fw+v/Y6f7/1eL7/9nb9v/h2Of/7M+n//XCW//5uj3/+7Ur//yxHf/9rhX//q8Q//6mJP/9k1f/+4x///aNnv/zjbr/9Y3N//aR1f/4lM7/+JnC//COrv/ua4f/9m5y//uGc//8k3z/+qKI//aupP/1tMT/8J3b/+iJ6v/qzfD/6O75/9fl/f/Y3vn/3NPz/+TM4P/uxpr/+LxJ//u3MP/8syX//a8c//2sF//+rBb//p8w//2OX//7ioD/9o6e//KQu//zk8//9ZjX//ec0//4nsn/85i7//B3mf/1cHz/+oZ4//uSgf/6oYX/97Kg//Wpvv/vcdH/5W7n/+vG7f/p6vf/1d78/9nX9//fyu3/6MDN//O8fv/6uDv/+7Qr//yxJf/9rB///akd//6oIP/+mz3//oxm//uMg//2kaD/8pW9//Ob0f/2oNj/+aPX//ul1P/4o83/9Iyy//d7kP/6in3/+5OB//qhgv/5rpX/9pyy/+9czf/kZ+D/7L7q/+vk9f/S0/v/2s30/+O+4//ttK3/+LRW//u0Mf/8si7//K8q//2pJv/9pSj//qMu//6WSP/+jWv/+46F//aVo//zmr//9KHS//em2v/8qNr//qra//2q2P/5n8z/+Iuv//uOjP/7loH//KGA//ukjf/5kab/8VjD/+dq2P/tt+b/7t3y/9XJ+P/gwvD/6bPa//Osmf/6sEn/+7E1//ywNf/8ri///agu//2jNf/+nz3//pRT//6Pb//8k4j/95um//Shwv/1p9T/+Krc//yr2//+rdv//q3c//yp2v/5mM3/+pKp//ubhv/8oIH//J6L//yPmv/2a7D/63fL/++z4//w1u7/48D0/+257f/zr9n/96ic//urU//8rT//+689//yyMv/9ry///qk///6jUP/+nGT//pt6//yfj//4pKz/9ajG//at1v/6r9z//azb//+u3f//r93//q7e//ug3P/6lcn/+52g//ujhP/9nIz//ZKb//qJpP/zjrr/8rHc//PN6v/zuO//+7Ts//uw4f/7qK7//KVo//ynTf/7rEb//bU0//27Jv/9tz3//bJj//6weP/+sIj//a+a//mwsv/2scn/+LTY//uz3f/9rtz//7De//6w3//+reL//aXl//ya4P/8nML//KSZ//2cm//9mrD//aGz//uitf/4r87/9sPk//u07f//tO3//rLo//ymwP/8nYL//J9g//unU//8skL//b0v//zBQP/8xHD//saJ//7FlP/9waP/+725//i5y//5u9j/+rjd//yv3f/+r9///q7i//6r5v/9quj//aTp//2e2v/9oLr//aC1//2ouv/+s7b//rSz//ywwP/6uNn//bPs//6z6//+ruP//J7G//uRmv/7knn/+51m//yrUv/9tkb//MBZ//3Lf//+0pP//tSa//7PqP/8yb7/+sLM//vC1v/6v9z/+bHd//io4v/7pej//arp//2x6P/8ren//KHg//2hxf/9p7v//rC3//+4s///u7D//rS5//2x0f//tO3//7Lr//6n3f/8ksL/+oKl//mDkf/5kXz//KNi//2vWP/+vnH//suQ//7Umv/+2Zz//tan//7SwP/9ysn//srO//vF1P/3sdH/7p7b/+2c6P/2o+3/9Kvs//Gn7f/xn+L//KXF//6uuv//sLj//7S1//+5sf/+tLn//q7Q//+z7f//sen//p/W//uEuv/5daf/9ned//aFjv/6l3f//adp//65ff/+ypr//tGh//7Vn//+1af//ta9///Rv///0r///cvD//m1uP/vn8n/5Jff/96b6//Um/H/zZvy/9Wb6v/ypc7//6+8//+xuf//tLb//7mx//22vf/+rtT//q/q//2n4v/9jsr/+3Wy//drqP/0cKL/9H2Z//iOhv/8oHT//rV///7Hnv/+zqf//tGm//7Uqv/+2Ln//9az///Xsv/90bT//MSj//m6r//tqcn/0aDh/76a8v+9m/b/vZn0/9ue4f/8q8L//rO0//+5rv/+vqn//LrB//6v2v/8qef//JnY//x7vv/6Zq3/9mSn//NtpP/ze53/94qN//yceP/+sn3//sWb//7Oqf/+0an//tas//7cuf//27D//96r//7aqv/+1Jz//tSe//rLrP/htc3/waPr/7if9v+ymvn/zJzt//eoxf/+t6D//8WV//7Kmf/8v8L//a/c//yk5f/7jtL/+224//lcqv/2X6b/9Gyj//R8mv/4jIr//J53//6zfv/+xZr//s2o//7Sqf/+2K7//uC8///htf//46z//t2m//7XnP/+2Z///tmh//XLt//Osdr/s6Lx/7Kd9v/Ro+z/9qvH//64mf//y4j//s+S//zBwf/9sNv//aHk//uI0P/7Zbf/+Feq//Vdpv/0bqD/+IKR//uWfv/+qHf//rqI//7Gnv/+zaf//tSp//7bsP/+477//+W4///mrv//3qT//tic//7Yn//+2qH//NWr/967zP+6pOj/waTt/+Gt4P/4r8j//bWi///Hiv/+zpP//cDB//6v2//9oOT/+4bR//pkuf/3WK3/9F+o//Vynf/6jIX//qR1//61fv/+v5H//seg//7Npv/+1an//t2y//7kwP//5rj//+ex///fpv/+2J3//tie//7ZoP/91qb/5r7E/8am3//Yq97/9LbN//qzxf/8sa///r+R//7MlP/9vcL//q7b//yh5f/6iNP/+Gi8//Vdr//0Zan/93qW//yXev/+rXH//rp///6/kf/+xp///s6l//7WrP/+37j//uXE///kuP//57X//+Os//7Znv/+2J3//tme//3Sof/vu7z/4KvW/+6xz//7tsP/+7PC//uruf/9rJ7//bWd//yzxv/+rtv/+6Ll//iM1P/2b77/9GWw//Vvpf/5hoz//KBy//6ya//+unn//r+Q//7HoP/+z6n//tmz//7iwv/+58j//+K2///mt//+5rT//9ui//7Wnv/+057//smg//u5rv/4ssX/+rTF//u0wP/7sL//+p+7//mRrf/5lK3/+qXL//6u2//4o+X/9JDU//R5vf/1cq7/93ud//qQhf/7pW///bJm//67dP/+wY///smj//7Sr//+3Lz//uXK//7ny///37T//+O0//7isv/+0Jb//8WH///AjP/+upf//rSh//2zsf/7tLz/+7S7//yttf/6lbX/94Oz//WEtv/2n8///a7c//Gn5f/wltH/9IO5//h+pv/7h5X/+5WD//ukcP/9smL//r1t//7Dif/+yaD//tOy//7gw//+6M3//ujM///dsv//3q3//tur//7Agf//r2j//6px//+og//+pY3//qiX//ywov/8r6f//Kei//yVo//6hKv/9Ie3//Og0P/8rtz/563k/+mZzv/zibP/+oag//qLlf/5k4n/+6Jx//2zXf/+vWL//sJ5//7Hkv/+0av//uDC//3pyv/96Mz//tux///apf/+1qb//7h+//+lZf//nGf//5dt//+Tc///lXn//qN+//unjP/5nJ3//JWb//2Knv/2i7L/8KLR//uu3P/druT/4ZXN/+2FtP/1g6X/94Wd//iMj//6nXX//a5f//64Xv/+vW3//sKB//7KmP/+2bP//ebE//3nzf/+2bH//tWf//7Vpf/+toX//5xk//+RW///iFj//4Nc//+FYv/+l2j/+599//eQmv/3iKT/94aj/++HtP/tn9H/+q7d/9aq5f/ajND/5Hq7/+13rv/yeaL/9YCU//mPgf/8oW3//q1m//60a//+uHb//sKJ//7Spv/+48D//ufO//7Xsv/+0Zr//tSk//68kv//mGn//4ZP//9+S///elD//oJa//2Qav/5kIT/9YOX//N7pP/ueK7/5nu7/+iX0//5rd3/0aXp/9KB1v/ba8P/5Wa2/+xoqf/yb5v/936M//uUef/9pWz//qxr//6ucf/+u4X//tGl//7jwv/959H//tez//7PmP/+0KL//sWh//6rh//+i2D//3xQ//59VP/+iF///It1//d9j//ybpv/7Wmn/+Zmtv/dasP/447W//es3v/LpO7/yHnd/89czf/bU8H/5VW1/+5dpv/1cJT/+419//6ibf/+pWj//qZt//63hf/+0ar//eTJ//3o1f/+1rX//c2X//3Lof/+x6b//cCh//6dev/+hlz//ohd//6TZP/8iXn/9m2V/+5apv/mVbb/20/B/89YzP/ahdv/9are/8eo8v+/eeX/xFXW/9FIzP/fSML/6VC0//Nlnv/7ioH//qFt//6jaP/+q3H//rqL//3Ssf/95s///efa//7WuP/8y5j//Mik//7FqP/9xan//a6J//6caf/+kmL//ptn//yKe//0X5//6ky2/99Ew//RQcv/wk/V/9CB4f/yq+D/x7L3/76I7f/AZOH/zFXX/9pS0P/mVsb/8Guw//mRkP/8p3z//K15//y4hP/8w5v/+9W7//vm1v/75t///NbC//nMpP/6yq7//Mmy//vIs//7vZv//LWC//yldf/8o3X/+paM//FgtP/kT8n/20zR/8pN1v+9W+D/y4jn//Cs4f/Pw/v/xqL0/8aF6//PeeT/23Xf/+V32P/uhsf/9qWs//i3mv/4v5j/+Meh//jPsv/43Mn/9+jf//fm5v/31tb/9dXB//XWyP/31sr/99XI//fOt//3yqj/98Of//e9nv/2r6//7oXO/+R63f/beeH/z3vl/8aF7P/Soe3/8bHj/w==";
12880
12964
  }));
12881
12965
  //#endregion
12882
12966
  //#region src/renderer/WaveRenderer.ts
12883
- function bd(e, t) {
12884
- let n = wd.set(e);
12967
+ function wd(e, t, n, r = 0) {
12968
+ let i = e / Dd, a = t / 750, o;
12969
+ switch (n) {
12970
+ case "contain":
12971
+ o = Math.min(i, a);
12972
+ break;
12973
+ case "width":
12974
+ o = i;
12975
+ break;
12976
+ case "height":
12977
+ o = a;
12978
+ break;
12979
+ default: o = Math.max(i, a);
12980
+ }
12981
+ return r > 0 && (o = Math.min(o, e / (Dd * r))), o;
12982
+ }
12983
+ function Td(e, t) {
12984
+ let n = kd.set(e);
12885
12985
  return t.set(n.r, n.g, n.b);
12886
12986
  }
12887
- var xd, Sd, Cd, wd, Td, Ed = t((() => {
12888
- Vc(), nl(), il(), cl(), Zc(), fl(), ou(), pu(), Ru(), fd(), yd(), Gl(), xd = 220, Sd = 1333, Cd = class {
12987
+ var Ed, Dd, Od, kd, Ad, jd = t((() => {
12988
+ Vc(), nl(), il(), cl(), Zc(), fl(), _u(), nu(), Hu(), gd(), Cd(), Yl(), Ed = 220, Dd = 1333, Od = class {
12889
12989
  makeVideo;
12890
12990
  onVideoReady;
12891
12991
  texture;
@@ -12898,8 +12998,8 @@ var xd, Sd, Cd, wd, Td, Ed = t((() => {
12898
12998
  }
12899
12999
  apply(e, t) {
12900
13000
  let n = e.paletteVideoUrl, r = e.paletteImageUrl, i = e.paletteSource ?? "hero", a, o;
12901
- if (n) this.ensureVideo(n), this.video?.readyState && this.video.readyState >= 2 ? (a = "video|" + n, o = () => Uu(new _i(this.video))) : (a = "video-loading|" + n, o = () => gd());
12902
- else if (r) this.clearVideo(), a = "url|" + r, o = () => ad(r);
13001
+ if (n) this.ensureVideo(n), this.video?.readyState && this.video.readyState >= 2 ? (a = "video|" + n, o = () => qu(new _i(this.video))) : (a = "video-loading|" + n, o = () => bd());
13002
+ else if (r) this.clearVideo(), a = "url|" + r, o = () => ld(r);
12903
13003
  else if (i === "stops") {
12904
13004
  this.clearVideo();
12905
13005
  let t = {
@@ -12907,8 +13007,8 @@ var xd, Sd, Cd, wd, Td, Ed = t((() => {
12907
13007
  edgeColor: e.paletteEdgeColor ?? "#8e9dff",
12908
13008
  edgeAmount: e.paletteEdgeAmount ?? .3
12909
13009
  };
12910
- a = "stops|" + Hu(t), o = () => Gu(t);
12911
- } else dd[i] ? (this.clearVideo(), a = "map|" + i, o = () => Wu(id(dd[i]))) : (this.clearVideo(), a = "hero", o = () => gd());
13010
+ a = "stops|" + Ku(t), o = () => Yu(t);
13011
+ } else hd[i] ? (this.clearVideo(), a = "map|" + i, o = () => Ju(cd(hd[i]))) : (this.clearVideo(), a = "hero", o = () => bd());
12912
13012
  (a !== this.sig || !this.texture) && (this.texture?.dispose(), this.texture = o(), this.sig = a), t.uPalette.value = this.texture, t.uUsePalette.value = e.usePaletteTexture === !1 ? 0 : 1, t.uPaletteRaw.value = 1;
12913
13013
  }
12914
13014
  syncPlayback(e, t) {
@@ -12931,7 +13031,7 @@ var xd, Sd, Cd, wd, Td, Ed = t((() => {
12931
13031
  dispose() {
12932
13032
  this.texture?.dispose(), this.texture = void 0, this.clearVideo(), this.failedUrl = "";
12933
13033
  }
12934
- }, wd = new X(), Td = class {
13034
+ }, kd = new X(), Ad = class {
12935
13035
  renderer;
12936
13036
  scene = new Gn();
12937
13037
  camera;
@@ -12984,10 +13084,13 @@ var xd, Sd, Cd, wd, Td, Ed = t((() => {
12984
13084
  resizeObserver;
12985
13085
  intersectionObserver;
12986
13086
  motionQuery;
13087
+ dprQuery;
13088
+ resizeRaf = 0;
13089
+ lastResize;
12987
13090
  capturing = !1;
12988
13091
  outputSize;
12989
13092
  constructor(e, t, n = {}) {
12990
- this.container = e, this.config = Fl(t), this.respectReducedMotion = n.respectReducedMotion ?? !0, this.skipIntroRamp = n.skipIntroRamp ?? !1, this.renderer = new Bc({
13093
+ this.container = e, this.config = Rl(t), this.respectReducedMotion = n.respectReducedMotion ?? !0, this.skipIntroRamp = n.skipIntroRamp ?? !1, this.renderer = new Bc({
12991
13094
  antialias: !0,
12992
13095
  alpha: !0,
12993
13096
  preserveDrawingBuffer: !0,
@@ -13001,15 +13104,15 @@ var xd, Sd, Cd, wd, Td, Ed = t((() => {
13001
13104
  uGrainAmount: { value: t.grain },
13002
13105
  uTime: { value: 0 }
13003
13106
  },
13004
- vertexShader: Ql,
13005
- fragmentShader: $l
13107
+ vertexShader: lu,
13108
+ fragmentShader: uu
13006
13109
  }), this.composer.addPass(this.postPass), this.composer.addPass(new sl()), this.motionQuery = window.matchMedia("(prefers-reduced-motion: reduce)"), this.reducedMotion = this.respectReducedMotion && this.motionQuery.matches, this.motionQuery.addEventListener("change", this.onMotionChange), document.addEventListener("visibilitychange", this.onVisibilityChange), this.intersectionObserver = new IntersectionObserver((e) => {
13007
13110
  this.visible = e[0]?.isIntersecting ?? !0, this.updateRunning();
13008
- }, { rootMargin: "100px" }), this.intersectionObserver.observe(e), this.resizeObserver = new ResizeObserver(this.onResize), this.resizeObserver.observe(e), this.applyBackground(), this.buildWaves(), this.resize();
13111
+ }, { rootMargin: "100px" }), this.intersectionObserver.observe(e), this.resizeObserver = new ResizeObserver(this.onResize), this.resizeObserver.observe(e), this.watchDpr(), this.applyBackground(), this.buildWaves(), this.resize();
13009
13112
  }
13010
13113
  get segments() {
13011
13114
  let e = this.config.quality / Math.sqrt(Math.max(1, this.config.waves.length));
13012
- return Gt.clamp(Math.round(xd * e), 24, 360);
13115
+ return Gt.clamp(Math.round(Ed * e), 24, 360);
13013
13116
  }
13014
13117
  makeUniforms() {
13015
13118
  let e = [], t = [];
@@ -13074,7 +13177,7 @@ var xd, Sd, Cd, wd, Td, Ed = t((() => {
13074
13177
  uEdgeFeather: { value: .1 },
13075
13178
  uOpacity: { value: 1 },
13076
13179
  uSquared: { value: 1 },
13077
- uResolution: { value: new G(1, 1) },
13180
+ uResolution: { value: this.renderer.getDrawingBufferSize(new G()) },
13078
13181
  uAmbient: { value: .45 },
13079
13182
  uNumLights: { value: 1 },
13080
13183
  uLightPos: { value: a },
@@ -13089,6 +13192,12 @@ var xd, Sd, Cd, wd, Td, Ed = t((() => {
13089
13192
  uLineDerivativePower: { value: .95 },
13090
13193
  uMaxWidth: { value: 1232 },
13091
13194
  uClearColor: { value: new K(1, 1, 1) },
13195
+ uHelixTurns: { value: 0 },
13196
+ uHelixRadius: { value: 0 },
13197
+ uHelixRoll: { value: 0 },
13198
+ uHelixPhase: { value: 0 },
13199
+ uRungAmount: { value: 0 },
13200
+ uRungThickness: { value: 1 },
13092
13201
  uPointer: { value: new G(0, 0) },
13093
13202
  uPointerActive: { value: 0 },
13094
13203
  uPointerRadius: { value: .6 },
@@ -13111,14 +13220,16 @@ var xd, Sd, Cd, wd, Td, Ed = t((() => {
13111
13220
  let t = {};
13112
13221
  e?.twistMotion && (t.TWIST_MOTION = ""), (this.config.loopSeconds ?? 0) > 0 && (t.LOOP_MOTION = "");
13113
13222
  let n = e?.interaction?.bindings?.some((e) => e.target === "detailAmount") ?? !1;
13114
- return ((e?.detailAmount ?? 0) !== 0 || n) && (t.DETAIL_OCTAVE = ""), (e?.depthTint ?? 0) > 0 && (t.DEPTH_TINT = ""), (e?.edgeFeather ?? .1) !== .1 && (t.EDGE_FEATHER = ""), e && vu(this.config, e) && (t.POINTER_FX = "", yu(this.config, e) && (t.POINTER_RIPPLES = "")), t;
13223
+ ((e?.detailAmount ?? 0) !== 0 || n) && (t.DETAIL_OCTAVE = ""), (e?.depthTint ?? 0) > 0 && (t.DEPTH_TINT = ""), (e?.edgeFeather ?? .1) !== .1 && (t.EDGE_FEATHER = "");
13224
+ let r = e?.interaction?.bindings?.some((e) => e.target.startsWith("helix")) ?? !1;
13225
+ return ((e?.helixRadius ?? 0) !== 0 || (e?.helixRoll ?? 0) !== 0 || r) && (t.HELIX = ""), e?.theme === "wireframe" && (e.rungAmount ?? 0) > 0 && (t.RUNGS = ""), e && Su(this.config, e) && (t.POINTER_FX = "", Cu(this.config, e) && (t.POINTER_RIPPLES = "")), t;
13115
13226
  }
13116
13227
  addWave() {
13117
- let e = new fu(this.segments), t = this.config.waves[this.waves.length] ?? this.config.waves[0], n = new Oi({
13228
+ let e = new tu(this.segments), t = this.config.waves[this.waves.length] ?? this.config.waves[0], n = new Oi({
13118
13229
  uniforms: this.makeUniforms(),
13119
13230
  defines: this.waveDefines(t),
13120
- vertexShader: Yl,
13121
- fragmentShader: t?.theme === "wireframe" ? Zl : Xl,
13231
+ vertexShader: ou,
13232
+ fragmentShader: t?.theme === "wireframe" ? cu : su,
13122
13233
  transparent: !0,
13123
13234
  depthTest: !0,
13124
13235
  depthWrite: !0,
@@ -13127,7 +13238,7 @@ var xd, Sd, Cd, wd, Td, Ed = t((() => {
13127
13238
  this.applyBlendMode(n, t?.blendMode ?? "squared");
13128
13239
  let r = new si(e.geometry, n);
13129
13240
  r.frustumCulled = !1, this.group.add(r);
13130
- let i = new Cd((e) => this.createLoopingVideo(e), () => {
13241
+ let i = new Od((e) => this.createLoopingVideo(e), () => {
13131
13242
  this.updatePaletteTextures(), this.syncVideoPlayback(), this.running || this.renderOnce();
13132
13243
  });
13133
13244
  this.waves.push({
@@ -13168,7 +13279,7 @@ var xd, Sd, Cd, wd, Td, Ed = t((() => {
13168
13279
  this.applyBlendMode(e.material, n.blendMode) && (e.material.needsUpdate = !0);
13169
13280
  let i = this.waveDefines(n), a = e.material.defines ?? {};
13170
13281
  Object.keys(i).sort().join(",") !== Object.keys(a).sort().join(",") && (e.material.defines = i, e.material.needsUpdate = !0);
13171
- let o = n.theme === "wireframe" ? Zl : Xl;
13282
+ let o = n.theme === "wireframe" ? cu : su;
13172
13283
  e.material.fragmentShader !== o && (e.material.fragmentShader = o, e.material.needsUpdate = !0);
13173
13284
  let s = [...n.palette].sort((e, t) => e.pos - t.pos), c = Math.max(1, Math.min(s.length, 8)), l = r.uColors.value, u = r.uColorPos.value;
13174
13285
  for (let e = 0; e < 8; e++) {
@@ -13176,21 +13287,21 @@ var xd, Sd, Cd, wd, Td, Ed = t((() => {
13176
13287
  color: "#ffffff",
13177
13288
  pos: 0
13178
13289
  };
13179
- bd(t.color, l[e]), u[e] = t.pos;
13290
+ Td(t.color, l[e]), u[e] = t.pos;
13180
13291
  }
13181
13292
  r.uColorCount.value = c, r.uGradType.value = n.gradientType === "radial" ? 1 : n.gradientType === "conic" ? 2 : n.gradientType === "mesh" ? 3 : 0, r.uGradAngle.value = (n.gradientAngle ?? 0) * Math.PI / 180, r.uGradShift.value = n.gradientShift ?? 0;
13182
13293
  let d = n.meshGradientPoints.slice(0, 8), f = r.uMeshPointPos.value, p = r.uMeshPointColor.value, m = r.uMeshPointInfluence.value;
13183
13294
  for (let e = 0; e < 8; e++) {
13184
13295
  let t = d[e] ?? d[d.length - 1];
13185
- t && (f[e].set(t.x, t.y), bd(t.color, p[e]), m[e] = t.influence);
13296
+ t && (f[e].set(t.x, t.y), Td(t.color, p[e]), m[e] = t.influence);
13186
13297
  }
13187
- r.uMeshPointCount.value = d.length, r.uMeshSoftness.value = n.meshGradientSoftness, r.uPaletteScale.value.set(n.paletteTextureScale?.x ?? 1, n.paletteTextureScale?.y ?? 1), r.uPaletteOffset.value.set(n.paletteTextureOffset?.x ?? 0, n.paletteTextureOffset?.y ?? 0), r.uPaletteRotation.value = (n.paletteTextureRotation ?? 0) * Math.PI / 180, r.uHueShift.value = n.hueShift, r.uContrast.value = n.colorContrast, r.uSaturation.value = n.colorSaturation, r.uLineAmount.value = n.lineAmount ?? 425, r.uLineThickness.value = n.lineThickness ?? 1, r.uLineDerivativePower.value = n.lineDerivativePower ?? .95, r.uMaxWidth.value = n.maxWidth ?? 1232, bd(this.config.background, r.uClearColor.value), r.uFiberCount.value = n.fiberCount, r.uFiberStrength.value = n.fiberStrength, r.uTexture.value = n.texture, r.uCreaseLight.value = n.creaseLight, r.uCreaseSharpness.value = n.creaseSharpness, r.uCreaseSoftness.value = n.creaseSoftness, r.uSheen.value = n.sheen ?? 1, r.uRoundness.value = n.roundness ?? .35, r.uIridescence.value = n.iridescence ?? 0, r.uDepthTint.value = n.depthTint ?? 0, bd(n.depthTintColor ?? "#0a2540", r.uDepthTintColor.value), r.uEdgeFade.value = n.edgeFade, r.uEdgeFeather.value = n.edgeFeather ?? .1;
13298
+ r.uMeshPointCount.value = d.length, r.uMeshSoftness.value = n.meshGradientSoftness, r.uPaletteScale.value.set(n.paletteTextureScale?.x ?? 1, n.paletteTextureScale?.y ?? 1), r.uPaletteOffset.value.set(n.paletteTextureOffset?.x ?? 0, n.paletteTextureOffset?.y ?? 0), r.uPaletteRotation.value = (n.paletteTextureRotation ?? 0) * Math.PI / 180, r.uHueShift.value = n.hueShift, r.uContrast.value = n.colorContrast, r.uSaturation.value = n.colorSaturation, r.uLineAmount.value = n.lineAmount ?? 425, r.uLineThickness.value = n.lineThickness ?? 1, r.uLineDerivativePower.value = n.lineDerivativePower ?? .95, r.uRungAmount.value = n.rungAmount ?? 0, r.uRungThickness.value = n.rungThickness ?? 1, r.uMaxWidth.value = n.maxWidth ?? 1232, Td(this.config.background, r.uClearColor.value), r.uFiberCount.value = n.fiberCount, r.uFiberStrength.value = n.fiberStrength, r.uTexture.value = n.texture, r.uCreaseLight.value = n.creaseLight, r.uCreaseSharpness.value = n.creaseSharpness, r.uCreaseSoftness.value = n.creaseSoftness, r.uSheen.value = n.sheen ?? 1, r.uRoundness.value = n.roundness ?? .35, r.uIridescence.value = n.iridescence ?? 0, r.uDepthTint.value = n.depthTint ?? 0, Td(n.depthTintColor ?? "#0a2540", r.uDepthTintColor.value), r.uEdgeFade.value = n.edgeFade, r.uEdgeFeather.value = n.edgeFeather ?? .1;
13188
13299
  let h = this.config.lights ?? [];
13189
13300
  r.uAmbient.value = this.config.ambient ?? .45, r.uNumLights.value = Math.min(h.length, 8);
13190
13301
  let g = r.uLightPos.value, _ = r.uLightColor.value, v = r.uLightIntensity.value;
13191
13302
  for (let e = 0; e < 8; e++) {
13192
13303
  let t = h[e];
13193
- t ? (g[e].set(t.position.x, t.position.y, t.position.z), bd(t.color, _[e]), v[e] = t.intensity) : v[e] = 0;
13304
+ t ? (g[e].set(t.position.x, t.position.y, t.position.z), Td(t.color, _[e]), v[e] = t.intensity) : v[e] = 0;
13194
13305
  }
13195
13306
  let y = n.noiseBands ?? [];
13196
13307
  r.uNumNoiseBands.value = Math.min(y.length, 4);
@@ -13199,12 +13310,12 @@ var xd, Sd, Cd, wd, Td, Ed = t((() => {
13199
13310
  let t = y[e];
13200
13311
  t && (b[e].set(t.startX, t.endX, t.startY, t.endY), x[e].set(t.feather, t.strength, t.frequency, t.colorAttenuation), S[e] = t.parabolaPower);
13201
13312
  }
13202
- r.uSpeed.value = n.speed, r.uSeed.value = n.seed, r.uLoopSeconds.value = this.config.loopSeconds ?? 0, r.uDispFreqX.value = n.displaceFrequency.x, r.uDispFreqZ.value = n.displaceFrequency.y, r.uDispAmount.value = n.displaceAmount, r.uDetailFreq.value = n.detailFrequency ?? .04, r.uDetailAmount.value = n.detailAmount ?? 0, r.uTwFreqX.value = n.twistFrequency.x, r.uTwFreqY.value = n.twistFrequency.y, r.uTwFreqZ.value = n.twistFrequency.z, r.uTwPowX.value = n.twistPower.x, r.uTwPowY.value = n.twistPower.y, r.uTwPowZ.value = n.twistPower.z, e.mesh.scale.set(n.scale.x, n.scale.y, n.scale.z), e.mesh.rotation.set(Gt.degToRad(n.rotation.x), Gt.degToRad(n.rotation.y), Gt.degToRad(n.rotation.z)), e.mesh.position.set(n.position.x, n.position.y, n.position.z), r.uOpacity.value = n.opacity;
13313
+ r.uSpeed.value = n.speed, r.uSeed.value = n.seed, r.uLoopSeconds.value = this.config.loopSeconds ?? 0, r.uDispFreqX.value = n.displaceFrequency.x, r.uDispFreqZ.value = n.displaceFrequency.y, r.uDispAmount.value = n.displaceAmount, r.uDetailFreq.value = n.detailFrequency ?? .04, r.uDetailAmount.value = n.detailAmount ?? 0, r.uTwFreqX.value = n.twistFrequency.x, r.uTwFreqY.value = n.twistFrequency.y, r.uTwFreqZ.value = n.twistFrequency.z, r.uTwPowX.value = n.twistPower.x, r.uTwPowY.value = n.twistPower.y, r.uTwPowZ.value = n.twistPower.z, r.uHelixTurns.value = n.helixTurns ?? 0, r.uHelixRadius.value = n.helixRadius ?? 0, r.uHelixRoll.value = n.helixRoll ?? 0, r.uHelixPhase.value = n.helixPhase ?? 0, e.mesh.scale.set(n.scale.x, n.scale.y, n.scale.z), e.mesh.rotation.set(Gt.degToRad(n.rotation.x), Gt.degToRad(n.rotation.y), Gt.degToRad(n.rotation.z)), e.mesh.position.set(n.position.x, n.position.y, n.position.z), r.uOpacity.value = n.opacity;
13203
13314
  });
13204
13315
  let e = (this.config.interaction?.radius ?? .3) * 2, t = this.config.interaction?.ribbonFlow ?? .8;
13205
13316
  this.waves.forEach((n, r) => {
13206
13317
  let i = this.config.waves[r] ?? this.config.waves[this.config.waves.length - 1];
13207
- if (!vu(this.config, i)) return;
13318
+ if (!Su(this.config, i)) return;
13208
13319
  let a = n.material.uniforms, o = i.interaction?.hover;
13209
13320
  a.uPointerRadius.value = e, a.uPointerAgitate.value = o?.agitate ?? 0, a.uPointerPush.value = o?.push ?? 0, a.uPointerWake.value = o?.wake ?? 0, a.uPointerThin.value = o?.thin ?? 0, a.uPointerHue.value = o?.hueShift ?? 0, a.uPointerLighten.value = o?.lighten ?? 0, a.uPointerRipple.value = i.interaction?.press?.ripple ?? 0, a.uShapeFlow.value = t;
13210
13321
  }), this.updatePaletteTextures(), this.syncVideoPlayback(), this.group.scale.set(this.config.mirrorH ? -1 : 1, this.config.mirrorV ? -1 : 1, 1), this.onAfterRefresh(), this.running || this.renderOnce();
@@ -13250,13 +13361,13 @@ var xd, Sd, Cd, wd, Td, Ed = t((() => {
13250
13361
  t
13251
13362
  ].join("|");
13252
13363
  if (a !== this.backgroundSig || !this.backgroundTexture) {
13253
- let i = Yu(n, r, e, t);
13254
- this.backgroundTexture?.dispose(), this.backgroundTexture = Wu(i), this.backgroundSig = a;
13364
+ let i = $u(n, r, e, t);
13365
+ this.backgroundTexture?.dispose(), this.backgroundTexture = Ju(i), this.backgroundSig = a;
13255
13366
  }
13256
13367
  this.scene.background = this.backgroundTexture;
13257
13368
  return;
13258
13369
  }
13259
- let r = this.config.backgroundGradientSource ?? "stops", i = dd[r], a = r !== "stops" && i?.kind === "gradient" && i.stops ? i.stops : this.config.backgroundPalette, o = a.map((e) => `${e.color}@${e.pos.toFixed(3)}`).join(","), s = [
13370
+ let r = this.config.backgroundGradientSource ?? "stops", i = hd[r], a = r !== "stops" && i?.kind === "gradient" && i.stops ? i.stops : this.config.backgroundPalette, o = a.map((e) => `${e.color}@${e.pos.toFixed(3)}`).join(","), s = [
13260
13371
  "gradient",
13261
13372
  r,
13262
13373
  n,
@@ -13266,14 +13377,14 @@ var xd, Sd, Cd, wd, Td, Ed = t((() => {
13266
13377
  t
13267
13378
  ].join("|");
13268
13379
  if (s !== this.backgroundSig || !this.backgroundTexture) {
13269
- let r = Ku({
13380
+ let r = Xu({
13270
13381
  stops: a,
13271
13382
  type: n,
13272
13383
  angle: this.config.backgroundGradientAngle,
13273
13384
  width: e,
13274
13385
  height: t
13275
13386
  });
13276
- this.backgroundTexture?.dispose(), this.backgroundTexture = Wu(r), this.backgroundSig = s;
13387
+ this.backgroundTexture?.dispose(), this.backgroundTexture = Ju(r), this.backgroundSig = s;
13277
13388
  }
13278
13389
  this.scene.background = this.backgroundTexture;
13279
13390
  }
@@ -13296,7 +13407,7 @@ var xd, Sd, Cd, wd, Td, Ed = t((() => {
13296
13407
  c = this.backgroundImage, l = this.backgroundImage.naturalWidth, u = this.backgroundImage.naturalHeight, d = `custom|${s}`;
13297
13408
  } else {
13298
13409
  this.clearBackgroundVideo();
13299
- let r = this.config.backgroundImageSource ?? "vaporwave", i = r === "hero" ? hd() : dd[r]?.kind === "image" ? id(dd[r], Math.max(t, n)) : null;
13410
+ let r = this.config.backgroundImageSource ?? "vaporwave", i = r === "hero" ? yd() : hd[r]?.kind === "image" ? cd(hd[r], Math.max(t, n)) : null;
13300
13411
  if (!i) {
13301
13412
  this.scene.background = e;
13302
13413
  return;
@@ -13315,8 +13426,8 @@ var xd, Sd, Cd, wd, Td, Ed = t((() => {
13315
13426
  n
13316
13427
  ].join("|");
13317
13428
  if (f !== this.backgroundSig || !this.backgroundTexture) {
13318
- let e = Xu(c, l, u, t, n, r, this.config.background, i, a.x, a.y);
13319
- this.backgroundTexture?.dispose(), this.backgroundTexture = Wu(e), this.backgroundSig = f, this.backgroundVideoCanvas = o ? e : void 0;
13429
+ let e = ed(c, l, u, t, n, r, this.config.background, i, a.x, a.y);
13430
+ this.backgroundTexture?.dispose(), this.backgroundTexture = Ju(e), this.backgroundSig = f, this.backgroundVideoCanvas = o ? e : void 0;
13320
13431
  }
13321
13432
  this.scene.background = this.backgroundTexture;
13322
13433
  }
@@ -13368,7 +13479,7 @@ var xd, Sd, Cd, wd, Td, Ed = t((() => {
13368
13479
  x: 0,
13369
13480
  y: 0
13370
13481
  };
13371
- Zu(t, e, e.videoWidth, e.videoHeight, this.config.backgroundImageFit ?? "cover", this.config.background, this.config.backgroundImageZoom ?? 1, n.x, n.y), this.backgroundTexture.needsUpdate = !0;
13482
+ td(t, e, e.videoWidth, e.videoHeight, this.config.backgroundImageFit ?? "cover", this.config.background, this.config.backgroundImageZoom ?? 1, n.x, n.y), this.backgroundTexture.needsUpdate = !0;
13372
13483
  }
13373
13484
  applyPost() {
13374
13485
  let e = this.postPass.uniforms;
@@ -13395,8 +13506,8 @@ var xd, Sd, Cd, wd, Td, Ed = t((() => {
13395
13506
  uDitherScale: { value: this.config.ditherScale ?? 2 },
13396
13507
  uDitherSteps: { value: this.config.ditherSteps ?? 4 }
13397
13508
  },
13398
- vertexShader: Ql,
13399
- fragmentShader: eu
13509
+ vertexShader: lu,
13510
+ fragmentShader: du
13400
13511
  }), this.composer.addPass(this.ditherPass));
13401
13512
  let t = this.ditherPass.uniforms;
13402
13513
  t.uDitherStrength.value = e, t.uDitherScale.value = Math.max(1, this.config.ditherScale ?? 2), t.uDitherSteps.value = Math.max(2, Math.round(this.config.ditherSteps ?? 4));
@@ -13414,8 +13525,8 @@ var xd, Sd, Cd, wd, Td, Ed = t((() => {
13414
13525
  uInnerLightDecay: { value: this.config.innerLightDecay ?? .95 },
13415
13526
  uInnerLightCenter: { value: new G(t, n) }
13416
13527
  },
13417
- vertexShader: Ql,
13418
- fragmentShader: tu
13528
+ vertexShader: lu,
13529
+ fragmentShader: fu
13419
13530
  }), this.composer.insertPass(this.innerLightPass, 1));
13420
13531
  let r = this.innerLightPass.uniforms;
13421
13532
  r.uInnerLight.value = e, r.uInnerLightDensity.value = this.config.innerLightDensity ?? .5, r.uInnerLightDecay.value = this.config.innerLightDecay ?? .95, r.uInnerLightCenter.value.set(t, n);
@@ -13432,8 +13543,8 @@ var xd, Sd, Cd, wd, Td, Ed = t((() => {
13432
13543
  uHalftoneCell: { value: this.config.halftoneCell ?? 6 },
13433
13544
  uHalftoneAngle: { value: this.config.halftoneAngle ?? .4 }
13434
13545
  },
13435
- vertexShader: Ql,
13436
- fragmentShader: nu
13546
+ vertexShader: lu,
13547
+ fragmentShader: pu
13437
13548
  }), this.composer.addPass(this.halftonePass));
13438
13549
  let t = this.halftonePass.uniforms;
13439
13550
  t.uHalftone.value = e, t.uHalftoneCell.value = Math.max(2, this.config.halftoneCell ?? 6), t.uHalftoneAngle.value = this.config.halftoneAngle ?? .4;
@@ -13446,8 +13557,8 @@ var xd, Sd, Cd, wd, Td, Ed = t((() => {
13446
13557
  tDiffuse: { value: null },
13447
13558
  uHeatmap: { value: e }
13448
13559
  },
13449
- vertexShader: Ql,
13450
- fragmentShader: ru
13560
+ vertexShader: lu,
13561
+ fragmentShader: mu
13451
13562
  }), this.composer.addPass(this.heatmapPass)), this.heatmapPass.uniforms.uHeatmap.value = e) : this.heatmapPass &&= (this.composer.removePass(this.heatmapPass), this.heatmapPass.dispose(), void 0);
13452
13563
  }
13453
13564
  applyPaperTexture() {
@@ -13459,8 +13570,8 @@ var xd, Sd, Cd, wd, Td, Ed = t((() => {
13459
13570
  uPaper: { value: e },
13460
13571
  uPaperScale: { value: this.config.paperTextureScale ?? 2 }
13461
13572
  },
13462
- vertexShader: Ql,
13463
- fragmentShader: iu
13573
+ vertexShader: lu,
13574
+ fragmentShader: hu
13464
13575
  }), this.composer.addPass(this.paperTexturePass));
13465
13576
  let t = this.paperTexturePass.uniforms;
13466
13577
  t.uPaper.value = e, t.uPaperScale.value = Math.max(.5, this.config.paperTextureScale ?? 2);
@@ -13475,16 +13586,33 @@ var xd, Sd, Cd, wd, Td, Ed = t((() => {
13475
13586
  uHalftoneCmyk: { value: e },
13476
13587
  uHalftoneCmykCell: { value: this.config.halftoneCmykCell ?? 6 }
13477
13588
  },
13478
- vertexShader: Ql,
13479
- fragmentShader: au
13589
+ vertexShader: lu,
13590
+ fragmentShader: gu
13480
13591
  }), this.composer.addPass(this.halftoneCmykPass));
13481
13592
  let t = this.halftoneCmykPass.uniforms;
13482
13593
  t.uHalftoneCmyk.value = e, t.uHalftoneCmykCell.value = Math.max(2, this.config.halftoneCmykCell ?? 6);
13483
13594
  } else this.halftoneCmykPass &&= (this.composer.removePass(this.halftoneCmykPass), this.halftoneCmykPass.dispose(), void 0);
13484
13595
  }
13485
13596
  onResize = () => {
13486
- this.resize();
13597
+ this.resizeRaf ||= requestAnimationFrame(() => {
13598
+ this.resizeRaf = 0;
13599
+ let e = this.viewportMetrics(), t = this.lastResize;
13600
+ t && e.w === t.w && e.h === t.h && e.dpr === t.dpr || this.resize();
13601
+ });
13602
+ };
13603
+ onDprChange = () => {
13604
+ this.watchDpr(), this.resize();
13487
13605
  };
13606
+ watchDpr() {
13607
+ this.dprQuery?.removeEventListener("change", this.onDprChange), this.dprQuery = window.matchMedia(`(resolution: ${window.devicePixelRatio || 1}dppx)`), this.dprQuery.addEventListener("change", this.onDprChange);
13608
+ }
13609
+ viewportMetrics() {
13610
+ return {
13611
+ w: this.outputSize?.width ?? Math.max(1, this.container.clientWidth),
13612
+ h: this.outputSize?.height ?? Math.max(1, this.container.clientHeight),
13613
+ dpr: this.outputSize ? 1 : Math.min(window.devicePixelRatio || 1, this.config.dprMax)
13614
+ };
13615
+ }
13488
13616
  onContextLost = (e) => {
13489
13617
  e.preventDefault(), cancelAnimationFrame(this.rafId), this.running = !1;
13490
13618
  };
@@ -13492,8 +13620,12 @@ var xd, Sd, Cd, wd, Td, Ed = t((() => {
13492
13620
  this.disposeWaves(), this.backgroundTexture?.dispose(), this.backgroundTexture = void 0, this.backgroundSig = "", this.buildWaves(), this.resize(), this.updateRunning();
13493
13621
  };
13494
13622
  resize() {
13495
- let e = this.outputSize?.width ?? Math.max(1, this.container.clientWidth), t = this.outputSize?.height ?? Math.max(1, this.container.clientHeight), n = this.outputSize ? 1 : Math.min(window.devicePixelRatio || 1, this.config.dprMax);
13496
- this.renderer.setPixelRatio(n), this.renderer.setSize(e, t, !this.outputSize), this.outputSize && (this.renderer.domElement.style.width = "100%", this.renderer.domElement.style.height = "100%"), this.composer.setPixelRatio(n), this.composer.setSize(e, t);
13623
+ let { w: e, h: t, dpr: n } = this.viewportMetrics();
13624
+ this.lastResize = {
13625
+ w: e,
13626
+ h: t,
13627
+ dpr: n
13628
+ }, this.renderer.setPixelRatio(n), this.renderer.setSize(e, t, !this.outputSize), this.outputSize && (this.renderer.domElement.style.width = "100%", this.renderer.domElement.style.height = "100%"), this.composer.setPixelRatio(n), this.composer.setSize(e, t);
13497
13629
  let r = e * n, i = t * n;
13498
13630
  this.postPass.uniforms.uResolution.value.set(r, i), this.ditherPass && this.ditherPass.uniforms.uResolution.value.set(r, i), this.halftonePass && this.halftonePass.uniforms.uResolution.value.set(r, i);
13499
13631
  for (let e of this.waves) e.material.uniforms.uResolution.value.set(r, i);
@@ -13544,8 +13676,8 @@ var xd, Sd, Cd, wd, Td, Ed = t((() => {
13544
13676
  this.updateBackgroundVideoFrame(), this.updateTime(), this.applyInteraction(), this.updateClipPlanes(), this.composer.render(), this.onAfterRenderFrame();
13545
13677
  }
13546
13678
  syncInteraction() {
13547
- let e = xu(this.config);
13548
- e && !this.interaction ? this.interaction = new Lu(this.container, () => this.config) : !e && this.interaction && (this.interaction.dispose(), this.interaction = void 0, this.interactionTimeOffset = 0, this.interactionZoom !== 1 && (this.interactionZoom = 1, this.applyZoom()));
13679
+ let e = Tu(this.config);
13680
+ e && !this.interaction ? this.interaction = new Vu(this.container, () => this.config) : !e && this.interaction && (this.interaction.dispose(), this.interaction = void 0, this.interactionTimeOffset = 0, this.interactionZoom !== 1 && (this.interactionZoom = 1, this.applyZoom()));
13549
13681
  }
13550
13682
  applyInteraction() {
13551
13683
  if (this.interaction) {
@@ -13553,13 +13685,13 @@ var xd, Sd, Cd, wd, Td, Ed = t((() => {
13553
13685
  this.applyInteractionRest();
13554
13686
  return;
13555
13687
  }
13556
- bu(this.config) && this.applyPointerField(this.interaction), this.applyBindings(this.interaction);
13688
+ wu(this.config) && this.applyPointerField(this.interaction), this.applyBindings(this.interaction);
13557
13689
  }
13558
13690
  }
13559
13691
  applyInteractionRest() {
13560
13692
  for (let e = 0; e < this.waves.length; e++) {
13561
13693
  let t = this.config.waves[e] ?? this.config.waves[this.config.waves.length - 1];
13562
- if (!vu(this.config, t)) continue;
13694
+ if (!Su(this.config, t)) continue;
13563
13695
  let n = this.waves[e].material.uniforms;
13564
13696
  n.uPointerActive.value = 0;
13565
13697
  let r = n.uRippleAmp.value;
@@ -13573,7 +13705,7 @@ var xd, Sd, Cd, wd, Td, Ed = t((() => {
13573
13705
  out: this.interactionSceneOut
13574
13706
  };
13575
13707
  for (let n of e) {
13576
- let e = Iu[n.target];
13708
+ let e = Bu[n.target];
13577
13709
  e.apply(e.base(this.config), t);
13578
13710
  }
13579
13711
  }
@@ -13583,7 +13715,7 @@ var xd, Sd, Cd, wd, Td, Ed = t((() => {
13583
13715
  if (!t || !n || n.length === 0) continue;
13584
13716
  let r = this.waves[e];
13585
13717
  for (let e of n) {
13586
- let n = Fu[e.target];
13718
+ let n = zu[e.target];
13587
13719
  n.apply(n.base(t), {
13588
13720
  u: r.material.uniforms,
13589
13721
  mesh: r.mesh
@@ -13595,7 +13727,7 @@ var xd, Sd, Cd, wd, Td, Ed = t((() => {
13595
13727
  let t = this.camera.right - this.camera.left, n = this.camera.top - this.camera.bottom, r = n === 0 ? 1 : t / n, i = e.sample().ripples, a = Math.min(1, .2 + .85 * e.pointerFlux()), o = e.pointerVelocity();
13596
13728
  for (let t = 0; t < this.waves.length; t++) {
13597
13729
  let n = this.config.waves[t] ?? this.config.waves[this.config.waves.length - 1];
13598
- if (!vu(this.config, n)) continue;
13730
+ if (!Su(this.config, n)) continue;
13599
13731
  let s = this.waves[t].material.uniforms;
13600
13732
  s.uPointerAgitate.value = (n.interaction?.hover?.agitate ?? 0) * a, s.uPointerVel.value.copy(o);
13601
13733
  let c = e.fieldFor(t);
@@ -13611,7 +13743,7 @@ var xd, Sd, Cd, wd, Td, Ed = t((() => {
13611
13743
  out: this.interactionSceneOut
13612
13744
  };
13613
13745
  for (let n of this.config.interaction?.bindings ?? []) {
13614
- let r = Iu[n.target], i = Gt.lerp(n.from ?? r.base(this.config), n.to, e.bindingValue(n));
13746
+ let r = Bu[n.target], i = Gt.lerp(n.from ?? r.base(this.config), n.to, e.bindingValue(n));
13615
13747
  r.apply(i, t);
13616
13748
  }
13617
13749
  for (let t = 0; t < this.waves.length; t++) {
@@ -13619,7 +13751,7 @@ var xd, Sd, Cd, wd, Td, Ed = t((() => {
13619
13751
  if (!n || !r || r.length === 0) continue;
13620
13752
  let i = this.waves[t];
13621
13753
  for (let t of r) {
13622
- let r = Fu[t.target], a = Gt.lerp(t.from ?? r.base(n), t.to, e.bindingValue(t));
13754
+ let r = zu[t.target], a = Gt.lerp(t.from ?? r.base(n), t.to, e.bindingValue(t));
13623
13755
  r.apply(a, {
13624
13756
  u: i.material.uniforms,
13625
13757
  mesh: i.mesh
@@ -13648,7 +13780,10 @@ var xd, Sd, Cd, wd, Td, Ed = t((() => {
13648
13780
  onAfterResize() {}
13649
13781
  applyZoom() {
13650
13782
  let e = this.camera.right - this.camera.left, t = this.camera.top - this.camera.bottom;
13651
- this.camera.zoom = Math.max(e / Sd, t / 750) * (this.config.cameraZoom ?? 1) * this.interactionZoom, this.camera.updateProjectionMatrix();
13783
+ this.camera.zoom = this.baseFrameZoom(e, t) * (this.config.cameraZoom ?? 1) * this.interactionZoom, this.camera.updateProjectionMatrix();
13784
+ }
13785
+ baseFrameZoom(e, t) {
13786
+ return wd(e, t, this.config.cameraFit ?? "cover", this.config.cameraMinVisibleWidth ?? 0);
13652
13787
  }
13653
13788
  updateClipPlanes() {
13654
13789
  this.clipBox.makeEmpty();
@@ -13658,7 +13793,7 @@ var xd, Sd, Cd, wd, Td, Ed = t((() => {
13658
13793
  let r = n.geometry.boundingSphere;
13659
13794
  if (!r) continue;
13660
13795
  let i = this.clipTmpA.setFromMatrixPosition(n.matrixWorld), a = Math.abs(Number(t.material.uniforms.uDispAmount.value) || 0), o = this.config.waves[e] ?? this.config.waves[this.config.waves.length - 1], s = 0;
13661
- if (vu(this.config, o)) {
13796
+ if (Su(this.config, o)) {
13662
13797
  let e = o.interaction?.hover;
13663
13798
  s = (e?.agitate ?? 0) + Math.abs(e?.push ?? 0) + (e?.wake ?? 0) + (o.interaction?.press?.ripple ?? 0);
13664
13799
  }
@@ -13694,25 +13829,25 @@ var xd, Sd, Cd, wd, Td, Ed = t((() => {
13694
13829
  return this.config;
13695
13830
  }
13696
13831
  setConfig(e) {
13697
- let t = Fl(e), n = t.waves.length !== this.waves.length || t.quality !== this.config.quality;
13832
+ let t = Rl(e), n = t.waves.length !== this.waves.length || t.quality !== this.config.quality;
13698
13833
  this.config = t, n ? this.rebuild() : this.refresh(), this.applyCameraFromConfig();
13699
13834
  }
13700
13835
  dispose() {
13701
- cancelAnimationFrame(this.rafId), this.running = !1, this.interaction?.dispose(), this.interaction = void 0, this.resizeObserver.disconnect(), this.intersectionObserver.disconnect(), this.motionQuery.removeEventListener("change", this.onMotionChange), document.removeEventListener("visibilitychange", this.onVisibilityChange), this.renderer.domElement.removeEventListener("webglcontextlost", this.onContextLost), this.renderer.domElement.removeEventListener("webglcontextrestored", this.onContextRestored), this.clearBackgroundVideo(), this.backgroundTexture?.dispose();
13836
+ cancelAnimationFrame(this.rafId), cancelAnimationFrame(this.resizeRaf), this.running = !1, this.interaction?.dispose(), this.interaction = void 0, this.resizeObserver.disconnect(), this.intersectionObserver.disconnect(), this.motionQuery.removeEventListener("change", this.onMotionChange), this.dprQuery?.removeEventListener("change", this.onDprChange), document.removeEventListener("visibilitychange", this.onVisibilityChange), this.renderer.domElement.removeEventListener("webglcontextlost", this.onContextLost), this.renderer.domElement.removeEventListener("webglcontextrestored", this.onContextRestored), this.clearBackgroundVideo(), this.backgroundTexture?.dispose();
13702
13837
  for (let e of this.waves) e.material.dispose(), e.geometry.dispose(), e.palette.dispose();
13703
13838
  this.bloomPass?.dispose(), this.ditherPass?.dispose(), this.innerLightPass?.dispose(), this.halftonePass?.dispose(), this.heatmapPass?.dispose(), this.paperTexturePass?.dispose(), this.halftoneCmykPass?.dispose(), this.composer.dispose(), this.renderer.dispose(), this.renderer.domElement.remove();
13704
13839
  }
13705
13840
  };
13706
- })), Dd = /* @__PURE__ */ n({
13707
- WaveRenderer: () => Td,
13841
+ })), Md = /* @__PURE__ */ n({
13842
+ WaveRenderer: () => Ad,
13708
13843
  createDefaultConfig: () => wl
13709
13844
  });
13710
13845
  //#endregion
13711
13846
  //#region src/shell/probe.ts
13712
13847
  t((() => {
13713
- Ed(), Gl();
13848
+ jd(), Yl();
13714
13849
  }))();
13715
- function Od() {
13850
+ function Nd() {
13716
13851
  if (typeof document > "u") return !1;
13717
13852
  try {
13718
13853
  let e = document.createElement("canvas"), t = { failIfMajorPerformanceCaveat: !0 }, n = e.getContext("webgl2", t) ?? e.getContext("webgl", t);
@@ -13721,22 +13856,22 @@ function Od() {
13721
13856
  return !1;
13722
13857
  }
13723
13858
  }
13724
- function kd() {
13859
+ function Pd() {
13725
13860
  return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
13726
13861
  }
13727
- function Ad() {
13862
+ function Fd() {
13728
13863
  return typeof navigator > "u" ? !1 : navigator.connection?.saveData === !0;
13729
13864
  }
13730
13865
  //#endregion
13731
13866
  //#region src/shell/poster.ts
13732
- var jd = "data-wave3d-poster";
13733
- function Md(e) {
13867
+ var Id = "data-wave3d-poster";
13868
+ function Ld(e) {
13734
13869
  getComputedStyle(e).position === "static" && (e.style.position = "relative");
13735
13870
  }
13736
- function Nd(e, t, n = "fill") {
13737
- let r = e.querySelector(`img[${jd}]`);
13871
+ function Rd(e, t, n = "fill") {
13872
+ let r = e.querySelector(`img[${Id}]`);
13738
13873
  if (!r && !t) return null;
13739
- r || (r = document.createElement("img"), r.setAttribute(jd, ""), r.decoding = "async", r.alt = "", r.setAttribute("aria-hidden", "true"), e.appendChild(r)), t && (r.src = t), Object.assign(r.style, {
13874
+ r || (r = document.createElement("img"), r.setAttribute(Id, ""), r.decoding = "async", r.alt = "", r.setAttribute("aria-hidden", "true"), e.appendChild(r)), t && (r.src = t), Object.assign(r.style, {
13740
13875
  position: "absolute",
13741
13876
  inset: "0",
13742
13877
  width: "100%",
@@ -13769,12 +13904,12 @@ function Nd(e, t, n = "fill") {
13769
13904
  }
13770
13905
  //#endregion
13771
13906
  //#region src/shell/createWave.ts
13772
- function Pd(e, t, n, r) {
13907
+ function zd(e, t, n, r) {
13773
13908
  let { lazy: i = !0, rootMargin: a = "200px", webgl: o = "auto", respectReducedMotion: s = !0, reducedMotionBehavior: c = "static", respectSaveData: l = !0, fadeMs: u = 300 } = r, d = "poster", f = null, p = { ...n };
13774
13909
  r.paused !== void 0 && (p.paused = r.paused);
13775
13910
  let m = /* @__PURE__ */ new Map(), h = !1, g = null, _, v = 0;
13776
- Md(t);
13777
- let y = Nd(t, r.poster, r.posterFit);
13911
+ Ld(t);
13912
+ let y = Rd(t, r.poster, r.posterFit);
13778
13913
  function b(e) {
13779
13914
  d !== e && (d = e, r.onStateChange?.(e));
13780
13915
  }
@@ -13822,7 +13957,7 @@ function Pd(e, t, n, r) {
13822
13957
  }
13823
13958
  function E() {
13824
13959
  if (!h) {
13825
- if (o === "auto" && !Od()) {
13960
+ if (o === "auto" && !Nd()) {
13826
13961
  x("no-webgl");
13827
13962
  return;
13828
13963
  }
@@ -13831,8 +13966,8 @@ function Pd(e, t, n, r) {
13831
13966
  }
13832
13967
  function D() {
13833
13968
  if (o !== "off") {
13834
- if (l && Ad()) return x("save-data");
13835
- if (s && c === "poster" && kd()) return x("reduced-motion");
13969
+ if (l && Fd()) return x("save-data");
13970
+ if (s && c === "poster" && Pd()) return x("reduced-motion");
13836
13971
  i && typeof IntersectionObserver < "u" ? (g = new IntersectionObserver((e) => {
13837
13972
  e.some((e) => e.isIntersecting) && (g?.disconnect(), g = null, E());
13838
13973
  }, { rootMargin: a }), g.observe(t)) : E();
@@ -13875,11 +14010,11 @@ function Pd(e, t, n, r) {
13875
14010
  }
13876
14011
  //#endregion
13877
14012
  //#region src/presets.ts
13878
- Gl();
13879
- var Fd = 180 / Math.PI;
13880
- function Id(e) {
14013
+ Yl();
14014
+ var Bd = 180 / Math.PI;
14015
+ function Vd(e) {
13881
14016
  let t = wl(), n = t.waves[0];
13882
- return n.speed = e.speed, n.colorContrast = e.contrast, n.colorSaturation = e.sat, n.hueShift = e.hueRad * Fd, n.displaceFrequency = {
14017
+ return n.speed = e.speed, n.colorContrast = e.contrast, n.colorSaturation = e.sat, n.hueShift = e.hueRad * Bd, n.displaceFrequency = {
13883
14018
  x: e.dispX,
13884
14019
  y: e.dispZ
13885
14020
  }, n.displaceAmount = e.dispAmt, n.position = {
@@ -13887,9 +14022,9 @@ function Id(e) {
13887
14022
  y: e.pos[1],
13888
14023
  z: e.pos[2]
13889
14024
  }, n.rotation = {
13890
- x: e.rotRad[0] * Fd,
13891
- y: e.rotRad[1] * Fd,
13892
- z: e.rotRad[2] * Fd
14025
+ x: e.rotRad[0] * Bd,
14026
+ y: e.rotRad[1] * Bd,
14027
+ z: e.rotRad[2] * Bd
13893
14028
  }, n.scale = {
13894
14029
  x: e.scale[0],
13895
14030
  y: e.scale[1],
@@ -13912,8 +14047,8 @@ function Id(e) {
13912
14047
  z: 0
13913
14048
  }, t.cameraZoom = e.zoom, t;
13914
14049
  }
13915
- var Ld = {
13916
- Hero: () => Id({
14050
+ var Hd = {
14051
+ Hero: () => Vd({
13917
14052
  speed: .04,
13918
14053
  contrast: 1,
13919
14054
  sat: 1,
@@ -13957,7 +14092,7 @@ var Ld = {
13957
14092
  camTarget: [-420, -200]
13958
14093
  }),
13959
14094
  "Wave 2": () => wl(),
13960
- "Wave 3": () => Id({
14095
+ "Wave 3": () => Vd({
13961
14096
  speed: .08,
13962
14097
  contrast: 1,
13963
14098
  sat: 1,
@@ -14000,7 +14135,7 @@ var Ld = {
14000
14135
  zoom: 1.3,
14001
14136
  camTarget: [-104, 13]
14002
14137
  }),
14003
- "Wave 4": () => Id({
14138
+ "Wave 4": () => Vd({
14004
14139
  speed: .0525,
14005
14140
  contrast: .969,
14006
14141
  sat: 1.383,
@@ -14080,7 +14215,7 @@ var Ld = {
14080
14215
  ]), t.creaseLight = 1, e.background = "#05060c", e.transparentBackground = !1, e.waves = bl(t, 3), e.waveCount = 3, e;
14081
14216
  },
14082
14217
  "Mesh Gradient": () => {
14083
- let e = Ld.Hero(), t = e.waves[0];
14218
+ let e = Hd.Hero(), t = e.waves[0];
14084
14219
  return t.gradientType = "mesh", t.meshGradientPoints = [
14085
14220
  {
14086
14221
  color: "#0a84ff",
@@ -14121,7 +14256,7 @@ var Ld = {
14121
14256
  ], t.meshGradientSoftness = .68, t.blendMode = "normal", t.hueShift = 0, t.colorContrast = 1.06, t.colorSaturation = 1.12, t.fiberStrength = .14, e.grain = .3, e.blur = .008, e.background = "#070914", e.backgroundMode = "color", e.transparentBackground = !1, e;
14122
14257
  },
14123
14258
  "Solar Bloom": () => {
14124
- let e = Ld.Hero(), t = e.waves[0];
14259
+ let e = Hd.Hero(), t = e.waves[0];
14125
14260
  return t.usePaletteTexture = !1, t.gradientType = "radial", t.gradientShift = .14, t.palette = [
14126
14261
  {
14127
14262
  color: "#fff3c4",
@@ -14150,7 +14285,7 @@ var Ld = {
14150
14285
  ], t.blendMode = "normal", t.hueShift = 0, t.colorContrast = 1.05, t.colorSaturation = 1.18, t.fiberStrength = .12, e.grain = .3, e.blur = .01, e.background = "#0a0714", e.backgroundMode = "gradient", e.backgroundGradientType = "radial", e.backgroundGradientSource = "stops", e.backgroundPalette = vl(["#2a1330", "#08040f"]), e.transparentBackground = !1, e;
14151
14286
  },
14152
14287
  Holographic: () => {
14153
- let e = Ld.Hero(), t = e.waves[0];
14288
+ let e = Hd.Hero(), t = e.waves[0];
14154
14289
  return t.usePaletteTexture = !1, t.gradientType = "conic", t.gradientShift = .08, t.palette = [
14155
14290
  {
14156
14291
  color: "#8ef6e4",
@@ -14183,7 +14318,7 @@ var Ld = {
14183
14318
  ], t.blendMode = "normal", t.hueShift = 0, t.colorContrast = 1.04, t.colorSaturation = 1.12, t.fiberStrength = .12, e.grain = .28, e.blur = .01, e.background = "#05060c", e.backgroundMode = "gradient", e.backgroundGradientType = "linear", e.backgroundGradientAngle = 135, e.backgroundGradientSource = "stops", e.backgroundPalette = vl(["#04121a", "#0a0518"]), e.transparentBackground = !1, e;
14184
14319
  },
14185
14320
  Aurora: () => {
14186
- let e = Ld.Hero(), t = e.waves[0];
14321
+ let e = Hd.Hero(), t = e.waves[0];
14187
14322
  return t.gradientType = "mesh", t.meshGradientPoints = [
14188
14323
  {
14189
14324
  color: "#0a1f3c",
@@ -14255,31 +14390,103 @@ var Ld = {
14255
14390
  ], e.backgroundMeshSoftness = .75, e.transparentBackground = !1, e;
14256
14391
  },
14257
14392
  Palestine: () => {
14258
- let e = Ld.Hero(), t = e.waves[0];
14393
+ let e = Hd.Hero(), t = e.waves[0];
14259
14394
  return t.paletteSource = "palestine", t.blendMode = "normal", t.hueShift = 0, t.colorContrast = 1, t.colorSaturation = 1, e.grain = .35, e.background = "#f2efe8", e.transparentBackground = !0, e;
14260
14395
  },
14261
14396
  Spain: () => {
14262
- let e = Ld.Hero(), t = e.waves[0];
14397
+ let e = Hd.Hero(), t = e.waves[0];
14263
14398
  return t.paletteSource = "spain", t.blendMode = "normal", t.hueShift = 0, t.colorContrast = 1.18, t.colorSaturation = 1.25, t.creaseLight = 1.6, e.grain = .3, e.background = "#1a0608", e.backgroundMode = "color", e.transparentBackground = !1, e;
14264
14399
  },
14265
14400
  "Vaporwave Sunset": () => {
14266
- let e = Ld.Hero(), t = e.waves[0];
14267
- return t.position.x = 525, t.rotation.x = -.64 * Fd, t.rotation.z = 1.68 * Fd, t.paletteSource = "vaporwave", t.blendMode = "normal", t.hueShift = 0, t.colorContrast = 1.08, t.colorSaturation = 1.15, t.creaseLight = 1.25, e.cameraZoom = 1.1, e.cameraTarget = {
14401
+ let e = Hd.Hero(), t = e.waves[0];
14402
+ return t.position.x = 525, t.rotation.x = -.64 * Bd, t.rotation.z = 1.68 * Bd, t.paletteSource = "vaporwave", t.blendMode = "normal", t.hueShift = 0, t.colorContrast = 1.08, t.colorSaturation = 1.15, t.creaseLight = 1.25, e.cameraZoom = 1.1, e.cameraTarget = {
14268
14403
  x: 150,
14269
14404
  y: 360,
14270
14405
  z: 0
14271
14406
  }, e.background = "#09051f", e.transparentBackground = !1, e;
14272
14407
  },
14408
+ Corkscrew: () => {
14409
+ let e = Hd.Hero(), t = e.waves[0];
14410
+ return t.helixTurns = 5, t.helixRadius = 45, t.helixRoll = 1, t.helixPhase = 0, t.twistFrequency = {
14411
+ x: 0,
14412
+ y: 0,
14413
+ z: 0
14414
+ }, t.twistPower = {
14415
+ x: 4,
14416
+ y: 4,
14417
+ z: 2
14418
+ }, t.displaceAmount = 16, t.displaceFrequency = {
14419
+ x: .006,
14420
+ y: 8e-4
14421
+ }, t.speed = .1, t.position = {
14422
+ x: 0,
14423
+ y: 0,
14424
+ z: 0
14425
+ }, t.rotation = {
14426
+ x: 0,
14427
+ y: 0,
14428
+ z: 12
14429
+ }, t.scale = {
14430
+ x: 3,
14431
+ y: 3,
14432
+ z: 1.5
14433
+ }, t.gradientType = "mesh", t.meshGradientPoints = [
14434
+ {
14435
+ color: "#0a84ff",
14436
+ x: .06,
14437
+ y: .9,
14438
+ influence: .68
14439
+ },
14440
+ {
14441
+ color: "#64d2ff",
14442
+ x: .88,
14443
+ y: .92,
14444
+ influence: .72
14445
+ },
14446
+ {
14447
+ color: "#bf5af2",
14448
+ x: .5,
14449
+ y: .64,
14450
+ influence: .58
14451
+ },
14452
+ {
14453
+ color: "#ff375f",
14454
+ x: .1,
14455
+ y: .14,
14456
+ influence: .7
14457
+ },
14458
+ {
14459
+ color: "#ff9f0a",
14460
+ x: .84,
14461
+ y: .12,
14462
+ influence: .74
14463
+ },
14464
+ {
14465
+ color: "#30d158",
14466
+ x: .94,
14467
+ y: .5,
14468
+ influence: .54
14469
+ }
14470
+ ], t.meshGradientSoftness = .68, t.blendMode = "normal", t.hueShift = 0, t.colorContrast = 1.06, t.colorSaturation = 1.12, t.fiberStrength = .14, e.cameraPosition = {
14471
+ x: -526.009,
14472
+ y: -285.284,
14473
+ z: -425.489
14474
+ }, e.cameraTarget = {
14475
+ x: -95.046,
14476
+ y: -17.053,
14477
+ z: -105.608
14478
+ }, e.cameraDistance = 600, e.cameraZoom = 1.176, e.grain = .3, e.blur = .008, e.bloomStrength = .35, e.bloomRadius = .6, e.bloomThreshold = .55, e.background = "#070914", e.backgroundMode = "color", e.transparentBackground = !1, e;
14479
+ },
14273
14480
  Kaleidoscope: () => {
14274
- let e = Ld["Wave 3"](), t = e.waves[0];
14481
+ let e = Hd["Wave 3"](), t = e.waves[0];
14275
14482
  return t.paletteSource = "kaleidoscope", t.blendMode = "normal", t.hueShift = 0, t.colorContrast = 1.05, t.colorSaturation = 1.12, e.grain = .5, e;
14276
14483
  }
14277
14484
  };
14278
- Ed(), Gl();
14279
- var Rd = () => Promise.resolve(Dd);
14280
- function zd(e, t = {}, n = {}) {
14281
- return Pd(Rd, e, t, n);
14485
+ jd(), Yl();
14486
+ var Ud = () => Promise.resolve(Md);
14487
+ function Wd(e, t = {}, n = {}) {
14488
+ return zd(Ud, e, t, n);
14282
14489
  }
14283
- var Bd = zd;
14490
+ var Gd = Wd;
14284
14491
  //#endregion
14285
- export { Vl as DEFAULT_LIGHT_POSITION, Il as MAX_COLORS, Rl as MAX_LIGHTS, Ll as MAX_MESH_POINTS, zl as MAX_NOISE_BANDS, Bl as MAX_WAVES, Ld as PRESETS, Td as WaveRenderer, wl as createDefaultConfig, yl as createDefaultMeshPoints, gl as createLight, _l as createNoiseBand, zd as createWave, Dl as ensureCamera, kl as ensureSceneDefaults, Fl as ensureStudioConfig, vl as makeStops, Sl as makeWave, bl as makeWaveSpread, Bd as mountWave, El as normalizeBackground, Pl as normalizeSceneInteraction, Ol as normalizeWave, Nl as normalizeWaveInteraction, Cl as resizeWaves };
14492
+ export { Wl as CAMERA_FITS, Gl as DEFAULT_LIGHT_POSITION, zl as MAX_COLORS, Vl as MAX_LIGHTS, Bl as MAX_MESH_POINTS, Hl as MAX_NOISE_BANDS, Ul as MAX_WAVES, Hd as PRESETS, Ad as WaveRenderer, wl as createDefaultConfig, yl as createDefaultMeshPoints, gl as createLight, _l as createNoiseBand, Wd as createWave, Dl as ensureCamera, kl as ensureSceneDefaults, Rl as ensureStudioConfig, vl as makeStops, Sl as makeWave, bl as makeWaveSpread, Gd as mountWave, El as normalizeBackground, Ll as normalizeSceneInteraction, Ol as normalizeWave, Il as normalizeWaveInteraction, Cl as resizeWaves };