mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-03 12:17:03 +00:00
* fix(catalog): 3D previews load their scripts under the docs host's script policy * fix(catalog): preserve script text through HTML parsing * docs(catalog): describe the shared script bundle
1 line
1.0 MiB
Plaintext
1 line
1.0 MiB
Plaintext
{"text":"\"use strict\";(() => {\n var __defProp = Object.defineProperty;\n var __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n };\n\n // registry/blocks/cuboid-carousel/assets/three.module.min.js\n var three_module_min_exports = {};\n __export(three_module_min_exports, {\n ACESFilmicToneMapping: () => st,\n AddEquation: () => w,\n AddOperation: () => $,\n AdditiveAnimationBlendMode: () => Je,\n AdditiveBlending: () => g,\n AgXToneMapping: () => rt,\n AlphaFormat: () => Dt,\n AlwaysCompare: () => ks,\n AlwaysDepth: () => j,\n AlwaysStencilFunc: () => Ss,\n AmbientLight: () => lu,\n AnimationAction: () => nd,\n AnimationClip: () => Ac,\n AnimationLoader: () => Ec,\n AnimationMixer: () => od,\n AnimationObjectGroup: () => rd,\n AnimationUtils: () => uc,\n ArcCurve: () => Ih,\n ArrayCamera: () => Ru,\n ArrowHelper: () => op,\n AttachedBindMode: () => at,\n Audio: () => Wu,\n AudioAnalyser: () => Zu,\n AudioContext: () => Tu,\n AudioListener: () => ju,\n AudioLoader: () => zu,\n AxesHelper: () => hp,\n BackSide: () => d,\n BasicDepthPacking: () => Ye,\n BasicShadowMap: () => o,\n BatchedMesh: () => Eo,\n BezierInterpolant: () => gc,\n Bone: () => Ha,\n BooleanKeyframeTrack: () => xc,\n Box2: () => Sd,\n Box3: () => Qr,\n Box3Helper: () => sp,\n BoxGeometry: () => yh,\n BoxHelper: () => ep,\n BufferAttribute: () => Mn,\n BufferGeometry: () => Wn,\n BufferGeometryLoader: () => fu,\n ByteType: () => Ct,\n Cache: () => zc,\n Camera: () => $c,\n CameraHelper: () => Qd,\n CanvasTexture: () => ch,\n CapsuleGeometry: () => gh,\n CatmullRomCurve3: () => Nh,\n CineonToneMapping: () => et,\n CircleGeometry: () => fh,\n ClampToEdgeWrapping: () => yt,\n Clock: () => xd,\n Color: () => Pr,\n ColorKeyframeTrack: () => bc,\n ColorManagement: () => Ri,\n Compatibility: () => Ys,\n CompressedArrayTexture: () => oh,\n CompressedCubeTexture: () => hh,\n CompressedTexture: () => ah,\n CompressedTextureLoader: () => Nc,\n ConeGeometry: () => bh,\n ConstantAlphaFactor: () => F,\n ConstantColorFactor: () => V,\n Controls: () => cp,\n CubeCamera: () => Pu,\n CubeDepthTexture: () => ph,\n CubeReflectionMapping: () => lt,\n CubeRefractionMapping: () => ct,\n CubeTexture: () => lh,\n CubeTextureLoader: () => Fc,\n CubeUVReflectionMapping: () => pt,\n CubicBezierCurve: () => Dh,\n CubicBezierCurve3: () => Uh,\n CubicInterpolant: () => pc,\n CullFaceBack: () => r,\n CullFaceFront: () => n,\n CullFaceFrontBack: () => a,\n CullFaceNone: () => i,\n Curve: () => zh,\n CurvePath: () => Yh,\n CustomBlending: () => b,\n CustomToneMapping: () => it,\n CylinderGeometry: () => xh,\n Cylindrical: () => vd,\n Data3DTexture: () => Gi,\n DataArrayTexture: () => Yi,\n DataTexture: () => Xa,\n DataTextureLoader: () => Dc,\n DataUtils: () => xn,\n DecrementStencilOp: () => ds,\n DecrementWrapStencilOp: () => ms,\n DefaultLoadingManager: () => Bc,\n DepthFormat: () => Wt,\n DepthStencilFormat: () => Jt,\n DepthTexture: () => dh,\n DetachedBindMode: () => ot,\n DirectionalLight: () => hu,\n DirectionalLightHelper: () => Zd,\n DiscreteInterpolant: () => yc,\n DodecahedronGeometry: () => wh,\n DoubleSide: () => p,\n DstAlphaFactor: () => O,\n DstColorFactor: () => R,\n DynamicCopyUsage: () => Fs,\n DynamicDrawUsage: () => Ps,\n DynamicReadUsage: () => Ns,\n EdgesGeometry: () => Th,\n EllipseCurve: () => Ch,\n EqualCompare: () => Ts,\n EqualDepth: () => q,\n EqualStencilFunc: () => xs,\n EquirectangularReflectionMapping: () => ut,\n EquirectangularRefractionMapping: () => dt,\n Euler: () => hr,\n EventDispatcher: () => di,\n ExternalTexture: () => mh,\n ExtrudeGeometry: () => zl,\n FileLoader: () => Rc,\n Float16BufferAttribute: () => Bn,\n Float32BufferAttribute: () => kn,\n FloatType: () => Pt,\n Fog: () => Nr,\n FogExp2: () => Er,\n FramebufferTexture: () => nh,\n FrontSide: () => u,\n Frustum: () => mo,\n FrustumArray: () => go,\n GLBufferAttribute: () => pd,\n GLSL1: () => Us,\n GLSL3: () => js,\n GreaterCompare: () => Cs,\n GreaterDepth: () => X,\n GreaterEqualCompare: () => Bs,\n GreaterEqualDepth: () => H,\n GreaterEqualStencilFunc: () => Ms,\n GreaterStencilFunc: () => vs,\n GridHelper: () => Jd,\n Group: () => Tr,\n HTMLTexture: () => uh,\n HalfFloatType: () => Rt,\n HemisphereLight: () => Wc,\n HemisphereLightHelper: () => Wd,\n IcosahedronGeometry: () => Il,\n ImageBitmapLoader: () => _u,\n ImageLoader: () => Lc,\n ImageUtils: () => Li,\n IncrementStencilOp: () => us,\n IncrementWrapStencilOp: () => ps,\n InstancedBufferAttribute: () => $a,\n InstancedBufferGeometry: () => gu,\n InstancedInterleavedBuffer: () => dd,\n InstancedMesh: () => no,\n Int16BufferAttribute: () => Tn,\n Int32BufferAttribute: () => Cn,\n Int8BufferAttribute: () => Sn,\n IntType: () => kt,\n InterleavedBuffer: () => Jn,\n InterleavedBufferAttribute: () => Hn,\n Interpolant: () => dc,\n InterpolateBezier: () => Fe,\n InterpolateDiscrete: () => Ne,\n InterpolateLinear: () => Ve,\n InterpolateSmooth: () => Le,\n InterpolationSamplingMode: () => Xs,\n InterpolationSamplingType: () => Hs,\n InvertStencilOp: () => ys,\n KeepStencilOp: () => ls,\n KeyframeTrack: () => fc,\n LOD: () => pa,\n LatheGeometry: () => Bl,\n Layers: () => lr,\n LessCompare: () => As,\n LessDepth: () => W,\n LessEqualCompare: () => zs,\n LessEqualDepth: () => J,\n LessEqualStencilFunc: () => bs,\n LessStencilFunc: () => fs,\n Light: () => jc,\n LightProbe: () => du,\n Line: () => Jo,\n Line3: () => kd,\n LineBasicMaterial: () => No,\n LineCurve: () => jh,\n LineCurve3: () => Wh,\n LineDashedMaterial: () => ac,\n LineLoop: () => Zo,\n LineSegments: () => Yo,\n LinearFilter: () => Mt,\n LinearInterpolant: () => mc,\n LinearMipMapLinearFilter: () => Tt,\n LinearMipMapNearestFilter: () => _t,\n LinearMipmapLinearFilter: () => At,\n LinearMipmapNearestFilter: () => St,\n LinearSRGBColorSpace: () => ss,\n LinearToneMapping: () => K,\n LinearTransfer: () => is,\n Loader: () => kc,\n LoaderUtils: () => yu,\n LoadingManager: () => Ic,\n LoopOnce: () => Pe,\n LoopPingPong: () => Ee,\n LoopRepeat: () => Re,\n MOUSE: () => e,\n Material: () => Zn,\n MaterialBlending: () => v,\n MaterialLoader: () => mu,\n MathUtils: () => Si,\n Matrix2: () => wd,\n Matrix3: () => Ii,\n Matrix4: () => Qi,\n MaxEquation: () => A,\n Mesh: () => Ra,\n MeshBasicMaterial: () => Ma,\n MeshDepthMaterial: () => ic,\n MeshDistanceMaterial: () => rc,\n MeshLambertMaterial: () => sc,\n MeshMatcapMaterial: () => nc,\n MeshNormalMaterial: () => ec,\n MeshPhongMaterial: () => Kl,\n MeshPhysicalMaterial: () => Ql,\n MeshStandardMaterial: () => $l,\n MeshToonMaterial: () => tc,\n MinEquation: () => _,\n MirroredRepeatWrapping: () => gt,\n MixOperation: () => G,\n MultiplyBlending: () => x,\n MultiplyOperation: () => Z,\n NearestFilter: () => ft,\n NearestMipMapLinearFilter: () => wt,\n NearestMipMapNearestFilter: () => bt,\n NearestMipmapLinearFilter: () => vt,\n NearestMipmapNearestFilter: () => xt,\n NeutralToneMapping: () => nt,\n NeverCompare: () => _s,\n NeverDepth: () => U,\n NeverStencilFunc: () => gs,\n NoBlending: () => m,\n NoColorSpace: () => ts,\n NoNormalPacking: () => ns,\n NoToneMapping: () => Q,\n NormalAnimationBlendMode: () => We,\n NormalBlending: () => y,\n NormalGAPacking: () => os,\n NormalRGPacking: () => as,\n NotEqualCompare: () => Is,\n NotEqualDepth: () => Y,\n NotEqualStencilFunc: () => ws,\n NumberKeyframeTrack: () => vc,\n Object3D: () => Ar,\n ObjectLoader: () => bu,\n ObjectSpaceNormalMap: () => Ke,\n OctahedronGeometry: () => kl,\n OneFactor: () => z,\n OneMinusConstantAlphaFactor: () => D,\n OneMinusConstantColorFactor: () => L,\n OneMinusDstAlphaFactor: () => P,\n OneMinusDstColorFactor: () => E,\n OneMinusSrcAlphaFactor: () => k,\n OneMinusSrcColorFactor: () => I,\n OrthographicCamera: () => au,\n PCFShadowMap: () => h,\n PCFSoftShadowMap: () => l,\n PMREMGenerator: () => ri2,\n Path: () => Zh,\n PerspectiveCamera: () => eu,\n Plane: () => lo,\n PlaneGeometry: () => Ol,\n PlaneHelper: () => ip,\n PointLight: () => nu,\n PointLightHelper: () => Fd,\n Points: () => eh,\n PointsMaterial: () => Go,\n PolarGridHelper: () => qd,\n PolyhedronGeometry: () => vh,\n PositionalAudio: () => Yu,\n PropertyBinding: () => id,\n PropertyMixer: () => Gu,\n QuadraticBezierCurve: () => Jh,\n QuadraticBezierCurve3: () => qh,\n Quaternion: () => Ai,\n QuaternionKeyframeTrack: () => Mc,\n QuaternionLinearInterpolant: () => wc,\n R11_EAC_Format: () => he,\n RED_GREEN_RGTC2_Format: () => ke,\n RED_RGTC1_Format: () => Ie,\n REVISION: () => t,\n RG11_EAC_Format: () => ce,\n RGBADepthPacking: () => Ze,\n RGBAFormat: () => jt,\n RGBAIntegerFormat: () => Gt,\n RGBA_ASTC_10x10_Format: () => Se,\n RGBA_ASTC_10x5_Format: () => ve,\n RGBA_ASTC_10x6_Format: () => we,\n RGBA_ASTC_10x8_Format: () => Me,\n RGBA_ASTC_12x10_Format: () => _e,\n RGBA_ASTC_12x12_Format: () => Ae,\n RGBA_ASTC_4x4_Format: () => de,\n RGBA_ASTC_5x4_Format: () => pe,\n RGBA_ASTC_5x5_Format: () => me,\n RGBA_ASTC_6x5_Format: () => ye,\n RGBA_ASTC_6x6_Format: () => ge,\n RGBA_ASTC_8x5_Format: () => fe,\n RGBA_ASTC_8x6_Format: () => xe,\n RGBA_ASTC_8x8_Format: () => be,\n RGBA_BPTC_Format: () => Te,\n RGBA_ETC2_EAC_Format: () => oe,\n RGBA_PVRTC_2BPPV1_Format: () => re,\n RGBA_PVRTC_4BPPV1_Format: () => ie,\n RGBA_S3TC_DXT1_Format: () => Qt,\n RGBA_S3TC_DXT3_Format: () => Kt,\n RGBA_S3TC_DXT5_Format: () => te,\n RGBDepthPacking: () => Ge,\n RGBFormat: () => Ut,\n RGBIntegerFormat: () => Zt,\n RGB_BPTC_SIGNED_Format: () => ze,\n RGB_BPTC_UNSIGNED_Format: () => Ce,\n RGB_ETC1_Format: () => ne,\n RGB_ETC2_Format: () => ae,\n RGB_PVRTC_2BPPV1_Format: () => se,\n RGB_PVRTC_4BPPV1_Format: () => ee,\n RGB_S3TC_DXT1_Format: () => $t,\n RGDepthPacking: () => $e,\n RGFormat: () => Xt,\n RGIntegerFormat: () => Yt,\n RawShaderMaterial: () => Gl,\n Ray: () => wa,\n Raycaster: () => yd,\n RectAreaLight: () => cu,\n RedFormat: () => qt,\n RedIntegerFormat: () => Ht,\n ReinhardToneMapping: () => tt,\n RenderTarget: () => Hi,\n RenderTarget3D: () => hd,\n RepeatWrapping: () => mt,\n ReplaceStencilOp: () => cs,\n ReverseSubtractEquation: () => S,\n RingGeometry: () => Pl,\n SIGNED_R11_EAC_Format: () => le,\n SIGNED_RED_GREEN_RGTC2_Format: () => Oe,\n SIGNED_RED_RGTC1_Format: () => Be,\n SIGNED_RG11_EAC_Format: () => ue,\n SRGBColorSpace: () => es,\n SRGBTransfer: () => rs,\n Scene: () => Vr,\n ShaderChunk: () => Bn2,\n ShaderLib: () => Hn2,\n ShaderMaterial: () => Zl,\n ShadowMaterial: () => Wl,\n Shape: () => Gh,\n ShapeGeometry: () => Rl,\n ShapePath: () => lp,\n ShapeUtils: () => _l,\n ShortType: () => It,\n Skeleton: () => Ga,\n SkeletonHelper: () => Vd,\n SkinnedMesh: () => qa,\n Source: () => Di,\n Sphere: () => En,\n SphereGeometry: () => El,\n Spherical: () => bd,\n SphericalHarmonics3: () => uu,\n SplineCurve: () => Hh,\n SpotLight: () => iu,\n SpotLightHelper: () => Pd,\n Sprite: () => la,\n SpriteMaterial: () => Gn,\n SrcAlphaFactor: () => B,\n SrcAlphaSaturateFactor: () => N,\n SrcColorFactor: () => C,\n StaticCopyUsage: () => Ls,\n StaticDrawUsage: () => Os,\n StaticReadUsage: () => Es,\n StereoCamera: () => ku,\n StreamCopyUsage: () => Ds,\n StreamDrawUsage: () => Rs,\n StreamReadUsage: () => Vs,\n StringKeyframeTrack: () => Sc,\n SubtractEquation: () => M,\n SubtractiveBlending: () => f,\n TOUCH: () => s,\n TangentSpaceNormalMap: () => Qe,\n TetrahedronGeometry: () => Nl,\n Texture: () => Ji,\n TextureLoader: () => Uc,\n TextureUtils: () => dp,\n Timer: () => Eu,\n TimestampQuery: () => qs,\n TorusGeometry: () => Vl,\n TorusKnotGeometry: () => Ll,\n Triangle: () => $r,\n TriangleFanDrawMode: () => Xe,\n TriangleStripDrawMode: () => He,\n TrianglesDrawMode: () => qe,\n TubeGeometry: () => Fl,\n UVMapping: () => ht,\n Uint16BufferAttribute: () => zn,\n Uint32BufferAttribute: () => In,\n Uint8BufferAttribute: () => _n,\n Uint8ClampedBufferAttribute: () => An,\n Uniform: () => ld,\n UniformsGroup: () => ud,\n UniformsLib: () => Gn2,\n UniformsUtils: () => Yl,\n UnsignedByteType: () => zt,\n UnsignedInt101111Type: () => Ft,\n UnsignedInt248Type: () => Vt,\n UnsignedInt5999Type: () => Lt,\n UnsignedIntType: () => Ot,\n UnsignedShort4444Type: () => Et,\n UnsignedShort5551Type: () => Nt,\n UnsignedShortType: () => Bt,\n VSMShadowMap: () => c,\n Vector2: () => _i,\n Vector3: () => Ti,\n Vector4: () => qi,\n VectorKeyframeTrack: () => _c,\n VideoFrameTexture: () => rh,\n VideoTexture: () => ih,\n WebGL3DRenderTarget: () => $i,\n WebGLArrayRenderTarget: () => Zi,\n WebGLCoordinateSystem: () => Ws,\n WebGLCubeRenderTarget: () => di2,\n WebGLRenderTarget: () => Xi,\n WebGLRenderer: () => Pa2,\n WebGLUtils: () => Ea2,\n WebGPUCoordinateSystem: () => Js,\n WebXRController: () => Cr,\n WireframeGeometry: () => Dl,\n WrapAroundEnding: () => je,\n ZeroCurvatureEnding: () => De,\n ZeroFactor: () => T,\n ZeroSlopeEnding: () => Ue,\n ZeroStencilOp: () => hs,\n createCanvasElement: () => Ks,\n error: () => oi,\n getConsoleFunction: () => ii,\n log: () => ri,\n setConsoleFunction: () => si,\n warn: () => ai,\n warnOnce: () => hi\n });\n\n // registry/blocks/cuboid-carousel/assets/three.core.min.js\n var t = \"185\";\n var e = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };\n var s = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };\n var i = 0;\n var r = 1;\n var n = 2;\n var a = 3;\n var o = 0;\n var h = 1;\n var l = 2;\n var c = 3;\n var u = 0;\n var d = 1;\n var p = 2;\n var m = 0;\n var y = 1;\n var g = 2;\n var f = 3;\n var x = 4;\n var b = 5;\n var v = 6;\n var w = 100;\n var M = 101;\n var S = 102;\n var _ = 103;\n var A = 104;\n var T = 200;\n var z = 201;\n var C = 202;\n var I = 203;\n var B = 204;\n var k = 205;\n var O = 206;\n var P = 207;\n var R = 208;\n var E = 209;\n var N = 210;\n var V = 211;\n var L = 212;\n var F = 213;\n var D = 214;\n var U = 0;\n var j = 1;\n var W = 2;\n var J = 3;\n var q = 4;\n var H = 5;\n var X = 6;\n var Y = 7;\n var Z = 0;\n var G = 1;\n var $ = 2;\n var Q = 0;\n var K = 1;\n var tt = 2;\n var et = 3;\n var st = 4;\n var it = 5;\n var rt = 6;\n var nt = 7;\n var at = \"attached\";\n var ot = \"detached\";\n var ht = 300;\n var lt = 301;\n var ct = 302;\n var ut = 303;\n var dt = 304;\n var pt = 306;\n var mt = 1e3;\n var yt = 1001;\n var gt = 1002;\n var ft = 1003;\n var xt = 1004;\n var bt = 1004;\n var vt = 1005;\n var wt = 1005;\n var Mt = 1006;\n var St = 1007;\n var _t = 1007;\n var At = 1008;\n var Tt = 1008;\n var zt = 1009;\n var Ct = 1010;\n var It = 1011;\n var Bt = 1012;\n var kt = 1013;\n var Ot = 1014;\n var Pt = 1015;\n var Rt = 1016;\n var Et = 1017;\n var Nt = 1018;\n var Vt = 1020;\n var Lt = 35902;\n var Ft = 35899;\n var Dt = 1021;\n var Ut = 1022;\n var jt = 1023;\n var Wt = 1026;\n var Jt = 1027;\n var qt = 1028;\n var Ht = 1029;\n var Xt = 1030;\n var Yt = 1031;\n var Zt = 1032;\n var Gt = 1033;\n var $t = 33776;\n var Qt = 33777;\n var Kt = 33778;\n var te = 33779;\n var ee = 35840;\n var se = 35841;\n var ie = 35842;\n var re = 35843;\n var ne = 36196;\n var ae = 37492;\n var oe = 37496;\n var he = 37488;\n var le = 37489;\n var ce = 37490;\n var ue = 37491;\n var de = 37808;\n var pe = 37809;\n var me = 37810;\n var ye = 37811;\n var ge = 37812;\n var fe = 37813;\n var xe = 37814;\n var be = 37815;\n var ve = 37816;\n var we = 37817;\n var Me = 37818;\n var Se = 37819;\n var _e = 37820;\n var Ae = 37821;\n var Te = 36492;\n var ze = 36494;\n var Ce = 36495;\n var Ie = 36283;\n var Be = 36284;\n var ke = 36285;\n var Oe = 36286;\n var Pe = 2200;\n var Re = 2201;\n var Ee = 2202;\n var Ne = 2300;\n var Ve = 2301;\n var Le = 2302;\n var Fe = 2303;\n var De = 2400;\n var Ue = 2401;\n var je = 2402;\n var We = 2500;\n var Je = 2501;\n var qe = 0;\n var He = 1;\n var Xe = 2;\n var Ye = 3200;\n var Ze = 3201;\n var Ge = 3202;\n var $e = 3203;\n var Qe = 0;\n var Ke = 1;\n var ts = \"\";\n var es = \"srgb\";\n var ss = \"srgb-linear\";\n var is = \"linear\";\n var rs = \"srgb\";\n var ns = \"\";\n var as = \"rg\";\n var os = \"ga\";\n var hs = 0;\n var ls = 7680;\n var cs = 7681;\n var us = 7682;\n var ds = 7683;\n var ps = 34055;\n var ms = 34056;\n var ys = 5386;\n var gs = 512;\n var fs = 513;\n var xs = 514;\n var bs = 515;\n var vs = 516;\n var ws = 517;\n var Ms = 518;\n var Ss = 519;\n var _s = 512;\n var As = 513;\n var Ts = 514;\n var zs = 515;\n var Cs = 516;\n var Is = 517;\n var Bs = 518;\n var ks = 519;\n var Os = 35044;\n var Ps = 35048;\n var Rs = 35040;\n var Es = 35045;\n var Ns = 35049;\n var Vs = 35041;\n var Ls = 35046;\n var Fs = 35050;\n var Ds = 35042;\n var Us = \"100\";\n var js = \"300 es\";\n var Ws = 2e3;\n var Js = 2001;\n var qs = { COMPUTE: \"compute\", RENDER: \"render\" };\n var Hs = { PERSPECTIVE: \"perspective\", LINEAR: \"linear\", FLAT: \"flat\" };\n var Xs = {\n NORMAL: \"normal\",\n CENTROID: \"centroid\",\n SAMPLE: \"sample\",\n FIRST: \"first\",\n EITHER: \"either\"\n };\n var Ys = { TEXTURE_COMPARE: \"depthTextureCompare\" };\n var Zs = {\n Int8Array,\n Uint8Array,\n Uint8ClampedArray,\n Int16Array,\n Uint16Array,\n Int32Array,\n Uint32Array,\n Float32Array,\n Float64Array\n };\n function Gs(t2, e2) {\n return new Zs[t2](e2);\n }\n function $s(t2) {\n return ArrayBuffer.isView(t2) && !(t2 instanceof DataView);\n }\n function Qs(t2) {\n return document.createElementNS(\"http://www.w3.org/1999/xhtml\", t2);\n }\n function Ks() {\n const t2 = Qs(\"canvas\");\n return t2.style.display = \"block\", t2;\n }\n var ti = {};\n var ei = null;\n function si(t2) {\n ei = t2;\n }\n function ii() {\n return ei;\n }\n function ri(...t2) {\n const e2 = \"THREE.\" + t2.shift();\n ei ? ei(\"log\", e2, ...t2) : console.log(e2, ...t2);\n }\n function ni(t2) {\n const e2 = t2[0];\n if (\"string\" == typeof e2 && e2.startsWith(\"TSL:\")) {\n const e3 = t2[1];\n e3 && e3.isStackTrace ? t2[0] += \" \" + e3.getLocation() : t2[1] = 'Stack trace not available. Enable \"THREE.Node.captureStackTrace\" to capture stack traces.';\n }\n return t2;\n }\n function ai(...t2) {\n const e2 = \"THREE.\" + (t2 = ni(t2)).shift();\n if (ei) ei(\"warn\", e2, ...t2);\n else {\n const s2 = t2[0];\n s2 && s2.isStackTrace ? console.warn(s2.getError(e2)) : console.warn(e2, ...t2);\n }\n }\n function oi(...t2) {\n const e2 = \"THREE.\" + (t2 = ni(t2)).shift();\n if (ei) ei(\"error\", e2, ...t2);\n else {\n const s2 = t2[0];\n s2 && s2.isStackTrace ? console.error(s2.getError(e2)) : console.error(e2, ...t2);\n }\n }\n function hi(...t2) {\n const e2 = t2.join(\" \");\n e2 in ti || (ti[e2] = true, ai(...t2));\n }\n function ci(t2, e2, s2) {\n return new Promise(function(i2, r2) {\n setTimeout(function n2() {\n switch (t2.clientWaitSync(e2, t2.SYNC_FLUSH_COMMANDS_BIT, 0)) {\n case t2.WAIT_FAILED:\n r2();\n break;\n case t2.TIMEOUT_EXPIRED:\n setTimeout(n2, s2);\n break;\n default:\n i2();\n }\n }, s2);\n });\n }\n var ui = { [U]: 1, [W]: 6, [q]: 7, [J]: 5, [j]: 0, [X]: 2, [Y]: 4, [H]: 3 };\n var di = class {\n addEventListener(t2, e2) {\n void 0 === this._listeners && (this._listeners = {});\n const s2 = this._listeners;\n void 0 === s2[t2] && (s2[t2] = []), -1 === s2[t2].indexOf(e2) && s2[t2].push(e2);\n }\n hasEventListener(t2, e2) {\n const s2 = this._listeners;\n return void 0 !== s2 && void 0 !== s2[t2] && -1 !== s2[t2].indexOf(e2);\n }\n removeEventListener(t2, e2) {\n const s2 = this._listeners;\n if (void 0 === s2) return;\n const i2 = s2[t2];\n if (void 0 !== i2) {\n const t3 = i2.indexOf(e2);\n -1 !== t3 && i2.splice(t3, 1);\n }\n }\n dispatchEvent(t2) {\n const e2 = this._listeners;\n if (void 0 === e2) return;\n const s2 = e2[t2.type];\n if (void 0 !== s2) {\n t2.target = this;\n const e3 = s2.slice(0);\n for (let s3 = 0, i2 = e3.length; s3 < i2; s3++) e3[s3].call(this, t2);\n t2.target = null;\n }\n }\n };\n var pi = [\n \"00\",\n \"01\",\n \"02\",\n \"03\",\n \"04\",\n \"05\",\n \"06\",\n \"07\",\n \"08\",\n \"09\",\n \"0a\",\n \"0b\",\n \"0c\",\n \"0d\",\n \"0e\",\n \"0f\",\n \"10\",\n \"11\",\n \"12\",\n \"13\",\n \"14\",\n \"15\",\n \"16\",\n \"17\",\n \"18\",\n \"19\",\n \"1a\",\n \"1b\",\n \"1c\",\n \"1d\",\n \"1e\",\n \"1f\",\n \"20\",\n \"21\",\n \"22\",\n \"23\",\n \"24\",\n \"25\",\n \"26\",\n \"27\",\n \"28\",\n \"29\",\n \"2a\",\n \"2b\",\n \"2c\",\n \"2d\",\n \"2e\",\n \"2f\",\n \"30\",\n \"31\",\n \"32\",\n \"33\",\n \"34\",\n \"35\",\n \"36\",\n \"37\",\n \"38\",\n \"39\",\n \"3a\",\n \"3b\",\n \"3c\",\n \"3d\",\n \"3e\",\n \"3f\",\n \"40\",\n \"41\",\n \"42\",\n \"43\",\n \"44\",\n \"45\",\n \"46\",\n \"47\",\n \"48\",\n \"49\",\n \"4a\",\n \"4b\",\n \"4c\",\n \"4d\",\n \"4e\",\n \"4f\",\n \"50\",\n \"51\",\n \"52\",\n \"53\",\n \"54\",\n \"55\",\n \"56\",\n \"57\",\n \"58\",\n \"59\",\n \"5a\",\n \"5b\",\n \"5c\",\n \"5d\",\n \"5e\",\n \"5f\",\n \"60\",\n \"61\",\n \"62\",\n \"63\",\n \"64\",\n \"65\",\n \"66\",\n \"67\",\n \"68\",\n \"69\",\n \"6a\",\n \"6b\",\n \"6c\",\n \"6d\",\n \"6e\",\n \"6f\",\n \"70\",\n \"71\",\n \"72\",\n \"73\",\n \"74\",\n \"75\",\n \"76\",\n \"77\",\n \"78\",\n \"79\",\n \"7a\",\n \"7b\",\n \"7c\",\n \"7d\",\n \"7e\",\n \"7f\",\n \"80\",\n \"81\",\n \"82\",\n \"83\",\n \"84\",\n \"85\",\n \"86\",\n \"87\",\n \"88\",\n \"89\",\n \"8a\",\n \"8b\",\n \"8c\",\n \"8d\",\n \"8e\",\n \"8f\",\n \"90\",\n \"91\",\n \"92\",\n \"93\",\n \"94\",\n \"95\",\n \"96\",\n \"97\",\n \"98\",\n \"99\",\n \"9a\",\n \"9b\",\n \"9c\",\n \"9d\",\n \"9e\",\n \"9f\",\n \"a0\",\n \"a1\",\n \"a2\",\n \"a3\",\n \"a4\",\n \"a5\",\n \"a6\",\n \"a7\",\n \"a8\",\n \"a9\",\n \"aa\",\n \"ab\",\n \"ac\",\n \"ad\",\n \"ae\",\n \"af\",\n \"b0\",\n \"b1\",\n \"b2\",\n \"b3\",\n \"b4\",\n \"b5\",\n \"b6\",\n \"b7\",\n \"b8\",\n \"b9\",\n \"ba\",\n \"bb\",\n \"bc\",\n \"bd\",\n \"be\",\n \"bf\",\n \"c0\",\n \"c1\",\n \"c2\",\n \"c3\",\n \"c4\",\n \"c5\",\n \"c6\",\n \"c7\",\n \"c8\",\n \"c9\",\n \"ca\",\n \"cb\",\n \"cc\",\n \"cd\",\n \"ce\",\n \"cf\",\n \"d0\",\n \"d1\",\n \"d2\",\n \"d3\",\n \"d4\",\n \"d5\",\n \"d6\",\n \"d7\",\n \"d8\",\n \"d9\",\n \"da\",\n \"db\",\n \"dc\",\n \"dd\",\n \"de\",\n \"df\",\n \"e0\",\n \"e1\",\n \"e2\",\n \"e3\",\n \"e4\",\n \"e5\",\n \"e6\",\n \"e7\",\n \"e8\",\n \"e9\",\n \"ea\",\n \"eb\",\n \"ec\",\n \"ed\",\n \"ee\",\n \"ef\",\n \"f0\",\n \"f1\",\n \"f2\",\n \"f3\",\n \"f4\",\n \"f5\",\n \"f6\",\n \"f7\",\n \"f8\",\n \"f9\",\n \"fa\",\n \"fb\",\n \"fc\",\n \"fd\",\n \"fe\",\n \"ff\"\n ];\n var mi = 1234567;\n var yi = Math.PI / 180;\n var gi = 180 / Math.PI;\n function fi() {\n const t2 = 4294967295 * Math.random() | 0, e2 = 4294967295 * Math.random() | 0, s2 = 4294967295 * Math.random() | 0, i2 = 4294967295 * Math.random() | 0;\n return (pi[255 & t2] + pi[t2 >> 8 & 255] + pi[t2 >> 16 & 255] + pi[t2 >> 24 & 255] + \"-\" + pi[255 & e2] + pi[e2 >> 8 & 255] + \"-\" + pi[e2 >> 16 & 15 | 64] + pi[e2 >> 24 & 255] + \"-\" + pi[63 & s2 | 128] + pi[s2 >> 8 & 255] + \"-\" + pi[s2 >> 16 & 255] + pi[s2 >> 24 & 255] + pi[255 & i2] + pi[i2 >> 8 & 255] + pi[i2 >> 16 & 255] + pi[i2 >> 24 & 255]).toLowerCase();\n }\n function xi(t2, e2, s2) {\n return Math.max(e2, Math.min(s2, t2));\n }\n function bi(t2, e2) {\n return (t2 % e2 + e2) % e2;\n }\n function vi(t2, e2, s2) {\n return (1 - s2) * t2 + s2 * e2;\n }\n function wi(t2, e2) {\n switch (e2.constructor) {\n case Float32Array:\n return t2;\n case Uint32Array:\n return t2 / 4294967295;\n case Uint16Array:\n return t2 / 65535;\n case Uint8Array:\n return t2 / 255;\n case Int32Array:\n return Math.max(t2 / 2147483647, -1);\n case Int16Array:\n return Math.max(t2 / 32767, -1);\n case Int8Array:\n return Math.max(t2 / 127, -1);\n default:\n throw new Error(\"THREE.MathUtils: Invalid component type.\");\n }\n }\n function Mi(t2, e2) {\n switch (e2.constructor) {\n case Float32Array:\n return t2;\n case Uint32Array:\n return Math.round(4294967295 * t2);\n case Uint16Array:\n return Math.round(65535 * t2);\n case Uint8Array:\n return Math.round(255 * t2);\n case Int32Array:\n return Math.round(2147483647 * t2);\n case Int16Array:\n return Math.round(32767 * t2);\n case Int8Array:\n return Math.round(127 * t2);\n default:\n throw new Error(\"THREE.MathUtils: Invalid component type.\");\n }\n }\n var Si = {\n DEG2RAD: yi,\n RAD2DEG: gi,\n generateUUID: fi,\n clamp: xi,\n euclideanModulo: bi,\n mapLinear: function(t2, e2, s2, i2, r2) {\n return i2 + (t2 - e2) * (r2 - i2) / (s2 - e2);\n },\n inverseLerp: function(t2, e2, s2) {\n return t2 !== e2 ? (s2 - t2) / (e2 - t2) : 0;\n },\n lerp: vi,\n damp: function(t2, e2, s2, i2) {\n return vi(t2, e2, 1 - Math.exp(-s2 * i2));\n },\n pingpong: function(t2, e2 = 1) {\n return e2 - Math.abs(bi(t2, 2 * e2) - e2);\n },\n smoothstep: function(t2, e2, s2) {\n return t2 <= e2 ? 0 : t2 >= s2 ? 1 : (t2 = (t2 - e2) / (s2 - e2)) * t2 * (3 - 2 * t2);\n },\n smootherstep: function(t2, e2, s2) {\n return t2 <= e2 ? 0 : t2 >= s2 ? 1 : (t2 = (t2 - e2) / (s2 - e2)) * t2 * t2 * (t2 * (6 * t2 - 15) + 10);\n },\n randInt: function(t2, e2) {\n return t2 + Math.floor(Math.random() * (e2 - t2 + 1));\n },\n randFloat: function(t2, e2) {\n return t2 + Math.random() * (e2 - t2);\n },\n randFloatSpread: function(t2) {\n return t2 * (0.5 - Math.random());\n },\n seededRandom: function(t2) {\n void 0 !== t2 && (mi = t2);\n let e2 = mi += 1831565813;\n return e2 = Math.imul(e2 ^ e2 >>> 15, 1 | e2), e2 ^= e2 + Math.imul(e2 ^ e2 >>> 7, 61 | e2), ((e2 ^ e2 >>> 14) >>> 0) / 4294967296;\n },\n degToRad: function(t2) {\n return t2 * yi;\n },\n radToDeg: function(t2) {\n return t2 * gi;\n },\n isPowerOfTwo: function(t2) {\n return !(t2 & t2 - 1) && 0 !== t2;\n },\n ceilPowerOfTwo: function(t2) {\n return Math.pow(2, Math.ceil(Math.log(t2) / Math.LN2));\n },\n floorPowerOfTwo: function(t2) {\n return Math.pow(2, Math.floor(Math.log(t2) / Math.LN2));\n },\n setQuaternionFromProperEuler: function(t2, e2, s2, i2, r2) {\n const n2 = Math.cos, a2 = Math.sin, o2 = n2(s2 / 2), h2 = a2(s2 / 2), l2 = n2((e2 + i2) / 2), c2 = a2((e2 + i2) / 2), u2 = n2((e2 - i2) / 2), d2 = a2((e2 - i2) / 2), p2 = n2((i2 - e2) / 2), m2 = a2((i2 - e2) / 2);\n switch (r2) {\n case \"XYX\":\n t2.set(o2 * c2, h2 * u2, h2 * d2, o2 * l2);\n break;\n case \"YZY\":\n t2.set(h2 * d2, o2 * c2, h2 * u2, o2 * l2);\n break;\n case \"ZXZ\":\n t2.set(h2 * u2, h2 * d2, o2 * c2, o2 * l2);\n break;\n case \"XZX\":\n t2.set(o2 * c2, h2 * m2, h2 * p2, o2 * l2);\n break;\n case \"YXY\":\n t2.set(h2 * p2, o2 * c2, h2 * m2, o2 * l2);\n break;\n case \"ZYZ\":\n t2.set(h2 * m2, h2 * p2, o2 * c2, o2 * l2);\n break;\n default:\n ai(\"MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: \" + r2);\n }\n },\n normalize: Mi,\n denormalize: wi\n };\n var _i = class __i {\n static {\n __i.prototype.isVector2 = true;\n }\n constructor(t2 = 0, e2 = 0) {\n this.x = t2, this.y = e2;\n }\n get width() {\n return this.x;\n }\n set width(t2) {\n this.x = t2;\n }\n get height() {\n return this.y;\n }\n set height(t2) {\n this.y = t2;\n }\n set(t2, e2) {\n return this.x = t2, this.y = e2, this;\n }\n setScalar(t2) {\n return this.x = t2, this.y = t2, this;\n }\n setX(t2) {\n return this.x = t2, this;\n }\n setY(t2) {\n return this.y = t2, this;\n }\n setComponent(t2, e2) {\n switch (t2) {\n case 0:\n this.x = e2;\n break;\n case 1:\n this.y = e2;\n break;\n default:\n throw new Error(\"THREE.Vector2: index is out of range: \" + t2);\n }\n return this;\n }\n getComponent(t2) {\n switch (t2) {\n case 0:\n return this.x;\n case 1:\n return this.y;\n default:\n throw new Error(\"THREE.Vector2: index is out of range: \" + t2);\n }\n }\n clone() {\n return new this.constructor(this.x, this.y);\n }\n copy(t2) {\n return this.x = t2.x, this.y = t2.y, this;\n }\n add(t2) {\n return this.x += t2.x, this.y += t2.y, this;\n }\n addScalar(t2) {\n return this.x += t2, this.y += t2, this;\n }\n addVectors(t2, e2) {\n return this.x = t2.x + e2.x, this.y = t2.y + e2.y, this;\n }\n addScaledVector(t2, e2) {\n return this.x += t2.x * e2, this.y += t2.y * e2, this;\n }\n sub(t2) {\n return this.x -= t2.x, this.y -= t2.y, this;\n }\n subScalar(t2) {\n return this.x -= t2, this.y -= t2, this;\n }\n subVectors(t2, e2) {\n return this.x = t2.x - e2.x, this.y = t2.y - e2.y, this;\n }\n multiply(t2) {\n return this.x *= t2.x, this.y *= t2.y, this;\n }\n multiplyScalar(t2) {\n return this.x *= t2, this.y *= t2, this;\n }\n divide(t2) {\n return this.x /= t2.x, this.y /= t2.y, this;\n }\n divideScalar(t2) {\n return this.multiplyScalar(1 / t2);\n }\n applyMatrix3(t2) {\n const e2 = this.x, s2 = this.y, i2 = t2.elements;\n return this.x = i2[0] * e2 + i2[3] * s2 + i2[6], this.y = i2[1] * e2 + i2[4] * s2 + i2[7], this;\n }\n min(t2) {\n return this.x = Math.min(this.x, t2.x), this.y = Math.min(this.y, t2.y), this;\n }\n max(t2) {\n return this.x = Math.max(this.x, t2.x), this.y = Math.max(this.y, t2.y), this;\n }\n clamp(t2, e2) {\n return this.x = xi(this.x, t2.x, e2.x), this.y = xi(this.y, t2.y, e2.y), this;\n }\n clampScalar(t2, e2) {\n return this.x = xi(this.x, t2, e2), this.y = xi(this.y, t2, e2), this;\n }\n clampLength(t2, e2) {\n const s2 = this.length();\n return this.divideScalar(s2 || 1).multiplyScalar(xi(s2, t2, e2));\n }\n floor() {\n return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this;\n }\n ceil() {\n return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this;\n }\n round() {\n return this.x = Math.round(this.x), this.y = Math.round(this.y), this;\n }\n roundToZero() {\n return this.x = Math.trunc(this.x), this.y = Math.trunc(this.y), this;\n }\n negate() {\n return this.x = -this.x, this.y = -this.y, this;\n }\n dot(t2) {\n return this.x * t2.x + this.y * t2.y;\n }\n cross(t2) {\n return this.x * t2.y - this.y * t2.x;\n }\n lengthSq() {\n return this.x * this.x + this.y * this.y;\n }\n length() {\n return Math.sqrt(this.x * this.x + this.y * this.y);\n }\n manhattanLength() {\n return Math.abs(this.x) + Math.abs(this.y);\n }\n normalize() {\n return this.divideScalar(this.length() || 1);\n }\n angle() {\n return Math.atan2(-this.y, -this.x) + Math.PI;\n }\n angleTo(t2) {\n const e2 = Math.sqrt(this.lengthSq() * t2.lengthSq());\n if (0 === e2) return Math.PI / 2;\n const s2 = this.dot(t2) / e2;\n return Math.acos(xi(s2, -1, 1));\n }\n distanceTo(t2) {\n return Math.sqrt(this.distanceToSquared(t2));\n }\n distanceToSquared(t2) {\n const e2 = this.x - t2.x, s2 = this.y - t2.y;\n return e2 * e2 + s2 * s2;\n }\n manhattanDistanceTo(t2) {\n return Math.abs(this.x - t2.x) + Math.abs(this.y - t2.y);\n }\n setLength(t2) {\n return this.normalize().multiplyScalar(t2);\n }\n lerp(t2, e2) {\n return this.x += (t2.x - this.x) * e2, this.y += (t2.y - this.y) * e2, this;\n }\n lerpVectors(t2, e2, s2) {\n return this.x = t2.x + (e2.x - t2.x) * s2, this.y = t2.y + (e2.y - t2.y) * s2, this;\n }\n equals(t2) {\n return t2.x === this.x && t2.y === this.y;\n }\n fromArray(t2, e2 = 0) {\n return this.x = t2[e2], this.y = t2[e2 + 1], this;\n }\n toArray(t2 = [], e2 = 0) {\n return t2[e2] = this.x, t2[e2 + 1] = this.y, t2;\n }\n fromBufferAttribute(t2, e2) {\n return this.x = t2.getX(e2), this.y = t2.getY(e2), this;\n }\n rotateAround(t2, e2) {\n const s2 = Math.cos(e2), i2 = Math.sin(e2), r2 = this.x - t2.x, n2 = this.y - t2.y;\n return this.x = r2 * s2 - n2 * i2 + t2.x, this.y = r2 * i2 + n2 * s2 + t2.y, this;\n }\n random() {\n return this.x = Math.random(), this.y = Math.random(), this;\n }\n *[Symbol.iterator]() {\n yield this.x, yield this.y;\n }\n };\n var Ai = class {\n constructor(t2 = 0, e2 = 0, s2 = 0, i2 = 1) {\n this.isQuaternion = true, this._x = t2, this._y = e2, this._z = s2, this._w = i2;\n }\n static slerpFlat(t2, e2, s2, i2, r2, n2, a2) {\n let o2 = s2[i2 + 0], h2 = s2[i2 + 1], l2 = s2[i2 + 2], c2 = s2[i2 + 3], u2 = r2[n2 + 0], d2 = r2[n2 + 1], p2 = r2[n2 + 2], m2 = r2[n2 + 3];\n if (c2 !== m2 || o2 !== u2 || h2 !== d2 || l2 !== p2) {\n let t3 = o2 * u2 + h2 * d2 + l2 * p2 + c2 * m2;\n t3 < 0 && (u2 = -u2, d2 = -d2, p2 = -p2, m2 = -m2, t3 = -t3);\n let e3 = 1 - a2;\n if (t3 < 0.9995) {\n const s3 = Math.acos(t3), i3 = Math.sin(s3);\n e3 = Math.sin(e3 * s3) / i3, o2 = o2 * e3 + u2 * (a2 = Math.sin(a2 * s3) / i3), h2 = h2 * e3 + d2 * a2, l2 = l2 * e3 + p2 * a2, c2 = c2 * e3 + m2 * a2;\n } else {\n o2 = o2 * e3 + u2 * a2, h2 = h2 * e3 + d2 * a2, l2 = l2 * e3 + p2 * a2, c2 = c2 * e3 + m2 * a2;\n const t4 = 1 / Math.sqrt(o2 * o2 + h2 * h2 + l2 * l2 + c2 * c2);\n o2 *= t4, h2 *= t4, l2 *= t4, c2 *= t4;\n }\n }\n t2[e2] = o2, t2[e2 + 1] = h2, t2[e2 + 2] = l2, t2[e2 + 3] = c2;\n }\n static multiplyQuaternionsFlat(t2, e2, s2, i2, r2, n2) {\n const a2 = s2[i2], o2 = s2[i2 + 1], h2 = s2[i2 + 2], l2 = s2[i2 + 3], c2 = r2[n2], u2 = r2[n2 + 1], d2 = r2[n2 + 2], p2 = r2[n2 + 3];\n return t2[e2] = a2 * p2 + l2 * c2 + o2 * d2 - h2 * u2, t2[e2 + 1] = o2 * p2 + l2 * u2 + h2 * c2 - a2 * d2, t2[e2 + 2] = h2 * p2 + l2 * d2 + a2 * u2 - o2 * c2, t2[e2 + 3] = l2 * p2 - a2 * c2 - o2 * u2 - h2 * d2, t2;\n }\n get x() {\n return this._x;\n }\n set x(t2) {\n this._x = t2, this._onChangeCallback();\n }\n get y() {\n return this._y;\n }\n set y(t2) {\n this._y = t2, this._onChangeCallback();\n }\n get z() {\n return this._z;\n }\n set z(t2) {\n this._z = t2, this._onChangeCallback();\n }\n get w() {\n return this._w;\n }\n set w(t2) {\n this._w = t2, this._onChangeCallback();\n }\n set(t2, e2, s2, i2) {\n return this._x = t2, this._y = e2, this._z = s2, this._w = i2, this._onChangeCallback(), this;\n }\n clone() {\n return new this.constructor(this._x, this._y, this._z, this._w);\n }\n copy(t2) {\n return this._x = t2.x, this._y = t2.y, this._z = t2.z, this._w = t2.w, this._onChangeCallback(), this;\n }\n setFromEuler(t2, e2 = true) {\n const s2 = t2._x, i2 = t2._y, r2 = t2._z, n2 = t2._order, a2 = Math.cos, o2 = Math.sin, h2 = a2(s2 / 2), l2 = a2(i2 / 2), c2 = a2(r2 / 2), u2 = o2(s2 / 2), d2 = o2(i2 / 2), p2 = o2(r2 / 2);\n switch (n2) {\n case \"XYZ\":\n this._x = u2 * l2 * c2 + h2 * d2 * p2, this._y = h2 * d2 * c2 - u2 * l2 * p2, this._z = h2 * l2 * p2 + u2 * d2 * c2, this._w = h2 * l2 * c2 - u2 * d2 * p2;\n break;\n case \"YXZ\":\n this._x = u2 * l2 * c2 + h2 * d2 * p2, this._y = h2 * d2 * c2 - u2 * l2 * p2, this._z = h2 * l2 * p2 - u2 * d2 * c2, this._w = h2 * l2 * c2 + u2 * d2 * p2;\n break;\n case \"ZXY\":\n this._x = u2 * l2 * c2 - h2 * d2 * p2, this._y = h2 * d2 * c2 + u2 * l2 * p2, this._z = h2 * l2 * p2 + u2 * d2 * c2, this._w = h2 * l2 * c2 - u2 * d2 * p2;\n break;\n case \"ZYX\":\n this._x = u2 * l2 * c2 - h2 * d2 * p2, this._y = h2 * d2 * c2 + u2 * l2 * p2, this._z = h2 * l2 * p2 - u2 * d2 * c2, this._w = h2 * l2 * c2 + u2 * d2 * p2;\n break;\n case \"YZX\":\n this._x = u2 * l2 * c2 + h2 * d2 * p2, this._y = h2 * d2 * c2 + u2 * l2 * p2, this._z = h2 * l2 * p2 - u2 * d2 * c2, this._w = h2 * l2 * c2 - u2 * d2 * p2;\n break;\n case \"XZY\":\n this._x = u2 * l2 * c2 - h2 * d2 * p2, this._y = h2 * d2 * c2 - u2 * l2 * p2, this._z = h2 * l2 * p2 + u2 * d2 * c2, this._w = h2 * l2 * c2 + u2 * d2 * p2;\n break;\n default:\n ai(\"Quaternion: .setFromEuler() encountered an unknown order: \" + n2);\n }\n return true === e2 && this._onChangeCallback(), this;\n }\n setFromAxisAngle(t2, e2) {\n const s2 = e2 / 2, i2 = Math.sin(s2);\n return this._x = t2.x * i2, this._y = t2.y * i2, this._z = t2.z * i2, this._w = Math.cos(s2), this._onChangeCallback(), this;\n }\n setFromRotationMatrix(t2) {\n const e2 = t2.elements, s2 = e2[0], i2 = e2[4], r2 = e2[8], n2 = e2[1], a2 = e2[5], o2 = e2[9], h2 = e2[2], l2 = e2[6], c2 = e2[10], u2 = s2 + a2 + c2;\n if (u2 > 0) {\n const t3 = 0.5 / Math.sqrt(u2 + 1);\n this._w = 0.25 / t3, this._x = (l2 - o2) * t3, this._y = (r2 - h2) * t3, this._z = (n2 - i2) * t3;\n } else if (s2 > a2 && s2 > c2) {\n const t3 = 2 * Math.sqrt(1 + s2 - a2 - c2);\n this._w = (l2 - o2) / t3, this._x = 0.25 * t3, this._y = (i2 + n2) / t3, this._z = (r2 + h2) / t3;\n } else if (a2 > c2) {\n const t3 = 2 * Math.sqrt(1 + a2 - s2 - c2);\n this._w = (r2 - h2) / t3, this._x = (i2 + n2) / t3, this._y = 0.25 * t3, this._z = (o2 + l2) / t3;\n } else {\n const t3 = 2 * Math.sqrt(1 + c2 - s2 - a2);\n this._w = (n2 - i2) / t3, this._x = (r2 + h2) / t3, this._y = (o2 + l2) / t3, this._z = 0.25 * t3;\n }\n return this._onChangeCallback(), this;\n }\n setFromUnitVectors(t2, e2) {\n let s2 = t2.dot(e2) + 1;\n return s2 < 1e-8 ? (s2 = 0, Math.abs(t2.x) > Math.abs(t2.z) ? (this._x = -t2.y, this._y = t2.x, this._z = 0, this._w = s2) : (this._x = 0, this._y = -t2.z, this._z = t2.y, this._w = s2)) : (this._x = t2.y * e2.z - t2.z * e2.y, this._y = t2.z * e2.x - t2.x * e2.z, this._z = t2.x * e2.y - t2.y * e2.x, this._w = s2), this.normalize();\n }\n angleTo(t2) {\n return 2 * Math.acos(Math.abs(xi(this.dot(t2), -1, 1)));\n }\n rotateTowards(t2, e2) {\n const s2 = this.angleTo(t2);\n if (0 === s2) return this;\n const i2 = Math.min(1, e2 / s2);\n return this.slerp(t2, i2), this;\n }\n identity() {\n return this.set(0, 0, 0, 1);\n }\n invert() {\n return this.conjugate();\n }\n conjugate() {\n return this._x *= -1, this._y *= -1, this._z *= -1, this._onChangeCallback(), this;\n }\n dot(t2) {\n return this._x * t2._x + this._y * t2._y + this._z * t2._z + this._w * t2._w;\n }\n lengthSq() {\n return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w;\n }\n length() {\n return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w);\n }\n normalize() {\n let t2 = this.length();\n return 0 === t2 ? (this._x = 0, this._y = 0, this._z = 0, this._w = 1) : (t2 = 1 / t2, this._x = this._x * t2, this._y = this._y * t2, this._z = this._z * t2, this._w = this._w * t2), this._onChangeCallback(), this;\n }\n multiply(t2) {\n return this.multiplyQuaternions(this, t2);\n }\n premultiply(t2) {\n return this.multiplyQuaternions(t2, this);\n }\n multiplyQuaternions(t2, e2) {\n const s2 = t2._x, i2 = t2._y, r2 = t2._z, n2 = t2._w, a2 = e2._x, o2 = e2._y, h2 = e2._z, l2 = e2._w;\n return this._x = s2 * l2 + n2 * a2 + i2 * h2 - r2 * o2, this._y = i2 * l2 + n2 * o2 + r2 * a2 - s2 * h2, this._z = r2 * l2 + n2 * h2 + s2 * o2 - i2 * a2, this._w = n2 * l2 - s2 * a2 - i2 * o2 - r2 * h2, this._onChangeCallback(), this;\n }\n slerp(t2, e2) {\n let s2 = t2._x, i2 = t2._y, r2 = t2._z, n2 = t2._w, a2 = this.dot(t2);\n a2 < 0 && (s2 = -s2, i2 = -i2, r2 = -r2, n2 = -n2, a2 = -a2);\n let o2 = 1 - e2;\n if (a2 < 0.9995) {\n const t3 = Math.acos(a2), h2 = Math.sin(t3);\n o2 = Math.sin(o2 * t3) / h2, e2 = Math.sin(e2 * t3) / h2, this._x = this._x * o2 + s2 * e2, this._y = this._y * o2 + i2 * e2, this._z = this._z * o2 + r2 * e2, this._w = this._w * o2 + n2 * e2, this._onChangeCallback();\n } else\n this._x = this._x * o2 + s2 * e2, this._y = this._y * o2 + i2 * e2, this._z = this._z * o2 + r2 * e2, this._w = this._w * o2 + n2 * e2, this.normalize();\n return this;\n }\n slerpQuaternions(t2, e2, s2) {\n return this.copy(t2).slerp(e2, s2);\n }\n random() {\n const t2 = 2 * Math.PI * Math.random(), e2 = 2 * Math.PI * Math.random(), s2 = Math.random(), i2 = Math.sqrt(1 - s2), r2 = Math.sqrt(s2);\n return this.set(i2 * Math.sin(t2), i2 * Math.cos(t2), r2 * Math.sin(e2), r2 * Math.cos(e2));\n }\n equals(t2) {\n return t2._x === this._x && t2._y === this._y && t2._z === this._z && t2._w === this._w;\n }\n fromArray(t2, e2 = 0) {\n return this._x = t2[e2], this._y = t2[e2 + 1], this._z = t2[e2 + 2], this._w = t2[e2 + 3], this._onChangeCallback(), this;\n }\n toArray(t2 = [], e2 = 0) {\n return t2[e2] = this._x, t2[e2 + 1] = this._y, t2[e2 + 2] = this._z, t2[e2 + 3] = this._w, t2;\n }\n fromBufferAttribute(t2, e2) {\n return this._x = t2.getX(e2), this._y = t2.getY(e2), this._z = t2.getZ(e2), this._w = t2.getW(e2), this._onChangeCallback(), this;\n }\n toJSON() {\n return this.toArray();\n }\n _onChange(t2) {\n return this._onChangeCallback = t2, this;\n }\n _onChangeCallback() {\n }\n *[Symbol.iterator]() {\n yield this._x, yield this._y, yield this._z, yield this._w;\n }\n };\n var Ti = class _Ti {\n static {\n _Ti.prototype.isVector3 = true;\n }\n constructor(t2 = 0, e2 = 0, s2 = 0) {\n this.x = t2, this.y = e2, this.z = s2;\n }\n set(t2, e2, s2) {\n return void 0 === s2 && (s2 = this.z), this.x = t2, this.y = e2, this.z = s2, this;\n }\n setScalar(t2) {\n return this.x = t2, this.y = t2, this.z = t2, this;\n }\n setX(t2) {\n return this.x = t2, this;\n }\n setY(t2) {\n return this.y = t2, this;\n }\n setZ(t2) {\n return this.z = t2, this;\n }\n setComponent(t2, e2) {\n switch (t2) {\n case 0:\n this.x = e2;\n break;\n case 1:\n this.y = e2;\n break;\n case 2:\n this.z = e2;\n break;\n default:\n throw new Error(\"THREE.Vector3: index is out of range: \" + t2);\n }\n return this;\n }\n getComponent(t2) {\n switch (t2) {\n case 0:\n return this.x;\n case 1:\n return this.y;\n case 2:\n return this.z;\n default:\n throw new Error(\"THREE.Vector3: index is out of range: \" + t2);\n }\n }\n clone() {\n return new this.constructor(this.x, this.y, this.z);\n }\n copy(t2) {\n return this.x = t2.x, this.y = t2.y, this.z = t2.z, this;\n }\n add(t2) {\n return this.x += t2.x, this.y += t2.y, this.z += t2.z, this;\n }\n addScalar(t2) {\n return this.x += t2, this.y += t2, this.z += t2, this;\n }\n addVectors(t2, e2) {\n return this.x = t2.x + e2.x, this.y = t2.y + e2.y, this.z = t2.z + e2.z, this;\n }\n addScaledVector(t2, e2) {\n return this.x += t2.x * e2, this.y += t2.y * e2, this.z += t2.z * e2, this;\n }\n sub(t2) {\n return this.x -= t2.x, this.y -= t2.y, this.z -= t2.z, this;\n }\n subScalar(t2) {\n return this.x -= t2, this.y -= t2, this.z -= t2, this;\n }\n subVectors(t2, e2) {\n return this.x = t2.x - e2.x, this.y = t2.y - e2.y, this.z = t2.z - e2.z, this;\n }\n multiply(t2) {\n return this.x *= t2.x, this.y *= t2.y, this.z *= t2.z, this;\n }\n multiplyScalar(t2) {\n return this.x *= t2, this.y *= t2, this.z *= t2, this;\n }\n multiplyVectors(t2, e2) {\n return this.x = t2.x * e2.x, this.y = t2.y * e2.y, this.z = t2.z * e2.z, this;\n }\n applyEuler(t2) {\n return this.applyQuaternion(Ci.setFromEuler(t2));\n }\n applyAxisAngle(t2, e2) {\n return this.applyQuaternion(Ci.setFromAxisAngle(t2, e2));\n }\n applyMatrix3(t2) {\n const e2 = this.x, s2 = this.y, i2 = this.z, r2 = t2.elements;\n return this.x = r2[0] * e2 + r2[3] * s2 + r2[6] * i2, this.y = r2[1] * e2 + r2[4] * s2 + r2[7] * i2, this.z = r2[2] * e2 + r2[5] * s2 + r2[8] * i2, this;\n }\n applyNormalMatrix(t2) {\n return this.applyMatrix3(t2).normalize();\n }\n applyMatrix4(t2) {\n const e2 = this.x, s2 = this.y, i2 = this.z, r2 = t2.elements, n2 = 1 / (r2[3] * e2 + r2[7] * s2 + r2[11] * i2 + r2[15]);\n return this.x = (r2[0] * e2 + r2[4] * s2 + r2[8] * i2 + r2[12]) * n2, this.y = (r2[1] * e2 + r2[5] * s2 + r2[9] * i2 + r2[13]) * n2, this.z = (r2[2] * e2 + r2[6] * s2 + r2[10] * i2 + r2[14]) * n2, this;\n }\n applyQuaternion(t2) {\n const e2 = this.x, s2 = this.y, i2 = this.z, r2 = t2.x, n2 = t2.y, a2 = t2.z, o2 = t2.w, h2 = 2 * (n2 * i2 - a2 * s2), l2 = 2 * (a2 * e2 - r2 * i2), c2 = 2 * (r2 * s2 - n2 * e2);\n return this.x = e2 + o2 * h2 + n2 * c2 - a2 * l2, this.y = s2 + o2 * l2 + a2 * h2 - r2 * c2, this.z = i2 + o2 * c2 + r2 * l2 - n2 * h2, this;\n }\n project(t2) {\n return this.applyMatrix4(t2.matrixWorldInverse).applyMatrix4(t2.projectionMatrix);\n }\n unproject(t2) {\n return this.applyMatrix4(t2.projectionMatrixInverse).applyMatrix4(t2.matrixWorld);\n }\n transformDirection(t2) {\n const e2 = this.x, s2 = this.y, i2 = this.z, r2 = t2.elements;\n return this.x = r2[0] * e2 + r2[4] * s2 + r2[8] * i2, this.y = r2[1] * e2 + r2[5] * s2 + r2[9] * i2, this.z = r2[2] * e2 + r2[6] * s2 + r2[10] * i2, this.normalize();\n }\n divide(t2) {\n return this.x /= t2.x, this.y /= t2.y, this.z /= t2.z, this;\n }\n divideScalar(t2) {\n return this.multiplyScalar(1 / t2);\n }\n min(t2) {\n return this.x = Math.min(this.x, t2.x), this.y = Math.min(this.y, t2.y), this.z = Math.min(this.z, t2.z), this;\n }\n max(t2) {\n return this.x = Math.max(this.x, t2.x), this.y = Math.max(this.y, t2.y), this.z = Math.max(this.z, t2.z), this;\n }\n clamp(t2, e2) {\n return this.x = xi(this.x, t2.x, e2.x), this.y = xi(this.y, t2.y, e2.y), this.z = xi(this.z, t2.z, e2.z), this;\n }\n clampScalar(t2, e2) {\n return this.x = xi(this.x, t2, e2), this.y = xi(this.y, t2, e2), this.z = xi(this.z, t2, e2), this;\n }\n clampLength(t2, e2) {\n const s2 = this.length();\n return this.divideScalar(s2 || 1).multiplyScalar(xi(s2, t2, e2));\n }\n floor() {\n return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this.z = Math.floor(this.z), this;\n }\n ceil() {\n return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this.z = Math.ceil(this.z), this;\n }\n round() {\n return this.x = Math.round(this.x), this.y = Math.round(this.y), this.z = Math.round(this.z), this;\n }\n roundToZero() {\n return this.x = Math.trunc(this.x), this.y = Math.trunc(this.y), this.z = Math.trunc(this.z), this;\n }\n negate() {\n return this.x = -this.x, this.y = -this.y, this.z = -this.z, this;\n }\n dot(t2) {\n return this.x * t2.x + this.y * t2.y + this.z * t2.z;\n }\n lengthSq() {\n return this.x * this.x + this.y * this.y + this.z * this.z;\n }\n length() {\n return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);\n }\n manhattanLength() {\n return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z);\n }\n normalize() {\n return this.divideScalar(this.length() || 1);\n }\n setLength(t2) {\n return this.normalize().multiplyScalar(t2);\n }\n lerp(t2, e2) {\n return this.x += (t2.x - this.x) * e2, this.y += (t2.y - this.y) * e2, this.z += (t2.z - this.z) * e2, this;\n }\n lerpVectors(t2, e2, s2) {\n return this.x = t2.x + (e2.x - t2.x) * s2, this.y = t2.y + (e2.y - t2.y) * s2, this.z = t2.z + (e2.z - t2.z) * s2, this;\n }\n cross(t2) {\n return this.crossVectors(this, t2);\n }\n crossVectors(t2, e2) {\n const s2 = t2.x, i2 = t2.y, r2 = t2.z, n2 = e2.x, a2 = e2.y, o2 = e2.z;\n return this.x = i2 * o2 - r2 * a2, this.y = r2 * n2 - s2 * o2, this.z = s2 * a2 - i2 * n2, this;\n }\n projectOnVector(t2) {\n const e2 = t2.lengthSq();\n if (0 === e2) return this.set(0, 0, 0);\n const s2 = t2.dot(this) / e2;\n return this.copy(t2).multiplyScalar(s2);\n }\n projectOnPlane(t2) {\n return zi.copy(this).projectOnVector(t2), this.sub(zi);\n }\n reflect(t2) {\n return this.sub(zi.copy(t2).multiplyScalar(2 * this.dot(t2)));\n }\n angleTo(t2) {\n const e2 = Math.sqrt(this.lengthSq() * t2.lengthSq());\n if (0 === e2) return Math.PI / 2;\n const s2 = this.dot(t2) / e2;\n return Math.acos(xi(s2, -1, 1));\n }\n distanceTo(t2) {\n return Math.sqrt(this.distanceToSquared(t2));\n }\n distanceToSquared(t2) {\n const e2 = this.x - t2.x, s2 = this.y - t2.y, i2 = this.z - t2.z;\n return e2 * e2 + s2 * s2 + i2 * i2;\n }\n manhattanDistanceTo(t2) {\n return Math.abs(this.x - t2.x) + Math.abs(this.y - t2.y) + Math.abs(this.z - t2.z);\n }\n setFromSpherical(t2) {\n return this.setFromSphericalCoords(t2.radius, t2.phi, t2.theta);\n }\n setFromSphericalCoords(t2, e2, s2) {\n const i2 = Math.sin(e2) * t2;\n return this.x = i2 * Math.sin(s2), this.y = Math.cos(e2) * t2, this.z = i2 * Math.cos(s2), this;\n }\n setFromCylindrical(t2) {\n return this.setFromCylindricalCoords(t2.radius, t2.theta, t2.y);\n }\n setFromCylindricalCoords(t2, e2, s2) {\n return this.x = t2 * Math.sin(e2), this.y = s2, this.z = t2 * Math.cos(e2), this;\n }\n setFromMatrixPosition(t2) {\n const e2 = t2.elements;\n return this.x = e2[12], this.y = e2[13], this.z = e2[14], this;\n }\n setFromMatrixScale(t2) {\n const e2 = this.setFromMatrixColumn(t2, 0).length(), s2 = this.setFromMatrixColumn(t2, 1).length(), i2 = this.setFromMatrixColumn(t2, 2).length();\n return this.x = e2, this.y = s2, this.z = i2, this;\n }\n setFromMatrixColumn(t2, e2) {\n return this.fromArray(t2.elements, 4 * e2);\n }\n setFromMatrix3Column(t2, e2) {\n return this.fromArray(t2.elements, 3 * e2);\n }\n setFromEuler(t2) {\n return this.x = t2._x, this.y = t2._y, this.z = t2._z, this;\n }\n setFromColor(t2) {\n return this.x = t2.r, this.y = t2.g, this.z = t2.b, this;\n }\n equals(t2) {\n return t2.x === this.x && t2.y === this.y && t2.z === this.z;\n }\n fromArray(t2, e2 = 0) {\n return this.x = t2[e2], this.y = t2[e2 + 1], this.z = t2[e2 + 2], this;\n }\n toArray(t2 = [], e2 = 0) {\n return t2[e2] = this.x, t2[e2 + 1] = this.y, t2[e2 + 2] = this.z, t2;\n }\n fromBufferAttribute(t2, e2) {\n return this.x = t2.getX(e2), this.y = t2.getY(e2), this.z = t2.getZ(e2), this;\n }\n random() {\n return this.x = Math.random(), this.y = Math.random(), this.z = Math.random(), this;\n }\n randomDirection() {\n const t2 = Math.random() * Math.PI * 2, e2 = 2 * Math.random() - 1, s2 = Math.sqrt(1 - e2 * e2);\n return this.x = s2 * Math.cos(t2), this.y = e2, this.z = s2 * Math.sin(t2), this;\n }\n *[Symbol.iterator]() {\n yield this.x, yield this.y, yield this.z;\n }\n };\n var zi = new Ti();\n var Ci = new Ai();\n var Ii = class _Ii {\n static {\n _Ii.prototype.isMatrix3 = true;\n }\n constructor(t2, e2, s2, i2, r2, n2, a2, o2, h2) {\n this.elements = [1, 0, 0, 0, 1, 0, 0, 0, 1], void 0 !== t2 && this.set(t2, e2, s2, i2, r2, n2, a2, o2, h2);\n }\n set(t2, e2, s2, i2, r2, n2, a2, o2, h2) {\n const l2 = this.elements;\n return l2[0] = t2, l2[1] = i2, l2[2] = a2, l2[3] = e2, l2[4] = r2, l2[5] = o2, l2[6] = s2, l2[7] = n2, l2[8] = h2, this;\n }\n identity() {\n return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1), this;\n }\n copy(t2) {\n const e2 = this.elements, s2 = t2.elements;\n return e2[0] = s2[0], e2[1] = s2[1], e2[2] = s2[2], e2[3] = s2[3], e2[4] = s2[4], e2[5] = s2[5], e2[6] = s2[6], e2[7] = s2[7], e2[8] = s2[8], this;\n }\n extractBasis(t2, e2, s2) {\n return t2.setFromMatrix3Column(this, 0), e2.setFromMatrix3Column(this, 1), s2.setFromMatrix3Column(this, 2), this;\n }\n setFromMatrix4(t2) {\n const e2 = t2.elements;\n return this.set(e2[0], e2[4], e2[8], e2[1], e2[5], e2[9], e2[2], e2[6], e2[10]), this;\n }\n multiply(t2) {\n return this.multiplyMatrices(this, t2);\n }\n premultiply(t2) {\n return this.multiplyMatrices(t2, this);\n }\n multiplyMatrices(t2, e2) {\n const s2 = t2.elements, i2 = e2.elements, r2 = this.elements, n2 = s2[0], a2 = s2[3], o2 = s2[6], h2 = s2[1], l2 = s2[4], c2 = s2[7], u2 = s2[2], d2 = s2[5], p2 = s2[8], m2 = i2[0], y2 = i2[3], g2 = i2[6], f2 = i2[1], x2 = i2[4], b2 = i2[7], v2 = i2[2], w2 = i2[5], M2 = i2[8];\n return r2[0] = n2 * m2 + a2 * f2 + o2 * v2, r2[3] = n2 * y2 + a2 * x2 + o2 * w2, r2[6] = n2 * g2 + a2 * b2 + o2 * M2, r2[1] = h2 * m2 + l2 * f2 + c2 * v2, r2[4] = h2 * y2 + l2 * x2 + c2 * w2, r2[7] = h2 * g2 + l2 * b2 + c2 * M2, r2[2] = u2 * m2 + d2 * f2 + p2 * v2, r2[5] = u2 * y2 + d2 * x2 + p2 * w2, r2[8] = u2 * g2 + d2 * b2 + p2 * M2, this;\n }\n multiplyScalar(t2) {\n const e2 = this.elements;\n return e2[0] *= t2, e2[3] *= t2, e2[6] *= t2, e2[1] *= t2, e2[4] *= t2, e2[7] *= t2, e2[2] *= t2, e2[5] *= t2, e2[8] *= t2, this;\n }\n determinant() {\n const t2 = this.elements, e2 = t2[0], s2 = t2[1], i2 = t2[2], r2 = t2[3], n2 = t2[4], a2 = t2[5], o2 = t2[6], h2 = t2[7], l2 = t2[8];\n return e2 * n2 * l2 - e2 * a2 * h2 - s2 * r2 * l2 + s2 * a2 * o2 + i2 * r2 * h2 - i2 * n2 * o2;\n }\n invert() {\n const t2 = this.elements, e2 = t2[0], s2 = t2[1], i2 = t2[2], r2 = t2[3], n2 = t2[4], a2 = t2[5], o2 = t2[6], h2 = t2[7], l2 = t2[8], c2 = l2 * n2 - a2 * h2, u2 = a2 * o2 - l2 * r2, d2 = h2 * r2 - n2 * o2, p2 = e2 * c2 + s2 * u2 + i2 * d2;\n if (0 === p2) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0);\n const m2 = 1 / p2;\n return t2[0] = c2 * m2, t2[1] = (i2 * h2 - l2 * s2) * m2, t2[2] = (a2 * s2 - i2 * n2) * m2, t2[3] = u2 * m2, t2[4] = (l2 * e2 - i2 * o2) * m2, t2[5] = (i2 * r2 - a2 * e2) * m2, t2[6] = d2 * m2, t2[7] = (s2 * o2 - h2 * e2) * m2, t2[8] = (n2 * e2 - s2 * r2) * m2, this;\n }\n transpose() {\n let t2;\n const e2 = this.elements;\n return t2 = e2[1], e2[1] = e2[3], e2[3] = t2, t2 = e2[2], e2[2] = e2[6], e2[6] = t2, t2 = e2[5], e2[5] = e2[7], e2[7] = t2, this;\n }\n getNormalMatrix(t2) {\n return this.setFromMatrix4(t2).invert().transpose();\n }\n transposeIntoArray(t2) {\n const e2 = this.elements;\n return t2[0] = e2[0], t2[1] = e2[3], t2[2] = e2[6], t2[3] = e2[1], t2[4] = e2[4], t2[5] = e2[7], t2[6] = e2[2], t2[7] = e2[5], t2[8] = e2[8], this;\n }\n setUvTransform(t2, e2, s2, i2, r2, n2, a2) {\n const o2 = Math.cos(r2), h2 = Math.sin(r2);\n return this.set(\n s2 * o2,\n s2 * h2,\n -s2 * (o2 * n2 + h2 * a2) + n2 + t2,\n -i2 * h2,\n i2 * o2,\n -i2 * (-h2 * n2 + o2 * a2) + a2 + e2,\n 0,\n 0,\n 1\n ), this;\n }\n scale(t2, e2) {\n return hi(\"Matrix3: .scale() is deprecated. Use .makeScale() instead.\"), this.premultiply(Bi.makeScale(t2, e2)), this;\n }\n rotate(t2) {\n return hi(\"Matrix3: .rotate() is deprecated. Use .makeRotation() instead.\"), this.premultiply(Bi.makeRotation(-t2)), this;\n }\n translate(t2, e2) {\n return hi(\"Matrix3: .translate() is deprecated. Use .makeTranslation() instead.\"), this.premultiply(Bi.makeTranslation(t2, e2)), this;\n }\n makeTranslation(t2, e2) {\n return t2.isVector2 ? this.set(1, 0, t2.x, 0, 1, t2.y, 0, 0, 1) : this.set(1, 0, t2, 0, 1, e2, 0, 0, 1), this;\n }\n makeRotation(t2) {\n const e2 = Math.cos(t2), s2 = Math.sin(t2);\n return this.set(e2, -s2, 0, s2, e2, 0, 0, 0, 1), this;\n }\n makeScale(t2, e2) {\n return this.set(t2, 0, 0, 0, e2, 0, 0, 0, 1), this;\n }\n equals(t2) {\n const e2 = this.elements, s2 = t2.elements;\n for (let t3 = 0; t3 < 9; t3++) if (e2[t3] !== s2[t3]) return false;\n return true;\n }\n fromArray(t2, e2 = 0) {\n for (let s2 = 0; s2 < 9; s2++) this.elements[s2] = t2[s2 + e2];\n return this;\n }\n toArray(t2 = [], e2 = 0) {\n const s2 = this.elements;\n return t2[e2] = s2[0], t2[e2 + 1] = s2[1], t2[e2 + 2] = s2[2], t2[e2 + 3] = s2[3], t2[e2 + 4] = s2[4], t2[e2 + 5] = s2[5], t2[e2 + 6] = s2[6], t2[e2 + 7] = s2[7], t2[e2 + 8] = s2[8], t2;\n }\n clone() {\n return new this.constructor().fromArray(this.elements);\n }\n };\n var Bi = new Ii();\n var ki = new Ii().set(\n 0.4123908,\n 0.3575843,\n 0.1804808,\n 0.212639,\n 0.7151687,\n 0.0721923,\n 0.0193308,\n 0.1191948,\n 0.9505322\n );\n var Oi = new Ii().set(\n 3.2409699,\n -1.5373832,\n -0.4986108,\n -0.9692436,\n 1.8759675,\n 0.0415551,\n 0.0556301,\n -0.203977,\n 1.0569715\n );\n function Pi() {\n const t2 = {\n enabled: true,\n workingColorSpace: ss,\n spaces: {},\n convert: function(t3, e3, s3) {\n return false !== this.enabled && e3 !== s3 && e3 && s3 ? (this.spaces[e3].transfer === rs && (t3.r = Ei(t3.r), t3.g = Ei(t3.g), t3.b = Ei(t3.b)), this.spaces[e3].primaries !== this.spaces[s3].primaries && (t3.applyMatrix3(this.spaces[e3].toXYZ), t3.applyMatrix3(this.spaces[s3].fromXYZ)), this.spaces[s3].transfer === rs && (t3.r = Ni(t3.r), t3.g = Ni(t3.g), t3.b = Ni(t3.b)), t3) : t3;\n },\n workingToColorSpace: function(t3, e3) {\n return this.convert(t3, this.workingColorSpace, e3);\n },\n colorSpaceToWorking: function(t3, e3) {\n return this.convert(t3, e3, this.workingColorSpace);\n },\n getPrimaries: function(t3) {\n return this.spaces[t3].primaries;\n },\n getTransfer: function(t3) {\n return \"\" === t3 ? is : this.spaces[t3].transfer;\n },\n getToneMappingMode: function(t3) {\n return this.spaces[t3].outputColorSpaceConfig.toneMappingMode || \"standard\";\n },\n getLuminanceCoefficients: function(t3, e3 = this.workingColorSpace) {\n return t3.fromArray(this.spaces[e3].luminanceCoefficients);\n },\n define: function(t3) {\n Object.assign(this.spaces, t3);\n },\n _getMatrix: function(t3, e3, s3) {\n return t3.copy(this.spaces[e3].toXYZ).multiply(this.spaces[s3].fromXYZ);\n },\n _getDrawingBufferColorSpace: function(t3) {\n return this.spaces[t3].outputColorSpaceConfig.drawingBufferColorSpace;\n },\n _getUnpackColorSpace: function(t3 = this.workingColorSpace) {\n return this.spaces[t3].workingColorSpaceConfig.unpackColorSpace;\n },\n fromWorkingColorSpace: function(e3, s3) {\n return hi(\n \"ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace().\"\n ), t2.workingToColorSpace(e3, s3);\n },\n toWorkingColorSpace: function(e3, s3) {\n return hi(\"ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking().\"), t2.colorSpaceToWorking(e3, s3);\n }\n }, e2 = [0.64, 0.33, 0.3, 0.6, 0.15, 0.06], s2 = [0.2126, 0.7152, 0.0722], i2 = [0.3127, 0.329];\n return t2.define({\n [ss]: {\n primaries: e2,\n whitePoint: i2,\n transfer: is,\n toXYZ: ki,\n fromXYZ: Oi,\n luminanceCoefficients: s2,\n workingColorSpaceConfig: { unpackColorSpace: es },\n outputColorSpaceConfig: { drawingBufferColorSpace: es }\n },\n [es]: {\n primaries: e2,\n whitePoint: i2,\n transfer: rs,\n toXYZ: ki,\n fromXYZ: Oi,\n luminanceCoefficients: s2,\n outputColorSpaceConfig: { drawingBufferColorSpace: es }\n }\n }), t2;\n }\n var Ri = Pi();\n function Ei(t2) {\n return t2 < 0.04045 ? 0.0773993808 * t2 : Math.pow(0.9478672986 * t2 + 0.0521327014, 2.4);\n }\n function Ni(t2) {\n return t2 < 31308e-7 ? 12.92 * t2 : 1.055 * Math.pow(t2, 0.41666) - 0.055;\n }\n var Vi;\n var Li = class {\n static getDataURL(t2, e2 = \"image/png\") {\n if (/^data:/i.test(t2.src)) return t2.src;\n if (\"undefined\" == typeof HTMLCanvasElement) return t2.src;\n let s2;\n if (t2 instanceof HTMLCanvasElement) s2 = t2;\n else {\n void 0 === Vi && (Vi = Qs(\"canvas\")), Vi.width = t2.width, Vi.height = t2.height;\n const e3 = Vi.getContext(\"2d\");\n t2 instanceof ImageData ? e3.putImageData(t2, 0, 0) : e3.drawImage(t2, 0, 0, t2.width, t2.height), s2 = Vi;\n }\n return s2.toDataURL(e2);\n }\n static sRGBToLinear(t2) {\n if (\"undefined\" != typeof HTMLImageElement && t2 instanceof HTMLImageElement || \"undefined\" != typeof HTMLCanvasElement && t2 instanceof HTMLCanvasElement || \"undefined\" != typeof ImageBitmap && t2 instanceof ImageBitmap) {\n const e2 = Qs(\"canvas\");\n e2.width = t2.width, e2.height = t2.height;\n const s2 = e2.getContext(\"2d\");\n s2.drawImage(t2, 0, 0, t2.width, t2.height);\n const i2 = s2.getImageData(0, 0, t2.width, t2.height), r2 = i2.data;\n for (let t3 = 0; t3 < r2.length; t3++) r2[t3] = 255 * Ei(r2[t3] / 255);\n return s2.putImageData(i2, 0, 0), e2;\n }\n if (t2.data) {\n const e2 = t2.data.slice(0);\n for (let t3 = 0; t3 < e2.length; t3++)\n e2 instanceof Uint8Array || e2 instanceof Uint8ClampedArray ? e2[t3] = Math.floor(255 * Ei(e2[t3] / 255)) : e2[t3] = Ei(e2[t3]);\n return { data: e2, width: t2.width, height: t2.height };\n }\n return ai(\"ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied.\"), t2;\n }\n };\n var Fi = 0;\n var Di = class {\n constructor(t2 = null) {\n this.isSource = true, Object.defineProperty(this, \"id\", { value: Fi++ }), this.uuid = fi(), this.data = t2, this.dataReady = true, this.version = 0;\n }\n getSize(t2) {\n const e2 = this.data;\n return \"undefined\" != typeof HTMLVideoElement && e2 instanceof HTMLVideoElement ? t2.set(e2.videoWidth, e2.videoHeight, 0) : \"undefined\" != typeof VideoFrame && e2 instanceof VideoFrame ? t2.set(e2.displayWidth, e2.displayHeight, 0) : null !== e2 ? t2.set(e2.width, e2.height, e2.depth || 0) : t2.set(0, 0, 0), t2;\n }\n set needsUpdate(t2) {\n true === t2 && this.version++;\n }\n toJSON(t2) {\n const e2 = void 0 === t2 || \"string\" == typeof t2;\n if (!e2 && void 0 !== t2.images[this.uuid]) return t2.images[this.uuid];\n const s2 = { uuid: this.uuid, url: \"\" }, i2 = this.data;\n if (null !== i2) {\n let t3;\n if (Array.isArray(i2)) {\n t3 = [];\n for (let e3 = 0, s3 = i2.length; e3 < s3; e3++)\n i2[e3].isDataTexture ? t3.push(Ui(i2[e3].image)) : t3.push(Ui(i2[e3]));\n } else t3 = Ui(i2);\n s2.url = t3;\n }\n return e2 || (t2.images[this.uuid] = s2), s2;\n }\n };\n function Ui(t2) {\n return \"undefined\" != typeof HTMLImageElement && t2 instanceof HTMLImageElement || \"undefined\" != typeof HTMLCanvasElement && t2 instanceof HTMLCanvasElement || \"undefined\" != typeof ImageBitmap && t2 instanceof ImageBitmap ? Li.getDataURL(t2) : t2.data ? {\n data: Array.from(t2.data),\n width: t2.width,\n height: t2.height,\n type: t2.data.constructor.name\n } : (ai(\"Texture: Unable to serialize Texture.\"), {});\n }\n var ji = 0;\n var Wi = new Ti();\n var Ji = class _Ji extends di {\n constructor(t2 = _Ji.DEFAULT_IMAGE, e2 = _Ji.DEFAULT_MAPPING, s2 = 1001, i2 = 1001, r2 = 1006, n2 = 1008, a2 = 1023, o2 = 1009, h2 = _Ji.DEFAULT_ANISOTROPY, l2 = \"\") {\n super(), this.isTexture = true, Object.defineProperty(this, \"id\", { value: ji++ }), this.uuid = fi(), this.name = \"\", this.source = new Di(t2), this.mipmaps = [], this.mapping = e2, this.channel = 0, this.wrapS = s2, this.wrapT = i2, this.magFilter = r2, this.minFilter = n2, this.anisotropy = h2, this.format = a2, this.internalFormat = null, this.type = o2, this.offset = new _i(0, 0), this.repeat = new _i(1, 1), this.center = new _i(0, 0), this.rotation = 0, this.matrixAutoUpdate = true, this.matrix = new Ii(), this.generateMipmaps = true, this.premultiplyAlpha = false, this.flipY = true, this.unpackAlignment = 4, this.colorSpace = l2, this.userData = {}, this.updateRanges = [], this.version = 0, this.onUpdate = null, this.renderTarget = null, this.isRenderTargetTexture = false, this.isArrayTexture = !!(t2 && t2.depth && t2.depth > 1), this.pmremVersion = 0, this.normalized = false;\n }\n get width() {\n return this.source.getSize(Wi).x;\n }\n get height() {\n return this.source.getSize(Wi).y;\n }\n get depth() {\n return this.source.getSize(Wi).z;\n }\n get image() {\n return this.source.data;\n }\n set image(t2) {\n this.source.data = t2;\n }\n updateMatrix() {\n this.matrix.setUvTransform(\n this.offset.x,\n this.offset.y,\n this.repeat.x,\n this.repeat.y,\n this.rotation,\n this.center.x,\n this.center.y\n );\n }\n addUpdateRange(t2, e2) {\n this.updateRanges.push({ start: t2, count: e2 });\n }\n clearUpdateRanges() {\n this.updateRanges.length = 0;\n }\n clone() {\n return new this.constructor().copy(this);\n }\n copy(t2) {\n return this.name = t2.name, this.source = t2.source, this.mipmaps = t2.mipmaps.slice(0), this.mapping = t2.mapping, this.channel = t2.channel, this.wrapS = t2.wrapS, this.wrapT = t2.wrapT, this.magFilter = t2.magFilter, this.minFilter = t2.minFilter, this.anisotropy = t2.anisotropy, this.format = t2.format, this.internalFormat = t2.internalFormat, this.type = t2.type, this.normalized = t2.normalized, this.offset.copy(t2.offset), this.repeat.copy(t2.repeat), this.center.copy(t2.center), this.rotation = t2.rotation, this.matrixAutoUpdate = t2.matrixAutoUpdate, this.matrix.copy(t2.matrix), this.generateMipmaps = t2.generateMipmaps, this.premultiplyAlpha = t2.premultiplyAlpha, this.flipY = t2.flipY, this.unpackAlignment = t2.unpackAlignment, this.colorSpace = t2.colorSpace, this.renderTarget = t2.renderTarget, this.isRenderTargetTexture = t2.isRenderTargetTexture, this.isArrayTexture = t2.isArrayTexture, this.userData = JSON.parse(JSON.stringify(t2.userData)), this.needsUpdate = true, this;\n }\n setValues(t2) {\n for (const e2 in t2) {\n const s2 = t2[e2];\n if (void 0 === s2) {\n ai(`Texture.setValues(): parameter '${e2}' has value of undefined.`);\n continue;\n }\n const i2 = this[e2];\n void 0 !== i2 ? i2 && s2 && i2.isVector2 && s2.isVector2 || i2 && s2 && i2.isVector3 && s2.isVector3 || i2 && s2 && i2.isMatrix3 && s2.isMatrix3 ? i2.copy(s2) : this[e2] = s2 : ai(`Texture.setValues(): property '${e2}' does not exist.`);\n }\n }\n toJSON(t2) {\n const e2 = void 0 === t2 || \"string\" == typeof t2;\n if (!e2 && void 0 !== t2.textures[this.uuid]) return t2.textures[this.uuid];\n const s2 = {\n metadata: { version: 4.7, type: \"Texture\", generator: \"Texture.toJSON\" },\n uuid: this.uuid,\n name: this.name,\n image: this.source.toJSON(t2).uuid,\n mapping: this.mapping,\n channel: this.channel,\n repeat: [this.repeat.x, this.repeat.y],\n offset: [this.offset.x, this.offset.y],\n center: [this.center.x, this.center.y],\n rotation: this.rotation,\n wrap: [this.wrapS, this.wrapT],\n format: this.format,\n internalFormat: this.internalFormat,\n type: this.type,\n normalized: this.normalized,\n colorSpace: this.colorSpace,\n minFilter: this.minFilter,\n magFilter: this.magFilter,\n anisotropy: this.anisotropy,\n flipY: this.flipY,\n generateMipmaps: this.generateMipmaps,\n premultiplyAlpha: this.premultiplyAlpha,\n unpackAlignment: this.unpackAlignment\n };\n return Object.keys(this.userData).length > 0 && (s2.userData = this.userData), e2 || (t2.textures[this.uuid] = s2), s2;\n }\n dispose() {\n this.dispatchEvent({ type: \"dispose\" });\n }\n transformUv(t2) {\n if (this.mapping !== ht) return t2;\n if (t2.applyMatrix3(this.matrix), t2.x < 0 || t2.x > 1)\n switch (this.wrapS) {\n case mt:\n t2.x = t2.x - Math.floor(t2.x);\n break;\n case yt:\n t2.x = t2.x < 0 ? 0 : 1;\n break;\n case gt:\n 1 === Math.abs(Math.floor(t2.x) % 2) ? t2.x = Math.ceil(t2.x) - t2.x : t2.x = t2.x - Math.floor(t2.x);\n }\n if (t2.y < 0 || t2.y > 1)\n switch (this.wrapT) {\n case mt:\n t2.y = t2.y - Math.floor(t2.y);\n break;\n case yt:\n t2.y = t2.y < 0 ? 0 : 1;\n break;\n case gt:\n 1 === Math.abs(Math.floor(t2.y) % 2) ? t2.y = Math.ceil(t2.y) - t2.y : t2.y = t2.y - Math.floor(t2.y);\n }\n return this.flipY && (t2.y = 1 - t2.y), t2;\n }\n set needsUpdate(t2) {\n true === t2 && (this.version++, this.source.needsUpdate = true);\n }\n set needsPMREMUpdate(t2) {\n true === t2 && this.pmremVersion++;\n }\n };\n Ji.DEFAULT_IMAGE = null, Ji.DEFAULT_MAPPING = ht, Ji.DEFAULT_ANISOTROPY = 1;\n var qi = class _qi {\n static {\n _qi.prototype.isVector4 = true;\n }\n constructor(t2 = 0, e2 = 0, s2 = 0, i2 = 1) {\n this.x = t2, this.y = e2, this.z = s2, this.w = i2;\n }\n get width() {\n return this.z;\n }\n set width(t2) {\n this.z = t2;\n }\n get height() {\n return this.w;\n }\n set height(t2) {\n this.w = t2;\n }\n set(t2, e2, s2, i2) {\n return this.x = t2, this.y = e2, this.z = s2, this.w = i2, this;\n }\n setScalar(t2) {\n return this.x = t2, this.y = t2, this.z = t2, this.w = t2, this;\n }\n setX(t2) {\n return this.x = t2, this;\n }\n setY(t2) {\n return this.y = t2, this;\n }\n setZ(t2) {\n return this.z = t2, this;\n }\n setW(t2) {\n return this.w = t2, this;\n }\n setComponent(t2, e2) {\n switch (t2) {\n case 0:\n this.x = e2;\n break;\n case 1:\n this.y = e2;\n break;\n case 2:\n this.z = e2;\n break;\n case 3:\n this.w = e2;\n break;\n default:\n throw new Error(\"THREE.Vector4: index is out of range: \" + t2);\n }\n return this;\n }\n getComponent(t2) {\n switch (t2) {\n case 0:\n return this.x;\n case 1:\n return this.y;\n case 2:\n return this.z;\n case 3:\n return this.w;\n default:\n throw new Error(\"THREE.Vector4: index is out of range: \" + t2);\n }\n }\n clone() {\n return new this.constructor(this.x, this.y, this.z, this.w);\n }\n copy(t2) {\n return this.x = t2.x, this.y = t2.y, this.z = t2.z, this.w = void 0 !== t2.w ? t2.w : 1, this;\n }\n add(t2) {\n return this.x += t2.x, this.y += t2.y, this.z += t2.z, this.w += t2.w, this;\n }\n addScalar(t2) {\n return this.x += t2, this.y += t2, this.z += t2, this.w += t2, this;\n }\n addVectors(t2, e2) {\n return this.x = t2.x + e2.x, this.y = t2.y + e2.y, this.z = t2.z + e2.z, this.w = t2.w + e2.w, this;\n }\n addScaledVector(t2, e2) {\n return this.x += t2.x * e2, this.y += t2.y * e2, this.z += t2.z * e2, this.w += t2.w * e2, this;\n }\n sub(t2) {\n return this.x -= t2.x, this.y -= t2.y, this.z -= t2.z, this.w -= t2.w, this;\n }\n subScalar(t2) {\n return this.x -= t2, this.y -= t2, this.z -= t2, this.w -= t2, this;\n }\n subVectors(t2, e2) {\n return this.x = t2.x - e2.x, this.y = t2.y - e2.y, this.z = t2.z - e2.z, this.w = t2.w - e2.w, this;\n }\n multiply(t2) {\n return this.x *= t2.x, this.y *= t2.y, this.z *= t2.z, this.w *= t2.w, this;\n }\n multiplyScalar(t2) {\n return this.x *= t2, this.y *= t2, this.z *= t2, this.w *= t2, this;\n }\n applyMatrix4(t2) {\n const e2 = this.x, s2 = this.y, i2 = this.z, r2 = this.w, n2 = t2.elements;\n return this.x = n2[0] * e2 + n2[4] * s2 + n2[8] * i2 + n2[12] * r2, this.y = n2[1] * e2 + n2[5] * s2 + n2[9] * i2 + n2[13] * r2, this.z = n2[2] * e2 + n2[6] * s2 + n2[10] * i2 + n2[14] * r2, this.w = n2[3] * e2 + n2[7] * s2 + n2[11] * i2 + n2[15] * r2, this;\n }\n divide(t2) {\n return this.x /= t2.x, this.y /= t2.y, this.z /= t2.z, this.w /= t2.w, this;\n }\n divideScalar(t2) {\n return this.multiplyScalar(1 / t2);\n }\n setAxisAngleFromQuaternion(t2) {\n this.w = 2 * Math.acos(t2.w);\n const e2 = Math.sqrt(1 - t2.w * t2.w);\n return e2 < 1e-4 ? (this.x = 1, this.y = 0, this.z = 0) : (this.x = t2.x / e2, this.y = t2.y / e2, this.z = t2.z / e2), this;\n }\n setAxisAngleFromRotationMatrix(t2) {\n let e2, s2, i2, r2;\n const n2 = 0.01, a2 = 0.1, o2 = t2.elements, h2 = o2[0], l2 = o2[4], c2 = o2[8], u2 = o2[1], d2 = o2[5], p2 = o2[9], m2 = o2[2], y2 = o2[6], g2 = o2[10];\n if (Math.abs(l2 - u2) < n2 && Math.abs(c2 - m2) < n2 && Math.abs(p2 - y2) < n2) {\n if (Math.abs(l2 + u2) < a2 && Math.abs(c2 + m2) < a2 && Math.abs(p2 + y2) < a2 && Math.abs(h2 + d2 + g2 - 3) < a2)\n return this.set(1, 0, 0, 0), this;\n e2 = Math.PI;\n const t3 = (h2 + 1) / 2, o3 = (d2 + 1) / 2, f3 = (g2 + 1) / 2, x2 = (l2 + u2) / 4, b2 = (c2 + m2) / 4, v2 = (p2 + y2) / 4;\n return t3 > o3 && t3 > f3 ? t3 < n2 ? (s2 = 0, i2 = 0.707106781, r2 = 0.707106781) : (s2 = Math.sqrt(t3), i2 = x2 / s2, r2 = b2 / s2) : o3 > f3 ? o3 < n2 ? (s2 = 0.707106781, i2 = 0, r2 = 0.707106781) : (i2 = Math.sqrt(o3), s2 = x2 / i2, r2 = v2 / i2) : f3 < n2 ? (s2 = 0.707106781, i2 = 0.707106781, r2 = 0) : (r2 = Math.sqrt(f3), s2 = b2 / r2, i2 = v2 / r2), this.set(s2, i2, r2, e2), this;\n }\n let f2 = Math.sqrt((y2 - p2) * (y2 - p2) + (c2 - m2) * (c2 - m2) + (u2 - l2) * (u2 - l2));\n return Math.abs(f2) < 1e-3 && (f2 = 1), this.x = (y2 - p2) / f2, this.y = (c2 - m2) / f2, this.z = (u2 - l2) / f2, this.w = Math.acos((h2 + d2 + g2 - 1) / 2), this;\n }\n setFromMatrixPosition(t2) {\n const e2 = t2.elements;\n return this.x = e2[12], this.y = e2[13], this.z = e2[14], this.w = e2[15], this;\n }\n min(t2) {\n return this.x = Math.min(this.x, t2.x), this.y = Math.min(this.y, t2.y), this.z = Math.min(this.z, t2.z), this.w = Math.min(this.w, t2.w), this;\n }\n max(t2) {\n return this.x = Math.max(this.x, t2.x), this.y = Math.max(this.y, t2.y), this.z = Math.max(this.z, t2.z), this.w = Math.max(this.w, t2.w), this;\n }\n clamp(t2, e2) {\n return this.x = xi(this.x, t2.x, e2.x), this.y = xi(this.y, t2.y, e2.y), this.z = xi(this.z, t2.z, e2.z), this.w = xi(this.w, t2.w, e2.w), this;\n }\n clampScalar(t2, e2) {\n return this.x = xi(this.x, t2, e2), this.y = xi(this.y, t2, e2), this.z = xi(this.z, t2, e2), this.w = xi(this.w, t2, e2), this;\n }\n clampLength(t2, e2) {\n const s2 = this.length();\n return this.divideScalar(s2 || 1).multiplyScalar(xi(s2, t2, e2));\n }\n floor() {\n return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this.z = Math.floor(this.z), this.w = Math.floor(this.w), this;\n }\n ceil() {\n return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this.z = Math.ceil(this.z), this.w = Math.ceil(this.w), this;\n }\n round() {\n return this.x = Math.round(this.x), this.y = Math.round(this.y), this.z = Math.round(this.z), this.w = Math.round(this.w), this;\n }\n roundToZero() {\n return this.x = Math.trunc(this.x), this.y = Math.trunc(this.y), this.z = Math.trunc(this.z), this.w = Math.trunc(this.w), this;\n }\n negate() {\n return this.x = -this.x, this.y = -this.y, this.z = -this.z, this.w = -this.w, this;\n }\n dot(t2) {\n return this.x * t2.x + this.y * t2.y + this.z * t2.z + this.w * t2.w;\n }\n lengthSq() {\n return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w;\n }\n length() {\n return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w);\n }\n manhattanLength() {\n return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w);\n }\n normalize() {\n return this.divideScalar(this.length() || 1);\n }\n setLength(t2) {\n return this.normalize().multiplyScalar(t2);\n }\n lerp(t2, e2) {\n return this.x += (t2.x - this.x) * e2, this.y += (t2.y - this.y) * e2, this.z += (t2.z - this.z) * e2, this.w += (t2.w - this.w) * e2, this;\n }\n lerpVectors(t2, e2, s2) {\n return this.x = t2.x + (e2.x - t2.x) * s2, this.y = t2.y + (e2.y - t2.y) * s2, this.z = t2.z + (e2.z - t2.z) * s2, this.w = t2.w + (e2.w - t2.w) * s2, this;\n }\n equals(t2) {\n return t2.x === this.x && t2.y === this.y && t2.z === this.z && t2.w === this.w;\n }\n fromArray(t2, e2 = 0) {\n return this.x = t2[e2], this.y = t2[e2 + 1], this.z = t2[e2 + 2], this.w = t2[e2 + 3], this;\n }\n toArray(t2 = [], e2 = 0) {\n return t2[e2] = this.x, t2[e2 + 1] = this.y, t2[e2 + 2] = this.z, t2[e2 + 3] = this.w, t2;\n }\n fromBufferAttribute(t2, e2) {\n return this.x = t2.getX(e2), this.y = t2.getY(e2), this.z = t2.getZ(e2), this.w = t2.getW(e2), this;\n }\n random() {\n return this.x = Math.random(), this.y = Math.random(), this.z = Math.random(), this.w = Math.random(), this;\n }\n *[Symbol.iterator]() {\n yield this.x, yield this.y, yield this.z, yield this.w;\n }\n };\n var Hi = class extends di {\n constructor(t2 = 1, e2 = 1, s2 = {}) {\n super(), s2 = Object.assign(\n {\n generateMipmaps: false,\n internalFormat: null,\n minFilter: Mt,\n depthBuffer: true,\n stencilBuffer: false,\n resolveDepthBuffer: true,\n resolveStencilBuffer: true,\n depthTexture: null,\n samples: 0,\n count: 1,\n depth: 1,\n multiview: false,\n useArrayDepthTexture: false\n },\n s2\n ), this.isRenderTarget = true, this.width = t2, this.height = e2, this.depth = s2.depth, this.scissor = new qi(0, 0, t2, e2), this.scissorTest = false, this.viewport = new qi(0, 0, t2, e2), this.textures = [];\n const i2 = { width: t2, height: e2, depth: s2.depth }, r2 = new Ji(i2), n2 = s2.count;\n for (let t3 = 0; t3 < n2; t3++)\n this.textures[t3] = r2.clone(), this.textures[t3].isRenderTargetTexture = true, this.textures[t3].renderTarget = this;\n this._setTextureOptions(s2), this.depthBuffer = s2.depthBuffer, this.stencilBuffer = s2.stencilBuffer, this.resolveDepthBuffer = s2.resolveDepthBuffer, this.resolveStencilBuffer = s2.resolveStencilBuffer, this._depthTexture = null, this.depthTexture = s2.depthTexture, this.samples = s2.samples, this.multiview = s2.multiview, this.useArrayDepthTexture = s2.useArrayDepthTexture;\n }\n _setTextureOptions(t2 = {}) {\n const e2 = { minFilter: Mt, generateMipmaps: false, flipY: false, internalFormat: null };\n void 0 !== t2.mapping && (e2.mapping = t2.mapping), void 0 !== t2.wrapS && (e2.wrapS = t2.wrapS), void 0 !== t2.wrapT && (e2.wrapT = t2.wrapT), void 0 !== t2.wrapR && (e2.wrapR = t2.wrapR), void 0 !== t2.magFilter && (e2.magFilter = t2.magFilter), void 0 !== t2.minFilter && (e2.minFilter = t2.minFilter), void 0 !== t2.format && (e2.format = t2.format), void 0 !== t2.type && (e2.type = t2.type), void 0 !== t2.anisotropy && (e2.anisotropy = t2.anisotropy), void 0 !== t2.colorSpace && (e2.colorSpace = t2.colorSpace), void 0 !== t2.flipY && (e2.flipY = t2.flipY), void 0 !== t2.generateMipmaps && (e2.generateMipmaps = t2.generateMipmaps), void 0 !== t2.internalFormat && (e2.internalFormat = t2.internalFormat);\n for (let t3 = 0; t3 < this.textures.length; t3++) {\n this.textures[t3].setValues(e2);\n }\n }\n get texture() {\n return this.textures[0];\n }\n set texture(t2) {\n this.textures[0] = t2;\n }\n set depthTexture(t2) {\n null !== this._depthTexture && (this._depthTexture.renderTarget = null), null !== t2 && (t2.renderTarget = this), this._depthTexture = t2;\n }\n get depthTexture() {\n return this._depthTexture;\n }\n setSize(t2, e2, s2 = 1) {\n if (this.width !== t2 || this.height !== e2 || this.depth !== s2) {\n this.width = t2, this.height = e2, this.depth = s2;\n for (let i2 = 0, r2 = this.textures.length; i2 < r2; i2++)\n this.textures[i2].image.width = t2, this.textures[i2].image.height = e2, this.textures[i2].image.depth = s2, true !== this.textures[i2].isData3DTexture && (this.textures[i2].isArrayTexture = this.textures[i2].image.depth > 1);\n this.dispose();\n }\n this.viewport.set(0, 0, t2, e2), this.scissor.set(0, 0, t2, e2);\n }\n clone() {\n return new this.constructor().copy(this);\n }\n copy(t2) {\n this.width = t2.width, this.height = t2.height, this.depth = t2.depth, this.scissor.copy(t2.scissor), this.scissorTest = t2.scissorTest, this.viewport.copy(t2.viewport), this.textures.length = 0;\n for (let e2 = 0, s2 = t2.textures.length; e2 < s2; e2++) {\n this.textures[e2] = t2.textures[e2].clone(), this.textures[e2].isRenderTargetTexture = true, this.textures[e2].renderTarget = this;\n const s3 = Object.assign({}, t2.textures[e2].image);\n this.textures[e2].source = new Di(s3);\n }\n return this.depthBuffer = t2.depthBuffer, this.stencilBuffer = t2.stencilBuffer, this.resolveDepthBuffer = t2.resolveDepthBuffer, this.resolveStencilBuffer = t2.resolveStencilBuffer, null !== t2.depthTexture && (this.depthTexture = t2.depthTexture.clone()), this.samples = t2.samples, this.multiview = t2.multiview, this.useArrayDepthTexture = t2.useArrayDepthTexture, this;\n }\n dispose() {\n this.dispatchEvent({ type: \"dispose\" });\n }\n };\n var Xi = class extends Hi {\n constructor(t2 = 1, e2 = 1, s2 = {}) {\n super(t2, e2, s2), this.isWebGLRenderTarget = true;\n }\n };\n var Yi = class extends Ji {\n constructor(t2 = null, e2 = 1, s2 = 1, i2 = 1) {\n super(null), this.isDataArrayTexture = true, this.image = { data: t2, width: e2, height: s2, depth: i2 }, this.magFilter = ft, this.minFilter = ft, this.wrapR = yt, this.generateMipmaps = false, this.flipY = false, this.unpackAlignment = 1, this.layerUpdates = /* @__PURE__ */ new Set();\n }\n addLayerUpdate(t2) {\n this.layerUpdates.add(t2);\n }\n clearLayerUpdates() {\n this.layerUpdates.clear();\n }\n };\n var Zi = class extends Xi {\n constructor(t2 = 1, e2 = 1, s2 = 1, i2 = {}) {\n super(t2, e2, i2), this.isWebGLArrayRenderTarget = true, this.depth = s2, this.texture = new Yi(null, t2, e2, s2), this._setTextureOptions(i2), this.texture.isRenderTargetTexture = true;\n }\n };\n var Gi = class extends Ji {\n constructor(t2 = null, e2 = 1, s2 = 1, i2 = 1) {\n super(null), this.isData3DTexture = true, this.image = { data: t2, width: e2, height: s2, depth: i2 }, this.magFilter = ft, this.minFilter = ft, this.wrapR = yt, this.generateMipmaps = false, this.flipY = false, this.unpackAlignment = 1;\n }\n };\n var $i = class extends Xi {\n constructor(t2 = 1, e2 = 1, s2 = 1, i2 = {}) {\n super(t2, e2, i2), this.isWebGL3DRenderTarget = true, this.depth = s2, this.texture = new Gi(null, t2, e2, s2), this._setTextureOptions(i2), this.texture.isRenderTargetTexture = true;\n }\n };\n var Qi = class _Qi {\n static {\n _Qi.prototype.isMatrix4 = true;\n }\n constructor(t2, e2, s2, i2, r2, n2, a2, o2, h2, l2, c2, u2, d2, p2, m2, y2) {\n this.elements = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], void 0 !== t2 && this.set(t2, e2, s2, i2, r2, n2, a2, o2, h2, l2, c2, u2, d2, p2, m2, y2);\n }\n set(t2, e2, s2, i2, r2, n2, a2, o2, h2, l2, c2, u2, d2, p2, m2, y2) {\n const g2 = this.elements;\n return g2[0] = t2, g2[4] = e2, g2[8] = s2, g2[12] = i2, g2[1] = r2, g2[5] = n2, g2[9] = a2, g2[13] = o2, g2[2] = h2, g2[6] = l2, g2[10] = c2, g2[14] = u2, g2[3] = d2, g2[7] = p2, g2[11] = m2, g2[15] = y2, this;\n }\n identity() {\n return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this;\n }\n clone() {\n return new _Qi().fromArray(this.elements);\n }\n copy(t2) {\n const e2 = this.elements, s2 = t2.elements;\n return e2[0] = s2[0], e2[1] = s2[1], e2[2] = s2[2], e2[3] = s2[3], e2[4] = s2[4], e2[5] = s2[5], e2[6] = s2[6], e2[7] = s2[7], e2[8] = s2[8], e2[9] = s2[9], e2[10] = s2[10], e2[11] = s2[11], e2[12] = s2[12], e2[13] = s2[13], e2[14] = s2[14], e2[15] = s2[15], this;\n }\n copyPosition(t2) {\n const e2 = this.elements, s2 = t2.elements;\n return e2[12] = s2[12], e2[13] = s2[13], e2[14] = s2[14], this;\n }\n setFromMatrix3(t2) {\n const e2 = t2.elements;\n return this.set(e2[0], e2[3], e2[6], 0, e2[1], e2[4], e2[7], 0, e2[2], e2[5], e2[8], 0, 0, 0, 0, 1), this;\n }\n extractBasis(t2, e2, s2) {\n return 0 === this.determinantAffine() ? (t2.set(1, 0, 0), e2.set(0, 1, 0), s2.set(0, 0, 1), this) : (t2.setFromMatrixColumn(this, 0), e2.setFromMatrixColumn(this, 1), s2.setFromMatrixColumn(this, 2), this);\n }\n makeBasis(t2, e2, s2) {\n return this.set(t2.x, e2.x, s2.x, 0, t2.y, e2.y, s2.y, 0, t2.z, e2.z, s2.z, 0, 0, 0, 0, 1), this;\n }\n extractRotation(t2) {\n if (0 === t2.determinantAffine()) return this.identity();\n const e2 = this.elements, s2 = t2.elements, i2 = 1 / Ki.setFromMatrixColumn(t2, 0).length(), r2 = 1 / Ki.setFromMatrixColumn(t2, 1).length(), n2 = 1 / Ki.setFromMatrixColumn(t2, 2).length();\n return e2[0] = s2[0] * i2, e2[1] = s2[1] * i2, e2[2] = s2[2] * i2, e2[3] = 0, e2[4] = s2[4] * r2, e2[5] = s2[5] * r2, e2[6] = s2[6] * r2, e2[7] = 0, e2[8] = s2[8] * n2, e2[9] = s2[9] * n2, e2[10] = s2[10] * n2, e2[11] = 0, e2[12] = 0, e2[13] = 0, e2[14] = 0, e2[15] = 1, this;\n }\n makeRotationFromEuler(t2) {\n const e2 = this.elements, s2 = t2.x, i2 = t2.y, r2 = t2.z, n2 = Math.cos(s2), a2 = Math.sin(s2), o2 = Math.cos(i2), h2 = Math.sin(i2), l2 = Math.cos(r2), c2 = Math.sin(r2);\n if (\"XYZ\" === t2.order) {\n const t3 = n2 * l2, s3 = n2 * c2, i3 = a2 * l2, r3 = a2 * c2;\n e2[0] = o2 * l2, e2[4] = -o2 * c2, e2[8] = h2, e2[1] = s3 + i3 * h2, e2[5] = t3 - r3 * h2, e2[9] = -a2 * o2, e2[2] = r3 - t3 * h2, e2[6] = i3 + s3 * h2, e2[10] = n2 * o2;\n } else if (\"YXZ\" === t2.order) {\n const t3 = o2 * l2, s3 = o2 * c2, i3 = h2 * l2, r3 = h2 * c2;\n e2[0] = t3 + r3 * a2, e2[4] = i3 * a2 - s3, e2[8] = n2 * h2, e2[1] = n2 * c2, e2[5] = n2 * l2, e2[9] = -a2, e2[2] = s3 * a2 - i3, e2[6] = r3 + t3 * a2, e2[10] = n2 * o2;\n } else if (\"ZXY\" === t2.order) {\n const t3 = o2 * l2, s3 = o2 * c2, i3 = h2 * l2, r3 = h2 * c2;\n e2[0] = t3 - r3 * a2, e2[4] = -n2 * c2, e2[8] = i3 + s3 * a2, e2[1] = s3 + i3 * a2, e2[5] = n2 * l2, e2[9] = r3 - t3 * a2, e2[2] = -n2 * h2, e2[6] = a2, e2[10] = n2 * o2;\n } else if (\"ZYX\" === t2.order) {\n const t3 = n2 * l2, s3 = n2 * c2, i3 = a2 * l2, r3 = a2 * c2;\n e2[0] = o2 * l2, e2[4] = i3 * h2 - s3, e2[8] = t3 * h2 + r3, e2[1] = o2 * c2, e2[5] = r3 * h2 + t3, e2[9] = s3 * h2 - i3, e2[2] = -h2, e2[6] = a2 * o2, e2[10] = n2 * o2;\n } else if (\"YZX\" === t2.order) {\n const t3 = n2 * o2, s3 = n2 * h2, i3 = a2 * o2, r3 = a2 * h2;\n e2[0] = o2 * l2, e2[4] = r3 - t3 * c2, e2[8] = i3 * c2 + s3, e2[1] = c2, e2[5] = n2 * l2, e2[9] = -a2 * l2, e2[2] = -h2 * l2, e2[6] = s3 * c2 + i3, e2[10] = t3 - r3 * c2;\n } else if (\"XZY\" === t2.order) {\n const t3 = n2 * o2, s3 = n2 * h2, i3 = a2 * o2, r3 = a2 * h2;\n e2[0] = o2 * l2, e2[4] = -c2, e2[8] = h2 * l2, e2[1] = t3 * c2 + r3, e2[5] = n2 * l2, e2[9] = s3 * c2 - i3, e2[2] = i3 * c2 - s3, e2[6] = a2 * l2, e2[10] = r3 * c2 + t3;\n }\n return e2[3] = 0, e2[7] = 0, e2[11] = 0, e2[12] = 0, e2[13] = 0, e2[14] = 0, e2[15] = 1, this;\n }\n makeRotationFromQuaternion(t2) {\n return this.compose(er, t2, sr);\n }\n lookAt(t2, e2, s2) {\n const i2 = this.elements;\n return nr.subVectors(t2, e2), 0 === nr.lengthSq() && (nr.z = 1), nr.normalize(), ir.crossVectors(s2, nr), 0 === ir.lengthSq() && (1 === Math.abs(s2.z) ? nr.x += 1e-4 : nr.z += 1e-4, nr.normalize(), ir.crossVectors(s2, nr)), ir.normalize(), rr.crossVectors(nr, ir), i2[0] = ir.x, i2[4] = rr.x, i2[8] = nr.x, i2[1] = ir.y, i2[5] = rr.y, i2[9] = nr.y, i2[2] = ir.z, i2[6] = rr.z, i2[10] = nr.z, this;\n }\n multiply(t2) {\n return this.multiplyMatrices(this, t2);\n }\n premultiply(t2) {\n return this.multiplyMatrices(t2, this);\n }\n multiplyMatrices(t2, e2) {\n const s2 = t2.elements, i2 = e2.elements, r2 = this.elements, n2 = s2[0], a2 = s2[4], o2 = s2[8], h2 = s2[12], l2 = s2[1], c2 = s2[5], u2 = s2[9], d2 = s2[13], p2 = s2[2], m2 = s2[6], y2 = s2[10], g2 = s2[14], f2 = s2[3], x2 = s2[7], b2 = s2[11], v2 = s2[15], w2 = i2[0], M2 = i2[4], S2 = i2[8], _2 = i2[12], A2 = i2[1], T2 = i2[5], z2 = i2[9], C2 = i2[13], I2 = i2[2], B2 = i2[6], k2 = i2[10], O2 = i2[14], P2 = i2[3], R2 = i2[7], E2 = i2[11], N2 = i2[15];\n return r2[0] = n2 * w2 + a2 * A2 + o2 * I2 + h2 * P2, r2[4] = n2 * M2 + a2 * T2 + o2 * B2 + h2 * R2, r2[8] = n2 * S2 + a2 * z2 + o2 * k2 + h2 * E2, r2[12] = n2 * _2 + a2 * C2 + o2 * O2 + h2 * N2, r2[1] = l2 * w2 + c2 * A2 + u2 * I2 + d2 * P2, r2[5] = l2 * M2 + c2 * T2 + u2 * B2 + d2 * R2, r2[9] = l2 * S2 + c2 * z2 + u2 * k2 + d2 * E2, r2[13] = l2 * _2 + c2 * C2 + u2 * O2 + d2 * N2, r2[2] = p2 * w2 + m2 * A2 + y2 * I2 + g2 * P2, r2[6] = p2 * M2 + m2 * T2 + y2 * B2 + g2 * R2, r2[10] = p2 * S2 + m2 * z2 + y2 * k2 + g2 * E2, r2[14] = p2 * _2 + m2 * C2 + y2 * O2 + g2 * N2, r2[3] = f2 * w2 + x2 * A2 + b2 * I2 + v2 * P2, r2[7] = f2 * M2 + x2 * T2 + b2 * B2 + v2 * R2, r2[11] = f2 * S2 + x2 * z2 + b2 * k2 + v2 * E2, r2[15] = f2 * _2 + x2 * C2 + b2 * O2 + v2 * N2, this;\n }\n multiplyScalar(t2) {\n const e2 = this.elements;\n return e2[0] *= t2, e2[4] *= t2, e2[8] *= t2, e2[12] *= t2, e2[1] *= t2, e2[5] *= t2, e2[9] *= t2, e2[13] *= t2, e2[2] *= t2, e2[6] *= t2, e2[10] *= t2, e2[14] *= t2, e2[3] *= t2, e2[7] *= t2, e2[11] *= t2, e2[15] *= t2, this;\n }\n determinant() {\n const t2 = this.elements, e2 = t2[0], s2 = t2[4], i2 = t2[8], r2 = t2[12], n2 = t2[1], a2 = t2[5], o2 = t2[9], h2 = t2[13], l2 = t2[2], c2 = t2[6], u2 = t2[10], d2 = t2[14], p2 = t2[3], m2 = t2[7], y2 = t2[11], g2 = t2[15], f2 = o2 * d2 - h2 * u2, x2 = a2 * d2 - h2 * c2, b2 = a2 * u2 - o2 * c2, v2 = n2 * d2 - h2 * l2, w2 = n2 * u2 - o2 * l2, M2 = n2 * c2 - a2 * l2;\n return e2 * (m2 * f2 - y2 * x2 + g2 * b2) - s2 * (p2 * f2 - y2 * v2 + g2 * w2) + i2 * (p2 * x2 - m2 * v2 + g2 * M2) - r2 * (p2 * b2 - m2 * w2 + y2 * M2);\n }\n determinantAffine() {\n const t2 = this.elements, e2 = t2[0], s2 = t2[4], i2 = t2[8], r2 = t2[1], n2 = t2[5], a2 = t2[9], o2 = t2[2], h2 = t2[6], l2 = t2[10];\n return e2 * (n2 * l2 - a2 * h2) - s2 * (r2 * l2 - a2 * o2) + i2 * (r2 * h2 - n2 * o2);\n }\n transpose() {\n const t2 = this.elements;\n let e2;\n return e2 = t2[1], t2[1] = t2[4], t2[4] = e2, e2 = t2[2], t2[2] = t2[8], t2[8] = e2, e2 = t2[6], t2[6] = t2[9], t2[9] = e2, e2 = t2[3], t2[3] = t2[12], t2[12] = e2, e2 = t2[7], t2[7] = t2[13], t2[13] = e2, e2 = t2[11], t2[11] = t2[14], t2[14] = e2, this;\n }\n setPosition(t2, e2, s2) {\n const i2 = this.elements;\n return t2.isVector3 ? (i2[12] = t2.x, i2[13] = t2.y, i2[14] = t2.z) : (i2[12] = t2, i2[13] = e2, i2[14] = s2), this;\n }\n invert() {\n const t2 = this.elements, e2 = t2[0], s2 = t2[1], i2 = t2[2], r2 = t2[3], n2 = t2[4], a2 = t2[5], o2 = t2[6], h2 = t2[7], l2 = t2[8], c2 = t2[9], u2 = t2[10], d2 = t2[11], p2 = t2[12], m2 = t2[13], y2 = t2[14], g2 = t2[15], f2 = e2 * a2 - s2 * n2, x2 = e2 * o2 - i2 * n2, b2 = e2 * h2 - r2 * n2, v2 = s2 * o2 - i2 * a2, w2 = s2 * h2 - r2 * a2, M2 = i2 * h2 - r2 * o2, S2 = l2 * m2 - c2 * p2, _2 = l2 * y2 - u2 * p2, A2 = l2 * g2 - d2 * p2, T2 = c2 * y2 - u2 * m2, z2 = c2 * g2 - d2 * m2, C2 = u2 * g2 - d2 * y2, I2 = f2 * C2 - x2 * z2 + b2 * T2 + v2 * A2 - w2 * _2 + M2 * S2;\n if (0 === I2) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\n const B2 = 1 / I2;\n return t2[0] = (a2 * C2 - o2 * z2 + h2 * T2) * B2, t2[1] = (i2 * z2 - s2 * C2 - r2 * T2) * B2, t2[2] = (m2 * M2 - y2 * w2 + g2 * v2) * B2, t2[3] = (u2 * w2 - c2 * M2 - d2 * v2) * B2, t2[4] = (o2 * A2 - n2 * C2 - h2 * _2) * B2, t2[5] = (e2 * C2 - i2 * A2 + r2 * _2) * B2, t2[6] = (y2 * b2 - p2 * M2 - g2 * x2) * B2, t2[7] = (l2 * M2 - u2 * b2 + d2 * x2) * B2, t2[8] = (n2 * z2 - a2 * A2 + h2 * S2) * B2, t2[9] = (s2 * A2 - e2 * z2 - r2 * S2) * B2, t2[10] = (p2 * w2 - m2 * b2 + g2 * f2) * B2, t2[11] = (c2 * b2 - l2 * w2 - d2 * f2) * B2, t2[12] = (a2 * _2 - n2 * T2 - o2 * S2) * B2, t2[13] = (e2 * T2 - s2 * _2 + i2 * S2) * B2, t2[14] = (m2 * x2 - p2 * v2 - y2 * f2) * B2, t2[15] = (l2 * v2 - c2 * x2 + u2 * f2) * B2, this;\n }\n scale(t2) {\n const e2 = this.elements, s2 = t2.x, i2 = t2.y, r2 = t2.z;\n return e2[0] *= s2, e2[4] *= i2, e2[8] *= r2, e2[1] *= s2, e2[5] *= i2, e2[9] *= r2, e2[2] *= s2, e2[6] *= i2, e2[10] *= r2, e2[3] *= s2, e2[7] *= i2, e2[11] *= r2, this;\n }\n getMaxScaleOnAxis() {\n const t2 = this.elements, e2 = t2[0] * t2[0] + t2[1] * t2[1] + t2[2] * t2[2], s2 = t2[4] * t2[4] + t2[5] * t2[5] + t2[6] * t2[6], i2 = t2[8] * t2[8] + t2[9] * t2[9] + t2[10] * t2[10];\n return Math.sqrt(Math.max(e2, s2, i2));\n }\n makeTranslation(t2, e2, s2) {\n return t2.isVector3 ? this.set(1, 0, 0, t2.x, 0, 1, 0, t2.y, 0, 0, 1, t2.z, 0, 0, 0, 1) : this.set(1, 0, 0, t2, 0, 1, 0, e2, 0, 0, 1, s2, 0, 0, 0, 1), this;\n }\n makeRotationX(t2) {\n const e2 = Math.cos(t2), s2 = Math.sin(t2);\n return this.set(1, 0, 0, 0, 0, e2, -s2, 0, 0, s2, e2, 0, 0, 0, 0, 1), this;\n }\n makeRotationY(t2) {\n const e2 = Math.cos(t2), s2 = Math.sin(t2);\n return this.set(e2, 0, s2, 0, 0, 1, 0, 0, -s2, 0, e2, 0, 0, 0, 0, 1), this;\n }\n makeRotationZ(t2) {\n const e2 = Math.cos(t2), s2 = Math.sin(t2);\n return this.set(e2, -s2, 0, 0, s2, e2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this;\n }\n makeRotationAxis(t2, e2) {\n const s2 = Math.cos(e2), i2 = Math.sin(e2), r2 = 1 - s2, n2 = t2.x, a2 = t2.y, o2 = t2.z, h2 = r2 * n2, l2 = r2 * a2;\n return this.set(\n h2 * n2 + s2,\n h2 * a2 - i2 * o2,\n h2 * o2 + i2 * a2,\n 0,\n h2 * a2 + i2 * o2,\n l2 * a2 + s2,\n l2 * o2 - i2 * n2,\n 0,\n h2 * o2 - i2 * a2,\n l2 * o2 + i2 * n2,\n r2 * o2 * o2 + s2,\n 0,\n 0,\n 0,\n 0,\n 1\n ), this;\n }\n makeScale(t2, e2, s2) {\n return this.set(t2, 0, 0, 0, 0, e2, 0, 0, 0, 0, s2, 0, 0, 0, 0, 1), this;\n }\n makeShear(t2, e2, s2, i2, r2, n2) {\n return this.set(1, s2, r2, 0, t2, 1, n2, 0, e2, i2, 1, 0, 0, 0, 0, 1), this;\n }\n compose(t2, e2, s2) {\n const i2 = this.elements, r2 = e2._x, n2 = e2._y, a2 = e2._z, o2 = e2._w, h2 = r2 + r2, l2 = n2 + n2, c2 = a2 + a2, u2 = r2 * h2, d2 = r2 * l2, p2 = r2 * c2, m2 = n2 * l2, y2 = n2 * c2, g2 = a2 * c2, f2 = o2 * h2, x2 = o2 * l2, b2 = o2 * c2, v2 = s2.x, w2 = s2.y, M2 = s2.z;\n return i2[0] = (1 - (m2 + g2)) * v2, i2[1] = (d2 + b2) * v2, i2[2] = (p2 - x2) * v2, i2[3] = 0, i2[4] = (d2 - b2) * w2, i2[5] = (1 - (u2 + g2)) * w2, i2[6] = (y2 + f2) * w2, i2[7] = 0, i2[8] = (p2 + x2) * M2, i2[9] = (y2 - f2) * M2, i2[10] = (1 - (u2 + m2)) * M2, i2[11] = 0, i2[12] = t2.x, i2[13] = t2.y, i2[14] = t2.z, i2[15] = 1, this;\n }\n decompose(t2, e2, s2) {\n const i2 = this.elements;\n t2.x = i2[12], t2.y = i2[13], t2.z = i2[14];\n const r2 = this.determinantAffine();\n if (0 === r2) return s2.set(1, 1, 1), e2.identity(), this;\n let n2 = Ki.set(i2[0], i2[1], i2[2]).length();\n const a2 = Ki.set(i2[4], i2[5], i2[6]).length(), o2 = Ki.set(i2[8], i2[9], i2[10]).length();\n r2 < 0 && (n2 = -n2), tr.copy(this);\n const h2 = 1 / n2, l2 = 1 / a2, c2 = 1 / o2;\n return tr.elements[0] *= h2, tr.elements[1] *= h2, tr.elements[2] *= h2, tr.elements[4] *= l2, tr.elements[5] *= l2, tr.elements[6] *= l2, tr.elements[8] *= c2, tr.elements[9] *= c2, tr.elements[10] *= c2, e2.setFromRotationMatrix(tr), s2.x = n2, s2.y = a2, s2.z = o2, this;\n }\n makePerspective(t2, e2, s2, i2, r2, n2, a2 = 2e3, o2 = false) {\n const h2 = this.elements, l2 = 2 * r2 / (e2 - t2), c2 = 2 * r2 / (s2 - i2), u2 = (e2 + t2) / (e2 - t2), d2 = (s2 + i2) / (s2 - i2);\n let p2, m2;\n if (o2) p2 = r2 / (n2 - r2), m2 = n2 * r2 / (n2 - r2);\n else if (a2 === Ws) p2 = -(n2 + r2) / (n2 - r2), m2 = -2 * n2 * r2 / (n2 - r2);\n else {\n if (a2 !== Js)\n throw new Error(\"THREE.Matrix4.makePerspective(): Invalid coordinate system: \" + a2);\n p2 = -n2 / (n2 - r2), m2 = -n2 * r2 / (n2 - r2);\n }\n return h2[0] = l2, h2[4] = 0, h2[8] = u2, h2[12] = 0, h2[1] = 0, h2[5] = c2, h2[9] = d2, h2[13] = 0, h2[2] = 0, h2[6] = 0, h2[10] = p2, h2[14] = m2, h2[3] = 0, h2[7] = 0, h2[11] = -1, h2[15] = 0, this;\n }\n makeOrthographic(t2, e2, s2, i2, r2, n2, a2 = 2e3, o2 = false) {\n const h2 = this.elements, l2 = 2 / (e2 - t2), c2 = 2 / (s2 - i2), u2 = -(e2 + t2) / (e2 - t2), d2 = -(s2 + i2) / (s2 - i2);\n let p2, m2;\n if (o2) p2 = 1 / (n2 - r2), m2 = n2 / (n2 - r2);\n else if (a2 === Ws) p2 = -2 / (n2 - r2), m2 = -(n2 + r2) / (n2 - r2);\n else {\n if (a2 !== Js)\n throw new Error(\"THREE.Matrix4.makeOrthographic(): Invalid coordinate system: \" + a2);\n p2 = -1 / (n2 - r2), m2 = -r2 / (n2 - r2);\n }\n return h2[0] = l2, h2[4] = 0, h2[8] = 0, h2[12] = u2, h2[1] = 0, h2[5] = c2, h2[9] = 0, h2[13] = d2, h2[2] = 0, h2[6] = 0, h2[10] = p2, h2[14] = m2, h2[3] = 0, h2[7] = 0, h2[11] = 0, h2[15] = 1, this;\n }\n equals(t2) {\n const e2 = this.elements, s2 = t2.elements;\n for (let t3 = 0; t3 < 16; t3++) if (e2[t3] !== s2[t3]) return false;\n return true;\n }\n fromArray(t2, e2 = 0) {\n for (let s2 = 0; s2 < 16; s2++) this.elements[s2] = t2[s2 + e2];\n return this;\n }\n toArray(t2 = [], e2 = 0) {\n const s2 = this.elements;\n return t2[e2] = s2[0], t2[e2 + 1] = s2[1], t2[e2 + 2] = s2[2], t2[e2 + 3] = s2[3], t2[e2 + 4] = s2[4], t2[e2 + 5] = s2[5], t2[e2 + 6] = s2[6], t2[e2 + 7] = s2[7], t2[e2 + 8] = s2[8], t2[e2 + 9] = s2[9], t2[e2 + 10] = s2[10], t2[e2 + 11] = s2[11], t2[e2 + 12] = s2[12], t2[e2 + 13] = s2[13], t2[e2 + 14] = s2[14], t2[e2 + 15] = s2[15], t2;\n }\n };\n var Ki = new Ti();\n var tr = new Qi();\n var er = new Ti(0, 0, 0);\n var sr = new Ti(1, 1, 1);\n var ir = new Ti();\n var rr = new Ti();\n var nr = new Ti();\n var ar = new Qi();\n var or = new Ai();\n var hr = class _hr {\n constructor(t2 = 0, e2 = 0, s2 = 0, i2 = _hr.DEFAULT_ORDER) {\n this.isEuler = true, this._x = t2, this._y = e2, this._z = s2, this._order = i2;\n }\n get x() {\n return this._x;\n }\n set x(t2) {\n this._x = t2, this._onChangeCallback();\n }\n get y() {\n return this._y;\n }\n set y(t2) {\n this._y = t2, this._onChangeCallback();\n }\n get z() {\n return this._z;\n }\n set z(t2) {\n this._z = t2, this._onChangeCallback();\n }\n get order() {\n return this._order;\n }\n set order(t2) {\n this._order = t2, this._onChangeCallback();\n }\n set(t2, e2, s2, i2 = this._order) {\n return this._x = t2, this._y = e2, this._z = s2, this._order = i2, this._onChangeCallback(), this;\n }\n clone() {\n return new this.constructor(this._x, this._y, this._z, this._order);\n }\n copy(t2) {\n return this._x = t2._x, this._y = t2._y, this._z = t2._z, this._order = t2._order, this._onChangeCallback(), this;\n }\n setFromRotationMatrix(t2, e2 = this._order, s2 = true) {\n const i2 = t2.elements, r2 = i2[0], n2 = i2[4], a2 = i2[8], o2 = i2[1], h2 = i2[5], l2 = i2[9], c2 = i2[2], u2 = i2[6], d2 = i2[10];\n switch (e2) {\n case \"XYZ\":\n this._y = Math.asin(xi(a2, -1, 1)), Math.abs(a2) < 0.9999999 ? (this._x = Math.atan2(-l2, d2), this._z = Math.atan2(-n2, r2)) : (this._x = Math.atan2(u2, h2), this._z = 0);\n break;\n case \"YXZ\":\n this._x = Math.asin(-xi(l2, -1, 1)), Math.abs(l2) < 0.9999999 ? (this._y = Math.atan2(a2, d2), this._z = Math.atan2(o2, h2)) : (this._y = Math.atan2(-c2, r2), this._z = 0);\n break;\n case \"ZXY\":\n this._x = Math.asin(xi(u2, -1, 1)), Math.abs(u2) < 0.9999999 ? (this._y = Math.atan2(-c2, d2), this._z = Math.atan2(-n2, h2)) : (this._y = 0, this._z = Math.atan2(o2, r2));\n break;\n case \"ZYX\":\n this._y = Math.asin(-xi(c2, -1, 1)), Math.abs(c2) < 0.9999999 ? (this._x = Math.atan2(u2, d2), this._z = Math.atan2(o2, r2)) : (this._x = 0, this._z = Math.atan2(-n2, h2));\n break;\n case \"YZX\":\n this._z = Math.asin(xi(o2, -1, 1)), Math.abs(o2) < 0.9999999 ? (this._x = Math.atan2(-l2, h2), this._y = Math.atan2(-c2, r2)) : (this._x = 0, this._y = Math.atan2(a2, d2));\n break;\n case \"XZY\":\n this._z = Math.asin(-xi(n2, -1, 1)), Math.abs(n2) < 0.9999999 ? (this._x = Math.atan2(u2, h2), this._y = Math.atan2(a2, r2)) : (this._x = Math.atan2(-l2, d2), this._y = 0);\n break;\n default:\n ai(\"Euler: .setFromRotationMatrix() encountered an unknown order: \" + e2);\n }\n return this._order = e2, true === s2 && this._onChangeCallback(), this;\n }\n setFromQuaternion(t2, e2, s2) {\n return ar.makeRotationFromQuaternion(t2), this.setFromRotationMatrix(ar, e2, s2);\n }\n setFromVector3(t2, e2 = this._order) {\n return this.set(t2.x, t2.y, t2.z, e2);\n }\n reorder(t2) {\n return or.setFromEuler(this), this.setFromQuaternion(or, t2);\n }\n equals(t2) {\n return t2._x === this._x && t2._y === this._y && t2._z === this._z && t2._order === this._order;\n }\n fromArray(t2) {\n return this._x = t2[0], this._y = t2[1], this._z = t2[2], void 0 !== t2[3] && (this._order = t2[3]), this._onChangeCallback(), this;\n }\n toArray(t2 = [], e2 = 0) {\n return t2[e2] = this._x, t2[e2 + 1] = this._y, t2[e2 + 2] = this._z, t2[e2 + 3] = this._order, t2;\n }\n _onChange(t2) {\n return this._onChangeCallback = t2, this;\n }\n _onChangeCallback() {\n }\n *[Symbol.iterator]() {\n yield this._x, yield this._y, yield this._z, yield this._order;\n }\n };\n hr.DEFAULT_ORDER = \"XYZ\";\n var lr = class {\n constructor() {\n this.mask = 1;\n }\n set(t2) {\n this.mask = 1 << t2 >>> 0;\n }\n enable(t2) {\n this.mask |= 1 << t2;\n }\n enableAll() {\n this.mask = -1;\n }\n toggle(t2) {\n this.mask ^= 1 << t2;\n }\n disable(t2) {\n this.mask &= ~(1 << t2);\n }\n disableAll() {\n this.mask = 0;\n }\n test(t2) {\n return 0 !== (this.mask & t2.mask);\n }\n isEnabled(t2) {\n return !!(this.mask & 1 << t2);\n }\n };\n var cr = 0;\n var ur = new Ti();\n var dr = new Ai();\n var pr = new Qi();\n var mr = new Ti();\n var yr = new Ti();\n var gr = new Ti();\n var fr = new Ai();\n var xr = new Ti(1, 0, 0);\n var br = new Ti(0, 1, 0);\n var vr = new Ti(0, 0, 1);\n var wr = { type: \"added\" };\n var Mr = { type: \"removed\" };\n var Sr = { type: \"childadded\", child: null };\n var _r = { type: \"childremoved\", child: null };\n var Ar = class _Ar extends di {\n constructor() {\n super(), this.isObject3D = true, Object.defineProperty(this, \"id\", { value: cr++ }), this.uuid = fi(), this.name = \"\", this.type = \"Object3D\", this.parent = null, this.children = [], this.up = _Ar.DEFAULT_UP.clone();\n const t2 = new Ti(), e2 = new hr(), s2 = new Ai(), i2 = new Ti(1, 1, 1);\n e2._onChange(function() {\n s2.setFromEuler(e2, false);\n }), s2._onChange(function() {\n e2.setFromQuaternion(s2, void 0, false);\n }), Object.defineProperties(this, {\n position: { configurable: true, enumerable: true, value: t2 },\n rotation: { configurable: true, enumerable: true, value: e2 },\n quaternion: { configurable: true, enumerable: true, value: s2 },\n scale: { configurable: true, enumerable: true, value: i2 },\n modelViewMatrix: { value: new Qi() },\n normalMatrix: { value: new Ii() }\n }), this.matrix = new Qi(), this.matrixWorld = new Qi(), this.matrixAutoUpdate = _Ar.DEFAULT_MATRIX_AUTO_UPDATE, this.matrixWorldAutoUpdate = _Ar.DEFAULT_MATRIX_WORLD_AUTO_UPDATE, this.matrixWorldNeedsUpdate = false, this.layers = new lr(), this.visible = true, this.castShadow = false, this.receiveShadow = false, this.frustumCulled = true, this.renderOrder = 0, this.animations = [], this.customDepthMaterial = void 0, this.customDistanceMaterial = void 0, this.static = false, this.userData = {}, this.pivot = null;\n }\n onBeforeShadow() {\n }\n onAfterShadow() {\n }\n onBeforeRender() {\n }\n onAfterRender() {\n }\n applyMatrix4(t2) {\n this.matrixAutoUpdate && this.updateMatrix(), this.matrix.premultiply(t2), this.matrix.decompose(this.position, this.quaternion, this.scale);\n }\n applyQuaternion(t2) {\n return this.quaternion.premultiply(t2), this;\n }\n setRotationFromAxisAngle(t2, e2) {\n this.quaternion.setFromAxisAngle(t2, e2);\n }\n setRotationFromEuler(t2) {\n this.quaternion.setFromEuler(t2, true);\n }\n setRotationFromMatrix(t2) {\n this.quaternion.setFromRotationMatrix(t2);\n }\n setRotationFromQuaternion(t2) {\n this.quaternion.copy(t2);\n }\n rotateOnAxis(t2, e2) {\n return dr.setFromAxisAngle(t2, e2), this.quaternion.multiply(dr), this;\n }\n rotateOnWorldAxis(t2, e2) {\n return dr.setFromAxisAngle(t2, e2), this.quaternion.premultiply(dr), this;\n }\n rotateX(t2) {\n return this.rotateOnAxis(xr, t2);\n }\n rotateY(t2) {\n return this.rotateOnAxis(br, t2);\n }\n rotateZ(t2) {\n return this.rotateOnAxis(vr, t2);\n }\n translateOnAxis(t2, e2) {\n return ur.copy(t2).applyQuaternion(this.quaternion), this.position.add(ur.multiplyScalar(e2)), this;\n }\n translateX(t2) {\n return this.translateOnAxis(xr, t2);\n }\n translateY(t2) {\n return this.translateOnAxis(br, t2);\n }\n translateZ(t2) {\n return this.translateOnAxis(vr, t2);\n }\n localToWorld(t2) {\n return this.updateWorldMatrix(true, false), t2.applyMatrix4(this.matrixWorld);\n }\n worldToLocal(t2) {\n return this.updateWorldMatrix(true, false), t2.applyMatrix4(pr.copy(this.matrixWorld).invert());\n }\n lookAt(t2, e2, s2) {\n t2.isVector3 ? mr.copy(t2) : mr.set(t2, e2, s2);\n const i2 = this.parent;\n this.updateWorldMatrix(true, false), yr.setFromMatrixPosition(this.matrixWorld), this.isCamera || this.isLight ? pr.lookAt(yr, mr, this.up) : pr.lookAt(mr, yr, this.up), this.quaternion.setFromRotationMatrix(pr), i2 && (pr.extractRotation(i2.matrixWorld), dr.setFromRotationMatrix(pr), this.quaternion.premultiply(dr.invert()));\n }\n add(t2) {\n if (arguments.length > 1) {\n for (let t3 = 0; t3 < arguments.length; t3++) this.add(arguments[t3]);\n return this;\n }\n return t2 === this ? (oi(\"Object3D.add: object can't be added as a child of itself.\", t2), this) : (t2 && t2.isObject3D ? (t2.removeFromParent(), t2.parent = this, this.children.push(t2), t2.dispatchEvent(wr), Sr.child = t2, this.dispatchEvent(Sr), Sr.child = null) : oi(\"Object3D.add: object not an instance of THREE.Object3D.\", t2), this);\n }\n remove(t2) {\n if (arguments.length > 1) {\n for (let t3 = 0; t3 < arguments.length; t3++) this.remove(arguments[t3]);\n return this;\n }\n const e2 = this.children.indexOf(t2);\n return -1 !== e2 && (t2.parent = null, this.children.splice(e2, 1), t2.dispatchEvent(Mr), _r.child = t2, this.dispatchEvent(_r), _r.child = null), this;\n }\n removeFromParent() {\n const t2 = this.parent;\n return null !== t2 && t2.remove(this), this;\n }\n clear() {\n return this.remove(...this.children);\n }\n attach(t2) {\n return this.updateWorldMatrix(true, false), pr.copy(this.matrixWorld).invert(), null !== t2.parent && (t2.parent.updateWorldMatrix(true, false), pr.multiply(t2.parent.matrixWorld)), t2.applyMatrix4(pr), t2.removeFromParent(), t2.parent = this, this.children.push(t2), t2.updateWorldMatrix(false, true), t2.dispatchEvent(wr), Sr.child = t2, this.dispatchEvent(Sr), Sr.child = null, this;\n }\n getObjectById(t2) {\n return this.getObjectByProperty(\"id\", t2);\n }\n getObjectByName(t2) {\n return this.getObjectByProperty(\"name\", t2);\n }\n getObjectByProperty(t2, e2) {\n if (this[t2] === e2) return this;\n for (let s2 = 0, i2 = this.children.length; s2 < i2; s2++) {\n const i3 = this.children[s2].getObjectByProperty(t2, e2);\n if (void 0 !== i3) return i3;\n }\n }\n getObjectsByProperty(t2, e2, s2 = []) {\n this[t2] === e2 && s2.push(this);\n const i2 = this.children;\n for (let r2 = 0, n2 = i2.length; r2 < n2; r2++) i2[r2].getObjectsByProperty(t2, e2, s2);\n return s2;\n }\n getWorldPosition(t2) {\n return this.updateWorldMatrix(true, false), t2.setFromMatrixPosition(this.matrixWorld);\n }\n getWorldQuaternion(t2) {\n return this.updateWorldMatrix(true, false), this.matrixWorld.decompose(yr, t2, gr), t2;\n }\n getWorldScale(t2) {\n return this.updateWorldMatrix(true, false), this.matrixWorld.decompose(yr, fr, t2), t2;\n }\n getWorldDirection(t2) {\n this.updateWorldMatrix(true, false);\n const e2 = this.matrixWorld.elements;\n return t2.set(e2[8], e2[9], e2[10]).normalize();\n }\n raycast() {\n }\n traverse(t2) {\n t2(this);\n const e2 = this.children;\n for (let s2 = 0, i2 = e2.length; s2 < i2; s2++) e2[s2].traverse(t2);\n }\n traverseVisible(t2) {\n if (false === this.visible) return;\n t2(this);\n const e2 = this.children;\n for (let s2 = 0, i2 = e2.length; s2 < i2; s2++) e2[s2].traverseVisible(t2);\n }\n traverseAncestors(t2) {\n const e2 = this.parent;\n null !== e2 && (t2(e2), e2.traverseAncestors(t2));\n }\n updateMatrix() {\n this.matrix.compose(this.position, this.quaternion, this.scale);\n const t2 = this.pivot;\n if (null !== t2) {\n const e2 = t2.x, s2 = t2.y, i2 = t2.z, r2 = this.matrix.elements;\n r2[12] += e2 - r2[0] * e2 - r2[4] * s2 - r2[8] * i2, r2[13] += s2 - r2[1] * e2 - r2[5] * s2 - r2[9] * i2, r2[14] += i2 - r2[2] * e2 - r2[6] * s2 - r2[10] * i2;\n }\n this.matrixWorldNeedsUpdate = true;\n }\n updateMatrixWorld(t2) {\n this.matrixAutoUpdate && this.updateMatrix(), (this.matrixWorldNeedsUpdate || t2) && (true === this.matrixWorldAutoUpdate && (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix)), this.matrixWorldNeedsUpdate = false, t2 = true);\n const e2 = this.children;\n for (let s2 = 0, i2 = e2.length; s2 < i2; s2++) {\n e2[s2].updateMatrixWorld(t2);\n }\n }\n updateWorldMatrix(t2, e2, s2 = false) {\n const i2 = this.parent;\n if (true === t2 && null !== i2 && i2.updateWorldMatrix(true, false), this.matrixAutoUpdate && this.updateMatrix(), (this.matrixWorldNeedsUpdate || s2) && (true === this.matrixWorldAutoUpdate && (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix)), this.matrixWorldNeedsUpdate = false, s2 = true), true === e2) {\n const t3 = this.children;\n for (let e3 = 0, i3 = t3.length; e3 < i3; e3++) {\n t3[e3].updateWorldMatrix(false, true, s2);\n }\n }\n }\n toJSON(t2) {\n const e2 = void 0 === t2 || \"string\" == typeof t2, s2 = {};\n e2 && (t2 = {\n geometries: {},\n materials: {},\n textures: {},\n images: {},\n shapes: {},\n skeletons: {},\n animations: {},\n nodes: {}\n }, s2.metadata = { version: 4.7, type: \"Object\", generator: \"Object3D.toJSON\" });\n const i2 = {};\n function r2(e3, s3) {\n return void 0 === e3[s3.uuid] && (e3[s3.uuid] = s3.toJSON(t2)), s3.uuid;\n }\n if (i2.uuid = this.uuid, i2.type = this.type, \"\" !== this.name && (i2.name = this.name), true === this.castShadow && (i2.castShadow = true), true === this.receiveShadow && (i2.receiveShadow = true), false === this.visible && (i2.visible = false), false === this.frustumCulled && (i2.frustumCulled = false), 0 !== this.renderOrder && (i2.renderOrder = this.renderOrder), false !== this.static && (i2.static = this.static), Object.keys(this.userData).length > 0 && (i2.userData = this.userData), i2.layers = this.layers.mask, i2.matrix = this.matrix.toArray(), i2.up = this.up.toArray(), null !== this.pivot && (i2.pivot = this.pivot.toArray()), false === this.matrixAutoUpdate && (i2.matrixAutoUpdate = false), void 0 !== this.morphTargetDictionary && (i2.morphTargetDictionary = Object.assign({}, this.morphTargetDictionary)), void 0 !== this.morphTargetInfluences && (i2.morphTargetInfluences = this.morphTargetInfluences.slice()), this.isInstancedMesh && (i2.type = \"InstancedMesh\", i2.count = this.count, i2.instanceMatrix = this.instanceMatrix.toJSON(), null !== this.instanceColor && (i2.instanceColor = this.instanceColor.toJSON())), this.isBatchedMesh && (i2.type = \"BatchedMesh\", i2.perObjectFrustumCulled = this.perObjectFrustumCulled, i2.sortObjects = this.sortObjects, i2.drawRanges = this._drawRanges, i2.reservedRanges = this._reservedRanges, i2.geometryInfo = this._geometryInfo.map((t3) => ({\n ...t3,\n boundingBox: t3.boundingBox ? t3.boundingBox.toJSON() : void 0,\n boundingSphere: t3.boundingSphere ? t3.boundingSphere.toJSON() : void 0\n })), i2.instanceInfo = this._instanceInfo.map((t3) => ({ ...t3 })), i2.availableInstanceIds = this._availableInstanceIds.slice(), i2.availableGeometryIds = this._availableGeometryIds.slice(), i2.nextIndexStart = this._nextIndexStart, i2.nextVertexStart = this._nextVertexStart, i2.geometryCount = this._geometryCount, i2.maxInstanceCount = this._maxInstanceCount, i2.maxVertexCount = this._maxVertexCount, i2.maxIndexCount = this._maxIndexCount, i2.geometryInitialized = this._geometryInitialized, i2.matricesTexture = this._matricesTexture.toJSON(t2), i2.indirectTexture = this._indirectTexture.toJSON(t2), null !== this._colorsTexture && (i2.colorsTexture = this._colorsTexture.toJSON(t2)), null !== this.boundingSphere && (i2.boundingSphere = this.boundingSphere.toJSON()), null !== this.boundingBox && (i2.boundingBox = this.boundingBox.toJSON())), this.isScene)\n this.background && (this.background.isColor ? i2.background = this.background.toJSON() : this.background.isTexture && (i2.background = this.background.toJSON(t2).uuid)), this.environment && this.environment.isTexture && true !== this.environment.isRenderTargetTexture && (i2.environment = this.environment.toJSON(t2).uuid);\n else if (this.isMesh || this.isLine || this.isPoints) {\n i2.geometry = r2(t2.geometries, this.geometry);\n const e3 = this.geometry.parameters;\n if (void 0 !== e3 && void 0 !== e3.shapes) {\n const s3 = e3.shapes;\n if (Array.isArray(s3))\n for (let e4 = 0, i3 = s3.length; e4 < i3; e4++) {\n const i4 = s3[e4];\n r2(t2.shapes, i4);\n }\n else r2(t2.shapes, s3);\n }\n }\n if (this.isSkinnedMesh && (i2.bindMode = this.bindMode, i2.bindMatrix = this.bindMatrix.toArray(), void 0 !== this.skeleton && (r2(t2.skeletons, this.skeleton), i2.skeleton = this.skeleton.uuid)), void 0 !== this.material)\n if (Array.isArray(this.material)) {\n const e3 = [];\n for (let s3 = 0, i3 = this.material.length; s3 < i3; s3++)\n e3.push(r2(t2.materials, this.material[s3]));\n i2.material = e3;\n } else i2.material = r2(t2.materials, this.material);\n if (this.children.length > 0) {\n i2.children = [];\n for (let e3 = 0; e3 < this.children.length; e3++)\n i2.children.push(this.children[e3].toJSON(t2).object);\n }\n if (this.animations.length > 0) {\n i2.animations = [];\n for (let e3 = 0; e3 < this.animations.length; e3++) {\n const s3 = this.animations[e3];\n i2.animations.push(r2(t2.animations, s3));\n }\n }\n if (e2) {\n const e3 = n2(t2.geometries), i3 = n2(t2.materials), r3 = n2(t2.textures), a2 = n2(t2.images), o2 = n2(t2.shapes), h2 = n2(t2.skeletons), l2 = n2(t2.animations), c2 = n2(t2.nodes);\n e3.length > 0 && (s2.geometries = e3), i3.length > 0 && (s2.materials = i3), r3.length > 0 && (s2.textures = r3), a2.length > 0 && (s2.images = a2), o2.length > 0 && (s2.shapes = o2), h2.length > 0 && (s2.skeletons = h2), l2.length > 0 && (s2.animations = l2), c2.length > 0 && (s2.nodes = c2);\n }\n return s2.object = i2, s2;\n function n2(t3) {\n const e3 = [];\n for (const s3 in t3) {\n const i3 = t3[s3];\n delete i3.metadata, e3.push(i3);\n }\n return e3;\n }\n }\n clone(t2) {\n return new this.constructor().copy(this, t2);\n }\n copy(t2, e2 = true) {\n if (this.name = t2.name, this.up.copy(t2.up), this.position.copy(t2.position), this.rotation.order = t2.rotation.order, this.quaternion.copy(t2.quaternion), this.scale.copy(t2.scale), this.pivot = null !== t2.pivot ? t2.pivot.clone() : null, this.matrix.copy(t2.matrix), this.matrixWorld.copy(t2.matrixWorld), this.matrixAutoUpdate = t2.matrixAutoUpdate, this.matrixWorldAutoUpdate = t2.matrixWorldAutoUpdate, this.matrixWorldNeedsUpdate = t2.matrixWorldNeedsUpdate, this.layers.mask = t2.layers.mask, this.visible = t2.visible, this.castShadow = t2.castShadow, this.receiveShadow = t2.receiveShadow, this.frustumCulled = t2.frustumCulled, this.renderOrder = t2.renderOrder, this.static = t2.static, this.animations = t2.animations.slice(), this.userData = JSON.parse(JSON.stringify(t2.userData)), true === e2)\n for (let e3 = 0; e3 < t2.children.length; e3++) {\n const s2 = t2.children[e3];\n this.add(s2.clone());\n }\n return this;\n }\n };\n Ar.DEFAULT_UP = new Ti(0, 1, 0), Ar.DEFAULT_MATRIX_AUTO_UPDATE = true, Ar.DEFAULT_MATRIX_WORLD_AUTO_UPDATE = true;\n var Tr = class extends Ar {\n constructor() {\n super(), this.isGroup = true, this.type = \"Group\";\n }\n };\n var zr = { type: \"move\" };\n var Cr = class {\n constructor() {\n this._targetRay = null, this._grip = null, this._hand = null;\n }\n getHandSpace() {\n return null === this._hand && (this._hand = new Tr(), this._hand.matrixAutoUpdate = false, this._hand.visible = false, this._hand.joints = {}, this._hand.inputState = { pinching: false }), this._hand;\n }\n getTargetRaySpace() {\n return null === this._targetRay && (this._targetRay = new Tr(), this._targetRay.matrixAutoUpdate = false, this._targetRay.visible = false, this._targetRay.hasLinearVelocity = false, this._targetRay.linearVelocity = new Ti(), this._targetRay.hasAngularVelocity = false, this._targetRay.angularVelocity = new Ti()), this._targetRay;\n }\n getGripSpace() {\n return null === this._grip && (this._grip = new Tr(), this._grip.matrixAutoUpdate = false, this._grip.visible = false, this._grip.hasLinearVelocity = false, this._grip.linearVelocity = new Ti(), this._grip.hasAngularVelocity = false, this._grip.angularVelocity = new Ti(), this._grip.eventsEnabled = false), this._grip;\n }\n dispatchEvent(t2) {\n return null !== this._targetRay && this._targetRay.dispatchEvent(t2), null !== this._grip && this._grip.dispatchEvent(t2), null !== this._hand && this._hand.dispatchEvent(t2), this;\n }\n connect(t2) {\n if (t2 && t2.hand) {\n const e2 = this._hand;\n if (e2) for (const s2 of t2.hand.values()) this._getHandJoint(e2, s2);\n }\n return this.dispatchEvent({ type: \"connected\", data: t2 }), this;\n }\n disconnect(t2) {\n return this.dispatchEvent({ type: \"disconnected\", data: t2 }), null !== this._targetRay && (this._targetRay.visible = false), null !== this._grip && (this._grip.visible = false), null !== this._hand && (this._hand.visible = false), this;\n }\n update(t2, e2, s2) {\n let i2 = null, r2 = null, n2 = null;\n const a2 = this._targetRay, o2 = this._grip, h2 = this._hand;\n if (t2 && \"visible-blurred\" !== e2.session.visibilityState) {\n if (h2 && t2.hand) {\n n2 = true;\n for (const i4 of t2.hand.values()) {\n const t3 = e2.getJointPose(i4, s2), r4 = this._getHandJoint(h2, i4);\n null !== t3 && (r4.matrix.fromArray(t3.transform.matrix), r4.matrix.decompose(r4.position, r4.rotation, r4.scale), r4.matrixWorldNeedsUpdate = true, r4.jointRadius = t3.radius), r4.visible = null !== t3;\n }\n const i3 = h2.joints[\"index-finger-tip\"], r3 = h2.joints[\"thumb-tip\"], a3 = i3.position.distanceTo(r3.position), o3 = 0.02, l2 = 5e-3;\n h2.inputState.pinching && a3 > o3 + l2 ? (h2.inputState.pinching = false, this.dispatchEvent({ type: \"pinchend\", handedness: t2.handedness, target: this })) : !h2.inputState.pinching && a3 <= o3 - l2 && (h2.inputState.pinching = true, this.dispatchEvent({ type: \"pinchstart\", handedness: t2.handedness, target: this }));\n } else\n null !== o2 && t2.gripSpace && (r2 = e2.getPose(t2.gripSpace, s2), null !== r2 && (o2.matrix.fromArray(r2.transform.matrix), o2.matrix.decompose(o2.position, o2.rotation, o2.scale), o2.matrixWorldNeedsUpdate = true, r2.linearVelocity ? (o2.hasLinearVelocity = true, o2.linearVelocity.copy(r2.linearVelocity)) : o2.hasLinearVelocity = false, r2.angularVelocity ? (o2.hasAngularVelocity = true, o2.angularVelocity.copy(r2.angularVelocity)) : o2.hasAngularVelocity = false, o2.eventsEnabled && o2.dispatchEvent({ type: \"gripUpdated\", data: t2, target: this })));\n null !== a2 && (i2 = e2.getPose(t2.targetRaySpace, s2), null === i2 && null !== r2 && (i2 = r2), null !== i2 && (a2.matrix.fromArray(i2.transform.matrix), a2.matrix.decompose(a2.position, a2.rotation, a2.scale), a2.matrixWorldNeedsUpdate = true, i2.linearVelocity ? (a2.hasLinearVelocity = true, a2.linearVelocity.copy(i2.linearVelocity)) : a2.hasLinearVelocity = false, i2.angularVelocity ? (a2.hasAngularVelocity = true, a2.angularVelocity.copy(i2.angularVelocity)) : a2.hasAngularVelocity = false, this.dispatchEvent(zr)));\n }\n return null !== a2 && (a2.visible = null !== i2), null !== o2 && (o2.visible = null !== r2), null !== h2 && (h2.visible = null !== n2), this;\n }\n _getHandJoint(t2, e2) {\n if (void 0 === t2.joints[e2.jointName]) {\n const s2 = new Tr();\n s2.matrixAutoUpdate = false, s2.visible = false, t2.joints[e2.jointName] = s2, t2.add(s2);\n }\n return t2.joints[e2.jointName];\n }\n };\n var Ir = {\n aliceblue: 15792383,\n antiquewhite: 16444375,\n aqua: 65535,\n aquamarine: 8388564,\n azure: 15794175,\n beige: 16119260,\n bisque: 16770244,\n black: 0,\n blanchedalmond: 16772045,\n blue: 255,\n blueviolet: 9055202,\n brown: 10824234,\n burlywood: 14596231,\n cadetblue: 6266528,\n chartreuse: 8388352,\n chocolate: 13789470,\n coral: 16744272,\n cornflowerblue: 6591981,\n cornsilk: 16775388,\n crimson: 14423100,\n cyan: 65535,\n darkblue: 139,\n darkcyan: 35723,\n darkgoldenrod: 12092939,\n darkgray: 11119017,\n darkgreen: 25600,\n darkgrey: 11119017,\n darkkhaki: 12433259,\n darkmagenta: 9109643,\n darkolivegreen: 5597999,\n darkorange: 16747520,\n darkorchid: 10040012,\n darkred: 9109504,\n darksalmon: 15308410,\n darkseagreen: 9419919,\n darkslateblue: 4734347,\n darkslategray: 3100495,\n darkslategrey: 3100495,\n darkturquoise: 52945,\n darkviolet: 9699539,\n deeppink: 16716947,\n deepskyblue: 49151,\n dimgray: 6908265,\n dimgrey: 6908265,\n dodgerblue: 2003199,\n firebrick: 11674146,\n floralwhite: 16775920,\n forestgreen: 2263842,\n fuchsia: 16711935,\n gainsboro: 14474460,\n ghostwhite: 16316671,\n gold: 16766720,\n goldenrod: 14329120,\n gray: 8421504,\n green: 32768,\n greenyellow: 11403055,\n grey: 8421504,\n honeydew: 15794160,\n hotpink: 16738740,\n indianred: 13458524,\n indigo: 4915330,\n ivory: 16777200,\n khaki: 15787660,\n lavender: 15132410,\n lavenderblush: 16773365,\n lawngreen: 8190976,\n lemonchiffon: 16775885,\n lightblue: 11393254,\n lightcoral: 15761536,\n lightcyan: 14745599,\n lightgoldenrodyellow: 16448210,\n lightgray: 13882323,\n lightgreen: 9498256,\n lightgrey: 13882323,\n lightpink: 16758465,\n lightsalmon: 16752762,\n lightseagreen: 2142890,\n lightskyblue: 8900346,\n lightslategray: 7833753,\n lightslategrey: 7833753,\n lightsteelblue: 11584734,\n lightyellow: 16777184,\n lime: 65280,\n limegreen: 3329330,\n linen: 16445670,\n magenta: 16711935,\n maroon: 8388608,\n mediumaquamarine: 6737322,\n mediumblue: 205,\n mediumorchid: 12211667,\n mediumpurple: 9662683,\n mediumseagreen: 3978097,\n mediumslateblue: 8087790,\n mediumspringgreen: 64154,\n mediumturquoise: 4772300,\n mediumvioletred: 13047173,\n midnightblue: 1644912,\n mintcream: 16121850,\n mistyrose: 16770273,\n moccasin: 16770229,\n navajowhite: 16768685,\n navy: 128,\n oldlace: 16643558,\n olive: 8421376,\n olivedrab: 7048739,\n orange: 16753920,\n orangered: 16729344,\n orchid: 14315734,\n palegoldenrod: 15657130,\n palegreen: 10025880,\n paleturquoise: 11529966,\n palevioletred: 14381203,\n papayawhip: 16773077,\n peachpuff: 16767673,\n peru: 13468991,\n pink: 16761035,\n plum: 14524637,\n powderblue: 11591910,\n purple: 8388736,\n rebeccapurple: 6697881,\n red: 16711680,\n rosybrown: 12357519,\n royalblue: 4286945,\n saddlebrown: 9127187,\n salmon: 16416882,\n sandybrown: 16032864,\n seagreen: 3050327,\n seashell: 16774638,\n sienna: 10506797,\n silver: 12632256,\n skyblue: 8900331,\n slateblue: 6970061,\n slategray: 7372944,\n slategrey: 7372944,\n snow: 16775930,\n springgreen: 65407,\n steelblue: 4620980,\n tan: 13808780,\n teal: 32896,\n thistle: 14204888,\n tomato: 16737095,\n turquoise: 4251856,\n violet: 15631086,\n wheat: 16113331,\n white: 16777215,\n whitesmoke: 16119285,\n yellow: 16776960,\n yellowgreen: 10145074\n };\n var Br = { h: 0, s: 0, l: 0 };\n var kr = { h: 0, s: 0, l: 0 };\n function Or(t2, e2, s2) {\n return s2 < 0 && (s2 += 1), s2 > 1 && (s2 -= 1), s2 < 1 / 6 ? t2 + 6 * (e2 - t2) * s2 : s2 < 0.5 ? e2 : s2 < 2 / 3 ? t2 + 6 * (e2 - t2) * (2 / 3 - s2) : t2;\n }\n var Pr = class {\n constructor(t2, e2, s2) {\n return this.isColor = true, this.r = 1, this.g = 1, this.b = 1, this.set(t2, e2, s2);\n }\n set(t2, e2, s2) {\n if (void 0 === e2 && void 0 === s2) {\n const e3 = t2;\n e3 && e3.isColor ? this.copy(e3) : \"number\" == typeof e3 ? this.setHex(e3) : \"string\" == typeof e3 && this.setStyle(e3);\n } else this.setRGB(t2, e2, s2);\n return this;\n }\n setScalar(t2) {\n return this.r = t2, this.g = t2, this.b = t2, this;\n }\n setHex(t2, e2 = es) {\n return t2 = Math.floor(t2), this.r = (t2 >> 16 & 255) / 255, this.g = (t2 >> 8 & 255) / 255, this.b = (255 & t2) / 255, Ri.colorSpaceToWorking(this, e2), this;\n }\n setRGB(t2, e2, s2, i2 = Ri.workingColorSpace) {\n return this.r = t2, this.g = e2, this.b = s2, Ri.colorSpaceToWorking(this, i2), this;\n }\n setHSL(t2, e2, s2, i2 = Ri.workingColorSpace) {\n if (t2 = bi(t2, 1), e2 = xi(e2, 0, 1), s2 = xi(s2, 0, 1), 0 === e2)\n this.r = this.g = this.b = s2;\n else {\n const i3 = s2 <= 0.5 ? s2 * (1 + e2) : s2 + e2 - s2 * e2, r2 = 2 * s2 - i3;\n this.r = Or(r2, i3, t2 + 1 / 3), this.g = Or(r2, i3, t2), this.b = Or(r2, i3, t2 - 1 / 3);\n }\n return Ri.colorSpaceToWorking(this, i2), this;\n }\n setStyle(t2, e2 = es) {\n function s2(e3) {\n void 0 !== e3 && parseFloat(e3) < 1 && ai(\"Color: Alpha component of \" + t2 + \" will be ignored.\");\n }\n let i2;\n if (i2 = /^(\\w+)\\(([^\\)]*)\\)/.exec(t2)) {\n let r2;\n const n2 = i2[1], a2 = i2[2];\n switch (n2) {\n case \"rgb\":\n case \"rgba\":\n if (r2 = /^\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(a2))\n return s2(r2[4]), this.setRGB(\n Math.min(255, parseInt(r2[1], 10)) / 255,\n Math.min(255, parseInt(r2[2], 10)) / 255,\n Math.min(255, parseInt(r2[3], 10)) / 255,\n e2\n );\n if (r2 = /^\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(a2))\n return s2(r2[4]), this.setRGB(\n Math.min(100, parseInt(r2[1], 10)) / 100,\n Math.min(100, parseInt(r2[2], 10)) / 100,\n Math.min(100, parseInt(r2[3], 10)) / 100,\n e2\n );\n break;\n case \"hsl\":\n case \"hsla\":\n if (r2 = /^\\s*(\\d*\\.?\\d+)\\s*,\\s*(\\d*\\.?\\d+)\\%\\s*,\\s*(\\d*\\.?\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(\n a2\n ))\n return s2(r2[4]), this.setHSL(parseFloat(r2[1]) / 360, parseFloat(r2[2]) / 100, parseFloat(r2[3]) / 100, e2);\n break;\n default:\n ai(\"Color: Unknown color model \" + t2);\n }\n } else if (i2 = /^\\#([A-Fa-f\\d]+)$/.exec(t2)) {\n const s3 = i2[1], r2 = s3.length;\n if (3 === r2)\n return this.setRGB(\n parseInt(s3.charAt(0), 16) / 15,\n parseInt(s3.charAt(1), 16) / 15,\n parseInt(s3.charAt(2), 16) / 15,\n e2\n );\n if (6 === r2) return this.setHex(parseInt(s3, 16), e2);\n ai(\"Color: Invalid hex color \" + t2);\n } else if (t2 && t2.length > 0) return this.setColorName(t2, e2);\n return this;\n }\n setColorName(t2, e2 = es) {\n const s2 = Ir[t2.toLowerCase()];\n return void 0 !== s2 ? this.setHex(s2, e2) : ai(\"Color: Unknown color \" + t2), this;\n }\n clone() {\n return new this.constructor(this.r, this.g, this.b);\n }\n copy(t2) {\n return this.r = t2.r, this.g = t2.g, this.b = t2.b, this;\n }\n copySRGBToLinear(t2) {\n return this.r = Ei(t2.r), this.g = Ei(t2.g), this.b = Ei(t2.b), this;\n }\n copyLinearToSRGB(t2) {\n return this.r = Ni(t2.r), this.g = Ni(t2.g), this.b = Ni(t2.b), this;\n }\n convertSRGBToLinear() {\n return this.copySRGBToLinear(this), this;\n }\n convertLinearToSRGB() {\n return this.copyLinearToSRGB(this), this;\n }\n getHex(t2 = es) {\n return Ri.workingToColorSpace(Rr.copy(this), t2), 65536 * Math.round(xi(255 * Rr.r, 0, 255)) + 256 * Math.round(xi(255 * Rr.g, 0, 255)) + Math.round(xi(255 * Rr.b, 0, 255));\n }\n getHexString(t2 = es) {\n return (\"000000\" + this.getHex(t2).toString(16)).slice(-6);\n }\n getHSL(t2, e2 = Ri.workingColorSpace) {\n Ri.workingToColorSpace(Rr.copy(this), e2);\n const s2 = Rr.r, i2 = Rr.g, r2 = Rr.b, n2 = Math.max(s2, i2, r2), a2 = Math.min(s2, i2, r2);\n let o2, h2;\n const l2 = (a2 + n2) / 2;\n if (a2 === n2) o2 = 0, h2 = 0;\n else {\n const t3 = n2 - a2;\n switch (h2 = l2 <= 0.5 ? t3 / (n2 + a2) : t3 / (2 - n2 - a2), n2) {\n case s2:\n o2 = (i2 - r2) / t3 + (i2 < r2 ? 6 : 0);\n break;\n case i2:\n o2 = (r2 - s2) / t3 + 2;\n break;\n case r2:\n o2 = (s2 - i2) / t3 + 4;\n }\n o2 /= 6;\n }\n return t2.h = o2, t2.s = h2, t2.l = l2, t2;\n }\n getRGB(t2, e2 = Ri.workingColorSpace) {\n return Ri.workingToColorSpace(Rr.copy(this), e2), t2.r = Rr.r, t2.g = Rr.g, t2.b = Rr.b, t2;\n }\n getStyle(t2 = es) {\n Ri.workingToColorSpace(Rr.copy(this), t2);\n const e2 = Rr.r, s2 = Rr.g, i2 = Rr.b;\n return t2 !== es ? `color(${t2} ${e2.toFixed(3)} ${s2.toFixed(3)} ${i2.toFixed(3)})` : `rgb(${Math.round(255 * e2)},${Math.round(255 * s2)},${Math.round(255 * i2)})`;\n }\n offsetHSL(t2, e2, s2) {\n return this.getHSL(Br), this.setHSL(Br.h + t2, Br.s + e2, Br.l + s2);\n }\n add(t2) {\n return this.r += t2.r, this.g += t2.g, this.b += t2.b, this;\n }\n addColors(t2, e2) {\n return this.r = t2.r + e2.r, this.g = t2.g + e2.g, this.b = t2.b + e2.b, this;\n }\n addScalar(t2) {\n return this.r += t2, this.g += t2, this.b += t2, this;\n }\n sub(t2) {\n return this.r = Math.max(0, this.r - t2.r), this.g = Math.max(0, this.g - t2.g), this.b = Math.max(0, this.b - t2.b), this;\n }\n multiply(t2) {\n return this.r *= t2.r, this.g *= t2.g, this.b *= t2.b, this;\n }\n multiplyScalar(t2) {\n return this.r *= t2, this.g *= t2, this.b *= t2, this;\n }\n lerp(t2, e2) {\n return this.r += (t2.r - this.r) * e2, this.g += (t2.g - this.g) * e2, this.b += (t2.b - this.b) * e2, this;\n }\n lerpColors(t2, e2, s2) {\n return this.r = t2.r + (e2.r - t2.r) * s2, this.g = t2.g + (e2.g - t2.g) * s2, this.b = t2.b + (e2.b - t2.b) * s2, this;\n }\n lerpHSL(t2, e2) {\n this.getHSL(Br), t2.getHSL(kr);\n const s2 = vi(Br.h, kr.h, e2), i2 = vi(Br.s, kr.s, e2), r2 = vi(Br.l, kr.l, e2);\n return this.setHSL(s2, i2, r2), this;\n }\n setFromVector3(t2) {\n return this.r = t2.x, this.g = t2.y, this.b = t2.z, this;\n }\n applyMatrix3(t2) {\n const e2 = this.r, s2 = this.g, i2 = this.b, r2 = t2.elements;\n return this.r = r2[0] * e2 + r2[3] * s2 + r2[6] * i2, this.g = r2[1] * e2 + r2[4] * s2 + r2[7] * i2, this.b = r2[2] * e2 + r2[5] * s2 + r2[8] * i2, this;\n }\n equals(t2) {\n return t2.r === this.r && t2.g === this.g && t2.b === this.b;\n }\n fromArray(t2, e2 = 0) {\n return this.r = t2[e2], this.g = t2[e2 + 1], this.b = t2[e2 + 2], this;\n }\n toArray(t2 = [], e2 = 0) {\n return t2[e2] = this.r, t2[e2 + 1] = this.g, t2[e2 + 2] = this.b, t2;\n }\n fromBufferAttribute(t2, e2) {\n return this.r = t2.getX(e2), this.g = t2.getY(e2), this.b = t2.getZ(e2), this;\n }\n toJSON() {\n return this.getHex();\n }\n *[Symbol.iterator]() {\n yield this.r, yield this.g, yield this.b;\n }\n };\n var Rr = new Pr();\n Pr.NAMES = Ir;\n var Er = class _Er {\n constructor(t2, e2 = 25e-5) {\n this.isFogExp2 = true, this.name = \"\", this.color = new Pr(t2), this.density = e2;\n }\n clone() {\n return new _Er(this.color, this.density);\n }\n toJSON() {\n return { type: \"FogExp2\", name: this.name, color: this.color.getHex(), density: this.density };\n }\n };\n var Nr = class _Nr {\n constructor(t2, e2 = 1, s2 = 1e3) {\n this.isFog = true, this.name = \"\", this.color = new Pr(t2), this.near = e2, this.far = s2;\n }\n clone() {\n return new _Nr(this.color, this.near, this.far);\n }\n toJSON() {\n return {\n type: \"Fog\",\n name: this.name,\n color: this.color.getHex(),\n near: this.near,\n far: this.far\n };\n }\n };\n var Vr = class extends Ar {\n constructor() {\n super(), this.isScene = true, this.type = \"Scene\", this.background = null, this.environment = null, this.fog = null, this.backgroundBlurriness = 0, this.backgroundIntensity = 1, this.backgroundRotation = new hr(), this.environmentIntensity = 1, this.environmentRotation = new hr(), this.overrideMaterial = null, \"undefined\" != typeof __THREE_DEVTOOLS__ && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(\"observe\", { detail: this }));\n }\n copy(t2, e2) {\n return super.copy(t2, e2), null !== t2.background && (this.background = t2.background.clone()), null !== t2.environment && (this.environment = t2.environment.clone()), null !== t2.fog && (this.fog = t2.fog.clone()), this.backgroundBlurriness = t2.backgroundBlurriness, this.backgroundIntensity = t2.backgroundIntensity, this.backgroundRotation.copy(t2.backgroundRotation), this.environmentIntensity = t2.environmentIntensity, this.environmentRotation.copy(t2.environmentRotation), null !== t2.overrideMaterial && (this.overrideMaterial = t2.overrideMaterial.clone()), this.matrixAutoUpdate = t2.matrixAutoUpdate, this;\n }\n toJSON(t2) {\n const e2 = super.toJSON(t2);\n return null !== this.fog && (e2.object.fog = this.fog.toJSON()), this.backgroundBlurriness > 0 && (e2.object.backgroundBlurriness = this.backgroundBlurriness), 1 !== this.backgroundIntensity && (e2.object.backgroundIntensity = this.backgroundIntensity), e2.object.backgroundRotation = this.backgroundRotation.toArray(), 1 !== this.environmentIntensity && (e2.object.environmentIntensity = this.environmentIntensity), e2.object.environmentRotation = this.environmentRotation.toArray(), e2;\n }\n };\n var Lr = new Ti();\n var Fr = new Ti();\n var Dr = new Ti();\n var Ur = new Ti();\n var jr = new Ti();\n var Wr = new Ti();\n var Jr = new Ti();\n var qr = new Ti();\n var Hr = new Ti();\n var Xr = new Ti();\n var Yr = new qi();\n var Zr = new qi();\n var Gr = new qi();\n var $r = class _$r {\n constructor(t2 = new Ti(), e2 = new Ti(), s2 = new Ti()) {\n this.a = t2, this.b = e2, this.c = s2;\n }\n static getNormal(t2, e2, s2, i2) {\n i2.subVectors(s2, e2), Lr.subVectors(t2, e2), i2.cross(Lr);\n const r2 = i2.lengthSq();\n return r2 > 0 ? i2.multiplyScalar(1 / Math.sqrt(r2)) : i2.set(0, 0, 0);\n }\n static getBarycoord(t2, e2, s2, i2, r2) {\n Lr.subVectors(i2, e2), Fr.subVectors(s2, e2), Dr.subVectors(t2, e2);\n const n2 = Lr.dot(Lr), a2 = Lr.dot(Fr), o2 = Lr.dot(Dr), h2 = Fr.dot(Fr), l2 = Fr.dot(Dr), c2 = n2 * h2 - a2 * a2;\n if (0 === c2) return r2.set(0, 0, 0), null;\n const u2 = 1 / c2, d2 = (h2 * o2 - a2 * l2) * u2, p2 = (n2 * l2 - a2 * o2) * u2;\n return r2.set(1 - d2 - p2, p2, d2);\n }\n static containsPoint(t2, e2, s2, i2) {\n return null !== this.getBarycoord(t2, e2, s2, i2, Ur) && Ur.x >= 0 && Ur.y >= 0 && Ur.x + Ur.y <= 1;\n }\n static getInterpolation(t2, e2, s2, i2, r2, n2, a2, o2) {\n return null === this.getBarycoord(t2, e2, s2, i2, Ur) ? (o2.x = 0, o2.y = 0, \"z\" in o2 && (o2.z = 0), \"w\" in o2 && (o2.w = 0), null) : (o2.setScalar(0), o2.addScaledVector(r2, Ur.x), o2.addScaledVector(n2, Ur.y), o2.addScaledVector(a2, Ur.z), o2);\n }\n static getInterpolatedAttribute(t2, e2, s2, i2, r2, n2) {\n return Yr.setScalar(0), Zr.setScalar(0), Gr.setScalar(0), Yr.fromBufferAttribute(t2, e2), Zr.fromBufferAttribute(t2, s2), Gr.fromBufferAttribute(t2, i2), n2.setScalar(0), n2.addScaledVector(Yr, r2.x), n2.addScaledVector(Zr, r2.y), n2.addScaledVector(Gr, r2.z), n2;\n }\n static isFrontFacing(t2, e2, s2, i2) {\n return Lr.subVectors(s2, e2), Fr.subVectors(t2, e2), Lr.cross(Fr).dot(i2) < 0;\n }\n set(t2, e2, s2) {\n return this.a.copy(t2), this.b.copy(e2), this.c.copy(s2), this;\n }\n setFromPointsAndIndices(t2, e2, s2, i2) {\n return this.a.copy(t2[e2]), this.b.copy(t2[s2]), this.c.copy(t2[i2]), this;\n }\n setFromAttributeAndIndices(t2, e2, s2, i2) {\n return this.a.fromBufferAttribute(t2, e2), this.b.fromBufferAttribute(t2, s2), this.c.fromBufferAttribute(t2, i2), this;\n }\n clone() {\n return new this.constructor().copy(this);\n }\n copy(t2) {\n return this.a.copy(t2.a), this.b.copy(t2.b), this.c.copy(t2.c), this;\n }\n getArea() {\n return Lr.subVectors(this.c, this.b), Fr.subVectors(this.a, this.b), 0.5 * Lr.cross(Fr).length();\n }\n getMidpoint(t2) {\n return t2.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3);\n }\n getNormal(t2) {\n return _$r.getNormal(this.a, this.b, this.c, t2);\n }\n getPlane(t2) {\n return t2.setFromCoplanarPoints(this.a, this.b, this.c);\n }\n getBarycoord(t2, e2) {\n return _$r.getBarycoord(t2, this.a, this.b, this.c, e2);\n }\n getInterpolation(t2, e2, s2, i2, r2) {\n return _$r.getInterpolation(t2, this.a, this.b, this.c, e2, s2, i2, r2);\n }\n containsPoint(t2) {\n return _$r.containsPoint(t2, this.a, this.b, this.c);\n }\n isFrontFacing(t2) {\n return _$r.isFrontFacing(this.a, this.b, this.c, t2);\n }\n intersectsBox(t2) {\n return t2.intersectsTriangle(this);\n }\n closestPointToPoint(t2, e2) {\n const s2 = this.a, i2 = this.b, r2 = this.c;\n let n2, a2;\n jr.subVectors(i2, s2), Wr.subVectors(r2, s2), qr.subVectors(t2, s2);\n const o2 = jr.dot(qr), h2 = Wr.dot(qr);\n if (o2 <= 0 && h2 <= 0) return e2.copy(s2);\n Hr.subVectors(t2, i2);\n const l2 = jr.dot(Hr), c2 = Wr.dot(Hr);\n if (l2 >= 0 && c2 <= l2) return e2.copy(i2);\n const u2 = o2 * c2 - l2 * h2;\n if (u2 <= 0 && o2 >= 0 && l2 <= 0) return n2 = o2 / (o2 - l2), e2.copy(s2).addScaledVector(jr, n2);\n Xr.subVectors(t2, r2);\n const d2 = jr.dot(Xr), p2 = Wr.dot(Xr);\n if (p2 >= 0 && d2 <= p2) return e2.copy(r2);\n const m2 = d2 * h2 - o2 * p2;\n if (m2 <= 0 && h2 >= 0 && p2 <= 0) return a2 = h2 / (h2 - p2), e2.copy(s2).addScaledVector(Wr, a2);\n const y2 = l2 * p2 - d2 * c2;\n if (y2 <= 0 && c2 - l2 >= 0 && d2 - p2 >= 0)\n return Jr.subVectors(r2, i2), a2 = (c2 - l2) / (c2 - l2 + (d2 - p2)), e2.copy(i2).addScaledVector(Jr, a2);\n const g2 = 1 / (y2 + m2 + u2);\n return n2 = m2 * g2, a2 = u2 * g2, e2.copy(s2).addScaledVector(jr, n2).addScaledVector(Wr, a2);\n }\n equals(t2) {\n return t2.a.equals(this.a) && t2.b.equals(this.b) && t2.c.equals(this.c);\n }\n };\n var Qr = class {\n constructor(t2 = new Ti(1 / 0, 1 / 0, 1 / 0), e2 = new Ti(-1 / 0, -1 / 0, -1 / 0)) {\n this.isBox3 = true, this.min = t2, this.max = e2;\n }\n set(t2, e2) {\n return this.min.copy(t2), this.max.copy(e2), this;\n }\n setFromArray(t2) {\n this.makeEmpty();\n for (let e2 = 0, s2 = t2.length; e2 < s2; e2 += 3) this.expandByPoint(tn.fromArray(t2, e2));\n return this;\n }\n setFromBufferAttribute(t2) {\n this.makeEmpty();\n for (let e2 = 0, s2 = t2.count; e2 < s2; e2++) this.expandByPoint(tn.fromBufferAttribute(t2, e2));\n return this;\n }\n setFromPoints(t2) {\n this.makeEmpty();\n for (let e2 = 0, s2 = t2.length; e2 < s2; e2++) this.expandByPoint(t2[e2]);\n return this;\n }\n setFromCenterAndSize(t2, e2) {\n const s2 = tn.copy(e2).multiplyScalar(0.5);\n return this.min.copy(t2).sub(s2), this.max.copy(t2).add(s2), this;\n }\n setFromObject(t2, e2 = false) {\n return this.makeEmpty(), this.expandByObject(t2, e2);\n }\n clone() {\n return new this.constructor().copy(this);\n }\n copy(t2) {\n return this.min.copy(t2.min), this.max.copy(t2.max), this;\n }\n makeEmpty() {\n return this.min.x = this.min.y = this.min.z = 1 / 0, this.max.x = this.max.y = this.max.z = -1 / 0, this;\n }\n isEmpty() {\n return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z;\n }\n getCenter(t2) {\n return this.isEmpty() ? t2.set(0, 0, 0) : t2.addVectors(this.min, this.max).multiplyScalar(0.5);\n }\n getSize(t2) {\n return this.isEmpty() ? t2.set(0, 0, 0) : t2.subVectors(this.max, this.min);\n }\n expandByPoint(t2) {\n return this.min.min(t2), this.max.max(t2), this;\n }\n expandByVector(t2) {\n return this.min.sub(t2), this.max.add(t2), this;\n }\n expandByScalar(t2) {\n return this.min.addScalar(-t2), this.max.addScalar(t2), this;\n }\n expandByObject(t2, e2 = false) {\n t2.updateWorldMatrix(false, false);\n const s2 = t2.geometry;\n if (void 0 !== s2) {\n const i3 = s2.getAttribute(\"position\");\n if (true === e2 && void 0 !== i3 && true !== t2.isInstancedMesh)\n for (let e3 = 0, s3 = i3.count; e3 < s3; e3++)\n true === t2.isMesh ? t2.getVertexPosition(e3, tn) : tn.fromBufferAttribute(i3, e3), tn.applyMatrix4(t2.matrixWorld), this.expandByPoint(tn);\n else\n void 0 !== t2.boundingBox ? (null === t2.boundingBox && t2.computeBoundingBox(), en.copy(t2.boundingBox)) : (null === s2.boundingBox && s2.computeBoundingBox(), en.copy(s2.boundingBox)), en.applyMatrix4(t2.matrixWorld), this.union(en);\n }\n const i2 = t2.children;\n for (let t3 = 0, s3 = i2.length; t3 < s3; t3++) this.expandByObject(i2[t3], e2);\n return this;\n }\n containsPoint(t2) {\n return t2.x >= this.min.x && t2.x <= this.max.x && t2.y >= this.min.y && t2.y <= this.max.y && t2.z >= this.min.z && t2.z <= this.max.z;\n }\n containsBox(t2) {\n return this.min.x <= t2.min.x && t2.max.x <= this.max.x && this.min.y <= t2.min.y && t2.max.y <= this.max.y && this.min.z <= t2.min.z && t2.max.z <= this.max.z;\n }\n getParameter(t2, e2) {\n return e2.set(\n (t2.x - this.min.x) / (this.max.x - this.min.x),\n (t2.y - this.min.y) / (this.max.y - this.min.y),\n (t2.z - this.min.z) / (this.max.z - this.min.z)\n );\n }\n intersectsBox(t2) {\n return t2.max.x >= this.min.x && t2.min.x <= this.max.x && t2.max.y >= this.min.y && t2.min.y <= this.max.y && t2.max.z >= this.min.z && t2.min.z <= this.max.z;\n }\n intersectsSphere(t2) {\n return this.clampPoint(t2.center, tn), tn.distanceToSquared(t2.center) <= t2.radius * t2.radius;\n }\n intersectsPlane(t2) {\n let e2, s2;\n return t2.normal.x > 0 ? (e2 = t2.normal.x * this.min.x, s2 = t2.normal.x * this.max.x) : (e2 = t2.normal.x * this.max.x, s2 = t2.normal.x * this.min.x), t2.normal.y > 0 ? (e2 += t2.normal.y * this.min.y, s2 += t2.normal.y * this.max.y) : (e2 += t2.normal.y * this.max.y, s2 += t2.normal.y * this.min.y), t2.normal.z > 0 ? (e2 += t2.normal.z * this.min.z, s2 += t2.normal.z * this.max.z) : (e2 += t2.normal.z * this.max.z, s2 += t2.normal.z * this.min.z), e2 <= -t2.constant && s2 >= -t2.constant;\n }\n intersectsTriangle(t2) {\n if (this.isEmpty()) return false;\n this.getCenter(ln), cn.subVectors(this.max, ln), sn.subVectors(t2.a, ln), rn.subVectors(t2.b, ln), nn.subVectors(t2.c, ln), an.subVectors(rn, sn), on.subVectors(nn, rn), hn.subVectors(sn, nn);\n let e2 = [\n 0,\n -an.z,\n an.y,\n 0,\n -on.z,\n on.y,\n 0,\n -hn.z,\n hn.y,\n an.z,\n 0,\n -an.x,\n on.z,\n 0,\n -on.x,\n hn.z,\n 0,\n -hn.x,\n -an.y,\n an.x,\n 0,\n -on.y,\n on.x,\n 0,\n -hn.y,\n hn.x,\n 0\n ];\n return !!pn(e2, sn, rn, nn, cn) && (e2 = [1, 0, 0, 0, 1, 0, 0, 0, 1], !!pn(e2, sn, rn, nn, cn) && (un.crossVectors(an, on), e2 = [un.x, un.y, un.z], pn(e2, sn, rn, nn, cn)));\n }\n clampPoint(t2, e2) {\n return e2.copy(t2).clamp(this.min, this.max);\n }\n distanceToPoint(t2) {\n return this.clampPoint(t2, tn).distanceTo(t2);\n }\n getBoundingSphere(t2) {\n return this.isEmpty() ? t2.makeEmpty() : (this.getCenter(t2.center), t2.radius = 0.5 * this.getSize(tn).length()), t2;\n }\n intersect(t2) {\n return this.min.max(t2.min), this.max.min(t2.max), this.isEmpty() && this.makeEmpty(), this;\n }\n union(t2) {\n return this.min.min(t2.min), this.max.max(t2.max), this;\n }\n applyMatrix4(t2) {\n return this.isEmpty() || (Kr[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(t2), Kr[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(t2), Kr[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(t2), Kr[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(t2), Kr[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(t2), Kr[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(t2), Kr[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(t2), Kr[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(t2), this.setFromPoints(Kr)), this;\n }\n translate(t2) {\n return this.min.add(t2), this.max.add(t2), this;\n }\n equals(t2) {\n return t2.min.equals(this.min) && t2.max.equals(this.max);\n }\n toJSON() {\n return { min: this.min.toArray(), max: this.max.toArray() };\n }\n fromJSON(t2) {\n return this.min.fromArray(t2.min), this.max.fromArray(t2.max), this;\n }\n };\n var Kr = [new Ti(), new Ti(), new Ti(), new Ti(), new Ti(), new Ti(), new Ti(), new Ti()];\n var tn = new Ti();\n var en = new Qr();\n var sn = new Ti();\n var rn = new Ti();\n var nn = new Ti();\n var an = new Ti();\n var on = new Ti();\n var hn = new Ti();\n var ln = new Ti();\n var cn = new Ti();\n var un = new Ti();\n var dn = new Ti();\n function pn(t2, e2, s2, i2, r2) {\n for (let n2 = 0, a2 = t2.length - 3; n2 <= a2; n2 += 3) {\n dn.fromArray(t2, n2);\n const a3 = r2.x * Math.abs(dn.x) + r2.y * Math.abs(dn.y) + r2.z * Math.abs(dn.z), o2 = e2.dot(dn), h2 = s2.dot(dn), l2 = i2.dot(dn);\n if (Math.max(-Math.max(o2, h2, l2), Math.min(o2, h2, l2)) > a3) return false;\n }\n return true;\n }\n var mn = yn();\n function yn() {\n const t2 = new ArrayBuffer(4), e2 = new Float32Array(t2), s2 = new Uint32Array(t2), i2 = new Uint32Array(512), r2 = new Uint32Array(512);\n for (let t3 = 0; t3 < 256; ++t3) {\n const e3 = t3 - 127;\n e3 < -27 ? (i2[t3] = 0, i2[256 | t3] = 32768, r2[t3] = 24, r2[256 | t3] = 24) : e3 < -14 ? (i2[t3] = 1024 >> -e3 - 14, i2[256 | t3] = 1024 >> -e3 - 14 | 32768, r2[t3] = -e3 - 1, r2[256 | t3] = -e3 - 1) : e3 <= 15 ? (i2[t3] = e3 + 15 << 10, i2[256 | t3] = e3 + 15 << 10 | 32768, r2[t3] = 13, r2[256 | t3] = 13) : e3 < 128 ? (i2[t3] = 31744, i2[256 | t3] = 64512, r2[t3] = 24, r2[256 | t3] = 24) : (i2[t3] = 31744, i2[256 | t3] = 64512, r2[t3] = 13, r2[256 | t3] = 13);\n }\n const n2 = new Uint32Array(2048), a2 = new Uint32Array(64), o2 = new Uint32Array(64);\n for (let t3 = 1; t3 < 1024; ++t3) {\n let e3 = t3 << 13, s3 = 0;\n for (; !(8388608 & e3); ) e3 <<= 1, s3 -= 8388608;\n e3 &= -8388609, s3 += 947912704, n2[t3] = e3 | s3;\n }\n for (let t3 = 1024; t3 < 2048; ++t3) n2[t3] = 939524096 + (t3 - 1024 << 13);\n for (let t3 = 1; t3 < 31; ++t3) a2[t3] = t3 << 23;\n a2[31] = 1199570944, a2[32] = 2147483648;\n for (let t3 = 33; t3 < 63; ++t3) a2[t3] = 2147483648 + (t3 - 32 << 23);\n a2[63] = 3347054592;\n for (let t3 = 1; t3 < 64; ++t3) 32 !== t3 && (o2[t3] = 1024);\n return {\n floatView: e2,\n uint32View: s2,\n baseTable: i2,\n shiftTable: r2,\n mantissaTable: n2,\n exponentTable: a2,\n offsetTable: o2\n };\n }\n function gn(t2) {\n Math.abs(t2) > 65504 && ai(\"DataUtils.toHalfFloat(): Value out of range.\"), t2 = xi(t2, -65504, 65504), mn.floatView[0] = t2;\n const e2 = mn.uint32View[0], s2 = e2 >> 23 & 511;\n return mn.baseTable[s2] + ((8388607 & e2) >> mn.shiftTable[s2]);\n }\n function fn(t2) {\n const e2 = t2 >> 10;\n return mn.uint32View[0] = mn.mantissaTable[mn.offsetTable[e2] + (1023 & t2)] + mn.exponentTable[e2], mn.floatView[0];\n }\n var xn = class {\n static toHalfFloat(t2) {\n return gn(t2);\n }\n static fromHalfFloat(t2) {\n return fn(t2);\n }\n };\n var bn = new Ti();\n var vn = new _i();\n var wn = 0;\n var Mn = class extends di {\n constructor(t2, e2, s2 = false) {\n if (super(), Array.isArray(t2))\n throw new TypeError(\"THREE.BufferAttribute: array should be a Typed Array.\");\n this.isBufferAttribute = true, Object.defineProperty(this, \"id\", { value: wn++ }), this.name = \"\", this.array = t2, this.itemSize = e2, this.count = void 0 !== t2 ? t2.length / e2 : 0, this.normalized = s2, this.usage = Os, this.updateRanges = [], this.gpuType = Pt, this.version = 0;\n }\n onUploadCallback() {\n }\n set needsUpdate(t2) {\n true === t2 && this.version++;\n }\n setUsage(t2) {\n return this.usage = t2, this;\n }\n addUpdateRange(t2, e2) {\n this.updateRanges.push({ start: t2, count: e2 });\n }\n clearUpdateRanges() {\n this.updateRanges.length = 0;\n }\n copy(t2) {\n return this.name = t2.name, this.array = new t2.array.constructor(t2.array), this.itemSize = t2.itemSize, this.count = t2.count, this.normalized = t2.normalized, this.usage = t2.usage, this.gpuType = t2.gpuType, this;\n }\n copyAt(t2, e2, s2) {\n t2 *= this.itemSize, s2 *= e2.itemSize;\n for (let i2 = 0, r2 = this.itemSize; i2 < r2; i2++) this.array[t2 + i2] = e2.array[s2 + i2];\n return this;\n }\n copyArray(t2) {\n return this.array.set(t2), this;\n }\n applyMatrix3(t2) {\n if (2 === this.itemSize)\n for (let e2 = 0, s2 = this.count; e2 < s2; e2++)\n vn.fromBufferAttribute(this, e2), vn.applyMatrix3(t2), this.setXY(e2, vn.x, vn.y);\n else if (3 === this.itemSize)\n for (let e2 = 0, s2 = this.count; e2 < s2; e2++)\n bn.fromBufferAttribute(this, e2), bn.applyMatrix3(t2), this.setXYZ(e2, bn.x, bn.y, bn.z);\n return this;\n }\n applyMatrix4(t2) {\n for (let e2 = 0, s2 = this.count; e2 < s2; e2++)\n bn.fromBufferAttribute(this, e2), bn.applyMatrix4(t2), this.setXYZ(e2, bn.x, bn.y, bn.z);\n return this;\n }\n applyNormalMatrix(t2) {\n for (let e2 = 0, s2 = this.count; e2 < s2; e2++)\n bn.fromBufferAttribute(this, e2), bn.applyNormalMatrix(t2), this.setXYZ(e2, bn.x, bn.y, bn.z);\n return this;\n }\n transformDirection(t2) {\n for (let e2 = 0, s2 = this.count; e2 < s2; e2++)\n bn.fromBufferAttribute(this, e2), bn.transformDirection(t2), this.setXYZ(e2, bn.x, bn.y, bn.z);\n return this;\n }\n set(t2, e2 = 0) {\n return this.array.set(t2, e2), this;\n }\n getComponent(t2, e2) {\n let s2 = this.array[t2 * this.itemSize + e2];\n return this.normalized && (s2 = wi(s2, this.array)), s2;\n }\n setComponent(t2, e2, s2) {\n return this.normalized && (s2 = Mi(s2, this.array)), this.array[t2 * this.itemSize + e2] = s2, this;\n }\n getX(t2) {\n let e2 = this.array[t2 * this.itemSize];\n return this.normalized && (e2 = wi(e2, this.array)), e2;\n }\n setX(t2, e2) {\n return this.normalized && (e2 = Mi(e2, this.array)), this.array[t2 * this.itemSize] = e2, this;\n }\n getY(t2) {\n let e2 = this.array[t2 * this.itemSize + 1];\n return this.normalized && (e2 = wi(e2, this.array)), e2;\n }\n setY(t2, e2) {\n return this.normalized && (e2 = Mi(e2, this.array)), this.array[t2 * this.itemSize + 1] = e2, this;\n }\n getZ(t2) {\n let e2 = this.array[t2 * this.itemSize + 2];\n return this.normalized && (e2 = wi(e2, this.array)), e2;\n }\n setZ(t2, e2) {\n return this.normalized && (e2 = Mi(e2, this.array)), this.array[t2 * this.itemSize + 2] = e2, this;\n }\n getW(t2) {\n let e2 = this.array[t2 * this.itemSize + 3];\n return this.normalized && (e2 = wi(e2, this.array)), e2;\n }\n setW(t2, e2) {\n return this.normalized && (e2 = Mi(e2, this.array)), this.array[t2 * this.itemSize + 3] = e2, this;\n }\n setXY(t2, e2, s2) {\n return t2 *= this.itemSize, this.normalized && (e2 = Mi(e2, this.array), s2 = Mi(s2, this.array)), this.array[t2 + 0] = e2, this.array[t2 + 1] = s2, this;\n }\n setXYZ(t2, e2, s2, i2) {\n return t2 *= this.itemSize, this.normalized && (e2 = Mi(e2, this.array), s2 = Mi(s2, this.array), i2 = Mi(i2, this.array)), this.array[t2 + 0] = e2, this.array[t2 + 1] = s2, this.array[t2 + 2] = i2, this;\n }\n setXYZW(t2, e2, s2, i2, r2) {\n return t2 *= this.itemSize, this.normalized && (e2 = Mi(e2, this.array), s2 = Mi(s2, this.array), i2 = Mi(i2, this.array), r2 = Mi(r2, this.array)), this.array[t2 + 0] = e2, this.array[t2 + 1] = s2, this.array[t2 + 2] = i2, this.array[t2 + 3] = r2, this;\n }\n onUpload(t2) {\n return this.onUploadCallback = t2, this;\n }\n clone() {\n return new this.constructor(this.array, this.itemSize).copy(this);\n }\n toJSON() {\n const t2 = {\n itemSize: this.itemSize,\n type: this.array.constructor.name,\n array: Array.from(this.array),\n normalized: this.normalized\n };\n return \"\" !== this.name && (t2.name = this.name), this.usage !== Os && (t2.usage = this.usage), t2;\n }\n dispose() {\n this.dispatchEvent({ type: \"dispose\" });\n }\n };\n var Sn = class extends Mn {\n constructor(t2, e2, s2) {\n super(new Int8Array(t2), e2, s2);\n }\n };\n var _n = class extends Mn {\n constructor(t2, e2, s2) {\n super(new Uint8Array(t2), e2, s2);\n }\n };\n var An = class extends Mn {\n constructor(t2, e2, s2) {\n super(new Uint8ClampedArray(t2), e2, s2);\n }\n };\n var Tn = class extends Mn {\n constructor(t2, e2, s2) {\n super(new Int16Array(t2), e2, s2);\n }\n };\n var zn = class extends Mn {\n constructor(t2, e2, s2) {\n super(new Uint16Array(t2), e2, s2);\n }\n };\n var Cn = class extends Mn {\n constructor(t2, e2, s2) {\n super(new Int32Array(t2), e2, s2);\n }\n };\n var In = class extends Mn {\n constructor(t2, e2, s2) {\n super(new Uint32Array(t2), e2, s2);\n }\n };\n var Bn = class extends Mn {\n constructor(t2, e2, s2) {\n super(new Uint16Array(t2), e2, s2), this.isFloat16BufferAttribute = true;\n }\n getX(t2) {\n let e2 = fn(this.array[t2 * this.itemSize]);\n return this.normalized && (e2 = wi(e2, this.array)), e2;\n }\n setX(t2, e2) {\n return this.normalized && (e2 = Mi(e2, this.array)), this.array[t2 * this.itemSize] = gn(e2), this;\n }\n getY(t2) {\n let e2 = fn(this.array[t2 * this.itemSize + 1]);\n return this.normalized && (e2 = wi(e2, this.array)), e2;\n }\n setY(t2, e2) {\n return this.normalized && (e2 = Mi(e2, this.array)), this.array[t2 * this.itemSize + 1] = gn(e2), this;\n }\n getZ(t2) {\n let e2 = fn(this.array[t2 * this.itemSize + 2]);\n return this.normalized && (e2 = wi(e2, this.array)), e2;\n }\n setZ(t2, e2) {\n return this.normalized && (e2 = Mi(e2, this.array)), this.array[t2 * this.itemSize + 2] = gn(e2), this;\n }\n getW(t2) {\n let e2 = fn(this.array[t2 * this.itemSize + 3]);\n return this.normalized && (e2 = wi(e2, this.array)), e2;\n }\n setW(t2, e2) {\n return this.normalized && (e2 = Mi(e2, this.array)), this.array[t2 * this.itemSize + 3] = gn(e2), this;\n }\n setXY(t2, e2, s2) {\n return t2 *= this.itemSize, this.normalized && (e2 = Mi(e2, this.array), s2 = Mi(s2, this.array)), this.array[t2 + 0] = gn(e2), this.array[t2 + 1] = gn(s2), this;\n }\n setXYZ(t2, e2, s2, i2) {\n return t2 *= this.itemSize, this.normalized && (e2 = Mi(e2, this.array), s2 = Mi(s2, this.array), i2 = Mi(i2, this.array)), this.array[t2 + 0] = gn(e2), this.array[t2 + 1] = gn(s2), this.array[t2 + 2] = gn(i2), this;\n }\n setXYZW(t2, e2, s2, i2, r2) {\n return t2 *= this.itemSize, this.normalized && (e2 = Mi(e2, this.array), s2 = Mi(s2, this.array), i2 = Mi(i2, this.array), r2 = Mi(r2, this.array)), this.array[t2 + 0] = gn(e2), this.array[t2 + 1] = gn(s2), this.array[t2 + 2] = gn(i2), this.array[t2 + 3] = gn(r2), this;\n }\n };\n var kn = class extends Mn {\n constructor(t2, e2, s2) {\n super(new Float32Array(t2), e2, s2);\n }\n };\n var On = new Qr();\n var Pn = new Ti();\n var Rn = new Ti();\n var En = class {\n constructor(t2 = new Ti(), e2 = -1) {\n this.isSphere = true, this.center = t2, this.radius = e2;\n }\n set(t2, e2) {\n return this.center.copy(t2), this.radius = e2, this;\n }\n setFromPoints(t2, e2) {\n const s2 = this.center;\n void 0 !== e2 ? s2.copy(e2) : On.setFromPoints(t2).getCenter(s2);\n let i2 = 0;\n for (let e3 = 0, r2 = t2.length; e3 < r2; e3++) i2 = Math.max(i2, s2.distanceToSquared(t2[e3]));\n return this.radius = Math.sqrt(i2), this;\n }\n copy(t2) {\n return this.center.copy(t2.center), this.radius = t2.radius, this;\n }\n isEmpty() {\n return this.radius < 0;\n }\n makeEmpty() {\n return this.center.set(0, 0, 0), this.radius = -1, this;\n }\n containsPoint(t2) {\n return t2.distanceToSquared(this.center) <= this.radius * this.radius;\n }\n distanceToPoint(t2) {\n return t2.distanceTo(this.center) - this.radius;\n }\n intersectsSphere(t2) {\n const e2 = this.radius + t2.radius;\n return t2.center.distanceToSquared(this.center) <= e2 * e2;\n }\n intersectsBox(t2) {\n return t2.intersectsSphere(this);\n }\n intersectsPlane(t2) {\n return Math.abs(t2.distanceToPoint(this.center)) <= this.radius;\n }\n clampPoint(t2, e2) {\n const s2 = this.center.distanceToSquared(t2);\n return e2.copy(t2), s2 > this.radius * this.radius && (e2.sub(this.center).normalize(), e2.multiplyScalar(this.radius).add(this.center)), e2;\n }\n getBoundingBox(t2) {\n return this.isEmpty() ? (t2.makeEmpty(), t2) : (t2.set(this.center, this.center), t2.expandByScalar(this.radius), t2);\n }\n applyMatrix4(t2) {\n return this.center.applyMatrix4(t2), this.radius = this.radius * t2.getMaxScaleOnAxis(), this;\n }\n translate(t2) {\n return this.center.add(t2), this;\n }\n expandByPoint(t2) {\n if (this.isEmpty()) return this.center.copy(t2), this.radius = 0, this;\n Pn.subVectors(t2, this.center);\n const e2 = Pn.lengthSq();\n if (e2 > this.radius * this.radius) {\n const t3 = Math.sqrt(e2), s2 = 0.5 * (t3 - this.radius);\n this.center.addScaledVector(Pn, s2 / t3), this.radius += s2;\n }\n return this;\n }\n union(t2) {\n return t2.isEmpty() ? this : this.isEmpty() ? (this.copy(t2), this) : (true === this.center.equals(t2.center) ? this.radius = Math.max(this.radius, t2.radius) : (Rn.subVectors(t2.center, this.center).setLength(t2.radius), this.expandByPoint(Pn.copy(t2.center).add(Rn)), this.expandByPoint(Pn.copy(t2.center).sub(Rn))), this);\n }\n equals(t2) {\n return t2.center.equals(this.center) && t2.radius === this.radius;\n }\n clone() {\n return new this.constructor().copy(this);\n }\n toJSON() {\n return { radius: this.radius, center: this.center.toArray() };\n }\n fromJSON(t2) {\n return this.radius = t2.radius, this.center.fromArray(t2.center), this;\n }\n };\n var Nn = 0;\n var Vn = new Qi();\n var Ln = new Ar();\n var Fn = new Ti();\n var Dn = new Qr();\n var Un = new Qr();\n var jn = new Ti();\n var Wn = class _Wn extends di {\n constructor() {\n super(), this.isBufferGeometry = true, Object.defineProperty(this, \"id\", { value: Nn++ }), this.uuid = fi(), this.name = \"\", this.type = \"BufferGeometry\", this.index = null, this.indirect = null, this.indirectOffset = 0, this.attributes = {}, this.morphAttributes = {}, this.morphTargetsRelative = false, this.groups = [], this.boundingBox = null, this.boundingSphere = null, this.drawRange = { start: 0, count: 1 / 0 }, this.userData = {}, this._transformed = false;\n }\n getIndex() {\n return this.index;\n }\n setIndex(t2) {\n return Array.isArray(t2) ? this.index = new ((function(t3) {\n for (let e2 = t3.length - 1; e2 >= 0; --e2) if (t3[e2] >= 65535) return true;\n return false;\n })(t2) ? In : zn)(t2, 1) : this.index = t2, this;\n }\n setIndirect(t2, e2 = 0) {\n return this.indirect = t2, this.indirectOffset = e2, this;\n }\n getIndirect() {\n return this.indirect;\n }\n getAttribute(t2) {\n return this.attributes[t2];\n }\n setAttribute(t2, e2) {\n return this.attributes[t2] = e2, this;\n }\n deleteAttribute(t2) {\n return delete this.attributes[t2], this;\n }\n hasAttribute(t2) {\n return void 0 !== this.attributes[t2];\n }\n addGroup(t2, e2, s2 = 0) {\n this.groups.push({ start: t2, count: e2, materialIndex: s2 });\n }\n clearGroups() {\n this.groups = [];\n }\n setDrawRange(t2, e2) {\n this.drawRange.start = t2, this.drawRange.count = e2;\n }\n applyMatrix4(t2) {\n const e2 = this.attributes.position;\n void 0 !== e2 && (e2.applyMatrix4(t2), e2.needsUpdate = true);\n const s2 = this.attributes.normal;\n if (void 0 !== s2) {\n const e3 = new Ii().getNormalMatrix(t2);\n s2.applyNormalMatrix(e3), s2.needsUpdate = true;\n }\n const i2 = this.attributes.tangent;\n return void 0 !== i2 && (i2.transformDirection(t2), i2.needsUpdate = true), null !== this.boundingBox && this.computeBoundingBox(), null !== this.boundingSphere && this.computeBoundingSphere(), this._transformed = true, this;\n }\n applyQuaternion(t2) {\n return Vn.makeRotationFromQuaternion(t2), this.applyMatrix4(Vn), this;\n }\n rotateX(t2) {\n return Vn.makeRotationX(t2), this.applyMatrix4(Vn), this;\n }\n rotateY(t2) {\n return Vn.makeRotationY(t2), this.applyMatrix4(Vn), this;\n }\n rotateZ(t2) {\n return Vn.makeRotationZ(t2), this.applyMatrix4(Vn), this;\n }\n translate(t2, e2, s2) {\n return Vn.makeTranslation(t2, e2, s2), this.applyMatrix4(Vn), this;\n }\n scale(t2, e2, s2) {\n return Vn.makeScale(t2, e2, s2), this.applyMatrix4(Vn), this;\n }\n lookAt(t2) {\n return Ln.lookAt(t2), Ln.updateMatrix(), this.applyMatrix4(Ln.matrix), this;\n }\n center() {\n return this.computeBoundingBox(), this.boundingBox.getCenter(Fn).negate(), this.translate(Fn.x, Fn.y, Fn.z), this;\n }\n setFromPoints(t2) {\n const e2 = this.getAttribute(\"position\");\n if (void 0 === e2) {\n const e3 = [];\n for (let s2 = 0, i2 = t2.length; s2 < i2; s2++) {\n const i3 = t2[s2];\n e3.push(i3.x, i3.y, i3.z || 0);\n }\n this.setAttribute(\"position\", new kn(e3, 3));\n } else {\n const s2 = Math.min(t2.length, e2.count);\n for (let i2 = 0; i2 < s2; i2++) {\n const s3 = t2[i2];\n e2.setXYZ(i2, s3.x, s3.y, s3.z || 0);\n }\n t2.length > e2.count && ai(\n \"BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry.\"\n ), e2.needsUpdate = true;\n }\n return this;\n }\n computeBoundingBox() {\n null === this.boundingBox && (this.boundingBox = new Qr());\n const t2 = this.attributes.position, e2 = this.morphAttributes.position;\n if (t2 && t2.isGLBufferAttribute)\n return oi(\n \"BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.\",\n this\n ), void this.boundingBox.set(new Ti(-1 / 0, -1 / 0, -1 / 0), new Ti(1 / 0, 1 / 0, 1 / 0));\n if (void 0 !== t2) {\n if (this.boundingBox.setFromBufferAttribute(t2), e2)\n for (let t3 = 0, s2 = e2.length; t3 < s2; t3++) {\n const s3 = e2[t3];\n Dn.setFromBufferAttribute(s3), this.morphTargetsRelative ? (jn.addVectors(this.boundingBox.min, Dn.min), this.boundingBox.expandByPoint(jn), jn.addVectors(this.boundingBox.max, Dn.max), this.boundingBox.expandByPoint(jn)) : (this.boundingBox.expandByPoint(Dn.min), this.boundingBox.expandByPoint(Dn.max));\n }\n } else this.boundingBox.makeEmpty();\n (isNaN(this.boundingBox.min.x) || isNaN(this.boundingBox.min.y) || isNaN(this.boundingBox.min.z)) && oi(\n 'BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The \"position\" attribute is likely to have NaN values.',\n this\n );\n }\n computeBoundingSphere() {\n null === this.boundingSphere && (this.boundingSphere = new En());\n const t2 = this.attributes.position, e2 = this.morphAttributes.position;\n if (t2 && t2.isGLBufferAttribute)\n return oi(\n \"BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.\",\n this\n ), void this.boundingSphere.set(new Ti(), 1 / 0);\n if (t2) {\n const s2 = this.boundingSphere.center;\n if (Dn.setFromBufferAttribute(t2), e2)\n for (let t3 = 0, s3 = e2.length; t3 < s3; t3++) {\n const s4 = e2[t3];\n Un.setFromBufferAttribute(s4), this.morphTargetsRelative ? (jn.addVectors(Dn.min, Un.min), Dn.expandByPoint(jn), jn.addVectors(Dn.max, Un.max), Dn.expandByPoint(jn)) : (Dn.expandByPoint(Un.min), Dn.expandByPoint(Un.max));\n }\n Dn.getCenter(s2);\n let i2 = 0;\n for (let e3 = 0, r2 = t2.count; e3 < r2; e3++)\n jn.fromBufferAttribute(t2, e3), i2 = Math.max(i2, s2.distanceToSquared(jn));\n if (e2)\n for (let r2 = 0, n2 = e2.length; r2 < n2; r2++) {\n const n3 = e2[r2], a2 = this.morphTargetsRelative;\n for (let e3 = 0, r3 = n3.count; e3 < r3; e3++)\n jn.fromBufferAttribute(n3, e3), a2 && (Fn.fromBufferAttribute(t2, e3), jn.add(Fn)), i2 = Math.max(i2, s2.distanceToSquared(jn));\n }\n this.boundingSphere.radius = Math.sqrt(i2), isNaN(this.boundingSphere.radius) && oi(\n 'BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The \"position\" attribute is likely to have NaN values.',\n this\n );\n }\n }\n computeTangents() {\n const t2 = this.index, e2 = this.attributes;\n if (null === t2 || void 0 === e2.position || void 0 === e2.normal || void 0 === e2.uv)\n return void oi(\n \"BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)\"\n );\n const s2 = e2.position, i2 = e2.normal, r2 = e2.uv;\n let n2 = this.getAttribute(\"tangent\");\n void 0 !== n2 && n2.count === s2.count || (n2 = new Mn(new Float32Array(4 * s2.count), 4), this.setAttribute(\"tangent\", n2));\n const a2 = [], o2 = [];\n for (let t3 = 0; t3 < s2.count; t3++) a2[t3] = new Ti(), o2[t3] = new Ti();\n const h2 = new Ti(), l2 = new Ti(), c2 = new Ti(), u2 = new _i(), d2 = new _i(), p2 = new _i(), m2 = new Ti(), y2 = new Ti();\n function g2(t3, e3, i3) {\n h2.fromBufferAttribute(s2, t3), l2.fromBufferAttribute(s2, e3), c2.fromBufferAttribute(s2, i3), u2.fromBufferAttribute(r2, t3), d2.fromBufferAttribute(r2, e3), p2.fromBufferAttribute(r2, i3), l2.sub(h2), c2.sub(h2), d2.sub(u2), p2.sub(u2);\n const n3 = 1 / (d2.x * p2.y - p2.x * d2.y);\n isFinite(n3) && (m2.copy(l2).multiplyScalar(p2.y).addScaledVector(c2, -d2.y).multiplyScalar(n3), y2.copy(c2).multiplyScalar(d2.x).addScaledVector(l2, -p2.x).multiplyScalar(n3), a2[t3].add(m2), a2[e3].add(m2), a2[i3].add(m2), o2[t3].add(y2), o2[e3].add(y2), o2[i3].add(y2));\n }\n let f2 = this.groups;\n 0 === f2.length && (f2 = [{ start: 0, count: t2.count }]);\n for (let e3 = 0, s3 = f2.length; e3 < s3; ++e3) {\n const s4 = f2[e3], i3 = s4.start;\n for (let e4 = i3, r3 = i3 + s4.count; e4 < r3; e4 += 3)\n g2(t2.getX(e4 + 0), t2.getX(e4 + 1), t2.getX(e4 + 2));\n }\n const x2 = new Ti(), b2 = new Ti(), v2 = new Ti(), w2 = new Ti();\n function M2(t3) {\n v2.fromBufferAttribute(i2, t3), w2.copy(v2);\n const e3 = a2[t3];\n x2.copy(e3), x2.sub(v2.multiplyScalar(v2.dot(e3))).normalize(), b2.crossVectors(w2, e3);\n const s3 = b2.dot(o2[t3]) < 0 ? -1 : 1;\n n2.setXYZW(t3, x2.x, x2.y, x2.z, s3);\n }\n for (let e3 = 0, s3 = f2.length; e3 < s3; ++e3) {\n const s4 = f2[e3], i3 = s4.start;\n for (let e4 = i3, r3 = i3 + s4.count; e4 < r3; e4 += 3)\n M2(t2.getX(e4 + 0)), M2(t2.getX(e4 + 1)), M2(t2.getX(e4 + 2));\n }\n this._transformed = true;\n }\n computeVertexNormals() {\n const t2 = this.index, e2 = this.getAttribute(\"position\");\n if (void 0 !== e2) {\n let s2 = this.getAttribute(\"normal\");\n if (void 0 === s2 || s2.count !== e2.count)\n s2 = new Mn(new Float32Array(3 * e2.count), 3), this.setAttribute(\"normal\", s2);\n else for (let t3 = 0, e3 = s2.count; t3 < e3; t3++) s2.setXYZ(t3, 0, 0, 0);\n const i2 = new Ti(), r2 = new Ti(), n2 = new Ti(), a2 = new Ti(), o2 = new Ti(), h2 = new Ti(), l2 = new Ti(), c2 = new Ti();\n if (t2)\n for (let u2 = 0, d2 = t2.count; u2 < d2; u2 += 3) {\n const d3 = t2.getX(u2 + 0), p2 = t2.getX(u2 + 1), m2 = t2.getX(u2 + 2);\n i2.fromBufferAttribute(e2, d3), r2.fromBufferAttribute(e2, p2), n2.fromBufferAttribute(e2, m2), l2.subVectors(n2, r2), c2.subVectors(i2, r2), l2.cross(c2), a2.fromBufferAttribute(s2, d3), o2.fromBufferAttribute(s2, p2), h2.fromBufferAttribute(s2, m2), a2.add(l2), o2.add(l2), h2.add(l2), s2.setXYZ(d3, a2.x, a2.y, a2.z), s2.setXYZ(p2, o2.x, o2.y, o2.z), s2.setXYZ(m2, h2.x, h2.y, h2.z);\n }\n else\n for (let t3 = 0, a3 = e2.count; t3 < a3; t3 += 3)\n i2.fromBufferAttribute(e2, t3 + 0), r2.fromBufferAttribute(e2, t3 + 1), n2.fromBufferAttribute(e2, t3 + 2), l2.subVectors(n2, r2), c2.subVectors(i2, r2), l2.cross(c2), s2.setXYZ(t3 + 0, l2.x, l2.y, l2.z), s2.setXYZ(t3 + 1, l2.x, l2.y, l2.z), s2.setXYZ(t3 + 2, l2.x, l2.y, l2.z);\n this.normalizeNormals(), s2.needsUpdate = true;\n }\n }\n normalizeNormals() {\n const t2 = this.attributes.normal;\n for (let e2 = 0, s2 = t2.count; e2 < s2; e2++)\n jn.fromBufferAttribute(t2, e2), jn.normalize(), t2.setXYZ(e2, jn.x, jn.y, jn.z);\n }\n toNonIndexed() {\n function t2(t3, e3) {\n const s3 = t3.array, i3 = t3.itemSize, r3 = t3.normalized, n3 = new s3.constructor(e3.length * i3);\n let a2 = 0, o2 = 0;\n for (let r4 = 0, h2 = e3.length; r4 < h2; r4++) {\n a2 = t3.isInterleavedBufferAttribute ? e3[r4] * t3.data.stride + t3.offset : e3[r4] * i3;\n for (let t4 = 0; t4 < i3; t4++) n3[o2++] = s3[a2++];\n }\n return new Mn(n3, i3, r3);\n }\n if (null === this.index)\n return ai(\"BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed.\"), this;\n const e2 = new _Wn(), s2 = this.index.array, i2 = this.attributes;\n for (const r3 in i2) {\n const n3 = t2(i2[r3], s2);\n e2.setAttribute(r3, n3);\n }\n const r2 = this.morphAttributes;\n for (const i3 in r2) {\n const n3 = [], a2 = r2[i3];\n for (let e3 = 0, i4 = a2.length; e3 < i4; e3++) {\n const i5 = t2(a2[e3], s2);\n n3.push(i5);\n }\n e2.morphAttributes[i3] = n3;\n }\n e2.morphTargetsRelative = this.morphTargetsRelative;\n const n2 = this.groups;\n for (let t3 = 0, s3 = n2.length; t3 < s3; t3++) {\n const s4 = n2[t3];\n e2.addGroup(s4.start, s4.count, s4.materialIndex);\n }\n return e2;\n }\n toJSON() {\n const t2 = {\n metadata: { version: 4.7, type: \"BufferGeometry\", generator: \"BufferGeometry.toJSON\" }\n };\n if (t2.uuid = this.uuid, t2.type = void 0 !== this.parameters && true === this._transformed ? \"BufferGeometry\" : this.type, \"\" !== this.name && (t2.name = this.name), Object.keys(this.userData).length > 0 && (t2.userData = this.userData), void 0 !== this.parameters && true !== this._transformed) {\n const e3 = this.parameters;\n for (const s3 in e3) void 0 !== e3[s3] && (t2[s3] = e3[s3]);\n return t2;\n }\n t2.data = { attributes: {} };\n const e2 = this.index;\n null !== e2 && (t2.data.index = {\n type: e2.array.constructor.name,\n array: Array.prototype.slice.call(e2.array)\n });\n const s2 = this.attributes;\n for (const e3 in s2) {\n const i3 = s2[e3];\n t2.data.attributes[e3] = i3.toJSON(t2.data);\n }\n const i2 = {};\n let r2 = false;\n for (const e3 in this.morphAttributes) {\n const s3 = this.morphAttributes[e3], n3 = [];\n for (let e4 = 0, i3 = s3.length; e4 < i3; e4++) {\n const i4 = s3[e4];\n n3.push(i4.toJSON(t2.data));\n }\n n3.length > 0 && (i2[e3] = n3, r2 = true);\n }\n r2 && (t2.data.morphAttributes = i2, t2.data.morphTargetsRelative = this.morphTargetsRelative);\n const n2 = this.groups;\n n2.length > 0 && (t2.data.groups = JSON.parse(JSON.stringify(n2)));\n const a2 = this.boundingSphere;\n return null !== a2 && (t2.data.boundingSphere = a2.toJSON()), t2;\n }\n clone() {\n return new this.constructor().copy(this);\n }\n copy(t2) {\n this.index = null, this.attributes = {}, this.morphAttributes = {}, this.groups = [], this.boundingBox = null, this.boundingSphere = null;\n const e2 = {};\n this.name = t2.name;\n const s2 = t2.index;\n null !== s2 && this.setIndex(s2.clone());\n const i2 = t2.attributes;\n for (const t3 in i2) {\n const s3 = i2[t3];\n this.setAttribute(t3, s3.clone(e2));\n }\n const r2 = t2.morphAttributes;\n for (const t3 in r2) {\n const s3 = [], i3 = r2[t3];\n for (let t4 = 0, r3 = i3.length; t4 < r3; t4++) s3.push(i3[t4].clone(e2));\n this.morphAttributes[t3] = s3;\n }\n this.morphTargetsRelative = t2.morphTargetsRelative;\n const n2 = t2.groups;\n for (let t3 = 0, e3 = n2.length; t3 < e3; t3++) {\n const e4 = n2[t3];\n this.addGroup(e4.start, e4.count, e4.materialIndex);\n }\n const a2 = t2.boundingBox;\n null !== a2 && (this.boundingBox = a2.clone());\n const o2 = t2.boundingSphere;\n return null !== o2 && (this.boundingSphere = o2.clone()), this.drawRange.start = t2.drawRange.start, this.drawRange.count = t2.drawRange.count, this.userData = t2.userData, this._transformed = t2._transformed, this;\n }\n dispose() {\n this.dispatchEvent({ type: \"dispose\" });\n }\n };\n var Jn = class {\n constructor(t2, e2) {\n this.isInterleavedBuffer = true, this.array = t2, this.stride = e2, this.count = void 0 !== t2 ? t2.length / e2 : 0, this.usage = Os, this.updateRanges = [], this.version = 0, this.uuid = fi();\n }\n onUploadCallback() {\n }\n set needsUpdate(t2) {\n true === t2 && this.version++;\n }\n setUsage(t2) {\n return this.usage = t2, this;\n }\n addUpdateRange(t2, e2) {\n this.updateRanges.push({ start: t2, count: e2 });\n }\n clearUpdateRanges() {\n this.updateRanges.length = 0;\n }\n copy(t2) {\n return this.array = new t2.array.constructor(t2.array), this.count = t2.count, this.stride = t2.stride, this.usage = t2.usage, this;\n }\n copyAt(t2, e2, s2) {\n t2 *= this.stride, s2 *= e2.stride;\n for (let i2 = 0, r2 = this.stride; i2 < r2; i2++) this.array[t2 + i2] = e2.array[s2 + i2];\n return this;\n }\n set(t2, e2 = 0) {\n return this.array.set(t2, e2), this;\n }\n clone(t2) {\n void 0 === t2.arrayBuffers && (t2.arrayBuffers = {}), void 0 === this.array.buffer._uuid && (this.array.buffer._uuid = fi()), void 0 === t2.arrayBuffers[this.array.buffer._uuid] && (t2.arrayBuffers[this.array.buffer._uuid] = this.array.slice(0).buffer);\n const e2 = new this.array.constructor(t2.arrayBuffers[this.array.buffer._uuid]), s2 = new this.constructor(e2, this.stride);\n return s2.setUsage(this.usage), s2;\n }\n onUpload(t2) {\n return this.onUploadCallback = t2, this;\n }\n toJSON(t2) {\n return void 0 === t2.arrayBuffers && (t2.arrayBuffers = {}), void 0 === this.array.buffer._uuid && (this.array.buffer._uuid = fi()), void 0 === t2.arrayBuffers[this.array.buffer._uuid] && (t2.arrayBuffers[this.array.buffer._uuid] = Array.from(new Uint32Array(this.array.buffer))), {\n uuid: this.uuid,\n buffer: this.array.buffer._uuid,\n type: this.array.constructor.name,\n stride: this.stride\n };\n }\n };\n var qn = new Ti();\n var Hn = class _Hn {\n constructor(t2, e2, s2, i2 = false) {\n this.isInterleavedBufferAttribute = true, this.name = \"\", this.data = t2, this.itemSize = e2, this.offset = s2, this.normalized = i2;\n }\n get count() {\n return this.data.count;\n }\n get array() {\n return this.data.array;\n }\n set needsUpdate(t2) {\n this.data.needsUpdate = t2;\n }\n applyMatrix4(t2) {\n for (let e2 = 0, s2 = this.data.count; e2 < s2; e2++)\n qn.fromBufferAttribute(this, e2), qn.applyMatrix4(t2), this.setXYZ(e2, qn.x, qn.y, qn.z);\n return this;\n }\n applyNormalMatrix(t2) {\n for (let e2 = 0, s2 = this.count; e2 < s2; e2++)\n qn.fromBufferAttribute(this, e2), qn.applyNormalMatrix(t2), this.setXYZ(e2, qn.x, qn.y, qn.z);\n return this;\n }\n transformDirection(t2) {\n for (let e2 = 0, s2 = this.count; e2 < s2; e2++)\n qn.fromBufferAttribute(this, e2), qn.transformDirection(t2), this.setXYZ(e2, qn.x, qn.y, qn.z);\n return this;\n }\n getComponent(t2, e2) {\n let s2 = this.array[t2 * this.data.stride + this.offset + e2];\n return this.normalized && (s2 = wi(s2, this.array)), s2;\n }\n setComponent(t2, e2, s2) {\n return this.normalized && (s2 = Mi(s2, this.array)), this.data.array[t2 * this.data.stride + this.offset + e2] = s2, this;\n }\n setX(t2, e2) {\n return this.normalized && (e2 = Mi(e2, this.array)), this.data.array[t2 * this.data.stride + this.offset] = e2, this;\n }\n setY(t2, e2) {\n return this.normalized && (e2 = Mi(e2, this.array)), this.data.array[t2 * this.data.stride + this.offset + 1] = e2, this;\n }\n setZ(t2, e2) {\n return this.normalized && (e2 = Mi(e2, this.array)), this.data.array[t2 * this.data.stride + this.offset + 2] = e2, this;\n }\n setW(t2, e2) {\n return this.normalized && (e2 = Mi(e2, this.array)), this.data.array[t2 * this.data.stride + this.offset + 3] = e2, this;\n }\n getX(t2) {\n let e2 = this.data.array[t2 * this.data.stride + this.offset];\n return this.normalized && (e2 = wi(e2, this.array)), e2;\n }\n getY(t2) {\n let e2 = this.data.array[t2 * this.data.stride + this.offset + 1];\n return this.normalized && (e2 = wi(e2, this.array)), e2;\n }\n getZ(t2) {\n let e2 = this.data.array[t2 * this.data.stride + this.offset + 2];\n return this.normalized && (e2 = wi(e2, this.array)), e2;\n }\n getW(t2) {\n let e2 = this.data.array[t2 * this.data.stride + this.offset + 3];\n return this.normalized && (e2 = wi(e2, this.array)), e2;\n }\n setXY(t2, e2, s2) {\n return t2 = t2 * this.data.stride + this.offset, this.normalized && (e2 = Mi(e2, this.array), s2 = Mi(s2, this.array)), this.data.array[t2 + 0] = e2, this.data.array[t2 + 1] = s2, this;\n }\n setXYZ(t2, e2, s2, i2) {\n return t2 = t2 * this.data.stride + this.offset, this.normalized && (e2 = Mi(e2, this.array), s2 = Mi(s2, this.array), i2 = Mi(i2, this.array)), this.data.array[t2 + 0] = e2, this.data.array[t2 + 1] = s2, this.data.array[t2 + 2] = i2, this;\n }\n setXYZW(t2, e2, s2, i2, r2) {\n return t2 = t2 * this.data.stride + this.offset, this.normalized && (e2 = Mi(e2, this.array), s2 = Mi(s2, this.array), i2 = Mi(i2, this.array), r2 = Mi(r2, this.array)), this.data.array[t2 + 0] = e2, this.data.array[t2 + 1] = s2, this.data.array[t2 + 2] = i2, this.data.array[t2 + 3] = r2, this;\n }\n clone(t2) {\n if (void 0 === t2) {\n ri(\n \"InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.\"\n );\n const t3 = [];\n for (let e2 = 0; e2 < this.count; e2++) {\n const s2 = e2 * this.data.stride + this.offset;\n for (let e3 = 0; e3 < this.itemSize; e3++) t3.push(this.data.array[s2 + e3]);\n }\n return new Mn(new this.array.constructor(t3), this.itemSize, this.normalized);\n }\n return void 0 === t2.interleavedBuffers && (t2.interleavedBuffers = {}), void 0 === t2.interleavedBuffers[this.data.uuid] && (t2.interleavedBuffers[this.data.uuid] = this.data.clone(t2)), new _Hn(t2.interleavedBuffers[this.data.uuid], this.itemSize, this.offset, this.normalized);\n }\n toJSON(t2) {\n if (void 0 === t2) {\n ri(\n \"InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.\"\n );\n const t3 = [];\n for (let e2 = 0; e2 < this.count; e2++) {\n const s2 = e2 * this.data.stride + this.offset;\n for (let e3 = 0; e3 < this.itemSize; e3++) t3.push(this.data.array[s2 + e3]);\n }\n return {\n itemSize: this.itemSize,\n type: this.array.constructor.name,\n array: t3,\n normalized: this.normalized\n };\n }\n return void 0 === t2.interleavedBuffers && (t2.interleavedBuffers = {}), void 0 === t2.interleavedBuffers[this.data.uuid] && (t2.interleavedBuffers[this.data.uuid] = this.data.toJSON(t2)), {\n isInterleavedBufferAttribute: true,\n itemSize: this.itemSize,\n data: this.data.uuid,\n offset: this.offset,\n normalized: this.normalized\n };\n }\n };\n var Xn;\n var Yn = 0;\n var Zn = class extends di {\n constructor() {\n super(), this.isMaterial = true, Object.defineProperty(this, \"id\", { value: Yn++ }), this.uuid = fi(), this.name = \"\", this.type = \"Material\", this.blending = 1, this.side = 0, this.vertexColors = false, this.opacity = 1, this.transparent = false, this.alphaHash = false, this.blendSrc = 204, this.blendDst = 205, this.blendEquation = 100, this.blendSrcAlpha = null, this.blendDstAlpha = null, this.blendEquationAlpha = null, this.blendColor = new Pr(0, 0, 0), this.blendAlpha = 0, this.depthFunc = 3, this.depthTest = true, this.depthWrite = true, this.stencilWriteMask = 255, this.stencilFunc = 519, this.stencilRef = 0, this.stencilFuncMask = 255, this.stencilFail = ls, this.stencilZFail = ls, this.stencilZPass = ls, this.stencilWrite = false, this.clippingPlanes = null, this.clipIntersection = false, this.clipShadows = false, this.shadowSide = null, this.colorWrite = true, this.precision = null, this.polygonOffset = false, this.polygonOffsetFactor = 0, this.polygonOffsetUnits = 0, this.dithering = false, this.alphaToCoverage = false, this.premultipliedAlpha = false, this.forceSinglePass = false, this.allowOverride = true, this.visible = true, this.toneMapped = true, this.userData = {}, this.version = 0, this._alphaTest = 0;\n }\n get alphaTest() {\n return this._alphaTest;\n }\n set alphaTest(t2) {\n this._alphaTest > 0 != t2 > 0 && this.version++, this._alphaTest = t2;\n }\n onBeforeRender() {\n }\n onBeforeCompile() {\n }\n customProgramCacheKey() {\n return this.onBeforeCompile.toString();\n }\n setValues(t2) {\n if (void 0 !== t2)\n for (const e2 in t2) {\n const s2 = t2[e2];\n if (void 0 === s2) {\n ai(`Material: parameter '${e2}' has value of undefined.`);\n continue;\n }\n const i2 = this[e2];\n void 0 !== i2 ? i2 && i2.isColor ? i2.set(s2) : i2 && i2.isVector2 && s2 && s2.isVector2 || i2 && i2.isEuler && s2 && s2.isEuler || i2 && i2.isVector3 && s2 && s2.isVector3 ? i2.copy(s2) : this[e2] = s2 : ai(`Material: '${e2}' is not a property of THREE.${this.type}.`);\n }\n }\n toJSON(t2) {\n const e2 = void 0 === t2 || \"string\" == typeof t2;\n e2 && (t2 = { textures: {}, images: {} });\n const s2 = { metadata: { version: 4.7, type: \"Material\", generator: \"Material.toJSON\" } };\n function i2(t3) {\n const e3 = [];\n for (const s3 in t3) {\n const i3 = t3[s3];\n delete i3.metadata, e3.push(i3);\n }\n return e3;\n }\n if (s2.uuid = this.uuid, s2.type = this.type, \"\" !== this.name && (s2.name = this.name), this.color && this.color.isColor && (s2.color = this.color.getHex()), void 0 !== this.roughness && (s2.roughness = this.roughness), void 0 !== this.metalness && (s2.metalness = this.metalness), void 0 !== this.sheen && (s2.sheen = this.sheen), this.sheenColor && this.sheenColor.isColor && (s2.sheenColor = this.sheenColor.getHex()), void 0 !== this.sheenRoughness && (s2.sheenRoughness = this.sheenRoughness), this.emissive && this.emissive.isColor && (s2.emissive = this.emissive.getHex()), void 0 !== this.emissiveIntensity && 1 !== this.emissiveIntensity && (s2.emissiveIntensity = this.emissiveIntensity), this.specular && this.specular.isColor && (s2.specular = this.specular.getHex()), void 0 !== this.specularIntensity && (s2.specularIntensity = this.specularIntensity), this.specularColor && this.specularColor.isColor && (s2.specularColor = this.specularColor.getHex()), void 0 !== this.shininess && (s2.shininess = this.shininess), void 0 !== this.clearcoat && (s2.clearcoat = this.clearcoat), void 0 !== this.clearcoatRoughness && (s2.clearcoatRoughness = this.clearcoatRoughness), this.clearcoatMap && this.clearcoatMap.isTexture && (s2.clearcoatMap = this.clearcoatMap.toJSON(t2).uuid), this.clearcoatRoughnessMap && this.clearcoatRoughnessMap.isTexture && (s2.clearcoatRoughnessMap = this.clearcoatRoughnessMap.toJSON(t2).uuid), this.clearcoatNormalMap && this.clearcoatNormalMap.isTexture && (s2.clearcoatNormalMap = this.clearcoatNormalMap.toJSON(t2).uuid, s2.clearcoatNormalScale = this.clearcoatNormalScale.toArray()), this.sheenColorMap && this.sheenColorMap.isTexture && (s2.sheenColorMap = this.sheenColorMap.toJSON(t2).uuid), this.sheenRoughnessMap && this.sheenRoughnessMap.isTexture && (s2.sheenRoughnessMap = this.sheenRoughnessMap.toJSON(t2).uuid), void 0 !== this.dispersion && (s2.dispersion = this.dispersion), void 0 !== this.iridescence && (s2.iridescence = this.iridescence), void 0 !== this.iridescenceIOR && (s2.iridescenceIOR = this.iridescenceIOR), void 0 !== this.iridescenceThicknessRange && (s2.iridescenceThicknessRange = this.iridescenceThicknessRange), this.iridescenceMap && this.iridescenceMap.isTexture && (s2.iridescenceMap = this.iridescenceMap.toJSON(t2).uuid), this.iridescenceThicknessMap && this.iridescenceThicknessMap.isTexture && (s2.iridescenceThicknessMap = this.iridescenceThicknessMap.toJSON(t2).uuid), void 0 !== this.anisotropy && (s2.anisotropy = this.anisotropy), void 0 !== this.anisotropyRotation && (s2.anisotropyRotation = this.anisotropyRotation), this.anisotropyMap && this.anisotropyMap.isTexture && (s2.anisotropyMap = this.anisotropyMap.toJSON(t2).uuid), this.map && this.map.isTexture && (s2.map = this.map.toJSON(t2).uuid), this.matcap && this.matcap.isTexture && (s2.matcap = this.matcap.toJSON(t2).uuid), this.alphaMap && this.alphaMap.isTexture && (s2.alphaMap = this.alphaMap.toJSON(t2).uuid), this.lightMap && this.lightMap.isTexture && (s2.lightMap = this.lightMap.toJSON(t2).uuid, s2.lightMapIntensity = this.lightMapIntensity), this.aoMap && this.aoMap.isTexture && (s2.aoMap = this.aoMap.toJSON(t2).uuid, s2.aoMapIntensity = this.aoMapIntensity), this.bumpMap && this.bumpMap.isTexture && (s2.bumpMap = this.bumpMap.toJSON(t2).uuid, s2.bumpScale = this.bumpScale), this.normalMap && this.normalMap.isTexture && (s2.normalMap = this.normalMap.toJSON(t2).uuid, s2.normalMapType = this.normalMapType, s2.normalScale = this.normalScale.toArray()), this.displacementMap && this.displacementMap.isTexture && (s2.displacementMap = this.displacementMap.toJSON(t2).uuid, s2.displacementScale = this.displacementScale, s2.displacementBias = this.displacementBias), this.roughnessMap && this.roughnessMap.isTexture && (s2.roughnessMap = this.roughnessMap.toJSON(t2).uuid), this.metalnessMap && this.metalnessMap.isTexture && (s2.metalnessMap = this.metalnessMap.toJSON(t2).uuid), this.emissiveMap && this.emissiveMap.isTexture && (s2.emissiveMap = this.emissiveMap.toJSON(t2).uuid), this.specularMap && this.specularMap.isTexture && (s2.specularMap = this.specularMap.toJSON(t2).uuid), this.specularIntensityMap && this.specularIntensityMap.isTexture && (s2.specularIntensityMap = this.specularIntensityMap.toJSON(t2).uuid), this.specularColorMap && this.specularColorMap.isTexture && (s2.specularColorMap = this.specularColorMap.toJSON(t2).uuid), this.envMap && this.envMap.isTexture && (s2.envMap = this.envMap.toJSON(t2).uuid, void 0 !== this.combine && (s2.combine = this.combine)), void 0 !== this.envMapRotation && (s2.envMapRotation = this.envMapRotation.toArray()), void 0 !== this.envMapIntensity && (s2.envMapIntensity = this.envMapIntensity), void 0 !== this.reflectivity && (s2.reflectivity = this.reflectivity), void 0 !== this.refractionRatio && (s2.refractionRatio = this.refractionRatio), this.gradientMap && this.gradientMap.isTexture && (s2.gradientMap = this.gradientMap.toJSON(t2).uuid), void 0 !== this.transmission && (s2.transmission = this.transmission), this.transmissionMap && this.transmissionMap.isTexture && (s2.transmissionMap = this.transmissionMap.toJSON(t2).uuid), void 0 !== this.thickness && (s2.thickness = this.thickness), this.thicknessMap && this.thicknessMap.isTexture && (s2.thicknessMap = this.thicknessMap.toJSON(t2).uuid), void 0 !== this.attenuationDistance && this.attenuationDistance !== 1 / 0 && (s2.attenuationDistance = this.attenuationDistance), void 0 !== this.attenuationColor && (s2.attenuationColor = this.attenuationColor.getHex()), void 0 !== this.size && (s2.size = this.size), null !== this.shadowSide && (s2.shadowSide = this.shadowSide), void 0 !== this.sizeAttenuation && (s2.sizeAttenuation = this.sizeAttenuation), 1 !== this.blending && (s2.blending = this.blending), 0 !== this.side && (s2.side = this.side), true === this.vertexColors && (s2.vertexColors = true), this.opacity < 1 && (s2.opacity = this.opacity), true === this.transparent && (s2.transparent = true), 204 !== this.blendSrc && (s2.blendSrc = this.blendSrc), 205 !== this.blendDst && (s2.blendDst = this.blendDst), 100 !== this.blendEquation && (s2.blendEquation = this.blendEquation), null !== this.blendSrcAlpha && (s2.blendSrcAlpha = this.blendSrcAlpha), null !== this.blendDstAlpha && (s2.blendDstAlpha = this.blendDstAlpha), null !== this.blendEquationAlpha && (s2.blendEquationAlpha = this.blendEquationAlpha), this.blendColor && this.blendColor.isColor && (s2.blendColor = this.blendColor.getHex()), 0 !== this.blendAlpha && (s2.blendAlpha = this.blendAlpha), 3 !== this.depthFunc && (s2.depthFunc = this.depthFunc), false === this.depthTest && (s2.depthTest = this.depthTest), false === this.depthWrite && (s2.depthWrite = this.depthWrite), false === this.colorWrite && (s2.colorWrite = this.colorWrite), 255 !== this.stencilWriteMask && (s2.stencilWriteMask = this.stencilWriteMask), 519 !== this.stencilFunc && (s2.stencilFunc = this.stencilFunc), 0 !== this.stencilRef && (s2.stencilRef = this.stencilRef), 255 !== this.stencilFuncMask && (s2.stencilFuncMask = this.stencilFuncMask), this.stencilFail !== ls && (s2.stencilFail = this.stencilFail), this.stencilZFail !== ls && (s2.stencilZFail = this.stencilZFail), this.stencilZPass !== ls && (s2.stencilZPass = this.stencilZPass), true === this.stencilWrite && (s2.stencilWrite = this.stencilWrite), void 0 !== this.rotation && 0 !== this.rotation && (s2.rotation = this.rotation), true === this.polygonOffset && (s2.polygonOffset = true), 0 !== this.polygonOffsetFactor && (s2.polygonOffsetFactor = this.polygonOffsetFactor), 0 !== this.polygonOffsetUnits && (s2.polygonOffsetUnits = this.polygonOffsetUnits), void 0 !== this.linewidth && 1 !== this.linewidth && (s2.linewidth = this.linewidth), void 0 !== this.dashSize && (s2.dashSize = this.dashSize), void 0 !== this.gapSize && (s2.gapSize = this.gapSize), void 0 !== this.scale && (s2.scale = this.scale), true === this.dithering && (s2.dithering = true), this.alphaTest > 0 && (s2.alphaTest = this.alphaTest), true === this.alphaHash && (s2.alphaHash = true), true === this.alphaToCoverage && (s2.alphaToCoverage = true), true === this.premultipliedAlpha && (s2.premultipliedAlpha = true), true === this.forceSinglePass && (s2.forceSinglePass = true), false === this.allowOverride && (s2.allowOverride = false), true === this.wireframe && (s2.wireframe = true), this.wireframeLinewidth > 1 && (s2.wireframeLinewidth = this.wireframeLinewidth), \"round\" !== this.wireframeLinecap && (s2.wireframeLinecap = this.wireframeLinecap), \"round\" !== this.wireframeLinejoin && (s2.wireframeLinejoin = this.wireframeLinejoin), true === this.flatShading && (s2.flatShading = true), false === this.visible && (s2.visible = false), false === this.toneMapped && (s2.toneMapped = false), false === this.fog && (s2.fog = false), Object.keys(this.userData).length > 0 && (s2.userData = this.userData), e2) {\n const e3 = i2(t2.textures), r2 = i2(t2.images);\n e3.length > 0 && (s2.textures = e3), r2.length > 0 && (s2.images = r2);\n }\n return s2;\n }\n fromJSON(t2, e2) {\n if (void 0 !== t2.uuid && (this.uuid = t2.uuid), void 0 !== t2.name && (this.name = t2.name), void 0 !== t2.color && void 0 !== this.color && this.color.setHex(t2.color), void 0 !== t2.roughness && (this.roughness = t2.roughness), void 0 !== t2.metalness && (this.metalness = t2.metalness), void 0 !== t2.sheen && (this.sheen = t2.sheen), void 0 !== t2.sheenColor && (this.sheenColor = new Pr().setHex(t2.sheenColor)), void 0 !== t2.sheenRoughness && (this.sheenRoughness = t2.sheenRoughness), void 0 !== t2.emissive && void 0 !== this.emissive && this.emissive.setHex(t2.emissive), void 0 !== t2.specular && void 0 !== this.specular && this.specular.setHex(t2.specular), void 0 !== t2.specularIntensity && (this.specularIntensity = t2.specularIntensity), void 0 !== t2.specularColor && void 0 !== this.specularColor && this.specularColor.setHex(t2.specularColor), void 0 !== t2.shininess && (this.shininess = t2.shininess), void 0 !== t2.clearcoat && (this.clearcoat = t2.clearcoat), void 0 !== t2.clearcoatRoughness && (this.clearcoatRoughness = t2.clearcoatRoughness), void 0 !== t2.dispersion && (this.dispersion = t2.dispersion), void 0 !== t2.iridescence && (this.iridescence = t2.iridescence), void 0 !== t2.iridescenceIOR && (this.iridescenceIOR = t2.iridescenceIOR), void 0 !== t2.iridescenceThicknessRange && (this.iridescenceThicknessRange = t2.iridescenceThicknessRange), void 0 !== t2.transmission && (this.transmission = t2.transmission), void 0 !== t2.thickness && (this.thickness = t2.thickness), void 0 !== t2.attenuationDistance && (this.attenuationDistance = t2.attenuationDistance), void 0 !== t2.attenuationColor && void 0 !== this.attenuationColor && this.attenuationColor.setHex(t2.attenuationColor), void 0 !== t2.anisotropy && (this.anisotropy = t2.anisotropy), void 0 !== t2.anisotropyRotation && (this.anisotropyRotation = t2.anisotropyRotation), void 0 !== t2.fog && (this.fog = t2.fog), void 0 !== t2.flatShading && (this.flatShading = t2.flatShading), void 0 !== t2.blending && (this.blending = t2.blending), void 0 !== t2.combine && (this.combine = t2.combine), void 0 !== t2.side && (this.side = t2.side), void 0 !== t2.shadowSide && (this.shadowSide = t2.shadowSide), void 0 !== t2.opacity && (this.opacity = t2.opacity), void 0 !== t2.transparent && (this.transparent = t2.transparent), void 0 !== t2.alphaTest && (this.alphaTest = t2.alphaTest), void 0 !== t2.alphaHash && (this.alphaHash = t2.alphaHash), void 0 !== t2.depthFunc && (this.depthFunc = t2.depthFunc), void 0 !== t2.depthTest && (this.depthTest = t2.depthTest), void 0 !== t2.depthWrite && (this.depthWrite = t2.depthWrite), void 0 !== t2.colorWrite && (this.colorWrite = t2.colorWrite), void 0 !== t2.blendSrc && (this.blendSrc = t2.blendSrc), void 0 !== t2.blendDst && (this.blendDst = t2.blendDst), void 0 !== t2.blendEquation && (this.blendEquation = t2.blendEquation), void 0 !== t2.blendSrcAlpha && (this.blendSrcAlpha = t2.blendSrcAlpha), void 0 !== t2.blendDstAlpha && (this.blendDstAlpha = t2.blendDstAlpha), void 0 !== t2.blendEquationAlpha && (this.blendEquationAlpha = t2.blendEquationAlpha), void 0 !== t2.blendColor && void 0 !== this.blendColor && this.blendColor.setHex(t2.blendColor), void 0 !== t2.blendAlpha && (this.blendAlpha = t2.blendAlpha), void 0 !== t2.stencilWriteMask && (this.stencilWriteMask = t2.stencilWriteMask), void 0 !== t2.stencilFunc && (this.stencilFunc = t2.stencilFunc), void 0 !== t2.stencilRef && (this.stencilRef = t2.stencilRef), void 0 !== t2.stencilFuncMask && (this.stencilFuncMask = t2.stencilFuncMask), void 0 !== t2.stencilFail && (this.stencilFail = t2.stencilFail), void 0 !== t2.stencilZFail && (this.stencilZFail = t2.stencilZFail), void 0 !== t2.stencilZPass && (this.stencilZPass = t2.stencilZPass), void 0 !== t2.stencilWrite && (this.stencilWrite = t2.stencilWrite), void 0 !== t2.wireframe && (this.wireframe = t2.wireframe), void 0 !== t2.wireframeLinewidth && (this.wireframeLinewidth = t2.wireframeLinewidth), void 0 !== t2.wireframeLinecap && (this.wireframeLinecap = t2.wireframeLinecap), void 0 !== t2.wireframeLinejoin && (this.wireframeLinejoin = t2.wireframeLinejoin), void 0 !== t2.rotation && (this.rotation = t2.rotation), void 0 !== t2.linewidth && (this.linewidth = t2.linewidth), void 0 !== t2.dashSize && (this.dashSize = t2.dashSize), void 0 !== t2.gapSize && (this.gapSize = t2.gapSize), void 0 !== t2.scale && (this.scale = t2.scale), void 0 !== t2.polygonOffset && (this.polygonOffset = t2.polygonOffset), void 0 !== t2.polygonOffsetFactor && (this.polygonOffsetFactor = t2.polygonOffsetFactor), void 0 !== t2.polygonOffsetUnits && (this.polygonOffsetUnits = t2.polygonOffsetUnits), void 0 !== t2.dithering && (this.dithering = t2.dithering), void 0 !== t2.alphaToCoverage && (this.alphaToCoverage = t2.alphaToCoverage), void 0 !== t2.premultipliedAlpha && (this.premultipliedAlpha = t2.premultipliedAlpha), void 0 !== t2.forceSinglePass && (this.forceSinglePass = t2.forceSinglePass), void 0 !== t2.allowOverride && (this.allowOverride = t2.allowOverride), void 0 !== t2.visible && (this.visible = t2.visible), void 0 !== t2.toneMapped && (this.toneMapped = t2.toneMapped), void 0 !== t2.userData && (this.userData = t2.userData), void 0 !== t2.vertexColors && (\"number\" == typeof t2.vertexColors ? this.vertexColors = t2.vertexColors > 0 : this.vertexColors = t2.vertexColors), void 0 !== t2.size && (this.size = t2.size), void 0 !== t2.sizeAttenuation && (this.sizeAttenuation = t2.sizeAttenuation), void 0 !== t2.map && (this.map = e2[t2.map] || null), void 0 !== t2.matcap && (this.matcap = e2[t2.matcap] || null), void 0 !== t2.alphaMap && (this.alphaMap = e2[t2.alphaMap] || null), void 0 !== t2.bumpMap && (this.bumpMap = e2[t2.bumpMap] || null), void 0 !== t2.bumpScale && (this.bumpScale = t2.bumpScale), void 0 !== t2.normalMap && (this.normalMap = e2[t2.normalMap] || null), void 0 !== t2.normalMapType && (this.normalMapType = t2.normalMapType), void 0 !== t2.normalScale) {\n let e3 = t2.normalScale;\n false === Array.isArray(e3) && (e3 = [e3, e3]), this.normalScale = new _i().fromArray(e3);\n }\n return void 0 !== t2.displacementMap && (this.displacementMap = e2[t2.displacementMap] || null), void 0 !== t2.displacementScale && (this.displacementScale = t2.displacementScale), void 0 !== t2.displacementBias && (this.displacementBias = t2.displacementBias), void 0 !== t2.roughnessMap && (this.roughnessMap = e2[t2.roughnessMap] || null), void 0 !== t2.metalnessMap && (this.metalnessMap = e2[t2.metalnessMap] || null), void 0 !== t2.emissiveMap && (this.emissiveMap = e2[t2.emissiveMap] || null), void 0 !== t2.emissiveIntensity && (this.emissiveIntensity = t2.emissiveIntensity), void 0 !== t2.specularMap && (this.specularMap = e2[t2.specularMap] || null), void 0 !== t2.specularIntensityMap && (this.specularIntensityMap = e2[t2.specularIntensityMap] || null), void 0 !== t2.specularColorMap && (this.specularColorMap = e2[t2.specularColorMap] || null), void 0 !== t2.envMap && (this.envMap = e2[t2.envMap] || null), void 0 !== t2.envMapRotation && this.envMapRotation.fromArray(t2.envMapRotation), void 0 !== t2.envMapIntensity && (this.envMapIntensity = t2.envMapIntensity), void 0 !== t2.reflectivity && (this.reflectivity = t2.reflectivity), void 0 !== t2.refractionRatio && (this.refractionRatio = t2.refractionRatio), void 0 !== t2.lightMap && (this.lightMap = e2[t2.lightMap] || null), void 0 !== t2.lightMapIntensity && (this.lightMapIntensity = t2.lightMapIntensity), void 0 !== t2.aoMap && (this.aoMap = e2[t2.aoMap] || null), void 0 !== t2.aoMapIntensity && (this.aoMapIntensity = t2.aoMapIntensity), void 0 !== t2.gradientMap && (this.gradientMap = e2[t2.gradientMap] || null), void 0 !== t2.clearcoatMap && (this.clearcoatMap = e2[t2.clearcoatMap] || null), void 0 !== t2.clearcoatRoughnessMap && (this.clearcoatRoughnessMap = e2[t2.clearcoatRoughnessMap] || null), void 0 !== t2.clearcoatNormalMap && (this.clearcoatNormalMap = e2[t2.clearcoatNormalMap] || null), void 0 !== t2.clearcoatNormalScale && (this.clearcoatNormalScale = new _i().fromArray(t2.clearcoatNormalScale)), void 0 !== t2.iridescenceMap && (this.iridescenceMap = e2[t2.iridescenceMap] || null), void 0 !== t2.iridescenceThicknessMap && (this.iridescenceThicknessMap = e2[t2.iridescenceThicknessMap] || null), void 0 !== t2.transmissionMap && (this.transmissionMap = e2[t2.transmissionMap] || null), void 0 !== t2.thicknessMap && (this.thicknessMap = e2[t2.thicknessMap] || null), void 0 !== t2.anisotropyMap && (this.anisotropyMap = e2[t2.anisotropyMap] || null), void 0 !== t2.sheenColorMap && (this.sheenColorMap = e2[t2.sheenColorMap] || null), void 0 !== t2.sheenRoughnessMap && (this.sheenRoughnessMap = e2[t2.sheenRoughnessMap] || null), this;\n }\n clone() {\n return new this.constructor().copy(this);\n }\n copy(t2) {\n this.name = t2.name, this.blending = t2.blending, this.side = t2.side, this.vertexColors = t2.vertexColors, this.opacity = t2.opacity, this.transparent = t2.transparent, this.blendSrc = t2.blendSrc, this.blendDst = t2.blendDst, this.blendEquation = t2.blendEquation, this.blendSrcAlpha = t2.blendSrcAlpha, this.blendDstAlpha = t2.blendDstAlpha, this.blendEquationAlpha = t2.blendEquationAlpha, this.blendColor.copy(t2.blendColor), this.blendAlpha = t2.blendAlpha, this.depthFunc = t2.depthFunc, this.depthTest = t2.depthTest, this.depthWrite = t2.depthWrite, this.stencilWriteMask = t2.stencilWriteMask, this.stencilFunc = t2.stencilFunc, this.stencilRef = t2.stencilRef, this.stencilFuncMask = t2.stencilFuncMask, this.stencilFail = t2.stencilFail, this.stencilZFail = t2.stencilZFail, this.stencilZPass = t2.stencilZPass, this.stencilWrite = t2.stencilWrite;\n const e2 = t2.clippingPlanes;\n let s2 = null;\n if (null !== e2) {\n const t3 = e2.length;\n s2 = new Array(t3);\n for (let i2 = 0; i2 !== t3; ++i2) s2[i2] = e2[i2].clone();\n }\n return this.clippingPlanes = s2, this.clipIntersection = t2.clipIntersection, this.clipShadows = t2.clipShadows, this.shadowSide = t2.shadowSide, this.colorWrite = t2.colorWrite, this.precision = t2.precision, this.polygonOffset = t2.polygonOffset, this.polygonOffsetFactor = t2.polygonOffsetFactor, this.polygonOffsetUnits = t2.polygonOffsetUnits, this.dithering = t2.dithering, this.alphaTest = t2.alphaTest, this.alphaHash = t2.alphaHash, this.alphaToCoverage = t2.alphaToCoverage, this.premultipliedAlpha = t2.premultipliedAlpha, this.forceSinglePass = t2.forceSinglePass, this.allowOverride = t2.allowOverride, this.visible = t2.visible, this.toneMapped = t2.toneMapped, this.userData = JSON.parse(JSON.stringify(t2.userData)), this;\n }\n dispose() {\n this.dispatchEvent({ type: \"dispose\" });\n }\n set needsUpdate(t2) {\n true === t2 && this.version++;\n }\n };\n var Gn = class extends Zn {\n constructor(t2) {\n super(), this.isSpriteMaterial = true, this.type = \"SpriteMaterial\", this.color = new Pr(16777215), this.map = null, this.alphaMap = null, this.rotation = 0, this.sizeAttenuation = true, this.transparent = true, this.fog = true, this.setValues(t2);\n }\n copy(t2) {\n return super.copy(t2), this.color.copy(t2.color), this.map = t2.map, this.alphaMap = t2.alphaMap, this.rotation = t2.rotation, this.sizeAttenuation = t2.sizeAttenuation, this.fog = t2.fog, this;\n }\n };\n var $n = new Ti();\n var Qn = new Ti();\n var Kn = new Ti();\n var ta = new _i();\n var ea = new _i();\n var sa = new Qi();\n var ia = new Ti();\n var ra = new Ti();\n var na = new Ti();\n var aa = new _i();\n var oa = new _i();\n var ha = new _i();\n var la = class extends Ar {\n constructor(t2 = new Gn()) {\n if (super(), this.isSprite = true, this.type = \"Sprite\", void 0 === Xn) {\n Xn = new Wn();\n const t3 = new Float32Array([\n -0.5,\n -0.5,\n 0,\n 0,\n 0,\n 0.5,\n -0.5,\n 0,\n 1,\n 0,\n 0.5,\n 0.5,\n 0,\n 1,\n 1,\n -0.5,\n 0.5,\n 0,\n 0,\n 1\n ]), e2 = new Jn(t3, 5);\n Xn.setIndex([0, 1, 2, 0, 2, 3]), Xn.setAttribute(\"position\", new Hn(e2, 3, 0, false)), Xn.setAttribute(\"uv\", new Hn(e2, 2, 3, false));\n }\n this.geometry = Xn, this.material = t2, this.center = new _i(0.5, 0.5), this.count = 1;\n }\n raycast(t2, e2) {\n null === t2.camera && oi('Sprite: \"Raycaster.camera\" needs to be set in order to raycast against sprites.'), Qn.setFromMatrixScale(this.matrixWorld), sa.copy(t2.camera.matrixWorld), this.modelViewMatrix.multiplyMatrices(t2.camera.matrixWorldInverse, this.matrixWorld), Kn.setFromMatrixPosition(this.modelViewMatrix), t2.camera.isPerspectiveCamera && false === this.material.sizeAttenuation && Qn.multiplyScalar(-Kn.z);\n const s2 = this.material.rotation;\n let i2, r2;\n 0 !== s2 && (r2 = Math.cos(s2), i2 = Math.sin(s2));\n const n2 = this.center;\n ca(ia.set(-0.5, -0.5, 0), Kn, n2, Qn, i2, r2), ca(ra.set(0.5, -0.5, 0), Kn, n2, Qn, i2, r2), ca(na.set(0.5, 0.5, 0), Kn, n2, Qn, i2, r2), aa.set(0, 0), oa.set(1, 0), ha.set(1, 1);\n let a2 = t2.ray.intersectTriangle(ia, ra, na, false, $n);\n if (null === a2 && (ca(ra.set(-0.5, 0.5, 0), Kn, n2, Qn, i2, r2), oa.set(0, 1), a2 = t2.ray.intersectTriangle(ia, na, ra, false, $n), null === a2))\n return;\n const o2 = t2.ray.origin.distanceTo($n);\n o2 < t2.near || o2 > t2.far || e2.push({\n distance: o2,\n point: $n.clone(),\n uv: $r.getInterpolation($n, ia, ra, na, aa, oa, ha, new _i()),\n face: null,\n object: this\n });\n }\n copy(t2, e2) {\n return super.copy(t2, e2), void 0 !== t2.center && this.center.copy(t2.center), this.material = t2.material, this;\n }\n };\n function ca(t2, e2, s2, i2, r2, n2) {\n ta.subVectors(t2, s2).addScalar(0.5).multiply(i2), void 0 !== r2 ? (ea.x = n2 * ta.x - r2 * ta.y, ea.y = r2 * ta.x + n2 * ta.y) : ea.copy(ta), t2.copy(e2), t2.x += ea.x, t2.y += ea.y, t2.applyMatrix4(sa);\n }\n var ua = new Ti();\n var da = new Ti();\n var pa = class extends Ar {\n constructor() {\n super(), this.isLOD = true, this._currentLevel = 0, this.type = \"LOD\", Object.defineProperties(this, { levels: { enumerable: true, value: [] } }), this.autoUpdate = true;\n }\n copy(t2) {\n super.copy(t2, false);\n const e2 = t2.levels;\n for (let t3 = 0, s2 = e2.length; t3 < s2; t3++) {\n const s3 = e2[t3];\n this.addLevel(s3.object.clone(), s3.distance, s3.hysteresis);\n }\n return this.autoUpdate = t2.autoUpdate, this;\n }\n addLevel(t2, e2 = 0, s2 = 0) {\n e2 = Math.abs(e2);\n const i2 = this.levels;\n let r2;\n for (r2 = 0; r2 < i2.length && !(e2 < i2[r2].distance); r2++) ;\n return i2.splice(r2, 0, { distance: e2, hysteresis: s2, object: t2 }), this.add(t2), this;\n }\n removeLevel(t2) {\n const e2 = this.levels;\n for (let s2 = 0; s2 < e2.length; s2++)\n if (e2[s2].distance === t2) {\n const t3 = e2.splice(s2, 1);\n return this.remove(t3[0].object), true;\n }\n return false;\n }\n getCurrentLevel() {\n return this._currentLevel;\n }\n getObjectForDistance(t2) {\n const e2 = this.levels;\n if (e2.length > 0) {\n let s2, i2;\n for (s2 = 1, i2 = e2.length; s2 < i2; s2++) {\n let i3 = e2[s2].distance;\n if (e2[s2].object.visible && (i3 -= i3 * e2[s2].hysteresis), t2 < i3) break;\n }\n return e2[s2 - 1].object;\n }\n return null;\n }\n raycast(t2, e2) {\n if (this.levels.length > 0) {\n ua.setFromMatrixPosition(this.matrixWorld);\n const s2 = t2.ray.origin.distanceTo(ua);\n this.getObjectForDistance(s2).raycast(t2, e2);\n }\n }\n update(t2) {\n const e2 = this.levels;\n if (e2.length > 1) {\n ua.setFromMatrixPosition(t2.matrixWorld), da.setFromMatrixPosition(this.matrixWorld);\n const s2 = ua.distanceTo(da) / t2.zoom;\n let i2, r2;\n for (e2[0].object.visible = true, i2 = 1, r2 = e2.length; i2 < r2; i2++) {\n let t3 = e2[i2].distance;\n if (e2[i2].object.visible && (t3 -= t3 * e2[i2].hysteresis), !(s2 >= t3)) break;\n e2[i2 - 1].object.visible = false, e2[i2].object.visible = true;\n }\n for (this._currentLevel = i2 - 1; i2 < r2; i2++) e2[i2].object.visible = false;\n }\n }\n toJSON(t2) {\n const e2 = super.toJSON(t2);\n false === this.autoUpdate && (e2.object.autoUpdate = false), e2.object.levels = [];\n const s2 = this.levels;\n for (let t3 = 0, i2 = s2.length; t3 < i2; t3++) {\n const i3 = s2[t3];\n e2.object.levels.push({\n object: i3.object.uuid,\n distance: i3.distance,\n hysteresis: i3.hysteresis\n });\n }\n return e2;\n }\n };\n var ma = new Ti();\n var ya = new Ti();\n var ga = new Ti();\n var fa = new Ti();\n var xa = new Ti();\n var ba = new Ti();\n var va = new Ti();\n var wa = class {\n constructor(t2 = new Ti(), e2 = new Ti(0, 0, -1)) {\n this.origin = t2, this.direction = e2;\n }\n set(t2, e2) {\n return this.origin.copy(t2), this.direction.copy(e2), this;\n }\n copy(t2) {\n return this.origin.copy(t2.origin), this.direction.copy(t2.direction), this;\n }\n at(t2, e2) {\n return e2.copy(this.origin).addScaledVector(this.direction, t2);\n }\n lookAt(t2) {\n return this.direction.copy(t2).sub(this.origin).normalize(), this;\n }\n recast(t2) {\n return this.origin.copy(this.at(t2, ma)), this;\n }\n closestPointToPoint(t2, e2) {\n e2.subVectors(t2, this.origin);\n const s2 = e2.dot(this.direction);\n return s2 < 0 ? e2.copy(this.origin) : e2.copy(this.origin).addScaledVector(this.direction, s2);\n }\n distanceToPoint(t2) {\n return Math.sqrt(this.distanceSqToPoint(t2));\n }\n distanceSqToPoint(t2) {\n const e2 = ma.subVectors(t2, this.origin).dot(this.direction);\n return e2 < 0 ? this.origin.distanceToSquared(t2) : (ma.copy(this.origin).addScaledVector(this.direction, e2), ma.distanceToSquared(t2));\n }\n distanceSqToSegment(t2, e2, s2, i2) {\n ya.copy(t2).add(e2).multiplyScalar(0.5), ga.copy(e2).sub(t2).normalize(), fa.copy(this.origin).sub(ya);\n const r2 = 0.5 * t2.distanceTo(e2), n2 = -this.direction.dot(ga), a2 = fa.dot(this.direction), o2 = -fa.dot(ga), h2 = fa.lengthSq(), l2 = Math.abs(1 - n2 * n2);\n let c2, u2, d2, p2;\n if (l2 > 0)\n if (c2 = n2 * o2 - a2, u2 = n2 * a2 - o2, p2 = r2 * l2, c2 >= 0)\n if (u2 >= -p2)\n if (u2 <= p2) {\n const t3 = 1 / l2;\n c2 *= t3, u2 *= t3, d2 = c2 * (c2 + n2 * u2 + 2 * a2) + u2 * (n2 * c2 + u2 + 2 * o2) + h2;\n } else u2 = r2, c2 = Math.max(0, -(n2 * u2 + a2)), d2 = -c2 * c2 + u2 * (u2 + 2 * o2) + h2;\n else u2 = -r2, c2 = Math.max(0, -(n2 * u2 + a2)), d2 = -c2 * c2 + u2 * (u2 + 2 * o2) + h2;\n else\n u2 <= -p2 ? (c2 = Math.max(0, -(-n2 * r2 + a2)), u2 = c2 > 0 ? -r2 : Math.min(Math.max(-r2, -o2), r2), d2 = -c2 * c2 + u2 * (u2 + 2 * o2) + h2) : u2 <= p2 ? (c2 = 0, u2 = Math.min(Math.max(-r2, -o2), r2), d2 = u2 * (u2 + 2 * o2) + h2) : (c2 = Math.max(0, -(n2 * r2 + a2)), u2 = c2 > 0 ? r2 : Math.min(Math.max(-r2, -o2), r2), d2 = -c2 * c2 + u2 * (u2 + 2 * o2) + h2);\n else\n u2 = n2 > 0 ? -r2 : r2, c2 = Math.max(0, -(n2 * u2 + a2)), d2 = -c2 * c2 + u2 * (u2 + 2 * o2) + h2;\n return s2 && s2.copy(this.origin).addScaledVector(this.direction, c2), i2 && i2.copy(ya).addScaledVector(ga, u2), d2;\n }\n intersectSphere(t2, e2) {\n ma.subVectors(t2.center, this.origin);\n const s2 = ma.dot(this.direction), i2 = ma.dot(ma) - s2 * s2, r2 = t2.radius * t2.radius;\n if (i2 > r2) return null;\n const n2 = Math.sqrt(r2 - i2), a2 = s2 - n2, o2 = s2 + n2;\n return o2 < 0 ? null : a2 < 0 ? this.at(o2, e2) : this.at(a2, e2);\n }\n intersectsSphere(t2) {\n return !(t2.radius < 0) && this.distanceSqToPoint(t2.center) <= t2.radius * t2.radius;\n }\n distanceToPlane(t2) {\n const e2 = t2.normal.dot(this.direction);\n if (0 === e2) return 0 === t2.distanceToPoint(this.origin) ? 0 : null;\n const s2 = -(this.origin.dot(t2.normal) + t2.constant) / e2;\n return s2 >= 0 ? s2 : null;\n }\n intersectPlane(t2, e2) {\n const s2 = this.distanceToPlane(t2);\n return null === s2 ? null : this.at(s2, e2);\n }\n intersectsPlane(t2) {\n const e2 = t2.distanceToPoint(this.origin);\n if (0 === e2) return true;\n return t2.normal.dot(this.direction) * e2 < 0;\n }\n intersectBox(t2, e2) {\n let s2, i2, r2, n2, a2, o2;\n const h2 = 1 / this.direction.x, l2 = 1 / this.direction.y, c2 = 1 / this.direction.z, u2 = this.origin;\n return h2 >= 0 ? (s2 = (t2.min.x - u2.x) * h2, i2 = (t2.max.x - u2.x) * h2) : (s2 = (t2.max.x - u2.x) * h2, i2 = (t2.min.x - u2.x) * h2), l2 >= 0 ? (r2 = (t2.min.y - u2.y) * l2, n2 = (t2.max.y - u2.y) * l2) : (r2 = (t2.max.y - u2.y) * l2, n2 = (t2.min.y - u2.y) * l2), s2 > n2 || r2 > i2 ? null : ((r2 > s2 || isNaN(s2)) && (s2 = r2), (n2 < i2 || isNaN(i2)) && (i2 = n2), c2 >= 0 ? (a2 = (t2.min.z - u2.z) * c2, o2 = (t2.max.z - u2.z) * c2) : (a2 = (t2.max.z - u2.z) * c2, o2 = (t2.min.z - u2.z) * c2), s2 > o2 || a2 > i2 ? null : ((a2 > s2 || s2 != s2) && (s2 = a2), (o2 < i2 || i2 != i2) && (i2 = o2), i2 < 0 ? null : this.at(s2 >= 0 ? s2 : i2, e2)));\n }\n intersectsBox(t2) {\n return null !== this.intersectBox(t2, ma);\n }\n intersectTriangle(t2, e2, s2, i2, r2) {\n xa.subVectors(e2, t2), ba.subVectors(s2, t2), va.crossVectors(xa, ba);\n let n2, a2 = this.direction.dot(va);\n if (a2 > 0) {\n if (i2) return null;\n n2 = 1;\n } else {\n if (!(a2 < 0)) return null;\n n2 = -1, a2 = -a2;\n }\n fa.subVectors(this.origin, t2);\n const o2 = n2 * this.direction.dot(ba.crossVectors(fa, ba));\n if (o2 < 0) return null;\n const h2 = n2 * this.direction.dot(xa.cross(fa));\n if (h2 < 0) return null;\n if (o2 + h2 > a2) return null;\n const l2 = -n2 * fa.dot(va);\n return l2 < 0 ? null : this.at(l2 / a2, r2);\n }\n applyMatrix4(t2) {\n return this.origin.applyMatrix4(t2), this.direction.transformDirection(t2), this;\n }\n equals(t2) {\n return t2.origin.equals(this.origin) && t2.direction.equals(this.direction);\n }\n clone() {\n return new this.constructor().copy(this);\n }\n };\n var Ma = class extends Zn {\n constructor(t2) {\n super(), this.isMeshBasicMaterial = true, this.type = \"MeshBasicMaterial\", this.color = new Pr(16777215), this.map = null, this.lightMap = null, this.lightMapIntensity = 1, this.aoMap = null, this.aoMapIntensity = 1, this.specularMap = null, this.alphaMap = null, this.envMap = null, this.envMapRotation = new hr(), this.combine = 0, this.reflectivity = 1, this.refractionRatio = 0.98, this.wireframe = false, this.wireframeLinewidth = 1, this.wireframeLinecap = \"round\", this.wireframeLinejoin = \"round\", this.fog = true, this.setValues(t2);\n }\n copy(t2) {\n return super.copy(t2), this.color.copy(t2.color), this.map = t2.map, this.lightMap = t2.lightMap, this.lightMapIntensity = t2.lightMapIntensity, this.aoMap = t2.aoMap, this.aoMapIntensity = t2.aoMapIntensity, this.specularMap = t2.specularMap, this.alphaMap = t2.alphaMap, this.envMap = t2.envMap, this.envMapRotation.copy(t2.envMapRotation), this.combine = t2.combine, this.reflectivity = t2.reflectivity, this.refractionRatio = t2.refractionRatio, this.wireframe = t2.wireframe, this.wireframeLinewidth = t2.wireframeLinewidth, this.wireframeLinecap = t2.wireframeLinecap, this.wireframeLinejoin = t2.wireframeLinejoin, this.fog = t2.fog, this;\n }\n };\n var Sa = new Qi();\n var _a = new wa();\n var Aa = new En();\n var Ta = new Ti();\n var za = new Ti();\n var Ca = new Ti();\n var Ia = new Ti();\n var Ba = new Ti();\n var ka = new Ti();\n var Oa = new Ti();\n var Pa = new Ti();\n var Ra = class extends Ar {\n constructor(t2 = new Wn(), e2 = new Ma()) {\n super(), this.isMesh = true, this.type = \"Mesh\", this.geometry = t2, this.material = e2, this.morphTargetDictionary = void 0, this.morphTargetInfluences = void 0, this.count = 1, this.updateMorphTargets();\n }\n copy(t2, e2) {\n return super.copy(t2, e2), void 0 !== t2.morphTargetInfluences && (this.morphTargetInfluences = t2.morphTargetInfluences.slice()), void 0 !== t2.morphTargetDictionary && (this.morphTargetDictionary = Object.assign({}, t2.morphTargetDictionary)), this.material = Array.isArray(t2.material) ? t2.material.slice() : t2.material, this.geometry = t2.geometry, this;\n }\n updateMorphTargets() {\n const t2 = this.geometry.morphAttributes, e2 = Object.keys(t2);\n if (e2.length > 0) {\n const s2 = t2[e2[0]];\n if (void 0 !== s2) {\n this.morphTargetInfluences = [], this.morphTargetDictionary = {};\n for (let t3 = 0, e3 = s2.length; t3 < e3; t3++) {\n const e4 = s2[t3].name || String(t3);\n this.morphTargetInfluences.push(0), this.morphTargetDictionary[e4] = t3;\n }\n }\n }\n }\n getVertexPosition(t2, e2) {\n const s2 = this.geometry, i2 = s2.attributes.position, r2 = s2.morphAttributes.position, n2 = s2.morphTargetsRelative;\n e2.fromBufferAttribute(i2, t2);\n const a2 = this.morphTargetInfluences;\n if (r2 && a2) {\n ka.set(0, 0, 0);\n for (let s3 = 0, i3 = r2.length; s3 < i3; s3++) {\n const i4 = a2[s3], o2 = r2[s3];\n 0 !== i4 && (Ba.fromBufferAttribute(o2, t2), n2 ? ka.addScaledVector(Ba, i4) : ka.addScaledVector(Ba.sub(e2), i4));\n }\n e2.add(ka);\n }\n return e2;\n }\n raycast(t2, e2) {\n const s2 = this.geometry, i2 = this.material, r2 = this.matrixWorld;\n if (void 0 !== i2) {\n if (null === s2.boundingSphere && s2.computeBoundingSphere(), Aa.copy(s2.boundingSphere), Aa.applyMatrix4(r2), _a.copy(t2.ray).recast(t2.near), false === Aa.containsPoint(_a.origin)) {\n if (null === _a.intersectSphere(Aa, Ta)) return;\n if (_a.origin.distanceToSquared(Ta) > (t2.far - t2.near) ** 2) return;\n }\n Sa.copy(r2).invert(), _a.copy(t2.ray).applyMatrix4(Sa), null !== s2.boundingBox && false === _a.intersectsBox(s2.boundingBox) || this._computeIntersections(t2, e2, _a);\n }\n }\n _computeIntersections(t2, e2, s2) {\n let i2;\n const r2 = this.geometry, n2 = this.material, a2 = r2.index, o2 = r2.attributes.position, h2 = r2.attributes.uv, l2 = r2.attributes.uv1, c2 = r2.attributes.normal, u2 = r2.groups, d2 = r2.drawRange;\n if (null !== a2)\n if (Array.isArray(n2))\n for (let r3 = 0, o3 = u2.length; r3 < o3; r3++) {\n const o4 = u2[r3], p2 = n2[o4.materialIndex];\n for (let r4 = Math.max(o4.start, d2.start), n3 = Math.min(a2.count, Math.min(o4.start + o4.count, d2.start + d2.count)); r4 < n3; r4 += 3) {\n i2 = Ea(this, p2, t2, s2, h2, l2, c2, a2.getX(r4), a2.getX(r4 + 1), a2.getX(r4 + 2)), i2 && (i2.faceIndex = Math.floor(r4 / 3), i2.face.materialIndex = o4.materialIndex, e2.push(i2));\n }\n }\n else {\n for (let r3 = Math.max(0, d2.start), o3 = Math.min(a2.count, d2.start + d2.count); r3 < o3; r3 += 3) {\n i2 = Ea(this, n2, t2, s2, h2, l2, c2, a2.getX(r3), a2.getX(r3 + 1), a2.getX(r3 + 2)), i2 && (i2.faceIndex = Math.floor(r3 / 3), e2.push(i2));\n }\n }\n else if (void 0 !== o2)\n if (Array.isArray(n2))\n for (let r3 = 0, a3 = u2.length; r3 < a3; r3++) {\n const a4 = u2[r3], p2 = n2[a4.materialIndex];\n for (let r4 = Math.max(a4.start, d2.start), n3 = Math.min(o2.count, Math.min(a4.start + a4.count, d2.start + d2.count)); r4 < n3; r4 += 3) {\n i2 = Ea(this, p2, t2, s2, h2, l2, c2, r4, r4 + 1, r4 + 2), i2 && (i2.faceIndex = Math.floor(r4 / 3), i2.face.materialIndex = a4.materialIndex, e2.push(i2));\n }\n }\n else {\n for (let r3 = Math.max(0, d2.start), a3 = Math.min(o2.count, d2.start + d2.count); r3 < a3; r3 += 3) {\n i2 = Ea(this, n2, t2, s2, h2, l2, c2, r3, r3 + 1, r3 + 2), i2 && (i2.faceIndex = Math.floor(r3 / 3), e2.push(i2));\n }\n }\n }\n };\n function Ea(t2, e2, s2, i2, r2, n2, a2, o2, h2, l2) {\n t2.getVertexPosition(o2, za), t2.getVertexPosition(h2, Ca), t2.getVertexPosition(l2, Ia);\n const c2 = (function(t3, e3, s3, i3, r3, n3, a3, o3) {\n let h3;\n if (h3 = 1 === e3.side ? i3.intersectTriangle(a3, n3, r3, true, o3) : i3.intersectTriangle(r3, n3, a3, 0 === e3.side, o3), null === h3)\n return null;\n Pa.copy(o3), Pa.applyMatrix4(t3.matrixWorld);\n const l3 = s3.ray.origin.distanceTo(Pa);\n return l3 < s3.near || l3 > s3.far ? null : { distance: l3, point: Pa.clone(), object: t3 };\n })(t2, e2, s2, i2, za, Ca, Ia, Oa);\n if (c2) {\n const t3 = new Ti();\n $r.getBarycoord(Oa, za, Ca, Ia, t3), r2 && (c2.uv = $r.getInterpolatedAttribute(r2, o2, h2, l2, t3, new _i())), n2 && (c2.uv1 = $r.getInterpolatedAttribute(n2, o2, h2, l2, t3, new _i())), a2 && (c2.normal = $r.getInterpolatedAttribute(a2, o2, h2, l2, t3, new Ti()), c2.normal.dot(i2.direction) > 0 && c2.normal.multiplyScalar(-1));\n const e3 = { a: o2, b: h2, c: l2, normal: new Ti(), materialIndex: 0 };\n $r.getNormal(za, Ca, Ia, e3.normal), c2.face = e3, c2.barycoord = t3;\n }\n return c2;\n }\n var Na = new qi();\n var Va = new qi();\n var La = new qi();\n var Fa = new qi();\n var Da = new Qi();\n var Ua = new Ti();\n var ja = new En();\n var Wa = new Qi();\n var Ja = new wa();\n var qa = class extends Ra {\n constructor(t2, e2) {\n super(t2, e2), this.isSkinnedMesh = true, this.type = \"SkinnedMesh\", this.bindMode = at, this.bindMatrix = new Qi(), this.bindMatrixInverse = new Qi(), this.boundingBox = null, this.boundingSphere = null;\n }\n computeBoundingBox() {\n const t2 = this.geometry;\n null === this.boundingBox && (this.boundingBox = new Qr()), this.boundingBox.makeEmpty();\n const e2 = t2.getAttribute(\"position\");\n for (let t3 = 0; t3 < e2.count; t3++)\n this.getVertexPosition(t3, Ua), this.boundingBox.expandByPoint(Ua);\n }\n computeBoundingSphere() {\n const t2 = this.geometry;\n null === this.boundingSphere && (this.boundingSphere = new En()), this.boundingSphere.makeEmpty();\n const e2 = t2.getAttribute(\"position\");\n for (let t3 = 0; t3 < e2.count; t3++)\n this.getVertexPosition(t3, Ua), this.boundingSphere.expandByPoint(Ua);\n }\n copy(t2, e2) {\n return super.copy(t2, e2), this.bindMode = t2.bindMode, this.bindMatrix.copy(t2.bindMatrix), this.bindMatrixInverse.copy(t2.bindMatrixInverse), this.skeleton = t2.skeleton, null !== t2.boundingBox && (this.boundingBox = t2.boundingBox.clone()), null !== t2.boundingSphere && (this.boundingSphere = t2.boundingSphere.clone()), this;\n }\n raycast(t2, e2) {\n const s2 = this.material, i2 = this.matrixWorld;\n void 0 !== s2 && (null === this.boundingSphere && this.computeBoundingSphere(), ja.copy(this.boundingSphere), ja.applyMatrix4(i2), false !== t2.ray.intersectsSphere(ja) && (Wa.copy(i2).invert(), Ja.copy(t2.ray).applyMatrix4(Wa), null !== this.boundingBox && false === Ja.intersectsBox(this.boundingBox) || this._computeIntersections(t2, e2, Ja)));\n }\n getVertexPosition(t2, e2) {\n return super.getVertexPosition(t2, e2), this.applyBoneTransform(t2, e2), e2;\n }\n bind(t2, e2) {\n this.skeleton = t2, void 0 === e2 && (this.updateMatrixWorld(true), this.skeleton.calculateInverses(), e2 = this.matrixWorld), this.bindMatrix.copy(e2), this.bindMatrixInverse.copy(e2).invert();\n }\n pose() {\n this.skeleton.pose();\n }\n normalizeSkinWeights() {\n const t2 = new qi(), e2 = this.geometry.attributes.skinWeight;\n for (let s2 = 0, i2 = e2.count; s2 < i2; s2++) {\n t2.fromBufferAttribute(e2, s2);\n const i3 = 1 / t2.manhattanLength();\n i3 !== 1 / 0 ? t2.multiplyScalar(i3) : t2.set(1, 0, 0, 0), e2.setXYZW(s2, t2.x, t2.y, t2.z, t2.w);\n }\n }\n updateMatrixWorld(t2) {\n super.updateMatrixWorld(t2), this.bindMode === at ? this.bindMatrixInverse.copy(this.matrixWorld).invert() : this.bindMode === ot ? this.bindMatrixInverse.copy(this.bindMatrix).invert() : ai(\"SkinnedMesh: Unrecognized bindMode: \" + this.bindMode);\n }\n applyBoneTransform(t2, e2) {\n const s2 = this.skeleton, i2 = this.geometry;\n Va.fromBufferAttribute(i2.attributes.skinIndex, t2), La.fromBufferAttribute(i2.attributes.skinWeight, t2), e2.isVector4 ? (Na.copy(e2), e2.set(0, 0, 0, 0)) : (Na.set(...e2, 1), e2.set(0, 0, 0)), Na.applyMatrix4(this.bindMatrix);\n for (let t3 = 0; t3 < 4; t3++) {\n const i3 = La.getComponent(t3);\n if (0 !== i3) {\n const r2 = Va.getComponent(t3);\n Da.multiplyMatrices(s2.bones[r2].matrixWorld, s2.boneInverses[r2]), e2.addScaledVector(Fa.copy(Na).applyMatrix4(Da), i3);\n }\n }\n return e2.isVector4 && (e2.w = Na.w), e2.applyMatrix4(this.bindMatrixInverse);\n }\n };\n var Ha = class extends Ar {\n constructor() {\n super(), this.isBone = true, this.type = \"Bone\";\n }\n };\n var Xa = class extends Ji {\n constructor(t2 = null, e2 = 1, s2 = 1, i2, r2, n2, a2, o2, h2 = 1003, l2 = 1003, c2, u2) {\n super(null, n2, a2, o2, h2, l2, i2, r2, c2, u2), this.isDataTexture = true, this.image = { data: t2, width: e2, height: s2 }, this.generateMipmaps = false, this.flipY = false, this.unpackAlignment = 1;\n }\n };\n var Ya = new Qi();\n var Za = new Qi();\n var Ga = class _Ga {\n constructor(t2 = [], e2 = []) {\n this.uuid = fi(), this.bones = t2.slice(0), this.boneInverses = e2, this.boneMatrices = null, this.boneTexture = null, this.init();\n }\n init() {\n const t2 = this.bones, e2 = this.boneInverses;\n if (this.boneMatrices = new Float32Array(16 * t2.length), 0 === e2.length)\n this.calculateInverses();\n else if (t2.length !== e2.length) {\n ai(\"Skeleton: Number of inverse bone matrices does not match amount of bones.\"), this.boneInverses = [];\n for (let t3 = 0, e3 = this.bones.length; t3 < e3; t3++) this.boneInverses.push(new Qi());\n }\n }\n calculateInverses() {\n this.boneInverses.length = 0;\n for (let t2 = 0, e2 = this.bones.length; t2 < e2; t2++) {\n const e3 = new Qi();\n this.bones[t2] && e3.copy(this.bones[t2].matrixWorld).invert(), this.boneInverses.push(e3);\n }\n }\n pose() {\n for (let t2 = 0, e2 = this.bones.length; t2 < e2; t2++) {\n const e3 = this.bones[t2];\n e3 && e3.matrixWorld.copy(this.boneInverses[t2]).invert();\n }\n for (let t2 = 0, e2 = this.bones.length; t2 < e2; t2++) {\n const e3 = this.bones[t2];\n e3 && (e3.parent && e3.parent.isBone ? (e3.matrix.copy(e3.parent.matrixWorld).invert(), e3.matrix.multiply(e3.matrixWorld)) : e3.matrix.copy(e3.matrixWorld), e3.matrix.decompose(e3.position, e3.quaternion, e3.scale));\n }\n }\n update() {\n const t2 = this.bones, e2 = this.boneInverses, s2 = this.boneMatrices, i2 = this.boneTexture;\n for (let i3 = 0, r2 = t2.length; i3 < r2; i3++) {\n const r3 = t2[i3] ? t2[i3].matrixWorld : Za;\n Ya.multiplyMatrices(r3, e2[i3]), Ya.toArray(s2, 16 * i3);\n }\n null !== i2 && (i2.needsUpdate = true);\n }\n clone() {\n return new _Ga(this.bones, this.boneInverses);\n }\n computeBoneTexture() {\n let t2 = Math.sqrt(4 * this.bones.length);\n t2 = 4 * Math.ceil(t2 / 4), t2 = Math.max(t2, 4);\n const e2 = new Float32Array(t2 * t2 * 4);\n e2.set(this.boneMatrices);\n const s2 = new Xa(e2, t2, t2, jt, Pt);\n return s2.needsUpdate = true, this.boneMatrices = e2, this.boneTexture = s2, this;\n }\n getBoneByName(t2) {\n for (let e2 = 0, s2 = this.bones.length; e2 < s2; e2++) {\n const s3 = this.bones[e2];\n if (s3.name === t2) return s3;\n }\n }\n dispose() {\n null !== this.boneTexture && (this.boneTexture.dispose(), this.boneTexture = null);\n }\n fromJSON(t2, e2) {\n this.uuid = t2.uuid;\n for (let s2 = 0, i2 = t2.bones.length; s2 < i2; s2++) {\n const i3 = t2.bones[s2];\n let r2 = e2[i3];\n void 0 === r2 && (ai(\"Skeleton: No bone found with UUID:\", i3), r2 = new Ha()), this.bones.push(r2), this.boneInverses.push(new Qi().fromArray(t2.boneInverses[s2]));\n }\n return this.init(), this;\n }\n toJSON() {\n const t2 = {\n metadata: { version: 4.7, type: \"Skeleton\", generator: \"Skeleton.toJSON\" },\n bones: [],\n boneInverses: []\n };\n t2.uuid = this.uuid;\n const e2 = this.bones, s2 = this.boneInverses;\n for (let i2 = 0, r2 = e2.length; i2 < r2; i2++) {\n const r3 = e2[i2];\n t2.bones.push(r3.uuid);\n const n2 = s2[i2];\n t2.boneInverses.push(n2.toArray());\n }\n return t2;\n }\n };\n var $a = class extends Mn {\n constructor(t2, e2, s2, i2 = 1) {\n super(t2, e2, s2), this.isInstancedBufferAttribute = true, this.meshPerAttribute = i2;\n }\n copy(t2) {\n return super.copy(t2), this.meshPerAttribute = t2.meshPerAttribute, this;\n }\n toJSON() {\n const t2 = super.toJSON();\n return t2.meshPerAttribute = this.meshPerAttribute, t2.isInstancedBufferAttribute = true, t2;\n }\n };\n var Qa = new Qi();\n var Ka = new Qi();\n var to = [];\n var eo = new Qr();\n var so = new Qi();\n var io = new Ra();\n var ro = new En();\n var no = class extends Ra {\n constructor(t2, e2, s2) {\n super(t2, e2), this.isInstancedMesh = true, this.instanceMatrix = new $a(new Float32Array(16 * s2), 16), this.instanceColor = null, this.morphTexture = null, this.count = s2, this.boundingBox = null, this.boundingSphere = null;\n for (let t3 = 0; t3 < s2; t3++) this.setMatrixAt(t3, so);\n }\n computeBoundingBox() {\n const t2 = this.geometry, e2 = this.count;\n null === this.boundingBox && (this.boundingBox = new Qr()), null === t2.boundingBox && t2.computeBoundingBox(), this.boundingBox.makeEmpty();\n for (let s2 = 0; s2 < e2; s2++)\n this.getMatrixAt(s2, Qa), eo.copy(t2.boundingBox).applyMatrix4(Qa), this.boundingBox.union(eo);\n }\n computeBoundingSphere() {\n const t2 = this.geometry, e2 = this.count;\n null === this.boundingSphere && (this.boundingSphere = new En()), null === t2.boundingSphere && t2.computeBoundingSphere(), this.boundingSphere.makeEmpty();\n for (let s2 = 0; s2 < e2; s2++)\n this.getMatrixAt(s2, Qa), ro.copy(t2.boundingSphere).applyMatrix4(Qa), this.boundingSphere.union(ro);\n }\n copy(t2, e2) {\n return super.copy(t2, e2), this.instanceMatrix.copy(t2.instanceMatrix), null !== t2.morphTexture && (this.morphTexture = t2.morphTexture.clone()), null !== t2.instanceColor && (this.instanceColor = t2.instanceColor.clone()), this.count = t2.count, null !== t2.boundingBox && (this.boundingBox = t2.boundingBox.clone()), null !== t2.boundingSphere && (this.boundingSphere = t2.boundingSphere.clone()), this;\n }\n getColorAt(t2, e2) {\n return null === this.instanceColor ? e2.setRGB(1, 1, 1) : e2.fromArray(this.instanceColor.array, 3 * t2);\n }\n getMatrixAt(t2, e2) {\n return e2.fromArray(this.instanceMatrix.array, 16 * t2);\n }\n getMorphAt(t2, e2) {\n const s2 = e2.morphTargetInfluences, i2 = this.morphTexture.source.data.data, r2 = t2 * (s2.length + 1) + 1;\n for (let t3 = 0; t3 < s2.length; t3++) s2[t3] = i2[r2 + t3];\n }\n raycast(t2, e2) {\n const s2 = this.matrixWorld, i2 = this.count;\n if (io.geometry = this.geometry, io.material = this.material, void 0 !== io.material && (null === this.boundingSphere && this.computeBoundingSphere(), ro.copy(this.boundingSphere), ro.applyMatrix4(s2), false !== t2.ray.intersectsSphere(ro)))\n for (let r2 = 0; r2 < i2; r2++) {\n this.getMatrixAt(r2, Qa), Ka.multiplyMatrices(s2, Qa), io.matrixWorld = Ka, io.raycast(t2, to);\n for (let t3 = 0, s3 = to.length; t3 < s3; t3++) {\n const s4 = to[t3];\n s4.instanceId = r2, s4.object = this, e2.push(s4);\n }\n to.length = 0;\n }\n }\n setColorAt(t2, e2) {\n return null === this.instanceColor && (this.instanceColor = new $a(new Float32Array(3 * this.instanceMatrix.count).fill(1), 3)), e2.toArray(this.instanceColor.array, 3 * t2), this;\n }\n setMatrixAt(t2, e2) {\n return e2.toArray(this.instanceMatrix.array, 16 * t2), this;\n }\n setMorphAt(t2, e2) {\n const s2 = e2.morphTargetInfluences, i2 = s2.length + 1;\n null === this.morphTexture && (this.morphTexture = new Xa(new Float32Array(i2 * this.count), i2, this.count, qt, Pt));\n const r2 = this.morphTexture.source.data.data;\n let n2 = 0;\n for (let t3 = 0; t3 < s2.length; t3++) n2 += s2[t3];\n const a2 = this.geometry.morphTargetsRelative ? 1 : 1 - n2, o2 = i2 * t2;\n return r2[o2] = a2, r2.set(s2, o2 + 1), this;\n }\n updateMorphTargets() {\n }\n dispose() {\n this.dispatchEvent({ type: \"dispose\" }), null !== this.morphTexture && (this.morphTexture.dispose(), this.morphTexture = null);\n }\n };\n var ao = new Ti();\n var oo = new Ti();\n var ho = new Ii();\n var lo = class {\n constructor(t2 = new Ti(1, 0, 0), e2 = 0) {\n this.isPlane = true, this.normal = t2, this.constant = e2;\n }\n set(t2, e2) {\n return this.normal.copy(t2), this.constant = e2, this;\n }\n setComponents(t2, e2, s2, i2) {\n return this.normal.set(t2, e2, s2), this.constant = i2, this;\n }\n setFromNormalAndCoplanarPoint(t2, e2) {\n return this.normal.copy(t2), this.constant = -e2.dot(this.normal), this;\n }\n setFromCoplanarPoints(t2, e2, s2) {\n const i2 = ao.subVectors(s2, e2).cross(oo.subVectors(t2, e2)).normalize();\n return this.setFromNormalAndCoplanarPoint(i2, t2), this;\n }\n copy(t2) {\n return this.normal.copy(t2.normal), this.constant = t2.constant, this;\n }\n normalize() {\n const t2 = 1 / this.normal.length();\n return this.normal.multiplyScalar(t2), this.constant *= t2, this;\n }\n negate() {\n return this.constant *= -1, this.normal.negate(), this;\n }\n distanceToPoint(t2) {\n return this.normal.dot(t2) + this.constant;\n }\n distanceToSphere(t2) {\n return this.distanceToPoint(t2.center) - t2.radius;\n }\n projectPoint(t2, e2) {\n return e2.copy(t2).addScaledVector(this.normal, -this.distanceToPoint(t2));\n }\n intersectLine(t2, e2, s2 = true) {\n const i2 = t2.delta(ao), r2 = this.normal.dot(i2);\n if (0 === r2) return 0 === this.distanceToPoint(t2.start) ? e2.copy(t2.start) : null;\n const n2 = -(t2.start.dot(this.normal) + this.constant) / r2;\n return true === s2 && (n2 < 0 || n2 > 1) ? null : e2.copy(t2.start).addScaledVector(i2, n2);\n }\n intersectsLine(t2) {\n const e2 = this.distanceToPoint(t2.start), s2 = this.distanceToPoint(t2.end);\n return e2 < 0 && s2 > 0 || s2 < 0 && e2 > 0;\n }\n intersectsBox(t2) {\n return t2.intersectsPlane(this);\n }\n intersectsSphere(t2) {\n return t2.intersectsPlane(this);\n }\n coplanarPoint(t2) {\n return t2.copy(this.normal).multiplyScalar(-this.constant);\n }\n applyMatrix4(t2, e2) {\n const s2 = e2 || ho.getNormalMatrix(t2), i2 = this.coplanarPoint(ao).applyMatrix4(t2), r2 = this.normal.applyMatrix3(s2).normalize();\n return this.constant = -i2.dot(r2), this;\n }\n translate(t2) {\n return this.constant -= t2.dot(this.normal), this;\n }\n equals(t2) {\n return t2.normal.equals(this.normal) && t2.constant === this.constant;\n }\n clone() {\n return new this.constructor().copy(this);\n }\n };\n var co = new En();\n var uo = new _i(0.5, 0.5);\n var po = new Ti();\n var mo = class {\n constructor(t2 = new lo(), e2 = new lo(), s2 = new lo(), i2 = new lo(), r2 = new lo(), n2 = new lo()) {\n this.planes = [t2, e2, s2, i2, r2, n2];\n }\n set(t2, e2, s2, i2, r2, n2) {\n const a2 = this.planes;\n return a2[0].copy(t2), a2[1].copy(e2), a2[2].copy(s2), a2[3].copy(i2), a2[4].copy(r2), a2[5].copy(n2), this;\n }\n copy(t2) {\n const e2 = this.planes;\n for (let s2 = 0; s2 < 6; s2++) e2[s2].copy(t2.planes[s2]);\n return this;\n }\n setFromProjectionMatrix(t2, e2 = 2e3, s2 = false) {\n const i2 = this.planes, r2 = t2.elements, n2 = r2[0], a2 = r2[1], o2 = r2[2], h2 = r2[3], l2 = r2[4], c2 = r2[5], u2 = r2[6], d2 = r2[7], p2 = r2[8], m2 = r2[9], y2 = r2[10], g2 = r2[11], f2 = r2[12], x2 = r2[13], b2 = r2[14], v2 = r2[15];\n if (i2[0].setComponents(h2 - n2, d2 - l2, g2 - p2, v2 - f2).normalize(), i2[1].setComponents(h2 + n2, d2 + l2, g2 + p2, v2 + f2).normalize(), i2[2].setComponents(h2 + a2, d2 + c2, g2 + m2, v2 + x2).normalize(), i2[3].setComponents(h2 - a2, d2 - c2, g2 - m2, v2 - x2).normalize(), s2)\n i2[4].setComponents(o2, u2, y2, b2).normalize(), i2[5].setComponents(h2 - o2, d2 - u2, g2 - y2, v2 - b2).normalize();\n else if (i2[4].setComponents(h2 - o2, d2 - u2, g2 - y2, v2 - b2).normalize(), e2 === Ws)\n i2[5].setComponents(h2 + o2, d2 + u2, g2 + y2, v2 + b2).normalize();\n else {\n if (e2 !== Js)\n throw new Error(\"THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: \" + e2);\n i2[5].setComponents(o2, u2, y2, b2).normalize();\n }\n return this;\n }\n intersectsObject(t2) {\n if (void 0 !== t2.boundingSphere)\n null === t2.boundingSphere && t2.computeBoundingSphere(), co.copy(t2.boundingSphere).applyMatrix4(t2.matrixWorld);\n else {\n const e2 = t2.geometry;\n null === e2.boundingSphere && e2.computeBoundingSphere(), co.copy(e2.boundingSphere).applyMatrix4(t2.matrixWorld);\n }\n return this.intersectsSphere(co);\n }\n intersectsSprite(t2) {\n co.center.set(0, 0, 0);\n const e2 = uo.distanceTo(t2.center);\n return co.radius = 0.7071067811865476 + e2, co.applyMatrix4(t2.matrixWorld), this.intersectsSphere(co);\n }\n intersectsSphere(t2) {\n const e2 = this.planes, s2 = t2.center, i2 = -t2.radius;\n for (let t3 = 0; t3 < 6; t3++) {\n if (e2[t3].distanceToPoint(s2) < i2) return false;\n }\n return true;\n }\n intersectsBox(t2) {\n const e2 = this.planes;\n for (let s2 = 0; s2 < 6; s2++) {\n const i2 = e2[s2];\n if (po.x = i2.normal.x > 0 ? t2.max.x : t2.min.x, po.y = i2.normal.y > 0 ? t2.max.y : t2.min.y, po.z = i2.normal.z > 0 ? t2.max.z : t2.min.z, i2.distanceToPoint(po) < 0)\n return false;\n }\n return true;\n }\n containsPoint(t2) {\n const e2 = this.planes;\n for (let s2 = 0; s2 < 6; s2++) if (e2[s2].distanceToPoint(t2) < 0) return false;\n return true;\n }\n clone() {\n return new this.constructor().copy(this);\n }\n };\n var yo = new Qi();\n var go = class _go {\n constructor() {\n this.coordinateSystem = Ws, this._frustums = [], this._count = 0;\n }\n setFromArrayCamera(t2) {\n const e2 = t2.cameras, s2 = this._frustums;\n for (let t3 = 0; t3 < e2.length; t3++) {\n const i2 = e2[t3];\n yo.multiplyMatrices(i2.projectionMatrix, i2.matrixWorldInverse), void 0 === s2[t3] && (s2[t3] = new mo()), s2[t3].setFromProjectionMatrix(yo, i2.coordinateSystem, i2.reversedDepth);\n }\n return this._count = e2.length, this;\n }\n intersectsObject(t2) {\n const e2 = this._frustums;\n for (let s2 = 0; s2 < this._count; s2++) if (e2[s2].intersectsObject(t2)) return true;\n return false;\n }\n intersectsSprite(t2) {\n const e2 = this._frustums;\n for (let s2 = 0; s2 < this._count; s2++) if (e2[s2].intersectsSprite(t2)) return true;\n return false;\n }\n intersectsSphere(t2) {\n const e2 = this._frustums;\n for (let s2 = 0; s2 < this._count; s2++) if (e2[s2].intersectsSphere(t2)) return true;\n return false;\n }\n intersectsBox(t2) {\n const e2 = this._frustums;\n for (let s2 = 0; s2 < this._count; s2++) if (e2[s2].intersectsBox(t2)) return true;\n return false;\n }\n containsPoint(t2) {\n const e2 = this._frustums;\n for (let s2 = 0; s2 < this._count; s2++) if (e2[s2].containsPoint(t2)) return true;\n return false;\n }\n copy(t2) {\n this.coordinateSystem = t2.coordinateSystem;\n const e2 = this._frustums, s2 = t2._frustums;\n for (let i2 = 0; i2 < t2._count; i2++) void 0 === e2[i2] && (e2[i2] = new mo()), e2[i2].copy(s2[i2]);\n return this._count = t2._count, this;\n }\n clone() {\n return new _go().copy(this);\n }\n };\n function fo(t2, e2) {\n return t2 - e2;\n }\n function xo(t2, e2) {\n return t2.z - e2.z;\n }\n function bo(t2, e2) {\n return e2.z - t2.z;\n }\n var vo = class {\n constructor() {\n this.index = 0, this.pool = [], this.list = [];\n }\n push(t2, e2, s2, i2) {\n const r2 = this.pool, n2 = this.list;\n this.index >= r2.length && r2.push({ start: -1, count: -1, z: -1, index: -1 });\n const a2 = r2[this.index];\n n2.push(a2), this.index++, a2.start = t2, a2.count = e2, a2.z = s2, a2.index = i2;\n }\n reset() {\n this.list.length = 0, this.index = 0;\n }\n };\n var wo = new Qi();\n var Mo = new Pr(1, 1, 1);\n var So = new mo();\n var _o = new go();\n var Ao = new Qr();\n var To = new En();\n var zo = new Ti();\n var Co = new Ti();\n var Io = new Ti();\n var Bo = new vo();\n var ko = new Ra();\n var Oo = [];\n function Po(t2, e2, s2 = 0) {\n const i2 = e2.itemSize;\n if (t2.isInterleavedBufferAttribute || t2.array.constructor !== e2.array.constructor) {\n const r2 = t2.count;\n for (let n2 = 0; n2 < r2; n2++)\n for (let r3 = 0; r3 < i2; r3++) e2.setComponent(n2 + s2, r3, t2.getComponent(n2, r3));\n } else e2.array.set(t2.array, s2 * i2);\n e2.needsUpdate = true;\n }\n function Ro(t2, e2) {\n if (t2.constructor !== e2.constructor) {\n const s2 = Math.min(t2.length, e2.length);\n for (let i2 = 0; i2 < s2; i2++) e2[i2] = t2[i2];\n } else {\n const s2 = Math.min(t2.length, e2.length);\n e2.set(new t2.constructor(t2.buffer, 0, s2));\n }\n }\n var Eo = class extends Ra {\n constructor(t2, e2, s2 = 2 * e2, i2) {\n super(new Wn(), i2), this.isBatchedMesh = true, this.perObjectFrustumCulled = true, this.sortObjects = true, this.boundingBox = null, this.boundingSphere = null, this.customSort = null, this._instanceInfo = [], this._geometryInfo = [], this._availableInstanceIds = [], this._availableGeometryIds = [], this._nextIndexStart = 0, this._nextVertexStart = 0, this._geometryCount = 0, this._visibilityChanged = true, this._geometryInitialized = false, this._maxInstanceCount = t2, this._maxVertexCount = e2, this._maxIndexCount = s2, this._multiDrawCounts = new Int32Array(t2), this._multiDrawStarts = new Int32Array(t2), this._multiDrawCount = 0, this._matricesTexture = null, this._indirectTexture = null, this._colorsTexture = null, this._initMatricesTexture(), this._initIndirectTexture();\n }\n get maxInstanceCount() {\n return this._maxInstanceCount;\n }\n get instanceCount() {\n return this._instanceInfo.length - this._availableInstanceIds.length;\n }\n get unusedVertexCount() {\n return this._maxVertexCount - this._nextVertexStart;\n }\n get unusedIndexCount() {\n return this._maxIndexCount - this._nextIndexStart;\n }\n _initMatricesTexture() {\n let t2 = Math.sqrt(4 * this._maxInstanceCount);\n t2 = 4 * Math.ceil(t2 / 4), t2 = Math.max(t2, 4);\n const e2 = new Float32Array(t2 * t2 * 4), s2 = new Xa(e2, t2, t2, jt, Pt);\n this._matricesTexture = s2;\n }\n _initIndirectTexture() {\n let t2 = Math.sqrt(this._maxInstanceCount);\n t2 = Math.ceil(t2);\n const e2 = new Uint32Array(t2 * t2), s2 = new Xa(e2, t2, t2, Ht, Ot);\n this._indirectTexture = s2;\n }\n _initColorsTexture() {\n let t2 = Math.sqrt(this._maxInstanceCount);\n t2 = Math.ceil(t2);\n const e2 = new Float32Array(t2 * t2 * 4).fill(1), s2 = new Xa(e2, t2, t2, jt, Pt);\n s2.colorSpace = Ri.workingColorSpace, this._colorsTexture = s2;\n }\n _initializeGeometry(t2) {\n const e2 = this.geometry, s2 = this._maxVertexCount, i2 = this._maxIndexCount;\n if (false === this._geometryInitialized) {\n for (const i3 in t2.attributes) {\n const r2 = t2.getAttribute(i3), { array: n2, itemSize: a2, normalized: o2 } = r2, h2 = new n2.constructor(s2 * a2), l2 = new Mn(h2, a2, o2);\n e2.setAttribute(i3, l2);\n }\n if (null !== t2.getIndex()) {\n const t3 = s2 > 65535 ? new Uint32Array(i2) : new Uint16Array(i2);\n e2.setIndex(new Mn(t3, 1));\n }\n this._geometryInitialized = true;\n }\n }\n _validateGeometry(t2) {\n const e2 = this.geometry;\n if (Boolean(t2.getIndex()) !== Boolean(e2.getIndex()))\n throw new Error('THREE.BatchedMesh: All geometries must consistently have \"index\".');\n for (const s2 in e2.attributes) {\n if (!t2.hasAttribute(s2))\n throw new Error(\n `THREE.BatchedMesh: Added geometry missing \"${s2}\". All geometries must have consistent attributes.`\n );\n const i2 = t2.getAttribute(s2), r2 = e2.getAttribute(s2);\n if (i2.itemSize !== r2.itemSize || i2.normalized !== r2.normalized)\n throw new Error(\n \"THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.\"\n );\n }\n }\n validateInstanceId(t2) {\n const e2 = this._instanceInfo;\n if (t2 < 0 || t2 >= e2.length || false === e2[t2].active)\n throw new Error(\n `THREE.BatchedMesh: Invalid instanceId ${t2}. Instance is either out of range or has been deleted.`\n );\n }\n validateGeometryId(t2) {\n const e2 = this._geometryInfo;\n if (t2 < 0 || t2 >= e2.length || false === e2[t2].active)\n throw new Error(\n `THREE.BatchedMesh: Invalid geometryId ${t2}. Geometry is either out of range or has been deleted.`\n );\n }\n setCustomSort(t2) {\n return this.customSort = t2, this;\n }\n computeBoundingBox() {\n null === this.boundingBox && (this.boundingBox = new Qr());\n const t2 = this.boundingBox, e2 = this._instanceInfo;\n t2.makeEmpty();\n for (let s2 = 0, i2 = e2.length; s2 < i2; s2++) {\n if (false === e2[s2].active) continue;\n const i3 = e2[s2].geometryIndex;\n this.getMatrixAt(s2, wo), this.getBoundingBoxAt(i3, Ao).applyMatrix4(wo), t2.union(Ao);\n }\n }\n computeBoundingSphere() {\n null === this.boundingSphere && (this.boundingSphere = new En());\n const t2 = this.boundingSphere, e2 = this._instanceInfo;\n t2.makeEmpty();\n for (let s2 = 0, i2 = e2.length; s2 < i2; s2++) {\n if (false === e2[s2].active) continue;\n const i3 = e2[s2].geometryIndex;\n this.getMatrixAt(s2, wo), this.getBoundingSphereAt(i3, To).applyMatrix4(wo), t2.union(To);\n }\n }\n addInstance(t2) {\n if (this._instanceInfo.length >= this.maxInstanceCount && 0 === this._availableInstanceIds.length)\n throw new Error(\"THREE.BatchedMesh: Maximum item count reached.\");\n const e2 = { visible: true, active: true, geometryIndex: t2 };\n let s2 = null;\n this._availableInstanceIds.length > 0 ? (this._availableInstanceIds.sort(fo), s2 = this._availableInstanceIds.shift(), this._instanceInfo[s2] = e2) : (s2 = this._instanceInfo.length, this._instanceInfo.push(e2));\n const i2 = this._matricesTexture;\n wo.identity().toArray(i2.image.data, 16 * s2), i2.needsUpdate = true;\n const r2 = this._colorsTexture;\n return r2 && (Mo.toArray(r2.image.data, 4 * s2), r2.needsUpdate = true), this._visibilityChanged = true, s2;\n }\n addGeometry(t2, e2 = -1, s2 = -1) {\n this._initializeGeometry(t2), this._validateGeometry(t2);\n const i2 = {\n vertexStart: -1,\n vertexCount: -1,\n reservedVertexCount: -1,\n indexStart: -1,\n indexCount: -1,\n reservedIndexCount: -1,\n start: -1,\n count: -1,\n boundingBox: null,\n boundingSphere: null,\n active: true\n }, r2 = this._geometryInfo;\n i2.vertexStart = this._nextVertexStart, i2.reservedVertexCount = -1 === e2 ? t2.getAttribute(\"position\").count : e2;\n const n2 = t2.getIndex();\n if (null !== n2 && (i2.indexStart = this._nextIndexStart, i2.reservedIndexCount = -1 === s2 ? n2.count : s2), -1 !== i2.indexStart && i2.indexStart + i2.reservedIndexCount > this._maxIndexCount || i2.vertexStart + i2.reservedVertexCount > this._maxVertexCount)\n throw new Error(\"THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.\");\n let a2;\n return this._availableGeometryIds.length > 0 ? (this._availableGeometryIds.sort(fo), a2 = this._availableGeometryIds.shift(), r2[a2] = i2) : (a2 = this._geometryCount, this._geometryCount++, r2.push(i2)), this.setGeometryAt(a2, t2), this._nextIndexStart = i2.indexStart + i2.reservedIndexCount, this._nextVertexStart = i2.vertexStart + i2.reservedVertexCount, a2;\n }\n setGeometryAt(t2, e2) {\n if (t2 >= this._geometryCount)\n throw new Error(\"THREE.BatchedMesh: Maximum geometry count reached.\");\n this._validateGeometry(e2);\n const s2 = this.geometry, i2 = null !== s2.getIndex(), r2 = s2.getIndex(), n2 = e2.getIndex(), a2 = this._geometryInfo[t2];\n if (i2 && n2.count > a2.reservedIndexCount || e2.attributes.position.count > a2.reservedVertexCount)\n throw new Error(\"THREE.BatchedMesh: Reserved space not large enough for provided geometry.\");\n const o2 = a2.vertexStart, h2 = a2.reservedVertexCount;\n a2.vertexCount = e2.getAttribute(\"position\").count;\n for (const t3 in s2.attributes) {\n const i3 = e2.getAttribute(t3), r3 = s2.getAttribute(t3);\n Po(i3, r3, o2);\n const n3 = i3.itemSize;\n for (let t4 = i3.count, e3 = h2; t4 < e3; t4++) {\n const e4 = o2 + t4;\n for (let t5 = 0; t5 < n3; t5++) r3.setComponent(e4, t5, 0);\n }\n r3.needsUpdate = true, r3.addUpdateRange(o2 * n3, h2 * n3);\n }\n if (i2) {\n const t3 = a2.indexStart, s3 = a2.reservedIndexCount;\n a2.indexCount = e2.getIndex().count;\n for (let e3 = 0; e3 < n2.count; e3++) r2.setX(t3 + e3, o2 + n2.getX(e3));\n for (let e3 = n2.count, i3 = s3; e3 < i3; e3++) r2.setX(t3 + e3, o2);\n r2.needsUpdate = true, r2.addUpdateRange(t3, a2.reservedIndexCount);\n }\n return a2.start = i2 ? a2.indexStart : a2.vertexStart, a2.count = i2 ? a2.indexCount : a2.vertexCount, a2.boundingBox = null, null !== e2.boundingBox && (a2.boundingBox = e2.boundingBox.clone()), a2.boundingSphere = null, null !== e2.boundingSphere && (a2.boundingSphere = e2.boundingSphere.clone()), this._visibilityChanged = true, t2;\n }\n deleteGeometry(t2) {\n const e2 = this._geometryInfo;\n if (t2 >= e2.length || false === e2[t2].active) return this;\n const s2 = this._instanceInfo;\n for (let e3 = 0, i2 = s2.length; e3 < i2; e3++)\n s2[e3].active && s2[e3].geometryIndex === t2 && this.deleteInstance(e3);\n return e2[t2].active = false, this._availableGeometryIds.push(t2), this._visibilityChanged = true, this;\n }\n deleteInstance(t2) {\n return this.validateInstanceId(t2), this._instanceInfo[t2].active = false, this._availableInstanceIds.push(t2), this._visibilityChanged = true, this;\n }\n optimize() {\n let t2 = 0, e2 = 0;\n const s2 = this._geometryInfo, i2 = s2.map((t3, e3) => e3).sort((t3, e3) => s2[t3].vertexStart - s2[e3].vertexStart), r2 = this.geometry;\n for (let n2 = 0, a2 = s2.length; n2 < a2; n2++) {\n const a3 = i2[n2], o2 = s2[a3];\n if (false !== o2.active) {\n if (null !== r2.index) {\n if (o2.indexStart !== e2) {\n const { indexStart: s3, vertexStart: i3, reservedIndexCount: n3 } = o2, a4 = r2.index, h2 = a4.array, l2 = t2 - i3;\n for (let t3 = s3; t3 < s3 + n3; t3++) h2[t3] = h2[t3] + l2;\n a4.array.copyWithin(e2, s3, s3 + n3), a4.addUpdateRange(e2, n3), a4.needsUpdate = true, o2.indexStart = e2;\n }\n e2 += o2.reservedIndexCount;\n }\n if (o2.vertexStart !== t2) {\n const { vertexStart: e3, reservedVertexCount: s3 } = o2, i3 = r2.attributes;\n for (const r3 in i3) {\n const n3 = i3[r3], { array: a4, itemSize: o3 } = n3;\n a4.copyWithin(t2 * o3, e3 * o3, (e3 + s3) * o3), n3.addUpdateRange(t2 * o3, s3 * o3), n3.needsUpdate = true;\n }\n o2.vertexStart = t2;\n }\n t2 += o2.reservedVertexCount, o2.start = r2.index ? o2.indexStart : o2.vertexStart;\n }\n }\n return this._nextIndexStart = e2, this._nextVertexStart = t2, this._visibilityChanged = true, this;\n }\n getBoundingBoxAt(t2, e2) {\n if (t2 >= this._geometryCount) return null;\n const s2 = this.geometry, i2 = this._geometryInfo[t2];\n if (null === i2.boundingBox) {\n const t3 = new Qr(), e3 = s2.index, r2 = s2.attributes.position;\n for (let s3 = i2.start, n2 = i2.start + i2.count; s3 < n2; s3++) {\n let i3 = s3;\n e3 && (i3 = e3.getX(i3)), t3.expandByPoint(zo.fromBufferAttribute(r2, i3));\n }\n i2.boundingBox = t3;\n }\n return e2.copy(i2.boundingBox), e2;\n }\n getBoundingSphereAt(t2, e2) {\n if (t2 >= this._geometryCount) return null;\n const s2 = this.geometry, i2 = this._geometryInfo[t2];\n if (null === i2.boundingSphere) {\n const e3 = new En();\n this.getBoundingBoxAt(t2, Ao), Ao.getCenter(e3.center);\n const r2 = s2.index, n2 = s2.attributes.position;\n let a2 = 0;\n for (let t3 = i2.start, s3 = i2.start + i2.count; t3 < s3; t3++) {\n let s4 = t3;\n r2 && (s4 = r2.getX(s4)), zo.fromBufferAttribute(n2, s4), a2 = Math.max(a2, e3.center.distanceToSquared(zo));\n }\n e3.radius = Math.sqrt(a2), i2.boundingSphere = e3;\n }\n return e2.copy(i2.boundingSphere), e2;\n }\n setMatrixAt(t2, e2) {\n this.validateInstanceId(t2);\n const s2 = this._matricesTexture, i2 = this._matricesTexture.image.data;\n return e2.toArray(i2, 16 * t2), s2.needsUpdate = true, this;\n }\n getMatrixAt(t2, e2) {\n return this.validateInstanceId(t2), e2.fromArray(this._matricesTexture.image.data, 16 * t2);\n }\n setColorAt(t2, e2) {\n return this.validateInstanceId(t2), null === this._colorsTexture && this._initColorsTexture(), e2.toArray(this._colorsTexture.image.data, 4 * t2), this._colorsTexture.needsUpdate = true, this;\n }\n getColorAt(t2, e2) {\n return this.validateInstanceId(t2), null === this._colorsTexture ? e2.isVector4 ? e2.set(1, 1, 1, 1) : e2.setRGB(1, 1, 1) : e2.fromArray(this._colorsTexture.image.data, 4 * t2);\n }\n setVisibleAt(t2, e2) {\n return this.validateInstanceId(t2), this._instanceInfo[t2].visible === e2 || (this._instanceInfo[t2].visible = e2, this._visibilityChanged = true), this;\n }\n getVisibleAt(t2) {\n return this.validateInstanceId(t2), this._instanceInfo[t2].visible;\n }\n setGeometryIdAt(t2, e2) {\n return this.validateInstanceId(t2), this.validateGeometryId(e2), this._instanceInfo[t2].geometryIndex = e2, this;\n }\n getGeometryIdAt(t2) {\n return this.validateInstanceId(t2), this._instanceInfo[t2].geometryIndex;\n }\n getGeometryRangeAt(t2, e2 = {}) {\n this.validateGeometryId(t2);\n const s2 = this._geometryInfo[t2];\n return e2.vertexStart = s2.vertexStart, e2.vertexCount = s2.vertexCount, e2.reservedVertexCount = s2.reservedVertexCount, e2.indexStart = s2.indexStart, e2.indexCount = s2.indexCount, e2.reservedIndexCount = s2.reservedIndexCount, e2.start = s2.start, e2.count = s2.count, e2;\n }\n setInstanceCount(t2) {\n const e2 = this._availableInstanceIds, s2 = this._instanceInfo;\n for (e2.sort(fo); e2[e2.length - 1] === s2.length - 1; ) s2.pop(), e2.pop();\n if (t2 < s2.length)\n throw new Error(\n `THREE.BatchedMesh: Instance ids outside the range ${t2} are being used. Cannot shrink instance count.`\n );\n const i2 = new Int32Array(t2), r2 = new Int32Array(t2);\n Ro(this._multiDrawCounts, i2), Ro(this._multiDrawStarts, r2), this._multiDrawCounts = i2, this._multiDrawStarts = r2, this._maxInstanceCount = t2;\n const n2 = this._indirectTexture, a2 = this._matricesTexture, o2 = this._colorsTexture;\n n2.dispose(), this._initIndirectTexture(), Ro(n2.image.data, this._indirectTexture.image.data), a2.dispose(), this._initMatricesTexture(), Ro(a2.image.data, this._matricesTexture.image.data), o2 && (o2.dispose(), this._initColorsTexture(), Ro(o2.image.data, this._colorsTexture.image.data));\n }\n setGeometrySize(t2, e2) {\n const s2 = [...this._geometryInfo].filter((t3) => t3.active);\n if (Math.max(...s2.map((t3) => t3.vertexStart + t3.reservedVertexCount)) > t2)\n throw new Error(\n `THREE.BatchedMesh: Geometry vertex values are being used outside the range ${e2}. Cannot shrink further.`\n );\n if (this.geometry.index) {\n if (Math.max(...s2.map((t3) => t3.indexStart + t3.reservedIndexCount)) > e2)\n throw new Error(\n `THREE.BatchedMesh: Geometry index values are being used outside the range ${e2}. Cannot shrink further.`\n );\n }\n const i2 = this.geometry;\n i2.dispose(), this._maxVertexCount = t2, this._maxIndexCount = e2, this._geometryInitialized && (this._geometryInitialized = false, this.geometry = new Wn(), this._initializeGeometry(i2));\n const r2 = this.geometry;\n i2.index && Ro(i2.index.array, r2.index.array);\n for (const t3 in i2.attributes) Ro(i2.attributes[t3].array, r2.attributes[t3].array);\n }\n raycast(t2, e2) {\n const s2 = this._instanceInfo, i2 = this._geometryInfo, r2 = this.matrixWorld, n2 = this.geometry;\n ko.material = this.material, ko.geometry.index = n2.index, ko.geometry.attributes = n2.attributes, null === ko.geometry.boundingBox && (ko.geometry.boundingBox = new Qr()), null === ko.geometry.boundingSphere && (ko.geometry.boundingSphere = new En());\n for (let n3 = 0, a2 = s2.length; n3 < a2; n3++) {\n if (!s2[n3].visible || !s2[n3].active) continue;\n const a3 = s2[n3].geometryIndex, o2 = i2[a3];\n ko.geometry.setDrawRange(o2.start, o2.count), this.getMatrixAt(n3, ko.matrixWorld).premultiply(r2), this.getBoundingBoxAt(a3, ko.geometry.boundingBox), this.getBoundingSphereAt(a3, ko.geometry.boundingSphere), ko.raycast(t2, Oo);\n for (let t3 = 0, s3 = Oo.length; t3 < s3; t3++) {\n const s4 = Oo[t3];\n s4.object = this, s4.batchId = n3, e2.push(s4);\n }\n Oo.length = 0;\n }\n ko.material = null, ko.geometry.index = null, ko.geometry.attributes = {}, ko.geometry.setDrawRange(0, 1 / 0);\n }\n copy(t2) {\n return super.copy(t2), this.geometry = t2.geometry.clone(), this.perObjectFrustumCulled = t2.perObjectFrustumCulled, this.sortObjects = t2.sortObjects, this.boundingBox = null !== t2.boundingBox ? t2.boundingBox.clone() : null, this.boundingSphere = null !== t2.boundingSphere ? t2.boundingSphere.clone() : null, this._geometryInfo = t2._geometryInfo.map((t3) => ({\n ...t3,\n boundingBox: null !== t3.boundingBox ? t3.boundingBox.clone() : null,\n boundingSphere: null !== t3.boundingSphere ? t3.boundingSphere.clone() : null\n })), this._instanceInfo = t2._instanceInfo.map((t3) => ({ ...t3 })), this._availableInstanceIds = t2._availableInstanceIds.slice(), this._availableGeometryIds = t2._availableGeometryIds.slice(), this._nextIndexStart = t2._nextIndexStart, this._nextVertexStart = t2._nextVertexStart, this._geometryCount = t2._geometryCount, this._maxInstanceCount = t2._maxInstanceCount, this._maxVertexCount = t2._maxVertexCount, this._maxIndexCount = t2._maxIndexCount, this._geometryInitialized = t2._geometryInitialized, this._multiDrawCounts = t2._multiDrawCounts.slice(), this._multiDrawStarts = t2._multiDrawStarts.slice(), this._indirectTexture = t2._indirectTexture.clone(), this._indirectTexture.image.data = this._indirectTexture.image.data.slice(), this._matricesTexture = t2._matricesTexture.clone(), this._matricesTexture.image.data = this._matricesTexture.image.data.slice(), null !== this._colorsTexture && (this._colorsTexture = t2._colorsTexture.clone(), this._colorsTexture.image.data = this._colorsTexture.image.data.slice()), this;\n }\n dispose() {\n this.geometry.dispose(), this._matricesTexture.dispose(), this._matricesTexture = null, this._indirectTexture.dispose(), this._indirectTexture = null, null !== this._colorsTexture && (this._colorsTexture.dispose(), this._colorsTexture = null);\n }\n onBeforeRender(t2, e2, s2, i2, r2) {\n if (!this._visibilityChanged && !this.perObjectFrustumCulled && !this.sortObjects) return;\n const n2 = i2.getIndex();\n let a2 = null === n2 ? 1 : n2.array.BYTES_PER_ELEMENT, o2 = 1;\n r2.wireframe && (o2 = 2, a2 = i2.attributes.position.count > 65535 ? 4 : 2);\n const h2 = this._instanceInfo, l2 = this._multiDrawStarts, c2 = this._multiDrawCounts, u2 = this._geometryInfo, d2 = this.perObjectFrustumCulled, p2 = this._indirectTexture, m2 = p2.image.data, y2 = s2.isArrayCamera ? _o : So;\n d2 && (s2.isArrayCamera ? y2.setFromArrayCamera(s2) : (wo.multiplyMatrices(s2.projectionMatrix, s2.matrixWorldInverse).multiply(this.matrixWorld), y2.setFromProjectionMatrix(wo, s2.coordinateSystem, s2.reversedDepth)));\n let g2 = 0;\n if (this.sortObjects) {\n wo.copy(this.matrixWorld).invert(), zo.setFromMatrixPosition(s2.matrixWorld).applyMatrix4(wo), Co.set(0, 0, -1).transformDirection(s2.matrixWorld).transformDirection(wo);\n for (let t4 = 0, e4 = h2.length; t4 < e4; t4++)\n if (h2[t4].visible && h2[t4].active) {\n const e5 = h2[t4].geometryIndex;\n this.getMatrixAt(t4, wo), this.getBoundingSphereAt(e5, To).applyMatrix4(wo);\n let s3 = false;\n if (d2 && (s3 = !y2.intersectsSphere(To)), !s3) {\n const s4 = u2[e5], i3 = Io.subVectors(To.center, zo).dot(Co);\n Bo.push(s4.start, s4.count, i3, t4);\n }\n }\n const t3 = Bo.list, e3 = this.customSort;\n null === e3 ? t3.sort(r2.transparent ? bo : xo) : e3.call(this, t3, s2);\n for (let e4 = 0, s3 = t3.length; e4 < s3; e4++) {\n const s4 = t3[e4];\n l2[g2] = s4.start * a2 * o2, c2[g2] = s4.count * o2, m2[g2] = s4.index, g2++;\n }\n Bo.reset();\n } else\n for (let t3 = 0, e3 = h2.length; t3 < e3; t3++)\n if (h2[t3].visible && h2[t3].active) {\n const e4 = h2[t3].geometryIndex;\n let s3 = false;\n if (d2 && (this.getMatrixAt(t3, wo), this.getBoundingSphereAt(e4, To).applyMatrix4(wo), s3 = !y2.intersectsSphere(To)), !s3) {\n const s4 = u2[e4];\n l2[g2] = s4.start * a2 * o2, c2[g2] = s4.count * o2, m2[g2] = t3, g2++;\n }\n }\n p2.needsUpdate = true, this._multiDrawCount = g2, this._visibilityChanged = false;\n }\n onBeforeShadow(t2, e2, s2, i2, r2, n2) {\n this.onBeforeRender(t2, null, i2, r2, n2);\n }\n };\n var No = class extends Zn {\n constructor(t2) {\n super(), this.isLineBasicMaterial = true, this.type = \"LineBasicMaterial\", this.color = new Pr(16777215), this.map = null, this.linewidth = 1, this.linecap = \"round\", this.linejoin = \"round\", this.fog = true, this.setValues(t2);\n }\n copy(t2) {\n return super.copy(t2), this.color.copy(t2.color), this.map = t2.map, this.linewidth = t2.linewidth, this.linecap = t2.linecap, this.linejoin = t2.linejoin, this.fog = t2.fog, this;\n }\n };\n var Vo = new Ti();\n var Lo = new Ti();\n var Fo = new Qi();\n var Do = new wa();\n var Uo = new En();\n var jo = new Ti();\n var Wo = new Ti();\n var Jo = class extends Ar {\n constructor(t2 = new Wn(), e2 = new No()) {\n super(), this.isLine = true, this.type = \"Line\", this.geometry = t2, this.material = e2, this.morphTargetDictionary = void 0, this.morphTargetInfluences = void 0, this.updateMorphTargets();\n }\n copy(t2, e2) {\n return super.copy(t2, e2), this.material = Array.isArray(t2.material) ? t2.material.slice() : t2.material, this.geometry = t2.geometry, this;\n }\n computeLineDistances() {\n const t2 = this.geometry;\n if (null === t2.index) {\n const e2 = t2.attributes.position, s2 = [0];\n for (let t3 = 1, i2 = e2.count; t3 < i2; t3++)\n Vo.fromBufferAttribute(e2, t3 - 1), Lo.fromBufferAttribute(e2, t3), s2[t3] = s2[t3 - 1], s2[t3] += Vo.distanceTo(Lo);\n t2.setAttribute(\"lineDistance\", new kn(s2, 1));\n } else\n ai(\"Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.\");\n return this;\n }\n raycast(t2, e2) {\n const s2 = this.geometry, i2 = this.matrixWorld, r2 = t2.params.Line.threshold, n2 = s2.drawRange;\n if (null === s2.boundingSphere && s2.computeBoundingSphere(), Uo.copy(s2.boundingSphere), Uo.applyMatrix4(i2), Uo.radius += r2, false === t2.ray.intersectsSphere(Uo))\n return;\n Fo.copy(i2).invert(), Do.copy(t2.ray).applyMatrix4(Fo);\n const a2 = r2 / ((this.scale.x + this.scale.y + this.scale.z) / 3), o2 = a2 * a2, h2 = this.isLineSegments ? 2 : 1, l2 = s2.index, c2 = s2.attributes.position;\n if (null !== l2) {\n const s3 = Math.max(0, n2.start), i3 = Math.min(l2.count, n2.start + n2.count);\n for (let r3 = s3, n3 = i3 - 1; r3 < n3; r3 += h2) {\n const s4 = l2.getX(r3), i4 = l2.getX(r3 + 1), n4 = qo(this, t2, Do, o2, s4, i4, r3);\n n4 && e2.push(n4);\n }\n if (this.isLineLoop) {\n const r3 = l2.getX(i3 - 1), n3 = l2.getX(s3), a3 = qo(this, t2, Do, o2, r3, n3, i3 - 1);\n a3 && e2.push(a3);\n }\n } else {\n const s3 = Math.max(0, n2.start), i3 = Math.min(c2.count, n2.start + n2.count);\n for (let r3 = s3, n3 = i3 - 1; r3 < n3; r3 += h2) {\n const s4 = qo(this, t2, Do, o2, r3, r3 + 1, r3);\n s4 && e2.push(s4);\n }\n if (this.isLineLoop) {\n const r3 = qo(this, t2, Do, o2, i3 - 1, s3, i3 - 1);\n r3 && e2.push(r3);\n }\n }\n }\n updateMorphTargets() {\n const t2 = this.geometry.morphAttributes, e2 = Object.keys(t2);\n if (e2.length > 0) {\n const s2 = t2[e2[0]];\n if (void 0 !== s2) {\n this.morphTargetInfluences = [], this.morphTargetDictionary = {};\n for (let t3 = 0, e3 = s2.length; t3 < e3; t3++) {\n const e4 = s2[t3].name || String(t3);\n this.morphTargetInfluences.push(0), this.morphTargetDictionary[e4] = t3;\n }\n }\n }\n }\n };\n function qo(t2, e2, s2, i2, r2, n2, a2) {\n const o2 = t2.geometry.attributes.position;\n Vo.fromBufferAttribute(o2, r2), Lo.fromBufferAttribute(o2, n2);\n if (s2.distanceSqToSegment(Vo, Lo, jo, Wo) > i2) return;\n jo.applyMatrix4(t2.matrixWorld);\n const h2 = e2.ray.origin.distanceTo(jo);\n return h2 < e2.near || h2 > e2.far ? void 0 : {\n distance: h2,\n point: Wo.clone().applyMatrix4(t2.matrixWorld),\n index: a2,\n face: null,\n faceIndex: null,\n barycoord: null,\n object: t2\n };\n }\n var Ho = new Ti();\n var Xo = new Ti();\n var Yo = class extends Jo {\n constructor(t2, e2) {\n super(t2, e2), this.isLineSegments = true, this.type = \"LineSegments\";\n }\n computeLineDistances() {\n const t2 = this.geometry;\n if (null === t2.index) {\n const e2 = t2.attributes.position, s2 = [];\n for (let t3 = 0, i2 = e2.count; t3 < i2; t3 += 2)\n Ho.fromBufferAttribute(e2, t3), Xo.fromBufferAttribute(e2, t3 + 1), s2[t3] = 0 === t3 ? 0 : s2[t3 - 1], s2[t3 + 1] = s2[t3] + Ho.distanceTo(Xo);\n t2.setAttribute(\"lineDistance\", new kn(s2, 1));\n } else\n ai(\n \"LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.\"\n );\n return this;\n }\n };\n var Zo = class extends Jo {\n constructor(t2, e2) {\n super(t2, e2), this.isLineLoop = true, this.type = \"LineLoop\";\n }\n };\n var Go = class extends Zn {\n constructor(t2) {\n super(), this.isPointsMaterial = true, this.type = \"PointsMaterial\", this.color = new Pr(16777215), this.map = null, this.alphaMap = null, this.size = 1, this.sizeAttenuation = true, this.fog = true, this.setValues(t2);\n }\n copy(t2) {\n return super.copy(t2), this.color.copy(t2.color), this.map = t2.map, this.alphaMap = t2.alphaMap, this.size = t2.size, this.sizeAttenuation = t2.sizeAttenuation, this.fog = t2.fog, this;\n }\n };\n var $o = new Qi();\n var Qo = new wa();\n var Ko = new En();\n var th = new Ti();\n var eh = class extends Ar {\n constructor(t2 = new Wn(), e2 = new Go()) {\n super(), this.isPoints = true, this.type = \"Points\", this.geometry = t2, this.material = e2, this.morphTargetDictionary = void 0, this.morphTargetInfluences = void 0, this.updateMorphTargets();\n }\n copy(t2, e2) {\n return super.copy(t2, e2), this.material = Array.isArray(t2.material) ? t2.material.slice() : t2.material, this.geometry = t2.geometry, this;\n }\n raycast(t2, e2) {\n const s2 = this.geometry, i2 = this.matrixWorld, r2 = t2.params.Points.threshold, n2 = s2.drawRange;\n if (null === s2.boundingSphere && s2.computeBoundingSphere(), Ko.copy(s2.boundingSphere), Ko.applyMatrix4(i2), Ko.radius += r2, false === t2.ray.intersectsSphere(Ko))\n return;\n $o.copy(i2).invert(), Qo.copy(t2.ray).applyMatrix4($o);\n const a2 = r2 / ((this.scale.x + this.scale.y + this.scale.z) / 3), o2 = a2 * a2, h2 = s2.index, l2 = s2.attributes.position;\n if (null !== h2) {\n for (let s3 = Math.max(0, n2.start), r3 = Math.min(h2.count, n2.start + n2.count); s3 < r3; s3++) {\n const r4 = h2.getX(s3);\n th.fromBufferAttribute(l2, r4), sh(th, r4, o2, i2, t2, e2, this);\n }\n } else {\n for (let s3 = Math.max(0, n2.start), r3 = Math.min(l2.count, n2.start + n2.count); s3 < r3; s3++)\n th.fromBufferAttribute(l2, s3), sh(th, s3, o2, i2, t2, e2, this);\n }\n }\n updateMorphTargets() {\n const t2 = this.geometry.morphAttributes, e2 = Object.keys(t2);\n if (e2.length > 0) {\n const s2 = t2[e2[0]];\n if (void 0 !== s2) {\n this.morphTargetInfluences = [], this.morphTargetDictionary = {};\n for (let t3 = 0, e3 = s2.length; t3 < e3; t3++) {\n const e4 = s2[t3].name || String(t3);\n this.morphTargetInfluences.push(0), this.morphTargetDictionary[e4] = t3;\n }\n }\n }\n }\n };\n function sh(t2, e2, s2, i2, r2, n2, a2) {\n const o2 = Qo.distanceSqToPoint(t2);\n if (o2 < s2) {\n const s3 = new Ti();\n Qo.closestPointToPoint(t2, s3), s3.applyMatrix4(i2);\n const h2 = r2.ray.origin.distanceTo(s3);\n if (h2 < r2.near || h2 > r2.far) return;\n n2.push({\n distance: h2,\n distanceToRay: Math.sqrt(o2),\n point: s3,\n index: e2,\n face: null,\n faceIndex: null,\n barycoord: null,\n object: a2\n });\n }\n }\n var ih = class extends Ji {\n constructor(t2, e2, s2, i2, r2 = 1006, n2 = 1006, a2, o2, h2) {\n super(t2, e2, s2, i2, r2, n2, a2, o2, h2), this.isVideoTexture = true, this.generateMipmaps = false, this._requestVideoFrameCallbackId = 0;\n const l2 = this;\n \"requestVideoFrameCallback\" in t2 && (this._requestVideoFrameCallbackId = t2.requestVideoFrameCallback(function e3() {\n l2.needsUpdate = true, l2._requestVideoFrameCallbackId = t2.requestVideoFrameCallback(e3);\n }));\n }\n clone() {\n return new this.constructor(this.image).copy(this);\n }\n update() {\n const t2 = this.image;\n false === \"requestVideoFrameCallback\" in t2 && t2.readyState >= t2.HAVE_CURRENT_DATA && (this.needsUpdate = true);\n }\n dispose() {\n 0 !== this._requestVideoFrameCallbackId && (this.source.data.cancelVideoFrameCallback(this._requestVideoFrameCallbackId), this._requestVideoFrameCallbackId = 0), super.dispose();\n }\n };\n var rh = class extends ih {\n constructor(t2, e2, s2, i2, r2, n2, a2, o2) {\n super({}, t2, e2, s2, i2, r2, n2, a2, o2), this.isVideoFrameTexture = true;\n }\n update() {\n }\n clone() {\n return new this.constructor().copy(this);\n }\n setFrame(t2) {\n this.image = t2, this.needsUpdate = true;\n }\n };\n var nh = class extends Ji {\n constructor(t2, e2) {\n super({ width: t2, height: e2 }), this.isFramebufferTexture = true, this.magFilter = ft, this.minFilter = ft, this.generateMipmaps = false, this.needsUpdate = true;\n }\n };\n var ah = class extends Ji {\n constructor(t2, e2, s2, i2, r2, n2, a2, o2, h2, l2, c2, u2) {\n super(null, n2, a2, o2, h2, l2, i2, r2, c2, u2), this.isCompressedTexture = true, this.image = { width: e2, height: s2 }, this.mipmaps = t2, this.flipY = false, this.generateMipmaps = false;\n }\n };\n var oh = class extends ah {\n constructor(t2, e2, s2, i2, r2, n2) {\n super(t2, e2, s2, r2, n2), this.isCompressedArrayTexture = true, this.image.depth = i2, this.wrapR = yt, this.layerUpdates = /* @__PURE__ */ new Set();\n }\n addLayerUpdate(t2) {\n this.layerUpdates.add(t2);\n }\n clearLayerUpdates() {\n this.layerUpdates.clear();\n }\n };\n var hh = class extends ah {\n constructor(t2, e2, s2) {\n super(void 0, t2[0].width, t2[0].height, e2, s2, lt), this.isCompressedCubeTexture = true, this.isCubeTexture = true, this.image = t2;\n }\n };\n var lh = class extends Ji {\n constructor(t2 = [], e2 = 301, s2, i2, r2, n2, a2, o2, h2, l2) {\n super(t2, e2, s2, i2, r2, n2, a2, o2, h2, l2), this.isCubeTexture = true, this.flipY = false;\n }\n get images() {\n return this.image;\n }\n set images(t2) {\n this.image = t2;\n }\n };\n var ch = class extends Ji {\n constructor(t2, e2, s2, i2, r2, n2, a2, o2, h2) {\n super(t2, e2, s2, i2, r2, n2, a2, o2, h2), this.isCanvasTexture = true, this.needsUpdate = true;\n }\n };\n var uh = class extends Ji {\n constructor(t2, e2, s2, i2, r2, n2, a2, o2, h2) {\n super(t2, e2, s2, i2, r2, n2, a2, o2, h2), this.isHTMLTexture = true, this.generateMipmaps = false, this.needsUpdate = true;\n const l2 = t2 ? t2.parentNode : null;\n null !== l2 && \"requestPaint\" in l2 && (l2.onpaint = () => {\n this.needsUpdate = true;\n }, l2.requestPaint());\n }\n dispose() {\n const t2 = this.image ? this.image.parentNode : null;\n null !== t2 && \"onpaint\" in t2 && (t2.onpaint = null), super.dispose();\n }\n };\n var dh = class extends Ji {\n constructor(t2, e2, s2 = 1014, i2, r2, n2, a2 = 1003, o2 = 1003, h2, l2 = 1026, c2 = 1) {\n if (l2 !== Wt && 1027 !== l2)\n throw new Error(\n \"THREE.DepthTexture: format must be either THREE.DepthFormat or THREE.DepthStencilFormat\"\n );\n super({ width: t2, height: e2, depth: c2 }, i2, r2, n2, a2, o2, l2, s2, h2), this.isDepthTexture = true, this.flipY = false, this.generateMipmaps = false, this.compareFunction = null;\n }\n copy(t2) {\n return super.copy(t2), this.source = new Di(Object.assign({}, t2.image)), this.compareFunction = t2.compareFunction, this;\n }\n toJSON(t2) {\n const e2 = super.toJSON(t2);\n return null !== this.compareFunction && (e2.compareFunction = this.compareFunction), e2;\n }\n };\n var ph = class extends dh {\n constructor(t2, e2 = 1014, s2 = 301, i2, r2, n2 = 1003, a2 = 1003, o2, h2 = 1026) {\n const l2 = { width: t2, height: t2, depth: 1 }, c2 = [l2, l2, l2, l2, l2, l2];\n super(t2, t2, e2, s2, i2, r2, n2, a2, o2, h2), this.image = c2, this.isCubeDepthTexture = true, this.isCubeTexture = true;\n }\n get images() {\n return this.image;\n }\n set images(t2) {\n this.image = t2;\n }\n };\n var mh = class extends Ji {\n constructor(t2 = null) {\n super(), this.sourceTexture = t2, this.isExternalTexture = true;\n }\n copy(t2) {\n return super.copy(t2), this.sourceTexture = t2.sourceTexture, this;\n }\n };\n var yh = class _yh extends Wn {\n constructor(t2 = 1, e2 = 1, s2 = 1, i2 = 1, r2 = 1, n2 = 1) {\n super(), this.type = \"BoxGeometry\", this.parameters = {\n width: t2,\n height: e2,\n depth: s2,\n widthSegments: i2,\n heightSegments: r2,\n depthSegments: n2\n };\n const a2 = this;\n i2 = Math.floor(i2), r2 = Math.floor(r2), n2 = Math.floor(n2);\n const o2 = [], h2 = [], l2 = [], c2 = [];\n let u2 = 0, d2 = 0;\n function p2(t3, e3, s3, i3, r3, n3, p3, m2, y2, g2, f2) {\n const x2 = n3 / y2, b2 = p3 / g2, v2 = n3 / 2, w2 = p3 / 2, M2 = m2 / 2, S2 = y2 + 1, _2 = g2 + 1;\n let A2 = 0, T2 = 0;\n const z2 = new Ti();\n for (let n4 = 0; n4 < _2; n4++) {\n const a3 = n4 * b2 - w2;\n for (let o3 = 0; o3 < S2; o3++) {\n const u3 = o3 * x2 - v2;\n z2[t3] = u3 * i3, z2[e3] = a3 * r3, z2[s3] = M2, h2.push(z2.x, z2.y, z2.z), z2[t3] = 0, z2[e3] = 0, z2[s3] = m2 > 0 ? 1 : -1, l2.push(z2.x, z2.y, z2.z), c2.push(o3 / y2), c2.push(1 - n4 / g2), A2 += 1;\n }\n }\n for (let t4 = 0; t4 < g2; t4++)\n for (let e4 = 0; e4 < y2; e4++) {\n const s4 = u2 + e4 + S2 * t4, i4 = u2 + e4 + S2 * (t4 + 1), r4 = u2 + (e4 + 1) + S2 * (t4 + 1), n4 = u2 + (e4 + 1) + S2 * t4;\n o2.push(s4, i4, n4), o2.push(i4, r4, n4), T2 += 6;\n }\n a2.addGroup(d2, T2, f2), d2 += T2, u2 += A2;\n }\n p2(\"z\", \"y\", \"x\", -1, -1, s2, e2, t2, n2, r2, 0), p2(\"z\", \"y\", \"x\", 1, -1, s2, e2, -t2, n2, r2, 1), p2(\"x\", \"z\", \"y\", 1, 1, t2, s2, e2, i2, n2, 2), p2(\"x\", \"z\", \"y\", 1, -1, t2, s2, -e2, i2, n2, 3), p2(\"x\", \"y\", \"z\", 1, -1, t2, e2, s2, i2, r2, 4), p2(\"x\", \"y\", \"z\", -1, -1, t2, e2, -s2, i2, r2, 5), this.setIndex(o2), this.setAttribute(\"position\", new kn(h2, 3)), this.setAttribute(\"normal\", new kn(l2, 3)), this.setAttribute(\"uv\", new kn(c2, 2));\n }\n copy(t2) {\n return super.copy(t2), this.parameters = Object.assign({}, t2.parameters), this;\n }\n static fromJSON(t2) {\n return new _yh(t2.width, t2.height, t2.depth, t2.widthSegments, t2.heightSegments, t2.depthSegments);\n }\n };\n var gh = class _gh extends Wn {\n constructor(t2 = 1, e2 = 1, s2 = 4, i2 = 8, r2 = 1) {\n super(), this.type = \"CapsuleGeometry\", this.parameters = {\n radius: t2,\n height: e2,\n capSegments: s2,\n radialSegments: i2,\n heightSegments: r2\n }, e2 = Math.max(0, e2), s2 = Math.max(1, Math.floor(s2)), i2 = Math.max(3, Math.floor(i2)), r2 = Math.max(1, Math.floor(r2));\n const n2 = [], a2 = [], o2 = [], h2 = [], l2 = e2 / 2, c2 = Math.PI / 2 * t2, u2 = e2, d2 = 2 * c2 + u2, p2 = 2 * s2 + r2, m2 = i2 + 1, y2 = new Ti(), g2 = new Ti();\n for (let f2 = 0; f2 <= p2; f2++) {\n let x2 = 0, b2 = 0, v2 = 0, w2 = 0;\n if (f2 <= s2) {\n const e3 = f2 / s2, i3 = e3 * Math.PI / 2;\n b2 = -l2 - t2 * Math.cos(i3), v2 = t2 * Math.sin(i3), w2 = -t2 * Math.cos(i3), x2 = e3 * c2;\n } else if (f2 <= s2 + r2) {\n const i3 = (f2 - s2) / r2;\n b2 = i3 * e2 - l2, v2 = t2, w2 = 0, x2 = c2 + i3 * u2;\n } else {\n const e3 = (f2 - s2 - r2) / s2, i3 = e3 * Math.PI / 2;\n b2 = l2 + t2 * Math.sin(i3), v2 = t2 * Math.cos(i3), w2 = t2 * Math.sin(i3), x2 = c2 + u2 + e3 * c2;\n }\n const M2 = Math.max(0, Math.min(1, x2 / d2));\n let S2 = 0;\n 0 === f2 ? S2 = 0.5 / i2 : f2 === p2 && (S2 = -0.5 / i2);\n for (let t3 = 0; t3 <= i2; t3++) {\n const e3 = t3 / i2, s3 = e3 * Math.PI * 2, r3 = Math.sin(s3), n3 = Math.cos(s3);\n g2.x = -v2 * n3, g2.y = b2, g2.z = v2 * r3, a2.push(g2.x, g2.y, g2.z), y2.set(-v2 * n3, w2, v2 * r3), y2.normalize(), o2.push(y2.x, y2.y, y2.z), h2.push(e3 + S2, M2);\n }\n if (f2 > 0) {\n const t3 = (f2 - 1) * m2;\n for (let e3 = 0; e3 < i2; e3++) {\n const s3 = t3 + e3, i3 = t3 + e3 + 1, r3 = f2 * m2 + e3, a3 = f2 * m2 + e3 + 1;\n n2.push(s3, i3, r3), n2.push(i3, a3, r3);\n }\n }\n }\n this.setIndex(n2), this.setAttribute(\"position\", new kn(a2, 3)), this.setAttribute(\"normal\", new kn(o2, 3)), this.setAttribute(\"uv\", new kn(h2, 2));\n }\n copy(t2) {\n return super.copy(t2), this.parameters = Object.assign({}, t2.parameters), this;\n }\n static fromJSON(t2) {\n return new _gh(t2.radius, t2.height, t2.capSegments, t2.radialSegments, t2.heightSegments);\n }\n };\n var fh = class _fh extends Wn {\n constructor(t2 = 1, e2 = 32, s2 = 0, i2 = 2 * Math.PI) {\n super(), this.type = \"CircleGeometry\", this.parameters = { radius: t2, segments: e2, thetaStart: s2, thetaLength: i2 }, e2 = Math.max(3, e2);\n const r2 = [], n2 = [], a2 = [], o2 = [], h2 = new Ti(), l2 = new _i();\n n2.push(0, 0, 0), a2.push(0, 0, 1), o2.push(0.5, 0.5);\n for (let r3 = 0, c2 = 3; r3 <= e2; r3++, c2 += 3) {\n const u2 = s2 + r3 / e2 * i2;\n h2.x = t2 * Math.cos(u2), h2.y = t2 * Math.sin(u2), n2.push(h2.x, h2.y, h2.z), a2.push(0, 0, 1), l2.x = (n2[c2] / t2 + 1) / 2, l2.y = (n2[c2 + 1] / t2 + 1) / 2, o2.push(l2.x, l2.y);\n }\n for (let t3 = 1; t3 <= e2; t3++) r2.push(t3, t3 + 1, 0);\n this.setIndex(r2), this.setAttribute(\"position\", new kn(n2, 3)), this.setAttribute(\"normal\", new kn(a2, 3)), this.setAttribute(\"uv\", new kn(o2, 2));\n }\n copy(t2) {\n return super.copy(t2), this.parameters = Object.assign({}, t2.parameters), this;\n }\n static fromJSON(t2) {\n return new _fh(t2.radius, t2.segments, t2.thetaStart, t2.thetaLength);\n }\n };\n var xh = class _xh extends Wn {\n constructor(t2 = 1, e2 = 1, s2 = 1, i2 = 32, r2 = 1, n2 = false, a2 = 0, o2 = 2 * Math.PI) {\n super(), this.type = \"CylinderGeometry\", this.parameters = {\n radiusTop: t2,\n radiusBottom: e2,\n height: s2,\n radialSegments: i2,\n heightSegments: r2,\n openEnded: n2,\n thetaStart: a2,\n thetaLength: o2\n };\n const h2 = this;\n i2 = Math.floor(i2), r2 = Math.floor(r2);\n const l2 = [], c2 = [], u2 = [], d2 = [];\n let p2 = 0;\n const m2 = [], y2 = s2 / 2;\n let g2 = 0;\n function f2(s3) {\n const r3 = p2, n3 = new _i(), m3 = new Ti();\n let f3 = 0;\n const x2 = true === s3 ? t2 : e2, b2 = true === s3 ? 1 : -1;\n for (let t3 = 1; t3 <= i2; t3++) c2.push(0, y2 * b2, 0), u2.push(0, b2, 0), d2.push(0.5, 0.5), p2++;\n const v2 = p2;\n for (let t3 = 0; t3 <= i2; t3++) {\n const e3 = t3 / i2 * o2 + a2, s4 = Math.cos(e3), r4 = Math.sin(e3);\n m3.x = x2 * r4, m3.y = y2 * b2, m3.z = x2 * s4, c2.push(m3.x, m3.y, m3.z), u2.push(0, b2, 0), n3.x = 0.5 * s4 + 0.5, n3.y = 0.5 * r4 * b2 + 0.5, d2.push(n3.x, n3.y), p2++;\n }\n for (let t3 = 0; t3 < i2; t3++) {\n const e3 = r3 + t3, i3 = v2 + t3;\n true === s3 ? l2.push(i3, i3 + 1, e3) : l2.push(i3 + 1, i3, e3), f3 += 3;\n }\n h2.addGroup(g2, f3, true === s3 ? 1 : 2), g2 += f3;\n }\n !(function() {\n const n3 = new Ti(), f3 = new Ti();\n let x2 = 0;\n const b2 = (e2 - t2) / s2;\n for (let h3 = 0; h3 <= r2; h3++) {\n const l3 = [], g3 = h3 / r2, x3 = g3 * (e2 - t2) + t2;\n for (let t3 = 0; t3 <= i2; t3++) {\n const e3 = t3 / i2, r3 = e3 * o2 + a2, h4 = Math.sin(r3), m3 = Math.cos(r3);\n f3.x = x3 * h4, f3.y = -g3 * s2 + y2, f3.z = x3 * m3, c2.push(f3.x, f3.y, f3.z), n3.set(h4, b2, m3).normalize(), u2.push(n3.x, n3.y, n3.z), d2.push(e3, 1 - g3), l3.push(p2++);\n }\n m2.push(l3);\n }\n for (let s3 = 0; s3 < i2; s3++)\n for (let i3 = 0; i3 < r2; i3++) {\n const n4 = m2[i3][s3], a3 = m2[i3 + 1][s3], o3 = m2[i3 + 1][s3 + 1], h3 = m2[i3][s3 + 1];\n (t2 > 0 || 0 !== i3) && (l2.push(n4, a3, h3), x2 += 3), (e2 > 0 || i3 !== r2 - 1) && (l2.push(a3, o3, h3), x2 += 3);\n }\n h2.addGroup(g2, x2, 0), g2 += x2;\n })(), false === n2 && (t2 > 0 && f2(true), e2 > 0 && f2(false)), this.setIndex(l2), this.setAttribute(\"position\", new kn(c2, 3)), this.setAttribute(\"normal\", new kn(u2, 3)), this.setAttribute(\"uv\", new kn(d2, 2));\n }\n copy(t2) {\n return super.copy(t2), this.parameters = Object.assign({}, t2.parameters), this;\n }\n static fromJSON(t2) {\n return new _xh(\n t2.radiusTop,\n t2.radiusBottom,\n t2.height,\n t2.radialSegments,\n t2.heightSegments,\n t2.openEnded,\n t2.thetaStart,\n t2.thetaLength\n );\n }\n };\n var bh = class _bh extends xh {\n constructor(t2 = 1, e2 = 1, s2 = 32, i2 = 1, r2 = false, n2 = 0, a2 = 2 * Math.PI) {\n super(0, t2, e2, s2, i2, r2, n2, a2), this.type = \"ConeGeometry\", this.parameters = {\n radius: t2,\n height: e2,\n radialSegments: s2,\n heightSegments: i2,\n openEnded: r2,\n thetaStart: n2,\n thetaLength: a2\n };\n }\n static fromJSON(t2) {\n return new _bh(\n t2.radius,\n t2.height,\n t2.radialSegments,\n t2.heightSegments,\n t2.openEnded,\n t2.thetaStart,\n t2.thetaLength\n );\n }\n };\n var vh = class _vh extends Wn {\n constructor(t2 = [], e2 = [], s2 = 1, i2 = 0) {\n super(), this.type = \"PolyhedronGeometry\", this.parameters = { vertices: t2, indices: e2, radius: s2, detail: i2 };\n const r2 = [], n2 = [];\n function a2(t3, e3, s3, i3) {\n const r3 = i3 + 1, n3 = [];\n for (let i4 = 0; i4 <= r3; i4++) {\n n3[i4] = [];\n const a3 = t3.clone().lerp(s3, i4 / r3), o3 = e3.clone().lerp(s3, i4 / r3), h3 = r3 - i4;\n for (let t4 = 0; t4 <= h3; t4++) n3[i4][t4] = 0 === t4 && i4 === r3 ? a3 : a3.clone().lerp(o3, t4 / h3);\n }\n for (let t4 = 0; t4 < r3; t4++)\n for (let e4 = 0; e4 < 2 * (r3 - t4) - 1; e4++) {\n const s4 = Math.floor(e4 / 2);\n e4 % 2 == 0 ? (o2(n3[t4][s4 + 1]), o2(n3[t4 + 1][s4]), o2(n3[t4][s4])) : (o2(n3[t4][s4 + 1]), o2(n3[t4 + 1][s4 + 1]), o2(n3[t4 + 1][s4]));\n }\n }\n function o2(t3) {\n r2.push(t3.x, t3.y, t3.z);\n }\n function h2(e3, s3) {\n const i3 = 3 * e3;\n s3.x = t2[i3 + 0], s3.y = t2[i3 + 1], s3.z = t2[i3 + 2];\n }\n function l2(t3, e3, s3, i3) {\n i3 < 0 && 1 === t3.x && (n2[e3] = t3.x - 1), 0 === s3.x && 0 === s3.z && (n2[e3] = i3 / 2 / Math.PI + 0.5);\n }\n function c2(t3) {\n return Math.atan2(t3.z, -t3.x);\n }\n function u2(t3) {\n return Math.atan2(-t3.y, Math.sqrt(t3.x * t3.x + t3.z * t3.z));\n }\n !(function(t3) {\n const s3 = new Ti(), i3 = new Ti(), r3 = new Ti();\n for (let n3 = 0; n3 < e2.length; n3 += 3)\n h2(e2[n3 + 0], s3), h2(e2[n3 + 1], i3), h2(e2[n3 + 2], r3), a2(s3, i3, r3, t3);\n })(i2), (function(t3) {\n const e3 = new Ti();\n for (let s3 = 0; s3 < r2.length; s3 += 3)\n e3.x = r2[s3 + 0], e3.y = r2[s3 + 1], e3.z = r2[s3 + 2], e3.normalize().multiplyScalar(t3), r2[s3 + 0] = e3.x, r2[s3 + 1] = e3.y, r2[s3 + 2] = e3.z;\n })(s2), (function() {\n const t3 = new Ti();\n for (let e3 = 0; e3 < r2.length; e3 += 3) {\n t3.x = r2[e3 + 0], t3.y = r2[e3 + 1], t3.z = r2[e3 + 2];\n const s3 = c2(t3) / 2 / Math.PI + 0.5, i3 = u2(t3) / Math.PI + 0.5;\n n2.push(s3, 1 - i3);\n }\n (function() {\n const t4 = new Ti(), e3 = new Ti(), s3 = new Ti(), i3 = new Ti(), a3 = new _i(), o3 = new _i(), h3 = new _i();\n for (let u3 = 0, d2 = 0; u3 < r2.length; u3 += 9, d2 += 6) {\n t4.set(r2[u3 + 0], r2[u3 + 1], r2[u3 + 2]), e3.set(r2[u3 + 3], r2[u3 + 4], r2[u3 + 5]), s3.set(r2[u3 + 6], r2[u3 + 7], r2[u3 + 8]), a3.set(n2[d2 + 0], n2[d2 + 1]), o3.set(n2[d2 + 2], n2[d2 + 3]), h3.set(n2[d2 + 4], n2[d2 + 5]), i3.copy(t4).add(e3).add(s3).divideScalar(3);\n const p2 = c2(i3);\n l2(a3, d2 + 0, t4, p2), l2(o3, d2 + 2, e3, p2), l2(h3, d2 + 4, s3, p2);\n }\n })(), (function() {\n for (let t4 = 0; t4 < n2.length; t4 += 6) {\n const e3 = n2[t4 + 0], s3 = n2[t4 + 2], i3 = n2[t4 + 4], r3 = Math.max(e3, s3, i3), a3 = Math.min(e3, s3, i3);\n r3 > 0.9 && a3 < 0.1 && (e3 < 0.2 && (n2[t4 + 0] += 1), s3 < 0.2 && (n2[t4 + 2] += 1), i3 < 0.2 && (n2[t4 + 4] += 1));\n }\n })();\n })(), this.setAttribute(\"position\", new kn(r2, 3)), this.setAttribute(\"normal\", new kn(r2.slice(), 3)), this.setAttribute(\"uv\", new kn(n2, 2)), 0 === i2 ? this.computeVertexNormals() : this.normalizeNormals();\n }\n copy(t2) {\n return super.copy(t2), this.parameters = Object.assign({}, t2.parameters), this;\n }\n static fromJSON(t2) {\n return new _vh(t2.vertices, t2.indices, t2.radius, t2.detail);\n }\n };\n var wh = class _wh extends vh {\n constructor(t2 = 1, e2 = 0) {\n const s2 = (1 + Math.sqrt(5)) / 2, i2 = 1 / s2;\n super(\n [\n -1,\n -1,\n -1,\n -1,\n -1,\n 1,\n -1,\n 1,\n -1,\n -1,\n 1,\n 1,\n 1,\n -1,\n -1,\n 1,\n -1,\n 1,\n 1,\n 1,\n -1,\n 1,\n 1,\n 1,\n 0,\n -i2,\n -s2,\n 0,\n -i2,\n s2,\n 0,\n i2,\n -s2,\n 0,\n i2,\n s2,\n -i2,\n -s2,\n 0,\n -i2,\n s2,\n 0,\n i2,\n -s2,\n 0,\n i2,\n s2,\n 0,\n -s2,\n 0,\n -i2,\n s2,\n 0,\n -i2,\n -s2,\n 0,\n i2,\n s2,\n 0,\n i2\n ],\n [\n 3,\n 11,\n 7,\n 3,\n 7,\n 15,\n 3,\n 15,\n 13,\n 7,\n 19,\n 17,\n 7,\n 17,\n 6,\n 7,\n 6,\n 15,\n 17,\n 4,\n 8,\n 17,\n 8,\n 10,\n 17,\n 10,\n 6,\n 8,\n 0,\n 16,\n 8,\n 16,\n 2,\n 8,\n 2,\n 10,\n 0,\n 12,\n 1,\n 0,\n 1,\n 18,\n 0,\n 18,\n 16,\n 6,\n 10,\n 2,\n 6,\n 2,\n 13,\n 6,\n 13,\n 15,\n 2,\n 16,\n 18,\n 2,\n 18,\n 3,\n 2,\n 3,\n 13,\n 18,\n 1,\n 9,\n 18,\n 9,\n 11,\n 18,\n 11,\n 3,\n 4,\n 14,\n 12,\n 4,\n 12,\n 0,\n 4,\n 0,\n 8,\n 11,\n 9,\n 5,\n 11,\n 5,\n 19,\n 11,\n 19,\n 7,\n 19,\n 5,\n 14,\n 19,\n 14,\n 4,\n 19,\n 4,\n 17,\n 1,\n 12,\n 14,\n 1,\n 14,\n 5,\n 1,\n 5,\n 9\n ],\n t2,\n e2\n ), this.type = \"DodecahedronGeometry\", this.parameters = { radius: t2, detail: e2 };\n }\n static fromJSON(t2) {\n return new _wh(t2.radius, t2.detail);\n }\n };\n var Mh = new Ti();\n var Sh = new Ti();\n var _h = new Ti();\n var Ah = new $r();\n var Th = class extends Wn {\n constructor(t2 = null, e2 = 1) {\n if (super(), this.type = \"EdgesGeometry\", this.parameters = { geometry: t2, thresholdAngle: e2 }, null !== t2) {\n const s2 = 4, i2 = Math.pow(10, s2), r2 = Math.cos(yi * e2), n2 = t2.getIndex(), a2 = t2.getAttribute(\"position\"), o2 = n2 ? n2.count : a2.count, h2 = [0, 0, 0], l2 = [\"a\", \"b\", \"c\"], c2 = new Array(3), u2 = {}, d2 = [];\n for (let t3 = 0; t3 < o2; t3 += 3) {\n n2 ? (h2[0] = n2.getX(t3), h2[1] = n2.getX(t3 + 1), h2[2] = n2.getX(t3 + 2)) : (h2[0] = t3, h2[1] = t3 + 1, h2[2] = t3 + 2);\n const { a: e3, b: s3, c: o3 } = Ah;\n if (e3.fromBufferAttribute(a2, h2[0]), s3.fromBufferAttribute(a2, h2[1]), o3.fromBufferAttribute(a2, h2[2]), Ah.getNormal(_h), c2[0] = `${Math.round(e3.x * i2)},${Math.round(e3.y * i2)},${Math.round(e3.z * i2)}`, c2[1] = `${Math.round(s3.x * i2)},${Math.round(s3.y * i2)},${Math.round(s3.z * i2)}`, c2[2] = `${Math.round(o3.x * i2)},${Math.round(o3.y * i2)},${Math.round(o3.z * i2)}`, c2[0] !== c2[1] && c2[1] !== c2[2] && c2[2] !== c2[0])\n for (let t4 = 0; t4 < 3; t4++) {\n const e4 = (t4 + 1) % 3, s4 = c2[t4], i3 = c2[e4], n3 = Ah[l2[t4]], a3 = Ah[l2[e4]], o4 = `${s4}_${i3}`, p2 = `${i3}_${s4}`;\n p2 in u2 && u2[p2] ? (_h.dot(u2[p2].normal) <= r2 && (d2.push(n3.x, n3.y, n3.z), d2.push(a3.x, a3.y, a3.z)), u2[p2] = null) : o4 in u2 || (u2[o4] = { index0: h2[t4], index1: h2[e4], normal: _h.clone() });\n }\n }\n for (const t3 in u2)\n if (u2[t3]) {\n const { index0: e3, index1: s3 } = u2[t3];\n Mh.fromBufferAttribute(a2, e3), Sh.fromBufferAttribute(a2, s3), d2.push(Mh.x, Mh.y, Mh.z), d2.push(Sh.x, Sh.y, Sh.z);\n }\n this.setAttribute(\"position\", new kn(d2, 3));\n }\n }\n copy(t2) {\n return super.copy(t2), this.parameters = Object.assign({}, t2.parameters), this;\n }\n };\n var zh = class {\n constructor() {\n this.type = \"Curve\", this.arcLengthDivisions = 200, this.needsUpdate = false, this.cacheArcLengths = null;\n }\n getPoint() {\n ai(\"Curve: .getPoint() not implemented.\");\n }\n getPointAt(t2, e2) {\n const s2 = this.getUtoTmapping(t2);\n return this.getPoint(s2, e2);\n }\n getPoints(t2 = 5) {\n const e2 = [];\n for (let s2 = 0; s2 <= t2; s2++) e2.push(this.getPoint(s2 / t2));\n return e2;\n }\n getSpacedPoints(t2 = 5) {\n const e2 = [];\n for (let s2 = 0; s2 <= t2; s2++) e2.push(this.getPointAt(s2 / t2));\n return e2;\n }\n getLength() {\n const t2 = this.getLengths();\n return t2[t2.length - 1];\n }\n getLengths(t2 = this.arcLengthDivisions) {\n if (this.cacheArcLengths && this.cacheArcLengths.length === t2 + 1 && !this.needsUpdate)\n return this.cacheArcLengths;\n this.needsUpdate = false;\n const e2 = [];\n let s2, i2 = this.getPoint(0), r2 = 0;\n e2.push(0);\n for (let n2 = 1; n2 <= t2; n2++)\n s2 = this.getPoint(n2 / t2), r2 += s2.distanceTo(i2), e2.push(r2), i2 = s2;\n return this.cacheArcLengths = e2, e2;\n }\n updateArcLengths() {\n this.needsUpdate = true, this.getLengths();\n }\n getUtoTmapping(t2, e2 = null) {\n const s2 = this.getLengths();\n let i2 = 0;\n const r2 = s2.length;\n let n2;\n n2 = e2 || t2 * s2[r2 - 1];\n let a2, o2 = 0, h2 = r2 - 1;\n for (; o2 <= h2; )\n if (i2 = Math.floor(o2 + (h2 - o2) / 2), a2 = s2[i2] - n2, a2 < 0) o2 = i2 + 1;\n else {\n if (!(a2 > 0)) {\n h2 = i2;\n break;\n }\n h2 = i2 - 1;\n }\n if (i2 = h2, s2[i2] === n2) return i2 / (r2 - 1);\n const l2 = s2[i2];\n return (i2 + (n2 - l2) / (s2[i2 + 1] - l2)) / (r2 - 1);\n }\n getTangent(t2, e2) {\n const s2 = 1e-4;\n let i2 = t2 - s2, r2 = t2 + s2;\n i2 < 0 && (i2 = 0), r2 > 1 && (r2 = 1);\n const n2 = this.getPoint(i2), a2 = this.getPoint(r2), o2 = e2 || (n2.isVector2 ? new _i() : new Ti());\n return o2.copy(a2).sub(n2).normalize(), o2;\n }\n getTangentAt(t2, e2) {\n const s2 = this.getUtoTmapping(t2);\n return this.getTangent(s2, e2);\n }\n computeFrenetFrames(t2, e2 = false) {\n const s2 = new Ti(), i2 = [], r2 = [], n2 = [], a2 = new Ti(), o2 = new Qi();\n for (let e3 = 0; e3 <= t2; e3++) {\n const s3 = e3 / t2;\n i2[e3] = this.getTangentAt(s3, new Ti());\n }\n r2[0] = new Ti(), n2[0] = new Ti();\n let h2 = Number.MAX_VALUE;\n const l2 = Math.abs(i2[0].x), c2 = Math.abs(i2[0].y), u2 = Math.abs(i2[0].z);\n l2 <= h2 && (h2 = l2, s2.set(1, 0, 0)), c2 <= h2 && (h2 = c2, s2.set(0, 1, 0)), u2 <= h2 && s2.set(0, 0, 1), a2.crossVectors(i2[0], s2).normalize(), r2[0].crossVectors(i2[0], a2), n2[0].crossVectors(i2[0], r2[0]);\n for (let e3 = 1; e3 <= t2; e3++) {\n if (r2[e3] = r2[e3 - 1].clone(), n2[e3] = n2[e3 - 1].clone(), a2.crossVectors(i2[e3 - 1], i2[e3]), a2.length() > Number.EPSILON) {\n a2.normalize();\n const t3 = Math.acos(xi(i2[e3 - 1].dot(i2[e3]), -1, 1));\n r2[e3].applyMatrix4(o2.makeRotationAxis(a2, t3));\n }\n n2[e3].crossVectors(i2[e3], r2[e3]);\n }\n if (true === e2) {\n let e3 = Math.acos(xi(r2[0].dot(r2[t2]), -1, 1));\n e3 /= t2, i2[0].dot(a2.crossVectors(r2[0], r2[t2])) > 0 && (e3 = -e3);\n for (let s3 = 1; s3 <= t2; s3++)\n r2[s3].applyMatrix4(o2.makeRotationAxis(i2[s3], e3 * s3)), n2[s3].crossVectors(i2[s3], r2[s3]);\n }\n return { tangents: i2, normals: r2, binormals: n2 };\n }\n clone() {\n return new this.constructor().copy(this);\n }\n copy(t2) {\n return this.arcLengthDivisions = t2.arcLengthDivisions, this;\n }\n toJSON() {\n const t2 = { metadata: { version: 4.7, type: \"Curve\", generator: \"Curve.toJSON\" } };\n return t2.arcLengthDivisions = this.arcLengthDivisions, t2.type = this.type, t2;\n }\n fromJSON(t2) {\n return this.arcLengthDivisions = t2.arcLengthDivisions, this;\n }\n };\n var Ch = class extends zh {\n constructor(t2 = 0, e2 = 0, s2 = 1, i2 = 1, r2 = 0, n2 = 2 * Math.PI, a2 = false, o2 = 0) {\n super(), this.isEllipseCurve = true, this.type = \"EllipseCurve\", this.aX = t2, this.aY = e2, this.xRadius = s2, this.yRadius = i2, this.aStartAngle = r2, this.aEndAngle = n2, this.aClockwise = a2, this.aRotation = o2;\n }\n getPoint(t2, e2 = new _i()) {\n const s2 = e2, i2 = 2 * Math.PI;\n let r2 = this.aEndAngle - this.aStartAngle;\n const n2 = Math.abs(r2) < Number.EPSILON;\n for (; r2 < 0; ) r2 += i2;\n for (; r2 > i2; ) r2 -= i2;\n r2 < Number.EPSILON && (r2 = n2 ? 0 : i2), true !== this.aClockwise || n2 || (r2 === i2 ? r2 = -i2 : r2 -= i2);\n const a2 = this.aStartAngle + t2 * r2;\n let o2 = this.aX + this.xRadius * Math.cos(a2), h2 = this.aY + this.yRadius * Math.sin(a2);\n if (0 !== this.aRotation) {\n const t3 = Math.cos(this.aRotation), e3 = Math.sin(this.aRotation), s3 = o2 - this.aX, i3 = h2 - this.aY;\n o2 = s3 * t3 - i3 * e3 + this.aX, h2 = s3 * e3 + i3 * t3 + this.aY;\n }\n return s2.set(o2, h2);\n }\n copy(t2) {\n return super.copy(t2), this.aX = t2.aX, this.aY = t2.aY, this.xRadius = t2.xRadius, this.yRadius = t2.yRadius, this.aStartAngle = t2.aStartAngle, this.aEndAngle = t2.aEndAngle, this.aClockwise = t2.aClockwise, this.aRotation = t2.aRotation, this;\n }\n toJSON() {\n const t2 = super.toJSON();\n return t2.aX = this.aX, t2.aY = this.aY, t2.xRadius = this.xRadius, t2.yRadius = this.yRadius, t2.aStartAngle = this.aStartAngle, t2.aEndAngle = this.aEndAngle, t2.aClockwise = this.aClockwise, t2.aRotation = this.aRotation, t2;\n }\n fromJSON(t2) {\n return super.fromJSON(t2), this.aX = t2.aX, this.aY = t2.aY, this.xRadius = t2.xRadius, this.yRadius = t2.yRadius, this.aStartAngle = t2.aStartAngle, this.aEndAngle = t2.aEndAngle, this.aClockwise = t2.aClockwise, this.aRotation = t2.aRotation, this;\n }\n };\n var Ih = class extends Ch {\n constructor(t2, e2, s2, i2, r2, n2) {\n super(t2, e2, s2, s2, i2, r2, n2), this.isArcCurve = true, this.type = \"ArcCurve\";\n }\n };\n function Bh() {\n let t2 = 0, e2 = 0, s2 = 0, i2 = 0;\n function r2(r3, n2, a2, o2) {\n t2 = r3, e2 = a2, s2 = -3 * r3 + 3 * n2 - 2 * a2 - o2, i2 = 2 * r3 - 2 * n2 + a2 + o2;\n }\n return {\n initCatmullRom: function(t3, e3, s3, i3, n2) {\n r2(e3, s3, n2 * (s3 - t3), n2 * (i3 - e3));\n },\n initNonuniformCatmullRom: function(t3, e3, s3, i3, n2, a2, o2) {\n let h2 = (e3 - t3) / n2 - (s3 - t3) / (n2 + a2) + (s3 - e3) / a2, l2 = (s3 - e3) / a2 - (i3 - e3) / (a2 + o2) + (i3 - s3) / o2;\n h2 *= a2, l2 *= a2, r2(e3, s3, h2, l2);\n },\n calc: function(r3) {\n const n2 = r3 * r3;\n return t2 + e2 * r3 + s2 * n2 + i2 * (n2 * r3);\n }\n };\n }\n var kh = new Ti();\n var Oh = new Ti();\n var Ph = new Bh();\n var Rh = new Bh();\n var Eh = new Bh();\n var Nh = class extends zh {\n constructor(t2 = [], e2 = false, s2 = \"centripetal\", i2 = 0.5) {\n super(), this.isCatmullRomCurve3 = true, this.type = \"CatmullRomCurve3\", this.points = t2, this.closed = e2, this.curveType = s2, this.tension = i2;\n }\n getPoint(t2, e2 = new Ti()) {\n const s2 = e2, i2 = this.points, r2 = i2.length, n2 = (r2 - (this.closed ? 0 : 1)) * t2;\n let a2, o2, h2 = Math.floor(n2), l2 = n2 - h2;\n this.closed ? h2 += h2 > 0 ? 0 : (Math.floor(Math.abs(h2) / r2) + 1) * r2 : 0 === l2 && h2 === r2 - 1 && (h2 = r2 - 2, l2 = 1), this.closed || h2 > 0 ? a2 = i2[(h2 - 1) % r2] : (Oh.subVectors(i2[0], i2[1]).add(i2[0]), a2 = Oh);\n const c2 = i2[h2 % r2], u2 = i2[(h2 + 1) % r2];\n if (this.closed || h2 + 2 < r2 ? o2 = i2[(h2 + 2) % r2] : (kh.subVectors(i2[r2 - 1], i2[r2 - 2]).add(i2[r2 - 1]), o2 = kh), \"centripetal\" === this.curveType || \"chordal\" === this.curveType) {\n const t3 = \"chordal\" === this.curveType ? 0.5 : 0.25;\n let e3 = Math.pow(a2.distanceToSquared(c2), t3), s3 = Math.pow(c2.distanceToSquared(u2), t3), i3 = Math.pow(u2.distanceToSquared(o2), t3);\n s3 < 1e-4 && (s3 = 1), e3 < 1e-4 && (e3 = s3), i3 < 1e-4 && (i3 = s3), Ph.initNonuniformCatmullRom(a2.x, c2.x, u2.x, o2.x, e3, s3, i3), Rh.initNonuniformCatmullRom(a2.y, c2.y, u2.y, o2.y, e3, s3, i3), Eh.initNonuniformCatmullRom(a2.z, c2.z, u2.z, o2.z, e3, s3, i3);\n } else\n \"catmullrom\" === this.curveType && (Ph.initCatmullRom(a2.x, c2.x, u2.x, o2.x, this.tension), Rh.initCatmullRom(a2.y, c2.y, u2.y, o2.y, this.tension), Eh.initCatmullRom(a2.z, c2.z, u2.z, o2.z, this.tension));\n return s2.set(Ph.calc(l2), Rh.calc(l2), Eh.calc(l2)), s2;\n }\n copy(t2) {\n super.copy(t2), this.points = [];\n for (let e2 = 0, s2 = t2.points.length; e2 < s2; e2++) {\n const s3 = t2.points[e2];\n this.points.push(s3.clone());\n }\n return this.closed = t2.closed, this.curveType = t2.curveType, this.tension = t2.tension, this;\n }\n toJSON() {\n const t2 = super.toJSON();\n t2.points = [];\n for (let e2 = 0, s2 = this.points.length; e2 < s2; e2++) {\n const s3 = this.points[e2];\n t2.points.push(s3.toArray());\n }\n return t2.closed = this.closed, t2.curveType = this.curveType, t2.tension = this.tension, t2;\n }\n fromJSON(t2) {\n super.fromJSON(t2), this.points = [];\n for (let e2 = 0, s2 = t2.points.length; e2 < s2; e2++) {\n const s3 = t2.points[e2];\n this.points.push(new Ti().fromArray(s3));\n }\n return this.closed = t2.closed, this.curveType = t2.curveType, this.tension = t2.tension, this;\n }\n };\n function Vh(t2, e2, s2, i2, r2) {\n const n2 = 0.5 * (i2 - e2), a2 = 0.5 * (r2 - s2), o2 = t2 * t2;\n return (2 * s2 - 2 * i2 + n2 + a2) * (t2 * o2) + (-3 * s2 + 3 * i2 - 2 * n2 - a2) * o2 + n2 * t2 + s2;\n }\n function Lh(t2, e2, s2, i2) {\n return (function(t3, e3) {\n const s3 = 1 - t3;\n return s3 * s3 * e3;\n })(t2, e2) + (function(t3, e3) {\n return 2 * (1 - t3) * t3 * e3;\n })(t2, s2) + (function(t3, e3) {\n return t3 * t3 * e3;\n })(t2, i2);\n }\n function Fh(t2, e2, s2, i2, r2) {\n return (function(t3, e3) {\n const s3 = 1 - t3;\n return s3 * s3 * s3 * e3;\n })(t2, e2) + (function(t3, e3) {\n const s3 = 1 - t3;\n return 3 * s3 * s3 * t3 * e3;\n })(t2, s2) + (function(t3, e3) {\n return 3 * (1 - t3) * t3 * t3 * e3;\n })(t2, i2) + (function(t3, e3) {\n return t3 * t3 * t3 * e3;\n })(t2, r2);\n }\n var Dh = class extends zh {\n constructor(t2 = new _i(), e2 = new _i(), s2 = new _i(), i2 = new _i()) {\n super(), this.isCubicBezierCurve = true, this.type = \"CubicBezierCurve\", this.v0 = t2, this.v1 = e2, this.v2 = s2, this.v3 = i2;\n }\n getPoint(t2, e2 = new _i()) {\n const s2 = e2, i2 = this.v0, r2 = this.v1, n2 = this.v2, a2 = this.v3;\n return s2.set(Fh(t2, i2.x, r2.x, n2.x, a2.x), Fh(t2, i2.y, r2.y, n2.y, a2.y)), s2;\n }\n copy(t2) {\n return super.copy(t2), this.v0.copy(t2.v0), this.v1.copy(t2.v1), this.v2.copy(t2.v2), this.v3.copy(t2.v3), this;\n }\n toJSON() {\n const t2 = super.toJSON();\n return t2.v0 = this.v0.toArray(), t2.v1 = this.v1.toArray(), t2.v2 = this.v2.toArray(), t2.v3 = this.v3.toArray(), t2;\n }\n fromJSON(t2) {\n return super.fromJSON(t2), this.v0.fromArray(t2.v0), this.v1.fromArray(t2.v1), this.v2.fromArray(t2.v2), this.v3.fromArray(t2.v3), this;\n }\n };\n var Uh = class extends zh {\n constructor(t2 = new Ti(), e2 = new Ti(), s2 = new Ti(), i2 = new Ti()) {\n super(), this.isCubicBezierCurve3 = true, this.type = \"CubicBezierCurve3\", this.v0 = t2, this.v1 = e2, this.v2 = s2, this.v3 = i2;\n }\n getPoint(t2, e2 = new Ti()) {\n const s2 = e2, i2 = this.v0, r2 = this.v1, n2 = this.v2, a2 = this.v3;\n return s2.set(Fh(t2, i2.x, r2.x, n2.x, a2.x), Fh(t2, i2.y, r2.y, n2.y, a2.y), Fh(t2, i2.z, r2.z, n2.z, a2.z)), s2;\n }\n copy(t2) {\n return super.copy(t2), this.v0.copy(t2.v0), this.v1.copy(t2.v1), this.v2.copy(t2.v2), this.v3.copy(t2.v3), this;\n }\n toJSON() {\n const t2 = super.toJSON();\n return t2.v0 = this.v0.toArray(), t2.v1 = this.v1.toArray(), t2.v2 = this.v2.toArray(), t2.v3 = this.v3.toArray(), t2;\n }\n fromJSON(t2) {\n return super.fromJSON(t2), this.v0.fromArray(t2.v0), this.v1.fromArray(t2.v1), this.v2.fromArray(t2.v2), this.v3.fromArray(t2.v3), this;\n }\n };\n var jh = class extends zh {\n constructor(t2 = new _i(), e2 = new _i()) {\n super(), this.isLineCurve = true, this.type = \"LineCurve\", this.v1 = t2, this.v2 = e2;\n }\n getPoint(t2, e2 = new _i()) {\n const s2 = e2;\n return 1 === t2 ? s2.copy(this.v2) : (s2.copy(this.v2).sub(this.v1), s2.multiplyScalar(t2).add(this.v1)), s2;\n }\n getPointAt(t2, e2) {\n return this.getPoint(t2, e2);\n }\n getTangent(t2, e2 = new _i()) {\n return e2.subVectors(this.v2, this.v1).normalize();\n }\n getTangentAt(t2, e2) {\n return this.getTangent(t2, e2);\n }\n copy(t2) {\n return super.copy(t2), this.v1.copy(t2.v1), this.v2.copy(t2.v2), this;\n }\n toJSON() {\n const t2 = super.toJSON();\n return t2.v1 = this.v1.toArray(), t2.v2 = this.v2.toArray(), t2;\n }\n fromJSON(t2) {\n return super.fromJSON(t2), this.v1.fromArray(t2.v1), this.v2.fromArray(t2.v2), this;\n }\n };\n var Wh = class extends zh {\n constructor(t2 = new Ti(), e2 = new Ti()) {\n super(), this.isLineCurve3 = true, this.type = \"LineCurve3\", this.v1 = t2, this.v2 = e2;\n }\n getPoint(t2, e2 = new Ti()) {\n const s2 = e2;\n return 1 === t2 ? s2.copy(this.v2) : (s2.copy(this.v2).sub(this.v1), s2.multiplyScalar(t2).add(this.v1)), s2;\n }\n getPointAt(t2, e2) {\n return this.getPoint(t2, e2);\n }\n getTangent(t2, e2 = new Ti()) {\n return e2.subVectors(this.v2, this.v1).normalize();\n }\n getTangentAt(t2, e2) {\n return this.getTangent(t2, e2);\n }\n copy(t2) {\n return super.copy(t2), this.v1.copy(t2.v1), this.v2.copy(t2.v2), this;\n }\n toJSON() {\n const t2 = super.toJSON();\n return t2.v1 = this.v1.toArray(), t2.v2 = this.v2.toArray(), t2;\n }\n fromJSON(t2) {\n return super.fromJSON(t2), this.v1.fromArray(t2.v1), this.v2.fromArray(t2.v2), this;\n }\n };\n var Jh = class extends zh {\n constructor(t2 = new _i(), e2 = new _i(), s2 = new _i()) {\n super(), this.isQuadraticBezierCurve = true, this.type = \"QuadraticBezierCurve\", this.v0 = t2, this.v1 = e2, this.v2 = s2;\n }\n getPoint(t2, e2 = new _i()) {\n const s2 = e2, i2 = this.v0, r2 = this.v1, n2 = this.v2;\n return s2.set(Lh(t2, i2.x, r2.x, n2.x), Lh(t2, i2.y, r2.y, n2.y)), s2;\n }\n copy(t2) {\n return super.copy(t2), this.v0.copy(t2.v0), this.v1.copy(t2.v1), this.v2.copy(t2.v2), this;\n }\n toJSON() {\n const t2 = super.toJSON();\n return t2.v0 = this.v0.toArray(), t2.v1 = this.v1.toArray(), t2.v2 = this.v2.toArray(), t2;\n }\n fromJSON(t2) {\n return super.fromJSON(t2), this.v0.fromArray(t2.v0), this.v1.fromArray(t2.v1), this.v2.fromArray(t2.v2), this;\n }\n };\n var qh = class extends zh {\n constructor(t2 = new Ti(), e2 = new Ti(), s2 = new Ti()) {\n super(), this.isQuadraticBezierCurve3 = true, this.type = \"QuadraticBezierCurve3\", this.v0 = t2, this.v1 = e2, this.v2 = s2;\n }\n getPoint(t2, e2 = new Ti()) {\n const s2 = e2, i2 = this.v0, r2 = this.v1, n2 = this.v2;\n return s2.set(Lh(t2, i2.x, r2.x, n2.x), Lh(t2, i2.y, r2.y, n2.y), Lh(t2, i2.z, r2.z, n2.z)), s2;\n }\n copy(t2) {\n return super.copy(t2), this.v0.copy(t2.v0), this.v1.copy(t2.v1), this.v2.copy(t2.v2), this;\n }\n toJSON() {\n const t2 = super.toJSON();\n return t2.v0 = this.v0.toArray(), t2.v1 = this.v1.toArray(), t2.v2 = this.v2.toArray(), t2;\n }\n fromJSON(t2) {\n return super.fromJSON(t2), this.v0.fromArray(t2.v0), this.v1.fromArray(t2.v1), this.v2.fromArray(t2.v2), this;\n }\n };\n var Hh = class extends zh {\n constructor(t2 = []) {\n super(), this.isSplineCurve = true, this.type = \"SplineCurve\", this.points = t2;\n }\n getPoint(t2, e2 = new _i()) {\n const s2 = e2, i2 = this.points, r2 = (i2.length - 1) * t2, n2 = Math.floor(r2), a2 = r2 - n2, o2 = i2[0 === n2 ? n2 : n2 - 1], h2 = i2[n2], l2 = i2[n2 > i2.length - 2 ? i2.length - 1 : n2 + 1], c2 = i2[n2 > i2.length - 3 ? i2.length - 1 : n2 + 2];\n return s2.set(Vh(a2, o2.x, h2.x, l2.x, c2.x), Vh(a2, o2.y, h2.y, l2.y, c2.y)), s2;\n }\n copy(t2) {\n super.copy(t2), this.points = [];\n for (let e2 = 0, s2 = t2.points.length; e2 < s2; e2++) {\n const s3 = t2.points[e2];\n this.points.push(s3.clone());\n }\n return this;\n }\n toJSON() {\n const t2 = super.toJSON();\n t2.points = [];\n for (let e2 = 0, s2 = this.points.length; e2 < s2; e2++) {\n const s3 = this.points[e2];\n t2.points.push(s3.toArray());\n }\n return t2;\n }\n fromJSON(t2) {\n super.fromJSON(t2), this.points = [];\n for (let e2 = 0, s2 = t2.points.length; e2 < s2; e2++) {\n const s3 = t2.points[e2];\n this.points.push(new _i().fromArray(s3));\n }\n return this;\n }\n };\n var Xh = Object.freeze({\n __proto__: null,\n ArcCurve: Ih,\n CatmullRomCurve3: Nh,\n CubicBezierCurve: Dh,\n CubicBezierCurve3: Uh,\n EllipseCurve: Ch,\n LineCurve: jh,\n LineCurve3: Wh,\n QuadraticBezierCurve: Jh,\n QuadraticBezierCurve3: qh,\n SplineCurve: Hh\n });\n var Yh = class extends zh {\n constructor() {\n super(), this.type = \"CurvePath\", this.curves = [], this.autoClose = false;\n }\n add(t2) {\n this.curves.push(t2);\n }\n closePath() {\n const t2 = this.curves[0].getPoint(0), e2 = this.curves[this.curves.length - 1].getPoint(1);\n if (!t2.equals(e2)) {\n const s2 = true === t2.isVector2 ? \"LineCurve\" : \"LineCurve3\";\n this.curves.push(new Xh[s2](e2, t2));\n }\n return this;\n }\n getPoint(t2, e2) {\n const s2 = t2 * this.getLength(), i2 = this.getCurveLengths();\n let r2 = 0;\n for (; r2 < i2.length; ) {\n if (i2[r2] >= s2) {\n const t3 = i2[r2] - s2, n2 = this.curves[r2], a2 = n2.getLength(), o2 = 0 === a2 ? 0 : 1 - t3 / a2;\n return n2.getPointAt(o2, e2);\n }\n r2++;\n }\n return null;\n }\n getLength() {\n const t2 = this.getCurveLengths();\n return t2[t2.length - 1];\n }\n updateArcLengths() {\n this.needsUpdate = true, this.cacheLengths = null, this.getCurveLengths();\n }\n getCurveLengths() {\n if (this.cacheLengths && this.cacheLengths.length === this.curves.length)\n return this.cacheLengths;\n const t2 = [];\n let e2 = 0;\n for (let s2 = 0, i2 = this.curves.length; s2 < i2; s2++)\n e2 += this.curves[s2].getLength(), t2.push(e2);\n return this.cacheLengths = t2, t2;\n }\n getSpacedPoints(t2 = 40) {\n const e2 = [];\n for (let s2 = 0; s2 <= t2; s2++) e2.push(this.getPoint(s2 / t2));\n return this.autoClose && e2.push(e2[0]), e2;\n }\n getPoints(t2 = 12) {\n const e2 = [];\n let s2;\n for (let i2 = 0, r2 = this.curves; i2 < r2.length; i2++) {\n const n2 = r2[i2], a2 = n2.isEllipseCurve ? 2 * t2 : n2.isLineCurve || n2.isLineCurve3 ? 1 : n2.isSplineCurve ? t2 * n2.points.length : t2, o2 = n2.getPoints(a2);\n for (let t3 = 0; t3 < o2.length; t3++) {\n const i3 = o2[t3];\n s2 && s2.equals(i3) || (e2.push(i3), s2 = i3);\n }\n }\n return this.autoClose && e2.length > 1 && !e2[e2.length - 1].equals(e2[0]) && e2.push(e2[0]), e2;\n }\n copy(t2) {\n super.copy(t2), this.curves = [];\n for (let e2 = 0, s2 = t2.curves.length; e2 < s2; e2++) {\n const s3 = t2.curves[e2];\n this.curves.push(s3.clone());\n }\n return this.autoClose = t2.autoClose, this;\n }\n toJSON() {\n const t2 = super.toJSON();\n t2.autoClose = this.autoClose, t2.curves = [];\n for (let e2 = 0, s2 = this.curves.length; e2 < s2; e2++) {\n const s3 = this.curves[e2];\n t2.curves.push(s3.toJSON());\n }\n return t2;\n }\n fromJSON(t2) {\n super.fromJSON(t2), this.autoClose = t2.autoClose, this.curves = [];\n for (let e2 = 0, s2 = t2.curves.length; e2 < s2; e2++) {\n const s3 = t2.curves[e2];\n this.curves.push(new Xh[s3.type]().fromJSON(s3));\n }\n return this;\n }\n };\n var Zh = class extends Yh {\n constructor(t2) {\n super(), this.type = \"Path\", this.currentPoint = new _i(), t2 && this.setFromPoints(t2);\n }\n setFromPoints(t2) {\n this.moveTo(t2[0].x, t2[0].y);\n for (let e2 = 1, s2 = t2.length; e2 < s2; e2++) this.lineTo(t2[e2].x, t2[e2].y);\n return this;\n }\n moveTo(t2, e2) {\n return this.currentPoint.set(t2, e2), this;\n }\n lineTo(t2, e2) {\n const s2 = new jh(this.currentPoint.clone(), new _i(t2, e2));\n return this.curves.push(s2), this.currentPoint.set(t2, e2), this;\n }\n quadraticCurveTo(t2, e2, s2, i2) {\n const r2 = new Jh(this.currentPoint.clone(), new _i(t2, e2), new _i(s2, i2));\n return this.curves.push(r2), this.currentPoint.set(s2, i2), this;\n }\n bezierCurveTo(t2, e2, s2, i2, r2, n2) {\n const a2 = new Dh(this.currentPoint.clone(), new _i(t2, e2), new _i(s2, i2), new _i(r2, n2));\n return this.curves.push(a2), this.currentPoint.set(r2, n2), this;\n }\n splineThru(t2) {\n const e2 = [this.currentPoint.clone()].concat(t2), s2 = new Hh(e2);\n return this.curves.push(s2), this.currentPoint.copy(t2[t2.length - 1]), this;\n }\n arc(t2, e2, s2, i2, r2, n2) {\n const a2 = this.currentPoint.x, o2 = this.currentPoint.y;\n return this.absarc(t2 + a2, e2 + o2, s2, i2, r2, n2), this;\n }\n absarc(t2, e2, s2, i2, r2, n2) {\n return this.absellipse(t2, e2, s2, s2, i2, r2, n2), this;\n }\n ellipse(t2, e2, s2, i2, r2, n2, a2, o2) {\n const h2 = this.currentPoint.x, l2 = this.currentPoint.y;\n return this.absellipse(t2 + h2, e2 + l2, s2, i2, r2, n2, a2, o2), this;\n }\n absellipse(t2, e2, s2, i2, r2, n2, a2, o2) {\n const h2 = new Ch(t2, e2, s2, i2, r2, n2, a2, o2);\n if (this.curves.length > 0) {\n const t3 = h2.getPoint(0);\n t3.equals(this.currentPoint) || this.lineTo(t3.x, t3.y);\n }\n this.curves.push(h2);\n const l2 = h2.getPoint(1);\n return this.currentPoint.copy(l2), this;\n }\n copy(t2) {\n return super.copy(t2), this.currentPoint.copy(t2.currentPoint), this;\n }\n toJSON() {\n const t2 = super.toJSON();\n return t2.currentPoint = this.currentPoint.toArray(), t2;\n }\n fromJSON(t2) {\n return super.fromJSON(t2), this.currentPoint.fromArray(t2.currentPoint), this;\n }\n };\n var Gh = class extends Zh {\n constructor(t2) {\n super(t2), this.uuid = fi(), this.type = \"Shape\", this.holes = [];\n }\n getPointsHoles(t2) {\n const e2 = [];\n for (let s2 = 0, i2 = this.holes.length; s2 < i2; s2++) e2[s2] = this.holes[s2].getPoints(t2);\n return e2;\n }\n extractPoints(t2) {\n return { shape: this.getPoints(t2), holes: this.getPointsHoles(t2) };\n }\n copy(t2) {\n super.copy(t2), this.holes = [];\n for (let e2 = 0, s2 = t2.holes.length; e2 < s2; e2++) {\n const s3 = t2.holes[e2];\n this.holes.push(s3.clone());\n }\n return this;\n }\n toJSON() {\n const t2 = super.toJSON();\n t2.uuid = this.uuid, t2.holes = [];\n for (let e2 = 0, s2 = this.holes.length; e2 < s2; e2++) {\n const s3 = this.holes[e2];\n t2.holes.push(s3.toJSON());\n }\n return t2;\n }\n fromJSON(t2) {\n super.fromJSON(t2), this.uuid = t2.uuid, this.holes = [];\n for (let e2 = 0, s2 = t2.holes.length; e2 < s2; e2++) {\n const s3 = t2.holes[e2];\n this.holes.push(new Zh().fromJSON(s3));\n }\n return this;\n }\n };\n function $h(t2, e2, s2 = 2) {\n const i2 = e2 && e2.length, r2 = i2 ? e2[0] * s2 : t2.length;\n let n2 = Qh(t2, 0, r2, s2, true);\n const a2 = [];\n if (!n2 || n2.next === n2.prev) return a2;\n let o2, h2, l2;\n if (i2 && (n2 = (function(t3, e3, s3, i3) {\n const r3 = [];\n for (let s4 = 0, n3 = e3.length; s4 < n3; s4++) {\n const a3 = Qh(t3, e3[s4] * i3, s4 < n3 - 1 ? e3[s4 + 1] * i3 : t3.length, i3, false);\n a3 === a3.next && (a3.steiner = true), r3.push(ll(a3));\n }\n r3.sort(nl);\n for (let t4 = 0; t4 < r3.length; t4++) s3 = al(r3[t4], s3);\n return s3;\n })(t2, e2, n2, s2)), t2.length > 80 * s2) {\n o2 = t2[0], h2 = t2[1];\n let e3 = o2, i3 = h2;\n for (let n3 = s2; n3 < r2; n3 += s2) {\n const s3 = t2[n3], r3 = t2[n3 + 1];\n s3 < o2 && (o2 = s3), r3 < h2 && (h2 = r3), s3 > e3 && (e3 = s3), r3 > i3 && (i3 = r3);\n }\n l2 = Math.max(e3 - o2, i3 - h2), l2 = 0 !== l2 ? 32767 / l2 : 0;\n }\n return tl(n2, a2, s2, o2, h2, l2, 0), a2;\n }\n function Qh(t2, e2, s2, i2, r2) {\n let n2;\n if (r2 === (function(t3, e3, s3, i3) {\n let r3 = 0;\n for (let n3 = e3, a2 = s3 - i3; n3 < s3; n3 += i3)\n r3 += (t3[a2] - t3[n3]) * (t3[n3 + 1] + t3[a2 + 1]), a2 = n3;\n return r3;\n })(t2, e2, s2, i2) > 0)\n for (let r3 = e2; r3 < s2; r3 += i2) n2 = vl(r3 / i2 | 0, t2[r3], t2[r3 + 1], n2);\n else for (let r3 = s2 - i2; r3 >= e2; r3 -= i2) n2 = vl(r3 / i2 | 0, t2[r3], t2[r3 + 1], n2);\n return n2 && ml(n2, n2.next) && (wl(n2), n2 = n2.next), n2;\n }\n function Kh(t2, e2) {\n if (!t2) return t2;\n e2 || (e2 = t2);\n let s2, i2 = t2;\n do {\n if (s2 = false, i2.steiner || !ml(i2, i2.next) && 0 !== pl(i2.prev, i2, i2.next)) i2 = i2.next;\n else {\n if (wl(i2), i2 = e2 = i2.prev, i2 === i2.next) break;\n s2 = true;\n }\n } while (s2 || i2 !== e2);\n return e2;\n }\n function tl(t2, e2, s2, i2, r2, n2, a2) {\n if (!t2) return;\n !a2 && n2 && (function(t3, e3, s3, i3) {\n let r3 = t3;\n do {\n 0 === r3.z && (r3.z = hl(r3.x, r3.y, e3, s3, i3)), r3.prevZ = r3.prev, r3.nextZ = r3.next, r3 = r3.next;\n } while (r3 !== t3);\n r3.prevZ.nextZ = null, r3.prevZ = null, (function(t4) {\n let e4, s4 = 1;\n do {\n let i4, r4 = t4;\n t4 = null;\n let n3 = null;\n for (e4 = 0; r4; ) {\n e4++;\n let a3 = r4, o3 = 0;\n for (let t5 = 0; t5 < s4 && (o3++, a3 = a3.nextZ, a3); t5++) ;\n let h2 = s4;\n for (; o3 > 0 || h2 > 0 && a3; )\n 0 !== o3 && (0 === h2 || !a3 || r4.z <= a3.z) ? (i4 = r4, r4 = r4.nextZ, o3--) : (i4 = a3, a3 = a3.nextZ, h2--), n3 ? n3.nextZ = i4 : t4 = i4, i4.prevZ = n3, n3 = i4;\n r4 = a3;\n }\n n3.nextZ = null, s4 *= 2;\n } while (e4 > 1);\n })(r3);\n })(t2, i2, r2, n2);\n let o2 = t2;\n for (; t2.prev !== t2.next; ) {\n const h2 = t2.prev, l2 = t2.next;\n if (n2 ? sl(t2, i2, r2, n2) : el(t2)) e2.push(h2.i, t2.i, l2.i), wl(t2), t2 = l2.next, o2 = l2.next;\n else if ((t2 = l2) === o2) {\n a2 ? 1 === a2 ? tl(t2 = il(Kh(t2), e2), e2, s2, i2, r2, n2, 2) : 2 === a2 && rl(t2, e2, s2, i2, r2, n2) : tl(Kh(t2), e2, s2, i2, r2, n2, 1);\n break;\n }\n }\n }\n function el(t2) {\n const e2 = t2.prev, s2 = t2, i2 = t2.next;\n if (pl(e2, s2, i2) >= 0) return false;\n const r2 = e2.x, n2 = s2.x, a2 = i2.x, o2 = e2.y, h2 = s2.y, l2 = i2.y, c2 = Math.min(r2, n2, a2), u2 = Math.min(o2, h2, l2), d2 = Math.max(r2, n2, a2), p2 = Math.max(o2, h2, l2);\n let m2 = i2.next;\n for (; m2 !== e2; ) {\n if (m2.x >= c2 && m2.x <= d2 && m2.y >= u2 && m2.y <= p2 && ul(r2, o2, n2, h2, a2, l2, m2.x, m2.y) && pl(m2.prev, m2, m2.next) >= 0)\n return false;\n m2 = m2.next;\n }\n return true;\n }\n function sl(t2, e2, s2, i2) {\n const r2 = t2.prev, n2 = t2, a2 = t2.next;\n if (pl(r2, n2, a2) >= 0) return false;\n const o2 = r2.x, h2 = n2.x, l2 = a2.x, c2 = r2.y, u2 = n2.y, d2 = a2.y, p2 = Math.min(o2, h2, l2), m2 = Math.min(c2, u2, d2), y2 = Math.max(o2, h2, l2), g2 = Math.max(c2, u2, d2), f2 = hl(p2, m2, e2, s2, i2), x2 = hl(y2, g2, e2, s2, i2);\n let b2 = t2.prevZ, v2 = t2.nextZ;\n for (; b2 && b2.z >= f2 && v2 && v2.z <= x2; ) {\n if (b2.x >= p2 && b2.x <= y2 && b2.y >= m2 && b2.y <= g2 && b2 !== r2 && b2 !== a2 && ul(o2, c2, h2, u2, l2, d2, b2.x, b2.y) && pl(b2.prev, b2, b2.next) >= 0)\n return false;\n if (b2 = b2.prevZ, v2.x >= p2 && v2.x <= y2 && v2.y >= m2 && v2.y <= g2 && v2 !== r2 && v2 !== a2 && ul(o2, c2, h2, u2, l2, d2, v2.x, v2.y) && pl(v2.prev, v2, v2.next) >= 0)\n return false;\n v2 = v2.nextZ;\n }\n for (; b2 && b2.z >= f2; ) {\n if (b2.x >= p2 && b2.x <= y2 && b2.y >= m2 && b2.y <= g2 && b2 !== r2 && b2 !== a2 && ul(o2, c2, h2, u2, l2, d2, b2.x, b2.y) && pl(b2.prev, b2, b2.next) >= 0)\n return false;\n b2 = b2.prevZ;\n }\n for (; v2 && v2.z <= x2; ) {\n if (v2.x >= p2 && v2.x <= y2 && v2.y >= m2 && v2.y <= g2 && v2 !== r2 && v2 !== a2 && ul(o2, c2, h2, u2, l2, d2, v2.x, v2.y) && pl(v2.prev, v2, v2.next) >= 0)\n return false;\n v2 = v2.nextZ;\n }\n return true;\n }\n function il(t2, e2) {\n let s2 = t2;\n do {\n const i2 = s2.prev, r2 = s2.next.next;\n !ml(i2, r2) && yl(i2, s2, s2.next, r2) && xl(i2, r2) && xl(r2, i2) && (e2.push(i2.i, s2.i, r2.i), wl(s2), wl(s2.next), s2 = t2 = r2), s2 = s2.next;\n } while (s2 !== t2);\n return Kh(s2);\n }\n function rl(t2, e2, s2, i2, r2, n2) {\n let a2 = t2;\n do {\n let t3 = a2.next.next;\n for (; t3 !== a2.prev; ) {\n if (a2.i !== t3.i && dl(a2, t3)) {\n let o2 = bl(a2, t3);\n return a2 = Kh(a2, a2.next), o2 = Kh(o2, o2.next), tl(a2, e2, s2, i2, r2, n2, 0), void tl(o2, e2, s2, i2, r2, n2, 0);\n }\n t3 = t3.next;\n }\n a2 = a2.next;\n } while (a2 !== t2);\n }\n function nl(t2, e2) {\n let s2 = t2.x - e2.x;\n if (0 === s2 && (s2 = t2.y - e2.y, 0 === s2)) {\n s2 = (t2.next.y - t2.y) / (t2.next.x - t2.x) - (e2.next.y - e2.y) / (e2.next.x - e2.x);\n }\n return s2;\n }\n function al(t2, e2) {\n const s2 = (function(t3, e3) {\n let s3 = e3;\n const i3 = t3.x, r2 = t3.y;\n let n2, a2 = -1 / 0;\n if (ml(t3, s3)) return s3;\n do {\n if (ml(t3, s3.next)) return s3.next;\n if (r2 <= s3.y && r2 >= s3.next.y && s3.next.y !== s3.y) {\n const t4 = s3.x + (r2 - s3.y) * (s3.next.x - s3.x) / (s3.next.y - s3.y);\n if (t4 <= i3 && t4 > a2 && (a2 = t4, n2 = s3.x < s3.next.x ? s3 : s3.next, t4 === i3)) return n2;\n }\n s3 = s3.next;\n } while (s3 !== e3);\n if (!n2) return null;\n const o2 = n2, h2 = n2.x, l2 = n2.y;\n let c2 = 1 / 0;\n s3 = n2;\n do {\n if (i3 >= s3.x && s3.x >= h2 && i3 !== s3.x && cl(r2 < l2 ? i3 : a2, r2, h2, l2, r2 < l2 ? a2 : i3, r2, s3.x, s3.y)) {\n const e4 = Math.abs(r2 - s3.y) / (i3 - s3.x);\n xl(s3, t3) && (e4 < c2 || e4 === c2 && (s3.x > n2.x || s3.x === n2.x && ol(n2, s3))) && (n2 = s3, c2 = e4);\n }\n s3 = s3.next;\n } while (s3 !== o2);\n return n2;\n })(t2, e2);\n if (!s2) return e2;\n const i2 = bl(s2, t2);\n return Kh(i2, i2.next), Kh(s2, s2.next);\n }\n function ol(t2, e2) {\n return pl(t2.prev, t2, e2.prev) < 0 && pl(e2.next, t2, t2.next) < 0;\n }\n function hl(t2, e2, s2, i2, r2) {\n return (t2 = 1431655765 & ((t2 = 858993459 & ((t2 = 252645135 & ((t2 = 16711935 & ((t2 = (t2 - s2) * r2 | 0) | t2 << 8)) | t2 << 4)) | t2 << 2)) | t2 << 1)) | (e2 = 1431655765 & ((e2 = 858993459 & ((e2 = 252645135 & ((e2 = 16711935 & ((e2 = (e2 - i2) * r2 | 0) | e2 << 8)) | e2 << 4)) | e2 << 2)) | e2 << 1)) << 1;\n }\n function ll(t2) {\n let e2 = t2, s2 = t2;\n do {\n (e2.x < s2.x || e2.x === s2.x && e2.y < s2.y) && (s2 = e2), e2 = e2.next;\n } while (e2 !== t2);\n return s2;\n }\n function cl(t2, e2, s2, i2, r2, n2, a2, o2) {\n return (r2 - a2) * (e2 - o2) >= (t2 - a2) * (n2 - o2) && (t2 - a2) * (i2 - o2) >= (s2 - a2) * (e2 - o2) && (s2 - a2) * (n2 - o2) >= (r2 - a2) * (i2 - o2);\n }\n function ul(t2, e2, s2, i2, r2, n2, a2, o2) {\n return !(t2 === a2 && e2 === o2) && cl(t2, e2, s2, i2, r2, n2, a2, o2);\n }\n function dl(t2, e2) {\n return t2.next.i !== e2.i && t2.prev.i !== e2.i && !(function(t3, e3) {\n let s2 = t3;\n do {\n if (s2.i !== t3.i && s2.next.i !== t3.i && s2.i !== e3.i && s2.next.i !== e3.i && yl(s2, s2.next, t3, e3))\n return true;\n s2 = s2.next;\n } while (s2 !== t3);\n return false;\n })(t2, e2) && (xl(t2, e2) && xl(e2, t2) && (function(t3, e3) {\n let s2 = t3, i2 = false;\n const r2 = (t3.x + e3.x) / 2, n2 = (t3.y + e3.y) / 2;\n do {\n s2.y > n2 != s2.next.y > n2 && s2.next.y !== s2.y && r2 < (s2.next.x - s2.x) * (n2 - s2.y) / (s2.next.y - s2.y) + s2.x && (i2 = !i2), s2 = s2.next;\n } while (s2 !== t3);\n return i2;\n })(t2, e2) && (pl(t2.prev, t2, e2.prev) || pl(t2, e2.prev, e2)) || ml(t2, e2) && pl(t2.prev, t2, t2.next) > 0 && pl(e2.prev, e2, e2.next) > 0);\n }\n function pl(t2, e2, s2) {\n return (e2.y - t2.y) * (s2.x - e2.x) - (e2.x - t2.x) * (s2.y - e2.y);\n }\n function ml(t2, e2) {\n return t2.x === e2.x && t2.y === e2.y;\n }\n function yl(t2, e2, s2, i2) {\n const r2 = fl(pl(t2, e2, s2)), n2 = fl(pl(t2, e2, i2)), a2 = fl(pl(s2, i2, t2)), o2 = fl(pl(s2, i2, e2));\n return r2 !== n2 && a2 !== o2 || !(0 !== r2 || !gl(t2, s2, e2)) || !(0 !== n2 || !gl(t2, i2, e2)) || !(0 !== a2 || !gl(s2, t2, i2)) || !(0 !== o2 || !gl(s2, e2, i2));\n }\n function gl(t2, e2, s2) {\n return e2.x <= Math.max(t2.x, s2.x) && e2.x >= Math.min(t2.x, s2.x) && e2.y <= Math.max(t2.y, s2.y) && e2.y >= Math.min(t2.y, s2.y);\n }\n function fl(t2) {\n return t2 > 0 ? 1 : t2 < 0 ? -1 : 0;\n }\n function xl(t2, e2) {\n return pl(t2.prev, t2, t2.next) < 0 ? pl(t2, e2, t2.next) >= 0 && pl(t2, t2.prev, e2) >= 0 : pl(t2, e2, t2.prev) < 0 || pl(t2, t2.next, e2) < 0;\n }\n function bl(t2, e2) {\n const s2 = Ml(t2.i, t2.x, t2.y), i2 = Ml(e2.i, e2.x, e2.y), r2 = t2.next, n2 = e2.prev;\n return t2.next = e2, e2.prev = t2, s2.next = r2, r2.prev = s2, i2.next = s2, s2.prev = i2, n2.next = i2, i2.prev = n2, i2;\n }\n function vl(t2, e2, s2, i2) {\n const r2 = Ml(t2, e2, s2);\n return i2 ? (r2.next = i2.next, r2.prev = i2, i2.next.prev = r2, i2.next = r2) : (r2.prev = r2, r2.next = r2), r2;\n }\n function wl(t2) {\n t2.next.prev = t2.prev, t2.prev.next = t2.next, t2.prevZ && (t2.prevZ.nextZ = t2.nextZ), t2.nextZ && (t2.nextZ.prevZ = t2.prevZ);\n }\n function Ml(t2, e2, s2) {\n return { i: t2, x: e2, y: s2, prev: null, next: null, z: 0, prevZ: null, nextZ: null, steiner: false };\n }\n var Sl = class {\n static triangulate(t2, e2, s2 = 2) {\n return $h(t2, e2, s2);\n }\n };\n var _l = class __l {\n static area(t2) {\n const e2 = t2.length;\n let s2 = 0;\n for (let i2 = e2 - 1, r2 = 0; r2 < e2; i2 = r2++) s2 += t2[i2].x * t2[r2].y - t2[r2].x * t2[i2].y;\n return 0.5 * s2;\n }\n static isClockWise(t2) {\n return __l.area(t2) < 0;\n }\n static triangulateShape(t2, e2) {\n const s2 = [], i2 = [], r2 = [];\n Al(t2), Tl(s2, t2);\n let n2 = t2.length;\n e2.forEach(Al);\n for (let t3 = 0; t3 < e2.length; t3++) i2.push(n2), n2 += e2[t3].length, Tl(s2, e2[t3]);\n const a2 = Sl.triangulate(s2, i2);\n for (let t3 = 0; t3 < a2.length; t3 += 3) r2.push(a2.slice(t3, t3 + 3));\n return r2;\n }\n };\n function Al(t2) {\n const e2 = t2.length;\n e2 > 2 && t2[e2 - 1].equals(t2[0]) && t2.pop();\n }\n function Tl(t2, e2) {\n for (let s2 = 0; s2 < e2.length; s2++) t2.push(e2[s2].x), t2.push(e2[s2].y);\n }\n var zl = class _zl extends Wn {\n constructor(t2 = new Gh([new _i(0.5, 0.5), new _i(-0.5, 0.5), new _i(-0.5, -0.5), new _i(0.5, -0.5)]), e2 = {}) {\n super(), this.type = \"ExtrudeGeometry\", this.parameters = { shapes: t2, options: e2 }, t2 = Array.isArray(t2) ? t2 : [t2];\n const s2 = this, i2 = [], r2 = [];\n for (let e3 = 0, s3 = t2.length; e3 < s3; e3++) {\n n2(t2[e3]);\n }\n function n2(t3) {\n const n3 = [], a2 = void 0 !== e2.curveSegments ? e2.curveSegments : 12, o2 = void 0 !== e2.steps ? e2.steps : 1, h2 = void 0 !== e2.depth ? e2.depth : 1;\n let l2 = void 0 === e2.bevelEnabled || e2.bevelEnabled, c2 = void 0 !== e2.bevelThickness ? e2.bevelThickness : 0.2, u2 = void 0 !== e2.bevelSize ? e2.bevelSize : c2 - 0.1, d2 = void 0 !== e2.bevelOffset ? e2.bevelOffset : 0, p2 = void 0 !== e2.bevelSegments ? e2.bevelSegments : 3;\n const m2 = e2.extrudePath, y2 = void 0 !== e2.UVGenerator ? e2.UVGenerator : Cl;\n let g2, f2, x2, b2, v2, w2 = false;\n if (m2) {\n g2 = m2.getSpacedPoints(o2), w2 = true, l2 = false;\n const t4 = !!m2.isCatmullRomCurve3 && m2.closed;\n f2 = m2.computeFrenetFrames(o2, t4), x2 = new Ti(), b2 = new Ti(), v2 = new Ti();\n }\n l2 || (p2 = 0, c2 = 0, u2 = 0, d2 = 0);\n const M2 = t3.extractPoints(a2);\n let S2 = M2.shape;\n const _2 = M2.holes;\n if (!_l.isClockWise(S2)) {\n S2 = S2.reverse();\n for (let t4 = 0, e3 = _2.length; t4 < e3; t4++) {\n const e4 = _2[t4];\n _l.isClockWise(e4) && (_2[t4] = e4.reverse());\n }\n }\n function A2(t4) {\n const e3 = 1e-10 * 1e-10;\n let s3 = t4[0];\n for (let i3 = 1; i3 <= t4.length; i3++) {\n const r3 = i3 % t4.length, n4 = t4[r3], a3 = n4.x - s3.x, o3 = n4.y - s3.y, h3 = a3 * a3 + o3 * o3, l3 = Math.max(Math.abs(n4.x), Math.abs(n4.y), Math.abs(s3.x), Math.abs(s3.y));\n h3 <= e3 * l3 * l3 ? (t4.splice(r3, 1), i3--) : s3 = n4;\n }\n }\n A2(S2), _2.forEach(A2);\n const T2 = _2.length, z2 = S2;\n for (let t4 = 0; t4 < T2; t4++) {\n const e3 = _2[t4];\n S2 = S2.concat(e3);\n }\n function C2(t4, e3, s3) {\n return e3 || oi(\"ExtrudeGeometry: vec does not exist\"), t4.clone().addScaledVector(e3, s3);\n }\n const I2 = S2.length;\n function B2(t4, e3, s3) {\n let i3, r3, n4;\n const a3 = t4.x - e3.x, o3 = t4.y - e3.y, h3 = s3.x - t4.x, l3 = s3.y - t4.y, c3 = a3 * a3 + o3 * o3, u3 = a3 * l3 - o3 * h3;\n if (Math.abs(u3) > Number.EPSILON) {\n const u4 = Math.sqrt(c3), d3 = Math.sqrt(h3 * h3 + l3 * l3), p3 = e3.x - o3 / u4, m3 = e3.y + a3 / u4, y3 = ((s3.x - l3 / d3 - p3) * l3 - (s3.y + h3 / d3 - m3) * h3) / (a3 * l3 - o3 * h3);\n i3 = p3 + a3 * y3 - t4.x, r3 = m3 + o3 * y3 - t4.y;\n const g3 = i3 * i3 + r3 * r3;\n if (g3 <= 2) return new _i(i3, r3);\n n4 = Math.sqrt(g3 / 2);\n } else {\n let t5 = false;\n a3 > Number.EPSILON ? h3 > Number.EPSILON && (t5 = true) : a3 < -Number.EPSILON ? h3 < -Number.EPSILON && (t5 = true) : Math.sign(o3) === Math.sign(l3) && (t5 = true), t5 ? (i3 = -o3, r3 = a3, n4 = Math.sqrt(c3)) : (i3 = a3, r3 = o3, n4 = Math.sqrt(c3 / 2));\n }\n return new _i(i3 / n4, r3 / n4);\n }\n const k2 = [];\n for (let t4 = 0, e3 = z2.length, s3 = e3 - 1, i3 = t4 + 1; t4 < e3; t4++, s3++, i3++)\n s3 === e3 && (s3 = 0), i3 === e3 && (i3 = 0), k2[t4] = B2(z2[t4], z2[s3], z2[i3]);\n const O2 = [];\n let P2, R2, E2 = k2.concat();\n for (let t4 = 0, e3 = T2; t4 < e3; t4++) {\n const e4 = _2[t4];\n P2 = [];\n for (let t5 = 0, s3 = e4.length, i3 = s3 - 1, r3 = t5 + 1; t5 < s3; t5++, i3++, r3++)\n i3 === s3 && (i3 = 0), r3 === s3 && (r3 = 0), P2[t5] = B2(e4[t5], e4[i3], e4[r3]);\n O2.push(P2), E2 = E2.concat(P2);\n }\n if (0 === p2) R2 = _l.triangulateShape(z2, _2);\n else {\n const t4 = [], e3 = [];\n for (let s3 = 0; s3 < p2; s3++) {\n const i3 = s3 / p2, r3 = c2 * Math.cos(i3 * Math.PI / 2), n4 = u2 * Math.sin(i3 * Math.PI / 2) + d2;\n for (let e4 = 0, s4 = z2.length; e4 < s4; e4++) {\n const s5 = C2(z2[e4], k2[e4], n4);\n F2(s5.x, s5.y, -r3), 0 === i3 && t4.push(s5);\n }\n for (let t5 = 0, s4 = T2; t5 < s4; t5++) {\n const s5 = _2[t5];\n P2 = O2[t5];\n const a3 = [];\n for (let t6 = 0, e4 = s5.length; t6 < e4; t6++) {\n const e5 = C2(s5[t6], P2[t6], n4);\n F2(e5.x, e5.y, -r3), 0 === i3 && a3.push(e5);\n }\n 0 === i3 && e3.push(a3);\n }\n }\n R2 = _l.triangulateShape(t4, e3);\n }\n const N2 = R2.length, V2 = u2 + d2;\n for (let t4 = 0; t4 < I2; t4++) {\n const e3 = l2 ? C2(S2[t4], E2[t4], V2) : S2[t4];\n w2 ? (b2.copy(f2.normals[0]).multiplyScalar(e3.x), x2.copy(f2.binormals[0]).multiplyScalar(e3.y), v2.copy(g2[0]).add(b2).add(x2), F2(v2.x, v2.y, v2.z)) : F2(e3.x, e3.y, 0);\n }\n for (let t4 = 1; t4 <= o2; t4++)\n for (let e3 = 0; e3 < I2; e3++) {\n const s3 = l2 ? C2(S2[e3], E2[e3], V2) : S2[e3];\n w2 ? (b2.copy(f2.normals[t4]).multiplyScalar(s3.x), x2.copy(f2.binormals[t4]).multiplyScalar(s3.y), v2.copy(g2[t4]).add(b2).add(x2), F2(v2.x, v2.y, v2.z)) : F2(s3.x, s3.y, h2 / o2 * t4);\n }\n for (let t4 = p2 - 1; t4 >= 0; t4--) {\n const e3 = t4 / p2, s3 = c2 * Math.cos(e3 * Math.PI / 2), i3 = u2 * Math.sin(e3 * Math.PI / 2) + d2;\n for (let t5 = 0, e4 = z2.length; t5 < e4; t5++) {\n const e5 = C2(z2[t5], k2[t5], i3);\n F2(e5.x, e5.y, h2 + s3);\n }\n for (let t5 = 0, e4 = _2.length; t5 < e4; t5++) {\n const e5 = _2[t5];\n P2 = O2[t5];\n for (let t6 = 0, r3 = e5.length; t6 < r3; t6++) {\n const r4 = C2(e5[t6], P2[t6], i3);\n w2 ? F2(r4.x, r4.y + g2[o2 - 1].y, g2[o2 - 1].x + s3) : F2(r4.x, r4.y, h2 + s3);\n }\n }\n }\n function L2(t4, e3) {\n let s3 = t4.length;\n for (; --s3 >= 0; ) {\n const i3 = s3;\n let r3 = s3 - 1;\n r3 < 0 && (r3 = t4.length - 1);\n for (let t5 = 0, s4 = o2 + 2 * p2; t5 < s4; t5++) {\n const s5 = I2 * t5, n4 = I2 * (t5 + 1);\n U2(e3 + i3 + s5, e3 + r3 + s5, e3 + r3 + n4, e3 + i3 + n4);\n }\n }\n }\n function F2(t4, e3, s3) {\n n3.push(t4), n3.push(e3), n3.push(s3);\n }\n function D2(t4, e3, r3) {\n j2(t4), j2(e3), j2(r3);\n const n4 = i2.length / 3, a3 = y2.generateTopUV(s2, i2, n4 - 3, n4 - 2, n4 - 1);\n W2(a3[0]), W2(a3[1]), W2(a3[2]);\n }\n function U2(t4, e3, r3, n4) {\n j2(t4), j2(e3), j2(n4), j2(e3), j2(r3), j2(n4);\n const a3 = i2.length / 3, o3 = y2.generateSideWallUV(s2, i2, a3 - 6, a3 - 3, a3 - 2, a3 - 1);\n W2(o3[0]), W2(o3[1]), W2(o3[3]), W2(o3[1]), W2(o3[2]), W2(o3[3]);\n }\n function j2(t4) {\n i2.push(n3[3 * t4 + 0]), i2.push(n3[3 * t4 + 1]), i2.push(n3[3 * t4 + 2]);\n }\n function W2(t4) {\n r2.push(t4.x), r2.push(t4.y);\n }\n !(function() {\n const t4 = i2.length / 3;\n if (l2) {\n let t5 = 0, e3 = I2 * t5;\n for (let t6 = 0; t6 < N2; t6++) {\n const s3 = R2[t6];\n D2(s3[2] + e3, s3[1] + e3, s3[0] + e3);\n }\n t5 = o2 + 2 * p2, e3 = I2 * t5;\n for (let t6 = 0; t6 < N2; t6++) {\n const s3 = R2[t6];\n D2(s3[0] + e3, s3[1] + e3, s3[2] + e3);\n }\n } else {\n for (let t5 = 0; t5 < N2; t5++) {\n const e3 = R2[t5];\n D2(e3[2], e3[1], e3[0]);\n }\n for (let t5 = 0; t5 < N2; t5++) {\n const e3 = R2[t5];\n D2(e3[0] + I2 * o2, e3[1] + I2 * o2, e3[2] + I2 * o2);\n }\n }\n s2.addGroup(t4, i2.length / 3 - t4, 0);\n })(), (function() {\n const t4 = i2.length / 3;\n let e3 = 0;\n L2(z2, e3), e3 += z2.length;\n for (let t5 = 0, s3 = _2.length; t5 < s3; t5++) {\n const s4 = _2[t5];\n L2(s4, e3), e3 += s4.length;\n }\n s2.addGroup(t4, i2.length / 3 - t4, 1);\n })();\n }\n this.setAttribute(\"position\", new kn(i2, 3)), this.setAttribute(\"uv\", new kn(r2, 2)), this.computeVertexNormals();\n }\n copy(t2) {\n return super.copy(t2), this.parameters = Object.assign({}, t2.parameters), this;\n }\n toJSON() {\n const t2 = super.toJSON();\n return (function(t3, e2, s2) {\n if (s2.shapes = [], Array.isArray(t3))\n for (let e3 = 0, i2 = t3.length; e3 < i2; e3++) {\n const i3 = t3[e3];\n s2.shapes.push(i3.uuid);\n }\n else s2.shapes.push(t3.uuid);\n s2.options = Object.assign({}, e2), void 0 !== e2.extrudePath && (s2.options.extrudePath = e2.extrudePath.toJSON());\n return s2;\n })(this.parameters.shapes, this.parameters.options, t2);\n }\n static fromJSON(t2, e2) {\n const s2 = [];\n for (let i3 = 0, r2 = t2.shapes.length; i3 < r2; i3++) {\n const r3 = e2[t2.shapes[i3]];\n s2.push(r3);\n }\n const i2 = t2.options.extrudePath;\n return void 0 !== i2 && (t2.options.extrudePath = new Xh[i2.type]().fromJSON(i2)), new _zl(s2, t2.options);\n }\n };\n var Cl = {\n generateTopUV: function(t2, e2, s2, i2, r2) {\n const n2 = e2[3 * s2], a2 = e2[3 * s2 + 1], o2 = e2[3 * i2], h2 = e2[3 * i2 + 1], l2 = e2[3 * r2], c2 = e2[3 * r2 + 1];\n return [new _i(n2, a2), new _i(o2, h2), new _i(l2, c2)];\n },\n generateSideWallUV: function(t2, e2, s2, i2, r2, n2) {\n const a2 = e2[3 * s2], o2 = e2[3 * s2 + 1], h2 = e2[3 * s2 + 2], l2 = e2[3 * i2], c2 = e2[3 * i2 + 1], u2 = e2[3 * i2 + 2], d2 = e2[3 * r2], p2 = e2[3 * r2 + 1], m2 = e2[3 * r2 + 2], y2 = e2[3 * n2], g2 = e2[3 * n2 + 1], f2 = e2[3 * n2 + 2];\n return Math.abs(o2 - c2) < Math.abs(a2 - l2) ? [new _i(a2, 1 - h2), new _i(l2, 1 - u2), new _i(d2, 1 - m2), new _i(y2, 1 - f2)] : [new _i(o2, 1 - h2), new _i(c2, 1 - u2), new _i(p2, 1 - m2), new _i(g2, 1 - f2)];\n }\n };\n var Il = class _Il extends vh {\n constructor(t2 = 1, e2 = 0) {\n const s2 = (1 + Math.sqrt(5)) / 2;\n super(\n [\n -1,\n s2,\n 0,\n 1,\n s2,\n 0,\n -1,\n -s2,\n 0,\n 1,\n -s2,\n 0,\n 0,\n -1,\n s2,\n 0,\n 1,\n s2,\n 0,\n -1,\n -s2,\n 0,\n 1,\n -s2,\n s2,\n 0,\n -1,\n s2,\n 0,\n 1,\n -s2,\n 0,\n -1,\n -s2,\n 0,\n 1\n ],\n [\n 0,\n 11,\n 5,\n 0,\n 5,\n 1,\n 0,\n 1,\n 7,\n 0,\n 7,\n 10,\n 0,\n 10,\n 11,\n 1,\n 5,\n 9,\n 5,\n 11,\n 4,\n 11,\n 10,\n 2,\n 10,\n 7,\n 6,\n 7,\n 1,\n 8,\n 3,\n 9,\n 4,\n 3,\n 4,\n 2,\n 3,\n 2,\n 6,\n 3,\n 6,\n 8,\n 3,\n 8,\n 9,\n 4,\n 9,\n 5,\n 2,\n 4,\n 11,\n 6,\n 2,\n 10,\n 8,\n 6,\n 7,\n 9,\n 8,\n 1\n ],\n t2,\n e2\n ), this.type = \"IcosahedronGeometry\", this.parameters = { radius: t2, detail: e2 };\n }\n static fromJSON(t2) {\n return new _Il(t2.radius, t2.detail);\n }\n };\n var Bl = class _Bl extends Wn {\n constructor(t2 = [new _i(0, -0.5), new _i(0.5, 0), new _i(0, 0.5)], e2 = 12, s2 = 0, i2 = 2 * Math.PI) {\n super(), this.type = \"LatheGeometry\", this.parameters = { points: t2, segments: e2, phiStart: s2, phiLength: i2 }, e2 = Math.floor(e2), i2 = xi(i2, 0, 2 * Math.PI);\n const r2 = [], n2 = [], a2 = [], o2 = [], h2 = [], l2 = 1 / e2, c2 = new Ti(), u2 = new _i(), d2 = new Ti(), p2 = new Ti(), m2 = new Ti();\n let y2 = 0, g2 = 0;\n for (let e3 = 0; e3 <= t2.length - 1; e3++)\n switch (e3) {\n case 0:\n y2 = t2[e3 + 1].x - t2[e3].x, g2 = t2[e3 + 1].y - t2[e3].y, d2.x = 1 * g2, d2.y = -y2, d2.z = 0 * g2, m2.copy(d2), d2.normalize(), o2.push(d2.x, d2.y, d2.z);\n break;\n case t2.length - 1:\n o2.push(m2.x, m2.y, m2.z);\n break;\n default:\n y2 = t2[e3 + 1].x - t2[e3].x, g2 = t2[e3 + 1].y - t2[e3].y, d2.x = 1 * g2, d2.y = -y2, d2.z = 0 * g2, p2.copy(d2), d2.x += m2.x, d2.y += m2.y, d2.z += m2.z, d2.normalize(), o2.push(d2.x, d2.y, d2.z), m2.copy(p2);\n }\n for (let r3 = 0; r3 <= e2; r3++) {\n const d3 = s2 + r3 * l2 * i2, p3 = Math.sin(d3), m3 = Math.cos(d3);\n for (let s3 = 0; s3 <= t2.length - 1; s3++) {\n c2.x = t2[s3].x * p3, c2.y = t2[s3].y, c2.z = t2[s3].x * m3, n2.push(c2.x, c2.y, c2.z), u2.x = r3 / e2, u2.y = s3 / (t2.length - 1), a2.push(u2.x, u2.y);\n const i3 = o2[3 * s3 + 0] * p3, l3 = o2[3 * s3 + 1], d4 = o2[3 * s3 + 0] * m3;\n h2.push(i3, l3, d4);\n }\n }\n for (let s3 = 0; s3 < e2; s3++)\n for (let e3 = 0; e3 < t2.length - 1; e3++) {\n const i3 = e3 + s3 * t2.length, n3 = i3, a3 = i3 + t2.length, o3 = i3 + t2.length + 1, h3 = i3 + 1;\n r2.push(n3, a3, h3), r2.push(o3, h3, a3);\n }\n this.setIndex(r2), this.setAttribute(\"position\", new kn(n2, 3)), this.setAttribute(\"uv\", new kn(a2, 2)), this.setAttribute(\"normal\", new kn(h2, 3));\n }\n copy(t2) {\n return super.copy(t2), this.parameters = Object.assign({}, t2.parameters), this;\n }\n static fromJSON(t2) {\n return new _Bl(t2.points, t2.segments, t2.phiStart, t2.phiLength);\n }\n };\n var kl = class _kl extends vh {\n constructor(t2 = 1, e2 = 0) {\n super(\n [1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1],\n [0, 2, 4, 0, 4, 3, 0, 3, 5, 0, 5, 2, 1, 2, 5, 1, 5, 3, 1, 3, 4, 1, 4, 2],\n t2,\n e2\n ), this.type = \"OctahedronGeometry\", this.parameters = { radius: t2, detail: e2 };\n }\n static fromJSON(t2) {\n return new _kl(t2.radius, t2.detail);\n }\n };\n var Ol = class _Ol extends Wn {\n constructor(t2 = 1, e2 = 1, s2 = 1, i2 = 1) {\n super(), this.type = \"PlaneGeometry\", this.parameters = { width: t2, height: e2, widthSegments: s2, heightSegments: i2 };\n const r2 = t2 / 2, n2 = e2 / 2, a2 = Math.floor(s2), o2 = Math.floor(i2), h2 = a2 + 1, l2 = o2 + 1, c2 = t2 / a2, u2 = e2 / o2, d2 = [], p2 = [], m2 = [], y2 = [];\n for (let t3 = 0; t3 < l2; t3++) {\n const e3 = t3 * u2 - n2;\n for (let s3 = 0; s3 < h2; s3++) {\n const i3 = s3 * c2 - r2;\n p2.push(i3, -e3, 0), m2.push(0, 0, 1), y2.push(s3 / a2), y2.push(1 - t3 / o2);\n }\n }\n for (let t3 = 0; t3 < o2; t3++)\n for (let e3 = 0; e3 < a2; e3++) {\n const s3 = e3 + h2 * t3, i3 = e3 + h2 * (t3 + 1), r3 = e3 + 1 + h2 * (t3 + 1), n3 = e3 + 1 + h2 * t3;\n d2.push(s3, i3, n3), d2.push(i3, r3, n3);\n }\n this.setIndex(d2), this.setAttribute(\"position\", new kn(p2, 3)), this.setAttribute(\"normal\", new kn(m2, 3)), this.setAttribute(\"uv\", new kn(y2, 2));\n }\n copy(t2) {\n return super.copy(t2), this.parameters = Object.assign({}, t2.parameters), this;\n }\n static fromJSON(t2) {\n return new _Ol(t2.width, t2.height, t2.widthSegments, t2.heightSegments);\n }\n };\n var Pl = class _Pl extends Wn {\n constructor(t2 = 0.5, e2 = 1, s2 = 32, i2 = 1, r2 = 0, n2 = 2 * Math.PI) {\n super(), this.type = \"RingGeometry\", this.parameters = {\n innerRadius: t2,\n outerRadius: e2,\n thetaSegments: s2,\n phiSegments: i2,\n thetaStart: r2,\n thetaLength: n2\n }, s2 = Math.max(3, s2);\n const a2 = [], o2 = [], h2 = [], l2 = [];\n let c2 = t2;\n const u2 = (e2 - t2) / (i2 = Math.max(1, i2)), d2 = new Ti(), p2 = new _i();\n for (let t3 = 0; t3 <= i2; t3++) {\n for (let t4 = 0; t4 <= s2; t4++) {\n const i3 = r2 + t4 / s2 * n2;\n d2.x = c2 * Math.cos(i3), d2.y = c2 * Math.sin(i3), o2.push(d2.x, d2.y, d2.z), h2.push(0, 0, 1), p2.x = (d2.x / e2 + 1) / 2, p2.y = (d2.y / e2 + 1) / 2, l2.push(p2.x, p2.y);\n }\n c2 += u2;\n }\n for (let t3 = 0; t3 < i2; t3++) {\n const e3 = t3 * (s2 + 1);\n for (let t4 = 0; t4 < s2; t4++) {\n const i3 = t4 + e3, r3 = i3, n3 = i3 + s2 + 1, o3 = i3 + s2 + 2, h3 = i3 + 1;\n a2.push(r3, n3, h3), a2.push(n3, o3, h3);\n }\n }\n this.setIndex(a2), this.setAttribute(\"position\", new kn(o2, 3)), this.setAttribute(\"normal\", new kn(h2, 3)), this.setAttribute(\"uv\", new kn(l2, 2));\n }\n copy(t2) {\n return super.copy(t2), this.parameters = Object.assign({}, t2.parameters), this;\n }\n static fromJSON(t2) {\n return new _Pl(\n t2.innerRadius,\n t2.outerRadius,\n t2.thetaSegments,\n t2.phiSegments,\n t2.thetaStart,\n t2.thetaLength\n );\n }\n };\n var Rl = class _Rl extends Wn {\n constructor(t2 = new Gh([new _i(0, 0.5), new _i(-0.5, -0.5), new _i(0.5, -0.5)]), e2 = 12) {\n super(), this.type = \"ShapeGeometry\", this.parameters = { shapes: t2, curveSegments: e2 };\n const s2 = [], i2 = [], r2 = [], n2 = [];\n let a2 = 0, o2 = 0;\n if (false === Array.isArray(t2)) h2(t2);\n else for (let e3 = 0; e3 < t2.length; e3++) h2(t2[e3]), this.addGroup(a2, o2, e3), a2 += o2, o2 = 0;\n function h2(t3) {\n const a3 = i2.length / 3, h3 = t3.extractPoints(e2);\n let l2 = h3.shape;\n const c2 = h3.holes;\n false === _l.isClockWise(l2) && (l2 = l2.reverse());\n for (let t4 = 0, e3 = c2.length; t4 < e3; t4++) {\n const e4 = c2[t4];\n true === _l.isClockWise(e4) && (c2[t4] = e4.reverse());\n }\n const u2 = _l.triangulateShape(l2, c2);\n for (let t4 = 0, e3 = c2.length; t4 < e3; t4++) {\n const e4 = c2[t4];\n l2 = l2.concat(e4);\n }\n for (let t4 = 0, e3 = l2.length; t4 < e3; t4++) {\n const e4 = l2[t4];\n i2.push(e4.x, e4.y, 0), r2.push(0, 0, 1), n2.push(e4.x, e4.y);\n }\n for (let t4 = 0, e3 = u2.length; t4 < e3; t4++) {\n const e4 = u2[t4], i3 = e4[0] + a3, r3 = e4[1] + a3, n3 = e4[2] + a3;\n s2.push(i3, r3, n3), o2 += 3;\n }\n }\n this.setIndex(s2), this.setAttribute(\"position\", new kn(i2, 3)), this.setAttribute(\"normal\", new kn(r2, 3)), this.setAttribute(\"uv\", new kn(n2, 2));\n }\n copy(t2) {\n return super.copy(t2), this.parameters = Object.assign({}, t2.parameters), this;\n }\n toJSON() {\n const t2 = super.toJSON();\n return (function(t3, e2) {\n if (e2.shapes = [], Array.isArray(t3))\n for (let s2 = 0, i2 = t3.length; s2 < i2; s2++) {\n const i3 = t3[s2];\n e2.shapes.push(i3.uuid);\n }\n else e2.shapes.push(t3.uuid);\n return e2;\n })(this.parameters.shapes, t2);\n }\n static fromJSON(t2, e2) {\n const s2 = [];\n for (let i2 = 0, r2 = t2.shapes.length; i2 < r2; i2++) {\n const r3 = e2[t2.shapes[i2]];\n s2.push(r3);\n }\n return new _Rl(s2, t2.curveSegments);\n }\n };\n var El = class _El extends Wn {\n constructor(t2 = 1, e2 = 32, s2 = 16, i2 = 0, r2 = 2 * Math.PI, n2 = 0, a2 = Math.PI) {\n super(), this.type = \"SphereGeometry\", this.parameters = {\n radius: t2,\n widthSegments: e2,\n heightSegments: s2,\n phiStart: i2,\n phiLength: r2,\n thetaStart: n2,\n thetaLength: a2\n }, e2 = Math.max(3, Math.floor(e2)), s2 = Math.max(2, Math.floor(s2));\n const o2 = Math.min(n2 + a2, Math.PI);\n let h2 = 0;\n const l2 = [], c2 = new Ti(), u2 = new Ti(), d2 = [], p2 = [], m2 = [], y2 = [];\n for (let d3 = 0; d3 <= s2; d3++) {\n const g2 = [], f2 = d3 / s2, x2 = n2 + f2 * a2, b2 = t2 * Math.cos(x2), v2 = Math.sqrt(t2 * t2 - b2 * b2);\n let w2 = 0;\n 0 === d3 && 0 === n2 ? w2 = 0.5 / e2 : d3 === s2 && o2 === Math.PI && (w2 = -0.5 / e2);\n for (let t3 = 0; t3 <= e2; t3++) {\n const s3 = t3 / e2, n3 = i2 + s3 * r2;\n c2.x = -v2 * Math.cos(n3), c2.y = b2, c2.z = v2 * Math.sin(n3), p2.push(c2.x, c2.y, c2.z), u2.copy(c2).normalize(), m2.push(u2.x, u2.y, u2.z), y2.push(s3 + w2, 1 - f2), g2.push(h2++);\n }\n l2.push(g2);\n }\n for (let t3 = 0; t3 < s2; t3++)\n for (let i3 = 0; i3 < e2; i3++) {\n const e3 = l2[t3][i3 + 1], r3 = l2[t3][i3], a3 = l2[t3 + 1][i3], h3 = l2[t3 + 1][i3 + 1];\n (0 !== t3 || n2 > 0) && d2.push(e3, r3, h3), (t3 !== s2 - 1 || o2 < Math.PI) && d2.push(r3, a3, h3);\n }\n this.setIndex(d2), this.setAttribute(\"position\", new kn(p2, 3)), this.setAttribute(\"normal\", new kn(m2, 3)), this.setAttribute(\"uv\", new kn(y2, 2));\n }\n copy(t2) {\n return super.copy(t2), this.parameters = Object.assign({}, t2.parameters), this;\n }\n static fromJSON(t2) {\n return new _El(\n t2.radius,\n t2.widthSegments,\n t2.heightSegments,\n t2.phiStart,\n t2.phiLength,\n t2.thetaStart,\n t2.thetaLength\n );\n }\n };\n var Nl = class _Nl extends vh {\n constructor(t2 = 1, e2 = 0) {\n super([1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1], [2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1], t2, e2), this.type = \"TetrahedronGeometry\", this.parameters = { radius: t2, detail: e2 };\n }\n static fromJSON(t2) {\n return new _Nl(t2.radius, t2.detail);\n }\n };\n var Vl = class _Vl extends Wn {\n constructor(t2 = 1, e2 = 0.4, s2 = 12, i2 = 48, r2 = 2 * Math.PI, n2 = 0, a2 = 2 * Math.PI) {\n super(), this.type = \"TorusGeometry\", this.parameters = {\n radius: t2,\n tube: e2,\n radialSegments: s2,\n tubularSegments: i2,\n arc: r2,\n thetaStart: n2,\n thetaLength: a2\n }, s2 = Math.floor(s2), i2 = Math.floor(i2);\n const o2 = [], h2 = [], l2 = [], c2 = [], u2 = new Ti(), d2 = new Ti(), p2 = new Ti();\n for (let o3 = 0; o3 <= s2; o3++) {\n const m2 = n2 + o3 / s2 * a2;\n for (let n3 = 0; n3 <= i2; n3++) {\n const a3 = n3 / i2 * r2;\n d2.x = (t2 + e2 * Math.cos(m2)) * Math.cos(a3), d2.y = (t2 + e2 * Math.cos(m2)) * Math.sin(a3), d2.z = e2 * Math.sin(m2), h2.push(d2.x, d2.y, d2.z), u2.x = t2 * Math.cos(a3), u2.y = t2 * Math.sin(a3), p2.subVectors(d2, u2).normalize(), l2.push(p2.x, p2.y, p2.z), c2.push(n3 / i2), c2.push(o3 / s2);\n }\n }\n for (let t3 = 1; t3 <= s2; t3++)\n for (let e3 = 1; e3 <= i2; e3++) {\n const s3 = (i2 + 1) * t3 + e3 - 1, r3 = (i2 + 1) * (t3 - 1) + e3 - 1, n3 = (i2 + 1) * (t3 - 1) + e3, a3 = (i2 + 1) * t3 + e3;\n o2.push(s3, r3, a3), o2.push(r3, n3, a3);\n }\n this.setIndex(o2), this.setAttribute(\"position\", new kn(h2, 3)), this.setAttribute(\"normal\", new kn(l2, 3)), this.setAttribute(\"uv\", new kn(c2, 2));\n }\n copy(t2) {\n return super.copy(t2), this.parameters = Object.assign({}, t2.parameters), this;\n }\n static fromJSON(t2) {\n return new _Vl(t2.radius, t2.tube, t2.radialSegments, t2.tubularSegments, t2.arc);\n }\n };\n var Ll = class _Ll extends Wn {\n constructor(t2 = 1, e2 = 0.4, s2 = 64, i2 = 8, r2 = 2, n2 = 3) {\n super(), this.type = \"TorusKnotGeometry\", this.parameters = { radius: t2, tube: e2, tubularSegments: s2, radialSegments: i2, p: r2, q: n2 }, s2 = Math.floor(s2), i2 = Math.floor(i2);\n const a2 = [], o2 = [], h2 = [], l2 = [], c2 = new Ti(), u2 = new Ti(), d2 = new Ti(), p2 = new Ti(), m2 = new Ti(), y2 = new Ti(), g2 = new Ti();\n for (let a3 = 0; a3 <= s2; ++a3) {\n const x2 = a3 / s2 * r2 * Math.PI * 2;\n f2(x2, r2, n2, t2, d2), f2(x2 + 0.01, r2, n2, t2, p2), y2.subVectors(p2, d2), g2.addVectors(p2, d2), m2.crossVectors(y2, g2), g2.crossVectors(m2, y2), m2.normalize(), g2.normalize();\n for (let t3 = 0; t3 <= i2; ++t3) {\n const r3 = t3 / i2 * Math.PI * 2, n3 = -e2 * Math.cos(r3), p3 = e2 * Math.sin(r3);\n c2.x = d2.x + (n3 * g2.x + p3 * m2.x), c2.y = d2.y + (n3 * g2.y + p3 * m2.y), c2.z = d2.z + (n3 * g2.z + p3 * m2.z), o2.push(c2.x, c2.y, c2.z), u2.subVectors(c2, d2).normalize(), h2.push(u2.x, u2.y, u2.z), l2.push(a3 / s2), l2.push(t3 / i2);\n }\n }\n for (let t3 = 1; t3 <= s2; t3++)\n for (let e3 = 1; e3 <= i2; e3++) {\n const s3 = (i2 + 1) * (t3 - 1) + (e3 - 1), r3 = (i2 + 1) * t3 + (e3 - 1), n3 = (i2 + 1) * t3 + e3, o3 = (i2 + 1) * (t3 - 1) + e3;\n a2.push(s3, r3, o3), a2.push(r3, n3, o3);\n }\n function f2(t3, e3, s3, i3, r3) {\n const n3 = Math.cos(t3), a3 = Math.sin(t3), o3 = s3 / e3 * t3, h3 = Math.cos(o3);\n r3.x = i3 * (2 + h3) * 0.5 * n3, r3.y = i3 * (2 + h3) * a3 * 0.5, r3.z = i3 * Math.sin(o3) * 0.5;\n }\n this.setIndex(a2), this.setAttribute(\"position\", new kn(o2, 3)), this.setAttribute(\"normal\", new kn(h2, 3)), this.setAttribute(\"uv\", new kn(l2, 2));\n }\n copy(t2) {\n return super.copy(t2), this.parameters = Object.assign({}, t2.parameters), this;\n }\n static fromJSON(t2) {\n return new _Ll(t2.radius, t2.tube, t2.tubularSegments, t2.radialSegments, t2.p, t2.q);\n }\n };\n var Fl = class _Fl extends Wn {\n constructor(t2 = new qh(new Ti(-1, -1, 0), new Ti(-1, 1, 0), new Ti(1, 1, 0)), e2 = 64, s2 = 1, i2 = 8, r2 = false) {\n super(), this.type = \"TubeGeometry\", this.parameters = { path: t2, tubularSegments: e2, radius: s2, radialSegments: i2, closed: r2 };\n const n2 = t2.computeFrenetFrames(e2, r2);\n this.tangents = n2.tangents, this.normals = n2.normals, this.binormals = n2.binormals;\n const a2 = new Ti(), o2 = new Ti(), h2 = new _i();\n let l2 = new Ti();\n const c2 = [], u2 = [], d2 = [], p2 = [];\n function m2(r3) {\n l2 = t2.getPointAt(r3 / e2, l2);\n const h3 = n2.normals[r3], d3 = n2.binormals[r3];\n for (let t3 = 0; t3 <= i2; t3++) {\n const e3 = t3 / i2 * Math.PI * 2, r4 = Math.sin(e3), n3 = -Math.cos(e3);\n o2.x = n3 * h3.x + r4 * d3.x, o2.y = n3 * h3.y + r4 * d3.y, o2.z = n3 * h3.z + r4 * d3.z, o2.normalize(), u2.push(o2.x, o2.y, o2.z), a2.x = l2.x + s2 * o2.x, a2.y = l2.y + s2 * o2.y, a2.z = l2.z + s2 * o2.z, c2.push(a2.x, a2.y, a2.z);\n }\n }\n !(function() {\n for (let t3 = 0; t3 < e2; t3++) m2(t3);\n m2(false === r2 ? e2 : 0), (function() {\n for (let t3 = 0; t3 <= e2; t3++)\n for (let s3 = 0; s3 <= i2; s3++) h2.x = t3 / e2, h2.y = s3 / i2, d2.push(h2.x, h2.y);\n })(), (function() {\n for (let t3 = 1; t3 <= e2; t3++)\n for (let e3 = 1; e3 <= i2; e3++) {\n const s3 = (i2 + 1) * (t3 - 1) + (e3 - 1), r3 = (i2 + 1) * t3 + (e3 - 1), n3 = (i2 + 1) * t3 + e3, a3 = (i2 + 1) * (t3 - 1) + e3;\n p2.push(s3, r3, a3), p2.push(r3, n3, a3);\n }\n })();\n })(), this.setIndex(p2), this.setAttribute(\"position\", new kn(c2, 3)), this.setAttribute(\"normal\", new kn(u2, 3)), this.setAttribute(\"uv\", new kn(d2, 2));\n }\n copy(t2) {\n return super.copy(t2), this.parameters = Object.assign({}, t2.parameters), this;\n }\n toJSON() {\n const t2 = super.toJSON();\n return t2.path = this.parameters.path.toJSON(), t2;\n }\n static fromJSON(t2) {\n return new _Fl(\n new Xh[t2.path.type]().fromJSON(t2.path),\n t2.tubularSegments,\n t2.radius,\n t2.radialSegments,\n t2.closed\n );\n }\n };\n var Dl = class extends Wn {\n constructor(t2 = null) {\n if (super(), this.type = \"WireframeGeometry\", this.parameters = { geometry: t2 }, null !== t2) {\n const e2 = [], s2 = /* @__PURE__ */ new Set(), i2 = new Ti(), r2 = new Ti();\n if (null !== t2.index) {\n const n2 = t2.attributes.position, a2 = t2.index;\n let o2 = t2.groups;\n 0 === o2.length && (o2 = [{ start: 0, count: a2.count, materialIndex: 0 }]);\n for (let t3 = 0, h2 = o2.length; t3 < h2; ++t3) {\n const h3 = o2[t3], l2 = h3.start;\n for (let t4 = l2, o3 = l2 + h3.count; t4 < o3; t4 += 3)\n for (let o4 = 0; o4 < 3; o4++) {\n const h4 = a2.getX(t4 + o4), l3 = a2.getX(t4 + (o4 + 1) % 3);\n i2.fromBufferAttribute(n2, h4), r2.fromBufferAttribute(n2, l3), true === Ul(i2, r2, s2) && (e2.push(i2.x, i2.y, i2.z), e2.push(r2.x, r2.y, r2.z));\n }\n }\n } else {\n const n2 = t2.attributes.position;\n for (let t3 = 0, a2 = n2.count / 3; t3 < a2; t3++)\n for (let a3 = 0; a3 < 3; a3++) {\n const o2 = 3 * t3 + a3, h2 = 3 * t3 + (a3 + 1) % 3;\n i2.fromBufferAttribute(n2, o2), r2.fromBufferAttribute(n2, h2), true === Ul(i2, r2, s2) && (e2.push(i2.x, i2.y, i2.z), e2.push(r2.x, r2.y, r2.z));\n }\n }\n this.setAttribute(\"position\", new kn(e2, 3));\n }\n }\n copy(t2) {\n return super.copy(t2), this.parameters = Object.assign({}, t2.parameters), this;\n }\n };\n function Ul(t2, e2, s2) {\n const i2 = `${t2.x},${t2.y},${t2.z}-${e2.x},${e2.y},${e2.z}`, r2 = `${e2.x},${e2.y},${e2.z}-${t2.x},${t2.y},${t2.z}`;\n return true !== s2.has(i2) && true !== s2.has(r2) && (s2.add(i2), s2.add(r2), true);\n }\n var jl = Object.freeze({\n __proto__: null,\n BoxGeometry: yh,\n CapsuleGeometry: gh,\n CircleGeometry: fh,\n ConeGeometry: bh,\n CylinderGeometry: xh,\n DodecahedronGeometry: wh,\n EdgesGeometry: Th,\n ExtrudeGeometry: zl,\n IcosahedronGeometry: Il,\n LatheGeometry: Bl,\n OctahedronGeometry: kl,\n PlaneGeometry: Ol,\n PolyhedronGeometry: vh,\n RingGeometry: Pl,\n ShapeGeometry: Rl,\n SphereGeometry: El,\n TetrahedronGeometry: Nl,\n TorusGeometry: Vl,\n TorusKnotGeometry: Ll,\n TubeGeometry: Fl,\n WireframeGeometry: Dl\n });\n var Wl = class extends Zn {\n constructor(t2) {\n super(), this.isShadowMaterial = true, this.type = \"ShadowMaterial\", this.color = new Pr(0), this.transparent = true, this.fog = true, this.setValues(t2);\n }\n copy(t2) {\n return super.copy(t2), this.color.copy(t2.color), this.fog = t2.fog, this;\n }\n };\n function Jl(t2) {\n const e2 = {};\n for (const s2 in t2) {\n e2[s2] = {};\n for (const i2 in t2[s2]) {\n const r2 = t2[s2][i2];\n if (Hl(r2))\n r2.isRenderTargetTexture ? (ai(\n \"UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms().\"\n ), e2[s2][i2] = null) : e2[s2][i2] = r2.clone();\n else if (Array.isArray(r2))\n if (Hl(r2[0])) {\n const t3 = [];\n for (let e3 = 0, s3 = r2.length; e3 < s3; e3++) t3[e3] = r2[e3].clone();\n e2[s2][i2] = t3;\n } else e2[s2][i2] = r2.slice();\n else e2[s2][i2] = r2;\n }\n }\n return e2;\n }\n function ql(t2) {\n const e2 = {};\n for (let s2 = 0; s2 < t2.length; s2++) {\n const i2 = Jl(t2[s2]);\n for (const t3 in i2) e2[t3] = i2[t3];\n }\n return e2;\n }\n function Hl(t2) {\n return t2 && (t2.isColor || t2.isMatrix3 || t2.isMatrix4 || t2.isVector2 || t2.isVector3 || t2.isVector4 || t2.isTexture || t2.isQuaternion);\n }\n function Xl(t2) {\n const e2 = t2.getRenderTarget();\n return null === e2 ? t2.outputColorSpace : true === e2.isXRRenderTarget ? e2.texture.colorSpace : Ri.workingColorSpace;\n }\n var Yl = { clone: Jl, merge: ql };\n var Zl = class extends Zn {\n constructor(t2) {\n super(), this.isShaderMaterial = true, this.type = \"ShaderMaterial\", this.defines = {}, this.uniforms = {}, this.uniformsGroups = [], this.vertexShader = \"void main() {\\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\\n}\", this.fragmentShader = \"void main() {\\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\\n}\", this.linewidth = 1, this.wireframe = false, this.wireframeLinewidth = 1, this.fog = false, this.lights = false, this.clipping = false, this.forceSinglePass = true, this.extensions = { clipCullDistance: false, multiDraw: false }, this.defaultAttributeValues = { color: [1, 1, 1], uv: [0, 0], uv1: [0, 0] }, this.index0AttributeName = void 0, this.uniformsNeedUpdate = false, this.glslVersion = null, void 0 !== t2 && this.setValues(t2);\n }\n copy(t2) {\n return super.copy(t2), this.fragmentShader = t2.fragmentShader, this.vertexShader = t2.vertexShader, this.uniforms = Jl(t2.uniforms), this.uniformsGroups = (function(t3) {\n const e2 = [];\n for (let s2 = 0; s2 < t3.length; s2++) e2.push(t3[s2].clone());\n return e2;\n })(t2.uniformsGroups), this.defines = Object.assign({}, t2.defines), this.wireframe = t2.wireframe, this.wireframeLinewidth = t2.wireframeLinewidth, this.fog = t2.fog, this.lights = t2.lights, this.clipping = t2.clipping, this.extensions = Object.assign({}, t2.extensions), this.glslVersion = t2.glslVersion, this.defaultAttributeValues = Object.assign({}, t2.defaultAttributeValues), this.index0AttributeName = t2.index0AttributeName, this.uniformsNeedUpdate = t2.uniformsNeedUpdate, this;\n }\n toJSON(t2) {\n const e2 = super.toJSON(t2);\n e2.glslVersion = this.glslVersion, e2.uniforms = {};\n for (const s3 in this.uniforms) {\n const i2 = this.uniforms[s3].value;\n i2 && i2.isTexture ? e2.uniforms[s3] = { type: \"t\", value: i2.toJSON(t2).uuid } : i2 && i2.isColor ? e2.uniforms[s3] = { type: \"c\", value: i2.getHex() } : i2 && i2.isVector2 ? e2.uniforms[s3] = { type: \"v2\", value: i2.toArray() } : i2 && i2.isVector3 ? e2.uniforms[s3] = { type: \"v3\", value: i2.toArray() } : i2 && i2.isVector4 ? e2.uniforms[s3] = { type: \"v4\", value: i2.toArray() } : i2 && i2.isMatrix3 ? e2.uniforms[s3] = { type: \"m3\", value: i2.toArray() } : i2 && i2.isMatrix4 ? e2.uniforms[s3] = { type: \"m4\", value: i2.toArray() } : e2.uniforms[s3] = { value: i2 };\n }\n Object.keys(this.defines).length > 0 && (e2.defines = this.defines), e2.vertexShader = this.vertexShader, e2.fragmentShader = this.fragmentShader, e2.lights = this.lights, e2.clipping = this.clipping;\n const s2 = {};\n for (const t3 in this.extensions) true === this.extensions[t3] && (s2[t3] = true);\n return Object.keys(s2).length > 0 && (e2.extensions = s2), e2;\n }\n fromJSON(t2, e2) {\n if (super.fromJSON(t2, e2), void 0 !== t2.uniforms)\n for (const s2 in t2.uniforms) {\n const i2 = t2.uniforms[s2];\n switch (this.uniforms[s2] = {}, i2.type) {\n case \"t\":\n this.uniforms[s2].value = e2[i2.value] || null;\n break;\n case \"c\":\n this.uniforms[s2].value = new Pr().setHex(i2.value);\n break;\n case \"v2\":\n this.uniforms[s2].value = new _i().fromArray(i2.value);\n break;\n case \"v3\":\n this.uniforms[s2].value = new Ti().fromArray(i2.value);\n break;\n case \"v4\":\n this.uniforms[s2].value = new qi().fromArray(i2.value);\n break;\n case \"m3\":\n this.uniforms[s2].value = new Ii().fromArray(i2.value);\n break;\n case \"m4\":\n this.uniforms[s2].value = new Qi().fromArray(i2.value);\n break;\n default:\n this.uniforms[s2].value = i2.value;\n }\n }\n if (void 0 !== t2.defines && (this.defines = t2.defines), void 0 !== t2.vertexShader && (this.vertexShader = t2.vertexShader), void 0 !== t2.fragmentShader && (this.fragmentShader = t2.fragmentShader), void 0 !== t2.glslVersion && (this.glslVersion = t2.glslVersion), void 0 !== t2.extensions)\n for (const e3 in t2.extensions) this.extensions[e3] = t2.extensions[e3];\n return void 0 !== t2.lights && (this.lights = t2.lights), void 0 !== t2.clipping && (this.clipping = t2.clipping), this;\n }\n };\n var Gl = class extends Zl {\n constructor(t2) {\n super(t2), this.isRawShaderMaterial = true, this.type = \"RawShaderMaterial\";\n }\n };\n var $l = class extends Zn {\n constructor(t2) {\n super(), this.isMeshStandardMaterial = true, this.type = \"MeshStandardMaterial\", this.defines = { STANDARD: \"\" }, this.color = new Pr(16777215), this.roughness = 1, this.metalness = 0, this.map = null, this.lightMap = null, this.lightMapIntensity = 1, this.aoMap = null, this.aoMapIntensity = 1, this.emissive = new Pr(0), this.emissiveIntensity = 1, this.emissiveMap = null, this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalMapType = 0, this.normalScale = new _i(1, 1), this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.roughnessMap = null, this.metalnessMap = null, this.alphaMap = null, this.envMap = null, this.envMapRotation = new hr(), this.envMapIntensity = 1, this.wireframe = false, this.wireframeLinewidth = 1, this.wireframeLinecap = \"round\", this.wireframeLinejoin = \"round\", this.flatShading = false, this.fog = true, this.setValues(t2);\n }\n copy(t2) {\n return super.copy(t2), this.defines = { STANDARD: \"\" }, this.color.copy(t2.color), this.roughness = t2.roughness, this.metalness = t2.metalness, this.map = t2.map, this.lightMap = t2.lightMap, this.lightMapIntensity = t2.lightMapIntensity, this.aoMap = t2.aoMap, this.aoMapIntensity = t2.aoMapIntensity, this.emissive.copy(t2.emissive), this.emissiveMap = t2.emissiveMap, this.emissiveIntensity = t2.emissiveIntensity, this.bumpMap = t2.bumpMap, this.bumpScale = t2.bumpScale, this.normalMap = t2.normalMap, this.normalMapType = t2.normalMapType, this.normalScale.copy(t2.normalScale), this.displacementMap = t2.displacementMap, this.displacementScale = t2.displacementScale, this.displacementBias = t2.displacementBias, this.roughnessMap = t2.roughnessMap, this.metalnessMap = t2.metalnessMap, this.alphaMap = t2.alphaMap, this.envMap = t2.envMap, this.envMapRotation.copy(t2.envMapRotation), this.envMapIntensity = t2.envMapIntensity, this.wireframe = t2.wireframe, this.wireframeLinewidth = t2.wireframeLinewidth, this.wireframeLinecap = t2.wireframeLinecap, this.wireframeLinejoin = t2.wireframeLinejoin, this.flatShading = t2.flatShading, this.fog = t2.fog, this;\n }\n };\n var Ql = class extends $l {\n constructor(t2) {\n super(), this.isMeshPhysicalMaterial = true, this.defines = { STANDARD: \"\", PHYSICAL: \"\" }, this.type = \"MeshPhysicalMaterial\", this.anisotropyRotation = 0, this.anisotropyMap = null, this.clearcoatMap = null, this.clearcoatRoughness = 0, this.clearcoatRoughnessMap = null, this.clearcoatNormalScale = new _i(1, 1), this.clearcoatNormalMap = null, this.ior = 1.5, Object.defineProperty(this, \"reflectivity\", {\n get: function() {\n return xi(2.5 * (this.ior - 1) / (this.ior + 1), 0, 1);\n },\n set: function(t3) {\n this.ior = (1 + 0.4 * t3) / (1 - 0.4 * t3);\n }\n }), this.iridescenceMap = null, this.iridescenceIOR = 1.3, this.iridescenceThicknessRange = [100, 400], this.iridescenceThicknessMap = null, this.sheenColor = new Pr(0), this.sheenColorMap = null, this.sheenRoughness = 1, this.sheenRoughnessMap = null, this.transmissionMap = null, this.thickness = 0, this.thicknessMap = null, this.attenuationDistance = 1 / 0, this.attenuationColor = new Pr(1, 1, 1), this.specularIntensity = 1, this.specularIntensityMap = null, this.specularColor = new Pr(1, 1, 1), this.specularColorMap = null, this._anisotropy = 0, this._clearcoat = 0, this._dispersion = 0, this._iridescence = 0, this._sheen = 0, this._transmission = 0, this.setValues(t2);\n }\n get anisotropy() {\n return this._anisotropy;\n }\n set anisotropy(t2) {\n this._anisotropy > 0 != t2 > 0 && this.version++, this._anisotropy = t2;\n }\n get clearcoat() {\n return this._clearcoat;\n }\n set clearcoat(t2) {\n this._clearcoat > 0 != t2 > 0 && this.version++, this._clearcoat = t2;\n }\n get iridescence() {\n return this._iridescence;\n }\n set iridescence(t2) {\n this._iridescence > 0 != t2 > 0 && this.version++, this._iridescence = t2;\n }\n get dispersion() {\n return this._dispersion;\n }\n set dispersion(t2) {\n this._dispersion > 0 != t2 > 0 && this.version++, this._dispersion = t2;\n }\n get sheen() {\n return this._sheen;\n }\n set sheen(t2) {\n this._sheen > 0 != t2 > 0 && this.version++, this._sheen = t2;\n }\n get transmission() {\n return this._transmission;\n }\n set transmission(t2) {\n this._transmission > 0 != t2 > 0 && this.version++, this._transmission = t2;\n }\n copy(t2) {\n return super.copy(t2), this.defines = { STANDARD: \"\", PHYSICAL: \"\" }, this.anisotropy = t2.anisotropy, this.anisotropyRotation = t2.anisotropyRotation, this.anisotropyMap = t2.anisotropyMap, this.clearcoat = t2.clearcoat, this.clearcoatMap = t2.clearcoatMap, this.clearcoatRoughness = t2.clearcoatRoughness, this.clearcoatRoughnessMap = t2.clearcoatRoughnessMap, this.clearcoatNormalMap = t2.clearcoatNormalMap, this.clearcoatNormalScale.copy(t2.clearcoatNormalScale), this.dispersion = t2.dispersion, this.ior = t2.ior, this.iridescence = t2.iridescence, this.iridescenceMap = t2.iridescenceMap, this.iridescenceIOR = t2.iridescenceIOR, this.iridescenceThicknessRange = [...t2.iridescenceThicknessRange], this.iridescenceThicknessMap = t2.iridescenceThicknessMap, this.sheen = t2.sheen, this.sheenColor.copy(t2.sheenColor), this.sheenColorMap = t2.sheenColorMap, this.sheenRoughness = t2.sheenRoughness, this.sheenRoughnessMap = t2.sheenRoughnessMap, this.transmission = t2.transmission, this.transmissionMap = t2.transmissionMap, this.thickness = t2.thickness, this.thicknessMap = t2.thicknessMap, this.attenuationDistance = t2.attenuationDistance, this.attenuationColor.copy(t2.attenuationColor), this.specularIntensity = t2.specularIntensity, this.specularIntensityMap = t2.specularIntensityMap, this.specularColor.copy(t2.specularColor), this.specularColorMap = t2.specularColorMap, this;\n }\n };\n var Kl = class extends Zn {\n constructor(t2) {\n super(), this.isMeshPhongMaterial = true, this.type = \"MeshPhongMaterial\", this.color = new Pr(16777215), this.specular = new Pr(1118481), this.shininess = 30, this.map = null, this.lightMap = null, this.lightMapIntensity = 1, this.aoMap = null, this.aoMapIntensity = 1, this.emissive = new Pr(0), this.emissiveIntensity = 1, this.emissiveMap = null, this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalMapType = 0, this.normalScale = new _i(1, 1), this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.specularMap = null, this.alphaMap = null, this.envMap = null, this.envMapRotation = new hr(), this.combine = 0, this.reflectivity = 1, this.envMapIntensity = 1, this.refractionRatio = 0.98, this.wireframe = false, this.wireframeLinewidth = 1, this.wireframeLinecap = \"round\", this.wireframeLinejoin = \"round\", this.flatShading = false, this.fog = true, this.setValues(t2);\n }\n copy(t2) {\n return super.copy(t2), this.color.copy(t2.color), this.specular.copy(t2.specular), this.shininess = t2.shininess, this.map = t2.map, this.lightMap = t2.lightMap, this.lightMapIntensity = t2.lightMapIntensity, this.aoMap = t2.aoMap, this.aoMapIntensity = t2.aoMapIntensity, this.emissive.copy(t2.emissive), this.emissiveMap = t2.emissiveMap, this.emissiveIntensity = t2.emissiveIntensity, this.bumpMap = t2.bumpMap, this.bumpScale = t2.bumpScale, this.normalMap = t2.normalMap, this.normalMapType = t2.normalMapType, this.normalScale.copy(t2.normalScale), this.displacementMap = t2.displacementMap, this.displacementScale = t2.displacementScale, this.displacementBias = t2.displacementBias, this.specularMap = t2.specularMap, this.alphaMap = t2.alphaMap, this.envMap = t2.envMap, this.envMapRotation.copy(t2.envMapRotation), this.combine = t2.combine, this.reflectivity = t2.reflectivity, this.envMapIntensity = t2.envMapIntensity, this.refractionRatio = t2.refractionRatio, this.wireframe = t2.wireframe, this.wireframeLinewidth = t2.wireframeLinewidth, this.wireframeLinecap = t2.wireframeLinecap, this.wireframeLinejoin = t2.wireframeLinejoin, this.flatShading = t2.flatShading, this.fog = t2.fog, this;\n }\n };\n var tc = class extends Zn {\n constructor(t2) {\n super(), this.isMeshToonMaterial = true, this.defines = { TOON: \"\" }, this.type = \"MeshToonMaterial\", this.color = new Pr(16777215), this.map = null, this.gradientMap = null, this.lightMap = null, this.lightMapIntensity = 1, this.aoMap = null, this.aoMapIntensity = 1, this.emissive = new Pr(0), this.emissiveIntensity = 1, this.emissiveMap = null, this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalMapType = 0, this.normalScale = new _i(1, 1), this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.alphaMap = null, this.wireframe = false, this.wireframeLinewidth = 1, this.wireframeLinecap = \"round\", this.wireframeLinejoin = \"round\", this.fog = true, this.setValues(t2);\n }\n copy(t2) {\n return super.copy(t2), this.color.copy(t2.color), this.map = t2.map, this.gradientMap = t2.gradientMap, this.lightMap = t2.lightMap, this.lightMapIntensity = t2.lightMapIntensity, this.aoMap = t2.aoMap, this.aoMapIntensity = t2.aoMapIntensity, this.emissive.copy(t2.emissive), this.emissiveMap = t2.emissiveMap, this.emissiveIntensity = t2.emissiveIntensity, this.bumpMap = t2.bumpMap, this.bumpScale = t2.bumpScale, this.normalMap = t2.normalMap, this.normalMapType = t2.normalMapType, this.normalScale.copy(t2.normalScale), this.displacementMap = t2.displacementMap, this.displacementScale = t2.displacementScale, this.displacementBias = t2.displacementBias, this.alphaMap = t2.alphaMap, this.wireframe = t2.wireframe, this.wireframeLinewidth = t2.wireframeLinewidth, this.wireframeLinecap = t2.wireframeLinecap, this.wireframeLinejoin = t2.wireframeLinejoin, this.fog = t2.fog, this;\n }\n };\n var ec = class extends Zn {\n constructor(t2) {\n super(), this.isMeshNormalMaterial = true, this.type = \"MeshNormalMaterial\", this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalMapType = 0, this.normalScale = new _i(1, 1), this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.wireframe = false, this.wireframeLinewidth = 1, this.flatShading = false, this.setValues(t2);\n }\n copy(t2) {\n return super.copy(t2), this.bumpMap = t2.bumpMap, this.bumpScale = t2.bumpScale, this.normalMap = t2.normalMap, this.normalMapType = t2.normalMapType, this.normalScale.copy(t2.normalScale), this.displacementMap = t2.displacementMap, this.displacementScale = t2.displacementScale, this.displacementBias = t2.displacementBias, this.wireframe = t2.wireframe, this.wireframeLinewidth = t2.wireframeLinewidth, this.flatShading = t2.flatShading, this;\n }\n };\n var sc = class extends Zn {\n constructor(t2) {\n super(), this.isMeshLambertMaterial = true, this.type = \"MeshLambertMaterial\", this.color = new Pr(16777215), this.map = null, this.lightMap = null, this.lightMapIntensity = 1, this.aoMap = null, this.aoMapIntensity = 1, this.emissive = new Pr(0), this.emissiveIntensity = 1, this.emissiveMap = null, this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalMapType = 0, this.normalScale = new _i(1, 1), this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.specularMap = null, this.alphaMap = null, this.envMap = null, this.envMapRotation = new hr(), this.combine = 0, this.reflectivity = 1, this.envMapIntensity = 1, this.refractionRatio = 0.98, this.wireframe = false, this.wireframeLinewidth = 1, this.wireframeLinecap = \"round\", this.wireframeLinejoin = \"round\", this.flatShading = false, this.fog = true, this.setValues(t2);\n }\n copy(t2) {\n return super.copy(t2), this.color.copy(t2.color), this.map = t2.map, this.lightMap = t2.lightMap, this.lightMapIntensity = t2.lightMapIntensity, this.aoMap = t2.aoMap, this.aoMapIntensity = t2.aoMapIntensity, this.emissive.copy(t2.emissive), this.emissiveMap = t2.emissiveMap, this.emissiveIntensity = t2.emissiveIntensity, this.bumpMap = t2.bumpMap, this.bumpScale = t2.bumpScale, this.normalMap = t2.normalMap, this.normalMapType = t2.normalMapType, this.normalScale.copy(t2.normalScale), this.displacementMap = t2.displacementMap, this.displacementScale = t2.displacementScale, this.displacementBias = t2.displacementBias, this.specularMap = t2.specularMap, this.alphaMap = t2.alphaMap, this.envMap = t2.envMap, this.envMapRotation.copy(t2.envMapRotation), this.combine = t2.combine, this.reflectivity = t2.reflectivity, this.envMapIntensity = t2.envMapIntensity, this.refractionRatio = t2.refractionRatio, this.wireframe = t2.wireframe, this.wireframeLinewidth = t2.wireframeLinewidth, this.wireframeLinecap = t2.wireframeLinecap, this.wireframeLinejoin = t2.wireframeLinejoin, this.flatShading = t2.flatShading, this.fog = t2.fog, this;\n }\n };\n var ic = class extends Zn {\n constructor(t2) {\n super(), this.isMeshDepthMaterial = true, this.type = \"MeshDepthMaterial\", this.depthPacking = 3200, this.map = null, this.alphaMap = null, this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.wireframe = false, this.wireframeLinewidth = 1, this.setValues(t2);\n }\n copy(t2) {\n return super.copy(t2), this.depthPacking = t2.depthPacking, this.map = t2.map, this.alphaMap = t2.alphaMap, this.displacementMap = t2.displacementMap, this.displacementScale = t2.displacementScale, this.displacementBias = t2.displacementBias, this.wireframe = t2.wireframe, this.wireframeLinewidth = t2.wireframeLinewidth, this;\n }\n };\n var rc = class extends Zn {\n constructor(t2) {\n super(), this.isMeshDistanceMaterial = true, this.type = \"MeshDistanceMaterial\", this.map = null, this.alphaMap = null, this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.setValues(t2);\n }\n copy(t2) {\n return super.copy(t2), this.map = t2.map, this.alphaMap = t2.alphaMap, this.displacementMap = t2.displacementMap, this.displacementScale = t2.displacementScale, this.displacementBias = t2.displacementBias, this;\n }\n };\n var nc = class extends Zn {\n constructor(t2) {\n super(), this.isMeshMatcapMaterial = true, this.defines = { MATCAP: \"\" }, this.type = \"MeshMatcapMaterial\", this.color = new Pr(16777215), this.matcap = null, this.map = null, this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalMapType = 0, this.normalScale = new _i(1, 1), this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.alphaMap = null, this.wireframe = false, this.wireframeLinewidth = 1, this.flatShading = false, this.fog = true, this.setValues(t2);\n }\n copy(t2) {\n return super.copy(t2), this.defines = { MATCAP: \"\" }, this.color.copy(t2.color), this.matcap = t2.matcap, this.map = t2.map, this.bumpMap = t2.bumpMap, this.bumpScale = t2.bumpScale, this.normalMap = t2.normalMap, this.normalMapType = t2.normalMapType, this.normalScale.copy(t2.normalScale), this.displacementMap = t2.displacementMap, this.displacementScale = t2.displacementScale, this.displacementBias = t2.displacementBias, this.alphaMap = t2.alphaMap, this.wireframe = t2.wireframe, this.wireframeLinewidth = t2.wireframeLinewidth, this.flatShading = t2.flatShading, this.fog = t2.fog, this;\n }\n };\n var ac = class extends No {\n constructor(t2) {\n super(), this.isLineDashedMaterial = true, this.type = \"LineDashedMaterial\", this.scale = 1, this.dashSize = 3, this.gapSize = 1, this.setValues(t2);\n }\n copy(t2) {\n return super.copy(t2), this.scale = t2.scale, this.dashSize = t2.dashSize, this.gapSize = t2.gapSize, this;\n }\n };\n function oc(t2, e2) {\n return t2 && t2.constructor !== e2 ? \"number\" == typeof e2.BYTES_PER_ELEMENT ? new e2(t2) : Array.prototype.slice.call(t2) : t2;\n }\n function hc(t2) {\n const e2 = t2.length, s2 = new Array(e2);\n for (let t3 = 0; t3 !== e2; ++t3) s2[t3] = t3;\n return s2.sort(function(e3, s3) {\n return t2[e3] - t2[s3];\n }), s2;\n }\n function lc(t2, e2, s2) {\n const i2 = t2.length, r2 = new t2.constructor(i2);\n for (let n2 = 0, a2 = 0; a2 !== i2; ++n2) {\n const i3 = s2[n2] * e2;\n for (let s3 = 0; s3 !== e2; ++s3) r2[a2++] = t2[i3 + s3];\n }\n return r2;\n }\n function cc(t2, e2, s2, i2) {\n let r2 = 1, n2 = t2[0];\n for (; void 0 !== n2 && void 0 === n2[i2]; ) n2 = t2[r2++];\n if (void 0 === n2) return;\n let a2 = n2[i2];\n if (void 0 !== a2)\n if (Array.isArray(a2))\n do {\n a2 = n2[i2], void 0 !== a2 && (e2.push(n2.time), s2.push(...a2)), n2 = t2[r2++];\n } while (void 0 !== n2);\n else if (void 0 !== a2.toArray)\n do {\n a2 = n2[i2], void 0 !== a2 && (e2.push(n2.time), a2.toArray(s2, s2.length)), n2 = t2[r2++];\n } while (void 0 !== n2);\n else\n do {\n a2 = n2[i2], void 0 !== a2 && (e2.push(n2.time), s2.push(a2)), n2 = t2[r2++];\n } while (void 0 !== n2);\n }\n var uc = class {\n static convertArray(t2, e2) {\n return oc(t2, e2);\n }\n static isTypedArray(t2) {\n return $s(t2);\n }\n static getKeyframeOrder(t2) {\n return hc(t2);\n }\n static sortedArray(t2, e2, s2) {\n return lc(t2, e2, s2);\n }\n static flattenJSON(t2, e2, s2, i2) {\n cc(t2, e2, s2, i2);\n }\n static subclip(t2, e2, s2, i2, r2 = 30) {\n return (function(t3, e3, s3, i3, r3 = 30) {\n const n2 = t3.clone();\n n2.name = e3;\n const a2 = [];\n for (let t4 = 0; t4 < n2.tracks.length; ++t4) {\n const e4 = n2.tracks[t4], o3 = e4.getValueSize(), h2 = [], l2 = [];\n for (let t5 = 0; t5 < e4.times.length; ++t5) {\n const n3 = e4.times[t5] * r3;\n if (!(n3 < s3 || n3 >= i3)) {\n h2.push(e4.times[t5]);\n for (let s4 = 0; s4 < o3; ++s4) l2.push(e4.values[t5 * o3 + s4]);\n }\n }\n 0 !== h2.length && (e4.times = oc(h2, e4.times.constructor), e4.values = oc(l2, e4.values.constructor), a2.push(e4));\n }\n n2.tracks = a2;\n let o2 = 1 / 0;\n for (let t4 = 0; t4 < n2.tracks.length; ++t4)\n o2 > n2.tracks[t4].times[0] && (o2 = n2.tracks[t4].times[0]);\n for (let t4 = 0; t4 < n2.tracks.length; ++t4) n2.tracks[t4].shift(-1 * o2);\n return n2.resetDuration(), n2;\n })(t2, e2, s2, i2, r2);\n }\n static makeClipAdditive(t2, e2 = 0, s2 = t2, i2 = 30) {\n return (function(t3, e3 = 0, s3 = t3, i3 = 30) {\n i3 <= 0 && (i3 = 30);\n const r2 = s3.tracks.length, n2 = e3 / i3;\n for (let e4 = 0; e4 < r2; ++e4) {\n const i4 = s3.tracks[e4], r3 = i4.ValueTypeName;\n if (\"bool\" === r3 || \"string\" === r3) continue;\n const a2 = t3.tracks.find(function(t4) {\n return t4.name === i4.name && t4.ValueTypeName === r3;\n });\n if (void 0 === a2) continue;\n let o2 = 0;\n const h2 = i4.getValueSize();\n i4.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline && (o2 = h2 / 3);\n let l2 = 0;\n const c2 = a2.getValueSize();\n a2.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline && (l2 = c2 / 3);\n const u2 = i4.times.length - 1;\n let d2;\n if (n2 <= i4.times[0]) {\n const t4 = o2, e5 = h2 - o2;\n d2 = i4.values.slice(t4, e5);\n } else if (n2 >= i4.times[u2]) {\n const t4 = u2 * h2 + o2, e5 = t4 + h2 - o2;\n d2 = i4.values.slice(t4, e5);\n } else {\n const t4 = i4.createInterpolant(), e5 = o2, s4 = h2 - o2;\n t4.evaluate(n2), d2 = t4.resultBuffer.slice(e5, s4);\n }\n \"quaternion\" === r3 && new Ai().fromArray(d2).normalize().conjugate().toArray(d2);\n const p2 = a2.times.length;\n for (let t4 = 0; t4 < p2; ++t4) {\n const e5 = t4 * c2 + l2;\n if (\"quaternion\" === r3) Ai.multiplyQuaternionsFlat(a2.values, e5, d2, 0, a2.values, e5);\n else {\n const t5 = c2 - 2 * l2;\n for (let s4 = 0; s4 < t5; ++s4) a2.values[e5 + s4] -= d2[s4];\n }\n }\n }\n return t3.blendMode = Je, t3;\n })(t2, e2, s2, i2);\n }\n };\n var dc = class {\n constructor(t2, e2, s2, i2) {\n this.parameterPositions = t2, this._cachedIndex = 0, this.resultBuffer = void 0 !== i2 ? i2 : new e2.constructor(s2), this.sampleValues = e2, this.valueSize = s2, this.settings = null, this.DefaultSettings_ = {};\n }\n evaluate(t2) {\n const e2 = this.parameterPositions;\n let s2 = this._cachedIndex, i2 = e2[s2], r2 = e2[s2 - 1];\n t: {\n e: {\n let n2;\n s: {\n i: if (!(t2 < i2)) {\n for (let n3 = s2 + 2; ; ) {\n if (void 0 === i2) {\n if (t2 < r2) break i;\n return s2 = e2.length, this._cachedIndex = s2, this.copySampleValue_(s2 - 1);\n }\n if (s2 === n3) break;\n if (r2 = i2, i2 = e2[++s2], t2 < i2) break e;\n }\n n2 = e2.length;\n break s;\n }\n if (!(t2 >= r2)) {\n const a2 = e2[1];\n t2 < a2 && (s2 = 2, r2 = a2);\n for (let n3 = s2 - 2; ; ) {\n if (void 0 === r2) return this._cachedIndex = 0, this.copySampleValue_(0);\n if (s2 === n3) break;\n if (i2 = r2, r2 = e2[--s2 - 1], t2 >= r2) break e;\n }\n n2 = s2, s2 = 0;\n break s;\n }\n break t;\n }\n for (; s2 < n2; ) {\n const i3 = s2 + n2 >>> 1;\n t2 < e2[i3] ? n2 = i3 : s2 = i3 + 1;\n }\n if (i2 = e2[s2], r2 = e2[s2 - 1], void 0 === r2)\n return this._cachedIndex = 0, this.copySampleValue_(0);\n if (void 0 === i2)\n return s2 = e2.length, this._cachedIndex = s2, this.copySampleValue_(s2 - 1);\n }\n this._cachedIndex = s2, this.intervalChanged_(s2, r2, i2);\n }\n return this.interpolate_(s2, r2, t2, i2);\n }\n getSettings_() {\n return this.settings || this.DefaultSettings_;\n }\n copySampleValue_(t2) {\n const e2 = this.resultBuffer, s2 = this.sampleValues, i2 = this.valueSize, r2 = t2 * i2;\n for (let t3 = 0; t3 !== i2; ++t3) e2[t3] = s2[r2 + t3];\n return e2;\n }\n interpolate_() {\n throw new Error(\"THREE.Interpolant: Call to abstract method.\");\n }\n intervalChanged_() {\n }\n };\n var pc = class extends dc {\n constructor(t2, e2, s2, i2) {\n super(t2, e2, s2, i2), this._weightPrev = -0, this._offsetPrev = -0, this._weightNext = -0, this._offsetNext = -0, this.DefaultSettings_ = { endingStart: De, endingEnd: De };\n }\n intervalChanged_(t2, e2, s2) {\n const i2 = this.parameterPositions;\n let r2 = t2 - 2, n2 = t2 + 1, a2 = i2[r2], o2 = i2[n2];\n if (void 0 === a2)\n switch (this.getSettings_().endingStart) {\n case Ue:\n r2 = t2, a2 = 2 * e2 - s2;\n break;\n case je:\n r2 = i2.length - 2, a2 = e2 + i2[r2] - i2[r2 + 1];\n break;\n default:\n r2 = t2, a2 = s2;\n }\n if (void 0 === o2)\n switch (this.getSettings_().endingEnd) {\n case Ue:\n n2 = t2, o2 = 2 * s2 - e2;\n break;\n case je:\n n2 = 1, o2 = s2 + i2[1] - i2[0];\n break;\n default:\n n2 = t2 - 1, o2 = e2;\n }\n const h2 = 0.5 * (s2 - e2), l2 = this.valueSize;\n this._weightPrev = h2 / (e2 - a2), this._weightNext = h2 / (o2 - s2), this._offsetPrev = r2 * l2, this._offsetNext = n2 * l2;\n }\n interpolate_(t2, e2, s2, i2) {\n const r2 = this.resultBuffer, n2 = this.sampleValues, a2 = this.valueSize, o2 = t2 * a2, h2 = o2 - a2, l2 = this._offsetPrev, c2 = this._offsetNext, u2 = this._weightPrev, d2 = this._weightNext, p2 = (s2 - e2) / (i2 - e2), m2 = p2 * p2, y2 = m2 * p2, g2 = -u2 * y2 + 2 * u2 * m2 - u2 * p2, f2 = (1 + u2) * y2 + (-1.5 - 2 * u2) * m2 + (-0.5 + u2) * p2 + 1, x2 = (-1 - d2) * y2 + (1.5 + d2) * m2 + 0.5 * p2, b2 = d2 * y2 - d2 * m2;\n for (let t3 = 0; t3 !== a2; ++t3) r2[t3] = g2 * n2[l2 + t3] + f2 * n2[h2 + t3] + x2 * n2[o2 + t3] + b2 * n2[c2 + t3];\n return r2;\n }\n };\n var mc = class extends dc {\n constructor(t2, e2, s2, i2) {\n super(t2, e2, s2, i2);\n }\n interpolate_(t2, e2, s2, i2) {\n const r2 = this.resultBuffer, n2 = this.sampleValues, a2 = this.valueSize, o2 = t2 * a2, h2 = o2 - a2, l2 = (s2 - e2) / (i2 - e2), c2 = 1 - l2;\n for (let t3 = 0; t3 !== a2; ++t3) r2[t3] = n2[h2 + t3] * c2 + n2[o2 + t3] * l2;\n return r2;\n }\n };\n var yc = class extends dc {\n constructor(t2, e2, s2, i2) {\n super(t2, e2, s2, i2);\n }\n interpolate_(t2) {\n return this.copySampleValue_(t2 - 1);\n }\n };\n var gc = class extends dc {\n interpolate_(t2, e2, s2, i2) {\n const r2 = this.resultBuffer, n2 = this.sampleValues, a2 = this.valueSize, o2 = t2 * a2, h2 = o2 - a2, l2 = this.inTangents, c2 = this.outTangents;\n if (!l2 || !c2) {\n const t3 = (s2 - e2) / (i2 - e2), l3 = 1 - t3;\n for (let e3 = 0; e3 !== a2; ++e3) r2[e3] = n2[h2 + e3] * l3 + n2[o2 + e3] * t3;\n return r2;\n }\n const u2 = 2 * a2, d2 = t2 - 1;\n for (let p2 = 0; p2 !== a2; ++p2) {\n const a3 = n2[h2 + p2], m2 = n2[o2 + p2], y2 = d2 * u2 + 2 * p2, g2 = c2[y2], f2 = c2[y2 + 1], x2 = t2 * u2 + 2 * p2, b2 = l2[x2], v2 = l2[x2 + 1];\n let w2, M2, S2, _2, A2, T2 = (s2 - e2) / (i2 - e2);\n for (let t3 = 0; t3 < 8; t3++) {\n w2 = T2 * T2, M2 = w2 * T2, S2 = 1 - T2, _2 = S2 * S2, A2 = _2 * S2;\n const t4 = A2 * e2 + 3 * _2 * T2 * g2 + 3 * S2 * w2 * b2 + M2 * i2 - s2;\n if (Math.abs(t4) < 1e-10) break;\n const r3 = 3 * _2 * (g2 - e2) + 6 * S2 * T2 * (b2 - g2) + 3 * w2 * (i2 - b2);\n if (Math.abs(r3) < 1e-10) break;\n T2 -= t4 / r3, T2 = Math.max(0, Math.min(1, T2));\n }\n r2[p2] = A2 * a3 + 3 * _2 * T2 * f2 + 3 * S2 * w2 * v2 + M2 * m2;\n }\n return r2;\n }\n };\n var fc = class {\n constructor(t2, e2, s2, i2) {\n if (void 0 === t2) throw new Error(\"THREE.KeyframeTrack: track name is undefined\");\n if (void 0 === e2 || 0 === e2.length)\n throw new Error(\"THREE.KeyframeTrack: no keyframes in track named \" + t2);\n this.name = t2, this.times = oc(e2, this.TimeBufferType), this.values = oc(s2, this.ValueBufferType), this.setInterpolation(i2 || this.DefaultInterpolation);\n }\n static toJSON(t2) {\n const e2 = t2.constructor;\n let s2;\n if (e2.toJSON !== this.toJSON) s2 = e2.toJSON(t2);\n else {\n s2 = { name: t2.name, times: oc(t2.times, Array), values: oc(t2.values, Array) };\n const e3 = t2.getInterpolation();\n e3 !== t2.DefaultInterpolation && (s2.interpolation = e3);\n }\n return s2.type = t2.ValueTypeName, s2;\n }\n InterpolantFactoryMethodDiscrete(t2) {\n return new yc(this.times, this.values, this.getValueSize(), t2);\n }\n InterpolantFactoryMethodLinear(t2) {\n return new mc(this.times, this.values, this.getValueSize(), t2);\n }\n InterpolantFactoryMethodSmooth(t2) {\n return new pc(this.times, this.values, this.getValueSize(), t2);\n }\n InterpolantFactoryMethodBezier(t2) {\n const e2 = new gc(this.times, this.values, this.getValueSize(), t2);\n return this.settings && (e2.inTangents = this.settings.inTangents, e2.outTangents = this.settings.outTangents), e2;\n }\n setInterpolation(t2) {\n let e2;\n switch (t2) {\n case Ne:\n e2 = this.InterpolantFactoryMethodDiscrete;\n break;\n case Ve:\n e2 = this.InterpolantFactoryMethodLinear;\n break;\n case Le:\n e2 = this.InterpolantFactoryMethodSmooth;\n break;\n case Fe:\n e2 = this.InterpolantFactoryMethodBezier;\n }\n if (void 0 === e2) {\n const e3 = \"unsupported interpolation for \" + this.ValueTypeName + \" keyframe track named \" + this.name;\n if (void 0 === this.createInterpolant) {\n if (t2 === this.DefaultInterpolation) throw new Error(e3);\n this.setInterpolation(this.DefaultInterpolation);\n }\n return ai(\"KeyframeTrack:\", e3), this;\n }\n return this.createInterpolant = e2, this;\n }\n getInterpolation() {\n switch (this.createInterpolant) {\n case this.InterpolantFactoryMethodDiscrete:\n return Ne;\n case this.InterpolantFactoryMethodLinear:\n return Ve;\n case this.InterpolantFactoryMethodSmooth:\n return Le;\n case this.InterpolantFactoryMethodBezier:\n return Fe;\n }\n }\n getValueSize() {\n return this.values.length / this.times.length;\n }\n shift(t2) {\n if (0 !== t2) {\n const e2 = this.times;\n for (let s2 = 0, i2 = e2.length; s2 !== i2; ++s2) e2[s2] += t2;\n }\n return this;\n }\n scale(t2) {\n if (1 !== t2) {\n const e2 = this.times;\n for (let s2 = 0, i2 = e2.length; s2 !== i2; ++s2) e2[s2] *= t2;\n }\n return this;\n }\n trim(t2, e2) {\n const s2 = this.times, i2 = s2.length;\n let r2 = 0, n2 = i2 - 1;\n for (; r2 !== i2 && s2[r2] < t2; ) ++r2;\n for (; -1 !== n2 && s2[n2] > e2; ) --n2;\n if (++n2, 0 !== r2 || n2 !== i2) {\n r2 >= n2 && (n2 = Math.max(n2, 1), r2 = n2 - 1);\n const t3 = this.getValueSize();\n this.times = s2.slice(r2, n2), this.values = this.values.slice(r2 * t3, n2 * t3);\n }\n return this;\n }\n validate() {\n let t2 = true;\n const e2 = this.getValueSize();\n e2 - Math.floor(e2) !== 0 && (oi(\"KeyframeTrack: Invalid value size in track.\", this), t2 = false);\n const s2 = this.times, i2 = this.values, r2 = s2.length;\n 0 === r2 && (oi(\"KeyframeTrack: Track is empty.\", this), t2 = false);\n let n2 = null;\n for (let e3 = 0; e3 !== r2; e3++) {\n const i3 = s2[e3];\n if (\"number\" == typeof i3 && isNaN(i3)) {\n oi(\"KeyframeTrack: Time is not a valid number.\", this, e3, i3), t2 = false;\n break;\n }\n if (null !== n2 && n2 > i3) {\n oi(\"KeyframeTrack: Out of order keys.\", this, e3, i3, n2), t2 = false;\n break;\n }\n n2 = i3;\n }\n if (void 0 !== i2 && $s(i2))\n for (let e3 = 0, s3 = i2.length; e3 !== s3; ++e3) {\n const s4 = i2[e3];\n if (isNaN(s4)) {\n oi(\"KeyframeTrack: Value is not a valid number.\", this, e3, s4), t2 = false;\n break;\n }\n }\n return t2;\n }\n optimize() {\n const t2 = this.times.slice(), e2 = this.values.slice(), s2 = this.getValueSize(), i2 = this.getInterpolation() === Le, r2 = t2.length - 1;\n let n2 = 1;\n for (let a2 = 1; a2 < r2; ++a2) {\n let r3 = false;\n const o2 = t2[a2];\n if (o2 !== t2[a2 + 1] && (1 !== a2 || o2 !== t2[0]))\n if (i2) r3 = true;\n else {\n const t3 = a2 * s2, i3 = t3 - s2, n3 = t3 + s2;\n for (let a3 = 0; a3 !== s2; ++a3) {\n const s3 = e2[t3 + a3];\n if (s3 !== e2[i3 + a3] || s3 !== e2[n3 + a3]) {\n r3 = true;\n break;\n }\n }\n }\n if (r3) {\n if (a2 !== n2) {\n t2[n2] = t2[a2];\n const i3 = a2 * s2, r4 = n2 * s2;\n for (let t3 = 0; t3 !== s2; ++t3) e2[r4 + t3] = e2[i3 + t3];\n }\n ++n2;\n }\n }\n if (r2 > 0) {\n t2[n2] = t2[r2];\n for (let t3 = r2 * s2, i3 = n2 * s2, a2 = 0; a2 !== s2; ++a2) e2[i3 + a2] = e2[t3 + a2];\n ++n2;\n }\n return n2 !== t2.length ? (this.times = t2.slice(0, n2), this.values = e2.slice(0, n2 * s2)) : (this.times = t2, this.values = e2), this;\n }\n clone() {\n const t2 = this.times.slice(), e2 = this.values.slice(), s2 = new (0, this.constructor)(this.name, t2, e2);\n return s2.createInterpolant = this.createInterpolant, s2;\n }\n };\n fc.prototype.ValueTypeName = \"\", fc.prototype.TimeBufferType = Float32Array, fc.prototype.ValueBufferType = Float32Array, fc.prototype.DefaultInterpolation = Ve;\n var xc = class extends fc {\n constructor(t2, e2, s2) {\n super(t2, e2, s2);\n }\n };\n xc.prototype.ValueTypeName = \"bool\", xc.prototype.ValueBufferType = Array, xc.prototype.DefaultInterpolation = Ne, xc.prototype.InterpolantFactoryMethodLinear = void 0, xc.prototype.InterpolantFactoryMethodSmooth = void 0;\n var bc = class extends fc {\n constructor(t2, e2, s2, i2) {\n super(t2, e2, s2, i2);\n }\n };\n bc.prototype.ValueTypeName = \"color\";\n var vc = class extends fc {\n constructor(t2, e2, s2, i2) {\n super(t2, e2, s2, i2);\n }\n };\n vc.prototype.ValueTypeName = \"number\";\n var wc = class extends dc {\n constructor(t2, e2, s2, i2) {\n super(t2, e2, s2, i2);\n }\n interpolate_(t2, e2, s2, i2) {\n const r2 = this.resultBuffer, n2 = this.sampleValues, a2 = this.valueSize, o2 = (s2 - e2) / (i2 - e2);\n let h2 = t2 * a2;\n for (let t3 = h2 + a2; h2 !== t3; h2 += 4) Ai.slerpFlat(r2, 0, n2, h2 - a2, n2, h2, o2);\n return r2;\n }\n };\n var Mc = class extends fc {\n constructor(t2, e2, s2, i2) {\n super(t2, e2, s2, i2);\n }\n InterpolantFactoryMethodLinear(t2) {\n return new wc(this.times, this.values, this.getValueSize(), t2);\n }\n };\n Mc.prototype.ValueTypeName = \"quaternion\", Mc.prototype.InterpolantFactoryMethodSmooth = void 0;\n var Sc = class extends fc {\n constructor(t2, e2, s2) {\n super(t2, e2, s2);\n }\n };\n Sc.prototype.ValueTypeName = \"string\", Sc.prototype.ValueBufferType = Array, Sc.prototype.DefaultInterpolation = Ne, Sc.prototype.InterpolantFactoryMethodLinear = void 0, Sc.prototype.InterpolantFactoryMethodSmooth = void 0;\n var _c = class extends fc {\n constructor(t2, e2, s2, i2) {\n super(t2, e2, s2, i2);\n }\n };\n _c.prototype.ValueTypeName = \"vector\";\n var Ac = class {\n constructor(t2 = \"\", e2 = -1, s2 = [], i2 = 2500) {\n this.name = t2, this.tracks = s2, this.duration = e2, this.blendMode = i2, this.uuid = fi(), this.userData = {}, this.duration < 0 && this.resetDuration();\n }\n static parse(t2) {\n const e2 = [], s2 = t2.tracks, i2 = 1 / (t2.fps || 1);\n for (let t3 = 0, r3 = s2.length; t3 !== r3; ++t3) e2.push(Tc(s2[t3]).scale(i2));\n const r2 = new this(t2.name, t2.duration, e2, t2.blendMode);\n return r2.uuid = t2.uuid, r2.userData = JSON.parse(t2.userData || \"{}\"), r2;\n }\n static toJSON(t2) {\n const e2 = [], s2 = t2.tracks, i2 = {\n name: t2.name,\n duration: t2.duration,\n tracks: e2,\n uuid: t2.uuid,\n blendMode: t2.blendMode,\n userData: JSON.stringify(t2.userData)\n };\n for (let t3 = 0, i3 = s2.length; t3 !== i3; ++t3) e2.push(fc.toJSON(s2[t3]));\n return i2;\n }\n static CreateFromMorphTargetSequence(t2, e2, s2, i2) {\n const r2 = e2.length, n2 = [];\n for (let t3 = 0; t3 < r2; t3++) {\n let a2 = [], o2 = [];\n a2.push((t3 + r2 - 1) % r2, t3, (t3 + 1) % r2), o2.push(0, 1, 0);\n const h2 = hc(a2);\n a2 = lc(a2, 1, h2), o2 = lc(o2, 1, h2), i2 || 0 !== a2[0] || (a2.push(r2), o2.push(o2[0])), n2.push(new vc(\".morphTargetInfluences[\" + e2[t3].name + \"]\", a2, o2).scale(1 / s2));\n }\n return new this(t2, -1, n2);\n }\n static findByName(t2, e2) {\n let s2 = t2;\n if (!Array.isArray(t2)) {\n const e3 = t2;\n s2 = e3.geometry && e3.geometry.animations || e3.animations;\n }\n for (let t3 = 0; t3 < s2.length; t3++) if (s2[t3].name === e2) return s2[t3];\n return null;\n }\n static CreateClipsFromMorphTargetSequences(t2, e2, s2) {\n const i2 = {}, r2 = /^([\\w-]*?)([\\d]+)$/;\n for (let e3 = 0, s3 = t2.length; e3 < s3; e3++) {\n const s4 = t2[e3], n3 = s4.name.match(r2);\n if (n3 && n3.length > 1) {\n const t3 = n3[1];\n let e4 = i2[t3];\n e4 || (i2[t3] = e4 = []), e4.push(s4);\n }\n }\n const n2 = [];\n for (const t3 in i2) n2.push(this.CreateFromMorphTargetSequence(t3, i2[t3], e2, s2));\n return n2;\n }\n resetDuration() {\n let t2 = 0;\n for (let e2 = 0, s2 = this.tracks.length; e2 !== s2; ++e2) {\n const s3 = this.tracks[e2];\n t2 = Math.max(t2, s3.times[s3.times.length - 1]);\n }\n return this.duration = t2, this;\n }\n trim() {\n for (let t2 = 0; t2 < this.tracks.length; t2++) this.tracks[t2].trim(0, this.duration);\n return this;\n }\n validate() {\n let t2 = true;\n for (let e2 = 0; e2 < this.tracks.length; e2++) t2 = t2 && this.tracks[e2].validate();\n return t2;\n }\n optimize() {\n for (let t2 = 0; t2 < this.tracks.length; t2++) this.tracks[t2].optimize();\n return this;\n }\n clone() {\n const t2 = [];\n for (let e3 = 0; e3 < this.tracks.length; e3++) t2.push(this.tracks[e3].clone());\n const e2 = new this.constructor(this.name, this.duration, t2, this.blendMode);\n return e2.userData = JSON.parse(JSON.stringify(this.userData)), e2;\n }\n toJSON() {\n return this.constructor.toJSON(this);\n }\n };\n function Tc(t2) {\n if (void 0 === t2.type)\n throw new Error(\"THREE.KeyframeTrack: track type undefined, can not parse\");\n const e2 = (function(t3) {\n switch (t3.toLowerCase()) {\n case \"scalar\":\n case \"double\":\n case \"float\":\n case \"number\":\n case \"integer\":\n return vc;\n case \"vector\":\n case \"vector2\":\n case \"vector3\":\n case \"vector4\":\n return _c;\n case \"color\":\n return bc;\n case \"quaternion\":\n return Mc;\n case \"bool\":\n case \"boolean\":\n return xc;\n case \"string\":\n return Sc;\n }\n throw new Error(\"THREE.KeyframeTrack: Unsupported typeName: \" + t3);\n })(t2.type);\n if (void 0 === t2.times) {\n const e3 = [], s2 = [];\n cc(t2.keys, e3, s2, \"value\"), t2.times = e3, t2.values = s2;\n }\n return void 0 !== e2.parse ? e2.parse(t2) : new e2(t2.name, t2.times, t2.values, t2.interpolation);\n }\n var zc = {\n enabled: false,\n files: {},\n add: function(t2, e2) {\n false !== this.enabled && (Cc(t2) || (this.files[t2] = e2));\n },\n get: function(t2) {\n if (false !== this.enabled && !Cc(t2)) return this.files[t2];\n },\n remove: function(t2) {\n delete this.files[t2];\n },\n clear: function() {\n this.files = {};\n }\n };\n function Cc(t2) {\n try {\n const e2 = t2.slice(t2.indexOf(\":\") + 1);\n return \"blob:\" === new URL(e2).protocol;\n } catch (t3) {\n return false;\n }\n }\n var Ic = class {\n constructor(t2, e2, s2) {\n const i2 = this;\n let r2, n2 = false, a2 = 0, o2 = 0;\n const h2 = [];\n this.onStart = void 0, this.onLoad = t2, this.onProgress = e2, this.onError = s2, this._abortController = null, this.itemStart = function(t3) {\n o2++, false === n2 && void 0 !== i2.onStart && i2.onStart(t3, a2, o2), n2 = true;\n }, this.itemEnd = function(t3) {\n a2++, void 0 !== i2.onProgress && i2.onProgress(t3, a2, o2), a2 === o2 && (n2 = false, void 0 !== i2.onLoad && i2.onLoad());\n }, this.itemError = function(t3) {\n void 0 !== i2.onError && i2.onError(t3);\n }, this.resolveURL = function(t3) {\n return t3 = t3.normalize(\"NFC\"), r2 ? r2(t3) : t3;\n }, this.setURLModifier = function(t3) {\n return r2 = t3, this;\n }, this.addHandler = function(t3, e3) {\n return h2.push(t3, e3), this;\n }, this.removeHandler = function(t3) {\n const e3 = h2.indexOf(t3);\n return -1 !== e3 && h2.splice(e3, 2), this;\n }, this.getHandler = function(t3) {\n for (let e3 = 0, s3 = h2.length; e3 < s3; e3 += 2) {\n const s4 = h2[e3], i3 = h2[e3 + 1];\n if (s4.global && (s4.lastIndex = 0), s4.test(t3)) return i3;\n }\n return null;\n }, this.abort = function() {\n return this.abortController.abort(), this._abortController = null, this;\n };\n }\n get abortController() {\n return this._abortController || (this._abortController = new AbortController()), this._abortController;\n }\n };\n var Bc = new Ic();\n var kc = class {\n constructor(t2) {\n this.manager = void 0 !== t2 ? t2 : Bc, this.crossOrigin = \"anonymous\", this.withCredentials = false, this.path = \"\", this.resourcePath = \"\", this.requestHeader = {}, \"undefined\" != typeof __THREE_DEVTOOLS__ && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(\"observe\", { detail: this }));\n }\n load() {\n }\n loadAsync(t2, e2) {\n const s2 = this;\n return new Promise(function(i2, r2) {\n s2.load(t2, i2, e2, r2);\n });\n }\n parse() {\n }\n setCrossOrigin(t2) {\n return this.crossOrigin = t2, this;\n }\n setWithCredentials(t2) {\n return this.withCredentials = t2, this;\n }\n setPath(t2) {\n return this.path = t2, this;\n }\n setResourcePath(t2) {\n return this.resourcePath = t2, this;\n }\n setRequestHeader(t2) {\n return this.requestHeader = t2, this;\n }\n abort() {\n return this;\n }\n };\n kc.DEFAULT_MATERIAL_NAME = \"__DEFAULT\";\n var Oc = {};\n var Pc = class extends Error {\n constructor(t2, e2) {\n super(t2), this.response = e2;\n }\n };\n var Rc = class extends kc {\n constructor(t2) {\n super(t2), this.mimeType = \"\", this.responseType = \"\", this._abortController = new AbortController();\n }\n load(t2, e2, s2, i2) {\n void 0 === t2 && (t2 = \"\"), void 0 !== this.path && (t2 = this.path + t2), t2 = this.manager.resolveURL(t2);\n const r2 = zc.get(`file:${t2}`);\n if (void 0 !== r2)\n return this.manager.itemStart(t2), void setTimeout(() => {\n e2 && e2(r2), this.manager.itemEnd(t2);\n }, 0);\n if (void 0 !== Oc[t2]) return void Oc[t2].push({ onLoad: e2, onProgress: s2, onError: i2 });\n Oc[t2] = [], Oc[t2].push({ onLoad: e2, onProgress: s2, onError: i2 });\n const n2 = new Request(t2, {\n headers: new Headers(this.requestHeader),\n credentials: this.withCredentials ? \"include\" : \"same-origin\",\n signal: \"function\" == typeof AbortSignal.any ? AbortSignal.any([this._abortController.signal, this.manager.abortController.signal]) : this._abortController.signal\n }), a2 = this.mimeType, o2 = this.responseType;\n fetch(n2).then((e3) => {\n if (200 === e3.status || 0 === e3.status) {\n if (0 === e3.status && ai(\"FileLoader: HTTP Status 0 received.\"), \"undefined\" == typeof ReadableStream || void 0 === e3.body || void 0 === e3.body.getReader)\n return e3;\n const s3 = Oc[t2], i3 = e3.body.getReader(), r3 = e3.headers.get(\"X-File-Size\") || e3.headers.get(\"Content-Length\"), n3 = r3 ? parseInt(r3) : 0, a3 = 0 !== n3;\n let o3 = 0;\n const h2 = new ReadableStream({\n start(t3) {\n !(function e4() {\n i3.read().then(\n ({ done: i4, value: r4 }) => {\n if (i4) t3.close();\n else {\n o3 += r4.byteLength;\n const i5 = new ProgressEvent(\"progress\", {\n lengthComputable: a3,\n loaded: o3,\n total: n3\n });\n for (let t4 = 0, e5 = s3.length; t4 < e5; t4++) {\n const e6 = s3[t4];\n e6.onProgress && e6.onProgress(i5);\n }\n t3.enqueue(r4), e4();\n }\n },\n (e5) => {\n t3.error(e5);\n }\n );\n })();\n }\n });\n return new Response(h2);\n }\n throw new Pc(`fetch for \"${e3.url}\" responded with ${e3.status}: ${e3.statusText}`, e3);\n }).then((t3) => {\n switch (o2) {\n case \"arraybuffer\":\n return t3.arrayBuffer();\n case \"blob\":\n return t3.blob();\n case \"document\":\n return t3.text().then((t4) => new DOMParser().parseFromString(t4, a2));\n case \"json\":\n return t3.json();\n default:\n if (\"\" === a2) return t3.text();\n {\n const e3 = /charset=\"?([^;\"\\s]*)\"?/i.exec(a2), s3 = e3 && e3[1] ? e3[1].toLowerCase() : void 0, i3 = new TextDecoder(s3);\n return t3.arrayBuffer().then((t4) => i3.decode(t4));\n }\n }\n }).then((e3) => {\n zc.add(`file:${t2}`, e3);\n const s3 = Oc[t2];\n delete Oc[t2];\n for (let t3 = 0, i3 = s3.length; t3 < i3; t3++) {\n const i4 = s3[t3];\n i4.onLoad && i4.onLoad(e3);\n }\n }).catch((e3) => {\n const s3 = Oc[t2];\n if (void 0 === s3) throw this.manager.itemError(t2), e3;\n delete Oc[t2];\n for (let t3 = 0, i3 = s3.length; t3 < i3; t3++) {\n const i4 = s3[t3];\n i4.onError && i4.onError(e3);\n }\n this.manager.itemError(t2);\n }).finally(() => {\n this.manager.itemEnd(t2);\n }), this.manager.itemStart(t2);\n }\n setResponseType(t2) {\n return this.responseType = t2, this;\n }\n setMimeType(t2) {\n return this.mimeType = t2, this;\n }\n abort() {\n return this._abortController.abort(), this._abortController = new AbortController(), this;\n }\n };\n var Ec = class extends kc {\n constructor(t2) {\n super(t2);\n }\n load(t2, e2, s2, i2) {\n const r2 = this, n2 = new Rc(this.manager);\n n2.setPath(this.path), n2.setRequestHeader(this.requestHeader), n2.setWithCredentials(this.withCredentials), n2.load(\n t2,\n function(s3) {\n try {\n e2(r2.parse(JSON.parse(s3)));\n } catch (e3) {\n i2 ? i2(e3) : oi(e3), r2.manager.itemError(t2);\n }\n },\n s2,\n i2\n );\n }\n parse(t2) {\n const e2 = [];\n for (let s2 = 0; s2 < t2.length; s2++) {\n const i2 = Ac.parse(t2[s2]);\n e2.push(i2);\n }\n return e2;\n }\n };\n var Nc = class extends kc {\n constructor(t2) {\n super(t2);\n }\n load(t2, e2, s2, i2) {\n const r2 = this, n2 = [], a2 = new ah(), o2 = new Rc(this.manager);\n o2.setPath(this.path), o2.setResponseType(\"arraybuffer\"), o2.setRequestHeader(this.requestHeader), o2.setWithCredentials(r2.withCredentials);\n let h2 = 0;\n function l2(l3) {\n o2.load(\n t2[l3],\n function(t3) {\n const s3 = r2.parse(t3, true);\n n2[l3] = { width: s3.width, height: s3.height, format: s3.format, mipmaps: s3.mipmaps }, h2 += 1, 6 === h2 && (1 === s3.mipmapCount && (a2.minFilter = Mt), a2.image = n2, a2.format = s3.format, a2.needsUpdate = true, e2 && e2(a2));\n },\n s2,\n i2\n );\n }\n if (Array.isArray(t2)) for (let e3 = 0, s3 = t2.length; e3 < s3; ++e3) l2(e3);\n else\n o2.load(\n t2,\n function(t3) {\n const s3 = r2.parse(t3, true);\n if (s3.isCubemap) {\n const t4 = s3.mipmaps.length / s3.mipmapCount;\n for (let e3 = 0; e3 < t4; e3++) {\n n2[e3] = { mipmaps: [] };\n for (let t5 = 0; t5 < s3.mipmapCount; t5++)\n n2[e3].mipmaps.push(s3.mipmaps[e3 * s3.mipmapCount + t5]), n2[e3].format = s3.format, n2[e3].width = s3.width, n2[e3].height = s3.height;\n }\n a2.image = n2;\n } else a2.image.width = s3.width, a2.image.height = s3.height, a2.mipmaps = s3.mipmaps;\n 1 === s3.mipmapCount && (a2.minFilter = Mt), a2.format = s3.format, a2.needsUpdate = true, e2 && e2(a2);\n },\n s2,\n i2\n );\n return a2;\n }\n };\n var Vc = /* @__PURE__ */ new WeakMap();\n var Lc = class extends kc {\n constructor(t2) {\n super(t2);\n }\n load(t2, e2, s2, i2) {\n void 0 !== this.path && (t2 = this.path + t2), t2 = this.manager.resolveURL(t2);\n const r2 = this, n2 = zc.get(`image:${t2}`);\n if (void 0 !== n2) {\n if (true === n2.complete)\n r2.manager.itemStart(t2), setTimeout(function() {\n e2 && e2(n2), r2.manager.itemEnd(t2);\n }, 0);\n else {\n let t3 = Vc.get(n2);\n void 0 === t3 && (t3 = [], Vc.set(n2, t3)), t3.push({ onLoad: e2, onError: i2 });\n }\n return n2;\n }\n const a2 = Qs(\"img\");\n function o2() {\n l2(), e2 && e2(this);\n const s3 = Vc.get(this) || [];\n for (let t3 = 0; t3 < s3.length; t3++) {\n const e3 = s3[t3];\n e3.onLoad && e3.onLoad(this);\n }\n Vc.delete(this), r2.manager.itemEnd(t2);\n }\n function h2(e3) {\n l2(), i2 && i2(e3), zc.remove(`image:${t2}`);\n const s3 = Vc.get(this) || [];\n for (let t3 = 0; t3 < s3.length; t3++) {\n const i3 = s3[t3];\n i3.onError && i3.onError(e3);\n }\n Vc.delete(this), r2.manager.itemError(t2), r2.manager.itemEnd(t2);\n }\n function l2() {\n a2.removeEventListener(\"load\", o2, false), a2.removeEventListener(\"error\", h2, false);\n }\n return a2.addEventListener(\"load\", o2, false), a2.addEventListener(\"error\", h2, false), \"data:\" !== t2.slice(0, 5) && void 0 !== this.crossOrigin && (a2.crossOrigin = this.crossOrigin), zc.add(`image:${t2}`, a2), r2.manager.itemStart(t2), a2.src = t2, a2;\n }\n };\n var Fc = class extends kc {\n constructor(t2) {\n super(t2);\n }\n load(t2, e2, s2, i2) {\n const r2 = new lh();\n r2.colorSpace = es;\n const n2 = new Lc(this.manager);\n n2.setCrossOrigin(this.crossOrigin), n2.setPath(this.path);\n let a2 = 0;\n function o2(s3) {\n n2.load(\n t2[s3],\n function(t3) {\n r2.images[s3] = t3, a2++, 6 === a2 && (r2.needsUpdate = true, e2 && e2(r2));\n },\n void 0,\n i2\n );\n }\n for (let e3 = 0; e3 < t2.length; ++e3) o2(e3);\n return r2;\n }\n };\n var Dc = class extends kc {\n constructor(t2) {\n super(t2);\n }\n load(t2, e2, s2, i2) {\n const r2 = this, n2 = new Xa(), a2 = new Rc(this.manager);\n return a2.setResponseType(\"arraybuffer\"), a2.setRequestHeader(this.requestHeader), a2.setPath(this.path), a2.setWithCredentials(r2.withCredentials), a2.load(\n t2,\n function(t3) {\n let s3;\n try {\n s3 = r2.parse(t3);\n } catch (t4) {\n return void (void 0 !== i2 ? i2(t4) : oi(t4));\n }\n r2._applyTexData(n2, s3), e2 && e2(n2, s3);\n },\n s2,\n i2\n ), n2;\n }\n createDataTexture(t2) {\n const e2 = new Xa();\n return this._applyTexData(e2, this.parse(t2)), e2;\n }\n _applyTexData(t2, e2) {\n void 0 !== e2.image ? t2.image = e2.image : void 0 !== e2.data && (t2.image.width = e2.width, t2.image.height = e2.height, t2.image.data = e2.data), t2.wrapS = void 0 !== e2.wrapS ? e2.wrapS : yt, t2.wrapT = void 0 !== e2.wrapT ? e2.wrapT : yt, t2.magFilter = void 0 !== e2.magFilter ? e2.magFilter : Mt, t2.minFilter = void 0 !== e2.minFilter ? e2.minFilter : Mt, t2.anisotropy = void 0 !== e2.anisotropy ? e2.anisotropy : 1, void 0 !== e2.colorSpace && (t2.colorSpace = e2.colorSpace), void 0 !== e2.flipY && (t2.flipY = e2.flipY), void 0 !== e2.format && (t2.format = e2.format), void 0 !== e2.type && (t2.type = e2.type), void 0 !== e2.mipmaps && (t2.mipmaps = e2.mipmaps, t2.minFilter = At), 1 === e2.mipmapCount && (t2.minFilter = Mt), void 0 !== e2.generateMipmaps && (t2.generateMipmaps = e2.generateMipmaps), t2.needsUpdate = true;\n }\n };\n var Uc = class extends kc {\n constructor(t2) {\n super(t2);\n }\n load(t2, e2, s2, i2) {\n const r2 = new Ji(), n2 = new Lc(this.manager);\n return n2.setCrossOrigin(this.crossOrigin), n2.setPath(this.path), n2.load(\n t2,\n function(t3) {\n r2.image = t3, r2.needsUpdate = true, void 0 !== e2 && e2(r2);\n },\n s2,\n i2\n ), r2;\n }\n };\n var jc = class extends Ar {\n constructor(t2, e2 = 1) {\n super(), this.isLight = true, this.type = \"Light\", this.color = new Pr(t2), this.intensity = e2;\n }\n dispose() {\n this.dispatchEvent({ type: \"dispose\" });\n }\n copy(t2, e2) {\n return super.copy(t2, e2), this.color.copy(t2.color), this.intensity = t2.intensity, this;\n }\n toJSON(t2) {\n const e2 = super.toJSON(t2);\n return e2.object.color = this.color.getHex(), e2.object.intensity = this.intensity, e2;\n }\n };\n var Wc = class extends jc {\n constructor(t2, e2, s2) {\n super(t2, s2), this.isHemisphereLight = true, this.type = \"HemisphereLight\", this.position.copy(Ar.DEFAULT_UP), this.updateMatrix(), this.groundColor = new Pr(e2);\n }\n copy(t2, e2) {\n return super.copy(t2, e2), this.groundColor.copy(t2.groundColor), this;\n }\n toJSON(t2) {\n const e2 = super.toJSON(t2);\n return e2.object.groundColor = this.groundColor.getHex(), e2;\n }\n };\n var Jc = new Qi();\n var qc = new Ti();\n var Hc = new Ti();\n var Xc = class {\n constructor(t2) {\n this.camera = t2, this.intensity = 1, this.bias = 0, this.biasNode = null, this.normalBias = 0, this.radius = 1, this.blurSamples = 8, this.mapSize = new _i(512, 512), this.mapType = zt, this.map = null, this.mapPass = null, this.matrix = new Qi(), this.autoUpdate = true, this.needsUpdate = false, this._frustum = new mo(), this._frameExtents = new _i(1, 1), this._viewportCount = 1, this._viewports = [new qi(0, 0, 1, 1)];\n }\n getViewportCount() {\n return this._viewportCount;\n }\n getFrustum() {\n return this._frustum;\n }\n updateMatrices(t2) {\n const e2 = this.camera, s2 = this.matrix;\n qc.setFromMatrixPosition(t2.matrixWorld), e2.position.copy(qc), Hc.setFromMatrixPosition(t2.target.matrixWorld), e2.lookAt(Hc), e2.updateMatrixWorld(), Jc.multiplyMatrices(e2.projectionMatrix, e2.matrixWorldInverse), this._frustum.setFromProjectionMatrix(Jc, e2.coordinateSystem, e2.reversedDepth), e2.coordinateSystem === Js || e2.reversedDepth ? s2.set(0.5, 0, 0, 0.5, 0, 0.5, 0, 0.5, 0, 0, 1, 0, 0, 0, 0, 1) : s2.set(0.5, 0, 0, 0.5, 0, 0.5, 0, 0.5, 0, 0, 0.5, 0.5, 0, 0, 0, 1), s2.multiply(Jc);\n }\n getViewport(t2) {\n return this._viewports[t2];\n }\n getFrameExtents() {\n return this._frameExtents;\n }\n dispose() {\n this.map && this.map.dispose(), this.mapPass && this.mapPass.dispose();\n }\n copy(t2) {\n return this.camera = t2.camera.clone(), this.intensity = t2.intensity, this.bias = t2.bias, this.radius = t2.radius, this.autoUpdate = t2.autoUpdate, this.needsUpdate = t2.needsUpdate, this.normalBias = t2.normalBias, this.blurSamples = t2.blurSamples, this.mapSize.copy(t2.mapSize), this.biasNode = t2.biasNode, this;\n }\n clone() {\n return new this.constructor().copy(this);\n }\n toJSON() {\n const t2 = {};\n return 1 !== this.intensity && (t2.intensity = this.intensity), 0 !== this.bias && (t2.bias = this.bias), 0 !== this.normalBias && (t2.normalBias = this.normalBias), 1 !== this.radius && (t2.radius = this.radius), 512 === this.mapSize.x && 512 === this.mapSize.y || (t2.mapSize = this.mapSize.toArray()), t2.camera = this.camera.toJSON(false).object, delete t2.camera.matrix, t2;\n }\n };\n var Yc = new Ti();\n var Zc = new Ai();\n var Gc = new Ti();\n var $c = class extends Ar {\n constructor() {\n super(), this.isCamera = true, this.type = \"Camera\", this.matrixWorldInverse = new Qi(), this.projectionMatrix = new Qi(), this.projectionMatrixInverse = new Qi(), this.coordinateSystem = Ws, this._reversedDepth = false;\n }\n get reversedDepth() {\n return this._reversedDepth;\n }\n copy(t2, e2) {\n return super.copy(t2, e2), this.matrixWorldInverse.copy(t2.matrixWorldInverse), this.projectionMatrix.copy(t2.projectionMatrix), this.projectionMatrixInverse.copy(t2.projectionMatrixInverse), this.coordinateSystem = t2.coordinateSystem, this;\n }\n getWorldDirection(t2) {\n return super.getWorldDirection(t2).negate();\n }\n updateMatrixWorld(t2) {\n super.updateMatrixWorld(t2), this.matrixWorld.decompose(Yc, Zc, Gc), 1 === Gc.x && 1 === Gc.y && 1 === Gc.z ? this.matrixWorldInverse.copy(this.matrixWorld).invert() : this.matrixWorldInverse.compose(Yc, Zc, Gc.set(1, 1, 1)).invert();\n }\n updateWorldMatrix(t2, e2, s2 = false) {\n super.updateWorldMatrix(t2, e2, s2), this.matrixWorld.decompose(Yc, Zc, Gc), 1 === Gc.x && 1 === Gc.y && 1 === Gc.z ? this.matrixWorldInverse.copy(this.matrixWorld).invert() : this.matrixWorldInverse.compose(Yc, Zc, Gc.set(1, 1, 1)).invert();\n }\n clone() {\n return new this.constructor().copy(this);\n }\n };\n var Qc = new Ti();\n var Kc = new _i();\n var tu = new _i();\n var eu = class extends $c {\n constructor(t2 = 50, e2 = 1, s2 = 0.1, i2 = 2e3) {\n super(), this.isPerspectiveCamera = true, this.type = \"PerspectiveCamera\", this.fov = t2, this.zoom = 1, this.near = s2, this.far = i2, this.focus = 10, this.aspect = e2, this.view = null, this.filmGauge = 35, this.filmOffset = 0, this.updateProjectionMatrix();\n }\n copy(t2, e2) {\n return super.copy(t2, e2), this.fov = t2.fov, this.zoom = t2.zoom, this.near = t2.near, this.far = t2.far, this.focus = t2.focus, this.aspect = t2.aspect, this.view = null === t2.view ? null : Object.assign({}, t2.view), this.filmGauge = t2.filmGauge, this.filmOffset = t2.filmOffset, this;\n }\n setFocalLength(t2) {\n const e2 = 0.5 * this.getFilmHeight() / t2;\n this.fov = 2 * gi * Math.atan(e2), this.updateProjectionMatrix();\n }\n getFocalLength() {\n const t2 = Math.tan(0.5 * yi * this.fov);\n return 0.5 * this.getFilmHeight() / t2;\n }\n getEffectiveFOV() {\n return 2 * gi * Math.atan(Math.tan(0.5 * yi * this.fov) / this.zoom);\n }\n getFilmWidth() {\n return this.filmGauge * Math.min(this.aspect, 1);\n }\n getFilmHeight() {\n return this.filmGauge / Math.max(this.aspect, 1);\n }\n getViewBounds(t2, e2, s2) {\n Qc.set(-1, -1, 0.5).applyMatrix4(this.projectionMatrixInverse), e2.set(Qc.x, Qc.y).multiplyScalar(-t2 / Qc.z), Qc.set(1, 1, 0.5).applyMatrix4(this.projectionMatrixInverse), s2.set(Qc.x, Qc.y).multiplyScalar(-t2 / Qc.z);\n }\n getViewSize(t2, e2) {\n return this.getViewBounds(t2, Kc, tu), e2.subVectors(tu, Kc);\n }\n setViewOffset(t2, e2, s2, i2, r2, n2) {\n this.aspect = t2 / e2, null === this.view && (this.view = {\n enabled: true,\n fullWidth: 1,\n fullHeight: 1,\n offsetX: 0,\n offsetY: 0,\n width: 1,\n height: 1\n }), this.view.enabled = true, this.view.fullWidth = t2, this.view.fullHeight = e2, this.view.offsetX = s2, this.view.offsetY = i2, this.view.width = r2, this.view.height = n2, this.updateProjectionMatrix();\n }\n clearViewOffset() {\n null !== this.view && (this.view.enabled = false), this.updateProjectionMatrix();\n }\n updateProjectionMatrix() {\n const t2 = this.near;\n let e2 = t2 * Math.tan(0.5 * yi * this.fov) / this.zoom, s2 = 2 * e2, i2 = this.aspect * s2, r2 = -0.5 * i2;\n const n2 = this.view;\n if (null !== this.view && this.view.enabled) {\n const t3 = n2.fullWidth, a3 = n2.fullHeight;\n r2 += n2.offsetX * i2 / t3, e2 -= n2.offsetY * s2 / a3, i2 *= n2.width / t3, s2 *= n2.height / a3;\n }\n const a2 = this.filmOffset;\n 0 !== a2 && (r2 += t2 * a2 / this.getFilmWidth()), this.projectionMatrix.makePerspective(\n r2,\n r2 + i2,\n e2,\n e2 - s2,\n t2,\n this.far,\n this.coordinateSystem,\n this.reversedDepth\n ), this.projectionMatrixInverse.copy(this.projectionMatrix).invert();\n }\n toJSON(t2) {\n const e2 = super.toJSON(t2);\n return e2.object.fov = this.fov, e2.object.zoom = this.zoom, e2.object.near = this.near, e2.object.far = this.far, e2.object.focus = this.focus, e2.object.aspect = this.aspect, null !== this.view && (e2.object.view = Object.assign({}, this.view)), e2.object.filmGauge = this.filmGauge, e2.object.filmOffset = this.filmOffset, e2;\n }\n };\n var su = class extends Xc {\n constructor() {\n super(new eu(50, 1, 0.5, 500)), this.isSpotLightShadow = true, this.focus = 1, this.aspect = 1;\n }\n updateMatrices(t2) {\n const e2 = this.camera, s2 = 2 * gi * t2.angle * this.focus, i2 = this.mapSize.width / this.mapSize.height * this.aspect, r2 = t2.distance || e2.far;\n s2 === e2.fov && i2 === e2.aspect && r2 === e2.far || (e2.fov = s2, e2.aspect = i2, e2.far = r2, e2.updateProjectionMatrix()), super.updateMatrices(t2);\n }\n copy(t2) {\n return super.copy(t2), this.focus = t2.focus, this;\n }\n };\n var iu = class extends jc {\n constructor(t2, e2, s2 = 0, i2 = Math.PI / 3, r2 = 0, n2 = 2) {\n super(t2, e2), this.isSpotLight = true, this.type = \"SpotLight\", this.position.copy(Ar.DEFAULT_UP), this.updateMatrix(), this.target = new Ar(), this.distance = s2, this.angle = i2, this.penumbra = r2, this.decay = n2, this.map = null, this.shadow = new su();\n }\n get power() {\n return this.intensity * Math.PI;\n }\n set power(t2) {\n this.intensity = t2 / Math.PI;\n }\n dispose() {\n super.dispose(), this.shadow.dispose();\n }\n copy(t2, e2) {\n return super.copy(t2, e2), this.distance = t2.distance, this.angle = t2.angle, this.penumbra = t2.penumbra, this.decay = t2.decay, this.target = t2.target.clone(), this.map = t2.map, this.shadow = t2.shadow.clone(), this;\n }\n toJSON(t2) {\n const e2 = super.toJSON(t2);\n return e2.object.distance = this.distance, e2.object.angle = this.angle, e2.object.decay = this.decay, e2.object.penumbra = this.penumbra, e2.object.target = this.target.uuid, this.map && this.map.isTexture && (e2.object.map = this.map.toJSON(t2).uuid), e2.object.shadow = this.shadow.toJSON(), e2;\n }\n };\n var ru = class extends Xc {\n constructor() {\n super(new eu(90, 1, 0.5, 500)), this.isPointLightShadow = true;\n }\n };\n var nu = class extends jc {\n constructor(t2, e2, s2 = 0, i2 = 2) {\n super(t2, e2), this.isPointLight = true, this.type = \"PointLight\", this.distance = s2, this.decay = i2, this.shadow = new ru();\n }\n get power() {\n return 4 * this.intensity * Math.PI;\n }\n set power(t2) {\n this.intensity = t2 / (4 * Math.PI);\n }\n dispose() {\n super.dispose(), this.shadow.dispose();\n }\n copy(t2, e2) {\n return super.copy(t2, e2), this.distance = t2.distance, this.decay = t2.decay, this.shadow = t2.shadow.clone(), this;\n }\n toJSON(t2) {\n const e2 = super.toJSON(t2);\n return e2.object.distance = this.distance, e2.object.decay = this.decay, e2.object.shadow = this.shadow.toJSON(), e2;\n }\n };\n var au = class extends $c {\n constructor(t2 = -1, e2 = 1, s2 = 1, i2 = -1, r2 = 0.1, n2 = 2e3) {\n super(), this.isOrthographicCamera = true, this.type = \"OrthographicCamera\", this.zoom = 1, this.view = null, this.left = t2, this.right = e2, this.top = s2, this.bottom = i2, this.near = r2, this.far = n2, this.updateProjectionMatrix();\n }\n copy(t2, e2) {\n return super.copy(t2, e2), this.left = t2.left, this.right = t2.right, this.top = t2.top, this.bottom = t2.bottom, this.near = t2.near, this.far = t2.far, this.zoom = t2.zoom, this.view = null === t2.view ? null : Object.assign({}, t2.view), this;\n }\n setViewOffset(t2, e2, s2, i2, r2, n2) {\n null === this.view && (this.view = {\n enabled: true,\n fullWidth: 1,\n fullHeight: 1,\n offsetX: 0,\n offsetY: 0,\n width: 1,\n height: 1\n }), this.view.enabled = true, this.view.fullWidth = t2, this.view.fullHeight = e2, this.view.offsetX = s2, this.view.offsetY = i2, this.view.width = r2, this.view.height = n2, this.updateProjectionMatrix();\n }\n clearViewOffset() {\n null !== this.view && (this.view.enabled = false), this.updateProjectionMatrix();\n }\n updateProjectionMatrix() {\n const t2 = (this.right - this.left) / (2 * this.zoom), e2 = (this.top - this.bottom) / (2 * this.zoom), s2 = (this.right + this.left) / 2, i2 = (this.top + this.bottom) / 2;\n let r2 = s2 - t2, n2 = s2 + t2, a2 = i2 + e2, o2 = i2 - e2;\n if (null !== this.view && this.view.enabled) {\n const t3 = (this.right - this.left) / this.view.fullWidth / this.zoom, e3 = (this.top - this.bottom) / this.view.fullHeight / this.zoom;\n r2 += t3 * this.view.offsetX, n2 = r2 + t3 * this.view.width, a2 -= e3 * this.view.offsetY, o2 = a2 - e3 * this.view.height;\n }\n this.projectionMatrix.makeOrthographic(\n r2,\n n2,\n a2,\n o2,\n this.near,\n this.far,\n this.coordinateSystem,\n this.reversedDepth\n ), this.projectionMatrixInverse.copy(this.projectionMatrix).invert();\n }\n toJSON(t2) {\n const e2 = super.toJSON(t2);\n return e2.object.zoom = this.zoom, e2.object.left = this.left, e2.object.right = this.right, e2.object.top = this.top, e2.object.bottom = this.bottom, e2.object.near = this.near, e2.object.far = this.far, null !== this.view && (e2.object.view = Object.assign({}, this.view)), e2;\n }\n };\n var ou = class extends Xc {\n constructor() {\n super(new au(-5, 5, 5, -5, 0.5, 500)), this.isDirectionalLightShadow = true;\n }\n };\n var hu = class extends jc {\n constructor(t2, e2) {\n super(t2, e2), this.isDirectionalLight = true, this.type = \"DirectionalLight\", this.position.copy(Ar.DEFAULT_UP), this.updateMatrix(), this.target = new Ar(), this.shadow = new ou();\n }\n dispose() {\n super.dispose(), this.shadow.dispose();\n }\n copy(t2) {\n return super.copy(t2), this.target = t2.target.clone(), this.shadow = t2.shadow.clone(), this;\n }\n toJSON(t2) {\n const e2 = super.toJSON(t2);\n return e2.object.shadow = this.shadow.toJSON(), e2.object.target = this.target.uuid, e2;\n }\n };\n var lu = class extends jc {\n constructor(t2, e2) {\n super(t2, e2), this.isAmbientLight = true, this.type = \"AmbientLight\";\n }\n };\n var cu = class extends jc {\n constructor(t2, e2, s2 = 10, i2 = 10) {\n super(t2, e2), this.isRectAreaLight = true, this.type = \"RectAreaLight\", this.width = s2, this.height = i2;\n }\n get power() {\n return this.intensity * this.width * this.height * Math.PI;\n }\n set power(t2) {\n this.intensity = t2 / (this.width * this.height * Math.PI);\n }\n copy(t2) {\n return super.copy(t2), this.width = t2.width, this.height = t2.height, this;\n }\n toJSON(t2) {\n const e2 = super.toJSON(t2);\n return e2.object.width = this.width, e2.object.height = this.height, e2;\n }\n };\n var uu = class {\n constructor() {\n this.isSphericalHarmonics3 = true, this.coefficients = [];\n for (let t2 = 0; t2 < 9; t2++) this.coefficients.push(new Ti());\n }\n set(t2) {\n for (let e2 = 0; e2 < 9; e2++) this.coefficients[e2].copy(t2[e2]);\n return this;\n }\n zero() {\n for (let t2 = 0; t2 < 9; t2++) this.coefficients[t2].set(0, 0, 0);\n return this;\n }\n getAt(t2, e2) {\n const s2 = t2.x, i2 = t2.y, r2 = t2.z, n2 = this.coefficients;\n return e2.copy(n2[0]).multiplyScalar(0.282095), e2.addScaledVector(n2[1], 0.488603 * i2), e2.addScaledVector(n2[2], 0.488603 * r2), e2.addScaledVector(n2[3], 0.488603 * s2), e2.addScaledVector(n2[4], s2 * i2 * 1.092548), e2.addScaledVector(n2[5], i2 * r2 * 1.092548), e2.addScaledVector(n2[6], 0.315392 * (3 * r2 * r2 - 1)), e2.addScaledVector(n2[7], s2 * r2 * 1.092548), e2.addScaledVector(n2[8], 0.546274 * (s2 * s2 - i2 * i2)), e2;\n }\n getIrradianceAt(t2, e2) {\n const s2 = t2.x, i2 = t2.y, r2 = t2.z, n2 = this.coefficients;\n return e2.copy(n2[0]).multiplyScalar(0.886227), e2.addScaledVector(n2[1], 1.023328 * i2), e2.addScaledVector(n2[2], 1.023328 * r2), e2.addScaledVector(n2[3], 1.023328 * s2), e2.addScaledVector(n2[4], 0.858086 * s2 * i2), e2.addScaledVector(n2[5], 0.858086 * i2 * r2), e2.addScaledVector(n2[6], 0.743125 * r2 * r2 - 0.247708), e2.addScaledVector(n2[7], 0.858086 * s2 * r2), e2.addScaledVector(n2[8], 0.429043 * (s2 * s2 - i2 * i2)), e2;\n }\n add(t2) {\n for (let e2 = 0; e2 < 9; e2++) this.coefficients[e2].add(t2.coefficients[e2]);\n return this;\n }\n addScaledSH(t2, e2) {\n for (let s2 = 0; s2 < 9; s2++) this.coefficients[s2].addScaledVector(t2.coefficients[s2], e2);\n return this;\n }\n scale(t2) {\n for (let e2 = 0; e2 < 9; e2++) this.coefficients[e2].multiplyScalar(t2);\n return this;\n }\n lerp(t2, e2) {\n for (let s2 = 0; s2 < 9; s2++) this.coefficients[s2].lerp(t2.coefficients[s2], e2);\n return this;\n }\n equals(t2) {\n for (let e2 = 0; e2 < 9; e2++) if (!this.coefficients[e2].equals(t2.coefficients[e2])) return false;\n return true;\n }\n copy(t2) {\n return this.set(t2.coefficients);\n }\n clone() {\n return new this.constructor().copy(this);\n }\n fromArray(t2, e2 = 0) {\n const s2 = this.coefficients;\n for (let i2 = 0; i2 < 9; i2++) s2[i2].fromArray(t2, e2 + 3 * i2);\n return this;\n }\n toArray(t2 = [], e2 = 0) {\n const s2 = this.coefficients;\n for (let i2 = 0; i2 < 9; i2++) s2[i2].toArray(t2, e2 + 3 * i2);\n return t2;\n }\n static getBasisAt(t2, e2) {\n const s2 = t2.x, i2 = t2.y, r2 = t2.z;\n e2[0] = 0.282095, e2[1] = 0.488603 * i2, e2[2] = 0.488603 * r2, e2[3] = 0.488603 * s2, e2[4] = 1.092548 * s2 * i2, e2[5] = 1.092548 * i2 * r2, e2[6] = 0.315392 * (3 * r2 * r2 - 1), e2[7] = 1.092548 * s2 * r2, e2[8] = 0.546274 * (s2 * s2 - i2 * i2);\n }\n };\n var du = class extends jc {\n constructor(t2 = new uu(), e2 = 1) {\n super(void 0, e2), this.isLightProbe = true, this.sh = t2;\n }\n copy(t2) {\n return super.copy(t2), this.sh.copy(t2.sh), this;\n }\n toJSON(t2) {\n const e2 = super.toJSON(t2);\n return e2.object.sh = this.sh.toArray(), e2;\n }\n };\n var pu = {};\n var mu = class _mu extends kc {\n constructor(t2) {\n super(t2), this.textures = {};\n }\n load(t2, e2, s2, i2) {\n const r2 = this, n2 = new Rc(r2.manager);\n n2.setPath(r2.path), n2.setRequestHeader(r2.requestHeader), n2.setWithCredentials(r2.withCredentials), n2.load(\n t2,\n function(s3) {\n try {\n e2(r2.parse(JSON.parse(s3)));\n } catch (e3) {\n i2 ? i2(e3) : oi(e3), r2.manager.itemError(t2);\n }\n },\n s2,\n i2\n );\n }\n parse(t2) {\n const e2 = this.createMaterialFromType(t2.type);\n return e2.fromJSON(t2, this.textures), e2;\n }\n setTextures(t2) {\n return this.textures = t2, this;\n }\n createMaterialFromType(t2) {\n return _mu.createMaterialFromType(t2);\n }\n static createMaterialFromType(t2) {\n const e2 = {\n ShadowMaterial: Wl,\n SpriteMaterial: Gn,\n RawShaderMaterial: Gl,\n ShaderMaterial: Zl,\n PointsMaterial: Go,\n MeshPhysicalMaterial: Ql,\n MeshStandardMaterial: $l,\n MeshPhongMaterial: Kl,\n MeshToonMaterial: tc,\n MeshNormalMaterial: ec,\n MeshLambertMaterial: sc,\n MeshDepthMaterial: ic,\n MeshDistanceMaterial: rc,\n MeshBasicMaterial: Ma,\n MeshMatcapMaterial: nc,\n LineDashedMaterial: ac,\n LineBasicMaterial: No,\n Material: Zn,\n ...pu\n }[t2];\n let s2;\n return void 0 === e2 ? (hi(\n `MaterialLoader: Unknown material type \"${t2}\". Use .registerMaterial() before starting the deserialization process.`\n ), s2 = new Zn()) : s2 = new e2(), s2;\n }\n static registerMaterial(t2, e2) {\n pu[t2] = e2;\n }\n };\n var yu = class {\n static extractUrlBase(t2) {\n const e2 = t2.lastIndexOf(\"/\");\n return -1 === e2 ? \"./\" : t2.slice(0, e2 + 1);\n }\n static resolveURL(t2, e2) {\n return \"string\" != typeof t2 || \"\" === t2 ? \"\" : (/^https?:\\/\\//i.test(e2) && /^\\//.test(t2) && (e2 = e2.replace(/(^https?:\\/\\/[^\\/]+).*/i, \"$1\")), /^(https?:)?\\/\\//i.test(t2) || /^data:.*,.*$/i.test(t2) || /^blob:.*$/i.test(t2) ? t2 : e2 + t2);\n }\n };\n var gu = class extends Wn {\n constructor() {\n super(), this.isInstancedBufferGeometry = true, this.type = \"InstancedBufferGeometry\", this.instanceCount = 1 / 0;\n }\n copy(t2) {\n return super.copy(t2), this.instanceCount = t2.instanceCount, this;\n }\n toJSON() {\n const t2 = super.toJSON();\n return t2.instanceCount = this.instanceCount, t2.isInstancedBufferGeometry = true, t2;\n }\n };\n var fu = class extends kc {\n constructor(t2) {\n super(t2);\n }\n load(t2, e2, s2, i2) {\n const r2 = this, n2 = new Rc(r2.manager);\n n2.setPath(r2.path), n2.setRequestHeader(r2.requestHeader), n2.setWithCredentials(r2.withCredentials), n2.load(\n t2,\n function(s3) {\n try {\n e2(r2.parse(JSON.parse(s3)));\n } catch (e3) {\n i2 ? i2(e3) : oi(e3), r2.manager.itemError(t2);\n }\n },\n s2,\n i2\n );\n }\n parse(t2) {\n const e2 = {}, s2 = {};\n function i2(t3, i3) {\n if (void 0 !== e2[i3]) return e2[i3];\n const r3 = t3.interleavedBuffers[i3], n3 = (function(t4, e3) {\n if (void 0 !== s2[e3]) return s2[e3];\n const i4 = t4.arrayBuffers, r4 = i4[e3], n4 = new Uint32Array(r4).buffer;\n return s2[e3] = n4, n4;\n })(t3, r3.buffer), a3 = Gs(r3.type, n3), o3 = new Jn(a3, r3.stride);\n return o3.uuid = r3.uuid, e2[i3] = o3, o3;\n }\n const r2 = t2.isInstancedBufferGeometry ? new gu() : new Wn(), n2 = t2.data.index;\n if (void 0 !== n2) {\n const t3 = Gs(n2.type, n2.array);\n r2.setIndex(new Mn(t3, 1));\n }\n const a2 = t2.data.attributes;\n for (const e3 in a2) {\n const s3 = a2[e3];\n let n3;\n if (s3.isInterleavedBufferAttribute) {\n const e4 = i2(t2.data, s3.data);\n n3 = new Hn(e4, s3.itemSize, s3.offset, s3.normalized);\n } else {\n const t3 = Gs(s3.type, s3.array);\n n3 = new (s3.isInstancedBufferAttribute ? $a : Mn)(t3, s3.itemSize, s3.normalized);\n }\n void 0 !== s3.name && (n3.name = s3.name), void 0 !== s3.usage && n3.setUsage(s3.usage), r2.setAttribute(e3, n3);\n }\n const o2 = t2.data.morphAttributes;\n if (o2)\n for (const e3 in o2) {\n const s3 = o2[e3], n3 = [];\n for (let e4 = 0, r3 = s3.length; e4 < r3; e4++) {\n const r4 = s3[e4];\n let a3;\n if (r4.isInterleavedBufferAttribute) {\n const e5 = i2(t2.data, r4.data);\n a3 = new Hn(e5, r4.itemSize, r4.offset, r4.normalized);\n } else {\n const t3 = Gs(r4.type, r4.array);\n a3 = new Mn(t3, r4.itemSize, r4.normalized);\n }\n void 0 !== r4.name && (a3.name = r4.name), n3.push(a3);\n }\n r2.morphAttributes[e3] = n3;\n }\n t2.data.morphTargetsRelative && (r2.morphTargetsRelative = true);\n const h2 = t2.data.groups || t2.data.drawcalls || t2.data.offsets;\n if (void 0 !== h2)\n for (let t3 = 0, e3 = h2.length; t3 !== e3; ++t3) {\n const e4 = h2[t3];\n r2.addGroup(e4.start, e4.count, e4.materialIndex);\n }\n const l2 = t2.data.boundingSphere;\n return void 0 !== l2 && (r2.boundingSphere = new En().fromJSON(l2)), t2.name && (r2.name = t2.name), t2.userData && (r2.userData = t2.userData), r2;\n }\n };\n var xu = {};\n var bu = class extends kc {\n constructor(t2) {\n super(t2);\n }\n load(t2, e2, s2, i2) {\n const r2 = this, n2 = \"\" === this.path ? yu.extractUrlBase(t2) : this.path;\n this.resourcePath = this.resourcePath || n2;\n const a2 = new Rc(this.manager);\n a2.setPath(this.path), a2.setRequestHeader(this.requestHeader), a2.setWithCredentials(this.withCredentials), a2.load(\n t2,\n function(s3) {\n let n3 = null;\n try {\n n3 = JSON.parse(s3);\n } catch (e3) {\n return void 0 !== i2 && i2(e3), void oi(\"ObjectLoader: Can't parse \" + t2 + \".\", e3.message);\n }\n const a3 = n3.metadata;\n if (void 0 === a3 || void 0 === a3.type || \"geometry\" === a3.type.toLowerCase())\n return void 0 !== i2 && i2(new Error(\"THREE.ObjectLoader: Can't load \" + t2)), void oi(\"ObjectLoader: Can't load \" + t2);\n r2.parse(n3, e2);\n },\n s2,\n i2\n );\n }\n async loadAsync(t2, e2) {\n const s2 = \"\" === this.path ? yu.extractUrlBase(t2) : this.path;\n this.resourcePath = this.resourcePath || s2;\n const i2 = new Rc(this.manager);\n i2.setPath(this.path), i2.setRequestHeader(this.requestHeader), i2.setWithCredentials(this.withCredentials);\n const r2 = await i2.loadAsync(t2, e2);\n let n2;\n try {\n n2 = JSON.parse(r2);\n } catch (e3) {\n throw new Error(\"THREE.ObjectLoader: Can't parse \" + t2 + \". \" + e3.message);\n }\n const a2 = n2.metadata;\n if (void 0 === a2 || void 0 === a2.type || \"geometry\" === a2.type.toLowerCase())\n throw new Error(\"THREE.ObjectLoader: Can't load \" + t2);\n return await this.parseAsync(n2);\n }\n parse(t2, e2) {\n const s2 = this.parseAnimations(t2.animations), i2 = this.parseShapes(t2.shapes), r2 = this.parseGeometries(t2.geometries, i2), n2 = this.parseImages(t2.images, function() {\n void 0 !== e2 && e2(h2);\n }), a2 = this.parseTextures(t2.textures, n2), o2 = this.parseMaterials(t2.materials, a2), h2 = this.parseObject(t2.object, r2, o2, a2, s2), l2 = this.parseSkeletons(t2.skeletons, h2);\n if (this.bindSkeletons(h2, l2), this.bindLightTargets(h2), void 0 !== e2) {\n let t3 = false;\n for (const e3 in n2)\n if (n2[e3].data instanceof HTMLImageElement) {\n t3 = true;\n break;\n }\n false === t3 && e2(h2);\n }\n return h2;\n }\n async parseAsync(t2) {\n const e2 = this.parseAnimations(t2.animations), s2 = this.parseShapes(t2.shapes), i2 = this.parseGeometries(t2.geometries, s2), r2 = await this.parseImagesAsync(t2.images), n2 = this.parseTextures(t2.textures, r2), a2 = this.parseMaterials(t2.materials, n2), o2 = this.parseObject(t2.object, i2, a2, n2, e2), h2 = this.parseSkeletons(t2.skeletons, o2);\n return this.bindSkeletons(o2, h2), this.bindLightTargets(o2), o2;\n }\n static registerGeometry(t2, e2) {\n xu[t2] = e2;\n }\n parseShapes(t2) {\n const e2 = {};\n if (void 0 !== t2)\n for (let s2 = 0, i2 = t2.length; s2 < i2; s2++) {\n const i3 = new Gh().fromJSON(t2[s2]);\n e2[i3.uuid] = i3;\n }\n return e2;\n }\n parseSkeletons(t2, e2) {\n const s2 = {}, i2 = {};\n if (e2.traverse(function(t3) {\n t3.isBone && (i2[t3.uuid] = t3);\n }), void 0 !== t2)\n for (let e3 = 0, r2 = t2.length; e3 < r2; e3++) {\n const r3 = new Ga().fromJSON(t2[e3], i2);\n s2[r3.uuid] = r3;\n }\n return s2;\n }\n parseGeometries(t2, e2) {\n const s2 = {};\n if (void 0 !== t2) {\n const i2 = new fu();\n for (let r2 = 0, n2 = t2.length; r2 < n2; r2++) {\n let n3;\n const a2 = t2[r2];\n switch (a2.type) {\n case \"BufferGeometry\":\n case \"InstancedBufferGeometry\":\n n3 = i2.parse(a2);\n break;\n default:\n a2.type in jl ? n3 = jl[a2.type].fromJSON(a2, e2) : a2.type in xu ? n3 = xu[a2.type].fromJSON(a2, e2) : ai(\n `ObjectLoader: Unknown geometry type \"${a2.type}\". Use .registerGeometry() before starting the deserialization process.`\n );\n }\n n3.uuid = a2.uuid, void 0 !== a2.name && (n3.name = a2.name), void 0 !== a2.userData && (n3.userData = a2.userData), s2[a2.uuid] = n3;\n }\n }\n return s2;\n }\n parseMaterials(t2, e2) {\n const s2 = {}, i2 = {};\n if (void 0 !== t2) {\n const r2 = new mu();\n r2.setTextures(e2);\n for (let e3 = 0, n2 = t2.length; e3 < n2; e3++) {\n const n3 = t2[e3];\n void 0 === s2[n3.uuid] && (s2[n3.uuid] = r2.parse(n3)), i2[n3.uuid] = s2[n3.uuid];\n }\n }\n return i2;\n }\n parseAnimations(t2) {\n const e2 = {};\n if (void 0 !== t2)\n for (let s2 = 0; s2 < t2.length; s2++) {\n const i2 = t2[s2], r2 = Ac.parse(i2);\n e2[r2.uuid] = r2;\n }\n return e2;\n }\n parseImages(t2, e2) {\n const s2 = this, i2 = {};\n let r2;\n function n2(t3) {\n if (\"string\" == typeof t3) {\n const e3 = t3;\n return (function(t4) {\n return t4 = s2.manager.resolveURL(t4), s2.manager.itemStart(t4), r2.load(\n t4,\n function() {\n s2.manager.itemEnd(t4);\n },\n void 0,\n function() {\n s2.manager.itemError(t4), s2.manager.itemEnd(t4);\n }\n );\n })(/^(\\/\\/)|([a-z]+:(\\/\\/)?)/i.test(e3) ? e3 : s2.resourcePath + e3);\n }\n return t3.data ? { data: Gs(t3.type, t3.data), width: t3.width, height: t3.height } : null;\n }\n if (void 0 !== t2 && t2.length > 0) {\n const s3 = new Ic(e2);\n r2 = new Lc(s3), r2.setCrossOrigin(this.crossOrigin);\n for (let e3 = 0, s4 = t2.length; e3 < s4; e3++) {\n const s5 = t2[e3], r3 = s5.url;\n if (Array.isArray(r3)) {\n const t3 = [];\n for (let e4 = 0, s6 = r3.length; e4 < s6; e4++) {\n const s7 = n2(r3[e4]);\n null !== s7 && (s7 instanceof HTMLImageElement ? t3.push(s7) : t3.push(new Xa(s7.data, s7.width, s7.height)));\n }\n i2[s5.uuid] = new Di(t3);\n } else {\n const t3 = n2(s5.url);\n i2[s5.uuid] = new Di(t3);\n }\n }\n }\n return i2;\n }\n async parseImagesAsync(t2) {\n const e2 = this, s2 = {};\n let i2;\n async function r2(t3) {\n if (\"string\" == typeof t3) {\n const s3 = t3, r3 = /^(\\/\\/)|([a-z]+:(\\/\\/)?)/i.test(s3) ? s3 : e2.resourcePath + s3;\n return await i2.loadAsync(r3);\n }\n return t3.data ? { data: Gs(t3.type, t3.data), width: t3.width, height: t3.height } : null;\n }\n if (void 0 !== t2 && t2.length > 0) {\n i2 = new Lc(this.manager), i2.setCrossOrigin(this.crossOrigin);\n for (let e3 = 0, i3 = t2.length; e3 < i3; e3++) {\n const i4 = t2[e3], n2 = i4.url;\n if (Array.isArray(n2)) {\n const t3 = [];\n for (let e4 = 0, s3 = n2.length; e4 < s3; e4++) {\n const s4 = n2[e4], i5 = await r2(s4);\n null !== i5 && (i5 instanceof HTMLImageElement ? t3.push(i5) : t3.push(new Xa(i5.data, i5.width, i5.height)));\n }\n s2[i4.uuid] = new Di(t3);\n } else {\n const t3 = await r2(i4.url);\n s2[i4.uuid] = new Di(t3);\n }\n }\n }\n return s2;\n }\n parseTextures(t2, e2) {\n function s2(t3, e3) {\n return \"number\" == typeof t3 ? t3 : (ai(\"ObjectLoader.parseTexture: Constant should be in numeric form.\", t3), e3[t3]);\n }\n const i2 = {};\n if (void 0 !== t2)\n for (let r2 = 0, n2 = t2.length; r2 < n2; r2++) {\n const n3 = t2[r2];\n void 0 === n3.image && ai('ObjectLoader: No \"image\" specified for', n3.uuid), void 0 === e2[n3.image] && ai(\"ObjectLoader: Undefined image\", n3.image);\n const a2 = e2[n3.image], o2 = a2.data;\n let h2;\n Array.isArray(o2) ? (h2 = new lh(), 6 === o2.length && (h2.needsUpdate = true)) : (h2 = o2 && o2.data ? new Xa() : new Ji(), o2 && (h2.needsUpdate = true)), h2.source = a2, h2.uuid = n3.uuid, void 0 !== n3.name && (h2.name = n3.name), void 0 !== n3.mapping && (h2.mapping = s2(n3.mapping, vu)), void 0 !== n3.channel && (h2.channel = n3.channel), void 0 !== n3.offset && h2.offset.fromArray(n3.offset), void 0 !== n3.repeat && h2.repeat.fromArray(n3.repeat), void 0 !== n3.center && h2.center.fromArray(n3.center), void 0 !== n3.rotation && (h2.rotation = n3.rotation), void 0 !== n3.wrap && (h2.wrapS = s2(n3.wrap[0], wu), h2.wrapT = s2(n3.wrap[1], wu)), void 0 !== n3.format && (h2.format = n3.format), void 0 !== n3.internalFormat && (h2.internalFormat = n3.internalFormat), void 0 !== n3.type && (h2.type = n3.type), void 0 !== n3.colorSpace && (h2.colorSpace = n3.colorSpace), void 0 !== n3.minFilter && (h2.minFilter = s2(n3.minFilter, Mu)), void 0 !== n3.magFilter && (h2.magFilter = s2(n3.magFilter, Mu)), void 0 !== n3.anisotropy && (h2.anisotropy = n3.anisotropy), void 0 !== n3.flipY && (h2.flipY = n3.flipY), void 0 !== n3.generateMipmaps && (h2.generateMipmaps = n3.generateMipmaps), void 0 !== n3.premultiplyAlpha && (h2.premultiplyAlpha = n3.premultiplyAlpha), void 0 !== n3.unpackAlignment && (h2.unpackAlignment = n3.unpackAlignment), void 0 !== n3.compareFunction && (h2.compareFunction = n3.compareFunction), void 0 !== n3.normalized && (h2.normalized = n3.normalized), void 0 !== n3.userData && (h2.userData = n3.userData), i2[n3.uuid] = h2;\n }\n return i2;\n }\n parseObject(t2, e2, s2, i2, r2) {\n let n2, a2, o2;\n function h2(t3) {\n return void 0 === e2[t3] && ai(\"ObjectLoader: Undefined geometry\", t3), e2[t3];\n }\n function l2(t3) {\n if (void 0 !== t3) {\n if (Array.isArray(t3)) {\n const e3 = [];\n for (let i3 = 0, r3 = t3.length; i3 < r3; i3++) {\n const r4 = t3[i3];\n void 0 === s2[r4] && ai(\"ObjectLoader: Undefined material\", r4), e3.push(s2[r4]);\n }\n return e3;\n }\n return void 0 === s2[t3] && ai(\"ObjectLoader: Undefined material\", t3), s2[t3];\n }\n }\n function c2(t3) {\n return void 0 === i2[t3] && ai(\"ObjectLoader: Undefined texture\", t3), i2[t3];\n }\n switch (t2.type) {\n case \"Scene\":\n n2 = new Vr(), void 0 !== t2.background && (Number.isInteger(t2.background) ? n2.background = new Pr(t2.background) : n2.background = c2(t2.background)), void 0 !== t2.environment && (n2.environment = c2(t2.environment)), void 0 !== t2.fog && (\"Fog\" === t2.fog.type ? n2.fog = new Nr(t2.fog.color, t2.fog.near, t2.fog.far) : \"FogExp2\" === t2.fog.type && (n2.fog = new Er(t2.fog.color, t2.fog.density)), \"\" !== t2.fog.name && (n2.fog.name = t2.fog.name)), void 0 !== t2.backgroundBlurriness && (n2.backgroundBlurriness = t2.backgroundBlurriness), void 0 !== t2.backgroundIntensity && (n2.backgroundIntensity = t2.backgroundIntensity), void 0 !== t2.backgroundRotation && n2.backgroundRotation.fromArray(t2.backgroundRotation), void 0 !== t2.environmentIntensity && (n2.environmentIntensity = t2.environmentIntensity), void 0 !== t2.environmentRotation && n2.environmentRotation.fromArray(t2.environmentRotation);\n break;\n case \"PerspectiveCamera\":\n n2 = new eu(t2.fov, t2.aspect, t2.near, t2.far), void 0 !== t2.focus && (n2.focus = t2.focus), void 0 !== t2.zoom && (n2.zoom = t2.zoom), void 0 !== t2.filmGauge && (n2.filmGauge = t2.filmGauge), void 0 !== t2.filmOffset && (n2.filmOffset = t2.filmOffset), void 0 !== t2.view && (n2.view = Object.assign({}, t2.view));\n break;\n case \"OrthographicCamera\":\n n2 = new au(t2.left, t2.right, t2.top, t2.bottom, t2.near, t2.far), void 0 !== t2.zoom && (n2.zoom = t2.zoom), void 0 !== t2.view && (n2.view = Object.assign({}, t2.view));\n break;\n case \"AmbientLight\":\n n2 = new lu(t2.color, t2.intensity);\n break;\n case \"DirectionalLight\":\n n2 = new hu(t2.color, t2.intensity), n2.target = t2.target || \"\";\n break;\n case \"PointLight\":\n n2 = new nu(t2.color, t2.intensity, t2.distance, t2.decay);\n break;\n case \"RectAreaLight\":\n n2 = new cu(t2.color, t2.intensity, t2.width, t2.height);\n break;\n case \"SpotLight\":\n n2 = new iu(t2.color, t2.intensity, t2.distance, t2.angle, t2.penumbra, t2.decay), n2.target = t2.target || \"\";\n break;\n case \"HemisphereLight\":\n n2 = new Wc(t2.color, t2.groundColor, t2.intensity);\n break;\n case \"LightProbe\":\n const e3 = new uu().fromArray(t2.sh);\n n2 = new du(e3, t2.intensity);\n break;\n case \"SkinnedMesh\":\n a2 = h2(t2.geometry), o2 = l2(t2.material), n2 = new qa(a2, o2), void 0 !== t2.bindMode && (n2.bindMode = t2.bindMode), void 0 !== t2.bindMatrix && n2.bindMatrix.fromArray(t2.bindMatrix), void 0 !== t2.skeleton && (n2.skeleton = t2.skeleton);\n break;\n case \"Mesh\":\n a2 = h2(t2.geometry), o2 = l2(t2.material), n2 = new Ra(a2, o2);\n break;\n case \"InstancedMesh\":\n a2 = h2(t2.geometry), o2 = l2(t2.material);\n const s3 = t2.count, i3 = t2.instanceMatrix, r3 = t2.instanceColor;\n n2 = new no(a2, o2, s3), n2.instanceMatrix = new $a(new Float32Array(i3.array), 16), void 0 !== r3 && (n2.instanceColor = new $a(new Float32Array(r3.array), r3.itemSize));\n break;\n case \"BatchedMesh\":\n a2 = h2(t2.geometry), o2 = l2(t2.material), n2 = new Eo(t2.maxInstanceCount, t2.maxVertexCount, t2.maxIndexCount, o2), n2.geometry = a2, n2.perObjectFrustumCulled = t2.perObjectFrustumCulled, n2.sortObjects = t2.sortObjects, n2._drawRanges = t2.drawRanges, n2._reservedRanges = t2.reservedRanges, n2._geometryInfo = t2.geometryInfo.map((t3) => {\n let e4 = null, s4 = null;\n return void 0 !== t3.boundingBox && (e4 = new Qr().fromJSON(t3.boundingBox)), void 0 !== t3.boundingSphere && (s4 = new En().fromJSON(t3.boundingSphere)), { ...t3, boundingBox: e4, boundingSphere: s4 };\n }), n2._instanceInfo = t2.instanceInfo, n2._availableInstanceIds = t2._availableInstanceIds, n2._availableGeometryIds = t2._availableGeometryIds, n2._nextIndexStart = t2.nextIndexStart, n2._nextVertexStart = t2.nextVertexStart, n2._geometryCount = t2.geometryCount, n2._maxInstanceCount = t2.maxInstanceCount, n2._maxVertexCount = t2.maxVertexCount, n2._maxIndexCount = t2.maxIndexCount, n2._geometryInitialized = t2.geometryInitialized, n2._matricesTexture = c2(t2.matricesTexture.uuid), n2._indirectTexture = c2(t2.indirectTexture.uuid), void 0 !== t2.colorsTexture && (n2._colorsTexture = c2(t2.colorsTexture.uuid)), void 0 !== t2.boundingSphere && (n2.boundingSphere = new En().fromJSON(t2.boundingSphere)), void 0 !== t2.boundingBox && (n2.boundingBox = new Qr().fromJSON(t2.boundingBox));\n break;\n case \"LOD\":\n n2 = new pa();\n break;\n case \"Line\":\n n2 = new Jo(h2(t2.geometry), l2(t2.material));\n break;\n case \"LineLoop\":\n n2 = new Zo(h2(t2.geometry), l2(t2.material));\n break;\n case \"LineSegments\":\n n2 = new Yo(h2(t2.geometry), l2(t2.material));\n break;\n case \"PointCloud\":\n case \"Points\":\n n2 = new eh(h2(t2.geometry), l2(t2.material));\n break;\n case \"Sprite\":\n n2 = new la(l2(t2.material));\n break;\n case \"Group\":\n n2 = new Tr();\n break;\n case \"Bone\":\n n2 = new Ha();\n break;\n default:\n n2 = new Ar();\n }\n if (n2.uuid = t2.uuid, void 0 !== t2.name && (n2.name = t2.name), void 0 !== t2.matrix ? (n2.matrix.fromArray(t2.matrix), void 0 !== t2.matrixAutoUpdate && (n2.matrixAutoUpdate = t2.matrixAutoUpdate), n2.matrixAutoUpdate && n2.matrix.decompose(n2.position, n2.quaternion, n2.scale)) : (void 0 !== t2.position && n2.position.fromArray(t2.position), void 0 !== t2.rotation && n2.rotation.fromArray(t2.rotation), void 0 !== t2.quaternion && n2.quaternion.fromArray(t2.quaternion), void 0 !== t2.scale && n2.scale.fromArray(t2.scale)), void 0 !== t2.up && n2.up.fromArray(t2.up), void 0 !== t2.pivot && (n2.pivot = new Ti().fromArray(t2.pivot)), void 0 !== t2.morphTargetDictionary && (n2.morphTargetDictionary = Object.assign({}, t2.morphTargetDictionary)), void 0 !== t2.morphTargetInfluences && (n2.morphTargetInfluences = t2.morphTargetInfluences.slice()), void 0 !== t2.castShadow && (n2.castShadow = t2.castShadow), void 0 !== t2.receiveShadow && (n2.receiveShadow = t2.receiveShadow), t2.shadow && (void 0 !== t2.shadow.intensity && (n2.shadow.intensity = t2.shadow.intensity), void 0 !== t2.shadow.bias && (n2.shadow.bias = t2.shadow.bias), void 0 !== t2.shadow.normalBias && (n2.shadow.normalBias = t2.shadow.normalBias), void 0 !== t2.shadow.radius && (n2.shadow.radius = t2.shadow.radius), void 0 !== t2.shadow.mapSize && n2.shadow.mapSize.fromArray(t2.shadow.mapSize), void 0 !== t2.shadow.camera && (n2.shadow.camera = this.parseObject(t2.shadow.camera))), void 0 !== t2.visible && (n2.visible = t2.visible), void 0 !== t2.frustumCulled && (n2.frustumCulled = t2.frustumCulled), void 0 !== t2.renderOrder && (n2.renderOrder = t2.renderOrder), void 0 !== t2.static && (n2.static = t2.static), void 0 !== t2.userData && (n2.userData = t2.userData), void 0 !== t2.layers && (n2.layers.mask = t2.layers), void 0 !== t2.children) {\n const a3 = t2.children;\n for (let t3 = 0; t3 < a3.length; t3++) n2.add(this.parseObject(a3[t3], e2, s2, i2, r2));\n }\n if (void 0 !== t2.animations) {\n const e3 = t2.animations;\n for (let t3 = 0; t3 < e3.length; t3++) {\n const s3 = e3[t3];\n n2.animations.push(r2[s3]);\n }\n }\n if (\"LOD\" === t2.type) {\n void 0 !== t2.autoUpdate && (n2.autoUpdate = t2.autoUpdate);\n const e3 = t2.levels;\n for (let t3 = 0; t3 < e3.length; t3++) {\n const s3 = e3[t3], i3 = n2.getObjectByProperty(\"uuid\", s3.object);\n void 0 !== i3 && n2.addLevel(i3, s3.distance, s3.hysteresis);\n }\n }\n return n2;\n }\n bindSkeletons(t2, e2) {\n 0 !== Object.keys(e2).length && t2.traverse(function(t3) {\n if (true === t3.isSkinnedMesh && void 0 !== t3.skeleton) {\n const s2 = e2[t3.skeleton];\n void 0 === s2 ? ai(\"ObjectLoader: No skeleton found with UUID:\", t3.skeleton) : t3.bind(s2, t3.bindMatrix);\n }\n });\n }\n bindLightTargets(t2) {\n t2.traverse(function(e2) {\n if (e2.isDirectionalLight || e2.isSpotLight) {\n const s2 = e2.target, i2 = t2.getObjectByProperty(\"uuid\", s2);\n e2.target = void 0 !== i2 ? i2 : new Ar();\n }\n });\n }\n };\n var vu = {\n UVMapping: ht,\n CubeReflectionMapping: lt,\n CubeRefractionMapping: 302,\n EquirectangularReflectionMapping: 303,\n EquirectangularRefractionMapping: 304,\n CubeUVReflectionMapping: 306\n };\n var wu = { RepeatWrapping: mt, ClampToEdgeWrapping: yt, MirroredRepeatWrapping: gt };\n var Mu = {\n NearestFilter: ft,\n NearestMipmapNearestFilter: 1004,\n NearestMipmapLinearFilter: 1005,\n LinearFilter: Mt,\n LinearMipmapNearestFilter: 1007,\n LinearMipmapLinearFilter: At\n };\n var Su = /* @__PURE__ */ new WeakMap();\n var _u = class extends kc {\n constructor(t2) {\n super(t2), this.isImageBitmapLoader = true, \"undefined\" == typeof createImageBitmap && ai(\"ImageBitmapLoader: createImageBitmap() not supported.\"), \"undefined\" == typeof fetch && ai(\"ImageBitmapLoader: fetch() not supported.\"), this.options = { premultiplyAlpha: \"none\" }, this._abortController = new AbortController();\n }\n setOptions(t2) {\n return this.options = t2, this;\n }\n load(t2, e2, s2, i2) {\n void 0 === t2 && (t2 = \"\"), void 0 !== this.path && (t2 = this.path + t2), t2 = this.manager.resolveURL(t2);\n const r2 = this, n2 = zc.get(`image-bitmap:${t2}`);\n if (void 0 !== n2)\n return r2.manager.itemStart(t2), n2.then ? void n2.then((s3) => {\n true === Su.has(n2) ? (i2 && i2(Su.get(n2)), r2.manager.itemError(t2), r2.manager.itemEnd(t2)) : (e2 && e2(s3), r2.manager.itemEnd(t2));\n }) : void setTimeout(function() {\n e2 && e2(n2), r2.manager.itemEnd(t2);\n }, 0);\n const a2 = {};\n a2.credentials = \"anonymous\" === this.crossOrigin ? \"same-origin\" : \"include\", a2.headers = this.requestHeader, a2.signal = \"function\" == typeof AbortSignal.any ? AbortSignal.any([this._abortController.signal, this.manager.abortController.signal]) : this._abortController.signal;\n const o2 = fetch(t2, a2).then(function(t3) {\n return t3.blob();\n }).then(function(t3) {\n return createImageBitmap(t3, Object.assign(r2.options, { colorSpaceConversion: \"none\" }));\n }).then(function(s3) {\n zc.add(`image-bitmap:${t2}`, s3), e2 && e2(s3), r2.manager.itemEnd(t2);\n }).catch(function(e3) {\n i2 && i2(e3), Su.set(o2, e3), zc.remove(`image-bitmap:${t2}`), r2.manager.itemError(t2), r2.manager.itemEnd(t2);\n });\n zc.add(`image-bitmap:${t2}`, o2), r2.manager.itemStart(t2);\n }\n abort() {\n return this._abortController.abort(), this._abortController = new AbortController(), this;\n }\n };\n var Au;\n var Tu = class {\n static getContext() {\n return void 0 === Au && (Au = new (window.AudioContext || window.webkitAudioContext)()), Au;\n }\n static setContext(t2) {\n Au = t2;\n }\n };\n var zu = class extends kc {\n constructor(t2) {\n super(t2);\n }\n load(t2, e2, s2, i2) {\n const r2 = this, n2 = new Rc(this.manager);\n function a2(e3) {\n i2 ? i2(e3) : oi(e3), r2.manager.itemError(t2);\n }\n n2.setResponseType(\"arraybuffer\"), n2.setPath(this.path), n2.setRequestHeader(this.requestHeader), n2.setWithCredentials(this.withCredentials), n2.load(\n t2,\n function(s3) {\n try {\n const i3 = s3.slice(0), n3 = Tu.getContext(), o2 = t2 + \"#decode\";\n r2.manager.itemStart(o2), n3.decodeAudioData(i3, function(t3) {\n e2(t3), r2.manager.itemEnd(o2);\n }).catch(function(t3) {\n a2(t3), r2.manager.itemEnd(o2);\n });\n } catch (t3) {\n a2(t3);\n }\n },\n s2,\n i2\n );\n }\n };\n var Cu = new Qi();\n var Iu = new Qi();\n var Bu = new Qi();\n var ku = class {\n constructor() {\n this.type = \"StereoCamera\", this.aspect = 1, this.eyeSep = 0.064, this.cameraL = new eu(), this.cameraL.layers.enable(1), this.cameraL.matrixAutoUpdate = false, this.cameraR = new eu(), this.cameraR.layers.enable(2), this.cameraR.matrixAutoUpdate = false, this._cache = {\n focus: null,\n fov: null,\n aspect: null,\n near: null,\n far: null,\n zoom: null,\n eyeSep: null\n };\n }\n update(t2) {\n const e2 = this._cache;\n if (e2.focus !== t2.focus || e2.fov !== t2.fov || e2.aspect !== t2.aspect * this.aspect || e2.near !== t2.near || e2.far !== t2.far || e2.zoom !== t2.zoom || e2.eyeSep !== this.eyeSep) {\n e2.focus = t2.focus, e2.fov = t2.fov, e2.aspect = t2.aspect * this.aspect, e2.near = t2.near, e2.far = t2.far, e2.zoom = t2.zoom, e2.eyeSep = this.eyeSep, Bu.copy(t2.projectionMatrix);\n const s2 = e2.eyeSep / 2, i2 = s2 * e2.near / e2.focus, r2 = e2.near * Math.tan(yi * e2.fov * 0.5) / e2.zoom;\n let n2, a2;\n Iu.elements[12] = -s2, Cu.elements[12] = s2, n2 = -r2 * e2.aspect + i2, a2 = r2 * e2.aspect + i2, Bu.elements[0] = 2 * e2.near / (a2 - n2), Bu.elements[8] = (a2 + n2) / (a2 - n2), this.cameraL.projectionMatrix.copy(Bu), n2 = -r2 * e2.aspect - i2, a2 = r2 * e2.aspect - i2, Bu.elements[0] = 2 * e2.near / (a2 - n2), Bu.elements[8] = (a2 + n2) / (a2 - n2), this.cameraR.projectionMatrix.copy(Bu);\n }\n this.cameraL.matrix.copy(t2.matrixWorld).multiply(Iu), this.cameraL.matrixWorldNeedsUpdate = true, this.cameraR.matrix.copy(t2.matrixWorld).multiply(Cu), this.cameraR.matrixWorldNeedsUpdate = true;\n }\n };\n var Ou = -90;\n var Pu = class extends Ar {\n constructor(t2, e2, s2) {\n super(), this.type = \"CubeCamera\", this.renderTarget = s2, this.coordinateSystem = null, this.activeMipmapLevel = 0;\n const i2 = new eu(Ou, 1, t2, e2);\n i2.layers = this.layers, this.add(i2);\n const r2 = new eu(Ou, 1, t2, e2);\n r2.layers = this.layers, this.add(r2);\n const n2 = new eu(Ou, 1, t2, e2);\n n2.layers = this.layers, this.add(n2);\n const a2 = new eu(Ou, 1, t2, e2);\n a2.layers = this.layers, this.add(a2);\n const o2 = new eu(Ou, 1, t2, e2);\n o2.layers = this.layers, this.add(o2);\n const h2 = new eu(Ou, 1, t2, e2);\n h2.layers = this.layers, this.add(h2);\n }\n updateCoordinateSystem() {\n const t2 = this.coordinateSystem, e2 = this.children.concat(), [s2, i2, r2, n2, a2, o2] = e2;\n for (const t3 of e2) this.remove(t3);\n if (t2 === Ws)\n s2.up.set(0, 1, 0), s2.lookAt(1, 0, 0), i2.up.set(0, 1, 0), i2.lookAt(-1, 0, 0), r2.up.set(0, 0, -1), r2.lookAt(0, 1, 0), n2.up.set(0, 0, 1), n2.lookAt(0, -1, 0), a2.up.set(0, 1, 0), a2.lookAt(0, 0, 1), o2.up.set(0, 1, 0), o2.lookAt(0, 0, -1);\n else {\n if (t2 !== Js)\n throw new Error(\n \"THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: \" + t2\n );\n s2.up.set(0, -1, 0), s2.lookAt(-1, 0, 0), i2.up.set(0, -1, 0), i2.lookAt(1, 0, 0), r2.up.set(0, 0, 1), r2.lookAt(0, 1, 0), n2.up.set(0, 0, -1), n2.lookAt(0, -1, 0), a2.up.set(0, -1, 0), a2.lookAt(0, 0, 1), o2.up.set(0, -1, 0), o2.lookAt(0, 0, -1);\n }\n for (const t3 of e2) this.add(t3), t3.updateMatrixWorld();\n }\n update(t2, e2) {\n null === this.parent && this.updateMatrixWorld();\n const { renderTarget: s2, activeMipmapLevel: i2 } = this;\n this.coordinateSystem !== t2.coordinateSystem && (this.coordinateSystem = t2.coordinateSystem, this.updateCoordinateSystem());\n const [r2, n2, a2, o2, h2, l2] = this.children, c2 = t2.getRenderTarget(), u2 = t2.getActiveCubeFace(), d2 = t2.getActiveMipmapLevel(), p2 = t2.xr.enabled;\n t2.xr.enabled = false;\n const m2 = s2.texture.generateMipmaps;\n s2.texture.generateMipmaps = false;\n let y2 = false;\n y2 = true === t2.isWebGLRenderer ? t2.state.buffers.depth.getReversed() : t2.reversedDepthBuffer, t2.setRenderTarget(s2, 0, i2), y2 && false === t2.autoClear && t2.clearDepth(), t2.render(e2, r2), t2.setRenderTarget(s2, 1, i2), y2 && false === t2.autoClear && t2.clearDepth(), t2.render(e2, n2), t2.setRenderTarget(s2, 2, i2), y2 && false === t2.autoClear && t2.clearDepth(), t2.render(e2, a2), t2.setRenderTarget(s2, 3, i2), y2 && false === t2.autoClear && t2.clearDepth(), t2.render(e2, o2), t2.setRenderTarget(s2, 4, i2), y2 && false === t2.autoClear && t2.clearDepth(), t2.render(e2, h2), s2.texture.generateMipmaps = m2, t2.setRenderTarget(s2, 5, i2), y2 && false === t2.autoClear && t2.clearDepth(), t2.render(e2, l2), t2.setRenderTarget(c2, u2, d2), t2.xr.enabled = p2, s2.texture.needsPMREMUpdate = true;\n }\n };\n var Ru = class extends eu {\n constructor(t2 = []) {\n super(), this.isArrayCamera = true, this.isMultiViewCamera = false, this.cameras = t2;\n }\n };\n var Eu = class {\n constructor() {\n this._previousTime = 0, this._currentTime = 0, this._startTime = performance.now(), this._delta = 0, this._elapsed = 0, this._timescale = 1, this._document = null, this._pageVisibilityHandler = null;\n }\n connect(t2) {\n this._document = t2, void 0 !== t2.hidden && (this._pageVisibilityHandler = Nu.bind(this), t2.addEventListener(\"visibilitychange\", this._pageVisibilityHandler, false));\n }\n disconnect() {\n null !== this._pageVisibilityHandler && (this._document.removeEventListener(\"visibilitychange\", this._pageVisibilityHandler), this._pageVisibilityHandler = null), this._document = null;\n }\n getDelta() {\n return this._delta / 1e3;\n }\n getElapsed() {\n return this._elapsed / 1e3;\n }\n getTimescale() {\n return this._timescale;\n }\n setTimescale(t2) {\n return this._timescale = t2, this;\n }\n reset() {\n return this._currentTime = performance.now() - this._startTime, this;\n }\n dispose() {\n this.disconnect();\n }\n update(t2) {\n return null !== this._pageVisibilityHandler && true === this._document.hidden ? this._delta = 0 : (this._previousTime = this._currentTime, this._currentTime = (void 0 !== t2 ? t2 : performance.now()) - this._startTime, this._delta = (this._currentTime - this._previousTime) * this._timescale, this._elapsed += this._delta), this;\n }\n };\n function Nu() {\n false === this._document.hidden && this.reset();\n }\n var Vu = new Ti();\n var Lu = new Ai();\n var Fu = new Ti();\n var Du = new Ti();\n var Uu = new Ti();\n var ju = class extends Ar {\n constructor() {\n super(), this.type = \"AudioListener\", this.context = Tu.getContext(), this.gain = this.context.createGain(), this.gain.connect(this.context.destination), this.filter = null, this.timeDelta = 0, this._timer = new Eu();\n }\n getInput() {\n return this.gain;\n }\n removeFilter() {\n return null !== this.filter && (this.gain.disconnect(this.filter), this.filter.disconnect(this.context.destination), this.gain.connect(this.context.destination), this.filter = null), this;\n }\n getFilter() {\n return this.filter;\n }\n setFilter(t2) {\n return null !== this.filter ? (this.gain.disconnect(this.filter), this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination), this.filter = t2, this.gain.connect(this.filter), this.filter.connect(this.context.destination), this;\n }\n getMasterVolume() {\n return this.gain.gain.value;\n }\n setMasterVolume(t2) {\n return this.gain.gain.setTargetAtTime(t2, this.context.currentTime, 0.01), this;\n }\n updateMatrixWorld(t2) {\n super.updateMatrixWorld(t2), this._timer.update();\n const e2 = this.context.listener;\n if (this.timeDelta = this._timer.getDelta(), this.matrixWorld.decompose(Vu, Lu, Fu), Du.set(0, 0, -1).applyQuaternion(Lu), Uu.set(0, 1, 0).applyQuaternion(Lu), e2.positionX) {\n const t3 = this.context.currentTime + this.timeDelta;\n e2.positionX.linearRampToValueAtTime(Vu.x, t3), e2.positionY.linearRampToValueAtTime(Vu.y, t3), e2.positionZ.linearRampToValueAtTime(Vu.z, t3), e2.forwardX.linearRampToValueAtTime(Du.x, t3), e2.forwardY.linearRampToValueAtTime(Du.y, t3), e2.forwardZ.linearRampToValueAtTime(Du.z, t3), e2.upX.linearRampToValueAtTime(Uu.x, t3), e2.upY.linearRampToValueAtTime(Uu.y, t3), e2.upZ.linearRampToValueAtTime(Uu.z, t3);\n } else e2.setPosition(Vu.x, Vu.y, Vu.z), e2.setOrientation(Du.x, Du.y, Du.z, Uu.x, Uu.y, Uu.z);\n }\n };\n var Wu = class extends Ar {\n constructor(t2) {\n super(), this.type = \"Audio\", this.listener = t2, this.context = t2.context, this.gain = this.context.createGain(), this.gain.connect(t2.getInput()), this.autoplay = false, this.buffer = null, this.detune = 0, this.loop = false, this.loopStart = 0, this.loopEnd = 0, this.offset = 0, this.duration = void 0, this.playbackRate = 1, this.isPlaying = false, this.hasPlaybackControl = true, this.source = null, this.sourceType = \"empty\", this._startedAt = 0, this._progress = 0, this._connected = false, this.filters = [];\n }\n getOutput() {\n return this.gain;\n }\n setNodeSource(t2) {\n return this.hasPlaybackControl = false, this.sourceType = \"audioNode\", this.source = t2, this.connect(), this;\n }\n setMediaElementSource(t2) {\n return this.hasPlaybackControl = false, this.sourceType = \"mediaNode\", this.source = this.context.createMediaElementSource(t2), this.connect(), this;\n }\n setMediaStreamSource(t2) {\n return this.hasPlaybackControl = false, this.sourceType = \"mediaStreamNode\", this.source = this.context.createMediaStreamSource(t2), this.connect(), this;\n }\n setBuffer(t2) {\n return this.buffer = t2, this.sourceType = \"buffer\", this.autoplay && this.play(), this;\n }\n play(t2 = 0) {\n if (true === this.isPlaying) return void ai(\"Audio: Audio is already playing.\");\n if (false === this.hasPlaybackControl)\n return void ai(\"Audio: this Audio has no playback control.\");\n this._startedAt = this.context.currentTime + t2;\n const e2 = this.context.createBufferSource();\n return e2.buffer = this.buffer, e2.loop = this.loop, e2.loopStart = this.loopStart, e2.loopEnd = this.loopEnd, e2.onended = this.onEnded.bind(this), e2.start(this._startedAt, this._progress + this.offset, this.duration), this.isPlaying = true, this.source = e2, this.setDetune(this.detune), this.setPlaybackRate(this.playbackRate), this.connect();\n }\n pause() {\n if (false !== this.hasPlaybackControl)\n return true === this.isPlaying && (this._progress += Math.max(this.context.currentTime - this._startedAt, 0) * this.playbackRate, true === this.loop && (this._progress = this._progress % (this.duration || this.buffer.duration)), this.source.stop(), this.source.onended = null, this.isPlaying = false), this;\n ai(\"Audio: this Audio has no playback control.\");\n }\n stop(t2 = 0) {\n if (false !== this.hasPlaybackControl)\n return this._progress = 0, null !== this.source && (this.source.stop(this.context.currentTime + t2), this.source.onended = null), this.isPlaying = false, this;\n ai(\"Audio: this Audio has no playback control.\");\n }\n connect() {\n if (this.filters.length > 0) {\n this.source.connect(this.filters[0]);\n for (let t2 = 1, e2 = this.filters.length; t2 < e2; t2++)\n this.filters[t2 - 1].connect(this.filters[t2]);\n this.filters[this.filters.length - 1].connect(this.getOutput());\n } else this.source.connect(this.getOutput());\n return this._connected = true, this;\n }\n disconnect() {\n if (false !== this._connected) {\n if (this.filters.length > 0) {\n this.source.disconnect(this.filters[0]);\n for (let t2 = 1, e2 = this.filters.length; t2 < e2; t2++)\n this.filters[t2 - 1].disconnect(this.filters[t2]);\n this.filters[this.filters.length - 1].disconnect(this.getOutput());\n } else this.source.disconnect(this.getOutput());\n return this._connected = false, this;\n }\n }\n getFilters() {\n return this.filters;\n }\n setFilters(t2) {\n return t2 || (t2 = []), true === this._connected ? (this.disconnect(), this.filters = t2.slice(), this.connect()) : this.filters = t2.slice(), this;\n }\n setDetune(t2) {\n return this.detune = t2, true === this.isPlaying && void 0 !== this.source.detune && this.source.detune.setTargetAtTime(this.detune, this.context.currentTime, 0.01), this;\n }\n getDetune() {\n return this.detune;\n }\n getFilter() {\n return this.getFilters()[0];\n }\n setFilter(t2) {\n return this.setFilters(t2 ? [t2] : []);\n }\n setPlaybackRate(t2) {\n if (false !== this.hasPlaybackControl)\n return this.playbackRate = t2, true === this.isPlaying && this.source.playbackRate.setTargetAtTime(\n this.playbackRate,\n this.context.currentTime,\n 0.01\n ), this;\n ai(\"Audio: this Audio has no playback control.\");\n }\n getPlaybackRate() {\n return this.playbackRate;\n }\n onEnded() {\n this.isPlaying = false, this._progress = 0;\n }\n getLoop() {\n return false === this.hasPlaybackControl ? (ai(\"Audio: this Audio has no playback control.\"), false) : this.loop;\n }\n setLoop(t2) {\n if (false !== this.hasPlaybackControl)\n return this.loop = t2, true === this.isPlaying && (this.source.loop = this.loop), this;\n ai(\"Audio: this Audio has no playback control.\");\n }\n setLoopStart(t2) {\n return this.loopStart = t2, this;\n }\n setLoopEnd(t2) {\n return this.loopEnd = t2, this;\n }\n getVolume() {\n return this.gain.gain.value;\n }\n setVolume(t2) {\n return this.gain.gain.setTargetAtTime(t2, this.context.currentTime, 0.01), this;\n }\n copy(t2, e2) {\n return super.copy(t2, e2), \"buffer\" !== t2.sourceType ? (ai(\"Audio: Audio source type cannot be copied.\"), this) : (this.autoplay = t2.autoplay, this.buffer = t2.buffer, this.detune = t2.detune, this.loop = t2.loop, this.loopStart = t2.loopStart, this.loopEnd = t2.loopEnd, this.offset = t2.offset, this.duration = t2.duration, this.playbackRate = t2.playbackRate, this.hasPlaybackControl = t2.hasPlaybackControl, this.sourceType = t2.sourceType, this.filters = t2.filters.slice(), this);\n }\n clone(t2) {\n return new this.constructor(this.listener).copy(this, t2);\n }\n };\n var Ju = new Ti();\n var qu = new Ai();\n var Hu = new Ti();\n var Xu = new Ti();\n var Yu = class extends Wu {\n constructor(t2) {\n super(t2), this.panner = this.context.createPanner(), this.panner.panningModel = \"HRTF\", this.panner.connect(this.gain);\n }\n connect() {\n return super.connect(), this.panner.connect(this.gain), this;\n }\n disconnect() {\n return super.disconnect(), this.panner.disconnect(this.gain), this;\n }\n getOutput() {\n return this.panner;\n }\n getRefDistance() {\n return this.panner.refDistance;\n }\n setRefDistance(t2) {\n return this.panner.refDistance = t2, this;\n }\n getRolloffFactor() {\n return this.panner.rolloffFactor;\n }\n setRolloffFactor(t2) {\n return this.panner.rolloffFactor = t2, this;\n }\n getDistanceModel() {\n return this.panner.distanceModel;\n }\n setDistanceModel(t2) {\n return this.panner.distanceModel = t2, this;\n }\n getMaxDistance() {\n return this.panner.maxDistance;\n }\n setMaxDistance(t2) {\n return this.panner.maxDistance = t2, this;\n }\n setDirectionalCone(t2, e2, s2) {\n return this.panner.coneInnerAngle = t2, this.panner.coneOuterAngle = e2, this.panner.coneOuterGain = s2, this;\n }\n updateMatrixWorld(t2) {\n if (super.updateMatrixWorld(t2), true === this.hasPlaybackControl && false === this.isPlaying)\n return;\n this.matrixWorld.decompose(Ju, qu, Hu), Xu.set(0, 0, 1).applyQuaternion(qu);\n const e2 = this.panner;\n if (e2.positionX) {\n const t3 = this.context.currentTime + this.listener.timeDelta;\n e2.positionX.linearRampToValueAtTime(Ju.x, t3), e2.positionY.linearRampToValueAtTime(Ju.y, t3), e2.positionZ.linearRampToValueAtTime(Ju.z, t3), e2.orientationX.linearRampToValueAtTime(Xu.x, t3), e2.orientationY.linearRampToValueAtTime(Xu.y, t3), e2.orientationZ.linearRampToValueAtTime(Xu.z, t3);\n } else e2.setPosition(Ju.x, Ju.y, Ju.z), e2.setOrientation(Xu.x, Xu.y, Xu.z);\n }\n };\n var Zu = class {\n constructor(t2, e2 = 2048) {\n this.analyser = t2.context.createAnalyser(), this.analyser.fftSize = e2, this.data = new Uint8Array(this.analyser.frequencyBinCount), t2.getOutput().connect(this.analyser);\n }\n getFrequencyData() {\n return this.analyser.getByteFrequencyData(this.data), this.data;\n }\n getAverageFrequency() {\n let t2 = 0;\n const e2 = this.getFrequencyData();\n for (let s2 = 0; s2 < e2.length; s2++) t2 += e2[s2];\n return t2 / e2.length;\n }\n };\n var Gu = class {\n constructor(t2, e2, s2) {\n let i2, r2, n2;\n switch (this.binding = t2, this.valueSize = s2, e2) {\n case \"quaternion\":\n i2 = this._slerp, r2 = this._slerpAdditive, n2 = this._setAdditiveIdentityQuaternion, this.buffer = new Float64Array(6 * s2), this._workIndex = 5;\n break;\n case \"string\":\n case \"bool\":\n i2 = this._select, r2 = this._select, n2 = this._setAdditiveIdentityOther, this.buffer = new Array(5 * s2);\n break;\n default:\n i2 = this._lerp, r2 = this._lerpAdditive, n2 = this._setAdditiveIdentityNumeric, this.buffer = new Float64Array(5 * s2);\n }\n this._mixBufferRegion = i2, this._mixBufferRegionAdditive = r2, this._setIdentity = n2, this._origIndex = 3, this._addIndex = 4, this.cumulativeWeight = 0, this.cumulativeWeightAdditive = 0, this.useCount = 0, this.referenceCount = 0;\n }\n accumulate(t2, e2) {\n const s2 = this.buffer, i2 = this.valueSize, r2 = t2 * i2 + i2;\n let n2 = this.cumulativeWeight;\n if (0 === n2) {\n for (let t3 = 0; t3 !== i2; ++t3) s2[r2 + t3] = s2[t3];\n n2 = e2;\n } else {\n n2 += e2;\n const t3 = e2 / n2;\n this._mixBufferRegion(s2, r2, 0, t3, i2);\n }\n this.cumulativeWeight = n2;\n }\n accumulateAdditive(t2) {\n const e2 = this.buffer, s2 = this.valueSize, i2 = s2 * this._addIndex;\n 0 === this.cumulativeWeightAdditive && this._setIdentity(), this._mixBufferRegionAdditive(e2, i2, 0, t2, s2), this.cumulativeWeightAdditive += t2;\n }\n apply(t2) {\n const e2 = this.valueSize, s2 = this.buffer, i2 = t2 * e2 + e2, r2 = this.cumulativeWeight, n2 = this.cumulativeWeightAdditive, a2 = this.binding;\n if (this.cumulativeWeight = 0, this.cumulativeWeightAdditive = 0, r2 < 1) {\n const t3 = e2 * this._origIndex;\n this._mixBufferRegion(s2, i2, t3, 1 - r2, e2);\n }\n n2 > 0 && this._mixBufferRegionAdditive(s2, i2, this._addIndex * e2, 1, e2);\n for (let t3 = e2, r3 = e2 + e2; t3 !== r3; ++t3)\n if (s2[t3] !== s2[t3 + e2]) {\n a2.setValue(s2, i2);\n break;\n }\n }\n saveOriginalState() {\n const t2 = this.binding, e2 = this.buffer, s2 = this.valueSize, i2 = s2 * this._origIndex;\n t2.getValue(e2, i2);\n for (let t3 = s2, r2 = i2; t3 !== r2; ++t3) e2[t3] = e2[i2 + t3 % s2];\n this._setIdentity(), this.cumulativeWeight = 0, this.cumulativeWeightAdditive = 0;\n }\n restoreOriginalState() {\n const t2 = 3 * this.valueSize;\n this.binding.setValue(this.buffer, t2);\n }\n _setAdditiveIdentityNumeric() {\n const t2 = this._addIndex * this.valueSize, e2 = t2 + this.valueSize;\n for (let s2 = t2; s2 < e2; s2++) this.buffer[s2] = 0;\n }\n _setAdditiveIdentityQuaternion() {\n this._setAdditiveIdentityNumeric(), this.buffer[this._addIndex * this.valueSize + 3] = 1;\n }\n _setAdditiveIdentityOther() {\n const t2 = this._origIndex * this.valueSize, e2 = this._addIndex * this.valueSize;\n for (let s2 = 0; s2 < this.valueSize; s2++) this.buffer[e2 + s2] = this.buffer[t2 + s2];\n }\n _select(t2, e2, s2, i2, r2) {\n if (i2 >= 0.5) for (let i3 = 0; i3 !== r2; ++i3) t2[e2 + i3] = t2[s2 + i3];\n }\n _slerp(t2, e2, s2, i2) {\n Ai.slerpFlat(t2, e2, t2, e2, t2, s2, i2);\n }\n _slerpAdditive(t2, e2, s2, i2, r2) {\n const n2 = this._workIndex * r2;\n Ai.multiplyQuaternionsFlat(t2, n2, t2, e2, t2, s2), Ai.slerpFlat(t2, e2, t2, e2, t2, n2, i2);\n }\n _lerp(t2, e2, s2, i2, r2) {\n const n2 = 1 - i2;\n for (let a2 = 0; a2 !== r2; ++a2) {\n const r3 = e2 + a2;\n t2[r3] = t2[r3] * n2 + t2[s2 + a2] * i2;\n }\n }\n _lerpAdditive(t2, e2, s2, i2, r2) {\n for (let n2 = 0; n2 !== r2; ++n2) {\n const r3 = e2 + n2;\n t2[r3] = t2[r3] + t2[s2 + n2] * i2;\n }\n }\n };\n var $u = \"\\\\[\\\\]\\\\.:\\\\/\";\n var Qu = new RegExp(\"[\" + $u + \"]\", \"g\");\n var Ku = \"[^\" + $u + \"]\";\n var td = \"[^\" + $u.replace(\"\\\\.\", \"\") + \"]\";\n var ed = new RegExp(\n \"^\" + /((?:WC+[\\/:])*)/.source.replace(\"WC\", Ku) + /(WCOD+)?/.source.replace(\"WCOD\", td) + /(?:\\.(WC+)(?:\\[(.+)\\])?)?/.source.replace(\"WC\", Ku) + /\\.(WC+)(?:\\[(.+)\\])?/.source.replace(\"WC\", Ku) + \"$\"\n );\n var sd = [\"material\", \"materials\", \"bones\", \"map\"];\n var id = class _id {\n constructor(t2, e2, s2) {\n this.path = e2, this.parsedPath = s2 || _id.parseTrackName(e2), this.node = _id.findNode(t2, this.parsedPath.nodeName), this.rootNode = t2, this.getValue = this._getValue_unbound, this.setValue = this._setValue_unbound;\n }\n static create(t2, e2, s2) {\n return t2 && t2.isAnimationObjectGroup ? new _id.Composite(t2, e2, s2) : new _id(t2, e2, s2);\n }\n static sanitizeNodeName(t2) {\n return t2.replace(/\\s/g, \"_\").replace(Qu, \"\");\n }\n static parseTrackName(t2) {\n const e2 = ed.exec(t2);\n if (null === e2) throw new Error(\"THREE.PropertyBinding: Cannot parse trackName: \" + t2);\n const s2 = {\n nodeName: e2[2],\n objectName: e2[3],\n objectIndex: e2[4],\n propertyName: e2[5],\n propertyIndex: e2[6]\n }, i2 = s2.nodeName && s2.nodeName.lastIndexOf(\".\");\n if (void 0 !== i2 && -1 !== i2) {\n const t3 = s2.nodeName.substring(i2 + 1);\n -1 !== sd.indexOf(t3) && (s2.nodeName = s2.nodeName.substring(0, i2), s2.objectName = t3);\n }\n if (null === s2.propertyName || 0 === s2.propertyName.length)\n throw new Error(\"THREE.PropertyBinding: can not parse propertyName from trackName: \" + t2);\n return s2;\n }\n static findNode(t2, e2) {\n if (void 0 === e2 || \"\" === e2 || \".\" === e2 || -1 === e2 || e2 === t2.name || e2 === t2.uuid) return t2;\n if (t2.skeleton) {\n const s2 = t2.skeleton.getBoneByName(e2);\n if (void 0 !== s2) return s2;\n }\n if (t2.children) {\n const s2 = function(t3) {\n for (let i3 = 0; i3 < t3.length; i3++) {\n const r2 = t3[i3];\n if (r2.name === e2 || r2.uuid === e2) return r2;\n const n2 = s2(r2.children);\n if (n2) return n2;\n }\n return null;\n }, i2 = s2(t2.children);\n if (i2) return i2;\n }\n return null;\n }\n _getValue_unavailable() {\n }\n _setValue_unavailable() {\n }\n _getValue_direct(t2, e2) {\n t2[e2] = this.targetObject[this.propertyName];\n }\n _getValue_array(t2, e2) {\n const s2 = this.resolvedProperty;\n for (let i2 = 0, r2 = s2.length; i2 !== r2; ++i2) t2[e2++] = s2[i2];\n }\n _getValue_arrayElement(t2, e2) {\n t2[e2] = this.resolvedProperty[this.propertyIndex];\n }\n _getValue_toArray(t2, e2) {\n this.resolvedProperty.toArray(t2, e2);\n }\n _setValue_direct(t2, e2) {\n this.targetObject[this.propertyName] = t2[e2];\n }\n _setValue_direct_setNeedsUpdate(t2, e2) {\n this.targetObject[this.propertyName] = t2[e2], this.targetObject.needsUpdate = true;\n }\n _setValue_direct_setMatrixWorldNeedsUpdate(t2, e2) {\n this.targetObject[this.propertyName] = t2[e2], this.targetObject.matrixWorldNeedsUpdate = true;\n }\n _setValue_array(t2, e2) {\n const s2 = this.resolvedProperty;\n for (let i2 = 0, r2 = s2.length; i2 !== r2; ++i2) s2[i2] = t2[e2++];\n }\n _setValue_array_setNeedsUpdate(t2, e2) {\n const s2 = this.resolvedProperty;\n for (let i2 = 0, r2 = s2.length; i2 !== r2; ++i2) s2[i2] = t2[e2++];\n this.targetObject.needsUpdate = true;\n }\n _setValue_array_setMatrixWorldNeedsUpdate(t2, e2) {\n const s2 = this.resolvedProperty;\n for (let i2 = 0, r2 = s2.length; i2 !== r2; ++i2) s2[i2] = t2[e2++];\n this.targetObject.matrixWorldNeedsUpdate = true;\n }\n _setValue_arrayElement(t2, e2) {\n this.resolvedProperty[this.propertyIndex] = t2[e2];\n }\n _setValue_arrayElement_setNeedsUpdate(t2, e2) {\n this.resolvedProperty[this.propertyIndex] = t2[e2], this.targetObject.needsUpdate = true;\n }\n _setValue_arrayElement_setMatrixWorldNeedsUpdate(t2, e2) {\n this.resolvedProperty[this.propertyIndex] = t2[e2], this.targetObject.matrixWorldNeedsUpdate = true;\n }\n _setValue_fromArray(t2, e2) {\n this.resolvedProperty.fromArray(t2, e2);\n }\n _setValue_fromArray_setNeedsUpdate(t2, e2) {\n this.resolvedProperty.fromArray(t2, e2), this.targetObject.needsUpdate = true;\n }\n _setValue_fromArray_setMatrixWorldNeedsUpdate(t2, e2) {\n this.resolvedProperty.fromArray(t2, e2), this.targetObject.matrixWorldNeedsUpdate = true;\n }\n _getValue_unbound(t2, e2) {\n this.bind(), this.getValue(t2, e2);\n }\n _setValue_unbound(t2, e2) {\n this.bind(), this.setValue(t2, e2);\n }\n bind() {\n let t2 = this.node;\n const e2 = this.parsedPath, s2 = e2.objectName, i2 = e2.propertyName;\n let r2 = e2.propertyIndex;\n if (t2 || (t2 = _id.findNode(this.rootNode, e2.nodeName), this.node = t2), this.getValue = this._getValue_unavailable, this.setValue = this._setValue_unavailable, !t2)\n return void ai(\"PropertyBinding: No target node found for track: \" + this.path + \".\");\n if (s2) {\n let i3 = e2.objectIndex;\n switch (s2) {\n case \"materials\":\n if (!t2.material)\n return void oi(\n \"PropertyBinding: Can not bind to material as node does not have a material.\",\n this\n );\n if (!t2.material.materials)\n return void oi(\n \"PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.\",\n this\n );\n t2 = t2.material.materials;\n break;\n case \"bones\":\n if (!t2.skeleton)\n return void oi(\n \"PropertyBinding: Can not bind to bones as node does not have a skeleton.\",\n this\n );\n t2 = t2.skeleton.bones;\n for (let e3 = 0; e3 < t2.length; e3++)\n if (t2[e3].name === i3) {\n i3 = e3;\n break;\n }\n break;\n case \"map\":\n if (\"map\" in t2) {\n t2 = t2.map;\n break;\n }\n if (!t2.material)\n return void oi(\n \"PropertyBinding: Can not bind to material as node does not have a material.\",\n this\n );\n if (!t2.material.map)\n return void oi(\n \"PropertyBinding: Can not bind to material.map as node.material does not have a map.\",\n this\n );\n t2 = t2.material.map;\n break;\n default:\n if (void 0 === t2[s2])\n return void oi(\"PropertyBinding: Can not bind to objectName of node undefined.\", this);\n t2 = t2[s2];\n }\n if (void 0 !== i3) {\n if (void 0 === t2[i3])\n return void oi(\n \"PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.\",\n this,\n t2\n );\n t2 = t2[i3];\n }\n }\n const n2 = t2[i2];\n if (void 0 === n2) {\n return void oi(\n \"PropertyBinding: Trying to update property for track: \" + e2.nodeName + \".\" + i2 + \" but it wasn't found.\",\n t2\n );\n }\n let a2 = this.Versioning.None;\n this.targetObject = t2, true === t2.isMaterial ? a2 = this.Versioning.NeedsUpdate : true === t2.isObject3D && (a2 = this.Versioning.MatrixWorldNeedsUpdate);\n let o2 = this.BindingType.Direct;\n if (void 0 !== r2) {\n if (\"morphTargetInfluences\" === i2) {\n if (!t2.geometry)\n return void oi(\n \"PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.\",\n this\n );\n if (!t2.geometry.morphAttributes)\n return void oi(\n \"PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.\",\n this\n );\n void 0 !== t2.morphTargetDictionary[r2] && (r2 = t2.morphTargetDictionary[r2]);\n }\n o2 = this.BindingType.ArrayElement, this.resolvedProperty = n2, this.propertyIndex = r2;\n } else\n void 0 !== n2.fromArray && void 0 !== n2.toArray ? (o2 = this.BindingType.HasFromToArray, this.resolvedProperty = n2) : Array.isArray(n2) ? (o2 = this.BindingType.EntireArray, this.resolvedProperty = n2) : this.propertyName = i2;\n this.getValue = this.GetterByBindingType[o2], this.setValue = this.SetterByBindingTypeAndVersioning[o2][a2];\n }\n unbind() {\n this.node = null, this.getValue = this._getValue_unbound, this.setValue = this._setValue_unbound;\n }\n };\n id.Composite = class {\n constructor(t2, e2, s2) {\n const i2 = s2 || id.parseTrackName(e2);\n this._targetGroup = t2, this._bindings = t2.subscribe_(e2, i2);\n }\n getValue(t2, e2) {\n this.bind();\n const s2 = this._targetGroup.nCachedObjects_, i2 = this._bindings[s2];\n void 0 !== i2 && i2.getValue(t2, e2);\n }\n setValue(t2, e2) {\n const s2 = this._bindings;\n for (let i2 = this._targetGroup.nCachedObjects_, r2 = s2.length; i2 !== r2; ++i2) s2[i2].setValue(t2, e2);\n }\n bind() {\n const t2 = this._bindings;\n for (let e2 = this._targetGroup.nCachedObjects_, s2 = t2.length; e2 !== s2; ++e2) t2[e2].bind();\n }\n unbind() {\n const t2 = this._bindings;\n for (let e2 = this._targetGroup.nCachedObjects_, s2 = t2.length; e2 !== s2; ++e2) t2[e2].unbind();\n }\n }, id.prototype.BindingType = { Direct: 0, EntireArray: 1, ArrayElement: 2, HasFromToArray: 3 }, id.prototype.Versioning = { None: 0, NeedsUpdate: 1, MatrixWorldNeedsUpdate: 2 }, id.prototype.GetterByBindingType = [\n id.prototype._getValue_direct,\n id.prototype._getValue_array,\n id.prototype._getValue_arrayElement,\n id.prototype._getValue_toArray\n ], id.prototype.SetterByBindingTypeAndVersioning = [\n [\n id.prototype._setValue_direct,\n id.prototype._setValue_direct_setNeedsUpdate,\n id.prototype._setValue_direct_setMatrixWorldNeedsUpdate\n ],\n [\n id.prototype._setValue_array,\n id.prototype._setValue_array_setNeedsUpdate,\n id.prototype._setValue_array_setMatrixWorldNeedsUpdate\n ],\n [\n id.prototype._setValue_arrayElement,\n id.prototype._setValue_arrayElement_setNeedsUpdate,\n id.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate\n ],\n [\n id.prototype._setValue_fromArray,\n id.prototype._setValue_fromArray_setNeedsUpdate,\n id.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate\n ]\n ];\n var rd = class {\n constructor() {\n this.isAnimationObjectGroup = true, this.uuid = fi(), this._objects = Array.prototype.slice.call(arguments), this.nCachedObjects_ = 0;\n const t2 = {};\n this._indicesByUUID = t2;\n for (let e3 = 0, s2 = arguments.length; e3 !== s2; ++e3) t2[arguments[e3].uuid] = e3;\n this._paths = [], this._parsedPaths = [], this._bindings = [], this._bindingsIndicesByPath = {};\n const e2 = this;\n this.stats = {\n objects: {\n get total() {\n return e2._objects.length;\n },\n get inUse() {\n return this.total - e2.nCachedObjects_;\n }\n },\n get bindingsPerObject() {\n return e2._bindings.length;\n }\n };\n }\n add() {\n const t2 = this._objects, e2 = this._indicesByUUID, s2 = this._paths, i2 = this._parsedPaths, r2 = this._bindings, n2 = r2.length;\n let a2, o2 = t2.length, h2 = this.nCachedObjects_;\n for (let l2 = 0, c2 = arguments.length; l2 !== c2; ++l2) {\n const c3 = arguments[l2], u2 = c3.uuid;\n let d2 = e2[u2];\n if (void 0 === d2) {\n d2 = o2++, e2[u2] = d2, t2.push(c3);\n for (let t3 = 0, e3 = n2; t3 !== e3; ++t3) r2[t3].push(new id(c3, s2[t3], i2[t3]));\n } else if (d2 < h2) {\n a2 = t2[d2];\n const o3 = --h2, l3 = t2[o3];\n e2[l3.uuid] = d2, t2[d2] = l3, e2[u2] = o3, t2[o3] = c3;\n for (let t3 = 0, e3 = n2; t3 !== e3; ++t3) {\n const e4 = r2[t3], n3 = e4[o3];\n let a3 = e4[d2];\n e4[d2] = n3, void 0 === a3 && (a3 = new id(c3, s2[t3], i2[t3])), e4[o3] = a3;\n }\n } else\n t2[d2] !== a2 && oi(\n \"AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.\"\n );\n }\n this.nCachedObjects_ = h2;\n }\n remove() {\n const t2 = this._objects, e2 = this._indicesByUUID, s2 = this._bindings, i2 = s2.length;\n let r2 = this.nCachedObjects_;\n for (let n2 = 0, a2 = arguments.length; n2 !== a2; ++n2) {\n const a3 = arguments[n2], o2 = a3.uuid, h2 = e2[o2];\n if (void 0 !== h2 && h2 >= r2) {\n const n3 = r2++, l2 = t2[n3];\n e2[l2.uuid] = h2, t2[h2] = l2, e2[o2] = n3, t2[n3] = a3;\n for (let t3 = 0, e3 = i2; t3 !== e3; ++t3) {\n const e4 = s2[t3], i3 = e4[n3], r3 = e4[h2];\n e4[h2] = i3, e4[n3] = r3;\n }\n }\n }\n this.nCachedObjects_ = r2;\n }\n uncache() {\n const t2 = this._objects, e2 = this._indicesByUUID, s2 = this._bindings, i2 = s2.length;\n let r2 = this.nCachedObjects_, n2 = t2.length;\n for (let a2 = 0, o2 = arguments.length; a2 !== o2; ++a2) {\n const o3 = arguments[a2].uuid, h2 = e2[o3];\n if (void 0 !== h2)\n if (delete e2[o3], h2 < r2) {\n const a3 = --r2, o4 = t2[a3], l2 = --n2, c2 = t2[l2];\n e2[o4.uuid] = h2, t2[h2] = o4, e2[c2.uuid] = a3, t2[a3] = c2, t2.pop();\n for (let t3 = 0, e3 = i2; t3 !== e3; ++t3) {\n const e4 = s2[t3], i3 = e4[a3], r3 = e4[l2];\n e4[h2] = i3, e4[a3] = r3, e4.pop();\n }\n } else {\n const r3 = --n2, a3 = t2[r3];\n r3 > 0 && (e2[a3.uuid] = h2), t2[h2] = a3, t2.pop();\n for (let t3 = 0, e3 = i2; t3 !== e3; ++t3) {\n const e4 = s2[t3];\n e4[h2] = e4[r3], e4.pop();\n }\n }\n }\n this.nCachedObjects_ = r2;\n }\n subscribe_(t2, e2) {\n const s2 = this._bindingsIndicesByPath;\n let i2 = s2[t2];\n const r2 = this._bindings;\n if (void 0 !== i2) return r2[i2];\n const n2 = this._paths, a2 = this._parsedPaths, o2 = this._objects, h2 = o2.length, l2 = this.nCachedObjects_, c2 = new Array(h2);\n i2 = r2.length, s2[t2] = i2, n2.push(t2), a2.push(e2), r2.push(c2);\n for (let s3 = l2, i3 = o2.length; s3 !== i3; ++s3) {\n const i4 = o2[s3];\n c2[s3] = new id(i4, t2, e2);\n }\n return c2;\n }\n unsubscribe_(t2) {\n const e2 = this._bindingsIndicesByPath, s2 = e2[t2];\n if (void 0 !== s2) {\n const i2 = this._paths, r2 = this._parsedPaths, n2 = this._bindings, a2 = n2.length - 1, o2 = n2[a2];\n e2[t2[a2]] = s2, n2[s2] = o2, n2.pop(), r2[s2] = r2[a2], r2.pop(), i2[s2] = i2[a2], i2.pop();\n }\n }\n };\n var nd = class {\n constructor(t2, e2, s2 = null, i2 = e2.blendMode) {\n this._mixer = t2, this._clip = e2, this._localRoot = s2, this.blendMode = i2;\n const r2 = e2.tracks, n2 = r2.length, a2 = new Array(n2), o2 = { endingStart: De, endingEnd: De };\n for (let t3 = 0; t3 !== n2; ++t3) {\n const e3 = r2[t3].createInterpolant(null);\n a2[t3] = e3, e3.settings = o2;\n }\n this._interpolantSettings = o2, this._interpolants = a2, this._propertyBindings = new Array(n2), this._cacheIndex = null, this._byClipCacheIndex = null, this._timeScaleInterpolant = null, this._restoreTimeScale = null, this._weightInterpolant = null, this.loop = 2201, this._loopCount = -1, this._startTime = null, this.time = 0, this.timeScale = 1, this._effectiveTimeScale = 1, this.weight = 1, this._effectiveWeight = 1, this.repetitions = 1 / 0, this.paused = false, this.enabled = true, this.clampWhenFinished = false, this.zeroSlopeAtStart = true, this.zeroSlopeAtEnd = true;\n }\n play() {\n return this._mixer._activateAction(this), this;\n }\n stop() {\n return this._mixer._deactivateAction(this), this.reset();\n }\n reset() {\n return this.paused = false, this.enabled = true, this.time = 0, this._loopCount = -1, this._startTime = null, this.stopFading().stopWarping();\n }\n isRunning() {\n return this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this);\n }\n isScheduled() {\n return this._mixer._isActiveAction(this);\n }\n startAt(t2) {\n return this._startTime = t2, this;\n }\n setLoop(t2, e2) {\n return this.loop = t2, this.repetitions = e2, this;\n }\n setEffectiveWeight(t2) {\n return this.weight = t2, this._effectiveWeight = this.enabled ? t2 : 0, this.stopFading();\n }\n getEffectiveWeight() {\n return this._effectiveWeight;\n }\n fadeIn(t2) {\n return this._scheduleFading(t2, 0, 1);\n }\n fadeOut(t2) {\n return this._scheduleFading(t2, 1, 0);\n }\n crossFadeFrom(t2, e2, s2 = false) {\n if (t2.fadeOut(e2), this.fadeIn(e2), true === s2) {\n const s3 = this._clip.duration, i2 = t2._clip.duration, r2 = i2 / s3, n2 = s3 / i2;\n t2._restoreTimeScale = t2.timeScale, this._restoreTimeScale = this.timeScale, t2.warp(1, r2, e2), this.warp(n2, 1, e2);\n }\n return this;\n }\n crossFadeTo(t2, e2, s2 = false) {\n return t2.crossFadeFrom(this, e2, s2);\n }\n stopFading() {\n const t2 = this._weightInterpolant;\n return null !== t2 && (this._weightInterpolant = null, this._mixer._takeBackControlInterpolant(t2)), this;\n }\n setEffectiveTimeScale(t2) {\n return this.timeScale = t2, this._effectiveTimeScale = this.paused ? 0 : t2, this.stopWarping();\n }\n getEffectiveTimeScale() {\n return this._effectiveTimeScale;\n }\n setDuration(t2) {\n return this.timeScale = this._clip.duration / t2, this.stopWarping();\n }\n syncWith(t2) {\n return this.time = t2.time, this.timeScale = t2.timeScale, this.stopWarping();\n }\n halt(t2) {\n return this.warp(this._effectiveTimeScale, 0, t2);\n }\n warp(t2, e2, s2) {\n const i2 = this._mixer, r2 = i2.time, n2 = this.timeScale;\n let a2 = this._timeScaleInterpolant;\n null === a2 && (a2 = i2._lendControlInterpolant(), this._timeScaleInterpolant = a2);\n const o2 = a2.parameterPositions, h2 = a2.sampleValues;\n return o2[0] = r2, o2[1] = r2 + s2, h2[0] = t2 / n2, h2[1] = e2 / n2, this;\n }\n stopWarping() {\n const t2 = this._timeScaleInterpolant;\n return null !== t2 && (this._timeScaleInterpolant = null, this._mixer._takeBackControlInterpolant(t2)), this._restoreTimeScale = null, this;\n }\n getMixer() {\n return this._mixer;\n }\n getClip() {\n return this._clip;\n }\n getRoot() {\n return this._localRoot || this._mixer._root;\n }\n _update(t2, e2, s2, i2) {\n if (!this.enabled) return void this._updateWeight(t2);\n const r2 = this._startTime;\n if (null !== r2) {\n const i3 = (t2 - r2) * s2;\n i3 < 0 || 0 === s2 ? e2 = 0 : (this._startTime = null, e2 = s2 * i3);\n }\n e2 *= this._updateTimeScale(t2);\n const n2 = this._updateTime(e2), a2 = this._updateWeight(t2);\n if (a2 > 0) {\n const t3 = this._interpolants, e3 = this._propertyBindings;\n if (this.blendMode === Je)\n for (let s3 = 0, i3 = t3.length; s3 !== i3; ++s3) t3[s3].evaluate(n2), e3[s3].accumulateAdditive(a2);\n else for (let s3 = 0, r3 = t3.length; s3 !== r3; ++s3) t3[s3].evaluate(n2), e3[s3].accumulate(i2, a2);\n }\n }\n _updateWeight(t2) {\n let e2 = 0;\n if (this.enabled) {\n e2 = this.weight;\n const s2 = this._weightInterpolant;\n if (null !== s2) {\n const i2 = s2.evaluate(t2)[0];\n e2 *= i2, t2 > s2.parameterPositions[1] && (this.stopFading(), 0 === i2 && (this.enabled = false));\n }\n }\n return this._effectiveWeight = e2, e2;\n }\n _updateTimeScale(t2) {\n let e2 = 0;\n if (!this.paused) {\n e2 = this.timeScale;\n const s2 = this._timeScaleInterpolant;\n if (null !== s2) {\n e2 *= s2.evaluate(t2)[0], t2 > s2.parameterPositions[1] && (0 === e2 ? this.paused = true : (null !== this._restoreTimeScale && (e2 = this._restoreTimeScale), this.timeScale = e2), this.stopWarping());\n }\n }\n return this._effectiveTimeScale = e2, e2;\n }\n _updateTime(t2) {\n const e2 = this._clip.duration, s2 = this.loop;\n let i2 = this.time + t2, r2 = this._loopCount;\n const n2 = 2202 === s2;\n if (0 === t2) return -1 === r2 || !n2 || 1 & ~r2 ? i2 : e2 - i2;\n if (2200 === s2) {\n -1 === r2 && (this._loopCount = 0, this._setEndings(true, true, false));\n t: {\n if (i2 >= e2) i2 = e2;\n else {\n if (!(i2 < 0)) {\n this.time = i2;\n break t;\n }\n i2 = 0;\n }\n this.clampWhenFinished ? this.paused = true : this.enabled = false, this.time = i2, this._mixer.dispatchEvent({ type: \"finished\", action: this, direction: t2 < 0 ? -1 : 1 });\n }\n } else {\n if (-1 === r2 && (t2 >= 0 ? (r2 = 0, this._setEndings(true, 0 === this.repetitions, n2)) : this._setEndings(0 === this.repetitions, true, n2)), i2 >= e2 || i2 < 0) {\n const s3 = Math.floor(i2 / e2);\n i2 -= e2 * s3, r2 += Math.abs(s3);\n const a2 = this.repetitions - r2;\n if (a2 <= 0)\n this.clampWhenFinished ? this.paused = true : this.enabled = false, i2 = t2 > 0 ? e2 : 0, this.time = i2, this._mixer.dispatchEvent({\n type: \"finished\",\n action: this,\n direction: t2 > 0 ? 1 : -1\n });\n else {\n if (1 === a2) {\n const e3 = t2 < 0;\n this._setEndings(e3, !e3, n2);\n } else this._setEndings(false, false, n2);\n this._loopCount = r2, this.time = i2, this._mixer.dispatchEvent({ type: \"loop\", action: this, loopDelta: s3 });\n }\n } else this._loopCount = r2, this.time = i2;\n if (n2 && !(1 & ~r2)) return e2 - i2;\n }\n return i2;\n }\n _setEndings(t2, e2, s2) {\n const i2 = this._interpolantSettings;\n s2 ? (i2.endingStart = Ue, i2.endingEnd = Ue) : (i2.endingStart = t2 ? this.zeroSlopeAtStart ? Ue : De : je, i2.endingEnd = e2 ? this.zeroSlopeAtEnd ? Ue : De : je);\n }\n _scheduleFading(t2, e2, s2) {\n const i2 = this._mixer, r2 = i2.time;\n let n2 = this._weightInterpolant;\n null === n2 && (n2 = i2._lendControlInterpolant(), this._weightInterpolant = n2);\n const a2 = n2.parameterPositions, o2 = n2.sampleValues;\n return a2[0] = r2, o2[0] = e2, a2[1] = r2 + t2, o2[1] = s2, this;\n }\n };\n var ad = new Float32Array(1);\n var od = class extends di {\n constructor(t2) {\n super(), this._root = t2, this._initMemoryManager(), this._accuIndex = 0, this.time = 0, this.timeScale = 1, \"undefined\" != typeof __THREE_DEVTOOLS__ && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(\"observe\", { detail: this }));\n }\n _bindAction(t2, e2) {\n const s2 = t2._localRoot || this._root, i2 = t2._clip.tracks, r2 = i2.length, n2 = t2._propertyBindings, a2 = t2._interpolants, o2 = s2.uuid, h2 = this._bindingsByRootAndName;\n let l2 = h2[o2];\n void 0 === l2 && (l2 = {}, h2[o2] = l2);\n for (let t3 = 0; t3 !== r2; ++t3) {\n const r3 = i2[t3], h3 = r3.name;\n let c2 = l2[h3];\n if (void 0 !== c2) ++c2.referenceCount, n2[t3] = c2;\n else {\n if (c2 = n2[t3], void 0 !== c2) {\n null === c2._cacheIndex && (++c2.referenceCount, this._addInactiveBinding(c2, o2, h3));\n continue;\n }\n const i3 = e2 && e2._propertyBindings[t3].binding.parsedPath;\n c2 = new Gu(id.create(s2, h3, i3), r3.ValueTypeName, r3.getValueSize()), ++c2.referenceCount, this._addInactiveBinding(c2, o2, h3), n2[t3] = c2;\n }\n a2[t3].resultBuffer = c2.buffer;\n }\n }\n _activateAction(t2) {\n if (!this._isActiveAction(t2)) {\n if (null === t2._cacheIndex) {\n const e3 = (t2._localRoot || this._root).uuid, s2 = t2._clip.uuid, i2 = this._actionsByClip[s2];\n this._bindAction(t2, i2 && i2.knownActions[0]), this._addInactiveAction(t2, s2, e3);\n }\n const e2 = t2._propertyBindings;\n for (let t3 = 0, s2 = e2.length; t3 !== s2; ++t3) {\n const s3 = e2[t3];\n 0 === s3.useCount++ && (this._lendBinding(s3), s3.saveOriginalState());\n }\n this._lendAction(t2);\n }\n }\n _deactivateAction(t2) {\n if (this._isActiveAction(t2)) {\n const e2 = t2._propertyBindings;\n for (let t3 = 0, s2 = e2.length; t3 !== s2; ++t3) {\n const s3 = e2[t3];\n 0 === --s3.useCount && (s3.restoreOriginalState(), this._takeBackBinding(s3));\n }\n this._takeBackAction(t2);\n }\n }\n _initMemoryManager() {\n this._actions = [], this._nActiveActions = 0, this._actionsByClip = {}, this._bindings = [], this._nActiveBindings = 0, this._bindingsByRootAndName = {}, this._controlInterpolants = [], this._nActiveControlInterpolants = 0;\n const t2 = this;\n this.stats = {\n actions: {\n get total() {\n return t2._actions.length;\n },\n get inUse() {\n return t2._nActiveActions;\n }\n },\n bindings: {\n get total() {\n return t2._bindings.length;\n },\n get inUse() {\n return t2._nActiveBindings;\n }\n },\n controlInterpolants: {\n get total() {\n return t2._controlInterpolants.length;\n },\n get inUse() {\n return t2._nActiveControlInterpolants;\n }\n }\n };\n }\n _isActiveAction(t2) {\n const e2 = t2._cacheIndex;\n return null !== e2 && e2 < this._nActiveActions;\n }\n _addInactiveAction(t2, e2, s2) {\n const i2 = this._actions, r2 = this._actionsByClip;\n let n2 = r2[e2];\n if (void 0 === n2)\n n2 = { knownActions: [t2], actionByRoot: {} }, t2._byClipCacheIndex = 0, r2[e2] = n2;\n else {\n const e3 = n2.knownActions;\n t2._byClipCacheIndex = e3.length, e3.push(t2);\n }\n t2._cacheIndex = i2.length, i2.push(t2), n2.actionByRoot[s2] = t2;\n }\n _removeInactiveAction(t2) {\n const e2 = this._actions, s2 = e2[e2.length - 1], i2 = t2._cacheIndex;\n s2._cacheIndex = i2, e2[i2] = s2, e2.pop(), t2._cacheIndex = null;\n const r2 = t2._clip.uuid, n2 = this._actionsByClip, a2 = n2[r2], o2 = a2.knownActions, h2 = o2[o2.length - 1], l2 = t2._byClipCacheIndex;\n h2._byClipCacheIndex = l2, o2[l2] = h2, o2.pop(), t2._byClipCacheIndex = null;\n delete a2.actionByRoot[(t2._localRoot || this._root).uuid], 0 === o2.length && delete n2[r2], this._removeInactiveBindingsForAction(t2);\n }\n _removeInactiveBindingsForAction(t2) {\n const e2 = t2._propertyBindings;\n for (let t3 = 0, s2 = e2.length; t3 !== s2; ++t3) {\n const s3 = e2[t3];\n 0 === --s3.referenceCount && this._removeInactiveBinding(s3);\n }\n }\n _lendAction(t2) {\n const e2 = this._actions, s2 = t2._cacheIndex, i2 = this._nActiveActions++, r2 = e2[i2];\n t2._cacheIndex = i2, e2[i2] = t2, r2._cacheIndex = s2, e2[s2] = r2;\n }\n _takeBackAction(t2) {\n const e2 = this._actions, s2 = t2._cacheIndex, i2 = --this._nActiveActions, r2 = e2[i2];\n t2._cacheIndex = i2, e2[i2] = t2, r2._cacheIndex = s2, e2[s2] = r2;\n }\n _addInactiveBinding(t2, e2, s2) {\n const i2 = this._bindingsByRootAndName, r2 = this._bindings;\n let n2 = i2[e2];\n void 0 === n2 && (n2 = {}, i2[e2] = n2), n2[s2] = t2, t2._cacheIndex = r2.length, r2.push(t2);\n }\n _removeInactiveBinding(t2) {\n const e2 = this._bindings, s2 = t2.binding, i2 = s2.rootNode.uuid, r2 = s2.path, n2 = this._bindingsByRootAndName, a2 = n2[i2], o2 = e2[e2.length - 1], h2 = t2._cacheIndex;\n o2._cacheIndex = h2, e2[h2] = o2, e2.pop(), delete a2[r2], 0 === Object.keys(a2).length && delete n2[i2];\n }\n _lendBinding(t2) {\n const e2 = this._bindings, s2 = t2._cacheIndex, i2 = this._nActiveBindings++, r2 = e2[i2];\n t2._cacheIndex = i2, e2[i2] = t2, r2._cacheIndex = s2, e2[s2] = r2;\n }\n _takeBackBinding(t2) {\n const e2 = this._bindings, s2 = t2._cacheIndex, i2 = --this._nActiveBindings, r2 = e2[i2];\n t2._cacheIndex = i2, e2[i2] = t2, r2._cacheIndex = s2, e2[s2] = r2;\n }\n _lendControlInterpolant() {\n const t2 = this._controlInterpolants, e2 = this._nActiveControlInterpolants++;\n let s2 = t2[e2];\n return void 0 === s2 && (s2 = new mc(new Float32Array(2), new Float32Array(2), 1, ad), s2.__cacheIndex = e2, t2[e2] = s2), s2;\n }\n _takeBackControlInterpolant(t2) {\n const e2 = this._controlInterpolants, s2 = t2.__cacheIndex, i2 = --this._nActiveControlInterpolants, r2 = e2[i2];\n t2.__cacheIndex = i2, e2[i2] = t2, r2.__cacheIndex = s2, e2[s2] = r2;\n }\n clipAction(t2, e2, s2) {\n const i2 = e2 || this._root, r2 = i2.uuid;\n let n2 = \"string\" == typeof t2 ? Ac.findByName(i2, t2) : t2;\n const a2 = null !== n2 ? n2.uuid : t2, o2 = this._actionsByClip[a2];\n let h2 = null;\n if (void 0 === s2 && (s2 = null !== n2 ? n2.blendMode : We), void 0 !== o2) {\n const t3 = o2.actionByRoot[r2];\n if (void 0 !== t3 && t3.blendMode === s2) return t3;\n h2 = o2.knownActions[0], null === n2 && (n2 = h2._clip);\n }\n if (null === n2) return null;\n const l2 = new nd(this, n2, e2, s2);\n return this._bindAction(l2, h2), this._addInactiveAction(l2, a2, r2), l2;\n }\n existingAction(t2, e2) {\n const s2 = e2 || this._root, i2 = s2.uuid, r2 = \"string\" == typeof t2 ? Ac.findByName(s2, t2) : t2, n2 = r2 ? r2.uuid : t2, a2 = this._actionsByClip[n2];\n return void 0 !== a2 && a2.actionByRoot[i2] || null;\n }\n stopAllAction() {\n const t2 = this._actions;\n for (let e2 = this._nActiveActions - 1; e2 >= 0; --e2) t2[e2].stop();\n return this;\n }\n update(t2) {\n t2 *= this.timeScale;\n const e2 = this._actions, s2 = this._nActiveActions, i2 = this.time += t2, r2 = Math.sign(t2), n2 = this._accuIndex ^= 1;\n for (let a3 = 0; a3 !== s2; ++a3) {\n e2[a3]._update(i2, t2, r2, n2);\n }\n const a2 = this._bindings, o2 = this._nActiveBindings;\n for (let t3 = 0; t3 !== o2; ++t3) a2[t3].apply(n2);\n return this;\n }\n setTime(t2) {\n this.time = 0;\n for (let t3 = 0; t3 < this._actions.length; t3++) this._actions[t3].time = 0;\n return this.update(t2);\n }\n getRoot() {\n return this._root;\n }\n uncacheClip(t2) {\n const e2 = this._actions, s2 = t2.uuid, i2 = this._actionsByClip, r2 = i2[s2];\n if (void 0 !== r2) {\n const t3 = r2.knownActions;\n for (let s3 = 0, i3 = t3.length; s3 !== i3; ++s3) {\n const i4 = t3[s3];\n this._deactivateAction(i4);\n const r3 = i4._cacheIndex, n2 = e2[e2.length - 1];\n i4._cacheIndex = null, i4._byClipCacheIndex = null, n2._cacheIndex = r3, e2[r3] = n2, e2.pop(), this._removeInactiveBindingsForAction(i4);\n }\n delete i2[s2];\n }\n }\n uncacheRoot(t2) {\n const e2 = t2.uuid, s2 = this._actionsByClip;\n for (const t3 in s2) {\n const i3 = s2[t3].actionByRoot[e2];\n void 0 !== i3 && (this._deactivateAction(i3), this._removeInactiveAction(i3));\n }\n const i2 = this._bindingsByRootAndName[e2];\n if (void 0 !== i2)\n for (const t3 in i2) {\n const e3 = i2[t3];\n e3.restoreOriginalState(), this._removeInactiveBinding(e3);\n }\n }\n uncacheAction(t2, e2) {\n const s2 = this.existingAction(t2, e2);\n null !== s2 && (this._deactivateAction(s2), this._removeInactiveAction(s2));\n }\n };\n var hd = class extends Hi {\n constructor(t2 = 1, e2 = 1, s2 = 1, i2 = {}) {\n super(t2, e2, i2), this.isRenderTarget3D = true, this.depth = s2, this.texture = new Gi(null, t2, e2, s2), this._setTextureOptions(i2), this.texture.isRenderTargetTexture = true;\n }\n };\n var ld = class _ld {\n constructor(t2) {\n this.value = t2;\n }\n clone() {\n return new _ld(void 0 === this.value.clone ? this.value : this.value.clone());\n }\n };\n var cd = 0;\n var ud = class extends di {\n constructor() {\n super(), this.isUniformsGroup = true, Object.defineProperty(this, \"id\", { value: cd++ }), this.name = \"\", this.usage = Os, this.uniforms = [];\n }\n add(t2) {\n return this.uniforms.push(t2), this;\n }\n remove(t2) {\n const e2 = this.uniforms.indexOf(t2);\n return -1 !== e2 && this.uniforms.splice(e2, 1), this;\n }\n setName(t2) {\n return this.name = t2, this;\n }\n setUsage(t2) {\n return this.usage = t2, this;\n }\n dispose() {\n this.dispatchEvent({ type: \"dispose\" });\n }\n copy(t2) {\n this.name = t2.name, this.usage = t2.usage;\n const e2 = t2.uniforms;\n this.uniforms.length = 0;\n for (let t3 = 0, s2 = e2.length; t3 < s2; t3++) {\n const s3 = Array.isArray(e2[t3]) ? e2[t3] : [e2[t3]];\n for (let t4 = 0; t4 < s3.length; t4++) this.uniforms.push(s3[t4].clone());\n }\n return this;\n }\n clone() {\n return new this.constructor().copy(this);\n }\n };\n var dd = class extends Jn {\n constructor(t2, e2, s2 = 1) {\n super(t2, e2), this.isInstancedInterleavedBuffer = true, this.meshPerAttribute = s2;\n }\n copy(t2) {\n return super.copy(t2), this.meshPerAttribute = t2.meshPerAttribute, this;\n }\n clone(t2) {\n const e2 = super.clone(t2);\n return e2.meshPerAttribute = this.meshPerAttribute, e2;\n }\n toJSON(t2) {\n const e2 = super.toJSON(t2);\n return e2.isInstancedInterleavedBuffer = true, e2.meshPerAttribute = this.meshPerAttribute, e2;\n }\n };\n var pd = class {\n constructor(t2, e2, s2, i2, r2, n2 = false) {\n this.isGLBufferAttribute = true, this.name = \"\", this.buffer = t2, this.type = e2, this.itemSize = s2, this.elementSize = i2, this.count = r2, this.normalized = n2, this.version = 0;\n }\n set needsUpdate(t2) {\n true === t2 && this.version++;\n }\n setBuffer(t2) {\n return this.buffer = t2, this;\n }\n setType(t2, e2) {\n return this.type = t2, this.elementSize = e2, this;\n }\n setItemSize(t2) {\n return this.itemSize = t2, this;\n }\n setCount(t2) {\n return this.count = t2, this;\n }\n };\n var md = new Qi();\n var yd = class {\n constructor(t2, e2, s2 = 0, i2 = 1 / 0) {\n this.ray = new wa(t2, e2), this.near = s2, this.far = i2, this.camera = null, this.layers = new lr(), this.params = {\n Mesh: {},\n Line: { threshold: 1 },\n LOD: {},\n Points: { threshold: 1 },\n Sprite: {}\n };\n }\n set(t2, e2) {\n this.ray.set(t2, e2);\n }\n setFromCamera(t2, e2) {\n e2.isPerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(e2.matrixWorld), this.ray.direction.set(t2.x, t2.y, 0.5).unproject(e2).sub(this.ray.origin).normalize(), this.camera = e2) : e2.isOrthographicCamera ? (this.ray.origin.set(t2.x, t2.y, e2.projectionMatrix.elements[14]).unproject(e2), this.ray.direction.set(0, 0, -1).transformDirection(e2.matrixWorld), this.camera = e2) : oi(\"Raycaster: Unsupported camera type: \" + e2.type);\n }\n setFromXRController(t2) {\n return md.identity().extractRotation(t2.matrixWorld), this.ray.origin.setFromMatrixPosition(t2.matrixWorld), this.ray.direction.set(0, 0, -1).applyMatrix4(md), this;\n }\n intersectObject(t2, e2 = true, s2 = []) {\n return fd(t2, this, s2, e2), s2.sort(gd), s2;\n }\n intersectObjects(t2, e2 = true, s2 = []) {\n for (let i2 = 0, r2 = t2.length; i2 < r2; i2++) fd(t2[i2], this, s2, e2);\n return s2.sort(gd), s2;\n }\n };\n function gd(t2, e2) {\n return t2.distance - e2.distance;\n }\n function fd(t2, e2, s2, i2) {\n let r2 = true;\n if (t2.layers.test(e2.layers)) {\n false === t2.raycast(e2, s2) && (r2 = false);\n }\n if (true === r2 && true === i2) {\n const i3 = t2.children;\n for (let t3 = 0, r3 = i3.length; t3 < r3; t3++) fd(i3[t3], e2, s2, true);\n }\n }\n var xd = class {\n constructor(t2 = true) {\n this.autoStart = t2, this.startTime = 0, this.oldTime = 0, this.elapsedTime = 0, this.running = false, ai(\"Clock: This module has been deprecated. Please use THREE.Timer instead.\");\n }\n start() {\n this.startTime = performance.now(), this.oldTime = this.startTime, this.elapsedTime = 0, this.running = true;\n }\n stop() {\n this.getElapsedTime(), this.running = false, this.autoStart = false;\n }\n getElapsedTime() {\n return this.getDelta(), this.elapsedTime;\n }\n getDelta() {\n let t2 = 0;\n if (this.autoStart && !this.running) return this.start(), 0;\n if (this.running) {\n const e2 = performance.now();\n t2 = (e2 - this.oldTime) / 1e3, this.oldTime = e2, this.elapsedTime += t2;\n }\n return t2;\n }\n };\n var bd = class {\n constructor(t2 = 1, e2 = 0, s2 = 0) {\n this.radius = t2, this.phi = e2, this.theta = s2;\n }\n set(t2, e2, s2) {\n return this.radius = t2, this.phi = e2, this.theta = s2, this;\n }\n copy(t2) {\n return this.radius = t2.radius, this.phi = t2.phi, this.theta = t2.theta, this;\n }\n makeSafe() {\n const t2 = 1e-6;\n return this.phi = xi(this.phi, t2, Math.PI - t2), this;\n }\n setFromVector3(t2) {\n return this.setFromCartesianCoords(t2.x, t2.y, t2.z);\n }\n setFromCartesianCoords(t2, e2, s2) {\n return this.radius = Math.sqrt(t2 * t2 + e2 * e2 + s2 * s2), 0 === this.radius ? (this.theta = 0, this.phi = 0) : (this.theta = Math.atan2(t2, s2), this.phi = Math.acos(xi(e2 / this.radius, -1, 1))), this;\n }\n clone() {\n return new this.constructor().copy(this);\n }\n };\n var vd = class {\n constructor(t2 = 1, e2 = 0, s2 = 0) {\n this.radius = t2, this.theta = e2, this.y = s2;\n }\n set(t2, e2, s2) {\n return this.radius = t2, this.theta = e2, this.y = s2, this;\n }\n copy(t2) {\n return this.radius = t2.radius, this.theta = t2.theta, this.y = t2.y, this;\n }\n setFromVector3(t2) {\n return this.setFromCartesianCoords(t2.x, t2.y, t2.z);\n }\n setFromCartesianCoords(t2, e2, s2) {\n return this.radius = Math.sqrt(t2 * t2 + s2 * s2), this.theta = Math.atan2(t2, s2), this.y = e2, this;\n }\n clone() {\n return new this.constructor().copy(this);\n }\n };\n var wd = class _wd {\n static {\n _wd.prototype.isMatrix2 = true;\n }\n constructor(t2, e2, s2, i2) {\n this.elements = [1, 0, 0, 1], void 0 !== t2 && this.set(t2, e2, s2, i2);\n }\n identity() {\n return this.set(1, 0, 0, 1), this;\n }\n fromArray(t2, e2 = 0) {\n for (let s2 = 0; s2 < 4; s2++) this.elements[s2] = t2[s2 + e2];\n return this;\n }\n set(t2, e2, s2, i2) {\n const r2 = this.elements;\n return r2[0] = t2, r2[2] = e2, r2[1] = s2, r2[3] = i2, this;\n }\n };\n var Md = new _i();\n var Sd = class {\n constructor(t2 = new _i(1 / 0, 1 / 0), e2 = new _i(-1 / 0, -1 / 0)) {\n this.isBox2 = true, this.min = t2, this.max = e2;\n }\n set(t2, e2) {\n return this.min.copy(t2), this.max.copy(e2), this;\n }\n setFromPoints(t2) {\n this.makeEmpty();\n for (let e2 = 0, s2 = t2.length; e2 < s2; e2++) this.expandByPoint(t2[e2]);\n return this;\n }\n setFromCenterAndSize(t2, e2) {\n const s2 = Md.copy(e2).multiplyScalar(0.5);\n return this.min.copy(t2).sub(s2), this.max.copy(t2).add(s2), this;\n }\n clone() {\n return new this.constructor().copy(this);\n }\n copy(t2) {\n return this.min.copy(t2.min), this.max.copy(t2.max), this;\n }\n makeEmpty() {\n return this.min.x = this.min.y = 1 / 0, this.max.x = this.max.y = -1 / 0, this;\n }\n isEmpty() {\n return this.max.x < this.min.x || this.max.y < this.min.y;\n }\n getCenter(t2) {\n return this.isEmpty() ? t2.set(0, 0) : t2.addVectors(this.min, this.max).multiplyScalar(0.5);\n }\n getSize(t2) {\n return this.isEmpty() ? t2.set(0, 0) : t2.subVectors(this.max, this.min);\n }\n expandByPoint(t2) {\n return this.min.min(t2), this.max.max(t2), this;\n }\n expandByVector(t2) {\n return this.min.sub(t2), this.max.add(t2), this;\n }\n expandByScalar(t2) {\n return this.min.addScalar(-t2), this.max.addScalar(t2), this;\n }\n containsPoint(t2) {\n return t2.x >= this.min.x && t2.x <= this.max.x && t2.y >= this.min.y && t2.y <= this.max.y;\n }\n containsBox(t2) {\n return this.min.x <= t2.min.x && t2.max.x <= this.max.x && this.min.y <= t2.min.y && t2.max.y <= this.max.y;\n }\n getParameter(t2, e2) {\n return e2.set(\n (t2.x - this.min.x) / (this.max.x - this.min.x),\n (t2.y - this.min.y) / (this.max.y - this.min.y)\n );\n }\n intersectsBox(t2) {\n return t2.max.x >= this.min.x && t2.min.x <= this.max.x && t2.max.y >= this.min.y && t2.min.y <= this.max.y;\n }\n clampPoint(t2, e2) {\n return e2.copy(t2).clamp(this.min, this.max);\n }\n distanceToPoint(t2) {\n return this.clampPoint(t2, Md).distanceTo(t2);\n }\n intersect(t2) {\n return this.min.max(t2.min), this.max.min(t2.max), this.isEmpty() && this.makeEmpty(), this;\n }\n union(t2) {\n return this.min.min(t2.min), this.max.max(t2.max), this;\n }\n translate(t2) {\n return this.min.add(t2), this.max.add(t2), this;\n }\n equals(t2) {\n return t2.min.equals(this.min) && t2.max.equals(this.max);\n }\n };\n var _d = new Ti();\n var Ad = new Ti();\n var Td = new Ti();\n var zd = new Ti();\n var Cd = new Ti();\n var Id = new Ti();\n var Bd = new Ti();\n var kd = class {\n constructor(t2 = new Ti(), e2 = new Ti()) {\n this.start = t2, this.end = e2;\n }\n set(t2, e2) {\n return this.start.copy(t2), this.end.copy(e2), this;\n }\n copy(t2) {\n return this.start.copy(t2.start), this.end.copy(t2.end), this;\n }\n getCenter(t2) {\n return t2.addVectors(this.start, this.end).multiplyScalar(0.5);\n }\n delta(t2) {\n return t2.subVectors(this.end, this.start);\n }\n distanceSq() {\n return this.start.distanceToSquared(this.end);\n }\n distance() {\n return this.start.distanceTo(this.end);\n }\n at(t2, e2) {\n return this.delta(e2).multiplyScalar(t2).add(this.start);\n }\n closestPointToPointParameter(t2, e2) {\n _d.subVectors(t2, this.start), Ad.subVectors(this.end, this.start);\n const s2 = Ad.dot(Ad);\n if (0 === s2) return 0;\n let i2 = Ad.dot(_d) / s2;\n return e2 && (i2 = xi(i2, 0, 1)), i2;\n }\n closestPointToPoint(t2, e2, s2) {\n const i2 = this.closestPointToPointParameter(t2, e2);\n return this.delta(s2).multiplyScalar(i2).add(this.start);\n }\n distanceSqToLine3(t2, e2 = Id, s2 = Bd) {\n const i2 = 1e-8 * 1e-8;\n let r2, n2;\n const a2 = this.start, o2 = t2.start, h2 = this.end, l2 = t2.end;\n Td.subVectors(h2, a2), zd.subVectors(l2, o2), Cd.subVectors(a2, o2);\n const c2 = Td.dot(Td), u2 = zd.dot(zd), d2 = zd.dot(Cd);\n if (c2 <= i2 && u2 <= i2) return e2.copy(a2), s2.copy(o2), e2.sub(s2), e2.dot(e2);\n if (c2 <= i2) r2 = 0, n2 = d2 / u2, n2 = xi(n2, 0, 1);\n else {\n const t3 = Td.dot(Cd);\n if (u2 <= i2) n2 = 0, r2 = xi(-t3 / c2, 0, 1);\n else {\n const e3 = Td.dot(zd), s3 = c2 * u2 - e3 * e3;\n r2 = 0 !== s3 ? xi((e3 * d2 - t3 * u2) / s3, 0, 1) : 0, n2 = (e3 * r2 + d2) / u2, n2 < 0 ? (n2 = 0, r2 = xi(-t3 / c2, 0, 1)) : n2 > 1 && (n2 = 1, r2 = xi((e3 - t3) / c2, 0, 1));\n }\n }\n return e2.copy(a2).addScaledVector(Td, r2), s2.copy(o2).addScaledVector(zd, n2), e2.distanceToSquared(s2);\n }\n applyMatrix4(t2) {\n return this.start.applyMatrix4(t2), this.end.applyMatrix4(t2), this;\n }\n equals(t2) {\n return t2.start.equals(this.start) && t2.end.equals(this.end);\n }\n clone() {\n return new this.constructor().copy(this);\n }\n };\n var Od = new Ti();\n var Pd = class extends Ar {\n constructor(t2, e2) {\n super(), this.light = t2, this.matrixAutoUpdate = false, this.color = e2, this.type = \"SpotLightHelper\";\n const s2 = new Wn(), i2 = [\n 0,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 1,\n 0,\n 1,\n 0,\n 0,\n 0,\n -1,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 1,\n 0,\n 0,\n 0,\n 0,\n -1,\n 1\n ];\n for (let t3 = 0, e3 = 1, s3 = 32; t3 < s3; t3++, e3++) {\n const r3 = t3 / s3 * Math.PI * 2, n2 = e3 / s3 * Math.PI * 2;\n i2.push(Math.cos(r3), Math.sin(r3), 1, Math.cos(n2), Math.sin(n2), 1);\n }\n s2.setAttribute(\"position\", new kn(i2, 3));\n const r2 = new No({ fog: false, toneMapped: false });\n this.cone = new Yo(s2, r2), this.add(this.cone), this.update();\n }\n dispose() {\n this.cone.geometry.dispose(), this.cone.material.dispose();\n }\n update() {\n this.light.updateWorldMatrix(true, false), this.light.target.updateWorldMatrix(true, false), this.parent ? (this.parent.updateWorldMatrix(true), this.matrix.copy(this.parent.matrixWorld).invert().multiply(this.light.matrixWorld)) : this.matrix.copy(this.light.matrixWorld), this.matrixWorldNeedsUpdate = true;\n const t2 = this.light.distance ? this.light.distance : 1e3, e2 = t2 * Math.tan(this.light.angle);\n this.cone.scale.set(e2, e2, t2), Od.setFromMatrixPosition(this.light.target.matrixWorld), this.cone.lookAt(Od), void 0 !== this.color ? this.cone.material.color.set(this.color) : this.cone.material.color.copy(this.light.color);\n }\n };\n var Rd = new Ti();\n var Ed = new Qi();\n var Nd = new Qi();\n var Vd = class extends Yo {\n constructor(t2) {\n const e2 = Ld(t2), s2 = new Wn(), i2 = [], r2 = [];\n for (let t3 = 0; t3 < e2.length; t3++) {\n const s3 = e2[t3];\n s3.parent && s3.parent.isBone && (i2.push(0, 0, 0), i2.push(0, 0, 0), r2.push(0, 0, 0), r2.push(0, 0, 0));\n }\n s2.setAttribute(\"position\", new kn(i2, 3)), s2.setAttribute(\"color\", new kn(r2, 3));\n super(\n s2,\n new No({ vertexColors: true, depthTest: false, depthWrite: false, toneMapped: false, transparent: true })\n ), this.isSkeletonHelper = true, this.type = \"SkeletonHelper\", this.root = t2, this.bones = e2, this.matrix = t2.matrixWorld, this.matrixAutoUpdate = false;\n const n2 = new Pr(255), a2 = new Pr(65280);\n this.setColors(n2, a2);\n }\n updateMatrixWorld(t2) {\n const e2 = this.bones, s2 = this.geometry, i2 = s2.getAttribute(\"position\");\n Nd.copy(this.root.matrixWorld).invert();\n for (let t3 = 0, s3 = 0; t3 < e2.length; t3++) {\n const r2 = e2[t3];\n r2.parent && r2.parent.isBone && (Ed.multiplyMatrices(Nd, r2.matrixWorld), Rd.setFromMatrixPosition(Ed), i2.setXYZ(s3, Rd.x, Rd.y, Rd.z), Ed.multiplyMatrices(Nd, r2.parent.matrixWorld), Rd.setFromMatrixPosition(Ed), i2.setXYZ(s3 + 1, Rd.x, Rd.y, Rd.z), s3 += 2);\n }\n s2.getAttribute(\"position\").needsUpdate = true, super.updateMatrixWorld(t2);\n }\n setColors(t2, e2) {\n const s2 = this.geometry.getAttribute(\"color\");\n for (let i2 = 0; i2 < s2.count; i2 += 2)\n s2.setXYZ(i2, t2.r, t2.g, t2.b), s2.setXYZ(i2 + 1, e2.r, e2.g, e2.b);\n return s2.needsUpdate = true, this;\n }\n dispose() {\n this.geometry.dispose(), this.material.dispose();\n }\n };\n function Ld(t2) {\n const e2 = [];\n true === t2.isBone && e2.push(t2);\n for (let s2 = 0; s2 < t2.children.length; s2++) e2.push(...Ld(t2.children[s2]));\n return e2;\n }\n var Fd = class extends Ra {\n constructor(t2, e2, s2) {\n super(new El(e2, 4, 2), new Ma({ wireframe: true, fog: false, toneMapped: false })), this.light = t2, this.color = s2, this.type = \"PointLightHelper\", this.matrix = this.light.matrixWorld, this.matrixAutoUpdate = false, this.update();\n }\n dispose() {\n this.geometry.dispose(), this.material.dispose();\n }\n update() {\n this.matrixWorldNeedsUpdate = true, this.light.updateWorldMatrix(true, false), void 0 !== this.color ? this.material.color.set(this.color) : this.material.color.copy(this.light.color);\n }\n };\n var Dd = new Ti();\n var Ud = new Pr();\n var jd = new Pr();\n var Wd = class extends Ar {\n constructor(t2, e2, s2) {\n super(), this.light = t2, this.matrix = t2.matrixWorld, this.matrixAutoUpdate = false, this.color = s2, this.type = \"HemisphereLightHelper\";\n const i2 = new kl(e2);\n i2.rotateY(0.5 * Math.PI), this.material = new Ma({ wireframe: true, fog: false, toneMapped: false }), void 0 === this.color && (this.material.vertexColors = true);\n const r2 = i2.getAttribute(\"position\"), n2 = new Float32Array(3 * r2.count);\n i2.setAttribute(\"color\", new Mn(n2, 3)), this.add(new Ra(i2, this.material)), this.update();\n }\n dispose() {\n this.children[0].geometry.dispose(), this.children[0].material.dispose();\n }\n update() {\n const t2 = this.children[0];\n if (void 0 !== this.color) this.material.color.set(this.color);\n else {\n const e2 = t2.geometry.getAttribute(\"color\");\n Ud.copy(this.light.color), jd.copy(this.light.groundColor);\n for (let t3 = 0, s2 = e2.count; t3 < s2; t3++) {\n const i2 = t3 < s2 / 2 ? Ud : jd;\n e2.setXYZ(t3, i2.r, i2.g, i2.b);\n }\n e2.needsUpdate = true;\n }\n this.matrixWorldNeedsUpdate = true, this.light.updateWorldMatrix(true, false), t2.lookAt(Dd.setFromMatrixPosition(this.light.matrixWorld).negate());\n }\n };\n var Jd = class extends Yo {\n constructor(t2 = 10, e2 = 10, s2 = 4473924, i2 = 8947848) {\n s2 = new Pr(s2), i2 = new Pr(i2);\n const r2 = e2 / 2, n2 = t2 / e2, a2 = t2 / 2, o2 = [], h2 = [];\n for (let t3 = 0, l3 = 0, c2 = -a2; t3 <= e2; t3++, c2 += n2) {\n o2.push(-a2, 0, c2, a2, 0, c2), o2.push(c2, 0, -a2, c2, 0, a2);\n const e3 = t3 === r2 ? s2 : i2;\n e3.toArray(h2, l3), l3 += 3, e3.toArray(h2, l3), l3 += 3, e3.toArray(h2, l3), l3 += 3, e3.toArray(h2, l3), l3 += 3;\n }\n const l2 = new Wn();\n l2.setAttribute(\"position\", new kn(o2, 3)), l2.setAttribute(\"color\", new kn(h2, 3));\n super(l2, new No({ vertexColors: true, toneMapped: false })), this.type = \"GridHelper\";\n }\n dispose() {\n this.geometry.dispose(), this.material.dispose();\n }\n };\n var qd = class extends Yo {\n constructor(t2 = 10, e2 = 16, s2 = 8, i2 = 64, r2 = 4473924, n2 = 8947848) {\n r2 = new Pr(r2), n2 = new Pr(n2);\n const a2 = [], o2 = [];\n if (e2 > 1)\n for (let s3 = 0; s3 < e2; s3++) {\n const i3 = s3 / e2 * (2 * Math.PI), h3 = Math.sin(i3) * t2, l2 = Math.cos(i3) * t2;\n a2.push(0, 0, 0), a2.push(h3, 0, l2);\n const c2 = 1 & s3 ? r2 : n2;\n o2.push(c2.r, c2.g, c2.b), o2.push(c2.r, c2.g, c2.b);\n }\n for (let e3 = 0; e3 < s2; e3++) {\n const h3 = 1 & e3 ? r2 : n2, l2 = t2 - t2 / s2 * e3;\n for (let t3 = 0; t3 < i2; t3++) {\n let e4 = t3 / i2 * (2 * Math.PI), s3 = Math.sin(e4) * l2, r3 = Math.cos(e4) * l2;\n a2.push(s3, 0, r3), o2.push(h3.r, h3.g, h3.b), e4 = (t3 + 1) / i2 * (2 * Math.PI), s3 = Math.sin(e4) * l2, r3 = Math.cos(e4) * l2, a2.push(s3, 0, r3), o2.push(h3.r, h3.g, h3.b);\n }\n }\n const h2 = new Wn();\n h2.setAttribute(\"position\", new kn(a2, 3)), h2.setAttribute(\"color\", new kn(o2, 3));\n super(h2, new No({ vertexColors: true, toneMapped: false })), this.type = \"PolarGridHelper\";\n }\n dispose() {\n this.geometry.dispose(), this.material.dispose();\n }\n };\n var Hd = new Ti();\n var Xd = new Ti();\n var Yd = new Ti();\n var Zd = class extends Ar {\n constructor(t2, e2, s2) {\n super(), this.light = t2, this.matrix = t2.matrixWorld, this.matrixAutoUpdate = false, this.color = s2, this.type = \"DirectionalLightHelper\", void 0 === e2 && (e2 = 1);\n let i2 = new Wn();\n i2.setAttribute(\"position\", new kn([-e2, e2, 0, e2, e2, 0, e2, -e2, 0, -e2, -e2, 0, -e2, e2, 0], 3));\n const r2 = new No({ fog: false, toneMapped: false });\n this.lightPlane = new Jo(i2, r2), this.add(this.lightPlane), i2 = new Wn(), i2.setAttribute(\"position\", new kn([0, 0, 0, 0, 0, 1], 3)), this.targetLine = new Jo(i2, r2), this.add(this.targetLine), this.update();\n }\n dispose() {\n this.lightPlane.geometry.dispose(), this.lightPlane.material.dispose(), this.targetLine.geometry.dispose(), this.targetLine.material.dispose();\n }\n update() {\n this.matrixWorldNeedsUpdate = true, this.light.updateWorldMatrix(true, false), this.light.target.updateWorldMatrix(true, false), Hd.setFromMatrixPosition(this.light.matrixWorld), Xd.setFromMatrixPosition(this.light.target.matrixWorld), Yd.subVectors(Xd, Hd), this.lightPlane.lookAt(Xd), void 0 !== this.color ? (this.lightPlane.material.color.set(this.color), this.targetLine.material.color.set(this.color)) : (this.lightPlane.material.color.copy(this.light.color), this.targetLine.material.color.copy(this.light.color)), this.targetLine.lookAt(Xd), this.targetLine.scale.z = Yd.length();\n }\n };\n var Gd = new Ti();\n var $d = new $c();\n var Qd = class extends Yo {\n constructor(t2) {\n const e2 = new Wn(), s2 = new No({ color: 16777215, vertexColors: true, toneMapped: false }), i2 = [], r2 = [], n2 = {};\n function a2(t3, e3) {\n o2(t3), o2(e3);\n }\n function o2(t3) {\n i2.push(0, 0, 0), r2.push(0, 0, 0), void 0 === n2[t3] && (n2[t3] = []), n2[t3].push(i2.length / 3 - 1);\n }\n a2(\"n1\", \"n2\"), a2(\"n2\", \"n4\"), a2(\"n4\", \"n3\"), a2(\"n3\", \"n1\"), a2(\"f1\", \"f2\"), a2(\"f2\", \"f4\"), a2(\"f4\", \"f3\"), a2(\"f3\", \"f1\"), a2(\"n1\", \"f1\"), a2(\"n2\", \"f2\"), a2(\"n3\", \"f3\"), a2(\"n4\", \"f4\"), a2(\"p\", \"n1\"), a2(\"p\", \"n2\"), a2(\"p\", \"n3\"), a2(\"p\", \"n4\"), a2(\"u1\", \"u2\"), a2(\"u2\", \"u3\"), a2(\"u3\", \"u1\"), a2(\"c\", \"t\"), a2(\"p\", \"c\"), a2(\"cn1\", \"cn2\"), a2(\"cn3\", \"cn4\"), a2(\"cf1\", \"cf2\"), a2(\"cf3\", \"cf4\"), e2.setAttribute(\"position\", new kn(i2, 3)), e2.setAttribute(\"color\", new kn(r2, 3)), super(e2, s2), this.type = \"CameraHelper\", this.camera = t2, this.camera.updateProjectionMatrix && this.camera.updateProjectionMatrix(), this.matrix = t2.matrixWorld, this.matrixAutoUpdate = false, this.pointMap = n2, this.update();\n const h2 = new Pr(16755200), l2 = new Pr(16711680), c2 = new Pr(43775), u2 = new Pr(16777215), d2 = new Pr(3355443);\n this.setColors(h2, l2, c2, u2, d2);\n }\n setColors(t2, e2, s2, i2, r2) {\n const n2 = this.geometry.getAttribute(\"color\");\n return n2.setXYZ(0, t2.r, t2.g, t2.b), n2.setXYZ(1, t2.r, t2.g, t2.b), n2.setXYZ(2, t2.r, t2.g, t2.b), n2.setXYZ(3, t2.r, t2.g, t2.b), n2.setXYZ(4, t2.r, t2.g, t2.b), n2.setXYZ(5, t2.r, t2.g, t2.b), n2.setXYZ(6, t2.r, t2.g, t2.b), n2.setXYZ(7, t2.r, t2.g, t2.b), n2.setXYZ(8, t2.r, t2.g, t2.b), n2.setXYZ(9, t2.r, t2.g, t2.b), n2.setXYZ(10, t2.r, t2.g, t2.b), n2.setXYZ(11, t2.r, t2.g, t2.b), n2.setXYZ(12, t2.r, t2.g, t2.b), n2.setXYZ(13, t2.r, t2.g, t2.b), n2.setXYZ(14, t2.r, t2.g, t2.b), n2.setXYZ(15, t2.r, t2.g, t2.b), n2.setXYZ(16, t2.r, t2.g, t2.b), n2.setXYZ(17, t2.r, t2.g, t2.b), n2.setXYZ(18, t2.r, t2.g, t2.b), n2.setXYZ(19, t2.r, t2.g, t2.b), n2.setXYZ(20, t2.r, t2.g, t2.b), n2.setXYZ(21, t2.r, t2.g, t2.b), n2.setXYZ(22, t2.r, t2.g, t2.b), n2.setXYZ(23, t2.r, t2.g, t2.b), n2.setXYZ(24, e2.r, e2.g, e2.b), n2.setXYZ(25, e2.r, e2.g, e2.b), n2.setXYZ(26, e2.r, e2.g, e2.b), n2.setXYZ(27, e2.r, e2.g, e2.b), n2.setXYZ(28, e2.r, e2.g, e2.b), n2.setXYZ(29, e2.r, e2.g, e2.b), n2.setXYZ(30, e2.r, e2.g, e2.b), n2.setXYZ(31, e2.r, e2.g, e2.b), n2.setXYZ(32, s2.r, s2.g, s2.b), n2.setXYZ(33, s2.r, s2.g, s2.b), n2.setXYZ(34, s2.r, s2.g, s2.b), n2.setXYZ(35, s2.r, s2.g, s2.b), n2.setXYZ(36, s2.r, s2.g, s2.b), n2.setXYZ(37, s2.r, s2.g, s2.b), n2.setXYZ(38, i2.r, i2.g, i2.b), n2.setXYZ(39, i2.r, i2.g, i2.b), n2.setXYZ(40, r2.r, r2.g, r2.b), n2.setXYZ(41, r2.r, r2.g, r2.b), n2.setXYZ(42, r2.r, r2.g, r2.b), n2.setXYZ(43, r2.r, r2.g, r2.b), n2.setXYZ(44, r2.r, r2.g, r2.b), n2.setXYZ(45, r2.r, r2.g, r2.b), n2.setXYZ(46, r2.r, r2.g, r2.b), n2.setXYZ(47, r2.r, r2.g, r2.b), n2.setXYZ(48, r2.r, r2.g, r2.b), n2.setXYZ(49, r2.r, r2.g, r2.b), n2.needsUpdate = true, this;\n }\n update() {\n const t2 = this.geometry, e2 = this.pointMap;\n let s2, i2;\n if ($d.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse), true === this.camera.reversedDepth)\n s2 = 1, i2 = 0;\n else if (this.camera.coordinateSystem === Ws) s2 = -1, i2 = 1;\n else {\n if (this.camera.coordinateSystem !== Js)\n throw new Error(\n \"THREE.CameraHelper.update(): Invalid coordinate system: \" + this.camera.coordinateSystem\n );\n s2 = 0, i2 = 1;\n }\n Kd(\"c\", e2, t2, $d, 0, 0, s2), Kd(\"t\", e2, t2, $d, 0, 0, i2), Kd(\"n1\", e2, t2, $d, -1, -1, s2), Kd(\"n2\", e2, t2, $d, 1, -1, s2), Kd(\"n3\", e2, t2, $d, -1, 1, s2), Kd(\"n4\", e2, t2, $d, 1, 1, s2), Kd(\"f1\", e2, t2, $d, -1, -1, i2), Kd(\"f2\", e2, t2, $d, 1, -1, i2), Kd(\"f3\", e2, t2, $d, -1, 1, i2), Kd(\"f4\", e2, t2, $d, 1, 1, i2), Kd(\"u1\", e2, t2, $d, 0.7, 1.1, s2), Kd(\"u2\", e2, t2, $d, -0.7, 1.1, s2), Kd(\"u3\", e2, t2, $d, 0, 2, s2), Kd(\"cf1\", e2, t2, $d, -1, 0, i2), Kd(\"cf2\", e2, t2, $d, 1, 0, i2), Kd(\"cf3\", e2, t2, $d, 0, -1, i2), Kd(\"cf4\", e2, t2, $d, 0, 1, i2), Kd(\"cn1\", e2, t2, $d, -1, 0, s2), Kd(\"cn2\", e2, t2, $d, 1, 0, s2), Kd(\"cn3\", e2, t2, $d, 0, -1, s2), Kd(\"cn4\", e2, t2, $d, 0, 1, s2), t2.getAttribute(\"position\").needsUpdate = true;\n }\n dispose() {\n this.geometry.dispose(), this.material.dispose();\n }\n };\n function Kd(t2, e2, s2, i2, r2, n2, a2) {\n Gd.set(r2, n2, a2).unproject(i2);\n const o2 = e2[t2];\n if (void 0 !== o2) {\n const t3 = s2.getAttribute(\"position\");\n for (let e3 = 0, s3 = o2.length; e3 < s3; e3++) t3.setXYZ(o2[e3], Gd.x, Gd.y, Gd.z);\n }\n }\n var tp = new Qr();\n var ep = class extends Yo {\n constructor(t2, e2 = 16776960) {\n const s2 = new Uint16Array([\n 0,\n 1,\n 1,\n 2,\n 2,\n 3,\n 3,\n 0,\n 4,\n 5,\n 5,\n 6,\n 6,\n 7,\n 7,\n 4,\n 0,\n 4,\n 1,\n 5,\n 2,\n 6,\n 3,\n 7\n ]), i2 = new Float32Array(24), r2 = new Wn();\n r2.setIndex(new Mn(s2, 1)), r2.setAttribute(\"position\", new Mn(i2, 3)), super(r2, new No({ color: e2, toneMapped: false })), this.object = t2, this.type = \"BoxHelper\", this.matrixAutoUpdate = false, this.update();\n }\n update() {\n if (void 0 !== this.object && tp.setFromObject(this.object), tp.isEmpty()) return;\n const t2 = tp.min, e2 = tp.max, s2 = this.geometry.attributes.position, i2 = s2.array;\n i2[0] = e2.x, i2[1] = e2.y, i2[2] = e2.z, i2[3] = t2.x, i2[4] = e2.y, i2[5] = e2.z, i2[6] = t2.x, i2[7] = t2.y, i2[8] = e2.z, i2[9] = e2.x, i2[10] = t2.y, i2[11] = e2.z, i2[12] = e2.x, i2[13] = e2.y, i2[14] = t2.z, i2[15] = t2.x, i2[16] = e2.y, i2[17] = t2.z, i2[18] = t2.x, i2[19] = t2.y, i2[20] = t2.z, i2[21] = e2.x, i2[22] = t2.y, i2[23] = t2.z, s2.needsUpdate = true, this.geometry.computeBoundingSphere();\n }\n setFromObject(t2) {\n return this.object = t2, this.update(), this;\n }\n copy(t2, e2) {\n return super.copy(t2, e2), this.object = t2.object, this;\n }\n dispose() {\n this.geometry.dispose(), this.material.dispose();\n }\n };\n var sp = class extends Yo {\n constructor(t2, e2 = 16776960) {\n const s2 = new Uint16Array([\n 0,\n 1,\n 1,\n 2,\n 2,\n 3,\n 3,\n 0,\n 4,\n 5,\n 5,\n 6,\n 6,\n 7,\n 7,\n 4,\n 0,\n 4,\n 1,\n 5,\n 2,\n 6,\n 3,\n 7\n ]), i2 = new Wn();\n i2.setIndex(new Mn(s2, 1)), i2.setAttribute(\n \"position\",\n new kn(\n [1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1],\n 3\n )\n ), super(i2, new No({ color: e2, toneMapped: false })), this.box = t2, this.type = \"Box3Helper\", this.geometry.computeBoundingSphere();\n }\n updateMatrixWorld(t2) {\n const e2 = this.box;\n e2.isEmpty() || (e2.getCenter(this.position), e2.getSize(this.scale), this.scale.multiplyScalar(0.5), super.updateMatrixWorld(t2));\n }\n dispose() {\n this.geometry.dispose(), this.material.dispose();\n }\n };\n var ip = class extends Jo {\n constructor(t2, e2 = 1, s2 = 16776960) {\n const i2 = s2, r2 = new Wn();\n r2.setAttribute(\n \"position\",\n new kn([1, -1, 0, -1, 1, 0, -1, -1, 0, 1, 1, 0, -1, 1, 0, -1, -1, 0, 1, -1, 0, 1, 1, 0], 3)\n ), r2.computeBoundingSphere(), super(r2, new No({ color: i2, toneMapped: false })), this.type = \"PlaneHelper\", this.plane = t2, this.size = e2;\n const n2 = new Wn();\n n2.setAttribute(\n \"position\",\n new kn([1, 1, 0, -1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, -1, 0], 3)\n ), n2.computeBoundingSphere(), this.add(\n new Ra(\n n2,\n new Ma({ color: i2, opacity: 0.2, transparent: true, depthWrite: false, toneMapped: false })\n )\n );\n }\n updateMatrixWorld(t2) {\n this.position.set(0, 0, 0), this.scale.set(0.5 * this.size, 0.5 * this.size, 1), this.lookAt(this.plane.normal), this.translateZ(-this.plane.constant), super.updateMatrixWorld(t2);\n }\n dispose() {\n this.geometry.dispose(), this.material.dispose(), this.children[0].geometry.dispose(), this.children[0].material.dispose();\n }\n };\n var rp = new Ti();\n var np;\n var ap;\n var op = class extends Ar {\n constructor(t2 = new Ti(0, 0, 1), e2 = new Ti(0, 0, 0), s2 = 1, i2 = 16776960, r2 = 0.2 * s2, n2 = 0.2 * r2) {\n super(), this.type = \"ArrowHelper\", void 0 === np && (np = new Wn(), np.setAttribute(\"position\", new kn([0, 0, 0, 0, 1, 0], 3)), ap = new bh(0.5, 1, 5, 1), ap.translate(0, -0.5, 0)), this.position.copy(e2), this.line = new Jo(np, new No({ color: i2, toneMapped: false })), this.line.matrixAutoUpdate = false, this.add(this.line), this.cone = new Ra(ap, new Ma({ color: i2, toneMapped: false })), this.cone.matrixAutoUpdate = false, this.add(this.cone), this.setDirection(t2), this.setLength(s2, r2, n2);\n }\n setDirection(t2) {\n if (t2.y > 0.99999) this.quaternion.set(0, 0, 0, 1);\n else if (t2.y < -0.99999) this.quaternion.set(1, 0, 0, 0);\n else {\n rp.set(t2.z, 0, -t2.x).normalize();\n const e2 = Math.acos(t2.y);\n this.quaternion.setFromAxisAngle(rp, e2);\n }\n }\n setLength(t2, e2 = 0.2 * t2, s2 = 0.2 * e2) {\n this.line.scale.set(1, Math.max(1e-4, t2 - e2), 1), this.line.updateMatrix(), this.cone.scale.set(s2, e2, s2), this.cone.position.y = t2, this.cone.updateMatrix();\n }\n setColor(t2) {\n this.line.material.color.set(t2), this.cone.material.color.set(t2);\n }\n copy(t2) {\n return super.copy(t2, false), this.line.copy(t2.line), this.cone.copy(t2.cone), this;\n }\n dispose() {\n this.line.geometry.dispose(), this.line.material.dispose(), this.cone.geometry.dispose(), this.cone.material.dispose();\n }\n };\n var hp = class extends Yo {\n constructor(t2 = 1) {\n const e2 = [0, 0, 0, t2, 0, 0, 0, 0, 0, 0, t2, 0, 0, 0, 0, 0, 0, t2], s2 = new Wn();\n s2.setAttribute(\"position\", new kn(e2, 3)), s2.setAttribute(\n \"color\",\n new kn([1, 0, 0, 1, 0.6, 0, 0, 1, 0, 0.6, 1, 0, 0, 0, 1, 0, 0.6, 1], 3)\n );\n super(s2, new No({ vertexColors: true, toneMapped: false })), this.type = \"AxesHelper\";\n }\n setColors(t2, e2, s2) {\n const i2 = new Pr(), r2 = this.geometry.attributes.color.array;\n return i2.set(t2), i2.toArray(r2, 0), i2.toArray(r2, 3), i2.set(e2), i2.toArray(r2, 6), i2.toArray(r2, 9), i2.set(s2), i2.toArray(r2, 12), i2.toArray(r2, 15), this.geometry.attributes.color.needsUpdate = true, this;\n }\n dispose() {\n this.geometry.dispose(), this.material.dispose();\n }\n };\n var lp = class {\n constructor() {\n this.type = \"ShapePath\", this.color = new Pr(), this.subPaths = [], this.currentPath = null, this.userData = {};\n }\n moveTo(t2, e2) {\n return this.currentPath = new Zh(), this.subPaths.push(this.currentPath), this.currentPath.moveTo(t2, e2), this;\n }\n lineTo(t2, e2) {\n return this.currentPath.lineTo(t2, e2), this;\n }\n quadraticCurveTo(t2, e2, s2, i2) {\n return this.currentPath.quadraticCurveTo(t2, e2, s2, i2), this;\n }\n bezierCurveTo(t2, e2, s2, i2, r2, n2) {\n return this.currentPath.bezierCurveTo(t2, e2, s2, i2, r2, n2), this;\n }\n splineThru(t2) {\n return this.currentPath.splineThru(t2), this;\n }\n toShapes() {\n function t2(t3, e3) {\n let s3 = false;\n const i3 = e3.length;\n for (let r3 = 0, n3 = i3 - 1; r3 < i3; n3 = r3++) {\n const i4 = e3[r3], a3 = e3[n3];\n i4.y > t3.y != a3.y > t3.y && t3.x < (a3.x - i4.x) * (t3.y - i4.y) / (a3.y - i4.y) + i4.x && (s3 = !s3);\n }\n return s3;\n }\n function e2(e3, s3) {\n const i3 = s3.getCenter(new _i());\n if (t2(i3, e3)) return i3;\n const r3 = i3.y, n3 = [], a3 = e3.length;\n for (let t3 = 0; t3 < a3; t3++) {\n const s4 = e3[t3], i4 = e3[(t3 + 1) % a3];\n if (s4.y > r3 != i4.y > r3) {\n const t4 = s4.x + (r3 - s4.y) * (i4.x - s4.x) / (i4.y - s4.y);\n n3.push(t4);\n }\n }\n return n3.length > 1 && (n3.sort((t3, e4) => t3 - e4), i3.x = (n3[0] + n3[1]) / 2), i3;\n }\n let s2 = this.userData.style && this.userData.style.fillRule || \"nonzero\";\n \"nonzero\" !== s2 && \"evenodd\" !== s2 && (ai('Fill-rule \"' + s2 + '\" is not supported, falling back to \"nonzero\".'), s2 = \"nonzero\");\n const i2 = \"nonzero\" === s2 ? (t3) => 0 !== t3 : (t3) => !!(1 & t3), r2 = [];\n for (const t3 of this.subPaths) {\n const s3 = t3.getPoints();\n if (s3.length < 3) continue;\n const i3 = _l.area(s3);\n if (0 === i3) continue;\n const n3 = new Sd();\n for (let t4 = 0; t4 < s3.length; t4++) n3.expandByPoint(s3[t4]);\n r2.push({\n subPath: t3,\n points: s3,\n boundingBox: n3,\n interiorPoint: e2(s3, n3),\n absArea: Math.abs(i3),\n winding: i3 < 0 ? -1 : 1,\n container: null,\n exclude: false,\n role: null\n });\n }\n r2.sort((t3, e3) => e3.absArea - t3.absArea);\n for (let e3 = 0; e3 < r2.length; e3++) {\n const s3 = r2[e3];\n let n3 = 0;\n for (let i3 = e3 - 1; i3 >= 0; i3--) {\n const e4 = r2[i3];\n if (e4.boundingBox.containsBox(s3.boundingBox) && t2(s3.interiorPoint, e4.points)) {\n s3.container = e4.exclude ? e4.container : e4, n3 = e4.winding, s3.winding += n3;\n break;\n }\n }\n i2(s3.winding) === i2(n3) && (s3.exclude = true);\n }\n for (const t3 of r2)\n t3.exclude || (t3.role = null === t3.container || \"hole\" === t3.container.role ? \"outer\" : \"hole\");\n const n2 = [], a2 = /* @__PURE__ */ new Map();\n for (const t3 of r2) {\n if (t3.exclude || \"outer\" !== t3.role) continue;\n const e3 = new Gh();\n e3.curves = t3.subPath.curves, n2.push(e3), a2.set(t3, e3);\n }\n for (const t3 of r2) {\n if (t3.exclude || \"hole\" !== t3.role) continue;\n const e3 = a2.get(t3.container);\n if (!e3) continue;\n const s3 = new Zh();\n s3.curves = t3.subPath.curves, e3.holes.push(s3);\n }\n return n2;\n }\n };\n var cp = class extends di {\n constructor(t2, e2 = null) {\n super(), this.object = t2, this.domElement = e2, this.enabled = true, this.state = -1, this.keys = {}, this.mouseButtons = { LEFT: null, MIDDLE: null, RIGHT: null }, this.touches = { ONE: null, TWO: null };\n }\n connect(t2) {\n void 0 !== t2 ? (null !== this.domElement && this.disconnect(), this.domElement = t2) : ai(\"Controls: connect() now requires an element.\");\n }\n disconnect() {\n }\n dispose() {\n }\n update() {\n }\n };\n function up(t2, e2, s2, i2) {\n const r2 = (function(t3) {\n switch (t3) {\n case zt:\n case Ct:\n return { byteLength: 1, components: 1 };\n case Bt:\n case It:\n case Rt:\n return { byteLength: 2, components: 1 };\n case Et:\n case Nt:\n return { byteLength: 2, components: 4 };\n case Ot:\n case kt:\n case Pt:\n return { byteLength: 4, components: 1 };\n case Lt:\n case Ft:\n return { byteLength: 4, components: 3 };\n }\n throw new Error(`THREE.TextureUtils: Unknown texture type ${t3}.`);\n })(i2);\n switch (s2) {\n case 1021:\n return t2 * e2;\n case qt:\n case Ht:\n return t2 * e2 / r2.components * r2.byteLength;\n case 1030:\n case 1031:\n return t2 * e2 * 2 / r2.components * r2.byteLength;\n case 1022:\n return t2 * e2 * 3 / r2.components * r2.byteLength;\n case jt:\n case 1033:\n return t2 * e2 * 4 / r2.components * r2.byteLength;\n case 33776:\n case 33777:\n return Math.floor((t2 + 3) / 4) * Math.floor((e2 + 3) / 4) * 8;\n case 33778:\n case 33779:\n return Math.floor((t2 + 3) / 4) * Math.floor((e2 + 3) / 4) * 16;\n case 35841:\n case 35843:\n return Math.max(t2, 16) * Math.max(e2, 8) / 4;\n case 35840:\n case 35842:\n return Math.max(t2, 8) * Math.max(e2, 8) / 2;\n case 36196:\n case 37492:\n case 37488:\n case 37489:\n return Math.floor((t2 + 3) / 4) * Math.floor((e2 + 3) / 4) * 8;\n case 37496:\n case 37490:\n case 37491:\n case 37808:\n return Math.floor((t2 + 3) / 4) * Math.floor((e2 + 3) / 4) * 16;\n case 37809:\n return Math.floor((t2 + 4) / 5) * Math.floor((e2 + 3) / 4) * 16;\n case 37810:\n return Math.floor((t2 + 4) / 5) * Math.floor((e2 + 4) / 5) * 16;\n case 37811:\n return Math.floor((t2 + 5) / 6) * Math.floor((e2 + 4) / 5) * 16;\n case 37812:\n return Math.floor((t2 + 5) / 6) * Math.floor((e2 + 5) / 6) * 16;\n case 37813:\n return Math.floor((t2 + 7) / 8) * Math.floor((e2 + 4) / 5) * 16;\n case 37814:\n return Math.floor((t2 + 7) / 8) * Math.floor((e2 + 5) / 6) * 16;\n case 37815:\n return Math.floor((t2 + 7) / 8) * Math.floor((e2 + 7) / 8) * 16;\n case 37816:\n return Math.floor((t2 + 9) / 10) * Math.floor((e2 + 4) / 5) * 16;\n case 37817:\n return Math.floor((t2 + 9) / 10) * Math.floor((e2 + 5) / 6) * 16;\n case 37818:\n return Math.floor((t2 + 9) / 10) * Math.floor((e2 + 7) / 8) * 16;\n case 37819:\n return Math.floor((t2 + 9) / 10) * Math.floor((e2 + 9) / 10) * 16;\n case 37820:\n return Math.floor((t2 + 11) / 12) * Math.floor((e2 + 9) / 10) * 16;\n case 37821:\n return Math.floor((t2 + 11) / 12) * Math.floor((e2 + 11) / 12) * 16;\n case 36492:\n case 36494:\n case 36495:\n return Math.ceil(t2 / 4) * Math.ceil(e2 / 4) * 16;\n case 36283:\n case 36284:\n return Math.ceil(t2 / 4) * Math.ceil(e2 / 4) * 8;\n case 36285:\n case 36286:\n return Math.ceil(t2 / 4) * Math.ceil(e2 / 4) * 16;\n }\n throw new Error(`Unable to determine texture byte length for ${s2} format.`);\n }\n var dp = class {\n static contain(t2, e2) {\n return (function(t3, e3) {\n const s2 = t3.image && t3.image.width ? t3.image.width / t3.image.height : 1;\n return s2 > e3 ? (t3.repeat.x = 1, t3.repeat.y = s2 / e3, t3.offset.x = 0, t3.offset.y = (1 - t3.repeat.y) / 2) : (t3.repeat.x = e3 / s2, t3.repeat.y = 1, t3.offset.x = (1 - t3.repeat.x) / 2, t3.offset.y = 0), t3;\n })(t2, e2);\n }\n static cover(t2, e2) {\n return (function(t3, e3) {\n const s2 = t3.image && t3.image.width ? t3.image.width / t3.image.height : 1;\n return s2 > e3 ? (t3.repeat.x = e3 / s2, t3.repeat.y = 1, t3.offset.x = (1 - t3.repeat.x) / 2, t3.offset.y = 0) : (t3.repeat.x = 1, t3.repeat.y = s2 / e3, t3.offset.x = 0, t3.offset.y = (1 - t3.repeat.y) / 2), t3;\n })(t2, e2);\n }\n static fill(t2) {\n return (function(t3) {\n return t3.repeat.x = 1, t3.repeat.y = 1, t3.offset.x = 0, t3.offset.y = 0, t3;\n })(t2);\n }\n static getByteLength(t2, e2, s2, i2) {\n return up(t2, e2, s2, i2);\n }\n };\n \"undefined\" != typeof __THREE_DEVTOOLS__ && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(\"register\", { detail: { revision: t } })), \"undefined\" != typeof window && (window.__THREE__ ? ai(\"WARNING: Multiple instances of Three.js being imported.\") : window.__THREE__ = t);\n\n // registry/blocks/cuboid-carousel/assets/three.module.min.js\n function On2() {\n let e2 = null, t2 = false, n2 = null, i2 = null;\n function r2(t3, a2) {\n n2(t3, a2), i2 = e2.requestAnimationFrame(r2);\n }\n return {\n start: function() {\n true !== t2 && null !== n2 && null !== e2 && (i2 = e2.requestAnimationFrame(r2), t2 = true);\n },\n stop: function() {\n null !== e2 && e2.cancelAnimationFrame(i2), t2 = false;\n },\n setAnimationLoop: function(e3) {\n n2 = e3;\n },\n setContext: function(t3) {\n e2 = t3;\n }\n };\n }\n function Fn2(e2) {\n const t2 = /* @__PURE__ */ new WeakMap();\n return {\n get: function(e3) {\n return e3.isInterleavedBufferAttribute && (e3 = e3.data), t2.get(e3);\n },\n remove: function(n2) {\n n2.isInterleavedBufferAttribute && (n2 = n2.data);\n const i2 = t2.get(n2);\n i2 && (e2.deleteBuffer(i2.buffer), t2.delete(n2));\n },\n update: function(n2, i2) {\n if (n2.isInterleavedBufferAttribute && (n2 = n2.data), n2.isGLBufferAttribute) {\n const e3 = t2.get(n2);\n return void ((!e3 || e3.version < n2.version) && t2.set(n2, {\n buffer: n2.buffer,\n type: n2.type,\n bytesPerElement: n2.elementSize,\n version: n2.version\n }));\n }\n const r2 = t2.get(n2);\n if (void 0 === r2)\n t2.set(\n n2,\n (function(t3, n3) {\n const i3 = t3.array, r3 = t3.usage, a2 = i3.byteLength, o2 = e2.createBuffer();\n let s2;\n if (e2.bindBuffer(n3, o2), e2.bufferData(n3, i3, r3), t3.onUploadCallback(), i3 instanceof Float32Array)\n s2 = e2.FLOAT;\n else if (\"undefined\" != typeof Float16Array && i3 instanceof Float16Array)\n s2 = e2.HALF_FLOAT;\n else if (i3 instanceof Uint16Array)\n s2 = t3.isFloat16BufferAttribute ? e2.HALF_FLOAT : e2.UNSIGNED_SHORT;\n else if (i3 instanceof Int16Array) s2 = e2.SHORT;\n else if (i3 instanceof Uint32Array) s2 = e2.UNSIGNED_INT;\n else if (i3 instanceof Int32Array) s2 = e2.INT;\n else if (i3 instanceof Int8Array) s2 = e2.BYTE;\n else if (i3 instanceof Uint8Array) s2 = e2.UNSIGNED_BYTE;\n else {\n if (!(i3 instanceof Uint8ClampedArray))\n throw new Error(\"THREE.WebGLAttributes: Unsupported buffer data format: \" + i3);\n s2 = e2.UNSIGNED_BYTE;\n }\n return {\n buffer: o2,\n type: s2,\n bytesPerElement: i3.BYTES_PER_ELEMENT,\n version: t3.version,\n size: a2\n };\n })(n2, i2)\n );\n else if (r2.version < n2.version) {\n if (r2.size !== n2.array.byteLength)\n throw new Error(\n \"THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.\"\n );\n !(function(t3, n3, i3) {\n const r3 = n3.array, a2 = n3.updateRanges;\n if (e2.bindBuffer(i3, t3), 0 === a2.length) e2.bufferSubData(i3, 0, r3);\n else {\n a2.sort((e3, t5) => e3.start - t5.start);\n let t4 = 0;\n for (let e3 = 1; e3 < a2.length; e3++) {\n const n4 = a2[t4], i4 = a2[e3];\n i4.start <= n4.start + n4.count + 1 ? n4.count = Math.max(n4.count, i4.start + i4.count - n4.start) : (++t4, a2[t4] = i4);\n }\n a2.length = t4 + 1;\n for (let t5 = 0, n4 = a2.length; t5 < n4; t5++) {\n const n5 = a2[t5];\n e2.bufferSubData(i3, n5.start * r3.BYTES_PER_ELEMENT, r3, n5.start, n5.count);\n }\n n3.clearUpdateRanges();\n }\n n3.onUploadCallback();\n })(r2.buffer, n2, i2), r2.version = n2.version;\n }\n }\n };\n }\n var Bn2 = {\n alphahash_fragment: \"#ifdef USE_ALPHAHASH\\n\tif ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\\n#endif\",\n alphahash_pars_fragment: \"#ifdef USE_ALPHAHASH\\n\tconst float ALPHA_HASH_SCALE = 0.05;\\n\tfloat hash2D( vec2 value ) {\\n\t\treturn fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\\n\t}\\n\tfloat hash3D( vec3 value ) {\\n\t\treturn hash2D( vec2( hash2D( value.xy ), value.z ) );\\n\t}\\n\tfloat getAlphaHashThreshold( vec3 position ) {\\n\t\tfloat maxDeriv = max(\\n\t\t\tlength( dFdx( position.xyz ) ),\\n\t\t\tlength( dFdy( position.xyz ) )\\n\t\t);\\n\t\tfloat pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\\n\t\tvec2 pixScales = vec2(\\n\t\t\texp2( floor( log2( pixScale ) ) ),\\n\t\t\texp2( ceil( log2( pixScale ) ) )\\n\t\t);\\n\t\tvec2 alpha = vec2(\\n\t\t\thash3D( floor( pixScales.x * position.xyz ) ),\\n\t\t\thash3D( floor( pixScales.y * position.xyz ) )\\n\t\t);\\n\t\tfloat lerpFactor = fract( log2( pixScale ) );\\n\t\tfloat x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\\n\t\tfloat a = min( lerpFactor, 1.0 - lerpFactor );\\n\t\tvec3 cases = vec3(\\n\t\t\tx * x / ( 2.0 * a * ( 1.0 - a ) ),\\n\t\t\t( x - 0.5 * a ) / ( 1.0 - a ),\\n\t\t\t1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\\n\t\t);\\n\t\tfloat threshold = ( x < ( 1.0 - a ) )\\n\t\t\t? ( ( x < a ) ? cases.x : cases.y )\\n\t\t\t: cases.z;\\n\t\treturn clamp( threshold , 1.0e-6, 1.0 );\\n\t}\\n#endif\",\n alphamap_fragment: \"#ifdef USE_ALPHAMAP\\n\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\\n#endif\",\n alphamap_pars_fragment: \"#ifdef USE_ALPHAMAP\\n\tuniform sampler2D alphaMap;\\n#endif\",\n alphatest_fragment: \"#ifdef USE_ALPHATEST\\n\t#ifdef ALPHA_TO_COVERAGE\\n\tdiffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );\\n\tif ( diffuseColor.a == 0.0 ) discard;\\n\t#else\\n\tif ( diffuseColor.a < alphaTest ) discard;\\n\t#endif\\n#endif\",\n alphatest_pars_fragment: \"#ifdef USE_ALPHATEST\\n\tuniform float alphaTest;\\n#endif\",\n aomap_fragment: \"#ifdef USE_AOMAP\\n\tfloat ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\\n\t#if defined( USE_CLEARCOAT ) \\n\t\tclearcoatSpecularIndirect *= ambientOcclusion;\\n\t#endif\\n\t#if defined( USE_SHEEN ) \\n\t\tsheenSpecularIndirect *= ambientOcclusion;\\n\t#endif\\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\\n\t\tfloat dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\\n\t#endif\\n#endif\",\n aomap_pars_fragment: \"#ifdef USE_AOMAP\\n\tuniform sampler2D aoMap;\\n\tuniform float aoMapIntensity;\\n#endif\",\n batching_pars_vertex: \"#ifdef USE_BATCHING\\n\t#if ! defined( GL_ANGLE_multi_draw )\\n\t#define gl_DrawID _gl_DrawID\\n\tuniform int _gl_DrawID;\\n\t#endif\\n\tuniform highp sampler2D batchingTexture;\\n\tuniform highp usampler2D batchingIdTexture;\\n\tmat4 getBatchingMatrix( const in float i ) {\\n\t\tint size = textureSize( batchingTexture, 0 ).x;\\n\t\tint j = int( i ) * 4;\\n\t\tint x = j % size;\\n\t\tint y = j / size;\\n\t\tvec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );\\n\t\tvec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );\\n\t\tvec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );\\n\t\tvec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );\\n\t\treturn mat4( v1, v2, v3, v4 );\\n\t}\\n\tfloat getIndirectIndex( const in int i ) {\\n\t\tint size = textureSize( batchingIdTexture, 0 ).x;\\n\t\tint x = i % size;\\n\t\tint y = i / size;\\n\t\treturn float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );\\n\t}\\n#endif\\n#ifdef USE_BATCHING_COLOR\\n\tuniform sampler2D batchingColorTexture;\\n\tvec4 getBatchingColor( const in float i ) {\\n\t\tint size = textureSize( batchingColorTexture, 0 ).x;\\n\t\tint j = int( i );\\n\t\tint x = j % size;\\n\t\tint y = j / size;\\n\t\treturn texelFetch( batchingColorTexture, ivec2( x, y ), 0 );\\n\t}\\n#endif\",\n batching_vertex: \"#ifdef USE_BATCHING\\n\tmat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );\\n#endif\",\n begin_vertex: \"vec3 transformed = vec3( position );\\n#ifdef USE_ALPHAHASH\\n\tvPosition = vec3( position );\\n#endif\",\n beginnormal_vertex: \"vec3 objectNormal = vec3( normal );\\n#ifdef USE_TANGENT\\n\tvec3 objectTangent = vec3( tangent.xyz );\\n#endif\",\n bsdfs: \"float G_BlinnPhong_Implicit( ) {\\n\treturn 0.25;\\n}\\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\\n}\\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\\n\tvec3 halfDir = normalize( lightDir + viewDir );\\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\\n\tfloat G = G_BlinnPhong_Implicit( );\\n\tfloat D = D_BlinnPhong( shininess, dotNH );\\n\treturn F * ( G * D );\\n} // validated\",\n iridescence_fragment: \"#ifdef USE_IRIDESCENCE\\n\tconst mat3 XYZ_TO_REC709 = mat3(\\n\t\t 3.2404542, -0.9692660, 0.0556434,\\n\t\t-1.5371385, 1.8760108, -0.2040259,\\n\t\t-0.4985314, 0.0415560, 1.0572252\\n\t);\\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\\n\t}\\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\\n\t}\\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\\n\t}\\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\\n\t\txyz /= 1.0685e-7;\\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\\n\t\treturn rgb;\\n\t}\\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\\n\t\tvec3 I;\\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\\n\t\tif ( cosTheta2Sq < 0.0 ) {\\n\t\t\treturn vec3( 1.0 );\\n\t\t}\\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\\n\t\tfloat T121 = 1.0 - R12;\\n\t\tfloat phi12 = 0.0;\\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\\n\t\tfloat phi21 = PI - phi12;\\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\\n\t\tvec3 phi23 = vec3( 0.0 );\\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\\n\t\tvec3 phi = vec3( phi21 ) + phi23;\\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\\n\t\tvec3 r123 = sqrt( R123 );\\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\\n\t\tvec3 C0 = R12 + Rs;\\n\t\tI = C0;\\n\t\tvec3 Cm = Rs - T121;\\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\\n\t\t\tCm *= r123;\\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\\n\t\t\tI += Cm * Sm;\\n\t\t}\\n\t\treturn max( I, vec3( 0.0 ) );\\n\t}\\n#endif\",\n bumpmap_pars_fragment: \"#ifdef USE_BUMPMAP\\n\tuniform sampler2D bumpMap;\\n\tuniform float bumpScale;\\n\tvec2 dHdxy_fwd() {\\n\t\tvec2 dSTdx = dFdx( vBumpMapUv );\\n\t\tvec2 dSTdy = dFdy( vBumpMapUv );\\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\\n\t\treturn vec2( dBx, dBy );\\n\t}\\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\\n\t\tvec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );\\n\t\tvec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );\\n\t\tvec3 vN = surf_norm;\\n\t\tvec3 R1 = cross( vSigmaY, vN );\\n\t\tvec3 R2 = cross( vN, vSigmaX );\\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\\n\t}\\n#endif\",\n clipping_planes_fragment: \"#if NUM_CLIPPING_PLANES > 0\\n\tvec4 plane;\\n\t#ifdef ALPHA_TO_COVERAGE\\n\t\tfloat distanceToPlane, distanceGradient;\\n\t\tfloat clipOpacity = 1.0;\\n\t\t#pragma unroll_loop_start\\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\\n\t\t\tplane = clippingPlanes[ i ];\\n\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\\n\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\\n\t\t\tclipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\\n\t\t\tif ( clipOpacity == 0.0 ) discard;\\n\t\t}\\n\t\t#pragma unroll_loop_end\\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\\n\t\t\tfloat unionClipOpacity = 1.0;\\n\t\t\t#pragma unroll_loop_start\\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\\n\t\t\t\tplane = clippingPlanes[ i ];\\n\t\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\\n\t\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\\n\t\t\t\tunionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\\n\t\t\t}\\n\t\t\t#pragma unroll_loop_end\\n\t\t\tclipOpacity *= 1.0 - unionClipOpacity;\\n\t\t#endif\\n\t\tdiffuseColor.a *= clipOpacity;\\n\t\tif ( diffuseColor.a == 0.0 ) discard;\\n\t#else\\n\t\t#pragma unroll_loop_start\\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\\n\t\t\tplane = clippingPlanes[ i ];\\n\t\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\\n\t\t}\\n\t\t#pragma unroll_loop_end\\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\\n\t\t\tbool clipped = true;\\n\t\t\t#pragma unroll_loop_start\\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\\n\t\t\t\tplane = clippingPlanes[ i ];\\n\t\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\\n\t\t\t}\\n\t\t\t#pragma unroll_loop_end\\n\t\t\tif ( clipped ) discard;\\n\t\t#endif\\n\t#endif\\n#endif\",\n clipping_planes_pars_fragment: \"#if NUM_CLIPPING_PLANES > 0\\n\tvarying vec3 vClipPosition;\\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\\n#endif\",\n clipping_planes_pars_vertex: \"#if NUM_CLIPPING_PLANES > 0\\n\tvarying vec3 vClipPosition;\\n#endif\",\n clipping_planes_vertex: \"#if NUM_CLIPPING_PLANES > 0\\n\tvClipPosition = - mvPosition.xyz;\\n#endif\",\n color_fragment: \"#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA )\\n\tdiffuseColor *= vColor;\\n#endif\",\n color_pars_fragment: \"#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA )\\n\tvarying vec4 vColor;\\n#endif\",\n color_pars_vertex: \"#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\\n\tvarying vec4 vColor;\\n#endif\",\n color_vertex: \"#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\\n\tvColor = vec4( 1.0 );\\n#endif\\n#ifdef USE_COLOR_ALPHA\\n\tvColor *= color;\\n#elif defined( USE_COLOR )\\n\tvColor.rgb *= color;\\n#endif\\n#ifdef USE_INSTANCING_COLOR\\n\tvColor.rgb *= instanceColor.rgb;\\n#endif\\n#ifdef USE_BATCHING_COLOR\\n\tvColor *= getBatchingColor( getIndirectIndex( gl_DrawID ) );\\n#endif\",\n common: \"#define PI 3.141592653589793\\n#define PI2 6.283185307179586\\n#define PI_HALF 1.5707963267948966\\n#define RECIPROCAL_PI 0.3183098861837907\\n#define RECIPROCAL_PI2 0.15915494309189535\\n#define EPSILON 1e-6\\n#ifndef saturate\\n#define saturate( a ) clamp( a, 0.0, 1.0 )\\n#endif\\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\\nfloat pow2( const in float x ) { return x*x; }\\nvec3 pow2( const in vec3 x ) { return x*x; }\\nfloat pow3( const in float x ) { return x*x*x; }\\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\\nhighp float rand( const in vec2 uv ) {\\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\\n\treturn fract( sin( sn ) * c );\\n}\\n#ifdef HIGH_PRECISION\\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\\n#else\\n\tfloat precisionSafeLength( vec3 v ) {\\n\t\tfloat maxComponent = max3( abs( v ) );\\n\t\treturn length( v / maxComponent ) * maxComponent;\\n\t}\\n#endif\\nstruct IncidentLight {\\n\tvec3 color;\\n\tvec3 direction;\\n\tbool visible;\\n};\\nstruct ReflectedLight {\\n\tvec3 directDiffuse;\\n\tvec3 directSpecular;\\n\tvec3 indirectDiffuse;\\n\tvec3 indirectSpecular;\\n};\\n#ifdef USE_ALPHAHASH\\n\tvarying vec3 vPosition;\\n#endif\\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\\n}\\n#define inverseTransformDirection transformDirectionByInverseViewMatrix\\nvec3 transformNormalByInverseViewMatrix( in vec3 normal, in mat4 viewMatrix ) {\\n\treturn normalize( ( vec4( normal, 0.0 ) * viewMatrix ).xyz );\\n}\\nvec3 transformDirectionByInverseViewMatrix( in vec3 dir, in mat4 viewMatrix ) {\\n\treturn normalize( ( vec4( dir, 0.0 ) * viewMatrix ).xyz );\\n}\\nbool isPerspectiveMatrix( mat4 m ) {\\n\treturn m[ 2 ][ 3 ] == - 1.0;\\n}\\nvec2 equirectUv( in vec3 dir ) {\\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\\n\treturn vec2( u, v );\\n}\\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\\n\treturn RECIPROCAL_PI * diffuseColor;\\n}\\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\\n}\\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\\n} // validated\",\n cube_uv_reflection_fragment: \"#ifdef ENVMAP_TYPE_CUBE_UV\\n\t#define cubeUV_minMipLevel 4.0\\n\t#define cubeUV_minTileSize 16.0\\n\tfloat getFace( vec3 direction ) {\\n\t\tvec3 absDirection = abs( direction );\\n\t\tfloat face = - 1.0;\\n\t\tif ( absDirection.x > absDirection.z ) {\\n\t\t\tif ( absDirection.x > absDirection.y )\\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\\n\t\t\telse\\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\\n\t\t} else {\\n\t\t\tif ( absDirection.z > absDirection.y )\\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\\n\t\t\telse\\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\\n\t\t}\\n\t\treturn face;\\n\t}\\n\tvec2 getUV( vec3 direction, float face ) {\\n\t\tvec2 uv;\\n\t\tif ( face == 0.0 ) {\\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\\n\t\t} else if ( face == 1.0 ) {\\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\\n\t\t} else if ( face == 2.0 ) {\\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\\n\t\t} else if ( face == 3.0 ) {\\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\\n\t\t} else if ( face == 4.0 ) {\\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\\n\t\t} else {\\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\\n\t\t}\\n\t\treturn 0.5 * ( uv + 1.0 );\\n\t}\\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\\n\t\tfloat face = getFace( direction );\\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\\n\t\tfloat faceSize = exp2( mipInt );\\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\\n\t\tif ( face > 2.0 ) {\\n\t\t\tuv.y += faceSize;\\n\t\t\tface -= 3.0;\\n\t\t}\\n\t\tuv.x += face * faceSize;\\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\\n\t\t#ifdef texture2DGradEXT\\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\\n\t\t#else\\n\t\t\treturn texture2D( envMap, uv ).rgb;\\n\t\t#endif\\n\t}\\n\t#define cubeUV_r0 1.0\\n\t#define cubeUV_m0 - 2.0\\n\t#define cubeUV_r1 0.8\\n\t#define cubeUV_m1 - 1.0\\n\t#define cubeUV_r4 0.4\\n\t#define cubeUV_m4 2.0\\n\t#define cubeUV_r5 0.305\\n\t#define cubeUV_m5 3.0\\n\t#define cubeUV_r6 0.21\\n\t#define cubeUV_m6 4.0\\n\tfloat roughnessToMip( float roughness ) {\\n\t\tfloat mip = 0.0;\\n\t\tif ( roughness >= cubeUV_r1 ) {\\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\\n\t\t} else if ( roughness >= cubeUV_r4 ) {\\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\\n\t\t} else if ( roughness >= cubeUV_r5 ) {\\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\\n\t\t} else if ( roughness >= cubeUV_r6 ) {\\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\\n\t\t} else {\\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\\n\t\treturn mip;\\n\t}\\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\\n\t\tfloat mipF = fract( mip );\\n\t\tfloat mipInt = floor( mip );\\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\\n\t\tif ( mipF == 0.0 ) {\\n\t\t\treturn vec4( color0, 1.0 );\\n\t\t} else {\\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\\n\t\t}\\n\t}\\n#endif\",\n defaultnormal_vertex: \"vec3 transformedNormal = objectNormal;\\n#ifdef USE_TANGENT\\n\tvec3 transformedTangent = objectTangent;\\n#endif\\n#ifdef USE_BATCHING\\n\tmat3 bm = mat3( batchingMatrix );\\n\ttransformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\\n\ttransformedNormal = bm * transformedNormal;\\n\t#ifdef USE_TANGENT\\n\t\ttransformedTangent = bm * transformedTangent;\\n\t#endif\\n#endif\\n#ifdef USE_INSTANCING\\n\tmat3 im = mat3( instanceMatrix );\\n\ttransformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\\n\ttransformedNormal = im * transformedNormal;\\n\t#ifdef USE_TANGENT\\n\t\ttransformedTangent = im * transformedTangent;\\n\t#endif\\n#endif\\ntransformedNormal = normalMatrix * transformedNormal;\\n#ifdef FLIP_SIDED\\n\ttransformedNormal = - transformedNormal;\\n#endif\\n#ifdef USE_TANGENT\\n\ttransformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\\n#endif\",\n displacementmap_pars_vertex: \"#ifdef USE_DISPLACEMENTMAP\\n\tuniform sampler2D displacementMap;\\n\tuniform float displacementScale;\\n\tuniform float displacementBias;\\n#endif\",\n displacementmap_vertex: \"#ifdef USE_DISPLACEMENTMAP\\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\\n#endif\",\n emissivemap_fragment: \"#ifdef USE_EMISSIVEMAP\\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\\n\t#ifdef DECODE_VIDEO_TEXTURE_EMISSIVE\\n\t\temissiveColor = sRGBTransferEOTF( emissiveColor );\\n\t#endif\\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\\n#endif\",\n emissivemap_pars_fragment: \"#ifdef USE_EMISSIVEMAP\\n\tuniform sampler2D emissiveMap;\\n#endif\",\n colorspace_fragment: \"gl_FragColor = linearToOutputTexel( gl_FragColor );\",\n colorspace_pars_fragment: \"vec4 LinearTransferOETF( in vec4 value ) {\\n\treturn value;\\n}\\nvec4 sRGBTransferEOTF( in vec4 value ) {\\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\\n}\\nvec4 sRGBTransferOETF( in vec4 value ) {\\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\\n}\",\n envmap_fragment: \"#ifdef USE_ENVMAP\\n\t#ifdef ENV_WORLDPOS\\n\t\tvec3 cameraToFrag;\\n\t\tif ( isOrthographic ) {\\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\\n\t\t} else {\\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\\n\t\t}\\n\t\tvec3 worldNormal = transformNormalByInverseViewMatrix( normal, viewMatrix );\\n\t\t#ifdef ENVMAP_MODE_REFLECTION\\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\\n\t\t#else\\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\\n\t\t#endif\\n\t#else\\n\t\tvec3 reflectVec = vReflect;\\n\t#endif\\n\t#ifdef ENVMAP_TYPE_CUBE\\n\t\tvec4 envColor = textureCube( envMap, envMapRotation * reflectVec );\\n\t\t#ifdef ENVMAP_BLENDING_MULTIPLY\\n\t\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\\n\t\t#elif defined( ENVMAP_BLENDING_MIX )\\n\t\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\\n\t\t#elif defined( ENVMAP_BLENDING_ADD )\\n\t\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\\n\t\t#endif\\n\t#endif\\n#endif\",\n envmap_common_pars_fragment: \"#ifdef USE_ENVMAP\\n\tuniform float envMapIntensity;\\n\tuniform mat3 envMapRotation;\\n\t#ifdef ENVMAP_TYPE_CUBE\\n\t\tuniform samplerCube envMap;\\n\t#else\\n\t\tuniform sampler2D envMap;\\n\t#endif\\n#endif\",\n envmap_pars_fragment: \"#ifdef USE_ENVMAP\\n\tuniform float reflectivity;\\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\\n\t\t#define ENV_WORLDPOS\\n\t#endif\\n\t#ifdef ENV_WORLDPOS\\n\t\tvarying vec3 vWorldPosition;\\n\t\tuniform float refractionRatio;\\n\t#else\\n\t\tvarying vec3 vReflect;\\n\t#endif\\n#endif\",\n envmap_pars_vertex: \"#ifdef USE_ENVMAP\\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\\n\t\t#define ENV_WORLDPOS\\n\t#endif\\n\t#ifdef ENV_WORLDPOS\\n\t\t\\n\t\tvarying vec3 vWorldPosition;\\n\t#else\\n\t\tvarying vec3 vReflect;\\n\t\tuniform float refractionRatio;\\n\t#endif\\n#endif\",\n envmap_physical_pars_fragment: \"#ifdef USE_ENVMAP\\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\\n\t\t\tvec3 worldNormal = transformNormalByInverseViewMatrix( normal, viewMatrix );\\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );\\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\\n\t\t#else\\n\t\t\treturn vec3( 0.0 );\\n\t\t#endif\\n\t}\\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\\n\t\t\treflectVec = normalize( mix( reflectVec, normal, pow4( roughness ) ) );\\n\t\t\treflectVec = transformDirectionByInverseViewMatrix( reflectVec, viewMatrix );\\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );\\n\t\t\treturn envMapColor.rgb * envMapIntensity;\\n\t\t#else\\n\t\t\treturn vec3( 0.0 );\\n\t\t#endif\\n\t}\\n\t#ifdef USE_ANISOTROPY\\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\\n\t\t\t#else\\n\t\t\t\treturn vec3( 0.0 );\\n\t\t\t#endif\\n\t\t}\\n\t#endif\\n#endif\",\n envmap_vertex: \"#ifdef USE_ENVMAP\\n\t#ifdef ENV_WORLDPOS\\n\t\tvWorldPosition = worldPosition.xyz;\\n\t#else\\n\t\tvec3 cameraToVertex;\\n\t\tif ( isOrthographic ) {\\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\\n\t\t} else {\\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\\n\t\t}\\n\t\tvec3 worldNormal = transformNormalByInverseViewMatrix( transformedNormal, viewMatrix );\\n\t\t#ifdef ENVMAP_MODE_REFLECTION\\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\\n\t\t#else\\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\\n\t\t#endif\\n\t#endif\\n#endif\",\n fog_vertex: \"#ifdef USE_FOG\\n\tvFogDepth = - mvPosition.z;\\n#endif\",\n fog_pars_vertex: \"#ifdef USE_FOG\\n\tvarying float vFogDepth;\\n#endif\",\n fog_fragment: \"#ifdef USE_FOG\\n\t#ifdef FOG_EXP2\\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\\n\t#else\\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\\n\t#endif\\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\\n#endif\",\n fog_pars_fragment: \"#ifdef USE_FOG\\n\tuniform vec3 fogColor;\\n\tvarying float vFogDepth;\\n\t#ifdef FOG_EXP2\\n\t\tuniform float fogDensity;\\n\t#else\\n\t\tuniform float fogNear;\\n\t\tuniform float fogFar;\\n\t#endif\\n#endif\",\n gradientmap_pars_fragment: \"#ifdef USE_GRADIENTMAP\\n\tuniform sampler2D gradientMap;\\n#endif\\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\\n\tfloat dotNL = dot( normal, lightDirection );\\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\\n\t#ifdef USE_GRADIENTMAP\\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\\n\t#else\\n\t\tvec2 fw = fwidth( coord ) * 0.5;\\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\\n\t#endif\\n}\",\n lightmap_pars_fragment: \"#ifdef USE_LIGHTMAP\\n\tuniform sampler2D lightMap;\\n\tuniform float lightMapIntensity;\\n#endif\",\n lights_lambert_fragment: \"LambertMaterial material;\\nmaterial.diffuseColor = diffuseColor.rgb;\\nmaterial.specularStrength = specularStrength;\",\n lights_lambert_pars_fragment: \"varying vec3 vViewPosition;\\nstruct LambertMaterial {\\n\tvec3 diffuseColor;\\n\tfloat specularStrength;\\n};\\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\\n\tvec3 irradiance = dotNL * directLight.color;\\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert\",\n lights_pars_begin: \"uniform bool receiveShadow;\\nuniform vec3 ambientLightColor;\\n#if defined( USE_LIGHT_PROBES )\\n\tuniform vec3 lightProbe[ 9 ];\\n#endif\\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\\n\tfloat x = normal.x, y = normal.y, z = normal.z;\\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\\n\treturn result;\\n}\\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\\n\tvec3 worldNormal = transformNormalByInverseViewMatrix( normal, viewMatrix );\\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\\n\treturn irradiance;\\n}\\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\\n\tvec3 irradiance = ambientLightColor;\\n\treturn irradiance;\\n}\\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\\n\tif ( cutoffDistance > 0.0 ) {\\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\\n\t}\\n\treturn distanceFalloff;\\n}\\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\\n}\\n#if NUM_DIR_LIGHTS > 0\\n\tstruct DirectionalLight {\\n\t\tvec3 direction;\\n\t\tvec3 color;\\n\t};\\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\\n\t\tlight.color = directionalLight.color;\\n\t\tlight.direction = directionalLight.direction;\\n\t\tlight.visible = true;\\n\t}\\n#endif\\n#if NUM_POINT_LIGHTS > 0\\n\tstruct PointLight {\\n\t\tvec3 position;\\n\t\tvec3 color;\\n\t\tfloat distance;\\n\t\tfloat decay;\\n\t};\\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\\n\tvoid getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\\n\t\tvec3 lVector = pointLight.position - geometryPosition;\\n\t\tlight.direction = normalize( lVector );\\n\t\tfloat lightDistance = length( lVector );\\n\t\tlight.color = pointLight.color;\\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\\n\t}\\n#endif\\n#if NUM_SPOT_LIGHTS > 0\\n\tstruct SpotLight {\\n\t\tvec3 position;\\n\t\tvec3 direction;\\n\t\tvec3 color;\\n\t\tfloat distance;\\n\t\tfloat decay;\\n\t\tfloat coneCos;\\n\t\tfloat penumbraCos;\\n\t};\\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\\n\t\tvec3 lVector = spotLight.position - geometryPosition;\\n\t\tlight.direction = normalize( lVector );\\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\\n\t\tif ( spotAttenuation > 0.0 ) {\\n\t\t\tfloat lightDistance = length( lVector );\\n\t\t\tlight.color = spotLight.color * spotAttenuation;\\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\\n\t\t} else {\\n\t\t\tlight.color = vec3( 0.0 );\\n\t\t\tlight.visible = false;\\n\t\t}\\n\t}\\n#endif\\n#if NUM_RECT_AREA_LIGHTS > 0\\n\tstruct RectAreaLight {\\n\t\tvec3 color;\\n\t\tvec3 position;\\n\t\tvec3 halfWidth;\\n\t\tvec3 halfHeight;\\n\t};\\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\\n#endif\\n#if NUM_HEMI_LIGHTS > 0\\n\tstruct HemisphereLight {\\n\t\tvec3 direction;\\n\t\tvec3 skyColor;\\n\t\tvec3 groundColor;\\n\t};\\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\\n\t\treturn irradiance;\\n\t}\\n#endif\\n#include <lightprobes_pars_fragment>\",\n lights_toon_fragment: \"ToonMaterial material;\\nmaterial.diffuseColor = diffuseColor.rgb;\",\n lights_toon_pars_fragment: \"varying vec3 vViewPosition;\\nstruct ToonMaterial {\\n\tvec3 diffuseColor;\\n};\\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\\n\tvec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\n#define RE_Direct\t\t\t\tRE_Direct_Toon\\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\",\n lights_phong_fragment: \"BlinnPhongMaterial material;\\nmaterial.diffuseColor = diffuseColor.rgb;\\nmaterial.specularColor = specular;\\nmaterial.specularShininess = shininess;\\nmaterial.specularStrength = specularStrength;\",\n lights_phong_pars_fragment: \"varying vec3 vViewPosition;\\nstruct BlinnPhongMaterial {\\n\tvec3 diffuseColor;\\n\tvec3 specularColor;\\n\tfloat specularShininess;\\n\tfloat specularStrength;\\n};\\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\\n\tvec3 irradiance = dotNL * directLight.color;\\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\\n}\\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\",\n lights_physical_fragment: \"PhysicalMaterial material;\\nmaterial.diffuseColor = diffuseColor.rgb;\\nmaterial.diffuseContribution = diffuseColor.rgb * ( 1.0 - metalnessFactor );\\nmaterial.metalness = metalnessFactor;\\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\\nmaterial.roughness = min( material.roughness, 1.0 );\\n#ifdef IOR\\n\tmaterial.ior = ior;\\n\t#ifdef USE_SPECULAR\\n\t\tfloat specularIntensityFactor = specularIntensity;\\n\t\tvec3 specularColorFactor = specularColor;\\n\t\t#ifdef USE_SPECULAR_COLORMAP\\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\\n\t\t#endif\\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\\n\t\t#endif\\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\\n\t#else\\n\t\tfloat specularIntensityFactor = 1.0;\\n\t\tvec3 specularColorFactor = vec3( 1.0 );\\n\t\tmaterial.specularF90 = 1.0;\\n\t#endif\\n\tmaterial.specularColor = min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor;\\n\tmaterial.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor );\\n#else\\n\tmaterial.specularColor = vec3( 0.04 );\\n\tmaterial.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor );\\n\tmaterial.specularF90 = 1.0;\\n#endif\\n#ifdef USE_CLEARCOAT\\n\tmaterial.clearcoat = clearcoat;\\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\\n\tmaterial.clearcoatF0 = vec3( 0.04 );\\n\tmaterial.clearcoatF90 = 1.0;\\n\t#ifdef USE_CLEARCOATMAP\\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\\n\t#endif\\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\\n\t#endif\\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\\n\tmaterial.clearcoatRoughness += geometryRoughness;\\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\\n#endif\\n#ifdef USE_DISPERSION\\n\tmaterial.dispersion = dispersion;\\n#endif\\n#ifdef USE_IRIDESCENCE\\n\tmaterial.iridescence = iridescence;\\n\tmaterial.iridescenceIOR = iridescenceIOR;\\n\t#ifdef USE_IRIDESCENCEMAP\\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\\n\t#endif\\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\\n\t#else\\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\\n\t#endif\\n#endif\\n#ifdef USE_SHEEN\\n\tmaterial.sheenColor = sheenColor;\\n\t#ifdef USE_SHEEN_COLORMAP\\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\\n\t#endif\\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.0001, 1.0 );\\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\\n\t#endif\\n#endif\\n#ifdef USE_ANISOTROPY\\n\t#ifdef USE_ANISOTROPYMAP\\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\\n\t#else\\n\t\tvec2 anisotropyV = anisotropyVector;\\n\t#endif\\n\tmaterial.anisotropy = length( anisotropyV );\\n\tif( material.anisotropy == 0.0 ) {\\n\t\tanisotropyV = vec2( 1.0, 0.0 );\\n\t} else {\\n\t\tanisotropyV /= material.anisotropy;\\n\t\tmaterial.anisotropy = saturate( material.anisotropy );\\n\t}\\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\\n#endif\",\n lights_physical_pars_fragment: \"uniform sampler2D dfgLUT;\\nstruct PhysicalMaterial {\\n\tvec3 diffuseColor;\\n\tvec3 diffuseContribution;\\n\tvec3 specularColor;\\n\tvec3 specularColorBlended;\\n\tfloat roughness;\\n\tfloat metalness;\\n\tfloat specularF90;\\n\tfloat dispersion;\\n\t#ifdef USE_CLEARCOAT\\n\t\tfloat clearcoat;\\n\t\tfloat clearcoatRoughness;\\n\t\tvec3 clearcoatF0;\\n\t\tfloat clearcoatF90;\\n\t#endif\\n\t#ifdef USE_IRIDESCENCE\\n\t\tfloat iridescence;\\n\t\tfloat iridescenceIOR;\\n\t\tfloat iridescenceThickness;\\n\t\tvec3 iridescenceFresnel;\\n\t\tvec3 iridescenceF0;\\n\t\tvec3 iridescenceFresnelDielectric;\\n\t\tvec3 iridescenceFresnelMetallic;\\n\t#endif\\n\t#ifdef USE_SHEEN\\n\t\tvec3 sheenColor;\\n\t\tfloat sheenRoughness;\\n\t#endif\\n\t#ifdef IOR\\n\t\tfloat ior;\\n\t#endif\\n\t#ifdef USE_TRANSMISSION\\n\t\tfloat transmission;\\n\t\tfloat transmissionAlpha;\\n\t\tfloat thickness;\\n\t\tfloat attenuationDistance;\\n\t\tvec3 attenuationColor;\\n\t#endif\\n\t#ifdef USE_ANISOTROPY\\n\t\tfloat anisotropy;\\n\t\tfloat alphaT;\\n\t\tvec3 anisotropyT;\\n\t\tvec3 anisotropyB;\\n\t#endif\\n};\\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\\nvec3 sheenSpecularDirect = vec3( 0.0 );\\nvec3 sheenSpecularIndirect = vec3(0.0 );\\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\\n float x2 = x * x;\\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\\n}\\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\\n\tfloat a2 = pow2( alpha );\\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\\n\treturn 0.5 / max( gv + gl, EPSILON );\\n}\\nfloat D_GGX( const in float alpha, const in float dotNH ) {\\n\tfloat a2 = pow2( alpha );\\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\\n}\\n#ifdef USE_ANISOTROPY\\n\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\\n\t\treturn 0.5 / max( gv + gl, EPSILON );\\n\t}\\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\\n\t\tfloat a2 = alphaT * alphaB;\\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\\n\t\thighp float v2 = dot( v, v );\\n\t\tfloat w2 = a2 / v2;\\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\\n\t}\\n#endif\\n#ifdef USE_CLEARCOAT\\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\\n\t\tvec3 f0 = material.clearcoatF0;\\n\t\tfloat f90 = material.clearcoatF90;\\n\t\tfloat roughness = material.clearcoatRoughness;\\n\t\tfloat alpha = pow2( roughness );\\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\\n\t\tfloat D = D_GGX( alpha, dotNH );\\n\t\treturn F * ( V * D );\\n\t}\\n#endif\\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\\n\tvec3 f0 = material.specularColorBlended;\\n\tfloat f90 = material.specularF90;\\n\tfloat roughness = material.roughness;\\n\tfloat alpha = pow2( roughness );\\n\tvec3 halfDir = normalize( lightDir + viewDir );\\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\\n\tvec3 F = F_Schlick( f0, f90, dotVH );\\n\t#ifdef USE_IRIDESCENCE\\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\\n\t#endif\\n\t#ifdef USE_ANISOTROPY\\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\\n\t#else\\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\\n\t\tfloat D = D_GGX( alpha, dotNH );\\n\t#endif\\n\treturn F * ( V * D );\\n}\\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\\n\tconst float LUT_SIZE = 64.0;\\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\\n\tfloat dotNV = saturate( dot( N, V ) );\\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\\n\tuv = uv * LUT_SCALE + LUT_BIAS;\\n\treturn uv;\\n}\\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\\n\tfloat l = length( f );\\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\\n}\\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\\n\tfloat x = dot( v1, v2 );\\n\tfloat y = abs( x );\\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\\n\tfloat v = a / b;\\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\\n\treturn cross( v1, v2 ) * theta_sintheta;\\n}\\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\\n\tvec3 lightNormal = cross( v1, v2 );\\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\\n\tvec3 T1, T2;\\n\tT1 = normalize( V - N * dot( V, N ) );\\n\tT2 = - cross( N, T1 );\\n\tmat3 mat = mInv * transpose( mat3( T1, T2, N ) );\\n\tvec3 coords[ 4 ];\\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\\n\tvec3 vectorFormFactor = vec3( 0.0 );\\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\\n\treturn vec3( result );\\n}\\n#if defined( USE_SHEEN )\\nfloat D_Charlie( float roughness, float dotNH ) {\\n\tfloat alpha = pow2( roughness );\\n\tfloat invAlpha = 1.0 / alpha;\\n\tfloat cos2h = dotNH * dotNH;\\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\\n}\\nfloat V_Neubelt( float dotNV, float dotNL ) {\\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\\n}\\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\\n\tvec3 halfDir = normalize( lightDir + viewDir );\\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\\n\tfloat V = V_Neubelt( dotNV, dotNL );\\n\treturn sheenColor * ( D * V );\\n}\\n#endif\\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\\n\tfloat r2 = roughness * roughness;\\n\tfloat rInv = 1.0 / ( roughness + 0.1 );\\n\tfloat a = -1.9362 + 1.0678 * roughness + 0.4573 * r2 - 0.8469 * rInv;\\n\tfloat b = -0.6014 + 0.5538 * roughness - 0.4670 * r2 - 0.1255 * rInv;\\n\tfloat DG = exp( a * dotNV + b );\\n\treturn saturate( DG );\\n}\\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\\n\tvec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg;\\n\treturn specularColor * fab.x + specularF90 * fab.y;\\n}\\n#ifdef USE_IRIDESCENCE\\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\\n#else\\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\\n#endif\\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\\n\tvec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg;\\n\t#ifdef USE_IRIDESCENCE\\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\\n\t#else\\n\t\tvec3 Fr = specularColor;\\n\t#endif\\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\\n\tfloat Ess = fab.x + fab.y;\\n\tfloat Ems = 1.0 - Ess;\\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\\n\tsingleScatter += FssEss;\\n\tmultiScatter += Fms * Ems;\\n}\\nvec3 BRDF_GGX_Multiscatter( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\\n\tvec3 singleScatter = BRDF_GGX( lightDir, viewDir, normal, material );\\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\\n\tvec2 dfgV = texture2D( dfgLUT, vec2( material.roughness, dotNV ) ).rg;\\n\tvec2 dfgL = texture2D( dfgLUT, vec2( material.roughness, dotNL ) ).rg;\\n\tvec3 FssEss_V = material.specularColorBlended * dfgV.x + material.specularF90 * dfgV.y;\\n\tvec3 FssEss_L = material.specularColorBlended * dfgL.x + material.specularF90 * dfgL.y;\\n\tfloat Ess_V = dfgV.x + dfgV.y;\\n\tfloat Ess_L = dfgL.x + dfgL.y;\\n\tfloat Ems_V = 1.0 - Ess_V;\\n\tfloat Ems_L = 1.0 - Ess_L;\\n\tvec3 Favg = material.specularColorBlended + ( 1.0 - material.specularColorBlended ) * 0.047619;\\n\tvec3 Fms = FssEss_V * FssEss_L * Favg / ( 1.0 - Ems_V * Ems_L * Favg + EPSILON );\\n\tfloat compensationFactor = Ems_V * Ems_L;\\n\tvec3 multiScatter = Fms * compensationFactor;\\n\treturn singleScatter + multiScatter;\\n}\\n#if NUM_RECT_AREA_LIGHTS > 0\\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\\n\t\tvec3 normal = geometryNormal;\\n\t\tvec3 viewDir = geometryViewDir;\\n\t\tvec3 position = geometryPosition;\\n\t\tvec3 lightPos = rectAreaLight.position;\\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\\n\t\tvec3 lightColor = rectAreaLight.color;\\n\t\tfloat roughness = material.roughness;\\n\t\tvec3 rectCoords[ 4 ];\\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\\n\t\tvec4 t1 = texture2D( ltc_1, uv );\\n\t\tvec4 t2 = texture2D( ltc_2, uv );\\n\t\tmat3 mInv = mat3(\\n\t\t\tvec3( t1.x, 0, t1.y ),\\n\t\t\tvec3( 0, 1, 0 ),\\n\t\t\tvec3( t1.z, 0, t1.w )\\n\t\t);\\n\t\tvec3 fresnel = ( material.specularColorBlended * t2.x + ( material.specularF90 - material.specularColorBlended ) * t2.y );\\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseContribution * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\\n\t\t#ifdef USE_CLEARCOAT\\n\t\t\tvec3 Ncc = geometryClearcoatNormal;\\n\t\t\tvec2 uvClearcoat = LTC_Uv( Ncc, viewDir, material.clearcoatRoughness );\\n\t\t\tvec4 t1Clearcoat = texture2D( ltc_1, uvClearcoat );\\n\t\t\tvec4 t2Clearcoat = texture2D( ltc_2, uvClearcoat );\\n\t\t\tmat3 mInvClearcoat = mat3(\\n\t\t\t\tvec3( t1Clearcoat.x, 0, t1Clearcoat.y ),\\n\t\t\t\tvec3( 0, 1, 0 ),\\n\t\t\t\tvec3( t1Clearcoat.z, 0, t1Clearcoat.w )\\n\t\t\t);\\n\t\t\tvec3 fresnelClearcoat = material.clearcoatF0 * t2Clearcoat.x + ( material.clearcoatF90 - material.clearcoatF0 ) * t2Clearcoat.y;\\n\t\t\tclearcoatSpecularDirect += lightColor * fresnelClearcoat * LTC_Evaluate( Ncc, viewDir, position, mInvClearcoat, rectCoords );\\n\t\t#endif\\n\t}\\n#endif\\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\\n\tvec3 irradiance = dotNL * directLight.color;\\n\t#ifdef USE_CLEARCOAT\\n\t\tfloat dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\\n\t\tclearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\\n\t#endif\\n\t#ifdef USE_SHEEN\\n \\n \t\tsheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\\n \\n \t\tfloat sheenAlbedoV = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\\n \t\tfloat sheenAlbedoL = IBLSheenBRDF( geometryNormal, directLight.direction, material.sheenRoughness );\\n \\n \t\tfloat sheenEnergyComp = 1.0 - max3( material.sheenColor ) * max( sheenAlbedoV, sheenAlbedoL );\\n \\n \t\tirradiance *= sheenEnergyComp;\\n \\n \t#endif\\n\treflectedLight.directSpecular += irradiance * BRDF_GGX_Multiscatter( directLight.direction, geometryViewDir, geometryNormal, material );\\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseContribution );\\n}\\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\\n\tvec3 diffuse = irradiance * BRDF_Lambert( material.diffuseContribution );\\n\t#ifdef USE_SHEEN\\n\t\tfloat sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\\n\t\tfloat sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo;\\n\t\tdiffuse *= sheenEnergyComp;\\n\t#endif\\n\treflectedLight.indirectDiffuse += diffuse;\\n}\\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\\n\t#ifdef USE_CLEARCOAT\\n\t\tclearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\\n\t#endif\\n\t#ifdef USE_SHEEN\\n\t\tsheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ) * RECIPROCAL_PI;\\n \t#endif\\n\tvec3 singleScatteringDielectric = vec3( 0.0 );\\n\tvec3 multiScatteringDielectric = vec3( 0.0 );\\n\tvec3 singleScatteringMetallic = vec3( 0.0 );\\n\tvec3 multiScatteringMetallic = vec3( 0.0 );\\n\t#ifdef USE_IRIDESCENCE\\n\t\tcomputeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnelDielectric, material.roughness, singleScatteringDielectric, multiScatteringDielectric );\\n\t\tcomputeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.iridescence, material.iridescenceFresnelMetallic, material.roughness, singleScatteringMetallic, multiScatteringMetallic );\\n\t#else\\n\t\tcomputeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScatteringDielectric, multiScatteringDielectric );\\n\t\tcomputeMultiscattering( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.roughness, singleScatteringMetallic, multiScatteringMetallic );\\n\t#endif\\n\tvec3 singleScattering = mix( singleScatteringDielectric, singleScatteringMetallic, material.metalness );\\n\tvec3 multiScattering = mix( multiScatteringDielectric, multiScatteringMetallic, material.metalness );\\n\tvec3 totalScatteringDielectric = singleScatteringDielectric + multiScatteringDielectric;\\n\tvec3 diffuse = material.diffuseContribution * ( 1.0 - totalScatteringDielectric );\\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\\n\tvec3 indirectSpecular = radiance * singleScattering;\\n\tindirectSpecular += multiScattering * cosineWeightedIrradiance;\\n\tvec3 indirectDiffuse = diffuse * cosineWeightedIrradiance;\\n\t#ifdef USE_SHEEN\\n\t\tfloat sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\\n\t\tfloat sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo;\\n\t\tindirectSpecular *= sheenEnergyComp;\\n\t\tindirectDiffuse *= sheenEnergyComp;\\n\t#endif\\n\treflectedLight.indirectSpecular += indirectSpecular;\\n\treflectedLight.indirectDiffuse += indirectDiffuse;\\n}\\n#define RE_Direct\t\t\t\tRE_Direct_Physical\\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\\n}\",\n lights_fragment_begin: \"\\nvec3 geometryPosition = - vViewPosition;\\nvec3 geometryNormal = normal;\\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\\nvec3 geometryClearcoatNormal = vec3( 0.0 );\\n#ifdef USE_CLEARCOAT\\n\tgeometryClearcoatNormal = clearcoatNormal;\\n#endif\\n#ifdef USE_IRIDESCENCE\\n\tfloat dotNVi = saturate( dot( normal, geometryViewDir ) );\\n\tif ( material.iridescenceThickness == 0.0 ) {\\n\t\tmaterial.iridescence = 0.0;\\n\t} else {\\n\t\tmaterial.iridescence = saturate( material.iridescence );\\n\t}\\n\tif ( material.iridescence > 0.0 ) {\\n\t\tmaterial.iridescenceFresnelDielectric = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\\n\t\tmaterial.iridescenceFresnelMetallic = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.diffuseColor );\\n\t\tmaterial.iridescenceFresnel = mix( material.iridescenceFresnelDielectric, material.iridescenceFresnelMetallic, material.metalness );\\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\\n\t}\\n#endif\\nIncidentLight directLight;\\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\\n\tPointLight pointLight;\\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\\n\tPointLightShadow pointLightShadow;\\n\t#endif\\n\t#pragma unroll_loop_start\\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\\n\t\tpointLight = pointLights[ i ];\\n\t\tgetPointLightInfo( pointLight, geometryPosition, directLight );\\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) )\\n\t\tpointLightShadow = pointLightShadows[ i ];\\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\\n\t\t#endif\\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\\n\t}\\n\t#pragma unroll_loop_end\\n#endif\\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\\n\tSpotLight spotLight;\\n\tvec4 spotColor;\\n\tvec3 spotLightCoord;\\n\tbool inSpotLightMap;\\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\\n\tSpotLightShadow spotLightShadow;\\n\t#endif\\n\t#pragma unroll_loop_start\\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\\n\t\tspotLight = spotLights[ i ];\\n\t\tgetSpotLightInfo( spotLight, geometryPosition, directLight );\\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\\n\t\t#else\\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\\n\t\t#endif\\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\\n\t\t#endif\\n\t\t#undef SPOT_LIGHT_MAP_INDEX\\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\\n\t\tspotLightShadow = spotLightShadows[ i ];\\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\\n\t\t#endif\\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\\n\t}\\n\t#pragma unroll_loop_end\\n#endif\\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\\n\tDirectionalLight directionalLight;\\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\\n\tDirectionalLightShadow directionalLightShadow;\\n\t#endif\\n\t#pragma unroll_loop_start\\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\\n\t\tdirectionalLight = directionalLights[ i ];\\n\t\tgetDirectionalLightInfo( directionalLight, directLight );\\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\\n\t\t#endif\\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\\n\t}\\n\t#pragma unroll_loop_end\\n#endif\\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\\n\tRectAreaLight rectAreaLight;\\n\t#pragma unroll_loop_start\\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\\n\t\trectAreaLight = rectAreaLights[ i ];\\n\t\tRE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\\n\t}\\n\t#pragma unroll_loop_end\\n#endif\\n#if defined( RE_IndirectDiffuse )\\n\tvec3 iblIrradiance = vec3( 0.0 );\\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\\n\t#if defined( USE_LIGHT_PROBES )\\n\t\tirradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\\n\t#endif\\n\t#if ( NUM_HEMI_LIGHTS > 0 )\\n\t\t#pragma unroll_loop_start\\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\\n\t\t}\\n\t\t#pragma unroll_loop_end\\n\t#endif\\n\t#ifdef USE_LIGHT_PROBES_GRID\\n\t\tvec3 probeWorldPos = ( ( vec4( geometryPosition, 1.0 ) - viewMatrix[ 3 ] ) * viewMatrix ).xyz;\\n\t\tvec3 probeWorldNormal = transformNormalByInverseViewMatrix( geometryNormal, viewMatrix );\\n\t\tirradiance += getLightProbeGridIrradiance( probeWorldPos, probeWorldNormal );\\n\t#endif\\n#endif\\n#if defined( RE_IndirectSpecular )\\n\tvec3 radiance = vec3( 0.0 );\\n\tvec3 clearcoatRadiance = vec3( 0.0 );\\n#endif\",\n lights_fragment_maps: \"#if defined( RE_IndirectDiffuse )\\n\t#ifdef USE_LIGHTMAP\\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\\n\t\tirradiance += lightMapIrradiance;\\n\t#endif\\n\t#if defined( USE_ENVMAP ) && defined( ENVMAP_TYPE_CUBE_UV )\\n\t\t#if defined( STANDARD ) || defined( LAMBERT ) || defined( PHONG )\\n\t\t\tiblIrradiance += getIBLIrradiance( geometryNormal );\\n\t\t#endif\\n\t#endif\\n#endif\\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\\n\t#ifdef USE_ANISOTROPY\\n\t\tradiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\\n\t#else\\n\t\tradiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\\n\t#endif\\n\t#ifdef USE_CLEARCOAT\\n\t\tclearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\\n\t#endif\\n#endif\",\n lights_fragment_end: \"#if defined( RE_IndirectDiffuse )\\n\t#if defined( LAMBERT ) || defined( PHONG )\\n\t\tirradiance += iblIrradiance;\\n\t#endif\\n\tRE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\\n#endif\\n#if defined( RE_IndirectSpecular )\\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\\n#endif\",\n lightprobes_pars_fragment: \"#ifdef USE_LIGHT_PROBES_GRID\\nuniform highp sampler3D probesSH;\\nuniform vec3 probesMin;\\nuniform vec3 probesMax;\\nuniform vec3 probesResolution;\\nvec3 getLightProbeGridIrradiance( vec3 worldPos, vec3 worldNormal ) {\\n\tvec3 res = probesResolution;\\n\tvec3 gridRange = probesMax - probesMin;\\n\tvec3 resMinusOne = res - 1.0;\\n\tvec3 probeSpacing = gridRange / resMinusOne;\\n\tvec3 samplePos = worldPos + worldNormal * probeSpacing * 0.5;\\n\tvec3 uvw = clamp( ( samplePos - probesMin ) / gridRange, 0.0, 1.0 );\\n\tuvw = uvw * resMinusOne / res + 0.5 / res;\\n\tfloat nz = res.z;\\n\tfloat paddedSlices = nz + 2.0;\\n\tfloat atlasDepth = 7.0 * paddedSlices;\\n\tfloat uvZBase = uvw.z * nz + 1.0;\\n\tvec4 s0 = texture( probesSH, vec3( uvw.xy, ( uvZBase ) / atlasDepth ) );\\n\tvec4 s1 = texture( probesSH, vec3( uvw.xy, ( uvZBase + paddedSlices ) / atlasDepth ) );\\n\tvec4 s2 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 2.0 * paddedSlices ) / atlasDepth ) );\\n\tvec4 s3 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 3.0 * paddedSlices ) / atlasDepth ) );\\n\tvec4 s4 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 4.0 * paddedSlices ) / atlasDepth ) );\\n\tvec4 s5 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 5.0 * paddedSlices ) / atlasDepth ) );\\n\tvec4 s6 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 6.0 * paddedSlices ) / atlasDepth ) );\\n\tvec3 c0 = s0.xyz;\\n\tvec3 c1 = vec3( s0.w, s1.xy );\\n\tvec3 c2 = vec3( s1.zw, s2.x );\\n\tvec3 c3 = s2.yzw;\\n\tvec3 c4 = s3.xyz;\\n\tvec3 c5 = vec3( s3.w, s4.xy );\\n\tvec3 c6 = vec3( s4.zw, s5.x );\\n\tvec3 c7 = s5.yzw;\\n\tvec3 c8 = s6.xyz;\\n\tfloat x = worldNormal.x, y = worldNormal.y, z = worldNormal.z;\\n\tvec3 result = c0 * 0.886227;\\n\tresult += c1 * 2.0 * 0.511664 * y;\\n\tresult += c2 * 2.0 * 0.511664 * z;\\n\tresult += c3 * 2.0 * 0.511664 * x;\\n\tresult += c4 * 2.0 * 0.429043 * x * y;\\n\tresult += c5 * 2.0 * 0.429043 * y * z;\\n\tresult += c6 * ( 0.743125 * z * z - 0.247708 );\\n\tresult += c7 * 2.0 * 0.429043 * x * z;\\n\tresult += c8 * 0.429043 * ( x * x - y * y );\\n\treturn max( result, vec3( 0.0 ) );\\n}\\n#endif\",\n logdepthbuf_fragment: \"#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )\\n\tgl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\\n#endif\",\n logdepthbuf_pars_fragment: \"#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )\\n\tuniform float logDepthBufFC;\\n\tvarying float vFragDepth;\\n\tvarying float vIsPerspective;\\n#endif\",\n logdepthbuf_pars_vertex: \"#ifdef USE_LOGARITHMIC_DEPTH_BUFFER\\n\tvarying float vFragDepth;\\n\tvarying float vIsPerspective;\\n#endif\",\n logdepthbuf_vertex: \"#ifdef USE_LOGARITHMIC_DEPTH_BUFFER\\n\tvFragDepth = 1.0 + gl_Position.w;\\n\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\\n#endif\",\n map_fragment: \"#ifdef USE_MAP\\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\\n\t#ifdef DECODE_VIDEO_TEXTURE\\n\t\tsampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );\\n\t#endif\\n\tdiffuseColor *= sampledDiffuseColor;\\n#endif\",\n map_pars_fragment: \"#ifdef USE_MAP\\n\tuniform sampler2D map;\\n#endif\",\n map_particle_fragment: \"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\\n\t#if defined( USE_POINTS_UV )\\n\t\tvec2 uv = vUv;\\n\t#else\\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\\n\t#endif\\n#endif\\n#ifdef USE_MAP\\n\tdiffuseColor *= texture2D( map, uv );\\n#endif\\n#ifdef USE_ALPHAMAP\\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\\n#endif\",\n map_particle_pars_fragment: \"#if defined( USE_POINTS_UV )\\n\tvarying vec2 vUv;\\n#else\\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\\n\t\tuniform mat3 uvTransform;\\n\t#endif\\n#endif\\n#ifdef USE_MAP\\n\tuniform sampler2D map;\\n#endif\\n#ifdef USE_ALPHAMAP\\n\tuniform sampler2D alphaMap;\\n#endif\",\n metalnessmap_fragment: \"float metalnessFactor = metalness;\\n#ifdef USE_METALNESSMAP\\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\\n\tmetalnessFactor *= texelMetalness.b;\\n#endif\",\n metalnessmap_pars_fragment: \"#ifdef USE_METALNESSMAP\\n\tuniform sampler2D metalnessMap;\\n#endif\",\n morphinstance_vertex: \"#ifdef USE_INSTANCING_MORPH\\n\tfloat morphTargetInfluences[ MORPHTARGETS_COUNT ];\\n\tfloat morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\\n\t\tmorphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\\n\t}\\n#endif\",\n morphcolor_vertex: \"#if defined( USE_MORPHCOLORS )\\n\tvColor *= morphTargetBaseInfluence;\\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\\n\t\t#if defined( USE_COLOR_ALPHA )\\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\\n\t\t#elif defined( USE_COLOR )\\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\\n\t\t#endif\\n\t}\\n#endif\",\n morphnormal_vertex: \"#ifdef USE_MORPHNORMALS\\n\tobjectNormal *= morphTargetBaseInfluence;\\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\\n\t}\\n#endif\",\n morphtarget_pars_vertex: \"#ifdef USE_MORPHTARGETS\\n\t#ifndef USE_INSTANCING_MORPH\\n\t\tuniform float morphTargetBaseInfluence;\\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\\n\t#endif\\n\tuniform sampler2DArray morphTargetsTexture;\\n\tuniform ivec2 morphTargetsTextureSize;\\n\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\\n\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\\n\t\tint y = texelIndex / morphTargetsTextureSize.x;\\n\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\\n\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\\n\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\\n\t}\\n#endif\",\n morphtarget_vertex: \"#ifdef USE_MORPHTARGETS\\n\ttransformed *= morphTargetBaseInfluence;\\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\\n\t}\\n#endif\",\n normal_fragment_begin: \"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\\n#ifdef FLAT_SHADED\\n\tvec3 fdx = dFdx( vViewPosition );\\n\tvec3 fdy = dFdy( vViewPosition );\\n\tvec3 normal = normalize( cross( fdx, fdy ) );\\n#else\\n\tvec3 normal = normalize( vNormal );\\n\t#ifdef DOUBLE_SIDED\\n\t\tnormal *= faceDirection;\\n\t#endif\\n#endif\\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\\n\t#ifdef USE_TANGENT\\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\\n\t#else\\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\\n\t\t#if defined( USE_NORMALMAP )\\n\t\t\tvNormalMapUv\\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\\n\t\t\tvClearcoatNormalMapUv\\n\t\t#else\\n\t\t\tvUv\\n\t\t#endif\\n\t\t);\\n\t#endif\\n\t#ifdef DOUBLE_SIDED\\n\t\ttbn[0] *= faceDirection;\\n\t\ttbn[1] *= faceDirection;\\n\t#endif\\n#endif\\n#ifdef USE_CLEARCOAT_NORMALMAP\\n\t#ifdef USE_TANGENT\\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\\n\t#else\\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\\n\t#endif\\n\t#ifdef DOUBLE_SIDED\\n\t\ttbn2[0] *= faceDirection;\\n\t\ttbn2[1] *= faceDirection;\\n\t#endif\\n#endif\\nvec3 nonPerturbedNormal = normal;\",\n normal_fragment_maps: \"#ifdef USE_NORMALMAP_OBJECTSPACE\\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\\n\t#ifdef FLIP_SIDED\\n\t\tnormal = - normal;\\n\t#endif\\n\t#ifdef DOUBLE_SIDED\\n\t\tnormal = normal * faceDirection;\\n\t#endif\\n\tnormal = normalize( normalMatrix * normal );\\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\\n\t#if defined( USE_PACKED_NORMALMAP )\\n\t\tmapN = vec3( mapN.xy, sqrt( saturate( 1.0 - dot( mapN.xy, mapN.xy ) ) ) );\\n\t#endif\\n\tmapN.xy *= normalScale;\\n\tnormal = normalize( tbn * mapN );\\n#elif defined( USE_BUMPMAP )\\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\\n#endif\",\n normal_pars_fragment: \"#ifndef FLAT_SHADED\\n\tvarying vec3 vNormal;\\n\t#ifdef USE_TANGENT\\n\t\tvarying vec3 vTangent;\\n\t\tvarying vec3 vBitangent;\\n\t#endif\\n#endif\",\n normal_pars_vertex: \"#ifndef FLAT_SHADED\\n\tvarying vec3 vNormal;\\n\t#ifdef USE_TANGENT\\n\t\tvarying vec3 vTangent;\\n\t\tvarying vec3 vBitangent;\\n\t#endif\\n#endif\",\n normal_vertex: \"#ifndef FLAT_SHADED\\n\tvNormal = normalize( transformedNormal );\\n\t#ifdef USE_TANGENT\\n\t\tvTangent = normalize( transformedTangent );\\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\\n\t\t#ifdef FLIP_SIDED\\n\t\t\tvBitangent = - vBitangent;\\n\t\t#endif\\n\t#endif\\n#endif\",\n normalmap_pars_fragment: \"#ifdef USE_NORMALMAP\\n\tuniform sampler2D normalMap;\\n\tuniform vec2 normalScale;\\n#endif\\n#ifdef USE_NORMALMAP_OBJECTSPACE\\n\tuniform mat3 normalMatrix;\\n#endif\\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\\n\t\tvec2 st0 = dFdx( uv.st );\\n\t\tvec2 st1 = dFdy( uv.st );\\n\t\tvec3 N = surf_norm;\\n\t\tvec3 q1perp = cross( q1, N );\\n\t\tvec3 q0perp = cross( N, q0 );\\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\\n\t\treturn mat3( T * scale, B * scale, N );\\n\t}\\n#endif\",\n clearcoat_normal_fragment_begin: \"#ifdef USE_CLEARCOAT\\n\tvec3 clearcoatNormal = nonPerturbedNormal;\\n#endif\",\n clearcoat_normal_fragment_maps: \"#ifdef USE_CLEARCOAT_NORMALMAP\\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\\n\tclearcoatMapN.xy *= clearcoatNormalScale;\\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\\n#endif\",\n clearcoat_pars_fragment: \"#ifdef USE_CLEARCOATMAP\\n\tuniform sampler2D clearcoatMap;\\n#endif\\n#ifdef USE_CLEARCOAT_NORMALMAP\\n\tuniform sampler2D clearcoatNormalMap;\\n\tuniform vec2 clearcoatNormalScale;\\n#endif\\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\\n\tuniform sampler2D clearcoatRoughnessMap;\\n#endif\",\n iridescence_pars_fragment: \"#ifdef USE_IRIDESCENCEMAP\\n\tuniform sampler2D iridescenceMap;\\n#endif\\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\\n\tuniform sampler2D iridescenceThicknessMap;\\n#endif\",\n opaque_fragment: \"#ifdef OPAQUE\\ndiffuseColor.a = 1.0;\\n#endif\\n#ifdef USE_TRANSMISSION\\ndiffuseColor.a *= material.transmissionAlpha;\\n#endif\\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );\",\n packing: \"vec3 packNormalToRGB( const in vec3 normal ) {\\n\treturn normalize( normal ) * 0.5 + 0.5;\\n}\\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\\n\treturn 2.0 * rgb.xyz - 1.0;\\n}\\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;\\nconst float Inv255 = 1. / 255.;\\nconst vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );\\nconst vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );\\nconst vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );\\nconst vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );\\nvec4 packDepthToRGBA( const in float v ) {\\n\tif( v <= 0.0 )\\n\t\treturn vec4( 0., 0., 0., 0. );\\n\tif( v >= 1.0 )\\n\t\treturn vec4( 1., 1., 1., 1. );\\n\tfloat vuf;\\n\tfloat af = modf( v * PackFactors.a, vuf );\\n\tfloat bf = modf( vuf * ShiftRight8, vuf );\\n\tfloat gf = modf( vuf * ShiftRight8, vuf );\\n\treturn vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );\\n}\\nvec3 packDepthToRGB( const in float v ) {\\n\tif( v <= 0.0 )\\n\t\treturn vec3( 0., 0., 0. );\\n\tif( v >= 1.0 )\\n\t\treturn vec3( 1., 1., 1. );\\n\tfloat vuf;\\n\tfloat bf = modf( v * PackFactors.b, vuf );\\n\tfloat gf = modf( vuf * ShiftRight8, vuf );\\n\treturn vec3( vuf * Inv255, gf * PackUpscale, bf );\\n}\\nvec2 packDepthToRG( const in float v ) {\\n\tif( v <= 0.0 )\\n\t\treturn vec2( 0., 0. );\\n\tif( v >= 1.0 )\\n\t\treturn vec2( 1., 1. );\\n\tfloat vuf;\\n\tfloat gf = modf( v * 256., vuf );\\n\treturn vec2( vuf * Inv255, gf );\\n}\\nfloat unpackRGBAToDepth( const in vec4 v ) {\\n\treturn dot( v, UnpackFactors4 );\\n}\\nfloat unpackRGBToDepth( const in vec3 v ) {\\n\treturn dot( v, UnpackFactors3 );\\n}\\nfloat unpackRGToDepth( const in vec2 v ) {\\n\treturn v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;\\n}\\nvec4 pack2HalfToRGBA( const in vec2 v ) {\\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\\n}\\nvec2 unpackRGBATo2Half( const in vec4 v ) {\\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\\n}\\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\\n\treturn ( viewZ + near ) / ( near - far );\\n}\\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\\n\t#ifdef USE_REVERSED_DEPTH_BUFFER\\n\t\\n\t\treturn depth * ( far - near ) - far;\\n\t#else\\n\t\treturn depth * ( near - far ) - near;\\n\t#endif\\n}\\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\\n}\\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\\n\t\\n\t#ifdef USE_REVERSED_DEPTH_BUFFER\\n\t\treturn ( near * far ) / ( ( near - far ) * depth - near );\\n\t#else\\n\t\treturn ( near * far ) / ( ( far - near ) * depth - far );\\n\t#endif\\n}\",\n premultiplied_alpha_fragment: \"#ifdef PREMULTIPLIED_ALPHA\\n\tgl_FragColor.rgb *= gl_FragColor.a;\\n#endif\",\n project_vertex: \"vec4 mvPosition = vec4( transformed, 1.0 );\\n#ifdef USE_BATCHING\\n\tmvPosition = batchingMatrix * mvPosition;\\n#endif\\n#ifdef USE_INSTANCING\\n\tmvPosition = instanceMatrix * mvPosition;\\n#endif\\nmvPosition = modelViewMatrix * mvPosition;\\ngl_Position = projectionMatrix * mvPosition;\",\n dithering_fragment: \"#ifdef DITHERING\\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\\n#endif\",\n dithering_pars_fragment: \"#ifdef DITHERING\\n\tvec3 dithering( vec3 color ) {\\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\\n\t\treturn color + dither_shift_RGB;\\n\t}\\n#endif\",\n roughnessmap_fragment: \"float roughnessFactor = roughness;\\n#ifdef USE_ROUGHNESSMAP\\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\\n\troughnessFactor *= texelRoughness.g;\\n#endif\",\n roughnessmap_pars_fragment: \"#ifdef USE_ROUGHNESSMAP\\n\tuniform sampler2D roughnessMap;\\n#endif\",\n shadowmap_pars_fragment: \"#if NUM_SPOT_LIGHT_COORDS > 0\\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\\n#endif\\n#if NUM_SPOT_LIGHT_MAPS > 0\\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\\n#endif\\n#ifdef USE_SHADOWMAP\\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\\n\t\t\tuniform sampler2DShadow directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\\n\t\t#else\\n\t\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\\n\t\t#endif\\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\\n\t\tstruct DirectionalLightShadow {\\n\t\t\tfloat shadowIntensity;\\n\t\t\tfloat shadowBias;\\n\t\t\tfloat shadowNormalBias;\\n\t\t\tfloat shadowRadius;\\n\t\t\tvec2 shadowMapSize;\\n\t\t};\\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\\n\t#endif\\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\\n\t\t\tuniform sampler2DShadow spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\\n\t\t#else\\n\t\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\\n\t\t#endif\\n\t\tstruct SpotLightShadow {\\n\t\t\tfloat shadowIntensity;\\n\t\t\tfloat shadowBias;\\n\t\t\tfloat shadowNormalBias;\\n\t\t\tfloat shadowRadius;\\n\t\t\tvec2 shadowMapSize;\\n\t\t};\\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\\n\t#endif\\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\\n\t\t\tuniform samplerCubeShadow pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\\n\t\t#elif defined( SHADOWMAP_TYPE_BASIC )\\n\t\t\tuniform samplerCube pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\\n\t\t#endif\\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\\n\t\tstruct PointLightShadow {\\n\t\t\tfloat shadowIntensity;\\n\t\t\tfloat shadowBias;\\n\t\t\tfloat shadowNormalBias;\\n\t\t\tfloat shadowRadius;\\n\t\t\tvec2 shadowMapSize;\\n\t\t\tfloat shadowCameraNear;\\n\t\t\tfloat shadowCameraFar;\\n\t\t};\\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\\n\t#endif\\n\t#if defined( SHADOWMAP_TYPE_PCF )\\n\t\tfloat interleavedGradientNoise( vec2 position ) {\\n\t\t\treturn fract( 52.9829189 * fract( dot( position, vec2( 0.06711056, 0.00583715 ) ) ) );\\n\t\t}\\n\t\tvec2 vogelDiskSample( int sampleIndex, int samplesCount, float phi ) {\\n\t\t\tconst float goldenAngle = 2.399963229728653;\\n\t\t\tfloat r = sqrt( ( float( sampleIndex ) + 0.5 ) / float( samplesCount ) );\\n\t\t\tfloat theta = float( sampleIndex ) * goldenAngle + phi;\\n\t\t\treturn vec2( cos( theta ), sin( theta ) ) * r;\\n\t\t}\\n\t#endif\\n\t#if defined( SHADOWMAP_TYPE_PCF )\\n\t\tfloat getShadow( sampler2DShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\\n\t\t\tfloat shadow = 1.0;\\n\t\t\tshadowCoord.xyz /= shadowCoord.w;\\n\t\t\tshadowCoord.z += shadowBias;\\n\t\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\\n\t\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\\n\t\t\tif ( frustumTest ) {\\n\t\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\\n\t\t\t\tfloat radius = shadowRadius * texelSize.x;\\n\t\t\t\tfloat phi = interleavedGradientNoise( gl_FragCoord.xy ) * PI2;\\n\t\t\t\tshadow = (\\n\t\t\t\t\ttexture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 0, 5, phi ) * radius, shadowCoord.z ) ) +\\n\t\t\t\t\ttexture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 1, 5, phi ) * radius, shadowCoord.z ) ) +\\n\t\t\t\t\ttexture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 2, 5, phi ) * radius, shadowCoord.z ) ) +\\n\t\t\t\t\ttexture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 3, 5, phi ) * radius, shadowCoord.z ) ) +\\n\t\t\t\t\ttexture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 4, 5, phi ) * radius, shadowCoord.z ) )\\n\t\t\t\t) * 0.2;\\n\t\t\t}\\n\t\t\treturn mix( 1.0, shadow, shadowIntensity );\\n\t\t}\\n\t#elif defined( SHADOWMAP_TYPE_VSM )\\n\t\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\\n\t\t\tfloat shadow = 1.0;\\n\t\t\tshadowCoord.xyz /= shadowCoord.w;\\n\t\t\t#ifdef USE_REVERSED_DEPTH_BUFFER\\n\t\t\t\tshadowCoord.z -= shadowBias;\\n\t\t\t#else\\n\t\t\t\tshadowCoord.z += shadowBias;\\n\t\t\t#endif\\n\t\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\\n\t\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\\n\t\t\tif ( frustumTest ) {\\n\t\t\t\tvec2 distribution = texture2D( shadowMap, shadowCoord.xy ).rg;\\n\t\t\t\tfloat mean = distribution.x;\\n\t\t\t\tfloat variance = distribution.y * distribution.y;\\n\t\t\t\t#ifdef USE_REVERSED_DEPTH_BUFFER\\n\t\t\t\t\tfloat hard_shadow = step( mean, shadowCoord.z );\\n\t\t\t\t#else\\n\t\t\t\t\tfloat hard_shadow = step( shadowCoord.z, mean );\\n\t\t\t\t#endif\\n\t\t\t\t\\n\t\t\t\tif ( hard_shadow == 1.0 ) {\\n\t\t\t\t\tshadow = 1.0;\\n\t\t\t\t} else {\\n\t\t\t\t\tvariance = max( variance, 0.0000001 );\\n\t\t\t\t\tfloat d = shadowCoord.z - mean;\\n\t\t\t\t\tfloat p_max = variance / ( variance + d * d );\\n\t\t\t\t\tp_max = clamp( ( p_max - 0.3 ) / 0.65, 0.0, 1.0 );\\n\t\t\t\t\tshadow = max( hard_shadow, p_max );\\n\t\t\t\t}\\n\t\t\t}\\n\t\t\treturn mix( 1.0, shadow, shadowIntensity );\\n\t\t}\\n\t#else\\n\t\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\\n\t\t\tfloat shadow = 1.0;\\n\t\t\tshadowCoord.xyz /= shadowCoord.w;\\n\t\t\t#ifdef USE_REVERSED_DEPTH_BUFFER\\n\t\t\t\tshadowCoord.z -= shadowBias;\\n\t\t\t#else\\n\t\t\t\tshadowCoord.z += shadowBias;\\n\t\t\t#endif\\n\t\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\\n\t\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\\n\t\t\tif ( frustumTest ) {\\n\t\t\t\tfloat depth = texture2D( shadowMap, shadowCoord.xy ).r;\\n\t\t\t\t#ifdef USE_REVERSED_DEPTH_BUFFER\\n\t\t\t\t\tshadow = step( depth, shadowCoord.z );\\n\t\t\t\t#else\\n\t\t\t\t\tshadow = step( shadowCoord.z, depth );\\n\t\t\t\t#endif\\n\t\t\t}\\n\t\t\treturn mix( 1.0, shadow, shadowIntensity );\\n\t\t}\\n\t#endif\\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\\n\t#if defined( SHADOWMAP_TYPE_PCF )\\n\tfloat getPointShadow( samplerCubeShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\\n\t\tfloat shadow = 1.0;\\n\t\tvec3 lightToPosition = shadowCoord.xyz;\\n\t\tvec3 bd3D = normalize( lightToPosition );\\n\t\tvec3 absVec = abs( lightToPosition );\\n\t\tfloat viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z );\\n\t\tif ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) {\\n\t\t\t#ifdef USE_REVERSED_DEPTH_BUFFER\\n\t\t\t\tfloat dp = ( shadowCameraNear * ( shadowCameraFar - viewSpaceZ ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );\\n\t\t\t\tdp -= shadowBias;\\n\t\t\t#else\\n\t\t\t\tfloat dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );\\n\t\t\t\tdp += shadowBias;\\n\t\t\t#endif\\n\t\t\tfloat texelSize = shadowRadius / shadowMapSize.x;\\n\t\t\tvec3 absDir = abs( bd3D );\\n\t\t\tvec3 tangent = absDir.x > absDir.z ? vec3( 0.0, 1.0, 0.0 ) : vec3( 1.0, 0.0, 0.0 );\\n\t\t\ttangent = normalize( cross( bd3D, tangent ) );\\n\t\t\tvec3 bitangent = cross( bd3D, tangent );\\n\t\t\tfloat phi = interleavedGradientNoise( gl_FragCoord.xy ) * PI2;\\n\t\t\tvec2 sample0 = vogelDiskSample( 0, 5, phi );\\n\t\t\tvec2 sample1 = vogelDiskSample( 1, 5, phi );\\n\t\t\tvec2 sample2 = vogelDiskSample( 2, 5, phi );\\n\t\t\tvec2 sample3 = vogelDiskSample( 3, 5, phi );\\n\t\t\tvec2 sample4 = vogelDiskSample( 4, 5, phi );\\n\t\t\tshadow = (\\n\t\t\t\ttexture( shadowMap, vec4( bd3D + ( tangent * sample0.x + bitangent * sample0.y ) * texelSize, dp ) ) +\\n\t\t\t\ttexture( shadowMap, vec4( bd3D + ( tangent * sample1.x + bitangent * sample1.y ) * texelSize, dp ) ) +\\n\t\t\t\ttexture( shadowMap, vec4( bd3D + ( tangent * sample2.x + bitangent * sample2.y ) * texelSize, dp ) ) +\\n\t\t\t\ttexture( shadowMap, vec4( bd3D + ( tangent * sample3.x + bitangent * sample3.y ) * texelSize, dp ) ) +\\n\t\t\t\ttexture( shadowMap, vec4( bd3D + ( tangent * sample4.x + bitangent * sample4.y ) * texelSize, dp ) )\\n\t\t\t) * 0.2;\\n\t\t}\\n\t\treturn mix( 1.0, shadow, shadowIntensity );\\n\t}\\n\t#elif defined( SHADOWMAP_TYPE_BASIC )\\n\tfloat getPointShadow( samplerCube shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\\n\t\tfloat shadow = 1.0;\\n\t\tvec3 lightToPosition = shadowCoord.xyz;\\n\t\tvec3 absVec = abs( lightToPosition );\\n\t\tfloat viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z );\\n\t\tif ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) {\\n\t\t\tfloat dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );\\n\t\t\tdp += shadowBias;\\n\t\t\tvec3 bd3D = normalize( lightToPosition );\\n\t\t\tfloat depth = textureCube( shadowMap, bd3D ).r;\\n\t\t\t#ifdef USE_REVERSED_DEPTH_BUFFER\\n\t\t\t\tdepth = 1.0 - depth;\\n\t\t\t#endif\\n\t\t\tshadow = step( dp, depth );\\n\t\t}\\n\t\treturn mix( 1.0, shadow, shadowIntensity );\\n\t}\\n\t#endif\\n\t#endif\\n#endif\",\n shadowmap_pars_vertex: \"#if NUM_SPOT_LIGHT_COORDS > 0\\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\\n#endif\\n#ifdef USE_SHADOWMAP\\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\\n\t\tstruct DirectionalLightShadow {\\n\t\t\tfloat shadowIntensity;\\n\t\t\tfloat shadowBias;\\n\t\t\tfloat shadowNormalBias;\\n\t\t\tfloat shadowRadius;\\n\t\t\tvec2 shadowMapSize;\\n\t\t};\\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\\n\t#endif\\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\\n\t\tstruct SpotLightShadow {\\n\t\t\tfloat shadowIntensity;\\n\t\t\tfloat shadowBias;\\n\t\t\tfloat shadowNormalBias;\\n\t\t\tfloat shadowRadius;\\n\t\t\tvec2 shadowMapSize;\\n\t\t};\\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\\n\t#endif\\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\\n\t\tstruct PointLightShadow {\\n\t\t\tfloat shadowIntensity;\\n\t\t\tfloat shadowBias;\\n\t\t\tfloat shadowNormalBias;\\n\t\t\tfloat shadowRadius;\\n\t\t\tvec2 shadowMapSize;\\n\t\t\tfloat shadowCameraNear;\\n\t\t\tfloat shadowCameraFar;\\n\t\t};\\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\\n\t#endif\\n#endif\",\n shadowmap_vertex: \"#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\\n\t#ifdef HAS_NORMAL\\n\t\tvec3 shadowWorldNormal = transformNormalByInverseViewMatrix( transformedNormal, viewMatrix );\\n\t#else\\n\t\tvec3 shadowWorldNormal = vec3( 0.0 );\\n\t#endif\\n\tvec4 shadowWorldPosition;\\n#endif\\n#if defined( USE_SHADOWMAP )\\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\\n\t\t#pragma unroll_loop_start\\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\\n\t\t}\\n\t\t#pragma unroll_loop_end\\n\t#endif\\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\\n\t\t#pragma unroll_loop_start\\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\\n\t\t}\\n\t\t#pragma unroll_loop_end\\n\t#endif\\n#endif\\n#if NUM_SPOT_LIGHT_COORDS > 0\\n\t#pragma unroll_loop_start\\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\\n\t\tshadowWorldPosition = worldPosition;\\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\\n\t\t#endif\\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\\n\t}\\n\t#pragma unroll_loop_end\\n#endif\",\n shadowmask_pars_fragment: \"float getShadowMask() {\\n\tfloat shadow = 1.0;\\n\t#ifdef USE_SHADOWMAP\\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\\n\tDirectionalLightShadow directionalLight;\\n\t#pragma unroll_loop_start\\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\\n\t\tdirectionalLight = directionalLightShadows[ i ];\\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\\n\t}\\n\t#pragma unroll_loop_end\\n\t#endif\\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\\n\tSpotLightShadow spotLight;\\n\t#pragma unroll_loop_start\\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\\n\t\tspotLight = spotLightShadows[ i ];\\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\\n\t}\\n\t#pragma unroll_loop_end\\n\t#endif\\n\t#if NUM_POINT_LIGHT_SHADOWS > 0 && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) )\\n\tPointLightShadow pointLight;\\n\t#pragma unroll_loop_start\\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\\n\t\tpointLight = pointLightShadows[ i ];\\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\\n\t}\\n\t#pragma unroll_loop_end\\n\t#endif\\n\t#endif\\n\treturn shadow;\\n}\",\n skinbase_vertex: \"#ifdef USE_SKINNING\\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\\n#endif\",\n skinning_pars_vertex: \"#ifdef USE_SKINNING\\n\tuniform mat4 bindMatrix;\\n\tuniform mat4 bindMatrixInverse;\\n\tuniform highp sampler2D boneTexture;\\n\tmat4 getBoneMatrix( const in float i ) {\\n\t\tint size = textureSize( boneTexture, 0 ).x;\\n\t\tint j = int( i ) * 4;\\n\t\tint x = j % size;\\n\t\tint y = j / size;\\n\t\tvec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\\n\t\tvec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\\n\t\tvec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\\n\t\tvec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\\n\t\treturn mat4( v1, v2, v3, v4 );\\n\t}\\n#endif\",\n skinning_vertex: \"#ifdef USE_SKINNING\\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\\n\tvec4 skinned = vec4( 0.0 );\\n\tskinned += boneMatX * skinVertex * skinWeight.x;\\n\tskinned += boneMatY * skinVertex * skinWeight.y;\\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\\n\tskinned += boneMatW * skinVertex * skinWeight.w;\\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\\n#endif\",\n skinnormal_vertex: \"#ifdef USE_SKINNING\\n\tmat4 skinMatrix = mat4( 0.0 );\\n\tskinMatrix += skinWeight.x * boneMatX;\\n\tskinMatrix += skinWeight.y * boneMatY;\\n\tskinMatrix += skinWeight.z * boneMatZ;\\n\tskinMatrix += skinWeight.w * boneMatW;\\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\\n\t#ifdef USE_TANGENT\\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\\n\t#endif\\n#endif\",\n specularmap_fragment: \"float specularStrength;\\n#ifdef USE_SPECULARMAP\\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\\n\tspecularStrength = texelSpecular.r;\\n#else\\n\tspecularStrength = 1.0;\\n#endif\",\n specularmap_pars_fragment: \"#ifdef USE_SPECULARMAP\\n\tuniform sampler2D specularMap;\\n#endif\",\n tonemapping_fragment: \"#if defined( TONE_MAPPING )\\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\\n#endif\",\n tonemapping_pars_fragment: \"#ifndef saturate\\n#define saturate( a ) clamp( a, 0.0, 1.0 )\\n#endif\\nuniform float toneMappingExposure;\\nvec3 LinearToneMapping( vec3 color ) {\\n\treturn saturate( toneMappingExposure * color );\\n}\\nvec3 ReinhardToneMapping( vec3 color ) {\\n\tcolor *= toneMappingExposure;\\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\\n}\\nvec3 CineonToneMapping( vec3 color ) {\\n\tcolor *= toneMappingExposure;\\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\\n}\\nvec3 RRTAndODTFit( vec3 v ) {\\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\\n\treturn a / b;\\n}\\nvec3 ACESFilmicToneMapping( vec3 color ) {\\n\tconst mat3 ACESInputMat = mat3(\\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\\n\t);\\n\tconst mat3 ACESOutputMat = mat3(\\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\\n\t);\\n\tcolor *= toneMappingExposure / 0.6;\\n\tcolor = ACESInputMat * color;\\n\tcolor = RRTAndODTFit( color );\\n\tcolor = ACESOutputMat * color;\\n\treturn saturate( color );\\n}\\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\\n\tvec3( 1.6605, - 0.1246, - 0.0182 ),\\n\tvec3( - 0.5876, 1.1329, - 0.1006 ),\\n\tvec3( - 0.0728, - 0.0083, 1.1187 )\\n);\\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\\n\tvec3( 0.6274, 0.0691, 0.0164 ),\\n\tvec3( 0.3293, 0.9195, 0.0880 ),\\n\tvec3( 0.0433, 0.0113, 0.8956 )\\n);\\nvec3 agxDefaultContrastApprox( vec3 x ) {\\n\tvec3 x2 = x * x;\\n\tvec3 x4 = x2 * x2;\\n\treturn + 15.5 * x4 * x2\\n\t\t- 40.14 * x4 * x\\n\t\t+ 31.96 * x4\\n\t\t- 6.868 * x2 * x\\n\t\t+ 0.4298 * x2\\n\t\t+ 0.1191 * x\\n\t\t- 0.00232;\\n}\\nvec3 AgXToneMapping( vec3 color ) {\\n\tconst mat3 AgXInsetMatrix = mat3(\\n\t\tvec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\\n\t\tvec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\\n\t\tvec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\\n\t);\\n\tconst mat3 AgXOutsetMatrix = mat3(\\n\t\tvec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\\n\t\tvec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\\n\t\tvec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\\n\t);\\n\tconst float AgxMinEv = - 12.47393;\tconst float AgxMaxEv = 4.026069;\\n\tcolor *= toneMappingExposure;\\n\tcolor = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\\n\tcolor = AgXInsetMatrix * color;\\n\tcolor = max( color, 1e-10 );\tcolor = log2( color );\\n\tcolor = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\\n\tcolor = clamp( color, 0.0, 1.0 );\\n\tcolor = agxDefaultContrastApprox( color );\\n\tcolor = AgXOutsetMatrix * color;\\n\tcolor = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\\n\tcolor = LINEAR_REC2020_TO_LINEAR_SRGB * color;\\n\tcolor = clamp( color, 0.0, 1.0 );\\n\treturn color;\\n}\\nvec3 NeutralToneMapping( vec3 color ) {\\n\tconst float StartCompression = 0.8 - 0.04;\\n\tconst float Desaturation = 0.15;\\n\tcolor *= toneMappingExposure;\\n\tfloat x = min( color.r, min( color.g, color.b ) );\\n\tfloat offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\\n\tcolor -= offset;\\n\tfloat peak = max( color.r, max( color.g, color.b ) );\\n\tif ( peak < StartCompression ) return color;\\n\tfloat d = 1. - StartCompression;\\n\tfloat newPeak = 1. - d * d / ( peak + d - StartCompression );\\n\tcolor *= newPeak / peak;\\n\tfloat g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );\\n\treturn mix( color, vec3( newPeak ), g );\\n}\\nvec3 CustomToneMapping( vec3 color ) { return color; }\",\n transmission_fragment: \"#ifdef USE_TRANSMISSION\\n\tmaterial.transmission = transmission;\\n\tmaterial.transmissionAlpha = 1.0;\\n\tmaterial.thickness = thickness;\\n\tmaterial.attenuationDistance = attenuationDistance;\\n\tmaterial.attenuationColor = attenuationColor;\\n\t#ifdef USE_TRANSMISSIONMAP\\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\\n\t#endif\\n\t#ifdef USE_THICKNESSMAP\\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\\n\t#endif\\n\tvec3 pos = vWorldPosition;\\n\tvec3 v = normalize( cameraPosition - pos );\\n\tvec3 n = transformNormalByInverseViewMatrix( normal, viewMatrix );\\n\tvec4 transmitted = getIBLVolumeRefraction(\\n\t\tn, v, material.roughness, material.diffuseContribution, material.specularColorBlended, material.specularF90,\\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,\\n\t\tmaterial.attenuationColor, material.attenuationDistance );\\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\\n#endif\",\n transmission_pars_fragment: \"#ifdef USE_TRANSMISSION\\n\tuniform float transmission;\\n\tuniform float thickness;\\n\tuniform float attenuationDistance;\\n\tuniform vec3 attenuationColor;\\n\t#ifdef USE_TRANSMISSIONMAP\\n\t\tuniform sampler2D transmissionMap;\\n\t#endif\\n\t#ifdef USE_THICKNESSMAP\\n\t\tuniform sampler2D thicknessMap;\\n\t#endif\\n\tuniform vec2 transmissionSamplerSize;\\n\tuniform sampler2D transmissionSamplerMap;\\n\tuniform mat4 modelMatrix;\\n\tuniform mat4 projectionMatrix;\\n\tvarying vec3 vWorldPosition;\\n\tfloat w0( float a ) {\\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\\n\t}\\n\tfloat w1( float a ) {\\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\\n\t}\\n\tfloat w2( float a ){\\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\\n\t}\\n\tfloat w3( float a ) {\\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\\n\t}\\n\tfloat g0( float a ) {\\n\t\treturn w0( a ) + w1( a );\\n\t}\\n\tfloat g1( float a ) {\\n\t\treturn w2( a ) + w3( a );\\n\t}\\n\tfloat h0( float a ) {\\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\\n\t}\\n\tfloat h1( float a ) {\\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\\n\t}\\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\\n\t\tuv = uv * texelSize.zw + 0.5;\\n\t\tvec2 iuv = floor( uv );\\n\t\tvec2 fuv = fract( uv );\\n\t\tfloat g0x = g0( fuv.x );\\n\t\tfloat g1x = g1( fuv.x );\\n\t\tfloat h0x = h0( fuv.x );\\n\t\tfloat h1x = h1( fuv.x );\\n\t\tfloat h0y = h0( fuv.y );\\n\t\tfloat h1y = h1( fuv.y );\\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\\n\t}\\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\\n\t\treturn mix( fSample, cSample, fract( lod ) );\\n\t}\\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\\n\t\tvec3 modelScale;\\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\\n\t}\\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\\n\t}\\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\\n\t}\\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\\n\t\tif ( isinf( attenuationDistance ) ) {\\n\t\t\treturn vec3( 1.0 );\\n\t\t} else {\\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\\n\t\t}\\n\t}\\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,\\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\\n\t\tvec4 transmittedLight;\\n\t\tvec3 transmittance;\\n\t\t#ifdef USE_DISPERSION\\n\t\t\tfloat halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;\\n\t\t\tvec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );\\n\t\t\tfor ( int i = 0; i < 3; i ++ ) {\\n\t\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );\\n\t\t\t\tvec3 refractedRayExit = position + transmissionRay;\\n\t\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\\n\t\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\\n\t\t\t\trefractionCoords += 1.0;\\n\t\t\t\trefractionCoords /= 2.0;\\n\t\t\t\tvec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );\\n\t\t\t\ttransmittedLight[ i ] = transmissionSample[ i ];\\n\t\t\t\ttransmittedLight.a += transmissionSample.a;\\n\t\t\t\ttransmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];\\n\t\t\t}\\n\t\t\ttransmittedLight.a /= 3.0;\\n\t\t#else\\n\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\\n\t\t\tvec3 refractedRayExit = position + transmissionRay;\\n\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\\n\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\\n\t\t\trefractionCoords += 1.0;\\n\t\t\trefractionCoords /= 2.0;\\n\t\t\ttransmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\\n\t\t\ttransmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\\n\t\t#endif\\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\\n\t}\\n#endif\",\n uv_pars_fragment: \"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\\n\tvarying vec2 vUv;\\n#endif\\n#ifdef USE_MAP\\n\tvarying vec2 vMapUv;\\n#endif\\n#ifdef USE_ALPHAMAP\\n\tvarying vec2 vAlphaMapUv;\\n#endif\\n#ifdef USE_LIGHTMAP\\n\tvarying vec2 vLightMapUv;\\n#endif\\n#ifdef USE_AOMAP\\n\tvarying vec2 vAoMapUv;\\n#endif\\n#ifdef USE_BUMPMAP\\n\tvarying vec2 vBumpMapUv;\\n#endif\\n#ifdef USE_NORMALMAP\\n\tvarying vec2 vNormalMapUv;\\n#endif\\n#ifdef USE_EMISSIVEMAP\\n\tvarying vec2 vEmissiveMapUv;\\n#endif\\n#ifdef USE_METALNESSMAP\\n\tvarying vec2 vMetalnessMapUv;\\n#endif\\n#ifdef USE_ROUGHNESSMAP\\n\tvarying vec2 vRoughnessMapUv;\\n#endif\\n#ifdef USE_ANISOTROPYMAP\\n\tvarying vec2 vAnisotropyMapUv;\\n#endif\\n#ifdef USE_CLEARCOATMAP\\n\tvarying vec2 vClearcoatMapUv;\\n#endif\\n#ifdef USE_CLEARCOAT_NORMALMAP\\n\tvarying vec2 vClearcoatNormalMapUv;\\n#endif\\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\\n\tvarying vec2 vClearcoatRoughnessMapUv;\\n#endif\\n#ifdef USE_IRIDESCENCEMAP\\n\tvarying vec2 vIridescenceMapUv;\\n#endif\\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\\n\tvarying vec2 vIridescenceThicknessMapUv;\\n#endif\\n#ifdef USE_SHEEN_COLORMAP\\n\tvarying vec2 vSheenColorMapUv;\\n#endif\\n#ifdef USE_SHEEN_ROUGHNESSMAP\\n\tvarying vec2 vSheenRoughnessMapUv;\\n#endif\\n#ifdef USE_SPECULARMAP\\n\tvarying vec2 vSpecularMapUv;\\n#endif\\n#ifdef USE_SPECULAR_COLORMAP\\n\tvarying vec2 vSpecularColorMapUv;\\n#endif\\n#ifdef USE_SPECULAR_INTENSITYMAP\\n\tvarying vec2 vSpecularIntensityMapUv;\\n#endif\\n#ifdef USE_TRANSMISSIONMAP\\n\tuniform mat3 transmissionMapTransform;\\n\tvarying vec2 vTransmissionMapUv;\\n#endif\\n#ifdef USE_THICKNESSMAP\\n\tuniform mat3 thicknessMapTransform;\\n\tvarying vec2 vThicknessMapUv;\\n#endif\",\n uv_pars_vertex: \"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\\n\tvarying vec2 vUv;\\n#endif\\n#ifdef USE_MAP\\n\tuniform mat3 mapTransform;\\n\tvarying vec2 vMapUv;\\n#endif\\n#ifdef USE_ALPHAMAP\\n\tuniform mat3 alphaMapTransform;\\n\tvarying vec2 vAlphaMapUv;\\n#endif\\n#ifdef USE_LIGHTMAP\\n\tuniform mat3 lightMapTransform;\\n\tvarying vec2 vLightMapUv;\\n#endif\\n#ifdef USE_AOMAP\\n\tuniform mat3 aoMapTransform;\\n\tvarying vec2 vAoMapUv;\\n#endif\\n#ifdef USE_BUMPMAP\\n\tuniform mat3 bumpMapTransform;\\n\tvarying vec2 vBumpMapUv;\\n#endif\\n#ifdef USE_NORMALMAP\\n\tuniform mat3 normalMapTransform;\\n\tvarying vec2 vNormalMapUv;\\n#endif\\n#ifdef USE_DISPLACEMENTMAP\\n\tuniform mat3 displacementMapTransform;\\n\tvarying vec2 vDisplacementMapUv;\\n#endif\\n#ifdef USE_EMISSIVEMAP\\n\tuniform mat3 emissiveMapTransform;\\n\tvarying vec2 vEmissiveMapUv;\\n#endif\\n#ifdef USE_METALNESSMAP\\n\tuniform mat3 metalnessMapTransform;\\n\tvarying vec2 vMetalnessMapUv;\\n#endif\\n#ifdef USE_ROUGHNESSMAP\\n\tuniform mat3 roughnessMapTransform;\\n\tvarying vec2 vRoughnessMapUv;\\n#endif\\n#ifdef USE_ANISOTROPYMAP\\n\tuniform mat3 anisotropyMapTransform;\\n\tvarying vec2 vAnisotropyMapUv;\\n#endif\\n#ifdef USE_CLEARCOATMAP\\n\tuniform mat3 clearcoatMapTransform;\\n\tvarying vec2 vClearcoatMapUv;\\n#endif\\n#ifdef USE_CLEARCOAT_NORMALMAP\\n\tuniform mat3 clearcoatNormalMapTransform;\\n\tvarying vec2 vClearcoatNormalMapUv;\\n#endif\\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\\n\tuniform mat3 clearcoatRoughnessMapTransform;\\n\tvarying vec2 vClearcoatRoughnessMapUv;\\n#endif\\n#ifdef USE_SHEEN_COLORMAP\\n\tuniform mat3 sheenColorMapTransform;\\n\tvarying vec2 vSheenColorMapUv;\\n#endif\\n#ifdef USE_SHEEN_ROUGHNESSMAP\\n\tuniform mat3 sheenRoughnessMapTransform;\\n\tvarying vec2 vSheenRoughnessMapUv;\\n#endif\\n#ifdef USE_IRIDESCENCEMAP\\n\tuniform mat3 iridescenceMapTransform;\\n\tvarying vec2 vIridescenceMapUv;\\n#endif\\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\\n\tuniform mat3 iridescenceThicknessMapTransform;\\n\tvarying vec2 vIridescenceThicknessMapUv;\\n#endif\\n#ifdef USE_SPECULARMAP\\n\tuniform mat3 specularMapTransform;\\n\tvarying vec2 vSpecularMapUv;\\n#endif\\n#ifdef USE_SPECULAR_COLORMAP\\n\tuniform mat3 specularColorMapTransform;\\n\tvarying vec2 vSpecularColorMapUv;\\n#endif\\n#ifdef USE_SPECULAR_INTENSITYMAP\\n\tuniform mat3 specularIntensityMapTransform;\\n\tvarying vec2 vSpecularIntensityMapUv;\\n#endif\\n#ifdef USE_TRANSMISSIONMAP\\n\tuniform mat3 transmissionMapTransform;\\n\tvarying vec2 vTransmissionMapUv;\\n#endif\\n#ifdef USE_THICKNESSMAP\\n\tuniform mat3 thicknessMapTransform;\\n\tvarying vec2 vThicknessMapUv;\\n#endif\",\n uv_vertex: \"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\\n\tvUv = vec3( uv, 1 ).xy;\\n#endif\\n#ifdef USE_MAP\\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_ALPHAMAP\\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_LIGHTMAP\\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_AOMAP\\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_BUMPMAP\\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_NORMALMAP\\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_DISPLACEMENTMAP\\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_EMISSIVEMAP\\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_METALNESSMAP\\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_ROUGHNESSMAP\\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_ANISOTROPYMAP\\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_CLEARCOATMAP\\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_CLEARCOAT_NORMALMAP\\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_IRIDESCENCEMAP\\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_SHEEN_COLORMAP\\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_SHEEN_ROUGHNESSMAP\\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_SPECULARMAP\\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_SPECULAR_COLORMAP\\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_SPECULAR_INTENSITYMAP\\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_TRANSMISSIONMAP\\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_THICKNESSMAP\\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\\n#endif\",\n worldpos_vertex: \"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\\n\tvec4 worldPosition = vec4( transformed, 1.0 );\\n\t#ifdef USE_BATCHING\\n\t\tworldPosition = batchingMatrix * worldPosition;\\n\t#endif\\n\t#ifdef USE_INSTANCING\\n\t\tworldPosition = instanceMatrix * worldPosition;\\n\t#endif\\n\tworldPosition = modelMatrix * worldPosition;\\n#endif\",\n background_vert: \"varying vec2 vUv;\\nuniform mat3 uvTransform;\\nvoid main() {\\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\\n}\",\n background_frag: \"uniform sampler2D t2D;\\nuniform float backgroundIntensity;\\nvarying vec2 vUv;\\nvoid main() {\\n\tvec4 texColor = texture2D( t2D, vUv );\\n\t#ifdef DECODE_VIDEO_TEXTURE\\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\\n\t#endif\\n\ttexColor.rgb *= backgroundIntensity;\\n\tgl_FragColor = texColor;\\n\t#include <tonemapping_fragment>\\n\t#include <colorspace_fragment>\\n}\",\n backgroundCube_vert: \"varying vec3 vWorldDirection;\\n#include <common>\\nvoid main() {\\n\tvWorldDirection = transformDirection( position, modelMatrix );\\n\t#include <begin_vertex>\\n\t#include <project_vertex>\\n\tgl_Position.z = gl_Position.w;\\n}\",\n backgroundCube_frag: \"#ifdef ENVMAP_TYPE_CUBE\\n\tuniform samplerCube envMap;\\n#elif defined( ENVMAP_TYPE_CUBE_UV )\\n\tuniform sampler2D envMap;\\n#endif\\nuniform float backgroundBlurriness;\\nuniform float backgroundIntensity;\\nuniform mat3 backgroundRotation;\\nvarying vec3 vWorldDirection;\\n#include <cube_uv_reflection_fragment>\\nvoid main() {\\n\t#ifdef ENVMAP_TYPE_CUBE\\n\t\tvec4 texColor = textureCube( envMap, backgroundRotation * vWorldDirection );\\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\\n\t\tvec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );\\n\t#else\\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\\n\t#endif\\n\ttexColor.rgb *= backgroundIntensity;\\n\tgl_FragColor = texColor;\\n\t#include <tonemapping_fragment>\\n\t#include <colorspace_fragment>\\n}\",\n cube_vert: \"varying vec3 vWorldDirection;\\n#include <common>\\nvoid main() {\\n\tvWorldDirection = transformDirection( position, modelMatrix );\\n\t#include <begin_vertex>\\n\t#include <project_vertex>\\n\tgl_Position.z = gl_Position.w;\\n}\",\n cube_frag: \"uniform samplerCube tCube;\\nuniform float tFlip;\\nuniform float opacity;\\nvarying vec3 vWorldDirection;\\nvoid main() {\\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\\n\tgl_FragColor = texColor;\\n\tgl_FragColor.a *= opacity;\\n\t#include <tonemapping_fragment>\\n\t#include <colorspace_fragment>\\n}\",\n depth_vert: \"#include <common>\\n#include <batching_pars_vertex>\\n#include <uv_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvarying vec2 vHighPrecisionZW;\\nvoid main() {\\n\t#include <uv_vertex>\\n\t#include <batching_vertex>\\n\t#include <skinbase_vertex>\\n\t#include <morphinstance_vertex>\\n\t#ifdef USE_DISPLACEMENTMAP\\n\t\t#include <beginnormal_vertex>\\n\t\t#include <morphnormal_vertex>\\n\t\t#include <skinnormal_vertex>\\n\t#endif\\n\t#include <begin_vertex>\\n\t#include <morphtarget_vertex>\\n\t#include <skinning_vertex>\\n\t#include <displacementmap_vertex>\\n\t#include <project_vertex>\\n\t#include <logdepthbuf_vertex>\\n\t#include <clipping_planes_vertex>\\n\tvHighPrecisionZW = gl_Position.zw;\\n}\",\n depth_frag: \"#if DEPTH_PACKING == 3200\\n\tuniform float opacity;\\n#endif\\n#include <common>\\n#include <packing>\\n#include <uv_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <alphahash_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvarying vec2 vHighPrecisionZW;\\nvoid main() {\\n\tvec4 diffuseColor = vec4( 1.0 );\\n\t#include <clipping_planes_fragment>\\n\t#if DEPTH_PACKING == 3200\\n\t\tdiffuseColor.a = opacity;\\n\t#endif\\n\t#include <map_fragment>\\n\t#include <alphamap_fragment>\\n\t#include <alphatest_fragment>\\n\t#include <alphahash_fragment>\\n\t#include <logdepthbuf_fragment>\\n\t#ifdef USE_REVERSED_DEPTH_BUFFER\\n\t\tfloat fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ];\\n\t#else\\n\t\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5;\\n\t#endif\\n\t#if DEPTH_PACKING == 3200\\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\\n\t#elif DEPTH_PACKING == 3201\\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\\n\t#elif DEPTH_PACKING == 3202\\n\t\tgl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );\\n\t#elif DEPTH_PACKING == 3203\\n\t\tgl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );\\n\t#endif\\n}\",\n distance_vert: \"#define DISTANCE\\nvarying vec3 vWorldPosition;\\n#include <common>\\n#include <batching_pars_vertex>\\n#include <uv_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\t#include <uv_vertex>\\n\t#include <batching_vertex>\\n\t#include <skinbase_vertex>\\n\t#include <morphinstance_vertex>\\n\t#ifdef USE_DISPLACEMENTMAP\\n\t\t#include <beginnormal_vertex>\\n\t\t#include <morphnormal_vertex>\\n\t\t#include <skinnormal_vertex>\\n\t#endif\\n\t#include <begin_vertex>\\n\t#include <morphtarget_vertex>\\n\t#include <skinning_vertex>\\n\t#include <displacementmap_vertex>\\n\t#include <project_vertex>\\n\t#include <worldpos_vertex>\\n\t#include <clipping_planes_vertex>\\n\tvWorldPosition = worldPosition.xyz;\\n}\",\n distance_frag: \"#define DISTANCE\\nuniform vec3 referencePosition;\\nuniform float nearDistance;\\nuniform float farDistance;\\nvarying vec3 vWorldPosition;\\n#include <common>\\n#include <uv_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <alphahash_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\tvec4 diffuseColor = vec4( 1.0 );\\n\t#include <clipping_planes_fragment>\\n\t#include <map_fragment>\\n\t#include <alphamap_fragment>\\n\t#include <alphatest_fragment>\\n\t#include <alphahash_fragment>\\n\tfloat dist = length( vWorldPosition - referencePosition );\\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\\n\tdist = saturate( dist );\\n\tgl_FragColor = vec4( dist, 0.0, 0.0, 1.0 );\\n}\",\n equirect_vert: \"varying vec3 vWorldDirection;\\n#include <common>\\nvoid main() {\\n\tvWorldDirection = transformDirection( position, modelMatrix );\\n\t#include <begin_vertex>\\n\t#include <project_vertex>\\n}\",\n equirect_frag: \"uniform sampler2D tEquirect;\\nvarying vec3 vWorldDirection;\\n#include <common>\\nvoid main() {\\n\tvec3 direction = normalize( vWorldDirection );\\n\tvec2 sampleUV = equirectUv( direction );\\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\\n\t#include <tonemapping_fragment>\\n\t#include <colorspace_fragment>\\n}\",\n linedashed_vert: \"uniform float scale;\\nattribute float lineDistance;\\nvarying float vLineDistance;\\n#include <common>\\n#include <uv_pars_vertex>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\tvLineDistance = scale * lineDistance;\\n\t#include <uv_vertex>\\n\t#include <color_vertex>\\n\t#include <morphinstance_vertex>\\n\t#include <morphcolor_vertex>\\n\t#include <begin_vertex>\\n\t#include <morphtarget_vertex>\\n\t#include <project_vertex>\\n\t#include <logdepthbuf_vertex>\\n\t#include <clipping_planes_vertex>\\n\t#include <fog_vertex>\\n}\",\n linedashed_frag: \"uniform vec3 diffuse;\\nuniform float opacity;\\nuniform float dashSize;\\nuniform float totalSize;\\nvarying float vLineDistance;\\n#include <common>\\n#include <color_pars_fragment>\\n#include <uv_pars_fragment>\\n#include <map_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\t#include <clipping_planes_fragment>\\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\\n\t\tdiscard;\\n\t}\\n\tvec3 outgoingLight = vec3( 0.0 );\\n\t#include <logdepthbuf_fragment>\\n\t#include <map_fragment>\\n\t#include <color_fragment>\\n\toutgoingLight = diffuseColor.rgb;\\n\t#include <opaque_fragment>\\n\t#include <tonemapping_fragment>\\n\t#include <colorspace_fragment>\\n\t#include <fog_fragment>\\n\t#include <premultiplied_alpha_fragment>\\n}\",\n meshbasic_vert: \"#include <common>\\n#include <batching_pars_vertex>\\n#include <uv_pars_vertex>\\n#include <envmap_pars_vertex>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\t#include <uv_vertex>\\n\t#include <color_vertex>\\n\t#include <morphinstance_vertex>\\n\t#include <morphcolor_vertex>\\n\t#include <batching_vertex>\\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\\n\t\t#include <beginnormal_vertex>\\n\t\t#include <morphnormal_vertex>\\n\t\t#include <skinbase_vertex>\\n\t\t#include <skinnormal_vertex>\\n\t\t#include <defaultnormal_vertex>\\n\t#endif\\n\t#include <begin_vertex>\\n\t#include <morphtarget_vertex>\\n\t#include <skinning_vertex>\\n\t#include <project_vertex>\\n\t#include <logdepthbuf_vertex>\\n\t#include <clipping_planes_vertex>\\n\t#include <worldpos_vertex>\\n\t#include <envmap_vertex>\\n\t#include <fog_vertex>\\n}\",\n meshbasic_frag: \"uniform vec3 diffuse;\\nuniform float opacity;\\n#ifndef FLAT_SHADED\\n\tvarying vec3 vNormal;\\n#endif\\n#include <common>\\n#include <dithering_pars_fragment>\\n#include <color_pars_fragment>\\n#include <uv_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <alphahash_pars_fragment>\\n#include <aomap_pars_fragment>\\n#include <lightmap_pars_fragment>\\n#include <envmap_common_pars_fragment>\\n#include <envmap_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <specularmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\t#include <clipping_planes_fragment>\\n\t#include <logdepthbuf_fragment>\\n\t#include <map_fragment>\\n\t#include <color_fragment>\\n\t#include <alphamap_fragment>\\n\t#include <alphatest_fragment>\\n\t#include <alphahash_fragment>\\n\t#include <specularmap_fragment>\\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\t#ifdef USE_LIGHTMAP\\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\\n\t#else\\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\\n\t#endif\\n\t#include <aomap_fragment>\\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\\n\t#include <envmap_fragment>\\n\t#include <opaque_fragment>\\n\t#include <tonemapping_fragment>\\n\t#include <colorspace_fragment>\\n\t#include <fog_fragment>\\n\t#include <premultiplied_alpha_fragment>\\n\t#include <dithering_fragment>\\n}\",\n meshlambert_vert: \"#define LAMBERT\\nvarying vec3 vViewPosition;\\n#include <common>\\n#include <batching_pars_vertex>\\n#include <uv_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <envmap_pars_vertex>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <normal_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <shadowmap_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\t#include <uv_vertex>\\n\t#include <color_vertex>\\n\t#include <morphinstance_vertex>\\n\t#include <morphcolor_vertex>\\n\t#include <batching_vertex>\\n\t#include <beginnormal_vertex>\\n\t#include <morphnormal_vertex>\\n\t#include <skinbase_vertex>\\n\t#include <skinnormal_vertex>\\n\t#include <defaultnormal_vertex>\\n\t#include <normal_vertex>\\n\t#include <begin_vertex>\\n\t#include <morphtarget_vertex>\\n\t#include <skinning_vertex>\\n\t#include <displacementmap_vertex>\\n\t#include <project_vertex>\\n\t#include <logdepthbuf_vertex>\\n\t#include <clipping_planes_vertex>\\n\tvViewPosition = - mvPosition.xyz;\\n\t#include <worldpos_vertex>\\n\t#include <envmap_vertex>\\n\t#include <shadowmap_vertex>\\n\t#include <fog_vertex>\\n}\",\n meshlambert_frag: \"#define LAMBERT\\nuniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform float opacity;\\n#include <common>\\n#include <dithering_pars_fragment>\\n#include <color_pars_fragment>\\n#include <uv_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <alphahash_pars_fragment>\\n#include <aomap_pars_fragment>\\n#include <lightmap_pars_fragment>\\n#include <emissivemap_pars_fragment>\\n#include <cube_uv_reflection_fragment>\\n#include <envmap_common_pars_fragment>\\n#include <envmap_pars_fragment>\\n#include <envmap_physical_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <bsdfs>\\n#include <lights_pars_begin>\\n#include <normal_pars_fragment>\\n#include <lights_lambert_pars_fragment>\\n#include <shadowmap_pars_fragment>\\n#include <bumpmap_pars_fragment>\\n#include <normalmap_pars_fragment>\\n#include <specularmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\t#include <clipping_planes_fragment>\\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\tvec3 totalEmissiveRadiance = emissive;\\n\t#include <logdepthbuf_fragment>\\n\t#include <map_fragment>\\n\t#include <color_fragment>\\n\t#include <alphamap_fragment>\\n\t#include <alphatest_fragment>\\n\t#include <alphahash_fragment>\\n\t#include <specularmap_fragment>\\n\t#include <normal_fragment_begin>\\n\t#include <normal_fragment_maps>\\n\t#include <emissivemap_fragment>\\n\t#include <lights_lambert_fragment>\\n\t#include <lights_fragment_begin>\\n\t#include <lights_fragment_maps>\\n\t#include <lights_fragment_end>\\n\t#include <aomap_fragment>\\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\\n\t#include <envmap_fragment>\\n\t#include <opaque_fragment>\\n\t#include <tonemapping_fragment>\\n\t#include <colorspace_fragment>\\n\t#include <fog_fragment>\\n\t#include <premultiplied_alpha_fragment>\\n\t#include <dithering_fragment>\\n}\",\n meshmatcap_vert: \"#define MATCAP\\nvarying vec3 vViewPosition;\\n#include <common>\\n#include <batching_pars_vertex>\\n#include <uv_pars_vertex>\\n#include <color_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <normal_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\t#include <uv_vertex>\\n\t#include <color_vertex>\\n\t#include <morphinstance_vertex>\\n\t#include <morphcolor_vertex>\\n\t#include <batching_vertex>\\n\t#include <beginnormal_vertex>\\n\t#include <morphnormal_vertex>\\n\t#include <skinbase_vertex>\\n\t#include <skinnormal_vertex>\\n\t#include <defaultnormal_vertex>\\n\t#include <normal_vertex>\\n\t#include <begin_vertex>\\n\t#include <morphtarget_vertex>\\n\t#include <skinning_vertex>\\n\t#include <displacementmap_vertex>\\n\t#include <project_vertex>\\n\t#include <logdepthbuf_vertex>\\n\t#include <clipping_planes_vertex>\\n\t#include <fog_vertex>\\n\tvViewPosition = - mvPosition.xyz;\\n}\",\n meshmatcap_frag: \"#define MATCAP\\nuniform vec3 diffuse;\\nuniform float opacity;\\nuniform sampler2D matcap;\\nvarying vec3 vViewPosition;\\n#include <common>\\n#include <dithering_pars_fragment>\\n#include <color_pars_fragment>\\n#include <uv_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <alphahash_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <normal_pars_fragment>\\n#include <bumpmap_pars_fragment>\\n#include <normalmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\t#include <clipping_planes_fragment>\\n\t#include <logdepthbuf_fragment>\\n\t#include <map_fragment>\\n\t#include <color_fragment>\\n\t#include <alphamap_fragment>\\n\t#include <alphatest_fragment>\\n\t#include <alphahash_fragment>\\n\t#include <normal_fragment_begin>\\n\t#include <normal_fragment_maps>\\n\tvec3 viewDir = normalize( vViewPosition );\\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\\n\tvec3 y = cross( viewDir, x );\\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\\n\t#ifdef USE_MATCAP\\n\t\tvec4 matcapColor = texture2D( matcap, uv );\\n\t#else\\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\\n\t#endif\\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\\n\t#include <opaque_fragment>\\n\t#include <tonemapping_fragment>\\n\t#include <colorspace_fragment>\\n\t#include <fog_fragment>\\n\t#include <premultiplied_alpha_fragment>\\n\t#include <dithering_fragment>\\n}\",\n meshnormal_vert: \"#define NORMAL\\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\\n\tvarying vec3 vViewPosition;\\n#endif\\n#include <common>\\n#include <batching_pars_vertex>\\n#include <uv_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <normal_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\t#include <uv_vertex>\\n\t#include <batching_vertex>\\n\t#include <beginnormal_vertex>\\n\t#include <morphinstance_vertex>\\n\t#include <morphnormal_vertex>\\n\t#include <skinbase_vertex>\\n\t#include <skinnormal_vertex>\\n\t#include <defaultnormal_vertex>\\n\t#include <normal_vertex>\\n\t#include <begin_vertex>\\n\t#include <morphtarget_vertex>\\n\t#include <skinning_vertex>\\n\t#include <displacementmap_vertex>\\n\t#include <project_vertex>\\n\t#include <logdepthbuf_vertex>\\n\t#include <clipping_planes_vertex>\\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\\n\tvViewPosition = - mvPosition.xyz;\\n#endif\\n}\",\n meshnormal_frag: \"#define NORMAL\\nuniform float opacity;\\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\\n\tvarying vec3 vViewPosition;\\n#endif\\n#include <uv_pars_fragment>\\n#include <normal_pars_fragment>\\n#include <bumpmap_pars_fragment>\\n#include <normalmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\tvec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\\n\t#include <clipping_planes_fragment>\\n\t#include <logdepthbuf_fragment>\\n\t#include <normal_fragment_begin>\\n\t#include <normal_fragment_maps>\\n\tgl_FragColor = vec4( normalize( normal ) * 0.5 + 0.5, diffuseColor.a );\\n\t#ifdef OPAQUE\\n\t\tgl_FragColor.a = 1.0;\\n\t#endif\\n}\",\n meshphong_vert: \"#define PHONG\\nvarying vec3 vViewPosition;\\n#include <common>\\n#include <batching_pars_vertex>\\n#include <uv_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <envmap_pars_vertex>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <normal_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <shadowmap_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\t#include <uv_vertex>\\n\t#include <color_vertex>\\n\t#include <morphcolor_vertex>\\n\t#include <batching_vertex>\\n\t#include <beginnormal_vertex>\\n\t#include <morphinstance_vertex>\\n\t#include <morphnormal_vertex>\\n\t#include <skinbase_vertex>\\n\t#include <skinnormal_vertex>\\n\t#include <defaultnormal_vertex>\\n\t#include <normal_vertex>\\n\t#include <begin_vertex>\\n\t#include <morphtarget_vertex>\\n\t#include <skinning_vertex>\\n\t#include <displacementmap_vertex>\\n\t#include <project_vertex>\\n\t#include <logdepthbuf_vertex>\\n\t#include <clipping_planes_vertex>\\n\tvViewPosition = - mvPosition.xyz;\\n\t#include <worldpos_vertex>\\n\t#include <envmap_vertex>\\n\t#include <shadowmap_vertex>\\n\t#include <fog_vertex>\\n}\",\n meshphong_frag: \"#define PHONG\\nuniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform vec3 specular;\\nuniform float shininess;\\nuniform float opacity;\\n#include <common>\\n#include <dithering_pars_fragment>\\n#include <color_pars_fragment>\\n#include <uv_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <alphahash_pars_fragment>\\n#include <aomap_pars_fragment>\\n#include <lightmap_pars_fragment>\\n#include <emissivemap_pars_fragment>\\n#include <cube_uv_reflection_fragment>\\n#include <envmap_common_pars_fragment>\\n#include <envmap_pars_fragment>\\n#include <envmap_physical_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <bsdfs>\\n#include <lights_pars_begin>\\n#include <normal_pars_fragment>\\n#include <lights_phong_pars_fragment>\\n#include <shadowmap_pars_fragment>\\n#include <bumpmap_pars_fragment>\\n#include <normalmap_pars_fragment>\\n#include <specularmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\t#include <clipping_planes_fragment>\\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\tvec3 totalEmissiveRadiance = emissive;\\n\t#include <logdepthbuf_fragment>\\n\t#include <map_fragment>\\n\t#include <color_fragment>\\n\t#include <alphamap_fragment>\\n\t#include <alphatest_fragment>\\n\t#include <alphahash_fragment>\\n\t#include <specularmap_fragment>\\n\t#include <normal_fragment_begin>\\n\t#include <normal_fragment_maps>\\n\t#include <emissivemap_fragment>\\n\t#include <lights_phong_fragment>\\n\t#include <lights_fragment_begin>\\n\t#include <lights_fragment_maps>\\n\t#include <lights_fragment_end>\\n\t#include <aomap_fragment>\\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\\n\t#include <envmap_fragment>\\n\t#include <opaque_fragment>\\n\t#include <tonemapping_fragment>\\n\t#include <colorspace_fragment>\\n\t#include <fog_fragment>\\n\t#include <premultiplied_alpha_fragment>\\n\t#include <dithering_fragment>\\n}\",\n meshphysical_vert: \"#define STANDARD\\nvarying vec3 vViewPosition;\\n#ifdef USE_TRANSMISSION\\n\tvarying vec3 vWorldPosition;\\n#endif\\n#include <common>\\n#include <batching_pars_vertex>\\n#include <uv_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <normal_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <shadowmap_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\t#include <uv_vertex>\\n\t#include <color_vertex>\\n\t#include <morphinstance_vertex>\\n\t#include <morphcolor_vertex>\\n\t#include <batching_vertex>\\n\t#include <beginnormal_vertex>\\n\t#include <morphnormal_vertex>\\n\t#include <skinbase_vertex>\\n\t#include <skinnormal_vertex>\\n\t#include <defaultnormal_vertex>\\n\t#include <normal_vertex>\\n\t#include <begin_vertex>\\n\t#include <morphtarget_vertex>\\n\t#include <skinning_vertex>\\n\t#include <displacementmap_vertex>\\n\t#include <project_vertex>\\n\t#include <logdepthbuf_vertex>\\n\t#include <clipping_planes_vertex>\\n\tvViewPosition = - mvPosition.xyz;\\n\t#include <worldpos_vertex>\\n\t#include <shadowmap_vertex>\\n\t#include <fog_vertex>\\n#ifdef USE_TRANSMISSION\\n\tvWorldPosition = worldPosition.xyz;\\n#endif\\n}\",\n meshphysical_frag: \"#define STANDARD\\n#ifdef PHYSICAL\\n\t#define IOR\\n\t#define USE_SPECULAR\\n#endif\\nuniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform float roughness;\\nuniform float metalness;\\nuniform float opacity;\\n#ifdef IOR\\n\tuniform float ior;\\n#endif\\n#ifdef USE_SPECULAR\\n\tuniform float specularIntensity;\\n\tuniform vec3 specularColor;\\n\t#ifdef USE_SPECULAR_COLORMAP\\n\t\tuniform sampler2D specularColorMap;\\n\t#endif\\n\t#ifdef USE_SPECULAR_INTENSITYMAP\\n\t\tuniform sampler2D specularIntensityMap;\\n\t#endif\\n#endif\\n#ifdef USE_CLEARCOAT\\n\tuniform float clearcoat;\\n\tuniform float clearcoatRoughness;\\n#endif\\n#ifdef USE_DISPERSION\\n\tuniform float dispersion;\\n#endif\\n#ifdef USE_IRIDESCENCE\\n\tuniform float iridescence;\\n\tuniform float iridescenceIOR;\\n\tuniform float iridescenceThicknessMinimum;\\n\tuniform float iridescenceThicknessMaximum;\\n#endif\\n#ifdef USE_SHEEN\\n\tuniform vec3 sheenColor;\\n\tuniform float sheenRoughness;\\n\t#ifdef USE_SHEEN_COLORMAP\\n\t\tuniform sampler2D sheenColorMap;\\n\t#endif\\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\\n\t\tuniform sampler2D sheenRoughnessMap;\\n\t#endif\\n#endif\\n#ifdef USE_ANISOTROPY\\n\tuniform vec2 anisotropyVector;\\n\t#ifdef USE_ANISOTROPYMAP\\n\t\tuniform sampler2D anisotropyMap;\\n\t#endif\\n#endif\\nvarying vec3 vViewPosition;\\n#include <common>\\n#include <dithering_pars_fragment>\\n#include <color_pars_fragment>\\n#include <uv_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <alphahash_pars_fragment>\\n#include <aomap_pars_fragment>\\n#include <lightmap_pars_fragment>\\n#include <emissivemap_pars_fragment>\\n#include <iridescence_fragment>\\n#include <cube_uv_reflection_fragment>\\n#include <envmap_common_pars_fragment>\\n#include <envmap_physical_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <lights_pars_begin>\\n#include <normal_pars_fragment>\\n#include <lights_physical_pars_fragment>\\n#include <transmission_pars_fragment>\\n#include <shadowmap_pars_fragment>\\n#include <bumpmap_pars_fragment>\\n#include <normalmap_pars_fragment>\\n#include <clearcoat_pars_fragment>\\n#include <iridescence_pars_fragment>\\n#include <roughnessmap_pars_fragment>\\n#include <metalnessmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\t#include <clipping_planes_fragment>\\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\tvec3 totalEmissiveRadiance = emissive;\\n\t#include <logdepthbuf_fragment>\\n\t#include <map_fragment>\\n\t#include <color_fragment>\\n\t#include <alphamap_fragment>\\n\t#include <alphatest_fragment>\\n\t#include <alphahash_fragment>\\n\t#include <roughnessmap_fragment>\\n\t#include <metalnessmap_fragment>\\n\t#include <normal_fragment_begin>\\n\t#include <normal_fragment_maps>\\n\t#include <clearcoat_normal_fragment_begin>\\n\t#include <clearcoat_normal_fragment_maps>\\n\t#include <emissivemap_fragment>\\n\t#include <lights_physical_fragment>\\n\t#include <lights_fragment_begin>\\n\t#include <lights_fragment_maps>\\n\t#include <lights_fragment_end>\\n\t#include <aomap_fragment>\\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\\n\t#include <transmission_fragment>\\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\\n\t#ifdef USE_SHEEN\\n \\n\t\toutgoingLight = outgoingLight + sheenSpecularDirect + sheenSpecularIndirect;\\n \\n \t#endif\\n\t#ifdef USE_CLEARCOAT\\n\t\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\\n\t#endif\\n\t#include <opaque_fragment>\\n\t#include <tonemapping_fragment>\\n\t#include <colorspace_fragment>\\n\t#include <fog_fragment>\\n\t#include <premultiplied_alpha_fragment>\\n\t#include <dithering_fragment>\\n}\",\n meshtoon_vert: \"#define TOON\\nvarying vec3 vViewPosition;\\n#include <common>\\n#include <batching_pars_vertex>\\n#include <uv_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <normal_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <shadowmap_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\t#include <uv_vertex>\\n\t#include <color_vertex>\\n\t#include <morphinstance_vertex>\\n\t#include <morphcolor_vertex>\\n\t#include <batching_vertex>\\n\t#include <beginnormal_vertex>\\n\t#include <morphnormal_vertex>\\n\t#include <skinbase_vertex>\\n\t#include <skinnormal_vertex>\\n\t#include <defaultnormal_vertex>\\n\t#include <normal_vertex>\\n\t#include <begin_vertex>\\n\t#include <morphtarget_vertex>\\n\t#include <skinning_vertex>\\n\t#include <displacementmap_vertex>\\n\t#include <project_vertex>\\n\t#include <logdepthbuf_vertex>\\n\t#include <clipping_planes_vertex>\\n\tvViewPosition = - mvPosition.xyz;\\n\t#include <worldpos_vertex>\\n\t#include <shadowmap_vertex>\\n\t#include <fog_vertex>\\n}\",\n meshtoon_frag: \"#define TOON\\nuniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform float opacity;\\n#include <common>\\n#include <dithering_pars_fragment>\\n#include <color_pars_fragment>\\n#include <uv_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <alphahash_pars_fragment>\\n#include <aomap_pars_fragment>\\n#include <lightmap_pars_fragment>\\n#include <emissivemap_pars_fragment>\\n#include <gradientmap_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <bsdfs>\\n#include <lights_pars_begin>\\n#include <normal_pars_fragment>\\n#include <lights_toon_pars_fragment>\\n#include <shadowmap_pars_fragment>\\n#include <bumpmap_pars_fragment>\\n#include <normalmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\t#include <clipping_planes_fragment>\\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\tvec3 totalEmissiveRadiance = emissive;\\n\t#include <logdepthbuf_fragment>\\n\t#include <map_fragment>\\n\t#include <color_fragment>\\n\t#include <alphamap_fragment>\\n\t#include <alphatest_fragment>\\n\t#include <alphahash_fragment>\\n\t#include <normal_fragment_begin>\\n\t#include <normal_fragment_maps>\\n\t#include <emissivemap_fragment>\\n\t#include <lights_toon_fragment>\\n\t#include <lights_fragment_begin>\\n\t#include <lights_fragment_maps>\\n\t#include <lights_fragment_end>\\n\t#include <aomap_fragment>\\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\\n\t#include <opaque_fragment>\\n\t#include <tonemapping_fragment>\\n\t#include <colorspace_fragment>\\n\t#include <fog_fragment>\\n\t#include <premultiplied_alpha_fragment>\\n\t#include <dithering_fragment>\\n}\",\n points_vert: \"uniform float size;\\nuniform float scale;\\n#include <common>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\n#ifdef USE_POINTS_UV\\n\tvarying vec2 vUv;\\n\tuniform mat3 uvTransform;\\n#endif\\nvoid main() {\\n\t#ifdef USE_POINTS_UV\\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\\n\t#endif\\n\t#include <color_vertex>\\n\t#include <morphinstance_vertex>\\n\t#include <morphcolor_vertex>\\n\t#include <begin_vertex>\\n\t#include <morphtarget_vertex>\\n\t#include <project_vertex>\\n\tgl_PointSize = size;\\n\t#ifdef USE_SIZEATTENUATION\\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\\n\t#endif\\n\t#include <logdepthbuf_vertex>\\n\t#include <clipping_planes_vertex>\\n\t#include <worldpos_vertex>\\n\t#include <fog_vertex>\\n}\",\n points_frag: \"uniform vec3 diffuse;\\nuniform float opacity;\\n#include <common>\\n#include <color_pars_fragment>\\n#include <map_particle_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <alphahash_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\t#include <clipping_planes_fragment>\\n\tvec3 outgoingLight = vec3( 0.0 );\\n\t#include <logdepthbuf_fragment>\\n\t#include <map_particle_fragment>\\n\t#include <color_fragment>\\n\t#include <alphatest_fragment>\\n\t#include <alphahash_fragment>\\n\toutgoingLight = diffuseColor.rgb;\\n\t#include <opaque_fragment>\\n\t#include <tonemapping_fragment>\\n\t#include <colorspace_fragment>\\n\t#include <fog_fragment>\\n\t#include <premultiplied_alpha_fragment>\\n}\",\n shadow_vert: \"#include <common>\\n#include <batching_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <shadowmap_pars_vertex>\\nvoid main() {\\n\t#include <batching_vertex>\\n\t#include <beginnormal_vertex>\\n\t#include <morphinstance_vertex>\\n\t#include <morphnormal_vertex>\\n\t#include <skinbase_vertex>\\n\t#include <skinnormal_vertex>\\n\t#include <defaultnormal_vertex>\\n\t#include <begin_vertex>\\n\t#include <morphtarget_vertex>\\n\t#include <skinning_vertex>\\n\t#include <project_vertex>\\n\t#include <logdepthbuf_vertex>\\n\t#include <worldpos_vertex>\\n\t#include <shadowmap_vertex>\\n\t#include <fog_vertex>\\n}\",\n shadow_frag: \"uniform vec3 color;\\nuniform float opacity;\\n#include <common>\\n#include <fog_pars_fragment>\\n#include <bsdfs>\\n#include <lights_pars_begin>\\n#include <logdepthbuf_pars_fragment>\\n#include <shadowmap_pars_fragment>\\n#include <shadowmask_pars_fragment>\\nvoid main() {\\n\t#include <logdepthbuf_fragment>\\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\\n\t#include <tonemapping_fragment>\\n\t#include <colorspace_fragment>\\n\t#include <fog_fragment>\\n\t#include <premultiplied_alpha_fragment>\\n}\",\n sprite_vert: \"uniform float rotation;\\nuniform vec2 center;\\n#include <common>\\n#include <uv_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\t#include <uv_vertex>\\n\tvec4 mvPosition = modelViewMatrix[ 3 ];\\n\tvec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) );\\n\t#ifndef USE_SIZEATTENUATION\\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\\n\t#endif\\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\\n\tvec2 rotatedPosition;\\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\\n\tmvPosition.xy += rotatedPosition;\\n\tgl_Position = projectionMatrix * mvPosition;\\n\t#include <logdepthbuf_vertex>\\n\t#include <clipping_planes_vertex>\\n\t#include <fog_vertex>\\n}\",\n sprite_frag: \"uniform vec3 diffuse;\\nuniform float opacity;\\n#include <common>\\n#include <uv_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <alphahash_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\t#include <clipping_planes_fragment>\\n\tvec3 outgoingLight = vec3( 0.0 );\\n\t#include <logdepthbuf_fragment>\\n\t#include <map_fragment>\\n\t#include <alphamap_fragment>\\n\t#include <alphatest_fragment>\\n\t#include <alphahash_fragment>\\n\toutgoingLight = diffuseColor.rgb;\\n\t#include <opaque_fragment>\\n\t#include <tonemapping_fragment>\\n\t#include <colorspace_fragment>\\n\t#include <fog_fragment>\\n}\"\n };\n var Gn2 = {\n common: {\n diffuse: { value: new Pr(16777215) },\n opacity: { value: 1 },\n map: { value: null },\n mapTransform: { value: new Ii() },\n alphaMap: { value: null },\n alphaMapTransform: { value: new Ii() },\n alphaTest: { value: 0 }\n },\n specularmap: { specularMap: { value: null }, specularMapTransform: { value: new Ii() } },\n envmap: {\n envMap: { value: null },\n envMapRotation: { value: new Ii() },\n reflectivity: { value: 1 },\n ior: { value: 1.5 },\n refractionRatio: { value: 0.98 },\n dfgLUT: { value: null }\n },\n aomap: {\n aoMap: { value: null },\n aoMapIntensity: { value: 1 },\n aoMapTransform: { value: new Ii() }\n },\n lightmap: {\n lightMap: { value: null },\n lightMapIntensity: { value: 1 },\n lightMapTransform: { value: new Ii() }\n },\n bumpmap: {\n bumpMap: { value: null },\n bumpMapTransform: { value: new Ii() },\n bumpScale: { value: 1 }\n },\n normalmap: {\n normalMap: { value: null },\n normalMapTransform: { value: new Ii() },\n normalScale: { value: new _i(1, 1) }\n },\n displacementmap: {\n displacementMap: { value: null },\n displacementMapTransform: { value: new Ii() },\n displacementScale: { value: 1 },\n displacementBias: { value: 0 }\n },\n emissivemap: { emissiveMap: { value: null }, emissiveMapTransform: { value: new Ii() } },\n metalnessmap: { metalnessMap: { value: null }, metalnessMapTransform: { value: new Ii() } },\n roughnessmap: { roughnessMap: { value: null }, roughnessMapTransform: { value: new Ii() } },\n gradientmap: { gradientMap: { value: null } },\n fog: {\n fogDensity: { value: 25e-5 },\n fogNear: { value: 1 },\n fogFar: { value: 2e3 },\n fogColor: { value: new Pr(16777215) }\n },\n lights: {\n ambientLightColor: { value: [] },\n lightProbe: { value: [] },\n directionalLights: { value: [], properties: { direction: {}, color: {} } },\n directionalLightShadows: {\n value: [],\n properties: {\n shadowIntensity: 1,\n shadowBias: {},\n shadowNormalBias: {},\n shadowRadius: {},\n shadowMapSize: {}\n }\n },\n directionalShadowMatrix: { value: [] },\n spotLights: {\n value: [],\n properties: {\n color: {},\n position: {},\n direction: {},\n distance: {},\n coneCos: {},\n penumbraCos: {},\n decay: {}\n }\n },\n spotLightShadows: {\n value: [],\n properties: {\n shadowIntensity: 1,\n shadowBias: {},\n shadowNormalBias: {},\n shadowRadius: {},\n shadowMapSize: {}\n }\n },\n spotLightMap: { value: [] },\n spotLightMatrix: { value: [] },\n pointLights: { value: [], properties: { color: {}, position: {}, decay: {}, distance: {} } },\n pointLightShadows: {\n value: [],\n properties: {\n shadowIntensity: 1,\n shadowBias: {},\n shadowNormalBias: {},\n shadowRadius: {},\n shadowMapSize: {},\n shadowCameraNear: {},\n shadowCameraFar: {}\n }\n },\n pointShadowMatrix: { value: [] },\n hemisphereLights: { value: [], properties: { direction: {}, skyColor: {}, groundColor: {} } },\n rectAreaLights: { value: [], properties: { color: {}, position: {}, width: {}, height: {} } },\n ltc_1: { value: null },\n ltc_2: { value: null },\n probesSH: { value: null },\n probesMin: { value: new Ti() },\n probesMax: { value: new Ti() },\n probesResolution: { value: new Ti() }\n },\n points: {\n diffuse: { value: new Pr(16777215) },\n opacity: { value: 1 },\n size: { value: 1 },\n scale: { value: 1 },\n map: { value: null },\n alphaMap: { value: null },\n alphaMapTransform: { value: new Ii() },\n alphaTest: { value: 0 },\n uvTransform: { value: new Ii() }\n },\n sprite: {\n diffuse: { value: new Pr(16777215) },\n opacity: { value: 1 },\n center: { value: new _i(0.5, 0.5) },\n rotation: { value: 0 },\n map: { value: null },\n mapTransform: { value: new Ii() },\n alphaMap: { value: null },\n alphaMapTransform: { value: new Ii() },\n alphaTest: { value: 0 }\n }\n };\n var Hn2 = {\n basic: {\n uniforms: ql([Gn2.common, Gn2.specularmap, Gn2.envmap, Gn2.aomap, Gn2.lightmap, Gn2.fog]),\n vertexShader: Bn2.meshbasic_vert,\n fragmentShader: Bn2.meshbasic_frag\n },\n lambert: {\n uniforms: ql([\n Gn2.common,\n Gn2.specularmap,\n Gn2.envmap,\n Gn2.aomap,\n Gn2.lightmap,\n Gn2.emissivemap,\n Gn2.bumpmap,\n Gn2.normalmap,\n Gn2.displacementmap,\n Gn2.fog,\n Gn2.lights,\n { emissive: { value: new Pr(0) }, envMapIntensity: { value: 1 } }\n ]),\n vertexShader: Bn2.meshlambert_vert,\n fragmentShader: Bn2.meshlambert_frag\n },\n phong: {\n uniforms: ql([\n Gn2.common,\n Gn2.specularmap,\n Gn2.envmap,\n Gn2.aomap,\n Gn2.lightmap,\n Gn2.emissivemap,\n Gn2.bumpmap,\n Gn2.normalmap,\n Gn2.displacementmap,\n Gn2.fog,\n Gn2.lights,\n {\n emissive: { value: new Pr(0) },\n specular: { value: new Pr(1118481) },\n shininess: { value: 30 },\n envMapIntensity: { value: 1 }\n }\n ]),\n vertexShader: Bn2.meshphong_vert,\n fragmentShader: Bn2.meshphong_frag\n },\n standard: {\n uniforms: ql([\n Gn2.common,\n Gn2.envmap,\n Gn2.aomap,\n Gn2.lightmap,\n Gn2.emissivemap,\n Gn2.bumpmap,\n Gn2.normalmap,\n Gn2.displacementmap,\n Gn2.roughnessmap,\n Gn2.metalnessmap,\n Gn2.fog,\n Gn2.lights,\n {\n emissive: { value: new Pr(0) },\n roughness: { value: 1 },\n metalness: { value: 0 },\n envMapIntensity: { value: 1 }\n }\n ]),\n vertexShader: Bn2.meshphysical_vert,\n fragmentShader: Bn2.meshphysical_frag\n },\n toon: {\n uniforms: ql([\n Gn2.common,\n Gn2.aomap,\n Gn2.lightmap,\n Gn2.emissivemap,\n Gn2.bumpmap,\n Gn2.normalmap,\n Gn2.displacementmap,\n Gn2.gradientmap,\n Gn2.fog,\n Gn2.lights,\n { emissive: { value: new Pr(0) } }\n ]),\n vertexShader: Bn2.meshtoon_vert,\n fragmentShader: Bn2.meshtoon_frag\n },\n matcap: {\n uniforms: ql([\n Gn2.common,\n Gn2.bumpmap,\n Gn2.normalmap,\n Gn2.displacementmap,\n Gn2.fog,\n { matcap: { value: null } }\n ]),\n vertexShader: Bn2.meshmatcap_vert,\n fragmentShader: Bn2.meshmatcap_frag\n },\n points: {\n uniforms: ql([Gn2.points, Gn2.fog]),\n vertexShader: Bn2.points_vert,\n fragmentShader: Bn2.points_frag\n },\n dashed: {\n uniforms: ql([\n Gn2.common,\n Gn2.fog,\n { scale: { value: 1 }, dashSize: { value: 1 }, totalSize: { value: 2 } }\n ]),\n vertexShader: Bn2.linedashed_vert,\n fragmentShader: Bn2.linedashed_frag\n },\n depth: {\n uniforms: ql([Gn2.common, Gn2.displacementmap]),\n vertexShader: Bn2.depth_vert,\n fragmentShader: Bn2.depth_frag\n },\n normal: {\n uniforms: ql([\n Gn2.common,\n Gn2.bumpmap,\n Gn2.normalmap,\n Gn2.displacementmap,\n { opacity: { value: 1 } }\n ]),\n vertexShader: Bn2.meshnormal_vert,\n fragmentShader: Bn2.meshnormal_frag\n },\n sprite: {\n uniforms: ql([Gn2.sprite, Gn2.fog]),\n vertexShader: Bn2.sprite_vert,\n fragmentShader: Bn2.sprite_frag\n },\n background: {\n uniforms: {\n uvTransform: { value: new Ii() },\n t2D: { value: null },\n backgroundIntensity: { value: 1 }\n },\n vertexShader: Bn2.background_vert,\n fragmentShader: Bn2.background_frag\n },\n backgroundCube: {\n uniforms: {\n envMap: { value: null },\n backgroundBlurriness: { value: 0 },\n backgroundIntensity: { value: 1 },\n backgroundRotation: { value: new Ii() }\n },\n vertexShader: Bn2.backgroundCube_vert,\n fragmentShader: Bn2.backgroundCube_frag\n },\n cube: {\n uniforms: { tCube: { value: null }, tFlip: { value: -1 }, opacity: { value: 1 } },\n vertexShader: Bn2.cube_vert,\n fragmentShader: Bn2.cube_frag\n },\n equirect: {\n uniforms: { tEquirect: { value: null } },\n vertexShader: Bn2.equirect_vert,\n fragmentShader: Bn2.equirect_frag\n },\n distance: {\n uniforms: ql([\n Gn2.common,\n Gn2.displacementmap,\n {\n referencePosition: { value: new Ti() },\n nearDistance: { value: 1 },\n farDistance: { value: 1e3 }\n }\n ]),\n vertexShader: Bn2.distance_vert,\n fragmentShader: Bn2.distance_frag\n },\n shadow: {\n uniforms: ql([Gn2.lights, Gn2.fog, { color: { value: new Pr(0) }, opacity: { value: 1 } }]),\n vertexShader: Bn2.shadow_vert,\n fragmentShader: Bn2.shadow_frag\n }\n };\n Hn2.physical = {\n uniforms: ql([\n Hn2.standard.uniforms,\n {\n clearcoat: { value: 0 },\n clearcoatMap: { value: null },\n clearcoatMapTransform: { value: new Ii() },\n clearcoatNormalMap: { value: null },\n clearcoatNormalMapTransform: { value: new Ii() },\n clearcoatNormalScale: { value: new _i(1, 1) },\n clearcoatRoughness: { value: 0 },\n clearcoatRoughnessMap: { value: null },\n clearcoatRoughnessMapTransform: { value: new Ii() },\n dispersion: { value: 0 },\n iridescence: { value: 0 },\n iridescenceMap: { value: null },\n iridescenceMapTransform: { value: new Ii() },\n iridescenceIOR: { value: 1.3 },\n iridescenceThicknessMinimum: { value: 100 },\n iridescenceThicknessMaximum: { value: 400 },\n iridescenceThicknessMap: { value: null },\n iridescenceThicknessMapTransform: { value: new Ii() },\n sheen: { value: 0 },\n sheenColor: { value: new Pr(0) },\n sheenColorMap: { value: null },\n sheenColorMapTransform: { value: new Ii() },\n sheenRoughness: { value: 1 },\n sheenRoughnessMap: { value: null },\n sheenRoughnessMapTransform: { value: new Ii() },\n transmission: { value: 0 },\n transmissionMap: { value: null },\n transmissionMapTransform: { value: new Ii() },\n transmissionSamplerSize: { value: new _i() },\n transmissionSamplerMap: { value: null },\n thickness: { value: 0 },\n thicknessMap: { value: null },\n thicknessMapTransform: { value: new Ii() },\n attenuationDistance: { value: 0 },\n attenuationColor: { value: new Pr(0) },\n specularColor: { value: new Pr(1, 1, 1) },\n specularColorMap: { value: null },\n specularColorMapTransform: { value: new Ii() },\n specularIntensity: { value: 1 },\n specularIntensityMap: { value: null },\n specularIntensityMapTransform: { value: new Ii() },\n anisotropyVector: { value: new _i() },\n anisotropyMap: { value: null },\n anisotropyMapTransform: { value: new Ii() }\n }\n ]),\n vertexShader: Bn2.meshphysical_vert,\n fragmentShader: Bn2.meshphysical_frag\n };\n var Vn2 = { r: 0, b: 0, g: 0 };\n var Wn2 = new Qi();\n var zn2 = new Ii();\n function kn2(e2, t2, i2, r2, u2, g2) {\n const v2 = new Pr(0);\n let E2, S2, M2 = true === u2 ? 0 : 1, T2 = null, x2 = 0, R2 = null;\n function A2(e3) {\n let n2 = true === e3.isScene ? e3.background : null;\n if (n2 && n2.isTexture) {\n const i3 = e3.backgroundBlurriness > 0;\n n2 = t2.get(n2, i3);\n }\n return n2;\n }\n function b2(t3, n2) {\n t3.getRGB(Vn2, Xl(e2)), i2.buffers.color.setClear(Vn2.r, Vn2.g, Vn2.b, n2, g2);\n }\n return {\n getClearColor: function() {\n return v2;\n },\n setClearColor: function(e3, t3 = 1) {\n v2.set(e3), M2 = t3, b2(v2, M2);\n },\n getClearAlpha: function() {\n return M2;\n },\n setClearAlpha: function(e3) {\n M2 = e3, b2(v2, M2);\n },\n render: function(t3) {\n let n2 = false;\n const r3 = A2(t3);\n null === r3 ? b2(v2, M2) : r3 && r3.isColor && (b2(r3, 1), n2 = true);\n const a2 = e2.xr.getEnvironmentBlendMode();\n \"additive\" === a2 ? i2.buffers.color.setClear(0, 0, 0, 1, g2) : \"alpha-blend\" === a2 && i2.buffers.color.setClear(0, 0, 0, 0, g2), (e2.autoClear || n2) && (i2.buffers.depth.setTest(true), i2.buffers.depth.setMask(true), i2.buffers.color.setMask(true), e2.clear(e2.autoClearColor, e2.autoClearDepth, e2.autoClearStencil));\n },\n addToRenderList: function(t3, n2) {\n const i3 = A2(n2);\n i3 && (i3.isCubeTexture || i3.mapping === pt) ? (void 0 === S2 && (S2 = new Ra(\n new yh(1, 1, 1),\n new Zl({\n name: \"BackgroundCubeMaterial\",\n uniforms: Jl(Hn2.backgroundCube.uniforms),\n vertexShader: Hn2.backgroundCube.vertexShader,\n fragmentShader: Hn2.backgroundCube.fragmentShader,\n side: d,\n depthTest: false,\n depthWrite: false,\n fog: false,\n allowOverride: false\n })\n ), S2.geometry.deleteAttribute(\"normal\"), S2.geometry.deleteAttribute(\"uv\"), S2.onBeforeRender = function(e3, t4, n3) {\n this.matrixWorld.copyPosition(n3.matrixWorld);\n }, Object.defineProperty(S2.material, \"envMap\", {\n get: function() {\n return this.uniforms.envMap.value;\n }\n }), r2.update(S2)), S2.material.uniforms.envMap.value = i3, S2.material.uniforms.backgroundBlurriness.value = n2.backgroundBlurriness, S2.material.uniforms.backgroundIntensity.value = n2.backgroundIntensity, S2.material.uniforms.backgroundRotation.value.setFromMatrix4(Wn2.makeRotationFromEuler(n2.backgroundRotation)).transpose(), i3.isCubeTexture && false === i3.isRenderTargetTexture && S2.material.uniforms.backgroundRotation.value.premultiply(zn2), S2.material.toneMapped = Ri.getTransfer(i3.colorSpace) !== rs, T2 === i3 && x2 === i3.version && R2 === e2.toneMapping || (S2.material.needsUpdate = true, T2 = i3, x2 = i3.version, R2 = e2.toneMapping), S2.layers.enableAll(), t3.unshift(S2, S2.geometry, S2.material, 0, 0, null)) : i3 && i3.isTexture && (void 0 === E2 && (E2 = new Ra(\n new Ol(2, 2),\n new Zl({\n name: \"BackgroundMaterial\",\n uniforms: Jl(Hn2.background.uniforms),\n vertexShader: Hn2.background.vertexShader,\n fragmentShader: Hn2.background.fragmentShader,\n side: u,\n depthTest: false,\n depthWrite: false,\n fog: false,\n allowOverride: false\n })\n ), E2.geometry.deleteAttribute(\"normal\"), Object.defineProperty(E2.material, \"map\", {\n get: function() {\n return this.uniforms.t2D.value;\n }\n }), r2.update(E2)), E2.material.uniforms.t2D.value = i3, E2.material.uniforms.backgroundIntensity.value = n2.backgroundIntensity, E2.material.toneMapped = Ri.getTransfer(i3.colorSpace) !== rs, true === i3.matrixAutoUpdate && i3.updateMatrix(), E2.material.uniforms.uvTransform.value.copy(i3.matrix), T2 === i3 && x2 === i3.version && R2 === e2.toneMapping || (E2.material.needsUpdate = true, T2 = i3, x2 = i3.version, R2 = e2.toneMapping), E2.layers.enableAll(), t3.unshift(E2, E2.geometry, E2.material, 0, 0, null));\n },\n dispose: function() {\n void 0 !== S2 && (S2.geometry.dispose(), S2.material.dispose(), S2 = void 0), void 0 !== E2 && (E2.geometry.dispose(), E2.material.dispose(), E2 = void 0);\n }\n };\n }\n function Xn2(e2, t2) {\n const n2 = e2.getParameter(e2.MAX_VERTEX_ATTRIBS), i2 = {}, r2 = c2(null);\n let a2 = r2, o2 = false;\n function s2(t3) {\n return e2.bindVertexArray(t3);\n }\n function l2(t3) {\n return e2.deleteVertexArray(t3);\n }\n function c2(e3) {\n const t3 = [], i3 = [], r3 = [];\n for (let e4 = 0; e4 < n2; e4++) t3[e4] = 0, i3[e4] = 0, r3[e4] = 0;\n return {\n geometry: null,\n program: null,\n wireframe: false,\n newAttributes: t3,\n enabledAttributes: i3,\n attributeDivisors: r3,\n object: e3,\n attributes: {},\n index: null\n };\n }\n function d2() {\n const e3 = a2.newAttributes;\n for (let t3 = 0, n3 = e3.length; t3 < n3; t3++) e3[t3] = 0;\n }\n function u2(e3) {\n f2(e3, 0);\n }\n function f2(t3, n3) {\n const i3 = a2.newAttributes, r3 = a2.enabledAttributes, o3 = a2.attributeDivisors;\n i3[t3] = 1, 0 === r3[t3] && (e2.enableVertexAttribArray(t3), r3[t3] = 1), o3[t3] !== n3 && (e2.vertexAttribDivisor(t3, n3), o3[t3] = n3);\n }\n function p2() {\n const t3 = a2.newAttributes, n3 = a2.enabledAttributes;\n for (let i3 = 0, r3 = n3.length; i3 < r3; i3++)\n n3[i3] !== t3[i3] && (e2.disableVertexAttribArray(i3), n3[i3] = 0);\n }\n function m2(t3, n3, i3, r3, a3, o3, s3) {\n true === s3 ? e2.vertexAttribIPointer(t3, n3, i3, a3, o3) : e2.vertexAttribPointer(t3, n3, i3, r3, a3, o3);\n }\n function h2() {\n _2(), o2 = true, a2 !== r2 && (a2 = r2, s2(a2.object));\n }\n function _2() {\n r2.geometry = null, r2.program = null, r2.wireframe = false;\n }\n return {\n setup: function(n3, r3, l3, h3, _3) {\n let v2 = false;\n const E2 = (function(t3, n4, r4, a3) {\n const o3 = true === a3.wireframe;\n let s3 = i2[n4.id];\n void 0 === s3 && (s3 = {}, i2[n4.id] = s3);\n const l4 = true === t3.isInstancedMesh ? t3.id : 0;\n let d3 = s3[l4];\n void 0 === d3 && (d3 = {}, s3[l4] = d3);\n let u3 = d3[r4.id];\n void 0 === u3 && (u3 = {}, d3[r4.id] = u3);\n let f3 = u3[o3];\n void 0 === f3 && (f3 = c2(e2.createVertexArray()), u3[o3] = f3);\n return f3;\n })(n3, h3, l3, r3);\n a2 !== E2 && (a2 = E2, s2(a2.object)), v2 = (function(e3, t3, n4, i3) {\n const r4 = a2.attributes, o3 = t3.attributes;\n let s3 = 0;\n const l4 = n4.getAttributes();\n for (const t4 in l4) {\n if (l4[t4].location >= 0) {\n const n5 = r4[t4];\n let i4 = o3[t4];\n if (void 0 === i4 && (\"instanceMatrix\" === t4 && e3.instanceMatrix && (i4 = e3.instanceMatrix), \"instanceColor\" === t4 && e3.instanceColor && (i4 = e3.instanceColor)), void 0 === n5)\n return true;\n if (n5.attribute !== i4) return true;\n if (i4 && n5.data !== i4.data) return true;\n s3++;\n }\n }\n return a2.attributesNum !== s3 || a2.index !== i3;\n })(n3, h3, l3, _3), v2 && (function(e3, t3, n4, i3) {\n const r4 = {}, o3 = t3.attributes;\n let s3 = 0;\n const l4 = n4.getAttributes();\n for (const t4 in l4) {\n if (l4[t4].location >= 0) {\n let n5 = o3[t4];\n void 0 === n5 && (\"instanceMatrix\" === t4 && e3.instanceMatrix && (n5 = e3.instanceMatrix), \"instanceColor\" === t4 && e3.instanceColor && (n5 = e3.instanceColor));\n const i4 = {};\n i4.attribute = n5, n5 && n5.data && (i4.data = n5.data), r4[t4] = i4, s3++;\n }\n }\n a2.attributes = r4, a2.attributesNum = s3, a2.index = i3;\n })(n3, h3, l3, _3), null !== _3 && t2.update(_3, e2.ELEMENT_ARRAY_BUFFER), (v2 || o2) && (o2 = false, (function(n4, i3, r4, a3) {\n d2();\n const o3 = a3.attributes, s3 = r4.getAttributes(), l4 = i3.defaultAttributeValues;\n for (const i4 in s3) {\n const r5 = s3[i4];\n if (r5.location >= 0) {\n let s4 = o3[i4];\n if (void 0 === s4 && (\"instanceMatrix\" === i4 && n4.instanceMatrix && (s4 = n4.instanceMatrix), \"instanceColor\" === i4 && n4.instanceColor && (s4 = n4.instanceColor)), void 0 !== s4) {\n const i5 = s4.normalized, o4 = s4.itemSize, l5 = t2.get(s4);\n if (void 0 === l5) continue;\n const c3 = l5.buffer, d3 = l5.type, p3 = l5.bytesPerElement, h4 = d3 === e2.INT || d3 === e2.UNSIGNED_INT || s4.gpuType === kt;\n if (s4.isInterleavedBufferAttribute) {\n const t3 = s4.data, l6 = t3.stride, _4 = s4.offset;\n if (t3.isInstancedInterleavedBuffer) {\n for (let e3 = 0; e3 < r5.locationSize; e3++)\n f2(r5.location + e3, t3.meshPerAttribute);\n true !== n4.isInstancedMesh && void 0 === a3._maxInstanceCount && (a3._maxInstanceCount = t3.meshPerAttribute * t3.count);\n } else for (let e3 = 0; e3 < r5.locationSize; e3++) u2(r5.location + e3);\n e2.bindBuffer(e2.ARRAY_BUFFER, c3);\n for (let e3 = 0; e3 < r5.locationSize; e3++)\n m2(\n r5.location + e3,\n o4 / r5.locationSize,\n d3,\n i5,\n l6 * p3,\n (_4 + o4 / r5.locationSize * e3) * p3,\n h4\n );\n } else {\n if (s4.isInstancedBufferAttribute) {\n for (let e3 = 0; e3 < r5.locationSize; e3++)\n f2(r5.location + e3, s4.meshPerAttribute);\n true !== n4.isInstancedMesh && void 0 === a3._maxInstanceCount && (a3._maxInstanceCount = s4.meshPerAttribute * s4.count);\n } else for (let e3 = 0; e3 < r5.locationSize; e3++) u2(r5.location + e3);\n e2.bindBuffer(e2.ARRAY_BUFFER, c3);\n for (let e3 = 0; e3 < r5.locationSize; e3++)\n m2(\n r5.location + e3,\n o4 / r5.locationSize,\n d3,\n i5,\n o4 * p3,\n o4 / r5.locationSize * e3 * p3,\n h4\n );\n }\n } else if (void 0 !== l4) {\n const t3 = l4[i4];\n if (void 0 !== t3)\n switch (t3.length) {\n case 2:\n e2.vertexAttrib2fv(r5.location, t3);\n break;\n case 3:\n e2.vertexAttrib3fv(r5.location, t3);\n break;\n case 4:\n e2.vertexAttrib4fv(r5.location, t3);\n break;\n default:\n e2.vertexAttrib1fv(r5.location, t3);\n }\n }\n }\n }\n p2();\n })(n3, r3, l3, h3), null !== _3 && e2.bindBuffer(e2.ELEMENT_ARRAY_BUFFER, t2.get(_3).buffer));\n },\n reset: h2,\n resetDefaultState: _2,\n dispose: function() {\n h2();\n for (const e3 in i2) {\n const t3 = i2[e3];\n for (const e4 in t3) {\n const n3 = t3[e4];\n for (const e5 in n3) {\n const t4 = n3[e5];\n for (const e6 in t4) l2(t4[e6].object), delete t4[e6];\n delete n3[e5];\n }\n }\n delete i2[e3];\n }\n },\n releaseStatesOfGeometry: function(e3) {\n if (void 0 === i2[e3.id]) return;\n const t3 = i2[e3.id];\n for (const e4 in t3) {\n const n3 = t3[e4];\n for (const e5 in n3) {\n const t4 = n3[e5];\n for (const e6 in t4) l2(t4[e6].object), delete t4[e6];\n delete n3[e5];\n }\n }\n delete i2[e3.id];\n },\n releaseStatesOfObject: function(e3) {\n for (const t3 in i2) {\n const n3 = i2[t3], r3 = true === e3.isInstancedMesh ? e3.id : 0, a3 = n3[r3];\n if (void 0 !== a3) {\n for (const e4 in a3) {\n const t4 = a3[e4];\n for (const e5 in t4) l2(t4[e5].object), delete t4[e5];\n delete a3[e4];\n }\n delete n3[r3], 0 === Object.keys(n3).length && delete i2[t3];\n }\n }\n },\n releaseStatesOfProgram: function(e3) {\n for (const t3 in i2) {\n const n3 = i2[t3];\n for (const t4 in n3) {\n const i3 = n3[t4];\n if (void 0 === i3[e3.id]) continue;\n const r3 = i3[e3.id];\n for (const e4 in r3) l2(r3[e4].object), delete r3[e4];\n delete i3[e3.id];\n }\n }\n },\n initAttributes: d2,\n enableAttribute: u2,\n disableUnusedAttributes: p2\n };\n }\n function Kn2(e2, t2, n2) {\n let i2;\n this.setMode = function(e3) {\n i2 = e3;\n }, this.render = function(t3, r2) {\n e2.drawArrays(i2, t3, r2), n2.update(r2, i2, 1);\n }, this.renderInstances = function(t3, r2, a2) {\n 0 !== a2 && (e2.drawArraysInstanced(i2, t3, r2, a2), n2.update(r2, i2, a2));\n }, this.renderMultiDraw = function(e3, r2, a2) {\n if (0 === a2) return;\n t2.get(\"WEBGL_multi_draw\").multiDrawArraysWEBGL(i2, e3, 0, r2, 0, a2);\n let o2 = 0;\n for (let e4 = 0; e4 < a2; e4++) o2 += r2[e4];\n n2.update(o2, i2, 1);\n };\n }\n function Yn2(e2, t2, n2, i2) {\n let r2;\n function a2(t3) {\n if (\"highp\" === t3) {\n if (e2.getShaderPrecisionFormat(e2.VERTEX_SHADER, e2.HIGH_FLOAT).precision > 0 && e2.getShaderPrecisionFormat(e2.FRAGMENT_SHADER, e2.HIGH_FLOAT).precision > 0)\n return \"highp\";\n t3 = \"mediump\";\n }\n return \"mediump\" === t3 && e2.getShaderPrecisionFormat(e2.VERTEX_SHADER, e2.MEDIUM_FLOAT).precision > 0 && e2.getShaderPrecisionFormat(e2.FRAGMENT_SHADER, e2.MEDIUM_FLOAT).precision > 0 ? \"mediump\" : \"lowp\";\n }\n let o2 = void 0 !== n2.precision ? n2.precision : \"highp\";\n const s2 = a2(o2);\n s2 !== o2 && (ai(\"WebGLRenderer:\", o2, \"not supported, using\", s2, \"instead.\"), o2 = s2);\n const l2 = true === n2.logarithmicDepthBuffer, c2 = true === n2.reversedDepthBuffer && t2.has(\"EXT_clip_control\");\n true === n2.reversedDepthBuffer && false === c2 && ai(\n \"WebGLRenderer: Unable to use reversed depth buffer due to missing EXT_clip_control extension. Fallback to default depth buffer.\"\n );\n return {\n isWebGL2: true,\n getMaxAnisotropy: function() {\n if (void 0 !== r2) return r2;\n if (true === t2.has(\"EXT_texture_filter_anisotropic\")) {\n const n3 = t2.get(\"EXT_texture_filter_anisotropic\");\n r2 = e2.getParameter(n3.MAX_TEXTURE_MAX_ANISOTROPY_EXT);\n } else r2 = 0;\n return r2;\n },\n getMaxPrecision: a2,\n textureFormatReadable: function(t3) {\n return t3 === jt || i2.convert(t3) === e2.getParameter(e2.IMPLEMENTATION_COLOR_READ_FORMAT);\n },\n textureTypeReadable: function(n3) {\n const r3 = n3 === Rt && (t2.has(\"EXT_color_buffer_half_float\") || t2.has(\"EXT_color_buffer_float\"));\n return !(n3 !== zt && i2.convert(n3) !== e2.getParameter(e2.IMPLEMENTATION_COLOR_READ_TYPE) && n3 !== Pt && !r3);\n },\n precision: o2,\n logarithmicDepthBuffer: l2,\n reversedDepthBuffer: c2,\n maxTextures: e2.getParameter(e2.MAX_TEXTURE_IMAGE_UNITS),\n maxVertexTextures: e2.getParameter(e2.MAX_VERTEX_TEXTURE_IMAGE_UNITS),\n maxTextureSize: e2.getParameter(e2.MAX_TEXTURE_SIZE),\n maxCubemapSize: e2.getParameter(e2.MAX_CUBE_MAP_TEXTURE_SIZE),\n maxAttributes: e2.getParameter(e2.MAX_VERTEX_ATTRIBS),\n maxVertexUniforms: e2.getParameter(e2.MAX_VERTEX_UNIFORM_VECTORS),\n maxVaryings: e2.getParameter(e2.MAX_VARYING_VECTORS),\n maxFragmentUniforms: e2.getParameter(e2.MAX_FRAGMENT_UNIFORM_VECTORS),\n maxSamples: e2.getParameter(e2.MAX_SAMPLES),\n samples: e2.getParameter(e2.SAMPLES)\n };\n }\n function qn2(t2) {\n const n2 = this;\n let i2 = null, r2 = 0, a2 = false, o2 = false;\n const s2 = new lo(), l2 = new Ii(), c2 = { value: null, needsUpdate: false };\n function d2(e2, t3, i3, r3) {\n const a3 = null !== e2 ? e2.length : 0;\n let o3 = null;\n if (0 !== a3) {\n if (o3 = c2.value, true !== r3 || null === o3) {\n const n3 = i3 + 4 * a3, r4 = t3.matrixWorldInverse;\n l2.getNormalMatrix(r4), (null === o3 || o3.length < n3) && (o3 = new Float32Array(n3));\n for (let t4 = 0, n4 = i3; t4 !== a3; ++t4, n4 += 4)\n s2.copy(e2[t4]).applyMatrix4(r4, l2), s2.normal.toArray(o3, n4), o3[n4 + 3] = s2.constant;\n }\n c2.value = o3, c2.needsUpdate = true;\n }\n return n2.numPlanes = a3, n2.numIntersection = 0, o3;\n }\n this.uniform = c2, this.numPlanes = 0, this.numIntersection = 0, this.init = function(e2, t3) {\n const n3 = 0 !== e2.length || t3 || 0 !== r2 || a2;\n return a2 = t3, r2 = e2.length, n3;\n }, this.beginShadows = function() {\n o2 = true, d2(null);\n }, this.endShadows = function() {\n o2 = false;\n }, this.setGlobalState = function(e2, t3) {\n i2 = d2(e2, t3, 0);\n }, this.setState = function(e2, s3, l3) {\n const u2 = e2.clippingPlanes, f2 = e2.clipIntersection, p2 = e2.clipShadows, m2 = t2.get(e2);\n if (!a2 || null === u2 || 0 === u2.length || o2 && !p2)\n o2 ? d2(null) : (function() {\n c2.value !== i2 && (c2.value = i2, c2.needsUpdate = r2 > 0);\n n2.numPlanes = r2, n2.numIntersection = 0;\n })();\n else {\n const e3 = o2 ? 0 : r2, t3 = 4 * e3;\n let n3 = m2.clippingState || null;\n c2.value = n3, n3 = d2(u2, s3, t3, l3);\n for (let e4 = 0; e4 !== t3; ++e4) n3[e4] = i2[e4];\n m2.clippingState = n3, this.numIntersection = f2 ? this.numPlanes : 0, this.numPlanes += e3;\n }\n };\n }\n zn2.set(-1, 0, 0, 0, 1, 0, 0, 0, 1);\n var jn2 = [0.125, 0.215, 0.35, 0.446, 0.526, 0.582];\n var Zn2 = 20;\n var $n2 = new au();\n var Qn2 = new Pr();\n var Jn2 = null;\n var ei2 = 0;\n var ti2 = 0;\n var ni2 = false;\n var ii2 = new Ti();\n var ri2 = class {\n constructor(e2) {\n this._renderer = e2, 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;\n }\n fromScene(e2, t2 = 0, n2 = 0.1, i2 = 100, r2 = {}) {\n const { size: a2 = 256, position: o2 = ii2 } = r2;\n Jn2 = this._renderer.getRenderTarget(), ei2 = this._renderer.getActiveCubeFace(), ti2 = this._renderer.getActiveMipmapLevel(), ni2 = this._renderer.xr.enabled, this._renderer.xr.enabled = false, this._setSize(a2);\n const s2 = this._allocateTargets();\n return s2.depthBuffer = true, this._sceneToCubeUV(e2, n2, i2, s2, o2), t2 > 0 && this._blur(s2, 0, 0, t2), this._applyPMREM(s2), this._cleanup(s2), s2;\n }\n fromEquirectangular(e2, t2 = null) {\n return this._fromTexture(e2, t2);\n }\n fromCubemap(e2, t2 = null) {\n return this._fromTexture(e2, t2);\n }\n compileCubemapShader() {\n null === this._cubemapMaterial && (this._cubemapMaterial = li(), this._compileMaterial(this._cubemapMaterial));\n }\n compileEquirectangularShader() {\n null === this._equirectMaterial && (this._equirectMaterial = si2(), this._compileMaterial(this._equirectMaterial));\n }\n dispose() {\n this._dispose(), null !== this._cubemapMaterial && this._cubemapMaterial.dispose(), null !== this._equirectMaterial && this._equirectMaterial.dispose(), null !== this._backgroundBox && (this._backgroundBox.geometry.dispose(), this._backgroundBox.material.dispose());\n }\n _setSize(e2) {\n this._lodMax = Math.floor(Math.log2(e2)), this._cubeSize = Math.pow(2, this._lodMax);\n }\n _dispose() {\n null !== this._blurMaterial && this._blurMaterial.dispose(), null !== this._ggxMaterial && this._ggxMaterial.dispose(), null !== this._pingPongRenderTarget && this._pingPongRenderTarget.dispose();\n for (let e2 = 0; e2 < this._lodMeshes.length; e2++) this._lodMeshes[e2].geometry.dispose();\n }\n _cleanup(e2) {\n this._renderer.setRenderTarget(Jn2, ei2, ti2), this._renderer.xr.enabled = ni2, e2.scissorTest = false, oi2(e2, 0, 0, e2.width, e2.height);\n }\n _fromTexture(e2, t2) {\n e2.mapping === lt || e2.mapping === ct ? this._setSize(0 === e2.image.length ? 16 : e2.image[0].width || e2.image[0].image.width) : this._setSize(e2.image.width / 4), Jn2 = this._renderer.getRenderTarget(), ei2 = this._renderer.getActiveCubeFace(), ti2 = this._renderer.getActiveMipmapLevel(), ni2 = this._renderer.xr.enabled, this._renderer.xr.enabled = false;\n const n2 = t2 || this._allocateTargets();\n return this._textureToCubeUV(e2, n2), this._applyPMREM(n2), this._cleanup(n2), n2;\n }\n _allocateTargets() {\n const e2 = 3 * Math.max(this._cubeSize, 112), t2 = 4 * this._cubeSize, n2 = {\n magFilter: Mt,\n minFilter: Mt,\n generateMipmaps: false,\n type: Rt,\n format: jt,\n colorSpace: ss,\n depthBuffer: false\n }, r2 = ai2(e2, t2, n2);\n if (null === this._pingPongRenderTarget || this._pingPongRenderTarget.width !== e2 || this._pingPongRenderTarget.height !== t2) {\n null !== this._pingPongRenderTarget && this._dispose(), this._pingPongRenderTarget = ai2(e2, t2, n2);\n const { _lodMax: r3 } = this;\n ({\n lodMeshes: this._lodMeshes,\n sizeLods: this._sizeLods,\n sigmas: this._sigmas\n } = (function(e3) {\n const t3 = [], n3 = [], i2 = [];\n let r4 = e3;\n const a2 = e3 - 4 + 1 + jn2.length;\n for (let s2 = 0; s2 < a2; s2++) {\n const a3 = Math.pow(2, r4);\n t3.push(a3);\n let l2 = 1 / a3;\n s2 > e3 - 4 ? l2 = jn2[s2 - e3 + 4 - 1] : 0 === s2 && (l2 = 0), n3.push(l2);\n const c2 = 1 / (a3 - 2), d2 = -c2, u2 = 1 + c2, f2 = [d2, d2, u2, d2, u2, u2, d2, d2, u2, u2, d2, u2], p2 = 6, m2 = 6, h2 = 3, _2 = 2, g2 = 1, v2 = new Float32Array(h2 * m2 * p2), E2 = new Float32Array(_2 * m2 * p2), S2 = new Float32Array(g2 * m2 * p2);\n for (let e4 = 0; e4 < p2; e4++) {\n const t4 = e4 % 3 * 2 / 3 - 1, n4 = e4 > 2 ? 0 : -1, i3 = [\n t4,\n n4,\n 0,\n t4 + 2 / 3,\n n4,\n 0,\n t4 + 2 / 3,\n n4 + 1,\n 0,\n t4,\n n4,\n 0,\n t4 + 2 / 3,\n n4 + 1,\n 0,\n t4,\n n4 + 1,\n 0\n ];\n v2.set(i3, h2 * m2 * e4), E2.set(f2, _2 * m2 * e4);\n const r5 = [e4, e4, e4, e4, e4, e4];\n S2.set(r5, g2 * m2 * e4);\n }\n const M2 = new Wn();\n M2.setAttribute(\"position\", new Mn(v2, h2)), M2.setAttribute(\"uv\", new Mn(E2, _2)), M2.setAttribute(\"faceIndex\", new Mn(S2, g2)), i2.push(new Ra(M2, null)), r4 > 4 && r4--;\n }\n return { lodMeshes: i2, sizeLods: t3, sigmas: n3 };\n })(r3)), this._blurMaterial = (function(e3, t3, n3) {\n const r4 = new Float32Array(Zn2), a2 = new Ti(0, 1, 0), o2 = new Zl({\n name: \"SphericalGaussianBlur\",\n defines: {\n n: Zn2,\n CUBEUV_TEXEL_WIDTH: 1 / t3,\n CUBEUV_TEXEL_HEIGHT: 1 / n3,\n CUBEUV_MAX_MIP: `${e3}.0`\n },\n uniforms: {\n envMap: { value: null },\n samples: { value: 1 },\n weights: { value: r4 },\n latitudinal: { value: false },\n dTheta: { value: 0 },\n mipInt: { value: 0 },\n poleAxis: { value: a2 }\n },\n vertexShader: ci2(),\n fragmentShader: \"\\n\\n\t\t\tprecision mediump float;\\n\t\t\tprecision mediump int;\\n\\n\t\t\tvarying vec3 vOutputDirection;\\n\\n\t\t\tuniform sampler2D envMap;\\n\t\t\tuniform int samples;\\n\t\t\tuniform float weights[ n ];\\n\t\t\tuniform bool latitudinal;\\n\t\t\tuniform float dTheta;\\n\t\t\tuniform float mipInt;\\n\t\t\tuniform vec3 poleAxis;\\n\\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\\n\t\t\t#include <cube_uv_reflection_fragment>\\n\\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\\n\\n\t\t\t\tfloat cosTheta = cos( theta );\\n\t\t\t\t// Rodrigues' axis-angle rotation\\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\\n\\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\\n\\n\t\t\t}\\n\\n\t\t\tvoid main() {\\n\\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\\n\\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\\n\\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\\n\\n\t\t\t\t}\\n\\n\t\t\t\taxis = normalize( axis );\\n\\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\\n\\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\\n\\n\t\t\t\t\tif ( i >= samples ) {\\n\\n\t\t\t\t\t\tbreak;\\n\\n\t\t\t\t\t}\\n\\n\t\t\t\t\tfloat theta = dTheta * float( i );\\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\\n\\n\t\t\t\t}\\n\\n\t\t\t}\\n\t\t\",\n blending: m,\n depthTest: false,\n depthWrite: false\n });\n return o2;\n })(r3, e2, t2), this._ggxMaterial = (function(e3, t3, n3) {\n const i2 = new Zl({\n name: \"PMREMGGXConvolution\",\n defines: {\n GGX_SAMPLES: 256,\n CUBEUV_TEXEL_WIDTH: 1 / t3,\n CUBEUV_TEXEL_HEIGHT: 1 / n3,\n CUBEUV_MAX_MIP: `${e3}.0`\n },\n uniforms: { envMap: { value: null }, roughness: { value: 0 }, mipInt: { value: 0 } },\n vertexShader: ci2(),\n fragmentShader: '\\n\\n\t\t\tprecision highp float;\\n\t\t\tprecision highp int;\\n\\n\t\t\tvarying vec3 vOutputDirection;\\n\\n\t\t\tuniform sampler2D envMap;\\n\t\t\tuniform float roughness;\\n\t\t\tuniform float mipInt;\\n\\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\\n\t\t\t#include <cube_uv_reflection_fragment>\\n\\n\t\t\t#define PI 3.14159265359\\n\\n\t\t\t// Van der Corput radical inverse\\n\t\t\tfloat radicalInverse_VdC(uint bits) {\\n\t\t\t\tbits = (bits << 16u) | (bits >> 16u);\\n\t\t\t\tbits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u);\\n\t\t\t\tbits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u);\\n\t\t\t\tbits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u);\\n\t\t\t\tbits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u);\\n\t\t\t\treturn float(bits) * 2.3283064365386963e-10; // / 0x100000000\\n\t\t\t}\\n\\n\t\t\t// Hammersley sequence\\n\t\t\tvec2 hammersley(uint i, uint N) {\\n\t\t\t\treturn vec2(float(i) / float(N), radicalInverse_VdC(i));\\n\t\t\t}\\n\\n\t\t\t// GGX VNDF importance sampling (Eric Heitz 2018)\\n\t\t\t// \"Sampling the GGX Distribution of Visible Normals\"\\n\t\t\t// https://jcgt.org/published/0007/04/01/\\n\t\t\tvec3 importanceSampleGGX_VNDF(vec2 Xi, vec3 V, float roughness) {\\n\t\t\t\tfloat alpha = roughness * roughness;\\n\\n\t\t\t\t// Section 4.1: Orthonormal basis\\n\t\t\t\tvec3 T1 = vec3(1.0, 0.0, 0.0);\\n\t\t\t\tvec3 T2 = cross(V, T1);\\n\\n\t\t\t\t// Section 4.2: Parameterization of projected area\\n\t\t\t\tfloat r = sqrt(Xi.x);\\n\t\t\t\tfloat phi = 2.0 * PI * Xi.y;\\n\t\t\t\tfloat t1 = r * cos(phi);\\n\t\t\t\tfloat t2 = r * sin(phi);\\n\t\t\t\tfloat s = 0.5 * (1.0 + V.z);\\n\t\t\t\tt2 = (1.0 - s) * sqrt(1.0 - t1 * t1) + s * t2;\\n\\n\t\t\t\t// Section 4.3: Reprojection onto hemisphere\\n\t\t\t\tvec3 Nh = t1 * T1 + t2 * T2 + sqrt(max(0.0, 1.0 - t1 * t1 - t2 * t2)) * V;\\n\\n\t\t\t\t// Section 3.4: Transform back to ellipsoid configuration\\n\t\t\t\treturn normalize(vec3(alpha * Nh.x, alpha * Nh.y, max(0.0, Nh.z)));\\n\t\t\t}\\n\\n\t\t\tvoid main() {\\n\t\t\t\tvec3 N = normalize(vOutputDirection);\\n\t\t\t\tvec3 V = N; // Assume view direction equals normal for pre-filtering\\n\\n\t\t\t\tvec3 prefilteredColor = vec3(0.0);\\n\t\t\t\tfloat totalWeight = 0.0;\\n\\n\t\t\t\t// For very low roughness, just sample the environment directly\\n\t\t\t\tif (roughness < 0.001) {\\n\t\t\t\t\tgl_FragColor = vec4(bilinearCubeUV(envMap, N, mipInt), 1.0);\\n\t\t\t\t\treturn;\\n\t\t\t\t}\\n\\n\t\t\t\t// Tangent space basis for VNDF sampling\\n\t\t\t\tvec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);\\n\t\t\t\tvec3 tangent = normalize(cross(up, N));\\n\t\t\t\tvec3 bitangent = cross(N, tangent);\\n\\n\t\t\t\tfor(uint i = 0u; i < uint(GGX_SAMPLES); i++) {\\n\t\t\t\t\tvec2 Xi = hammersley(i, uint(GGX_SAMPLES));\\n\\n\t\t\t\t\t// For PMREM, V = N, so in tangent space V is always (0, 0, 1)\\n\t\t\t\t\tvec3 H_tangent = importanceSampleGGX_VNDF(Xi, vec3(0.0, 0.0, 1.0), roughness);\\n\\n\t\t\t\t\t// Transform H back to world space\\n\t\t\t\t\tvec3 H = normalize(tangent * H_tangent.x + bitangent * H_tangent.y + N * H_tangent.z);\\n\t\t\t\t\tvec3 L = normalize(2.0 * dot(V, H) * H - V);\\n\\n\t\t\t\t\tfloat NdotL = max(dot(N, L), 0.0);\\n\\n\t\t\t\t\tif(NdotL > 0.0) {\\n\t\t\t\t\t\t// Sample environment at fixed mip level\\n\t\t\t\t\t\t// VNDF importance sampling handles the distribution filtering\\n\t\t\t\t\t\tvec3 sampleColor = bilinearCubeUV(envMap, L, mipInt);\\n\\n\t\t\t\t\t\t// Weight by NdotL for the split-sum approximation\\n\t\t\t\t\t\t// VNDF PDF naturally accounts for the visible microfacet distribution\\n\t\t\t\t\t\tprefilteredColor += sampleColor * NdotL;\\n\t\t\t\t\t\ttotalWeight += NdotL;\\n\t\t\t\t\t}\\n\t\t\t\t}\\n\\n\t\t\t\tif (totalWeight > 0.0) {\\n\t\t\t\t\tprefilteredColor = prefilteredColor / totalWeight;\\n\t\t\t\t}\\n\\n\t\t\t\tgl_FragColor = vec4(prefilteredColor, 1.0);\\n\t\t\t}\\n\t\t',\n blending: m,\n depthTest: false,\n depthWrite: false\n });\n return i2;\n })(r3, e2, t2);\n }\n return r2;\n }\n _compileMaterial(e2) {\n const t2 = new Ra(new Wn(), e2);\n this._renderer.compile(t2, $n2);\n }\n _sceneToCubeUV(e2, t2, n2, i2, r2) {\n const a2 = new eu(90, 1, t2, n2), l2 = [1, -1, 1, 1, 1, 1], d2 = [1, 1, 1, -1, -1, -1], u2 = this._renderer, f2 = u2.autoClear, p2 = u2.toneMapping;\n u2.getClearColor(Qn2), u2.toneMapping = Q, u2.autoClear = false;\n u2.state.buffers.depth.getReversed() && (u2.setRenderTarget(i2), u2.clearDepth(), u2.setRenderTarget(null)), null === this._backgroundBox && (this._backgroundBox = new Ra(\n new yh(),\n new Ma({ name: \"PMREM.Background\", side: d, depthWrite: false, depthTest: false })\n ));\n const m2 = this._backgroundBox, h2 = m2.material;\n let _2 = false;\n const g2 = e2.background;\n g2 ? g2.isColor && (h2.color.copy(g2), e2.background = null, _2 = true) : (h2.color.copy(Qn2), _2 = true);\n for (let t3 = 0; t3 < 6; t3++) {\n const n3 = t3 % 3;\n 0 === n3 ? (a2.up.set(0, l2[t3], 0), a2.position.set(r2.x, r2.y, r2.z), a2.lookAt(r2.x + d2[t3], r2.y, r2.z)) : 1 === n3 ? (a2.up.set(0, 0, l2[t3]), a2.position.set(r2.x, r2.y, r2.z), a2.lookAt(r2.x, r2.y + d2[t3], r2.z)) : (a2.up.set(0, l2[t3], 0), a2.position.set(r2.x, r2.y, r2.z), a2.lookAt(r2.x, r2.y, r2.z + d2[t3]));\n const o2 = this._cubeSize;\n oi2(i2, n3 * o2, t3 > 2 ? o2 : 0, o2, o2), u2.setRenderTarget(i2), _2 && u2.render(m2, a2), u2.render(e2, a2);\n }\n u2.toneMapping = p2, u2.autoClear = f2, e2.background = g2;\n }\n _textureToCubeUV(e2, t2) {\n const n2 = this._renderer, i2 = e2.mapping === lt || e2.mapping === ct;\n i2 ? (null === this._cubemapMaterial && (this._cubemapMaterial = li()), this._cubemapMaterial.uniforms.flipEnvMap.value = false === e2.isRenderTargetTexture ? -1 : 1) : null === this._equirectMaterial && (this._equirectMaterial = si2());\n const r2 = i2 ? this._cubemapMaterial : this._equirectMaterial, a2 = this._lodMeshes[0];\n a2.material = r2;\n r2.uniforms.envMap.value = e2;\n const o2 = this._cubeSize;\n oi2(t2, 0, 0, 3 * o2, 2 * o2), n2.setRenderTarget(t2), n2.render(a2, $n2);\n }\n _applyPMREM(e2) {\n const t2 = this._renderer, n2 = t2.autoClear;\n t2.autoClear = false;\n const i2 = this._lodMeshes.length;\n for (let t3 = 1; t3 < i2; t3++) this._applyGGXFilter(e2, t3 - 1, t3);\n t2.autoClear = n2;\n }\n _applyGGXFilter(e2, t2, n2) {\n const i2 = this._renderer, r2 = this._pingPongRenderTarget, a2 = this._ggxMaterial, o2 = this._lodMeshes[n2];\n o2.material = a2;\n const s2 = a2.uniforms, l2 = n2 / (this._lodMeshes.length - 1), c2 = t2 / (this._lodMeshes.length - 1), d2 = Math.sqrt(l2 * l2 - c2 * c2) * (0 + 1.25 * l2), { _lodMax: u2 } = this, f2 = this._sizeLods[n2], p2 = 3 * f2 * (n2 > u2 - 4 ? n2 - u2 + 4 : 0), m2 = 4 * (this._cubeSize - f2);\n s2.envMap.value = e2.texture, s2.roughness.value = d2, s2.mipInt.value = u2 - t2, oi2(r2, p2, m2, 3 * f2, 2 * f2), i2.setRenderTarget(r2), i2.render(o2, $n2), s2.envMap.value = r2.texture, s2.roughness.value = 0, s2.mipInt.value = u2 - n2, oi2(e2, p2, m2, 3 * f2, 2 * f2), i2.setRenderTarget(e2), i2.render(o2, $n2);\n }\n _blur(e2, t2, n2, i2, r2) {\n const a2 = this._pingPongRenderTarget;\n this._halfBlur(e2, a2, t2, n2, i2, \"latitudinal\", r2), this._halfBlur(a2, e2, n2, n2, i2, \"longitudinal\", r2);\n }\n _halfBlur(e2, t2, n2, i2, r2, a2, o2) {\n const s2 = this._renderer, l2 = this._blurMaterial;\n \"latitudinal\" !== a2 && \"longitudinal\" !== a2 && oi(\"blur direction must be either latitudinal or longitudinal!\");\n const c2 = this._lodMeshes[i2];\n c2.material = l2;\n const d2 = l2.uniforms, u2 = this._sizeLods[n2] - 1, f2 = isFinite(r2) ? Math.PI / (2 * u2) : 2 * Math.PI / 39, p2 = r2 / f2, m2 = isFinite(r2) ? 1 + Math.floor(3 * p2) : Zn2;\n m2 > Zn2 && ai(\n `sigmaRadians, ${r2}, is too large and will clip, as it requested ${m2} samples when the maximum is set to 20`\n );\n const h2 = [];\n let _2 = 0;\n for (let e3 = 0; e3 < Zn2; ++e3) {\n const t3 = e3 / p2, n3 = Math.exp(-t3 * t3 / 2);\n h2.push(n3), 0 === e3 ? _2 += n3 : e3 < m2 && (_2 += 2 * n3);\n }\n for (let e3 = 0; e3 < h2.length; e3++) h2[e3] = h2[e3] / _2;\n d2.envMap.value = e2.texture, d2.samples.value = m2, d2.weights.value = h2, d2.latitudinal.value = \"latitudinal\" === a2, o2 && (d2.poleAxis.value = o2);\n const { _lodMax: g2 } = this;\n d2.dTheta.value = f2, d2.mipInt.value = g2 - n2;\n const E2 = this._sizeLods[i2];\n oi2(t2, 3 * E2 * (i2 > g2 - 4 ? i2 - g2 + 4 : 0), 4 * (this._cubeSize - E2), 3 * E2, 2 * E2), s2.setRenderTarget(t2), s2.render(c2, $n2);\n }\n };\n function ai2(e2, t2, n2) {\n const i2 = new Xi(e2, t2, n2);\n return i2.texture.mapping = pt, i2.texture.name = \"PMREM.cubeUv\", i2.scissorTest = true, i2;\n }\n function oi2(e2, t2, n2, i2, r2) {\n e2.viewport.set(t2, n2, i2, r2), e2.scissor.set(t2, n2, i2, r2);\n }\n function si2() {\n return new Zl({\n name: \"EquirectangularToCubeUV\",\n uniforms: { envMap: { value: null } },\n vertexShader: ci2(),\n fragmentShader: \"\\n\\n\t\t\tprecision mediump float;\\n\t\t\tprecision mediump int;\\n\\n\t\t\tvarying vec3 vOutputDirection;\\n\\n\t\t\tuniform sampler2D envMap;\\n\\n\t\t\t#include <common>\\n\\n\t\t\tvoid main() {\\n\\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\\n\\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\\n\\n\t\t\t}\\n\t\t\",\n blending: m,\n depthTest: false,\n depthWrite: false\n });\n }\n function li() {\n return new Zl({\n name: \"CubemapToCubeUV\",\n uniforms: { envMap: { value: null }, flipEnvMap: { value: -1 } },\n vertexShader: ci2(),\n fragmentShader: \"\\n\\n\t\t\tprecision mediump float;\\n\t\t\tprecision mediump int;\\n\\n\t\t\tuniform float flipEnvMap;\\n\\n\t\t\tvarying vec3 vOutputDirection;\\n\\n\t\t\tuniform samplerCube envMap;\\n\\n\t\t\tvoid main() {\\n\\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\\n\\n\t\t\t}\\n\t\t\",\n blending: m,\n depthTest: false,\n depthWrite: false\n });\n }\n function ci2() {\n return \"\\n\\n\t\tprecision mediump float;\\n\t\tprecision mediump int;\\n\\n\t\tattribute float faceIndex;\\n\\n\t\tvarying vec3 vOutputDirection;\\n\\n\t\t// RH coordinate system; PMREM face-indexing convention\\n\t\tvec3 getDirection( vec2 uv, float face ) {\\n\\n\t\t\tuv = 2.0 * uv - 1.0;\\n\\n\t\t\tvec3 direction = vec3( uv, 1.0 );\\n\\n\t\t\tif ( face == 0.0 ) {\\n\\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\\n\\n\t\t\t} else if ( face == 1.0 ) {\\n\\n\t\t\t\tdirection = direction.xzy;\\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\\n\\n\t\t\t} else if ( face == 2.0 ) {\\n\\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\\n\\n\t\t\t} else if ( face == 3.0 ) {\\n\\n\t\t\t\tdirection = direction.zyx;\\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\\n\\n\t\t\t} else if ( face == 4.0 ) {\\n\\n\t\t\t\tdirection = direction.xzy;\\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\\n\\n\t\t\t} else if ( face == 5.0 ) {\\n\\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\\n\\n\t\t\t}\\n\\n\t\t\treturn direction;\\n\\n\t\t}\\n\\n\t\tvoid main() {\\n\\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\\n\t\t\tgl_Position = vec4( position, 1.0 );\\n\\n\t\t}\\n\t\";\n }\n var di2 = class extends Xi {\n constructor(e2 = 1, t2 = {}) {\n super(e2, e2, t2), this.isWebGLCubeRenderTarget = true;\n const n2 = { width: e2, height: e2, depth: 1 }, i2 = [n2, n2, n2, n2, n2, n2];\n this.texture = new lh(i2), this._setTextureOptions(t2), this.texture.isRenderTargetTexture = true;\n }\n fromEquirectangularTexture(e2, t2) {\n this.texture.type = t2.type, this.texture.colorSpace = t2.colorSpace, this.texture.generateMipmaps = t2.generateMipmaps, this.texture.minFilter = t2.minFilter, this.texture.magFilter = t2.magFilter;\n const n2 = {\n uniforms: { tEquirect: { value: null } },\n vertexShader: \"\\n\\n\t\t\t\tvarying vec3 vWorldDirection;\\n\\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\\n\\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\\n\\n\t\t\t\t}\\n\\n\t\t\t\tvoid main() {\\n\\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\\n\\n\t\t\t\t\t#include <begin_vertex>\\n\t\t\t\t\t#include <project_vertex>\\n\\n\t\t\t\t}\\n\t\t\t\",\n fragmentShader: \"\\n\\n\t\t\t\tuniform sampler2D tEquirect;\\n\\n\t\t\t\tvarying vec3 vWorldDirection;\\n\\n\t\t\t\t#include <common>\\n\\n\t\t\t\tvoid main() {\\n\\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\\n\\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\\n\\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\\n\\n\t\t\t\t}\\n\t\t\t\"\n }, i2 = new yh(5, 5, 5), r2 = new Zl({\n name: \"CubemapFromEquirect\",\n uniforms: Jl(n2.uniforms),\n vertexShader: n2.vertexShader,\n fragmentShader: n2.fragmentShader,\n side: d,\n blending: m\n });\n r2.uniforms.tEquirect.value = t2;\n const a2 = new Ra(i2, r2), u2 = t2.minFilter;\n t2.minFilter === At && (t2.minFilter = Mt);\n return new Pu(1, 10, this).update(e2, a2), t2.minFilter = u2, a2.geometry.dispose(), a2.material.dispose(), this;\n }\n clear(e2, t2 = true, n2 = true, i2 = true) {\n const r2 = e2.getRenderTarget();\n for (let r3 = 0; r3 < 6; r3++) e2.setRenderTarget(this, r3), e2.clear(t2, n2, i2);\n e2.setRenderTarget(r2);\n }\n };\n function ui2(e2) {\n let t2 = /* @__PURE__ */ new WeakMap(), n2 = /* @__PURE__ */ new WeakMap(), i2 = null;\n function r2(e3, t3) {\n return t3 === ut ? e3.mapping = lt : t3 === dt && (e3.mapping = ct), e3;\n }\n function a2(e3) {\n const n3 = e3.target;\n n3.removeEventListener(\"dispose\", a2);\n const i3 = t2.get(n3);\n void 0 !== i3 && (t2.delete(n3), i3.dispose());\n }\n function o2(e3) {\n const t3 = e3.target;\n t3.removeEventListener(\"dispose\", o2);\n const i3 = n2.get(t3);\n void 0 !== i3 && (n2.delete(t3), i3.dispose());\n }\n return {\n get: function(s2, l2 = false) {\n return null == s2 ? null : l2 ? (function(t3) {\n if (t3 && t3.isTexture) {\n const r3 = t3.mapping, a3 = r3 === ut || r3 === dt, s3 = r3 === lt || r3 === ct;\n if (a3 || s3) {\n let r4 = n2.get(t3);\n const l3 = void 0 !== r4 ? r4.texture.pmremVersion : 0;\n if (t3.isRenderTargetTexture && t3.pmremVersion !== l3)\n return null === i2 && (i2 = new ri2(e2)), r4 = a3 ? i2.fromEquirectangular(t3, r4) : i2.fromCubemap(t3, r4), r4.texture.pmremVersion = t3.pmremVersion, n2.set(t3, r4), r4.texture;\n if (void 0 !== r4) return r4.texture;\n {\n const l4 = t3.image;\n return a3 && l4 && l4.height > 0 || s3 && l4 && (function(e3) {\n let t4 = 0;\n const n3 = 6;\n for (let i3 = 0; i3 < n3; i3++) void 0 !== e3[i3] && t4++;\n return t4 === n3;\n })(l4) ? (null === i2 && (i2 = new ri2(e2)), r4 = a3 ? i2.fromEquirectangular(t3) : i2.fromCubemap(t3), r4.texture.pmremVersion = t3.pmremVersion, n2.set(t3, r4), t3.addEventListener(\"dispose\", o2), r4.texture) : null;\n }\n }\n }\n return t3;\n })(s2) : (function(n3) {\n if (n3 && n3.isTexture) {\n const i3 = n3.mapping;\n if (i3 === ut || i3 === dt) {\n if (t2.has(n3)) {\n return r2(t2.get(n3).texture, n3.mapping);\n }\n {\n const i4 = n3.image;\n if (i4 && i4.height > 0) {\n const o3 = new di2(i4.height);\n return o3.fromEquirectangularTexture(e2, n3), t2.set(n3, o3), n3.addEventListener(\"dispose\", a2), r2(o3.texture, n3.mapping);\n }\n return null;\n }\n }\n }\n return n3;\n })(s2);\n },\n dispose: function() {\n t2 = /* @__PURE__ */ new WeakMap(), n2 = /* @__PURE__ */ new WeakMap(), null !== i2 && (i2.dispose(), i2 = null);\n }\n };\n }\n function fi2(e2) {\n const t2 = {};\n function n2(n3) {\n if (void 0 !== t2[n3]) return t2[n3];\n const i2 = e2.getExtension(n3);\n return t2[n3] = i2, i2;\n }\n return {\n has: function(e3) {\n return null !== n2(e3);\n },\n init: function() {\n n2(\"EXT_color_buffer_float\"), n2(\"WEBGL_clip_cull_distance\"), n2(\"OES_texture_float_linear\"), n2(\"EXT_color_buffer_half_float\"), n2(\"WEBGL_multisampled_render_to_texture\"), n2(\"WEBGL_render_shared_exponent\");\n },\n get: function(e3) {\n const t3 = n2(e3);\n return null === t3 && hi(\"WebGLRenderer: \" + e3 + \" extension not supported.\"), t3;\n }\n };\n }\n function pi2(e2, t2, n2, i2) {\n const r2 = {}, a2 = /* @__PURE__ */ new WeakMap();\n function o2(e3) {\n const s3 = e3.target;\n null !== s3.index && t2.remove(s3.index);\n for (const e4 in s3.attributes) t2.remove(s3.attributes[e4]);\n s3.removeEventListener(\"dispose\", o2), delete r2[s3.id];\n const l2 = a2.get(s3);\n l2 && (t2.remove(l2), a2.delete(s3)), i2.releaseStatesOfGeometry(s3), true === s3.isInstancedBufferGeometry && delete s3._maxInstanceCount, n2.memory.geometries--;\n }\n function s2(e3) {\n const n3 = [], i3 = e3.index, r3 = e3.attributes.position;\n let o3 = 0;\n if (void 0 === r3) return;\n if (null !== i3) {\n const e4 = i3.array;\n o3 = i3.version;\n for (let t3 = 0, i4 = e4.length; t3 < i4; t3 += 3) {\n const i5 = e4[t3 + 0], r4 = e4[t3 + 1], a3 = e4[t3 + 2];\n n3.push(i5, r4, r4, a3, a3, i5);\n }\n } else {\n const e4 = r3.array;\n o3 = r3.version;\n for (let t3 = 0, i4 = e4.length / 3 - 1; t3 < i4; t3 += 3) {\n const e5 = t3 + 0, i5 = t3 + 1, r4 = t3 + 2;\n n3.push(e5, i5, i5, r4, r4, e5);\n }\n }\n const s3 = new (r3.count >= 65535 ? In : zn)(n3, 1);\n s3.version = o3;\n const l2 = a2.get(e3);\n l2 && t2.remove(l2), a2.set(e3, s3);\n }\n return {\n get: function(e3, t3) {\n return true === r2[t3.id] || (t3.addEventListener(\"dispose\", o2), r2[t3.id] = true, n2.memory.geometries++), t3;\n },\n update: function(n3) {\n const i3 = n3.attributes;\n for (const n4 in i3) t2.update(i3[n4], e2.ARRAY_BUFFER);\n },\n getWireframeAttribute: function(e3) {\n const t3 = a2.get(e3);\n if (t3) {\n const n3 = e3.index;\n null !== n3 && t3.version < n3.version && s2(e3);\n } else s2(e3);\n return a2.get(e3);\n }\n };\n }\n function mi2(e2, t2, n2) {\n let i2, r2, a2;\n this.setMode = function(e3) {\n i2 = e3;\n }, this.setIndex = function(e3) {\n r2 = e3.type, a2 = e3.bytesPerElement;\n }, this.render = function(t3, o2) {\n e2.drawElements(i2, o2, r2, t3 * a2), n2.update(o2, i2, 1);\n }, this.renderInstances = function(t3, o2, s2) {\n 0 !== s2 && (e2.drawElementsInstanced(i2, o2, r2, t3 * a2, s2), n2.update(o2, i2, s2));\n }, this.renderMultiDraw = function(e3, a3, o2) {\n if (0 === o2) return;\n t2.get(\"WEBGL_multi_draw\").multiDrawElementsWEBGL(i2, a3, 0, r2, e3, 0, o2);\n let s2 = 0;\n for (let e4 = 0; e4 < o2; e4++) s2 += a3[e4];\n n2.update(s2, i2, 1);\n };\n }\n function hi2(e2) {\n const t2 = { frame: 0, calls: 0, triangles: 0, points: 0, lines: 0 };\n return {\n memory: { geometries: 0, textures: 0 },\n render: t2,\n programs: null,\n autoReset: true,\n reset: function() {\n t2.calls = 0, t2.triangles = 0, t2.points = 0, t2.lines = 0;\n },\n update: function(n2, i2, r2) {\n switch (t2.calls++, i2) {\n case e2.TRIANGLES:\n t2.triangles += r2 * (n2 / 3);\n break;\n case e2.LINES:\n t2.lines += r2 * (n2 / 2);\n break;\n case e2.LINE_STRIP:\n t2.lines += r2 * (n2 - 1);\n break;\n case e2.LINE_LOOP:\n t2.lines += r2 * n2;\n break;\n case e2.POINTS:\n t2.points += r2 * n2;\n break;\n default:\n oi(\"WebGLInfo: Unknown draw mode:\", i2);\n }\n }\n };\n }\n function _i2(e2, n2, i2) {\n const r2 = /* @__PURE__ */ new WeakMap(), a2 = new qi();\n return {\n update: function(o2, s2, l2) {\n const c2 = o2.morphTargetInfluences, d2 = s2.morphAttributes.position || s2.morphAttributes.normal || s2.morphAttributes.color, u2 = void 0 !== d2 ? d2.length : 0;\n let f2 = r2.get(s2);\n if (void 0 === f2 || f2.count !== u2) {\n let b2 = function() {\n R2.dispose(), r2.delete(s2), s2.removeEventListener(\"dispose\", b2);\n };\n void 0 !== f2 && f2.texture.dispose();\n const p2 = void 0 !== s2.morphAttributes.position, m2 = void 0 !== s2.morphAttributes.normal, h2 = void 0 !== s2.morphAttributes.color, _2 = s2.morphAttributes.position || [], g2 = s2.morphAttributes.normal || [], v2 = s2.morphAttributes.color || [];\n let E2 = 0;\n true === p2 && (E2 = 1), true === m2 && (E2 = 2), true === h2 && (E2 = 3);\n let S2 = s2.attributes.position.count * E2, T2 = 1;\n S2 > n2.maxTextureSize && (T2 = Math.ceil(S2 / n2.maxTextureSize), S2 = n2.maxTextureSize);\n const x2 = new Float32Array(S2 * T2 * 4 * u2), R2 = new Yi(x2, S2, T2, u2);\n R2.type = Pt, R2.needsUpdate = true;\n const A2 = 4 * E2;\n for (let C2 = 0; C2 < u2; C2++) {\n const P2 = _2[C2], L2 = g2[C2], U2 = v2[C2], D2 = S2 * T2 * 4 * C2;\n for (let w2 = 0; w2 < P2.count; w2++) {\n const I2 = w2 * A2;\n true === p2 && (a2.fromBufferAttribute(P2, w2), x2[D2 + I2 + 0] = a2.x, x2[D2 + I2 + 1] = a2.y, x2[D2 + I2 + 2] = a2.z, x2[D2 + I2 + 3] = 0), true === m2 && (a2.fromBufferAttribute(L2, w2), x2[D2 + I2 + 4] = a2.x, x2[D2 + I2 + 5] = a2.y, x2[D2 + I2 + 6] = a2.z, x2[D2 + I2 + 7] = 0), true === h2 && (a2.fromBufferAttribute(U2, w2), x2[D2 + I2 + 8] = a2.x, x2[D2 + I2 + 9] = a2.y, x2[D2 + I2 + 10] = a2.z, x2[D2 + I2 + 11] = 4 === U2.itemSize ? a2.w : 1);\n }\n }\n f2 = { count: u2, texture: R2, size: new _i(S2, T2) }, r2.set(s2, f2), s2.addEventListener(\"dispose\", b2);\n }\n if (true === o2.isInstancedMesh && null !== o2.morphTexture)\n l2.getUniforms().setValue(e2, \"morphTexture\", o2.morphTexture, i2);\n else {\n let N2 = 0;\n for (let O2 = 0; O2 < c2.length; O2++) N2 += c2[O2];\n const y2 = s2.morphTargetsRelative ? 1 : 1 - N2;\n l2.getUniforms().setValue(e2, \"morphTargetBaseInfluence\", y2), l2.getUniforms().setValue(e2, \"morphTargetInfluences\", c2);\n }\n l2.getUniforms().setValue(e2, \"morphTargetsTexture\", f2.texture, i2), l2.getUniforms().setValue(e2, \"morphTargetsTextureSize\", f2.size);\n }\n };\n }\n function gi2(e2, t2, n2, i2, r2) {\n let a2 = /* @__PURE__ */ new WeakMap();\n function o2(e3) {\n const t3 = e3.target;\n t3.removeEventListener(\"dispose\", o2), i2.releaseStatesOfObject(t3), n2.remove(t3.instanceMatrix), null !== t3.instanceColor && n2.remove(t3.instanceColor);\n }\n return {\n update: function(i3) {\n const s2 = r2.render.frame, l2 = i3.geometry, c2 = t2.get(i3, l2);\n if (a2.get(c2) !== s2 && (t2.update(c2), a2.set(c2, s2)), i3.isInstancedMesh && (false === i3.hasEventListener(\"dispose\", o2) && i3.addEventListener(\"dispose\", o2), a2.get(i3) !== s2 && (n2.update(i3.instanceMatrix, e2.ARRAY_BUFFER), null !== i3.instanceColor && n2.update(i3.instanceColor, e2.ARRAY_BUFFER), a2.set(i3, s2))), i3.isSkinnedMesh) {\n const e3 = i3.skeleton;\n a2.get(e3) !== s2 && (e3.update(), a2.set(e3, s2));\n }\n return c2;\n },\n dispose: function() {\n a2 = /* @__PURE__ */ new WeakMap();\n }\n };\n }\n var vi2 = {\n [K]: \"LINEAR_TONE_MAPPING\",\n [tt]: \"REINHARD_TONE_MAPPING\",\n [et]: \"CINEON_TONE_MAPPING\",\n [st]: \"ACES_FILMIC_TONE_MAPPING\",\n [rt]: \"AGX_TONE_MAPPING\",\n [nt]: \"NEUTRAL_TONE_MAPPING\",\n [it]: \"CUSTOM_TONE_MAPPING\"\n };\n function Ei2(e2, t2, n2, i2, r2, a2) {\n const s2 = new Xi(t2, n2, {\n type: e2,\n depthBuffer: r2,\n stencilBuffer: a2,\n samples: i2 ? 4 : 0,\n depthTexture: r2 ? new dh(t2, n2) : void 0\n }), l2 = new Xi(t2, n2, { type: Rt, depthBuffer: false, stencilBuffer: false }), c2 = new Wn();\n c2.setAttribute(\"position\", new kn([-1, 3, 0, -1, -1, 0, 3, -1, 0], 3)), c2.setAttribute(\"uv\", new kn([0, 2, 0, 0, 2, 0], 2));\n const d2 = new Gl({\n uniforms: { tDiffuse: { value: null } },\n vertexShader: \"\\n\t\t\tprecision highp float;\\n\\n\t\t\tuniform mat4 modelViewMatrix;\\n\t\t\tuniform mat4 projectionMatrix;\\n\\n\t\t\tattribute vec3 position;\\n\t\t\tattribute vec2 uv;\\n\\n\t\t\tvarying vec2 vUv;\\n\\n\t\t\tvoid main() {\\n\t\t\t\tvUv = uv;\\n\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\\n\t\t\t}\",\n fragmentShader: \"\\n\t\t\tprecision highp float;\\n\\n\t\t\tuniform sampler2D tDiffuse;\\n\\n\t\t\tvarying vec2 vUv;\\n\\n\t\t\t#include <tonemapping_pars_fragment>\\n\t\t\t#include <colorspace_pars_fragment>\\n\\n\t\t\tvoid main() {\\n\t\t\t\tgl_FragColor = texture2D( tDiffuse, vUv );\\n\\n\t\t\t\t#ifdef LINEAR_TONE_MAPPING\\n\t\t\t\t\tgl_FragColor.rgb = LinearToneMapping( gl_FragColor.rgb );\\n\t\t\t\t#elif defined( REINHARD_TONE_MAPPING )\\n\t\t\t\t\tgl_FragColor.rgb = ReinhardToneMapping( gl_FragColor.rgb );\\n\t\t\t\t#elif defined( CINEON_TONE_MAPPING )\\n\t\t\t\t\tgl_FragColor.rgb = CineonToneMapping( gl_FragColor.rgb );\\n\t\t\t\t#elif defined( ACES_FILMIC_TONE_MAPPING )\\n\t\t\t\t\tgl_FragColor.rgb = ACESFilmicToneMapping( gl_FragColor.rgb );\\n\t\t\t\t#elif defined( AGX_TONE_MAPPING )\\n\t\t\t\t\tgl_FragColor.rgb = AgXToneMapping( gl_FragColor.rgb );\\n\t\t\t\t#elif defined( NEUTRAL_TONE_MAPPING )\\n\t\t\t\t\tgl_FragColor.rgb = NeutralToneMapping( gl_FragColor.rgb );\\n\t\t\t\t#elif defined( CUSTOM_TONE_MAPPING )\\n\t\t\t\t\tgl_FragColor.rgb = CustomToneMapping( gl_FragColor.rgb );\\n\t\t\t\t#endif\\n\\n\t\t\t\t#ifdef SRGB_TRANSFER\\n\t\t\t\t\tgl_FragColor = sRGBTransferOETF( gl_FragColor );\\n\t\t\t\t#endif\\n\t\t\t}\",\n depthTest: false,\n depthWrite: false\n }), u2 = new Ra(c2, d2), m2 = new au(-1, 1, 1, -1, 0, 1);\n let h2, _2 = null, g2 = null, v2 = false, S2 = null, M2 = [], T2 = false;\n this.setSize = function(e3, t3) {\n s2.setSize(e3, t3), l2.setSize(e3, t3);\n for (let n3 = 0; n3 < M2.length; n3++) {\n const i3 = M2[n3];\n i3.setSize && i3.setSize(e3, t3);\n }\n }, this.setEffects = function(e3) {\n M2 = e3, T2 = M2.length > 0 && true === M2[0].isRenderPass;\n const t3 = s2.width, n3 = s2.height;\n for (let e4 = 0; e4 < M2.length; e4++) {\n const i3 = M2[e4];\n i3.setSize && i3.setSize(t3, n3);\n }\n }, this.begin = function(e3, t3) {\n if (v2) return false;\n if (e3.toneMapping === Q && 0 === M2.length) return false;\n if (S2 = t3, null !== t3) {\n const e4 = t3.width, n3 = t3.height;\n s2.width === e4 && s2.height === n3 || this.setSize(e4, n3);\n }\n return false === T2 && e3.setRenderTarget(s2), h2 = e3.toneMapping, e3.toneMapping = Q, true;\n }, this.hasRenderPass = function() {\n return T2;\n }, this.end = function(e3, t3) {\n e3.toneMapping = h2, v2 = true;\n let n3 = s2, i3 = l2;\n for (let r3 = 0; r3 < M2.length; r3++) {\n const a3 = M2[r3];\n if (false !== a3.enabled && (a3.render(e3, i3, n3, t3), false !== a3.needsSwap)) {\n const e4 = n3;\n n3 = i3, i3 = e4;\n }\n }\n if (_2 !== e3.outputColorSpace || g2 !== e3.toneMapping) {\n _2 = e3.outputColorSpace, g2 = e3.toneMapping, d2.defines = {}, Ri.getTransfer(_2) === rs && (d2.defines.SRGB_TRANSFER = \"\");\n const t4 = vi2[g2];\n t4 && (d2.defines[t4] = \"\"), d2.needsUpdate = true;\n }\n d2.uniforms.tDiffuse.value = n3.texture, e3.setRenderTarget(S2), e3.render(u2, m2), S2 = null, v2 = false;\n }, this.isCompositing = function() {\n return v2;\n }, this.dispose = function() {\n s2.depthTexture && s2.depthTexture.dispose(), s2.dispose(), l2.dispose(), c2.dispose(), d2.dispose();\n };\n }\n var Si2 = new Ji();\n var Mi2 = new dh(1, 1);\n var Ti2 = new Yi();\n var xi2 = new Gi();\n var Ri2 = new lh();\n var Ai2 = [];\n var bi2 = [];\n var Ci2 = new Float32Array(16);\n var Pi2 = new Float32Array(9);\n var Li2 = new Float32Array(4);\n function Ui2(e2, t2, n2) {\n const i2 = e2[0];\n if (i2 <= 0 || i2 > 0) return e2;\n const r2 = t2 * n2;\n let a2 = Ai2[r2];\n if (void 0 === a2 && (a2 = new Float32Array(r2), Ai2[r2] = a2), 0 !== t2) {\n i2.toArray(a2, 0);\n for (let i3 = 1, r3 = 0; i3 !== t2; ++i3) r3 += n2, e2[i3].toArray(a2, r3);\n }\n return a2;\n }\n function Di2(e2, t2) {\n if (e2.length !== t2.length) return false;\n for (let n2 = 0, i2 = e2.length; n2 < i2; n2++) if (e2[n2] !== t2[n2]) return false;\n return true;\n }\n function wi2(e2, t2) {\n for (let n2 = 0, i2 = t2.length; n2 < i2; n2++) e2[n2] = t2[n2];\n }\n function Ii2(e2, t2) {\n let n2 = bi2[t2];\n void 0 === n2 && (n2 = new Int32Array(t2), bi2[t2] = n2);\n for (let i2 = 0; i2 !== t2; ++i2) n2[i2] = e2.allocateTextureUnit();\n return n2;\n }\n function Ni2(e2, t2) {\n const n2 = this.cache;\n n2[0] !== t2 && (e2.uniform1f(this.addr, t2), n2[0] = t2);\n }\n function yi2(e2, t2) {\n const n2 = this.cache;\n if (void 0 !== t2.x)\n n2[0] === t2.x && n2[1] === t2.y || (e2.uniform2f(this.addr, t2.x, t2.y), n2[0] = t2.x, n2[1] = t2.y);\n else {\n if (Di2(n2, t2)) return;\n e2.uniform2fv(this.addr, t2), wi2(n2, t2);\n }\n }\n function Oi2(e2, t2) {\n const n2 = this.cache;\n if (void 0 !== t2.x)\n n2[0] === t2.x && n2[1] === t2.y && n2[2] === t2.z || (e2.uniform3f(this.addr, t2.x, t2.y, t2.z), n2[0] = t2.x, n2[1] = t2.y, n2[2] = t2.z);\n else if (void 0 !== t2.r)\n n2[0] === t2.r && n2[1] === t2.g && n2[2] === t2.b || (e2.uniform3f(this.addr, t2.r, t2.g, t2.b), n2[0] = t2.r, n2[1] = t2.g, n2[2] = t2.b);\n else {\n if (Di2(n2, t2)) return;\n e2.uniform3fv(this.addr, t2), wi2(n2, t2);\n }\n }\n function Fi2(e2, t2) {\n const n2 = this.cache;\n if (void 0 !== t2.x)\n n2[0] === t2.x && n2[1] === t2.y && n2[2] === t2.z && n2[3] === t2.w || (e2.uniform4f(this.addr, t2.x, t2.y, t2.z, t2.w), n2[0] = t2.x, n2[1] = t2.y, n2[2] = t2.z, n2[3] = t2.w);\n else {\n if (Di2(n2, t2)) return;\n e2.uniform4fv(this.addr, t2), wi2(n2, t2);\n }\n }\n function Bi2(e2, t2) {\n const n2 = this.cache, i2 = t2.elements;\n if (void 0 === i2) {\n if (Di2(n2, t2)) return;\n e2.uniformMatrix2fv(this.addr, false, t2), wi2(n2, t2);\n } else {\n if (Di2(n2, i2)) return;\n Li2.set(i2), e2.uniformMatrix2fv(this.addr, false, Li2), wi2(n2, i2);\n }\n }\n function Gi2(e2, t2) {\n const n2 = this.cache, i2 = t2.elements;\n if (void 0 === i2) {\n if (Di2(n2, t2)) return;\n e2.uniformMatrix3fv(this.addr, false, t2), wi2(n2, t2);\n } else {\n if (Di2(n2, i2)) return;\n Pi2.set(i2), e2.uniformMatrix3fv(this.addr, false, Pi2), wi2(n2, i2);\n }\n }\n function Hi2(e2, t2) {\n const n2 = this.cache, i2 = t2.elements;\n if (void 0 === i2) {\n if (Di2(n2, t2)) return;\n e2.uniformMatrix4fv(this.addr, false, t2), wi2(n2, t2);\n } else {\n if (Di2(n2, i2)) return;\n Ci2.set(i2), e2.uniformMatrix4fv(this.addr, false, Ci2), wi2(n2, i2);\n }\n }\n function Vi2(e2, t2) {\n const n2 = this.cache;\n n2[0] !== t2 && (e2.uniform1i(this.addr, t2), n2[0] = t2);\n }\n function Wi2(e2, t2) {\n const n2 = this.cache;\n if (void 0 !== t2.x)\n n2[0] === t2.x && n2[1] === t2.y || (e2.uniform2i(this.addr, t2.x, t2.y), n2[0] = t2.x, n2[1] = t2.y);\n else {\n if (Di2(n2, t2)) return;\n e2.uniform2iv(this.addr, t2), wi2(n2, t2);\n }\n }\n function zi2(e2, t2) {\n const n2 = this.cache;\n if (void 0 !== t2.x)\n n2[0] === t2.x && n2[1] === t2.y && n2[2] === t2.z || (e2.uniform3i(this.addr, t2.x, t2.y, t2.z), n2[0] = t2.x, n2[1] = t2.y, n2[2] = t2.z);\n else {\n if (Di2(n2, t2)) return;\n e2.uniform3iv(this.addr, t2), wi2(n2, t2);\n }\n }\n function ki2(e2, t2) {\n const n2 = this.cache;\n if (void 0 !== t2.x)\n n2[0] === t2.x && n2[1] === t2.y && n2[2] === t2.z && n2[3] === t2.w || (e2.uniform4i(this.addr, t2.x, t2.y, t2.z, t2.w), n2[0] = t2.x, n2[1] = t2.y, n2[2] = t2.z, n2[3] = t2.w);\n else {\n if (Di2(n2, t2)) return;\n e2.uniform4iv(this.addr, t2), wi2(n2, t2);\n }\n }\n function Xi2(e2, t2) {\n const n2 = this.cache;\n n2[0] !== t2 && (e2.uniform1ui(this.addr, t2), n2[0] = t2);\n }\n function Ki2(e2, t2) {\n const n2 = this.cache;\n if (void 0 !== t2.x)\n n2[0] === t2.x && n2[1] === t2.y || (e2.uniform2ui(this.addr, t2.x, t2.y), n2[0] = t2.x, n2[1] = t2.y);\n else {\n if (Di2(n2, t2)) return;\n e2.uniform2uiv(this.addr, t2), wi2(n2, t2);\n }\n }\n function Yi2(e2, t2) {\n const n2 = this.cache;\n if (void 0 !== t2.x)\n n2[0] === t2.x && n2[1] === t2.y && n2[2] === t2.z || (e2.uniform3ui(this.addr, t2.x, t2.y, t2.z), n2[0] = t2.x, n2[1] = t2.y, n2[2] = t2.z);\n else {\n if (Di2(n2, t2)) return;\n e2.uniform3uiv(this.addr, t2), wi2(n2, t2);\n }\n }\n function qi2(e2, t2) {\n const n2 = this.cache;\n if (void 0 !== t2.x)\n n2[0] === t2.x && n2[1] === t2.y && n2[2] === t2.z && n2[3] === t2.w || (e2.uniform4ui(this.addr, t2.x, t2.y, t2.z, t2.w), n2[0] = t2.x, n2[1] = t2.y, n2[2] = t2.z, n2[3] = t2.w);\n else {\n if (Di2(n2, t2)) return;\n e2.uniform4uiv(this.addr, t2), wi2(n2, t2);\n }\n }\n function ji2(e2, t2, n2) {\n const i2 = this.cache, r2 = n2.allocateTextureUnit();\n let a2;\n i2[0] !== r2 && (e2.uniform1i(this.addr, r2), i2[0] = r2), this.type === e2.SAMPLER_2D_SHADOW ? (Mi2.compareFunction = n2.isReversedDepthBuffer() ? Bs : zs, a2 = Mi2) : a2 = Si2, n2.setTexture2D(t2 || a2, r2);\n }\n function Zi2(e2, t2, n2) {\n const i2 = this.cache, r2 = n2.allocateTextureUnit();\n i2[0] !== r2 && (e2.uniform1i(this.addr, r2), i2[0] = r2), n2.setTexture3D(t2 || xi2, r2);\n }\n function $i2(e2, t2, n2) {\n const i2 = this.cache, r2 = n2.allocateTextureUnit();\n i2[0] !== r2 && (e2.uniform1i(this.addr, r2), i2[0] = r2), n2.setTextureCube(t2 || Ri2, r2);\n }\n function Qi2(e2, t2, n2) {\n const i2 = this.cache, r2 = n2.allocateTextureUnit();\n i2[0] !== r2 && (e2.uniform1i(this.addr, r2), i2[0] = r2), n2.setTexture2DArray(t2 || Ti2, r2);\n }\n function Ji2(e2, t2) {\n e2.uniform1fv(this.addr, t2);\n }\n function er2(e2, t2) {\n const n2 = Ui2(t2, this.size, 2);\n e2.uniform2fv(this.addr, n2);\n }\n function tr2(e2, t2) {\n const n2 = Ui2(t2, this.size, 3);\n e2.uniform3fv(this.addr, n2);\n }\n function nr2(e2, t2) {\n const n2 = Ui2(t2, this.size, 4);\n e2.uniform4fv(this.addr, n2);\n }\n function ir2(e2, t2) {\n const n2 = Ui2(t2, this.size, 4);\n e2.uniformMatrix2fv(this.addr, false, n2);\n }\n function rr2(e2, t2) {\n const n2 = Ui2(t2, this.size, 9);\n e2.uniformMatrix3fv(this.addr, false, n2);\n }\n function ar2(e2, t2) {\n const n2 = Ui2(t2, this.size, 16);\n e2.uniformMatrix4fv(this.addr, false, n2);\n }\n function or2(e2, t2) {\n e2.uniform1iv(this.addr, t2);\n }\n function sr2(e2, t2) {\n e2.uniform2iv(this.addr, t2);\n }\n function lr2(e2, t2) {\n e2.uniform3iv(this.addr, t2);\n }\n function cr2(e2, t2) {\n e2.uniform4iv(this.addr, t2);\n }\n function dr2(e2, t2) {\n e2.uniform1uiv(this.addr, t2);\n }\n function ur2(e2, t2) {\n e2.uniform2uiv(this.addr, t2);\n }\n function fr2(e2, t2) {\n e2.uniform3uiv(this.addr, t2);\n }\n function pr2(e2, t2) {\n e2.uniform4uiv(this.addr, t2);\n }\n function mr2(e2, t2, n2) {\n const i2 = this.cache, r2 = t2.length, a2 = Ii2(n2, r2);\n let o2;\n Di2(i2, a2) || (e2.uniform1iv(this.addr, a2), wi2(i2, a2)), o2 = this.type === e2.SAMPLER_2D_SHADOW ? Mi2 : Si2;\n for (let e3 = 0; e3 !== r2; ++e3) n2.setTexture2D(t2[e3] || o2, a2[e3]);\n }\n function hr2(e2, t2, n2) {\n const i2 = this.cache, r2 = t2.length, a2 = Ii2(n2, r2);\n Di2(i2, a2) || (e2.uniform1iv(this.addr, a2), wi2(i2, a2));\n for (let e3 = 0; e3 !== r2; ++e3) n2.setTexture3D(t2[e3] || xi2, a2[e3]);\n }\n function _r2(e2, t2, n2) {\n const i2 = this.cache, r2 = t2.length, a2 = Ii2(n2, r2);\n Di2(i2, a2) || (e2.uniform1iv(this.addr, a2), wi2(i2, a2));\n for (let e3 = 0; e3 !== r2; ++e3) n2.setTextureCube(t2[e3] || Ri2, a2[e3]);\n }\n function gr2(e2, t2, n2) {\n const i2 = this.cache, r2 = t2.length, a2 = Ii2(n2, r2);\n Di2(i2, a2) || (e2.uniform1iv(this.addr, a2), wi2(i2, a2));\n for (let e3 = 0; e3 !== r2; ++e3) n2.setTexture2DArray(t2[e3] || Ti2, a2[e3]);\n }\n var vr2 = class {\n constructor(e2, t2, n2) {\n this.id = e2, this.addr = n2, this.cache = [], this.type = t2.type, this.setValue = (function(e3) {\n switch (e3) {\n case 5126:\n return Ni2;\n case 35664:\n return yi2;\n case 35665:\n return Oi2;\n case 35666:\n return Fi2;\n case 35674:\n return Bi2;\n case 35675:\n return Gi2;\n case 35676:\n return Hi2;\n case 5124:\n case 35670:\n return Vi2;\n case 35667:\n case 35671:\n return Wi2;\n case 35668:\n case 35672:\n return zi2;\n case 35669:\n case 35673:\n return ki2;\n case 5125:\n return Xi2;\n case 36294:\n return Ki2;\n case 36295:\n return Yi2;\n case 36296:\n return qi2;\n case 35678:\n case 36198:\n case 36298:\n case 36306:\n case 35682:\n return ji2;\n case 35679:\n case 36299:\n case 36307:\n return Zi2;\n case 35680:\n case 36300:\n case 36308:\n case 36293:\n return $i2;\n case 36289:\n case 36303:\n case 36311:\n case 36292:\n return Qi2;\n }\n })(t2.type);\n }\n };\n var Er2 = class {\n constructor(e2, t2, n2) {\n this.id = e2, this.addr = n2, this.cache = [], this.type = t2.type, this.size = t2.size, this.setValue = (function(e3) {\n switch (e3) {\n case 5126:\n return Ji2;\n case 35664:\n return er2;\n case 35665:\n return tr2;\n case 35666:\n return nr2;\n case 35674:\n return ir2;\n case 35675:\n return rr2;\n case 35676:\n return ar2;\n case 5124:\n case 35670:\n return or2;\n case 35667:\n case 35671:\n return sr2;\n case 35668:\n case 35672:\n return lr2;\n case 35669:\n case 35673:\n return cr2;\n case 5125:\n return dr2;\n case 36294:\n return ur2;\n case 36295:\n return fr2;\n case 36296:\n return pr2;\n case 35678:\n case 36198:\n case 36298:\n case 36306:\n case 35682:\n return mr2;\n case 35679:\n case 36299:\n case 36307:\n return hr2;\n case 35680:\n case 36300:\n case 36308:\n case 36293:\n return _r2;\n case 36289:\n case 36303:\n case 36311:\n case 36292:\n return gr2;\n }\n })(t2.type);\n }\n };\n var Sr2 = class {\n constructor(e2) {\n this.id = e2, this.seq = [], this.map = {};\n }\n setValue(e2, t2, n2) {\n const i2 = this.seq;\n for (let r2 = 0, a2 = i2.length; r2 !== a2; ++r2) {\n const a3 = i2[r2];\n a3.setValue(e2, t2[a3.id], n2);\n }\n }\n };\n var Mr2 = /(\\w+)(\\])?(\\[|\\.)?/g;\n function Tr2(e2, t2) {\n e2.seq.push(t2), e2.map[t2.id] = t2;\n }\n function xr2(e2, t2, n2) {\n const i2 = e2.name, r2 = i2.length;\n for (Mr2.lastIndex = 0; ; ) {\n const a2 = Mr2.exec(i2), o2 = Mr2.lastIndex;\n let s2 = a2[1];\n const l2 = \"]\" === a2[2], c2 = a2[3];\n if (l2 && (s2 |= 0), void 0 === c2 || \"[\" === c2 && o2 + 2 === r2) {\n Tr2(n2, void 0 === c2 ? new vr2(s2, e2, t2) : new Er2(s2, e2, t2));\n break;\n }\n {\n let e3 = n2.map[s2];\n void 0 === e3 && (e3 = new Sr2(s2), Tr2(n2, e3)), n2 = e3;\n }\n }\n }\n var Rr2 = class {\n constructor(e2, t2) {\n this.seq = [], this.map = {};\n const n2 = e2.getProgramParameter(t2, e2.ACTIVE_UNIFORMS);\n for (let i3 = 0; i3 < n2; ++i3) {\n const n3 = e2.getActiveUniform(t2, i3);\n xr2(n3, e2.getUniformLocation(t2, n3.name), this);\n }\n const i2 = [], r2 = [];\n for (const t3 of this.seq)\n t3.type === e2.SAMPLER_2D_SHADOW || t3.type === e2.SAMPLER_CUBE_SHADOW || t3.type === e2.SAMPLER_2D_ARRAY_SHADOW ? i2.push(t3) : r2.push(t3);\n i2.length > 0 && (this.seq = i2.concat(r2));\n }\n setValue(e2, t2, n2, i2) {\n const r2 = this.map[t2];\n void 0 !== r2 && r2.setValue(e2, n2, i2);\n }\n setOptional(e2, t2, n2) {\n const i2 = t2[n2];\n void 0 !== i2 && this.setValue(e2, n2, i2);\n }\n static upload(e2, t2, n2, i2) {\n for (let r2 = 0, a2 = t2.length; r2 !== a2; ++r2) {\n const a3 = t2[r2], o2 = n2[a3.id];\n false !== o2.needsUpdate && a3.setValue(e2, o2.value, i2);\n }\n }\n static seqWithValue(e2, t2) {\n const n2 = [];\n for (let i2 = 0, r2 = e2.length; i2 !== r2; ++i2) {\n const r3 = e2[i2];\n r3.id in t2 && n2.push(r3);\n }\n return n2;\n }\n };\n function Ar2(e2, t2, n2) {\n const i2 = e2.createShader(t2);\n return e2.shaderSource(i2, n2), e2.compileShader(i2), i2;\n }\n var br2 = 0;\n var Cr2 = new Ii();\n function Pr2(e2, t2, n2) {\n const i2 = e2.getShaderParameter(t2, e2.COMPILE_STATUS), r2 = (e2.getShaderInfoLog(t2) || \"\").trim();\n if (i2 && \"\" === r2) return \"\";\n const a2 = /ERROR: 0:(\\d+)/.exec(r2);\n if (a2) {\n const i3 = parseInt(a2[1]);\n return n2.toUpperCase() + \"\\n\\n\" + r2 + \"\\n\\n\" + (function(e3, t3) {\n const n3 = e3.split(\"\\n\"), i4 = [], r3 = Math.max(t3 - 6, 0), a3 = Math.min(t3 + 6, n3.length);\n for (let e4 = r3; e4 < a3; e4++) {\n const r4 = e4 + 1;\n i4.push(`${r4 === t3 ? \">\" : \" \"} ${r4}: ${n3[e4]}`);\n }\n return i4.join(\"\\n\");\n })(e2.getShaderSource(t2), i3);\n }\n return r2;\n }\n function Lr2(e2, t2) {\n const n2 = (function(e3) {\n Ri._getMatrix(Cr2, Ri.workingColorSpace, e3);\n const t3 = `mat3( ${Cr2.elements.map((e4) => e4.toFixed(4))} )`;\n switch (Ri.getTransfer(e3)) {\n case is:\n return [t3, \"LinearTransferOETF\"];\n case rs:\n return [t3, \"sRGBTransferOETF\"];\n default:\n return ai(\"WebGLProgram: Unsupported color space: \", e3), [t3, \"LinearTransferOETF\"];\n }\n })(t2);\n return [\n `vec4 ${e2}( vec4 value ) {`,\n `\treturn ${n2[1]}( vec4( value.rgb * ${n2[0]}, value.a ) );`,\n \"}\"\n ].join(\"\\n\");\n }\n var Ur2 = {\n [K]: \"Linear\",\n [tt]: \"Reinhard\",\n [et]: \"Cineon\",\n [st]: \"ACESFilmic\",\n [rt]: \"AgX\",\n [nt]: \"Neutral\",\n [it]: \"Custom\"\n };\n function Dr2(e2, t2) {\n const n2 = Ur2[t2];\n return void 0 === n2 ? (ai(\"WebGLProgram: Unsupported toneMapping:\", t2), \"vec3 \" + e2 + \"( vec3 color ) { return LinearToneMapping( color ); }\") : \"vec3 \" + e2 + \"( vec3 color ) { return \" + n2 + \"ToneMapping( color ); }\";\n }\n var wr2 = new Ti();\n function Ir2() {\n Ri.getLuminanceCoefficients(wr2);\n return [\n \"float luminance( const in vec3 rgb ) {\",\n `\tconst vec3 weights = vec3( ${wr2.x.toFixed(4)}, ${wr2.y.toFixed(4)}, ${wr2.z.toFixed(4)} );`,\n \"\treturn dot( weights, rgb );\",\n \"}\"\n ].join(\"\\n\");\n }\n function Nr2(e2) {\n return \"\" !== e2;\n }\n function yr2(e2, t2) {\n const n2 = t2.numSpotLightShadows + t2.numSpotLightMaps - t2.numSpotLightShadowsWithMaps;\n return e2.replace(/NUM_DIR_LIGHTS/g, t2.numDirLights).replace(/NUM_SPOT_LIGHTS/g, t2.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g, t2.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g, n2).replace(/NUM_RECT_AREA_LIGHTS/g, t2.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g, t2.numPointLights).replace(/NUM_HEMI_LIGHTS/g, t2.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g, t2.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g, t2.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g, t2.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g, t2.numPointLightShadows);\n }\n function Or2(e2, t2) {\n return e2.replace(/NUM_CLIPPING_PLANES/g, t2.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g, t2.numClippingPlanes - t2.numClipIntersection);\n }\n var Fr2 = /^[ \\t]*#include +<([\\w\\d./]+)>/gm;\n function Br2(e2) {\n return e2.replace(Fr2, Hr2);\n }\n var Gr2 = /* @__PURE__ */ new Map();\n function Hr2(e2, t2) {\n let n2 = Bn2[t2];\n if (void 0 === n2) {\n const e3 = Gr2.get(t2);\n if (void 0 === e3) throw new Error(\"THREE.WebGLProgram: Can not resolve #include <\" + t2 + \">\");\n n2 = Bn2[e3], ai('WebGLRenderer: Shader chunk \"%s\" has been deprecated. Use \"%s\" instead.', t2, e3);\n }\n return Br2(n2);\n }\n var Vr2 = /#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;\n function Wr2(e2) {\n return e2.replace(Vr2, zr2);\n }\n function zr2(e2, t2, n2, i2) {\n let r2 = \"\";\n for (let e3 = parseInt(t2); e3 < parseInt(n2); e3++)\n r2 += i2.replace(/\\[\\s*i\\s*\\]/g, \"[ \" + e3 + \" ]\").replace(/UNROLLED_LOOP_INDEX/g, e3);\n return r2;\n }\n function kr2(e2) {\n let t2 = `precision ${e2.precision} float;\n\tprecision ${e2.precision} int;\n\tprecision ${e2.precision} sampler2D;\n\tprecision ${e2.precision} samplerCube;\n\tprecision ${e2.precision} sampler3D;\n\tprecision ${e2.precision} sampler2DArray;\n\tprecision ${e2.precision} sampler2DShadow;\n\tprecision ${e2.precision} samplerCubeShadow;\n\tprecision ${e2.precision} sampler2DArrayShadow;\n\tprecision ${e2.precision} isampler2D;\n\tprecision ${e2.precision} isampler3D;\n\tprecision ${e2.precision} isamplerCube;\n\tprecision ${e2.precision} isampler2DArray;\n\tprecision ${e2.precision} usampler2D;\n\tprecision ${e2.precision} usampler3D;\n\tprecision ${e2.precision} usamplerCube;\n\tprecision ${e2.precision} usampler2DArray;\n\t`;\n return \"highp\" === e2.precision ? t2 += \"\\n#define HIGH_PRECISION\" : \"mediump\" === e2.precision ? t2 += \"\\n#define MEDIUM_PRECISION\" : \"lowp\" === e2.precision && (t2 += \"\\n#define LOW_PRECISION\"), t2;\n }\n var Xr2 = { [h]: \"SHADOWMAP_TYPE_PCF\", [c]: \"SHADOWMAP_TYPE_VSM\" };\n var Kr2 = { [lt]: \"ENVMAP_TYPE_CUBE\", [ct]: \"ENVMAP_TYPE_CUBE\", [pt]: \"ENVMAP_TYPE_CUBE_UV\" };\n var Yr2 = { [ct]: \"ENVMAP_MODE_REFRACTION\" };\n var qr2 = {\n [Z]: \"ENVMAP_BLENDING_MULTIPLY\",\n [G]: \"ENVMAP_BLENDING_MIX\",\n [$]: \"ENVMAP_BLENDING_ADD\"\n };\n function jr2(e2, t2, n2, i2) {\n const r2 = e2.getContext(), a2 = n2.defines;\n let o2 = n2.vertexShader, s2 = n2.fragmentShader;\n const l2 = (function(e3) {\n return Xr2[e3.shadowMapType] || \"SHADOWMAP_TYPE_BASIC\";\n })(n2), c2 = (function(e3) {\n return false === e3.envMap ? \"ENVMAP_TYPE_CUBE\" : Kr2[e3.envMapMode] || \"ENVMAP_TYPE_CUBE\";\n })(n2), d2 = (function(e3) {\n return false === e3.envMap ? \"ENVMAP_MODE_REFLECTION\" : Yr2[e3.envMapMode] || \"ENVMAP_MODE_REFLECTION\";\n })(n2), u2 = (function(e3) {\n return false === e3.envMap ? \"ENVMAP_BLENDING_NONE\" : qr2[e3.combine] || \"ENVMAP_BLENDING_NONE\";\n })(n2), f2 = (function(e3) {\n const t3 = e3.envMapCubeUVHeight;\n if (null === t3) return null;\n const n3 = Math.log2(t3) - 2, i3 = 1 / t3;\n return { texelWidth: 1 / (3 * Math.max(Math.pow(2, n3), 112)), texelHeight: i3, maxMip: n3 };\n })(n2), p2 = (function(e3) {\n return [\n e3.extensionClipCullDistance ? \"#extension GL_ANGLE_clip_cull_distance : require\" : \"\",\n e3.extensionMultiDraw ? \"#extension GL_ANGLE_multi_draw : require\" : \"\"\n ].filter(Nr2).join(\"\\n\");\n })(n2), m2 = (function(e3) {\n const t3 = [];\n for (const n3 in e3) {\n const i3 = e3[n3];\n false !== i3 && t3.push(\"#define \" + n3 + \" \" + i3);\n }\n return t3.join(\"\\n\");\n })(a2), h2 = r2.createProgram();\n let _2, g2, E2 = n2.glslVersion ? \"#version \" + n2.glslVersion + \"\\n\" : \"\";\n n2.isRawShaderMaterial ? (_2 = [\"#define SHADER_TYPE \" + n2.shaderType, \"#define SHADER_NAME \" + n2.shaderName, m2].filter(Nr2).join(\"\\n\"), _2.length > 0 && (_2 += \"\\n\"), g2 = [\"#define SHADER_TYPE \" + n2.shaderType, \"#define SHADER_NAME \" + n2.shaderName, m2].filter(Nr2).join(\"\\n\"), g2.length > 0 && (g2 += \"\\n\")) : (_2 = [\n kr2(n2),\n \"#define SHADER_TYPE \" + n2.shaderType,\n \"#define SHADER_NAME \" + n2.shaderName,\n m2,\n n2.extensionClipCullDistance ? \"#define USE_CLIP_DISTANCE\" : \"\",\n n2.batching ? \"#define USE_BATCHING\" : \"\",\n n2.batchingColor ? \"#define USE_BATCHING_COLOR\" : \"\",\n n2.instancing ? \"#define USE_INSTANCING\" : \"\",\n n2.instancingColor ? \"#define USE_INSTANCING_COLOR\" : \"\",\n n2.instancingMorph ? \"#define USE_INSTANCING_MORPH\" : \"\",\n n2.useFog && n2.fog ? \"#define USE_FOG\" : \"\",\n n2.useFog && n2.fogExp2 ? \"#define FOG_EXP2\" : \"\",\n n2.map ? \"#define USE_MAP\" : \"\",\n n2.envMap ? \"#define USE_ENVMAP\" : \"\",\n n2.envMap ? \"#define \" + d2 : \"\",\n n2.lightMap ? \"#define USE_LIGHTMAP\" : \"\",\n n2.aoMap ? \"#define USE_AOMAP\" : \"\",\n n2.bumpMap ? \"#define USE_BUMPMAP\" : \"\",\n n2.normalMap ? \"#define USE_NORMALMAP\" : \"\",\n n2.normalMapObjectSpace ? \"#define USE_NORMALMAP_OBJECTSPACE\" : \"\",\n n2.normalMapTangentSpace ? \"#define USE_NORMALMAP_TANGENTSPACE\" : \"\",\n n2.displacementMap ? \"#define USE_DISPLACEMENTMAP\" : \"\",\n n2.emissiveMap ? \"#define USE_EMISSIVEMAP\" : \"\",\n n2.anisotropy ? \"#define USE_ANISOTROPY\" : \"\",\n n2.anisotropyMap ? \"#define USE_ANISOTROPYMAP\" : \"\",\n n2.clearcoatMap ? \"#define USE_CLEARCOATMAP\" : \"\",\n n2.clearcoatRoughnessMap ? \"#define USE_CLEARCOAT_ROUGHNESSMAP\" : \"\",\n n2.clearcoatNormalMap ? \"#define USE_CLEARCOAT_NORMALMAP\" : \"\",\n n2.iridescenceMap ? \"#define USE_IRIDESCENCEMAP\" : \"\",\n n2.iridescenceThicknessMap ? \"#define USE_IRIDESCENCE_THICKNESSMAP\" : \"\",\n n2.specularMap ? \"#define USE_SPECULARMAP\" : \"\",\n n2.specularColorMap ? \"#define USE_SPECULAR_COLORMAP\" : \"\",\n n2.specularIntensityMap ? \"#define USE_SPECULAR_INTENSITYMAP\" : \"\",\n n2.roughnessMap ? \"#define USE_ROUGHNESSMAP\" : \"\",\n n2.metalnessMap ? \"#define USE_METALNESSMAP\" : \"\",\n n2.alphaMap ? \"#define USE_ALPHAMAP\" : \"\",\n n2.alphaHash ? \"#define USE_ALPHAHASH\" : \"\",\n n2.transmission ? \"#define USE_TRANSMISSION\" : \"\",\n n2.transmissionMap ? \"#define USE_TRANSMISSIONMAP\" : \"\",\n n2.thicknessMap ? \"#define USE_THICKNESSMAP\" : \"\",\n n2.sheenColorMap ? \"#define USE_SHEEN_COLORMAP\" : \"\",\n n2.sheenRoughnessMap ? \"#define USE_SHEEN_ROUGHNESSMAP\" : \"\",\n n2.mapUv ? \"#define MAP_UV \" + n2.mapUv : \"\",\n n2.alphaMapUv ? \"#define ALPHAMAP_UV \" + n2.alphaMapUv : \"\",\n n2.lightMapUv ? \"#define LIGHTMAP_UV \" + n2.lightMapUv : \"\",\n n2.aoMapUv ? \"#define AOMAP_UV \" + n2.aoMapUv : \"\",\n n2.emissiveMapUv ? \"#define EMISSIVEMAP_UV \" + n2.emissiveMapUv : \"\",\n n2.bumpMapUv ? \"#define BUMPMAP_UV \" + n2.bumpMapUv : \"\",\n n2.normalMapUv ? \"#define NORMALMAP_UV \" + n2.normalMapUv : \"\",\n n2.displacementMapUv ? \"#define DISPLACEMENTMAP_UV \" + n2.displacementMapUv : \"\",\n n2.metalnessMapUv ? \"#define METALNESSMAP_UV \" + n2.metalnessMapUv : \"\",\n n2.roughnessMapUv ? \"#define ROUGHNESSMAP_UV \" + n2.roughnessMapUv : \"\",\n n2.anisotropyMapUv ? \"#define ANISOTROPYMAP_UV \" + n2.anisotropyMapUv : \"\",\n n2.clearcoatMapUv ? \"#define CLEARCOATMAP_UV \" + n2.clearcoatMapUv : \"\",\n n2.clearcoatNormalMapUv ? \"#define CLEARCOAT_NORMALMAP_UV \" + n2.clearcoatNormalMapUv : \"\",\n n2.clearcoatRoughnessMapUv ? \"#define CLEARCOAT_ROUGHNESSMAP_UV \" + n2.clearcoatRoughnessMapUv : \"\",\n n2.iridescenceMapUv ? \"#define IRIDESCENCEMAP_UV \" + n2.iridescenceMapUv : \"\",\n n2.iridescenceThicknessMapUv ? \"#define IRIDESCENCE_THICKNESSMAP_UV \" + n2.iridescenceThicknessMapUv : \"\",\n n2.sheenColorMapUv ? \"#define SHEEN_COLORMAP_UV \" + n2.sheenColorMapUv : \"\",\n n2.sheenRoughnessMapUv ? \"#define SHEEN_ROUGHNESSMAP_UV \" + n2.sheenRoughnessMapUv : \"\",\n n2.specularMapUv ? \"#define SPECULARMAP_UV \" + n2.specularMapUv : \"\",\n n2.specularColorMapUv ? \"#define SPECULAR_COLORMAP_UV \" + n2.specularColorMapUv : \"\",\n n2.specularIntensityMapUv ? \"#define SPECULAR_INTENSITYMAP_UV \" + n2.specularIntensityMapUv : \"\",\n n2.transmissionMapUv ? \"#define TRANSMISSIONMAP_UV \" + n2.transmissionMapUv : \"\",\n n2.thicknessMapUv ? \"#define THICKNESSMAP_UV \" + n2.thicknessMapUv : \"\",\n n2.vertexTangents && false === n2.flatShading ? \"#define USE_TANGENT\" : \"\",\n n2.vertexNormals ? \"#define HAS_NORMAL\" : \"\",\n n2.vertexColors ? \"#define USE_COLOR\" : \"\",\n n2.vertexAlphas ? \"#define USE_COLOR_ALPHA\" : \"\",\n n2.vertexUv1s ? \"#define USE_UV1\" : \"\",\n n2.vertexUv2s ? \"#define USE_UV2\" : \"\",\n n2.vertexUv3s ? \"#define USE_UV3\" : \"\",\n n2.pointsUvs ? \"#define USE_POINTS_UV\" : \"\",\n n2.flatShading ? \"#define FLAT_SHADED\" : \"\",\n n2.skinning ? \"#define USE_SKINNING\" : \"\",\n n2.morphTargets ? \"#define USE_MORPHTARGETS\" : \"\",\n n2.morphNormals && false === n2.flatShading ? \"#define USE_MORPHNORMALS\" : \"\",\n n2.morphColors ? \"#define USE_MORPHCOLORS\" : \"\",\n n2.morphTargetsCount > 0 ? \"#define MORPHTARGETS_TEXTURE_STRIDE \" + n2.morphTextureStride : \"\",\n n2.morphTargetsCount > 0 ? \"#define MORPHTARGETS_COUNT \" + n2.morphTargetsCount : \"\",\n n2.doubleSided ? \"#define DOUBLE_SIDED\" : \"\",\n n2.flipSided ? \"#define FLIP_SIDED\" : \"\",\n n2.shadowMapEnabled ? \"#define USE_SHADOWMAP\" : \"\",\n n2.shadowMapEnabled ? \"#define \" + l2 : \"\",\n n2.sizeAttenuation ? \"#define USE_SIZEATTENUATION\" : \"\",\n n2.numLightProbes > 0 ? \"#define USE_LIGHT_PROBES\" : \"\",\n n2.logarithmicDepthBuffer ? \"#define USE_LOGARITHMIC_DEPTH_BUFFER\" : \"\",\n n2.reversedDepthBuffer ? \"#define USE_REVERSED_DEPTH_BUFFER\" : \"\",\n \"uniform mat4 modelMatrix;\",\n \"uniform mat4 modelViewMatrix;\",\n \"uniform mat4 projectionMatrix;\",\n \"uniform mat4 viewMatrix;\",\n \"uniform mat3 normalMatrix;\",\n \"uniform vec3 cameraPosition;\",\n \"uniform bool isOrthographic;\",\n \"#ifdef USE_INSTANCING\",\n \"\tattribute mat4 instanceMatrix;\",\n \"#endif\",\n \"#ifdef USE_INSTANCING_COLOR\",\n \"\tattribute vec3 instanceColor;\",\n \"#endif\",\n \"#ifdef USE_INSTANCING_MORPH\",\n \"\tuniform sampler2D morphTexture;\",\n \"#endif\",\n \"attribute vec3 position;\",\n \"attribute vec3 normal;\",\n \"attribute vec2 uv;\",\n \"#ifdef USE_UV1\",\n \"\tattribute vec2 uv1;\",\n \"#endif\",\n \"#ifdef USE_UV2\",\n \"\tattribute vec2 uv2;\",\n \"#endif\",\n \"#ifdef USE_UV3\",\n \"\tattribute vec2 uv3;\",\n \"#endif\",\n \"#ifdef USE_TANGENT\",\n \"\tattribute vec4 tangent;\",\n \"#endif\",\n \"#if defined( USE_COLOR_ALPHA )\",\n \"\tattribute vec4 color;\",\n \"#elif defined( USE_COLOR )\",\n \"\tattribute vec3 color;\",\n \"#endif\",\n \"#ifdef USE_SKINNING\",\n \"\tattribute vec4 skinIndex;\",\n \"\tattribute vec4 skinWeight;\",\n \"#endif\",\n \"\\n\"\n ].filter(Nr2).join(\"\\n\"), g2 = [\n kr2(n2),\n \"#define SHADER_TYPE \" + n2.shaderType,\n \"#define SHADER_NAME \" + n2.shaderName,\n m2,\n n2.useFog && n2.fog ? \"#define USE_FOG\" : \"\",\n n2.useFog && n2.fogExp2 ? \"#define FOG_EXP2\" : \"\",\n n2.alphaToCoverage ? \"#define ALPHA_TO_COVERAGE\" : \"\",\n n2.map ? \"#define USE_MAP\" : \"\",\n n2.matcap ? \"#define USE_MATCAP\" : \"\",\n n2.envMap ? \"#define USE_ENVMAP\" : \"\",\n n2.envMap ? \"#define \" + c2 : \"\",\n n2.envMap ? \"#define \" + d2 : \"\",\n n2.envMap ? \"#define \" + u2 : \"\",\n f2 ? \"#define CUBEUV_TEXEL_WIDTH \" + f2.texelWidth : \"\",\n f2 ? \"#define CUBEUV_TEXEL_HEIGHT \" + f2.texelHeight : \"\",\n f2 ? \"#define CUBEUV_MAX_MIP \" + f2.maxMip + \".0\" : \"\",\n n2.lightMap ? \"#define USE_LIGHTMAP\" : \"\",\n n2.aoMap ? \"#define USE_AOMAP\" : \"\",\n n2.bumpMap ? \"#define USE_BUMPMAP\" : \"\",\n n2.normalMap ? \"#define USE_NORMALMAP\" : \"\",\n n2.normalMapObjectSpace ? \"#define USE_NORMALMAP_OBJECTSPACE\" : \"\",\n n2.normalMapTangentSpace ? \"#define USE_NORMALMAP_TANGENTSPACE\" : \"\",\n n2.packedNormalMap ? \"#define USE_PACKED_NORMALMAP\" : \"\",\n n2.emissiveMap ? \"#define USE_EMISSIVEMAP\" : \"\",\n n2.anisotropy ? \"#define USE_ANISOTROPY\" : \"\",\n n2.anisotropyMap ? \"#define USE_ANISOTROPYMAP\" : \"\",\n n2.clearcoat ? \"#define USE_CLEARCOAT\" : \"\",\n n2.clearcoatMap ? \"#define USE_CLEARCOATMAP\" : \"\",\n n2.clearcoatRoughnessMap ? \"#define USE_CLEARCOAT_ROUGHNESSMAP\" : \"\",\n n2.clearcoatNormalMap ? \"#define USE_CLEARCOAT_NORMALMAP\" : \"\",\n n2.dispersion ? \"#define USE_DISPERSION\" : \"\",\n n2.iridescence ? \"#define USE_IRIDESCENCE\" : \"\",\n n2.iridescenceMap ? \"#define USE_IRIDESCENCEMAP\" : \"\",\n n2.iridescenceThicknessMap ? \"#define USE_IRIDESCENCE_THICKNESSMAP\" : \"\",\n n2.specularMap ? \"#define USE_SPECULARMAP\" : \"\",\n n2.specularColorMap ? \"#define USE_SPECULAR_COLORMAP\" : \"\",\n n2.specularIntensityMap ? \"#define USE_SPECULAR_INTENSITYMAP\" : \"\",\n n2.roughnessMap ? \"#define USE_ROUGHNESSMAP\" : \"\",\n n2.metalnessMap ? \"#define USE_METALNESSMAP\" : \"\",\n n2.alphaMap ? \"#define USE_ALPHAMAP\" : \"\",\n n2.alphaTest ? \"#define USE_ALPHATEST\" : \"\",\n n2.alphaHash ? \"#define USE_ALPHAHASH\" : \"\",\n n2.sheen ? \"#define USE_SHEEN\" : \"\",\n n2.sheenColorMap ? \"#define USE_SHEEN_COLORMAP\" : \"\",\n n2.sheenRoughnessMap ? \"#define USE_SHEEN_ROUGHNESSMAP\" : \"\",\n n2.transmission ? \"#define USE_TRANSMISSION\" : \"\",\n n2.transmissionMap ? \"#define USE_TRANSMISSIONMAP\" : \"\",\n n2.thicknessMap ? \"#define USE_THICKNESSMAP\" : \"\",\n n2.vertexTangents && false === n2.flatShading ? \"#define USE_TANGENT\" : \"\",\n n2.vertexColors || n2.instancingColor ? \"#define USE_COLOR\" : \"\",\n n2.vertexAlphas || n2.batchingColor ? \"#define USE_COLOR_ALPHA\" : \"\",\n n2.vertexUv1s ? \"#define USE_UV1\" : \"\",\n n2.vertexUv2s ? \"#define USE_UV2\" : \"\",\n n2.vertexUv3s ? \"#define USE_UV3\" : \"\",\n n2.pointsUvs ? \"#define USE_POINTS_UV\" : \"\",\n n2.gradientMap ? \"#define USE_GRADIENTMAP\" : \"\",\n n2.flatShading ? \"#define FLAT_SHADED\" : \"\",\n n2.doubleSided ? \"#define DOUBLE_SIDED\" : \"\",\n n2.flipSided ? \"#define FLIP_SIDED\" : \"\",\n n2.shadowMapEnabled ? \"#define USE_SHADOWMAP\" : \"\",\n n2.shadowMapEnabled ? \"#define \" + l2 : \"\",\n n2.premultipliedAlpha ? \"#define PREMULTIPLIED_ALPHA\" : \"\",\n n2.numLightProbes > 0 ? \"#define USE_LIGHT_PROBES\" : \"\",\n n2.numLightProbeGrids > 0 ? \"#define USE_LIGHT_PROBES_GRID\" : \"\",\n n2.decodeVideoTexture ? \"#define DECODE_VIDEO_TEXTURE\" : \"\",\n n2.decodeVideoTextureEmissive ? \"#define DECODE_VIDEO_TEXTURE_EMISSIVE\" : \"\",\n n2.logarithmicDepthBuffer ? \"#define USE_LOGARITHMIC_DEPTH_BUFFER\" : \"\",\n n2.reversedDepthBuffer ? \"#define USE_REVERSED_DEPTH_BUFFER\" : \"\",\n \"uniform mat4 viewMatrix;\",\n \"uniform vec3 cameraPosition;\",\n \"uniform bool isOrthographic;\",\n n2.toneMapping !== Q ? \"#define TONE_MAPPING\" : \"\",\n n2.toneMapping !== Q ? Bn2.tonemapping_pars_fragment : \"\",\n n2.toneMapping !== Q ? Dr2(\"toneMapping\", n2.toneMapping) : \"\",\n n2.dithering ? \"#define DITHERING\" : \"\",\n n2.opaque ? \"#define OPAQUE\" : \"\",\n Bn2.colorspace_pars_fragment,\n Lr2(\"linearToOutputTexel\", n2.outputColorSpace),\n Ir2(),\n n2.useDepthPacking ? \"#define DEPTH_PACKING \" + n2.depthPacking : \"\",\n \"\\n\"\n ].filter(Nr2).join(\"\\n\")), o2 = Br2(o2), o2 = yr2(o2, n2), o2 = Or2(o2, n2), s2 = Br2(s2), s2 = yr2(s2, n2), s2 = Or2(s2, n2), o2 = Wr2(o2), s2 = Wr2(s2), true !== n2.isRawShaderMaterial && (E2 = \"#version 300 es\\n\", _2 = [p2, \"#define attribute in\", \"#define varying out\", \"#define texture2D texture\"].join(\"\\n\") + \"\\n\" + _2, g2 = [\n \"#define varying in\",\n n2.glslVersion === js ? \"\" : \"layout(location = 0) out highp vec4 pc_fragColor;\",\n n2.glslVersion === js ? \"\" : \"#define gl_FragColor pc_fragColor\",\n \"#define gl_FragDepthEXT gl_FragDepth\",\n \"#define texture2D texture\",\n \"#define textureCube texture\",\n \"#define texture2DProj textureProj\",\n \"#define texture2DLodEXT textureLod\",\n \"#define texture2DProjLodEXT textureProjLod\",\n \"#define textureCubeLodEXT textureLod\",\n \"#define texture2DGradEXT textureGrad\",\n \"#define texture2DProjGradEXT textureProjGrad\",\n \"#define textureCubeGradEXT textureGrad\"\n ].join(\"\\n\") + \"\\n\" + g2);\n const S2 = E2 + _2 + o2, M2 = E2 + g2 + s2, T2 = Ar2(r2, r2.VERTEX_SHADER, S2), x2 = Ar2(r2, r2.FRAGMENT_SHADER, M2);\n function R2(t3) {\n if (e2.debug.checkShaderErrors) {\n const n3 = r2.getProgramInfoLog(h2) || \"\", i3 = r2.getShaderInfoLog(T2) || \"\", a3 = r2.getShaderInfoLog(x2) || \"\", o3 = n3.trim(), s3 = i3.trim(), l3 = a3.trim();\n let c3 = true, d3 = true;\n if (false === r2.getProgramParameter(h2, r2.LINK_STATUS))\n if (c3 = false, \"function\" == typeof e2.debug.onShaderError)\n e2.debug.onShaderError(r2, h2, T2, x2);\n else {\n const e3 = Pr2(r2, T2, \"vertex\"), n4 = Pr2(r2, x2, \"fragment\");\n oi(\n \"WebGLProgram: Shader Error \" + r2.getError() + \" - VALIDATE_STATUS \" + r2.getProgramParameter(h2, r2.VALIDATE_STATUS) + \"\\n\\nMaterial Name: \" + t3.name + \"\\nMaterial Type: \" + t3.type + \"\\n\\nProgram Info Log: \" + o3 + \"\\n\" + e3 + \"\\n\" + n4\n );\n }\n else \"\" !== o3 ? ai(\"WebGLProgram: Program Info Log:\", o3) : \"\" !== s3 && \"\" !== l3 || (d3 = false);\n d3 && (t3.diagnostics = {\n runnable: c3,\n programLog: o3,\n vertexShader: { log: s3, prefix: _2 },\n fragmentShader: { log: l3, prefix: g2 }\n });\n }\n r2.deleteShader(T2), r2.deleteShader(x2), A2 = new Rr2(r2, h2), b2 = (function(e3, t4) {\n const n3 = {}, i3 = e3.getProgramParameter(t4, e3.ACTIVE_ATTRIBUTES);\n for (let r3 = 0; r3 < i3; r3++) {\n const i4 = e3.getActiveAttrib(t4, r3), a3 = i4.name;\n let o3 = 1;\n i4.type === e3.FLOAT_MAT2 && (o3 = 2), i4.type === e3.FLOAT_MAT3 && (o3 = 3), i4.type === e3.FLOAT_MAT4 && (o3 = 4), n3[a3] = { type: i4.type, location: e3.getAttribLocation(t4, a3), locationSize: o3 };\n }\n return n3;\n })(r2, h2);\n }\n let A2, b2;\n r2.attachShader(h2, T2), r2.attachShader(h2, x2), void 0 !== n2.index0AttributeName ? r2.bindAttribLocation(h2, 0, n2.index0AttributeName) : true === n2.hasPositionAttribute && r2.bindAttribLocation(h2, 0, \"position\"), r2.linkProgram(h2), this.getUniforms = function() {\n return void 0 === A2 && R2(this), A2;\n }, this.getAttributes = function() {\n return void 0 === b2 && R2(this), b2;\n };\n let C2 = false === n2.rendererExtensionParallelShaderCompile;\n return this.isReady = function() {\n return false === C2 && (C2 = r2.getProgramParameter(h2, 37297)), C2;\n }, this.destroy = function() {\n i2.releaseStatesOfProgram(this), r2.deleteProgram(h2), this.program = void 0;\n }, this.type = n2.shaderType, this.name = n2.shaderName, this.id = br2++, this.cacheKey = t2, this.usedTimes = 1, this.program = h2, this.vertexShader = T2, this.fragmentShader = x2, this;\n }\n var Zr2 = 0;\n var $r2 = class {\n constructor() {\n this.shaderCache = /* @__PURE__ */ new Map(), this.materialCache = /* @__PURE__ */ new Map();\n }\n update(e2, t2, n2) {\n const i2 = this._getShaderCacheForMaterial(e2);\n return false === i2.has(t2) && (i2.add(t2), t2.usedTimes++), false === i2.has(n2) && (i2.add(n2), n2.usedTimes++), this;\n }\n remove(e2) {\n const t2 = this.materialCache.get(e2);\n for (const e3 of t2) e3.usedTimes--, 0 === e3.usedTimes && this.shaderCache.delete(e3.code);\n return this.materialCache.delete(e2), this;\n }\n getVertexShaderStage(e2) {\n return this._getShaderStage(e2.vertexShader);\n }\n getFragmentShaderStage(e2) {\n return this._getShaderStage(e2.fragmentShader);\n }\n dispose() {\n this.shaderCache.clear(), this.materialCache.clear();\n }\n _getShaderCacheForMaterial(e2) {\n const t2 = this.materialCache;\n let n2 = t2.get(e2);\n return void 0 === n2 && (n2 = /* @__PURE__ */ new Set(), t2.set(e2, n2)), n2;\n }\n _getShaderStage(e2) {\n const t2 = this.shaderCache;\n let n2 = t2.get(e2);\n return void 0 === n2 && (n2 = new Qr2(e2), t2.set(e2, n2)), n2;\n }\n };\n var Qr2 = class {\n constructor(e2) {\n this.id = Zr2++, this.code = e2, this.usedTimes = 0;\n }\n };\n function Jr2(e2, t2, n2, i2, r2, o2) {\n const s2 = new lr(), l2 = new $r2(), d2 = /* @__PURE__ */ new Set(), u2 = [], m2 = /* @__PURE__ */ new Map(), h2 = i2.logarithmicDepthBuffer;\n let _2 = i2.precision;\n const g2 = {\n MeshDepthMaterial: \"depth\",\n MeshDistanceMaterial: \"distance\",\n MeshNormalMaterial: \"normal\",\n MeshBasicMaterial: \"basic\",\n MeshLambertMaterial: \"lambert\",\n MeshPhongMaterial: \"phong\",\n MeshToonMaterial: \"toon\",\n MeshStandardMaterial: \"physical\",\n MeshPhysicalMaterial: \"physical\",\n MeshMatcapMaterial: \"matcap\",\n LineBasicMaterial: \"basic\",\n LineDashedMaterial: \"dashed\",\n PointsMaterial: \"points\",\n ShadowMaterial: \"shadow\",\n SpriteMaterial: \"sprite\"\n };\n function E2(e3) {\n return d2.add(e3), 0 === e3 ? \"uv\" : `uv${e3}`;\n }\n return {\n getParameters: function(r3, s3, u3, m3, S2, M2) {\n const T2 = m3.fog, x2 = S2.geometry, R2 = r3.isMeshStandardMaterial || r3.isMeshLambertMaterial || r3.isMeshPhongMaterial ? m3.environment : null, A2 = r3.isMeshStandardMaterial || r3.isMeshLambertMaterial && !r3.envMap || r3.isMeshPhongMaterial && !r3.envMap, b2 = t2.get(r3.envMap || R2, A2), C2 = b2 && b2.mapping === pt ? b2.image.height : null, P2 = g2[r3.type];\n null !== r3.precision && (_2 = i2.getMaxPrecision(r3.precision), _2 !== r3.precision && ai(\"WebGLProgram.getParameters:\", r3.precision, \"not supported, using\", _2, \"instead.\"));\n const U2 = x2.morphAttributes.position || x2.morphAttributes.normal || x2.morphAttributes.color, D2 = void 0 !== U2 ? U2.length : 0;\n let w2, I2, N2, y2, O2 = 0;\n if (void 0 !== x2.morphAttributes.position && (O2 = 1), void 0 !== x2.morphAttributes.normal && (O2 = 2), void 0 !== x2.morphAttributes.color && (O2 = 3), P2) {\n const e3 = Hn2[P2];\n w2 = e3.vertexShader, I2 = e3.fragmentShader;\n } else {\n w2 = r3.vertexShader, I2 = r3.fragmentShader;\n const e3 = l2.getVertexShaderStage(r3), t3 = l2.getFragmentShaderStage(r3);\n l2.update(r3, e3, t3), N2 = e3.id, y2 = t3.id;\n }\n const F2 = e2.getRenderTarget(), B2 = e2.state.buffers.depth.getReversed(), G2 = true === S2.isInstancedMesh, H2 = true === S2.isBatchedMesh, V2 = !!r3.map, W2 = !!r3.matcap, z2 = !!b2, k2 = !!r3.aoMap, X2 = !!r3.lightMap, K2 = !!r3.bumpMap && false === r3.wireframe, Y2 = !!r3.normalMap, q2 = !!r3.displacementMap, j2 = !!r3.emissiveMap, Z2 = !!r3.metalnessMap, $2 = !!r3.roughnessMap, Q2 = r3.anisotropy > 0, J2 = r3.clearcoat > 0, ee2 = r3.dispersion > 0, te2 = r3.iridescence > 0, ne2 = r3.sheen > 0, ie2 = r3.transmission > 0, re2 = Q2 && !!r3.anisotropyMap, ae2 = J2 && !!r3.clearcoatMap, oe2 = J2 && !!r3.clearcoatNormalMap, se2 = J2 && !!r3.clearcoatRoughnessMap, le2 = te2 && !!r3.iridescenceMap, ce2 = te2 && !!r3.iridescenceThicknessMap, de2 = ne2 && !!r3.sheenColorMap, ue2 = ne2 && !!r3.sheenRoughnessMap, fe2 = !!r3.specularMap, pe2 = !!r3.specularColorMap, me2 = !!r3.specularIntensityMap, Ee2 = ie2 && !!r3.transmissionMap, xe2 = ie2 && !!r3.thicknessMap, Re2 = !!r3.gradientMap, Ae2 = !!r3.alphaMap, be2 = r3.alphaTest > 0, Ce2 = !!r3.alphaHash, Pe2 = !!r3.extensions;\n let Le2 = Q;\n r3.toneMapped && (null !== F2 && true !== F2.isXRRenderTarget || (Le2 = e2.toneMapping));\n const Ue2 = {\n shaderID: P2,\n shaderType: r3.type,\n shaderName: r3.name,\n vertexShader: w2,\n fragmentShader: I2,\n defines: r3.defines,\n customVertexShaderID: N2,\n customFragmentShaderID: y2,\n isRawShaderMaterial: true === r3.isRawShaderMaterial,\n glslVersion: r3.glslVersion,\n precision: _2,\n batching: H2,\n batchingColor: H2 && null !== S2._colorsTexture,\n instancing: G2,\n instancingColor: G2 && null !== S2.instanceColor,\n instancingMorph: G2 && null !== S2.morphTexture,\n outputColorSpace: null === F2 ? e2.outputColorSpace : true === F2.isXRRenderTarget ? F2.texture.colorSpace : Ri.workingColorSpace,\n alphaToCoverage: !!r3.alphaToCoverage,\n map: V2,\n matcap: W2,\n envMap: z2,\n envMapMode: z2 && b2.mapping,\n envMapCubeUVHeight: C2,\n aoMap: k2,\n lightMap: X2,\n bumpMap: K2,\n normalMap: Y2,\n displacementMap: q2,\n emissiveMap: j2,\n normalMapObjectSpace: Y2 && r3.normalMapType === Ke,\n normalMapTangentSpace: Y2 && r3.normalMapType === Qe,\n packedNormalMap: Y2 && r3.normalMapType === Qe && (De2 = r3.normalMap.format, De2 === Xt || De2 === ce || De2 === ke),\n metalnessMap: Z2,\n roughnessMap: $2,\n anisotropy: Q2,\n anisotropyMap: re2,\n clearcoat: J2,\n clearcoatMap: ae2,\n clearcoatNormalMap: oe2,\n clearcoatRoughnessMap: se2,\n dispersion: ee2,\n iridescence: te2,\n iridescenceMap: le2,\n iridescenceThicknessMap: ce2,\n sheen: ne2,\n sheenColorMap: de2,\n sheenRoughnessMap: ue2,\n specularMap: fe2,\n specularColorMap: pe2,\n specularIntensityMap: me2,\n transmission: ie2,\n transmissionMap: Ee2,\n thicknessMap: xe2,\n gradientMap: Re2,\n opaque: false === r3.transparent && r3.blending === y && false === r3.alphaToCoverage,\n alphaMap: Ae2,\n alphaTest: be2,\n alphaHash: Ce2,\n combine: r3.combine,\n mapUv: V2 && E2(r3.map.channel),\n aoMapUv: k2 && E2(r3.aoMap.channel),\n lightMapUv: X2 && E2(r3.lightMap.channel),\n bumpMapUv: K2 && E2(r3.bumpMap.channel),\n normalMapUv: Y2 && E2(r3.normalMap.channel),\n displacementMapUv: q2 && E2(r3.displacementMap.channel),\n emissiveMapUv: j2 && E2(r3.emissiveMap.channel),\n metalnessMapUv: Z2 && E2(r3.metalnessMap.channel),\n roughnessMapUv: $2 && E2(r3.roughnessMap.channel),\n anisotropyMapUv: re2 && E2(r3.anisotropyMap.channel),\n clearcoatMapUv: ae2 && E2(r3.clearcoatMap.channel),\n clearcoatNormalMapUv: oe2 && E2(r3.clearcoatNormalMap.channel),\n clearcoatRoughnessMapUv: se2 && E2(r3.clearcoatRoughnessMap.channel),\n iridescenceMapUv: le2 && E2(r3.iridescenceMap.channel),\n iridescenceThicknessMapUv: ce2 && E2(r3.iridescenceThicknessMap.channel),\n sheenColorMapUv: de2 && E2(r3.sheenColorMap.channel),\n sheenRoughnessMapUv: ue2 && E2(r3.sheenRoughnessMap.channel),\n specularMapUv: fe2 && E2(r3.specularMap.channel),\n specularColorMapUv: pe2 && E2(r3.specularColorMap.channel),\n specularIntensityMapUv: me2 && E2(r3.specularIntensityMap.channel),\n transmissionMapUv: Ee2 && E2(r3.transmissionMap.channel),\n thicknessMapUv: xe2 && E2(r3.thicknessMap.channel),\n alphaMapUv: Ae2 && E2(r3.alphaMap.channel),\n vertexTangents: !!x2.attributes.tangent && (Y2 || Q2),\n vertexNormals: !!x2.attributes.normal,\n vertexColors: r3.vertexColors,\n vertexAlphas: true === r3.vertexColors && !!x2.attributes.color && 4 === x2.attributes.color.itemSize,\n pointsUvs: true === S2.isPoints && !!x2.attributes.uv && (V2 || Ae2),\n fog: !!T2,\n useFog: true === r3.fog,\n fogExp2: !!T2 && T2.isFogExp2,\n flatShading: false === r3.wireframe && (true === r3.flatShading || void 0 === x2.attributes.normal && false === Y2 && (r3.isMeshLambertMaterial || r3.isMeshPhongMaterial || r3.isMeshStandardMaterial || r3.isMeshPhysicalMaterial)),\n sizeAttenuation: true === r3.sizeAttenuation,\n logarithmicDepthBuffer: h2,\n reversedDepthBuffer: B2,\n skinning: true === S2.isSkinnedMesh,\n hasPositionAttribute: void 0 !== x2.attributes.position,\n morphTargets: void 0 !== x2.morphAttributes.position,\n morphNormals: void 0 !== x2.morphAttributes.normal,\n morphColors: void 0 !== x2.morphAttributes.color,\n morphTargetsCount: D2,\n morphTextureStride: O2,\n numDirLights: s3.directional.length,\n numPointLights: s3.point.length,\n numSpotLights: s3.spot.length,\n numSpotLightMaps: s3.spotLightMap.length,\n numRectAreaLights: s3.rectArea.length,\n numHemiLights: s3.hemi.length,\n numDirLightShadows: s3.directionalShadowMap.length,\n numPointLightShadows: s3.pointShadowMap.length,\n numSpotLightShadows: s3.spotShadowMap.length,\n numSpotLightShadowsWithMaps: s3.numSpotLightShadowsWithMaps,\n numLightProbes: s3.numLightProbes,\n numLightProbeGrids: M2.length,\n numClippingPlanes: o2.numPlanes,\n numClipIntersection: o2.numIntersection,\n dithering: r3.dithering,\n shadowMapEnabled: e2.shadowMap.enabled && u3.length > 0,\n shadowMapType: e2.shadowMap.type,\n toneMapping: Le2,\n decodeVideoTexture: V2 && true === r3.map.isVideoTexture && Ri.getTransfer(r3.map.colorSpace) === rs,\n decodeVideoTextureEmissive: j2 && true === r3.emissiveMap.isVideoTexture && Ri.getTransfer(r3.emissiveMap.colorSpace) === rs,\n premultipliedAlpha: r3.premultipliedAlpha,\n doubleSided: r3.side === p,\n flipSided: r3.side === d,\n useDepthPacking: r3.depthPacking >= 0,\n depthPacking: r3.depthPacking || 0,\n index0AttributeName: r3.index0AttributeName,\n extensionClipCullDistance: Pe2 && true === r3.extensions.clipCullDistance && n2.has(\"WEBGL_clip_cull_distance\"),\n extensionMultiDraw: (Pe2 && true === r3.extensions.multiDraw || H2) && n2.has(\"WEBGL_multi_draw\"),\n rendererExtensionParallelShaderCompile: n2.has(\"KHR_parallel_shader_compile\"),\n customProgramCacheKey: r3.customProgramCacheKey()\n };\n var De2;\n return Ue2.vertexUv1s = d2.has(1), Ue2.vertexUv2s = d2.has(2), Ue2.vertexUv3s = d2.has(3), d2.clear(), Ue2;\n },\n getProgramCacheKey: function(t3) {\n const n3 = [];\n if (t3.shaderID ? n3.push(t3.shaderID) : (n3.push(t3.customVertexShaderID), n3.push(t3.customFragmentShaderID)), void 0 !== t3.defines)\n for (const e3 in t3.defines) n3.push(e3), n3.push(t3.defines[e3]);\n return false === t3.isRawShaderMaterial && (!(function(e3, t4) {\n e3.push(t4.precision), e3.push(t4.outputColorSpace), e3.push(t4.envMapMode), e3.push(t4.envMapCubeUVHeight), e3.push(t4.mapUv), e3.push(t4.alphaMapUv), e3.push(t4.lightMapUv), e3.push(t4.aoMapUv), e3.push(t4.bumpMapUv), e3.push(t4.normalMapUv), e3.push(t4.displacementMapUv), e3.push(t4.emissiveMapUv), e3.push(t4.metalnessMapUv), e3.push(t4.roughnessMapUv), e3.push(t4.anisotropyMapUv), e3.push(t4.clearcoatMapUv), e3.push(t4.clearcoatNormalMapUv), e3.push(t4.clearcoatRoughnessMapUv), e3.push(t4.iridescenceMapUv), e3.push(t4.iridescenceThicknessMapUv), e3.push(t4.sheenColorMapUv), e3.push(t4.sheenRoughnessMapUv), e3.push(t4.specularMapUv), e3.push(t4.specularColorMapUv), e3.push(t4.specularIntensityMapUv), e3.push(t4.transmissionMapUv), e3.push(t4.thicknessMapUv), e3.push(t4.combine), e3.push(t4.fogExp2), e3.push(t4.sizeAttenuation), e3.push(t4.morphTargetsCount), e3.push(t4.morphAttributeCount), e3.push(t4.numDirLights), e3.push(t4.numPointLights), e3.push(t4.numSpotLights), e3.push(t4.numSpotLightMaps), e3.push(t4.numHemiLights), e3.push(t4.numRectAreaLights), e3.push(t4.numDirLightShadows), e3.push(t4.numPointLightShadows), e3.push(t4.numSpotLightShadows), e3.push(t4.numSpotLightShadowsWithMaps), e3.push(t4.numLightProbes), e3.push(t4.shadowMapType), e3.push(t4.toneMapping), e3.push(t4.numClippingPlanes), e3.push(t4.numClipIntersection), e3.push(t4.depthPacking);\n })(n3, t3), (function(e3, t4) {\n s2.disableAll(), t4.instancing && s2.enable(0);\n t4.instancingColor && s2.enable(1);\n t4.instancingMorph && s2.enable(2);\n t4.matcap && s2.enable(3);\n t4.envMap && s2.enable(4);\n t4.normalMapObjectSpace && s2.enable(5);\n t4.normalMapTangentSpace && s2.enable(6);\n t4.clearcoat && s2.enable(7);\n t4.iridescence && s2.enable(8);\n t4.alphaTest && s2.enable(9);\n t4.vertexColors && s2.enable(10);\n t4.vertexAlphas && s2.enable(11);\n t4.vertexUv1s && s2.enable(12);\n t4.vertexUv2s && s2.enable(13);\n t4.vertexUv3s && s2.enable(14);\n t4.vertexTangents && s2.enable(15);\n t4.anisotropy && s2.enable(16);\n t4.alphaHash && s2.enable(17);\n t4.batching && s2.enable(18);\n t4.dispersion && s2.enable(19);\n t4.batchingColor && s2.enable(20);\n t4.gradientMap && s2.enable(21);\n t4.packedNormalMap && s2.enable(22);\n t4.vertexNormals && s2.enable(23);\n e3.push(s2.mask), s2.disableAll(), t4.fog && s2.enable(0);\n t4.useFog && s2.enable(1);\n t4.flatShading && s2.enable(2);\n t4.logarithmicDepthBuffer && s2.enable(3);\n t4.reversedDepthBuffer && s2.enable(4);\n t4.skinning && s2.enable(5);\n t4.morphTargets && s2.enable(6);\n t4.morphNormals && s2.enable(7);\n t4.morphColors && s2.enable(8);\n t4.premultipliedAlpha && s2.enable(9);\n t4.shadowMapEnabled && s2.enable(10);\n t4.doubleSided && s2.enable(11);\n t4.flipSided && s2.enable(12);\n t4.useDepthPacking && s2.enable(13);\n t4.dithering && s2.enable(14);\n t4.transmission && s2.enable(15);\n t4.sheen && s2.enable(16);\n t4.opaque && s2.enable(17);\n t4.pointsUvs && s2.enable(18);\n t4.decodeVideoTexture && s2.enable(19);\n t4.decodeVideoTextureEmissive && s2.enable(20);\n t4.alphaToCoverage && s2.enable(21);\n t4.numLightProbeGrids > 0 && s2.enable(22);\n t4.hasPositionAttribute && s2.enable(23);\n e3.push(s2.mask);\n })(n3, t3), n3.push(e2.outputColorSpace)), n3.push(t3.customProgramCacheKey), n3.join();\n },\n getUniforms: function(e3) {\n const t3 = g2[e3.type];\n let n3;\n if (t3) {\n const e4 = Hn2[t3];\n n3 = Yl.clone(e4.uniforms);\n } else n3 = e3.uniforms;\n return n3;\n },\n acquireProgram: function(t3, n3) {\n let i3 = m2.get(n3);\n return void 0 !== i3 ? ++i3.usedTimes : (i3 = new jr2(e2, n3, t3, r2), u2.push(i3), m2.set(n3, i3)), i3;\n },\n releaseProgram: function(e3) {\n if (0 === --e3.usedTimes) {\n const t3 = u2.indexOf(e3);\n u2[t3] = u2[u2.length - 1], u2.pop(), m2.delete(e3.cacheKey), e3.destroy();\n }\n },\n releaseShaderCache: function(e3) {\n l2.remove(e3);\n },\n programs: u2,\n dispose: function() {\n l2.dispose();\n }\n };\n }\n function ea2() {\n let e2 = /* @__PURE__ */ new WeakMap();\n return {\n has: function(t2) {\n return e2.has(t2);\n },\n get: function(t2) {\n let n2 = e2.get(t2);\n return void 0 === n2 && (n2 = {}, e2.set(t2, n2)), n2;\n },\n remove: function(t2) {\n e2.delete(t2);\n },\n update: function(t2, n2, i2) {\n e2.get(t2)[n2] = i2;\n },\n dispose: function() {\n e2 = /* @__PURE__ */ new WeakMap();\n }\n };\n }\n function ta2(e2, t2) {\n return e2.groupOrder !== t2.groupOrder ? e2.groupOrder - t2.groupOrder : e2.renderOrder !== t2.renderOrder ? e2.renderOrder - t2.renderOrder : e2.material.id !== t2.material.id ? e2.material.id - t2.material.id : e2.materialVariant !== t2.materialVariant ? e2.materialVariant - t2.materialVariant : e2.z !== t2.z ? e2.z - t2.z : e2.id - t2.id;\n }\n function na2(e2, t2) {\n return e2.groupOrder !== t2.groupOrder ? e2.groupOrder - t2.groupOrder : e2.renderOrder !== t2.renderOrder ? e2.renderOrder - t2.renderOrder : e2.z !== t2.z ? t2.z - e2.z : e2.id - t2.id;\n }\n function ia2() {\n const e2 = [];\n let t2 = 0;\n const n2 = [], i2 = [], r2 = [];\n function a2(e3) {\n let t3 = 0;\n return e3.isInstancedMesh && (t3 += 2), e3.isSkinnedMesh && (t3 += 1), t3;\n }\n function o2(n3, i3, r3, o3, s2, l2) {\n let c2 = e2[t2];\n return void 0 === c2 ? (c2 = {\n id: n3.id,\n object: n3,\n geometry: i3,\n material: r3,\n materialVariant: a2(n3),\n groupOrder: o3,\n renderOrder: n3.renderOrder,\n z: s2,\n group: l2\n }, e2[t2] = c2) : (c2.id = n3.id, c2.object = n3, c2.geometry = i3, c2.material = r3, c2.materialVariant = a2(n3), c2.groupOrder = o3, c2.renderOrder = n3.renderOrder, c2.z = s2, c2.group = l2), t2++, c2;\n }\n return {\n opaque: n2,\n transmissive: i2,\n transparent: r2,\n init: function() {\n t2 = 0, n2.length = 0, i2.length = 0, r2.length = 0;\n },\n push: function(e3, t3, a3, s2, l2, c2) {\n const d2 = o2(e3, t3, a3, s2, l2, c2);\n a3.transmission > 0 ? i2.push(d2) : true === a3.transparent ? r2.push(d2) : n2.push(d2);\n },\n unshift: function(e3, t3, a3, s2, l2, c2) {\n const d2 = o2(e3, t3, a3, s2, l2, c2);\n a3.transmission > 0 ? i2.unshift(d2) : true === a3.transparent ? r2.unshift(d2) : n2.unshift(d2);\n },\n finish: function() {\n for (let n3 = t2, i3 = e2.length; n3 < i3; n3++) {\n const t3 = e2[n3];\n if (null === t3.id) break;\n t3.id = null, t3.object = null, t3.geometry = null, t3.material = null, t3.group = null;\n }\n },\n sort: function(e3, t3, a3) {\n n2.length > 1 && n2.sort(e3 || ta2), i2.length > 1 && i2.sort(t3 || na2), r2.length > 1 && r2.sort(t3 || na2), a3 && (n2.reverse(), i2.reverse(), r2.reverse());\n }\n };\n }\n function ra2() {\n let e2 = /* @__PURE__ */ new WeakMap();\n return {\n get: function(t2, n2) {\n const i2 = e2.get(t2);\n let r2;\n return void 0 === i2 ? (r2 = new ia2(), e2.set(t2, [r2])) : n2 >= i2.length ? (r2 = new ia2(), i2.push(r2)) : r2 = i2[n2], r2;\n },\n dispose: function() {\n e2 = /* @__PURE__ */ new WeakMap();\n }\n };\n }\n function aa2() {\n const e2 = {};\n return {\n get: function(t2) {\n if (void 0 !== e2[t2.id]) return e2[t2.id];\n let r2;\n switch (t2.type) {\n case \"DirectionalLight\":\n r2 = { direction: new Ti(), color: new Pr() };\n break;\n case \"SpotLight\":\n r2 = {\n position: new Ti(),\n direction: new Ti(),\n color: new Pr(),\n distance: 0,\n coneCos: 0,\n penumbraCos: 0,\n decay: 0\n };\n break;\n case \"PointLight\":\n r2 = { position: new Ti(), color: new Pr(), distance: 0, decay: 0 };\n break;\n case \"HemisphereLight\":\n r2 = { direction: new Ti(), skyColor: new Pr(), groundColor: new Pr() };\n break;\n case \"RectAreaLight\":\n r2 = { color: new Pr(), position: new Ti(), halfWidth: new Ti(), halfHeight: new Ti() };\n }\n return e2[t2.id] = r2, r2;\n }\n };\n }\n var oa2 = 0;\n function sa2(e2, t2) {\n return (t2.castShadow ? 2 : 0) - (e2.castShadow ? 2 : 0) + (t2.map ? 1 : 0) - (e2.map ? 1 : 0);\n }\n function la2(e2) {\n const n2 = new aa2(), r2 = /* @__PURE__ */ (function() {\n const e3 = {};\n return {\n get: function(n3) {\n if (void 0 !== e3[n3.id]) return e3[n3.id];\n let i2;\n switch (n3.type) {\n case \"DirectionalLight\":\n case \"SpotLight\":\n i2 = {\n shadowIntensity: 1,\n shadowBias: 0,\n shadowNormalBias: 0,\n shadowRadius: 1,\n shadowMapSize: new _i()\n };\n break;\n case \"PointLight\":\n i2 = {\n shadowIntensity: 1,\n shadowBias: 0,\n shadowNormalBias: 0,\n shadowRadius: 1,\n shadowMapSize: new _i(),\n shadowCameraNear: 1,\n shadowCameraFar: 1e3\n };\n }\n return e3[n3.id] = i2, i2;\n }\n };\n })(), a2 = {\n version: 0,\n hash: {\n directionalLength: -1,\n pointLength: -1,\n spotLength: -1,\n rectAreaLength: -1,\n hemiLength: -1,\n numDirectionalShadows: -1,\n numPointShadows: -1,\n numSpotShadows: -1,\n numSpotMaps: -1,\n numLightProbes: -1\n },\n ambient: [0, 0, 0],\n probe: [],\n directional: [],\n directionalShadow: [],\n directionalShadowMap: [],\n directionalShadowMatrix: [],\n spot: [],\n spotLightMap: [],\n spotShadow: [],\n spotShadowMap: [],\n spotLightMatrix: [],\n rectArea: [],\n rectAreaLTC1: null,\n rectAreaLTC2: null,\n point: [],\n pointShadow: [],\n pointShadowMap: [],\n pointShadowMatrix: [],\n hemi: [],\n numSpotLightShadowsWithMaps: 0,\n numLightProbes: 0\n };\n for (let e3 = 0; e3 < 9; e3++) a2.probe.push(new Ti());\n const o2 = new Ti(), s2 = new Qi(), l2 = new Qi();\n return {\n setup: function(t2) {\n let i2 = 0, o3 = 0, s3 = 0;\n for (let e3 = 0; e3 < 9; e3++) a2.probe[e3].set(0, 0, 0);\n let l3 = 0, c2 = 0, d2 = 0, u2 = 0, f2 = 0, p2 = 0, m2 = 0, h2 = 0, _2 = 0, g2 = 0, v2 = 0;\n t2.sort(sa2);\n for (let e3 = 0, E3 = t2.length; e3 < E3; e3++) {\n const E4 = t2[e3], S2 = E4.color, M2 = E4.intensity, T2 = E4.distance;\n let x2 = null;\n if (E4.shadow && E4.shadow.map && (x2 = E4.shadow.map.texture.format === Xt ? E4.shadow.map.texture : E4.shadow.map.depthTexture || E4.shadow.map.texture), E4.isAmbientLight)\n i2 += S2.r * M2, o3 += S2.g * M2, s3 += S2.b * M2;\n else if (E4.isLightProbe) {\n for (let e4 = 0; e4 < 9; e4++) a2.probe[e4].addScaledVector(E4.sh.coefficients[e4], M2);\n v2++;\n } else if (E4.isDirectionalLight) {\n const e4 = n2.get(E4);\n if (e4.color.copy(E4.color).multiplyScalar(E4.intensity), E4.castShadow) {\n const e5 = E4.shadow, t3 = r2.get(E4);\n t3.shadowIntensity = e5.intensity, t3.shadowBias = e5.bias, t3.shadowNormalBias = e5.normalBias, t3.shadowRadius = e5.radius, t3.shadowMapSize = e5.mapSize, a2.directionalShadow[l3] = t3, a2.directionalShadowMap[l3] = x2, a2.directionalShadowMatrix[l3] = E4.shadow.matrix, p2++;\n }\n a2.directional[l3] = e4, l3++;\n } else if (E4.isSpotLight) {\n const e4 = n2.get(E4);\n e4.position.setFromMatrixPosition(E4.matrixWorld), e4.color.copy(S2).multiplyScalar(M2), e4.distance = T2, e4.coneCos = Math.cos(E4.angle), e4.penumbraCos = Math.cos(E4.angle * (1 - E4.penumbra)), e4.decay = E4.decay, a2.spot[d2] = e4;\n const t3 = E4.shadow;\n if (E4.map && (a2.spotLightMap[_2] = E4.map, _2++, t3.updateMatrices(E4), E4.castShadow && g2++), a2.spotLightMatrix[d2] = t3.matrix, E4.castShadow) {\n const e5 = r2.get(E4);\n e5.shadowIntensity = t3.intensity, e5.shadowBias = t3.bias, e5.shadowNormalBias = t3.normalBias, e5.shadowRadius = t3.radius, e5.shadowMapSize = t3.mapSize, a2.spotShadow[d2] = e5, a2.spotShadowMap[d2] = x2, h2++;\n }\n d2++;\n } else if (E4.isRectAreaLight) {\n const e4 = n2.get(E4);\n e4.color.copy(S2).multiplyScalar(M2), e4.halfWidth.set(0.5 * E4.width, 0, 0), e4.halfHeight.set(0, 0.5 * E4.height, 0), a2.rectArea[u2] = e4, u2++;\n } else if (E4.isPointLight) {\n const e4 = n2.get(E4);\n if (e4.color.copy(E4.color).multiplyScalar(E4.intensity), e4.distance = E4.distance, e4.decay = E4.decay, E4.castShadow) {\n const e5 = E4.shadow, t3 = r2.get(E4);\n t3.shadowIntensity = e5.intensity, t3.shadowBias = e5.bias, t3.shadowNormalBias = e5.normalBias, t3.shadowRadius = e5.radius, t3.shadowMapSize = e5.mapSize, t3.shadowCameraNear = e5.camera.near, t3.shadowCameraFar = e5.camera.far, a2.pointShadow[c2] = t3, a2.pointShadowMap[c2] = x2, a2.pointShadowMatrix[c2] = E4.shadow.matrix, m2++;\n }\n a2.point[c2] = e4, c2++;\n } else if (E4.isHemisphereLight) {\n const e4 = n2.get(E4);\n e4.skyColor.copy(E4.color).multiplyScalar(M2), e4.groundColor.copy(E4.groundColor).multiplyScalar(M2), a2.hemi[f2] = e4, f2++;\n }\n }\n u2 > 0 && (true === e2.has(\"OES_texture_float_linear\") ? (a2.rectAreaLTC1 = Gn2.LTC_FLOAT_1, a2.rectAreaLTC2 = Gn2.LTC_FLOAT_2) : (a2.rectAreaLTC1 = Gn2.LTC_HALF_1, a2.rectAreaLTC2 = Gn2.LTC_HALF_2)), a2.ambient[0] = i2, a2.ambient[1] = o3, a2.ambient[2] = s3;\n const E2 = a2.hash;\n E2.directionalLength === l3 && E2.pointLength === c2 && E2.spotLength === d2 && E2.rectAreaLength === u2 && E2.hemiLength === f2 && E2.numDirectionalShadows === p2 && E2.numPointShadows === m2 && E2.numSpotShadows === h2 && E2.numSpotMaps === _2 && E2.numLightProbes === v2 || (a2.directional.length = l3, a2.spot.length = d2, a2.rectArea.length = u2, a2.point.length = c2, a2.hemi.length = f2, a2.directionalShadow.length = p2, a2.directionalShadowMap.length = p2, a2.pointShadow.length = m2, a2.pointShadowMap.length = m2, a2.spotShadow.length = h2, a2.spotShadowMap.length = h2, a2.directionalShadowMatrix.length = p2, a2.pointShadowMatrix.length = m2, a2.spotLightMatrix.length = h2 + _2 - g2, a2.spotLightMap.length = _2, a2.numSpotLightShadowsWithMaps = g2, a2.numLightProbes = v2, E2.directionalLength = l3, E2.pointLength = c2, E2.spotLength = d2, E2.rectAreaLength = u2, E2.hemiLength = f2, E2.numDirectionalShadows = p2, E2.numPointShadows = m2, E2.numSpotShadows = h2, E2.numSpotMaps = _2, E2.numLightProbes = v2, a2.version = oa2++);\n },\n setupView: function(e3, t2) {\n let n3 = 0, i2 = 0, r3 = 0, c2 = 0, d2 = 0;\n const u2 = t2.matrixWorldInverse;\n for (let t3 = 0, f2 = e3.length; t3 < f2; t3++) {\n const f3 = e3[t3];\n if (f3.isDirectionalLight) {\n const e4 = a2.directional[n3];\n e4.direction.setFromMatrixPosition(f3.matrixWorld), o2.setFromMatrixPosition(f3.target.matrixWorld), e4.direction.sub(o2), e4.direction.transformDirection(u2), n3++;\n } else if (f3.isSpotLight) {\n const e4 = a2.spot[r3];\n e4.position.setFromMatrixPosition(f3.matrixWorld), e4.position.applyMatrix4(u2), e4.direction.setFromMatrixPosition(f3.matrixWorld), o2.setFromMatrixPosition(f3.target.matrixWorld), e4.direction.sub(o2), e4.direction.transformDirection(u2), r3++;\n } else if (f3.isRectAreaLight) {\n const e4 = a2.rectArea[c2];\n e4.position.setFromMatrixPosition(f3.matrixWorld), e4.position.applyMatrix4(u2), l2.identity(), s2.copy(f3.matrixWorld), s2.premultiply(u2), l2.extractRotation(s2), e4.halfWidth.set(0.5 * f3.width, 0, 0), e4.halfHeight.set(0, 0.5 * f3.height, 0), e4.halfWidth.applyMatrix4(l2), e4.halfHeight.applyMatrix4(l2), c2++;\n } else if (f3.isPointLight) {\n const e4 = a2.point[i2];\n e4.position.setFromMatrixPosition(f3.matrixWorld), e4.position.applyMatrix4(u2), i2++;\n } else if (f3.isHemisphereLight) {\n const e4 = a2.hemi[d2];\n e4.direction.setFromMatrixPosition(f3.matrixWorld), e4.direction.transformDirection(u2), d2++;\n }\n }\n },\n state: a2\n };\n }\n function ca2(e2) {\n const t2 = new la2(e2), n2 = [], i2 = [], r2 = [];\n const a2 = {\n lightsArray: n2,\n shadowsArray: i2,\n lightProbeGridArray: r2,\n camera: null,\n lights: t2,\n transmissionRenderTarget: {},\n textureUnits: 0\n };\n return {\n init: function(e3) {\n a2.camera = e3, n2.length = 0, i2.length = 0, r2.length = 0;\n },\n state: a2,\n setupLights: function() {\n t2.setup(n2);\n },\n setupLightsView: function(e3) {\n t2.setupView(n2, e3);\n },\n pushLight: function(e3) {\n n2.push(e3);\n },\n pushShadow: function(e3) {\n i2.push(e3);\n },\n pushLightProbeGrid: function(e3) {\n r2.push(e3);\n }\n };\n }\n function da2(e2) {\n let t2 = /* @__PURE__ */ new WeakMap();\n return {\n get: function(n2, i2 = 0) {\n const r2 = t2.get(n2);\n let a2;\n return void 0 === r2 ? (a2 = new ca2(e2), t2.set(n2, [a2])) : i2 >= r2.length ? (a2 = new ca2(e2), r2.push(a2)) : a2 = r2[i2], a2;\n },\n dispose: function() {\n t2 = /* @__PURE__ */ new WeakMap();\n }\n };\n }\n var ua2 = [\n new Ti(1, 0, 0),\n new Ti(-1, 0, 0),\n new Ti(0, 1, 0),\n new Ti(0, -1, 0),\n new Ti(0, 0, 1),\n new Ti(0, 0, -1)\n ];\n var fa2 = [\n new Ti(0, -1, 0),\n new Ti(0, -1, 0),\n new Ti(0, 0, 1),\n new Ti(0, 0, -1),\n new Ti(0, -1, 0),\n new Ti(0, -1, 0)\n ];\n var pa2 = new Qi();\n var ma2 = new Ti();\n var ha2 = new Ti();\n function _a2(e2, n2, i2) {\n let r2 = new mo();\n const a2 = new _i(), s2 = new _i(), d2 = new qi(), u2 = new ic(), f2 = new rc(), p2 = {}, m2 = i2.maxTextureSize, _2 = { [u]: d, [d]: u, [p]: p }, g2 = new Zl({\n defines: { VSM_SAMPLES: 8 },\n uniforms: {\n shadow_pass: { value: null },\n resolution: { value: new _i() },\n radius: { value: 4 }\n },\n vertexShader: \"void main() {\\n\tgl_Position = vec4( position, 1.0 );\\n}\",\n fragmentShader: \"uniform sampler2D shadow_pass;\\nuniform vec2 resolution;\\nuniform float radius;\\nvoid main() {\\n\tconst float samples = float( VSM_SAMPLES );\\n\tfloat mean = 0.0;\\n\tfloat squared_mean = 0.0;\\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\\n\tfor ( float i = 0.0; i < samples; i ++ ) {\\n\t\tfloat uvOffset = uvStart + i * uvStride;\\n\t\t#ifdef HORIZONTAL_PASS\\n\t\t\tvec2 distribution = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ).rg;\\n\t\t\tmean += distribution.x;\\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\\n\t\t#else\\n\t\t\tfloat depth = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ).r;\\n\t\t\tmean += depth;\\n\t\t\tsquared_mean += depth * depth;\\n\t\t#endif\\n\t}\\n\tmean = mean / samples;\\n\tsquared_mean = squared_mean / samples;\\n\tfloat std_dev = sqrt( max( 0.0, squared_mean - mean * mean ) );\\n\tgl_FragColor = vec4( mean, std_dev, 0.0, 1.0 );\\n}\"\n }), S2 = g2.clone();\n S2.defines.HORIZONTAL_PASS = 1;\n const T2 = new Wn();\n T2.setAttribute(\"position\", new Mn(new Float32Array([-1, -1, 0.5, 3, -1, 0.5, -1, 3, 0.5]), 3));\n const x2 = new Ra(T2, g2), R2 = this;\n this.enabled = false, this.autoUpdate = true, this.needsUpdate = false, this.type = h;\n let A2 = this.type;\n function C2(t2, i3) {\n const r3 = n2.update(x2);\n g2.defines.VSM_SAMPLES !== t2.blurSamples && (g2.defines.VSM_SAMPLES = t2.blurSamples, S2.defines.VSM_SAMPLES = t2.blurSamples, g2.needsUpdate = true, S2.needsUpdate = true), null === t2.mapPass && (t2.mapPass = new Xi(a2.x, a2.y, { format: Xt, type: Rt })), g2.uniforms.shadow_pass.value = t2.map.depthTexture, g2.uniforms.resolution.value = t2.mapSize, g2.uniforms.radius.value = t2.radius, e2.setRenderTarget(t2.mapPass), e2.clear(), e2.renderBufferDirect(i3, null, r3, g2, x2, null), S2.uniforms.shadow_pass.value = t2.mapPass.texture, S2.uniforms.resolution.value = t2.mapSize, S2.uniforms.radius.value = t2.radius, e2.setRenderTarget(t2.map), e2.clear(), e2.renderBufferDirect(i3, null, r3, S2, x2, null);\n }\n function P2(t2, n3, i3, r3) {\n let a3 = null;\n const o2 = true === i3.isPointLight ? t2.customDistanceMaterial : t2.customDepthMaterial;\n if (void 0 !== o2) a3 = o2;\n else if (a3 = true === i3.isPointLight ? f2 : u2, e2.localClippingEnabled && true === n3.clipShadows && Array.isArray(n3.clippingPlanes) && 0 !== n3.clippingPlanes.length || n3.displacementMap && 0 !== n3.displacementScale || n3.alphaMap && n3.alphaTest > 0 || n3.map && n3.alphaTest > 0 || true === n3.alphaToCoverage) {\n const e3 = a3.uuid, t3 = n3.uuid;\n let i4 = p2[e3];\n void 0 === i4 && (i4 = {}, p2[e3] = i4);\n let r4 = i4[t3];\n void 0 === r4 && (r4 = a3.clone(), i4[t3] = r4, n3.addEventListener(\"dispose\", U2)), a3 = r4;\n }\n if (a3.visible = n3.visible, a3.wireframe = n3.wireframe, a3.side = r3 === c ? null !== n3.shadowSide ? n3.shadowSide : n3.side : null !== n3.shadowSide ? n3.shadowSide : _2[n3.side], a3.alphaMap = n3.alphaMap, a3.alphaTest = true === n3.alphaToCoverage ? 0.5 : n3.alphaTest, a3.map = n3.map, a3.clipShadows = n3.clipShadows, a3.clippingPlanes = n3.clippingPlanes, a3.clipIntersection = n3.clipIntersection, a3.displacementMap = n3.displacementMap, a3.displacementScale = n3.displacementScale, a3.displacementBias = n3.displacementBias, a3.wireframeLinewidth = n3.wireframeLinewidth, a3.linewidth = n3.linewidth, true === i3.isPointLight && true === a3.isMeshDistanceMaterial) {\n e2.properties.get(a3).light = i3;\n }\n return a3;\n }\n function L2(t2, i3, a3, o2, s3) {\n if (false === t2.visible) return;\n if (t2.layers.test(i3.layers) && (t2.isMesh || t2.isLine || t2.isPoints) && (t2.castShadow || t2.receiveShadow && s3 === c) && (!t2.frustumCulled || r2.intersectsObject(t2))) {\n t2.modelViewMatrix.multiplyMatrices(a3.matrixWorldInverse, t2.matrixWorld);\n const r3 = n2.update(t2), l3 = t2.material;\n if (Array.isArray(l3)) {\n const n3 = r3.groups;\n for (let c2 = 0, d3 = n3.length; c2 < d3; c2++) {\n const d4 = n3[c2], u3 = l3[d4.materialIndex];\n if (u3 && u3.visible) {\n const n4 = P2(t2, u3, o2, s3);\n t2.onBeforeShadow(e2, t2, i3, a3, r3, n4, d4), e2.renderBufferDirect(a3, null, r3, n4, t2, d4), t2.onAfterShadow(e2, t2, i3, a3, r3, n4, d4);\n }\n }\n } else if (l3.visible) {\n const n3 = P2(t2, l3, o2, s3);\n t2.onBeforeShadow(e2, t2, i3, a3, r3, n3, null), e2.renderBufferDirect(a3, null, r3, n3, t2, null), t2.onAfterShadow(e2, t2, i3, a3, r3, n3, null);\n }\n }\n const l2 = t2.children;\n for (let e3 = 0, t3 = l2.length; e3 < t3; e3++) L2(l2[e3], i3, a3, o2, s3);\n }\n function U2(e3) {\n e3.target.removeEventListener(\"dispose\", U2);\n for (const t2 in p2) {\n const n3 = p2[t2], i3 = e3.target.uuid;\n if (i3 in n3) {\n n3[i3].dispose(), delete n3[i3];\n }\n }\n }\n this.render = function(t2, n3, i3) {\n if (false === R2.enabled) return;\n if (false === R2.autoUpdate && false === R2.needsUpdate) return;\n if (0 === t2.length) return;\n this.type === l && (ai(\"WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead.\"), this.type = h);\n const o2 = e2.getRenderTarget(), l2 = e2.getActiveCubeFace(), c2 = e2.getActiveMipmapLevel(), u3 = e2.state;\n u3.setBlending(m), true === u3.buffers.depth.getReversed() ? u3.buffers.color.setClear(0, 0, 0, 0) : u3.buffers.color.setClear(1, 1, 1, 1), u3.buffers.depth.setTest(true), u3.setScissorTest(false);\n const f3 = A2 !== this.type;\n f3 && n3.traverse(function(e3) {\n e3.material && (Array.isArray(e3.material) ? e3.material.forEach((e4) => e4.needsUpdate = true) : e3.material.needsUpdate = true);\n });\n for (let o3 = 0, l3 = t2.length; o3 < l3; o3++) {\n const l4 = t2[o3], c3 = l4.shadow;\n if (void 0 === c3) {\n ai(\"WebGLShadowMap:\", l4, \"has no shadow.\");\n continue;\n }\n if (false === c3.autoUpdate && false === c3.needsUpdate) continue;\n a2.copy(c3.mapSize);\n const p3 = c3.getFrameExtents();\n a2.multiply(p3), s2.copy(c3.mapSize), (a2.x > m2 || a2.y > m2) && (a2.x > m2 && (s2.x = Math.floor(m2 / p3.x), a2.x = s2.x * p3.x, c3.mapSize.x = s2.x), a2.y > m2 && (s2.y = Math.floor(m2 / p3.y), a2.y = s2.y * p3.y, c3.mapSize.y = s2.y));\n const h2 = e2.state.buffers.depth.getReversed();\n if (c3.camera._reversedDepth = h2, null === c3.map || true === f3) {\n if (null !== c3.map && (null !== c3.map.depthTexture && (c3.map.depthTexture.dispose(), c3.map.depthTexture = null), c3.map.dispose()), this.type === c) {\n if (l4.isPointLight) {\n ai(\n \"WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.\"\n );\n continue;\n }\n c3.map = new Xi(a2.x, a2.y, {\n format: Xt,\n type: Rt,\n minFilter: Mt,\n magFilter: Mt,\n generateMipmaps: false\n }), c3.map.texture.name = l4.name + \".shadowMap\", c3.map.depthTexture = new dh(a2.x, a2.y, Pt), c3.map.depthTexture.name = l4.name + \".shadowMapDepth\", c3.map.depthTexture.format = Wt, c3.map.depthTexture.compareFunction = null, c3.map.depthTexture.minFilter = ft, c3.map.depthTexture.magFilter = ft;\n } else\n l4.isPointLight ? (c3.map = new di2(a2.x), c3.map.depthTexture = new ph(a2.x, Ot)) : (c3.map = new Xi(a2.x, a2.y), c3.map.depthTexture = new dh(a2.x, a2.y, Ot)), c3.map.depthTexture.name = l4.name + \".shadowMap\", c3.map.depthTexture.format = Wt, this.type === h ? (c3.map.depthTexture.compareFunction = h2 ? Bs : zs, c3.map.depthTexture.minFilter = Mt, c3.map.depthTexture.magFilter = Mt) : (c3.map.depthTexture.compareFunction = null, c3.map.depthTexture.minFilter = ft, c3.map.depthTexture.magFilter = ft);\n c3.camera.updateProjectionMatrix();\n }\n const _3 = c3.map.isWebGLCubeRenderTarget ? 6 : 1;\n for (let t3 = 0; t3 < _3; t3++) {\n if (c3.map.isWebGLCubeRenderTarget) e2.setRenderTarget(c3.map, t3), e2.clear();\n else {\n 0 === t3 && (e2.setRenderTarget(c3.map), e2.clear());\n const n4 = c3.getViewport(t3);\n d2.set(s2.x * n4.x, s2.y * n4.y, s2.x * n4.z, s2.y * n4.w), u3.viewport(d2);\n }\n if (l4.isPointLight) {\n const e3 = c3.camera, n4 = c3.matrix, i4 = l4.distance || e3.far;\n i4 !== e3.far && (e3.far = i4, e3.updateProjectionMatrix()), ma2.setFromMatrixPosition(l4.matrixWorld), e3.position.copy(ma2), ha2.copy(e3.position), ha2.add(ua2[t3]), e3.up.copy(fa2[t3]), e3.lookAt(ha2), e3.updateMatrixWorld(), n4.makeTranslation(-ma2.x, -ma2.y, -ma2.z), pa2.multiplyMatrices(e3.projectionMatrix, e3.matrixWorldInverse), c3._frustum.setFromProjectionMatrix(pa2, e3.coordinateSystem, e3.reversedDepth);\n } else c3.updateMatrices(l4);\n r2 = c3.getFrustum(), L2(n3, i3, c3.camera, l4, this.type);\n }\n true !== c3.isPointLightShadow && this.type === c && C2(c3, i3), c3.needsUpdate = false;\n }\n A2 = this.type, R2.needsUpdate = false, e2.setRenderTarget(o2, l2, c2);\n };\n }\n function ga2(e2, t2) {\n const i2 = new (function() {\n let t3 = false;\n const n2 = new qi();\n let i3 = null;\n const r3 = new qi(0, 0, 0, 0);\n return {\n setMask: function(n3) {\n i3 === n3 || t3 || (e2.colorMask(n3, n3, n3, n3), i3 = n3);\n },\n setLocked: function(e3) {\n t3 = e3;\n },\n setClear: function(t4, i4, a3, o3, s3) {\n true === s3 && (t4 *= o3, i4 *= o3, a3 *= o3), n2.set(t4, i4, a3, o3), false === r3.equals(n2) && (e2.clearColor(t4, i4, a3, o3), r3.copy(n2));\n },\n reset: function() {\n t3 = false, i3 = null, r3.set(-1, 0, 0, 0);\n }\n };\n })(), r2 = new (function() {\n let n2 = false, i3 = false, r3 = null, a3 = null, o3 = null;\n return {\n setReversed: function(e3) {\n if (i3 !== e3) {\n const n3 = t2.get(\"EXT_clip_control\");\n e3 ? n3.clipControlEXT(n3.LOWER_LEFT_EXT, n3.ZERO_TO_ONE_EXT) : n3.clipControlEXT(n3.LOWER_LEFT_EXT, n3.NEGATIVE_ONE_TO_ONE_EXT), i3 = e3;\n const r4 = o3;\n o3 = null, this.setClear(r4);\n }\n },\n getReversed: function() {\n return i3;\n },\n setTest: function(t3) {\n t3 ? X2(e2.DEPTH_TEST) : Y2(e2.DEPTH_TEST);\n },\n setMask: function(t3) {\n r3 === t3 || n2 || (e2.depthMask(t3), r3 = t3);\n },\n setFunc: function(t3) {\n if (i3 && (t3 = ui[t3]), a3 !== t3) {\n switch (t3) {\n case U:\n e2.depthFunc(e2.NEVER);\n break;\n case j:\n e2.depthFunc(e2.ALWAYS);\n break;\n case W:\n e2.depthFunc(e2.LESS);\n break;\n case J:\n e2.depthFunc(e2.LEQUAL);\n break;\n case q:\n e2.depthFunc(e2.EQUAL);\n break;\n case H:\n e2.depthFunc(e2.GEQUAL);\n break;\n case X:\n e2.depthFunc(e2.GREATER);\n break;\n case Y:\n e2.depthFunc(e2.NOTEQUAL);\n break;\n default:\n e2.depthFunc(e2.LEQUAL);\n }\n a3 = t3;\n }\n },\n setLocked: function(e3) {\n n2 = e3;\n },\n setClear: function(t3) {\n o3 !== t3 && (o3 = t3, i3 && (t3 = 1 - t3), e2.clearDepth(t3));\n },\n reset: function() {\n n2 = false, r3 = null, a3 = null, o3 = null, i3 = false;\n }\n };\n })(), a2 = new (function() {\n let t3 = false, n2 = null, i3 = null, r3 = null, a3 = null, o3 = null, s3 = null, l3 = null, c2 = null;\n return {\n setTest: function(n3) {\n t3 || (n3 ? X2(e2.STENCIL_TEST) : Y2(e2.STENCIL_TEST));\n },\n setMask: function(i4) {\n n2 === i4 || t3 || (e2.stencilMask(i4), n2 = i4);\n },\n setFunc: function(t4, n3, o4) {\n i3 === t4 && r3 === n3 && a3 === o4 || (e2.stencilFunc(t4, n3, o4), i3 = t4, r3 = n3, a3 = o4);\n },\n setOp: function(t4, n3, i4) {\n o3 === t4 && s3 === n3 && l3 === i4 || (e2.stencilOp(t4, n3, i4), o3 = t4, s3 = n3, l3 = i4);\n },\n setLocked: function(e3) {\n t3 = e3;\n },\n setClear: function(t4) {\n c2 !== t4 && (e2.clearStencil(t4), c2 = t4);\n },\n reset: function() {\n t3 = false, n2 = null, i3 = null, r3 = null, a3 = null, o3 = null, s3 = null, l3 = null, c2 = null;\n }\n };\n })(), o2 = /* @__PURE__ */ new WeakMap(), s2 = /* @__PURE__ */ new WeakMap();\n let l2 = {}, d2 = {}, u2 = {}, f2 = /* @__PURE__ */ new WeakMap(), p2 = [], m2 = null, h2 = false, _2 = null, g2 = null, v2 = null, E2 = null, S2 = null, M2 = null, T2 = null, x2 = new Pr(0, 0, 0), R2 = 0, A2 = false, b2 = null, C2 = null, P2 = null, L2 = null, U2 = null;\n const I2 = e2.getParameter(e2.MAX_COMBINED_TEXTURE_IMAGE_UNITS);\n let N2 = false, y2 = 0;\n const O2 = e2.getParameter(e2.VERSION);\n -1 !== O2.indexOf(\"WebGL\") ? (y2 = parseFloat(/^WebGL (\\d)/.exec(O2)[1]), N2 = y2 >= 1) : -1 !== O2.indexOf(\"OpenGL ES\") && (y2 = parseFloat(/^OpenGL ES (\\d)/.exec(O2)[1]), N2 = y2 >= 2);\n let F2 = null, B2 = {};\n const G2 = e2.getParameter(e2.SCISSOR_BOX), H2 = e2.getParameter(e2.VIEWPORT), V2 = new qi().fromArray(G2), W2 = new qi().fromArray(H2);\n function z2(t3, n2, i3, r3) {\n const a3 = new Uint8Array(4), o3 = e2.createTexture();\n e2.bindTexture(t3, o3), e2.texParameteri(t3, e2.TEXTURE_MIN_FILTER, e2.NEAREST), e2.texParameteri(t3, e2.TEXTURE_MAG_FILTER, e2.NEAREST);\n for (let o4 = 0; o4 < i3; o4++)\n t3 === e2.TEXTURE_3D || t3 === e2.TEXTURE_2D_ARRAY ? e2.texImage3D(n2, 0, e2.RGBA, 1, 1, r3, 0, e2.RGBA, e2.UNSIGNED_BYTE, a3) : e2.texImage2D(n2 + o4, 0, e2.RGBA, 1, 1, 0, e2.RGBA, e2.UNSIGNED_BYTE, a3);\n return o3;\n }\n const k2 = {};\n function X2(t3) {\n true !== l2[t3] && (e2.enable(t3), l2[t3] = true);\n }\n function Y2(t3) {\n false !== l2[t3] && (e2.disable(t3), l2[t3] = false);\n }\n k2[e2.TEXTURE_2D] = z2(e2.TEXTURE_2D, e2.TEXTURE_2D, 1), k2[e2.TEXTURE_CUBE_MAP] = z2(e2.TEXTURE_CUBE_MAP, e2.TEXTURE_CUBE_MAP_POSITIVE_X, 6), k2[e2.TEXTURE_2D_ARRAY] = z2(e2.TEXTURE_2D_ARRAY, e2.TEXTURE_2D_ARRAY, 1, 1), k2[e2.TEXTURE_3D] = z2(e2.TEXTURE_3D, e2.TEXTURE_3D, 1, 1), i2.setClear(0, 0, 0, 1), r2.setClear(1), a2.setClear(0), X2(e2.DEPTH_TEST), r2.setFunc(J), $2(false), Q2(r), X2(e2.CULL_FACE), Z2(m);\n const q2 = { [w]: e2.FUNC_ADD, [M]: e2.FUNC_SUBTRACT, [S]: e2.FUNC_REVERSE_SUBTRACT };\n q2[_] = e2.MIN, q2[A] = e2.MAX;\n const j2 = {\n [T]: e2.ZERO,\n [z]: e2.ONE,\n [C]: e2.SRC_COLOR,\n [B]: e2.SRC_ALPHA,\n [N]: e2.SRC_ALPHA_SATURATE,\n [R]: e2.DST_COLOR,\n [O]: e2.DST_ALPHA,\n [I]: e2.ONE_MINUS_SRC_COLOR,\n [k]: e2.ONE_MINUS_SRC_ALPHA,\n [E]: e2.ONE_MINUS_DST_COLOR,\n [P]: e2.ONE_MINUS_DST_ALPHA,\n [V]: e2.CONSTANT_COLOR,\n [L]: e2.ONE_MINUS_CONSTANT_COLOR,\n [F]: e2.CONSTANT_ALPHA,\n [D]: e2.ONE_MINUS_CONSTANT_ALPHA\n };\n function Z2(t3, n2, i3, r3, a3, o3, s3, l3, c2, d3) {\n if (t3 !== m) {\n if (false === h2 && (X2(e2.BLEND), h2 = true), t3 === b)\n a3 = a3 || n2, o3 = o3 || i3, s3 = s3 || r3, n2 === g2 && a3 === S2 || (e2.blendEquationSeparate(q2[n2], q2[a3]), g2 = n2, S2 = a3), i3 === v2 && r3 === E2 && o3 === M2 && s3 === T2 || (e2.blendFuncSeparate(j2[i3], j2[r3], j2[o3], j2[s3]), v2 = i3, E2 = r3, M2 = o3, T2 = s3), false !== l3.equals(x2) && c2 === R2 || (e2.blendColor(l3.r, l3.g, l3.b, c2), x2.copy(l3), R2 = c2), _2 = t3, A2 = false;\n else if (t3 !== _2 || d3 !== A2) {\n if (g2 === w && S2 === w || (e2.blendEquation(e2.FUNC_ADD), g2 = w, S2 = w), d3)\n switch (t3) {\n case y:\n e2.blendFuncSeparate(e2.ONE, e2.ONE_MINUS_SRC_ALPHA, e2.ONE, e2.ONE_MINUS_SRC_ALPHA);\n break;\n case g:\n e2.blendFunc(e2.ONE, e2.ONE);\n break;\n case f:\n e2.blendFuncSeparate(e2.ZERO, e2.ONE_MINUS_SRC_COLOR, e2.ZERO, e2.ONE);\n break;\n case x:\n e2.blendFuncSeparate(e2.DST_COLOR, e2.ONE_MINUS_SRC_ALPHA, e2.ZERO, e2.ONE);\n break;\n default:\n oi(\"WebGLState: Invalid blending: \", t3);\n }\n else\n switch (t3) {\n case y:\n e2.blendFuncSeparate(e2.SRC_ALPHA, e2.ONE_MINUS_SRC_ALPHA, e2.ONE, e2.ONE_MINUS_SRC_ALPHA);\n break;\n case g:\n e2.blendFuncSeparate(e2.SRC_ALPHA, e2.ONE, e2.ONE, e2.ONE);\n break;\n case f:\n oi(\"WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true\");\n break;\n case x:\n oi(\"WebGLState: MultiplyBlending requires material.premultipliedAlpha = true\");\n break;\n default:\n oi(\"WebGLState: Invalid blending: \", t3);\n }\n v2 = null, E2 = null, M2 = null, T2 = null, x2.set(0, 0, 0), R2 = 0, _2 = t3, A2 = d3;\n }\n } else true === h2 && (Y2(e2.BLEND), h2 = false);\n }\n function $2(t3) {\n b2 !== t3 && (t3 ? e2.frontFace(e2.CW) : e2.frontFace(e2.CCW), b2 = t3);\n }\n function Q2(t3) {\n t3 !== i ? (X2(e2.CULL_FACE), t3 !== C2 && (t3 === r ? e2.cullFace(e2.BACK) : t3 === n ? e2.cullFace(e2.FRONT) : e2.cullFace(e2.FRONT_AND_BACK))) : Y2(e2.CULL_FACE), C2 = t3;\n }\n function J2(t3, n2, i3) {\n t3 ? (X2(e2.POLYGON_OFFSET_FILL), L2 === n2 && U2 === i3 || (L2 = n2, U2 = i3, r2.getReversed() && (n2 = -n2), e2.polygonOffset(n2, i3))) : Y2(e2.POLYGON_OFFSET_FILL);\n }\n return {\n buffers: { color: i2, depth: r2, stencil: a2 },\n enable: X2,\n disable: Y2,\n bindFramebuffer: function(t3, n2) {\n return u2[t3] !== n2 && (e2.bindFramebuffer(t3, n2), u2[t3] = n2, t3 === e2.DRAW_FRAMEBUFFER && (u2[e2.FRAMEBUFFER] = n2), t3 === e2.FRAMEBUFFER && (u2[e2.DRAW_FRAMEBUFFER] = n2), true);\n },\n drawBuffers: function(t3, n2) {\n let i3 = p2, r3 = false;\n if (t3) {\n i3 = f2.get(n2), void 0 === i3 && (i3 = [], f2.set(n2, i3));\n const a3 = t3.textures;\n if (i3.length !== a3.length || i3[0] !== e2.COLOR_ATTACHMENT0) {\n for (let t4 = 0, n3 = a3.length; t4 < n3; t4++) i3[t4] = e2.COLOR_ATTACHMENT0 + t4;\n i3.length = a3.length, r3 = true;\n }\n } else i3[0] !== e2.BACK && (i3[0] = e2.BACK, r3 = true);\n r3 && e2.drawBuffers(i3);\n },\n useProgram: function(t3) {\n return m2 !== t3 && (e2.useProgram(t3), m2 = t3, true);\n },\n setBlending: Z2,\n setMaterial: function(t3, n2) {\n t3.side === p ? Y2(e2.CULL_FACE) : X2(e2.CULL_FACE);\n let o3 = t3.side === d;\n n2 && (o3 = !o3), $2(o3), t3.blending === y && false === t3.transparent ? Z2(m) : Z2(\n t3.blending,\n t3.blendEquation,\n t3.blendSrc,\n t3.blendDst,\n t3.blendEquationAlpha,\n t3.blendSrcAlpha,\n t3.blendDstAlpha,\n t3.blendColor,\n t3.blendAlpha,\n t3.premultipliedAlpha\n ), r2.setFunc(t3.depthFunc), r2.setTest(t3.depthTest), r2.setMask(t3.depthWrite), i2.setMask(t3.colorWrite);\n const s3 = t3.stencilWrite;\n a2.setTest(s3), s3 && (a2.setMask(t3.stencilWriteMask), a2.setFunc(t3.stencilFunc, t3.stencilRef, t3.stencilFuncMask), a2.setOp(t3.stencilFail, t3.stencilZFail, t3.stencilZPass)), J2(t3.polygonOffset, t3.polygonOffsetFactor, t3.polygonOffsetUnits), true === t3.alphaToCoverage ? X2(e2.SAMPLE_ALPHA_TO_COVERAGE) : Y2(e2.SAMPLE_ALPHA_TO_COVERAGE);\n },\n setFlipSided: $2,\n setCullFace: Q2,\n setLineWidth: function(t3) {\n t3 !== P2 && (N2 && e2.lineWidth(t3), P2 = t3);\n },\n setPolygonOffset: J2,\n setScissorTest: function(t3) {\n t3 ? X2(e2.SCISSOR_TEST) : Y2(e2.SCISSOR_TEST);\n },\n activeTexture: function(t3) {\n void 0 === t3 && (t3 = e2.TEXTURE0 + I2 - 1), F2 !== t3 && (e2.activeTexture(t3), F2 = t3);\n },\n bindTexture: function(t3, n2, i3) {\n void 0 === i3 && (i3 = null === F2 ? e2.TEXTURE0 + I2 - 1 : F2);\n let r3 = B2[i3];\n void 0 === r3 && (r3 = { type: void 0, texture: void 0 }, B2[i3] = r3), r3.type === t3 && r3.texture === n2 || (F2 !== i3 && (e2.activeTexture(i3), F2 = i3), e2.bindTexture(t3, n2 || k2[t3]), r3.type = t3, r3.texture = n2);\n },\n unbindTexture: function() {\n const t3 = B2[F2];\n void 0 !== t3 && void 0 !== t3.type && (e2.bindTexture(t3.type, null), t3.type = void 0, t3.texture = void 0);\n },\n compressedTexImage2D: function() {\n try {\n e2.compressedTexImage2D(...arguments);\n } catch (e3) {\n oi(\"WebGLState:\", e3);\n }\n },\n compressedTexImage3D: function() {\n try {\n e2.compressedTexImage3D(...arguments);\n } catch (e3) {\n oi(\"WebGLState:\", e3);\n }\n },\n texImage2D: function() {\n try {\n e2.texImage2D(...arguments);\n } catch (e3) {\n oi(\"WebGLState:\", e3);\n }\n },\n texImage3D: function() {\n try {\n e2.texImage3D(...arguments);\n } catch (e3) {\n oi(\"WebGLState:\", e3);\n }\n },\n pixelStorei: function(t3, n2) {\n d2[t3] !== n2 && (e2.pixelStorei(t3, n2), d2[t3] = n2);\n },\n getParameter: function(t3) {\n return void 0 !== d2[t3] ? d2[t3] : e2.getParameter(t3);\n },\n updateUBOMapping: function(t3, n2) {\n let i3 = s2.get(n2);\n void 0 === i3 && (i3 = /* @__PURE__ */ new WeakMap(), s2.set(n2, i3));\n let r3 = i3.get(t3);\n void 0 === r3 && (r3 = e2.getUniformBlockIndex(n2, t3.name), i3.set(t3, r3));\n },\n uniformBlockBinding: function(t3, n2) {\n const i3 = s2.get(n2).get(t3);\n o2.get(n2) !== i3 && (e2.uniformBlockBinding(n2, i3, t3.__bindingPointIndex), o2.set(n2, i3));\n },\n texStorage2D: function() {\n try {\n e2.texStorage2D(...arguments);\n } catch (e3) {\n oi(\"WebGLState:\", e3);\n }\n },\n texStorage3D: function() {\n try {\n e2.texStorage3D(...arguments);\n } catch (e3) {\n oi(\"WebGLState:\", e3);\n }\n },\n texSubImage2D: function() {\n try {\n e2.texSubImage2D(...arguments);\n } catch (e3) {\n oi(\"WebGLState:\", e3);\n }\n },\n texSubImage3D: function() {\n try {\n e2.texSubImage3D(...arguments);\n } catch (e3) {\n oi(\"WebGLState:\", e3);\n }\n },\n compressedTexSubImage2D: function() {\n try {\n e2.compressedTexSubImage2D(...arguments);\n } catch (e3) {\n oi(\"WebGLState:\", e3);\n }\n },\n compressedTexSubImage3D: function() {\n try {\n e2.compressedTexSubImage3D(...arguments);\n } catch (e3) {\n oi(\"WebGLState:\", e3);\n }\n },\n scissor: function(t3) {\n false === V2.equals(t3) && (e2.scissor(t3.x, t3.y, t3.z, t3.w), V2.copy(t3));\n },\n viewport: function(t3) {\n false === W2.equals(t3) && (e2.viewport(t3.x, t3.y, t3.z, t3.w), W2.copy(t3));\n },\n reset: function() {\n e2.disable(e2.BLEND), e2.disable(e2.CULL_FACE), e2.disable(e2.DEPTH_TEST), e2.disable(e2.POLYGON_OFFSET_FILL), e2.disable(e2.SCISSOR_TEST), e2.disable(e2.STENCIL_TEST), e2.disable(e2.SAMPLE_ALPHA_TO_COVERAGE), e2.blendEquation(e2.FUNC_ADD), e2.blendFunc(e2.ONE, e2.ZERO), e2.blendFuncSeparate(e2.ONE, e2.ZERO, e2.ONE, e2.ZERO), e2.blendColor(0, 0, 0, 0), e2.colorMask(true, true, true, true), e2.clearColor(0, 0, 0, 0), e2.depthMask(true), e2.depthFunc(e2.LESS), r2.setReversed(false), e2.clearDepth(1), e2.stencilMask(4294967295), e2.stencilFunc(e2.ALWAYS, 0, 4294967295), e2.stencilOp(e2.KEEP, e2.KEEP, e2.KEEP), e2.clearStencil(0), e2.cullFace(e2.BACK), e2.frontFace(e2.CCW), e2.polygonOffset(0, 0), e2.activeTexture(e2.TEXTURE0), e2.bindFramebuffer(e2.FRAMEBUFFER, null), e2.bindFramebuffer(e2.DRAW_FRAMEBUFFER, null), e2.bindFramebuffer(e2.READ_FRAMEBUFFER, null), e2.useProgram(null), e2.lineWidth(1), e2.scissor(0, 0, e2.canvas.width, e2.canvas.height), e2.viewport(0, 0, e2.canvas.width, e2.canvas.height), e2.pixelStorei(e2.PACK_ALIGNMENT, 4), e2.pixelStorei(e2.UNPACK_ALIGNMENT, 4), e2.pixelStorei(e2.UNPACK_FLIP_Y_WEBGL, false), e2.pixelStorei(e2.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false), e2.pixelStorei(e2.UNPACK_COLORSPACE_CONVERSION_WEBGL, e2.BROWSER_DEFAULT_WEBGL), e2.pixelStorei(e2.PACK_ROW_LENGTH, 0), e2.pixelStorei(e2.PACK_SKIP_PIXELS, 0), e2.pixelStorei(e2.PACK_SKIP_ROWS, 0), e2.pixelStorei(e2.UNPACK_ROW_LENGTH, 0), e2.pixelStorei(e2.UNPACK_IMAGE_HEIGHT, 0), e2.pixelStorei(e2.UNPACK_SKIP_PIXELS, 0), e2.pixelStorei(e2.UNPACK_SKIP_ROWS, 0), e2.pixelStorei(e2.UNPACK_SKIP_IMAGES, 0), l2 = {}, d2 = {}, F2 = null, B2 = {}, u2 = {}, f2 = /* @__PURE__ */ new WeakMap(), p2 = [], m2 = null, h2 = false, _2 = null, g2 = null, v2 = null, E2 = null, S2 = null, M2 = null, T2 = null, x2 = new Pr(0, 0, 0), R2 = 0, A2 = false, b2 = null, C2 = null, P2 = null, L2 = null, U2 = null, V2.set(0, 0, e2.canvas.width, e2.canvas.height), W2.set(0, 0, e2.canvas.width, e2.canvas.height), i2.reset(), r2.reset(), a2.reset();\n }\n };\n }\n function va2(e2, n2, i2, r2, a2, o2, s2) {\n const l2 = n2.has(\"WEBGL_multisampled_render_to_texture\") ? n2.get(\"WEBGL_multisampled_render_to_texture\") : null, c2 = \"undefined\" != typeof navigator && /OculusBrowser/g.test(navigator.userAgent), d2 = new _i(), u2 = /* @__PURE__ */ new WeakMap(), m2 = /* @__PURE__ */ new Set();\n let h2;\n const _2 = /* @__PURE__ */ new WeakMap();\n let g2 = false;\n try {\n g2 = \"undefined\" != typeof OffscreenCanvas && null !== new OffscreenCanvas(1, 1).getContext(\"2d\");\n } catch (e3) {\n }\n function E2(e3, t2) {\n return g2 ? new OffscreenCanvas(e3, t2) : Qs(\"canvas\");\n }\n function x2(e3, t2, n3) {\n let i3 = 1;\n const r3 = te2(e3);\n if ((r3.width > n3 || r3.height > n3) && (i3 = n3 / Math.max(r3.width, r3.height)), i3 < 1) {\n if (\"undefined\" != typeof HTMLImageElement && e3 instanceof HTMLImageElement || \"undefined\" != typeof HTMLCanvasElement && e3 instanceof HTMLCanvasElement || \"undefined\" != typeof ImageBitmap && e3 instanceof ImageBitmap || \"undefined\" != typeof VideoFrame && e3 instanceof VideoFrame) {\n const n4 = Math.floor(i3 * r3.width), a3 = Math.floor(i3 * r3.height);\n void 0 === h2 && (h2 = E2(n4, a3));\n const o3 = t2 ? E2(n4, a3) : h2;\n o3.width = n4, o3.height = a3;\n return o3.getContext(\"2d\").drawImage(e3, 0, 0, n4, a3), ai(\n \"WebGLRenderer: Texture has been resized from (\" + r3.width + \"x\" + r3.height + \") to (\" + n4 + \"x\" + a3 + \").\"\n ), o3;\n }\n return \"data\" in e3 && ai(\"WebGLRenderer: Image in DataTexture is too big (\" + r3.width + \"x\" + r3.height + \").\"), e3;\n }\n return e3;\n }\n function R2(e3) {\n return e3.generateMipmaps;\n }\n function A2(t2) {\n e2.generateMipmap(t2);\n }\n function b2(t2) {\n return t2.isWebGLCubeRenderTarget ? e2.TEXTURE_CUBE_MAP : t2.isWebGL3DRenderTarget ? e2.TEXTURE_3D : t2.isWebGLArrayRenderTarget || t2.isCompressedArrayTexture ? e2.TEXTURE_2D_ARRAY : e2.TEXTURE_2D;\n }\n function C2(t2, i3, r3, a3, o3, s3 = false) {\n if (null !== t2) {\n if (void 0 !== e2[t2]) return e2[t2];\n ai(\"WebGLRenderer: Attempt to use non-existing WebGL internal format '\" + t2 + \"'\");\n }\n let l3;\n a3 && (l3 = n2.get(\"EXT_texture_norm16\"), l3 || ai(\"WebGLRenderer: Unable to use normalized textures without EXT_texture_norm16 extension\"));\n let c3 = i3;\n if (i3 === e2.RED && (r3 === e2.FLOAT && (c3 = e2.R32F), r3 === e2.HALF_FLOAT && (c3 = e2.R16F), r3 === e2.UNSIGNED_BYTE && (c3 = e2.R8), r3 === e2.UNSIGNED_SHORT && l3 && (c3 = l3.R16_EXT), r3 === e2.SHORT && l3 && (c3 = l3.R16_SNORM_EXT)), i3 === e2.RED_INTEGER && (r3 === e2.UNSIGNED_BYTE && (c3 = e2.R8UI), r3 === e2.UNSIGNED_SHORT && (c3 = e2.R16UI), r3 === e2.UNSIGNED_INT && (c3 = e2.R32UI), r3 === e2.BYTE && (c3 = e2.R8I), r3 === e2.SHORT && (c3 = e2.R16I), r3 === e2.INT && (c3 = e2.R32I)), i3 === e2.RG && (r3 === e2.FLOAT && (c3 = e2.RG32F), r3 === e2.HALF_FLOAT && (c3 = e2.RG16F), r3 === e2.UNSIGNED_BYTE && (c3 = e2.RG8), r3 === e2.UNSIGNED_SHORT && l3 && (c3 = l3.RG16_EXT), r3 === e2.SHORT && l3 && (c3 = l3.RG16_SNORM_EXT)), i3 === e2.RG_INTEGER && (r3 === e2.UNSIGNED_BYTE && (c3 = e2.RG8UI), r3 === e2.UNSIGNED_SHORT && (c3 = e2.RG16UI), r3 === e2.UNSIGNED_INT && (c3 = e2.RG32UI), r3 === e2.BYTE && (c3 = e2.RG8I), r3 === e2.SHORT && (c3 = e2.RG16I), r3 === e2.INT && (c3 = e2.RG32I)), i3 === e2.RGB_INTEGER && (r3 === e2.UNSIGNED_BYTE && (c3 = e2.RGB8UI), r3 === e2.UNSIGNED_SHORT && (c3 = e2.RGB16UI), r3 === e2.UNSIGNED_INT && (c3 = e2.RGB32UI), r3 === e2.BYTE && (c3 = e2.RGB8I), r3 === e2.SHORT && (c3 = e2.RGB16I), r3 === e2.INT && (c3 = e2.RGB32I)), i3 === e2.RGBA_INTEGER && (r3 === e2.UNSIGNED_BYTE && (c3 = e2.RGBA8UI), r3 === e2.UNSIGNED_SHORT && (c3 = e2.RGBA16UI), r3 === e2.UNSIGNED_INT && (c3 = e2.RGBA32UI), r3 === e2.BYTE && (c3 = e2.RGBA8I), r3 === e2.SHORT && (c3 = e2.RGBA16I), r3 === e2.INT && (c3 = e2.RGBA32I)), i3 === e2.RGB && (r3 === e2.UNSIGNED_SHORT && l3 && (c3 = l3.RGB16_EXT), r3 === e2.SHORT && l3 && (c3 = l3.RGB16_SNORM_EXT), r3 === e2.UNSIGNED_INT_5_9_9_9_REV && (c3 = e2.RGB9_E5), r3 === e2.UNSIGNED_INT_10F_11F_11F_REV && (c3 = e2.R11F_G11F_B10F)), i3 === e2.RGBA) {\n const t3 = s3 ? is : Ri.getTransfer(o3);\n r3 === e2.FLOAT && (c3 = e2.RGBA32F), r3 === e2.HALF_FLOAT && (c3 = e2.RGBA16F), r3 === e2.UNSIGNED_BYTE && (c3 = t3 === rs ? e2.SRGB8_ALPHA8 : e2.RGBA8), r3 === e2.UNSIGNED_SHORT && l3 && (c3 = l3.RGBA16_EXT), r3 === e2.SHORT && l3 && (c3 = l3.RGBA16_SNORM_EXT), r3 === e2.UNSIGNED_SHORT_4_4_4_4 && (c3 = e2.RGBA4), r3 === e2.UNSIGNED_SHORT_5_5_5_1 && (c3 = e2.RGB5_A1);\n }\n return c3 !== e2.R16F && c3 !== e2.R32F && c3 !== e2.RG16F && c3 !== e2.RG32F && c3 !== e2.RGBA16F && c3 !== e2.RGBA32F || n2.get(\"EXT_color_buffer_float\"), c3;\n }\n function P2(t2, n3) {\n let i3;\n return t2 ? null === n3 || n3 === Ot || n3 === Vt ? i3 = e2.DEPTH24_STENCIL8 : n3 === Pt ? i3 = e2.DEPTH32F_STENCIL8 : n3 === Bt && (i3 = e2.DEPTH24_STENCIL8, ai(\n \"DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.\"\n )) : null === n3 || n3 === Ot || n3 === Vt ? i3 = e2.DEPTH_COMPONENT24 : n3 === Pt ? i3 = e2.DEPTH_COMPONENT32F : n3 === Bt && (i3 = e2.DEPTH_COMPONENT16), i3;\n }\n function L2(e3, t2) {\n return true === R2(e3) || e3.isFramebufferTexture && e3.minFilter !== ft && e3.minFilter !== Mt ? Math.log2(Math.max(t2.width, t2.height)) + 1 : void 0 !== e3.mipmaps && e3.mipmaps.length > 0 ? e3.mipmaps.length : e3.isCompressedTexture && Array.isArray(e3.image) ? t2.mipmaps.length : 1;\n }\n function U2(e3) {\n const t2 = e3.target;\n t2.removeEventListener(\"dispose\", U2), (function(e4) {\n const t3 = r2.get(e4);\n if (void 0 === t3.__webglInit) return;\n const n3 = e4.source, i3 = _2.get(n3);\n if (i3) {\n const r3 = i3[t3.__cacheKey];\n r3.usedTimes--, 0 === r3.usedTimes && I2(e4), 0 === Object.keys(i3).length && _2.delete(n3);\n }\n r2.remove(e4);\n })(t2), t2.isVideoTexture && u2.delete(t2), t2.isHTMLTexture && m2.delete(t2);\n }\n function w2(t2) {\n const n3 = t2.target;\n n3.removeEventListener(\"dispose\", w2), (function(t3) {\n const n4 = r2.get(t3);\n t3.depthTexture && (t3.depthTexture.dispose(), r2.remove(t3.depthTexture));\n if (t3.isWebGLCubeRenderTarget)\n for (let t4 = 0; t4 < 6; t4++) {\n if (Array.isArray(n4.__webglFramebuffer[t4]))\n for (let i4 = 0; i4 < n4.__webglFramebuffer[t4].length; i4++)\n e2.deleteFramebuffer(n4.__webglFramebuffer[t4][i4]);\n else e2.deleteFramebuffer(n4.__webglFramebuffer[t4]);\n n4.__webglDepthbuffer && e2.deleteRenderbuffer(n4.__webglDepthbuffer[t4]);\n }\n else {\n if (Array.isArray(n4.__webglFramebuffer))\n for (let t4 = 0; t4 < n4.__webglFramebuffer.length; t4++)\n e2.deleteFramebuffer(n4.__webglFramebuffer[t4]);\n else e2.deleteFramebuffer(n4.__webglFramebuffer);\n if (n4.__webglDepthbuffer && e2.deleteRenderbuffer(n4.__webglDepthbuffer), n4.__webglMultisampledFramebuffer && e2.deleteFramebuffer(n4.__webglMultisampledFramebuffer), n4.__webglColorRenderbuffer)\n for (let t4 = 0; t4 < n4.__webglColorRenderbuffer.length; t4++)\n n4.__webglColorRenderbuffer[t4] && e2.deleteRenderbuffer(n4.__webglColorRenderbuffer[t4]);\n n4.__webglDepthRenderbuffer && e2.deleteRenderbuffer(n4.__webglDepthRenderbuffer);\n }\n const i3 = t3.textures;\n for (let t4 = 0, n5 = i3.length; t4 < n5; t4++) {\n const n6 = r2.get(i3[t4]);\n n6.__webglTexture && (e2.deleteTexture(n6.__webglTexture), s2.memory.textures--), r2.remove(i3[t4]);\n }\n r2.remove(t3);\n })(n3);\n }\n function I2(t2) {\n const n3 = r2.get(t2);\n e2.deleteTexture(n3.__webglTexture);\n const i3 = t2.source;\n delete _2.get(i3)[n3.__cacheKey], s2.memory.textures--;\n }\n let N2 = 0;\n function F2(t2, n3) {\n const a3 = r2.get(t2);\n if (t2.isVideoTexture && (function(e3) {\n const t3 = s2.render.frame;\n u2.get(e3) !== t3 && (u2.set(e3, t3), e3.update());\n })(t2), false === t2.isRenderTargetTexture && true !== t2.isExternalTexture && t2.version > 0 && a3.__version !== t2.version) {\n const e3 = t2.image;\n if (null === e3) ai(\"WebGLRenderer: Texture marked for update but no image data found.\");\n else {\n if (false !== e3.complete) return void X2(a3, t2, n3);\n ai(\"WebGLRenderer: Texture marked for update but image is incomplete\");\n }\n } else t2.isExternalTexture && (a3.__webglTexture = t2.sourceTexture ? t2.sourceTexture : null);\n i2.bindTexture(e2.TEXTURE_2D, a3.__webglTexture, e2.TEXTURE0 + n3);\n }\n const G2 = { [mt]: e2.REPEAT, [yt]: e2.CLAMP_TO_EDGE, [gt]: e2.MIRRORED_REPEAT }, H2 = {\n [ft]: e2.NEAREST,\n [xt]: e2.NEAREST_MIPMAP_NEAREST,\n [vt]: e2.NEAREST_MIPMAP_LINEAR,\n [Mt]: e2.LINEAR,\n [St]: e2.LINEAR_MIPMAP_NEAREST,\n [At]: e2.LINEAR_MIPMAP_LINEAR\n }, V2 = {\n [_s]: e2.NEVER,\n [ks]: e2.ALWAYS,\n [As]: e2.LESS,\n [zs]: e2.LEQUAL,\n [Ts]: e2.EQUAL,\n [Bs]: e2.GEQUAL,\n [Cs]: e2.GREATER,\n [Is]: e2.NOTEQUAL\n };\n function W2(t2, i3) {\n if (i3.type !== Pt || false !== n2.has(\"OES_texture_float_linear\") || i3.magFilter !== Mt && i3.magFilter !== St && i3.magFilter !== vt && i3.magFilter !== At && i3.minFilter !== Mt && i3.minFilter !== St && i3.minFilter !== vt && i3.minFilter !== At || ai(\n \"WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device.\"\n ), e2.texParameteri(t2, e2.TEXTURE_WRAP_S, G2[i3.wrapS]), e2.texParameteri(t2, e2.TEXTURE_WRAP_T, G2[i3.wrapT]), t2 !== e2.TEXTURE_3D && t2 !== e2.TEXTURE_2D_ARRAY || e2.texParameteri(t2, e2.TEXTURE_WRAP_R, G2[i3.wrapR]), e2.texParameteri(t2, e2.TEXTURE_MAG_FILTER, H2[i3.magFilter]), e2.texParameteri(t2, e2.TEXTURE_MIN_FILTER, H2[i3.minFilter]), i3.compareFunction && (e2.texParameteri(t2, e2.TEXTURE_COMPARE_MODE, e2.COMPARE_REF_TO_TEXTURE), e2.texParameteri(t2, e2.TEXTURE_COMPARE_FUNC, V2[i3.compareFunction])), true === n2.has(\"EXT_texture_filter_anisotropic\")) {\n if (i3.magFilter === ft) return;\n if (i3.minFilter !== vt && i3.minFilter !== At) return;\n if (i3.type === Pt && false === n2.has(\"OES_texture_float_linear\")) return;\n if (i3.anisotropy > 1 || r2.get(i3).__currentAnisotropy) {\n const o3 = n2.get(\"EXT_texture_filter_anisotropic\");\n e2.texParameterf(\n t2,\n o3.TEXTURE_MAX_ANISOTROPY_EXT,\n Math.min(i3.anisotropy, a2.getMaxAnisotropy())\n ), r2.get(i3).__currentAnisotropy = i3.anisotropy;\n }\n }\n }\n function z2(t2, n3) {\n let i3 = false;\n void 0 === t2.__webglInit && (t2.__webglInit = true, n3.addEventListener(\"dispose\", U2));\n const r3 = n3.source;\n let a3 = _2.get(r3);\n void 0 === a3 && (a3 = {}, _2.set(r3, a3));\n const o3 = (function(e3) {\n const t3 = [];\n return t3.push(e3.wrapS), t3.push(e3.wrapT), t3.push(e3.wrapR || 0), t3.push(e3.magFilter), t3.push(e3.minFilter), t3.push(e3.anisotropy), t3.push(e3.internalFormat), t3.push(e3.format), t3.push(e3.type), t3.push(e3.generateMipmaps), t3.push(e3.premultiplyAlpha), t3.push(e3.flipY), t3.push(e3.unpackAlignment), t3.push(e3.colorSpace), t3.join();\n })(n3);\n if (o3 !== t2.__cacheKey) {\n void 0 === a3[o3] && (a3[o3] = { texture: e2.createTexture(), usedTimes: 0 }, s2.memory.textures++, i3 = true), a3[o3].usedTimes++;\n const r4 = a3[t2.__cacheKey];\n void 0 !== r4 && (a3[t2.__cacheKey].usedTimes--, 0 === r4.usedTimes && I2(n3)), t2.__cacheKey = o3, t2.__webglTexture = a3[o3].texture;\n }\n return i3;\n }\n function k2(e3, t2, n3) {\n return Math.floor(Math.floor(e3 / n3) / t2);\n }\n function X2(t2, n3, s3) {\n let l3 = e2.TEXTURE_2D;\n (n3.isDataArrayTexture || n3.isCompressedArrayTexture) && (l3 = e2.TEXTURE_2D_ARRAY), n3.isData3DTexture && (l3 = e2.TEXTURE_3D);\n const c3 = z2(t2, n3), d3 = n3.source;\n i2.bindTexture(l3, t2.__webglTexture, e2.TEXTURE0 + s3);\n const u3 = r2.get(d3);\n if (d3.version !== u3.__version || true === c3) {\n i2.activeTexture(e2.TEXTURE0 + s3);\n if (false === (\"undefined\" != typeof ImageBitmap && n3.image instanceof ImageBitmap)) {\n const t4 = Ri.getPrimaries(Ri.workingColorSpace), r4 = n3.colorSpace === ts ? null : Ri.getPrimaries(n3.colorSpace), a3 = n3.colorSpace === ts || t4 === r4 ? e2.NONE : e2.BROWSER_DEFAULT_WEBGL;\n i2.pixelStorei(e2.UNPACK_FLIP_Y_WEBGL, n3.flipY), i2.pixelStorei(e2.UNPACK_PREMULTIPLY_ALPHA_WEBGL, n3.premultiplyAlpha), i2.pixelStorei(e2.UNPACK_COLORSPACE_CONVERSION_WEBGL, a3);\n }\n i2.pixelStorei(e2.UNPACK_ALIGNMENT, n3.unpackAlignment);\n let t3 = x2(n3.image, false, a2.maxTextureSize);\n t3 = ee2(n3, t3);\n const r3 = o2.convert(n3.format, n3.colorSpace), p2 = o2.convert(n3.type);\n let h3, _3 = C2(n3.internalFormat, r3, p2, n3.normalized, n3.colorSpace, n3.isVideoTexture);\n W2(l3, n3);\n const g3 = n3.mipmaps, E3 = true !== n3.isVideoTexture, S2 = void 0 === u3.__version || true === c3, M2 = d3.dataReady, b3 = L2(n3, t3);\n if (n3.isDepthTexture)\n _3 = P2(n3.format === Jt, n3.type), S2 && (E3 ? i2.texStorage2D(e2.TEXTURE_2D, 1, _3, t3.width, t3.height) : i2.texImage2D(e2.TEXTURE_2D, 0, _3, t3.width, t3.height, 0, r3, p2, null));\n else if (n3.isDataTexture)\n if (g3.length > 0) {\n E3 && S2 && i2.texStorage2D(e2.TEXTURE_2D, b3, _3, g3[0].width, g3[0].height);\n for (let t4 = 0, n4 = g3.length; t4 < n4; t4++)\n h3 = g3[t4], E3 ? M2 && i2.texSubImage2D(e2.TEXTURE_2D, t4, 0, 0, h3.width, h3.height, r3, p2, h3.data) : i2.texImage2D(e2.TEXTURE_2D, t4, _3, h3.width, h3.height, 0, r3, p2, h3.data);\n n3.generateMipmaps = false;\n } else\n E3 ? (S2 && i2.texStorage2D(e2.TEXTURE_2D, b3, _3, t3.width, t3.height), M2 && (function(t4, n4, r4, a3) {\n const o3 = t4.updateRanges;\n if (0 === o3.length)\n i2.texSubImage2D(e2.TEXTURE_2D, 0, 0, 0, n4.width, n4.height, r4, a3, n4.data);\n else {\n o3.sort((e3, t5) => e3.start - t5.start);\n let s4 = 0;\n for (let e3 = 1; e3 < o3.length; e3++) {\n const t5 = o3[s4], i3 = o3[e3], r5 = t5.start + t5.count, a4 = k2(i3.start, n4.width, 4), l5 = k2(t5.start, n4.width, 4);\n i3.start <= r5 + 1 && a4 === l5 && k2(i3.start + i3.count - 1, n4.width, 4) === a4 ? t5.count = Math.max(t5.count, i3.start + i3.count - t5.start) : (++s4, o3[s4] = i3);\n }\n o3.length = s4 + 1;\n const l4 = i2.getParameter(e2.UNPACK_ROW_LENGTH), c4 = i2.getParameter(e2.UNPACK_SKIP_PIXELS), d4 = i2.getParameter(e2.UNPACK_SKIP_ROWS);\n i2.pixelStorei(e2.UNPACK_ROW_LENGTH, n4.width);\n for (let t5 = 0, s5 = o3.length; t5 < s5; t5++) {\n const s6 = o3[t5], l5 = Math.floor(s6.start / 4), c5 = Math.ceil(s6.count / 4), d5 = l5 % n4.width, u4 = Math.floor(l5 / n4.width), f2 = c5, p3 = 1;\n i2.pixelStorei(e2.UNPACK_SKIP_PIXELS, d5), i2.pixelStorei(e2.UNPACK_SKIP_ROWS, u4), i2.texSubImage2D(e2.TEXTURE_2D, 0, d5, u4, f2, p3, r4, a3, n4.data);\n }\n t4.clearUpdateRanges(), i2.pixelStorei(e2.UNPACK_ROW_LENGTH, l4), i2.pixelStorei(e2.UNPACK_SKIP_PIXELS, c4), i2.pixelStorei(e2.UNPACK_SKIP_ROWS, d4);\n }\n })(n3, t3, r3, p2)) : i2.texImage2D(e2.TEXTURE_2D, 0, _3, t3.width, t3.height, 0, r3, p2, t3.data);\n else if (n3.isCompressedTexture)\n if (n3.isCompressedArrayTexture) {\n E3 && S2 && i2.texStorage3D(e2.TEXTURE_2D_ARRAY, b3, _3, g3[0].width, g3[0].height, t3.depth);\n for (let a3 = 0, o3 = g3.length; a3 < o3; a3++)\n if (h3 = g3[a3], n3.format !== jt)\n if (null !== r3)\n if (E3) {\n if (M2)\n if (n3.layerUpdates.size > 0) {\n const t4 = up(h3.width, h3.height, n3.format, n3.type);\n for (const o4 of n3.layerUpdates) {\n const n4 = h3.data.subarray(\n o4 * t4 / h3.data.BYTES_PER_ELEMENT,\n (o4 + 1) * t4 / h3.data.BYTES_PER_ELEMENT\n );\n i2.compressedTexSubImage3D(\n e2.TEXTURE_2D_ARRAY,\n a3,\n 0,\n 0,\n o4,\n h3.width,\n h3.height,\n 1,\n r3,\n n4\n );\n }\n n3.clearLayerUpdates();\n } else\n i2.compressedTexSubImage3D(\n e2.TEXTURE_2D_ARRAY,\n a3,\n 0,\n 0,\n 0,\n h3.width,\n h3.height,\n t3.depth,\n r3,\n h3.data\n );\n } else\n i2.compressedTexImage3D(\n e2.TEXTURE_2D_ARRAY,\n a3,\n _3,\n h3.width,\n h3.height,\n t3.depth,\n 0,\n h3.data,\n 0,\n 0\n );\n else\n ai(\n \"WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()\"\n );\n else\n E3 ? M2 && i2.texSubImage3D(\n e2.TEXTURE_2D_ARRAY,\n a3,\n 0,\n 0,\n 0,\n h3.width,\n h3.height,\n t3.depth,\n r3,\n p2,\n h3.data\n ) : i2.texImage3D(\n e2.TEXTURE_2D_ARRAY,\n a3,\n _3,\n h3.width,\n h3.height,\n t3.depth,\n 0,\n r3,\n p2,\n h3.data\n );\n } else {\n E3 && S2 && i2.texStorage2D(e2.TEXTURE_2D, b3, _3, g3[0].width, g3[0].height);\n for (let t4 = 0, a3 = g3.length; t4 < a3; t4++)\n h3 = g3[t4], n3.format !== jt ? null !== r3 ? E3 ? M2 && i2.compressedTexSubImage2D(e2.TEXTURE_2D, t4, 0, 0, h3.width, h3.height, r3, h3.data) : i2.compressedTexImage2D(e2.TEXTURE_2D, t4, _3, h3.width, h3.height, 0, h3.data) : ai(\n \"WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()\"\n ) : E3 ? M2 && i2.texSubImage2D(e2.TEXTURE_2D, t4, 0, 0, h3.width, h3.height, r3, p2, h3.data) : i2.texImage2D(e2.TEXTURE_2D, t4, _3, h3.width, h3.height, 0, r3, p2, h3.data);\n }\n else if (n3.isDataArrayTexture)\n if (E3) {\n if (S2 && i2.texStorage3D(e2.TEXTURE_2D_ARRAY, b3, _3, t3.width, t3.height, t3.depth), M2)\n if (n3.layerUpdates.size > 0) {\n const a3 = up(t3.width, t3.height, n3.format, n3.type);\n for (const o3 of n3.layerUpdates) {\n const n4 = t3.data.subarray(\n o3 * a3 / t3.data.BYTES_PER_ELEMENT,\n (o3 + 1) * a3 / t3.data.BYTES_PER_ELEMENT\n );\n i2.texSubImage3D(e2.TEXTURE_2D_ARRAY, 0, 0, 0, o3, t3.width, t3.height, 1, r3, p2, n4);\n }\n n3.clearLayerUpdates();\n } else\n i2.texSubImage3D(\n e2.TEXTURE_2D_ARRAY,\n 0,\n 0,\n 0,\n 0,\n t3.width,\n t3.height,\n t3.depth,\n r3,\n p2,\n t3.data\n );\n } else i2.texImage3D(e2.TEXTURE_2D_ARRAY, 0, _3, t3.width, t3.height, t3.depth, 0, r3, p2, t3.data);\n else if (n3.isData3DTexture)\n E3 ? (S2 && i2.texStorage3D(e2.TEXTURE_3D, b3, _3, t3.width, t3.height, t3.depth), M2 && i2.texSubImage3D(e2.TEXTURE_3D, 0, 0, 0, 0, t3.width, t3.height, t3.depth, r3, p2, t3.data)) : i2.texImage3D(e2.TEXTURE_3D, 0, _3, t3.width, t3.height, t3.depth, 0, r3, p2, t3.data);\n else if (n3.isFramebufferTexture) {\n if (S2)\n if (E3) i2.texStorage2D(e2.TEXTURE_2D, b3, _3, t3.width, t3.height);\n else {\n let n4 = t3.width, a3 = t3.height;\n for (let t4 = 0; t4 < b3; t4++)\n i2.texImage2D(e2.TEXTURE_2D, t4, _3, n4, a3, 0, r3, p2, null), n4 >>= 1, a3 >>= 1;\n }\n } else if (n3.isHTMLTexture) {\n if (\"texElementImage2D\" in e2) {\n const i3 = e2.canvas;\n if (i3.hasAttribute(\"layoutsubtree\") || i3.setAttribute(\"layoutsubtree\", \"true\"), t3.parentNode !== i3)\n return i3.appendChild(t3), m2.add(n3), i3.onpaint = (e3) => {\n const t4 = e3.changedElements;\n for (const e4 of m2) t4.includes(e4.image) && (e4.needsUpdate = true);\n }, void i3.requestPaint();\n if (3 === e2.texElementImage2D.length) e2.texElementImage2D(e2.TEXTURE_2D, e2.RGBA8, t3);\n else {\n const n4 = 0, i4 = e2.RGBA, r4 = e2.RGBA, a3 = e2.UNSIGNED_BYTE;\n e2.texElementImage2D(e2.TEXTURE_2D, n4, i4, r4, a3, t3);\n }\n e2.texParameteri(e2.TEXTURE_2D, e2.TEXTURE_MIN_FILTER, e2.LINEAR), e2.texParameteri(e2.TEXTURE_2D, e2.TEXTURE_WRAP_S, e2.CLAMP_TO_EDGE), e2.texParameteri(e2.TEXTURE_2D, e2.TEXTURE_WRAP_T, e2.CLAMP_TO_EDGE);\n }\n } else if (g3.length > 0) {\n if (E3 && S2) {\n const t4 = te2(g3[0]);\n i2.texStorage2D(e2.TEXTURE_2D, b3, _3, t4.width, t4.height);\n }\n for (let t4 = 0, n4 = g3.length; t4 < n4; t4++)\n h3 = g3[t4], E3 ? M2 && i2.texSubImage2D(e2.TEXTURE_2D, t4, 0, 0, r3, p2, h3) : i2.texImage2D(e2.TEXTURE_2D, t4, _3, r3, p2, h3);\n n3.generateMipmaps = false;\n } else if (E3) {\n if (S2) {\n const n4 = te2(t3);\n i2.texStorage2D(e2.TEXTURE_2D, b3, _3, n4.width, n4.height);\n }\n M2 && i2.texSubImage2D(e2.TEXTURE_2D, 0, 0, 0, r3, p2, t3);\n } else i2.texImage2D(e2.TEXTURE_2D, 0, _3, r3, p2, t3);\n R2(n3) && A2(l3), u3.__version = d3.version, n3.onUpdate && n3.onUpdate(n3);\n }\n t2.__version = n3.version;\n }\n function K2(t2, n3, a3, s3, c3, d3) {\n const u3 = o2.convert(a3.format, a3.colorSpace), f2 = o2.convert(a3.type), p2 = C2(a3.internalFormat, u3, f2, a3.normalized, a3.colorSpace), m3 = r2.get(n3), h3 = r2.get(a3);\n if (h3.__renderTarget = n3, !m3.__hasExternalTextures) {\n const t3 = Math.max(1, n3.width >> d3), r3 = Math.max(1, n3.height >> d3);\n c3 === e2.TEXTURE_3D || c3 === e2.TEXTURE_2D_ARRAY ? i2.texImage3D(c3, d3, p2, t3, r3, n3.depth, 0, u3, f2, null) : i2.texImage2D(c3, d3, p2, t3, r3, 0, u3, f2, null);\n }\n i2.bindFramebuffer(e2.FRAMEBUFFER, t2), J2(n3) ? l2.framebufferTexture2DMultisampleEXT(e2.FRAMEBUFFER, s3, c3, h3.__webglTexture, 0, Q2(n3)) : (c3 === e2.TEXTURE_2D || c3 >= e2.TEXTURE_CUBE_MAP_POSITIVE_X && c3 <= e2.TEXTURE_CUBE_MAP_NEGATIVE_Z) && e2.framebufferTexture2D(e2.FRAMEBUFFER, s3, c3, h3.__webglTexture, d3), i2.bindFramebuffer(e2.FRAMEBUFFER, null);\n }\n function Y2(t2, n3, i3) {\n if (e2.bindRenderbuffer(e2.RENDERBUFFER, t2), n3.depthBuffer) {\n const r3 = n3.depthTexture, a3 = r3 && r3.isDepthTexture ? r3.type : null, o3 = P2(n3.stencilBuffer, a3), s3 = n3.stencilBuffer ? e2.DEPTH_STENCIL_ATTACHMENT : e2.DEPTH_ATTACHMENT;\n J2(n3) ? l2.renderbufferStorageMultisampleEXT(e2.RENDERBUFFER, Q2(n3), o3, n3.width, n3.height) : i3 ? e2.renderbufferStorageMultisample(e2.RENDERBUFFER, Q2(n3), o3, n3.width, n3.height) : e2.renderbufferStorage(e2.RENDERBUFFER, o3, n3.width, n3.height), e2.framebufferRenderbuffer(e2.FRAMEBUFFER, s3, e2.RENDERBUFFER, t2);\n } else {\n const t3 = n3.textures;\n for (let r3 = 0; r3 < t3.length; r3++) {\n const a3 = t3[r3], s3 = o2.convert(a3.format, a3.colorSpace), c3 = o2.convert(a3.type), d3 = C2(a3.internalFormat, s3, c3, a3.normalized, a3.colorSpace);\n J2(n3) ? l2.renderbufferStorageMultisampleEXT(e2.RENDERBUFFER, Q2(n3), d3, n3.width, n3.height) : i3 ? e2.renderbufferStorageMultisample(e2.RENDERBUFFER, Q2(n3), d3, n3.width, n3.height) : e2.renderbufferStorage(e2.RENDERBUFFER, d3, n3.width, n3.height);\n }\n }\n e2.bindRenderbuffer(e2.RENDERBUFFER, null);\n }\n function q2(t2, n3, a3) {\n const s3 = true === n3.isWebGLCubeRenderTarget;\n if (i2.bindFramebuffer(e2.FRAMEBUFFER, t2), !n3.depthTexture || !n3.depthTexture.isDepthTexture)\n throw new Error(\n \"THREE.WebGLTextures: renderTarget.depthTexture must be an instance of THREE.DepthTexture.\"\n );\n const c3 = r2.get(n3.depthTexture);\n if (c3.__renderTarget = n3, c3.__webglTexture && n3.depthTexture.image.width === n3.width && n3.depthTexture.image.height === n3.height || (n3.depthTexture.image.width = n3.width, n3.depthTexture.image.height = n3.height, n3.depthTexture.needsUpdate = true), s3) {\n if (void 0 === c3.__webglInit && (c3.__webglInit = true, n3.depthTexture.addEventListener(\"dispose\", U2)), void 0 === c3.__webglTexture) {\n c3.__webglTexture = e2.createTexture(), i2.bindTexture(e2.TEXTURE_CUBE_MAP, c3.__webglTexture), W2(e2.TEXTURE_CUBE_MAP, n3.depthTexture);\n const t3 = o2.convert(n3.depthTexture.format), r3 = o2.convert(n3.depthTexture.type);\n let a4;\n n3.depthTexture.format === Wt ? a4 = e2.DEPTH_COMPONENT24 : n3.depthTexture.format === Jt && (a4 = e2.DEPTH24_STENCIL8);\n for (let i3 = 0; i3 < 6; i3++)\n e2.texImage2D(e2.TEXTURE_CUBE_MAP_POSITIVE_X + i3, 0, a4, n3.width, n3.height, 0, t3, r3, null);\n }\n } else F2(n3.depthTexture, 0);\n const d3 = c3.__webglTexture, u3 = Q2(n3), f2 = s3 ? e2.TEXTURE_CUBE_MAP_POSITIVE_X + a3 : e2.TEXTURE_2D, p2 = n3.depthTexture.format === Jt ? e2.DEPTH_STENCIL_ATTACHMENT : e2.DEPTH_ATTACHMENT;\n if (n3.depthTexture.format === Wt)\n J2(n3) ? l2.framebufferTexture2DMultisampleEXT(e2.FRAMEBUFFER, p2, f2, d3, 0, u3) : e2.framebufferTexture2D(e2.FRAMEBUFFER, p2, f2, d3, 0);\n else {\n if (n3.depthTexture.format !== Jt)\n throw new Error(\"THREE.WebGLTextures: Unknown depthTexture format.\");\n J2(n3) ? l2.framebufferTexture2DMultisampleEXT(e2.FRAMEBUFFER, p2, f2, d3, 0, u3) : e2.framebufferTexture2D(e2.FRAMEBUFFER, p2, f2, d3, 0);\n }\n }\n function j2(t2) {\n const n3 = r2.get(t2), a3 = true === t2.isWebGLCubeRenderTarget;\n if (n3.__boundDepthTexture !== t2.depthTexture) {\n const e3 = t2.depthTexture;\n if (n3.__depthDisposeCallback && n3.__depthDisposeCallback(), e3) {\n const t3 = () => {\n delete n3.__boundDepthTexture, delete n3.__depthDisposeCallback, e3.removeEventListener(\"dispose\", t3);\n };\n e3.addEventListener(\"dispose\", t3), n3.__depthDisposeCallback = t3;\n }\n n3.__boundDepthTexture = e3;\n }\n if (t2.depthTexture && !n3.__autoAllocateDepthBuffer)\n if (a3) for (let e3 = 0; e3 < 6; e3++) q2(n3.__webglFramebuffer[e3], t2, e3);\n else {\n const e3 = t2.texture.mipmaps;\n e3 && e3.length > 0 ? q2(n3.__webglFramebuffer[0], t2, 0) : q2(n3.__webglFramebuffer, t2, 0);\n }\n else if (a3) {\n n3.__webglDepthbuffer = [];\n for (let r3 = 0; r3 < 6; r3++)\n if (i2.bindFramebuffer(e2.FRAMEBUFFER, n3.__webglFramebuffer[r3]), void 0 === n3.__webglDepthbuffer[r3])\n n3.__webglDepthbuffer[r3] = e2.createRenderbuffer(), Y2(n3.__webglDepthbuffer[r3], t2, false);\n else {\n const i3 = t2.stencilBuffer ? e2.DEPTH_STENCIL_ATTACHMENT : e2.DEPTH_ATTACHMENT, a4 = n3.__webglDepthbuffer[r3];\n e2.bindRenderbuffer(e2.RENDERBUFFER, a4), e2.framebufferRenderbuffer(e2.FRAMEBUFFER, i3, e2.RENDERBUFFER, a4);\n }\n } else {\n const r3 = t2.texture.mipmaps;\n if (r3 && r3.length > 0 ? i2.bindFramebuffer(e2.FRAMEBUFFER, n3.__webglFramebuffer[0]) : i2.bindFramebuffer(e2.FRAMEBUFFER, n3.__webglFramebuffer), void 0 === n3.__webglDepthbuffer)\n n3.__webglDepthbuffer = e2.createRenderbuffer(), Y2(n3.__webglDepthbuffer, t2, false);\n else {\n const i3 = t2.stencilBuffer ? e2.DEPTH_STENCIL_ATTACHMENT : e2.DEPTH_ATTACHMENT, r4 = n3.__webglDepthbuffer;\n e2.bindRenderbuffer(e2.RENDERBUFFER, r4), e2.framebufferRenderbuffer(e2.FRAMEBUFFER, i3, e2.RENDERBUFFER, r4);\n }\n }\n i2.bindFramebuffer(e2.FRAMEBUFFER, null);\n }\n const Z2 = [], $2 = [];\n function Q2(e3) {\n return Math.min(a2.maxSamples, e3.samples);\n }\n function J2(e3) {\n const t2 = r2.get(e3);\n return e3.samples > 0 && true === n2.has(\"WEBGL_multisampled_render_to_texture\") && false !== t2.__useRenderToTexture;\n }\n function ee2(e3, t2) {\n const n3 = e3.colorSpace, i3 = e3.format, r3 = e3.type;\n return true === e3.isCompressedTexture || true === e3.isVideoTexture || n3 !== ss && n3 !== ts && (Ri.getTransfer(n3) === rs ? i3 === jt && r3 === zt || ai(\"WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.\") : oi(\"WebGLTextures: Unsupported texture color space:\", n3)), t2;\n }\n function te2(e3) {\n return \"undefined\" != typeof HTMLImageElement && e3 instanceof HTMLImageElement ? (d2.width = e3.naturalWidth || e3.width, d2.height = e3.naturalHeight || e3.height) : \"undefined\" != typeof VideoFrame && e3 instanceof VideoFrame ? (d2.width = e3.displayWidth, d2.height = e3.displayHeight) : (d2.width = e3.width, d2.height = e3.height), d2;\n }\n this.allocateTextureUnit = function() {\n const e3 = N2;\n return e3 >= a2.maxTextures && ai(\n \"WebGLTextures: Trying to use \" + e3 + \" texture units while this GPU supports only \" + a2.maxTextures\n ), N2 += 1, e3;\n }, this.resetTextureUnits = function() {\n N2 = 0;\n }, this.getTextureUnits = function() {\n return N2;\n }, this.setTextureUnits = function(e3) {\n N2 = e3;\n }, this.setTexture2D = F2, this.setTexture2DArray = function(t2, n3) {\n const a3 = r2.get(t2);\n false === t2.isRenderTargetTexture && t2.version > 0 && a3.__version !== t2.version ? X2(a3, t2, n3) : (t2.isExternalTexture && (a3.__webglTexture = t2.sourceTexture ? t2.sourceTexture : null), i2.bindTexture(e2.TEXTURE_2D_ARRAY, a3.__webglTexture, e2.TEXTURE0 + n3));\n }, this.setTexture3D = function(t2, n3) {\n const a3 = r2.get(t2);\n false === t2.isRenderTargetTexture && t2.version > 0 && a3.__version !== t2.version ? X2(a3, t2, n3) : i2.bindTexture(e2.TEXTURE_3D, a3.__webglTexture, e2.TEXTURE0 + n3);\n }, this.setTextureCube = function(t2, n3) {\n const s3 = r2.get(t2);\n true !== t2.isCubeDepthTexture && t2.version > 0 && s3.__version !== t2.version ? (function(t3, n4, s4) {\n if (6 !== n4.image.length) return;\n const l3 = z2(t3, n4), c3 = n4.source;\n i2.bindTexture(e2.TEXTURE_CUBE_MAP, t3.__webglTexture, e2.TEXTURE0 + s4);\n const d3 = r2.get(c3);\n if (c3.version !== d3.__version || true === l3) {\n i2.activeTexture(e2.TEXTURE0 + s4);\n const t4 = Ri.getPrimaries(Ri.workingColorSpace), r3 = n4.colorSpace === ts ? null : Ri.getPrimaries(n4.colorSpace), u3 = n4.colorSpace === ts || t4 === r3 ? e2.NONE : e2.BROWSER_DEFAULT_WEBGL;\n i2.pixelStorei(e2.UNPACK_FLIP_Y_WEBGL, n4.flipY), i2.pixelStorei(e2.UNPACK_PREMULTIPLY_ALPHA_WEBGL, n4.premultiplyAlpha), i2.pixelStorei(e2.UNPACK_ALIGNMENT, n4.unpackAlignment), i2.pixelStorei(e2.UNPACK_COLORSPACE_CONVERSION_WEBGL, u3);\n const p2 = n4.isCompressedTexture || n4.image[0].isCompressedTexture, m3 = n4.image[0] && n4.image[0].isDataTexture, h3 = [];\n for (let e3 = 0; e3 < 6; e3++)\n h3[e3] = p2 || m3 ? m3 ? n4.image[e3].image : n4.image[e3] : x2(n4.image[e3], true, a2.maxCubemapSize), h3[e3] = ee2(n4, h3[e3]);\n const _3 = h3[0], g3 = o2.convert(n4.format, n4.colorSpace), E3 = o2.convert(n4.type), S2 = C2(n4.internalFormat, g3, E3, n4.normalized, n4.colorSpace), M2 = true !== n4.isVideoTexture, b3 = void 0 === d3.__version || true === l3, P3 = c3.dataReady;\n let U3, D2 = L2(n4, _3);\n if (W2(e2.TEXTURE_CUBE_MAP, n4), p2) {\n M2 && b3 && i2.texStorage2D(e2.TEXTURE_CUBE_MAP, D2, S2, _3.width, _3.height);\n for (let t5 = 0; t5 < 6; t5++) {\n U3 = h3[t5].mipmaps;\n for (let r4 = 0; r4 < U3.length; r4++) {\n const a3 = U3[r4];\n n4.format !== jt ? null !== g3 ? M2 ? P3 && i2.compressedTexSubImage2D(\n e2.TEXTURE_CUBE_MAP_POSITIVE_X + t5,\n r4,\n 0,\n 0,\n a3.width,\n a3.height,\n g3,\n a3.data\n ) : i2.compressedTexImage2D(\n e2.TEXTURE_CUBE_MAP_POSITIVE_X + t5,\n r4,\n S2,\n a3.width,\n a3.height,\n 0,\n a3.data\n ) : ai(\n \"WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()\"\n ) : M2 ? P3 && i2.texSubImage2D(\n e2.TEXTURE_CUBE_MAP_POSITIVE_X + t5,\n r4,\n 0,\n 0,\n a3.width,\n a3.height,\n g3,\n E3,\n a3.data\n ) : i2.texImage2D(\n e2.TEXTURE_CUBE_MAP_POSITIVE_X + t5,\n r4,\n S2,\n a3.width,\n a3.height,\n 0,\n g3,\n E3,\n a3.data\n );\n }\n }\n } else {\n if (U3 = n4.mipmaps, M2 && b3) {\n U3.length > 0 && D2++;\n const t5 = te2(h3[0]);\n i2.texStorage2D(e2.TEXTURE_CUBE_MAP, D2, S2, t5.width, t5.height);\n }\n for (let t5 = 0; t5 < 6; t5++)\n if (m3) {\n M2 ? P3 && i2.texSubImage2D(\n e2.TEXTURE_CUBE_MAP_POSITIVE_X + t5,\n 0,\n 0,\n 0,\n h3[t5].width,\n h3[t5].height,\n g3,\n E3,\n h3[t5].data\n ) : i2.texImage2D(\n e2.TEXTURE_CUBE_MAP_POSITIVE_X + t5,\n 0,\n S2,\n h3[t5].width,\n h3[t5].height,\n 0,\n g3,\n E3,\n h3[t5].data\n );\n for (let n5 = 0; n5 < U3.length; n5++) {\n const r4 = U3[n5].image[t5].image;\n M2 ? P3 && i2.texSubImage2D(\n e2.TEXTURE_CUBE_MAP_POSITIVE_X + t5,\n n5 + 1,\n 0,\n 0,\n r4.width,\n r4.height,\n g3,\n E3,\n r4.data\n ) : i2.texImage2D(\n e2.TEXTURE_CUBE_MAP_POSITIVE_X + t5,\n n5 + 1,\n S2,\n r4.width,\n r4.height,\n 0,\n g3,\n E3,\n r4.data\n );\n }\n } else {\n M2 ? P3 && i2.texSubImage2D(e2.TEXTURE_CUBE_MAP_POSITIVE_X + t5, 0, 0, 0, g3, E3, h3[t5]) : i2.texImage2D(e2.TEXTURE_CUBE_MAP_POSITIVE_X + t5, 0, S2, g3, E3, h3[t5]);\n for (let n5 = 0; n5 < U3.length; n5++) {\n const r4 = U3[n5];\n M2 ? P3 && i2.texSubImage2D(\n e2.TEXTURE_CUBE_MAP_POSITIVE_X + t5,\n n5 + 1,\n 0,\n 0,\n g3,\n E3,\n r4.image[t5]\n ) : i2.texImage2D(\n e2.TEXTURE_CUBE_MAP_POSITIVE_X + t5,\n n5 + 1,\n S2,\n g3,\n E3,\n r4.image[t5]\n );\n }\n }\n }\n R2(n4) && A2(e2.TEXTURE_CUBE_MAP), d3.__version = c3.version, n4.onUpdate && n4.onUpdate(n4);\n }\n t3.__version = n4.version;\n })(s3, t2, n3) : i2.bindTexture(e2.TEXTURE_CUBE_MAP, s3.__webglTexture, e2.TEXTURE0 + n3);\n }, this.rebindTextures = function(t2, n3, i3) {\n const a3 = r2.get(t2);\n void 0 !== n3 && K2(a3.__webglFramebuffer, t2, t2.texture, e2.COLOR_ATTACHMENT0, e2.TEXTURE_2D, 0), void 0 !== i3 && j2(t2);\n }, this.setupRenderTarget = function(t2) {\n const n3 = t2.texture, a3 = r2.get(t2), l3 = r2.get(n3);\n t2.addEventListener(\"dispose\", w2);\n const c3 = t2.textures, d3 = true === t2.isWebGLCubeRenderTarget, u3 = c3.length > 1;\n if (u3 || (void 0 === l3.__webglTexture && (l3.__webglTexture = e2.createTexture()), l3.__version = n3.version, s2.memory.textures++), d3) {\n a3.__webglFramebuffer = [];\n for (let t3 = 0; t3 < 6; t3++)\n if (n3.mipmaps && n3.mipmaps.length > 0) {\n a3.__webglFramebuffer[t3] = [];\n for (let i3 = 0; i3 < n3.mipmaps.length; i3++)\n a3.__webglFramebuffer[t3][i3] = e2.createFramebuffer();\n } else a3.__webglFramebuffer[t3] = e2.createFramebuffer();\n } else {\n if (n3.mipmaps && n3.mipmaps.length > 0) {\n a3.__webglFramebuffer = [];\n for (let t3 = 0; t3 < n3.mipmaps.length; t3++)\n a3.__webglFramebuffer[t3] = e2.createFramebuffer();\n } else a3.__webglFramebuffer = e2.createFramebuffer();\n if (u3)\n for (let t3 = 0, n4 = c3.length; t3 < n4; t3++) {\n const n5 = r2.get(c3[t3]);\n void 0 === n5.__webglTexture && (n5.__webglTexture = e2.createTexture(), s2.memory.textures++);\n }\n if (t2.samples > 0 && false === J2(t2)) {\n a3.__webglMultisampledFramebuffer = e2.createFramebuffer(), a3.__webglColorRenderbuffer = [], i2.bindFramebuffer(e2.FRAMEBUFFER, a3.__webglMultisampledFramebuffer);\n for (let n4 = 0; n4 < c3.length; n4++) {\n const i3 = c3[n4];\n a3.__webglColorRenderbuffer[n4] = e2.createRenderbuffer(), e2.bindRenderbuffer(e2.RENDERBUFFER, a3.__webglColorRenderbuffer[n4]);\n const r3 = o2.convert(i3.format, i3.colorSpace), s3 = o2.convert(i3.type), l4 = C2(i3.internalFormat, r3, s3, i3.normalized, i3.colorSpace, true === t2.isXRRenderTarget), d4 = Q2(t2);\n e2.renderbufferStorageMultisample(e2.RENDERBUFFER, d4, l4, t2.width, t2.height), e2.framebufferRenderbuffer(\n e2.FRAMEBUFFER,\n e2.COLOR_ATTACHMENT0 + n4,\n e2.RENDERBUFFER,\n a3.__webglColorRenderbuffer[n4]\n );\n }\n e2.bindRenderbuffer(e2.RENDERBUFFER, null), t2.depthBuffer && (a3.__webglDepthRenderbuffer = e2.createRenderbuffer(), Y2(a3.__webglDepthRenderbuffer, t2, true)), i2.bindFramebuffer(e2.FRAMEBUFFER, null);\n }\n }\n if (d3) {\n i2.bindTexture(e2.TEXTURE_CUBE_MAP, l3.__webglTexture), W2(e2.TEXTURE_CUBE_MAP, n3);\n for (let i3 = 0; i3 < 6; i3++)\n if (n3.mipmaps && n3.mipmaps.length > 0)\n for (let r3 = 0; r3 < n3.mipmaps.length; r3++)\n K2(\n a3.__webglFramebuffer[i3][r3],\n t2,\n n3,\n e2.COLOR_ATTACHMENT0,\n e2.TEXTURE_CUBE_MAP_POSITIVE_X + i3,\n r3\n );\n else\n K2(\n a3.__webglFramebuffer[i3],\n t2,\n n3,\n e2.COLOR_ATTACHMENT0,\n e2.TEXTURE_CUBE_MAP_POSITIVE_X + i3,\n 0\n );\n R2(n3) && A2(e2.TEXTURE_CUBE_MAP), i2.unbindTexture();\n } else if (u3) {\n for (let n4 = 0, o3 = c3.length; n4 < o3; n4++) {\n const o4 = c3[n4], s3 = r2.get(o4);\n let l4 = e2.TEXTURE_2D;\n (t2.isWebGL3DRenderTarget || t2.isWebGLArrayRenderTarget) && (l4 = t2.isWebGL3DRenderTarget ? e2.TEXTURE_3D : e2.TEXTURE_2D_ARRAY), i2.bindTexture(l4, s3.__webglTexture), W2(l4, o4), K2(a3.__webglFramebuffer, t2, o4, e2.COLOR_ATTACHMENT0 + n4, l4, 0), R2(o4) && A2(l4);\n }\n i2.unbindTexture();\n } else {\n let r3 = e2.TEXTURE_2D;\n if ((t2.isWebGL3DRenderTarget || t2.isWebGLArrayRenderTarget) && (r3 = t2.isWebGL3DRenderTarget ? e2.TEXTURE_3D : e2.TEXTURE_2D_ARRAY), i2.bindTexture(r3, l3.__webglTexture), W2(r3, n3), n3.mipmaps && n3.mipmaps.length > 0)\n for (let i3 = 0; i3 < n3.mipmaps.length; i3++)\n K2(a3.__webglFramebuffer[i3], t2, n3, e2.COLOR_ATTACHMENT0, r3, i3);\n else K2(a3.__webglFramebuffer, t2, n3, e2.COLOR_ATTACHMENT0, r3, 0);\n R2(n3) && A2(r3), i2.unbindTexture();\n }\n t2.depthBuffer && j2(t2);\n }, this.updateRenderTargetMipmap = function(e3) {\n const t2 = e3.textures;\n for (let n3 = 0, a3 = t2.length; n3 < a3; n3++) {\n const a4 = t2[n3];\n if (R2(a4)) {\n const t3 = b2(e3), n4 = r2.get(a4).__webglTexture;\n i2.bindTexture(t3, n4), A2(t3), i2.unbindTexture();\n }\n }\n }, this.updateMultisampleRenderTarget = function(t2) {\n if (t2.samples > 0) {\n if (false === J2(t2)) {\n const n3 = t2.textures, a3 = t2.width, o3 = t2.height;\n let s3 = e2.COLOR_BUFFER_BIT;\n const l3 = t2.stencilBuffer ? e2.DEPTH_STENCIL_ATTACHMENT : e2.DEPTH_ATTACHMENT, d3 = r2.get(t2), u3 = n3.length > 1;\n if (u3)\n for (let t3 = 0; t3 < n3.length; t3++)\n i2.bindFramebuffer(e2.FRAMEBUFFER, d3.__webglMultisampledFramebuffer), e2.framebufferRenderbuffer(\n e2.FRAMEBUFFER,\n e2.COLOR_ATTACHMENT0 + t3,\n e2.RENDERBUFFER,\n null\n ), i2.bindFramebuffer(e2.FRAMEBUFFER, d3.__webglFramebuffer), e2.framebufferTexture2D(\n e2.DRAW_FRAMEBUFFER,\n e2.COLOR_ATTACHMENT0 + t3,\n e2.TEXTURE_2D,\n null,\n 0\n );\n i2.bindFramebuffer(e2.READ_FRAMEBUFFER, d3.__webglMultisampledFramebuffer);\n const f2 = t2.texture.mipmaps;\n f2 && f2.length > 0 ? i2.bindFramebuffer(e2.DRAW_FRAMEBUFFER, d3.__webglFramebuffer[0]) : i2.bindFramebuffer(e2.DRAW_FRAMEBUFFER, d3.__webglFramebuffer);\n for (let i3 = 0; i3 < n3.length; i3++) {\n if (t2.resolveDepthBuffer && (t2.depthBuffer && (s3 |= e2.DEPTH_BUFFER_BIT), t2.stencilBuffer && t2.resolveStencilBuffer && (s3 |= e2.STENCIL_BUFFER_BIT)), u3) {\n e2.framebufferRenderbuffer(\n e2.READ_FRAMEBUFFER,\n e2.COLOR_ATTACHMENT0,\n e2.RENDERBUFFER,\n d3.__webglColorRenderbuffer[i3]\n );\n const t3 = r2.get(n3[i3]).__webglTexture;\n e2.framebufferTexture2D(e2.DRAW_FRAMEBUFFER, e2.COLOR_ATTACHMENT0, e2.TEXTURE_2D, t3, 0);\n }\n e2.blitFramebuffer(0, 0, a3, o3, 0, 0, a3, o3, s3, e2.NEAREST), true === c2 && (Z2.length = 0, $2.length = 0, Z2.push(e2.COLOR_ATTACHMENT0 + i3), t2.depthBuffer && false === t2.resolveDepthBuffer && (Z2.push(l3), $2.push(l3), e2.invalidateFramebuffer(e2.DRAW_FRAMEBUFFER, $2)), e2.invalidateFramebuffer(e2.READ_FRAMEBUFFER, Z2));\n }\n if (i2.bindFramebuffer(e2.READ_FRAMEBUFFER, null), i2.bindFramebuffer(e2.DRAW_FRAMEBUFFER, null), u3)\n for (let t3 = 0; t3 < n3.length; t3++) {\n i2.bindFramebuffer(e2.FRAMEBUFFER, d3.__webglMultisampledFramebuffer), e2.framebufferRenderbuffer(\n e2.FRAMEBUFFER,\n e2.COLOR_ATTACHMENT0 + t3,\n e2.RENDERBUFFER,\n d3.__webglColorRenderbuffer[t3]\n );\n const a4 = r2.get(n3[t3]).__webglTexture;\n i2.bindFramebuffer(e2.FRAMEBUFFER, d3.__webglFramebuffer), e2.framebufferTexture2D(\n e2.DRAW_FRAMEBUFFER,\n e2.COLOR_ATTACHMENT0 + t3,\n e2.TEXTURE_2D,\n a4,\n 0\n );\n }\n i2.bindFramebuffer(e2.DRAW_FRAMEBUFFER, d3.__webglMultisampledFramebuffer);\n } else if (t2.depthBuffer && false === t2.resolveDepthBuffer && c2) {\n const n3 = t2.stencilBuffer ? e2.DEPTH_STENCIL_ATTACHMENT : e2.DEPTH_ATTACHMENT;\n e2.invalidateFramebuffer(e2.DRAW_FRAMEBUFFER, [n3]);\n }\n }\n }, this.setupDepthRenderbuffer = j2, this.setupFrameBufferTexture = K2, this.useMultisampledRTT = J2, this.isReversedDepthBuffer = function() {\n return i2.buffers.depth.getReversed();\n };\n }\n function Ea2(e2, t2) {\n return {\n convert: function(n2, i2 = ts) {\n let r2;\n const a2 = Ri.getTransfer(i2);\n if (n2 === zt) return e2.UNSIGNED_BYTE;\n if (n2 === Et) return e2.UNSIGNED_SHORT_4_4_4_4;\n if (n2 === Nt) return e2.UNSIGNED_SHORT_5_5_5_1;\n if (n2 === Lt) return e2.UNSIGNED_INT_5_9_9_9_REV;\n if (n2 === Ft) return e2.UNSIGNED_INT_10F_11F_11F_REV;\n if (n2 === Ct) return e2.BYTE;\n if (n2 === It) return e2.SHORT;\n if (n2 === Bt) return e2.UNSIGNED_SHORT;\n if (n2 === kt) return e2.INT;\n if (n2 === Ot) return e2.UNSIGNED_INT;\n if (n2 === Pt) return e2.FLOAT;\n if (n2 === Rt) return e2.HALF_FLOAT;\n if (n2 === Dt) return e2.ALPHA;\n if (n2 === Ut) return e2.RGB;\n if (n2 === jt) return e2.RGBA;\n if (n2 === Wt) return e2.DEPTH_COMPONENT;\n if (n2 === Jt) return e2.DEPTH_STENCIL;\n if (n2 === qt) return e2.RED;\n if (n2 === Ht) return e2.RED_INTEGER;\n if (n2 === Xt) return e2.RG;\n if (n2 === Yt) return e2.RG_INTEGER;\n if (n2 === Gt) return e2.RGBA_INTEGER;\n if (n2 === $t || n2 === Qt || n2 === Kt || n2 === te)\n if (a2 === rs) {\n if (r2 = t2.get(\"WEBGL_compressed_texture_s3tc_srgb\"), null === r2) return null;\n if (n2 === $t) return r2.COMPRESSED_SRGB_S3TC_DXT1_EXT;\n if (n2 === Qt) return r2.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;\n if (n2 === Kt) return r2.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;\n if (n2 === te) return r2.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT;\n } else {\n if (r2 = t2.get(\"WEBGL_compressed_texture_s3tc\"), null === r2) return null;\n if (n2 === $t) return r2.COMPRESSED_RGB_S3TC_DXT1_EXT;\n if (n2 === Qt) return r2.COMPRESSED_RGBA_S3TC_DXT1_EXT;\n if (n2 === Kt) return r2.COMPRESSED_RGBA_S3TC_DXT3_EXT;\n if (n2 === te) return r2.COMPRESSED_RGBA_S3TC_DXT5_EXT;\n }\n if (n2 === ee || n2 === se || n2 === ie || n2 === re) {\n if (r2 = t2.get(\"WEBGL_compressed_texture_pvrtc\"), null === r2) return null;\n if (n2 === ee) return r2.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;\n if (n2 === se) return r2.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;\n if (n2 === ie) return r2.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;\n if (n2 === re) return r2.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;\n }\n if (n2 === ne || n2 === ae || n2 === oe || n2 === he || n2 === le || n2 === ce || n2 === ue) {\n if (r2 = t2.get(\"WEBGL_compressed_texture_etc\"), null === r2) return null;\n if (n2 === ne || n2 === ae) return a2 === rs ? r2.COMPRESSED_SRGB8_ETC2 : r2.COMPRESSED_RGB8_ETC2;\n if (n2 === oe)\n return a2 === rs ? r2.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : r2.COMPRESSED_RGBA8_ETC2_EAC;\n if (n2 === he) return r2.COMPRESSED_R11_EAC;\n if (n2 === le) return r2.COMPRESSED_SIGNED_R11_EAC;\n if (n2 === ce) return r2.COMPRESSED_RG11_EAC;\n if (n2 === ue) return r2.COMPRESSED_SIGNED_RG11_EAC;\n }\n if (n2 === de || n2 === pe || n2 === me || n2 === ye || n2 === ge || n2 === fe || n2 === xe || n2 === be || n2 === ve || n2 === we || n2 === Me || n2 === Se || n2 === _e || n2 === Ae) {\n if (r2 = t2.get(\"WEBGL_compressed_texture_astc\"), null === r2) return null;\n if (n2 === de)\n return a2 === rs ? r2.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR : r2.COMPRESSED_RGBA_ASTC_4x4_KHR;\n if (n2 === pe)\n return a2 === rs ? r2.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR : r2.COMPRESSED_RGBA_ASTC_5x4_KHR;\n if (n2 === me)\n return a2 === rs ? r2.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR : r2.COMPRESSED_RGBA_ASTC_5x5_KHR;\n if (n2 === ye)\n return a2 === rs ? r2.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR : r2.COMPRESSED_RGBA_ASTC_6x5_KHR;\n if (n2 === ge)\n return a2 === rs ? r2.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR : r2.COMPRESSED_RGBA_ASTC_6x6_KHR;\n if (n2 === fe)\n return a2 === rs ? r2.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR : r2.COMPRESSED_RGBA_ASTC_8x5_KHR;\n if (n2 === xe)\n return a2 === rs ? r2.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR : r2.COMPRESSED_RGBA_ASTC_8x6_KHR;\n if (n2 === be)\n return a2 === rs ? r2.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR : r2.COMPRESSED_RGBA_ASTC_8x8_KHR;\n if (n2 === ve)\n return a2 === rs ? r2.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR : r2.COMPRESSED_RGBA_ASTC_10x5_KHR;\n if (n2 === we)\n return a2 === rs ? r2.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR : r2.COMPRESSED_RGBA_ASTC_10x6_KHR;\n if (n2 === Me)\n return a2 === rs ? r2.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR : r2.COMPRESSED_RGBA_ASTC_10x8_KHR;\n if (n2 === Se)\n return a2 === rs ? r2.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR : r2.COMPRESSED_RGBA_ASTC_10x10_KHR;\n if (n2 === _e)\n return a2 === rs ? r2.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR : r2.COMPRESSED_RGBA_ASTC_12x10_KHR;\n if (n2 === Ae)\n return a2 === rs ? r2.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR : r2.COMPRESSED_RGBA_ASTC_12x12_KHR;\n }\n if (n2 === Te || n2 === ze || n2 === Ce) {\n if (r2 = t2.get(\"EXT_texture_compression_bptc\"), null === r2) return null;\n if (n2 === Te)\n return a2 === rs ? r2.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT : r2.COMPRESSED_RGBA_BPTC_UNORM_EXT;\n if (n2 === ze) return r2.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;\n if (n2 === Ce) return r2.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT;\n }\n if (n2 === Ie || n2 === Be || n2 === ke || n2 === Oe) {\n if (r2 = t2.get(\"EXT_texture_compression_rgtc\"), null === r2) return null;\n if (n2 === Ie) return r2.COMPRESSED_RED_RGTC1_EXT;\n if (n2 === Be) return r2.COMPRESSED_SIGNED_RED_RGTC1_EXT;\n if (n2 === ke) return r2.COMPRESSED_RED_GREEN_RGTC2_EXT;\n if (n2 === Oe) return r2.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT;\n }\n return n2 === Vt ? e2.UNSIGNED_INT_24_8 : void 0 !== e2[n2] ? e2[n2] : null;\n }\n };\n }\n var Sa2 = class {\n constructor() {\n this.texture = null, this.mesh = null, this.depthNear = 0, this.depthFar = 0;\n }\n init(e2, t2) {\n if (null === this.texture) {\n const n2 = new mh(e2.texture);\n e2.depthNear === t2.depthNear && e2.depthFar === t2.depthFar || (this.depthNear = e2.depthNear, this.depthFar = e2.depthFar), this.texture = n2;\n }\n }\n getMesh(e2) {\n if (null !== this.texture && null === this.mesh) {\n const t2 = e2.cameras[0].viewport, n2 = new Zl({\n vertexShader: \"\\nvoid main() {\\n\\n\tgl_Position = vec4( position, 1.0 );\\n\\n}\",\n fragmentShader: \"\\nuniform sampler2DArray depthColor;\\nuniform float depthWidth;\\nuniform float depthHeight;\\n\\nvoid main() {\\n\\n\tvec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );\\n\\n\tif ( coord.x >= 1.0 ) {\\n\\n\t\tgl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;\\n\\n\t} else {\\n\\n\t\tgl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;\\n\\n\t}\\n\\n}\",\n uniforms: {\n depthColor: { value: this.texture },\n depthWidth: { value: t2.z },\n depthHeight: { value: t2.w }\n }\n });\n this.mesh = new Ra(new Ol(20, 20), n2);\n }\n return this.mesh;\n }\n reset() {\n this.texture = null, this.mesh = null;\n }\n getDepthTexture() {\n return this.texture;\n }\n };\n var Ma2 = class extends di {\n constructor(e2, n2) {\n super();\n const r2 = this;\n let a2 = null, o2 = 1, s2 = null, l2 = \"local-floor\", c2 = 1, d2 = null, u2 = null, f2 = null, p2 = null, m2 = null, h2 = null;\n const _2 = \"undefined\" != typeof XRWebGLBinding, g2 = new Sa2(), E2 = {}, M2 = n2.getContextAttributes();\n let x2 = null, R2 = null;\n const A2 = [], b2 = [], C2 = new _i();\n let L2 = null;\n const U2 = new eu();\n U2.viewport = new qi();\n const D2 = new eu();\n D2.viewport = new qi();\n const w2 = [U2, D2], N2 = new Ru();\n let y2 = null, O2 = null;\n function F2(e3) {\n const t2 = b2.indexOf(e3.inputSource);\n if (-1 === t2) return;\n const n3 = A2[t2];\n void 0 !== n3 && (n3.update(e3.inputSource, e3.frame, d2 || s2), n3.dispatchEvent({ type: e3.type, data: e3.inputSource }));\n }\n function B2() {\n a2.removeEventListener(\"select\", F2), a2.removeEventListener(\"selectstart\", F2), a2.removeEventListener(\"selectend\", F2), a2.removeEventListener(\"squeeze\", F2), a2.removeEventListener(\"squeezestart\", F2), a2.removeEventListener(\"squeezeend\", F2), a2.removeEventListener(\"end\", B2), a2.removeEventListener(\"inputsourceschange\", G2);\n for (let e3 = 0; e3 < A2.length; e3++) {\n const t2 = b2[e3];\n null !== t2 && (b2[e3] = null, A2[e3].disconnect(t2));\n }\n y2 = null, O2 = null, g2.reset();\n for (const e3 in E2) delete E2[e3];\n e2.setRenderTarget(x2), m2 = null, p2 = null, f2 = null, a2 = null, R2 = null, k2.stop(), r2.isPresenting = false, e2.setPixelRatio(L2), e2.setSize(C2.width, C2.height, false), r2.dispatchEvent({ type: \"sessionend\" });\n }\n function G2(e3) {\n for (let t2 = 0; t2 < e3.removed.length; t2++) {\n const n3 = e3.removed[t2], i2 = b2.indexOf(n3);\n i2 >= 0 && (b2[i2] = null, A2[i2].disconnect(n3));\n }\n for (let t2 = 0; t2 < e3.added.length; t2++) {\n const n3 = e3.added[t2];\n let i2 = b2.indexOf(n3);\n if (-1 === i2) {\n for (let e4 = 0; e4 < A2.length; e4++) {\n if (e4 >= b2.length) {\n b2.push(n3), i2 = e4;\n break;\n }\n if (null === b2[e4]) {\n b2[e4] = n3, i2 = e4;\n break;\n }\n }\n if (-1 === i2) break;\n }\n const r3 = A2[i2];\n r3 && r3.connect(n3);\n }\n }\n this.cameraAutoUpdate = true, this.enabled = false, this.isPresenting = false, this.getController = function(e3) {\n let t2 = A2[e3];\n return void 0 === t2 && (t2 = new Cr(), A2[e3] = t2), t2.getTargetRaySpace();\n }, this.getControllerGrip = function(e3) {\n let t2 = A2[e3];\n return void 0 === t2 && (t2 = new Cr(), A2[e3] = t2), t2.getGripSpace();\n }, this.getHand = function(e3) {\n let t2 = A2[e3];\n return void 0 === t2 && (t2 = new Cr(), A2[e3] = t2), t2.getHandSpace();\n }, this.setFramebufferScaleFactor = function(e3) {\n o2 = e3, true === r2.isPresenting && ai(\"WebXRManager: Cannot change framebuffer scale while presenting.\");\n }, this.setReferenceSpaceType = function(e3) {\n l2 = e3, true === r2.isPresenting && ai(\"WebXRManager: Cannot change reference space type while presenting.\");\n }, this.getReferenceSpace = function() {\n return d2 || s2;\n }, this.setReferenceSpace = function(e3) {\n d2 = e3;\n }, this.getBaseLayer = function() {\n return null !== p2 ? p2 : m2;\n }, this.getBinding = function() {\n return null === f2 && _2 && (f2 = new XRWebGLBinding(a2, n2)), f2;\n }, this.getFrame = function() {\n return h2;\n }, this.getSession = function() {\n return a2;\n }, this.setSession = async function(t2) {\n if (a2 = t2, null !== a2) {\n x2 = e2.getRenderTarget(), a2.addEventListener(\"select\", F2), a2.addEventListener(\"selectstart\", F2), a2.addEventListener(\"selectend\", F2), a2.addEventListener(\"squeeze\", F2), a2.addEventListener(\"squeezestart\", F2), a2.addEventListener(\"squeezeend\", F2), a2.addEventListener(\"end\", B2), a2.addEventListener(\"inputsourceschange\", G2), true !== M2.xrCompatible && await n2.makeXRCompatible(), L2 = e2.getPixelRatio(), e2.getSize(C2);\n if (_2 && \"createProjectionLayer\" in XRWebGLBinding.prototype) {\n let t3 = null, i2 = null, r3 = null;\n M2.depth && (r3 = M2.stencil ? n2.DEPTH24_STENCIL8 : n2.DEPTH_COMPONENT24, t3 = M2.stencil ? Jt : Wt, i2 = M2.stencil ? Vt : Ot);\n const s3 = { colorFormat: n2.RGBA8, depthFormat: r3, scaleFactor: o2 };\n f2 = this.getBinding(), p2 = f2.createProjectionLayer(s3), a2.updateRenderState({ layers: [p2] }), e2.setPixelRatio(1), e2.setSize(p2.textureWidth, p2.textureHeight, false), R2 = new Xi(p2.textureWidth, p2.textureHeight, {\n format: jt,\n type: zt,\n depthTexture: new dh(\n p2.textureWidth,\n p2.textureHeight,\n i2,\n void 0,\n void 0,\n void 0,\n void 0,\n void 0,\n void 0,\n t3\n ),\n stencilBuffer: M2.stencil,\n colorSpace: e2.outputColorSpace,\n samples: M2.antialias ? 4 : 0,\n resolveDepthBuffer: false === p2.ignoreDepthValues,\n resolveStencilBuffer: false === p2.ignoreDepthValues\n });\n } else {\n const t3 = {\n antialias: M2.antialias,\n alpha: true,\n depth: M2.depth,\n stencil: M2.stencil,\n framebufferScaleFactor: o2\n };\n m2 = new XRWebGLLayer(a2, n2, t3), a2.updateRenderState({ baseLayer: m2 }), e2.setPixelRatio(1), e2.setSize(m2.framebufferWidth, m2.framebufferHeight, false), R2 = new Xi(m2.framebufferWidth, m2.framebufferHeight, {\n format: jt,\n type: zt,\n colorSpace: e2.outputColorSpace,\n stencilBuffer: M2.stencil,\n resolveDepthBuffer: false === m2.ignoreDepthValues,\n resolveStencilBuffer: false === m2.ignoreDepthValues\n });\n }\n R2.isXRRenderTarget = true, this.setFoveation(c2), d2 = null, s2 = await a2.requestReferenceSpace(l2), k2.setContext(a2), k2.start(), r2.isPresenting = true, r2.dispatchEvent({ type: \"sessionstart\" });\n }\n }, this.getEnvironmentBlendMode = function() {\n if (null !== a2) return a2.environmentBlendMode;\n }, this.getDepthTexture = function() {\n return g2.getDepthTexture();\n };\n const H2 = new Ti(), V2 = new Ti();\n function W2(e3, t2) {\n null === t2 ? e3.matrixWorld.copy(e3.matrix) : e3.matrixWorld.multiplyMatrices(t2.matrixWorld, e3.matrix), e3.matrixWorldInverse.copy(e3.matrixWorld).invert();\n }\n this.updateCamera = function(e3) {\n if (null === a2) return;\n let t2 = e3.near, n3 = e3.far;\n null !== g2.texture && (g2.depthNear > 0 && (t2 = g2.depthNear), g2.depthFar > 0 && (n3 = g2.depthFar)), N2.near = D2.near = U2.near = t2, N2.far = D2.far = U2.far = n3, y2 === N2.near && O2 === N2.far || (a2.updateRenderState({ depthNear: N2.near, depthFar: N2.far }), y2 = N2.near, O2 = N2.far), N2.layers.mask = 6 | e3.layers.mask, U2.layers.mask = -5 & N2.layers.mask, D2.layers.mask = -3 & N2.layers.mask;\n const i2 = e3.parent, r3 = N2.cameras;\n W2(N2, i2);\n for (let e4 = 0; e4 < r3.length; e4++) W2(r3[e4], i2);\n 2 === r3.length ? (function(e4, t3, n4) {\n H2.setFromMatrixPosition(t3.matrixWorld), V2.setFromMatrixPosition(n4.matrixWorld);\n const i3 = H2.distanceTo(V2), r4 = t3.projectionMatrix.elements, a3 = n4.projectionMatrix.elements, o3 = r4[14] / (r4[10] - 1), s3 = r4[14] / (r4[10] + 1), l3 = (r4[9] + 1) / r4[5], c3 = (r4[9] - 1) / r4[5], d3 = (r4[8] - 1) / r4[0], u3 = (a3[8] + 1) / a3[0], f3 = o3 * d3, p3 = o3 * u3, m3 = i3 / (-d3 + u3), h3 = m3 * -d3;\n if (t3.matrixWorld.decompose(e4.position, e4.quaternion, e4.scale), e4.translateX(h3), e4.translateZ(m3), e4.matrixWorld.compose(e4.position, e4.quaternion, e4.scale), e4.matrixWorldInverse.copy(e4.matrixWorld).invert(), -1 === r4[10])\n e4.projectionMatrix.copy(t3.projectionMatrix), e4.projectionMatrixInverse.copy(t3.projectionMatrixInverse);\n else {\n const t4 = o3 + m3, n5 = s3 + m3, r5 = f3 - h3, a4 = p3 + (i3 - h3), d4 = l3 * s3 / n5 * t4, u4 = c3 * s3 / n5 * t4;\n e4.projectionMatrix.makePerspective(r5, a4, d4, u4, t4, n5), e4.projectionMatrixInverse.copy(e4.projectionMatrix).invert();\n }\n })(N2, U2, D2) : N2.projectionMatrix.copy(U2.projectionMatrix), (function(e4, t3, n4) {\n null === n4 ? e4.matrix.copy(t3.matrixWorld) : (e4.matrix.copy(n4.matrixWorld), e4.matrix.invert(), e4.matrix.multiply(t3.matrixWorld));\n e4.matrix.decompose(e4.position, e4.quaternion, e4.scale), e4.updateMatrixWorld(true), e4.projectionMatrix.copy(t3.projectionMatrix), e4.projectionMatrixInverse.copy(t3.projectionMatrixInverse), e4.isPerspectiveCamera && (e4.fov = 2 * gi * Math.atan(1 / e4.projectionMatrix.elements[5]), e4.zoom = 1);\n })(e3, N2, i2);\n }, this.getCamera = function() {\n return N2;\n }, this.getFoveation = function() {\n if (null !== p2 || null !== m2) return c2;\n }, this.setFoveation = function(e3) {\n c2 = e3, null !== p2 && (p2.fixedFoveation = e3), null !== m2 && void 0 !== m2.fixedFoveation && (m2.fixedFoveation = e3);\n }, this.hasDepthSensing = function() {\n return null !== g2.texture;\n }, this.getDepthSensingMesh = function() {\n return g2.getMesh(N2);\n }, this.getCameraTexture = function(e3) {\n return E2[e3];\n };\n let z2 = null;\n const k2 = new On2();\n k2.setAnimationLoop(function(t2, n3) {\n if (u2 = n3.getViewerPose(d2 || s2), h2 = n3, null !== u2) {\n const t3 = u2.views;\n null !== m2 && (e2.setRenderTargetFramebuffer(R2, m2.framebuffer), e2.setRenderTarget(R2));\n let n4 = false;\n t3.length !== N2.cameras.length && (N2.cameras.length = 0, n4 = true);\n for (let i3 = 0; i3 < t3.length; i3++) {\n const r3 = t3[i3];\n let a3 = null;\n if (null !== m2) a3 = m2.getViewport(r3);\n else {\n const t4 = f2.getViewSubImage(p2, r3);\n a3 = t4.viewport, 0 === i3 && (e2.setRenderTargetTextures(R2, t4.colorTexture, t4.depthStencilTexture), e2.setRenderTarget(R2));\n }\n let o3 = w2[i3];\n void 0 === o3 && (o3 = new eu(), o3.layers.enable(i3), o3.viewport = new qi(), w2[i3] = o3), o3.matrix.fromArray(r3.transform.matrix), o3.matrix.decompose(o3.position, o3.quaternion, o3.scale), o3.projectionMatrix.fromArray(r3.projectionMatrix), o3.projectionMatrixInverse.copy(o3.projectionMatrix).invert(), o3.viewport.set(a3.x, a3.y, a3.width, a3.height), 0 === i3 && (N2.matrix.copy(o3.matrix), N2.matrix.decompose(N2.position, N2.quaternion, N2.scale)), true === n4 && N2.cameras.push(o3);\n }\n const i2 = a2.enabledFeatures;\n if (i2 && i2.includes(\"depth-sensing\") && \"gpu-optimized\" == a2.depthUsage && _2) {\n f2 = r2.getBinding();\n const e3 = f2.getDepthInformation(t3[0]);\n e3 && e3.isValid && e3.texture && g2.init(e3, a2.renderState);\n }\n if (i2 && i2.includes(\"camera-access\") && _2) {\n e2.state.unbindTexture(), f2 = r2.getBinding();\n for (let e3 = 0; e3 < t3.length; e3++) {\n const n5 = t3[e3].camera;\n if (n5) {\n let e4 = E2[n5];\n e4 || (e4 = new mh(), E2[n5] = e4);\n const t4 = f2.getCameraImage(n5);\n e4.sourceTexture = t4;\n }\n }\n }\n }\n for (let e3 = 0; e3 < A2.length; e3++) {\n const t3 = b2[e3], i2 = A2[e3];\n null !== t3 && void 0 !== i2 && i2.update(t3, n3, d2 || s2);\n }\n z2 && z2(t2, n3), n3.detectedPlanes && r2.dispatchEvent({ type: \"planesdetected\", data: n3 }), h2 = null;\n }), this.setAnimationLoop = function(e3) {\n z2 = e3;\n }, this.dispose = function() {\n };\n }\n };\n var Ta2 = new Qi();\n var xa2 = new Ii();\n function Ra2(e2, t2) {\n function n2(e3, t3) {\n true === e3.matrixAutoUpdate && e3.updateMatrix(), t3.value.copy(e3.matrix);\n }\n function i2(e3, i3) {\n e3.opacity.value = i3.opacity, i3.color && e3.diffuse.value.copy(i3.color), i3.emissive && e3.emissive.value.copy(i3.emissive).multiplyScalar(i3.emissiveIntensity), i3.map && (e3.map.value = i3.map, n2(i3.map, e3.mapTransform)), i3.alphaMap && (e3.alphaMap.value = i3.alphaMap, n2(i3.alphaMap, e3.alphaMapTransform)), i3.bumpMap && (e3.bumpMap.value = i3.bumpMap, n2(i3.bumpMap, e3.bumpMapTransform), e3.bumpScale.value = i3.bumpScale, i3.side === d && (e3.bumpScale.value *= -1)), i3.normalMap && (e3.normalMap.value = i3.normalMap, n2(i3.normalMap, e3.normalMapTransform), e3.normalScale.value.copy(i3.normalScale), i3.side === d && e3.normalScale.value.negate()), i3.displacementMap && (e3.displacementMap.value = i3.displacementMap, n2(i3.displacementMap, e3.displacementMapTransform), e3.displacementScale.value = i3.displacementScale, e3.displacementBias.value = i3.displacementBias), i3.emissiveMap && (e3.emissiveMap.value = i3.emissiveMap, n2(i3.emissiveMap, e3.emissiveMapTransform)), i3.specularMap && (e3.specularMap.value = i3.specularMap, n2(i3.specularMap, e3.specularMapTransform)), i3.alphaTest > 0 && (e3.alphaTest.value = i3.alphaTest);\n const r2 = t2.get(i3), a2 = r2.envMap, o2 = r2.envMapRotation;\n a2 && (e3.envMap.value = a2, e3.envMapRotation.value.setFromMatrix4(Ta2.makeRotationFromEuler(o2)).transpose(), a2.isCubeTexture && false === a2.isRenderTargetTexture && e3.envMapRotation.value.premultiply(xa2), e3.reflectivity.value = i3.reflectivity, e3.ior.value = i3.ior, e3.refractionRatio.value = i3.refractionRatio), i3.lightMap && (e3.lightMap.value = i3.lightMap, e3.lightMapIntensity.value = i3.lightMapIntensity, n2(i3.lightMap, e3.lightMapTransform)), i3.aoMap && (e3.aoMap.value = i3.aoMap, e3.aoMapIntensity.value = i3.aoMapIntensity, n2(i3.aoMap, e3.aoMapTransform));\n }\n return {\n refreshFogUniforms: function(t3, n3) {\n n3.color.getRGB(t3.fogColor.value, Xl(e2)), n3.isFog ? (t3.fogNear.value = n3.near, t3.fogFar.value = n3.far) : n3.isFogExp2 && (t3.fogDensity.value = n3.density);\n },\n refreshMaterialUniforms: function(e3, r2, a2, o2, s2) {\n r2.isNodeMaterial ? r2.uniformsNeedUpdate = false : r2.isMeshBasicMaterial ? i2(e3, r2) : r2.isMeshLambertMaterial ? (i2(e3, r2), r2.envMap && (e3.envMapIntensity.value = r2.envMapIntensity)) : r2.isMeshToonMaterial ? (i2(e3, r2), (function(e4, t3) {\n t3.gradientMap && (e4.gradientMap.value = t3.gradientMap);\n })(e3, r2)) : r2.isMeshPhongMaterial ? (i2(e3, r2), (function(e4, t3) {\n e4.specular.value.copy(t3.specular), e4.shininess.value = Math.max(t3.shininess, 1e-4);\n })(e3, r2), r2.envMap && (e3.envMapIntensity.value = r2.envMapIntensity)) : r2.isMeshStandardMaterial ? (i2(e3, r2), (function(e4, t3) {\n e4.metalness.value = t3.metalness, t3.metalnessMap && (e4.metalnessMap.value = t3.metalnessMap, n2(t3.metalnessMap, e4.metalnessMapTransform));\n e4.roughness.value = t3.roughness, t3.roughnessMap && (e4.roughnessMap.value = t3.roughnessMap, n2(t3.roughnessMap, e4.roughnessMapTransform));\n t3.envMap && (e4.envMapIntensity.value = t3.envMapIntensity);\n })(e3, r2), r2.isMeshPhysicalMaterial && (function(e4, t3, i3) {\n e4.ior.value = t3.ior, t3.sheen > 0 && (e4.sheenColor.value.copy(t3.sheenColor).multiplyScalar(t3.sheen), e4.sheenRoughness.value = t3.sheenRoughness, t3.sheenColorMap && (e4.sheenColorMap.value = t3.sheenColorMap, n2(t3.sheenColorMap, e4.sheenColorMapTransform)), t3.sheenRoughnessMap && (e4.sheenRoughnessMap.value = t3.sheenRoughnessMap, n2(t3.sheenRoughnessMap, e4.sheenRoughnessMapTransform)));\n t3.clearcoat > 0 && (e4.clearcoat.value = t3.clearcoat, e4.clearcoatRoughness.value = t3.clearcoatRoughness, t3.clearcoatMap && (e4.clearcoatMap.value = t3.clearcoatMap, n2(t3.clearcoatMap, e4.clearcoatMapTransform)), t3.clearcoatRoughnessMap && (e4.clearcoatRoughnessMap.value = t3.clearcoatRoughnessMap, n2(t3.clearcoatRoughnessMap, e4.clearcoatRoughnessMapTransform)), t3.clearcoatNormalMap && (e4.clearcoatNormalMap.value = t3.clearcoatNormalMap, n2(t3.clearcoatNormalMap, e4.clearcoatNormalMapTransform), e4.clearcoatNormalScale.value.copy(t3.clearcoatNormalScale), t3.side === d && e4.clearcoatNormalScale.value.negate()));\n t3.dispersion > 0 && (e4.dispersion.value = t3.dispersion);\n t3.iridescence > 0 && (e4.iridescence.value = t3.iridescence, e4.iridescenceIOR.value = t3.iridescenceIOR, e4.iridescenceThicknessMinimum.value = t3.iridescenceThicknessRange[0], e4.iridescenceThicknessMaximum.value = t3.iridescenceThicknessRange[1], t3.iridescenceMap && (e4.iridescenceMap.value = t3.iridescenceMap, n2(t3.iridescenceMap, e4.iridescenceMapTransform)), t3.iridescenceThicknessMap && (e4.iridescenceThicknessMap.value = t3.iridescenceThicknessMap, n2(t3.iridescenceThicknessMap, e4.iridescenceThicknessMapTransform)));\n t3.transmission > 0 && (e4.transmission.value = t3.transmission, e4.transmissionSamplerMap.value = i3.texture, e4.transmissionSamplerSize.value.set(i3.width, i3.height), t3.transmissionMap && (e4.transmissionMap.value = t3.transmissionMap, n2(t3.transmissionMap, e4.transmissionMapTransform)), e4.thickness.value = t3.thickness, t3.thicknessMap && (e4.thicknessMap.value = t3.thicknessMap, n2(t3.thicknessMap, e4.thicknessMapTransform)), e4.attenuationDistance.value = t3.attenuationDistance, e4.attenuationColor.value.copy(t3.attenuationColor));\n t3.anisotropy > 0 && (e4.anisotropyVector.value.set(\n t3.anisotropy * Math.cos(t3.anisotropyRotation),\n t3.anisotropy * Math.sin(t3.anisotropyRotation)\n ), t3.anisotropyMap && (e4.anisotropyMap.value = t3.anisotropyMap, n2(t3.anisotropyMap, e4.anisotropyMapTransform)));\n e4.specularIntensity.value = t3.specularIntensity, e4.specularColor.value.copy(t3.specularColor), t3.specularColorMap && (e4.specularColorMap.value = t3.specularColorMap, n2(t3.specularColorMap, e4.specularColorMapTransform));\n t3.specularIntensityMap && (e4.specularIntensityMap.value = t3.specularIntensityMap, n2(t3.specularIntensityMap, e4.specularIntensityMapTransform));\n })(e3, r2, s2)) : r2.isMeshMatcapMaterial ? (i2(e3, r2), (function(e4, t3) {\n t3.matcap && (e4.matcap.value = t3.matcap);\n })(e3, r2)) : r2.isMeshDepthMaterial ? i2(e3, r2) : r2.isMeshDistanceMaterial ? (i2(e3, r2), (function(e4, n3) {\n const i3 = t2.get(n3).light;\n e4.referencePosition.value.setFromMatrixPosition(i3.matrixWorld), e4.nearDistance.value = i3.shadow.camera.near, e4.farDistance.value = i3.shadow.camera.far;\n })(e3, r2)) : r2.isMeshNormalMaterial ? i2(e3, r2) : r2.isLineBasicMaterial ? ((function(e4, t3) {\n e4.diffuse.value.copy(t3.color), e4.opacity.value = t3.opacity, t3.map && (e4.map.value = t3.map, n2(t3.map, e4.mapTransform));\n })(e3, r2), r2.isLineDashedMaterial && (function(e4, t3) {\n e4.dashSize.value = t3.dashSize, e4.totalSize.value = t3.dashSize + t3.gapSize, e4.scale.value = t3.scale;\n })(e3, r2)) : r2.isPointsMaterial ? (function(e4, t3, i3, r3) {\n e4.diffuse.value.copy(t3.color), e4.opacity.value = t3.opacity, e4.size.value = t3.size * i3, e4.scale.value = 0.5 * r3, t3.map && (e4.map.value = t3.map, n2(t3.map, e4.uvTransform));\n t3.alphaMap && (e4.alphaMap.value = t3.alphaMap, n2(t3.alphaMap, e4.alphaMapTransform));\n t3.alphaTest > 0 && (e4.alphaTest.value = t3.alphaTest);\n })(e3, r2, a2, o2) : r2.isSpriteMaterial ? (function(e4, t3) {\n e4.diffuse.value.copy(t3.color), e4.opacity.value = t3.opacity, e4.rotation.value = t3.rotation, t3.map && (e4.map.value = t3.map, n2(t3.map, e4.mapTransform));\n t3.alphaMap && (e4.alphaMap.value = t3.alphaMap, n2(t3.alphaMap, e4.alphaMapTransform));\n t3.alphaTest > 0 && (e4.alphaTest.value = t3.alphaTest);\n })(e3, r2) : r2.isShadowMaterial ? (e3.color.value.copy(r2.color), e3.opacity.value = r2.opacity) : r2.isShaderMaterial && (r2.uniformsNeedUpdate = false);\n }\n };\n }\n function Aa2(e2, t2, n2, i2) {\n let r2 = {}, a2 = {}, o2 = [];\n const s2 = e2.getParameter(e2.MAX_UNIFORM_BUFFER_BINDINGS);\n function l2(t3, n3, i3, r3) {\n if (true === (function(e3, t4, n4, i4) {\n const r4 = e3.value, a3 = t4 + \"_\" + n4;\n if (void 0 === i4[a3])\n return \"number\" == typeof r4 || \"boolean\" == typeof r4 ? i4[a3] = r4 : ArrayBuffer.isView(r4) ? i4[a3] = r4.slice() : i4[a3] = r4.clone(), true;\n {\n const e4 = i4[a3];\n if (\"number\" == typeof r4 || \"boolean\" == typeof r4) {\n if (e4 !== r4) return i4[a3] = r4, true;\n } else {\n if (ArrayBuffer.isView(r4)) return true;\n if (false === e4.equals(r4)) return e4.copy(r4), true;\n }\n }\n return false;\n })(t3, n3, i3, r3)) {\n const n4 = t3.__offset, i4 = t3.value;\n if (Array.isArray(i4)) {\n let e3 = 0;\n for (let n5 = 0; n5 < i4.length; n5++) {\n const r4 = i4[n5], a3 = d2(r4);\n c2(r4, t3.__data, e3), \"number\" == typeof r4 || \"boolean\" == typeof r4 || r4.isMatrix3 || ArrayBuffer.isView(r4) || (e3 += a3.storage / Float32Array.BYTES_PER_ELEMENT);\n }\n } else c2(i4, t3.__data, 0);\n e2.bufferSubData(e2.UNIFORM_BUFFER, n4, t3.__data);\n }\n }\n function c2(e3, t3, n3) {\n \"number\" == typeof e3 || \"boolean\" == typeof e3 ? t3[0] = e3 : e3.isMatrix3 ? (t3[0] = e3.elements[0], t3[1] = e3.elements[1], t3[2] = e3.elements[2], t3[3] = 0, t3[4] = e3.elements[3], t3[5] = e3.elements[4], t3[6] = e3.elements[5], t3[7] = 0, t3[8] = e3.elements[6], t3[9] = e3.elements[7], t3[10] = e3.elements[8], t3[11] = 0) : ArrayBuffer.isView(e3) ? t3.set(new e3.constructor(e3.buffer, e3.byteOffset, t3.length)) : e3.toArray(t3, n3);\n }\n function d2(e3) {\n const t3 = { boundary: 0, storage: 0 };\n return \"number\" == typeof e3 || \"boolean\" == typeof e3 ? (t3.boundary = 4, t3.storage = 4) : e3.isVector2 ? (t3.boundary = 8, t3.storage = 8) : e3.isVector3 || e3.isColor ? (t3.boundary = 16, t3.storage = 12) : e3.isVector4 ? (t3.boundary = 16, t3.storage = 16) : e3.isMatrix3 ? (t3.boundary = 48, t3.storage = 48) : e3.isMatrix4 ? (t3.boundary = 64, t3.storage = 64) : e3.isTexture ? ai(\"WebGLRenderer: Texture samplers can not be part of an uniforms group.\") : ArrayBuffer.isView(e3) ? (t3.boundary = 16, t3.storage = e3.byteLength) : ai(\"WebGLRenderer: Unsupported uniform value type.\", e3), t3;\n }\n function u2(t3) {\n const n3 = t3.target;\n n3.removeEventListener(\"dispose\", u2);\n const i3 = o2.indexOf(n3.__bindingPointIndex);\n o2.splice(i3, 1), e2.deleteBuffer(r2[n3.id]), delete r2[n3.id], delete a2[n3.id];\n }\n return {\n bind: function(e3, t3) {\n const n3 = t3.program;\n i2.uniformBlockBinding(e3, n3);\n },\n update: function(n3, c3) {\n let f2 = r2[n3.id];\n void 0 === f2 && (!(function(e3) {\n const t3 = e3.uniforms;\n let n4 = 0;\n const i3 = 16;\n for (let e4 = 0, r4 = t3.length; e4 < r4; e4++) {\n const r5 = Array.isArray(t3[e4]) ? t3[e4] : [t3[e4]];\n for (let e5 = 0, t4 = r5.length; e5 < t4; e5++) {\n const t5 = r5[e5], a3 = Array.isArray(t5.value) ? t5.value : [t5.value];\n for (let e6 = 0, r6 = a3.length; e6 < r6; e6++) {\n const r7 = d2(a3[e6]), o3 = n4 % i3, s3 = o3 % r7.boundary, l3 = o3 + s3;\n n4 += s3, 0 !== l3 && i3 - l3 < r7.storage && (n4 += i3 - l3), t5.__data = new Float32Array(r7.storage / Float32Array.BYTES_PER_ELEMENT), t5.__offset = n4, n4 += r7.storage;\n }\n }\n }\n const r3 = n4 % i3;\n r3 > 0 && (n4 += i3 - r3);\n e3.__size = n4, e3.__cache = {};\n })(n3), f2 = (function(t3) {\n const n4 = (function() {\n for (let e3 = 0; e3 < s2; e3++) if (-1 === o2.indexOf(e3)) return o2.push(e3), e3;\n return oi(\"WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached.\"), 0;\n })();\n t3.__bindingPointIndex = n4;\n const i3 = e2.createBuffer(), r3 = t3.__size, a3 = t3.usage;\n return e2.bindBuffer(e2.UNIFORM_BUFFER, i3), e2.bufferData(e2.UNIFORM_BUFFER, r3, a3), e2.bindBuffer(e2.UNIFORM_BUFFER, null), e2.bindBufferBase(e2.UNIFORM_BUFFER, n4, i3), i3;\n })(n3), r2[n3.id] = f2, n3.addEventListener(\"dispose\", u2));\n const p2 = c3.program;\n i2.updateUBOMapping(n3, p2);\n const m2 = t2.render.frame;\n a2[n3.id] !== m2 && (!(function(t3) {\n const n4 = r2[t3.id], i3 = t3.uniforms, a3 = t3.__cache;\n e2.bindBuffer(e2.UNIFORM_BUFFER, n4);\n for (let e3 = 0, t4 = i3.length; e3 < t4; e3++) {\n const t5 = i3[e3];\n if (Array.isArray(t5)) for (let n5 = 0, i4 = t5.length; n5 < i4; n5++) l2(t5[n5], e3, n5, a3);\n else l2(t5, e3, 0, a3);\n }\n e2.bindBuffer(e2.UNIFORM_BUFFER, null);\n })(n3), a2[n3.id] = m2);\n },\n dispose: function() {\n for (const t3 in r2) e2.deleteBuffer(r2[t3]);\n o2 = [], r2 = {}, a2 = {};\n }\n };\n }\n xa2.set(-1, 0, 0, 0, 1, 0, 0, 0, 1);\n var ba2 = new Uint16Array([\n 12469,\n 15057,\n 12620,\n 14925,\n 13266,\n 14620,\n 13807,\n 14376,\n 14323,\n 13990,\n 14545,\n 13625,\n 14713,\n 13328,\n 14840,\n 12882,\n 14931,\n 12528,\n 14996,\n 12233,\n 15039,\n 11829,\n 15066,\n 11525,\n 15080,\n 11295,\n 15085,\n 10976,\n 15082,\n 10705,\n 15073,\n 10495,\n 13880,\n 14564,\n 13898,\n 14542,\n 13977,\n 14430,\n 14158,\n 14124,\n 14393,\n 13732,\n 14556,\n 13410,\n 14702,\n 12996,\n 14814,\n 12596,\n 14891,\n 12291,\n 14937,\n 11834,\n 14957,\n 11489,\n 14958,\n 11194,\n 14943,\n 10803,\n 14921,\n 10506,\n 14893,\n 10278,\n 14858,\n 9960,\n 14484,\n 14039,\n 14487,\n 14025,\n 14499,\n 13941,\n 14524,\n 13740,\n 14574,\n 13468,\n 14654,\n 13106,\n 14743,\n 12678,\n 14818,\n 12344,\n 14867,\n 11893,\n 14889,\n 11509,\n 14893,\n 11180,\n 14881,\n 10751,\n 14852,\n 10428,\n 14812,\n 10128,\n 14765,\n 9754,\n 14712,\n 9466,\n 14764,\n 13480,\n 14764,\n 13475,\n 14766,\n 13440,\n 14766,\n 13347,\n 14769,\n 13070,\n 14786,\n 12713,\n 14816,\n 12387,\n 14844,\n 11957,\n 14860,\n 11549,\n 14868,\n 11215,\n 14855,\n 10751,\n 14825,\n 10403,\n 14782,\n 10044,\n 14729,\n 9651,\n 14666,\n 9352,\n 14599,\n 9029,\n 14967,\n 12835,\n 14966,\n 12831,\n 14963,\n 12804,\n 14954,\n 12723,\n 14936,\n 12564,\n 14917,\n 12347,\n 14900,\n 11958,\n 14886,\n 11569,\n 14878,\n 11247,\n 14859,\n 10765,\n 14828,\n 10401,\n 14784,\n 10011,\n 14727,\n 9600,\n 14660,\n 9289,\n 14586,\n 8893,\n 14508,\n 8533,\n 15111,\n 12234,\n 15110,\n 12234,\n 15104,\n 12216,\n 15092,\n 12156,\n 15067,\n 12010,\n 15028,\n 11776,\n 14981,\n 11500,\n 14942,\n 11205,\n 14902,\n 10752,\n 14861,\n 10393,\n 14812,\n 9991,\n 14752,\n 9570,\n 14682,\n 9252,\n 14603,\n 8808,\n 14519,\n 8445,\n 14431,\n 8145,\n 15209,\n 11449,\n 15208,\n 11451,\n 15202,\n 11451,\n 15190,\n 11438,\n 15163,\n 11384,\n 15117,\n 11274,\n 15055,\n 10979,\n 14994,\n 10648,\n 14932,\n 10343,\n 14871,\n 9936,\n 14803,\n 9532,\n 14729,\n 9218,\n 14645,\n 8742,\n 14556,\n 8381,\n 14461,\n 8020,\n 14365,\n 7603,\n 15273,\n 10603,\n 15272,\n 10607,\n 15267,\n 10619,\n 15256,\n 10631,\n 15231,\n 10614,\n 15182,\n 10535,\n 15118,\n 10389,\n 15042,\n 10167,\n 14963,\n 9787,\n 14883,\n 9447,\n 14800,\n 9115,\n 14710,\n 8665,\n 14615,\n 8318,\n 14514,\n 7911,\n 14411,\n 7507,\n 14279,\n 7198,\n 15314,\n 9675,\n 15313,\n 9683,\n 15309,\n 9712,\n 15298,\n 9759,\n 15277,\n 9797,\n 15229,\n 9773,\n 15166,\n 9668,\n 15084,\n 9487,\n 14995,\n 9274,\n 14898,\n 8910,\n 14800,\n 8539,\n 14697,\n 8234,\n 14590,\n 7790,\n 14479,\n 7409,\n 14367,\n 7067,\n 14178,\n 6621,\n 15337,\n 8619,\n 15337,\n 8631,\n 15333,\n 8677,\n 15325,\n 8769,\n 15305,\n 8871,\n 15264,\n 8940,\n 15202,\n 8909,\n 15119,\n 8775,\n 15022,\n 8565,\n 14916,\n 8328,\n 14804,\n 8009,\n 14688,\n 7614,\n 14569,\n 7287,\n 14448,\n 6888,\n 14321,\n 6483,\n 14088,\n 6171,\n 15350,\n 7402,\n 15350,\n 7419,\n 15347,\n 7480,\n 15340,\n 7613,\n 15322,\n 7804,\n 15287,\n 7973,\n 15229,\n 8057,\n 15148,\n 8012,\n 15046,\n 7846,\n 14933,\n 7611,\n 14810,\n 7357,\n 14682,\n 7069,\n 14552,\n 6656,\n 14421,\n 6316,\n 14251,\n 5948,\n 14007,\n 5528,\n 15356,\n 5942,\n 15356,\n 5977,\n 15353,\n 6119,\n 15348,\n 6294,\n 15332,\n 6551,\n 15302,\n 6824,\n 15249,\n 7044,\n 15171,\n 7122,\n 15070,\n 7050,\n 14949,\n 6861,\n 14818,\n 6611,\n 14679,\n 6349,\n 14538,\n 6067,\n 14398,\n 5651,\n 14189,\n 5311,\n 13935,\n 4958,\n 15359,\n 4123,\n 15359,\n 4153,\n 15356,\n 4296,\n 15353,\n 4646,\n 15338,\n 5160,\n 15311,\n 5508,\n 15263,\n 5829,\n 15188,\n 6042,\n 15088,\n 6094,\n 14966,\n 6001,\n 14826,\n 5796,\n 14678,\n 5543,\n 14527,\n 5287,\n 14377,\n 4985,\n 14133,\n 4586,\n 13869,\n 4257,\n 15360,\n 1563,\n 15360,\n 1642,\n 15358,\n 2076,\n 15354,\n 2636,\n 15341,\n 3350,\n 15317,\n 4019,\n 15273,\n 4429,\n 15203,\n 4732,\n 15105,\n 4911,\n 14981,\n 4932,\n 14836,\n 4818,\n 14679,\n 4621,\n 14517,\n 4386,\n 14359,\n 4156,\n 14083,\n 3795,\n 13808,\n 3437,\n 15360,\n 122,\n 15360,\n 137,\n 15358,\n 285,\n 15355,\n 636,\n 15344,\n 1274,\n 15322,\n 2177,\n 15281,\n 2765,\n 15215,\n 3223,\n 15120,\n 3451,\n 14995,\n 3569,\n 14846,\n 3567,\n 14681,\n 3466,\n 14511,\n 3305,\n 14344,\n 3121,\n 14037,\n 2800,\n 13753,\n 2467,\n 15360,\n 0,\n 15360,\n 1,\n 15359,\n 21,\n 15355,\n 89,\n 15346,\n 253,\n 15325,\n 479,\n 15287,\n 796,\n 15225,\n 1148,\n 15133,\n 1492,\n 15008,\n 1749,\n 14856,\n 1882,\n 14685,\n 1886,\n 14506,\n 1783,\n 14324,\n 1608,\n 13996,\n 1398,\n 13702,\n 1183\n ]);\n var Ca2 = null;\n var Pa2 = class {\n constructor(e2 = {}) {\n const {\n canvas: t2 = Ks(),\n context: r2 = null,\n depth: a2 = true,\n stencil: o2 = false,\n alpha: s2 = false,\n antialias: l2 = false,\n premultipliedAlpha: d2 = true,\n preserveDrawingBuffer: p2 = false,\n powerPreference: m2 = \"default\",\n failIfMajorPerformanceCaveat: _2 = false,\n reversedDepthBuffer: g2 = false,\n outputBufferType: M2 = zt\n } = e2;\n let T2;\n if (this.isWebGLRenderer = true, null !== r2) {\n if (\"undefined\" != typeof WebGLRenderingContext && r2 instanceof WebGLRenderingContext)\n throw new Error(\"THREE.WebGLRenderer: WebGL 1 is not supported since r163.\");\n T2 = r2.getContextAttributes().alpha;\n } else T2 = s2;\n const x2 = M2, R2 = /* @__PURE__ */ new Set([Gt, Yt, Ht]), A2 = /* @__PURE__ */ new Set([zt, Ot, Bt, Vt, Et, Nt]), b2 = new Uint32Array(4), C2 = new Int32Array(4), P2 = new Ti();\n let U2 = null, w2 = null;\n const N2 = [], y2 = [];\n let F2 = null;\n this.domElement = t2, this.debug = { checkShaderErrors: true, onShaderError: null }, this.autoClear = true, this.autoClearColor = true, this.autoClearDepth = true, this.autoClearStencil = true, this.sortObjects = true, this.clippingPlanes = [], this.localClippingEnabled = false, this.toneMapping = Q, this.toneMappingExposure = 1, this.transmissionResolutionScale = 1;\n const G2 = this;\n let H2 = false, V2 = null, W2 = null, z2 = null, k2 = null;\n this._outputColorSpace = es;\n let X2 = 0, Y2 = 0, q2 = null, j2 = -1, Z2 = null;\n const $2 = new qi(), Q2 = new qi();\n let J2 = null;\n const ee2 = new Pr(0);\n let te2 = 0, ne2 = t2.width, ie2 = t2.height, re2 = 1, ae2 = null, oe2 = null;\n const se2 = new qi(0, 0, ne2, ie2), le2 = new qi(0, 0, ne2, ie2);\n let ce2 = false;\n const de2 = new mo();\n let ue2 = false, fe2 = false;\n const pe2 = new Qi(), me2 = new Ti(), _e2 = new qi(), ge2 = { background: null, fog: null, environment: null, overrideMaterial: null, isScene: true };\n let ve2 = false;\n function Ee2() {\n return null === q2 ? re2 : 1;\n }\n let Me2, Te2, xe2, Re2, Ae2, be2, Ce2, Pe2, De2, we2, Ie2, Ne2, ye2, Oe2, Fe2, Be2, Ge2, He2, Ve2, We2, ze2, ke2, Xe2, Ke2 = r2;\n function Ye2(e3, n2) {\n return t2.getContext(e3, n2);\n }\n try {\n const e3 = {\n alpha: true,\n depth: a2,\n stencil: o2,\n antialias: l2,\n premultipliedAlpha: d2,\n preserveDrawingBuffer: p2,\n powerPreference: m2,\n failIfMajorPerformanceCaveat: _2\n };\n if (\"setAttribute\" in t2 && t2.setAttribute(\"data-engine\", `three.js r${t}`), t2.addEventListener(\"webglcontextlost\", Ze2, false), t2.addEventListener(\"webglcontextrestored\", $e2, false), t2.addEventListener(\"webglcontextcreationerror\", Qe2, false), null === Ke2) {\n const t3 = \"webgl2\";\n if (Ke2 = Ye2(t3, e3), null === Ke2)\n throw Ye2(t3) ? new Error(\n \"THREE.WebGLRenderer: Error creating WebGL context with your selected attributes.\"\n ) : new Error(\"THREE.WebGLRenderer: Error creating WebGL context.\");\n }\n } catch (e3) {\n throw oi(\"WebGLRenderer: \" + e3.message), e3;\n }\n function qe2() {\n Me2 = new fi2(Ke2), Me2.init(), ze2 = new Ea2(Ke2, Me2), Te2 = new Yn2(Ke2, Me2, e2, ze2), xe2 = new ga2(Ke2, Me2), Te2.reversedDepthBuffer && g2 && xe2.buffers.depth.setReversed(true), W2 = Ke2.createFramebuffer(), z2 = Ke2.createFramebuffer(), k2 = Ke2.createFramebuffer(), Re2 = new hi2(Ke2), Ae2 = new ea2(), be2 = new va2(Ke2, Me2, xe2, Ae2, Te2, ze2, Re2), Ce2 = new ui2(G2), Pe2 = new Fn2(Ke2), ke2 = new Xn2(Ke2, Pe2), De2 = new pi2(Ke2, Pe2, Re2, ke2), we2 = new gi2(Ke2, De2, Pe2, ke2, Re2), He2 = new _i2(Ke2, Te2, be2), Fe2 = new qn2(Ae2), Ie2 = new Jr2(G2, Ce2, Me2, Te2, ke2, Fe2), Ne2 = new Ra2(G2, Ae2), ye2 = new ra2(), Oe2 = new da2(Me2), Ge2 = new kn2(G2, Ce2, xe2, we2, T2, d2), Be2 = new _a2(G2, we2, Te2), Xe2 = new Aa2(Ke2, Re2, Te2, xe2), Ve2 = new Kn2(Ke2, Me2, Re2), We2 = new mi2(Ke2, Me2, Re2), Re2.programs = Ie2.programs, G2.capabilities = Te2, G2.extensions = Me2, G2.properties = Ae2, G2.renderLists = ye2, G2.shadowMap = Be2, G2.state = xe2, G2.info = Re2;\n }\n qe2(), x2 !== zt && (F2 = new Ei2(x2, t2.width, t2.height, l2, a2, o2));\n const je2 = new Ma2(G2, Ke2);\n function Ze2(e3) {\n e3.preventDefault(), ri(\"WebGLRenderer: Context Lost.\"), H2 = true;\n }\n function $e2() {\n ri(\"WebGLRenderer: Context Restored.\"), H2 = false;\n const e3 = Re2.autoReset, t3 = Be2.enabled, n2 = Be2.autoUpdate, i2 = Be2.needsUpdate, r3 = Be2.type;\n qe2(), Re2.autoReset = e3, Be2.enabled = t3, Be2.autoUpdate = n2, Be2.needsUpdate = i2, Be2.type = r3;\n }\n function Qe2(e3) {\n oi(\"WebGLRenderer: A WebGL context could not be created. Reason: \", e3.statusMessage);\n }\n function Je2(e3) {\n const t3 = e3.target;\n t3.removeEventListener(\"dispose\", Je2), (function(e4) {\n (function(e5) {\n const t4 = Ae2.get(e5).programs;\n void 0 !== t4 && (t4.forEach(function(e6) {\n Ie2.releaseProgram(e6);\n }), e5.isShaderMaterial && Ie2.releaseShaderCache(e5));\n })(e4), Ae2.remove(e4);\n })(t3);\n }\n function et2(e3, t3, n2) {\n true === e3.transparent && e3.side === p && false === e3.forceSinglePass ? (e3.side = d, e3.needsUpdate = true, dt2(e3, t3, n2), e3.side = u, e3.needsUpdate = true, dt2(e3, t3, n2), e3.side = p) : dt2(e3, t3, n2);\n }\n this.xr = je2, this.getContext = function() {\n return Ke2;\n }, this.getContextAttributes = function() {\n return Ke2.getContextAttributes();\n }, this.forceContextLoss = function() {\n const e3 = Me2.get(\"WEBGL_lose_context\");\n e3 && e3.loseContext();\n }, this.forceContextRestore = function() {\n const e3 = Me2.get(\"WEBGL_lose_context\");\n e3 && e3.restoreContext();\n }, this.getPixelRatio = function() {\n return re2;\n }, this.setPixelRatio = function(e3) {\n void 0 !== e3 && (re2 = e3, this.setSize(ne2, ie2, false));\n }, this.getSize = function(e3) {\n return e3.set(ne2, ie2);\n }, this.setSize = function(e3, n2, i2 = true) {\n je2.isPresenting ? ai(\"WebGLRenderer: Can't change size while VR device is presenting.\") : (ne2 = e3, ie2 = n2, t2.width = Math.floor(e3 * re2), t2.height = Math.floor(n2 * re2), true === i2 && (t2.style.width = e3 + \"px\", t2.style.height = n2 + \"px\"), null !== F2 && F2.setSize(t2.width, t2.height), this.setViewport(0, 0, e3, n2));\n }, this.getDrawingBufferSize = function(e3) {\n return e3.set(ne2 * re2, ie2 * re2).floor();\n }, this.setDrawingBufferSize = function(e3, n2, i2) {\n ne2 = e3, ie2 = n2, re2 = i2, t2.width = Math.floor(e3 * i2), t2.height = Math.floor(n2 * i2), this.setViewport(0, 0, e3, n2);\n }, this.setEffects = function(e3) {\n if (x2 !== zt) {\n if (e3) {\n for (let t3 = 0; t3 < e3.length; t3++)\n if (true === e3[t3].isOutputPass) {\n ai(\n \"WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.\"\n );\n break;\n }\n }\n F2.setEffects(e3 || []);\n } else\n oi(\n \"WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.\"\n );\n }, this.getCurrentViewport = function(e3) {\n return e3.copy($2);\n }, this.getViewport = function(e3) {\n return e3.copy(se2);\n }, this.setViewport = function(e3, t3, n2, i2) {\n e3.isVector4 ? se2.set(e3.x, e3.y, e3.z, e3.w) : se2.set(e3, t3, n2, i2), xe2.viewport($2.copy(se2).multiplyScalar(re2).round());\n }, this.getScissor = function(e3) {\n return e3.copy(le2);\n }, this.setScissor = function(e3, t3, n2, i2) {\n e3.isVector4 ? le2.set(e3.x, e3.y, e3.z, e3.w) : le2.set(e3, t3, n2, i2), xe2.scissor(Q2.copy(le2).multiplyScalar(re2).round());\n }, this.getScissorTest = function() {\n return ce2;\n }, this.setScissorTest = function(e3) {\n xe2.setScissorTest(ce2 = e3);\n }, this.setOpaqueSort = function(e3) {\n ae2 = e3;\n }, this.setTransparentSort = function(e3) {\n oe2 = e3;\n }, this.getClearColor = function(e3) {\n return e3.copy(Ge2.getClearColor());\n }, this.setClearColor = function() {\n Ge2.setClearColor(...arguments);\n }, this.getClearAlpha = function() {\n return Ge2.getClearAlpha();\n }, this.setClearAlpha = function() {\n Ge2.setClearAlpha(...arguments);\n }, this.clear = function(e3 = true, t3 = true, n2 = true) {\n let i2 = 0;\n if (e3) {\n let e4 = false;\n if (null !== q2) {\n const t4 = q2.texture.format;\n e4 = R2.has(t4);\n }\n if (e4) {\n const e5 = q2.texture.type, t4 = A2.has(e5), n3 = Ge2.getClearColor(), i3 = Ge2.getClearAlpha(), r3 = n3.r, a3 = n3.g, o3 = n3.b;\n t4 ? (b2[0] = r3, b2[1] = a3, b2[2] = o3, b2[3] = i3, Ke2.clearBufferuiv(Ke2.COLOR, 0, b2)) : (C2[0] = r3, C2[1] = a3, C2[2] = o3, C2[3] = i3, Ke2.clearBufferiv(Ke2.COLOR, 0, C2));\n } else i2 |= Ke2.COLOR_BUFFER_BIT;\n }\n t3 && (i2 |= Ke2.DEPTH_BUFFER_BIT, this.state.buffers.depth.setMask(true)), n2 && (i2 |= Ke2.STENCIL_BUFFER_BIT, this.state.buffers.stencil.setMask(4294967295)), 0 !== i2 && Ke2.clear(i2);\n }, this.clearColor = function() {\n this.clear(true, false, false);\n }, this.clearDepth = function() {\n this.clear(false, true, false);\n }, this.clearStencil = function() {\n this.clear(false, false, true);\n }, this.setNodesHandler = function(e3) {\n e3.setRenderer(this), V2 = e3;\n }, this.dispose = function() {\n t2.removeEventListener(\"webglcontextlost\", Ze2, false), t2.removeEventListener(\"webglcontextrestored\", $e2, false), t2.removeEventListener(\"webglcontextcreationerror\", Qe2, false), Ge2.dispose(), ye2.dispose(), Oe2.dispose(), Ae2.dispose(), Ce2.dispose(), we2.dispose(), ke2.dispose(), Xe2.dispose(), Ie2.dispose(), je2.dispose(), je2.removeEventListener(\"sessionstart\", nt2), je2.removeEventListener(\"sessionend\", it2), rt2.stop();\n }, this.renderBufferDirect = function(e3, t3, n2, i2, r3, a3) {\n null === t3 && (t3 = ge2);\n const o3 = r3.isMesh && r3.matrixWorld.determinantAffine() < 0, s3 = (function(e4, t4, n3, i3, r4) {\n true !== t4.isScene && (t4 = ge2);\n be2.resetTextureUnits();\n const a4 = t4.fog, o4 = i3.isMeshStandardMaterial || i3.isMeshLambertMaterial || i3.isMeshPhongMaterial ? t4.environment : null, s4 = null === q2 ? G2.outputColorSpace : true === q2.isXRRenderTarget ? q2.texture.colorSpace : Ri.workingColorSpace, l4 = i3.isMeshStandardMaterial || i3.isMeshLambertMaterial && !i3.envMap || i3.isMeshPhongMaterial && !i3.envMap, c3 = Ce2.get(i3.envMap || o4, l4), d4 = true === i3.vertexColors && !!n3.attributes.color && 4 === n3.attributes.color.itemSize, u3 = !!n3.attributes.tangent && (!!i3.normalMap || i3.anisotropy > 0), p4 = !!n3.morphAttributes.position, m4 = !!n3.morphAttributes.normal, h3 = !!n3.morphAttributes.color;\n let _4 = Q;\n i3.toneMapped && (null !== q2 && true !== q2.isXRRenderTarget || (_4 = G2.toneMapping));\n const g4 = n3.morphAttributes.position || n3.morphAttributes.normal || n3.morphAttributes.color, v2 = void 0 !== g4 ? g4.length : 0, S2 = Ae2.get(i3), M3 = w2.state.lights;\n if (true === ue2 && (true === fe2 || e4 !== Z2)) {\n const t5 = e4 === Z2 && i3.id === j2;\n Fe2.setState(i3, e4, t5);\n }\n let T3 = false;\n i3.version === S2.__version ? S2.needsLights && S2.lightsStateVersion !== M3.state.version || S2.outputColorSpace !== s4 || r4.isBatchedMesh && false === S2.batching ? T3 = true : r4.isBatchedMesh || true !== S2.batching ? r4.isBatchedMesh && true === S2.batchingColor && null === r4.colorTexture || r4.isBatchedMesh && false === S2.batchingColor && null !== r4.colorTexture || r4.isInstancedMesh && false === S2.instancing ? T3 = true : r4.isInstancedMesh || true !== S2.instancing ? r4.isSkinnedMesh && false === S2.skinning ? T3 = true : r4.isSkinnedMesh || true !== S2.skinning ? r4.isInstancedMesh && true === S2.instancingColor && null === r4.instanceColor || r4.isInstancedMesh && false === S2.instancingColor && null !== r4.instanceColor || r4.isInstancedMesh && true === S2.instancingMorph && null === r4.morphTexture || r4.isInstancedMesh && false === S2.instancingMorph && null !== r4.morphTexture || S2.envMap !== c3 || true === i3.fog && S2.fog !== a4 ? T3 = true : void 0 === S2.numClippingPlanes || S2.numClippingPlanes === Fe2.numPlanes && S2.numIntersection === Fe2.numIntersection ? (S2.vertexAlphas !== d4 || S2.vertexTangents !== u3 || S2.morphTargets !== p4 || S2.morphNormals !== m4 || S2.morphColors !== h3 || S2.toneMapping !== _4 || S2.morphTargetsCount !== v2 || !!S2.lightProbeGrid != w2.state.lightProbeGridArray.length > 0) && (T3 = true) : T3 = true : T3 = true : T3 = true : T3 = true : (T3 = true, S2.__version = i3.version);\n let x3 = S2.currentProgram;\n true === T3 && (x3 = dt2(i3, t4, r4), V2 && i3.isNodeMaterial && V2.onUpdateProgram(i3, x3, S2));\n let R3 = false, A3 = false, b3 = false;\n const C3 = x3.getUniforms(), U3 = S2.uniforms;\n xe2.useProgram(x3.program) && (R3 = true, A3 = true, b3 = true);\n i3.id !== j2 && (j2 = i3.id, A3 = true);\n if (S2.needsLights) {\n const e5 = (function(e6, t5) {\n if (0 === e6.length) return null;\n if (1 === e6.length) return null !== e6[0].texture ? e6[0] : null;\n P2.setFromMatrixPosition(t5.matrixWorld);\n for (let t6 = 0, n4 = e6.length; t6 < n4; t6++) {\n const n5 = e6[t6];\n if (null !== n5.texture && n5.boundingBox.containsPoint(P2)) return n5;\n }\n return null;\n })(w2.state.lightProbeGridArray, r4);\n S2.lightProbeGrid !== e5 && (S2.lightProbeGrid = e5, A3 = true);\n }\n if (R3 || Z2 !== e4) {\n xe2.buffers.depth.getReversed() && true !== e4.reversedDepth && (e4._reversedDepth = true, e4.updateProjectionMatrix()), C3.setValue(Ke2, \"projectionMatrix\", e4.projectionMatrix), C3.setValue(Ke2, \"viewMatrix\", e4.matrixWorldInverse);\n const t5 = C3.map.cameraPosition;\n void 0 !== t5 && t5.setValue(Ke2, me2.setFromMatrixPosition(e4.matrixWorld)), Te2.logarithmicDepthBuffer && C3.setValue(Ke2, \"logDepthBufFC\", 2 / (Math.log(e4.far + 1) / Math.LN2)), (i3.isMeshPhongMaterial || i3.isMeshToonMaterial || i3.isMeshLambertMaterial || i3.isMeshBasicMaterial || i3.isMeshStandardMaterial || i3.isShaderMaterial) && C3.setValue(Ke2, \"isOrthographic\", true === e4.isOrthographicCamera), Z2 !== e4 && (Z2 = e4, A3 = true, b3 = true);\n }\n S2.needsLights && (M3.state.directionalShadowMap.length > 0 && C3.setValue(Ke2, \"directionalShadowMap\", M3.state.directionalShadowMap, be2), M3.state.spotShadowMap.length > 0 && C3.setValue(Ke2, \"spotShadowMap\", M3.state.spotShadowMap, be2), M3.state.pointShadowMap.length > 0 && C3.setValue(Ke2, \"pointShadowMap\", M3.state.pointShadowMap, be2));\n if (r4.isSkinnedMesh) {\n C3.setOptional(Ke2, r4, \"bindMatrix\"), C3.setOptional(Ke2, r4, \"bindMatrixInverse\");\n const e5 = r4.skeleton;\n e5 && (null === e5.boneTexture && e5.computeBoneTexture(), C3.setValue(Ke2, \"boneTexture\", e5.boneTexture, be2));\n }\n r4.isBatchedMesh && (C3.setOptional(Ke2, r4, \"batchingTexture\"), C3.setValue(Ke2, \"batchingTexture\", r4._matricesTexture, be2), C3.setOptional(Ke2, r4, \"batchingIdTexture\"), C3.setValue(Ke2, \"batchingIdTexture\", r4._indirectTexture, be2), C3.setOptional(Ke2, r4, \"batchingColorTexture\"), null !== r4._colorsTexture && C3.setValue(Ke2, \"batchingColorTexture\", r4._colorsTexture, be2));\n const D2 = n3.morphAttributes;\n void 0 === D2.position && void 0 === D2.normal && void 0 === D2.color || He2.update(r4, n3, x3);\n (A3 || S2.receiveShadow !== r4.receiveShadow) && (S2.receiveShadow = r4.receiveShadow, C3.setValue(Ke2, \"receiveShadow\", r4.receiveShadow));\n (i3.isMeshStandardMaterial || i3.isMeshLambertMaterial || i3.isMeshPhongMaterial) && null === i3.envMap && null !== t4.environment && (U3.envMapIntensity.value = t4.environmentIntensity);\n void 0 !== U3.dfgLUT && (U3.dfgLUT.value = (null === Ca2 && (Ca2 = new Xa(ba2, 16, 16, Xt, Rt), Ca2.name = \"DFG_LUT\", Ca2.minFilter = Mt, Ca2.magFilter = Mt, Ca2.wrapS = yt, Ca2.wrapT = yt, Ca2.generateMipmaps = false, Ca2.needsUpdate = true), Ca2));\n if (A3) {\n if (C3.setValue(Ke2, \"toneMappingExposure\", G2.toneMappingExposure), S2.needsLights && (N3 = b3, (I2 = U3).ambientLightColor.needsUpdate = N3, I2.lightProbe.needsUpdate = N3, I2.directionalLights.needsUpdate = N3, I2.directionalLightShadows.needsUpdate = N3, I2.pointLights.needsUpdate = N3, I2.pointLightShadows.needsUpdate = N3, I2.spotLights.needsUpdate = N3, I2.spotLightShadows.needsUpdate = N3, I2.rectAreaLights.needsUpdate = N3, I2.hemisphereLights.needsUpdate = N3), a4 && true === i3.fog && Ne2.refreshFogUniforms(U3, a4), Ne2.refreshMaterialUniforms(U3, i3, re2, ie2, w2.state.transmissionRenderTarget[e4.id]), S2.needsLights && S2.lightProbeGrid) {\n const e5 = S2.lightProbeGrid;\n U3.probesSH.value = e5.texture, U3.probesMin.value.copy(e5.boundingBox.min), U3.probesMax.value.copy(e5.boundingBox.max), U3.probesResolution.value.copy(e5.resolution);\n }\n Rr2.upload(Ke2, ut2(S2), U3, be2);\n }\n var I2, N3;\n i3.isShaderMaterial && true === i3.uniformsNeedUpdate && (Rr2.upload(Ke2, ut2(S2), U3, be2), i3.uniformsNeedUpdate = false);\n i3.isSpriteMaterial && C3.setValue(Ke2, \"center\", r4.center);\n if (C3.setValue(Ke2, \"modelViewMatrix\", r4.modelViewMatrix), C3.setValue(Ke2, \"normalMatrix\", r4.normalMatrix), C3.setValue(Ke2, \"modelMatrix\", r4.matrixWorld), void 0 !== i3.uniformsGroups) {\n const e5 = i3.uniformsGroups;\n for (let t5 = 0, n4 = e5.length; t5 < n4; t5++) {\n const n5 = e5[t5];\n Xe2.update(n5, x3), Xe2.bind(n5, x3);\n }\n }\n return x3;\n })(e3, t3, n2, i2, r3);\n xe2.setMaterial(i2, o3);\n let l3 = n2.index, c2 = 1;\n if (true === i2.wireframe) {\n if (l3 = De2.getWireframeAttribute(n2), void 0 === l3) return;\n c2 = 2;\n }\n const d3 = n2.drawRange, u2 = n2.attributes.position;\n let p3 = d3.start * c2, m3 = (d3.start + d3.count) * c2;\n null !== a3 && (p3 = Math.max(p3, a3.start * c2), m3 = Math.min(m3, (a3.start + a3.count) * c2)), null !== l3 ? (p3 = Math.max(p3, 0), m3 = Math.min(m3, l3.count)) : null != u2 && (p3 = Math.max(p3, 0), m3 = Math.min(m3, u2.count));\n const h2 = m3 - p3;\n if (h2 < 0 || h2 === 1 / 0) return;\n let _3;\n ke2.setup(r3, i2, s3, n2, l3);\n let g3 = Ve2;\n if (null !== l3 && (_3 = Pe2.get(l3), g3 = We2, g3.setIndex(_3)), r3.isMesh)\n true === i2.wireframe ? (xe2.setLineWidth(i2.wireframeLinewidth * Ee2()), g3.setMode(Ke2.LINES)) : g3.setMode(Ke2.TRIANGLES);\n else if (r3.isLine) {\n let e4 = i2.linewidth;\n void 0 === e4 && (e4 = 1), xe2.setLineWidth(e4 * Ee2()), r3.isLineSegments ? g3.setMode(Ke2.LINES) : r3.isLineLoop ? g3.setMode(Ke2.LINE_LOOP) : g3.setMode(Ke2.LINE_STRIP);\n } else r3.isPoints ? g3.setMode(Ke2.POINTS) : r3.isSprite && g3.setMode(Ke2.TRIANGLES);\n if (r3.isBatchedMesh)\n if (Me2.get(\"WEBGL_multi_draw\"))\n g3.renderMultiDraw(r3._multiDrawStarts, r3._multiDrawCounts, r3._multiDrawCount);\n else {\n const e4 = r3._multiDrawStarts, t4 = r3._multiDrawCounts, n3 = r3._multiDrawCount, a4 = l3 ? Pe2.get(l3).bytesPerElement : 1, o4 = Ae2.get(i2).currentProgram.getUniforms();\n for (let i3 = 0; i3 < n3; i3++) o4.setValue(Ke2, \"_gl_DrawID\", i3), g3.render(e4[i3] / a4, t4[i3]);\n }\n else if (r3.isInstancedMesh) g3.renderInstances(p3, h2, r3.count);\n else if (n2.isInstancedBufferGeometry) {\n const e4 = void 0 !== n2._maxInstanceCount ? n2._maxInstanceCount : 1 / 0, t4 = Math.min(n2.instanceCount, e4);\n g3.renderInstances(p3, h2, t4);\n } else g3.render(p3, h2);\n }, this.compile = function(e3, t3, n2 = null) {\n null === n2 && (n2 = e3), w2 = Oe2.get(n2), w2.init(t3), y2.push(w2), n2.traverseVisible(function(e4) {\n e4.isLight && e4.layers.test(t3.layers) && (w2.pushLight(e4), e4.castShadow && w2.pushShadow(e4));\n }), e3 !== n2 && e3.traverseVisible(function(e4) {\n e4.isLight && e4.layers.test(t3.layers) && (w2.pushLight(e4), e4.castShadow && w2.pushShadow(e4));\n }), w2.setupLights();\n const i2 = /* @__PURE__ */ new Set();\n return e3.traverse(function(e4) {\n if (!(e4.isMesh || e4.isPoints || e4.isLine || e4.isSprite)) return;\n const t4 = e4.material;\n if (t4)\n if (Array.isArray(t4))\n for (let r3 = 0; r3 < t4.length; r3++) {\n const a3 = t4[r3];\n et2(a3, n2, e4), i2.add(a3);\n }\n else et2(t4, n2, e4), i2.add(t4);\n }), w2 = y2.pop(), i2;\n }, this.compileAsync = function(e3, t3, n2 = null) {\n const i2 = this.compile(e3, t3, n2);\n return new Promise((t4) => {\n function n3() {\n i2.forEach(function(e4) {\n Ae2.get(e4).currentProgram.isReady() && i2.delete(e4);\n }), 0 !== i2.size ? setTimeout(n3, 10) : t4(e3);\n }\n null !== Me2.get(\"KHR_parallel_shader_compile\") ? n3() : setTimeout(n3, 10);\n });\n };\n let tt2 = null;\n function nt2() {\n rt2.stop();\n }\n function it2() {\n rt2.start();\n }\n const rt2 = new On2();\n function at2(e3, t3, n2, i2) {\n if (false === e3.visible) return;\n if (e3.layers.test(t3.layers)) {\n if (e3.isGroup) n2 = e3.renderOrder;\n else if (e3.isLOD) true === e3.autoUpdate && e3.update(t3);\n else if (e3.isLightProbeGrid) w2.pushLightProbeGrid(e3);\n else if (e3.isLight) w2.pushLight(e3), e3.castShadow && w2.pushShadow(e3);\n else if (e3.isSprite) {\n if (!e3.frustumCulled || de2.intersectsSprite(e3)) {\n i2 && _e2.setFromMatrixPosition(e3.matrixWorld).applyMatrix4(pe2);\n const t4 = we2.update(e3), r4 = e3.material;\n r4.visible && U2.push(e3, t4, r4, n2, _e2.z, null);\n }\n } else if ((e3.isMesh || e3.isLine || e3.isPoints) && (!e3.frustumCulled || de2.intersectsObject(e3))) {\n const t4 = we2.update(e3), r4 = e3.material;\n if (i2 && (void 0 !== e3.boundingSphere ? (null === e3.boundingSphere && e3.computeBoundingSphere(), _e2.copy(e3.boundingSphere.center)) : (null === t4.boundingSphere && t4.computeBoundingSphere(), _e2.copy(t4.boundingSphere.center)), _e2.applyMatrix4(e3.matrixWorld).applyMatrix4(pe2)), Array.isArray(r4)) {\n const i3 = t4.groups;\n for (let a3 = 0, o3 = i3.length; a3 < o3; a3++) {\n const o4 = i3[a3], s3 = r4[o4.materialIndex];\n s3 && s3.visible && U2.push(e3, t4, s3, n2, _e2.z, o4);\n }\n } else r4.visible && U2.push(e3, t4, r4, n2, _e2.z, null);\n }\n }\n const r3 = e3.children;\n for (let e4 = 0, a3 = r3.length; e4 < a3; e4++) at2(r3[e4], t3, n2, i2);\n }\n function ot2(e3, t3, n2, i2) {\n const { opaque: r3, transmissive: a3, transparent: o3 } = e3;\n w2.setupLightsView(n2), true === ue2 && Fe2.setGlobalState(G2.clippingPlanes, n2), i2 && xe2.viewport($2.copy(i2)), r3.length > 0 && lt2(r3, t3, n2), a3.length > 0 && lt2(a3, t3, n2), o3.length > 0 && lt2(o3, t3, n2), xe2.buffers.depth.setTest(true), xe2.buffers.depth.setMask(true), xe2.buffers.color.setMask(true), xe2.setPolygonOffset(false);\n }\n function st2(e3, t3, n2, i2) {\n if (null !== (true === n2.isScene ? n2.overrideMaterial : null)) return;\n if (void 0 === w2.state.transmissionRenderTarget[i2.id]) {\n const e4 = Me2.has(\"EXT_color_buffer_half_float\") || Me2.has(\"EXT_color_buffer_float\");\n w2.state.transmissionRenderTarget[i2.id] = new Xi(1, 1, {\n generateMipmaps: true,\n type: e4 ? Rt : zt,\n minFilter: At,\n samples: Math.max(4, Te2.samples),\n stencilBuffer: o2,\n resolveDepthBuffer: false,\n resolveStencilBuffer: false,\n colorSpace: Ri.workingColorSpace\n });\n }\n const r3 = w2.state.transmissionRenderTarget[i2.id], a3 = i2.viewport || $2;\n r3.setSize(a3.z * G2.transmissionResolutionScale, a3.w * G2.transmissionResolutionScale);\n const s3 = G2.getRenderTarget(), l3 = G2.getActiveCubeFace(), d3 = G2.getActiveMipmapLevel();\n G2.setRenderTarget(r3), G2.getClearColor(ee2), te2 = G2.getClearAlpha(), te2 < 1 && G2.setClearColor(16777215, 0.5), G2.clear(), ve2 && Ge2.render(n2);\n const u2 = G2.toneMapping;\n G2.toneMapping = Q;\n const p3 = i2.viewport;\n if (void 0 !== i2.viewport && (i2.viewport = void 0), w2.setupLightsView(i2), true === ue2 && Fe2.setGlobalState(G2.clippingPlanes, i2), lt2(e3, n2, i2), be2.updateMultisampleRenderTarget(r3), be2.updateRenderTargetMipmap(r3), false === Me2.has(\"WEBGL_multisampled_render_to_texture\")) {\n let e4 = false;\n for (let r4 = 0, a4 = t3.length; r4 < a4; r4++) {\n const a5 = t3[r4], { object: o3, geometry: s4, material: l4, group: d4 } = a5;\n if (l4.side === p && o3.layers.test(i2.layers)) {\n const t4 = l4.side;\n l4.side = d, l4.needsUpdate = true, ct2(o3, n2, i2, s4, l4, d4), l4.side = t4, l4.needsUpdate = true, e4 = true;\n }\n }\n true === e4 && (be2.updateMultisampleRenderTarget(r3), be2.updateRenderTargetMipmap(r3));\n }\n G2.setRenderTarget(s3, l3, d3), G2.setClearColor(ee2, te2), void 0 !== p3 && (i2.viewport = p3), G2.toneMapping = u2;\n }\n function lt2(e3, t3, n2) {\n const i2 = true === t3.isScene ? t3.overrideMaterial : null;\n for (let r3 = 0, a3 = e3.length; r3 < a3; r3++) {\n const a4 = e3[r3], { object: o3, geometry: s3, group: l3 } = a4;\n let c2 = a4.material;\n true === c2.allowOverride && null !== i2 && (c2 = i2), o3.layers.test(n2.layers) && ct2(o3, t3, n2, s3, c2, l3);\n }\n }\n function ct2(e3, t3, n2, i2, r3, a3) {\n e3.onBeforeRender(G2, t3, n2, i2, r3, a3), e3.modelViewMatrix.multiplyMatrices(n2.matrixWorldInverse, e3.matrixWorld), e3.normalMatrix.getNormalMatrix(e3.modelViewMatrix), r3.onBeforeRender(G2, t3, n2, i2, e3, a3), true === r3.transparent && r3.side === p && false === r3.forceSinglePass ? (r3.side = d, r3.needsUpdate = true, G2.renderBufferDirect(n2, t3, i2, r3, e3, a3), r3.side = u, r3.needsUpdate = true, G2.renderBufferDirect(n2, t3, i2, r3, e3, a3), r3.side = p) : G2.renderBufferDirect(n2, t3, i2, r3, e3, a3), e3.onAfterRender(G2, t3, n2, i2, r3, a3);\n }\n function dt2(e3, t3, n2) {\n true !== t3.isScene && (t3 = ge2);\n const i2 = Ae2.get(e3), r3 = w2.state.lights, a3 = w2.state.shadowsArray, o3 = r3.state.version, s3 = Ie2.getParameters(e3, r3.state, a3, t3, n2, w2.state.lightProbeGridArray), l3 = Ie2.getProgramCacheKey(s3);\n let c2 = i2.programs;\n i2.environment = e3.isMeshStandardMaterial || e3.isMeshLambertMaterial || e3.isMeshPhongMaterial ? t3.environment : null, i2.fog = t3.fog;\n const d3 = e3.isMeshStandardMaterial || e3.isMeshLambertMaterial && !e3.envMap || e3.isMeshPhongMaterial && !e3.envMap;\n i2.envMap = Ce2.get(e3.envMap || i2.environment, d3), i2.envMapRotation = null !== i2.environment && null === e3.envMap ? t3.environmentRotation : e3.envMapRotation, void 0 === c2 && (e3.addEventListener(\"dispose\", Je2), c2 = /* @__PURE__ */ new Map(), i2.programs = c2);\n let u2 = c2.get(l3);\n if (void 0 !== u2) {\n if (i2.currentProgram === u2 && i2.lightsStateVersion === o3) return ft2(e3, s3), u2;\n } else\n s3.uniforms = Ie2.getUniforms(e3), null !== V2 && e3.isNodeMaterial && V2.build(e3, n2, s3), e3.onBeforeCompile(s3, G2), u2 = Ie2.acquireProgram(s3, l3), c2.set(l3, u2), i2.uniforms = s3.uniforms;\n const f2 = i2.uniforms;\n return (e3.isShaderMaterial || e3.isRawShaderMaterial) && true !== e3.clipping || (f2.clippingPlanes = Fe2.uniform), ft2(e3, s3), i2.needsLights = (function(e4) {\n return e4.isMeshLambertMaterial || e4.isMeshToonMaterial || e4.isMeshPhongMaterial || e4.isMeshStandardMaterial || e4.isShadowMaterial || e4.isShaderMaterial && true === e4.lights;\n })(e3), i2.lightsStateVersion = o3, i2.needsLights && (f2.ambientLightColor.value = r3.state.ambient, f2.lightProbe.value = r3.state.probe, f2.directionalLights.value = r3.state.directional, f2.directionalLightShadows.value = r3.state.directionalShadow, f2.spotLights.value = r3.state.spot, f2.spotLightShadows.value = r3.state.spotShadow, f2.rectAreaLights.value = r3.state.rectArea, f2.ltc_1.value = r3.state.rectAreaLTC1, f2.ltc_2.value = r3.state.rectAreaLTC2, f2.pointLights.value = r3.state.point, f2.pointLightShadows.value = r3.state.pointShadow, f2.hemisphereLights.value = r3.state.hemi, f2.directionalShadowMatrix.value = r3.state.directionalShadowMatrix, f2.spotLightMatrix.value = r3.state.spotLightMatrix, f2.spotLightMap.value = r3.state.spotLightMap, f2.pointShadowMatrix.value = r3.state.pointShadowMatrix), i2.lightProbeGrid = w2.state.lightProbeGridArray.length > 0, i2.currentProgram = u2, i2.uniformsList = null, u2;\n }\n function ut2(e3) {\n if (null === e3.uniformsList) {\n const t3 = e3.currentProgram.getUniforms();\n e3.uniformsList = Rr2.seqWithValue(t3.seq, e3.uniforms);\n }\n return e3.uniformsList;\n }\n function ft2(e3, t3) {\n const n2 = Ae2.get(e3);\n n2.outputColorSpace = t3.outputColorSpace, n2.batching = t3.batching, n2.batchingColor = t3.batchingColor, n2.instancing = t3.instancing, n2.instancingColor = t3.instancingColor, n2.instancingMorph = t3.instancingMorph, n2.skinning = t3.skinning, n2.morphTargets = t3.morphTargets, n2.morphNormals = t3.morphNormals, n2.morphColors = t3.morphColors, n2.morphTargetsCount = t3.morphTargetsCount, n2.numClippingPlanes = t3.numClippingPlanes, n2.numIntersection = t3.numClipIntersection, n2.vertexAlphas = t3.vertexAlphas, n2.vertexTangents = t3.vertexTangents, n2.toneMapping = t3.toneMapping;\n }\n rt2.setAnimationLoop(function(e3) {\n tt2 && tt2(e3);\n }), \"undefined\" != typeof self && rt2.setContext(self), this.setAnimationLoop = function(e3) {\n tt2 = e3, je2.setAnimationLoop(e3), null === e3 ? rt2.stop() : rt2.start();\n }, je2.addEventListener(\"sessionstart\", nt2), je2.addEventListener(\"sessionend\", it2), this.render = function(e3, t3) {\n if (void 0 !== t3 && true !== t3.isCamera)\n return void oi(\"WebGLRenderer.render: camera is not an instance of THREE.Camera.\");\n if (true === H2) return;\n null !== V2 && V2.renderStart(e3, t3);\n const n2 = true === je2.enabled && true === je2.isPresenting, i2 = null !== F2 && (null === q2 || n2) && F2.begin(G2, q2);\n if (true === e3.matrixWorldAutoUpdate && e3.updateMatrixWorld(), null === t3.parent && true === t3.matrixWorldAutoUpdate && t3.updateMatrixWorld(), true !== je2.enabled || true !== je2.isPresenting || null !== F2 && false !== F2.isCompositing() || (true === je2.cameraAutoUpdate && je2.updateCamera(t3), t3 = je2.getCamera()), true === e3.isScene && e3.onBeforeRender(G2, e3, t3, q2), w2 = Oe2.get(e3, y2.length), w2.init(t3), w2.state.textureUnits = be2.getTextureUnits(), y2.push(w2), pe2.multiplyMatrices(t3.projectionMatrix, t3.matrixWorldInverse), de2.setFromProjectionMatrix(pe2, Ws, t3.reversedDepth), fe2 = this.localClippingEnabled, ue2 = Fe2.init(this.clippingPlanes, fe2), U2 = ye2.get(e3, N2.length), U2.init(), N2.push(U2), true === je2.enabled && true === je2.isPresenting) {\n const e4 = G2.xr.getDepthSensingMesh();\n null !== e4 && at2(e4, t3, -1 / 0, G2.sortObjects);\n }\n at2(e3, t3, 0, G2.sortObjects), U2.finish(), true === G2.sortObjects && U2.sort(ae2, oe2, t3.reversedDepth), ve2 = false === je2.enabled || false === je2.isPresenting || false === je2.hasDepthSensing(), ve2 && Ge2.addToRenderList(U2, e3), this.info.render.frame++, true === this.info.autoReset && this.info.reset(), true === ue2 && Fe2.beginShadows();\n const r3 = w2.state.shadowsArray;\n Be2.render(r3, e3, t3), true === ue2 && Fe2.endShadows();\n if (false === (i2 && F2.hasRenderPass())) {\n const n3 = U2.opaque, i3 = U2.transmissive;\n if (w2.setupLights(), t3.isArrayCamera) {\n const r4 = t3.cameras;\n if (i3.length > 0)\n for (let t4 = 0, a3 = r4.length; t4 < a3; t4++) {\n st2(n3, i3, e3, r4[t4]);\n }\n ve2 && Ge2.render(e3);\n for (let t4 = 0, n4 = r4.length; t4 < n4; t4++) {\n const n5 = r4[t4];\n ot2(U2, e3, n5, n5.viewport);\n }\n } else i3.length > 0 && st2(n3, i3, e3, t3), ve2 && Ge2.render(e3), ot2(U2, e3, t3);\n }\n null !== q2 && 0 === Y2 && (be2.updateMultisampleRenderTarget(q2), be2.updateRenderTargetMipmap(q2)), i2 && F2.end(G2), true === e3.isScene && e3.onAfterRender(G2, e3, t3), ke2.resetDefaultState(), j2 = -1, Z2 = null, y2.pop(), y2.length > 0 ? (w2 = y2[y2.length - 1], be2.setTextureUnits(w2.state.textureUnits), true === ue2 && Fe2.setGlobalState(G2.clippingPlanes, w2.state.camera)) : w2 = null, N2.pop(), U2 = N2.length > 0 ? N2[N2.length - 1] : null, null !== V2 && V2.renderEnd();\n }, this.getActiveCubeFace = function() {\n return X2;\n }, this.getActiveMipmapLevel = function() {\n return Y2;\n }, this.getRenderTarget = function() {\n return q2;\n }, this.setRenderTargetTextures = function(e3, t3, n2) {\n const i2 = Ae2.get(e3);\n i2.__autoAllocateDepthBuffer = false === e3.resolveDepthBuffer, false === i2.__autoAllocateDepthBuffer && (i2.__useRenderToTexture = false), Ae2.get(e3.texture).__webglTexture = t3, Ae2.get(e3.depthTexture).__webglTexture = i2.__autoAllocateDepthBuffer ? void 0 : n2, i2.__hasExternalTextures = true;\n }, this.setRenderTargetFramebuffer = function(e3, t3) {\n const n2 = Ae2.get(e3);\n n2.__webglFramebuffer = t3, n2.__useDefaultFramebuffer = void 0 === t3;\n }, this.setRenderTarget = function(e3, t3 = 0, n2 = 0) {\n q2 = e3, X2 = t3, Y2 = n2;\n let i2 = null, r3 = false, a3 = false;\n if (e3) {\n const o3 = Ae2.get(e3);\n if (void 0 !== o3.__useDefaultFramebuffer)\n return xe2.bindFramebuffer(Ke2.FRAMEBUFFER, o3.__webglFramebuffer), $2.copy(e3.viewport), Q2.copy(e3.scissor), J2 = e3.scissorTest, xe2.viewport($2), xe2.scissor(Q2), xe2.setScissorTest(J2), void (j2 = -1);\n if (void 0 === o3.__webglFramebuffer) be2.setupRenderTarget(e3);\n else if (o3.__hasExternalTextures)\n be2.rebindTextures(\n e3,\n Ae2.get(e3.texture).__webglTexture,\n Ae2.get(e3.depthTexture).__webglTexture\n );\n else if (e3.depthBuffer) {\n const t4 = e3.depthTexture;\n if (o3.__boundDepthTexture !== t4) {\n if (null !== t4 && Ae2.has(t4) && (e3.width !== t4.image.width || e3.height !== t4.image.height))\n throw new Error(\n \"THREE.WebGLRenderer: Attached DepthTexture is initialized to the incorrect size.\"\n );\n be2.setupDepthRenderbuffer(e3);\n }\n }\n const s3 = e3.texture;\n (s3.isData3DTexture || s3.isDataArrayTexture || s3.isCompressedArrayTexture) && (a3 = true);\n const l3 = Ae2.get(e3).__webglFramebuffer;\n e3.isWebGLCubeRenderTarget ? (i2 = Array.isArray(l3[t3]) ? l3[t3][n2] : l3[t3], r3 = true) : i2 = e3.samples > 0 && false === be2.useMultisampledRTT(e3) ? Ae2.get(e3).__webglMultisampledFramebuffer : Array.isArray(l3) ? l3[n2] : l3, $2.copy(e3.viewport), Q2.copy(e3.scissor), J2 = e3.scissorTest;\n } else\n $2.copy(se2).multiplyScalar(re2).floor(), Q2.copy(le2).multiplyScalar(re2).floor(), J2 = ce2;\n 0 !== n2 && (i2 = W2);\n if (xe2.bindFramebuffer(Ke2.FRAMEBUFFER, i2) && xe2.drawBuffers(e3, i2), xe2.viewport($2), xe2.scissor(Q2), xe2.setScissorTest(J2), r3) {\n const i3 = Ae2.get(e3.texture);\n Ke2.framebufferTexture2D(\n Ke2.FRAMEBUFFER,\n Ke2.COLOR_ATTACHMENT0,\n Ke2.TEXTURE_CUBE_MAP_POSITIVE_X + t3,\n i3.__webglTexture,\n n2\n );\n } else if (a3) {\n const i3 = t3;\n for (let t4 = 0; t4 < e3.textures.length; t4++) {\n const r4 = Ae2.get(e3.textures[t4]);\n Ke2.framebufferTextureLayer(\n Ke2.FRAMEBUFFER,\n Ke2.COLOR_ATTACHMENT0 + t4,\n r4.__webglTexture,\n n2,\n i3\n );\n }\n } else if (null !== e3 && 0 !== n2) {\n const t4 = Ae2.get(e3.texture);\n Ke2.framebufferTexture2D(\n Ke2.FRAMEBUFFER,\n Ke2.COLOR_ATTACHMENT0,\n Ke2.TEXTURE_2D,\n t4.__webglTexture,\n n2\n );\n }\n j2 = -1;\n }, this.readRenderTargetPixels = function(e3, t3, n2, i2, r3, a3, o3, s3 = 0) {\n if (!e3 || !e3.isWebGLRenderTarget)\n return void oi(\n \"WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.\"\n );\n let l3 = Ae2.get(e3).__webglFramebuffer;\n if (e3.isWebGLCubeRenderTarget && void 0 !== o3 && (l3 = l3[o3]), l3) {\n xe2.bindFramebuffer(Ke2.FRAMEBUFFER, l3);\n try {\n const o4 = e3.textures[s3], l4 = o4.format, c2 = o4.type;\n if (e3.textures.length > 1 && Ke2.readBuffer(Ke2.COLOR_ATTACHMENT0 + s3), !Te2.textureFormatReadable(l4))\n return void oi(\n \"WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.\"\n );\n if (!Te2.textureTypeReadable(c2))\n return void oi(\n \"WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.\"\n );\n t3 >= 0 && t3 <= e3.width - i2 && n2 >= 0 && n2 <= e3.height - r3 && Ke2.readPixels(t3, n2, i2, r3, ze2.convert(l4), ze2.convert(c2), a3);\n } finally {\n const e4 = null !== q2 ? Ae2.get(q2).__webglFramebuffer : null;\n xe2.bindFramebuffer(Ke2.FRAMEBUFFER, e4);\n }\n }\n }, this.readRenderTargetPixelsAsync = async function(e3, t3, n2, i2, r3, a3, o3, s3 = 0) {\n if (!e3 || !e3.isWebGLRenderTarget)\n throw new Error(\n \"THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.\"\n );\n let l3 = Ae2.get(e3).__webglFramebuffer;\n if (e3.isWebGLCubeRenderTarget && void 0 !== o3 && (l3 = l3[o3]), l3) {\n if (t3 >= 0 && t3 <= e3.width - i2 && n2 >= 0 && n2 <= e3.height - r3) {\n xe2.bindFramebuffer(Ke2.FRAMEBUFFER, l3);\n const o4 = e3.textures[s3], c2 = o4.format, d3 = o4.type;\n if (e3.textures.length > 1 && Ke2.readBuffer(Ke2.COLOR_ATTACHMENT0 + s3), !Te2.textureFormatReadable(c2))\n throw new Error(\n \"THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.\"\n );\n if (!Te2.textureTypeReadable(d3))\n throw new Error(\n \"THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.\"\n );\n const u2 = Ke2.createBuffer();\n Ke2.bindBuffer(Ke2.PIXEL_PACK_BUFFER, u2), Ke2.bufferData(Ke2.PIXEL_PACK_BUFFER, a3.byteLength, Ke2.STREAM_READ), Ke2.readPixels(t3, n2, i2, r3, ze2.convert(c2), ze2.convert(d3), 0);\n const f2 = null !== q2 ? Ae2.get(q2).__webglFramebuffer : null;\n xe2.bindFramebuffer(Ke2.FRAMEBUFFER, f2);\n const p3 = Ke2.fenceSync(Ke2.SYNC_GPU_COMMANDS_COMPLETE, 0);\n return Ke2.flush(), await ci(Ke2, p3, 4), Ke2.bindBuffer(Ke2.PIXEL_PACK_BUFFER, u2), Ke2.getBufferSubData(Ke2.PIXEL_PACK_BUFFER, 0, a3), Ke2.deleteBuffer(u2), Ke2.deleteSync(p3), a3;\n }\n throw new Error(\n \"THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.\"\n );\n }\n }, this.copyFramebufferToTexture = function(e3, t3 = null, n2 = 0) {\n const i2 = Math.pow(2, -n2), r3 = Math.floor(e3.image.width * i2), a3 = Math.floor(e3.image.height * i2), o3 = null !== t3 ? t3.x : 0, s3 = null !== t3 ? t3.y : 0;\n be2.setTexture2D(e3, 0), Ke2.copyTexSubImage2D(Ke2.TEXTURE_2D, n2, 0, 0, o3, s3, r3, a3), xe2.unbindTexture();\n }, this.copyTextureToTexture = function(e3, t3, n2 = null, i2 = null, r3 = 0, a3 = 0) {\n let o3, s3, l3, c2, d3, u2, f2, p3, m3;\n const h2 = e3.isCompressedTexture ? e3.mipmaps[a3] : e3.image;\n if (null !== n2)\n o3 = n2.max.x - n2.min.x, s3 = n2.max.y - n2.min.y, l3 = n2.isBox3 ? n2.max.z - n2.min.z : 1, c2 = n2.min.x, d3 = n2.min.y, u2 = n2.isBox3 ? n2.min.z : 0;\n else {\n const t4 = Math.pow(2, -r3);\n o3 = Math.floor(h2.width * t4), s3 = Math.floor(h2.height * t4), l3 = e3.isDataArrayTexture ? h2.depth : e3.isData3DTexture ? Math.floor(h2.depth * t4) : 1, c2 = 0, d3 = 0, u2 = 0;\n }\n null !== i2 ? (f2 = i2.x, p3 = i2.y, m3 = i2.z) : (f2 = 0, p3 = 0, m3 = 0);\n const _3 = ze2.convert(t3.format), g3 = ze2.convert(t3.type);\n let v2;\n t3.isData3DTexture ? (be2.setTexture3D(t3, 0), v2 = Ke2.TEXTURE_3D) : t3.isDataArrayTexture || t3.isCompressedArrayTexture ? (be2.setTexture2DArray(t3, 0), v2 = Ke2.TEXTURE_2D_ARRAY) : (be2.setTexture2D(t3, 0), v2 = Ke2.TEXTURE_2D), xe2.activeTexture(Ke2.TEXTURE0), xe2.pixelStorei(Ke2.UNPACK_FLIP_Y_WEBGL, t3.flipY), xe2.pixelStorei(Ke2.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t3.premultiplyAlpha), xe2.pixelStorei(Ke2.UNPACK_ALIGNMENT, t3.unpackAlignment);\n const E2 = xe2.getParameter(Ke2.UNPACK_ROW_LENGTH), S2 = xe2.getParameter(Ke2.UNPACK_IMAGE_HEIGHT), M3 = xe2.getParameter(Ke2.UNPACK_SKIP_PIXELS), T3 = xe2.getParameter(Ke2.UNPACK_SKIP_ROWS), x3 = xe2.getParameter(Ke2.UNPACK_SKIP_IMAGES);\n xe2.pixelStorei(Ke2.UNPACK_ROW_LENGTH, h2.width), xe2.pixelStorei(Ke2.UNPACK_IMAGE_HEIGHT, h2.height), xe2.pixelStorei(Ke2.UNPACK_SKIP_PIXELS, c2), xe2.pixelStorei(Ke2.UNPACK_SKIP_ROWS, d3), xe2.pixelStorei(Ke2.UNPACK_SKIP_IMAGES, u2);\n const R3 = e3.isDataArrayTexture || e3.isData3DTexture, A3 = t3.isDataArrayTexture || t3.isData3DTexture;\n if (e3.isDepthTexture) {\n const n3 = Ae2.get(e3), i3 = Ae2.get(t3), h3 = Ae2.get(n3.__renderTarget), _4 = Ae2.get(i3.__renderTarget);\n xe2.bindFramebuffer(Ke2.READ_FRAMEBUFFER, h3.__webglFramebuffer), xe2.bindFramebuffer(Ke2.DRAW_FRAMEBUFFER, _4.__webglFramebuffer);\n for (let n4 = 0; n4 < l3; n4++)\n R3 && (Ke2.framebufferTextureLayer(\n Ke2.READ_FRAMEBUFFER,\n Ke2.COLOR_ATTACHMENT0,\n Ae2.get(e3).__webglTexture,\n r3,\n u2 + n4\n ), Ke2.framebufferTextureLayer(\n Ke2.DRAW_FRAMEBUFFER,\n Ke2.COLOR_ATTACHMENT0,\n Ae2.get(t3).__webglTexture,\n a3,\n m3 + n4\n )), Ke2.blitFramebuffer(c2, d3, o3, s3, f2, p3, o3, s3, Ke2.DEPTH_BUFFER_BIT, Ke2.NEAREST);\n xe2.bindFramebuffer(Ke2.READ_FRAMEBUFFER, null), xe2.bindFramebuffer(Ke2.DRAW_FRAMEBUFFER, null);\n } else if (0 !== r3 || e3.isRenderTargetTexture || Ae2.has(e3)) {\n const n3 = Ae2.get(e3), i3 = Ae2.get(t3);\n xe2.bindFramebuffer(Ke2.READ_FRAMEBUFFER, z2), xe2.bindFramebuffer(Ke2.DRAW_FRAMEBUFFER, k2);\n for (let e4 = 0; e4 < l3; e4++)\n R3 ? Ke2.framebufferTextureLayer(\n Ke2.READ_FRAMEBUFFER,\n Ke2.COLOR_ATTACHMENT0,\n n3.__webglTexture,\n r3,\n u2 + e4\n ) : Ke2.framebufferTexture2D(\n Ke2.READ_FRAMEBUFFER,\n Ke2.COLOR_ATTACHMENT0,\n Ke2.TEXTURE_2D,\n n3.__webglTexture,\n r3\n ), A3 ? Ke2.framebufferTextureLayer(\n Ke2.DRAW_FRAMEBUFFER,\n Ke2.COLOR_ATTACHMENT0,\n i3.__webglTexture,\n a3,\n m3 + e4\n ) : Ke2.framebufferTexture2D(\n Ke2.DRAW_FRAMEBUFFER,\n Ke2.COLOR_ATTACHMENT0,\n Ke2.TEXTURE_2D,\n i3.__webglTexture,\n a3\n ), 0 !== r3 ? Ke2.blitFramebuffer(c2, d3, o3, s3, f2, p3, o3, s3, Ke2.COLOR_BUFFER_BIT, Ke2.NEAREST) : A3 ? Ke2.copyTexSubImage3D(v2, a3, f2, p3, m3 + e4, c2, d3, o3, s3) : Ke2.copyTexSubImage2D(v2, a3, f2, p3, c2, d3, o3, s3);\n xe2.bindFramebuffer(Ke2.READ_FRAMEBUFFER, null), xe2.bindFramebuffer(Ke2.DRAW_FRAMEBUFFER, null);\n } else\n A3 ? e3.isDataTexture || e3.isData3DTexture ? Ke2.texSubImage3D(v2, a3, f2, p3, m3, o3, s3, l3, _3, g3, h2.data) : t3.isCompressedArrayTexture ? Ke2.compressedTexSubImage3D(v2, a3, f2, p3, m3, o3, s3, l3, _3, h2.data) : Ke2.texSubImage3D(v2, a3, f2, p3, m3, o3, s3, l3, _3, g3, h2) : e3.isDataTexture ? Ke2.texSubImage2D(Ke2.TEXTURE_2D, a3, f2, p3, o3, s3, _3, g3, h2.data) : e3.isCompressedTexture ? Ke2.compressedTexSubImage2D(Ke2.TEXTURE_2D, a3, f2, p3, h2.width, h2.height, _3, h2.data) : Ke2.texSubImage2D(Ke2.TEXTURE_2D, a3, f2, p3, o3, s3, _3, g3, h2);\n xe2.pixelStorei(Ke2.UNPACK_ROW_LENGTH, E2), xe2.pixelStorei(Ke2.UNPACK_IMAGE_HEIGHT, S2), xe2.pixelStorei(Ke2.UNPACK_SKIP_PIXELS, M3), xe2.pixelStorei(Ke2.UNPACK_SKIP_ROWS, T3), xe2.pixelStorei(Ke2.UNPACK_SKIP_IMAGES, x3), 0 === a3 && t3.generateMipmaps && Ke2.generateMipmap(v2), xe2.unbindTexture();\n }, this.initRenderTarget = function(e3) {\n void 0 === Ae2.get(e3).__webglFramebuffer && be2.setupRenderTarget(e3);\n }, this.initTexture = function(e3) {\n e3.isCubeTexture ? be2.setTextureCube(e3, 0) : e3.isData3DTexture ? be2.setTexture3D(e3, 0) : e3.isDataArrayTexture || e3.isCompressedArrayTexture ? be2.setTexture2DArray(e3, 0) : be2.setTexture2D(e3, 0), xe2.unbindTexture();\n }, this.resetState = function() {\n X2 = 0, Y2 = 0, q2 = null, xe2.reset(), ke2.reset();\n }, \"undefined\" != typeof __THREE_DEVTOOLS__ && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(\"observe\", { detail: this }));\n }\n get coordinateSystem() {\n return Ws;\n }\n get outputColorSpace() {\n return this._outputColorSpace;\n }\n set outputColorSpace(e2) {\n this._outputColorSpace = e2;\n const t2 = this.getContext();\n t2.drawingBufferColorSpace = Ri._getDrawingBufferColorSpace(e2), t2.unpackColorSpace = Ri._getUnpackColorSpace();\n }\n };\n\n // registry/blocks/cuboid-carousel/assets/addons/environments/RoomEnvironment.js\n var RoomEnvironment_exports = {};\n __export(RoomEnvironment_exports, {\n RoomEnvironment: () => RoomEnvironment\n });\n var RoomEnvironment = class extends Vr {\n constructor() {\n super();\n const geometry = new yh();\n geometry.deleteAttribute(\"uv\");\n const roomMaterial = new $l({ side: d });\n const boxMaterial = new $l();\n const mainLight = new nu(16777215, 900, 28, 2);\n mainLight.position.set(0.418, 16.199, 0.3);\n this.add(mainLight);\n const room = new Ra(geometry, roomMaterial);\n room.position.set(-0.757, 13.219, 0.717);\n room.scale.set(31.713, 28.305, 28.591);\n this.add(room);\n const boxes = new no(geometry, boxMaterial, 6);\n const transform = new Ar();\n transform.position.set(-10.906, 2.009, 1.846);\n transform.rotation.set(0, -0.195, 0);\n transform.scale.set(2.328, 7.905, 4.651);\n transform.updateMatrix();\n boxes.setMatrixAt(0, transform.matrix);\n transform.position.set(-5.607, -0.754, -0.758);\n transform.rotation.set(0, 0.994, 0);\n transform.scale.set(1.97, 1.534, 3.955);\n transform.updateMatrix();\n boxes.setMatrixAt(1, transform.matrix);\n transform.position.set(6.167, 0.857, 7.803);\n transform.rotation.set(0, 0.561, 0);\n transform.scale.set(3.927, 6.285, 3.687);\n transform.updateMatrix();\n boxes.setMatrixAt(2, transform.matrix);\n transform.position.set(-2.017, 0.018, 6.124);\n transform.rotation.set(0, 0.333, 0);\n transform.scale.set(2.002, 4.566, 2.064);\n transform.updateMatrix();\n boxes.setMatrixAt(3, transform.matrix);\n transform.position.set(2.291, -0.756, -2.621);\n transform.rotation.set(0, -0.286, 0);\n transform.scale.set(1.546, 1.552, 1.496);\n transform.updateMatrix();\n boxes.setMatrixAt(4, transform.matrix);\n transform.position.set(-2.193, -0.369, -5.547);\n transform.rotation.set(0, 0.516, 0);\n transform.scale.set(3.875, 3.487, 2.986);\n transform.updateMatrix();\n boxes.setMatrixAt(5, transform.matrix);\n this.add(boxes);\n const light1 = new Ra(geometry, createAreaLightMaterial(50));\n light1.position.set(-16.116, 14.37, 8.208);\n light1.scale.set(0.1, 2.428, 2.739);\n this.add(light1);\n const light2 = new Ra(geometry, createAreaLightMaterial(50));\n light2.position.set(-16.109, 18.021, -8.207);\n light2.scale.set(0.1, 2.425, 2.751);\n this.add(light2);\n const light3 = new Ra(geometry, createAreaLightMaterial(17));\n light3.position.set(14.904, 12.198, -1.832);\n light3.scale.set(0.15, 4.265, 6.331);\n this.add(light3);\n const light4 = new Ra(geometry, createAreaLightMaterial(43));\n light4.position.set(-0.462, 8.89, 14.52);\n light4.scale.set(4.38, 5.441, 0.088);\n this.add(light4);\n const light5 = new Ra(geometry, createAreaLightMaterial(20));\n light5.position.set(3.235, 11.486, -12.541);\n light5.scale.set(2.5, 2, 0.1);\n this.add(light5);\n const light6 = new Ra(geometry, createAreaLightMaterial(100));\n light6.position.set(0, 20, 0);\n light6.scale.set(1, 0.1, 1);\n this.add(light6);\n }\n /**\n * Frees internal resources. This method should be called\n * when the environment is no longer required.\n */\n dispose() {\n const resources = /* @__PURE__ */ new Set();\n this.traverse((object) => {\n if (object.isMesh) {\n resources.add(object.geometry);\n resources.add(object.material);\n }\n });\n for (const resource of resources) {\n resource.dispose();\n }\n }\n };\n function createAreaLightMaterial(intensity) {\n const material = new sc({\n color: 0,\n emissive: 16777215,\n emissiveIntensity: intensity\n });\n return material;\n }\n\n // registry/blocks/cuboid-carousel/assets/addons/utils/BufferGeometryUtils.js\n var BufferGeometryUtils_exports = {};\n __export(BufferGeometryUtils_exports, {\n computeMikkTSpaceTangents: () => computeMikkTSpaceTangents,\n computeMorphedAttributes: () => computeMorphedAttributes,\n deepCloneAttribute: () => deepCloneAttribute,\n deinterleaveAttribute: () => deinterleaveAttribute,\n deinterleaveGeometry: () => deinterleaveGeometry,\n estimateBytesUsed: () => estimateBytesUsed,\n interleaveAttributes: () => interleaveAttributes,\n mergeAttributes: () => mergeAttributes,\n mergeGeometries: () => mergeGeometries,\n mergeGroups: () => mergeGroups,\n mergeVertices: () => mergeVertices,\n toCreasedNormals: () => toCreasedNormals,\n toTrianglesDrawMode: () => toTrianglesDrawMode\n });\n function computeMikkTSpaceTangents(geometry, MikkTSpace, negateSign = true) {\n if (!MikkTSpace || !MikkTSpace.isReady) {\n throw new Error(\"BufferGeometryUtils: Initialized MikkTSpace library required.\");\n }\n if (!geometry.hasAttribute(\"position\") || !geometry.hasAttribute(\"normal\") || !geometry.hasAttribute(\"uv\")) {\n throw new Error(\n 'BufferGeometryUtils: Tangents require \"position\", \"normal\", and \"uv\" attributes.'\n );\n }\n function getAttributeArray(attribute) {\n if (attribute.normalized || attribute.isInterleavedBufferAttribute) {\n const dstArray = new Float32Array(attribute.count * attribute.itemSize);\n for (let i2 = 0, j2 = 0; i2 < attribute.count; i2++) {\n dstArray[j2++] = attribute.getX(i2);\n dstArray[j2++] = attribute.getY(i2);\n if (attribute.itemSize > 2) {\n dstArray[j2++] = attribute.getZ(i2);\n }\n }\n return dstArray;\n }\n if (attribute.array instanceof Float32Array) {\n return attribute.array;\n }\n return new Float32Array(attribute.array);\n }\n const _geometry = geometry.index ? geometry.toNonIndexed() : geometry;\n const tangents = MikkTSpace.generateTangents(\n getAttributeArray(_geometry.attributes.position),\n getAttributeArray(_geometry.attributes.normal),\n getAttributeArray(_geometry.attributes.uv)\n );\n if (negateSign) {\n for (let i2 = 3; i2 < tangents.length; i2 += 4) {\n tangents[i2] *= -1;\n }\n }\n _geometry.setAttribute(\"tangent\", new Mn(tangents, 4));\n if (geometry !== _geometry) {\n geometry.copy(_geometry);\n }\n return geometry;\n }\n function mergeGeometries(geometries, useGroups = false) {\n const isIndexed = geometries[0].index !== null;\n const attributesUsed = new Set(Object.keys(geometries[0].attributes));\n const morphAttributesUsed = new Set(Object.keys(geometries[0].morphAttributes));\n const attributes = {};\n const morphAttributes = {};\n const morphTargetsRelative = geometries[0].morphTargetsRelative;\n const mergedGeometry = new Wn();\n let offset = 0;\n for (let i2 = 0; i2 < geometries.length; ++i2) {\n const geometry = geometries[i2];\n let attributesCount = 0;\n if (isIndexed !== (geometry.index !== null)) {\n console.error(\n \"THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index \" + i2 + \". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them.\"\n );\n return null;\n }\n for (const name in geometry.attributes) {\n if (!attributesUsed.has(name)) {\n console.error(\n \"THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index \" + i2 + '. All geometries must have compatible attributes; make sure \"' + name + '\" attribute exists among all geometries, or in none of them.'\n );\n return null;\n }\n if (attributes[name] === void 0) attributes[name] = [];\n attributes[name].push(geometry.attributes[name]);\n attributesCount++;\n }\n if (attributesCount !== attributesUsed.size) {\n console.error(\n \"THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index \" + i2 + \". Make sure all geometries have the same number of attributes.\"\n );\n return null;\n }\n if (morphTargetsRelative !== geometry.morphTargetsRelative) {\n console.error(\n \"THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index \" + i2 + \". .morphTargetsRelative must be consistent throughout all geometries.\"\n );\n return null;\n }\n for (const name in geometry.morphAttributes) {\n if (!morphAttributesUsed.has(name)) {\n console.error(\n \"THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index \" + i2 + \". .morphAttributes must be consistent throughout all geometries.\"\n );\n return null;\n }\n if (morphAttributes[name] === void 0) morphAttributes[name] = [];\n morphAttributes[name].push(geometry.morphAttributes[name]);\n }\n if (useGroups) {\n let count;\n if (isIndexed) {\n count = geometry.index.count;\n } else if (geometry.attributes.position !== void 0) {\n count = geometry.attributes.position.count;\n } else {\n console.error(\n \"THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index \" + i2 + \". The geometry must have either an index or a position attribute\"\n );\n return null;\n }\n mergedGeometry.addGroup(offset, count, i2);\n offset += count;\n }\n }\n if (isIndexed) {\n let indexOffset = 0;\n const mergedIndex = [];\n for (let i2 = 0; i2 < geometries.length; ++i2) {\n const index = geometries[i2].index;\n for (let j2 = 0; j2 < index.count; ++j2) {\n mergedIndex.push(index.getX(j2) + indexOffset);\n }\n indexOffset += geometries[i2].attributes.position.count;\n }\n mergedGeometry.setIndex(mergedIndex);\n }\n for (const name in attributes) {\n const mergedAttribute = mergeAttributes(attributes[name]);\n if (!mergedAttribute) {\n console.error(\n \"THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the \" + name + \" attribute.\"\n );\n return null;\n }\n mergedGeometry.setAttribute(name, mergedAttribute);\n }\n for (const name in morphAttributes) {\n const numMorphTargets = morphAttributes[name][0].length;\n if (numMorphTargets === 0) break;\n mergedGeometry.morphAttributes = mergedGeometry.morphAttributes || {};\n mergedGeometry.morphAttributes[name] = [];\n for (let i2 = 0; i2 < numMorphTargets; ++i2) {\n const morphAttributesToMerge = [];\n for (let j2 = 0; j2 < morphAttributes[name].length; ++j2) {\n morphAttributesToMerge.push(morphAttributes[name][j2][i2]);\n }\n const mergedMorphAttribute = mergeAttributes(morphAttributesToMerge);\n if (!mergedMorphAttribute) {\n console.error(\n \"THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the \" + name + \" morphAttribute.\"\n );\n return null;\n }\n mergedGeometry.morphAttributes[name].push(mergedMorphAttribute);\n }\n }\n return mergedGeometry;\n }\n function mergeAttributes(attributes) {\n let TypedArray;\n let itemSize;\n let normalized;\n let gpuType = -1;\n let arrayLength = 0;\n for (let i2 = 0; i2 < attributes.length; ++i2) {\n const attribute = attributes[i2];\n if (TypedArray === void 0) TypedArray = attribute.array.constructor;\n if (TypedArray !== attribute.array.constructor) {\n console.error(\n \"THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes.\"\n );\n return null;\n }\n if (itemSize === void 0) itemSize = attribute.itemSize;\n if (itemSize !== attribute.itemSize) {\n console.error(\n \"THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes.\"\n );\n return null;\n }\n if (normalized === void 0) normalized = attribute.normalized;\n if (normalized !== attribute.normalized) {\n console.error(\n \"THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes.\"\n );\n return null;\n }\n if (gpuType === -1) gpuType = attribute.gpuType;\n if (gpuType !== attribute.gpuType) {\n console.error(\n \"THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes.\"\n );\n return null;\n }\n arrayLength += attribute.count * itemSize;\n }\n const array = new TypedArray(arrayLength);\n const result = new Mn(array, itemSize, normalized);\n let offset = 0;\n for (let i2 = 0; i2 < attributes.length; ++i2) {\n const attribute = attributes[i2];\n if (attribute.isInterleavedBufferAttribute) {\n const tupleOffset = offset / itemSize;\n for (let j2 = 0, l2 = attribute.count; j2 < l2; j2++) {\n for (let c2 = 0; c2 < itemSize; c2++) {\n const value = attribute.getComponent(j2, c2);\n result.setComponent(j2 + tupleOffset, c2, value);\n }\n }\n } else {\n array.set(attribute.array, offset);\n }\n offset += attribute.count * itemSize;\n }\n if (gpuType !== void 0) {\n result.gpuType = gpuType;\n }\n return result;\n }\n function deepCloneAttribute(attribute) {\n if (attribute.isInstancedInterleavedBufferAttribute || attribute.isInterleavedBufferAttribute) {\n return deinterleaveAttribute(attribute);\n }\n if (attribute.isInstancedBufferAttribute) {\n return new $a().copy(attribute);\n }\n return new Mn().copy(attribute);\n }\n function interleaveAttributes(attributes) {\n let TypedArray;\n let arrayLength = 0;\n let stride = 0;\n for (let i2 = 0, l2 = attributes.length; i2 < l2; ++i2) {\n const attribute = attributes[i2];\n if (TypedArray === void 0) TypedArray = attribute.array.constructor;\n if (TypedArray !== attribute.array.constructor) {\n console.error(\"AttributeBuffers of different types cannot be interleaved\");\n return null;\n }\n arrayLength += attribute.array.length;\n stride += attribute.itemSize;\n }\n const interleavedBuffer = new Jn(new TypedArray(arrayLength), stride);\n let offset = 0;\n const res = [];\n const getters = [\"getX\", \"getY\", \"getZ\", \"getW\"];\n const setters = [\"setX\", \"setY\", \"setZ\", \"setW\"];\n for (let j2 = 0, l2 = attributes.length; j2 < l2; j2++) {\n const attribute = attributes[j2];\n const itemSize = attribute.itemSize;\n const count = attribute.count;\n const iba = new Hn(\n interleavedBuffer,\n itemSize,\n offset,\n attribute.normalized\n );\n res.push(iba);\n offset += itemSize;\n for (let c2 = 0; c2 < count; c2++) {\n for (let k2 = 0; k2 < itemSize; k2++) {\n iba[setters[k2]](c2, attribute[getters[k2]](c2));\n }\n }\n }\n return res;\n }\n function deinterleaveAttribute(attribute) {\n const cons = attribute.data.array.constructor;\n const count = attribute.count;\n const itemSize = attribute.itemSize;\n const normalized = attribute.normalized;\n const array = new cons(count * itemSize);\n let newAttribute;\n if (attribute.isInstancedInterleavedBufferAttribute) {\n newAttribute = new $a(\n array,\n itemSize,\n normalized,\n attribute.meshPerAttribute\n );\n } else {\n newAttribute = new Mn(array, itemSize, normalized);\n }\n for (let i2 = 0; i2 < count; i2++) {\n newAttribute.setX(i2, attribute.getX(i2));\n if (itemSize >= 2) {\n newAttribute.setY(i2, attribute.getY(i2));\n }\n if (itemSize >= 3) {\n newAttribute.setZ(i2, attribute.getZ(i2));\n }\n if (itemSize >= 4) {\n newAttribute.setW(i2, attribute.getW(i2));\n }\n }\n return newAttribute;\n }\n function deinterleaveGeometry(geometry) {\n const attributes = geometry.attributes;\n const morphTargets = geometry.morphTargets;\n const attrMap = /* @__PURE__ */ new Map();\n for (const key in attributes) {\n const attr = attributes[key];\n if (attr.isInterleavedBufferAttribute) {\n if (!attrMap.has(attr)) {\n attrMap.set(attr, deinterleaveAttribute(attr));\n }\n attributes[key] = attrMap.get(attr);\n }\n }\n for (const key in morphTargets) {\n const attr = morphTargets[key];\n if (attr.isInterleavedBufferAttribute) {\n if (!attrMap.has(attr)) {\n attrMap.set(attr, deinterleaveAttribute(attr));\n }\n morphTargets[key] = attrMap.get(attr);\n }\n }\n }\n function estimateBytesUsed(geometry) {\n let mem = 0;\n for (const name in geometry.attributes) {\n const attr = geometry.getAttribute(name);\n mem += attr.count * attr.itemSize * attr.array.BYTES_PER_ELEMENT;\n }\n const indices = geometry.getIndex();\n mem += indices ? indices.count * indices.itemSize * indices.array.BYTES_PER_ELEMENT : 0;\n return mem;\n }\n function mergeVertices(geometry, tolerance = 1e-4) {\n tolerance = Math.max(tolerance, Number.EPSILON);\n const hashToIndex = {};\n const indices = geometry.getIndex();\n const positions = geometry.getAttribute(\"position\");\n const vertexCount = indices ? indices.count : positions.count;\n let nextIndex = 0;\n const attributeNames = Object.keys(geometry.attributes);\n const tmpAttributes = {};\n const tmpMorphAttributes = {};\n const newIndices = [];\n const getters = [\"getX\", \"getY\", \"getZ\", \"getW\"];\n const setters = [\"setX\", \"setY\", \"setZ\", \"setW\"];\n for (let i2 = 0, l2 = attributeNames.length; i2 < l2; i2++) {\n const name = attributeNames[i2];\n const attr = geometry.attributes[name];\n tmpAttributes[name] = new attr.constructor(\n new attr.array.constructor(attr.count * attr.itemSize),\n attr.itemSize,\n attr.normalized\n );\n const morphAttributes = geometry.morphAttributes[name];\n if (morphAttributes) {\n if (!tmpMorphAttributes[name]) tmpMorphAttributes[name] = [];\n morphAttributes.forEach((morphAttr, i3) => {\n const array = new morphAttr.array.constructor(morphAttr.count * morphAttr.itemSize);\n tmpMorphAttributes[name][i3] = new morphAttr.constructor(\n array,\n morphAttr.itemSize,\n morphAttr.normalized\n );\n });\n }\n }\n const halfTolerance = tolerance * 0.5;\n const exponent = Math.log10(1 / tolerance);\n const hashMultiplier = Math.pow(10, exponent);\n const hashAdditive = halfTolerance * hashMultiplier;\n for (let i2 = 0; i2 < vertexCount; i2++) {\n const index = indices ? indices.getX(i2) : i2;\n let hash = \"\";\n for (let j2 = 0, l2 = attributeNames.length; j2 < l2; j2++) {\n const name = attributeNames[j2];\n const attribute = geometry.getAttribute(name);\n const itemSize = attribute.itemSize;\n for (let k2 = 0; k2 < itemSize; k2++) {\n hash += `${~~(attribute[getters[k2]](index) * hashMultiplier + hashAdditive)},`;\n }\n }\n if (hash in hashToIndex) {\n newIndices.push(hashToIndex[hash]);\n } else {\n for (let j2 = 0, l2 = attributeNames.length; j2 < l2; j2++) {\n const name = attributeNames[j2];\n const attribute = geometry.getAttribute(name);\n const morphAttributes = geometry.morphAttributes[name];\n const itemSize = attribute.itemSize;\n const newArray = tmpAttributes[name];\n const newMorphArrays = tmpMorphAttributes[name];\n for (let k2 = 0; k2 < itemSize; k2++) {\n const getterFunc = getters[k2];\n const setterFunc = setters[k2];\n newArray[setterFunc](nextIndex, attribute[getterFunc](index));\n if (morphAttributes) {\n for (let m2 = 0, ml2 = morphAttributes.length; m2 < ml2; m2++) {\n newMorphArrays[m2][setterFunc](nextIndex, morphAttributes[m2][getterFunc](index));\n }\n }\n }\n }\n hashToIndex[hash] = nextIndex;\n newIndices.push(nextIndex);\n nextIndex++;\n }\n }\n const result = geometry.clone();\n for (const name in geometry.attributes) {\n const tmpAttribute = tmpAttributes[name];\n result.setAttribute(\n name,\n new tmpAttribute.constructor(\n tmpAttribute.array.slice(0, nextIndex * tmpAttribute.itemSize),\n tmpAttribute.itemSize,\n tmpAttribute.normalized\n )\n );\n if (!(name in tmpMorphAttributes)) continue;\n for (let j2 = 0; j2 < tmpMorphAttributes[name].length; j2++) {\n const tmpMorphAttribute = tmpMorphAttributes[name][j2];\n result.morphAttributes[name][j2] = new tmpMorphAttribute.constructor(\n tmpMorphAttribute.array.slice(0, nextIndex * tmpMorphAttribute.itemSize),\n tmpMorphAttribute.itemSize,\n tmpMorphAttribute.normalized\n );\n }\n }\n result.setIndex(newIndices);\n return result;\n }\n function toTrianglesDrawMode(geometry, drawMode) {\n if (drawMode === qe) {\n console.warn(\n \"THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles.\"\n );\n return geometry;\n }\n if (drawMode === Xe || drawMode === He) {\n let index = geometry.getIndex();\n if (index === null) {\n const indices = [];\n const position = geometry.getAttribute(\"position\");\n if (position !== void 0) {\n for (let i2 = 0; i2 < position.count; i2++) {\n indices.push(i2);\n }\n geometry.setIndex(indices);\n index = geometry.getIndex();\n } else {\n console.error(\n \"THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible.\"\n );\n return geometry;\n }\n }\n const numberOfTriangles = index.count - 2;\n const newIndices = [];\n if (drawMode === Xe) {\n for (let i2 = 1; i2 <= numberOfTriangles; i2++) {\n newIndices.push(index.getX(0));\n newIndices.push(index.getX(i2));\n newIndices.push(index.getX(i2 + 1));\n }\n } else {\n for (let i2 = 0; i2 < numberOfTriangles; i2++) {\n if (i2 % 2 === 0) {\n newIndices.push(index.getX(i2));\n newIndices.push(index.getX(i2 + 1));\n newIndices.push(index.getX(i2 + 2));\n } else {\n newIndices.push(index.getX(i2 + 2));\n newIndices.push(index.getX(i2 + 1));\n newIndices.push(index.getX(i2));\n }\n }\n }\n if (newIndices.length / 3 !== numberOfTriangles) {\n console.error(\n \"THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.\"\n );\n }\n const newGeometry = geometry.clone();\n newGeometry.setIndex(newIndices);\n newGeometry.clearGroups();\n return newGeometry;\n } else {\n console.error(\"THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:\", drawMode);\n return geometry;\n }\n }\n function computeMorphedAttributes(object) {\n const _vA = new Ti();\n const _vB = new Ti();\n const _vC = new Ti();\n const _tempA = new Ti();\n const _tempB = new Ti();\n const _tempC = new Ti();\n const _morphA = new Ti();\n const _morphB = new Ti();\n const _morphC = new Ti();\n function _calculateMorphedAttributeData(object2, attribute, morphAttribute, morphTargetsRelative2, a3, b3, c3, modifiedAttributeArray) {\n _vA.fromBufferAttribute(attribute, a3);\n _vB.fromBufferAttribute(attribute, b3);\n _vC.fromBufferAttribute(attribute, c3);\n const morphInfluences = object2.morphTargetInfluences;\n if (morphAttribute && morphInfluences) {\n _morphA.set(0, 0, 0);\n _morphB.set(0, 0, 0);\n _morphC.set(0, 0, 0);\n for (let i3 = 0, il3 = morphAttribute.length; i3 < il3; i3++) {\n const influence = morphInfluences[i3];\n const morph = morphAttribute[i3];\n if (influence === 0) continue;\n _tempA.fromBufferAttribute(morph, a3);\n _tempB.fromBufferAttribute(morph, b3);\n _tempC.fromBufferAttribute(morph, c3);\n if (morphTargetsRelative2) {\n _morphA.addScaledVector(_tempA, influence);\n _morphB.addScaledVector(_tempB, influence);\n _morphC.addScaledVector(_tempC, influence);\n } else {\n _morphA.addScaledVector(_tempA.sub(_vA), influence);\n _morphB.addScaledVector(_tempB.sub(_vB), influence);\n _morphC.addScaledVector(_tempC.sub(_vC), influence);\n }\n }\n _vA.add(_morphA);\n _vB.add(_morphB);\n _vC.add(_morphC);\n }\n if (object2.isSkinnedMesh) {\n object2.applyBoneTransform(a3, _vA);\n object2.applyBoneTransform(b3, _vB);\n object2.applyBoneTransform(c3, _vC);\n }\n modifiedAttributeArray[a3 * 3 + 0] = _vA.x;\n modifiedAttributeArray[a3 * 3 + 1] = _vA.y;\n modifiedAttributeArray[a3 * 3 + 2] = _vA.z;\n modifiedAttributeArray[b3 * 3 + 0] = _vB.x;\n modifiedAttributeArray[b3 * 3 + 1] = _vB.y;\n modifiedAttributeArray[b3 * 3 + 2] = _vB.z;\n modifiedAttributeArray[c3 * 3 + 0] = _vC.x;\n modifiedAttributeArray[c3 * 3 + 1] = _vC.y;\n modifiedAttributeArray[c3 * 3 + 2] = _vC.z;\n }\n const geometry = object.geometry;\n const material = object.material;\n let a2, b2, c2;\n const index = geometry.index;\n const positionAttribute = geometry.attributes.position;\n const morphPosition = geometry.morphAttributes.position;\n const morphTargetsRelative = geometry.morphTargetsRelative;\n const normalAttribute = geometry.attributes.normal;\n const morphNormal = geometry.morphAttributes.position;\n const groups = geometry.groups;\n const drawRange = geometry.drawRange;\n let i2, j2, il2, jl2;\n let group;\n let start, end;\n const modifiedPosition = new Float32Array(positionAttribute.count * positionAttribute.itemSize);\n const modifiedNormal = new Float32Array(normalAttribute.count * normalAttribute.itemSize);\n if (index !== null) {\n if (Array.isArray(material)) {\n for (i2 = 0, il2 = groups.length; i2 < il2; i2++) {\n group = groups[i2];\n start = Math.max(group.start, drawRange.start);\n end = Math.min(group.start + group.count, drawRange.start + drawRange.count);\n for (j2 = start, jl2 = end; j2 < jl2; j2 += 3) {\n a2 = index.getX(j2);\n b2 = index.getX(j2 + 1);\n c2 = index.getX(j2 + 2);\n _calculateMorphedAttributeData(\n object,\n positionAttribute,\n morphPosition,\n morphTargetsRelative,\n a2,\n b2,\n c2,\n modifiedPosition\n );\n _calculateMorphedAttributeData(\n object,\n normalAttribute,\n morphNormal,\n morphTargetsRelative,\n a2,\n b2,\n c2,\n modifiedNormal\n );\n }\n }\n } else {\n start = Math.max(0, drawRange.start);\n end = Math.min(index.count, drawRange.start + drawRange.count);\n for (i2 = start, il2 = end; i2 < il2; i2 += 3) {\n a2 = index.getX(i2);\n b2 = index.getX(i2 + 1);\n c2 = index.getX(i2 + 2);\n _calculateMorphedAttributeData(\n object,\n positionAttribute,\n morphPosition,\n morphTargetsRelative,\n a2,\n b2,\n c2,\n modifiedPosition\n );\n _calculateMorphedAttributeData(\n object,\n normalAttribute,\n morphNormal,\n morphTargetsRelative,\n a2,\n b2,\n c2,\n modifiedNormal\n );\n }\n }\n } else {\n if (Array.isArray(material)) {\n for (i2 = 0, il2 = groups.length; i2 < il2; i2++) {\n group = groups[i2];\n start = Math.max(group.start, drawRange.start);\n end = Math.min(group.start + group.count, drawRange.start + drawRange.count);\n for (j2 = start, jl2 = end; j2 < jl2; j2 += 3) {\n a2 = j2;\n b2 = j2 + 1;\n c2 = j2 + 2;\n _calculateMorphedAttributeData(\n object,\n positionAttribute,\n morphPosition,\n morphTargetsRelative,\n a2,\n b2,\n c2,\n modifiedPosition\n );\n _calculateMorphedAttributeData(\n object,\n normalAttribute,\n morphNormal,\n morphTargetsRelative,\n a2,\n b2,\n c2,\n modifiedNormal\n );\n }\n }\n } else {\n start = Math.max(0, drawRange.start);\n end = Math.min(positionAttribute.count, drawRange.start + drawRange.count);\n for (i2 = start, il2 = end; i2 < il2; i2 += 3) {\n a2 = i2;\n b2 = i2 + 1;\n c2 = i2 + 2;\n _calculateMorphedAttributeData(\n object,\n positionAttribute,\n morphPosition,\n morphTargetsRelative,\n a2,\n b2,\n c2,\n modifiedPosition\n );\n _calculateMorphedAttributeData(\n object,\n normalAttribute,\n morphNormal,\n morphTargetsRelative,\n a2,\n b2,\n c2,\n modifiedNormal\n );\n }\n }\n }\n const morphedPositionAttribute = new kn(modifiedPosition, 3);\n const morphedNormalAttribute = new kn(modifiedNormal, 3);\n return {\n positionAttribute,\n normalAttribute,\n morphedPositionAttribute,\n morphedNormalAttribute\n };\n }\n function mergeGroups(geometry) {\n if (geometry.groups.length === 0) {\n console.warn(\n \"THREE.BufferGeometryUtils.mergeGroups(): No groups are defined. Nothing to merge.\"\n );\n return geometry;\n }\n let groups = geometry.groups;\n groups = groups.sort((a2, b2) => {\n if (a2.materialIndex !== b2.materialIndex) return a2.materialIndex - b2.materialIndex;\n return a2.start - b2.start;\n });\n if (geometry.getIndex() === null) {\n const positionAttribute = geometry.getAttribute(\"position\");\n const indices = [];\n for (let i2 = 0; i2 < positionAttribute.count; i2 += 3) {\n indices.push(i2, i2 + 1, i2 + 2);\n }\n geometry.setIndex(indices);\n }\n const index = geometry.getIndex();\n const newIndices = [];\n for (let i2 = 0; i2 < groups.length; i2++) {\n const group = groups[i2];\n const groupStart = group.start;\n const groupLength = groupStart + group.count;\n for (let j2 = groupStart; j2 < groupLength; j2++) {\n newIndices.push(index.getX(j2));\n }\n }\n geometry.dispose();\n geometry.setIndex(newIndices);\n let start = 0;\n for (let i2 = 0; i2 < groups.length; i2++) {\n const group = groups[i2];\n group.start = start;\n start += group.count;\n }\n let currentGroup = groups[0];\n geometry.groups = [currentGroup];\n for (let i2 = 1; i2 < groups.length; i2++) {\n const group = groups[i2];\n if (currentGroup.materialIndex === group.materialIndex) {\n currentGroup.count += group.count;\n } else {\n currentGroup = group;\n geometry.groups.push(currentGroup);\n }\n }\n return geometry;\n }\n function toCreasedNormals(geometry, creaseAngle = Math.PI / 3) {\n const creaseDot = Math.cos(creaseAngle);\n const hashMultiplier = (1 + 1e-10) * 100;\n const verts = [new Ti(), new Ti(), new Ti()];\n const tempVec1 = new Ti();\n const tempVec2 = new Ti();\n const tempNorm = new Ti();\n const tempNorm2 = new Ti();\n function hashVertex(v2) {\n const x2 = ~~(v2.x * hashMultiplier);\n const y2 = ~~(v2.y * hashMultiplier);\n const z2 = ~~(v2.z * hashMultiplier);\n return `${x2},${y2},${z2}`;\n }\n const resultGeometry = geometry.index ? geometry.toNonIndexed() : geometry;\n const posAttr = resultGeometry.attributes.position;\n const vertexMap = {};\n for (let i2 = 0, l2 = posAttr.count / 3; i2 < l2; i2++) {\n const i3 = 3 * i2;\n const a2 = verts[0].fromBufferAttribute(posAttr, i3 + 0);\n const b2 = verts[1].fromBufferAttribute(posAttr, i3 + 1);\n const c2 = verts[2].fromBufferAttribute(posAttr, i3 + 2);\n tempVec1.subVectors(c2, b2);\n tempVec2.subVectors(a2, b2);\n const normal = new Ti().crossVectors(tempVec1, tempVec2).normalize();\n for (let n2 = 0; n2 < 3; n2++) {\n const vert = verts[n2];\n const hash = hashVertex(vert);\n if (!(hash in vertexMap)) {\n vertexMap[hash] = [];\n }\n vertexMap[hash].push(normal);\n }\n }\n const normalArray = new Float32Array(posAttr.count * 3);\n const normAttr = new Mn(normalArray, 3, false);\n for (let i2 = 0, l2 = posAttr.count / 3; i2 < l2; i2++) {\n const i3 = 3 * i2;\n const a2 = verts[0].fromBufferAttribute(posAttr, i3 + 0);\n const b2 = verts[1].fromBufferAttribute(posAttr, i3 + 1);\n const c2 = verts[2].fromBufferAttribute(posAttr, i3 + 2);\n tempVec1.subVectors(c2, b2);\n tempVec2.subVectors(a2, b2);\n tempNorm.crossVectors(tempVec1, tempVec2).normalize();\n for (let n2 = 0; n2 < 3; n2++) {\n const vert = verts[n2];\n const hash = hashVertex(vert);\n const otherNormals = vertexMap[hash];\n tempNorm2.set(0, 0, 0);\n for (let k2 = 0, lk = otherNormals.length; k2 < lk; k2++) {\n const otherNorm = otherNormals[k2];\n if (tempNorm.dot(otherNorm) > creaseDot) {\n tempNorm2.add(otherNorm);\n }\n }\n tempNorm2.normalize();\n normAttr.setXYZ(i3 + n2, tempNorm2.x, tempNorm2.y, tempNorm2.z);\n }\n }\n resultGeometry.setAttribute(\"normal\", normAttr);\n return resultGeometry;\n }\n\n // <stdin>\n globalThis.__hfCatalogModules = { \"three\": three_module_min_exports, \"three/addons/environments/RoomEnvironment.js\": RoomEnvironment_exports, \"three/addons/utils/BufferGeometryUtils.js\": BufferGeometryUtils_exports };\n})();\n"} |