1import{r as $,j as a}from"./framer-vendor-BQFVqQmJ.js";import{Scene as Vt,PerspectiveCamera as Yt,WebGLRenderer as Xt,AmbientLight as Ut,DirectionalLight as Qt,Group as Kt,Vector3 as R,Mesh as _t,SphereGeometry as Zt,MeshBasicMaterial as Jt,Sprite as Pe,SpriteMaterial as He,AdditiveBlending as me,Quaternion as ea,Euler as ta,Color as Me,IcosahedronGeometry as aa,MeshStandardMaterial as na,BufferGeometry as Rt,BufferAttribute as V,LineSegments as oa,ShaderMaterial as zt,Points as sa,CanvasTexture as Ft}from"./three-vendor-C5Tu9S6t.js";import{P as ra}from"./pause-BZl_ZgBy.js";import{P as la}from"./play-U-iTt9iW.js";import{B as ia}from"./building-2-CySvALwl.js";import{L as ca}from"./landmark-D4jmsaj8.js";import{S as da}from"./scale-uI12rt4p.js";import{C as ma}from"./compass-BZVO2zjE.js";import{l as pa,U as ha,X as ua}from"./index-CjIeyhK0.js";import{R as fa}from"./repeat-mlSSVn1N.js";import{T as xa}from"./trending-up-CBXZ7X3x.js";import{R as ga}from"./radio-DCVaWPSN.js";import{M as ba}from"./minimize-2-Tih9UR9R.js";import{M as ya}from"./maximize-2-KeIu-mU2.js";import"./chart-vendor-D7KebX4S.js";import"./supabase-vendor-DJa18kbt.js";const va={LONG:"#34d399",SHORT:"#fb7185",HOLD:"#94a3b8"},wa={retail:"retail",institution:"สà¸à¸²à¸à¸±à¸",broker:"broker",bank:"smart money",government:"รัà¸/policy"},Sa={retail_fomo:"รายยà¹à¸à¸¢à¹à¸¥à¹à¸£à¸²à¸à¸² â à¹à¸à¹à¸²à¸à¸²à¸¡à¸à¸£à¸°à¹à¸ªà¹à¸à¸£à¸²à¸°à¸à¸¥à¸±à¸§à¸à¸à¸£à¸ มัà¸à¹à¸à¹à¸à¹à¸«à¸¢à¸·à¹à¸à¸à¸à¸ stop-hunt",breakout_chaser:"à¸à¸±à¸à¹à¸¥à¹à¹à¸à¸£à¸à¹à¸à¸²à¸à¹ â à¹à¸à¹à¸²à¹à¸¡à¸·à¹à¸à¸£à¸²à¸à¸²à¸à¸°à¸¥à¸¸à¹à¸à¸§ à¹à¸ªà¸µà¹à¸¢à¸à¹à¸à¸à¸à¸±à¸à¸à¸±à¸ false break",mean_reverter:"สายสวà¸à¸à¹à¸²à¹à¸à¸¥à¸µà¹à¸¢ â à¸à¸²à¸¢à¹à¸à¸/à¸à¸·à¹à¸à¸à¸¹à¸à¹à¸¡à¸·à¹à¸à¸£à¸²à¸à¸²à¹à¸«à¸§à¸µà¹à¸¢à¸à¹à¸à¸´à¸à¹à¸",panic_seller:"สายà¹à¸à¸à¸´à¸ â à¹à¸à¸à¸²à¸¢à¹à¸¡à¸·à¹à¸à¸à¸²à¸à¸à¸¸à¸ à¹à¸£à¹à¸à¹à¸«à¹à¹à¸à¸´à¸ liquidation cascade",smart_follower:"รายยà¹à¸à¸¢à¸à¸¥à¸²à¸ â รà¸à¸ªà¸±à¸à¸à¸²à¸à¸¢à¸·à¸à¸¢à¸±à¸à¹à¸¥à¹à¸§à¸à¹à¸à¸¢à¸à¸²à¸¡à¹à¸à¸´à¸à¹à¸«à¸à¹",market_maker:"à¸à¸¹à¹à¸à¸¹à¹à¸¥à¸ªà¸ าà¸à¸à¸¥à¹à¸à¸ â วาà¸à¸à¸à¹à¸à¸à¸£à¹à¸ªà¸à¸à¸à¸±à¹à¸ à¸à¹à¸²à¸à¸ªà¹à¸à¸£à¸à¸à¹à¸§à¸à¸à¸±à¸à¸à¸§à¸",smart_money:"à¹à¸à¸´à¸à¹à¸«à¸à¹/สà¸à¸²à¸à¸±à¸ â สะสม-à¸à¸¥à¹à¸à¸¢à¸à¸à¸à¸à¹à¸à¸à¸à¸¹à¸ ลà¹à¸²à¹à¸à¸ stop à¸à¸à¸à¸£à¸²à¸¢à¸¢à¹à¸à¸¢",policy_maker:"à¸à¸¹à¹à¸à¸³à¸«à¸à¸à¸à¹à¸¢à¸à¸²à¸¢ â à¸à¸à¸à¹à¸à¸µà¹à¸¢/à¸à¹à¸¢à¸à¸²à¸¢à¸à¸¢à¸±à¸à¸à¸±à¹à¸à¸à¸¥à¸²à¸à¸à¸£à¹à¸à¸¡à¸à¸±à¸"},ne={LONG:3462041,SHORT:16478597,HOLD:9741240},Tt={retail_fomo:16347926,breakout_chaser:9133302,mean_reverter:1096065,panic_seller:16478597,smart_follower:3900150,market_maker:2282478,smart_money:16498468,policy_maker:10980346},Ma="radial-gradient(ellipse at 50% 45%, #0d1b3d 0%, #070d22 48%, #02040c 100%)",Na=s=>{if(!s)return null;const h=parseInt(s.replace("#",""),16);return Number.isFinite(h)?h:null};function ja(s){let h;if(s&&s.length>=10)h=s.map(i=>{const c=(i.archetype||i.name).replace(/_\d+$/,""),M=Na(i.color)??Tt[c]??ne[i.decision];return{id:i.name,label:i.name.replace(/_\d+$/,""),decision:i.decision,hub:i.hub,nodeColor:M,tier:i.tier,conviction:i.conviction,post:i.post}});else{const i=[{base:"retail_fomo",decision:"LONG",n:32,hubEvery:11},{base:"breakout_chaser",decision:"LONG",n:18,hubEvery:9},{base:"panic_seller",decision:"SHORT",n:14,hubEvery:14},{base:"mean_reverter",decision:"SHORT",n:12,hubEvery:0},{base:"smart_follower",decision:"HOLD",n:14,hubEvery:0},{base:"market_maker",decision:"HOLD",n:8,hubEvery:0},{base:"smart_money",decision:"SHORT",n:8,hubEvery:8},{base:"policy_maker",decision:"HOLD",n:4,hubEvery:0}];h=[],i.forEach(c=>{for(let M=0;M<c.n;M++)h.push({id:`${c.base}_${M}`,label:c.base,decision:c.decision,hub:c.hubEvery>0&&M%c.hubEvery===0,nodeColor:Tt[c.base]??ne[c.decision]})})}const w=i=>h.map((c,M)=>({n:c,i:M})).filter(c=>c.n.hub&&c.n.decision===i).map(c=>c.i);let d=w("LONG"),g=w("SHORT");if(d.length===0){const i=h.findIndex(c=>c.decision==="LONG");i>=0&&(h[i].hub=!0,d=[i])}if(g.length===0){const i=h.findIndex(c=>c.decision==="SHORT");i>=0&&(h[i].hub=!0,g=[i])}const C=[];h.forEach((i,c)=>{if(!i.hub)if(i.decision==="LONG"&&d.length)C.push([d[c%d.length],c]),Math.random()>.85&&C.push([d[(c+2)%d.length],c]);else if(i.decision==="SHORT"&&g.length)C.push([g[c%g.length],c]);else{const M=d.length?d:g;M.length&&C.push([M[c%M.length],c])}});for(let i=0;i<d.length;i++)for(let c=i+1;c<d.length;c++)Math.random()>.35&&C.push([d[i],d[c]]);return g.forEach(i=>
1{d.length&&C.push([d[0],i])}),{nodes:h,edges:C}}function Ca(){const h=document.createElement("canvas");h.width=h.height=64;const w=h.getContext("2d"),d=w.createRadialGradient(64/2,64/2,0,64/2,64/2,64/2);return d.addColorStop(0,"rgba(255,255,255,1)"),d.addColorStop(.3,"rgba(255,255,255,0.7)"),d.addColorStop(1,"rgba(255,255,255,0)"),w.fillStyle=d,w.fillRect(0,0,64,64),new Ft(h)}function Ot(s){const w=document.createElement("canvas");w.width=w.height=256;const d=w.getContext("2d"),g=d.createRadialGradient(256/2,256/2,0,256/2,256/2,256/2);return g.addColorStop(0,"rgba(255,255,255,0)"),g.addColorStop(s*.9,"rgba(255,255,255,0.05)"),g.addColorStop(s,"rgba(255,255,255,0.55)"),g.addColorStop(s+(1-s)*.3,"rgba(255,255,255,0.14)"),g.addColorStop(1,"rgba(255,255,255,0)"),d.fillStyle=g,d.fillRect(0,0,256,256),new Ft(w)}function ka(s){return()=>(s=s*1664525+1013904223>>>0,s/4294967296)}function pe(s,h){const w=1-2*(s+.5)/h,d=Math.sqrt(1-w*w),g=s*Math.PI*(3-Math.sqrt(5));return new R(Math.cos(g)*d,w,Math.sin(g)*d)}const Ea=` 2 uniform float uTime; uniform float uScale; uniform float uBackFade; uniform float uTwinkle; 3 attribute vec3 aColor; attribute float aSize; attribute float aPhase; attribute float aDim; 4 varying vec3 vColor; varying float vAlpha; 5 void main() { 6 vec4 mv = modelViewMatrix * vec4(position, 1.0); 7 vec3 c = (modelViewMatrix * vec4(0.0, 0.0, 0.0, 1.0)).xyz; 8 float facing = dot(normalize(mv.xyz - c), normalize(-mv.xyz)); 9 float f = mix(uBackFade, 1.0, smoothstep(-0.35, 0.25, facing)); 10 float tw = 1.0 - uTwinkle + uTwinkle * sin(uTime * (1.1 + aPhase) + aPhase * 6.2831); 11 gl_PointSize = aSize * tw * uScale / -mv.z; 12 vColor = aColor; vAlpha = f * aDim; 13 gl_Position = projectionMatrix * mv; 14 }`,Aa=` 15 varying vec3 vColor; varying float vAlpha; 16 void main() { 17 float d = length(gl_PointCoord - 0.5); 18 if (d > 0.5) discard; 19 float halo = max(exp(-d * d * 16.0) - 0.018, 0.0); 20 float core = exp(-d * d * 150.0); 21 vec3 col = (vColor * halo + vec3(core * 0.9)) * vAlpha; 22 gl_FragColor = vec4(col, min(1.0, max(col.r, max(col.g, col.b)))); 23 }`,_a=` 24 uniform float uBackFade; 25 attribute vec3 aColor; 26 varying vec3 vColor; 27 void main() { 28 vec4 mv = modelViewMatrix * vec4(position, 1.0); 29 vec3 c = (modelViewMatrix * vec4(0.0, 0.0, 0.0, 1.0)).xyz; 30 float facing = dot(normalize(mv.xyz - c), normalize(-mv.xyz)); 31 vColor = aColor * mix(uBackFade, 1.0, smoothstep(-0.35, 0.25, facing)); 32 gl_Position = projectionMatrix * mv; 33 }`,Ra=` 34 varying vec3 vColor; 35 void main() { gl_FragColor = vec4(vColor, min(1.0, max(vColor.r, max(vColor.g, vColor.b)))); }`;function Ja({personas:s,fill:h=!1,ticker:w}){const d=$.useRef(null),[g,C]=$.useState(null),[i,c]=$.useState(!0),[M,Y]=$.useState(null),F=$.useRef({autoRotate:!0}).current,D=$.useRef(null);return $.useEffect(()=>{const b=d.current;if(!b)return;const{nodes:f,edges:S}=ja(s),L=f.length>80,x=ka(f.length*7919+17),De=()=>Math.sqrt(-2*Math.log(x()+1e-9))*Math.cos(2*Math.PI*x()),Be=b.clientWidth;let W=(h?b.clientHeight:360)||360;const Ie=50,X=new Vt,P=new Yt(Ie,Be/W,.1,3e3);let Ne=L?290:255;const je=()=>{P.position.set(0,0,Ne*Math.max(1,1/P.aspect))};je();let y;try{y=new Xt({antialias:!0,alpha:!0})}catch{return}y.setPixelRatio(Math.min(window.devicePixelRatio,2)),y.setSize(Be,W),y.setClearColor(0,0),b.appendChild(y.domElement),y.domElement.style.display="block",y.domElement.style.width="100%",y.domElement.style.cursor="grab",X.add(new Ut(10336511,.9));const Ge=new Qt(16777215,2.4);Ge.position.set(1,1.3,1.6),X.add(Ge);const k=new Kt;X.add(k);const $e={value:0},We={value:1},qe=()=>{We.value=y.getPixelRatio()*W/(2*Math.tan(Ie*Math.PI/360))};qe();const oe=(e,t)=>new zt({uniforms:{uTime:$e,uScale:We,uBackFade:{value:e},uTwinkle:{value:t}},vertexShader:Ea,fragmentShader:Aa,transparent:!0,depthWrite:!1,blending:me,premultipliedAlpha:!0}),se=(e,t,n,r,l)=>{const o=n.length,m=new Rt;m.setAttribute("position",new V(e,3)),m.setAttribute("aColor",new V(t,3)),m.setAttribute("aSize",new V(n,1)),m.setAttribute("aPhase",new V(Float32Array.from({length:o},()=>x()),1)),m.setAttribute("aDim",new V(new Float32Array(o).fill(1),1));const u=new sa(m,r);return u.renderOrder=l,u},B=80,re=1400,Lt=new R(.3,1,.2).normalize(),Ve=new Float32Array(re*3),Ye=new Float32Array(re*3),Xe=new Float32Array(re);for(let e=0;e<re;e++){const t=pe(e,re).applyAxisAngle(Lt,x()*.05).multiplyScalar(520+x()*480);Ve.set([t.x,t.y,t.z],e*3);
35const n=.18+x()*x()*.7,r=x();Ye.set([n*(.7+.2*r),n*(.8+.15*r),n],e*3),Xe[e]=3+x()*x()*9}const Ce=se(Ve,Ye,Xe,oe(1,.35),0);X.add(Ce);const he=new _t(new Zt(B*.985,48,48),new Jt({color:264732,transparent:!0,opacity:.82,depthWrite:!1}));he.renderOrder=1,k.add(he);const le=L?2200:1500,Ue=new Float32Array(le*3),Qe=new Float32Array(le*3),Ke=new Float32Array(le);for(let e=0;e<le;e++){const t=pe(e,le).multiplyScalar(B);Ue.set([t.x,t.y,t.z],e*3);const n=.1+x()*.12;Qe.set([n*.55,n*.75,n*1.4],e*3),Ke[e]=2.2}const Ze=se(Ue,Qe,Ke,oe(.12,0),2);k.add(Ze);const ue=L?420:300,Je=new Float32Array(ue*3),et=new Float32Array(ue*3),tt=new Float32Array(ue);for(let e=0;e<ue;e++){const t=pe(Math.floor(x()*5e3),5e3).multiplyScalar(B*(1.08+x()*x()*.9));Je.set([t.x,t.y,t.z],e*3);const n=.12+x()*.25;et.set([n*.6,n*.7,n],e*3),tt[e]=1.5+x()*2.5}const at=se(Je,et,tt,oe(.35,.5),2);k.add(at);const nt=Ot(.77),fe=new Pe(new He({map:nt,color:3895264,transparent:!0,opacity:.55,blending:me,depthWrite:!1}));fe.scale.setScalar(B*2*1.03/.77),fe.renderOrder=1,X.add(fe);const U=f.map((e,t)=>e.hub?t:-1).filter(e=>e>=0),Pt=new ea().setFromEuler(new ta(x()*3,x()*3,x()*3)),ke=new Map;U.forEach((e,t)=>ke.set(e,pe(t,Math.max(U.length,2)).applyQuaternion(Pt)));const xe=f.map(()=>-1);for(const[e,t]of S)xe[t]<0&&!f[t].hub&&(xe[t]=e);const ot=L?Math.min(.42,.62*Math.sqrt(4/Math.max(U.length,1))):.62,Ht=new R(0,1,0),N=f.map((e,t)=>{if(e.hub)return ke.get(t).clone().multiplyScalar(B*1.05);const n=xe[t]>=0?ke.get(xe[t]):void 0,r=n?n.clone():pe(Math.floor(x()*997),997),l=Ht.clone().cross(r);l.lengthSq()<1e-6&&l.set(1,0,0),l.normalize();const o=r.clone().cross(l).normalize();return r.addScaledVector(l,De()*ot).addScaledVector(o,De()*ot).normalize(),r.multiplyScalar(B*(1.005+x()*x()*.12))}),ie=f.map((e,t)=>t).filter(e=>!f[e].hub),E=new Me,Ee=new Me(16777215),st=new Float32Array(ie.length*3),rt=new Float32Array(ie.length*3),lt=new Float32Array(ie.length);ie.forEach((e,t)=>{st.set([N[e].x,N[e].y,N[e].z],t*3),E.setHex(f[e].nodeColor).lerp(Ee,.3),rt.set([E.r,E.g,E.b],t*3),lt[t]=(L?7:14)*(.7+x()*.6)});const ge=se(st,rt,lt,oe(.14,.18),4);k.add(ge);const be=new aa(1,1);{const e=be.attributes.position,t=new R;for(let n=0;n<e.count;n++){t.fromBufferAttribute(e,n);const r=Math.abs(Math.sin(t.x*127.1+t.y*311.7+t.z*74.7)*43758.5453)%1;t.multiplyScalar(.78+.34*r),e.setXYZ(n,t.x,t.y,t.z)}be.computeVertexNormals()}const it=Ca(),Q=L?3.4:4.6,K=U.map(e=>{const t=new Me(ne[f[e].decision]),n=new _t(be,new na({color:t.clone().lerp(Ee,.45),emissive:t,emissiveIntensity:.55,roughness:.2,metalness:.3,flatShading:!0,transparent:!0,opacity:.95}));n.scale.setScalar(Q),n.position.copy(N[e]),n.rotation.set(x()*6,x()*6,0),n.userData.index=e,n.renderOrder=5;const r=new Pe(new He({map:it,color:t,transparent:!0,opacity:.6,blending:me,depthWrite:!1}));return r.scale.setScalar(Q*7),r.position.copy(N[e]),r.renderOrder=6,k.add(n,r),{m:n,glow:r,ni:e}}),A=28,Dt=new Me(5209599),ce=new Float32Array(S.length*(A+1)*3),ct=new Float32Array(S.length),Ae=S.map(([e,t])=>f[e].hub&&f[t].hub),ye=new R,ve=new R,z=new R,dt=new R;S.forEach(([e,t],n)=>{const r=N[e].length(),l=N[t].length();ye.copy(N[e]).normalize(),ve.copy(N[t]).normalize();const o=ye.angleTo(ve),m=Math.sin(o),u=B*(Ae[n]?.06:.03)+B*.2*(o/Math.PI);let p=0;for(let v=0;v<=A;v++){const G=v/A;m<.001?(z.lerpVectors(ye,ve,G),z.lengthSq()<1e-6&&z.set(0,1,0),z.normalize()):z.copy(ye).multiplyScalar(Math.sin((1-G)*o)/m).addScaledVector(ve,Math.sin(G*o)/m),z.multiplyScalar(r+(l-r)*G+u*Math.sin(Math.PI*G)),v&&(p+=z.distanceTo(dt)),dt.copy(z),ce.set([z.x,z.y,z.z],(n*(A+1)+v)*3)}ct[n]=p});const de=A*2*3,mt=new Float32Array(S.length*de),_e=new Float32Array(S.length*de);S.forEach(([e],t)=>{E.setHex(ne[f[e].decision]).lerp(Dt,.45);const n=Ae[t]?.95:L?.3:.45;for(let r=0;r<A;r++)for(let l=0;l<2;l++){const o=r+l,m=((t*A+r)*2+l)*3,u=(t*(A+1)+o)*3;mt.set(ce.subarray(u,u+3),m);const p=n*(1-.65*(o/A));_e.set([E.r*p,E.g*p,E.b*p],m)}});const Bt=_e.slice(),Z=new Rt;Z.setAttribute("position",new V(mt,3)),Z.setAttribute("aColor",new V(_e,3));const Re=new oa(Z,new zt({uniforms:{uBackFade:{value:.12}},vertexShader:_a,fragmentShader:Ra,transparent:!0,depthWrite:!1,blending:me,premultipliedAlpha:!0}));Re.renderOrder=3,k.add(Re);const T=4,It=new Float32Array(S.length*T*3),pt=new Float32Array(S.length*T*3),ht=new Float32Array(S.length*T);
35S.forEach(([e],t)=>{E.setHex(ne[f[e].decision]).lerp(Ee,.35);for(let n=0;n<T;n++){const r=1-n/T;pt.set([E.r*r,E.g*r,E.b*r],(t*T+n)*3),ht[t*T+n]=(Ae[t]?9:L?4.5:6.5)*(1-n*.18)}});const J=se(It,pt,ht,oe(.1,0),5);k.add(J);const ze=S.map(()=>x()),Gt=(e,t,n,r)=>{const l=Math.max(0,Math.min(1,t))*A,o=Math.min(A-1,Math.floor(l)),m=l-o,u=(e*(A+1)+o)*3;for(let p=0;p<3;p++)n[r+p]=ce[u+p]+(ce[u+3+p]-ce[u+p])*m},Te=K.map(({ni:e})=>{const t=document.createElement("div");return t.textContent=f[e].label,t.style.cssText="position:absolute;left:0;top:0;pointer-events:none;white-space:nowrap;font-size:10px;letter-spacing:.02em;color:rgba(203,213,225,.85);text-shadow:0 0 6px rgba(2,6,23,.95);will-change:transform,opacity;",b.appendChild(t),t}),ut=K.map(()=>1);let j=-1;const ft=Ot(.6),O=new Pe(new He({map:ft,transparent:!0,blending:me,depthWrite:!1,depthTest:!1}));O.visible=!1,O.renderOrder=7,k.add(O);let H=null;const $t=e=>{const t=N[e],n=.45,r=Math.hypot(t.x,t.z);H={y:n-Math.atan2(t.x,t.z),x:Math.max(-1.2,Math.min(1.2,Math.atan2(t.y,r*Math.cos(n))))}},xt=()=>{const e=new Set;if(j>=0){e.add(j);for(const[l,o]of S)l===j?e.add(o):o===j&&e.add(l)}const t=ge.geometry.attributes.aDim.array;ie.forEach((l,o)=>{t[o]=j<0||e.has(l)?1:.08}),ge.geometry.attributes.aDim.needsUpdate=!0,K.forEach(({m:l,glow:o,ni:m},u)=>{const p=j<0||e.has(m),v=l.material;v.opacity=p?.95:.12,v.emissiveIntensity=p?.55:.05,o.material.opacity=p?.6:.04,ut[u]=p?1:.15});const n=Z.attributes.aColor.array,r=J.geometry.attributes.aDim.array;S.forEach(([l,o],m)=>{const u=j<0||l===j||o===j,p=u?j<0?1:1.6:.04;for(let v=0;v<de;v++)n[m*de+v]=Bt[m*de+v]*p;for(let v=0;v<T;v++)r[m*T+v]=u?1:0}),Z.attributes.aColor.needsUpdate=!0,J.geometry.attributes.aDim.needsUpdate=!0},gt=()=>{j=-1,H=null,O.visible=!1,xt()};D.current=gt;let ee=!1,we=0,Oe=0,Fe=0,I=.28;const Se=f.map(()=>0);for(const[e,t]of S)Se[e]++,Se[t]++;const Le=U.reduce((e,t)=>Se[t]>Se[e]?t:e,U[0]??0);let q=N[Le]?1.3-Math.atan2(N[Le].x,N[Le].z):0;const te=new R,Wt=new R,bt=(e,t,n=!1)=>{const r=y.domElement.getBoundingClientRect(),l=e-r.left,o=t-r.top;k.updateMatrixWorld();let m=-1,u=(n?22:L?12:14)**2;for(let p=0;p<f.length;p++){if(te.copy(N[p]).applyMatrix4(k.matrixWorld),te.dot(Wt.copy(P.position).sub(te))<0)continue;te.project(P);const v=(te.x+1)/2*r.width-l,G=(1-te.y)/2*r.height-o,At=(v*v+G*G)*(f[p].hub?.5:1);At<u&&(u=At,m=p)}return m},yt=e=>{ee=!0,we=0,Oe=e.clientX,Fe=e.clientY,y.domElement.style.cursor="grabbing"},vt=e=>{if(ee&&we<5){const t=bt(e.clientX,e.clientY,e.pointerType==="touch");if(t>=0){const n=[...new Set(S.filter(([o])=>o===t).map(([,o])=>f[o].label))],r=[...new Set(S.filter(([,o])=>o===t).map(([o])=>f[o].label))],l=f[t];Y({id:l.id,label:l.label,decision:l.decision,hub:l.hub,tier:l.tier,conviction:l.conviction,post:l.post,color:`#${l.nodeColor.toString(16).padStart(6,"0")}`,influences:n,influencedBy:r}),j=t,xt(),O.position.copy(N[t]),O.material.color.setHex(ne[l.decision]),O.visible=!0,$t(t)}else Y(null),gt()}ee=!1,y.domElement.style.cursor="grab"},wt=e=>{const t=y.domElement.getBoundingClientRect();if(ee){const r=e.clientX-Oe,l=e.clientY-Fe;we+=Math.abs(r)+Math.abs(l),we>5&&(H=null),q+=r*.006,I+=l*.006,I=Math.max(-1.2,Math.min(1.2,I)),Oe=e.clientX,Fe=e.clientY}const n=bt(e.clientX,e.clientY);n>=0?(C({label:f[n].id,x:e.clientX-t.left,y:e.clientY-t.top}),y.domElement.style.cursor="pointer"):(C(null),y.domElement.style.cursor=ee?"grabbing":"grab")},St=e=>{e.preventDefault(),Ne=Math.max(120,Math.min(480,Ne+e.deltaY*.12)),je()},_=y.domElement;_.addEventListener("pointerdown",yt),window.addEventListener("pointerup",vt),_.addEventListener("pointermove",wt),_.addEventListener("pointerleave",()=>C(null)),_.addEventListener("wheel",St,{passive:!1});const qt=J.geometry.attributes.position.array,ae=new R,Mt=new R;let Nt=0;const jt=performance.now();let Ct=jt;const kt=()=>{const e=performance.now(),t=(e-jt)/1e3,n=Math.min(.05,(e-Ct)/1e3);if(Ct=e,$e.value=t,H){const o=Math.atan2(Math.sin(H.y-q),Math.cos(H.y-q));q+=o*.07,I+=(H.x-I)*.07,Math.abs(o)<.002&&Math.abs(H.x-I)<.002&&(H=null)}else!ee&&F.autoRotate&&j<0&&(q+=.0018);if(O.visible){const o=t*.7%1;O.scale.setScalar((j>=0&&f[j].hub?Q*5:10)*(.8+o*1.1)),O.material.opacity=.9*(1-o)}
35k.rotation.set(I,q,0),Ce.rotation.set(I*.15,q*.15,0);for(let o=0;o<S.length;o++){const m=Math.max(ct[o],12);ze[o]=(ze[o]+n*34/m)%1;for(let u=0;u<T;u++)Gt(o,ze[o]-u*(5/m),qt,(o*T+u)*3)}J.geometry.attributes.position.needsUpdate=!0,K.forEach(({m:o,glow:m},u)=>{o.rotation.y+=.004,o.rotation.x+=.0015;const p=1+.06*Math.sin(t*1.6+u);o.scale.setScalar(Q*p),m.scale.setScalar(Q*7*p)}),y.render(X,P);const r=_.clientWidth,l=_.clientHeight;K.forEach(({m:o},m)=>{o.getWorldPosition(ae),Mt.copy(P.position).sub(ae).normalize();const u=ae.clone().normalize().dot(Mt);ae.project(P);const p=Math.max(0,Math.min(1,(u+.05)/.3))*ut[m];Te[m].style.opacity=p.toFixed(2),Te[m].style.transform=`translate(${(ae.x+1)/2*r+Q*2.2}px, ${(1-ae.y)/2*l-5}px)`}),Nt=requestAnimationFrame(kt)};kt();const Et=new ResizeObserver(()=>{const e=b.clientWidth;W=(h?b.clientHeight:360)||W,P.aspect=e/W,P.updateProjectionMatrix(),je(),y.setSize(e,W),qe()});return Et.observe(b),()=>{cancelAnimationFrame(Nt),Et.disconnect(),D.current=null,_.removeEventListener("pointerdown",yt),window.removeEventListener("pointerup",vt),_.removeEventListener("pointermove",wt),_.removeEventListener("wheel",St),Te.forEach(e=>e.remove());for(const e of[Ce,Ze,at,ge,J])e.geometry.dispose(),e.material.dispose();he.geometry.dispose(),he.material.dispose(),fe.material.dispose(),nt.dispose(),O.material.dispose(),ft.dispose(),be.dispose(),it.dispose(),K.forEach(({m:e,glow:t})=>{e.material.dispose(),t.material.dispose()}),Z.dispose(),Re.material.dispose(),y.dispose();try{y.forceContextLoss()}catch{}_.parentNode&&_.parentNode.removeChild(_)}},[]),a.jsxs("div",{ref:d,className:`relative w-full overflow-hidden rounded-lg ${h?"h-full":""}`,style:{...h?{}:{height:360},background:Ma},children:[a.jsxs("button",{onClick:()=>{F.autoRotate=!F.autoRotate,c(F.autoRotate)},className:"absolute top-2 left-2 z-10 flex items-center gap-1.5 text-[10px] text-slate-300 bg-slate-900/80 hover:bg-slate-800 border border-slate-700/60 rounded-md px-2 py-1 transition-colors","aria-label":i?"หยุà¸à¸«à¸¡à¸¸à¸":"หมุà¸à¸à¹à¸",children:[i?a.jsx(ra,{className:"w-3 h-3"}):a.jsx(la,{className:"w-3 h-3"}),i?"หยุà¸à¸«à¸¡à¸¸à¸":"หมุà¸"]}),a.jsxs("div",{className:"absolute top-2 right-2 flex flex-col items-end gap-0.5 text-[10px] text-slate-400 bg-slate-900/70 rounded-md px-2 py-1 pointer-events-none",children:[a.jsx("span",{className:"text-slate-500",children:"à¸à¸£à¸´à¸ªà¸à¸±à¸¥ = à¸à¸¹à¹à¸à¸³à¸à¸¹à¸ · สี = à¸à¸´à¸¨"}),a.jsxs("div",{className:"flex gap-2.5",children:[a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx("span",{className:"w-2 h-2 rounded-full bg-emerald-400"}),"à¸à¸·à¹à¸"]}),a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx("span",{className:"w-2 h-2 rounded-full bg-rose-400"}),"à¸à¸²à¸¢"]}),a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx("span",{className:"w-2 h-2 rounded-full bg-slate-400"}),"à¸à¸·à¸"]})]})]}),a.jsx("div",{className:"absolute bottom-2 right-2 text-[10px] text-slate-500 bg-slate-900/60 rounded-md px-2 py-1 pointer-events-none",children:"à¸à¸¥à¸´à¸à¸à¸¸à¸ = à¹à¸à¸à¸±à¸ªà¸à¸¥à¸±à¸ªà¹à¸à¸à¸£à¹ (หรีà¹à¸à¸±à¸§à¸à¸·à¹à¸) + à¸à¸¹à¸£à¸²à¸¢à¸¥à¸°à¹à¸à¸µà¸¢à¸ · à¸à¸£à¸´à¸ªà¸à¸±à¸¥ = à¸à¸¹à¹à¸à¸³à¸à¸¹à¸ สีà¸à¸²à¸¡à¸à¸´à¸¨ à¸à¸·à¹à¸/à¸à¸²à¸¢/à¸à¸·à¸ · à¸à¸²à¸§à¹à¸¥à¹à¸ = สี archetype · à¹à¸ªà¹à¸à¹à¸à¹à¸ = สายà¸à¸´à¸à¸à¸´à¸à¸¥ (à¸à¸¹à¹à¸à¸³âà¸à¸¹à¹à¸à¸³ = à¹à¸ªà¹à¸à¸ªà¸§à¹à¸²à¸) · à¸à¸²à¸§à¸«à¸²à¸à¸§à¸´à¹à¸ = contagion influencer â follower · ลาà¸à¸«à¸¡à¸¸à¸ · ลูà¸à¸à¸¥à¸´à¹à¸à¸à¸¹à¸¡"}),M&&a.jsx(La,{sel:M,ticker:w,onClose:()=>{var b;Y(null),(b=D.current)==null||b.call(D)}}),g&&a.jsx("div",{className:"absolute text-[10px] font-mono text-cyan-300 bg-slate-900/85 rounded-md px-2 py-1 pointer-events-none",style:{left:g.x+10,top:g.y+10},children:g.label})]})}const za={retail_fomo:ha,breakout_chaser:xa,mean_reverter:fa,panic_seller:pa,smart_follower:ma,market_maker:da,smart_money:ca,policy_maker:ia},Ta={LONG:"à¸à¸·à¹à¸",SHORT:"à¸à¸²à¸¢",HOLD:"à¸à¸·à¸"},Oa={high:85,med:55,low:25},Fa=` 36@keyframes igWave { 0%, 100% { transform: scaleY(.25) } 50% { transform: scaleY(1) } } 37.ig-wave { transform-origin: bottom; animation: igWave .9s ease-in-out infinite; } 38@keyframes igMarquee { from { transform: translateX(0) } to { transform: translateX(-50%) } } 39.ig-marquee { display: inline-block; animation: igMarquee 16s linear infinite; } 40@keyframes igIn { from { opacity: 0; transform: translateY(-6px) scale(.98) } to { opacity: 1; transform: none } } 41.ig-in { animation: igIn .22s ease-out; } 42@media (prefers-reduced-motion: reduce) { .ig-wave, .ig-marquee, .ig-in { animation: none } } 43`;function La({sel:s,ticker:h,onClose:w}){const[d,g]=$.useState(!1),C=za[s.label]??ga,i=va[s.decision],c=Sa[s.label]||"à¹à¸à¹à¸à¸à¸à¹à¹à¸à¸à¸¹à¸ â à¸à¸±à¸à¸ªà¸´à¸à¹à¸à¸à¸²à¸¡à¸à¸¤à¸à¸´à¸à¸£à¸£à¸¡à¸à¸à¸ archetype à¸à¸±à¸§à¹à¸à¸",M=s.post||c.split(" â ")[0],Y=s.conviction?Oa[s.conviction]??Math.round(Number(s.conviction)*100):NaN,F=Number.isFinite(Y)?Math.max(0,Math.min(100,Y)):null,D=[h??"MiroFish crowd sim",`${s.id} ${s.decision}${F!==null?` · มัà¹à¸à¹à¸ ${F}%`:""}`,`amplify ${s.influences.length} à¸à¸¥à¸¸à¹à¸¡`,`à¸à¸¹à¸à¸à¸§à¸à¹à¸à¸¢ ${s.influencedBy.length} à¸à¸¥à¸¸à¹à¸¡`].join(" ⢠");return a.jsxs("div",{className:`ig-in absolute left-2 top-10 z-20 ${d?"w-[min(460px,calc(100%-16px))]":"w-[min(310px,calc(100%-16px))]"} max-h-[calc(100%-3rem)] overflow-y-auto [scrollbar-color:rgba(100,116,139,.45)_transparent] [scrollbar-width:thin] rounded-lg border border-slate-500/30 bg-slate-950/90 text-[11px] shadow-2xl shadow-black/60 backdrop-blur-md`,children:[a.jsx("style",{children:Fa}),a.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-slate-700/50 px-2.5 py-1.5",children:[a.jsxs("span",{className:"truncate text-slate-300",children:[s.id," â Broadcast"]}),a.jsxs("div",{className:"flex shrink-0 items-center gap-2 text-slate-400",children:[a.jsx("button",{onClick:()=>g(b=>!b),className:"hover:text-slate-200","aria-label":d?"ยà¹à¸à¸«à¸à¹à¸²à¸à¹à¸²à¸":"à¸à¸¢à¸²à¸¢à¸«à¸à¹à¸²à¸à¹à¸²à¸",children:d?a.jsx(ba,{className:"h-3 w-3"}):a.jsx(ya,{className:"h-3 w-3"})}),a.jsx("button",{onClick:w,className:"hover:text-slate-200","aria-label":"à¸à¸´à¸",children:a.jsx(ua,{className:"h-3.5 w-3.5"})})]})]}),a.jsxs("div",{className:"relative m-2 aspect-video overflow-hidden rounded-md ring-1 ring-white/5",style:{background:`radial-gradient(circle at 28% 40%, ${s.color}40, #0b1224 58%, #050814)`},children:[a.jsx("div",{className:"absolute inset-0 opacity-40",style:{backgroundImage:"linear-gradient(rgba(148,163,184,.10) 1px, transparent 1px), linear-gradient(90deg, rgba(148,163,184,.10) 1px, transparent 1px)",backgroundSize:"22px 22px"}}),a.jsx("div",{className:"absolute left-[9%] top-[13%] flex aspect-square h-[50%] items-center justify-center rounded-full",style:{background:`radial-gradient(circle, ${s.color}55, transparent 70%)`,boxShadow:`0 0 36px ${s.color}40`},children:a.jsx(C,{className:"h-1/2 w-1/2",style:{color:s.color}})}),a.jsx("div",{className:"absolute right-[9%] top-[22%] flex h-[30%] items-end gap-[3px]","aria-hidden":!0,
43children:Array.from({length:14},(b,f)=>a.jsx("span",{className:"ig-wave block h-full w-[3px] rounded-full",style:{background:i,opacity:.85,animationDelay:`${(f*.37%1).toFixed(2)}s`}},f))}),a.jsxs("span",{className:"absolute left-2 top-2 flex items-center gap-1 rounded bg-black/55 px-1.5 py-0.5 text-[9px] font-bold tracking-wider text-rose-300",children:[a.jsx("span",{className:"h-1.5 w-1.5 animate-pulse rounded-full bg-rose-400"})," SIM"]}),s.hub&&a.jsx("span",{className:"absolute right-2 top-2 rounded bg-black/55 px-1.5 py-0.5 text-[9px] font-semibold text-amber-200",children:"à¸à¸¹à¹à¸à¸³à¸à¸¹à¸"}),a.jsxs("div",{className:"absolute inset-x-0 bottom-0",children:[a.jsxs("div",{className:"mx-2 mb-1 flex overflow-hidden rounded-sm shadow",children:[a.jsx("span",{className:"shrink-0 px-1.5 py-0.5 text-[10px] font-bold text-white",style:{background:i},children:Ta[s.decision]}),a.jsx("span",{className:`min-w-0 flex-1 bg-slate-100 px-1.5 py-0.5 text-[10px] font-semibold text-slate-900 ${d?"":"truncate"}`,children:M})]}),a.jsxs("div",{className:"flex items-center overflow-hidden bg-slate-900/95 text-[9px] text-slate-300",children:[a.jsx("span",{className:"shrink-0 bg-cyan-600 px-1.5 py-0.5 font-bold text-white",children:"MiroFish"}),a.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:a.jsx("div",{className:"ig-marquee whitespace-pre py-0.5 pl-2",children:`${D} ⢠${D} ⢠`})})]})]})]}),a.jsxs("div",{className:"px-2.5 pb-2.5",children:[a.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[a.jsx("span",{className:"shrink-0 rounded-sm bg-rose-500 px-1.5 py-0.5 text-[9px] font-bold tracking-wider text-white",children:"SOURCE"}),a.jsx("span",{className:"truncate font-semibold text-slate-100",children:s.label}),s.tier&&a.jsx("span",{className:"shrink-0 text-slate-500",children:wa[s.tier]??s.tier})]}),a.jsx("div",{className:"mb-1 text-[9px] font-semibold uppercase tracking-[0.18em] text-slate-500",children:"Agent evidence"}),a.jsx("p",{className:"mb-2 leading-relaxed text-slate-300",children:c}),F!==null&&a.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[a.jsx("span",{className:"shrink-0 text-[10px] text-slate-500",children:"à¸à¸§à¸²à¸¡à¸¡à¸±à¹à¸à¹à¸"}),a.jsx("div",{className:"h-1.5 flex-1 overflow-hidden rounded-full bg-slate-800",children:a.jsx("div",{className:"h-full rounded-full",style:{width:`${F}%`,background:i}})}),a.jsxs("span",{className:"w-8 shrink-0 text-right font-mono text-[10px] text-slate-400",children:[F,"%"]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"mb-0.5 text-[10px] text-emerald-300/80",children:["â amplify ",s.influences.length," à¸à¸¥à¸¸à¹à¸¡"]}),a.jsx("div",{className:"flex flex-wrap gap-1",children:s.influences.length===0?a.jsx("span",{className:"text-slate-600",children:"(à¹à¸¡à¹à¸¡à¸µ)"}):s.influences.slice(0,6).map(b=>a.jsx("span",{className:"rounded bg-emerald-500/15 px-1.5 py-0.5 text-[10px] text-emerald-200",children:b},b))})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"mb-0.5 text-[10px] text-cyan-300/80",children:["â à¸à¸¹à¸à¸à¸§à¸à¹à¸à¸¢ ",s.influencedBy.length," à¸à¸¥à¸¸à¹à¸¡"]}),a.jsx("div",{className:"flex flex-wrap gap-1",children:s.influencedBy.length===0?a.jsx("span",{className:"text-slate-600",children:"(à¹à¸¡à¹à¸¡à¸µ)"}):s.influencedBy.slice(0,6).map(b=>a.jsx("span",{className:"rounded bg-cyan-500/15 px-1.5 py-0.5 text-[10px] text-cyan-200",children:b},b))})]})]}),a.jsx("p",{className:"mt-2 border-t border-slate-800 pt-1.5 text-[9px] leading-snug text-slate-600",children:"à¹à¸à¹à¸à¸à¸à¹à¸à¸³à¸¥à¸à¸ â à¸à¹à¸à¸à¸§à¸²à¸¡à¸ªà¸£à¹à¸²à¸à¸à¸²à¸à¹à¸¡à¹à¹à¸à¸à¸à¸²à¸¡à¸à¸¸à¸à¸¥à¸´à¸ + à¸à¸²à¸£à¸à¸±à¸à¸ªà¸´à¸à¹à¸à¹à¸à¸£à¸à¸à¸à¸µà¹ à¹à¸¡à¹à¹à¸à¹à¸à¹à¸²à¸§à¸«à¸£à¸·à¸à¸à¸³à¸à¸¹à¸à¸à¸£à¸´à¸"})]})]})}export{Ja as default};
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.