@wave3d/core 0.1.0 → 0.2.1

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.
@@ -452,7 +452,7 @@ function pe(e) {
452
452
  }
453
453
  throw Error(`THREE.TextureUtils: Unknown texture type ${e}.`);
454
454
  }
455
- var me, he, ge, _e, ve, ye, z, be, xe, Se, Ce, we, Te, B, Ee, De, Oe, ke, Ae, je, V, Me, H, Ne, U, W, Pe, Fe, Ie, Le, Re, ze, Be, Ve, He, Ue, We, Ge, Ke, qe, Je, Ye, Xe, Ze, Qe, $e, et, tt, nt, rt, it, at, ot, st, ct, lt, ut, dt, ft, pt, mt, ht, gt, _t, vt, yt, bt, xt, St, Ct, wt, Tt, Et, Dt, Ot, kt, At, jt, Mt, Nt, Pt, Ft, It, Lt, Rt, zt, Bt, Vt, Ht, Ut, Wt, Gt, G, Kt, K, qt, Jt, q, Yt, Xt, Zt, J, Qt, $t, en, tn, nn, rn, an, Y, on, sn, cn, ln, un, dn, fn, pn, mn, hn, gn, _n, vn, yn, bn, xn, Sn, Cn, wn, Tn, En, Dn, On, kn, An, jn, Mn, Nn, Pn, Fn, In, Ln, Rn, zn, Bn, Vn, Hn, Un, X, Wn, Gn, Kn, qn, Jn, Yn, Xn, Zn, Qn, $n, er, tr, nr, rr, ir, ar, or, sr, cr, lr, ur, dr, fr, pr, mr, hr, gr, _r, vr, yr, br, xr, Sr, Cr, wr, Tr, Er, Dr, Or, kr, Ar, jr, Mr, Nr, Pr, Fr, Ir, Lr, Rr, zr, Br, Vr, Hr, Ur, Wr, Gr, Kr, qr, Jr, Yr, Xr, Zr, Qr, $r, ei, ti, ni, ri, ii, ai, oi, si, ci, li, ui, di, fi, pi, mi, hi, gi, _i, vi, yi, bi, xi, Si, Ci, wi, Ti, Ei, Di, Oi, ki, Ai, ji, Mi, Ni, Pi, Fi, Ii, Li, Ri, zi, Bi, Vi, Hi, Ui, Wi, Gi, Ki, qi, Ji, Yi, Xi, Zi, Qi, $i, ea, ta, na, ra, ia, aa, oa, sa, ca, la, ua, da, fa, pa, ma, ha, ga, _a, va, ya, ba, xa, Sa, Z, Ca, wa = t((() => {
455
+ var me, he, ge, _e, ve, ye, z, be, xe, Se, Ce, we, Te, B, Ee, De, Oe, ke, Ae, je, V, Me, H, Ne, U, W, Pe, Fe, Ie, Le, Re, ze, Be, Ve, He, Ue, We, Ge, Ke, qe, Je, Ye, Xe, Ze, Qe, $e, et, tt, nt, rt, it, at, ot, st, ct, lt, ut, dt, ft, pt, mt, ht, gt, _t, vt, yt, bt, xt, St, Ct, wt, Tt, Et, Dt, Ot, kt, At, jt, Mt, Nt, Pt, Ft, It, Lt, Rt, zt, Bt, Vt, Ht, Ut, Wt, Gt, G, Kt, K, qt, Jt, q, Yt, Xt, Zt, J, Qt, $t, en, tn, nn, rn, an, Y, on, sn, cn, ln, un, dn, fn, pn, mn, hn, gn, _n, vn, yn, bn, xn, Sn, Cn, wn, Tn, En, Dn, On, kn, An, jn, Mn, Nn, Pn, Fn, In, Ln, Rn, zn, Bn, Vn, Hn, Un, X, Wn, Gn, Kn, qn, Jn, Yn, Xn, Zn, Qn, $n, er, tr, nr, rr, ir, ar, or, sr, cr, lr, ur, dr, fr, pr, mr, hr, gr, _r, vr, yr, br, xr, Sr, Cr, wr, Tr, Er, Dr, Or, kr, Ar, jr, Mr, Nr, Pr, Fr, Ir, Lr, Rr, zr, Br, Vr, Hr, Ur, Wr, Gr, Kr, qr, Jr, Yr, Xr, Zr, Qr, $r, ei, ti, ni, ri, ii, ai, oi, si, ci, li, ui, di, fi, pi, mi, hi, gi, _i, vi, yi, bi, xi, Si, Ci, wi, Ti, Ei, Di, Oi, ki, Ai, ji, Mi, Ni, Pi, Fi, Ii, Li, Ri, zi, Bi, Vi, Hi, Ui, Wi, Gi, Ki, qi, Ji, Yi, Xi, Zi, Qi, $i, ea, ta, na, ra, ia, aa, oa, sa, ca, la, ua, da, fa, pa, ma, ha, ga, _a, va, ya, ba, xa, Sa, Z, Ca = t((() => {
456
456
  me = 1e3, he = 1001, ge = 1002, _e = 1003, ve = 1004, ye = 1005, z = 1006, be = 1007, xe = 1008, Se = 1009, Ce = 1010, we = 1011, Te = 1012, B = 1013, Ee = 1014, De = 1015, Oe = 1016, ke = 1017, Ae = 1018, je = 1020, V = 35902, Me = 35899, H = 1021, Ne = 1022, U = 1023, W = 1026, Pe = 1027, Fe = 1028, Ie = 1029, Le = 1030, Re = 1031, ze = 1033, Be = 33776, Ve = 33777, He = 33778, Ue = 33779, We = 35840, Ge = 35841, Ke = 35842, qe = 35843, Je = 36196, Ye = 37492, Xe = 37496, Ze = 37488, Qe = 37489, $e = 37490, et = 37491, tt = 37808, nt = 37809, rt = 37810, it = 37811, at = 37812, ot = 37813, st = 37814, ct = 37815, lt = 37816, ut = 37817, dt = 37818, ft = 37819, pt = 37820, mt = 37821, ht = 36492, gt = 36494, _t = 36495, vt = 36283, yt = 36284, bt = 36285, xt = 36286, St = 2300, Ct = 2301, wt = 2302, Tt = 2303, Et = 2400, Dt = 2401, Ot = 2402, kt = 3200, At = "srgb", jt = "srgb-linear", Mt = "linear", Nt = "srgb", Pt = 7680, Ft = 35044, It = 2e3, Lt = {}, Rt = null, zt = {
457
457
  0: 1,
458
458
  2: 6,
@@ -5046,29 +5046,7 @@ var me, he, ge, _e, ve, ye, z, be, xe, Se, Ce, we, Te, B, Ee, De, Oe, ke, Ae, je
5046
5046
  Z.prototype._setValue_fromArray_setNeedsUpdate,
5047
5047
  Z.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate
5048
5048
  ]
5049
- ], Ca = class {
5050
- constructor(e = !0) {
5051
- this.autoStart = e, this.startTime = 0, this.oldTime = 0, this.elapsedTime = 0, this.running = !1, l("Clock: This module has been deprecated. Please use THREE.Timer instead.");
5052
- }
5053
- start() {
5054
- this.startTime = performance.now(), this.oldTime = this.startTime, this.elapsedTime = 0, this.running = !0;
5055
- }
5056
- stop() {
5057
- this.getElapsedTime(), this.running = !1, this.autoStart = !1;
5058
- }
5059
- getElapsedTime() {
5060
- return this.getDelta(), this.elapsedTime;
5061
- }
5062
- getDelta() {
5063
- let e = 0;
5064
- if (this.autoStart && !this.running) return this.start(), 0;
5065
- if (this.running) {
5066
- let t = performance.now();
5067
- e = (t - this.oldTime) / 1e3, this.oldTime = t, this.elapsedTime += e;
5068
- }
5069
- return e;
5070
- }
5071
- }, class e {
5049
+ ], class e {
5072
5050
  static {
5073
5051
  e.prototype.isMatrix2 = !0;
5074
5052
  }
@@ -5095,7 +5073,7 @@ var me, he, ge, _e, ve, ye, z, be, xe, Se, Ce, we, Te, B, Ee, De, Oe, ke, Ae, je
5095
5073
  }));
5096
5074
  //#endregion
5097
5075
  //#region ../../node_modules/.pnpm/three@0.185.0/node_modules/three/build/three.module.js
5098
- function Ta() {
5076
+ function wa() {
5099
5077
  let e = null, t = !1, n = null, r = null;
5100
5078
  function i(t, a) {
5101
5079
  n(t, a), r = e.requestAnimationFrame(i);
@@ -5115,7 +5093,7 @@ function Ta() {
5115
5093
  }
5116
5094
  };
5117
5095
  }
5118
- function Ea(e) {
5096
+ function Ta(e) {
5119
5097
  let t = /* @__PURE__ */ new WeakMap();
5120
5098
  function n(t, n) {
5121
5099
  let r = t.array, i = t.usage, a = r.byteLength, o = e.createBuffer();
@@ -5190,7 +5168,7 @@ function Ea(e) {
5190
5168
  update: o
5191
5169
  };
5192
5170
  }
5193
- function Da(e, t, n, r, i, a) {
5171
+ function Ea(e, t, n, r, i, a) {
5194
5172
  let o = new X(0), s = i === !0 ? 0 : 1, c, l, u = null, d = 0, f = null;
5195
5173
  function p(e) {
5196
5174
  let n = e.isScene === !0 ? e.background : null;
@@ -5210,9 +5188,9 @@ function Da(e, t, n, r, i, a) {
5210
5188
  let i = p(n);
5211
5189
  i && (i.isCubeTexture || i.mapping === 306) ? (l === void 0 && (l = new si(new Ci(1, 1, 1), new Oi({
5212
5190
  name: "BackgroundCubeMaterial",
5213
- uniforms: oe(js.backgroundCube.uniforms),
5214
- vertexShader: js.backgroundCube.vertexShader,
5215
- fragmentShader: js.backgroundCube.fragmentShader,
5191
+ uniforms: oe(As.backgroundCube.uniforms),
5192
+ vertexShader: As.backgroundCube.vertexShader,
5193
+ fragmentShader: As.backgroundCube.fragmentShader,
5216
5194
  side: 1,
5217
5195
  depthTest: !1,
5218
5196
  depthWrite: !1,
@@ -5222,11 +5200,11 @@ function Da(e, t, n, r, i, a) {
5222
5200
  this.matrixWorld.copyPosition(n.matrixWorld);
5223
5201
  }, Object.defineProperty(l.material, "envMap", { get: function() {
5224
5202
  return this.uniforms.envMap.value;
5225
- } }), r.update(l)), l.material.uniforms.envMap.value = i, l.material.uniforms.backgroundBlurriness.value = n.backgroundBlurriness, l.material.uniforms.backgroundIntensity.value = n.backgroundIntensity, l.material.uniforms.backgroundRotation.value.setFromMatrix4(Ns.makeRotationFromEuler(n.backgroundRotation)).transpose(), i.isCubeTexture && i.isRenderTargetTexture === !1 && l.material.uniforms.backgroundRotation.value.premultiply(Ps), l.material.toneMapped = J.getTransfer(i.colorSpace) !== Nt, (u !== i || d !== i.version || f !== e.toneMapping) && (l.material.needsUpdate = !0, u = i, d = i.version, f = e.toneMapping), l.layers.enableAll(), t.unshift(l, l.geometry, l.material, 0, 0, null)) : i && i.isTexture && (c === void 0 && (c = new si(new wi(2, 2), new Oi({
5203
+ } }), r.update(l)), l.material.uniforms.envMap.value = i, l.material.uniforms.backgroundBlurriness.value = n.backgroundBlurriness, l.material.uniforms.backgroundIntensity.value = n.backgroundIntensity, l.material.uniforms.backgroundRotation.value.setFromMatrix4(Ms.makeRotationFromEuler(n.backgroundRotation)).transpose(), i.isCubeTexture && i.isRenderTargetTexture === !1 && l.material.uniforms.backgroundRotation.value.premultiply(Ns), l.material.toneMapped = J.getTransfer(i.colorSpace) !== Nt, (u !== i || d !== i.version || f !== e.toneMapping) && (l.material.needsUpdate = !0, u = i, d = i.version, f = e.toneMapping), l.layers.enableAll(), t.unshift(l, l.geometry, l.material, 0, 0, null)) : i && i.isTexture && (c === void 0 && (c = new si(new wi(2, 2), new Oi({
5226
5204
  name: "BackgroundMaterial",
5227
- uniforms: oe(js.background.uniforms),
5228
- vertexShader: js.background.vertexShader,
5229
- fragmentShader: js.background.fragmentShader,
5205
+ uniforms: oe(As.background.uniforms),
5206
+ vertexShader: As.background.vertexShader,
5207
+ fragmentShader: As.background.fragmentShader,
5230
5208
  side: 0,
5231
5209
  depthTest: !1,
5232
5210
  depthWrite: !1,
@@ -5237,7 +5215,7 @@ function Da(e, t, n, r, i, a) {
5237
5215
  } }), r.update(c)), c.material.uniforms.t2D.value = i, c.material.uniforms.backgroundIntensity.value = n.backgroundIntensity, c.material.toneMapped = J.getTransfer(i.colorSpace) !== Nt, i.matrixAutoUpdate === !0 && i.updateMatrix(), c.material.uniforms.uvTransform.value.copy(i.matrix), (u !== i || d !== i.version || f !== e.toneMapping) && (c.material.needsUpdate = !0, u = i, d = i.version, f = e.toneMapping), c.layers.enableAll(), t.unshift(c, c.geometry, c.material, 0, 0, null));
5238
5216
  }
5239
5217
  function g(t, r) {
5240
- t.getRGB(Ms, le(e)), n.buffers.color.setClear(Ms.r, Ms.g, Ms.b, r, a);
5218
+ t.getRGB(js, le(e)), n.buffers.color.setClear(js.r, js.g, js.b, r, a);
5241
5219
  }
5242
5220
  function _() {
5243
5221
  l !== void 0 && (l.geometry.dispose(), l.material.dispose(), l = void 0), c !== void 0 && (c.geometry.dispose(), c.material.dispose(), c = void 0);
@@ -5260,7 +5238,7 @@ function Da(e, t, n, r, i, a) {
5260
5238
  dispose: _
5261
5239
  };
5262
5240
  }
5263
- function Oa(e, t) {
5241
+ function Da(e, t) {
5264
5242
  let n = e.getParameter(e.MAX_VERTEX_ATTRIBS), r = {}, i = f(null), a = i, o = !1;
5265
5243
  function s(n, r, i, s, c) {
5266
5244
  let u = !1, f = d(n, s, i, r);
@@ -5455,7 +5433,7 @@ function Oa(e, t) {
5455
5433
  disableUnusedAttributes: v
5456
5434
  };
5457
5435
  }
5458
- function ka(e, t, n) {
5436
+ function Oa(e, t, n) {
5459
5437
  let r;
5460
5438
  function i(e) {
5461
5439
  r = e;
@@ -5475,7 +5453,7 @@ function ka(e, t, n) {
5475
5453
  }
5476
5454
  this.setMode = i, this.render = a, this.renderInstances = o, this.renderMultiDraw = s;
5477
5455
  }
5478
- function Aa(e, t, n, r) {
5456
+ function ka(e, t, n, r) {
5479
5457
  let i;
5480
5458
  function a() {
5481
5459
  if (i !== void 0) return i;
@@ -5525,7 +5503,7 @@ function Aa(e, t, n, r) {
5525
5503
  samples: C
5526
5504
  };
5527
5505
  }
5528
- function ja(e) {
5506
+ function Aa(e) {
5529
5507
  let t = this, n = null, r = 0, i = !1, a = !1, o = new fi(), s = new q(), c = {
5530
5508
  value: null,
5531
5509
  needsUpdate: !1
@@ -5565,13 +5543,13 @@ function ja(e) {
5565
5543
  return t.numPlanes = a, t.numIntersection = 0, l;
5566
5544
  }
5567
5545
  }
5568
- function Ma(e) {
5569
- let t = [], n = [], r = [], i = e, a = e - Fs + 1 + Is.length;
5546
+ function ja(e) {
5547
+ let t = [], n = [], r = [], i = e, a = e - Ps + 1 + Fs.length;
5570
5548
  for (let o = 0; o < a; o++) {
5571
5549
  let a = 2 ** i;
5572
5550
  t.push(a);
5573
5551
  let s = 1 / a;
5574
- o > e - Fs ? s = Is[o - e + Fs - 1] : o === 0 && (s = 0), n.push(s);
5552
+ o > e - Ps ? s = Fs[o - e + Ps - 1] : o === 0 && (s = 0), n.push(s);
5575
5553
  let c = 1 / (a - 2), l = -c, u = 1 + c, d = [
5576
5554
  l,
5577
5555
  l,
@@ -5619,7 +5597,7 @@ function Ma(e) {
5619
5597
  m.set(i, 6 * e);
5620
5598
  }
5621
5599
  let h = new Rr();
5622
- h.setAttribute("position", new Cr(f, 3)), h.setAttribute("uv", new Cr(p, 2)), h.setAttribute("faceIndex", new Cr(m, 1)), r.push(new si(h, null)), i > Fs && i--;
5600
+ h.setAttribute("position", new Cr(f, 3)), h.setAttribute("uv", new Cr(p, 2)), h.setAttribute("faceIndex", new Cr(m, 1)), r.push(new si(h, null)), i > Ps && i--;
5623
5601
  }
5624
5602
  return {
5625
5603
  lodMeshes: r,
@@ -5627,18 +5605,18 @@ function Ma(e) {
5627
5605
  sigmas: n
5628
5606
  };
5629
5607
  }
5630
- function Na(e, t, n) {
5608
+ function Ma(e, t, n) {
5631
5609
  let r = new sn(e, t, n);
5632
5610
  return r.texture.mapping = 306, r.texture.name = "PMREM.cubeUv", r.scissorTest = !0, r;
5633
5611
  }
5634
- function Pa(e, t, n, r, i) {
5612
+ function Na(e, t, n, r, i) {
5635
5613
  e.viewport.set(t, n, r, i), e.scissor.set(t, n, r, i);
5636
5614
  }
5637
- function Fa(e, t, n) {
5615
+ function Pa(e, t, n) {
5638
5616
  return new Oi({
5639
5617
  name: "PMREMGGXConvolution",
5640
5618
  defines: {
5641
- GGX_SAMPLES: Rs,
5619
+ GGX_SAMPLES: Ls,
5642
5620
  CUBEUV_TEXEL_WIDTH: 1 / t,
5643
5621
  CUBEUV_TEXEL_HEIGHT: 1 / n,
5644
5622
  CUBEUV_MAX_MIP: `${e}.0`
@@ -5648,19 +5626,19 @@ function Fa(e, t, n) {
5648
5626
  roughness: { value: 0 },
5649
5627
  mipInt: { value: 0 }
5650
5628
  },
5651
- vertexShader: za(),
5629
+ vertexShader: Ra(),
5652
5630
  fragmentShader: "\n\n precision highp float;\n precision highp int;\n\n varying vec3 vOutputDirection;\n\n uniform sampler2D envMap;\n uniform float roughness;\n uniform float mipInt;\n\n #define ENVMAP_TYPE_CUBE_UV\n #include <cube_uv_reflection_fragment>\n\n #define PI 3.14159265359\n\n // Van der Corput radical inverse\n float radicalInverse_VdC(uint bits) {\n bits = (bits << 16u) | (bits >> 16u);\n bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u);\n bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u);\n bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u);\n bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u);\n return float(bits) * 2.3283064365386963e-10; // / 0x100000000\n }\n\n // Hammersley sequence\n vec2 hammersley(uint i, uint N) {\n return vec2(float(i) / float(N), radicalInverse_VdC(i));\n }\n\n // GGX VNDF importance sampling (Eric Heitz 2018)\n // \"Sampling the GGX Distribution of Visible Normals\"\n // https://jcgt.org/published/0007/04/01/\n vec3 importanceSampleGGX_VNDF(vec2 Xi, vec3 V, float roughness) {\n float alpha = roughness * roughness;\n\n // Section 4.1: Orthonormal basis\n vec3 T1 = vec3(1.0, 0.0, 0.0);\n vec3 T2 = cross(V, T1);\n\n // Section 4.2: Parameterization of projected area\n float r = sqrt(Xi.x);\n float phi = 2.0 * PI * Xi.y;\n float t1 = r * cos(phi);\n float t2 = r * sin(phi);\n float s = 0.5 * (1.0 + V.z);\n t2 = (1.0 - s) * sqrt(1.0 - t1 * t1) + s * t2;\n\n // Section 4.3: Reprojection onto hemisphere\n vec3 Nh = t1 * T1 + t2 * T2 + sqrt(max(0.0, 1.0 - t1 * t1 - t2 * t2)) * V;\n\n // Section 3.4: Transform back to ellipsoid configuration\n return normalize(vec3(alpha * Nh.x, alpha * Nh.y, max(0.0, Nh.z)));\n }\n\n void main() {\n vec3 N = normalize(vOutputDirection);\n vec3 V = N; // Assume view direction equals normal for pre-filtering\n\n vec3 prefilteredColor = vec3(0.0);\n float totalWeight = 0.0;\n\n // For very low roughness, just sample the environment directly\n if (roughness < 0.001) {\n gl_FragColor = vec4(bilinearCubeUV(envMap, N, mipInt), 1.0);\n return;\n }\n\n // Tangent space basis for VNDF sampling\n vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);\n vec3 tangent = normalize(cross(up, N));\n vec3 bitangent = cross(N, tangent);\n\n for(uint i = 0u; i < uint(GGX_SAMPLES); i++) {\n vec2 Xi = hammersley(i, uint(GGX_SAMPLES));\n\n // For PMREM, V = N, so in tangent space V is always (0, 0, 1)\n vec3 H_tangent = importanceSampleGGX_VNDF(Xi, vec3(0.0, 0.0, 1.0), roughness);\n\n // Transform H back to world space\n vec3 H = normalize(tangent * H_tangent.x + bitangent * H_tangent.y + N * H_tangent.z);\n vec3 L = normalize(2.0 * dot(V, H) * H - V);\n\n float NdotL = max(dot(N, L), 0.0);\n\n if(NdotL > 0.0) {\n // Sample environment at fixed mip level\n // VNDF importance sampling handles the distribution filtering\n vec3 sampleColor = bilinearCubeUV(envMap, L, mipInt);\n\n // Weight by NdotL for the split-sum approximation\n // VNDF PDF naturally accounts for the visible microfacet distribution\n prefilteredColor += sampleColor * NdotL;\n totalWeight += NdotL;\n }\n }\n\n if (totalWeight > 0.0) {\n prefilteredColor = prefilteredColor / totalWeight;\n }\n\n gl_FragColor = vec4(prefilteredColor, 1.0);\n }\n ",
5653
5631
  blending: 0,
5654
5632
  depthTest: !1,
5655
5633
  depthWrite: !1
5656
5634
  });
5657
5635
  }
5658
- function Ia(e, t, n) {
5659
- let r = new Float32Array(Ls), i = new K(0, 1, 0);
5636
+ function Fa(e, t, n) {
5637
+ let r = new Float32Array(Is), i = new K(0, 1, 0);
5660
5638
  return new Oi({
5661
5639
  name: "SphericalGaussianBlur",
5662
5640
  defines: {
5663
- n: Ls,
5641
+ n: Is,
5664
5642
  CUBEUV_TEXEL_WIDTH: 1 / t,
5665
5643
  CUBEUV_TEXEL_HEIGHT: 1 / n,
5666
5644
  CUBEUV_MAX_MIP: `${e}.0`
@@ -5674,42 +5652,42 @@ function Ia(e, t, n) {
5674
5652
  mipInt: { value: 0 },
5675
5653
  poleAxis: { value: i }
5676
5654
  },
5677
- vertexShader: za(),
5655
+ vertexShader: Ra(),
5678
5656
  fragmentShader: "\n\n precision mediump float;\n precision mediump int;\n\n varying vec3 vOutputDirection;\n\n uniform sampler2D envMap;\n uniform int samples;\n uniform float weights[ n ];\n uniform bool latitudinal;\n uniform float dTheta;\n uniform float mipInt;\n uniform vec3 poleAxis;\n\n #define ENVMAP_TYPE_CUBE_UV\n #include <cube_uv_reflection_fragment>\n\n vec3 getSample( float theta, vec3 axis ) {\n\n float cosTheta = cos( theta );\n // Rodrigues' axis-angle rotation\n vec3 sampleDirection = vOutputDirection * cosTheta\n + cross( axis, vOutputDirection ) * sin( theta )\n + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n return bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n }\n\n void main() {\n\n vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n if ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n }\n\n axis = normalize( axis );\n\n gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n for ( int i = 1; i < n; i++ ) {\n\n if ( i >= samples ) {\n\n break;\n\n }\n\n float theta = dTheta * float( i );\n gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n }\n\n }\n ",
5679
5657
  blending: 0,
5680
5658
  depthTest: !1,
5681
5659
  depthWrite: !1
5682
5660
  });
5683
5661
  }
5684
- function La() {
5662
+ function Ia() {
5685
5663
  return new Oi({
5686
5664
  name: "EquirectangularToCubeUV",
5687
5665
  uniforms: { envMap: { value: null } },
5688
- vertexShader: za(),
5666
+ vertexShader: Ra(),
5689
5667
  fragmentShader: "\n\n precision mediump float;\n precision mediump int;\n\n varying vec3 vOutputDirection;\n\n uniform sampler2D envMap;\n\n #include <common>\n\n void main() {\n\n vec3 outputDirection = normalize( vOutputDirection );\n vec2 uv = equirectUv( outputDirection );\n\n gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n }\n ",
5690
5668
  blending: 0,
5691
5669
  depthTest: !1,
5692
5670
  depthWrite: !1
5693
5671
  });
5694
5672
  }
5695
- function Ra() {
5673
+ function La() {
5696
5674
  return new Oi({
5697
5675
  name: "CubemapToCubeUV",
5698
5676
  uniforms: {
5699
5677
  envMap: { value: null },
5700
5678
  flipEnvMap: { value: -1 }
5701
5679
  },
5702
- vertexShader: za(),
5680
+ vertexShader: Ra(),
5703
5681
  fragmentShader: "\n\n precision mediump float;\n precision mediump int;\n\n uniform float flipEnvMap;\n\n varying vec3 vOutputDirection;\n\n uniform samplerCube envMap;\n\n void main() {\n\n gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n }\n ",
5704
5682
  blending: 0,
5705
5683
  depthTest: !1,
5706
5684
  depthWrite: !1
5707
5685
  });
5708
5686
  }
5709
- function za() {
5687
+ function Ra() {
5710
5688
  return "\n\n precision mediump float;\n precision mediump int;\n\n attribute float faceIndex;\n\n varying vec3 vOutputDirection;\n\n // RH coordinate system; PMREM face-indexing convention\n vec3 getDirection( vec2 uv, float face ) {\n\n uv = 2.0 * uv - 1.0;\n\n vec3 direction = vec3( uv, 1.0 );\n\n if ( face == 0.0 ) {\n\n direction = direction.zyx; // ( 1, v, u ) pos x\n\n } else if ( face == 1.0 ) {\n\n direction = direction.xzy;\n direction.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n } else if ( face == 2.0 ) {\n\n direction.x *= -1.0; // ( -u, v, 1 ) pos z\n\n } else if ( face == 3.0 ) {\n\n direction = direction.zyx;\n direction.xz *= -1.0; // ( -1, v, -u ) neg x\n\n } else if ( face == 4.0 ) {\n\n direction = direction.xzy;\n direction.xy *= -1.0; // ( -u, -1, v ) neg y\n\n } else if ( face == 5.0 ) {\n\n direction.z *= -1.0; // ( u, v, -1 ) neg z\n\n }\n\n return direction;\n\n }\n\n void main() {\n\n vOutputDirection = getDirection( uv, faceIndex );\n gl_Position = vec4( position, 1.0 );\n\n }\n ";
5711
5689
  }
5712
- function Ba(e) {
5690
+ function za(e) {
5713
5691
  let t = /* @__PURE__ */ new WeakMap(), n = /* @__PURE__ */ new WeakMap(), r = null;
5714
5692
  function i(e, t = !1) {
5715
5693
  return e == null ? null : t ? o(e) : a(e);
@@ -5723,7 +5701,7 @@ function Ba(e) {
5723
5701
  } else {
5724
5702
  let r = n.image;
5725
5703
  if (r && r.height > 0) {
5726
- let i = new qs(r.height);
5704
+ let i = new Ks(r.height);
5727
5705
  return i.fromEquirectangularTexture(e, n), t.set(n, i), n.addEventListener("dispose", l), s(i.texture, n.mapping);
5728
5706
  } else return null;
5729
5707
  }
@@ -5735,11 +5713,11 @@ function Ba(e) {
5735
5713
  let i = t.mapping, a = i === 303 || i === 304, o = i === 301 || i === 302;
5736
5714
  if (a || o) {
5737
5715
  let i = n.get(t), s = i === void 0 ? 0 : i.texture.pmremVersion;
5738
- if (t.isRenderTargetTexture && t.pmremVersion !== s) return r === null && (r = new Ks(e)), i = a ? r.fromEquirectangular(t, i) : r.fromCubemap(t, i), i.texture.pmremVersion = t.pmremVersion, n.set(t, i), i.texture;
5716
+ if (t.isRenderTargetTexture && t.pmremVersion !== s) return r === null && (r = new Gs(e)), i = a ? r.fromEquirectangular(t, i) : r.fromCubemap(t, i), i.texture.pmremVersion = t.pmremVersion, n.set(t, i), i.texture;
5739
5717
  if (i !== void 0) return i.texture;
5740
5718
  {
5741
5719
  let s = t.image;
5742
- return a && s && s.height > 0 || o && s && c(s) ? (r === null && (r = new Ks(e)), i = a ? r.fromEquirectangular(t) : r.fromCubemap(t), i.texture.pmremVersion = t.pmremVersion, n.set(t, i), t.addEventListener("dispose", u), i.texture) : null;
5720
+ return a && s && s.height > 0 || o && s && c(s) ? (r === null && (r = new Gs(e)), i = a ? r.fromEquirectangular(t) : r.fromCubemap(t), i.texture.pmremVersion = t.pmremVersion, n.set(t, i), t.addEventListener("dispose", u), i.texture) : null;
5743
5721
  }
5744
5722
  }
5745
5723
  }
@@ -5773,7 +5751,7 @@ function Ba(e) {
5773
5751
  dispose: d
5774
5752
  };
5775
5753
  }
5776
- function Va(e) {
5754
+ function Ba(e) {
5777
5755
  let t = {};
5778
5756
  function n(n) {
5779
5757
  if (t[n] !== void 0) return t[n];
@@ -5793,7 +5771,7 @@ function Va(e) {
5793
5771
  }
5794
5772
  };
5795
5773
  }
5796
- function Ha(e, t, n, r) {
5774
+ function Va(e, t, n, r) {
5797
5775
  let i = {}, a = /* @__PURE__ */ new WeakMap();
5798
5776
  function o(e) {
5799
5777
  let s = e.target;
@@ -5847,7 +5825,7 @@ function Ha(e, t, n, r) {
5847
5825
  getWireframeAttribute: u
5848
5826
  };
5849
5827
  }
5850
- function Ua(e, t, n) {
5828
+ function Ha(e, t, n) {
5851
5829
  let r;
5852
5830
  function i(e) {
5853
5831
  r = e;
@@ -5871,7 +5849,7 @@ function Ua(e, t, n) {
5871
5849
  }
5872
5850
  this.setMode = i, this.setIndex = s, this.render = c, this.renderInstances = l, this.renderMultiDraw = u;
5873
5851
  }
5874
- function Wa(e) {
5852
+ function Ua(e) {
5875
5853
  let t = {
5876
5854
  geometries: 0,
5877
5855
  textures: 0
@@ -5916,7 +5894,7 @@ function Wa(e) {
5916
5894
  update: r
5917
5895
  };
5918
5896
  }
5919
- function Ga(e, t, n) {
5897
+ function Wa(e, t, n) {
5920
5898
  let r = /* @__PURE__ */ new WeakMap(), i = new Y();
5921
5899
  function a(a, o, s) {
5922
5900
  let c = a.morphTargetInfluences, l = o.morphAttributes.position || o.morphAttributes.normal || o.morphAttributes.color, u = l === void 0 ? 0 : l.length, d = r.get(o);
@@ -5957,7 +5935,7 @@ function Ga(e, t, n) {
5957
5935
  }
5958
5936
  return { update: a };
5959
5937
  }
5960
- function Ka(e, t, n, r, i) {
5938
+ function Ga(e, t, n, r, i) {
5961
5939
  let a = /* @__PURE__ */ new WeakMap();
5962
5940
  function o(r) {
5963
5941
  let o = i.render.frame, s = r.geometry, l = t.get(r, s);
@@ -5979,7 +5957,7 @@ function Ka(e, t, n, r, i) {
5979
5957
  dispose: s
5980
5958
  };
5981
5959
  }
5982
- function qa(e, t, n, r, i, a) {
5960
+ function Ka(e, t, n, r, i, a) {
5983
5961
  let o = new sn(t, n, {
5984
5962
  type: e,
5985
5963
  depthBuffer: i,
@@ -6050,7 +6028,7 @@ function qa(e, t, n, r, i, a) {
6050
6028
  }
6051
6029
  if (f !== e.outputColorSpace || p !== e.toneMapping) {
6052
6030
  f = e.outputColorSpace, p = e.toneMapping, l.defines = {}, J.getTransfer(f) === "srgb" && (l.defines.SRGB_TRANSFER = "");
6053
- let t = Js[p];
6031
+ let t = qs[p];
6054
6032
  t && (l.defines[t] = ""), l.needsUpdate = !0;
6055
6033
  }
6056
6034
  l.uniforms.tDiffuse.value = n.texture, e.setRenderTarget(g), e.render(u, d), g = null, m = !1;
@@ -6060,335 +6038,335 @@ function qa(e, t, n, r, i, a) {
6060
6038
  o.depthTexture && o.depthTexture.dispose(), o.dispose(), s.dispose(), c.dispose(), l.dispose();
6061
6039
  };
6062
6040
  }
6063
- function Ja(e, t, n) {
6041
+ function qa(e, t, n) {
6064
6042
  let r = e[0];
6065
6043
  if (r <= 0 || r > 0) return e;
6066
- let i = t * n, a = ec[i];
6067
- if (a === void 0 && (a = new Float32Array(i), ec[i] = a), t !== 0) {
6044
+ let i = t * n, a = $s[i];
6045
+ if (a === void 0 && (a = new Float32Array(i), $s[i] = a), t !== 0) {
6068
6046
  r.toArray(a, 0);
6069
6047
  for (let r = 1, i = 0; r !== t; ++r) i += n, e[r].toArray(a, i);
6070
6048
  }
6071
6049
  return a;
6072
6050
  }
6073
- function Ya(e, t) {
6051
+ function Ja(e, t) {
6074
6052
  if (e.length !== t.length) return !1;
6075
6053
  for (let n = 0, r = e.length; n < r; n++) if (e[n] !== t[n]) return !1;
6076
6054
  return !0;
6077
6055
  }
6078
- function Xa(e, t) {
6056
+ function Ya(e, t) {
6079
6057
  for (let n = 0, r = t.length; n < r; n++) e[n] = t[n];
6080
6058
  }
6081
- function Za(e, t) {
6082
- let n = tc[t];
6083
- n === void 0 && (n = new Int32Array(t), tc[t] = n);
6059
+ function Xa(e, t) {
6060
+ let n = ec[t];
6061
+ n === void 0 && (n = new Int32Array(t), ec[t] = n);
6084
6062
  for (let r = 0; r !== t; ++r) n[r] = e.allocateTextureUnit();
6085
6063
  return n;
6086
6064
  }
6087
- function Qa(e, t) {
6065
+ function Za(e, t) {
6088
6066
  let n = this.cache;
6089
6067
  n[0] !== t && (e.uniform1f(this.addr, t), n[0] = t);
6090
6068
  }
6091
- function $a(e, t) {
6069
+ function Qa(e, t) {
6092
6070
  let n = this.cache;
6093
6071
  if (t.x !== void 0) (n[0] !== t.x || n[1] !== t.y) && (e.uniform2f(this.addr, t.x, t.y), n[0] = t.x, n[1] = t.y);
6094
6072
  else {
6095
- if (Ya(n, t)) return;
6096
- e.uniform2fv(this.addr, t), Xa(n, t);
6073
+ if (Ja(n, t)) return;
6074
+ e.uniform2fv(this.addr, t), Ya(n, t);
6097
6075
  }
6098
6076
  }
6099
- function eo(e, t) {
6077
+ function $a(e, t) {
6100
6078
  let n = this.cache;
6101
6079
  if (t.x !== void 0) (n[0] !== t.x || n[1] !== t.y || n[2] !== t.z) && (e.uniform3f(this.addr, t.x, t.y, t.z), n[0] = t.x, n[1] = t.y, n[2] = t.z);
6102
6080
  else if (t.r !== void 0) (n[0] !== t.r || n[1] !== t.g || n[2] !== t.b) && (e.uniform3f(this.addr, t.r, t.g, t.b), n[0] = t.r, n[1] = t.g, n[2] = t.b);
6103
6081
  else {
6104
- if (Ya(n, t)) return;
6105
- e.uniform3fv(this.addr, t), Xa(n, t);
6082
+ if (Ja(n, t)) return;
6083
+ e.uniform3fv(this.addr, t), Ya(n, t);
6106
6084
  }
6107
6085
  }
6108
- function to(e, t) {
6086
+ function eo(e, t) {
6109
6087
  let n = this.cache;
6110
6088
  if (t.x !== void 0) (n[0] !== t.x || n[1] !== t.y || n[2] !== t.z || n[3] !== t.w) && (e.uniform4f(this.addr, t.x, t.y, t.z, t.w), n[0] = t.x, n[1] = t.y, n[2] = t.z, n[3] = t.w);
6111
6089
  else {
6112
- if (Ya(n, t)) return;
6113
- e.uniform4fv(this.addr, t), Xa(n, t);
6090
+ if (Ja(n, t)) return;
6091
+ e.uniform4fv(this.addr, t), Ya(n, t);
6114
6092
  }
6115
6093
  }
6116
- function no(e, t) {
6094
+ function to(e, t) {
6117
6095
  let n = this.cache, r = t.elements;
6118
6096
  if (r === void 0) {
6119
- if (Ya(n, t)) return;
6120
- e.uniformMatrix2fv(this.addr, !1, t), Xa(n, t);
6097
+ if (Ja(n, t)) return;
6098
+ e.uniformMatrix2fv(this.addr, !1, t), Ya(n, t);
6121
6099
  } else {
6122
- if (Ya(n, r)) return;
6123
- ic.set(r), e.uniformMatrix2fv(this.addr, !1, ic), Xa(n, r);
6100
+ if (Ja(n, r)) return;
6101
+ rc.set(r), e.uniformMatrix2fv(this.addr, !1, rc), Ya(n, r);
6124
6102
  }
6125
6103
  }
6126
- function ro(e, t) {
6104
+ function no(e, t) {
6127
6105
  let n = this.cache, r = t.elements;
6128
6106
  if (r === void 0) {
6129
- if (Ya(n, t)) return;
6130
- e.uniformMatrix3fv(this.addr, !1, t), Xa(n, t);
6107
+ if (Ja(n, t)) return;
6108
+ e.uniformMatrix3fv(this.addr, !1, t), Ya(n, t);
6131
6109
  } else {
6132
- if (Ya(n, r)) return;
6133
- rc.set(r), e.uniformMatrix3fv(this.addr, !1, rc), Xa(n, r);
6110
+ if (Ja(n, r)) return;
6111
+ nc.set(r), e.uniformMatrix3fv(this.addr, !1, nc), Ya(n, r);
6134
6112
  }
6135
6113
  }
6136
- function io(e, t) {
6114
+ function ro(e, t) {
6137
6115
  let n = this.cache, r = t.elements;
6138
6116
  if (r === void 0) {
6139
- if (Ya(n, t)) return;
6140
- e.uniformMatrix4fv(this.addr, !1, t), Xa(n, t);
6117
+ if (Ja(n, t)) return;
6118
+ e.uniformMatrix4fv(this.addr, !1, t), Ya(n, t);
6141
6119
  } else {
6142
- if (Ya(n, r)) return;
6143
- nc.set(r), e.uniformMatrix4fv(this.addr, !1, nc), Xa(n, r);
6120
+ if (Ja(n, r)) return;
6121
+ tc.set(r), e.uniformMatrix4fv(this.addr, !1, tc), Ya(n, r);
6144
6122
  }
6145
6123
  }
6146
- function ao(e, t) {
6124
+ function io(e, t) {
6147
6125
  let n = this.cache;
6148
6126
  n[0] !== t && (e.uniform1i(this.addr, t), n[0] = t);
6149
6127
  }
6150
- function oo(e, t) {
6128
+ function ao(e, t) {
6151
6129
  let n = this.cache;
6152
6130
  if (t.x !== void 0) (n[0] !== t.x || n[1] !== t.y) && (e.uniform2i(this.addr, t.x, t.y), n[0] = t.x, n[1] = t.y);
6153
6131
  else {
6154
- if (Ya(n, t)) return;
6155
- e.uniform2iv(this.addr, t), Xa(n, t);
6132
+ if (Ja(n, t)) return;
6133
+ e.uniform2iv(this.addr, t), Ya(n, t);
6156
6134
  }
6157
6135
  }
6158
- function so(e, t) {
6136
+ function oo(e, t) {
6159
6137
  let n = this.cache;
6160
6138
  if (t.x !== void 0) (n[0] !== t.x || n[1] !== t.y || n[2] !== t.z) && (e.uniform3i(this.addr, t.x, t.y, t.z), n[0] = t.x, n[1] = t.y, n[2] = t.z);
6161
6139
  else {
6162
- if (Ya(n, t)) return;
6163
- e.uniform3iv(this.addr, t), Xa(n, t);
6140
+ if (Ja(n, t)) return;
6141
+ e.uniform3iv(this.addr, t), Ya(n, t);
6164
6142
  }
6165
6143
  }
6166
- function co(e, t) {
6144
+ function so(e, t) {
6167
6145
  let n = this.cache;
6168
6146
  if (t.x !== void 0) (n[0] !== t.x || n[1] !== t.y || n[2] !== t.z || n[3] !== t.w) && (e.uniform4i(this.addr, t.x, t.y, t.z, t.w), n[0] = t.x, n[1] = t.y, n[2] = t.z, n[3] = t.w);
6169
6147
  else {
6170
- if (Ya(n, t)) return;
6171
- e.uniform4iv(this.addr, t), Xa(n, t);
6148
+ if (Ja(n, t)) return;
6149
+ e.uniform4iv(this.addr, t), Ya(n, t);
6172
6150
  }
6173
6151
  }
6174
- function lo(e, t) {
6152
+ function co(e, t) {
6175
6153
  let n = this.cache;
6176
6154
  n[0] !== t && (e.uniform1ui(this.addr, t), n[0] = t);
6177
6155
  }
6178
- function uo(e, t) {
6156
+ function lo(e, t) {
6179
6157
  let n = this.cache;
6180
6158
  if (t.x !== void 0) (n[0] !== t.x || n[1] !== t.y) && (e.uniform2ui(this.addr, t.x, t.y), n[0] = t.x, n[1] = t.y);
6181
6159
  else {
6182
- if (Ya(n, t)) return;
6183
- e.uniform2uiv(this.addr, t), Xa(n, t);
6160
+ if (Ja(n, t)) return;
6161
+ e.uniform2uiv(this.addr, t), Ya(n, t);
6184
6162
  }
6185
6163
  }
6186
- function fo(e, t) {
6164
+ function uo(e, t) {
6187
6165
  let n = this.cache;
6188
6166
  if (t.x !== void 0) (n[0] !== t.x || n[1] !== t.y || n[2] !== t.z) && (e.uniform3ui(this.addr, t.x, t.y, t.z), n[0] = t.x, n[1] = t.y, n[2] = t.z);
6189
6167
  else {
6190
- if (Ya(n, t)) return;
6191
- e.uniform3uiv(this.addr, t), Xa(n, t);
6168
+ if (Ja(n, t)) return;
6169
+ e.uniform3uiv(this.addr, t), Ya(n, t);
6192
6170
  }
6193
6171
  }
6194
- function po(e, t) {
6172
+ function fo(e, t) {
6195
6173
  let n = this.cache;
6196
6174
  if (t.x !== void 0) (n[0] !== t.x || n[1] !== t.y || n[2] !== t.z || n[3] !== t.w) && (e.uniform4ui(this.addr, t.x, t.y, t.z, t.w), n[0] = t.x, n[1] = t.y, n[2] = t.z, n[3] = t.w);
6197
6175
  else {
6198
- if (Ya(n, t)) return;
6199
- e.uniform4uiv(this.addr, t), Xa(n, t);
6176
+ if (Ja(n, t)) return;
6177
+ e.uniform4uiv(this.addr, t), Ya(n, t);
6200
6178
  }
6201
6179
  }
6202
- function mo(e, t, n) {
6180
+ function po(e, t, n) {
6203
6181
  let r = this.cache, i = n.allocateTextureUnit();
6204
6182
  r[0] !== i && (e.uniform1i(this.addr, i), r[0] = i);
6205
6183
  let a;
6206
- this.type === e.SAMPLER_2D_SHADOW ? (Xs.compareFunction = n.isReversedDepthBuffer() ? 518 : 515, a = Xs) : a = Ys, n.setTexture2D(t || a, i);
6184
+ this.type === e.SAMPLER_2D_SHADOW ? (Ys.compareFunction = n.isReversedDepthBuffer() ? 518 : 515, a = Ys) : a = Js, n.setTexture2D(t || a, i);
6207
6185
  }
6208
- function ho(e, t, n) {
6186
+ function mo(e, t, n) {
6209
6187
  let r = this.cache, i = n.allocateTextureUnit();
6210
- r[0] !== i && (e.uniform1i(this.addr, i), r[0] = i), n.setTexture3D(t || Qs, i);
6188
+ r[0] !== i && (e.uniform1i(this.addr, i), r[0] = i), n.setTexture3D(t || Zs, i);
6211
6189
  }
6212
- function go(e, t, n) {
6190
+ function ho(e, t, n) {
6213
6191
  let r = this.cache, i = n.allocateTextureUnit();
6214
- r[0] !== i && (e.uniform1i(this.addr, i), r[0] = i), n.setTextureCube(t || $s, i);
6192
+ r[0] !== i && (e.uniform1i(this.addr, i), r[0] = i), n.setTextureCube(t || Qs, i);
6215
6193
  }
6216
- function _o(e, t, n) {
6194
+ function go(e, t, n) {
6217
6195
  let r = this.cache, i = n.allocateTextureUnit();
6218
- r[0] !== i && (e.uniform1i(this.addr, i), r[0] = i), n.setTexture2DArray(t || Zs, i);
6196
+ r[0] !== i && (e.uniform1i(this.addr, i), r[0] = i), n.setTexture2DArray(t || Xs, i);
6219
6197
  }
6220
- function vo(e) {
6198
+ function _o(e) {
6221
6199
  switch (e) {
6222
- case 5126: return Qa;
6223
- case 35664: return $a;
6224
- case 35665: return eo;
6225
- case 35666: return to;
6226
- case 35674: return no;
6227
- case 35675: return ro;
6228
- case 35676: return io;
6200
+ case 5126: return Za;
6201
+ case 35664: return Qa;
6202
+ case 35665: return $a;
6203
+ case 35666: return eo;
6204
+ case 35674: return to;
6205
+ case 35675: return no;
6206
+ case 35676: return ro;
6229
6207
  case 5124:
6230
- case 35670: return ao;
6208
+ case 35670: return io;
6231
6209
  case 35667:
6232
- case 35671: return oo;
6210
+ case 35671: return ao;
6233
6211
  case 35668:
6234
- case 35672: return so;
6212
+ case 35672: return oo;
6235
6213
  case 35669:
6236
- case 35673: return co;
6237
- case 5125: return lo;
6238
- case 36294: return uo;
6239
- case 36295: return fo;
6240
- case 36296: return po;
6214
+ case 35673: return so;
6215
+ case 5125: return co;
6216
+ case 36294: return lo;
6217
+ case 36295: return uo;
6218
+ case 36296: return fo;
6241
6219
  case 35678:
6242
6220
  case 36198:
6243
6221
  case 36298:
6244
6222
  case 36306:
6245
- case 35682: return mo;
6223
+ case 35682: return po;
6246
6224
  case 35679:
6247
6225
  case 36299:
6248
- case 36307: return ho;
6226
+ case 36307: return mo;
6249
6227
  case 35680:
6250
6228
  case 36300:
6251
6229
  case 36308:
6252
- case 36293: return go;
6230
+ case 36293: return ho;
6253
6231
  case 36289:
6254
6232
  case 36303:
6255
6233
  case 36311:
6256
- case 36292: return _o;
6234
+ case 36292: return go;
6257
6235
  }
6258
6236
  }
6259
- function yo(e, t) {
6237
+ function vo(e, t) {
6260
6238
  e.uniform1fv(this.addr, t);
6261
6239
  }
6262
- function bo(e, t) {
6263
- let n = Ja(t, this.size, 2);
6240
+ function yo(e, t) {
6241
+ let n = qa(t, this.size, 2);
6264
6242
  e.uniform2fv(this.addr, n);
6265
6243
  }
6266
- function xo(e, t) {
6267
- let n = Ja(t, this.size, 3);
6244
+ function bo(e, t) {
6245
+ let n = qa(t, this.size, 3);
6268
6246
  e.uniform3fv(this.addr, n);
6269
6247
  }
6270
- function So(e, t) {
6271
- let n = Ja(t, this.size, 4);
6248
+ function xo(e, t) {
6249
+ let n = qa(t, this.size, 4);
6272
6250
  e.uniform4fv(this.addr, n);
6273
6251
  }
6274
- function Co(e, t) {
6275
- let n = Ja(t, this.size, 4);
6252
+ function So(e, t) {
6253
+ let n = qa(t, this.size, 4);
6276
6254
  e.uniformMatrix2fv(this.addr, !1, n);
6277
6255
  }
6278
- function wo(e, t) {
6279
- let n = Ja(t, this.size, 9);
6256
+ function Co(e, t) {
6257
+ let n = qa(t, this.size, 9);
6280
6258
  e.uniformMatrix3fv(this.addr, !1, n);
6281
6259
  }
6282
- function To(e, t) {
6283
- let n = Ja(t, this.size, 16);
6260
+ function wo(e, t) {
6261
+ let n = qa(t, this.size, 16);
6284
6262
  e.uniformMatrix4fv(this.addr, !1, n);
6285
6263
  }
6286
- function Eo(e, t) {
6264
+ function To(e, t) {
6287
6265
  e.uniform1iv(this.addr, t);
6288
6266
  }
6289
- function Do(e, t) {
6267
+ function Eo(e, t) {
6290
6268
  e.uniform2iv(this.addr, t);
6291
6269
  }
6292
- function Oo(e, t) {
6270
+ function Do(e, t) {
6293
6271
  e.uniform3iv(this.addr, t);
6294
6272
  }
6295
- function ko(e, t) {
6273
+ function Oo(e, t) {
6296
6274
  e.uniform4iv(this.addr, t);
6297
6275
  }
6298
- function Ao(e, t) {
6276
+ function ko(e, t) {
6299
6277
  e.uniform1uiv(this.addr, t);
6300
6278
  }
6301
- function jo(e, t) {
6279
+ function Ao(e, t) {
6302
6280
  e.uniform2uiv(this.addr, t);
6303
6281
  }
6304
- function Mo(e, t) {
6282
+ function jo(e, t) {
6305
6283
  e.uniform3uiv(this.addr, t);
6306
6284
  }
6307
- function No(e, t) {
6285
+ function Mo(e, t) {
6308
6286
  e.uniform4uiv(this.addr, t);
6309
6287
  }
6310
- function Po(e, t, n) {
6311
- let r = this.cache, i = t.length, a = Za(n, i);
6312
- Ya(r, a) || (e.uniform1iv(this.addr, a), Xa(r, a));
6288
+ function No(e, t, n) {
6289
+ let r = this.cache, i = t.length, a = Xa(n, i);
6290
+ Ja(r, a) || (e.uniform1iv(this.addr, a), Ya(r, a));
6313
6291
  let o;
6314
- o = this.type === e.SAMPLER_2D_SHADOW ? Xs : Ys;
6292
+ o = this.type === e.SAMPLER_2D_SHADOW ? Ys : Js;
6315
6293
  for (let e = 0; e !== i; ++e) n.setTexture2D(t[e] || o, a[e]);
6316
6294
  }
6295
+ function Po(e, t, n) {
6296
+ let r = this.cache, i = t.length, a = Xa(n, i);
6297
+ Ja(r, a) || (e.uniform1iv(this.addr, a), Ya(r, a));
6298
+ for (let e = 0; e !== i; ++e) n.setTexture3D(t[e] || Zs, a[e]);
6299
+ }
6317
6300
  function Fo(e, t, n) {
6318
- let r = this.cache, i = t.length, a = Za(n, i);
6319
- Ya(r, a) || (e.uniform1iv(this.addr, a), Xa(r, a));
6320
- for (let e = 0; e !== i; ++e) n.setTexture3D(t[e] || Qs, a[e]);
6301
+ let r = this.cache, i = t.length, a = Xa(n, i);
6302
+ Ja(r, a) || (e.uniform1iv(this.addr, a), Ya(r, a));
6303
+ for (let e = 0; e !== i; ++e) n.setTextureCube(t[e] || Qs, a[e]);
6321
6304
  }
6322
6305
  function Io(e, t, n) {
6323
- let r = this.cache, i = t.length, a = Za(n, i);
6324
- Ya(r, a) || (e.uniform1iv(this.addr, a), Xa(r, a));
6325
- for (let e = 0; e !== i; ++e) n.setTextureCube(t[e] || $s, a[e]);
6326
- }
6327
- function Lo(e, t, n) {
6328
- let r = this.cache, i = t.length, a = Za(n, i);
6329
- Ya(r, a) || (e.uniform1iv(this.addr, a), Xa(r, a));
6330
- for (let e = 0; e !== i; ++e) n.setTexture2DArray(t[e] || Zs, a[e]);
6306
+ let r = this.cache, i = t.length, a = Xa(n, i);
6307
+ Ja(r, a) || (e.uniform1iv(this.addr, a), Ya(r, a));
6308
+ for (let e = 0; e !== i; ++e) n.setTexture2DArray(t[e] || Xs, a[e]);
6331
6309
  }
6332
- function Ro(e) {
6310
+ function Lo(e) {
6333
6311
  switch (e) {
6334
- case 5126: return yo;
6335
- case 35664: return bo;
6336
- case 35665: return xo;
6337
- case 35666: return So;
6338
- case 35674: return Co;
6339
- case 35675: return wo;
6340
- case 35676: return To;
6312
+ case 5126: return vo;
6313
+ case 35664: return yo;
6314
+ case 35665: return bo;
6315
+ case 35666: return xo;
6316
+ case 35674: return So;
6317
+ case 35675: return Co;
6318
+ case 35676: return wo;
6341
6319
  case 5124:
6342
- case 35670: return Eo;
6320
+ case 35670: return To;
6343
6321
  case 35667:
6344
- case 35671: return Do;
6322
+ case 35671: return Eo;
6345
6323
  case 35668:
6346
- case 35672: return Oo;
6324
+ case 35672: return Do;
6347
6325
  case 35669:
6348
- case 35673: return ko;
6349
- case 5125: return Ao;
6350
- case 36294: return jo;
6351
- case 36295: return Mo;
6352
- case 36296: return No;
6326
+ case 35673: return Oo;
6327
+ case 5125: return ko;
6328
+ case 36294: return Ao;
6329
+ case 36295: return jo;
6330
+ case 36296: return Mo;
6353
6331
  case 35678:
6354
6332
  case 36198:
6355
6333
  case 36298:
6356
6334
  case 36306:
6357
- case 35682: return Po;
6335
+ case 35682: return No;
6358
6336
  case 35679:
6359
6337
  case 36299:
6360
- case 36307: return Fo;
6338
+ case 36307: return Po;
6361
6339
  case 35680:
6362
6340
  case 36300:
6363
6341
  case 36308:
6364
- case 36293: return Io;
6342
+ case 36293: return Fo;
6365
6343
  case 36289:
6366
6344
  case 36303:
6367
6345
  case 36311:
6368
- case 36292: return Lo;
6346
+ case 36292: return Io;
6369
6347
  }
6370
6348
  }
6371
- function zo(e, t) {
6349
+ function Ro(e, t) {
6372
6350
  e.seq.push(t), e.map[t.id] = t;
6373
6351
  }
6374
- function Bo(e, t, n) {
6352
+ function zo(e, t, n) {
6375
6353
  let r = e.name, i = r.length;
6376
- for (cc.lastIndex = 0;;) {
6377
- let a = cc.exec(r), o = cc.lastIndex, s = a[1], c = a[2] === "]", l = a[3];
6354
+ for (sc.lastIndex = 0;;) {
6355
+ let a = sc.exec(r), o = sc.lastIndex, s = a[1], c = a[2] === "]", l = a[3];
6378
6356
  if (c && (s |= 0), l === void 0 || l === "[" && o + 2 === i) {
6379
- zo(n, l === void 0 ? new ac(s, e, t) : new oc(s, e, t));
6357
+ Ro(n, l === void 0 ? new ic(s, e, t) : new ac(s, e, t));
6380
6358
  break;
6381
6359
  } else {
6382
6360
  let e = n.map[s];
6383
- e === void 0 && (e = new sc(s), zo(n, e)), n = e;
6361
+ e === void 0 && (e = new oc(s), Ro(n, e)), n = e;
6384
6362
  }
6385
6363
  }
6386
6364
  }
6387
- function Vo(e, t, n) {
6365
+ function Bo(e, t, n) {
6388
6366
  let r = e.createShader(t);
6389
6367
  return e.shaderSource(r, n), e.compileShader(r), r;
6390
6368
  }
6391
- function Ho(e, t) {
6369
+ function Vo(e, t) {
6392
6370
  let n = e.split("\n"), r = [], i = Math.max(t - 6, 0), a = Math.min(t + 6, n.length);
6393
6371
  for (let e = i; e < a; e++) {
6394
6372
  let i = e + 1;
@@ -6396,48 +6374,48 @@ function Ho(e, t) {
6396
6374
  }
6397
6375
  return r.join("\n");
6398
6376
  }
6399
- function Uo(e) {
6400
- J._getMatrix(fc, J.workingColorSpace, e);
6401
- let t = `mat3( ${fc.elements.map((e) => e.toFixed(4))} )`;
6377
+ function Ho(e) {
6378
+ J._getMatrix(dc, J.workingColorSpace, e);
6379
+ let t = `mat3( ${dc.elements.map((e) => e.toFixed(4))} )`;
6402
6380
  switch (J.getTransfer(e)) {
6403
6381
  case Mt: return [t, "LinearTransferOETF"];
6404
6382
  case Nt: return [t, "sRGBTransferOETF"];
6405
6383
  default: return l("WebGLProgram: Unsupported color space: ", e), [t, "LinearTransferOETF"];
6406
6384
  }
6407
6385
  }
6408
- function Wo(e, t, n) {
6386
+ function Uo(e, t, n) {
6409
6387
  let r = e.getShaderParameter(t, e.COMPILE_STATUS), i = (e.getShaderInfoLog(t) || "").trim();
6410
6388
  if (r && i === "") return "";
6411
6389
  let a = /ERROR: 0:(\d+)/.exec(i);
6412
6390
  if (a) {
6413
6391
  let r = parseInt(a[1]);
6414
- return n.toUpperCase() + "\n\n" + i + "\n\n" + Ho(e.getShaderSource(t), r);
6392
+ return n.toUpperCase() + "\n\n" + i + "\n\n" + Vo(e.getShaderSource(t), r);
6415
6393
  } else return i;
6416
6394
  }
6417
- function Go(e, t) {
6418
- let n = Uo(t);
6395
+ function Wo(e, t) {
6396
+ let n = Ho(t);
6419
6397
  return [
6420
6398
  `vec4 ${e}( vec4 value ) {`,
6421
6399
  ` return ${n[1]}( vec4( value.rgb * ${n[0]}, value.a ) );`,
6422
6400
  "}"
6423
6401
  ].join("\n");
6424
6402
  }
6425
- function Ko(e, t) {
6426
- let n = pc[t];
6403
+ function Go(e, t) {
6404
+ let n = fc[t];
6427
6405
  return n === void 0 ? (l("WebGLProgram: Unsupported toneMapping:", t), "vec3 " + e + "( vec3 color ) { return LinearToneMapping( color ); }") : "vec3 " + e + "( vec3 color ) { return " + n + "ToneMapping( color ); }";
6428
6406
  }
6429
- function qo() {
6430
- return J.getLuminanceCoefficients(mc), [
6407
+ function Ko() {
6408
+ return J.getLuminanceCoefficients(pc), [
6431
6409
  "float luminance( const in vec3 rgb ) {",
6432
- ` const vec3 weights = vec3( ${mc.x.toFixed(4)}, ${mc.y.toFixed(4)}, ${mc.z.toFixed(4)} );`,
6410
+ ` const vec3 weights = vec3( ${pc.x.toFixed(4)}, ${pc.y.toFixed(4)}, ${pc.z.toFixed(4)} );`,
6433
6411
  " return dot( weights, rgb );",
6434
6412
  "}"
6435
6413
  ].join("\n");
6436
6414
  }
6437
- function Jo(e) {
6438
- return [e.extensionClipCullDistance ? "#extension GL_ANGLE_clip_cull_distance : require" : "", e.extensionMultiDraw ? "#extension GL_ANGLE_multi_draw : require" : ""].filter(Zo).join("\n");
6415
+ function qo(e) {
6416
+ return [e.extensionClipCullDistance ? "#extension GL_ANGLE_clip_cull_distance : require" : "", e.extensionMultiDraw ? "#extension GL_ANGLE_multi_draw : require" : ""].filter(Xo).join("\n");
6439
6417
  }
6440
- function Yo(e) {
6418
+ function Jo(e) {
6441
6419
  let t = [];
6442
6420
  for (let n in e) {
6443
6421
  let r = e[n];
@@ -6445,7 +6423,7 @@ function Yo(e) {
6445
6423
  }
6446
6424
  return t.join("\n");
6447
6425
  }
6448
- function Xo(e, t) {
6426
+ function Yo(e, t) {
6449
6427
  let n = {}, r = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES);
6450
6428
  for (let i = 0; i < r; i++) {
6451
6429
  let r = e.getActiveAttrib(t, i), a = r.name, o = 1;
@@ -6457,37 +6435,37 @@ function Xo(e, t) {
6457
6435
  }
6458
6436
  return n;
6459
6437
  }
6460
- function Zo(e) {
6438
+ function Xo(e) {
6461
6439
  return e !== "";
6462
6440
  }
6463
- function Qo(e, t) {
6441
+ function Zo(e, t) {
6464
6442
  let n = t.numSpotLightShadows + t.numSpotLightMaps - t.numSpotLightShadowsWithMaps;
6465
6443
  return e.replace(/NUM_DIR_LIGHTS/g, t.numDirLights).replace(/NUM_SPOT_LIGHTS/g, t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g, t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g, n).replace(/NUM_RECT_AREA_LIGHTS/g, t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g, t.numPointLights).replace(/NUM_HEMI_LIGHTS/g, t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g, t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g, t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g, t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g, t.numPointLightShadows);
6466
6444
  }
6467
- function $o(e, t) {
6445
+ function Qo(e, t) {
6468
6446
  return e.replace(/NUM_CLIPPING_PLANES/g, t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g, t.numClippingPlanes - t.numClipIntersection);
6469
6447
  }
6470
- function es(e) {
6471
- return e.replace(hc, ts);
6448
+ function $o(e) {
6449
+ return e.replace(mc, es);
6472
6450
  }
6473
- function ts(e, t) {
6451
+ function es(e, t) {
6474
6452
  let n = Q[t];
6475
6453
  if (n === void 0) {
6476
- let e = gc.get(t);
6454
+ let e = hc.get(t);
6477
6455
  if (e !== void 0) n = Q[e], l("WebGLRenderer: Shader chunk \"%s\" has been deprecated. Use \"%s\" instead.", t, e);
6478
6456
  else throw Error("THREE.WebGLProgram: Can not resolve #include <" + t + ">");
6479
6457
  }
6480
- return es(n);
6458
+ return $o(n);
6481
6459
  }
6482
- function ns(e) {
6483
- return e.replace(_c, rs);
6460
+ function ts(e) {
6461
+ return e.replace(gc, ns);
6484
6462
  }
6485
- function rs(e, t, n, r) {
6463
+ function ns(e, t, n, r) {
6486
6464
  let i = "";
6487
6465
  for (let e = parseInt(t); e < parseInt(n); e++) i += r.replace(/\[\s*i\s*\]/g, "[ " + e + " ]").replace(/UNROLLED_LOOP_INDEX/g, e);
6488
6466
  return i;
6489
6467
  }
6490
- function is(e) {
6468
+ function rs(e) {
6491
6469
  let t = `precision ${e.precision} float;
6492
6470
  precision ${e.precision} int;
6493
6471
  precision ${e.precision} sampler2D;
@@ -6508,19 +6486,19 @@ function is(e) {
6508
6486
  `;
6509
6487
  return e.precision === "highp" ? t += "\n#define HIGH_PRECISION" : e.precision === "mediump" ? t += "\n#define MEDIUM_PRECISION" : e.precision === "lowp" && (t += "\n#define LOW_PRECISION"), t;
6510
6488
  }
6489
+ function is(e) {
6490
+ return _c[e.shadowMapType] || "SHADOWMAP_TYPE_BASIC";
6491
+ }
6511
6492
  function as(e) {
6512
- return vc[e.shadowMapType] || "SHADOWMAP_TYPE_BASIC";
6493
+ return e.envMap === !1 ? "ENVMAP_TYPE_CUBE" : vc[e.envMapMode] || "ENVMAP_TYPE_CUBE";
6513
6494
  }
6514
6495
  function os(e) {
6515
- return e.envMap === !1 ? "ENVMAP_TYPE_CUBE" : yc[e.envMapMode] || "ENVMAP_TYPE_CUBE";
6496
+ return e.envMap === !1 ? "ENVMAP_MODE_REFLECTION" : yc[e.envMapMode] || "ENVMAP_MODE_REFLECTION";
6516
6497
  }
6517
6498
  function ss(e) {
6518
- return e.envMap === !1 ? "ENVMAP_MODE_REFLECTION" : bc[e.envMapMode] || "ENVMAP_MODE_REFLECTION";
6499
+ return e.envMap === !1 ? "ENVMAP_BLENDING_NONE" : bc[e.combine] || "ENVMAP_BLENDING_NONE";
6519
6500
  }
6520
6501
  function cs(e) {
6521
- return e.envMap === !1 ? "ENVMAP_BLENDING_NONE" : xc[e.combine] || "ENVMAP_BLENDING_NONE";
6522
- }
6523
- function ls(e) {
6524
6502
  let t = e.envMapCubeUVHeight;
6525
6503
  if (t === null) return null;
6526
6504
  let n = Math.log2(t) - 2, r = 1 / t;
@@ -6530,18 +6508,18 @@ function ls(e) {
6530
6508
  maxMip: n
6531
6509
  };
6532
6510
  }
6533
- function us(e, t, n, r) {
6534
- let i = e.getContext(), a = n.defines, o = n.vertexShader, s = n.fragmentShader, c = as(n), d = os(n), f = ss(n), p = cs(n), m = ls(n), h = Jo(n), g = Yo(a), _ = i.createProgram(), v, y, b = n.glslVersion ? "#version " + n.glslVersion + "\n" : "";
6511
+ function ls(e, t, n, r) {
6512
+ let i = e.getContext(), a = n.defines, o = n.vertexShader, s = n.fragmentShader, c = is(n), d = as(n), f = os(n), p = ss(n), m = cs(n), h = qo(n), g = Jo(a), _ = i.createProgram(), v, y, b = n.glslVersion ? "#version " + n.glslVersion + "\n" : "";
6535
6513
  n.isRawShaderMaterial ? (v = [
6536
6514
  "#define SHADER_TYPE " + n.shaderType,
6537
6515
  "#define SHADER_NAME " + n.shaderName,
6538
6516
  g
6539
- ].filter(Zo).join("\n"), v.length > 0 && (v += "\n"), y = [
6517
+ ].filter(Xo).join("\n"), v.length > 0 && (v += "\n"), y = [
6540
6518
  "#define SHADER_TYPE " + n.shaderType,
6541
6519
  "#define SHADER_NAME " + n.shaderName,
6542
6520
  g
6543
- ].filter(Zo).join("\n"), y.length > 0 && (y += "\n")) : (v = [
6544
- is(n),
6521
+ ].filter(Xo).join("\n"), y.length > 0 && (y += "\n")) : (v = [
6522
+ rs(n),
6545
6523
  "#define SHADER_TYPE " + n.shaderType,
6546
6524
  "#define SHADER_NAME " + n.shaderName,
6547
6525
  g,
@@ -6670,8 +6648,8 @@ function us(e, t, n, r) {
6670
6648
  " attribute vec4 skinWeight;",
6671
6649
  "#endif",
6672
6650
  "\n"
6673
- ].filter(Zo).join("\n"), y = [
6674
- is(n),
6651
+ ].filter(Xo).join("\n"), y = [
6652
+ rs(n),
6675
6653
  "#define SHADER_TYPE " + n.shaderType,
6676
6654
  "#define SHADER_NAME " + n.shaderName,
6677
6655
  g,
@@ -6744,15 +6722,15 @@ function us(e, t, n, r) {
6744
6722
  "uniform bool isOrthographic;",
6745
6723
  n.toneMapping === 0 ? "" : "#define TONE_MAPPING",
6746
6724
  n.toneMapping === 0 ? "" : Q.tonemapping_pars_fragment,
6747
- n.toneMapping === 0 ? "" : Ko("toneMapping", n.toneMapping),
6725
+ n.toneMapping === 0 ? "" : Go("toneMapping", n.toneMapping),
6748
6726
  n.dithering ? "#define DITHERING" : "",
6749
6727
  n.opaque ? "#define OPAQUE" : "",
6750
6728
  Q.colorspace_pars_fragment,
6751
- Go("linearToOutputTexel", n.outputColorSpace),
6752
- qo(),
6729
+ Wo("linearToOutputTexel", n.outputColorSpace),
6730
+ Ko(),
6753
6731
  n.useDepthPacking ? "#define DEPTH_PACKING " + n.depthPacking : "",
6754
6732
  "\n"
6755
- ].filter(Zo).join("\n")), o = es(o), o = Qo(o, n), o = $o(o, n), s = es(s), s = Qo(s, n), s = $o(s, n), o = ns(o), s = ns(s), n.isRawShaderMaterial !== !0 && (b = "#version 300 es\n", v = [
6733
+ ].filter(Xo).join("\n")), o = $o(o), o = Zo(o, n), o = Qo(o, n), s = $o(s), s = Zo(s, n), s = Qo(s, n), o = ts(o), s = ts(s), n.isRawShaderMaterial !== !0 && (b = "#version 300 es\n", v = [
6756
6734
  h,
6757
6735
  "#define attribute in",
6758
6736
  "#define varying out",
@@ -6772,14 +6750,14 @@ function us(e, t, n, r) {
6772
6750
  "#define texture2DProjGradEXT textureProjGrad",
6773
6751
  "#define textureCubeGradEXT textureGrad"
6774
6752
  ].join("\n") + "\n" + y);
6775
- let x = b + v + o, S = b + y + s, C = Vo(i, i.VERTEX_SHADER, x), w = Vo(i, i.FRAGMENT_SHADER, S);
6753
+ let x = b + v + o, S = b + y + s, C = Bo(i, i.VERTEX_SHADER, x), w = Bo(i, i.FRAGMENT_SHADER, S);
6776
6754
  i.attachShader(_, C), i.attachShader(_, w), n.index0AttributeName === void 0 ? n.hasPositionAttribute === !0 && i.bindAttribLocation(_, 0, "position") : i.bindAttribLocation(_, 0, n.index0AttributeName), i.linkProgram(_);
6777
6755
  function T(t) {
6778
6756
  if (e.debug.checkShaderErrors) {
6779
6757
  let n = i.getProgramInfoLog(_) || "", r = i.getShaderInfoLog(C) || "", a = i.getShaderInfoLog(w) || "", o = n.trim(), s = r.trim(), c = a.trim(), d = !0, f = !0;
6780
6758
  if (i.getProgramParameter(_, i.LINK_STATUS) === !1) if (d = !1, typeof e.debug.onShaderError == "function") e.debug.onShaderError(i, _, C, w);
6781
6759
  else {
6782
- let e = Wo(i, C, "vertex"), n = Wo(i, w, "fragment");
6760
+ let e = Uo(i, C, "vertex"), n = Uo(i, w, "fragment");
6783
6761
  u("WebGLProgram: Shader Error " + i.getError() + " - VALIDATE_STATUS " + i.getProgramParameter(_, i.VALIDATE_STATUS) + "\n\nMaterial Name: " + t.name + "\nMaterial Type: " + t.type + "\n\nProgram Info Log: " + o + "\n" + e + "\n" + n);
6784
6762
  }
6785
6763
  else o === "" ? (s === "" || c === "") && (f = !1) : l("WebGLProgram: Program Info Log:", o);
@@ -6796,7 +6774,7 @@ function us(e, t, n, r) {
6796
6774
  }
6797
6775
  });
6798
6776
  }
6799
- i.deleteShader(C), i.deleteShader(w), E = new lc(i, _), D = Xo(i, _);
6777
+ i.deleteShader(C), i.deleteShader(w), E = new cc(i, _), D = Yo(i, _);
6800
6778
  }
6801
6779
  let E;
6802
6780
  this.getUniforms = function() {
@@ -6808,16 +6786,16 @@ function us(e, t, n, r) {
6808
6786
  };
6809
6787
  let O = n.rendererExtensionParallelShaderCompile === !1;
6810
6788
  return this.isReady = function() {
6811
- return O === !1 && (O = i.getProgramParameter(_, uc)), O;
6789
+ return O === !1 && (O = i.getProgramParameter(_, lc)), O;
6812
6790
  }, this.destroy = function() {
6813
6791
  r.releaseStatesOfProgram(this), i.deleteProgram(_), this.program = void 0;
6814
- }, this.type = n.shaderType, this.name = n.shaderName, this.id = dc++, this.cacheKey = t, this.usedTimes = 1, this.program = _, this.vertexShader = C, this.fragmentShader = w, this;
6792
+ }, this.type = n.shaderType, this.name = n.shaderName, this.id = uc++, this.cacheKey = t, this.usedTimes = 1, this.program = _, this.vertexShader = C, this.fragmentShader = w, this;
6815
6793
  }
6816
- function ds(e) {
6794
+ function us(e) {
6817
6795
  return e === 1030 || e === 37490 || e === 36285;
6818
6796
  }
6819
- function fs(e, t, n, r, i, a) {
6820
- let o = new xn(), s = new Cc(), c = /* @__PURE__ */ new Set(), u = [], d = /* @__PURE__ */ new Map(), f = r.logarithmicDepthBuffer, p = r.precision, m = {
6797
+ function ds(e, t, n, r, i, a) {
6798
+ let o = new xn(), s = new Sc(), c = /* @__PURE__ */ new Set(), u = [], d = /* @__PURE__ */ new Map(), f = r.logarithmicDepthBuffer, p = r.precision, m = {
6821
6799
  MeshDepthMaterial: "depth",
6822
6800
  MeshDistanceMaterial: "distance",
6823
6801
  MeshNormalMaterial: "normal",
@@ -6844,7 +6822,7 @@ function fs(e, t, n, r, i, a) {
6844
6822
  y.morphAttributes.position !== void 0 && (D = 1), y.morphAttributes.normal !== void 0 && (D = 2), y.morphAttributes.color !== void 0 && (D = 3);
6845
6823
  let O, k, A, j;
6846
6824
  if (w) {
6847
- let e = js[w];
6825
+ let e = As[w];
6848
6826
  O = e.vertexShader, k = e.fragmentShader;
6849
6827
  } else {
6850
6828
  O = i.vertexShader, k = i.fragmentShader;
@@ -6885,7 +6863,7 @@ function fs(e, t, n, r, i, a) {
6885
6863
  emissiveMap: L,
6886
6864
  normalMapObjectSpace: ae && i.normalMapType === 1,
6887
6865
  normalMapTangentSpace: ae && i.normalMapType === 0,
6888
- packedNormalMap: ae && i.normalMapType === 0 && ds(i.normalMap.format),
6866
+ packedNormalMap: ae && i.normalMapType === 0 && us(i.normalMap.format),
6889
6867
  metalnessMap: se,
6890
6868
  roughnessMap: ce,
6891
6869
  anisotropy: le,
@@ -7002,14 +6980,14 @@ function fs(e, t, n, r, i, a) {
7002
6980
  function b(e) {
7003
6981
  let t = m[e.type], n;
7004
6982
  if (t) {
7005
- let e = js[t];
6983
+ let e = As[t];
7006
6984
  n = Ti.clone(e.uniforms);
7007
6985
  } else n = e.uniforms;
7008
6986
  return n;
7009
6987
  }
7010
6988
  function x(t, n) {
7011
6989
  let r = d.get(n);
7012
- return r === void 0 ? (r = new us(e, n, t, i), u.push(r), d.set(n, r)) : ++r.usedTimes, r;
6990
+ return r === void 0 ? (r = new ls(e, n, t, i), u.push(r), d.set(n, r)) : ++r.usedTimes, r;
7013
6991
  }
7014
6992
  function S(e) {
7015
6993
  if (--e.usedTimes === 0) {
@@ -7034,7 +7012,7 @@ function fs(e, t, n, r, i, a) {
7034
7012
  dispose: w
7035
7013
  };
7036
7014
  }
7037
- function ps() {
7015
+ function fs() {
7038
7016
  let e = /* @__PURE__ */ new WeakMap();
7039
7017
  function t(t) {
7040
7018
  return e.has(t);
@@ -7060,13 +7038,13 @@ function ps() {
7060
7038
  dispose: a
7061
7039
  };
7062
7040
  }
7063
- function ms(e, t) {
7041
+ function ps(e, t) {
7064
7042
  return e.groupOrder === t.groupOrder ? e.renderOrder === t.renderOrder ? e.material.id === t.material.id ? e.materialVariant === t.materialVariant ? e.z === t.z ? e.id - t.id : e.z - t.z : e.materialVariant - t.materialVariant : e.material.id - t.material.id : e.renderOrder - t.renderOrder : e.groupOrder - t.groupOrder;
7065
7043
  }
7066
- function hs(e, t) {
7044
+ function ms(e, t) {
7067
7045
  return e.groupOrder === t.groupOrder ? e.renderOrder === t.renderOrder ? e.z === t.z ? e.id - t.id : t.z - e.z : e.renderOrder - t.renderOrder : e.groupOrder - t.groupOrder;
7068
7046
  }
7069
- function gs() {
7047
+ function hs() {
7070
7048
  let e = [], t = 0, n = [], r = [], i = [];
7071
7049
  function a() {
7072
7050
  t = 0, n.length = 0, r.length = 0, i.length = 0;
@@ -7098,7 +7076,7 @@ function gs() {
7098
7076
  a.transmission > 0 ? r.unshift(u) : a.transparent === !0 ? i.unshift(u) : n.unshift(u);
7099
7077
  }
7100
7078
  function u(e, t, a) {
7101
- n.length > 1 && n.sort(e || ms), r.length > 1 && r.sort(t || hs), i.length > 1 && i.sort(t || hs), a && (n.reverse(), r.reverse(), i.reverse());
7079
+ n.length > 1 && n.sort(e || ps), r.length > 1 && r.sort(t || ms), i.length > 1 && i.sort(t || ms), a && (n.reverse(), r.reverse(), i.reverse());
7102
7080
  }
7103
7081
  function d() {
7104
7082
  for (let n = t, r = e.length; n < r; n++) {
@@ -7118,11 +7096,11 @@ function gs() {
7118
7096
  sort: u
7119
7097
  };
7120
7098
  }
7121
- function _s() {
7099
+ function gs() {
7122
7100
  let e = /* @__PURE__ */ new WeakMap();
7123
7101
  function t(t, n) {
7124
7102
  let r = e.get(t), i;
7125
- return r === void 0 ? (i = new gs(), e.set(t, [i])) : n >= r.length ? (i = new gs(), r.push(i)) : i = r[n], i;
7103
+ return r === void 0 ? (i = new hs(), e.set(t, [i])) : n >= r.length ? (i = new hs(), r.push(i)) : i = r[n], i;
7126
7104
  }
7127
7105
  function n() {
7128
7106
  e = /* @__PURE__ */ new WeakMap();
@@ -7132,7 +7110,7 @@ function _s() {
7132
7110
  dispose: n
7133
7111
  };
7134
7112
  }
7135
- function vs() {
7113
+ function _s() {
7136
7114
  let e = {};
7137
7115
  return { get: function(t) {
7138
7116
  if (e[t.id] !== void 0) return e[t.id];
@@ -7182,7 +7160,7 @@ function vs() {
7182
7160
  return e[t.id] = n, n;
7183
7161
  } };
7184
7162
  }
7185
- function ys() {
7163
+ function vs() {
7186
7164
  let e = {};
7187
7165
  return { get: function(t) {
7188
7166
  if (e[t.id] !== void 0) return e[t.id];
@@ -7221,11 +7199,11 @@ function ys() {
7221
7199
  return e[t.id] = n, n;
7222
7200
  } };
7223
7201
  }
7224
- function bs(e, t) {
7202
+ function ys(e, t) {
7225
7203
  return (t.castShadow ? 2 : 0) - (e.castShadow ? 2 : 0) + +!!t.map - !!e.map;
7226
7204
  }
7227
- function xs(e) {
7228
- let t = new vs(), n = ys(), r = {
7205
+ function bs(e) {
7206
+ let t = new _s(), n = vs(), r = {
7229
7207
  version: 0,
7230
7208
  hash: {
7231
7209
  directionalLength: -1,
@@ -7271,7 +7249,7 @@ function xs(e) {
7271
7249
  let a = 0, o = 0, s = 0;
7272
7250
  for (let e = 0; e < 9; e++) r.probe[e].set(0, 0, 0);
7273
7251
  let c = 0, l = 0, u = 0, d = 0, f = 0, p = 0, m = 0, h = 0, g = 0, _ = 0, v = 0;
7274
- i.sort(bs);
7252
+ i.sort(ys);
7275
7253
  for (let e = 0, y = i.length; e < y; e++) {
7276
7254
  let y = i[e], b = y.color, x = y.intensity, S = y.distance, C = null;
7277
7255
  if (y.shadow && y.shadow.map && (C = y.shadow.map.texture.format === 1030 ? y.shadow.map.texture : y.shadow.map.depthTexture || y.shadow.map.texture), y.isAmbientLight) a += b.r * x, o += b.g * x, s += b.b * x;
@@ -7311,7 +7289,7 @@ function xs(e) {
7311
7289
  }
7312
7290
  d > 0 && (e.has("OES_texture_float_linear") === !0 ? (r.rectAreaLTC1 = $.LTC_FLOAT_1, r.rectAreaLTC2 = $.LTC_FLOAT_2) : (r.rectAreaLTC1 = $.LTC_HALF_1, r.rectAreaLTC2 = $.LTC_HALF_2)), r.ambient[0] = a, r.ambient[1] = o, r.ambient[2] = s;
7313
7291
  let y = r.hash;
7314
- (y.directionalLength !== c || y.pointLength !== l || y.spotLength !== u || y.rectAreaLength !== d || y.hemiLength !== f || y.numDirectionalShadows !== p || y.numPointShadows !== m || y.numSpotShadows !== h || y.numSpotMaps !== g || y.numLightProbes !== v) && (r.directional.length = c, r.spot.length = u, r.rectArea.length = d, r.point.length = l, r.hemi.length = f, r.directionalShadow.length = p, r.directionalShadowMap.length = p, r.pointShadow.length = m, r.pointShadowMap.length = m, r.spotShadow.length = h, r.spotShadowMap.length = h, r.directionalShadowMatrix.length = p, r.pointShadowMatrix.length = m, r.spotLightMatrix.length = h + g - _, r.spotLightMap.length = g, r.numSpotLightShadowsWithMaps = _, r.numLightProbes = v, y.directionalLength = c, y.pointLength = l, y.spotLength = u, y.rectAreaLength = d, y.hemiLength = f, y.numDirectionalShadows = p, y.numPointShadows = m, y.numSpotShadows = h, y.numSpotMaps = g, y.numLightProbes = v, r.version = Tc++);
7292
+ (y.directionalLength !== c || y.pointLength !== l || y.spotLength !== u || y.rectAreaLength !== d || y.hemiLength !== f || y.numDirectionalShadows !== p || y.numPointShadows !== m || y.numSpotShadows !== h || y.numSpotMaps !== g || y.numLightProbes !== v) && (r.directional.length = c, r.spot.length = u, r.rectArea.length = d, r.point.length = l, r.hemi.length = f, r.directionalShadow.length = p, r.directionalShadowMap.length = p, r.pointShadow.length = m, r.pointShadowMap.length = m, r.spotShadow.length = h, r.spotShadowMap.length = h, r.directionalShadowMatrix.length = p, r.pointShadowMatrix.length = m, r.spotLightMatrix.length = h + g - _, r.spotLightMap.length = g, r.numSpotLightShadowsWithMaps = _, r.numLightProbes = v, y.directionalLength = c, y.pointLength = l, y.spotLength = u, y.rectAreaLength = d, y.hemiLength = f, y.numDirectionalShadows = p, y.numPointShadows = m, y.numSpotShadows = h, y.numSpotMaps = g, y.numLightProbes = v, r.version = wc++);
7315
7293
  }
7316
7294
  function c(e, t) {
7317
7295
  let n = 0, s = 0, c = 0, l = 0, u = 0, d = t.matrixWorldInverse;
@@ -7341,8 +7319,8 @@ function xs(e) {
7341
7319
  state: r
7342
7320
  };
7343
7321
  }
7344
- function Ss(e) {
7345
- let t = new xs(e), n = [], r = [], i = [];
7322
+ function xs(e) {
7323
+ let t = new bs(e), n = [], r = [], i = [];
7346
7324
  function a(e) {
7347
7325
  d.camera = e, n.length = 0, r.length = 0, i.length = 0;
7348
7326
  }
@@ -7380,11 +7358,11 @@ function Ss(e) {
7380
7358
  pushLightProbeGrid: c
7381
7359
  };
7382
7360
  }
7383
- function Cs(e) {
7361
+ function Ss(e) {
7384
7362
  let t = /* @__PURE__ */ new WeakMap();
7385
7363
  function n(n, r = 0) {
7386
7364
  let i = t.get(n), a;
7387
- return i === void 0 ? (a = new Ss(e), t.set(n, [a])) : r >= i.length ? (a = new Ss(e), i.push(a)) : a = i[r], a;
7365
+ return i === void 0 ? (a = new xs(e), t.set(n, [a])) : r >= i.length ? (a = new xs(e), i.push(a)) : a = i[r], a;
7388
7366
  }
7389
7367
  function r() {
7390
7368
  t = /* @__PURE__ */ new WeakMap();
@@ -7394,7 +7372,7 @@ function Cs(e) {
7394
7372
  dispose: r
7395
7373
  };
7396
7374
  }
7397
- function ws(e, t, n) {
7375
+ function Cs(e, t, n) {
7398
7376
  let r = new gi(), i = new G(), a = new G(), o = new Y(), s = new Ai(), c = new ji(), u = {}, d = n.maxTextureSize, f = {
7399
7377
  0: 1,
7400
7378
  1: 0,
@@ -7406,8 +7384,8 @@ function ws(e, t, n) {
7406
7384
  resolution: { value: new G() },
7407
7385
  radius: { value: 4 }
7408
7386
  },
7409
- vertexShader: Ec,
7410
- fragmentShader: Dc
7387
+ vertexShader: Tc,
7388
+ fragmentShader: Ec
7411
7389
  }), m = p.clone();
7412
7390
  m.defines.HORIZONTAL_PASS = 1;
7413
7391
  let h = new Rr();
@@ -7458,7 +7436,7 @@ function ws(e, t, n) {
7458
7436
  magFilter: z,
7459
7437
  generateMipmaps: !1
7460
7438
  }), f.map.texture.name = u.name + ".shadowMap", f.map.depthTexture = new bi(i.x, i.y, De), f.map.depthTexture.name = u.name + ".shadowMapDepth", f.map.depthTexture.format = W, f.map.depthTexture.compareFunction = null, f.map.depthTexture.minFilter = _e, f.map.depthTexture.magFilter = _e;
7461
- } else u.isPointLight ? (f.map = new qs(i.x), f.map.depthTexture = new xi(i.x, Ee)) : (f.map = new sn(i.x, i.y), f.map.depthTexture = new bi(i.x, i.y, Ee)), f.map.depthTexture.name = u.name + ".shadowMap", f.map.depthTexture.format = W, this.type === 1 ? (f.map.depthTexture.compareFunction = g ? 518 : 515, f.map.depthTexture.minFilter = z, f.map.depthTexture.magFilter = z) : (f.map.depthTexture.compareFunction = null, f.map.depthTexture.minFilter = _e, f.map.depthTexture.magFilter = _e);
7439
+ } else u.isPointLight ? (f.map = new Ks(i.x), f.map.depthTexture = new xi(i.x, Ee)) : (f.map = new sn(i.x, i.y), f.map.depthTexture = new bi(i.x, i.y, Ee)), f.map.depthTexture.name = u.name + ".shadowMap", f.map.depthTexture.format = W, this.type === 1 ? (f.map.depthTexture.compareFunction = g ? 518 : 515, f.map.depthTexture.minFilter = z, f.map.depthTexture.magFilter = z) : (f.map.depthTexture.compareFunction = null, f.map.depthTexture.minFilter = _e, f.map.depthTexture.magFilter = _e);
7462
7440
  f.camera.updateProjectionMatrix();
7463
7441
  }
7464
7442
  let _ = f.map.isWebGLCubeRenderTarget ? 6 : 1;
@@ -7471,7 +7449,7 @@ function ws(e, t, n) {
7471
7449
  }
7472
7450
  if (u.isPointLight) {
7473
7451
  let e = f.camera, n = f.matrix, r = u.distance || e.far;
7474
- r !== e.far && (e.far = r, e.updateProjectionMatrix()), jc.setFromMatrixPosition(u.matrixWorld), e.position.copy(jc), Mc.copy(e.position), Mc.add(Oc[t]), e.up.copy(kc[t]), e.lookAt(Mc), e.updateMatrixWorld(), n.makeTranslation(-jc.x, -jc.y, -jc.z), Ac.multiplyMatrices(e.projectionMatrix, e.matrixWorldInverse), f._frustum.setFromProjectionMatrix(Ac, e.coordinateSystem, e.reversedDepth);
7452
+ r !== e.far && (e.far = r, e.updateProjectionMatrix()), Ac.setFromMatrixPosition(u.matrixWorld), e.position.copy(Ac), jc.copy(e.position), jc.add(Dc[t]), e.up.copy(Oc[t]), e.lookAt(jc), e.updateMatrixWorld(), n.makeTranslation(-Ac.x, -Ac.y, -Ac.z), kc.multiplyMatrices(e.projectionMatrix, e.matrixWorldInverse), f._frustum.setFromProjectionMatrix(kc, e.coordinateSystem, e.reversedDepth);
7475
7453
  } else f.updateMatrices(u);
7476
7454
  r = f.getFrustum(), x(n, s, f.camera, u, this.type);
7477
7455
  }
@@ -7531,7 +7509,7 @@ function ws(e, t, n) {
7531
7509
  }
7532
7510
  }
7533
7511
  }
7534
- function Ts(e, t) {
7512
+ function ws(e, t) {
7535
7513
  function n() {
7536
7514
  let t = !1, n = new Y(), r = null, i = new Y(0, 0, 0, 0);
7537
7515
  return {
@@ -7915,7 +7893,7 @@ function Ts(e, t) {
7915
7893
  reset: W
7916
7894
  };
7917
7895
  }
7918
- function Es(e, t, n, r, i, o, s) {
7896
+ function Ts(e, t, n, r, i, o, s) {
7919
7897
  let c = t.has("WEBGL_multisampled_render_to_texture") ? t.get("WEBGL_multisampled_render_to_texture") : null, d = typeof navigator > "u" ? !1 : /OculusBrowser/g.test(navigator.userAgent), f = new G(), p = /* @__PURE__ */ new WeakMap(), m = /* @__PURE__ */ new Set(), h, g = /* @__PURE__ */ new WeakMap(), _ = !1;
7920
7898
  try {
7921
7899
  _ = typeof OffscreenCanvas < "u" && new OffscreenCanvas(1, 1).getContext("2d") !== null;
@@ -8457,7 +8435,7 @@ function Es(e, t, n, r, i, o, s) {
8457
8435
  return n.buffers.depth.getReversed();
8458
8436
  };
8459
8437
  }
8460
- function Ds(e, t) {
8438
+ function Es(e, t) {
8461
8439
  function n(n, r = "") {
8462
8440
  let i, a = J.getTransfer(r);
8463
8441
  if (n === 1009) return e.UNSIGNED_BYTE;
@@ -8539,7 +8517,7 @@ function Ds(e, t) {
8539
8517
  }
8540
8518
  return { convert: n };
8541
8519
  }
8542
- function Os(e, t) {
8520
+ function Ds(e, t) {
8543
8521
  function n(e, t) {
8544
8522
  e.matrixAutoUpdate === !0 && e.updateMatrix(), t.value.copy(e.matrix);
8545
8523
  }
@@ -8552,7 +8530,7 @@ function Os(e, t) {
8552
8530
  function a(e, r) {
8553
8531
  e.opacity.value = r.opacity, r.color && e.diffuse.value.copy(r.color), r.emissive && e.emissive.value.copy(r.emissive).multiplyScalar(r.emissiveIntensity), r.map && (e.map.value = r.map, n(r.map, e.mapTransform)), r.alphaMap && (e.alphaMap.value = r.alphaMap, n(r.alphaMap, e.alphaMapTransform)), r.bumpMap && (e.bumpMap.value = r.bumpMap, n(r.bumpMap, e.bumpMapTransform), e.bumpScale.value = r.bumpScale, r.side === 1 && (e.bumpScale.value *= -1)), r.normalMap && (e.normalMap.value = r.normalMap, n(r.normalMap, e.normalMapTransform), e.normalScale.value.copy(r.normalScale), r.side === 1 && e.normalScale.value.negate()), r.displacementMap && (e.displacementMap.value = r.displacementMap, n(r.displacementMap, e.displacementMapTransform), e.displacementScale.value = r.displacementScale, e.displacementBias.value = r.displacementBias), r.emissiveMap && (e.emissiveMap.value = r.emissiveMap, n(r.emissiveMap, e.emissiveMapTransform)), r.specularMap && (e.specularMap.value = r.specularMap, n(r.specularMap, e.specularMapTransform)), r.alphaTest > 0 && (e.alphaTest.value = r.alphaTest);
8554
8532
  let i = t.get(r), a = i.envMap, o = i.envMapRotation;
8555
- a && (e.envMap.value = a, e.envMapRotation.value.setFromMatrix4(Lc.makeRotationFromEuler(o)).transpose(), a.isCubeTexture && a.isRenderTargetTexture === !1 && e.envMapRotation.value.premultiply(Rc), e.reflectivity.value = r.reflectivity, e.ior.value = r.ior, e.refractionRatio.value = r.refractionRatio), r.lightMap && (e.lightMap.value = r.lightMap, e.lightMapIntensity.value = r.lightMapIntensity, n(r.lightMap, e.lightMapTransform)), r.aoMap && (e.aoMap.value = r.aoMap, e.aoMapIntensity.value = r.aoMapIntensity, n(r.aoMap, e.aoMapTransform));
8533
+ a && (e.envMap.value = a, e.envMapRotation.value.setFromMatrix4(Ic.makeRotationFromEuler(o)).transpose(), a.isCubeTexture && a.isRenderTargetTexture === !1 && e.envMapRotation.value.premultiply(Lc), e.reflectivity.value = r.reflectivity, e.ior.value = r.ior, e.refractionRatio.value = r.refractionRatio), r.lightMap && (e.lightMap.value = r.lightMap, e.lightMapIntensity.value = r.lightMapIntensity, n(r.lightMap, e.lightMapTransform)), r.aoMap && (e.aoMap.value = r.aoMap, e.aoMapIntensity.value = r.aoMapIntensity, n(r.aoMap, e.aoMapTransform));
8556
8534
  }
8557
8535
  function o(e, t) {
8558
8536
  e.diffuse.value.copy(t.color), e.opacity.value = t.opacity, t.map && (e.map.value = t.map, n(t.map, e.mapTransform));
@@ -8590,7 +8568,7 @@ function Os(e, t) {
8590
8568
  refreshMaterialUniforms: i
8591
8569
  };
8592
8570
  }
8593
- function ks(e, t, n, r) {
8571
+ function Os(e, t, n, r) {
8594
8572
  let i = {}, a = {}, o = [], s = e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);
8595
8573
  function c(e, t) {
8596
8574
  let n = t.program;
@@ -8690,11 +8668,11 @@ function ks(e, t, n, r) {
8690
8668
  dispose: x
8691
8669
  };
8692
8670
  }
8693
- function As() {
8694
- return Bc === null && (Bc = new ci(zc, 16, 16, Le, Oe), Bc.name = "DFG_LUT", Bc.minFilter = z, Bc.magFilter = z, Bc.wrapS = he, Bc.wrapT = he, Bc.generateMipmaps = !1, Bc.needsUpdate = !0), Bc;
8671
+ function ks() {
8672
+ return zc === null && (zc = new ci(Rc, 16, 16, Le, Oe), zc.name = "DFG_LUT", zc.minFilter = z, zc.magFilter = z, zc.wrapS = he, zc.wrapT = he, zc.generateMipmaps = !1, zc.needsUpdate = !0), zc;
8695
8673
  }
8696
- var Q, $, js, Ms, Ns, Ps, Fs, Is, Ls, Rs, zs, Bs, Vs, Hs, Us, Ws, Gs, Ks, qs, Js, Ys, Xs, Zs, Qs, $s, ec, tc, nc, rc, ic, ac, oc, sc, cc, lc, uc, dc, fc, pc, mc, hc, gc, _c, vc, yc, bc, xc, Sc, Cc, wc, Tc, Ec, Dc, Oc, kc, Ac, jc, Mc, Nc, Pc, Fc, Ic, Lc, Rc, zc, Bc, Vc, Hc = t((() => {
8697
- wa(), Q = {
8674
+ var Q, $, As, js, Ms, Ns, Ps, Fs, Is, Ls, Rs, zs, Bs, Vs, Hs, Us, Ws, Gs, Ks, qs, Js, Ys, Xs, Zs, Qs, $s, ec, tc, nc, rc, ic, ac, oc, sc, cc, lc, uc, dc, fc, pc, mc, hc, gc, _c, vc, yc, bc, xc, Sc, Cc, wc, Tc, Ec, Dc, Oc, kc, Ac, jc, Mc, Nc, Pc, Fc, Ic, Lc, Rc, zc, Bc, Vc = t((() => {
8675
+ Ca(), Q = {
8698
8676
  alphahash_fragment: "#ifdef USE_ALPHAHASH\n if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif",
8699
8677
  alphahash_pars_fragment: "#ifdef USE_ALPHAHASH\n const float ALPHA_HASH_SCALE = 0.05;\n float hash2D( vec2 value ) {\n return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n }\n float hash3D( vec3 value ) {\n return hash2D( vec2( hash2D( value.xy ), value.z ) );\n }\n float getAlphaHashThreshold( vec3 position ) {\n float maxDeriv = max(\n length( dFdx( position.xyz ) ),\n length( dFdy( position.xyz ) )\n );\n float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n vec2 pixScales = vec2(\n exp2( floor( log2( pixScale ) ) ),\n exp2( ceil( log2( pixScale ) ) )\n );\n vec2 alpha = vec2(\n hash3D( floor( pixScales.x * position.xyz ) ),\n hash3D( floor( pixScales.y * position.xyz ) )\n );\n float lerpFactor = fract( log2( pixScale ) );\n float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n float a = min( lerpFactor, 1.0 - lerpFactor );\n vec3 cases = vec3(\n x * x / ( 2.0 * a * ( 1.0 - a ) ),\n ( x - 0.5 * a ) / ( 1.0 - a ),\n 1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n );\n float threshold = ( x < ( 1.0 - a ) )\n ? ( ( x < a ) ? cases.x : cases.y )\n : cases.z;\n return clamp( threshold , 1.0e-6, 1.0 );\n }\n#endif",
8700
8678
  alphamap_fragment: "#ifdef USE_ALPHAMAP\n diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif",
@@ -9017,7 +8995,7 @@ var Q, $, js, Ms, Ns, Ps, Fs, Is, Ls, Rs, zs, Bs, Vs, Hs, Us, Ws, Gs, Ks, qs, Js
9017
8995
  alphaMapTransform: { value: /*@__PURE__*/ new q() },
9018
8996
  alphaTest: { value: 0 }
9019
8997
  }
9020
- }, js = {
8998
+ }, As = {
9021
8999
  basic: {
9022
9000
  uniforms: /*@__PURE__*/ L([
9023
9001
  $.common,
@@ -9224,8 +9202,8 @@ var Q, $, js, Ms, Ns, Ps, Fs, Is, Ls, Rs, zs, Bs, Vs, Hs, Us, Ws, Gs, Ks, qs, Js
9224
9202
  vertexShader: Q.shadow_vert,
9225
9203
  fragmentShader: Q.shadow_frag
9226
9204
  }
9227
- }, js.physical = {
9228
- uniforms: /*@__PURE__*/ L([js.standard.uniforms, {
9205
+ }, As.physical = {
9206
+ uniforms: /*@__PURE__*/ L([As.standard.uniforms, {
9229
9207
  clearcoat: { value: 0 },
9230
9208
  clearcoatMap: { value: null },
9231
9209
  clearcoatMapTransform: { value: /*@__PURE__*/ new q() },
@@ -9273,24 +9251,24 @@ var Q, $, js, Ms, Ns, Ps, Fs, Is, Ls, Rs, zs, Bs, Vs, Hs, Us, Ws, Gs, Ks, qs, Js
9273
9251
  }]),
9274
9252
  vertexShader: Q.meshphysical_vert,
9275
9253
  fragmentShader: Q.meshphysical_frag
9276
- }, Ms = {
9254
+ }, js = {
9277
9255
  r: 0,
9278
9256
  b: 0,
9279
9257
  g: 0
9280
- }, Ns = /*@__PURE__*/ new un(), Ps = /*@__PURE__*/ new q(), Ps.set(-1, 0, 0, 0, 1, 0, 0, 0, 1), Fs = 4, Is = [
9258
+ }, Ms = /*@__PURE__*/ new un(), Ns = /*@__PURE__*/ new q(), Ns.set(-1, 0, 0, 0, 1, 0, 0, 0, 1), Ps = 4, Fs = [
9281
9259
  .125,
9282
9260
  .215,
9283
9261
  .35,
9284
9262
  .446,
9285
9263
  .526,
9286
9264
  .582
9287
- ], Ls = 20, Rs = 256, zs = /*@__PURE__*/ new oa(), Bs = /*@__PURE__*/ new X(), Vs = null, Hs = 0, Us = 0, Ws = !1, Gs = /*@__PURE__*/ new K(), Ks = class {
9265
+ ], Is = 20, Ls = 256, Rs = /*@__PURE__*/ new oa(), zs = /*@__PURE__*/ new X(), Bs = null, Vs = 0, Hs = 0, Us = !1, Ws = /*@__PURE__*/ new K(), Gs = class {
9288
9266
  constructor(e) {
9289
9267
  this._renderer = e, this._pingPongRenderTarget = null, this._lodMax = 0, this._cubeSize = 0, this._sizeLods = [], this._sigmas = [], this._lodMeshes = [], this._backgroundBox = null, this._cubemapMaterial = null, this._equirectMaterial = null, this._blurMaterial = null, this._ggxMaterial = null;
9290
9268
  }
9291
9269
  fromScene(e, t = 0, n = .1, r = 100, i = {}) {
9292
- let { size: a = 256, position: o = Gs } = i;
9293
- Vs = this._renderer.getRenderTarget(), Hs = this._renderer.getActiveCubeFace(), Us = this._renderer.getActiveMipmapLevel(), Ws = this._renderer.xr.enabled, this._renderer.xr.enabled = !1, this._setSize(a);
9270
+ let { size: a = 256, position: o = Ws } = i;
9271
+ Bs = this._renderer.getRenderTarget(), Vs = this._renderer.getActiveCubeFace(), Hs = this._renderer.getActiveMipmapLevel(), Us = this._renderer.xr.enabled, this._renderer.xr.enabled = !1, this._setSize(a);
9294
9272
  let s = this._allocateTargets();
9295
9273
  return s.depthBuffer = !0, this._sceneToCubeUV(e, n, r, s, o), t > 0 && this._blur(s, 0, 0, t), this._applyPMREM(s), this._cleanup(s), s;
9296
9274
  }
@@ -9301,10 +9279,10 @@ var Q, $, js, Ms, Ns, Ps, Fs, Is, Ls, Rs, zs, Bs, Vs, Hs, Us, Ws, Gs, Ks, qs, Js
9301
9279
  return this._fromTexture(e, t);
9302
9280
  }
9303
9281
  compileCubemapShader() {
9304
- this._cubemapMaterial === null && (this._cubemapMaterial = Ra(), this._compileMaterial(this._cubemapMaterial));
9282
+ this._cubemapMaterial === null && (this._cubemapMaterial = La(), this._compileMaterial(this._cubemapMaterial));
9305
9283
  }
9306
9284
  compileEquirectangularShader() {
9307
- this._equirectMaterial === null && (this._equirectMaterial = La(), this._compileMaterial(this._equirectMaterial));
9285
+ this._equirectMaterial === null && (this._equirectMaterial = Ia(), this._compileMaterial(this._equirectMaterial));
9308
9286
  }
9309
9287
  dispose() {
9310
9288
  this._dispose(), this._cubemapMaterial !== null && this._cubemapMaterial.dispose(), this._equirectMaterial !== null && this._equirectMaterial.dispose(), this._backgroundBox !== null && (this._backgroundBox.geometry.dispose(), this._backgroundBox.material.dispose());
@@ -9317,10 +9295,10 @@ var Q, $, js, Ms, Ns, Ps, Fs, Is, Ls, Rs, zs, Bs, Vs, Hs, Us, Ws, Gs, Ks, qs, Js
9317
9295
  for (let e = 0; e < this._lodMeshes.length; e++) this._lodMeshes[e].geometry.dispose();
9318
9296
  }
9319
9297
  _cleanup(e) {
9320
- this._renderer.setRenderTarget(Vs, Hs, Us), this._renderer.xr.enabled = Ws, e.scissorTest = !1, Pa(e, 0, 0, e.width, e.height);
9298
+ this._renderer.setRenderTarget(Bs, Vs, Hs), this._renderer.xr.enabled = Us, e.scissorTest = !1, Na(e, 0, 0, e.width, e.height);
9321
9299
  }
9322
9300
  _fromTexture(e, t) {
9323
- e.mapping === 301 || e.mapping === 302 ? this._setSize(e.image.length === 0 ? 16 : e.image[0].width || e.image[0].image.width) : this._setSize(e.image.width / 4), Vs = this._renderer.getRenderTarget(), Hs = this._renderer.getActiveCubeFace(), Us = this._renderer.getActiveMipmapLevel(), Ws = this._renderer.xr.enabled, this._renderer.xr.enabled = !1;
9301
+ e.mapping === 301 || e.mapping === 302 ? this._setSize(e.image.length === 0 ? 16 : e.image[0].width || e.image[0].image.width) : this._setSize(e.image.width / 4), Bs = this._renderer.getRenderTarget(), Vs = this._renderer.getActiveCubeFace(), Hs = this._renderer.getActiveMipmapLevel(), Us = this._renderer.xr.enabled, this._renderer.xr.enabled = !1;
9324
9302
  let n = t || this._allocateTargets();
9325
9303
  return this._textureToCubeUV(e, n), this._applyPMREM(n), this._cleanup(n), n;
9326
9304
  }
@@ -9333,17 +9311,17 @@ var Q, $, js, Ms, Ns, Ps, Fs, Is, Ls, Rs, zs, Bs, Vs, Hs, Us, Ws, Gs, Ks, qs, Js
9333
9311
  format: U,
9334
9312
  colorSpace: jt,
9335
9313
  depthBuffer: !1
9336
- }, r = Na(e, t, n);
9314
+ }, r = Ma(e, t, n);
9337
9315
  if (this._pingPongRenderTarget === null || this._pingPongRenderTarget.width !== e || this._pingPongRenderTarget.height !== t) {
9338
- this._pingPongRenderTarget !== null && this._dispose(), this._pingPongRenderTarget = Na(e, t, n);
9316
+ this._pingPongRenderTarget !== null && this._dispose(), this._pingPongRenderTarget = Ma(e, t, n);
9339
9317
  let { _lodMax: r } = this;
9340
- ({lodMeshes: this._lodMeshes, sizeLods: this._sizeLods, sigmas: this._sigmas} = Ma(r)), this._blurMaterial = Ia(r, e, t), this._ggxMaterial = Fa(r, e, t);
9318
+ ({lodMeshes: this._lodMeshes, sizeLods: this._sizeLods, sigmas: this._sigmas} = ja(r)), this._blurMaterial = Fa(r, e, t), this._ggxMaterial = Pa(r, e, t);
9341
9319
  }
9342
9320
  return r;
9343
9321
  }
9344
9322
  _compileMaterial(e) {
9345
9323
  let t = new si(new Rr(), e);
9346
- this._renderer.compile(t, zs);
9324
+ this._renderer.compile(t, Rs);
9347
9325
  }
9348
9326
  _sceneToCubeUV(e, t, n, r, i) {
9349
9327
  let a = new aa(90, 1, t, n), o = [
@@ -9361,31 +9339,31 @@ var Q, $, js, Ms, Ns, Ps, Fs, Is, Ls, Rs, zs, Bs, Vs, Hs, Us, Ws, Gs, Ks, qs, Js
9361
9339
  -1,
9362
9340
  -1
9363
9341
  ], c = this._renderer, l = c.autoClear, u = c.toneMapping;
9364
- c.getClearColor(Bs), c.toneMapping = 0, c.autoClear = !1, c.state.buffers.depth.getReversed() && (c.setRenderTarget(r), c.clearDepth(), c.setRenderTarget(null)), this._backgroundBox === null && (this._backgroundBox = new si(new Ci(), new Yr({
9342
+ c.getClearColor(zs), c.toneMapping = 0, c.autoClear = !1, c.state.buffers.depth.getReversed() && (c.setRenderTarget(r), c.clearDepth(), c.setRenderTarget(null)), this._backgroundBox === null && (this._backgroundBox = new si(new Ci(), new Yr({
9365
9343
  name: "PMREM.Background",
9366
9344
  side: 1,
9367
9345
  depthWrite: !1,
9368
9346
  depthTest: !1
9369
9347
  })));
9370
9348
  let d = this._backgroundBox, f = d.material, p = !1, m = e.background;
9371
- m ? m.isColor && (f.color.copy(m), e.background = null, p = !0) : (f.color.copy(Bs), p = !0);
9349
+ m ? m.isColor && (f.color.copy(m), e.background = null, p = !0) : (f.color.copy(zs), p = !0);
9372
9350
  for (let t = 0; t < 6; t++) {
9373
9351
  let n = t % 3;
9374
9352
  n === 0 ? (a.up.set(0, o[t], 0), a.position.set(i.x, i.y, i.z), a.lookAt(i.x + s[t], i.y, i.z)) : n === 1 ? (a.up.set(0, 0, o[t]), a.position.set(i.x, i.y, i.z), a.lookAt(i.x, i.y + s[t], i.z)) : (a.up.set(0, o[t], 0), a.position.set(i.x, i.y, i.z), a.lookAt(i.x, i.y, i.z + s[t]));
9375
9353
  let l = this._cubeSize;
9376
- Pa(r, n * l, t > 2 ? l : 0, l, l), c.setRenderTarget(r), p && c.render(d, a), c.render(e, a);
9354
+ Na(r, n * l, t > 2 ? l : 0, l, l), c.setRenderTarget(r), p && c.render(d, a), c.render(e, a);
9377
9355
  }
9378
9356
  c.toneMapping = u, c.autoClear = l, e.background = m;
9379
9357
  }
9380
9358
  _textureToCubeUV(e, t) {
9381
9359
  let n = this._renderer, r = e.mapping === 301 || e.mapping === 302;
9382
- r ? (this._cubemapMaterial === null && (this._cubemapMaterial = Ra()), this._cubemapMaterial.uniforms.flipEnvMap.value = e.isRenderTargetTexture === !1 ? -1 : 1) : this._equirectMaterial === null && (this._equirectMaterial = La());
9360
+ r ? (this._cubemapMaterial === null && (this._cubemapMaterial = La()), this._cubemapMaterial.uniforms.flipEnvMap.value = e.isRenderTargetTexture === !1 ? -1 : 1) : this._equirectMaterial === null && (this._equirectMaterial = Ia());
9383
9361
  let i = r ? this._cubemapMaterial : this._equirectMaterial, a = this._lodMeshes[0];
9384
9362
  a.material = i;
9385
9363
  let o = i.uniforms;
9386
9364
  o.envMap.value = e;
9387
9365
  let s = this._cubeSize;
9388
- Pa(t, 0, 0, 3 * s, 2 * s), n.setRenderTarget(t), n.render(a, zs);
9366
+ Na(t, 0, 0, 3 * s, 2 * s), n.setRenderTarget(t), n.render(a, Rs);
9389
9367
  }
9390
9368
  _applyPMREM(e) {
9391
9369
  let t = this._renderer, n = t.autoClear;
@@ -9397,8 +9375,8 @@ var Q, $, js, Ms, Ns, Ps, Fs, Is, Ls, Rs, zs, Bs, Vs, Hs, Us, Ws, Gs, Ks, qs, Js
9397
9375
  _applyGGXFilter(e, t, n) {
9398
9376
  let r = this._renderer, i = this._pingPongRenderTarget, a = this._ggxMaterial, o = this._lodMeshes[n];
9399
9377
  o.material = a;
9400
- let s = a.uniforms, c = n / (this._lodMeshes.length - 1), l = t / (this._lodMeshes.length - 1), u = Math.sqrt(c * c - l * l) * (0 + c * 1.25), { _lodMax: d } = this, f = this._sizeLods[n], p = 3 * f * (n > d - Fs ? n - d + Fs : 0), m = 4 * (this._cubeSize - f);
9401
- s.envMap.value = e.texture, s.roughness.value = u, s.mipInt.value = d - t, Pa(i, p, m, 3 * f, 2 * f), r.setRenderTarget(i), r.render(o, zs), s.envMap.value = i.texture, s.roughness.value = 0, s.mipInt.value = d - n, Pa(e, p, m, 3 * f, 2 * f), r.setRenderTarget(e), r.render(o, zs);
9378
+ let s = a.uniforms, c = n / (this._lodMeshes.length - 1), l = t / (this._lodMeshes.length - 1), u = Math.sqrt(c * c - l * l) * (0 + c * 1.25), { _lodMax: d } = this, f = this._sizeLods[n], p = 3 * f * (n > d - Ps ? n - d + Ps : 0), m = 4 * (this._cubeSize - f);
9379
+ s.envMap.value = e.texture, s.roughness.value = u, s.mipInt.value = d - t, Na(i, p, m, 3 * f, 2 * f), r.setRenderTarget(i), r.render(o, Rs), s.envMap.value = i.texture, s.roughness.value = 0, s.mipInt.value = d - n, Na(e, p, m, 3 * f, 2 * f), r.setRenderTarget(e), r.render(o, Rs);
9402
9380
  }
9403
9381
  _blur(e, t, n, r, i) {
9404
9382
  let a = this._pingPongRenderTarget;
@@ -9409,10 +9387,10 @@ var Q, $, js, Ms, Ns, Ps, Fs, Is, Ls, Rs, zs, Bs, Vs, Hs, Us, Ws, Gs, Ks, qs, Js
9409
9387
  a !== "latitudinal" && a !== "longitudinal" && u("blur direction must be either latitudinal or longitudinal!");
9410
9388
  let d = this._lodMeshes[r];
9411
9389
  d.material = c;
9412
- let f = c.uniforms, p = this._sizeLods[n] - 1, m = isFinite(i) ? Math.PI / (2 * p) : 2 * Math.PI / (2 * Ls - 1), h = i / m, g = isFinite(i) ? 1 + Math.floor(3 * h) : Ls;
9413
- g > Ls && l(`sigmaRadians, ${i}, is too large and will clip, as it requested ${g} samples when the maximum is set to ${Ls}`);
9390
+ let f = c.uniforms, p = this._sizeLods[n] - 1, m = isFinite(i) ? Math.PI / (2 * p) : 2 * Math.PI / (2 * Is - 1), h = i / m, g = isFinite(i) ? 1 + Math.floor(3 * h) : Is;
9391
+ g > Is && l(`sigmaRadians, ${i}, is too large and will clip, as it requested ${g} samples when the maximum is set to ${Is}`);
9414
9392
  let _ = [], v = 0;
9415
- for (let e = 0; e < Ls; ++e) {
9393
+ for (let e = 0; e < Is; ++e) {
9416
9394
  let t = e / h, n = Math.exp(-t * t / 2);
9417
9395
  _.push(n), e === 0 ? v += n : e < g && (v += 2 * n);
9418
9396
  }
@@ -9421,9 +9399,9 @@ var Q, $, js, Ms, Ns, Ps, Fs, Is, Ls, Rs, zs, Bs, Vs, Hs, Us, Ws, Gs, Ks, qs, Js
9421
9399
  let { _lodMax: y } = this;
9422
9400
  f.dTheta.value = m, f.mipInt.value = y - n;
9423
9401
  let b = this._sizeLods[r];
9424
- Pa(t, 3 * b * (r > y - Fs ? r - y + Fs : 0), 4 * (this._cubeSize - b), 3 * b, 2 * b), s.setRenderTarget(t), s.render(d, zs);
9402
+ Na(t, 3 * b * (r > y - Ps ? r - y + Ps : 0), 4 * (this._cubeSize - b), 3 * b, 2 * b), s.setRenderTarget(t), s.render(d, Rs);
9425
9403
  }
9426
- }, qs = class extends sn {
9404
+ }, Ks = class extends sn {
9427
9405
  constructor(e = 1, t = {}) {
9428
9406
  super(e, e, t), this.isWebGLCubeRenderTarget = !0;
9429
9407
  let n = {
@@ -9463,7 +9441,7 @@ var Q, $, js, Ms, Ns, Ps, Fs, Is, Ls, Rs, zs, Bs, Vs, Hs, Us, Ws, Gs, Ks, qs, Js
9463
9441
  for (let i = 0; i < 6; i++) e.setRenderTarget(this, i), e.clear(t, n, r);
9464
9442
  e.setRenderTarget(i);
9465
9443
  }
9466
- }, Js = {
9444
+ }, qs = {
9467
9445
  1: "LINEAR_TONE_MAPPING",
9468
9446
  2: "REINHARD_TONE_MAPPING",
9469
9447
  3: "CINEON_TONE_MAPPING",
@@ -9471,15 +9449,15 @@ var Q, $, js, Ms, Ns, Ps, Fs, Is, Ls, Rs, zs, Bs, Vs, Hs, Us, Ws, Gs, Ks, qs, Js
9471
9449
  6: "AGX_TONE_MAPPING",
9472
9450
  7: "NEUTRAL_TONE_MAPPING",
9473
9451
  5: "CUSTOM_TONE_MAPPING"
9474
- }, Ys = /*@__PURE__*/ new an(), Xs = /*@__PURE__*/ new bi(1, 1), Zs = /*@__PURE__*/ new cn(), Qs = /*@__PURE__*/ new ln(), $s = /*@__PURE__*/ new vi(), ec = [], tc = [], nc = /* @__PURE__ */ new Float32Array(16), rc = /* @__PURE__ */ new Float32Array(9), ic = /* @__PURE__ */ new Float32Array(4), ac = class {
9452
+ }, Js = /*@__PURE__*/ new an(), Ys = /*@__PURE__*/ new bi(1, 1), Xs = /*@__PURE__*/ new cn(), Zs = /*@__PURE__*/ new ln(), Qs = /*@__PURE__*/ new vi(), $s = [], ec = [], tc = /* @__PURE__ */ new Float32Array(16), nc = /* @__PURE__ */ new Float32Array(9), rc = /* @__PURE__ */ new Float32Array(4), ic = class {
9475
9453
  constructor(e, t, n) {
9476
- this.id = e, this.addr = n, this.cache = [], this.type = t.type, this.setValue = vo(t.type);
9454
+ this.id = e, this.addr = n, this.cache = [], this.type = t.type, this.setValue = _o(t.type);
9477
9455
  }
9478
- }, oc = class {
9456
+ }, ac = class {
9479
9457
  constructor(e, t, n) {
9480
- this.id = e, this.addr = n, this.cache = [], this.type = t.type, this.size = t.size, this.setValue = Ro(t.type);
9458
+ this.id = e, this.addr = n, this.cache = [], this.type = t.type, this.size = t.size, this.setValue = Lo(t.type);
9481
9459
  }
9482
- }, sc = class {
9460
+ }, oc = class {
9483
9461
  constructor(e) {
9484
9462
  this.id = e, this.seq = [], this.map = {};
9485
9463
  }
@@ -9490,13 +9468,13 @@ var Q, $, js, Ms, Ns, Ps, Fs, Is, Ls, Rs, zs, Bs, Vs, Hs, Us, Ws, Gs, Ks, qs, Js
9490
9468
  a.setValue(e, t[a.id], n);
9491
9469
  }
9492
9470
  }
9493
- }, cc = /(\w+)(\])?(\[|\.)?/g, lc = class {
9471
+ }, sc = /(\w+)(\])?(\[|\.)?/g, cc = class {
9494
9472
  constructor(e, t) {
9495
9473
  this.seq = [], this.map = {};
9496
9474
  let n = e.getProgramParameter(t, e.ACTIVE_UNIFORMS);
9497
9475
  for (let r = 0; r < n; ++r) {
9498
9476
  let n = e.getActiveUniform(t, r);
9499
- Bo(n, e.getUniformLocation(t, n.name), this);
9477
+ zo(n, e.getUniformLocation(t, n.name), this);
9500
9478
  }
9501
9479
  let r = [], i = [];
9502
9480
  for (let t of this.seq) t.type === e.SAMPLER_2D_SHADOW || t.type === e.SAMPLER_CUBE_SHADOW || t.type === e.SAMPLER_2D_ARRAY_SHADOW ? r.push(t) : i.push(t);
@@ -9524,7 +9502,7 @@ var Q, $, js, Ms, Ns, Ps, Fs, Is, Ls, Rs, zs, Bs, Vs, Hs, Us, Ws, Gs, Ks, qs, Js
9524
9502
  }
9525
9503
  return n;
9526
9504
  }
9527
- }, uc = 37297, dc = 0, fc = /*@__PURE__*/ new q(), pc = {
9505
+ }, lc = 37297, uc = 0, dc = /*@__PURE__*/ new q(), fc = {
9528
9506
  1: "Linear",
9529
9507
  2: "Reinhard",
9530
9508
  3: "Cineon",
@@ -9532,18 +9510,18 @@ var Q, $, js, Ms, Ns, Ps, Fs, Is, Ls, Rs, zs, Bs, Vs, Hs, Us, Ws, Gs, Ks, qs, Js
9532
9510
  6: "AgX",
9533
9511
  7: "Neutral",
9534
9512
  5: "Custom"
9535
- }, mc = /*@__PURE__*/ new K(), hc = /^[ \t]*#include +<([\w\d./]+)>/gm, gc = /* @__PURE__ */ new Map(), _c = /#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g, vc = {
9513
+ }, pc = /*@__PURE__*/ new K(), mc = /^[ \t]*#include +<([\w\d./]+)>/gm, hc = /* @__PURE__ */ new Map(), gc = /#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g, _c = {
9536
9514
  1: "SHADOWMAP_TYPE_PCF",
9537
9515
  3: "SHADOWMAP_TYPE_VSM"
9538
- }, yc = {
9516
+ }, vc = {
9539
9517
  301: "ENVMAP_TYPE_CUBE",
9540
9518
  302: "ENVMAP_TYPE_CUBE",
9541
9519
  306: "ENVMAP_TYPE_CUBE_UV"
9542
- }, bc = { 302: "ENVMAP_MODE_REFRACTION" }, xc = {
9520
+ }, yc = { 302: "ENVMAP_MODE_REFRACTION" }, bc = {
9543
9521
  0: "ENVMAP_BLENDING_MULTIPLY",
9544
9522
  1: "ENVMAP_BLENDING_MIX",
9545
9523
  2: "ENVMAP_BLENDING_ADD"
9546
- }, Sc = 0, Cc = class {
9524
+ }, xc = 0, Sc = class {
9547
9525
  constructor() {
9548
9526
  this.shaderCache = /* @__PURE__ */ new Map(), this.materialCache = /* @__PURE__ */ new Map();
9549
9527
  }
@@ -9571,27 +9549,27 @@ var Q, $, js, Ms, Ns, Ps, Fs, Is, Ls, Rs, zs, Bs, Vs, Hs, Us, Ws, Gs, Ks, qs, Js
9571
9549
  }
9572
9550
  _getShaderStage(e) {
9573
9551
  let t = this.shaderCache, n = t.get(e);
9574
- return n === void 0 && (n = new wc(e), t.set(e, n)), n;
9552
+ return n === void 0 && (n = new Cc(e), t.set(e, n)), n;
9575
9553
  }
9576
- }, wc = class {
9554
+ }, Cc = class {
9577
9555
  constructor(e) {
9578
- this.id = Sc++, this.code = e, this.usedTimes = 0;
9556
+ this.id = xc++, this.code = e, this.usedTimes = 0;
9579
9557
  }
9580
- }, Tc = 0, Ec = "void main() {\n gl_Position = vec4( position, 1.0 );\n}", Dc = "uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\nvoid main() {\n const float samples = float( VSM_SAMPLES );\n float mean = 0.0;\n float squared_mean = 0.0;\n float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n float uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n for ( float i = 0.0; i < samples; i ++ ) {\n float uvOffset = uvStart + i * uvStride;\n #ifdef HORIZONTAL_PASS\n vec2 distribution = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ).rg;\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n #else\n float depth = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ).r;\n mean += depth;\n squared_mean += depth * depth;\n #endif\n }\n mean = mean / samples;\n squared_mean = squared_mean / samples;\n float std_dev = sqrt( max( 0.0, squared_mean - mean * mean ) );\n gl_FragColor = vec4( mean, std_dev, 0.0, 1.0 );\n}", Oc = [
9558
+ }, wc = 0, Tc = "void main() {\n gl_Position = vec4( position, 1.0 );\n}", Ec = "uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\nvoid main() {\n const float samples = float( VSM_SAMPLES );\n float mean = 0.0;\n float squared_mean = 0.0;\n float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n float uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n for ( float i = 0.0; i < samples; i ++ ) {\n float uvOffset = uvStart + i * uvStride;\n #ifdef HORIZONTAL_PASS\n vec2 distribution = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ).rg;\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n #else\n float depth = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ).r;\n mean += depth;\n squared_mean += depth * depth;\n #endif\n }\n mean = mean / samples;\n squared_mean = squared_mean / samples;\n float std_dev = sqrt( max( 0.0, squared_mean - mean * mean ) );\n gl_FragColor = vec4( mean, std_dev, 0.0, 1.0 );\n}", Dc = [
9581
9559
  /*@__PURE__*/ new K(1, 0, 0),
9582
9560
  /*@__PURE__*/ new K(-1, 0, 0),
9583
9561
  /*@__PURE__*/ new K(0, 1, 0),
9584
9562
  /*@__PURE__*/ new K(0, -1, 0),
9585
9563
  /*@__PURE__*/ new K(0, 0, 1),
9586
9564
  /*@__PURE__*/ new K(0, 0, -1)
9587
- ], kc = [
9565
+ ], Oc = [
9588
9566
  /*@__PURE__*/ new K(0, -1, 0),
9589
9567
  /*@__PURE__*/ new K(0, -1, 0),
9590
9568
  /*@__PURE__*/ new K(0, 0, 1),
9591
9569
  /*@__PURE__*/ new K(0, 0, -1),
9592
9570
  /*@__PURE__*/ new K(0, -1, 0),
9593
9571
  /*@__PURE__*/ new K(0, -1, 0)
9594
- ], Ac = /*@__PURE__*/ new un(), jc = /*@__PURE__*/ new K(), Mc = /*@__PURE__*/ new K(), Nc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Pc = "\nuniform sampler2DArray depthColor;\nuniform float depthWidth;\nuniform float depthHeight;\n\nvoid main() {\n\n vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );\n\n if ( coord.x >= 1.0 ) {\n\n gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;\n\n } else {\n\n gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;\n\n }\n\n}", Fc = class {
9572
+ ], kc = /*@__PURE__*/ new un(), Ac = /*@__PURE__*/ new K(), jc = /*@__PURE__*/ new K(), Mc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Nc = "\nuniform sampler2DArray depthColor;\nuniform float depthWidth;\nuniform float depthHeight;\n\nvoid main() {\n\n vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );\n\n if ( coord.x >= 1.0 ) {\n\n gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;\n\n } else {\n\n gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;\n\n }\n\n}", Pc = class {
9595
9573
  constructor() {
9596
9574
  this.texture = null, this.mesh = null, this.depthNear = 0, this.depthFar = 0;
9597
9575
  }
@@ -9604,8 +9582,8 @@ var Q, $, js, Ms, Ns, Ps, Fs, Is, Ls, Rs, zs, Bs, Vs, Hs, Us, Ws, Gs, Ks, qs, Js
9604
9582
  getMesh(e) {
9605
9583
  if (this.texture !== null && this.mesh === null) {
9606
9584
  let t = e.cameras[0].viewport, n = new Oi({
9607
- vertexShader: Nc,
9608
- fragmentShader: Pc,
9585
+ vertexShader: Mc,
9586
+ fragmentShader: Nc,
9609
9587
  uniforms: {
9610
9588
  depthColor: { value: this.texture },
9611
9589
  depthWidth: { value: t.z },
@@ -9622,10 +9600,10 @@ var Q, $, js, Ms, Ns, Ps, Fs, Is, Ls, Rs, zs, Bs, Vs, Hs, Us, Ws, Gs, Ks, qs, Js
9622
9600
  getDepthTexture() {
9623
9601
  return this.texture;
9624
9602
  }
9625
- }, Ic = class extends Bt {
9603
+ }, Fc = class extends Bt {
9626
9604
  constructor(e, t) {
9627
9605
  super();
9628
- let n = this, r = null, i = 1, a = null, o = "local-floor", s = 1, c = null, u = null, d = null, f = null, p = null, m = null, h = typeof XRWebGLBinding < "u", g = new Fc(), _ = {}, v = t.getContextAttributes(), y = null, b = null, x = [], S = [], C = new G(), w = null, T = new aa();
9606
+ let n = this, r = null, i = 1, a = null, o = "local-floor", s = 1, c = null, u = null, d = null, f = null, p = null, m = null, h = typeof XRWebGLBinding < "u", g = new Pc(), _ = {}, v = t.getContextAttributes(), y = null, b = null, x = [], S = [], C = new G(), w = null, T = new aa();
9629
9607
  T.viewport = new Y();
9630
9608
  let E = new aa();
9631
9609
  E.viewport = new Y();
@@ -9826,12 +9804,12 @@ var Q, $, js, Ms, Ns, Ps, Fs, Is, Ls, Rs, zs, Bs, Vs, Hs, Us, Ws, Gs, Ks, qs, Js
9826
9804
  data: i
9827
9805
  }), m = null;
9828
9806
  }
9829
- let ie = new Ta();
9807
+ let ie = new wa();
9830
9808
  ie.setAnimationLoop(re), this.setAnimationLoop = function(e) {
9831
9809
  ne = e;
9832
9810
  }, this.dispose = function() {};
9833
9811
  }
9834
- }, Lc = /*@__PURE__*/ new un(), Rc = /*@__PURE__*/ new q(), Rc.set(-1, 0, 0, 0, 1, 0, 0, 0, 1), zc = new Uint16Array([
9812
+ }, Ic = /*@__PURE__*/ new un(), Lc = /*@__PURE__*/ new q(), Lc.set(-1, 0, 0, 0, 1, 0, 0, 0, 1), Rc = new Uint16Array([
9835
9813
  12469,
9836
9814
  15057,
9837
9815
  12620,
@@ -10344,7 +10322,7 @@ var Q, $, js, Ms, Ns, Ps, Fs, Is, Ls, Rs, zs, Bs, Vs, Hs, Us, Ws, Gs, Ks, qs, Js
10344
10322
  1398,
10345
10323
  13702,
10346
10324
  1183
10347
- ]), Bc = null, Vc = class {
10325
+ ]), zc = null, Bc = class {
10348
10326
  constructor(e = {}) {
10349
10327
  let { canvas: t = o(), context: n = null, depth: r = !0, stencil: i = !1, alpha: a = !1, antialias: c = !1, premultipliedAlpha: d = !0, preserveDrawingBuffer: p = !1, powerPreference: m = "default", failIfMajorPerformanceCaveat: h = !1, reversedDepthBuffer: g = !1, outputBufferType: _ = Se } = e;
10350
10328
  this.isWebGLRenderer = !0;
@@ -10405,10 +10383,10 @@ var Q, $, js, Ms, Ns, Ps, Fs, Is, Ls, Rs, zs, Bs, Vs, Hs, Us, Ws, Gs, Ks, qs, Js
10405
10383
  }
10406
10384
  let V, Me, H, Ne, U, W, Pe, Fe, Le, Be, Ve, He, Ue, We, Ge, Ke, qe, Je, Ye, Xe, Ze, Qe, $e;
10407
10385
  function et() {
10408
- V = new Va(B), V.init(), Ze = new Ds(B, V), Me = new Aa(B, V, e, Ze), H = new Ts(B, V), Me.reversedDepthBuffer && g && H.buffers.depth.setReversed(!0), ee = B.createFramebuffer(), N = B.createFramebuffer(), te = B.createFramebuffer(), Ne = new Wa(B), U = new ps(), W = new Es(B, V, H, U, Me, Ze, Ne), Pe = new Ba(A), Fe = new Ea(B), Qe = new Oa(B, Fe), Le = new Ha(B, Fe, Ne, Qe), Be = new Ka(B, Le, Fe, Qe, Ne), Je = new Ga(B, Me, W), Ge = new ja(U), Ve = new fs(A, Pe, V, Me, Qe, Ge), He = new Os(A, U), Ue = new _s(), We = new Cs(V), qe = new Da(A, Pe, H, Be, v, d), Ke = new ws(A, Be, Me), $e = new ks(B, Ne, Me, H), Ye = new ka(B, V, Ne), Xe = new Ua(B, V, Ne), Ne.programs = Ve.programs, A.capabilities = Me, A.extensions = V, A.properties = U, A.renderLists = Ue, A.shadowMap = Ke, A.state = H, A.info = Ne;
10386
+ V = new Ba(B), V.init(), Ze = new Es(B, V), Me = new ka(B, V, e, Ze), H = new ws(B, V), Me.reversedDepthBuffer && g && H.buffers.depth.setReversed(!0), ee = B.createFramebuffer(), N = B.createFramebuffer(), te = B.createFramebuffer(), Ne = new Ua(B), U = new fs(), W = new Ts(B, V, H, U, Me, Ze, Ne), Pe = new za(A), Fe = new Ta(B), Qe = new Da(B, Fe), Le = new Va(B, Fe, Ne, Qe), Be = new Ga(B, Le, Fe, Qe, Ne), Je = new Wa(B, Me, W), Ge = new Aa(U), Ve = new ds(A, Pe, V, Me, Qe, Ge), He = new Ds(A, U), Ue = new gs(), We = new Ss(V), qe = new Ea(A, Pe, H, Be, v, d), Ke = new Cs(A, Be, Me), $e = new Os(B, Ne, Me, H), Ye = new Oa(B, V, Ne), Xe = new Ha(B, V, Ne), Ne.programs = Ve.programs, A.capabilities = Me, A.extensions = V, A.properties = U, A.renderLists = Ue, A.shadowMap = Ke, A.state = H, A.info = Ne;
10409
10387
  }
10410
- et(), y !== 1009 && (k = new qa(y, t.width, t.height, c, r, i));
10411
- let tt = new Ic(A, B);
10388
+ et(), y !== 1009 && (k = new Ka(y, t.width, t.height, c, r, i));
10389
+ let tt = new Fc(A, B);
10412
10390
  this.xr = tt, this.getContext = function() {
10413
10391
  return B;
10414
10392
  }, this.getContextAttributes = function() {
@@ -10597,7 +10575,7 @@ var Q, $, js, Ms, Ns, Ps, Fs, Is, Ls, Rs, zs, Bs, Vs, Hs, Us, Ws, Gs, Ks, qs, Js
10597
10575
  function ft() {
10598
10576
  pt.start();
10599
10577
  }
10600
- let pt = new Ta();
10578
+ let pt = new wa();
10601
10579
  pt.setAnimationLoop(ut), typeof self < "u" && pt.setContext(self), this.setAnimationLoop = function(e) {
10602
10580
  lt = e, tt.setAnimationLoop(e), e === null ? pt.stop() : pt.start();
10603
10581
  }, tt.addEventListener("sessionstart", dt), tt.addEventListener("sessionend", ft), this.render = function(e, t) {
@@ -10723,7 +10701,7 @@ var Q, $, js, Ms, Ns, Ps, Fs, Is, Ls, Rs, zs, Bs, Vs, Hs, Us, Ws, Gs, Ks, qs, Js
10723
10701
  function bt(e) {
10724
10702
  if (e.uniformsList === null) {
10725
10703
  let t = e.currentProgram.getUniforms();
10726
- e.uniformsList = lc.seqWithValue(t.seq, e.uniforms);
10704
+ e.uniformsList = cc.seqWithValue(t.seq, e.uniforms);
10727
10705
  }
10728
10706
  return e.uniformsList;
10729
10707
  }
@@ -10771,14 +10749,14 @@ var Q, $, js, Ms, Ns, Ps, Fs, Is, Ls, Rs, zs, Bs, Vs, Hs, Us, Ws, Gs, Ks, qs, Js
10771
10749
  }
10772
10750
  i.isBatchedMesh && (T.setOptional(B, i, "batchingTexture"), T.setValue(B, "batchingTexture", i._matricesTexture, W), T.setOptional(B, i, "batchingIdTexture"), T.setValue(B, "batchingIdTexture", i._indirectTexture, W), T.setOptional(B, i, "batchingColorTexture"), i._colorsTexture !== null && T.setValue(B, "batchingColorTexture", i._colorsTexture, W));
10773
10751
  let O = n.morphAttributes;
10774
- if ((O.position !== void 0 || O.normal !== void 0 || O.color !== void 0) && Je.update(i, n, x), (C || v.receiveShadow !== i.receiveShadow) && (v.receiveShadow = i.receiveShadow, T.setValue(B, "receiveShadow", i.receiveShadow)), (r.isMeshStandardMaterial || r.isMeshLambertMaterial || r.isMeshPhongMaterial) && r.envMap === null && t.environment !== null && (D.envMapIntensity.value = t.environmentIntensity), D.dfgLUT !== void 0 && (D.dfgLUT.value = As()), C) {
10752
+ if ((O.position !== void 0 || O.normal !== void 0 || O.color !== void 0) && Je.update(i, n, x), (C || v.receiveShadow !== i.receiveShadow) && (v.receiveShadow = i.receiveShadow, T.setValue(B, "receiveShadow", i.receiveShadow)), (r.isMeshStandardMaterial || r.isMeshLambertMaterial || r.isMeshPhongMaterial) && r.envMap === null && t.environment !== null && (D.envMapIntensity.value = t.environmentIntensity), D.dfgLUT !== void 0 && (D.dfgLUT.value = ks()), C) {
10775
10753
  if (T.setValue(B, "toneMappingExposure", A.toneMappingExposure), v.needsLights && wt(D, w), a && r.fog === !0 && He.refreshFogUniforms(D, a), He.refreshMaterialUniforms(D, r, R, le, E.state.transmissionRenderTarget[e.id]), v.needsLights && v.lightProbeGrid) {
10776
10754
  let e = v.lightProbeGrid;
10777
10755
  D.probesSH.value = e.texture, D.probesMin.value.copy(e.boundingBox.min), D.probesMax.value.copy(e.boundingBox.max), D.probesResolution.value.copy(e.resolution);
10778
10756
  }
10779
- lc.upload(B, bt(v), D, W);
10757
+ cc.upload(B, bt(v), D, W);
10780
10758
  }
10781
- if (r.isShaderMaterial && r.uniformsNeedUpdate === !0 && (lc.upload(B, bt(v), D, W), r.uniformsNeedUpdate = !1), r.isSpriteMaterial && T.setValue(B, "center", i.center), T.setValue(B, "modelViewMatrix", i.modelViewMatrix), T.setValue(B, "normalMatrix", i.normalMatrix), T.setValue(B, "modelMatrix", i.matrixWorld), r.uniformsGroups !== void 0) {
10759
+ if (r.isShaderMaterial && r.uniformsNeedUpdate === !0 && (cc.upload(B, bt(v), D, W), r.uniformsNeedUpdate = !1), r.isSpriteMaterial && T.setValue(B, "center", i.center), T.setValue(B, "modelViewMatrix", i.modelViewMatrix), T.setValue(B, "normalMatrix", i.normalMatrix), T.setValue(B, "modelMatrix", i.matrixWorld), r.uniformsGroups !== void 0) {
10782
10760
  let e = r.uniformsGroups;
10783
10761
  for (let t = 0, n = e.length; t < n; t++) {
10784
10762
  let n = e[t];
@@ -10928,8 +10906,8 @@ var Q, $, js, Ms, Ns, Ps, Fs, Is, Ls, Rs, zs, Bs, Vs, Hs, Us, Ws, Gs, Ks, qs, Js
10928
10906
  t.drawingBufferColorSpace = J._getDrawingBufferColorSpace(e), t.unpackColorSpace = J._getUnpackColorSpace();
10929
10907
  }
10930
10908
  };
10931
- })), Uc, Wc = t((() => {
10932
- Uc = {
10909
+ })), Hc, Uc = t((() => {
10910
+ Hc = {
10933
10911
  name: "CopyShader",
10934
10912
  uniforms: {
10935
10913
  tDiffuse: { value: null },
@@ -10938,8 +10916,8 @@ var Q, $, js, Ms, Ns, Ps, Fs, Is, Ls, Rs, zs, Bs, Vs, Hs, Us, Ws, Gs, Ks, qs, Js
10938
10916
  vertexShader: "\n\n varying vec2 vUv;\n\n void main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }",
10939
10917
  fragmentShader: "\n\n uniform float opacity;\n\n uniform sampler2D tDiffuse;\n\n varying vec2 vUv;\n\n void main() {\n\n vec4 texel = texture2D( tDiffuse, vUv );\n gl_FragColor = opacity * texel;\n\n\n }"
10940
10918
  };
10941
- })), Gc, Kc, qc, Jc, Yc, Xc = t((() => {
10942
- Hc(), Gc = class {
10919
+ })), Wc, Gc, Kc, qc, Jc, Yc = t((() => {
10920
+ Vc(), Wc = class {
10943
10921
  constructor() {
10944
10922
  this.isPass = !0, this.enabled = !0, this.needsSwap = !0, this.clear = !1, this.renderToScreen = !1;
10945
10923
  }
@@ -10948,7 +10926,7 @@ var Q, $, js, Ms, Ns, Ps, Fs, Is, Ls, Rs, zs, Bs, Vs, Hs, Us, Ws, Gs, Ks, qs, Js
10948
10926
  console.error("THREE.Pass: .render() must be implemented in derived pass.");
10949
10927
  }
10950
10928
  dispose() {}
10951
- }, Kc = new oa(-1, 1, 1, -1, 0, 1), qc = class extends Rr {
10929
+ }, Gc = new oa(-1, 1, 1, -1, 0, 1), Kc = class extends Rr {
10952
10930
  constructor() {
10953
10931
  super(), this.setAttribute("position", new Er([
10954
10932
  -1,
@@ -10969,15 +10947,15 @@ var Q, $, js, Ms, Ns, Ps, Fs, Is, Ls, Rs, zs, Bs, Vs, Hs, Us, Ws, Gs, Ks, qs, Js
10969
10947
  0
10970
10948
  ], 2));
10971
10949
  }
10972
- }, Jc = new qc(), Yc = class {
10950
+ }, qc = new Kc(), Jc = class {
10973
10951
  constructor(e) {
10974
- this._mesh = new si(Jc, e);
10952
+ this._mesh = new si(qc, e);
10975
10953
  }
10976
10954
  dispose() {
10977
10955
  this._mesh.geometry.dispose();
10978
10956
  }
10979
10957
  render(e) {
10980
- e.render(this._mesh, Kc);
10958
+ e.render(this._mesh, Gc);
10981
10959
  }
10982
10960
  get material() {
10983
10961
  return this._mesh.material;
@@ -10986,8 +10964,8 @@ var Q, $, js, Ms, Ns, Ps, Fs, Is, Ls, Rs, zs, Bs, Vs, Hs, Us, Ws, Gs, Ks, qs, Js
10986
10964
  this._mesh.material = e;
10987
10965
  }
10988
10966
  };
10989
- })), Zc, Qc = t((() => {
10990
- Hc(), Xc(), Zc = class extends Gc {
10967
+ })), Xc, Zc = t((() => {
10968
+ Vc(), Yc(), Xc = class extends Wc {
10991
10969
  constructor(e, t = "tDiffuse") {
10992
10970
  super(), this.textureID = t, this.uniforms = null, this.material = null, e instanceof Oi ? (this.uniforms = e.uniforms, this.material = e) : e && (this.uniforms = Ti.clone(e.uniforms), this.material = new Oi({
10993
10971
  name: e.name === void 0 ? "unspecified" : e.name,
@@ -10995,7 +10973,7 @@ var Q, $, js, Ms, Ns, Ps, Fs, Is, Ls, Rs, zs, Bs, Vs, Hs, Us, Ws, Gs, Ks, qs, Js
10995
10973
  uniforms: this.uniforms,
10996
10974
  vertexShader: e.vertexShader,
10997
10975
  fragmentShader: e.fragmentShader
10998
- })), this._fsQuad = new Yc(this.material);
10976
+ })), this._fsQuad = new Jc(this.material);
10999
10977
  }
11000
10978
  render(e, t, n) {
11001
10979
  this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = n.texture), this._fsQuad.material = this.material, this.renderToScreen ? (e.setRenderTarget(null), this._fsQuad.render(e)) : (e.setRenderTarget(t), this.clear && e.clear(e.autoClearColor, e.autoClearDepth, e.autoClearStencil), this._fsQuad.render(e));
@@ -11004,8 +10982,8 @@ var Q, $, js, Ms, Ns, Ps, Fs, Is, Ls, Rs, zs, Bs, Vs, Hs, Us, Ws, Gs, Ks, qs, Js
11004
10982
  this.material.dispose(), this._fsQuad.dispose();
11005
10983
  }
11006
10984
  };
11007
- })), $c, el, tl = t((() => {
11008
- Xc(), $c = class extends Gc {
10985
+ })), Qc, $c, el = t((() => {
10986
+ Yc(), Qc = class extends Wc {
11009
10987
  constructor(e, t) {
11010
10988
  super(), this.scene = e, this.camera = t, this.clear = !0, this.needsSwap = !1, this.inverse = !1;
11011
10989
  }
@@ -11015,7 +10993,7 @@ var Q, $, js, Ms, Ns, Ps, Fs, Is, Ls, Rs, zs, Bs, Vs, Hs, Us, Ws, Gs, Ks, qs, Js
11015
10993
  let a, o;
11016
10994
  this.inverse ? (a = 0, o = 1) : (a = 1, o = 0), i.buffers.stencil.setTest(!0), i.buffers.stencil.setOp(r.REPLACE, r.REPLACE, r.REPLACE), i.buffers.stencil.setFunc(r.ALWAYS, a, 4294967295), i.buffers.stencil.setClear(o), i.buffers.stencil.setLocked(!0), e.setRenderTarget(n), this.clear && e.clear(), e.render(this.scene, this.camera), e.setRenderTarget(t), this.clear && e.clear(), e.render(this.scene, this.camera), i.buffers.color.setLocked(!1), i.buffers.depth.setLocked(!1), i.buffers.color.setMask(!0), i.buffers.depth.setMask(!0), i.buffers.stencil.setLocked(!1), i.buffers.stencil.setFunc(r.EQUAL, 1, 4294967295), i.buffers.stencil.setOp(r.KEEP, r.KEEP, r.KEEP), i.buffers.stencil.setLocked(!0);
11017
10995
  }
11018
- }, el = class extends Gc {
10996
+ }, $c = class extends Wc {
11019
10997
  constructor() {
11020
10998
  super(), this.needsSwap = !1;
11021
10999
  }
@@ -11023,14 +11001,14 @@ var Q, $, js, Ms, Ns, Ps, Fs, Is, Ls, Rs, zs, Bs, Vs, Hs, Us, Ws, Gs, Ks, qs, Js
11023
11001
  e.state.buffers.stencil.setLocked(!1), e.state.buffers.stencil.setTest(!1);
11024
11002
  }
11025
11003
  };
11026
- })), nl, rl = t((() => {
11027
- Hc(), Wc(), Qc(), tl(), nl = class {
11004
+ })), tl, nl = t((() => {
11005
+ Vc(), Uc(), Zc(), el(), tl = class {
11028
11006
  constructor(e, t) {
11029
11007
  if (this.renderer = e, this._pixelRatio = e.getPixelRatio(), t === void 0) {
11030
11008
  let n = e.getSize(new G());
11031
11009
  this._width = n.width, this._height = n.height, t = new sn(this._width * this._pixelRatio, this._height * this._pixelRatio, { type: Oe }), t.texture.name = "EffectComposer.rt1";
11032
11010
  } else this._width = t.width, this._height = t.height;
11033
- this.renderTarget1 = t, this.renderTarget2 = t.clone(), this.renderTarget2.texture.name = "EffectComposer.rt2", this.writeBuffer = this.renderTarget1, this.readBuffer = this.renderTarget2, this.renderToScreen = !0, this.passes = [], this.copyPass = new Zc(Uc), this.copyPass.material.blending = 0, this.timer = new da();
11011
+ this.renderTarget1 = t, this.renderTarget2 = t.clone(), this.renderTarget2.texture.name = "EffectComposer.rt2", this.writeBuffer = this.renderTarget1, this.readBuffer = this.renderTarget2, this.renderToScreen = !0, this.passes = [], this.copyPass = new Xc(Hc), this.copyPass.material.blending = 0, this.timer = new da();
11034
11012
  }
11035
11013
  swapBuffers() {
11036
11014
  let e = this.readBuffer;
@@ -11063,7 +11041,7 @@ var Q, $, js, Ms, Ns, Ps, Fs, Is, Ls, Rs, zs, Bs, Vs, Hs, Us, Ws, Gs, Ks, qs, Js
11063
11041
  }
11064
11042
  this.swapBuffers();
11065
11043
  }
11066
- $c !== void 0 && (r instanceof $c ? n = !0 : r instanceof el && (n = !1));
11044
+ Qc !== void 0 && (r instanceof Qc ? n = !0 : r instanceof $c && (n = !1));
11067
11045
  }
11068
11046
  }
11069
11047
  this.renderer.setRenderTarget(t);
@@ -11088,8 +11066,8 @@ var Q, $, js, Ms, Ns, Ps, Fs, Is, Ls, Rs, zs, Bs, Vs, Hs, Us, Ws, Gs, Ks, qs, Js
11088
11066
  this.renderTarget1.dispose(), this.renderTarget2.dispose(), this.copyPass.dispose();
11089
11067
  }
11090
11068
  };
11091
- })), il, al = t((() => {
11092
- Hc(), Xc(), il = class extends Gc {
11069
+ })), rl, il = t((() => {
11070
+ Vc(), Yc(), rl = class extends Wc {
11093
11071
  constructor(e, t, n = null, r = null, i = null) {
11094
11072
  super(), this.scene = e, this.camera = t, this.overrideMaterial = n, this.clearColor = r, this.clearAlpha = i, this.clear = !0, this.clearDepth = !1, this.needsSwap = !1, this.isRenderPass = !0, this._oldClearColor = new X();
11095
11073
  }
@@ -11100,8 +11078,8 @@ var Q, $, js, Ms, Ns, Ps, Fs, Is, Ls, Rs, zs, Bs, Vs, Hs, Us, Ws, Gs, Ks, qs, Js
11100
11078
  this.overrideMaterial !== null && (a = this.scene.overrideMaterial, this.scene.overrideMaterial = this.overrideMaterial), this.clearColor !== null && (e.getClearColor(this._oldClearColor), e.setClearColor(this.clearColor, e.getClearAlpha())), this.clearAlpha !== null && (i = e.getClearAlpha(), e.setClearAlpha(this.clearAlpha)), this.clearDepth == 1 && e.clearDepth(), e.setRenderTarget(this.renderToScreen ? null : n), this.clear === !0 && e.clear(e.autoClearColor, e.autoClearDepth, e.autoClearStencil), e.render(this.scene, this.camera), this.clearColor !== null && e.setClearColor(this._oldClearColor), this.clearAlpha !== null && e.setClearAlpha(i), this.overrideMaterial !== null && (this.scene.overrideMaterial = a), e.autoClear = r;
11101
11079
  }
11102
11080
  };
11103
- })), ol, sl = t((() => {
11104
- ol = {
11081
+ })), al, ol = t((() => {
11082
+ al = {
11105
11083
  name: "OutputShader",
11106
11084
  uniforms: {
11107
11085
  tDiffuse: { value: null },
@@ -11110,15 +11088,15 @@ var Q, $, js, Ms, Ns, Ps, Fs, Is, Ls, Rs, zs, Bs, Vs, Hs, Us, Ws, Gs, Ks, qs, Js
11110
11088
  vertexShader: "\n precision highp float;\n\n uniform mat4 modelViewMatrix;\n uniform mat4 projectionMatrix;\n\n attribute vec3 position;\n attribute vec2 uv;\n\n varying vec2 vUv;\n\n void main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }",
11111
11089
  fragmentShader: "\n\n precision highp float;\n\n uniform sampler2D tDiffuse;\n\n #include <tonemapping_pars_fragment>\n #include <colorspace_pars_fragment>\n\n varying vec2 vUv;\n\n void main() {\n\n gl_FragColor = texture2D( tDiffuse, vUv );\n\n // tone mapping\n\n #ifdef LINEAR_TONE_MAPPING\n\n gl_FragColor.rgb = LinearToneMapping( gl_FragColor.rgb );\n\n #elif defined( REINHARD_TONE_MAPPING )\n\n gl_FragColor.rgb = ReinhardToneMapping( gl_FragColor.rgb );\n\n #elif defined( CINEON_TONE_MAPPING )\n\n gl_FragColor.rgb = CineonToneMapping( gl_FragColor.rgb );\n\n #elif defined( ACES_FILMIC_TONE_MAPPING )\n\n gl_FragColor.rgb = ACESFilmicToneMapping( gl_FragColor.rgb );\n\n #elif defined( AGX_TONE_MAPPING )\n\n gl_FragColor.rgb = AgXToneMapping( gl_FragColor.rgb );\n\n #elif defined( NEUTRAL_TONE_MAPPING )\n\n gl_FragColor.rgb = NeutralToneMapping( gl_FragColor.rgb );\n\n #elif defined( CUSTOM_TONE_MAPPING )\n\n gl_FragColor.rgb = CustomToneMapping( gl_FragColor.rgb );\n\n #endif\n\n // color space\n\n #ifdef SRGB_TRANSFER\n\n gl_FragColor = sRGBTransferOETF( gl_FragColor );\n\n #endif\n\n }"
11112
11090
  };
11113
- })), cl, ll = t((() => {
11114
- Hc(), Xc(), sl(), cl = class extends Gc {
11091
+ })), sl, cl = t((() => {
11092
+ Vc(), Yc(), ol(), sl = class extends Wc {
11115
11093
  constructor() {
11116
- super(), this.isOutputPass = !0, this.uniforms = Ti.clone(ol.uniforms), this.material = new ki({
11117
- name: ol.name,
11094
+ super(), this.isOutputPass = !0, this.uniforms = Ti.clone(al.uniforms), this.material = new ki({
11095
+ name: al.name,
11118
11096
  uniforms: this.uniforms,
11119
- vertexShader: ol.vertexShader,
11120
- fragmentShader: ol.fragmentShader
11121
- }), this._fsQuad = new Yc(this.material), this._outputColorSpace = null, this._toneMapping = null;
11097
+ vertexShader: al.vertexShader,
11098
+ fragmentShader: al.fragmentShader
11099
+ }), this._fsQuad = new Jc(this.material), this._outputColorSpace = null, this._toneMapping = null;
11122
11100
  }
11123
11101
  render(e, t, n) {
11124
11102
  this.uniforms.tDiffuse.value = n.texture, this.uniforms.toneMappingExposure.value = e.toneMappingExposure, (this._outputColorSpace !== e.outputColorSpace || this._toneMapping !== e.toneMapping) && (this._outputColorSpace = e.outputColorSpace, this._toneMapping = e.toneMapping, this.material.defines = {}, J.getTransfer(this._outputColorSpace) === "srgb" && (this.material.defines.SRGB_TRANSFER = ""), this._toneMapping === 1 ? this.material.defines.LINEAR_TONE_MAPPING = "" : this._toneMapping === 2 ? this.material.defines.REINHARD_TONE_MAPPING = "" : this._toneMapping === 3 ? this.material.defines.CINEON_TONE_MAPPING = "" : this._toneMapping === 4 ? this.material.defines.ACES_FILMIC_TONE_MAPPING = "" : this._toneMapping === 6 ? this.material.defines.AGX_TONE_MAPPING = "" : this._toneMapping === 7 ? this.material.defines.NEUTRAL_TONE_MAPPING = "" : this._toneMapping === 5 && (this.material.defines.CUSTOM_TONE_MAPPING = ""), this.material.needsUpdate = !0), this.renderToScreen === !0 ? (e.setRenderTarget(null), this._fsQuad.render(e)) : (e.setRenderTarget(t), this.clear && e.clear(e.autoClearColor, e.autoClearDepth, e.autoClearStencil), this._fsQuad.render(e));
@@ -11127,8 +11105,8 @@ var Q, $, js, Ms, Ns, Ps, Fs, Is, Ls, Rs, zs, Bs, Vs, Hs, Us, Ws, Gs, Ks, qs, Js
11127
11105
  this.material.dispose(), this._fsQuad.dispose();
11128
11106
  }
11129
11107
  };
11130
- })), ul, dl = t((() => {
11131
- Hc(), ul = {
11108
+ })), ll, ul = t((() => {
11109
+ Vc(), ll = {
11132
11110
  name: "LuminosityHighPassShader",
11133
11111
  uniforms: {
11134
11112
  tDiffuse: { value: null },
@@ -11140,8 +11118,8 @@ var Q, $, js, Ms, Ns, Ps, Fs, Is, Ls, Rs, zs, Bs, Vs, Hs, Us, Ws, Gs, Ks, qs, Js
11140
11118
  vertexShader: "\n\n varying vec2 vUv;\n\n void main() {\n\n vUv = uv;\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }",
11141
11119
  fragmentShader: "\n\n uniform sampler2D tDiffuse;\n uniform vec3 defaultColor;\n uniform float defaultOpacity;\n uniform float luminosityThreshold;\n uniform float smoothWidth;\n\n varying vec2 vUv;\n\n void main() {\n\n vec4 texel = texture2D( tDiffuse, vUv );\n\n float v = luminance( texel.xyz );\n\n vec4 outputColor = vec4( defaultColor.rgb, defaultOpacity );\n\n float alpha = smoothstep( luminosityThreshold, luminosityThreshold + smoothWidth, v );\n\n gl_FragColor = mix( outputColor, texel, alpha );\n\n }"
11142
11120
  };
11143
- })), fl, pl = t((() => {
11144
- Hc(), Xc(), Wc(), dl(), fl = class e extends Gc {
11121
+ })), dl, fl = t((() => {
11122
+ Vc(), Yc(), Uc(), ul(), dl = class e extends Wc {
11145
11123
  constructor(e, t = 1, n, r) {
11146
11124
  super(), this.strength = t, this.radius = n, this.threshold = r, this.resolution = e === void 0 ? new G(256, 256) : new G(e.x, e.y), this.clearColor = new X(0, 0, 0), this.needsSwap = !1, this.renderTargetsHorizontal = [], this.renderTargetsVertical = [], this.nMips = 5;
11147
11125
  let i = Math.round(this.resolution.x / 2), a = Math.round(this.resolution.y / 2);
@@ -11152,7 +11130,7 @@ var Q, $, js, Ms, Ns, Ps, Fs, Is, Ls, Rs, zs, Bs, Vs, Hs, Us, Ws, Gs, Ks, qs, Js
11152
11130
  let n = new sn(i, a, { type: Oe });
11153
11131
  n.texture.name = "UnrealBloomPass.v" + e, n.texture.generateMipmaps = !1, this.renderTargetsVertical.push(n), i = Math.round(i / 2), a = Math.round(a / 2);
11154
11132
  }
11155
- let o = ul;
11133
+ let o = ll;
11156
11134
  this.highPassUniforms = Ti.clone(o.uniforms), this.highPassUniforms.luminosityThreshold.value = r, this.highPassUniforms.smoothWidth.value = .01, this.materialHighPassFilter = new Oi({
11157
11135
  uniforms: this.highPassUniforms,
11158
11136
  vertexShader: o.vertexShader,
@@ -11181,16 +11159,16 @@ var Q, $, js, Ms, Ns, Ps, Fs, Is, Ls, Rs, zs, Bs, Vs, Hs, Us, Ws, Gs, Ks, qs, Js
11181
11159
  new K(1, 1, 1),
11182
11160
  new K(1, 1, 1),
11183
11161
  new K(1, 1, 1)
11184
- ], this.compositeMaterial.uniforms.bloomTintColors.value = this.bloomTintColors, this.copyUniforms = Ti.clone(Uc.uniforms), this.blendMaterial = new Oi({
11162
+ ], this.compositeMaterial.uniforms.bloomTintColors.value = this.bloomTintColors, this.copyUniforms = Ti.clone(Hc.uniforms), this.blendMaterial = new Oi({
11185
11163
  uniforms: this.copyUniforms,
11186
- vertexShader: Uc.vertexShader,
11187
- fragmentShader: Uc.fragmentShader,
11164
+ vertexShader: Hc.vertexShader,
11165
+ fragmentShader: Hc.fragmentShader,
11188
11166
  premultipliedAlpha: !0,
11189
11167
  blending: 2,
11190
11168
  depthTest: !1,
11191
11169
  depthWrite: !1,
11192
11170
  transparent: !0
11193
- }), this._oldClearColor = new X(), this._oldClearAlpha = 1, this._basic = new Yr(), this._fsQuad = new Yc(null);
11171
+ }), this._oldClearColor = new X(), this._oldClearAlpha = 1, this._basic = new Yr(), this._fsQuad = new Jc(null);
11194
11172
  }
11195
11173
  dispose() {
11196
11174
  for (let e = 0; e < this.renderTargetsHorizontal.length; e++) this.renderTargetsHorizontal[e].dispose();
@@ -11245,20 +11223,20 @@ var Q, $, js, Ms, Ns, Ps, Fs, Is, Ls, Rs, zs, Bs, Vs, Hs, Us, Ws, Gs, Ks, qs, Js
11245
11223
  fragmentShader: "\n\n varying vec2 vUv;\n\n uniform sampler2D blurTexture1;\n uniform sampler2D blurTexture2;\n uniform sampler2D blurTexture3;\n uniform sampler2D blurTexture4;\n uniform sampler2D blurTexture5;\n uniform float bloomStrength;\n uniform float bloomRadius;\n uniform float bloomFactors[NUM_MIPS];\n uniform vec3 bloomTintColors[NUM_MIPS];\n\n float lerpBloomFactor( const in float factor ) {\n\n float mirrorFactor = 1.2 - factor;\n return mix( factor, mirrorFactor, bloomRadius );\n\n }\n\n void main() {\n\n // 3.0 for backwards compatibility with previous alpha-based intensity\n vec3 bloom = 3.0 * bloomStrength * (\n lerpBloomFactor( bloomFactors[ 0 ] ) * bloomTintColors[ 0 ] * texture2D( blurTexture1, vUv ).rgb +\n lerpBloomFactor( bloomFactors[ 1 ] ) * bloomTintColors[ 1 ] * texture2D( blurTexture2, vUv ).rgb +\n lerpBloomFactor( bloomFactors[ 2 ] ) * bloomTintColors[ 2 ] * texture2D( blurTexture3, vUv ).rgb +\n lerpBloomFactor( bloomFactors[ 3 ] ) * bloomTintColors[ 3 ] * texture2D( blurTexture4, vUv ).rgb +\n lerpBloomFactor( bloomFactors[ 4 ] ) * bloomTintColors[ 4 ] * texture2D( blurTexture5, vUv ).rgb\n );\n\n float bloomAlpha = max( bloom.r, max( bloom.g, bloom.b ) );\n gl_FragColor = vec4( bloom, bloomAlpha );\n\n }"
11246
11224
  });
11247
11225
  }
11248
- }, fl.BlurDirectionX = new G(1, 0), fl.BlurDirectionY = new G(0, 1);
11226
+ }, dl.BlurDirectionX = new G(1, 0), dl.BlurDirectionY = new G(0, 1);
11249
11227
  }));
11250
11228
  //#endregion
11251
11229
  //#region src/util/math.ts
11252
- function ml(e, t, n) {
11230
+ function pl(e, t, n) {
11253
11231
  return Math.min(n, Math.max(t, e));
11254
11232
  }
11255
- function hl(e) {
11256
- return ml(e, 0, 1);
11233
+ function ml(e) {
11234
+ return pl(e, 0, 1);
11257
11235
  }
11258
- var gl = t((() => {}));
11236
+ var hl = t((() => {}));
11259
11237
  //#endregion
11260
11238
  //#region src/config/model.ts
11261
- function _l(e = {
11239
+ function gl(e = {
11262
11240
  x: 300,
11263
11241
  y: 500,
11264
11242
  z: 800
@@ -11269,7 +11247,7 @@ function _l(e = {
11269
11247
  intensity: t
11270
11248
  };
11271
11249
  }
11272
- function vl() {
11250
+ function _l() {
11273
11251
  return {
11274
11252
  startX: 0,
11275
11253
  endX: .5,
@@ -11282,14 +11260,14 @@ function vl() {
11282
11260
  parabolaPower: 2
11283
11261
  };
11284
11262
  }
11285
- function yl(e) {
11263
+ function vl(e) {
11286
11264
  let t = e.length;
11287
11265
  return e.map((e, n) => ({
11288
11266
  color: e,
11289
11267
  pos: t > 1 ? n / (t - 1) : 0
11290
11268
  }));
11291
11269
  }
11292
- function bl() {
11270
+ function yl() {
11293
11271
  return [
11294
11272
  {
11295
11273
  color: "#5e5ce6",
@@ -11323,7 +11301,7 @@ function bl() {
11323
11301
  }
11324
11302
  ];
11325
11303
  }
11326
- function xl(e, t) {
11304
+ function bl(e, t) {
11327
11305
  if (t <= 1) return [structuredClone(e)];
11328
11306
  let n = [];
11329
11307
  for (let r = 0; r < t; r++) {
@@ -11344,7 +11322,7 @@ function xl(e, t) {
11344
11322
  }
11345
11323
  return n;
11346
11324
  }
11347
- function Sl() {
11325
+ function xl() {
11348
11326
  return {
11349
11327
  palette: [
11350
11328
  {
@@ -11383,7 +11361,7 @@ function Sl() {
11383
11361
  gradientType: "linear",
11384
11362
  gradientAngle: 90,
11385
11363
  gradientShift: .15,
11386
- meshGradientPoints: bl(),
11364
+ meshGradientPoints: yl(),
11387
11365
  meshGradientSoftness: .62,
11388
11366
  usePaletteTexture: !0,
11389
11367
  paletteSource: "hero",
@@ -11461,21 +11439,21 @@ function Sl() {
11461
11439
  seed: 0
11462
11440
  };
11463
11441
  }
11464
- function Cl() {
11465
- return Sl();
11442
+ function Sl() {
11443
+ return xl();
11466
11444
  }
11467
- function wl(e) {
11445
+ function Cl(e) {
11468
11446
  let t = Math.max(1, Math.round(e.waveCount) || 1);
11469
- for ((!Array.isArray(e.waves) || e.waves.length === 0) && (e.waves = [Cl()]); e.waves.length < t;) e.waves.push(structuredClone(e.waves[e.waves.length - 1]));
11447
+ for ((!Array.isArray(e.waves) || e.waves.length === 0) && (e.waves = [Sl()]); e.waves.length < t;) e.waves.push(structuredClone(e.waves[e.waves.length - 1]));
11470
11448
  for (; e.waves.length > t;) e.waves.pop();
11471
11449
  e.waveCount = e.waves.length;
11472
11450
  }
11473
- function Tl() {
11451
+ function wl() {
11474
11452
  return {
11475
11453
  background: "#ffffff",
11476
11454
  transparentBackground: !0,
11477
11455
  backgroundMode: "color",
11478
- backgroundPalette: yl([
11456
+ backgroundPalette: vl([
11479
11457
  "#0a2540",
11480
11458
  "#425466",
11481
11459
  "#7a73ff",
@@ -11484,7 +11462,7 @@ function Tl() {
11484
11462
  backgroundGradientType: "linear",
11485
11463
  backgroundGradientAngle: 135,
11486
11464
  backgroundGradientSource: "stops",
11487
- backgroundMeshPoints: bl(),
11465
+ backgroundMeshPoints: yl(),
11488
11466
  backgroundMeshSoftness: .62,
11489
11467
  backgroundImageSource: "vaporwave",
11490
11468
  backgroundImageFit: "cover",
@@ -11519,50 +11497,50 @@ function Tl() {
11519
11497
  lights: [],
11520
11498
  mirrorH: !1,
11521
11499
  mirrorV: !1,
11522
- waves: [Sl()]
11500
+ waves: [xl()]
11523
11501
  };
11524
11502
  }
11525
- function El(e) {
11503
+ function Tl(e) {
11526
11504
  let t = e.palette;
11527
- t.length > 0 && typeof t[0] == "string" && (e.palette = yl(t)), e.gradientType !== "radial" && e.gradientType !== "conic" && e.gradientType !== "mesh" && e.gradientType !== "linear" && (e.gradientType = "linear");
11505
+ 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");
11528
11506
  let n = e.meshGradientPoints;
11529
- if (!Array.isArray(n) || n.length < 2) e.meshGradientPoints = bl();
11507
+ if (!Array.isArray(n) || n.length < 2) e.meshGradientPoints = yl();
11530
11508
  else {
11531
- let t = bl();
11509
+ let t = yl();
11532
11510
  e.meshGradientPoints = n.slice(0, 8).map((e, n) => {
11533
11511
  let r = t[n] ?? t[t.length - 1], i = Number(e.x), a = Number(e.y), o = Number(e.influence);
11534
11512
  return {
11535
11513
  color: typeof e.color == "string" ? e.color : r.color,
11536
- x: hl(Number.isFinite(i) ? i : r.x),
11537
- y: hl(Number.isFinite(a) ? a : r.y),
11538
- influence: ml(Number.isFinite(o) ? o : r.influence, .15, 1.5)
11514
+ x: ml(Number.isFinite(i) ? i : r.x),
11515
+ y: ml(Number.isFinite(a) ? a : r.y),
11516
+ influence: pl(Number.isFinite(o) ? o : r.influence, .15, 1.5)
11539
11517
  };
11540
11518
  });
11541
11519
  }
11542
- Number.isFinite(e.meshGradientSoftness) || (e.meshGradientSoftness = .62), e.meshGradientSoftness = hl(e.meshGradientSoftness), e.paletteTextureScale ||= {
11520
+ Number.isFinite(e.meshGradientSoftness) || (e.meshGradientSoftness = .62), e.meshGradientSoftness = ml(e.meshGradientSoftness), e.paletteTextureScale ||= {
11543
11521
  x: 1,
11544
11522
  y: 1
11545
11523
  }, e.paletteTextureOffset ||= {
11546
11524
  x: 0,
11547
11525
  y: 0
11548
- }, e.paletteTextureScale.x = ml(Number(e.paletteTextureScale.x) || 1, .1, 8), e.paletteTextureScale.y = ml(Number(e.paletteTextureScale.y) || 1, .1, 8), e.paletteTextureOffset.x = ml(Number(e.paletteTextureOffset.x) || 0, -4, 4), e.paletteTextureOffset.y = ml(Number(e.paletteTextureOffset.y) || 0, -4, 4), e.paletteTextureRotation = ml(Number(e.paletteTextureRotation) || 0, -180, 180);
11526
+ }, 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);
11549
11527
  }
11550
- function Dl(e) {
11528
+ function El(e) {
11551
11529
  e.backgroundMode !== "gradient" && e.backgroundMode !== "image" && e.backgroundMode !== "color" && (e.backgroundMode = "color");
11552
11530
  let t = e.backgroundPalette;
11553
- !t || t.length < 2 ? e.backgroundPalette = yl([
11531
+ !t || t.length < 2 ? e.backgroundPalette = vl([
11554
11532
  "#0a2540",
11555
11533
  "#425466",
11556
11534
  "#7a73ff",
11557
11535
  "#f6f9fc"
11558
- ]) : typeof t[0] == "string" && (e.backgroundPalette = yl(t)), e.backgroundGradientType !== "radial" && e.backgroundGradientType !== "conic" && e.backgroundGradientType !== "mesh" && e.backgroundGradientType !== "linear" && (e.backgroundGradientType = "linear");
11536
+ ]) : typeof t[0] == "string" && (e.backgroundPalette = vl(t)), e.backgroundGradientType !== "radial" && e.backgroundGradientType !== "conic" && e.backgroundGradientType !== "mesh" && e.backgroundGradientType !== "linear" && (e.backgroundGradientType = "linear");
11559
11537
  let n = e.backgroundMeshPoints;
11560
- (!Array.isArray(n) || n.length < 2) && (e.backgroundMeshPoints = bl()), Number.isFinite(e.backgroundMeshSoftness) || (e.backgroundMeshSoftness = .62), e.backgroundMeshSoftness = hl(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 = ml(e.backgroundImageZoom, .1, 8), e.backgroundImagePosition ||= {
11538
+ (!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 ||= {
11561
11539
  x: 0,
11562
11540
  y: 0
11563
- }, typeof e.backgroundImagePosition.x != "number" && (e.backgroundImagePosition.x = 0), typeof e.backgroundImagePosition.y != "number" && (e.backgroundImagePosition.y = 0), e.backgroundImagePosition.x = ml(e.backgroundImagePosition.x, -100, 100), e.backgroundImagePosition.y = ml(e.backgroundImagePosition.y, -100, 100);
11541
+ }, 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);
11564
11542
  }
11565
- function Ol(e) {
11543
+ function Dl(e) {
11566
11544
  e.cameraPosition ||= {
11567
11545
  x: 0,
11568
11546
  y: 0,
@@ -11573,8 +11551,8 @@ function Ol(e) {
11573
11551
  z: 0
11574
11552
  }, typeof e.cameraZoom != "number" && (e.cameraZoom = 1);
11575
11553
  }
11576
- function kl(e) {
11577
- El(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 ||= {
11554
+ function Ol(e) {
11555
+ 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 ||= {
11578
11556
  x: .003234,
11579
11557
  y: .00799
11580
11558
  }, typeof e.displaceAmount != "number" && (e.displaceAmount = 6.051), typeof e.detailFrequency != "number" && (e.detailFrequency = .04), typeof e.detailAmount != "number" && (e.detailAmount = 0), e.twistFrequency ||= {
@@ -11599,22 +11577,22 @@ function kl(e) {
11599
11577
  z: 7
11600
11578
  }, 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);
11601
11579
  }
11602
- function Al(e) {
11603
- Dl(e), Ol(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.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);
11580
+ function kl(e) {
11581
+ 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.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);
11604
11582
  }
11605
- function jl(e) {
11583
+ function Al(e) {
11606
11584
  let t = e;
11607
- return Al(t), (!Array.isArray(t.waves) || t.waves.length === 0) && (t.waves = [Cl()]), t.waves.forEach(kl), t.waveCount = t.waves.length, t;
11585
+ return kl(t), (!Array.isArray(t.waves) || t.waves.length === 0) && (t.waves = [Sl()]), t.waves.forEach(Ol), t.waveCount = t.waves.length, t;
11608
11586
  }
11609
- var Ml, Nl, Pl, Fl, Il, Ll, Rl = t((() => {
11610
- gl(), Ml = 8, Nl = 8, Pl = 8, Fl = 4, Il = 6, Ll = {
11587
+ var jl, Ml, Nl, Pl, Fl, Il, Ll = t((() => {
11588
+ hl(), jl = 8, Ml = 8, Nl = 8, Pl = 4, Fl = 6, Il = {
11611
11589
  x: 800,
11612
11590
  y: 900,
11613
11591
  z: 1100
11614
11592
  };
11615
- })), zl, Bl, Vl, Hl, Ul, Wl, Gl, Kl, ql = t((() => {
11616
- Rl(), zl = "\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", Bl = "\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", Vl = "\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", Hl = `
11617
- ${zl}
11593
+ })), Rl, zl, Bl, Vl, Hl, Ul, Wl, Gl, Kl = t((() => {
11594
+ Ll(), Rl = "\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", zl = "\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", Bl = "\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", Vl = `
11595
+ ${Rl}
11618
11596
 
11619
11597
  uniform float uTime, uSpeed, uSeed;
11620
11598
  uniform float uDispFreqX, uDispFreqZ, uDispAmount;
@@ -11714,16 +11692,16 @@ void main(){
11714
11692
  gl_Position = projectionMatrix * viewMatrix * world;
11715
11693
  vClipPosition = gl_Position;
11716
11694
  }
11717
- `, Ul = `
11695
+ `, Hl = `
11718
11696
  #define MAX_COLORS 8
11719
11697
  #define MAX_MESH_POINTS 8
11720
11698
  #define MAX_LIGHTS 8
11721
11699
  #define MAX_NOISE_BANDS 4
11722
11700
  #define PI 3.14159265359
11723
11701
 
11724
- ${zl}
11702
+ ${Rl}
11725
11703
 
11726
- ${Bl}
11704
+ ${zl}
11727
11705
  uniform float uDebug; // dev: 1 = show crease, 2 = show derivative normal
11728
11706
  uniform float uSheen; // white-lift on the flat (low-crease) areas (1 = full)
11729
11707
  uniform float uRoundness; // pose-robust normal-based roundness/thickness strength
@@ -11764,7 +11742,7 @@ float grainHash(vec2 p){ return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758
11764
11742
  float parabola(float x, float k){ return pow(4.0 * x * (1.0 - x), k); }
11765
11743
  float mapLinear(float v, float a, float b, float c, float d){ return c + (v - a) * (d - c) / (b - a); }
11766
11744
 
11767
- ${Vl}
11745
+ ${Bl}
11768
11746
 
11769
11747
  // Striations: a subtle high-frequency simplex-noise grain ADDED to the
11770
11748
  // colour — colour-matched (weaker where blue is high), only near folds (crease), and
@@ -11904,14 +11882,14 @@ void main(){
11904
11882
  gl_FragColor.rgb *= gl_FragColor.a;
11905
11883
  #endif
11906
11884
  }
11907
- `, Wl = `
11885
+ `, Ul = `
11908
11886
  #define MAX_COLORS 8
11909
11887
  #define MAX_MESH_POINTS 8
11910
11888
  #define PI 3.14159265359
11911
11889
 
11912
- ${zl}
11890
+ ${Rl}
11913
11891
 
11914
- ${Bl}
11892
+ ${zl}
11915
11893
  uniform float uLineAmount; // default 425
11916
11894
  uniform float uLineThickness; // default 1
11917
11895
  uniform float uLineDerivativePower; // default 0.95
@@ -11921,7 +11899,7 @@ uniform vec3 uClearColor; // = page background colour (shown between t
11921
11899
  varying vec2 vUv;
11922
11900
  varying vec4 vClipPosition;
11923
11901
 
11924
- ${Vl}
11902
+ ${Bl}
11925
11903
 
11926
11904
  void main(){
11927
11905
  // Same 2D palette sample + colour ops as the solid theme.
@@ -11946,9 +11924,9 @@ void main(){
11946
11924
  gl_FragColor.rgb *= gl_FragColor.a;
11947
11925
  #endif
11948
11926
  }
11949
- `, Gl = "\nvarying vec2 vUv;\nvoid main(){\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n", Kl = "\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";
11950
- })), Jl, Yl, Xl, Zl, Ql, $l, eu = t((() => {
11951
- Hc(), Jl = 400, Yl = 16, Xl = Jl / 4, Zl = new K(1, 0, 0), Ql = new K(0, 1, 0), $l = class {
11927
+ `, Wl = "\nvarying vec2 vUv;\nvoid main(){\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n", Gl = "\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";
11928
+ })), ql, Jl, Yl, Xl, Zl, Ql, $l = t((() => {
11929
+ Vc(), ql = 400, Jl = 16, Yl = ql / 4, Xl = new K(1, 0, 0), Zl = new K(0, 1, 0), Ql = class {
11952
11930
  geometry;
11953
11931
  segments = -1;
11954
11932
  constructor(e) {
@@ -11957,11 +11935,11 @@ void main(){
11957
11935
  resize(e) {
11958
11936
  if (e === this.segments) return;
11959
11937
  this.segments = e;
11960
- let t = Gt.clamp(Math.round(e), 48, 200), n = t * 2, r = new wi(Jl, Jl, t, n), i = r.attributes.position, a = r.attributes.uv, o = new K();
11938
+ let t = Gt.clamp(Math.round(e), 48, 200), n = t * 2, r = new wi(ql, ql, t, n), i = r.attributes.position, a = r.attributes.uv, o = new K();
11961
11939
  for (let e = 0; e < i.count; e++) {
11962
11940
  o.fromBufferAttribute(i, e);
11963
11941
  let t = a.getY(e), n = 4 - 2 * (4 * t * (1 - t)) ** 9.5;
11964
- o.x < -16 ? o.z += n : o.x < Yl ? (o.z = Math.cos(Gt.mapLinear(o.x, -16, Yl, 0, Math.PI)) * n, o.x = Math.cos(Gt.mapLinear(o.x, -16, Yl, -Math.PI / 2, Math.PI / 2)) * n - Yl) : (o.z -= n, o.x = -o.x), o.x += Xl, o.applyAxisAngle(Zl, -Math.PI / 2), o.applyAxisAngle(Ql, -Math.PI / 2), i.setXYZ(e, o.x, o.y, o.z);
11942
+ o.x < -16 ? o.z += n : o.x < Jl ? (o.z = Math.cos(Gt.mapLinear(o.x, -16, Jl, 0, Math.PI)) * n, o.x = Math.cos(Gt.mapLinear(o.x, -16, Jl, -Math.PI / 2, Math.PI / 2)) * n - Jl) : (o.z -= n, o.x = -o.x), o.x += Yl, o.applyAxisAngle(Xl, -Math.PI / 2), o.applyAxisAngle(Zl, -Math.PI / 2), i.setXYZ(e, o.x, o.y, o.z);
11965
11943
  }
11966
11944
  i.needsUpdate = !0;
11967
11945
  let s = t + 1, c = r.getIndex(), l = c ? Array.from(c.array) : [];
@@ -11982,42 +11960,42 @@ void main(){
11982
11960
  }));
11983
11961
  //#endregion
11984
11962
  //#region src/renderer/palette.ts
11985
- function tu(e) {
11963
+ function eu(e) {
11986
11964
  return e * e * (3 - 2 * e);
11987
11965
  }
11988
- function nu(e, t) {
11966
+ function tu(e, t) {
11989
11967
  let n = new X(e).clone().convertLinearToSRGB();
11990
11968
  return `rgba(${Math.round(n.r * 255)}, ${Math.round(n.g * 255)}, ${Math.round(n.b * 255)}, ${t})`;
11991
11969
  }
11992
- function ru(e) {
11970
+ function nu(e) {
11993
11971
  let t = document.createElement("canvas");
11994
- t.width = Su, t.height = Cu;
11972
+ t.width = xu, t.height = Su;
11995
11973
  let n = t.getContext("2d");
11996
11974
  if (!n) return t;
11997
- let r = [...e.stops].sort((e, t) => e.pos - t.pos), i = n.createLinearGradient(0, 0, Su, 0);
11975
+ let r = [...e.stops].sort((e, t) => e.pos - t.pos), i = n.createLinearGradient(0, 0, xu, 0);
11998
11976
  if (r.length === 0) i.addColorStop(0, "#ffffff");
11999
- else for (let e of r) i.addColorStop(hl(e.pos), e.color);
12000
- n.fillStyle = i, n.fillRect(0, 0, Su, Cu);
12001
- let a = hl(e.edgeAmount);
11977
+ else for (let e of r) i.addColorStop(ml(e.pos), e.color);
11978
+ n.fillStyle = i, n.fillRect(0, 0, xu, Su);
11979
+ let a = ml(e.edgeAmount);
12002
11980
  if (a > .001) {
12003
- let t = n.createLinearGradient(0, 0, 0, Cu);
12004
- t.addColorStop(0, nu(e.edgeColor, a)), t.addColorStop(.5, nu(e.edgeColor, 0)), t.addColorStop(1, nu(e.edgeColor, a)), n.fillStyle = t, n.fillRect(0, 0, Su, Cu);
11981
+ let t = n.createLinearGradient(0, 0, 0, Su);
11982
+ t.addColorStop(0, tu(e.edgeColor, a)), t.addColorStop(.5, tu(e.edgeColor, 0)), t.addColorStop(1, tu(e.edgeColor, a)), n.fillStyle = t, n.fillRect(0, 0, xu, Su);
12005
11983
  }
12006
11984
  return t;
12007
11985
  }
12008
- function iu(e) {
11986
+ function ru(e) {
12009
11987
  return `${e.stops.map((e) => `${e.color}@${e.pos.toFixed(3)}`).join(",")}|${e.edgeColor}|${e.edgeAmount.toFixed(3)}`;
12010
11988
  }
12011
- function au(e) {
11989
+ function iu(e) {
12012
11990
  return e.colorSpace = At, e.minFilter = z, e.magFilter = z, e.wrapS = he, e.wrapT = he, e.generateMipmaps = !1, e;
12013
11991
  }
11992
+ function au(e) {
11993
+ return iu(new yi(e));
11994
+ }
12014
11995
  function ou(e) {
12015
- return au(new yi(e));
11996
+ return au(nu(e));
12016
11997
  }
12017
11998
  function su(e) {
12018
- return ou(ru(e));
12019
- }
12020
- function cu(e) {
12021
11999
  let t = document.createElement("canvas");
12022
12000
  t.width = Math.max(1, Math.round(e.width)), t.height = Math.max(1, Math.round(e.height));
12023
12001
  let n = t.getContext("2d");
@@ -12031,15 +12009,15 @@ function cu(e) {
12031
12009
  }
12032
12010
  let l = [...e.stops].sort((e, t) => e.pos - t.pos);
12033
12011
  if (l.length === 0) c.addColorStop(0, "#ffffff");
12034
- else for (let e of l) c.addColorStop(hl(e.pos), e.color);
12012
+ else for (let e of l) c.addColorStop(ml(e.pos), e.color);
12035
12013
  return n.fillStyle = c, n.fillRect(0, 0, r, i), t;
12036
12014
  }
12037
- function lu(e) {
12038
- let t = hl(e), n = t <= .0031308 ? t * 12.92 : 1.055 * t ** (1 / 2.4) - .055;
12039
- return Math.round(hl(n) * 255);
12015
+ function cu(e) {
12016
+ let t = ml(e), n = t <= .0031308 ? t * 12.92 : 1.055 * t ** (1 / 2.4) - .055;
12017
+ return Math.round(ml(n) * 255);
12040
12018
  }
12041
- function uu(e, t, n, r) {
12042
- 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 : bl(), l = c.map((e) => new X(e.color)), u = 4.8 + -3.4499999999999997 * hl(t);
12019
+ function lu(e, t, n, r) {
12020
+ 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);
12043
12021
  for (let e = 0; e < a; e++) {
12044
12022
  let t = 1 - e / Math.max(1, a - 1);
12045
12023
  for (let n = 0; n < i; n++) {
@@ -12049,12 +12027,12 @@ function uu(e, t, n, r) {
12049
12027
  a += l[e].r * s, o += l[e].g * s, d += l[e].b * s, f += s;
12050
12028
  }
12051
12029
  let p = Math.max(f, 1e-4), m = (e * i + n) * 4;
12052
- s[m] = lu(a / p), s[m + 1] = lu(o / p), s[m + 2] = lu(d / p), s[m + 3] = 255;
12030
+ s[m] = cu(a / p), s[m + 1] = cu(o / p), s[m + 2] = cu(d / p), s[m + 3] = 255;
12053
12031
  }
12054
12032
  }
12055
12033
  return o;
12056
12034
  }
12057
- function du(e, t, n, r) {
12035
+ function uu(e, t, n, r) {
12058
12036
  let i = document.createElement("canvas");
12059
12037
  i.width = Math.max(1, Math.round(n)), i.height = Math.max(1, Math.round(r));
12060
12038
  let a = i.getContext("2d");
@@ -12062,42 +12040,42 @@ function du(e, t, n, r) {
12062
12040
  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");
12063
12041
  l.width = s, l.height = c;
12064
12042
  let u = l.getContext("2d");
12065
- return u ? (u.putImageData(uu(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;
12043
+ return u ? (u.putImageData(lu(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;
12066
12044
  }
12067
- function fu(e, t, n, r, i, a, o, s = 1, c = 0, l = 0) {
12045
+ function du(e, t, n, r, i, a, o, s = 1, c = 0, l = 0) {
12068
12046
  let u = document.createElement("canvas");
12069
- return u.width = Math.max(1, Math.round(r)), u.height = Math.max(1, Math.round(i)), pu(u, e, t, n, a, o, s, c, l), u;
12047
+ return u.width = Math.max(1, Math.round(r)), u.height = Math.max(1, Math.round(i)), fu(u, e, t, n, a, o, s, c, l), u;
12070
12048
  }
12071
- function pu(e, t, n, r, i, a, o = 1, s = 0, c = 0) {
12049
+ function fu(e, t, n, r, i, a, o = 1, s = 0, c = 0) {
12072
12050
  let l = e.getContext("2d");
12073
12051
  if (!l) return;
12074
12052
  l.fillStyle = a, l.fillRect(0, 0, e.width, e.height);
12075
12053
  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;
12076
12054
  l.drawImage(t, (e.width - p) / 2 + h, (e.height - m) / 2 + g, p, m);
12077
12055
  }
12078
- function mu(e) {
12056
+ function pu(e) {
12079
12057
  let t = (t, n) => {
12080
12058
  let r = t * 374761393 + n * 668265263 + e * 1442695041 | 0;
12081
12059
  return r = Math.imul(r ^ r >>> 13, 1274126177), ((r ^ r >>> 16) >>> 0) / 4294967295;
12082
12060
  };
12083
12061
  return (e, n) => {
12084
- let r = Math.floor(e), i = Math.floor(n), a = tu(e - r), o = tu(n - i), s = t(r, i), c = t(r + 1, i), l = t(r, i + 1), u = t(r + 1, i + 1);
12062
+ let r = Math.floor(e), i = Math.floor(n), a = eu(e - r), o = eu(n - i), s = t(r, i), c = t(r + 1, i), l = t(r, i + 1), u = t(r + 1, i + 1);
12085
12063
  return s * (1 - a) * (1 - o) + c * a * (1 - o) + l * (1 - a) * o + u * a * o;
12086
12064
  };
12087
12065
  }
12088
- function hu(e, t, n, r) {
12066
+ function mu(e, t, n, r) {
12089
12067
  let i = 0, a = .5, o = 1, s = 0;
12090
12068
  for (let c = 0; c < r; c++) i += a * e(t * o, n * o), s += a, o *= 2, a *= .5;
12091
12069
  return i / s;
12092
12070
  }
12093
- function gu(e = 220) {
12094
- let t = Math.max(64, Math.min(1280, Math.round(e))), n = Tu.get(t);
12071
+ function hu(e = 220) {
12072
+ let t = Math.max(64, Math.min(1280, Math.round(e))), n = wu.get(t);
12095
12073
  if (n) return n;
12096
12074
  let r = document.createElement("canvas");
12097
12075
  r.width = t, r.height = t;
12098
12076
  let i = r.getContext("2d");
12099
12077
  if (!i) return r;
12100
- let a = i.createImageData(t, t), o = mu(11), s = mu(91), c = mu(47), l = [
12078
+ let a = i.createImageData(t, t), o = pu(11), s = pu(91), c = pu(47), l = [
12101
12079
  [0, [
12102
12080
  34,
12103
12081
  26,
@@ -12129,7 +12107,7 @@ function gu(e = 220) {
12129
12107
  188
12130
12108
  ]]
12131
12109
  ], u = (e) => {
12132
- e = hl(e);
12110
+ e = ml(e);
12133
12111
  for (let t = 1; t < l.length; t++) if (e <= l[t][0]) {
12134
12112
  let [n, r] = l[t - 1], [i, a] = l[t], o = (e - n) / (i - n);
12135
12113
  return [
@@ -12141,24 +12119,24 @@ function gu(e = 220) {
12141
12119
  return l[l.length - 1][1];
12142
12120
  };
12143
12121
  for (let e = 0; e < t; e++) for (let n = 0; n < t; n++) {
12144
- 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(hu(o, l, d, 4)), h = Math.max(0, hu(c, l * 1.6 + 3, d * 1.6, 3) - .55) * 1.7;
12122
+ 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(mu(o, l, d, 4)), h = Math.max(0, mu(c, l * 1.6 + 3, d * 1.6, 3) - .55) * 1.7;
12145
12123
  f = f * (1 - h) + 70 * h, p = p * (1 - h) + 210 * h, m = m * (1 - h) + 200 * h;
12146
12124
  let g = (e * t + n) * 4;
12147
12125
  a.data[g] = f, a.data[g + 1] = p, a.data[g + 2] = m, a.data[g + 3] = 255;
12148
12126
  }
12149
- return i.putImageData(a, 0, 0), Tu.set(t, r), r;
12127
+ return i.putImageData(a, 0, 0), wu.set(t, r), r;
12150
12128
  }
12151
- function _u(e, t, n, r) {
12152
- let i = `${e}|${t}x${n}`, a = Eu.get(i);
12129
+ function gu(e, t, n, r) {
12130
+ let i = `${e}|${t}x${n}`, a = Tu.get(i);
12153
12131
  if (a) return a;
12154
12132
  let o = document.createElement("canvas");
12155
12133
  o.width = t, o.height = n;
12156
12134
  let s = o.getContext("2d");
12157
- return s && r(s, t, n), Eu.set(i, o), o;
12135
+ return s && r(s, t, n), Tu.set(i, o), o;
12158
12136
  }
12159
- function vu(e = 240) {
12137
+ function _u(e = 240) {
12160
12138
  let t = Math.max(120, Math.min(2048, Math.round(e)));
12161
- return _u("vaporwave", t, Math.round(t * 2 / 3), (e, t, n) => {
12139
+ return gu("vaporwave", t, Math.round(t * 2 / 3), (e, t, n) => {
12162
12140
  let r = t / 240, i = e.createLinearGradient(0, 0, 0, n);
12163
12141
  i.addColorStop(0, "#120638"), i.addColorStop(.56, "#8e2de2"), i.addColorStop(1, "#ff2fa8"), e.fillStyle = i, e.fillRect(0, 0, t, n);
12164
12142
  let a = n * .48, o = n * .28, s = e.createLinearGradient(0, a - o, 0, a + o);
@@ -12174,9 +12152,9 @@ function vu(e = 240) {
12174
12152
  e.globalAlpha = 1;
12175
12153
  });
12176
12154
  }
12177
- function yu(e = 220) {
12155
+ function vu(e = 220) {
12178
12156
  let t = Math.max(110, Math.min(2048, Math.round(e)));
12179
- return _u("kaleidoscope", t, t, (e, t, n) => {
12157
+ return gu("kaleidoscope", t, t, (e, t, n) => {
12180
12158
  let r = t / 220, i = [
12181
12159
  "#00e5ff",
12182
12160
  "#6c3bff",
@@ -12192,25 +12170,25 @@ function yu(e = 220) {
12192
12170
  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();
12193
12171
  });
12194
12172
  }
12195
- function bu(e, t) {
12196
- return e.build ? e.build(t) : ru({
12173
+ function yu(e, t) {
12174
+ return e.build ? e.build(t) : nu({
12197
12175
  stops: e.stops ?? [],
12198
12176
  edgeColor: e.edgeColor ?? "#8e9dff",
12199
12177
  edgeAmount: e.edgeAmount ?? 0
12200
12178
  });
12201
12179
  }
12202
- function xu(e) {
12203
- return au(new Zi().load(e));
12180
+ function bu(e) {
12181
+ return iu(new Zi().load(e));
12204
12182
  }
12205
- var Su, Cu, wu, Tu, Eu, Du, Ou = t((() => {
12206
- Hc(), gl(), Rl(), Su = 256, Cu = 64, wu = (e) => e.map(([e, t]) => ({
12183
+ var xu, Su, Cu, wu, Tu, Eu, Du = t((() => {
12184
+ Vc(), hl(), Ll(), xu = 256, Su = 64, Cu = (e) => e.map(([e, t]) => ({
12207
12185
  color: e,
12208
12186
  pos: t
12209
- })), Tu = /* @__PURE__ */ new Map(), Eu = /* @__PURE__ */ new Map(), Du = {
12187
+ })), wu = /* @__PURE__ */ new Map(), Tu = /* @__PURE__ */ new Map(), Eu = {
12210
12188
  palestine: {
12211
12189
  label: "Palestine",
12212
12190
  kind: "gradient",
12213
- stops: wu([
12191
+ stops: Cu([
12214
12192
  ["#000000", 0],
12215
12193
  ["#f7f7f2", .34],
12216
12194
  ["#149954", .67],
@@ -12222,7 +12200,7 @@ var Su, Cu, wu, Tu, Eu, Du, Ou = t((() => {
12222
12200
  grandLine: {
12223
12201
  label: "Grand Line",
12224
12202
  kind: "gradient",
12225
- stops: wu([
12203
+ stops: Cu([
12226
12204
  ["#071b33", 0],
12227
12205
  ["#087ea4", .22],
12228
12206
  ["#45d4c5", .4],
@@ -12237,22 +12215,22 @@ var Su, Cu, wu, Tu, Eu, Du, Ou = t((() => {
12237
12215
  vaporwave: {
12238
12216
  label: "Vaporwave Sunset",
12239
12217
  kind: "image",
12240
- build: vu
12218
+ build: _u
12241
12219
  },
12242
12220
  kaleidoscope: {
12243
12221
  label: "Kaleidoscope",
12244
12222
  kind: "image",
12245
- build: yu
12223
+ build: vu
12246
12224
  },
12247
12225
  nebula: {
12248
12226
  label: "Nebula (2D)",
12249
12227
  kind: "image",
12250
- build: gu
12228
+ build: hu
12251
12229
  },
12252
12230
  sunset: {
12253
12231
  label: "Sunset",
12254
12232
  kind: "gradient",
12255
- stops: wu([
12233
+ stops: Cu([
12256
12234
  ["#3b1c6b", 0],
12257
12235
  ["#8b2fa0", .3],
12258
12236
  ["#e0457a", .56],
@@ -12265,7 +12243,7 @@ var Su, Cu, wu, Tu, Eu, Du, Ou = t((() => {
12265
12243
  aurora: {
12266
12244
  label: "Aurora",
12267
12245
  kind: "gradient",
12268
- stops: wu([
12246
+ stops: Cu([
12269
12247
  ["#0b3d4f", 0],
12270
12248
  ["#1fb89e", .3],
12271
12249
  ["#5ee0a0", .52],
@@ -12278,7 +12256,7 @@ var Su, Cu, wu, Tu, Eu, Du, Ou = t((() => {
12278
12256
  ocean: {
12279
12257
  label: "Ocean",
12280
12258
  kind: "gradient",
12281
- stops: wu([
12259
+ stops: Cu([
12282
12260
  ["#0a1f4d", 0],
12283
12261
  ["#1f6fb8", .36],
12284
12262
  ["#2bd0d0", .66],
@@ -12290,7 +12268,7 @@ var Su, Cu, wu, Tu, Eu, Du, Ou = t((() => {
12290
12268
  ember: {
12291
12269
  label: "Ember",
12292
12270
  kind: "gradient",
12293
- stops: wu([
12271
+ stops: Cu([
12294
12272
  ["#2a0707", 0],
12295
12273
  ["#a81e1e", .34],
12296
12274
  ["#ff5a2e", .64],
@@ -12302,7 +12280,7 @@ var Su, Cu, wu, Tu, Eu, Du, Ou = t((() => {
12302
12280
  iris: {
12303
12281
  label: "Iris",
12304
12282
  kind: "gradient",
12305
- stops: wu([
12283
+ stops: Cu([
12306
12284
  ["#2e1065", 0],
12307
12285
  ["#7c3aed", .34],
12308
12286
  ["#db2777", .64],
@@ -12314,7 +12292,7 @@ var Su, Cu, wu, Tu, Eu, Du, Ou = t((() => {
12314
12292
  mono: {
12315
12293
  label: "Mono",
12316
12294
  kind: "gradient",
12317
- stops: wu([
12295
+ stops: Cu([
12318
12296
  ["#16161e", 0],
12319
12297
  ["#6b7280", .4],
12320
12298
  ["#c2c8d2", .72],
@@ -12327,39 +12305,39 @@ var Su, Cu, wu, Tu, Eu, Du, Ou = t((() => {
12327
12305
  }));
12328
12306
  //#endregion
12329
12307
  //#region src/util/base64.ts
12330
- function ku(e) {
12308
+ function Ou(e) {
12331
12309
  let t = atob(e.replace(/-/g, "+").replace(/_/g, "/")), n = new Uint8Array(new ArrayBuffer(t.length));
12332
12310
  for (let e = 0; e < t.length; e++) n[e] = t.charCodeAt(e);
12333
12311
  return n;
12334
12312
  }
12335
- var Au = t((() => {}));
12313
+ var ku = t((() => {}));
12336
12314
  //#endregion
12337
12315
  //#region src/renderer/heroPalette.ts
12338
- function ju() {
12316
+ function Au() {
12339
12317
  let e = document.createElement("canvas");
12340
- e.width = Nu, e.height = Nu;
12318
+ e.width = Mu, e.height = Mu;
12341
12319
  let t = e.getContext("2d");
12342
12320
  if (t) {
12343
- let e = ku(Pu);
12344
- t.putImageData(new ImageData(new Uint8ClampedArray(e.buffer), Nu, Nu), 0, 0);
12321
+ let e = Ou(Nu);
12322
+ t.putImageData(new ImageData(new Uint8ClampedArray(e.buffer), Mu, Mu), 0, 0);
12345
12323
  }
12346
12324
  return e;
12347
12325
  }
12348
- function Mu() {
12349
- let e = au(new ci(ku(Pu), Nu, Nu, U, Se));
12326
+ function ju() {
12327
+ let e = iu(new ci(Ou(Nu), Mu, Mu, U, Se));
12350
12328
  return e.needsUpdate = !0, e;
12351
12329
  }
12352
- var Nu, Pu, Fu = t((() => {
12353
- Hc(), Au(), Ou(), Nu = 32, Pu = "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==";
12330
+ var Mu, Nu, Pu = t((() => {
12331
+ Vc(), ku(), Du(), Mu = 32, Nu = "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==";
12354
12332
  }));
12355
12333
  //#endregion
12356
12334
  //#region src/renderer/WaveRenderer.ts
12357
- function Iu(e, t) {
12358
- let n = Bu.set(e);
12335
+ function Fu(e, t) {
12336
+ let n = zu.set(e);
12359
12337
  return t.set(n.r, n.g, n.b);
12360
12338
  }
12361
- var Lu, Ru, zu, Bu, Vu, Hu = t((() => {
12362
- Hc(), rl(), al(), ll(), Qc(), pl(), ql(), eu(), Ou(), Fu(), Rl(), Lu = 220, Ru = 1333, zu = class {
12339
+ var Iu, Lu, Ru, zu, Bu, Vu = t((() => {
12340
+ Vc(), nl(), il(), cl(), Zc(), fl(), Kl(), $l(), Du(), Pu(), Ll(), Iu = 220, Lu = 1333, Ru = class {
12363
12341
  makeVideo;
12364
12342
  onVideoReady;
12365
12343
  texture;
@@ -12372,8 +12350,8 @@ var Lu, Ru, zu, Bu, Vu, Hu = t((() => {
12372
12350
  }
12373
12351
  apply(e, t) {
12374
12352
  let n = e.paletteVideoUrl, r = e.paletteImageUrl, i = e.paletteSource ?? "hero", a, o;
12375
- if (n) this.ensureVideo(n), this.video?.readyState && this.video.readyState >= 2 ? (a = "video|" + n, o = () => au(new _i(this.video))) : (a = "video-loading|" + n, o = () => Mu());
12376
- else if (r) this.clearVideo(), a = "url|" + r, o = () => xu(r);
12353
+ if (n) this.ensureVideo(n), this.video?.readyState && this.video.readyState >= 2 ? (a = "video|" + n, o = () => iu(new _i(this.video))) : (a = "video-loading|" + n, o = () => ju());
12354
+ else if (r) this.clearVideo(), a = "url|" + r, o = () => bu(r);
12377
12355
  else if (i === "stops") {
12378
12356
  this.clearVideo();
12379
12357
  let t = {
@@ -12381,8 +12359,8 @@ var Lu, Ru, zu, Bu, Vu, Hu = t((() => {
12381
12359
  edgeColor: e.paletteEdgeColor ?? "#8e9dff",
12382
12360
  edgeAmount: e.paletteEdgeAmount ?? .3
12383
12361
  };
12384
- a = "stops|" + iu(t), o = () => su(t);
12385
- } else Du[i] ? (this.clearVideo(), a = "map|" + i, o = () => ou(bu(Du[i]))) : (this.clearVideo(), a = "hero", o = () => Mu());
12362
+ a = "stops|" + ru(t), o = () => ou(t);
12363
+ } else Eu[i] ? (this.clearVideo(), a = "map|" + i, o = () => au(yu(Eu[i]))) : (this.clearVideo(), a = "hero", o = () => ju());
12386
12364
  (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;
12387
12365
  }
12388
12366
  syncPlayback(e, t) {
@@ -12405,7 +12383,7 @@ var Lu, Ru, zu, Bu, Vu, Hu = t((() => {
12405
12383
  dispose() {
12406
12384
  this.texture?.dispose(), this.texture = void 0, this.clearVideo(), this.failedUrl = "";
12407
12385
  }
12408
- }, Bu = new X(), Vu = class {
12386
+ }, zu = new X(), Bu = class {
12409
12387
  renderer;
12410
12388
  scene = new Gn();
12411
12389
  camera;
@@ -12433,7 +12411,7 @@ var Lu, Ru, zu, Bu, Vu, Hu = t((() => {
12433
12411
  clipSphere = new Ar();
12434
12412
  clipTmpA = new K();
12435
12413
  clipTmpB = new K();
12436
- clock = new Ca();
12414
+ timer = new da();
12437
12415
  time = 0;
12438
12416
  rafId = 0;
12439
12417
  running = !1;
@@ -12448,12 +12426,12 @@ var Lu, Ru, zu, Bu, Vu, Hu = t((() => {
12448
12426
  capturing = !1;
12449
12427
  outputSize;
12450
12428
  constructor(e, t, n = {}) {
12451
- this.container = e, this.config = jl(t), this.respectReducedMotion = n.respectReducedMotion ?? !0, this.skipIntroRamp = n.skipIntroRamp ?? !1, this.renderer = new Vc({
12429
+ this.container = e, this.config = Al(t), this.respectReducedMotion = n.respectReducedMotion ?? !0, this.skipIntroRamp = n.skipIntroRamp ?? !1, this.renderer = new Bc({
12452
12430
  antialias: !0,
12453
12431
  alpha: !0,
12454
12432
  preserveDrawingBuffer: !0,
12455
12433
  powerPreference: "high-performance"
12456
- }), this.renderer.outputColorSpace = At, this.renderer.setClearColor(0, 0), e.appendChild(this.renderer.domElement), this.renderer.domElement.addEventListener("webglcontextlost", this.onContextLost, !1), this.renderer.domElement.addEventListener("webglcontextrestored", this.onContextRestored, !1), this.camera = new oa(-1, 1, 1, -1, 1, 1e4), this.camera.position.set(t.cameraPosition.x, t.cameraPosition.y, t.cameraPosition.z), this.camera.zoom = t.cameraZoom ?? 1, this.camera.lookAt(t.cameraTarget.x, t.cameraTarget.y, t.cameraTarget.z), this.camera.updateProjectionMatrix(), this.homeCamPos.copy(this.camera.position), this.homeCamTarget.set(t.cameraTarget.x, t.cameraTarget.y, t.cameraTarget.z), this.scene.add(this.group), this.composer = new nl(this.renderer), this.composer.addPass(new il(this.scene, this.camera)), this.postPass = new Zc({
12434
+ }), this.renderer.outputColorSpace = At, this.renderer.setClearColor(0, 0), e.appendChild(this.renderer.domElement), this.renderer.domElement.addEventListener("webglcontextlost", this.onContextLost, !1), this.renderer.domElement.addEventListener("webglcontextrestored", this.onContextRestored, !1), this.camera = new oa(-1, 1, 1, -1, 1, 1e4), this.camera.position.set(t.cameraPosition.x, t.cameraPosition.y, t.cameraPosition.z), this.camera.zoom = t.cameraZoom ?? 1, this.camera.lookAt(t.cameraTarget.x, t.cameraTarget.y, t.cameraTarget.z), this.camera.updateProjectionMatrix(), this.homeCamPos.copy(this.camera.position), this.homeCamTarget.set(t.cameraTarget.x, t.cameraTarget.y, t.cameraTarget.z), this.scene.add(this.group), this.composer = new tl(this.renderer), this.composer.addPass(new rl(this.scene, this.camera)), this.postPass = new Xc({
12457
12435
  uniforms: {
12458
12436
  tDiffuse: { value: null },
12459
12437
  uResolution: { value: new G(1, 1) },
@@ -12462,15 +12440,15 @@ var Lu, Ru, zu, Bu, Vu, Hu = t((() => {
12462
12440
  uGrainAmount: { value: t.grain },
12463
12441
  uTime: { value: 0 }
12464
12442
  },
12465
- vertexShader: Gl,
12466
- fragmentShader: Kl
12467
- }), this.composer.addPass(this.postPass), this.composer.addPass(new cl()), 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) => {
12443
+ vertexShader: Wl,
12444
+ fragmentShader: Gl
12445
+ }), 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) => {
12468
12446
  this.visible = e[0]?.isIntersecting ?? !0, this.updateRunning();
12469
12447
  }, { rootMargin: "100px" }), this.intersectionObserver.observe(e), this.resizeObserver = new ResizeObserver(this.onResize), this.resizeObserver.observe(e), this.applyBackground(), this.buildWaves(), this.resize();
12470
12448
  }
12471
12449
  get segments() {
12472
12450
  let e = this.config.quality / Math.sqrt(Math.max(1, this.config.waves.length));
12473
- return Gt.clamp(Math.round(Lu * e), 24, 360);
12451
+ return Gt.clamp(Math.round(Iu * e), 24, 360);
12474
12452
  }
12475
12453
  makeUniforms() {
12476
12454
  let e = [], t = [];
@@ -12555,11 +12533,11 @@ var Lu, Ru, zu, Bu, Vu, Hu = t((() => {
12555
12533
  return e?.twistMotion && (t.TWIST_MOTION = ""), (this.config.loopSeconds ?? 0) > 0 && (t.LOOP_MOTION = ""), (e?.detailAmount ?? 0) !== 0 && (t.DETAIL_OCTAVE = ""), (e?.depthTint ?? 0) > 0 && (t.DEPTH_TINT = ""), (e?.edgeFeather ?? .1) !== .1 && (t.EDGE_FEATHER = ""), t;
12556
12534
  }
12557
12535
  addWave() {
12558
- let e = new $l(this.segments), t = this.config.waves[this.waves.length] ?? this.config.waves[0], n = new Oi({
12536
+ let e = new Ql(this.segments), t = this.config.waves[this.waves.length] ?? this.config.waves[0], n = new Oi({
12559
12537
  uniforms: this.makeUniforms(),
12560
12538
  defines: this.waveDefines(t),
12561
- vertexShader: Hl,
12562
- fragmentShader: t?.theme === "wireframe" ? Wl : Ul,
12539
+ vertexShader: Vl,
12540
+ fragmentShader: t?.theme === "wireframe" ? Ul : Hl,
12563
12541
  transparent: !0,
12564
12542
  depthTest: !0,
12565
12543
  depthWrite: !0,
@@ -12568,7 +12546,7 @@ var Lu, Ru, zu, Bu, Vu, Hu = t((() => {
12568
12546
  this.applyBlendMode(n, t?.blendMode ?? "squared");
12569
12547
  let r = new si(e.geometry, n);
12570
12548
  r.frustumCulled = !1, this.group.add(r);
12571
- let i = new zu((e) => this.createLoopingVideo(e), () => {
12549
+ let i = new Ru((e) => this.createLoopingVideo(e), () => {
12572
12550
  this.updatePaletteTextures(), this.syncVideoPlayback(), this.running || this.renderOnce();
12573
12551
  });
12574
12552
  this.waves.push({
@@ -12609,7 +12587,7 @@ var Lu, Ru, zu, Bu, Vu, Hu = t((() => {
12609
12587
  this.applyBlendMode(e.material, n.blendMode) && (e.material.needsUpdate = !0);
12610
12588
  let i = this.waveDefines(n), a = e.material.defines ?? {};
12611
12589
  Object.keys(i).sort().join(",") !== Object.keys(a).sort().join(",") && (e.material.defines = i, e.material.needsUpdate = !0);
12612
- let o = n.theme === "wireframe" ? Wl : Ul;
12590
+ let o = n.theme === "wireframe" ? Ul : Hl;
12613
12591
  e.material.fragmentShader !== o && (e.material.fragmentShader = o, e.material.needsUpdate = !0);
12614
12592
  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;
12615
12593
  for (let e = 0; e < 8; e++) {
@@ -12617,21 +12595,21 @@ var Lu, Ru, zu, Bu, Vu, Hu = t((() => {
12617
12595
  color: "#ffffff",
12618
12596
  pos: 0
12619
12597
  };
12620
- Iu(t.color, l[e]), u[e] = t.pos;
12598
+ Fu(t.color, l[e]), u[e] = t.pos;
12621
12599
  }
12622
12600
  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;
12623
12601
  let d = n.meshGradientPoints.slice(0, 8), f = r.uMeshPointPos.value, p = r.uMeshPointColor.value, m = r.uMeshPointInfluence.value;
12624
12602
  for (let e = 0; e < 8; e++) {
12625
12603
  let t = d[e] ?? d[d.length - 1];
12626
- t && (f[e].set(t.x, t.y), Iu(t.color, p[e]), m[e] = t.influence);
12604
+ t && (f[e].set(t.x, t.y), Fu(t.color, p[e]), m[e] = t.influence);
12627
12605
  }
12628
- 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, Iu(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, Iu(n.depthTintColor ?? "#0a2540", r.uDepthTintColor.value), r.uEdgeFade.value = n.edgeFade, r.uEdgeFeather.value = n.edgeFeather ?? .1;
12606
+ 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, Fu(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, Fu(n.depthTintColor ?? "#0a2540", r.uDepthTintColor.value), r.uEdgeFade.value = n.edgeFade, r.uEdgeFeather.value = n.edgeFeather ?? .1;
12629
12607
  let h = this.config.lights ?? [];
12630
12608
  r.uAmbient.value = this.config.ambient ?? .45, r.uNumLights.value = Math.min(h.length, 8);
12631
12609
  let g = r.uLightPos.value, _ = r.uLightColor.value, v = r.uLightIntensity.value;
12632
12610
  for (let e = 0; e < 8; e++) {
12633
12611
  let t = h[e];
12634
- t ? (g[e].set(t.position.x, t.position.y, t.position.z), Iu(t.color, _[e]), v[e] = t.intensity) : v[e] = 0;
12612
+ t ? (g[e].set(t.position.x, t.position.y, t.position.z), Fu(t.color, _[e]), v[e] = t.intensity) : v[e] = 0;
12635
12613
  }
12636
12614
  let y = n.noiseBands ?? [];
12637
12615
  r.uNumNoiseBands.value = Math.min(y.length, 4);
@@ -12684,13 +12662,13 @@ var Lu, Ru, zu, Bu, Vu, Hu = t((() => {
12684
12662
  t
12685
12663
  ].join("|");
12686
12664
  if (a !== this.backgroundSig || !this.backgroundTexture) {
12687
- let i = du(n, r, e, t);
12688
- this.backgroundTexture?.dispose(), this.backgroundTexture = ou(i), this.backgroundSig = a;
12665
+ let i = uu(n, r, e, t);
12666
+ this.backgroundTexture?.dispose(), this.backgroundTexture = au(i), this.backgroundSig = a;
12689
12667
  }
12690
12668
  this.scene.background = this.backgroundTexture;
12691
12669
  return;
12692
12670
  }
12693
- let r = this.config.backgroundGradientSource ?? "stops", i = Du[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 = [
12671
+ let r = this.config.backgroundGradientSource ?? "stops", i = Eu[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 = [
12694
12672
  "gradient",
12695
12673
  r,
12696
12674
  n,
@@ -12700,14 +12678,14 @@ var Lu, Ru, zu, Bu, Vu, Hu = t((() => {
12700
12678
  t
12701
12679
  ].join("|");
12702
12680
  if (s !== this.backgroundSig || !this.backgroundTexture) {
12703
- let r = cu({
12681
+ let r = su({
12704
12682
  stops: a,
12705
12683
  type: n,
12706
12684
  angle: this.config.backgroundGradientAngle,
12707
12685
  width: e,
12708
12686
  height: t
12709
12687
  });
12710
- this.backgroundTexture?.dispose(), this.backgroundTexture = ou(r), this.backgroundSig = s;
12688
+ this.backgroundTexture?.dispose(), this.backgroundTexture = au(r), this.backgroundSig = s;
12711
12689
  }
12712
12690
  this.scene.background = this.backgroundTexture;
12713
12691
  }
@@ -12730,7 +12708,7 @@ var Lu, Ru, zu, Bu, Vu, Hu = t((() => {
12730
12708
  c = this.backgroundImage, l = this.backgroundImage.naturalWidth, u = this.backgroundImage.naturalHeight, d = `custom|${s}`;
12731
12709
  } else {
12732
12710
  this.clearBackgroundVideo();
12733
- let r = this.config.backgroundImageSource ?? "vaporwave", i = r === "hero" ? ju() : Du[r]?.kind === "image" ? bu(Du[r], Math.max(t, n)) : null;
12711
+ let r = this.config.backgroundImageSource ?? "vaporwave", i = r === "hero" ? Au() : Eu[r]?.kind === "image" ? yu(Eu[r], Math.max(t, n)) : null;
12734
12712
  if (!i) {
12735
12713
  this.scene.background = e;
12736
12714
  return;
@@ -12749,8 +12727,8 @@ var Lu, Ru, zu, Bu, Vu, Hu = t((() => {
12749
12727
  n
12750
12728
  ].join("|");
12751
12729
  if (f !== this.backgroundSig || !this.backgroundTexture) {
12752
- let e = fu(c, l, u, t, n, r, this.config.background, i, a.x, a.y);
12753
- this.backgroundTexture?.dispose(), this.backgroundTexture = ou(e), this.backgroundSig = f, this.backgroundVideoCanvas = o ? e : void 0;
12730
+ let e = du(c, l, u, t, n, r, this.config.background, i, a.x, a.y);
12731
+ this.backgroundTexture?.dispose(), this.backgroundTexture = au(e), this.backgroundSig = f, this.backgroundVideoCanvas = o ? e : void 0;
12754
12732
  }
12755
12733
  this.scene.background = this.backgroundTexture;
12756
12734
  }
@@ -12802,7 +12780,7 @@ var Lu, Ru, zu, Bu, Vu, Hu = t((() => {
12802
12780
  x: 0,
12803
12781
  y: 0
12804
12782
  };
12805
- pu(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;
12783
+ fu(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;
12806
12784
  }
12807
12785
  applyPost() {
12808
12786
  let e = this.postPass.uniforms;
@@ -12813,7 +12791,7 @@ var Lu, Ru, zu, Bu, Vu, Hu = t((() => {
12813
12791
  if (e > 0) {
12814
12792
  if (!this.bloomPass) {
12815
12793
  let t = this.renderer.getDrawingBufferSize(new G());
12816
- this.bloomPass = new fl(t, e, this.config.bloomRadius ?? .4, this.config.bloomThreshold ?? .85), this.composer.insertPass(this.bloomPass, 1);
12794
+ this.bloomPass = new dl(t, e, this.config.bloomRadius ?? .4, this.config.bloomThreshold ?? .85), this.composer.insertPass(this.bloomPass, 1);
12817
12795
  }
12818
12796
  this.bloomPass.strength = e, this.bloomPass.radius = this.config.bloomRadius ?? .4, this.bloomPass.threshold = this.config.bloomThreshold ?? .85;
12819
12797
  } else this.bloomPass &&= (this.composer.removePass(this.bloomPass), this.bloomPass.dispose(), void 0);
@@ -12855,10 +12833,10 @@ var Lu, Ru, zu, Bu, Vu, Hu = t((() => {
12855
12833
  };
12856
12834
  updateRunning() {
12857
12835
  let e = this.started && this.visible && this.pageVisible && !this.config.paused && !this.reducedMotion;
12858
- e && !this.running ? (this.running = !0, this.clock.start(), this.clock.getDelta(), this.rafId = requestAnimationFrame(this.loop)) : !e && this.running && (this.running = !1, cancelAnimationFrame(this.rafId)), this.running || (this.introTimeRamp = 1, this.renderOnce()), this.syncVideoPlayback();
12836
+ e && !this.running ? (this.running = !0, this.timer.update(), this.rafId = requestAnimationFrame(this.loop)) : !e && this.running && (this.running = !1, cancelAnimationFrame(this.rafId)), this.running || (this.introTimeRamp = 1, this.renderOnce()), this.syncVideoPlayback();
12859
12837
  }
12860
12838
  loop = () => {
12861
- this.running && (this.time += this.clock.getDelta(), this.introTimeRamp < 1 && (this.introTimeRamp = Math.min(1, this.introTimeRamp + .016)), this.renderOnce(), this.rafId = requestAnimationFrame(this.loop));
12839
+ this.running && (this.timer.update(), this.time += this.timer.getDelta(), this.introTimeRamp < 1 && (this.introTimeRamp = Math.min(1, this.introTimeRamp + .016)), this.renderOnce(), this.rafId = requestAnimationFrame(this.loop));
12862
12840
  };
12863
12841
  updateTime() {
12864
12842
  let e = this.config.introRamp === !1 || this.skipIntroRamp ? 1 : this.introTimeRamp, t = this.time * e + (this.config.timeOffset ?? 0);
@@ -12891,7 +12869,7 @@ var Lu, Ru, zu, Bu, Vu, Hu = t((() => {
12891
12869
  onAfterResize() {}
12892
12870
  applyZoom() {
12893
12871
  let e = this.camera.right - this.camera.left, t = this.camera.top - this.camera.bottom;
12894
- this.camera.zoom = Math.max(e / Ru, t / 750) * (this.config.cameraZoom ?? 1), this.camera.updateProjectionMatrix();
12872
+ this.camera.zoom = Math.max(e / Lu, t / 750) * (this.config.cameraZoom ?? 1), this.camera.updateProjectionMatrix();
12895
12873
  }
12896
12874
  updateClipPlanes() {
12897
12875
  this.clipBox.makeEmpty();
@@ -12908,17 +12886,19 @@ var Lu, Ru, zu, Bu, Vu, Hu = t((() => {
12908
12886
  let e = this.camera.getWorldDirection(this.clipTmpA), t = this.clipTmpB.copy(this.clipSphere.center).sub(this.camera.position).dot(e), n = this.clipSphere.radius, r = n * .25 + 10;
12909
12887
  this.camera.near = t - n - r, this.camera.far = t + n + r, this.camera.updateProjectionMatrix();
12910
12888
  }
12911
- async captureImage(e, t = !0, n) {
12912
- let r = this.config.transparentBackground;
12913
- t !== r && (this.config.transparentBackground = t, this.applyBackground());
12914
- let i = null;
12889
+ async captureImage(e, t = !0, n, r) {
12890
+ let i = this.config.transparentBackground;
12891
+ t !== i && (this.config.transparentBackground = t, this.applyBackground());
12892
+ let a = r !== void 0, o = this.time, s = this.introTimeRamp;
12893
+ a && (this.time = r, this.introTimeRamp = 1);
12894
+ let c = null;
12915
12895
  try {
12916
- this.capturing = !0, this.renderOnce(), i = await new Promise((t) => this.canvas.toBlob(t, e, n));
12896
+ this.capturing = !0, this.renderOnce(), c = await new Promise((t) => this.canvas.toBlob(t, e, n));
12917
12897
  } finally {
12918
- this.capturing = !1, t !== r && (this.config.transparentBackground = r, this.applyBackground()), this.renderOnce();
12898
+ this.capturing = !1, t !== i && (this.config.transparentBackground = i, this.applyBackground()), a && (this.time = o, this.introTimeRamp = s), this.renderOnce();
12919
12899
  }
12920
- if (!i || i.type !== e) throw Error(`Failed to capture ${e}`);
12921
- return i;
12900
+ if (!c || c.type !== e) throw Error(`Failed to capture ${e}`);
12901
+ return c;
12922
12902
  }
12923
12903
  captureStream(e = 60) {
12924
12904
  return this.canvas.captureStream(e);
@@ -12930,7 +12910,7 @@ var Lu, Ru, zu, Bu, Vu, Hu = t((() => {
12930
12910
  return this.config;
12931
12911
  }
12932
12912
  setConfig(e) {
12933
- let t = jl(e), n = t.waves.length !== this.waves.length || t.quality !== this.config.quality;
12913
+ let t = Al(e), n = t.waves.length !== this.waves.length || t.quality !== this.config.quality;
12934
12914
  this.config = t, n ? this.rebuild() : this.refresh(), this.applyCameraFromConfig();
12935
12915
  }
12936
12916
  dispose() {
@@ -12939,16 +12919,16 @@ var Lu, Ru, zu, Bu, Vu, Hu = t((() => {
12939
12919
  this.bloomPass?.dispose(), this.composer.dispose(), this.renderer.dispose(), this.renderer.domElement.remove();
12940
12920
  }
12941
12921
  };
12942
- })), Uu = /* @__PURE__ */ n({
12943
- WaveRenderer: () => Vu,
12944
- createDefaultConfig: () => Tl
12922
+ })), Hu = /* @__PURE__ */ n({
12923
+ WaveRenderer: () => Bu,
12924
+ createDefaultConfig: () => wl
12945
12925
  });
12946
12926
  //#endregion
12947
12927
  //#region src/shell/probe.ts
12948
12928
  t((() => {
12949
- Hu(), Rl();
12929
+ Vu(), Ll();
12950
12930
  }))();
12951
- function Wu() {
12931
+ function Uu() {
12952
12932
  if (typeof document > "u") return !1;
12953
12933
  try {
12954
12934
  let e = document.createElement("canvas"), t = { failIfMajorPerformanceCaveat: !0 }, n = e.getContext("webgl2", t) ?? e.getContext("webgl", t);
@@ -12957,22 +12937,22 @@ function Wu() {
12957
12937
  return !1;
12958
12938
  }
12959
12939
  }
12960
- function Gu() {
12940
+ function Wu() {
12961
12941
  return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
12962
12942
  }
12963
- function Ku() {
12943
+ function Gu() {
12964
12944
  return typeof navigator > "u" ? !1 : navigator.connection?.saveData === !0;
12965
12945
  }
12966
12946
  //#endregion
12967
12947
  //#region src/shell/poster.ts
12968
- var qu = "data-wave3d-poster";
12969
- function Ju(e) {
12948
+ var Ku = "data-wave3d-poster";
12949
+ function qu(e) {
12970
12950
  getComputedStyle(e).position === "static" && (e.style.position = "relative");
12971
12951
  }
12972
- function Yu(e, t) {
12973
- let n = e.querySelector(`img[${qu}]`);
12952
+ function Ju(e, t) {
12953
+ let n = e.querySelector(`img[${Ku}]`);
12974
12954
  if (!n && !t) return null;
12975
- n || (n = document.createElement("img"), n.setAttribute(qu, ""), n.decoding = "async", n.alt = "", n.setAttribute("aria-hidden", "true"), e.appendChild(n)), t && (n.src = t), Object.assign(n.style, {
12955
+ n || (n = document.createElement("img"), n.setAttribute(Ku, ""), n.decoding = "async", n.alt = "", n.setAttribute("aria-hidden", "true"), e.appendChild(n)), t && (n.src = t), Object.assign(n.style, {
12976
12956
  position: "absolute",
12977
12957
  inset: "0",
12978
12958
  width: "100%",
@@ -13005,12 +12985,12 @@ function Yu(e, t) {
13005
12985
  }
13006
12986
  //#endregion
13007
12987
  //#region src/shell/createWave.ts
13008
- function Xu(e, t, n, r) {
12988
+ function Yu(e, t, n, r) {
13009
12989
  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 };
13010
12990
  r.paused !== void 0 && (p.paused = r.paused);
13011
12991
  let m = !1, h = null, g, _ = 0;
13012
- Ju(t);
13013
- let v = Yu(t, r.poster);
12992
+ qu(t);
12993
+ let v = Ju(t, r.poster);
13014
12994
  function y(e) {
13015
12995
  d !== e && (d = e, r.onStateChange?.(e));
13016
12996
  }
@@ -13056,7 +13036,7 @@ function Xu(e, t, n, r) {
13056
13036
  }
13057
13037
  function T() {
13058
13038
  if (!m) {
13059
- if (o === "auto" && !Wu()) {
13039
+ if (o === "auto" && !Uu()) {
13060
13040
  b("no-webgl");
13061
13041
  return;
13062
13042
  }
@@ -13065,8 +13045,8 @@ function Xu(e, t, n, r) {
13065
13045
  }
13066
13046
  function E() {
13067
13047
  if (o !== "off") {
13068
- if (l && Ku()) return b("save-data");
13069
- if (s && c === "poster" && Gu()) return b("reduced-motion");
13048
+ if (l && Gu()) return b("save-data");
13049
+ if (s && c === "poster" && Wu()) return b("reduced-motion");
13070
13050
  i && typeof IntersectionObserver < "u" ? (h = new IntersectionObserver((e) => {
13071
13051
  e.some((e) => e.isIntersecting) && (h?.disconnect(), h = null, T());
13072
13052
  }, { rootMargin: a }), h.observe(t)) : T();
@@ -13079,6 +13059,11 @@ function Xu(e, t, n, r) {
13079
13059
  get renderer() {
13080
13060
  return f;
13081
13061
  },
13062
+ snapshot(e = {}) {
13063
+ if (!f) return Promise.resolve(null);
13064
+ let { type: t = "image/webp", quality: n, transparent: r = !0, time: i } = e;
13065
+ return f.captureImage(t, r, n, i);
13066
+ },
13082
13067
  set(e) {
13083
13068
  f ? (f.setConfig({
13084
13069
  ...f.getConfig(),
@@ -13101,11 +13086,11 @@ function Xu(e, t, n, r) {
13101
13086
  }
13102
13087
  //#endregion
13103
13088
  //#region src/presets.ts
13104
- Rl();
13105
- var Zu = 180 / Math.PI;
13106
- function Qu(e) {
13107
- let t = Tl(), n = t.waves[0];
13108
- return n.speed = e.speed, n.colorContrast = e.contrast, n.colorSaturation = e.sat, n.hueShift = e.hueRad * Zu, n.displaceFrequency = {
13089
+ Ll();
13090
+ var Xu = 180 / Math.PI;
13091
+ function Zu(e) {
13092
+ let t = wl(), n = t.waves[0];
13093
+ return n.speed = e.speed, n.colorContrast = e.contrast, n.colorSaturation = e.sat, n.hueShift = e.hueRad * Xu, n.displaceFrequency = {
13109
13094
  x: e.dispX,
13110
13095
  y: e.dispZ
13111
13096
  }, n.displaceAmount = e.dispAmt, n.position = {
@@ -13113,9 +13098,9 @@ function Qu(e) {
13113
13098
  y: e.pos[1],
13114
13099
  z: e.pos[2]
13115
13100
  }, n.rotation = {
13116
- x: e.rotRad[0] * Zu,
13117
- y: e.rotRad[1] * Zu,
13118
- z: e.rotRad[2] * Zu
13101
+ x: e.rotRad[0] * Xu,
13102
+ y: e.rotRad[1] * Xu,
13103
+ z: e.rotRad[2] * Xu
13119
13104
  }, n.scale = {
13120
13105
  x: e.scale[0],
13121
13106
  y: e.scale[1],
@@ -13138,8 +13123,8 @@ function Qu(e) {
13138
13123
  z: 0
13139
13124
  }, t.cameraZoom = e.zoom, t;
13140
13125
  }
13141
- var $u = {
13142
- Hero: () => Qu({
13126
+ var Qu = {
13127
+ Hero: () => Zu({
13143
13128
  speed: .04,
13144
13129
  contrast: 1,
13145
13130
  sat: 1,
@@ -13182,8 +13167,8 @@ var $u = {
13182
13167
  zoom: .55,
13183
13168
  camTarget: [-420, -200]
13184
13169
  }),
13185
- "Wave 2": () => Tl(),
13186
- "Wave 3": () => Qu({
13170
+ "Wave 2": () => wl(),
13171
+ "Wave 3": () => Zu({
13187
13172
  speed: .08,
13188
13173
  contrast: 1,
13189
13174
  sat: 1,
@@ -13226,7 +13211,7 @@ var $u = {
13226
13211
  zoom: 1.3,
13227
13212
  camTarget: [-104, 13]
13228
13213
  }),
13229
- "Wave 4": () => Qu({
13214
+ "Wave 4": () => Zu({
13230
13215
  speed: .0525,
13231
13216
  contrast: .969,
13232
13217
  sat: 1.383,
@@ -13292,21 +13277,21 @@ var $u = {
13292
13277
  }]
13293
13278
  }),
13294
13279
  Wireframe: () => {
13295
- let e = Tl();
13280
+ let e = wl();
13296
13281
  return e.waves[0].theme = "wireframe", e.grain = 1.2, e.background = "#0a2540", e.transparentBackground = !1, e;
13297
13282
  },
13298
13283
  "Neon Dark Multistrand": () => {
13299
- let e = Tl(), t = e.waves[0];
13300
- return t.theme = "wireframe", t.blendMode = "additive", t.palette = yl([
13284
+ let e = wl(), t = e.waves[0];
13285
+ return t.theme = "wireframe", t.blendMode = "additive", t.palette = vl([
13301
13286
  "#00f5d4",
13302
13287
  "#00bbf9",
13303
13288
  "#9b5de5",
13304
13289
  "#f15bb5",
13305
13290
  "#fee440"
13306
- ]), t.creaseLight = 1, e.background = "#05060c", e.transparentBackground = !1, e.waves = xl(t, 3), e.waveCount = 3, e;
13291
+ ]), t.creaseLight = 1, e.background = "#05060c", e.transparentBackground = !1, e.waves = bl(t, 3), e.waveCount = 3, e;
13307
13292
  },
13308
13293
  "Mesh Gradient": () => {
13309
- let e = $u.Hero(), t = e.waves[0];
13294
+ let e = Qu.Hero(), t = e.waves[0];
13310
13295
  return t.gradientType = "mesh", t.meshGradientPoints = [
13311
13296
  {
13312
13297
  color: "#0a84ff",
@@ -13347,7 +13332,7 @@ var $u = {
13347
13332
  ], 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;
13348
13333
  },
13349
13334
  "Solar Bloom": () => {
13350
- let e = $u.Hero(), t = e.waves[0];
13335
+ let e = Qu.Hero(), t = e.waves[0];
13351
13336
  return t.usePaletteTexture = !1, t.gradientType = "radial", t.gradientShift = .14, t.palette = [
13352
13337
  {
13353
13338
  color: "#fff3c4",
@@ -13373,10 +13358,10 @@ var $u = {
13373
13358
  color: "#241246",
13374
13359
  pos: 1
13375
13360
  }
13376
- ], 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 = yl(["#2a1330", "#08040f"]), e.transparentBackground = !1, e;
13361
+ ], 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;
13377
13362
  },
13378
13363
  Holographic: () => {
13379
- let e = $u.Hero(), t = e.waves[0];
13364
+ let e = Qu.Hero(), t = e.waves[0];
13380
13365
  return t.usePaletteTexture = !1, t.gradientType = "conic", t.gradientShift = .08, t.palette = [
13381
13366
  {
13382
13367
  color: "#8ef6e4",
@@ -13406,10 +13391,10 @@ var $u = {
13406
13391
  color: "#8ef6e4",
13407
13392
  pos: 1
13408
13393
  }
13409
- ], 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 = yl(["#04121a", "#0a0518"]), e.transparentBackground = !1, e;
13394
+ ], 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;
13410
13395
  },
13411
13396
  Aurora: () => {
13412
- let e = $u.Hero(), t = e.waves[0];
13397
+ let e = Qu.Hero(), t = e.waves[0];
13413
13398
  return t.gradientType = "mesh", t.meshGradientPoints = [
13414
13399
  {
13415
13400
  color: "#0a1f3c",
@@ -13481,27 +13466,27 @@ var $u = {
13481
13466
  ], e.backgroundMeshSoftness = .75, e.transparentBackground = !1, e;
13482
13467
  },
13483
13468
  Palestine: () => {
13484
- let e = $u.Hero(), t = e.waves[0];
13469
+ let e = Qu.Hero(), t = e.waves[0];
13485
13470
  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;
13486
13471
  },
13487
13472
  "Vaporwave Sunset": () => {
13488
- let e = $u.Hero(), t = e.waves[0];
13489
- return t.position.x = 525, t.rotation.x = -.64 * Zu, t.rotation.z = 1.68 * Zu, 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 = {
13473
+ let e = Qu.Hero(), t = e.waves[0];
13474
+ return t.position.x = 525, t.rotation.x = -.64 * Xu, t.rotation.z = 1.68 * Xu, 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 = {
13490
13475
  x: 150,
13491
13476
  y: 360,
13492
13477
  z: 0
13493
13478
  }, e.background = "#09051f", e.transparentBackground = !1, e;
13494
13479
  },
13495
13480
  Kaleidoscope: () => {
13496
- let e = $u["Wave 3"](), t = e.waves[0];
13481
+ let e = Qu["Wave 3"](), t = e.waves[0];
13497
13482
  return t.paletteSource = "kaleidoscope", t.blendMode = "normal", t.hueShift = 0, t.colorContrast = 1.05, t.colorSaturation = 1.12, e.grain = .5, e;
13498
13483
  }
13499
13484
  };
13500
- Hu(), Rl();
13501
- var ed = () => Promise.resolve(Uu);
13502
- function td(e, t = {}, n = {}) {
13503
- return Xu(ed, e, t, n);
13485
+ Vu(), Ll();
13486
+ var $u = () => Promise.resolve(Hu);
13487
+ function ed(e, t = {}, n = {}) {
13488
+ return Yu($u, e, t, n);
13504
13489
  }
13505
- var nd = td;
13490
+ var td = ed;
13506
13491
  //#endregion
13507
- export { Ll as DEFAULT_LIGHT_POSITION, Ml as MAX_COLORS, Pl as MAX_LIGHTS, Nl as MAX_MESH_POINTS, Fl as MAX_NOISE_BANDS, Il as MAX_WAVES, $u as PRESETS, Vu as WaveRenderer, Tl as createDefaultConfig, bl as createDefaultMeshPoints, _l as createLight, vl as createNoiseBand, td as createWave, Ol as ensureCamera, Al as ensureSceneDefaults, jl as ensureStudioConfig, yl as makeStops, Cl as makeWave, xl as makeWaveSpread, nd as mountWave, Dl as normalizeBackground, kl as normalizeWave, wl as resizeWaves };
13492
+ export { Il as DEFAULT_LIGHT_POSITION, jl as MAX_COLORS, Nl as MAX_LIGHTS, Ml as MAX_MESH_POINTS, Pl as MAX_NOISE_BANDS, Fl as MAX_WAVES, Qu as PRESETS, Bu as WaveRenderer, wl as createDefaultConfig, yl as createDefaultMeshPoints, gl as createLight, _l as createNoiseBand, ed as createWave, Dl as ensureCamera, kl as ensureSceneDefaults, Al as ensureStudioConfig, vl as makeStops, Sl as makeWave, bl as makeWaveSpread, td as mountWave, El as normalizeBackground, Ol as normalizeWave, Cl as resizeWaves };