mirror of
https://github.com/exogen/t2-mapper.git
synced 2026-01-19 12:14:47 +00:00
1 line
20 KiB
JavaScript
1 line
20 KiB
JavaScript
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,47071,80520,e=>{"use strict";e.s(["useTexture",()=>a],47071);var t=e.i(71645),n=e.i(90072),r=e.i(16096);e.s(["useLoader",()=>i.G],80520);var i=e.i(46712),i=i;let o=e=>e===Object(e)&&!Array.isArray(e)&&"function"!=typeof e;function a(e,a){let l=(0,r.useThree)(e=>e.gl),s=(0,i.G)(n.TextureLoader,o(e)?Object.values(e):e);return(0,t.useLayoutEffect)(()=>{null==a||a(s)},[a]),(0,t.useEffect)(()=>{if("initTexture"in l){let e=[];Array.isArray(s)?e=s:s instanceof n.Texture?e=[s]:o(s)&&(e=Object.values(s)),e.forEach(e=>{e instanceof n.Texture&&l.initTexture(e)})}},[l,s]),(0,t.useMemo)(()=>{if(!o(e))return s;{let t={},n=0;for(let r in e)t[r]=s[n++];return t}},[e,s])}a.preload=e=>i.G.preload(n.TextureLoader,e),a.clear=e=>i.G.clear(n.TextureLoader,e)},6112,51475,77482,e=>{"use strict";e.s(["useDatablock",()=>u],6112),e.s(["RuntimeProvider",()=>s,"useRuntime",()=>c],77482);var t=e.i(43476),n=e.i(71645);e.s(["TickProvider",()=>o,"useTick",()=>a],51475);var r=e.i(5230);let i=(0,n.createContext)(null);function o(e){let{children:o}=e,a=(0,n.useRef)(void 0),l=(0,n.useRef)(0),s=(0,n.useRef)(0);(0,r.useFrame)((e,t)=>{for(l.current+=t;l.current>=.03125;)if(l.current-=.03125,s.current++,a.current)for(let e of a.current)e(s.current)});let c=(0,n.useCallback)(e=>(null!=a.current||(a.current=new Set),a.current.add(e),()=>{a.current.delete(e)}),[]),u=(0,n.useCallback)(()=>s.current,[]),f=(0,n.useMemo)(()=>({subscribe:c,getTick:u}),[c,u]);return(0,t.jsx)(i.Provider,{value:f,children:o})}function a(e){let t=(0,n.useContext)(i);if(!t)throw Error("useTick must be used within a TickProvider");let r=(0,n.useRef)(e);r.current=e,(0,n.useEffect)(()=>t.subscribe(e=>r.current(e)),[t])}let l=(0,n.createContext)(null);function s(e){let{runtime:n,children:r}=e;return(0,t.jsx)(l.Provider,{value:n,children:(0,t.jsx)(o,{children:r})})}function c(){let e=(0,n.useContext)(l);if(!e)throw Error("useRuntime must be used within a RuntimeProvider");return e}function u(e){let t=c();if(e)return t.state.datablocks.get(e)}},31067,e=>{"use strict";function t(){return(t=Object.assign.bind()).apply(null,arguments)}e.s(["default",()=>t])},75567,e=>{"use strict";e.s(["setupAlphaTestedTexture",()=>i,"setupColor",()=>r,"setupMask",()=>o]);var t=e.i(90072);function n(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{repeat:r=[1,1],disableMipmaps:i=!1}=n;return e.wrapS=e.wrapT=t.RepeatWrapping,e.colorSpace=t.SRGBColorSpace,e.repeat.set(...r),e.flipY=!1,e.anisotropy=16,i?(e.generateMipmaps=!1,e.minFilter=t.LinearFilter):(e.generateMipmaps=!0,e.minFilter=t.LinearMipmapLinearFilter),e.magFilter=t.LinearFilter,e.needsUpdate=!0,e}function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[1,1];return n(e,{repeat:t})}function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[1,1];return n(e,{repeat:t,disableMipmaps:!0})}function o(e){let n=new t.DataTexture(e,256,256,t.RedFormat,t.UnsignedByteType);return n.colorSpace=t.NoColorSpace,n.wrapS=n.wrapT=t.RepeatWrapping,n.generateMipmaps=!1,n.minFilter=t.LinearFilter,n.magFilter=t.LinearFilter,n.needsUpdate=!0,n}},47021,e=>{"use strict";e.s(["fogFragmentShader",()=>n,"injectCustomFog",()=>i,"installCustomFogShader",()=>r]);var t=e.i(8560);let n="\n#ifdef USE_FOG\n // Check fog enabled uniform - allows toggling without shader recompilation\n #ifdef USE_VOLUMETRIC_FOG\n if (!fogEnabled) {\n // Skip all fog calculations when disabled\n } else {\n #endif\n\n float dist = vFogDepth;\n\n // Discard fragments at or beyond visible distance - matches Torque's behavior\n // where objects beyond visibleDistance are not rendered at all.\n // This prevents fully-fogged geometry from showing as silhouettes against\n // the sky's fog-to-sky gradient.\n if (dist >= fogFar) {\n discard;\n }\n\n // Step 1: Calculate distance-based haze (quadratic falloff)\n // Since we discard at fogFar, haze never reaches 1.0 here\n float haze = 0.0;\n if (dist > fogNear) {\n float fogScale = 1.0 / (fogFar - fogNear);\n float distFactor = (dist - fogNear) * fogScale - 1.0;\n haze = 1.0 - distFactor * distFactor;\n }\n\n // Step 2: Calculate fog volume contributions\n // Note: Per-volume colors are NOT used in Tribes 2 ($specialFog defaults to false)\n // All fog uses the global fogColor - see Tribes2_Fog_System.md for details\n float volumeFog = 0.0;\n\n #ifdef USE_VOLUMETRIC_FOG\n {\n #ifdef USE_FOG_WORLD_POSITION\n float fragmentHeight = vFogWorldPosition.y;\n #else\n float fragmentHeight = cameraHeight;\n #endif\n\n float deltaY = fragmentHeight - cameraHeight;\n float absDeltaY = abs(deltaY);\n\n // Determine if we're going up (positive) or down (negative)\n if (absDeltaY > 0.01) {\n // Non-horizontal ray: ray-march through fog volumes\n for (int i = 0; i < 3; i++) {\n int offset = i * 4;\n float volVisDist = fogVolumeData[offset + 0];\n float volMinH = fogVolumeData[offset + 1];\n float volMaxH = fogVolumeData[offset + 2];\n float volPct = fogVolumeData[offset + 3];\n\n // Skip inactive volumes (visibleDistance = 0)\n if (volVisDist <= 0.0) continue;\n\n // Calculate fog factor for this volume\n // From Torque: factor = (1 / (volumeVisDist * visFactor)) * percentage\n // where visFactor is smVisibleDistanceMod (a user quality pref, default 1.0)\n // Since we don't have quality settings, we use visFactor = 1.0\n float factor = (1.0 / volVisDist) * volPct;\n\n // Find ray intersection with this volume's height range\n float rayMinY = min(cameraHeight, fragmentHeight);\n float rayMaxY = max(cameraHeight, fragmentHeight);\n\n // Check if ray intersects volume height range\n if (rayMinY < volMaxH && rayMaxY > volMinH) {\n float intersectMin = max(rayMinY, volMinH);\n float intersectMax = min(rayMaxY, volMaxH);\n float intersectHeight = intersectMax - intersectMin;\n\n // Calculate distance traveled through this volume using similar triangles:\n // subDist / dist = intersectHeight / absDeltaY\n float subDist = dist * (intersectHeight / absDeltaY);\n\n // Accumulate fog: fog += subDist * factor\n volumeFog += subDist * factor;\n }\n }\n } else {\n // Near-horizontal ray: if camera is inside a volume, apply full fog for that volume\n for (int i = 0; i < 3; i++) {\n int offset = i * 4;\n float volVisDist = fogVolumeData[offset + 0];\n float volMinH = fogVolumeData[offset + 1];\n float volMaxH = fogVolumeData[offset + 2];\n float volPct = fogVolumeData[offset + 3];\n\n if (volVisDist <= 0.0) continue;\n\n // If camera is inside this volume, apply fog for full distance\n if (cameraHeight >= volMinH && cameraHeight <= volMaxH) {\n float factor = (1.0 / volVisDist) * volPct;\n volumeFog += dist * factor;\n }\n }\n }\n }\n #endif\n\n // Step 3: Combine haze and volume fog\n // Torque's clamping: if (bandPct + hazePct > 1) hazePct = 1 - bandPct\n // This gives fog volumes priority over haze\n float volPct = min(volumeFog, 1.0);\n float hazePct = haze;\n if (volPct + hazePct > 1.0) {\n hazePct = 1.0 - volPct;\n }\n float fogFactor = hazePct + volPct;\n\n // Apply fog using global fogColor (per-volume colors not used in Tribes 2)\n gl_FragColor.rgb = mix(gl_FragColor.rgb, fogColor, fogFactor);\n\n #ifdef USE_VOLUMETRIC_FOG\n } // end fogEnabled check\n #endif\n#endif\n";function r(){t.ShaderChunk.fog_pars_fragment="\n#ifdef USE_FOG\n uniform vec3 fogColor;\n varying float vFogDepth;\n #ifdef FOG_EXP2\n uniform float fogDensity;\n #else\n uniform float fogNear;\n uniform float fogFar;\n #endif\n\n // Custom volumetric fog uniforms (only defined when USE_VOLUMETRIC_FOG is set)\n // Format: [visDist, minH, maxH, percentage] x 3 volumes = 12 floats\n #ifdef USE_VOLUMETRIC_FOG\n uniform float fogVolumeData[12];\n uniform float cameraHeight;\n #endif\n\n #ifdef USE_FOG_WORLD_POSITION\n varying vec3 vFogWorldPosition;\n #endif\n#endif\n",t.ShaderChunk.fog_fragment=n,t.ShaderChunk.fog_pars_vertex="\n#ifdef USE_FOG\n varying float vFogDepth;\n #ifdef USE_FOG_WORLD_POSITION\n varying vec3 vFogWorldPosition;\n #endif\n#endif\n",t.ShaderChunk.fog_vertex="\n#ifdef USE_FOG\n // Use Euclidean distance from camera, not view-space z-depth\n // This ensures fog doesn't change when rotating the camera\n vFogDepth = length(mvPosition.xyz);\n #ifdef USE_FOG_WORLD_POSITION\n vFogWorldPosition = (modelMatrix * vec4(transformed, 1.0)).xyz;\n #endif\n#endif\n"}function i(e,t){e.uniforms.fogVolumeData=t.fogVolumeData,e.uniforms.cameraHeight=t.cameraHeight,e.uniforms.fogEnabled=t.fogEnabled,e.vertexShader=e.vertexShader.replace("#include <fog_pars_vertex>","#include <fog_pars_vertex>\n#ifdef USE_FOG\n #define USE_FOG_WORLD_POSITION\n #define USE_VOLUMETRIC_FOG\n varying vec3 vFogWorldPosition;\n#endif"),e.vertexShader=e.vertexShader.replace("#include <fog_vertex>","#include <fog_vertex>\n#ifdef USE_FOG\n vFogWorldPosition = (modelMatrix * vec4(transformed, 1.0)).xyz;\n#endif"),e.fragmentShader=e.fragmentShader.replace("#include <fog_pars_fragment>","#include <fog_pars_fragment>\n#ifdef USE_FOG\n #define USE_VOLUMETRIC_FOG\n uniform float fogVolumeData[12];\n uniform float cameraHeight;\n uniform bool fogEnabled;\n #define USE_FOG_WORLD_POSITION\n varying vec3 vFogWorldPosition;\n#endif"),e.fragmentShader=e.fragmentShader.replace("#include <fog_fragment>",n)}},48066,e=>{"use strict";e.s(["globalFogUniforms",()=>t,"packFogVolumeData",()=>i,"resetGlobalFogUniforms",()=>r,"updateGlobalFogUniforms",()=>n]);let t={fogVolumeData:{value:new Float32Array(12)},cameraHeight:{value:0},fogEnabled:{value:!0}};function n(e,n){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];t.cameraHeight.value=e,t.fogVolumeData.value.set(n),t.fogEnabled.value=r}function r(){t.cameraHeight.value=0,t.fogVolumeData.value.fill(0),t.fogEnabled.value=!0}function i(e){let t=new Float32Array(12);for(let n=0;n<3;n++){let r=4*n,i=e[n];i&&(t[r+0]=i.visibleDistance,t[r+1]=i.minHeight,t[r+2]=i.maxHeight,t[r+3]=i.percentage)}return t}},89887,60099,e=>{"use strict";let t,n;e.s(["FloatingLabel",()=>b],89887);var r=e.i(43476),i=e.i(71645),o=e.i(5230),a=e.i(16096),l=e.i(90072);e.s(["Html",()=>y],60099);var s=e.i(31067),c=e.i(88014);let u=new l.Vector3,f=new l.Vector3,d=new l.Vector3,m=new l.Vector2;function g(e,t,n){let r=u.setFromMatrixPosition(e.matrixWorld);r.project(t);let i=n.width/2,o=n.height/2;return[r.x*i+i,-(r.y*o)+o]}let h=e=>1e-10>Math.abs(e)?0:e;function v(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r="matrix3d(";for(let n=0;16!==n;n++)r+=h(t[n]*e.elements[n])+(15!==n?",":")");return n+r}let p=(t=[1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1],e=>v(e,t)),x=(n=e=>[1/e,1/e,1/e,1,-1/e,-1/e,-1/e,-1,1/e,1/e,1/e,1,1,1,1,1],(e,t)=>v(e,n(t),"translate(-50%,-50%)")),y=i.forwardRef((e,t)=>{let{children:n,eps:r=.001,style:v,className:y,prepend:F,center:b,fullscreen:S,portal:M,distanceFactor:P,sprite:E=!1,transform:_=!1,occlude:T,onOcclude:w,castShadow:O,receiveShadow:D,material:C,geometry:R,zIndexRange:H=[0x1000037,0],calculatePosition:V=g,as:W="div",wrapperClass:L,pointerEvents:U="auto",...z}=e,{gl:k,camera:G,scene:I,size:A,raycaster:j,events:N,viewport:Y}=(0,a.useThree)(),[q]=i.useState(()=>document.createElement(W)),B=i.useRef(null),K=i.useRef(null),X=i.useRef(0),Z=i.useRef([0,0]),$=i.useRef(null),J=i.useRef(null),Q=(null==M?void 0:M.current)||N.connected||k.domElement.parentNode,ee=i.useRef(null),et=i.useRef(!1),en=i.useMemo(()=>T&&"blending"!==T||Array.isArray(T)&&T.length&&function(e){return e&&"object"==typeof e&&"current"in e}(T[0]),[T]);i.useLayoutEffect(()=>{let e=k.domElement;T&&"blending"===T?(e.style.zIndex="".concat(Math.floor(H[0]/2)),e.style.position="absolute",e.style.pointerEvents="none"):(e.style.zIndex=null,e.style.position=null,e.style.pointerEvents=null)},[T]),i.useLayoutEffect(()=>{if(K.current){let e=B.current=c.createRoot(q);if(I.updateMatrixWorld(),_)q.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{let e=V(K.current,G,A);q.style.cssText="position:absolute;top:0;left:0;transform:translate3d(".concat(e[0],"px,").concat(e[1],"px,0);transform-origin:0 0;")}return Q&&(F?Q.prepend(q):Q.appendChild(q)),()=>{Q&&Q.removeChild(q),e.unmount()}}},[Q,_]),i.useLayoutEffect(()=>{L&&(q.className=L)},[L]);let er=i.useMemo(()=>_?{position:"absolute",top:0,left:0,width:A.width,height:A.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:b?"translate3d(-50%,-50%,0)":"none",...S&&{top:-A.height/2,left:-A.width/2,width:A.width,height:A.height},...v},[v,b,S,A,_]),ei=i.useMemo(()=>({position:"absolute",pointerEvents:U}),[U]);i.useLayoutEffect(()=>{var e,r;et.current=!1,_?null==(e=B.current)||e.render(i.createElement("div",{ref:$,style:er},i.createElement("div",{ref:J,style:ei},i.createElement("div",{ref:t,className:y,style:v,children:n})))):null==(r=B.current)||r.render(i.createElement("div",{ref:t,style:er,className:y,children:n}))});let eo=i.useRef(!0);(0,o.useFrame)(e=>{if(K.current){G.updateMatrixWorld(),K.current.updateWorldMatrix(!0,!1);let e=_?Z.current:V(K.current,G,A);if(_||Math.abs(X.current-G.zoom)>r||Math.abs(Z.current[0]-e[0])>r||Math.abs(Z.current[1]-e[1])>r){let t=function(e,t){let n=u.setFromMatrixPosition(e.matrixWorld),r=f.setFromMatrixPosition(t.matrixWorld),i=n.sub(r),o=t.getWorldDirection(d);return i.angleTo(o)>Math.PI/2}(K.current,G),n=!1;en&&(Array.isArray(T)?n=T.map(e=>e.current):"blending"!==T&&(n=[I]));let r=eo.current;n?eo.current=function(e,t,n,r){let i=u.setFromMatrixPosition(e.matrixWorld),o=i.clone();o.project(t),m.set(o.x,o.y),n.setFromCamera(m,t);let a=n.intersectObjects(r,!0);if(a.length){let e=a[0].distance;return i.distanceTo(n.ray.origin)<e}return!0}(K.current,G,j,n)&&!t:eo.current=!t,r!==eo.current&&(w?w(!eo.current):q.style.display=eo.current?"block":"none");let i=Math.floor(H[0]/2),o=T?en?[H[0],i]:[i-1,0]:H;if(q.style.zIndex="".concat(function(e,t,n){if(t instanceof l.PerspectiveCamera||t instanceof l.OrthographicCamera){let r=u.setFromMatrixPosition(e.matrixWorld),i=f.setFromMatrixPosition(t.matrixWorld),o=r.distanceTo(i),a=(n[1]-n[0])/(t.far-t.near),l=n[1]-a*t.far;return Math.round(a*o+l)}}(K.current,G,o)),_){let[e,t]=[A.width/2,A.height/2],n=G.projectionMatrix.elements[5]*t,{isOrthographicCamera:r,top:i,left:o,bottom:a,right:l}=G,s=p(G.matrixWorldInverse),c=r?"scale(".concat(n,")translate(").concat(h(-(l+o)/2),"px,").concat(h((i+a)/2),"px)"):"translateZ(".concat(n,"px)"),u=K.current.matrixWorld;E&&((u=G.matrixWorldInverse.clone().transpose().copyPosition(u).scale(K.current.scale)).elements[3]=u.elements[7]=u.elements[11]=0,u.elements[15]=1),q.style.width=A.width+"px",q.style.height=A.height+"px",q.style.perspective=r?"":"".concat(n,"px"),$.current&&J.current&&($.current.style.transform="".concat(c).concat(s,"translate(").concat(e,"px,").concat(t,"px)"),J.current.style.transform=x(u,1/((P||10)/400)))}else{let t=void 0===P?1:function(e,t){if(t instanceof l.OrthographicCamera)return t.zoom;if(!(t instanceof l.PerspectiveCamera))return 1;{let n=u.setFromMatrixPosition(e.matrixWorld),r=f.setFromMatrixPosition(t.matrixWorld);return 1/(2*Math.tan(t.fov*Math.PI/180/2)*n.distanceTo(r))}}(K.current,G)*P;q.style.transform="translate3d(".concat(e[0],"px,").concat(e[1],"px,0) scale(").concat(t,")")}Z.current=e,X.current=G.zoom}}if(!en&&ee.current&&!et.current)if(_){if($.current){let e=$.current.children[0];if(null!=e&&e.clientWidth&&null!=e&&e.clientHeight){let{isOrthographicCamera:t}=G;if(t||R)z.scale&&(Array.isArray(z.scale)?z.scale instanceof l.Vector3?ee.current.scale.copy(z.scale.clone().divideScalar(1)):ee.current.scale.set(1/z.scale[0],1/z.scale[1],1/z.scale[2]):ee.current.scale.setScalar(1/z.scale));else{let t=(P||10)/400,n=e.clientWidth*t,r=e.clientHeight*t;ee.current.scale.set(n,r,1)}et.current=!0}}}else{let t=q.children[0];if(null!=t&&t.clientWidth&&null!=t&&t.clientHeight){let e=1/Y.factor,n=t.clientWidth*e,r=t.clientHeight*e;ee.current.scale.set(n,r,1),et.current=!0}ee.current.lookAt(e.camera.position)}});let ea=i.useMemo(()=>({vertexShader:_?void 0:'\n /*\n This shader is from the THREE\'s SpriteMaterial.\n We need to turn the backing plane into a Sprite\n (make it always face the camera) if "transfrom"\n is false.\n */\n #include <common>\n\n void main() {\n vec2 center = vec2(0., 1.);\n float rotation = 0.0;\n\n // This is somewhat arbitrary, but it seems to work well\n // Need to figure out how to derive this dynamically if it even matters\n float size = 0.03;\n\n vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n vec2 scale;\n scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\n bool isPerspective = isPerspectiveMatrix( projectionMatrix );\n if ( isPerspective ) scale *= - mvPosition.z;\n\n vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale * size;\n vec2 rotatedPosition;\n rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n mvPosition.xy += rotatedPosition;\n\n gl_Position = projectionMatrix * mvPosition;\n }\n ',fragmentShader:"\n void main() {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\n }\n "}),[_]);return i.createElement("group",(0,s.default)({},z,{ref:K}),T&&!en&&i.createElement("mesh",{castShadow:O,receiveShadow:D,ref:ee},R||i.createElement("planeGeometry",null),C||i.createElement("shaderMaterial",{side:l.DoubleSide,vertexShader:ea.vertexShader,fragmentShader:ea.fragmentShader})))}),F=[0,0,0],b=(0,i.memo)(function(e){let{children:t,color:n="white",position:s=F,opacity:c="fadeWithDistance"}=e,u="fadeWithDistance"===c,f=(0,i.useRef)(null),d=function(e){let{camera:t}=(0,a.useThree)(),n=(0,i.useRef)(null),r=function(e){let t=(0,i.useRef)(null);return(0,o.useFrame)(()=>{e.current&&(null!=t.current||(t.current=new l.Vector3),e.current.getWorldPosition(t.current))}),t}(e);return(0,o.useFrame)(()=>{r.current?n.current=t.position.distanceTo(r.current):n.current=null}),n}(f),[m,g]=(0,i.useState)(0!==c),h=(0,i.useRef)(null);return(0,i.useEffect)(()=>{if(u&&h.current&&null!=d.current){let e=Math.max(0,Math.min(1,1-d.current/200));h.current.style.opacity=e.toString()}},[m,u]),(0,o.useFrame)(()=>{if(u){let e=d.current,t=null!=e&&e<200;if(m!==t&&g(t),h.current&&t){let t=Math.max(0,Math.min(1,1-e/200));h.current.style.opacity=t.toString()}}else g(0!==c),h.current&&(h.current.style.opacity=c.toString())}),(0,r.jsx)("group",{ref:f,children:m?(0,r.jsx)(y,{position:s,center:!0,children:(0,r.jsx)("div",{ref:h,className:"StaticShapeLabel",style:{color:n},children:t})}):null})})},51434,e=>{"use strict";e.s(["AudioProvider",()=>a,"useAudio",()=>l]);var t=e.i(43476),n=e.i(71645),r=e.i(16096),i=e.i(90072);let o=(0,n.createContext)(void 0);function a(e){let{children:a}=e,{camera:l}=(0,r.useThree)(),[s,c]=(0,n.useState)({audioLoader:null,audioListener:null});return(0,n.useEffect)(()=>{let e=new i.AudioLoader,t=l.children.find(e=>e instanceof i.AudioListener);t||(t=new i.AudioListener,l.add(t)),c({audioLoader:e,audioListener:t})},[l]),(0,t.jsx)(o.Provider,{value:s,children:a})}function l(){let e=(0,n.useContext)(o);if(void 0===e)throw Error("useAudio must be used within AudioProvider");return e}},61921,e=>{e.v(t=>Promise.all(["static/chunks/5342f4b5b8c465ca.js"].map(t=>e.l(t))).then(()=>t(29055)))},25147,e=>{e.v(t=>Promise.all(["static/chunks/40a2f59d0c05dc35.js"].map(t=>e.l(t))).then(()=>t(63724)))},18599,e=>{e.v(t=>Promise.all(["static/chunks/440c894c0d872ba4.js"].map(t=>e.l(t))).then(()=>t(42585)))}]); |