1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3679],{3679:function(e,t,n){n.d(t,{default:function(){return s}});var a=n(7437),o=n(2265),r=n(1448),i=n(2691);function l(e,t,n,a){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=(90-e)*Math.PI/180,i=(t+180)*Math.PI/180,l=Math.sin(r),u=null!=a?a:new Float32Array(3);return u[o]=-n*l*Math.cos(i),u[o+1]=n*Math.cos(r),u[o+2]=n*l*Math.sin(i),u}function u(e,t){let n=374761393*e+668265263*t|0;return(((n=Math.imul(n^n>>>13,1274126177))^n>>>16)>>>0)/4294967296}function s(e){let{points:t,zoom:n=!1,autoRotate:s=!0,className:v=""}=e,d=(0,o.useRef)(null),[c,m]=(0,o.useState)(!1);return(0,o.useEffect)(()=>{let e;let a=d.current;if(!a)return;try{e=new r.CP7({antialias:!0,alpha:!0,powerPreference:"high-performance"})}catch(e){m(!0);return}let o=window.matchMedia("(prefers-reduced-motion: reduce)").matches,v=window.matchMedia("(max-width: 640px)").matches;e.setPixelRatio(Math.min(window.devicePixelRatio,2)),e.setClearColor(0,0),a.appendChild(e.domElement),e.domElement.style.touchAction=n?"none":"pan-y",e.domElement.setAttribute("role","img"),e.domElement.setAttribute("aria-label","A globe showing where Carpooling with Jesus listeners are, in all 50 states and around the world. Drag to turn it.");let c=new r.xsS,h=new r.cPb(38,1,.1,50);h.position.set(0,.35,3.15);let f=new i.z(h,e.domElement);f.enablePan=!1,f.enableZoom=n,f.enableDamping=!0,f.dampingFactor=.08,f.rotateSpeed=.55,f.zoomSpeed=.6,f.minDistance=1.55,f.maxDistance=4.6,f.autoRotate=s&&!o,f.autoRotateSpeed=.28,f.touches={ONE:r.QmN.ROTATE,TWO:n?r.QmN.DOLLY_ROTATE:r.QmN.ROTATE};let w=v?2048:4096,p=null,g=!1,x=new r.dpR().load("/globe/terrain-".concat(w,".png"),e=>{let t=e.image,n=document.createElement("canvas");n.width=1024,n.height=512;let a=n.getContext("2d",{willReadFrequently:!0});a&&(a.drawImage(t,0,0,1024,512),p={data:a.getImageData(0,0,1024,512).data,w:1024,h:512}),g=!0,W()},void 0,()=>m(!0));x.colorSpace=r.aCh,x.minFilter=r.D1R,x.magFilter=r.wem,x.anisotropy=Math.min(8,e.capabilities.getMaxAnisotropy());let y=new r.jyz({vertexShader:"\nuniform sampler2D uTerrain;\nuniform float uRelief;\nvarying vec2 vUv;\nvarying vec3 vNormalW;\nvarying vec3 vPosW;\nvoid main() {\n vUv = uv;\n float h = texture2D(uTerrain, uv).r;\n // Mountains rise a little. Subtle on purpose: the picture is a planet, not a\n // relief model, and the dots must stay visible over the Himalaya.\n vec3 p = position + normal * (h * uRelief);\n vec4 wp = modelMatrix * vec4(p, 1.0);\n vPosW = wp.xyz;\n vNormalW = normalize(mat3(modelMatrix) * normal);\n gl_Position = projectionMatrix * viewMatrix * wp;\n}\n",fragmentShader:"\nprecision highp float;\nuniform sampler2D uTerrain;\nuniform vec2 uTexel;\nuniform vec3 uLightDir;\nuniform vec3 uOcean;\nuniform vec3 uLandLow;\nuniform vec3 uLandHigh;\nuniform vec3 uCoast;\nuniform vec3 uRim;\nuniform float uRelief;\nvarying vec2 vUv;\nvarying vec3 vNormalW;\nvarying vec3 vPosW;\n\nvoid main() {\n vec4 t = texture2D(uTerrain, vUv);\n float h = t.r;\n float land = t.g;\n\n // Relief lighting from the height field: slope east-west and north-south.\n float hx = texture2D(uTerrain, vUv + vec2(uTexel.x, 0.0)).r - texture2D(uTerrain, vUv - vec2(uTexel.x, 0.0)).r;\n float hy = texture2D(uTerrain, vUv + vec2(0.0, uTexel.y)).r - texture2D(uTerrain, vUv - vec2(0.0, uTexel.y)).r;\n // Tangent frame on the sphere: east and north in world space.\n vec3 N = normalize(vNormalW);\n vec3 up = vec3(0.0, 1.0, 0.0);\n vec3 east = normalize(cross(up, N) + vec3(1e-5));\n vec3 north = normalize(cross(N, east));\n float bump = 9.0 * land;\n vec3 Nr = normalize(N - east * hx * bump + north * hy * bump);\n\n // Coast: land next to sea within a texel or two.\n float around = 0.0;\n around += texture2D(uTerrain, vUv + vec2( uTexel.x, 0.0)).g;\n around += texture2D(uTerrain, vUv + vec2(-uTexel.x, 0.0)).g;\n around += texture2D(uTerrain, vUv + vec2(0.0, uTexel.y)).g;\n around += texture2D(uTerrain, vUv + vec2(0.0, -uTexel.y)).g;\n float coast = land * (1.0 - smoothstep(0.0, 0.6, around * 0.25)) + (1.0 - land) * smoothstep(0.0, 0.5, around * 0.25) * 0.6;\n\n vec3 landColor = mix(uLandLow, uLandHigh, pow(h, 0.65));\n vec3 base = mix(uOcean, landColor, land);\n base = mix(base, uCoast, coast * 0.75);\n\n vec3 L = normalize(uLightDir);\n float diff = max(dot(Nr, L), 0.0);
1\n float wrap = max(dot(N, L) * 0.5 + 0.5, 0.0);\n vec3 V = normalize(cameraPosition - vPosW);\n float rim = pow(1.0 - max(dot(N, V), 0.0), 3.0);\n float spec = pow(max(dot(reflect(-L, N), V), 0.0), 24.0) * (1.0 - land) * 0.12;\n\n vec3 color = base * (0.5 + 0.5 * diff) * (0.7 + 0.3 * wrap);\n color += uRim * rim * 0.35;\n color += vec3(spec);\n gl_FragColor = vec4(color, 1.0);\n}\n",uniforms:{uTerrain:{value:x},uTexel:{value:new r.FM8(1/w,2/w)},uLightDir:{value:new r.Pa4(-.6,.5,.9).normalize()},uOcean:{value:new r.Ilk(659236)},uLandLow:{value:new r.Ilk(2772920)},uLandHigh:{value:new r.Ilk(10466036)},uCoast:{value:new r.Ilk(9150186)},uRim:{value:new r.Ilk(3831510)},uRelief:{value:.03}}});c.add(new r.Kj0(new r.xo$(1,v?160:256,v?80:128),y)),c.add(new r.Kj0(new r.xo$(1.045,96,48),new r.jyz({vertexShader:"\nvarying vec3 vNormalW;\nvarying vec3 vPosW;\nvoid main() {\n vec4 wp = modelMatrix * vec4(position, 1.0);\n vPosW = wp.xyz;\n vNormalW = normalize(mat3(modelMatrix) * normal);\n gl_Position = projectionMatrix * viewMatrix * wp;\n}\n",fragmentShader:"\nprecision highp float;\nuniform vec3 uColor;\nvarying vec3 vNormalW;\nvarying vec3 vPosW;\nvoid main() {\n vec3 V = normalize(cameraPosition - vPosW);\n // Seen from outside on a back-facing shell, the edge is where the normal\n // turns away from the camera. Thin and quiet, not a halo.\n float edge = pow(1.0 - abs(dot(normalize(vNormalW), V)), 4.0);\n gl_FragColor = vec4(uColor, edge * 0.55);\n}\n",uniforms:{uColor:{value:new r.Ilk(3831510)}},transparent:!0,depthWrite:!1,side:r._Li,blending:r.WMw})));let b=(e,t)=>{if(!p)return 0;let[n,a]=[(t+180)/360,(90-e)/180],o=Math.min(p.w-1,Math.max(0,Math.round(n*p.w))),r=Math.min(p.h-1,Math.max(0,Math.round(a*p.h)));return p.data[(r*p.w+o)*4]/255};fetch("/globe/borders.json").then(e=>e.json()).then(e=>{let t=(e,t,n)=>{let a=[],o=new Float32Array(3);for(let t of e)for(let e=0;e<t.length-1;e++)for(let[n,r]of[t[e],t[e+1]])l(n,r,1.004+.03*b(n,r),o),a.push(o[0],o[1],o[2]);let i=new r.u9r;i.setAttribute("position",new r.a$l(a,3)),c.add(new r.ejS(i,new r.nls({color:t,transparent:!0,opacity:n,depthWrite:!1})))};t(e.countries,11451634,.22),t(e.states,12898293,.3)}).catch(()=>{});let M=t.length,T=new r.u9r,R=new Float32Array(3*M),S=new Float32Array(3*M),A=new Float32Array(M),D=new Float32Array(M),z=new Float32Array(M);T.setAttribute("position",new r.TlE(R,3)),T.setAttribute("aStart",new r.TlE(S,3)),T.setAttribute("aDelay",new r.TlE(A,1)),T.setAttribute("aDuration",new r.TlE(D,1)),T.setAttribute("aSize",new r.TlE(z,1)),T.setDrawRange(0,0);let P=new r.jyz({vertexShader:"\nattribute vec3 aStart;\nattribute float aDelay;\nattribute float aDuration;\nattribute float aSize;\nuniform float uTime;\nuniform float uLeaving; // 0 arriving, 1 leaving\nuniform float uSize;\nuniform float uPixelRatio;\nvarying float vAlpha;\nvarying float vGlow;\n\nvoid main() {\n float t = clamp((uTime - aDelay) / aDuration, 0.0, 1.0);\n float e;\n vec3 p;\n if (uLeaving < 0.5) {\n // Fast out of the dark, then a controlled deceleration to a soft landing.\n e = 1.0 - pow(1.0 - t, 3.0);\n // A slight outward arc so the approach reads as a curve, not a rail.\n float arc = sin(t * 3.14159) * 0.22 * (1.0 - t);\n p = mix(aStart, position, e) + normalize(position) * arc;\n vAlpha = smoothstep(0.0, 0.15, t);\n vGlow = 1.0 - e;\n } else {\n // Leaving: ease in, lift off and thin out.\n e = t * t;\n p = mix(position, aStart, e);\n vAlpha = 1.0 - smoothstep(0.2, 1.0, t);\n vGlow = e;\n }\n vec4 mv = modelViewMatrix * vec4(p, 1.0);\n gl_Position = projectionMatrix * mv;\n gl_PointSize = uSize * aSize * uPixelRatio * (1.0 + 0.8 * vGlow) * (2.4 / -mv.z);\n}\n",fragmentShader:"\nprecision highp float;\nuniform vec3 uColor;\nvarying float vAlpha;\nvarying float vGlow;\nvoid main() {\n vec2 c = gl_PointCoord - 0.5;\n float d = length(c);\n if (d > 0.5) discard;\n float core = 1.0 - smoothstep(0.18, 0.32, d);\n float halo = (1.0 - smoothstep(0.2, 0.5, d)) * 0.35;\n float a = (core + halo) * vAlpha;\n gl_FragColor = vec4(uColor + vec3(0.25) * core, a);\n}\n",uniforms:{uTime:{value:0},uLeaving:{value:0},uSize:{value:v?5.5:6.5},uPixelRatio:{value:Math.min(window.devicePixelRatio,2)},uColor:{value:new r.Ilk(16106776)}},transparent:!0,depthWrite:!1,depthTest:!0}),L=new r.woe(T,P);L.frustumCulled=!1,c.add(L);let C=!1,N=!1,E={started:0,total:0,active:!1},W=()=>{if(N||!g||!C)return;N=!0;let e=M<=100?{window:3,flight:1.5,waves:0}
1:M<=1e3?{window:3.6,flight:1.4,waves:0}:M<=1e4?{window:4.4,flight:1.3,waves:24}:{window:5.6,flight:1.2,waves:16},n=new Float32Array(3);for(let a=0;a<M;a++){let[r,i,s]=t[a];l(i,r,1.008+.03*b(i,r),n),R[3*a]=n[0],R[3*a+1]=n[1],R[3*a+2]=n[2];let v=u(a,1)*Math.PI*2,d=(u(a,2)-.5)*Math.PI,c=Math.cos(d)*Math.cos(v),m=Math.sin(d),h=Math.cos(d)*Math.sin(v),f=2.4+1.6*u(a,3),w=n[0]+1.3*c,p=n[1]+1.3*m,g=n[2]+1.3*h,x=Math.hypot(w,p,g)||1;S[3*a]=w/x*f,S[3*a+1]=p/x*f,S[3*a+2]=g/x*f;let y=u(a,4)*Math.max(.01,e.window-e.flight);e.waves&&(y=Math.floor(u(a,5)*e.waves)/e.waves*(e.window-e.flight)),A[a]=o?0:y,D[a]=o?.001:e.flight*(.85+.3*u(a,6)),z[a]=s/3.4}for(let e of["position","aStart","aDelay","aDuration","aSize"])T.getAttribute(e).needsUpdate=!0;T.setDrawRange(0,M),P.uniforms.uTime.value=o?10:0,E.started=performance.now(),E.total=o?.01:e.window+.5,E.active=!0,!o&&s&&(f.autoRotate=!0,f.autoRotateSpeed=.9,F=performance.now()+1e3*e.window)},F=0,j=s&&!o?.28:0,I=()=>{f.autoRotate=!1,F=1/0},_=()=>{F=performance.now()+2600};f.addEventListener("start",I),f.addEventListener("end",_);let k=()=>{let t=a.clientWidth,n=a.clientHeight;e.setSize(t,n,!1),h.aspect=t/n,h.updateProjectionMatrix()};k();let U=new ResizeObserver(k);U.observe(a);let O=!0,G=new IntersectionObserver(e=>{var t,n;(O=null===(n=null===(t=e[0])||void 0===t?void 0:t.isIntersecting)||void 0===n||n)&&(C=!0,W())},{threshold:.2});G.observe(a);let V=new r.Pa4,H=0,q=()=>{if(H=requestAnimationFrame(q),!O)return;V.copy(h.position).normalize(),V.x-=.45,V.y+=.55,y.uniforms.uLightDir.value.copy(V.normalize());let t=performance.now();if(j>0&&(t>F&&!f.autoRotate&&(f.autoRotate=!0,f.autoRotateSpeed=1e-4),f.autoRotate&&f.autoRotateSpeed<j&&(f.autoRotateSpeed=Math.min(j,f.autoRotateSpeed+.004)),f.autoRotate&&f.autoRotateSpeed>j&&t>F&&(f.autoRotateSpeed=Math.max(j,f.autoRotateSpeed-.01))),f.update(),E.active){let e=(t-E.started)/1e3;P.uniforms.uTime.value=e,e>E.total&&(E.active=!1)}e.render(c,h)};return q(),()=>{cancelAnimationFrame(H),U.disconnect(),G.disconnect(),f.removeEventListener("start",I),f.removeEventListener("end",_),f.dispose(),c.traverse(e=>{var t,n,a;null===(n=e.geometry)||void 0===n||null===(t=n.dispose)||void 0===t||t.call(n);let o=e.material;Array.isArray(o)?o.forEach(e=>e.dispose()):null==o||null===(a=o.dispose)||void 0===a||a.call(o)}),x.dispose(),e.dispose(),e.domElement.parentNode===a&&a.removeChild(e.domElement)}},[t,n,s]),(0,a.jsx)("div",{className:"globe-stage ".concat(v),ref:d,children:c&&(0,a.jsx)("p",{className:"absolute inset-0 flex items-center justify-center text-white/60 text-sm px-6 text-center",children:"The globe needs a browser with WebGL. The flat map is on the reach page."})})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.