<!-- SOLID-PLAYTIME · part 125 -->
Ur=new Dn,wR=new ie;function CR(t,e,n,i,s,a,r){let o=new Xt(0),l=a===!0?0:1,c,u,f=null,h=0,p=null;function v(m){let x=m.isScene===!0?m.background:null;if(x&&x.isTexture)x=(m.backgroundBlurriness>0?n:e).get(x);return x}function y(m){let x=!1,S=v(m);if(S===null)d(o,l);else if(S&&S.isColor)d(S,1),x=!0;let A=t.xr.getEnvironmentBlendMode();if(A==="additive")i.buffers.color.setClear(0,0,0,1,r);else if(A==="alpha-blend")i.buffers.color.setClear(0,0,0,0,r);if(t.autoClear||x)i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil)}function U(m,x){let S=v(x);if(S&&(S.isCubeTexture||S.mapping===Lc)){if(u===void 0)u=new At(new $e(1,1,1),new Zi({name:"BackgroundCubeMaterial",uniforms:fr(is.backgroundCube.uniforms),vertexShader:is.backgroundCube.vertexShader,fragmentShader:is.backgroundCube.fragmentShader,side:fi,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(A,T,w){this.matrixWorld.copyPosition(w.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),s.update(u);if(Ur.copy(x.backgroundRotation),Ur.x*=-1,Ur.y*=-1,Ur.z*=-1,S.isCubeTexture&&S.isRenderTargetTexture===!1)Ur.y*=-1,Ur.z*=-1;if(u.material.uniforms.envMap.value=S,u.material.uniforms.flipEnvMap.value=S.isCubeTexture&&S.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=x.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=x.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(wR.makeRotationFromEuler(Ur)),u.material.toneMapped=ue.getTransfer(S.colorSpace)!==Be,f!==S||h!==S.version||p!==t.toneMapping)u.material.needsUpdate=!0,f=S,h=S.version,p=t.toneMapping;u.layers.enableAll(),m.unshift(u,u.geometry,u.material,0,0,null)}else if(S&&S.isTexture){if(c===void 0)c=new At(new qn(2,2),new Zi({name:"BackgroundMaterial",uniforms:fr(is.background.uniforms),vertexShader:is.background.vertexShader,fragmentShader:is.background.fragmentShader,side:zo,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(c);if(c.material.uniforms.t2D.value=S,c.material.uniforms.backgroundIntensity.value=x.backgroundIntensity,c.material.toneMapped=ue.getTransfer(S.colorSpace)!==Be,S.matrixAutoUpdate===!0)S.updateMatrix();if(c.material.uniforms.uvTransform.value.copy(S.matrix),f!==S||h!==S.version||p!==t.toneMapping)c.material.needsUpdate=!0,f=S,h=S.version,p=t.toneMapping;c.layers.enableAll(),m.unshift(c,c.geometry,c.material,0,0,null)}}function d(m,x){m.getRGB($f,EU(t)),i.buffers.color.setClear($f.r,$f.g,$f.b,x,r)}function g(){if(u!==void 0)u.geometry.dispose(),u.material.dispose(),u=void 0;if(c!==void 0)c.geometry.dispose(),c.material.dispose(),c=void 0}return{getClearColor:function(){return o},setClearColor:function(m,x=1){o.set(m),l=x,d(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(m){l=m,d(o,l)},render:y,addToRenderList:U,dispose:g}}function DR(t,e){let n=t.getParameter(t.MAX_VERTEX_ATTRIBS),i={},s=h(null),a=s,r=!1;function o(M,R,O,V,k){let et=!1,Z=f(V,O,R);if(a!==Z)a=Z,c(a.object);if(et=p(M,V,O,k),et)v(M,V,O,k);if(k!==null)e.update(k,t.ELEMENT_ARRAY_BUFFER);if(et||r){if(r=!1,x(M,R,O,V),k!==null)t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e.get(k).buffer)}}function l(){return t.createVertexArray()}function c(M){return t.bindVertexArray(M)}function u(M){return t.deleteVertexArray(M)}function f(M,R,O){let V=O.wireframe===!0,k=i[M.id];if(k===void 0)k={},i[M.id]=k;let et=k[R.id];if(et===void 0)et={},k[R.id]=et;let Z=et[V];if(Z===void 0)Z=h(l()),et[V]=Z;return Z}function h(M){let R=[],O=[],V=[];for(let k=0;k<n;k++)R[k]=0,O[k]=0,V[k]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:R,enabledAttributes:O,attributeDivisors:V,object:M,attributes:{},index:null}}function p(M,R,O,V){let k=a.attributes,et=R.attributes,Z=0,at=O.getAttributes();for(let W in at)if(at[W].location>=0){let mt=k[W],q=et[W];if(q===void 0){if(W==="instanceMatrix"&&M.instanceMatrix)q=M.instanceMatrix;if(W==="instanceColor"&&M.instanceColor)q=M.instanceColor}if(mt===void 0)return!0;if(mt.attribute!==q)return!0;if(q&&mt.data!==q.data)return!0;Z++}if(a.attributesNum!==Z)return!0;if(a.index!==V)return!0;return!1}function v(M,R,O,V){let k={},et=R.attributes,Z=0,at=O.getAttributes();for(let W in at)if(at[W].location>=0){let mt=et[W];if(mt===void 0){if(W==="instanceMatrix"&&M.instanceMatrix)mt=M.instanceMatrix;if(W==="instanceColor"&&M.instanceColor)mt=M.instanceColor}let q={};if(q.attribute=mt,mt&&mt.data)q.data=mt.data;k[W]=q,Z++}a.attributes=k,a.attributesNum=Z,a.index=V}function y(){let M=a.newAttributes;for(let R=0,O=M.length;R<O;R++)M[R]=0}function U(M){d(M,0)}function d(M,R){let O=a.newAttributes,V=a.enabledAttributes,k=a.attri