@uptimizr/dashboard 0.3.4 → 0.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/out/404.html +1 -1
  2. package/out/__next.__PAGE__.txt +2 -2
  3. package/out/__next._full.txt +2 -2
  4. package/out/__next._head.txt +1 -1
  5. package/out/__next._index.txt +1 -1
  6. package/out/__next._tree.txt +1 -1
  7. package/out/_next/static/chunks/{2h051-1hu4co_.js → 020h1b22yfzjc.js} +1 -1
  8. package/out/_next/static/chunks/{0k9-8s-jof_gw.js → 0jsh6juckq525.js} +1 -1
  9. package/out/_next/static/chunks/{1zcrrq1fx8g2y.js → 0n0thxa3jkour.js} +2 -2
  10. package/out/_next/static/chunks/0yvei5e7uye4f.js +3 -0
  11. package/out/_next/static/chunks/{01aeari2x_tlz.js → 10w513bgw-bgi.js} +1 -1
  12. package/out/_next/static/chunks/{39lxb7c--3_2u.js → 16hx9_epo71u-.js} +1 -1
  13. package/out/_next/static/chunks/{3d5yb9ybkz7hx.js → 1bxxv3nsl2-o_.js} +1 -1
  14. package/out/_next/static/chunks/{2yzui3v-besdu.js → 1f-2upk7uaxky.js} +1 -1
  15. package/out/_next/static/chunks/{38wksra3d_k-4.js → 1q-gcxr6o4bx2.js} +1 -1
  16. package/out/_next/static/chunks/{0fxfsshoxnnh6.js → 1st81sc3owvku.js} +1 -1
  17. package/out/_next/static/chunks/28ud4w7xswcir.js +1 -0
  18. package/out/_next/static/chunks/{1--aypw9o8yng.js → 2cqxw5m39njar.js} +4 -4
  19. package/out/_next/static/chunks/{09p5fltt7o3to.js → 2fle007r0cdnq.js} +1 -1
  20. package/out/_next/static/chunks/{29v8falcmjvev.js → 2jfmqd86u1tzv.js} +1 -1
  21. package/out/_next/static/chunks/{1bv97vf67p_ri.js → 2owp-uukmhm4s.js} +2 -2
  22. package/out/_next/static/chunks/{13oqt2aoms4f6.js → 2pkoed609lf41.js} +1 -1
  23. package/out/_next/static/chunks/{3pyggl13glbdc.js → 2wdk-kbm-n-m5.js} +1 -1
  24. package/out/_next/static/chunks/{42oyfkhdvb-u3.js → 30_2jsjk52x2i.js} +1 -1
  25. package/out/_next/static/chunks/{0zcdc17ie6lmh.js → 33h_kt3pzks_y.js} +1 -1
  26. package/out/_next/static/chunks/{2s0dwzg7kq36n.js → 366e7izc386pj.js} +1 -1
  27. package/out/_next/static/chunks/{0ufakw529sr9d.js → 36waz9xq39n4t.js} +4 -4
  28. package/out/_next/static/chunks/{1ll0ta8a2qx1p.js → 39dscgnk4__gl.js} +2 -2
  29. package/out/_next/static/chunks/{413o2v11bygt5.js → 3ghwe2mr2ig7e.js} +1 -1
  30. package/out/_next/static/chunks/3mcfjxvxo0o3e.js +1 -0
  31. package/out/_next/static/chunks/{259xlbe69b9tc.js → 3oj29s_tuqbkm.js} +1 -1
  32. package/out/_next/static/chunks/{3bsvp8qhjqdu0.js → 3r2hbpm4wju16.js} +1 -1
  33. package/out/_next/static/chunks/{340pg0qkv5tqq.js → 3rx1jhuop94-l.js} +1 -1
  34. package/out/_not-found/__next._full.txt +1 -1
  35. package/out/_not-found/__next._head.txt +1 -1
  36. package/out/_not-found/__next._index.txt +1 -1
  37. package/out/_not-found/__next._not-found.__PAGE__.txt +1 -1
  38. package/out/_not-found/__next._not-found.txt +1 -1
  39. package/out/_not-found/__next._tree.txt +1 -1
  40. package/out/_not-found.html +1 -1
  41. package/out/_not-found.txt +1 -1
  42. package/out/index.html +1 -1
  43. package/out/index.txt +2 -2
  44. package/package.json +3 -3
  45. package/out/_next/static/chunks/06m_64ysu9kn0.js +0 -1
  46. package/out/_next/static/chunks/34rcp8qrbp522.js +0 -3
  47. package/out/_next/static/chunks/3l6t8b3addlw7.js +0 -1
  48. /package/out/_next/static/{M5esRfAVlWSeBcfLV_jVr → RC8D0Hg382TugUN5Syz31}/_buildManifest.js +0 -0
  49. /package/out/_next/static/{M5esRfAVlWSeBcfLV_jVr → RC8D0Hg382TugUN5Syz31}/_clientMiddlewareManifest.js +0 -0
  50. /package/out/_next/static/{M5esRfAVlWSeBcfLV_jVr → RC8D0Hg382TugUN5Syz31}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,2348,2413,e=>{"use strict";let t=1/1.2;e.s(["ZOOM_IN_FACTOR",0,t,"ZOOM_OUT_FACTOR",0,1.2,"attachDoubleClickFocus",0,function(e,t,s){let n=()=>{let t=e.pick(e.pointerX,e.pointerY);t?.hit&&t.pickedPoint&&s.setTarget(t.pickedPoint)};return t.addEventListener("dblclick",n),()=>t.removeEventListener("dblclick",n)},"disableWheelZoom",0,function(e){e.inputs.removeByType("ArcRotateCameraMouseWheelInput")},"resetFocus",0,function(e,t){e.setTarget(t.target),e.alpha=t.alpha,e.beta=t.beta,e.radius=t.radius},"stepZoom",0,function(e,t){let s=e.lowerRadiusLimit??.01,n=e.upperRadiusLimit??1/0;e.radius=Math.min(n,Math.max(s,e.radius*t))}],2348);var s=e.i(28100);e.s(["ZoomButtons",0,function({onZoom:e,onReset:n}){let i="grid h-8 w-8 place-items-center rounded-md border border-edge bg-ink/80 text-lg leading-none text-fg backdrop-blur transition hover:bg-ink hover:text-white";return(0,s.jsxs)("div",{className:"absolute right-3 top-3 flex flex-col gap-1",children:[(0,s.jsx)("button",{type:"button","aria-label":"Zoom in",className:i,onClick:()=>e(t),children:"+"}),(0,s.jsx)("button",{type:"button","aria-label":"Zoom out",className:i,onClick:()=>e(1.2),children:"−"}),n?(0,s.jsx)("button",{type:"button","aria-label":"Reset camera focus to center",title:"Reset focus to center",className:i,onClick:n,children:(0,s.jsxs)("svg",{viewBox:"0 0 16 16",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round","aria-hidden":"true",children:[(0,s.jsx)("circle",{cx:"8",cy:"8",r:"3"}),(0,s.jsx)("path",{d:"M8 1v2.5M8 12.5V15M1 8h2.5M12.5 8H15"})]})}):null]})}],2413)},76421,e=>{"use strict";var t=e.i(28100),s=e.i(11623),n=e.i(20880);async function i(e,t,s){let n=e.getReader(),i=new TextDecoder,r="";for(t.addEventListener("abort",()=>void n.cancel().catch(()=>{}));;){let{done:e,value:t}=await n.read();if(e)return;let a=(r+=i.decode(t,{stream:!0})).indexOf("\n\n");for(;a>=0;){let e=r.slice(0,a);r=r.slice(a+2);let t="message",n=[];for(let s of e.split("\n"))!s.startsWith(":")&&(s.startsWith("event:")?t=s.slice(6).trim():s.startsWith("data:")&&n.push(s.slice(5).replace(/^ /,"")));"event"===t&&n.length>0&&s(n.join("\n")),a=r.indexOf("\n\n")}}}var r=e.i(60614),a=e.i(2348),l=e.i(2413);let o=new Set,c=[{key:"interaction",label:"Clicks & picks",color:"#fb923c",types:new Set(["pointer_click","mesh_interaction"])},{key:"actors",label:"Scene actors",color:"#e879f9",types:new Set(["node_transform"])},{key:"custom",label:"Custom",color:"#34d399",types:new Set(["custom"])},{key:"camera",label:"Camera",color:"#38bdf8",types:new Set(["camera_sample"])},{key:"pointer",label:"Pointer",color:"#94a3b8",types:new Set(["pointer_move","pointer_down","pointer_up"])},{key:"perf",label:"Perf",color:"#a78bfa",types:new Set(["frame_perf"])},{key:"lifecycle",label:"Lifecycle",color:"#f472b6",types:new Set(["session_start","session_end","scene_change","focus_change","visibility_change","viewport_resize","context_lost","context_restored","runtime_error","capability_change","input_action","resource_sample","compile_stall","mesh_visibility","hover_dwell"])}];function u(e,t,s){let n=Math.max(1,s),i=new Map;c.forEach((e,t)=>{for(let s of e.types)i.set(s,t)});let r=c.map(()=>new Set);for(let s of e){let e=i.get(s.type);if(void 0===e)continue;let a=Math.min(1,Math.max(0,(s.ts-t)/n));r[e].add(Math.round(600*a))}return c.map((e,t)=>({key:e.key,label:e.label,color:e.color,marks:[...r[t]].sort((e,t)=>e-t).map(e=>e/600)})).filter(e=>e.marks.length>0)}function h(e){let t=Math.max(0,Math.round(e/1e3)),s=Math.floor(t/60);return`${s}:${(t%60).toString().padStart(2,"0")}`}function d(e){let t=e.slice(e.lastIndexOf("/")+1);return t.length>20?`${t.slice(0,19)}\u2026`:t}function p({lanes:e,duration:s,progress:n,onSeek:i,hiddenTypes:r}){let a=e.filter(e=>{let t=c.find(t=>t.key===e.key);if(!t)return!0;for(let e of t.types)if(!r.has(e))return!0;return!1});if(0===a.length)return null;let l=`${Math.min(100,Math.max(0,n/Math.max(1,s)*100))}%`;return(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsx)("div",{className:"mb-1.5 flex flex-wrap items-center gap-x-3 gap-y-1 text-[10px] text-fg-muted",children:a.map(e=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,t.jsx)("span",{"aria-hidden":!0,className:"inline-block h-2 w-2 rounded-sm",style:{backgroundColor:e.color}}),e.label,(0,t.jsxs)("span",{className:"tabular-nums text-fg-muted",children:["(",e.marks.length,")"]})]},e.key))}),(0,t.jsxs)("button",{type:"button","aria-label":"Event timeline — click to seek",className:"relative block w-full cursor-pointer select-none rounded-md border border-edge bg-ink/60 p-1.5 text-left",onClick:e=>{var t;let n;return t=e.clientX,void i(Math.min(1,Math.max(0,(t-(n=e.currentTarget.getBoundingClientRect()).left)/(n.width||1)))*s)},children:[(0,t.jsx)("div",{className:"flex flex-col gap-1",children:a.map(e=>(0,t.jsx)("div",{className:"relative h-2.5 rounded-sm bg-white/5",children:e.marks.map((s,n)=>(0,t.jsx)("span",{"aria-hidden":!0,className:"pointer-events-none absolute top-0 h-full w-px",style:{left:`${100*s}%`,backgroundColor:e.color,opacity:.85}},n))},e.key))}),(0,t.jsx)("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-1 w-px bg-saffron",style:{left:l}})]})]})}e.s(["SessionReplayView",0,function({baseUrl:c,apiKey:m,sessionId:f,hiddenTypes:g,isLive:b=!1}){let k=(0,s.useRef)(null),x=(0,s.useRef)(null),j=(0,s.useRef)(0),y=(0,s.useRef)(g??o),w=(0,s.useRef)(!1),v=(0,s.useRef)(null),_=(0,s.useRef)(!1),M=(0,s.useRef)(!1),C=(0,s.useRef)(null),P=(0,s.useRef)(0),N=(0,s.useRef)([]),z=(0,s.useRef)([]),S=(0,s.useRef)([]),R=(0,s.useRef)(!0),q=(0,s.useRef)("birdview"),$=(0,s.useRef)(null),L=(0,s.useRef)(null),A=(0,s.useRef)([]),I=(0,s.useRef)(null),T=(0,s.useRef)(null),[V,E]=(0,s.useState)("idle"),[O,W]=(0,s.useState)(null),[Z,F]=(0,s.useState)(0),[B,H]=(0,s.useState)(0),[K,U]=(0,s.useState)(!1),[D,X]=(0,s.useState)([]),[G,J]=(0,s.useState)([]),[Y,Q]=(0,s.useState)([]),[ee,et]=(0,s.useState)(!0),[es,en]=(0,s.useState)(!1),[ei,er]=(0,s.useState)("birdview"),[ea,el]=(0,s.useState)(null),[eo,ec]=(0,s.useState)(!1),[eu,eh]=(0,s.useState)(!1),[ed,ep]=(0,s.useState)(null);(0,s.useEffect)(()=>{R.current=ee},[ee]),(0,s.useEffect)(()=>{M.current=K},[K]),(0,s.useEffect)(()=>{_.current=es},[es]),(0,s.useEffect)(()=>{q.current=ei,w.current=!0},[ei]),(0,s.useEffect)(()=>{y.current=g??o,w.current=!0},[g]),(0,s.useEffect)(()=>{let t=k.current;if(!t)return;let s=!1,i=null;return E("loading"),W(null),U(!1),F(0),H(0),X([]),J([]),Q([]),el(null),$.current=null,N.current=[],z.current=[],S.current=[],j.current=0,I.current=null,A.current=[],L.current=null,ec(!1),eh(!1),ep(null),(async()=>{try{let[{Engine:l},{Scene:o},{ArcRotateCamera:h},{UniversalCamera:d},{HemisphericLight:p},{Vector3:g,Color3:k,Color4:T,Matrix:V},{MeshBuilder:O},{StandardMaterial:W},{fetchSessionEvents:Z,ReplayPlayer:B}]=await Promise.all([e.A(3905),e.A(94432),e.A(59694),e.A(68480),e.A(88004),e.A(27940),e.A(27124),e.A(14074),e.A(85461),e.A(18561)]),K=await Z({endpoint:c,apiKey:m,sessionId:f});if(s)return;if(0===K.length)return void E("empty");let D=K[0].ts,G=K[0].ts;for(let e of K)e.ts<D&&(D=e.ts),e.ts>G&&(G=e.ts);let Y=new n.CollectorApi(c,m),ee=await (0,r.mergeSceneProxies)(Y,{since:D-1,until:G+1});if(s)return;let et=[...K].sort((e,t)=>e.ts-t.ts),es=et[0].ts,ei=[],er=[],ea=new Map,eo=null;for(let e of et){let t=e.ts-es;if("camera_sample"===e.type){eo=[e.position[0],e.position[1],e.position[2]],ei.push({at:t,position:eo,direction:[e.direction[0],e.direction[1],e.direction[2]],..."number"==typeof e.fov?{fov:e.fov}:{}});continue}if("node_transform"===e.type){if(e.boneId)continue;let s=e.childPath?`${e.nodeId}/${e.childPath}`:e.nodeId,n=ea.get(s);n||(n=[],ea.set(s,n)),n.push({at:t,position:[e.position[0],e.position[1],e.position[2]]});continue}if("pointer_click"===e.type&&e.hitPoint){let s=e.ray?.origin??eo;if(!s)continue;er.push({at:t,type:"pointer_click",origin:[s[0],s[1],s[2]],hit:[e.hitPoint[0],e.hitPoint[1],e.hitPoint[2]],...e.hitMesh?{mesh:e.hitMesh}:{}});continue}if("mesh_interaction"===e.type&&e.point){if(!eo)continue;er.push({at:t,type:"mesh_interaction",origin:[eo[0],eo[1],eo[2]],hit:[e.point[0],e.point[1],e.point[2]],...e.mesh?{mesh:e.mesh}:{}})}}if(0===ei.length&&0===er.length&&0===ea.size)return void E("empty");let ec=new l(t,!0,{preserveDrawingBuffer:!1}),eu=new o(ec);eu.clearColor=new T(.04,.05,.07,1),L.current=eu;let eh=new h("birdview-cam",-Math.PI/2,.22,12,g.Zero(),eu);eh.attachControl(t,!0),(0,a.disableWheelZoom)(eh),x.current=eh,new p("replay-light",new g(0,1,0),eu);let ed=new d("replay-follow-cam",g.Zero(),eu);ed.minZ=.05,ed.fov=Math.PI/3,eu.activeCamera=eh;let ep="birdview",em=O.CreateGround("replay-ground",{width:20,height:20,subdivisions:20},eu),ef=new W("replay-ground-mat",eu);ef.diffuseColor=new k(.12,.14,.18),ef.wireframe=!0,em.material=ef;let eg=new Set(ea.keys()),eb=new Set(Array.from(eg,e=>e.slice(e.lastIndexOf("/")+1))),ek=[],ex=[],ej=new Set,ey=e=>{if(ej.has(e.name)||(e=>{if(e.path){for(let t of eg)if(e.path===t||e.path.endsWith(`/${t}`))return!0}return eb.has(e.name)})(e))return!1;ej.add(e.name);let t=e.aabb,s=Math.max(t[3]-t[0],.001),n=Math.max(t[4]-t[1],.001),i=Math.max(t[5]-t[2],.001),r=O.CreateBox(`replay-proxy-${e.name}`,{width:s,height:n,depth:i},eu);r.position=new g((t[0]+t[3])/2,(t[1]+t[4])/2,(t[2]+t[5])/2);let a=new W(`replay-proxy-mat-${e.name}`,eu);return a.wireframe=!0,a.disableLighting=!0,a.emissiveColor=new k(.32,.4,.52),a.alpha=.35,r.material=a,r.isPickable=!1,I.current&&r.setEnabled(!1),ex.push(r),ek.push({name:e.name,center:new g((t[0]+t[3])/2,t[4],(t[2]+t[5])/2)}),!0};for(let e of ee)ey(e);N.current=ek,z.current=ek.map(()=>null),J(ek.map(e=>e.name)),A.current=ex;let ew=async()=>{let e=await (0,r.mergeSceneProxies)(Y,{since:D-1}).catch(()=>null);if(s||!e)return;let t=!1;for(let s of e)ey(s)&&(t=!0);t&&(N.current=ek,z.current=ek.map((e,t)=>z.current[t]??null),J(ek.map(e=>e.name)),w.current=!0)},ev=[[.91,.47,.98],[.4,.95,.6],[.98,.8,.3],[.45,.85,1]],e_=e=>{let t=e.indexOf("/");return -1===t?e:e.slice(0,t)},eM=[],eC=new Map,eP=0,eN=(e,t,s)=>{let n=O.CreateSphere(`replay-actor-${e}`,{diameter:.5,segments:12},eu),i=new W(`replay-actor-mat-${e}`,eu);i.disableLighting=!0;let r=ev[eP%ev.length];i.emissiveColor=new k(r[0],r[1],r[2]),n.material=i,n.isPickable=!1,n.isVisible=!1,eP++;let a={key:e,mesh:n,samples:s,driveKey:t};return eM.push(a),eC.set(e,a),a},ez=new Map,eS=new Map;for(let[e,t]of ea){if(0===t.length)continue;let s=e_(e);if(e===s)ez.set(s,t);else{let n=eS.get(s);(!n||t.length>n.samples.length)&&eS.set(s,{key:e,samples:t})}}for(let e of new Set([...ez.keys(),...eS.keys()])){let t=ez.get(e);if(t)eN(e,e,t);else{let t=eS.get(e);eN(e,t.key,t.samples)}}S.current=eM.map(()=>null),Q(eM.map(e=>e.key));let eR=(e,t)=>{if(0===e.length||t<e[0].at)return null;let s=0,n=e.length-1,i=-1;for(;s<=n;){let r=s+n>>1;e[r].at<=t?(i=r,s=r+1):n=r-1}if(i<0)return null;let r=e[i],a=e[i+1];if(!a)return r.position;let l=a.at-r.at;if(l<=0)return r.position;let o=Math.max(0,Math.min(1,(t-r.at)/l));return[r.position[0]+(a.position[0]-r.position[0])*o,r.position[1]+(a.position[1]-r.position[1])*o,r.position[2]+(a.position[2]-r.position[2])*o]},eq=1,e$=1.4,eL=O.CreateSphere("replay-camera-origin",{diameter:.35,segments:12},eu),eA=new W("replay-camera-origin-mat",eu);eA.disableLighting=!0,eA.emissiveColor=new k(.6,.9,1),eL.material=eA;let eI=O.CreateLines("replay-camera-frustum",{points:[g.Zero(),new g(0,0,1)]},eu);eI.color=new k(.7,.95,1),eI.isPickable=!1;let eT=O.CreateCylinder("replay-camera-cone",{height:1,diameterTop:0,diameterBottom:1,tessellation:24},eu);eT.bakeTransformIntoVertices(V.RotationX(-Math.PI/2).multiply(V.Translation(0,0,.5)));let eV=new W("replay-camera-cone-mat",eu);eV.disableLighting=!0,eV.emissiveColor=new k(.4,.78,1),eV.alpha=.16,eV.backFaceCulling=!1,eT.material=eV,eT.isPickable=!1,eT.isVisible=!1;let eE=(e,t,s,n)=>{if(e?.dispose(),0===s.length)return null;let i=O.CreateLineSystem(t,{lines:s,...n?{colors:n,useVertexAlpha:!0}:{}},eu);return i.isPickable=!1,i},eO=null,eW=null,eZ=null,eF=()=>{let e=y.current,t=[],s=[];for(let n of er){if(e.has(n.type))continue;let[i,r,a]=n.hit,l="mesh_interaction"===n.type?new T(.45,.85,1,.32):new T(1,.7,.35,.32);t.push([new g(i-.1,r,a),new g(i+.1,r,a)]),t.push([new g(i,r-.1,a),new g(i,r+.1,a)]),t.push([new g(i,r,a-.1),new g(i,r,a+.1)]),s.push([l,l],[l,l],[l,l])}eZ=eE(eZ,"replay-persistent-marks",t,s)};eF();let eB=O.CreateSphere("replay-glow",{diameter:1,segments:12},eu),eH=new W("replay-glow-mat",eu);eH.disableLighting=!0,eH.emissiveColor=new k(1,.62,.2),eH.alpha=0,eB.material=eH,eB.isPickable=!1,eB.isVisible=!1;let eK=1/0,eU=1/0,eD=1/0,eX=-1/0,eG=-1/0,eJ=-1/0,eY=!1,eQ=e=>{eK=Math.min(eK,e[0]),eU=Math.min(eU,e[1]),eD=Math.min(eD,e[2]),eX=Math.max(eX,e[0]),eG=Math.max(eG,e[1]),eJ=Math.max(eJ,e[2])},e0=()=>{let e;if(eY||!Number.isFinite(eK))return;let t=(eK+eX)/2,s=(eU+eG)/2,n=(eD+eJ)/2,i=eX-eK,r=eG-eU,a=eJ-eD,l=Math.sqrt(i*i+r*r+a*a);eh.setTarget(new g(t,s,n)),e=1.3*l,eh.radius=Number.isFinite(e)?Math.max(8,e):12,eY=!0};for(let e of ei)eQ(e.position);for(let e of er)eQ(e.origin),eQ(e.hit);for(let e of ea.values())for(let t of e)eQ(t.position);for(let e of ee)eQ(e.aabb.slice(0,3)),eQ(e.aabb.slice(3,6));e0();{let e=eX-eK,t=eG-eU,s=eJ-eD,n=Number.isFinite(e)?Math.sqrt(e*e+t*t+s*s):0,i=Math.min(Math.max(.035*n,.45),Math.max(.45,.18*n));eq=i/.35,e$=Math.max(.16*n,3.2*i,1.4),eL.scaling.setAll(eq)}let e1=-1,e2=e=>{var n;let i=w.current;if(!i&&e===e1)return;w.current=!1,e1=e,i&&eF();let r=y.current;(n=q.current)!==ep&&(ep=n,"follow"===n?(eh.detachControl(),eu.activeCamera=ed):(eu.activeCamera=eh,eh.attachControl(t,!0)));let a="follow"===q.current,l=r.has("camera_sample")?null:(e=>{if(0===ei.length)return null;let t=0,s=ei.length-1,n=-1;for(;t<=s;){let i=t+s>>1;ei[i].at<=e?(n=i,t=i+1):s=i-1}return n>=0?ei[n]:null})(e);if(l){eL.position.set(l.position[0],l.position[1],l.position[2]);let e=l.direction,t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2])||1,s=e$,n=new g(l.position[0]+e[0]/t*s,l.position[1]+e[1]/t*s,l.position[2]+e[2]/t*s);if(a)eL.isVisible=!1,eI.isVisible=!1,eT.isVisible=!1,ed.position.set(l.position[0],l.position[1],l.position[2]),ed.setTarget(n),l.fov&&l.fov>0&&(ed.fov=l.fov);else{eL.isVisible=!0,eI.isVisible=!0,eI=O.CreateLines("replay-camera-frustum",{points:[eL.position.clone(),n],instance:eI},eu);let e=(l.fov&&l.fov>0?l.fov:Math.PI/3)/2,t=s*Math.tan(e);eT.isVisible=!0,eT.position.copyFrom(eL.position),eT.lookAt(n),eT.scaling.set(2*t,2*t,s)}}else eL.isVisible=!1,eI.isVisible=!1,eT.isVisible=!1;let o=r.has("node_transform");for(let t of eM){let s=o?null:eR(t.samples,e);if(!s){t.mesh.isVisible=!1;continue}t.mesh.isVisible=!0,t.mesh.position.set(s[0],s[1],s[2])}let c=er.filter(t=>!r.has(t.type)&&t.at<=e&&t.at>=e-2200),u=[],h=[],d=[],p=[],m=null;for(let t of c){let s=e-t.at,n=Math.max(0,Math.min(1,1-s/2200)),i=new T(1,.62,.2,.18+.72*n),r=new g(t.origin[0],t.origin[1],t.origin[2]),a=new g(t.hit[0],t.hit[1],t.hit[2]);u.push([r,a]),h.push([i,i]);let l=.12+.08*n;d.push([new g(a.x-l,a.y,a.z),new g(a.x+l,a.y,a.z)]),d.push([new g(a.x,a.y-l,a.z),new g(a.x,a.y+l,a.z)]),d.push([new g(a.x,a.y,a.z-l),new g(a.x,a.y,a.z+l)]);let o=new T(1,.78,.42,.22+.72*n);if(p.push([o,o],[o,o],[o,o]),s<=900){let e=1-s/900;(!m||e>m.t)&&(m={hit:t.hit,t:e})}}if(m){let e=.25+.9*m.t;eB.isVisible=!0,eB.scaling.set(e,e,e),eB.position.set(m.hit[0],m.hit[1],m.hit[2]),eH.alpha=.12+.5*m.t}else eB.isVisible=!1;let f=null,b=-1/0;for(let e of c)e.mesh&&e.at>b&&(b=e.at,f=e.mesh);f!==$.current&&($.current=f,s||el(f)),eO=eE(eO,"replay-trail-lines",u,h),eW=eE(eW,"replay-trail-hits",d,p)},e3=et.length>0?et[et.length-1].ts-es:0,e5=e3,e4=et.length>0?et[et.length-1].ts:-1/0,e8=et.map(e=>({type:e.type,ts:e.ts})),e6=0,e7=null;if(b)v.current=null,C.current=e=>{if(s)return;let t="number"==typeof e.ts?e.ts:NaN;if(!Number.isFinite(t)||t<=e4)return;e4=t;let n=t-es;if(n>e5&&(e5=n),n>e3&&(e3=n),e8.push({type:e.type,ts:t}),"camera_sample"===e.type){let t=e.position,s=e.direction;if(t&&s){let i=[t[0],t[1],t[2]];eo=i;let r="number"==typeof e.fov?e.fov:void 0;ei.push({at:n,position:i,direction:[s[0],s[1],s[2]],...void 0!==r?{fov:r}:{}}),eQ(i),e0()}}else if("pointer_click"===e.type){let t=e.hitPoint,s=e.ray,i=s?.origin??eo;if(t&&i){let s="string"==typeof e.hitMesh?e.hitMesh:void 0;er.push({at:n,type:"pointer_click",origin:[i[0],i[1],i[2]],hit:[t[0],t[1],t[2]],...s?{mesh:s}:{}}),eQ(t),w.current=!0}}else if("mesh_interaction"===e.type){let t=e.point;if(t&&eo){let s="string"==typeof e.mesh?e.mesh:void 0;er.push({at:n,type:"mesh_interaction",origin:[eo[0],eo[1],eo[2]],hit:[t[0],t[1],t[2]],...s?{mesh:s}:{}}),eQ(t),w.current=!0}}else if("node_transform"===e.type){let t=e.position;if(e.boneId||"string"!=typeof e.nodeId||!t)return;let s="string"==typeof e.childPath?e.childPath:void 0,i=s?`${e.nodeId}/${s}`:e.nodeId;((e,t)=>{let s=e_(e),n=eC.get(s);if(!n){n=eN(s,e,[]);let t=S.current;S.current=eM.map((e,s)=>t[s]??null),Q(eM.map(e=>e.key))}e===n.driveKey?n.samples.push(t):e===s&&n.driveKey!==s&&(n.driveKey=s,n.samples.length=0,n.samples.push(t))})(i,{at:n,position:[t[0],t[1],t[2]]}),eQ(t)}let i=performance.now();i-e6>250&&(e6=i,X(u(e8,es,Math.max(1,e3)))),_.current&&n>j.current&&(j.current=n)},P.current=e3,j.current=e3,_.current=!0,en(!0),U(!1),F(e3),H(e3),X(u(e8,es,Math.max(1,e3))),e2(e3),e7=setInterval(()=>void ew(),4e3);else{let e=new B(K,{reset(){},apply(){}},{onProgress:e=>{s||(j.current=e,H(e))},onComplete:()=>{s||U(!1)}});v.current=e,F(e.durationMs),X(u(et,es,e.durationMs)),e.update(0),e2(0)}let e9=V.Identity(),te=new Map,tt=e=>{let t=te.get(e);if(t)return t;let s={w:e.offsetWidth||60,h:e.offsetHeight||16};return e.offsetWidth>0&&te.set(e,s),s},ts=performance.now(),tn=0;ec.runRenderLoop(()=>{if(b){let e=performance.now(),t=e-ts;if(ts=e,_.current)j.current+=t,j.current>e3&&(e3=j.current),P.current=e3,H(j.current),e-tn>250&&(tn=e,F(e3));else if(M.current){let e=j.current+t;e>=e3&&(e=e3),j.current=e,H(e)}}e2(j.current),eu.render(),(()=>{if(!R.current)return;let e=t.clientWidth||ec.getRenderWidth(),s=t.clientHeight||ec.getRenderHeight(),n=eh.viewport.toGlobal(e,s),i=eu.getTransformMatrix(),r=$.current,a=e=>e.slice(e.lastIndexOf("/")+1),l=e=>!!r&&(r===e||a(r)===a(e)||e.endsWith(`/${r}`)||r.endsWith(`/${e}`)),o=[],c=N.current,u=z.current;for(let e=0;e<c.length;e++){let t=u[e];if(!t)continue;let s=g.Project(c[e].center,e9,i,n);if(s.z<0||s.z>1){t.style.opacity="0";continue}o.push({el:t,x:s.x,y:s.y,liftPct:140,highlighted:l(c[e].name)})}let h=S.current;for(let e=0;e<eM.length;e++){let t=h[e];if(!t)continue;let s=eM[e].mesh;if(!s.isVisible){t.style.opacity="0";continue}let r=g.Project(s.position,e9,i,n);if(r.z<0||r.z>1){t.style.opacity="0";continue}o.push({el:t,x:r.x,y:r.y,liftPct:180,highlighted:l(eM[e].key)})}o.sort((e,t)=>e.highlighted!==t.highlighted?e.highlighted?-1:1:e.y-t.y||e.x-t.x);let d=[];for(let e of o){let{w:t,h:s}=tt(e.el),n=e.x-t/2,i=e.x+t/2,r=e.y-e.liftPct/100*s,a=r,l=!0,o=0;for(;l&&o++<256;)for(let e of(l=!1,d))n<e.right&&i>e.left&&a<e.bottom&&a+s>e.top&&(a=e.bottom+1,l=!0);d.push({left:n,right:i,top:a,bottom:a+s});let c=a-r;e.el.style.opacity="1",e.el.style.zIndex=e.highlighted?"10":"",e.el.style.transform=`translate(${e.x}px, ${e.y+c}px) translate(-50%, -${e.liftPct}%)`}})()});let ti=()=>ec.resize();window.addEventListener("resize",ti),E("ready"),i=()=>{window.removeEventListener("resize",ti),e7&&clearInterval(e7),C.current=null,v.current?.pause(),eI.dispose(),eT.dispose(),eO?.dispose(),eW?.dispose(),eZ?.dispose(),eB.dispose(),I.current?.dispose(),I.current=null,A.current=[],L.current=null,eu.dispose(),ec.dispose(),x.current=null,v.current=null}}catch(e){if(s)return;E("error"),W(e instanceof Error?e.message:"Failed to load replay.")}})(),()=>{s=!0,i?.()}},[c,m,f,b]);let em=(0,s.useCallback)(()=>{if(b){en(!1),_.current=!1,U(e=>{let t=!e;return M.current=t,t});return}let e=v.current;e&&U(t=>(t?e.pause():e.play(),!t))},[b]),ef=(0,s.useCallback)(e=>{if(b){en(!1),_.current=!1,U(!1),M.current=!1,j.current=e,H(e);return}let t=v.current;t&&(t.pause(),t.seek(e),U(!1),j.current=e,H(e))},[b]),eg=(0,s.useCallback)(()=>{en(!0),_.current=!0,U(!1),M.current=!1,j.current=P.current,H(P.current)},[]),{gated:eb}=function(e,t,r,a,l,o){let[c,u]=(0,s.useState)("idle"),[h,d]=(0,s.useState)(!1),[p,m]=(0,s.useState)(0),f=(0,s.useRef)(l),g=(0,s.useRef)(o);return f.current=l,g.current=o,(0,s.useEffect)(()=>{if(!a||!t||!e||!r)return void u("idle");let s=new n.CollectorApi(e,t),l=!1,o=0,c=null,h=null;d(!1),m(0);let p=()=>{if(l)return;u("reconnecting");let e=Math.min(1e3*2**o,15e3);o+=1,h=setTimeout(()=>void b(),e)},b=async()=>{let e;if(!l){u(0===o?"connecting":"reconnecting"),g.current(),m(0);try{({token:e}=await s.liveToken())}catch{p();return}if(!l){c=new AbortController;try{let t=await fetch(s.liveSessionUrl(e,r),{headers:{accept:"text/event-stream"},cache:"no-store",signal:c.signal});if(403===t.status){d(!0),u("idle");return}if(!t.ok||!t.body)return void p();o=0,u("open"),await i(t.body,c.signal,e=>{try{f.current(JSON.parse(e)),m(e=>e+1)}catch{}}),l||p()}catch{l||p()}}}};return b(),()=>{l=!0,h&&clearTimeout(h),c?.abort()}},[e,t,r,a]),{status:c,gated:h,count:p}}(c,m,f,b&&"ready"===V,e=>C.current?.(e),()=>{}),ek=(0,s.useCallback)(e=>{if(!ea)return!1;if(ea===e)return!0;let t=e=>e.slice(e.lastIndexOf("/")+1);return t(ea)===t(e)||e.endsWith(`/${ea}`)||ea.endsWith(`/${e}`)},[ea]),ex=(0,s.useCallback)(async t=>{let s=L.current;if(s){eh(!0),ep(`Loading ${t.name}…`);try{let[{loadSceneBackdrop:n}]=await Promise.all([e.A(3633),e.A(91064)]);if(L.current!==s)return;I.current?.dispose();let i=await n(s,t);if(L.current!==s)return void i.dispose();for(let e of(I.current=i,A.current))e.setEnabled(!1);w.current=!0,ec(!0),ep(`Loaded ${t.name} (${i.meshes.length} meshes).`)}catch(e){ep(e instanceof Error?e.message:"Could not load model.")}finally{eh(!1)}}},[]),ej=(0,s.useCallback)(e=>{let t=e.target.files?.[0];e.target.value="",t&&ex(t)},[ex]),ey=(0,s.useCallback)(()=>{for(let e of(I.current?.dispose(),I.current=null,A.current))e.setEnabled(!0);w.current=!0,ec(!1),ep(null)},[]);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("canvas",{ref:k,className:"aspect-video w-full rounded-lg border border-edge bg-ink"}),(0,t.jsxs)("div",{className:`pointer-events-none absolute inset-0 overflow-hidden ${ee?"":"hidden"}`,children:[G.map((e,s)=>(0,t.jsx)("div",{title:e,ref:e=>{e&&(z.current[s]=e)},className:`absolute left-0 top-0 whitespace-nowrap rounded px-1.5 py-0.5 text-[10px] font-medium opacity-0 transition-colors ${ek(e)?"bg-amber/30 text-white ring-2 ring-amber shadow-lg shadow-amber/30":"bg-ink/80 text-saffron ring-1 ring-amber/30"}`,children:d(e)},e)),Y.map((e,s)=>(0,t.jsx)("div",{title:e,ref:e=>{e&&(S.current[s]=e)},className:`absolute left-0 top-0 whitespace-nowrap rounded px-1.5 py-0.5 text-[10px] font-medium opacity-0 transition-colors ${ek(e)?"bg-fuchsia-400/30 text-white ring-2 ring-fuchsia-300 shadow-lg shadow-fuchsia-500/30":"bg-ink/80 text-fuchsia-300 ring-1 ring-fuchsia-400/30"}`,children:d(e)},`actor-${e}`))]}),"ready"===V&&(G.length>0||Y.length>0)?(0,t.jsx)("button",{type:"button",onClick:()=>et(e=>!e),className:"absolute left-3 top-3 rounded-md border border-edge bg-ink/80 px-2 py-1 text-xs font-medium text-fg transition hover:bg-ink hover:text-white","aria-pressed":ee?"true":"false",children:ee?"Hide labels":"Show labels"}):null,"ready"===V&&"birdview"===ei?(0,t.jsx)(l.ZoomButtons,{onZoom:e=>x.current&&(0,a.stepZoom)(x.current,e)}):null,"ready"!==V?(0,t.jsx)("div",{className:"pointer-events-none absolute inset-0 grid place-items-center text-sm text-fg-muted",children:"loading"===V?"Loading replay…":"empty"===V?"No replayable events (raw retention may be disabled).":"error"===V?O??"Replay unavailable.":null}):null]}),(0,t.jsxs)("div",{className:"mt-3 flex items-center gap-3",children:[(0,t.jsx)("button",{type:"button",onClick:em,disabled:"ready"!==V,className:"rounded-md bg-amber px-3 py-1.5 text-sm font-medium text-ink transition hover:bg-ember disabled:opacity-40",children:K?"Pause":"Play"}),b?(0,t.jsxs)("button",{type:"button",onClick:eg,disabled:"ready"!==V,"aria-pressed":es?"true":"false",className:`flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-sm font-medium transition disabled:opacity-40 ${es?"bg-rose-500/20 text-rose-300 ring-1 ring-rose-400/40":"border border-edge text-fg hover:bg-ink hover:text-white"}`,children:[(0,t.jsx)("span",{className:`inline-block h-2 w-2 rounded-full ${es?"animate-pulse bg-rose-400":"bg-fg-muted"}`}),es?"LIVE":"Resume live"]}):null,(0,t.jsxs)("div",{role:"group","aria-label":"Camera view",className:"flex items-center rounded-md border border-edge p-0.5 text-xs font-medium",children:[(0,t.jsx)("button",{type:"button",onClick:()=>er("birdview"),disabled:"ready"!==V,"aria-pressed":"birdview"===ei?"true":"false",className:`rounded px-2 py-1 transition disabled:opacity-40 ${"birdview"===ei?"bg-amber text-ink":"text-fg hover:text-white"}`,children:"Birdview"}),(0,t.jsx)("button",{type:"button",onClick:()=>er("follow"),disabled:"ready"!==V,"aria-pressed":"follow"===ei?"true":"false",className:`rounded px-2 py-1 transition disabled:opacity-40 ${"follow"===ei?"bg-amber text-ink":"text-fg hover:text-white"}`,children:"Follow camera"})]}),(0,t.jsx)("span",{className:"w-12 text-right font-mono text-xs tabular-nums text-fg-muted",children:h(B)}),(0,t.jsx)("input",{type:"range",min:0,max:Math.max(1,Z),step:50,value:Math.min(B,Z),onChange:e=>ef(Number(e.target.value)),disabled:"ready"!==V,className:"flex-1 accent-amber"}),(0,t.jsx)("span",{className:"w-12 font-mono text-xs tabular-nums text-fg-muted",children:h(Z)})]}),"ready"===V?(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-3",children:[(0,t.jsx)("input",{ref:T,type:"file",accept:".glb,.gltf,model/gltf-binary,model/gltf+json",onChange:ej,className:"hidden"}),(0,t.jsx)("button",{type:"button",onClick:()=>T.current?.click(),disabled:eu,className:"rounded-md border border-edge bg-ink/80 px-2.5 py-1.5 text-xs font-medium text-fg transition hover:bg-ink hover:text-white disabled:opacity-40",children:eu?"Loading model…":eo?"Replace model (.glb)":"Load model (.glb)"}),eo?(0,t.jsx)("button",{type:"button",onClick:ey,disabled:eu,className:"rounded-md border border-edge px-2.5 py-1.5 text-xs font-medium text-fg transition hover:bg-ink hover:text-white disabled:opacity-40",children:"Remove model"}):null,ed?(0,t.jsx)("span",{className:"text-xs text-fg-muted",role:"status",children:ed}):(0,t.jsx)("span",{className:"text-xs text-fg-muted",children:"Load a glTF model to replace the wireframe boxes with your real scene."})]}):null,"ready"===V?(0,t.jsx)(p,{lanes:D,duration:Z,progress:B,onSeek:ef,hiddenTypes:g??o}):null,b&&eb&&"ready"===V?(0,t.jsx)("p",{className:"mt-2 text-xs text-fg-muted",children:"Live follow is unavailable — raw session retention is disabled on the collector."}):null]})}],76421)},3905,e=>{e.v(t=>Promise.all(["static/chunks/3pdpaqzwhhijn.js","static/chunks/08bm3ye5govev.js","static/chunks/0g6u34xkzrpjn.js","static/chunks/25ctnyh7njp-d.js","static/chunks/2gh4z57fem0_v.js","static/chunks/3vaho-xrtuchd.js","static/chunks/0g7p8zp2kxve5.js"].map(t=>e.l(t))).then(()=>t(66232)))},94432,e=>{e.v(t=>Promise.all(["static/chunks/2kje_jvmwsvwo.js","static/chunks/1j--a56ji33_x.js","static/chunks/3pdpaqzwhhijn.js","static/chunks/2npk7tr63h7rl.js","static/chunks/3vaho-xrtuchd.js","static/chunks/3g_h_00xs9u59.js","static/chunks/1vzmzrjhlm1q5.js","static/chunks/25ctnyh7njp-d.js","static/chunks/1vpcaaf-0dn7q.js"].map(t=>e.l(t))).then(()=>t(92494)))},59694,e=>{e.v(t=>Promise.all(["static/chunks/1j--a56ji33_x.js","static/chunks/0oap0o8a8a_cl.js","static/chunks/0f_nv15a8q415.js","static/chunks/1vzmzrjhlm1q5.js","static/chunks/3pdpaqzwhhijn.js","static/chunks/245h82k-g1nxr.js","static/chunks/3ovd8o_usay7j.js","static/chunks/3vaho-xrtuchd.js","static/chunks/1vpcaaf-0dn7q.js","static/chunks/25ctnyh7njp-d.js","static/chunks/2npk7tr63h7rl.js","static/chunks/2wdk-kbm-n-m5.js"].map(t=>e.l(t))).then(()=>t(67186)))},68480,e=>{e.v(t=>Promise.all(["static/chunks/1--kelnig7pxx.js","static/chunks/1j--a56ji33_x.js","static/chunks/1vkww9l6lgqag.js","static/chunks/3pdpaqzwhhijn.js","static/chunks/2vaoftqgc44cg.js","static/chunks/3vaho-xrtuchd.js","static/chunks/3rl45k759wfi1.js","static/chunks/25ctnyh7njp-d.js"].map(t=>e.l(t))).then(()=>t(25062)))},88004,e=>{e.v(t=>Promise.all(["static/chunks/2p8dbh81chhon.js","static/chunks/1oara6fkfvgs3.js","static/chunks/1vzmzrjhlm1q5.js","static/chunks/25ctnyh7njp-d.js","static/chunks/3pdpaqzwhhijn.js"].map(t=>e.l(t))).then(()=>t(15768)))},27940,e=>{e.v(t=>Promise.all(["static/chunks/0w0sx062qmcsh.js","static/chunks/25ctnyh7njp-d.js","static/chunks/3pdpaqzwhhijn.js"].map(t=>e.l(t))).then(()=>t(23235)))},27124,e=>{e.v(t=>Promise.all(["static/chunks/1par9m038tiov.js","static/chunks/1j--a56ji33_x.js","static/chunks/2j-sax2xfdv7l.js","static/chunks/3rx1jhuop94-l.js","static/chunks/3pdpaqzwhhijn.js","static/chunks/0gwa154w_0wuh.js","static/chunks/0oap0o8a8a_cl.js","static/chunks/0f_nv15a8q415.js","static/chunks/3vaho-xrtuchd.js","static/chunks/2wdk-kbm-n-m5.js","static/chunks/1vzmzrjhlm1q5.js","static/chunks/3g_h_00xs9u59.js","static/chunks/1vpcaaf-0dn7q.js","static/chunks/25ctnyh7njp-d.js","static/chunks/2npk7tr63h7rl.js","static/chunks/10w513bgw-bgi.js"].map(t=>e.l(t))).then(()=>t(70928)))},14074,e=>{e.v(t=>Promise.all(["static/chunks/0n0thxa3jkour.js","static/chunks/1tdg_eolxlcdl.js","static/chunks/1j--a56ji33_x.js","static/chunks/1vzmzrjhlm1q5.js","static/chunks/0vddljjnmozzx.js","static/chunks/3pdpaqzwhhijn.js","static/chunks/1vpcaaf-0dn7q.js","static/chunks/3vaho-xrtuchd.js","static/chunks/0f_nv15a8q415.js","static/chunks/3g_h_00xs9u59.js","static/chunks/2npk7tr63h7rl.js","static/chunks/25ctnyh7njp-d.js"].map(t=>e.l(t))).then(()=>t(87566)))},85461,e=>{e.v(t=>Promise.all(["static/chunks/0n8n481szj90g.js"].map(t=>e.l(t))).then(()=>t(57092)))},18561,e=>{e.v(t=>Promise.all(["static/chunks/1j--a56ji33_x.js","static/chunks/1vkww9l6lgqag.js","static/chunks/3pdpaqzwhhijn.js","static/chunks/2npk7tr63h7rl.js","static/chunks/117ys3lltfmcu.js","static/chunks/25ctnyh7njp-d.js","static/chunks/1vzmzrjhlm1q5.js","static/chunks/3g_h_00xs9u59.js","static/chunks/1vpcaaf-0dn7q.js","static/chunks/3vaho-xrtuchd.js"].map(t=>e.l(t))).then(()=>t(85106)))},3633,e=>{e.v(t=>Promise.all(["static/chunks/2l_oqx9idxcs8.js","static/chunks/25ctnyh7njp-d.js"].map(t=>e.l(t))).then(()=>t(97900)))},91064,e=>{e.v(t=>Promise.all(["static/chunks/17v12p4sfraa0.js","static/chunks/1j--a56ji33_x.js","static/chunks/3rx1jhuop94-l.js","static/chunks/0oap0o8a8a_cl.js","static/chunks/17dmbt396_tyq.js","static/chunks/0vddljjnmozzx.js","static/chunks/17d1isrw8gtnb.js","static/chunks/0gwa154w_0wuh.js","static/chunks/3g4e2txsrb2p2.js","static/chunks/3urd7r018nel4.js","static/chunks/2zljunurdji0q.js","static/chunks/3pdpaqzwhhijn.js","static/chunks/2h1uw3cluvmmo.js","static/chunks/3vaho-xrtuchd.js","static/chunks/2npk7tr63h7rl.js","static/chunks/3g_h_00xs9u59.js","static/chunks/0f_nv15a8q415.js","static/chunks/1vpcaaf-0dn7q.js","static/chunks/40acif2eh_unv.js","static/chunks/3r2hbpm4wju16.js","static/chunks/25ctnyh7njp-d.js","static/chunks/2wdk-kbm-n-m5.js","static/chunks/3rl45k759wfi1.js","static/chunks/1st81sc3owvku.js"].map(t=>e.l(t))).then(()=>t(83572)))}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,2348,2413,t=>{"use strict";let e=1/1.2;t.s(["ZOOM_IN_FACTOR",0,e,"ZOOM_OUT_FACTOR",0,1.2,"attachDoubleClickFocus",0,function(t,e,s){let a=()=>{let e=t.pick(t.pointerX,t.pointerY);e?.hit&&e.pickedPoint&&s.setTarget(e.pickedPoint)};return e.addEventListener("dblclick",a),()=>e.removeEventListener("dblclick",a)},"disableWheelZoom",0,function(t){t.inputs.removeByType("ArcRotateCameraMouseWheelInput")},"resetFocus",0,function(t,e){t.setTarget(e.target),t.alpha=e.alpha,t.beta=e.beta,t.radius=e.radius},"stepZoom",0,function(t,e){let s=t.lowerRadiusLimit??.01,a=t.upperRadiusLimit??1/0;t.radius=Math.min(a,Math.max(s,t.radius*e))}],2348);var s=t.i(28100);t.s(["ZoomButtons",0,function({onZoom:t,onReset:a}){let n="grid h-8 w-8 place-items-center rounded-md border border-edge bg-ink/80 text-lg leading-none text-fg backdrop-blur transition hover:bg-ink hover:text-white";return(0,s.jsxs)("div",{className:"absolute right-3 top-3 flex flex-col gap-1",children:[(0,s.jsx)("button",{type:"button","aria-label":"Zoom in",className:n,onClick:()=>t(e),children:"+"}),(0,s.jsx)("button",{type:"button","aria-label":"Zoom out",className:n,onClick:()=>t(1.2),children:"−"}),a?(0,s.jsx)("button",{type:"button","aria-label":"Reset camera focus to center",title:"Reset focus to center",className:n,onClick:a,children:(0,s.jsxs)("svg",{viewBox:"0 0 16 16",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round","aria-hidden":"true",children:[(0,s.jsx)("circle",{cx:"8",cy:"8",r:"3"}),(0,s.jsx)("path",{d:"M8 1v2.5M8 12.5V15M1 8h2.5M12.5 8H15"})]})}):null]})}],2413)},25476,t=>{"use strict";t.s(["attachMeshHover",0,function(t,e,s){let a=0,n=null,c=e=>{let c=e.offsetX,r=e.offsetY;a||(a=requestAnimationFrame(()=>{var e,i;let l;a=0;let h=t.pick(c,r,t=>t.isPickable&&t.isEnabled()),o=h?.pickedMesh?(e=h.pickedMesh,i=h.thinInstanceIndex??-1,(l=e.metadata)?i>=0&&l.hoverLabels?l.hoverLabels[i]??null:l.hoverLabel??null:null):null;o?s({label:o,x:c,y:r}):null!==n&&s(null),n=o}))},r=()=>{a&&(cancelAnimationFrame(a),a=0),null!==n&&(n=null,s(null))};return e.addEventListener("pointermove",c),e.addEventListener("pointerleave",r),()=>{e.removeEventListener("pointermove",c),e.removeEventListener("pointerleave",r),a&&cancelAnimationFrame(a)}}])},53993,t=>{"use strict";var e=t.i(28100),s=t.i(11623),a=t.i(56054),n=t.i(2348),c=t.i(25476),r=t.i(18637),i=t.i(2413);function l({shape:t,onChange:s}){let a=t=>`h-8 px-2.5 text-xs font-medium leading-none transition first:rounded-l-md last:rounded-r-md ${t?"bg-ink text-white":"bg-ink/80 text-fg hover:text-white"}`,n="sphere"===t,c="cube"===t;return(0,e.jsxs)("div",{className:"absolute left-3 top-3 flex overflow-hidden rounded-md border border-edge backdrop-blur",role:"group","aria-label":"Voxel marker shape",children:[(0,e.jsx)("button",{type:"button",className:a(n),"aria-pressed":n,onClick:()=>s("sphere"),children:"Spheres"}),(0,e.jsx)("button",{type:"button",className:a(c),"aria-pressed":c,onClick:()=>s("cube"),children:"Cubes"})]})}t.s(["WorldHeatmap3DView",0,function({voxels:h,cellSize:o,proxyMeshes:u=[],legendTitle:d="Pointer-hit density",legendLow:j="few hits",legendHigh:p="most hits",legendNote:m="Each marker is a voxel where the pointer hit your scene. Color & size scale with hits, normalized to the 95th-percentile cell so a few hotspots don't wash out the rest.",emptyLabel:k="No 3D hit-points in range.",totals:b,voxelLabels:v}){let f=(0,s.useRef)(null),x=(0,s.useRef)(null),g=(0,s.useRef)(null),[w,y]=(0,s.useState)("loading"),[z,q]=(0,s.useState)(null),[_,M]=(0,s.useState)("sphere"),[L,A]=(0,s.useState)(null),C=(0,s.useRef)(h),P=(0,s.useRef)(u),R=(0,s.useRef)(v);C.current=h,P.current=u,R.current=v;let S=(0,s.useRef)(null),F=h.length>0||u.length>0;(0,s.useEffect)(()=>{let e=f.current;if(!e)return;if(!F)return void y("empty");let s=!1,r=null;return y("loading"),q(null),(async()=>{try{let[{Engine:i},{Scene:l},{ArcRotateCamera:h},{HemisphericLight:u},{Vector3:d,Color3:j,Color4:p,Matrix:m},{MeshBuilder:k},{StandardMaterial:b}]=await Promise.all([t.A(3905),t.A(94432),t.A(59694),t.A(88004),t.A(27940),t.A(27124),t.A(14074),t.A(35983),t.A(18561)]);if(s)return;let v=C.current,f=P.current,w=0,z=0,q=0,M=0;for(let t of v)w+=(t.vx+.5)*o,z+=(t.vy+.5)*o,q+=(t.vz+.5)*o,M++;if(0===M)for(let t of f)w+=(t.aabb[0]+t.aabb[3])/2,z+=(t.aabb[1]+t.aabb[4])/2,q+=(t.aabb[2]+t.aabb[5])/2,M++;let L=new d(w/M,z/M,q/M),F=4*o;for(let t of v){let e=(t.vx+.5)*o-L.x,s=(t.vy+.5)*o-L.y,a=(t.vz+.5)*o-L.z;F=Math.max(F,Math.sqrt(e*e+s*s+a*a))}for(let t of f){let e=(t.aabb[0]+t.aabb[3])/2-L.x,s=(t.aabb[1]+t.aabb[4])/2-L.y,a=(t.aabb[2]+t.aabb[5])/2-L.z;F=Math.max(F,Math.sqrt(e*e+s*s+a*a))}let E=new i(e,!0,{preserveDrawingBuffer:!1}),B=new l(E);B.clearColor=new p(.04,.05,.07,1);let T=new h("world-cam",Math.PI/4,Math.PI/3,2.4*F,L,B);T.attachControl(e,!0),(0,n.disableWheelZoom)(T),x.current=T,g.current={target:L,alpha:T.alpha,beta:T.beta,radius:T.radius},new u("world-light",new d(.4,1,.3),B);let N=Math.max(.02*F,.25*o)/(.9*o),I=T.radius,Z="cube"===_?k.CreateBox("world-voxel",{size:.9*o},B):k.CreateSphere("world-voxel",{diameter:.9*o,segments:6},B),O=new b("world-voxel-mat",B);O.diffuseColor=new j(1,1,1),O.specularColor=new j(0,0,0),Z.material=O;let $=0,H=new Float32Array(0),D=new Float32Array(0),V=-1,W=()=>{if(0===$)return;let t=Math.min(8,Math.max(.6,T.radius/I));if(!(.01>Math.abs(t-V))){V=t;for(let e=0;e<$;e++){let s=D[e]*t,a=16*e;H[a]=s,H[a+5]=s,H[a+10]=s}Z.thinInstanceBufferUpdated("matrix")}};B.onBeforeRenderObservable.add(W);let U=null,K="\0",X=()=>{(()=>{let t=P.current,e=t.map(t=>`${t.name}:${t.aabb.join(",")}`).join("|");if(e===K||(K=e,U&&(U.dispose(!1,!0),U=null),0===t.length))return;U=k.CreateBox("scene-proxy",{size:1},B);let s=new b("scene-proxy-mat",B);s.wireframe=!0,s.disableLighting=!0,s.emissiveColor=new j(.32,.4,.52),s.alpha=.35,U.material=s,U.isPickable=!0,U.thinInstanceEnablePicking=!0,U.metadata={hoverLabels:t.map(t=>t.name)};let a=t.length,n=new Float32Array(16*a);for(let e=0;e<a;e++){let s=t[e].aabb,a=Math.max(s[3]-s[0],.001),c=Math.max(s[4]-s[1],.001),r=Math.max(s[5]-s[2],.001);m.Scaling(a,c,r).multiply(m.Translation((s[0]+s[3])/2,(s[1]+s[4])/2,(s[2]+s[5])/2)).copyToArray(n,16*e)}U.thinInstanceSetBuffer("matrix",n,16,!0)})(),(()=>{let t=C.current,e=R.current,s=t.length;if(0===s){$=0,Z.isVisible=!1;return}let n=(0,a.percentileMax)(t.map(t=>t.count),.95),c=new Float32Array(16*s),r=new Float32Array(4*s),i=new Float32Array(s);for(let e=0;e<s;e++){let s=t[e],l=Math.min(1,s.count/n),h=N*(.5+.5*l);i[e]=h,m.Scaling(h,h,h).multiply(m.Translation((s.vx+.5)*o,(s.vy+.5)*o,(s.vz+.5)*o)).copyToArray(c,16*e);let[u,d,j]=(0,a.heatRgb)(l);r[4*e]=u,r[4*e+1]=d,r[4*e+2]=j,r[4*e+3]=1}$=s,H=c,D=i,Z.isVisible=!0,Z.isPickable=!!e,Z.thinInstanceEnablePicking=!!e,Z.metadata=e?{hoverLabels:e}:null,Z.thinInstanceSetBuffer("matrix",H,16,!1),Z.thinInstanceSetBuffer("color",r,4,!0),V=-1,W()})()};S.current=X,X(),E.runRenderLoop(()=>B.render());let Y=()=>E.resize();window.addEventListener("resize",Y);let G=(0,c.attachMeshHover)(B,e,A),J=(0,n.attachDoubleClickFocus)(B,e,T);y("ready"),r=()=>{window.removeEventListener("resize",Y),G(),J(),A(null),S.current=null,x.current=null,g.current=null,B.dispose(),E.dispose()}}catch(t){if(s)return;y("error"),q(t instanceof Error?t.message:"Failed to render heatmap.")}})(),()=>{s=!0,r?.()}},[_,o,F]),(0,s.useEffect)(()=>{S.current?.()},[h,u,v]);let E=b?b.cells>h.length?` Showing the ${h.length.toLocaleString()} busiest of ${b.cells.toLocaleString()} occupied cells (${b.hits.toLocaleString()} total hits).`:` ${b.cells.toLocaleString()} occupied cells, ${b.hits.toLocaleString()} total hits.`:"";return(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsx)("canvas",{ref:f,className:"aspect-video w-full rounded-lg border border-edge bg-ink"}),L?(0,e.jsx)("div",{className:"pointer-events-none absolute z-10 max-w-[16rem] truncate rounded border border-edge bg-ink/90 px-1.5 py-0.5 text-xs text-white shadow backdrop-blur",style:{left:L.x+12,top:L.y+12},children:L.label}):null,"ready"===w?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(l,{shape:_,onChange:M}),(0,e.jsx)(i.ZoomButtons,{onZoom:t=>x.current&&(0,n.stepZoom)(x.current,t),onReset:()=>x.current&&g.current&&(0,n.resetFocus)(x.current,g.current)}),(0,e.jsx)(r.HeatLegend,{title:d,lowLabel:j,highLabel:p,note:m+E})]}):(0,e.jsx)("div",{className:"pointer-events-none absolute inset-0 grid place-items-center text-sm text-fg-muted",children:"loading"===w?"Rendering…":"empty"===w?k:"error"===w?z??"Heatmap unavailable.":null})]})}])},3905,t=>{t.v(e=>Promise.all(["static/chunks/3pdpaqzwhhijn.js","static/chunks/08bm3ye5govev.js","static/chunks/0g6u34xkzrpjn.js","static/chunks/25ctnyh7njp-d.js","static/chunks/2gh4z57fem0_v.js","static/chunks/3vaho-xrtuchd.js","static/chunks/0g7p8zp2kxve5.js"].map(e=>t.l(e))).then(()=>e(66232)))},94432,t=>{t.v(e=>Promise.all(["static/chunks/2kje_jvmwsvwo.js","static/chunks/1j--a56ji33_x.js","static/chunks/3pdpaqzwhhijn.js","static/chunks/2npk7tr63h7rl.js","static/chunks/3vaho-xrtuchd.js","static/chunks/3g_h_00xs9u59.js","static/chunks/1vzmzrjhlm1q5.js","static/chunks/25ctnyh7njp-d.js","static/chunks/1vpcaaf-0dn7q.js"].map(e=>t.l(e))).then(()=>e(92494)))},59694,t=>{t.v(e=>Promise.all(["static/chunks/1j--a56ji33_x.js","static/chunks/0oap0o8a8a_cl.js","static/chunks/0f_nv15a8q415.js","static/chunks/1vzmzrjhlm1q5.js","static/chunks/3pdpaqzwhhijn.js","static/chunks/245h82k-g1nxr.js","static/chunks/3ovd8o_usay7j.js","static/chunks/3vaho-xrtuchd.js","static/chunks/1vpcaaf-0dn7q.js","static/chunks/25ctnyh7njp-d.js","static/chunks/2npk7tr63h7rl.js","static/chunks/3pyggl13glbdc.js"].map(e=>t.l(e))).then(()=>e(67186)))},88004,t=>{t.v(e=>Promise.all(["static/chunks/2p8dbh81chhon.js","static/chunks/1oara6fkfvgs3.js","static/chunks/1vzmzrjhlm1q5.js","static/chunks/25ctnyh7njp-d.js","static/chunks/3pdpaqzwhhijn.js"].map(e=>t.l(e))).then(()=>e(15768)))},27940,t=>{t.v(e=>Promise.all(["static/chunks/0w0sx062qmcsh.js","static/chunks/25ctnyh7njp-d.js","static/chunks/3pdpaqzwhhijn.js"].map(e=>t.l(e))).then(()=>e(23235)))},27124,t=>{t.v(e=>Promise.all(["static/chunks/1par9m038tiov.js","static/chunks/1j--a56ji33_x.js","static/chunks/2j-sax2xfdv7l.js","static/chunks/340pg0qkv5tqq.js","static/chunks/3pdpaqzwhhijn.js","static/chunks/0gwa154w_0wuh.js","static/chunks/0oap0o8a8a_cl.js","static/chunks/0f_nv15a8q415.js","static/chunks/3vaho-xrtuchd.js","static/chunks/3pyggl13glbdc.js","static/chunks/1vzmzrjhlm1q5.js","static/chunks/3g_h_00xs9u59.js","static/chunks/1vpcaaf-0dn7q.js","static/chunks/25ctnyh7njp-d.js","static/chunks/2npk7tr63h7rl.js","static/chunks/01aeari2x_tlz.js"].map(e=>t.l(e))).then(()=>e(70928)))},14074,t=>{t.v(e=>Promise.all(["static/chunks/1zcrrq1fx8g2y.js","static/chunks/1tdg_eolxlcdl.js","static/chunks/1j--a56ji33_x.js","static/chunks/1vzmzrjhlm1q5.js","static/chunks/0vddljjnmozzx.js","static/chunks/3pdpaqzwhhijn.js","static/chunks/1vpcaaf-0dn7q.js","static/chunks/3vaho-xrtuchd.js","static/chunks/0f_nv15a8q415.js","static/chunks/3g_h_00xs9u59.js","static/chunks/2npk7tr63h7rl.js","static/chunks/25ctnyh7njp-d.js"].map(e=>t.l(e))).then(()=>e(87566)))},35983,t=>{t.v(e=>Promise.all(["static/chunks/4227p7752rnny.js","static/chunks/1j--a56ji33_x.js","static/chunks/1vzmzrjhlm1q5.js","static/chunks/2npk7tr63h7rl.js","static/chunks/1vkww9l6lgqag.js","static/chunks/25ctnyh7njp-d.js","static/chunks/0f_nv15a8q415.js","static/chunks/3vaho-xrtuchd.js","static/chunks/1vpcaaf-0dn7q.js","static/chunks/3pyggl13glbdc.js","static/chunks/3pdpaqzwhhijn.js"].map(e=>t.l(e))).then(()=>e(50608)))},18561,t=>{t.v(e=>Promise.all(["static/chunks/1j--a56ji33_x.js","static/chunks/1vkww9l6lgqag.js","static/chunks/3pdpaqzwhhijn.js","static/chunks/2npk7tr63h7rl.js","static/chunks/117ys3lltfmcu.js","static/chunks/25ctnyh7njp-d.js","static/chunks/1vzmzrjhlm1q5.js","static/chunks/3g_h_00xs9u59.js","static/chunks/1vpcaaf-0dn7q.js","static/chunks/3vaho-xrtuchd.js"].map(e=>t.l(e))).then(()=>e(85106)))}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,2348,2413,t=>{"use strict";let e=1/1.2;t.s(["ZOOM_IN_FACTOR",0,e,"ZOOM_OUT_FACTOR",0,1.2,"attachDoubleClickFocus",0,function(t,e,s){let a=()=>{let e=t.pick(t.pointerX,t.pointerY);e?.hit&&e.pickedPoint&&s.setTarget(e.pickedPoint)};return e.addEventListener("dblclick",a),()=>e.removeEventListener("dblclick",a)},"disableWheelZoom",0,function(t){t.inputs.removeByType("ArcRotateCameraMouseWheelInput")},"resetFocus",0,function(t,e){t.setTarget(e.target),t.alpha=e.alpha,t.beta=e.beta,t.radius=e.radius},"stepZoom",0,function(t,e){let s=t.lowerRadiusLimit??.01,a=t.upperRadiusLimit??1/0;t.radius=Math.min(a,Math.max(s,t.radius*e))}],2348);var s=t.i(28100);t.s(["ZoomButtons",0,function({onZoom:t,onReset:a}){let n="grid h-8 w-8 place-items-center rounded-md border border-edge bg-ink/80 text-lg leading-none text-fg backdrop-blur transition hover:bg-ink hover:text-white";return(0,s.jsxs)("div",{className:"absolute right-3 top-3 flex flex-col gap-1",children:[(0,s.jsx)("button",{type:"button","aria-label":"Zoom in",className:n,onClick:()=>t(e),children:"+"}),(0,s.jsx)("button",{type:"button","aria-label":"Zoom out",className:n,onClick:()=>t(1.2),children:"−"}),a?(0,s.jsx)("button",{type:"button","aria-label":"Reset camera focus to center",title:"Reset focus to center",className:n,onClick:a,children:(0,s.jsxs)("svg",{viewBox:"0 0 16 16",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round","aria-hidden":"true",children:[(0,s.jsx)("circle",{cx:"8",cy:"8",r:"3"}),(0,s.jsx)("path",{d:"M8 1v2.5M8 12.5V15M1 8h2.5M12.5 8H15"})]})}):null]})}],2413)},25476,t=>{"use strict";t.s(["attachMeshHover",0,function(t,e,s){let a=0,n=null,r=e=>{let r=e.offsetX,c=e.offsetY;a||(a=requestAnimationFrame(()=>{var e,i;let l;a=0;let h=t.pick(r,c,t=>t.isPickable&&t.isEnabled()),o=h?.pickedMesh?(e=h.pickedMesh,i=h.thinInstanceIndex??-1,(l=e.metadata)?i>=0&&l.hoverLabels?l.hoverLabels[i]??null:l.hoverLabel??null:null):null;o?s({label:o,x:r,y:c}):null!==n&&s(null),n=o}))},c=()=>{a&&(cancelAnimationFrame(a),a=0),null!==n&&(n=null,s(null))};return e.addEventListener("pointermove",r),e.addEventListener("pointerleave",c),()=>{e.removeEventListener("pointermove",r),e.removeEventListener("pointerleave",c),a&&cancelAnimationFrame(a)}}])},53993,t=>{"use strict";var e=t.i(28100),s=t.i(11623),a=t.i(56054),n=t.i(2348),r=t.i(25476),c=t.i(18637),i=t.i(2413);function l({shape:t,onChange:s}){let a=t=>`h-8 px-2.5 text-xs font-medium leading-none transition first:rounded-l-md last:rounded-r-md ${t?"bg-ink text-white":"bg-ink/80 text-fg hover:text-white"}`,n="sphere"===t,r="cube"===t;return(0,e.jsxs)("div",{className:"absolute left-3 top-3 flex overflow-hidden rounded-md border border-edge backdrop-blur",role:"group","aria-label":"Voxel marker shape",children:[(0,e.jsx)("button",{type:"button",className:a(n),"aria-pressed":n,onClick:()=>s("sphere"),children:"Spheres"}),(0,e.jsx)("button",{type:"button",className:a(r),"aria-pressed":r,onClick:()=>s("cube"),children:"Cubes"})]})}t.s(["WorldHeatmap3DView",0,function({voxels:h,cellSize:o,proxyMeshes:u=[],legendTitle:d="Pointer-hit density",legendLow:j="few hits",legendHigh:p="most hits",legendNote:m="Each marker is a voxel where the pointer hit your scene. Color & size scale with hits, normalized to the 95th-percentile cell so a few hotspots don't wash out the rest.",emptyLabel:k="No 3D hit-points in range.",totals:b,voxelLabels:v}){let x=(0,s.useRef)(null),f=(0,s.useRef)(null),g=(0,s.useRef)(null),[w,y]=(0,s.useState)("loading"),[z,q]=(0,s.useState)(null),[_,M]=(0,s.useState)("sphere"),[L,A]=(0,s.useState)(null),C=(0,s.useRef)(h),P=(0,s.useRef)(u),R=(0,s.useRef)(v);C.current=h,P.current=u,R.current=v;let S=(0,s.useRef)(null),F=h.length>0||u.length>0;(0,s.useEffect)(()=>{let e=x.current;if(!e)return;if(!F)return void y("empty");let s=!1,c=null;return y("loading"),q(null),(async()=>{try{let[{Engine:i},{Scene:l},{ArcRotateCamera:h},{HemisphericLight:u},{Vector3:d,Color3:j,Color4:p,Matrix:m},{MeshBuilder:k},{StandardMaterial:b}]=await Promise.all([t.A(3905),t.A(94432),t.A(59694),t.A(88004),t.A(27940),t.A(27124),t.A(14074),t.A(35983),t.A(18561)]);if(s)return;let v=C.current,x=P.current,w=0,z=0,q=0,M=0;for(let t of v)w+=(t.vx+.5)*o,z+=(t.vy+.5)*o,q+=(t.vz+.5)*o,M++;if(0===M)for(let t of x)w+=(t.aabb[0]+t.aabb[3])/2,z+=(t.aabb[1]+t.aabb[4])/2,q+=(t.aabb[2]+t.aabb[5])/2,M++;let L=new d(w/M,z/M,q/M),F=4*o;for(let t of v){let e=(t.vx+.5)*o-L.x,s=(t.vy+.5)*o-L.y,a=(t.vz+.5)*o-L.z;F=Math.max(F,Math.sqrt(e*e+s*s+a*a))}for(let t of x){let e=(t.aabb[0]+t.aabb[3])/2-L.x,s=(t.aabb[1]+t.aabb[4])/2-L.y,a=(t.aabb[2]+t.aabb[5])/2-L.z;F=Math.max(F,Math.sqrt(e*e+s*s+a*a))}let E=new i(e,!0,{preserveDrawingBuffer:!1}),B=new l(E);B.clearColor=new p(.04,.05,.07,1);let T=new h("world-cam",Math.PI/4,Math.PI/3,2.4*F,L,B);T.attachControl(e,!0),(0,n.disableWheelZoom)(T),f.current=T,g.current={target:L,alpha:T.alpha,beta:T.beta,radius:T.radius},new u("world-light",new d(.4,1,.3),B);let N=Math.max(.02*F,.25*o)/(.9*o),I=T.radius,Z="cube"===_?k.CreateBox("world-voxel",{size:.9*o},B):k.CreateSphere("world-voxel",{diameter:.9*o,segments:6},B),O=new b("world-voxel-mat",B);O.diffuseColor=new j(1,1,1),O.specularColor=new j(0,0,0),Z.material=O;let $=0,H=new Float32Array(0),D=new Float32Array(0),V=-1,W=()=>{if(0===$)return;let t=Math.min(8,Math.max(.6,T.radius/I));if(!(.01>Math.abs(t-V))){V=t;for(let e=0;e<$;e++){let s=D[e]*t,a=16*e;H[a]=s,H[a+5]=s,H[a+10]=s}Z.thinInstanceBufferUpdated("matrix")}};B.onBeforeRenderObservable.add(W);let U=null,K="\0",X=()=>{(()=>{let t=P.current,e=t.map(t=>`${t.name}:${t.aabb.join(",")}`).join("|");if(e===K||(K=e,U&&(U.dispose(!1,!0),U=null),0===t.length))return;U=k.CreateBox("scene-proxy",{size:1},B);let s=new b("scene-proxy-mat",B);s.wireframe=!0,s.disableLighting=!0,s.emissiveColor=new j(.32,.4,.52),s.alpha=.35,U.material=s,U.isPickable=!0,U.thinInstanceEnablePicking=!0,U.metadata={hoverLabels:t.map(t=>t.name)};let a=t.length,n=new Float32Array(16*a);for(let e=0;e<a;e++){let s=t[e].aabb,a=Math.max(s[3]-s[0],.001),r=Math.max(s[4]-s[1],.001),c=Math.max(s[5]-s[2],.001);m.Scaling(a,r,c).multiply(m.Translation((s[0]+s[3])/2,(s[1]+s[4])/2,(s[2]+s[5])/2)).copyToArray(n,16*e)}U.thinInstanceSetBuffer("matrix",n,16,!0)})(),(()=>{let t=C.current,e=R.current,s=t.length;if(0===s){$=0,Z.isVisible=!1;return}let n=(0,a.percentileMax)(t.map(t=>t.count),.95),r=new Float32Array(16*s),c=new Float32Array(4*s),i=new Float32Array(s);for(let e=0;e<s;e++){let s=t[e],l=Math.min(1,s.count/n),h=N*(.5+.5*l);i[e]=h,m.Scaling(h,h,h).multiply(m.Translation((s.vx+.5)*o,(s.vy+.5)*o,(s.vz+.5)*o)).copyToArray(r,16*e);let[u,d,j]=(0,a.heatRgb)(l);c[4*e]=u,c[4*e+1]=d,c[4*e+2]=j,c[4*e+3]=1}$=s,H=r,D=i,Z.isVisible=!0,Z.isPickable=!!e,Z.thinInstanceEnablePicking=!!e,Z.metadata=e?{hoverLabels:e}:null,Z.thinInstanceSetBuffer("matrix",H,16,!1),Z.thinInstanceSetBuffer("color",c,4,!0),V=-1,W()})()};S.current=X,X(),E.runRenderLoop(()=>B.render());let Y=()=>E.resize();window.addEventListener("resize",Y);let G=(0,r.attachMeshHover)(B,e,A),J=(0,n.attachDoubleClickFocus)(B,e,T);y("ready"),c=()=>{window.removeEventListener("resize",Y),G(),J(),A(null),S.current=null,f.current=null,g.current=null,B.dispose(),E.dispose()}}catch(t){if(s)return;y("error"),q(t instanceof Error?t.message:"Failed to render heatmap.")}})(),()=>{s=!0,c?.()}},[_,o,F]),(0,s.useEffect)(()=>{S.current?.()},[h,u,v]);let E=b?b.cells>h.length?` Showing the ${h.length.toLocaleString()} busiest of ${b.cells.toLocaleString()} occupied cells (${b.hits.toLocaleString()} total hits).`:` ${b.cells.toLocaleString()} occupied cells, ${b.hits.toLocaleString()} total hits.`:"";return(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsx)("canvas",{ref:x,className:"aspect-video w-full rounded-lg border border-edge bg-ink"}),L?(0,e.jsx)("div",{className:"pointer-events-none absolute z-10 max-w-[16rem] truncate rounded border border-edge bg-ink/90 px-1.5 py-0.5 text-xs text-white shadow backdrop-blur",style:{left:L.x+12,top:L.y+12},children:L.label}):null,"ready"===w?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(l,{shape:_,onChange:M}),(0,e.jsx)(i.ZoomButtons,{onZoom:t=>f.current&&(0,n.stepZoom)(f.current,t),onReset:()=>f.current&&g.current&&(0,n.resetFocus)(f.current,g.current)}),(0,e.jsx)(c.HeatLegend,{title:d,lowLabel:j,highLabel:p,note:m+E})]}):(0,e.jsx)("div",{className:"pointer-events-none absolute inset-0 grid place-items-center text-sm text-fg-muted",children:"loading"===w?"Rendering…":"empty"===w?k:"error"===w?z??"Heatmap unavailable.":null})]})}])},3905,t=>{t.v(e=>Promise.all(["static/chunks/3pdpaqzwhhijn.js","static/chunks/08bm3ye5govev.js","static/chunks/0g6u34xkzrpjn.js","static/chunks/25ctnyh7njp-d.js","static/chunks/2gh4z57fem0_v.js","static/chunks/3vaho-xrtuchd.js","static/chunks/0g7p8zp2kxve5.js"].map(e=>t.l(e))).then(()=>e(66232)))},94432,t=>{t.v(e=>Promise.all(["static/chunks/2kje_jvmwsvwo.js","static/chunks/1j--a56ji33_x.js","static/chunks/3pdpaqzwhhijn.js","static/chunks/2npk7tr63h7rl.js","static/chunks/3vaho-xrtuchd.js","static/chunks/3g_h_00xs9u59.js","static/chunks/1vzmzrjhlm1q5.js","static/chunks/25ctnyh7njp-d.js","static/chunks/1vpcaaf-0dn7q.js"].map(e=>t.l(e))).then(()=>e(92494)))},59694,t=>{t.v(e=>Promise.all(["static/chunks/1j--a56ji33_x.js","static/chunks/0oap0o8a8a_cl.js","static/chunks/0f_nv15a8q415.js","static/chunks/1vzmzrjhlm1q5.js","static/chunks/3pdpaqzwhhijn.js","static/chunks/245h82k-g1nxr.js","static/chunks/3ovd8o_usay7j.js","static/chunks/3vaho-xrtuchd.js","static/chunks/1vpcaaf-0dn7q.js","static/chunks/25ctnyh7njp-d.js","static/chunks/2npk7tr63h7rl.js","static/chunks/2wdk-kbm-n-m5.js"].map(e=>t.l(e))).then(()=>e(67186)))},88004,t=>{t.v(e=>Promise.all(["static/chunks/2p8dbh81chhon.js","static/chunks/1oara6fkfvgs3.js","static/chunks/1vzmzrjhlm1q5.js","static/chunks/25ctnyh7njp-d.js","static/chunks/3pdpaqzwhhijn.js"].map(e=>t.l(e))).then(()=>e(15768)))},27940,t=>{t.v(e=>Promise.all(["static/chunks/0w0sx062qmcsh.js","static/chunks/25ctnyh7njp-d.js","static/chunks/3pdpaqzwhhijn.js"].map(e=>t.l(e))).then(()=>e(23235)))},27124,t=>{t.v(e=>Promise.all(["static/chunks/1par9m038tiov.js","static/chunks/1j--a56ji33_x.js","static/chunks/2j-sax2xfdv7l.js","static/chunks/3rx1jhuop94-l.js","static/chunks/3pdpaqzwhhijn.js","static/chunks/0gwa154w_0wuh.js","static/chunks/0oap0o8a8a_cl.js","static/chunks/0f_nv15a8q415.js","static/chunks/3vaho-xrtuchd.js","static/chunks/2wdk-kbm-n-m5.js","static/chunks/1vzmzrjhlm1q5.js","static/chunks/3g_h_00xs9u59.js","static/chunks/1vpcaaf-0dn7q.js","static/chunks/25ctnyh7njp-d.js","static/chunks/2npk7tr63h7rl.js","static/chunks/10w513bgw-bgi.js"].map(e=>t.l(e))).then(()=>e(70928)))},14074,t=>{t.v(e=>Promise.all(["static/chunks/0n0thxa3jkour.js","static/chunks/1tdg_eolxlcdl.js","static/chunks/1j--a56ji33_x.js","static/chunks/1vzmzrjhlm1q5.js","static/chunks/0vddljjnmozzx.js","static/chunks/3pdpaqzwhhijn.js","static/chunks/1vpcaaf-0dn7q.js","static/chunks/3vaho-xrtuchd.js","static/chunks/0f_nv15a8q415.js","static/chunks/3g_h_00xs9u59.js","static/chunks/2npk7tr63h7rl.js","static/chunks/25ctnyh7njp-d.js"].map(e=>t.l(e))).then(()=>e(87566)))},35983,t=>{t.v(e=>Promise.all(["static/chunks/4227p7752rnny.js","static/chunks/1j--a56ji33_x.js","static/chunks/1vzmzrjhlm1q5.js","static/chunks/2npk7tr63h7rl.js","static/chunks/1vkww9l6lgqag.js","static/chunks/25ctnyh7njp-d.js","static/chunks/0f_nv15a8q415.js","static/chunks/3vaho-xrtuchd.js","static/chunks/1vpcaaf-0dn7q.js","static/chunks/2wdk-kbm-n-m5.js","static/chunks/3pdpaqzwhhijn.js"].map(e=>t.l(e))).then(()=>e(50608)))},18561,t=>{t.v(e=>Promise.all(["static/chunks/1j--a56ji33_x.js","static/chunks/1vkww9l6lgqag.js","static/chunks/3pdpaqzwhhijn.js","static/chunks/2npk7tr63h7rl.js","static/chunks/117ys3lltfmcu.js","static/chunks/25ctnyh7njp-d.js","static/chunks/1vzmzrjhlm1q5.js","static/chunks/3g_h_00xs9u59.js","static/chunks/1vpcaaf-0dn7q.js","static/chunks/3vaho-xrtuchd.js"].map(e=>t.l(e))).then(()=>e(85106)))}]);