@uptimizr/dashboard 0.3.1 → 0.3.3

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 (36) hide show
  1. package/out/404.html +1 -1
  2. package/out/__next.__PAGE__.txt +2 -2
  3. package/out/__next._full.txt +3 -3
  4. package/out/__next._head.txt +1 -1
  5. package/out/__next._index.txt +2 -2
  6. package/out/__next._tree.txt +2 -2
  7. package/out/_next/static/chunks/06m_64ysu9kn0.js +1 -0
  8. package/out/_next/static/chunks/0hol9-rsh00k6.js +3 -0
  9. package/out/_next/static/chunks/0ljf5zpstyrg7.js +1 -0
  10. package/out/_next/static/chunks/1i89ao_sm6o4o.js +1 -0
  11. package/out/_next/static/chunks/2_hgfg-cjqw1-.js +1 -0
  12. package/out/_next/static/chunks/{2mleh3pbge181.js → 2t9zu9v_g9kr9.js} +1 -1
  13. package/out/_next/static/chunks/35f-9p5adh1sc.js +1 -0
  14. package/out/_next/static/chunks/39ojyykom0z2r.js +1 -0
  15. package/out/_next/static/chunks/3ef6upwlgr4q-.css +3 -0
  16. package/out/_next/static/chunks/3jha6wlqw8459.js +1 -0
  17. package/out/_not-found/__next._full.txt +2 -2
  18. package/out/_not-found/__next._head.txt +1 -1
  19. package/out/_not-found/__next._index.txt +2 -2
  20. package/out/_not-found/__next._not-found.__PAGE__.txt +1 -1
  21. package/out/_not-found/__next._not-found.txt +1 -1
  22. package/out/_not-found/__next._tree.txt +2 -2
  23. package/out/_not-found.html +1 -1
  24. package/out/_not-found.txt +2 -2
  25. package/out/index.html +1 -1
  26. package/out/index.txt +3 -3
  27. package/package.json +3 -3
  28. package/out/_next/static/chunks/0g_v2zswo4l6f.js +0 -1
  29. package/out/_next/static/chunks/1my2rhysaxjw4.js +0 -3
  30. package/out/_next/static/chunks/1vuq3dos1406d.css +0 -3
  31. package/out/_next/static/chunks/31nbg0n1q43p2.js +0 -1
  32. package/out/_next/static/chunks/3qw6q7d74g5wp.js +0 -1
  33. package/out/_next/static/chunks/3s2d9ymcd0l4e.js +0 -1
  34. /package/out/_next/static/{-UlF345C3V4TG3ZtvR-5_ → W_AwLgpmWJNo9qUUBPat3}/_buildManifest.js +0 -0
  35. /package/out/_next/static/{-UlF345C3V4TG3ZtvR-5_ → W_AwLgpmWJNo9qUUBPat3}/_clientMiddlewareManifest.js +0 -0
  36. /package/out/_next/static/{-UlF345C3V4TG3ZtvR-5_ → W_AwLgpmWJNo9qUUBPat3}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,93425,e=>{"use strict";var t=e.i(28100),s=e.i(11623);function n({children:e,label:s="More information"}){return(0,t.jsxs)("span",{className:"group relative inline-flex",children:[(0,t.jsx)("button",{type:"button","aria-label":s,className:"flex h-4 w-4 items-center justify-center rounded-full border border-edge text-[10px] font-bold leading-none text-fg-muted transition hover:border-amber hover:text-fg-hi focus:outline-none focus:ring-1 focus:ring-amber",children:"?"}),(0,t.jsx)("span",{role:"tooltip",className:"pointer-events-none absolute left-1/2 top-6 z-20 w-64 -translate-x-1/2 rounded-md border border-edge bg-ink/95 p-2.5 text-xs font-normal normal-case leading-relaxed tracking-normal text-fg opacity-0 shadow-lg shadow-black/40 transition-opacity duration-150 group-hover:opacity-100 group-focus-within:opacity-100",children:e})]})}function r({label:e,onClick:s,active:n=!1,children:a}){return(0,t.jsx)("button",{type:"button","aria-label":e,title:e,onClick:s,"aria-pressed":n,className:`flex h-6 w-6 items-center justify-center rounded-md border text-sm leading-none transition focus:outline-none focus:ring-1 focus:ring-amber ${n?"border-amber text-amber":"border-edge text-fg-muted hover:border-amber hover:text-fg-hi"}`,children:a})}e.s(["Panel",0,function({title:e,subtitle:a,help:i,children:c,className:l="",collapsible:o=!1,defaultCollapsed:u=!1,onHide:h,settings:m}){let[p,d]=(0,s.useState)(o&&u),[b,g]=(0,s.useState)(!1),v=(0,t.jsxs)("header",{className:p?"":"mb-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("h2",{className:"text-sm font-semibold uppercase tracking-wide text-fg",children:e}),o?(0,t.jsx)("span",{"aria-hidden":"true",className:"text-xs text-fg-muted",children:p?"▸":"▾"}):null,i?(0,t.jsx)(n,{label:`About: ${e}`,children:i}):null]}),a?(0,t.jsx)("p",{className:"mt-0.5 text-xs text-fg-muted",children:a}):null]}),f=!!m||!!h;return(0,t.jsxs)("section",{className:`rounded-xl border border-edge bg-panel p-4 shadow-lg shadow-black/20 ${l}`,children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[o?(0,t.jsx)("button",{type:"button",onClick:()=>d(e=>!e),"aria-expanded":p?"false":"true",className:"min-w-0 flex-1 text-left",children:v}):(0,t.jsx)("div",{className:"min-w-0 flex-1",children:v}),f?(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-1",children:[m?(0,t.jsx)(r,{label:`${e} settings`,active:b,onClick:()=>g(e=>!e),children:(0,t.jsx)("span",{"aria-hidden":"true",children:"⚙"})}):null,h?(0,t.jsx)(r,{label:`Hide ${e}`,onClick:h,children:(0,t.jsx)("span",{"aria-hidden":"true",children:"×"})}):null]}):null]}),m&&b?(0,t.jsx)("div",{className:"mb-3 rounded-lg border border-edge bg-ink/40 p-3",children:m}):null,p?null:c]})}])},62238,e=>{"use strict";e.s(["ZOOM_IN_FACTOR",0,1/1.2,"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))}])},42279,e=>{"use strict";var t=e.i(28100),s=e.i(62238);e.s(["ZoomButtons",0,function({onZoom:e,onReset:n}){let r="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,t.jsxs)("div",{className:"absolute right-3 top-3 flex flex-col gap-1",children:[(0,t.jsx)("button",{type:"button","aria-label":"Zoom in",className:r,onClick:()=>e(s.ZOOM_IN_FACTOR),children:"+"}),(0,t.jsx)("button",{type:"button","aria-label":"Zoom out",className:r,onClick:()=>e(s.ZOOM_OUT_FACTOR),children:"−"}),n?(0,t.jsx)("button",{type:"button","aria-label":"Reset camera focus to center",title:"Reset focus to center",className:r,onClick:n,children:(0,t.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,t.jsx)("circle",{cx:"8",cy:"8",r:"3"}),(0,t.jsx)("path",{d:"M8 1v2.5M8 12.5V15M1 8h2.5M12.5 8H15"})]})}):null]})}])},56054,59683,37660,e=>{"use strict";let t="linear-gradient(to right, rgb(178,47,38), rgb(224,123,57), rgb(244,200,75))";e.s(["HEAT_GRADIENT",0,t,"heatRgb",0,function(e){let t=Math.max(0,Math.min(1,e)),s=[.878,.482,.224],n=(e,t,s)=>[e[0]+(t[0]-e[0])*s,e[1]+(t[1]-e[1])*s,e[2]+(t[2]-e[2])*s];return t<.5?n([.698,.184,.149],s,t/.5):n(s,[.957,.784,.294],(t-.5)/.5)},"percentileMax",0,function(e,t=.95){if(0===e.length)return 1;let s=[...e].sort((e,t)=>e-t),n=Math.max(0,Math.min(1,t))*(s.length-1),r=Math.floor(n),a=Math.ceil(n);return Math.max(1,r===a?s[r]:s[r]+(s[a]-s[r])*(n-r))}],56054),e.s(["attachMeshHover",0,function(e,t,s){let n=0,r=null,a=t=>{let a=t.offsetX,i=t.offsetY;n||(n=requestAnimationFrame(()=>{var t,c;let l;n=0;let o=e.pick(a,i,e=>e.isPickable&&e.isEnabled()),u=o?.pickedMesh?(t=o.pickedMesh,c=o.thinInstanceIndex??-1,(l=t.metadata)?c>=0&&l.hoverLabels?l.hoverLabels[c]??null:l.hoverLabel??null:null):null;u?s({label:u,x:a,y:i}):null!==r&&s(null),r=u}))},i=()=>{n&&(cancelAnimationFrame(n),n=0),null!==r&&(r=null,s(null))};return t.addEventListener("pointermove",a),t.addEventListener("pointerleave",i),()=>{t.removeEventListener("pointermove",a),t.removeEventListener("pointerleave",i),n&&cancelAnimationFrame(n)}}],59683);var s=e.i(28100);e.s(["HeatLegend",0,function({title:e,lowLabel:n="low",highLabel:r="high",note:a}){return(0,s.jsxs)("div",{className:"pointer-events-none absolute bottom-3 left-3 rounded-md border border-edge bg-ink/80 px-3 py-2 text-fg backdrop-blur-sm",children:[(0,s.jsx)("div",{className:"mb-1 text-xs font-medium text-fg",children:e}),(0,s.jsx)("div",{className:"h-2 w-36 rounded-sm",style:{background:t}}),(0,s.jsxs)("div",{className:"mt-1 flex w-36 justify-between text-[10px] text-fg-muted",children:[(0,s.jsx)("span",{children:n}),(0,s.jsx)("span",{children:r})]}),a?(0,s.jsx)("div",{className:"mt-1 max-w-44 text-[10px] leading-tight text-fg-muted",children:a}):null]})}],37660)},38413,e=>{"use strict";var t=e.i(28100),s=e.i(11623),n=e.i(56054),r=e.i(62238),a=e.i(59683),i=e.i(37660),c=e.i(93425),l=e.i(42279);let o="World heatmap (3D)",u="Pointer hit-points voxel-binned in world space — drag to orbit, +/- to zoom, double-click to focus";function h({voxels:c,cellSize:o,proxyMeshes:u=[],legendTitle:p="Pointer-hit density",legendLow:d="few hits",legendHigh:b="most hits",legendNote:g="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:v="No 3D hit-points in range.",totals:f}){let j=(0,s.useRef)(null),x=(0,s.useRef)(null),k=(0,s.useRef)(null),[_,N]=(0,s.useState)("loading"),[y,w]=(0,s.useState)(null),[S,z]=(0,s.useState)("sphere"),[L,P]=(0,s.useState)(null);(0,s.useEffect)(()=>{let t=j.current;if(!t)return;if(0===c.length&&0===u.length)return void N("empty");let s=!1,i=null;return N("loading"),w(null),(async()=>{try{let[{Engine:l},{Scene:h},{ArcRotateCamera:m},{HemisphericLight:p},{Vector3:d,Color3:b,Color4:g,Matrix:v},{MeshBuilder:f},{StandardMaterial:j}]=await Promise.all([e.A(3905),e.A(94432),e.A(59694),e.A(88004),e.A(27940),e.A(27124),e.A(14074),e.A(35983),e.A(18561)]);if(s)return;let _=(0,n.percentileMax)(c.map(e=>e.count),.95),y=0,w=0,z=0,L=0;for(let e of c)y+=(e.vx+.5)*o,w+=(e.vy+.5)*o,z+=(e.vz+.5)*o,L++;if(0===L)for(let e of u)y+=(e.aabb[0]+e.aabb[3])/2,w+=(e.aabb[1]+e.aabb[4])/2,z+=(e.aabb[2]+e.aabb[5])/2,L++;let R=new d(y/L,w/L,z/L),T=4*o;for(let e of c){let t=(e.vx+.5)*o-R.x,s=(e.vy+.5)*o-R.y,n=(e.vz+.5)*o-R.z;T=Math.max(T,Math.sqrt(t*t+s*s+n*n))}for(let e of u){let t=(e.aabb[0]+e.aabb[3])/2-R.x,s=(e.aabb[1]+e.aabb[4])/2-R.y,n=(e.aabb[2]+e.aabb[5])/2-R.z;T=Math.max(T,Math.sqrt(t*t+s*s+n*n))}let C=new l(t,!0,{preserveDrawingBuffer:!1}),A=new h(C);A.clearColor=new g(.04,.05,.07,1);let M=new m("world-cam",Math.PI/4,Math.PI/3,2.4*T,R,A);if(M.attachControl(t,!0),(0,r.disableWheelZoom)(M),x.current=M,k.current={target:R,alpha:M.alpha,beta:M.beta,radius:M.radius},new p("world-light",new d(.4,1,.3),A),u.length>0){let e=f.CreateBox("scene-proxy",{size:1},A),t=new j("scene-proxy-mat",A);t.wireframe=!0,t.disableLighting=!0,t.emissiveColor=new b(.32,.4,.52),t.alpha=.35,e.material=t,e.isPickable=!0,e.thinInstanceEnablePicking=!0,e.metadata={hoverLabels:u.map(e=>e.name)};let s=u.length,n=new Float32Array(16*s);for(let e=0;e<s;e++){let t=u[e].aabb,s=Math.max(t[3]-t[0],.001),r=Math.max(t[4]-t[1],.001),a=Math.max(t[5]-t[2],.001);v.Scaling(s,r,a).multiply(v.Translation((t[0]+t[3])/2,(t[1]+t[4])/2,(t[2]+t[5])/2)).copyToArray(n,16*e)}e.thinInstanceSetBuffer("matrix",n,16,!0)}if(c.length>0){let e="cube"===S?f.CreateBox("world-voxel",{size:.9*o},A):f.CreateSphere("world-voxel",{diameter:.9*o,segments:6},A),t=new j("world-voxel-mat",A);t.diffuseColor=new b(1,1,1),t.specularColor=new b(0,0,0),e.material=t;let s=c.length,r=new Float32Array(16*s),a=new Float32Array(4*s),i=new Float32Array(s),l=Math.max(.02*T,.25*o)/(.9*o);for(let e=0;e<s;e++){let t=c[e],s=Math.min(1,t.count/_),u=l*(.5+.5*s);i[e]=u,v.Scaling(u,u,u).multiply(v.Translation((t.vx+.5)*o,(t.vy+.5)*o,(t.vz+.5)*o)).copyToArray(r,16*e);let[h,m,p]=(0,n.heatRgb)(s);a[4*e]=h,a[4*e+1]=m,a[4*e+2]=p,a[4*e+3]=1}e.thinInstanceSetBuffer("matrix",r,16,!1),e.thinInstanceSetBuffer("color",a,4,!0);let u=M.radius,h=0,m=()=>{let t=Math.min(8,Math.max(.6,M.radius/u));if(!(.01>Math.abs(t-h))){h=t;for(let e=0;e<s;e++){let s=i[e]*t,n=16*e;r[n]=s,r[n+5]=s,r[n+10]=s}e.thinInstanceBufferUpdated("matrix")}};m(),A.onBeforeRenderObservable.add(m)}C.runRenderLoop(()=>A.render());let q=()=>C.resize();window.addEventListener("resize",q);let E=(0,a.attachMeshHover)(A,t,P),U=(0,r.attachDoubleClickFocus)(A,t,M);N("ready"),i=()=>{window.removeEventListener("resize",q),E(),U(),P(null),x.current=null,k.current=null,A.dispose(),C.dispose()}}catch(e){if(s)return;N("error"),w(e instanceof Error?e.message:"Failed to render heatmap.")}})(),()=>{s=!0,i?.()}},[c,o,u,S]);let R=f?f.cells>c.length?` Showing the ${c.length.toLocaleString()} busiest of ${f.cells.toLocaleString()} occupied cells (${f.hits.toLocaleString()} total hits).`:` ${f.cells.toLocaleString()} occupied cells, ${f.hits.toLocaleString()} total hits.`:"";return(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("canvas",{ref:j,className:"aspect-video w-full rounded-lg border border-edge bg-ink"}),L?(0,t.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"===_?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(m,{shape:S,onChange:z}),(0,t.jsx)(l.ZoomButtons,{onZoom:e=>x.current&&(0,r.stepZoom)(x.current,e),onReset:()=>x.current&&k.current&&(0,r.resetFocus)(x.current,k.current)}),(0,t.jsx)(i.HeatLegend,{title:p,lowLabel:d,highLabel:b,note:g+R})]}):(0,t.jsx)("div",{className:"pointer-events-none absolute inset-0 grid place-items-center text-sm text-fg-muted",children:"loading"===_?"Rendering…":"empty"===_?v:"error"===_?y??"Heatmap unavailable.":null})]})}function m({shape:e,onChange:s}){let n=e=>`h-8 px-2.5 text-xs font-medium leading-none transition first:rounded-l-md last:rounded-r-md ${e?"bg-ink text-white":"bg-ink/80 text-fg hover:text-white"}`,r="sphere"===e,a="cube"===e;return(0,t.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,t.jsx)("button",{type:"button",className:n(r),"aria-pressed":r,onClick:()=>s("sphere"),children:"Spheres"}),(0,t.jsx)("button",{type:"button",className:n(a),"aria-pressed":a,onClick:()=>s("cube"),children:"Cubes"})]})}e.s(["WORLD_HEATMAP_SUBTITLE",0,u,"WORLD_HEATMAP_TITLE",0,o,"WorldHeatmap3D",0,function({title:e=o,subtitle:s=u,...n}){return(0,t.jsx)(c.Panel,{title:e,subtitle:s,children:(0,t.jsx)(h,{...n})})},"WorldHeatmap3DView",0,h])},82665,20880,89339,88725,e=>{"use strict";var t=e.i(37998);let s=!!t.default.env.NEXT_PUBLIC_COLLECTOR_URL,n=t.default.env.NEXT_PUBLIC_COLLECTOR_URL??"http://localhost:4318",r="1"===t.default.env.DASHBOARD_STATIC?"":t.default.env.NEXT_PUBLIC_API_KEY??"",a=t.default.env.NEXT_PUBLIC_PLAYGROUND_URL??"http://localhost:5173";e.s(["COLLECTOR_URL_IS_PINNED",0,s,"DEFAULT_API_KEY",0,r,"DEFAULT_COLLECTOR_URL",0,n,"DEFAULT_PLAYGROUND_URL",0,a],82665);class i extends Error{status;constructor(e,t){super(e),this.status=t,this.name="ApiError"}}class c{baseUrl;apiKey;constructor(e,t){this.baseUrl=e,this.apiKey=t}async get(e,t={}){let s=new URL(e,l(this.baseUrl));for(let[e,n]of Object.entries(t))null!=n&&s.searchParams.set(e,String(n));let n=await fetch(s,{headers:{"x-api-key":this.apiKey},cache:"no-store"});if(!n.ok)throw new i(await n.text().catch(()=>"")||n.statusText,n.status);return await n.json()}sessions(e){return this.get("api/v1/sessions",e).then(e=>e.map(e=>({...e,events:Number(e.events)})))}pointerHeatmap(e){return this.get("api/v1/heatmaps/pointer",e)}cameraHeatmap(e){return this.get("api/v1/heatmaps/camera",e)}topMeshes(e){return this.get("api/v1/meshes/top",e).then(e=>e.map(e=>({...e,count:Number(e.count)})))}meshKinds(e){return this.get("api/v1/meshes/kinds",e).then(e=>e.map(e=>({mesh:String(e.mesh??""),kind:String(e.kind??""),count:Number(e.count??0)})))}topMeshesBySource(e){return this.get("api/v1/meshes/sources",e).then(e=>e.map(e=>({mesh:String(e.mesh??""),source:String(e.source??""),count:Number(e.count??0)})))}topMeshesTrend(e){return this.get("api/v1/meshes/trend",e).then(e=>e.map(e=>({mesh:String(e.mesh??""),bucket:Number(e.bucket??0),count:Number(e.count??0)})))}topInputActions(e){return this.get("api/v1/input-actions/top",e).then(e=>e.map(e=>({action:String(e.action??""),source:String(e.source??""),count:Number(e.count??0)})))}perf(e){return this.get("api/v1/perf",e).then(e=>({samples:Number(e.samples??0),avg_fps:Number(e.avg_fps??0),min_fps:Number(e.min_fps??0),p50_fps:Number(e.p50_fps??0)}))}renderScale(e){return this.get("api/v1/perf/render-scale",e).then(e=>{let t=e[0]??{},s=Number(t.downscaled_samples??0),n=Number(t.scale_samples??0);return{samples:Number(t.samples??0),avg_fps:Number(t.avg_fps??0),p50_fps:Number(t.p50_fps??0),avg_render_scale:Number(t.avg_render_scale??0),p50_render_scale:Number(t.p50_render_scale??0),downscaled_samples:s,scale_samples:n,downscaled_share:n>0?s/n:0}})}perfDistribution(e){return this.get("api/v1/perf/distribution",e).then(e=>{let t=e[0]??{};return{sessions:Number(t.sessions??0),samples:Number(t.samples??0),p05_fps:Number(t.p05_fps??0),p50_fps:Number(t.p50_fps??0),p95_fps:Number(t.p95_fps??0)}})}fpsHistogram(e){return this.get("api/v1/perf/fps-histogram",e).then(e=>e.map(e=>({bucket:Number(e.bucket??0),sessions:Number(e.sessions??0)})))}frameTimePercentiles(e){return this.get("api/v1/perf/frame-time",e).then(e=>{let t=e[0]??{};return{sessions:Number(t.sessions??0),samples:Number(t.samples??0),p50_ms:Number(t.p50_ms??0),p95_ms:Number(t.p95_ms??0)}})}jankRate(e){return this.get("api/v1/perf/jank",e).then(e=>{let t=e[0]??{};return{sessions:Number(t.sessions??0),total_long_frames:Number(t.total_long_frames??0),median_rate:Number(t.median_rate??0),worst_decile_rate:Number(t.worst_decile_rate??0)}})}perfByDevice(e){return this.get("api/v1/perf/by-device",e).then(e=>e.map(e=>({engine:String(e.engine??""),is_mobile:String(e.is_mobile??""),renderer:String(e.renderer??""),browser:String(e.browser??""),os:String(e.os??""),sessions:Number(e.sessions??0),samples:Number(e.samples??0),p50_fps:Number(e.p50_fps??0)})))}perfByScene(e){return this.get("api/v1/perf/by-scene",e).then(e=>e.map(e=>({scene_id:String(e.scene_id??""),sessions:Number(e.sessions??0),samples:Number(e.samples??0),p50_fps:Number(e.p50_fps??0)})))}resourcePercentiles(e){return this.get("api/v1/perf/resource-percentiles",e).then(e=>{let t=e[0]??{};return{sessions:Number(t.sessions??0),samples:Number(t.samples??0),p50_js_heap_bytes:Number(t.p50_js_heap_bytes??0),p95_js_heap_bytes:Number(t.p95_js_heap_bytes??0),p50_texture_bytes:Number(t.p50_texture_bytes??0),p95_texture_bytes:Number(t.p95_texture_bytes??0),p50_triangles:Number(t.p50_triangles??0),p95_triangles:Number(t.p95_triangles??0)}})}stabilityCounts(e){return this.get("api/v1/perf/stability",e).then(e=>{let t=e[0]??{};return{context_losses:Number(t.context_losses??0),compile_stalls:Number(t.compile_stalls??0),incidents:Number(t.incidents??0)}})}graphicsDiagnosticCounts(e){return this.get("api/v1/graphics-diagnostics",e).then(e=>e.map(e=>({severity:String(e.severity??""),category:String(e.category??""),backend:String(e.backend??""),incidents:Number(e.incidents??0)})))}renderingTechnology(e){return this.get("api/v1/rendering-technology",e).then(e=>e.map(e=>({api:String(e.api??""),backend:String(e.backend??""),apiVersion:String(e.api_version??""),shadingLanguage:String(e.shading_language??""),sessions:Number(e.sessions??0)})))}worldHeatmap(e){return this.get("api/v1/heatmaps/world",e).then(e=>e.map(e=>({vx:Number(e.vx),vy:Number(e.vy),vz:Number(e.vz),count:Number(e.count)})))}gazeHeatmap(e){return this.get("api/v1/heatmaps/gaze",e).then(e=>e.map(e=>({vx:Number(e.vx),vy:Number(e.vy),vz:Number(e.vz),count:Number(e.count)})))}worldHeatmapStats(e){return this.get("api/v1/heatmaps/world/stats",e).then(e=>({cellSize:Number(e.cellSize??0),cells:Number(e.cells??0),hits:Number(e.hits??0)}))}gazeHeatmapStats(e){return this.get("api/v1/heatmaps/gaze/stats",e).then(e=>({cellSize:Number(e.cellSize??0),cells:Number(e.cells??0),hits:Number(e.hits??0)}))}cameraPositionHeatmap(e){return this.get("api/v1/heatmaps/position",e).then(e=>e.map(e=>({gx:Number(e.gx),gz:Number(e.gz),avg_y:Number(e.avg_y??0),count:Number(e.count??0)})))}sessionTrajectory(e,t){return this.get(`api/v1/sessions/${encodeURIComponent(e)}/trajectory`,t).then(e=>e.map(e=>({ts:Number(e.ts),x:Number(e.x),y:Number(e.y),z:Number(e.z)})))}aggregatePaths(e){return this.get("api/v1/paths",e).then(e=>e.map(e=>({session_id:String(e.session_id??""),ts:Number(e.ts),gx:Number(e.gx),gz:Number(e.gz)})))}clickRays(e){return this.get("api/v1/heatmaps/click-rays",e).then(e=>e.map(e=>({camVoxel:[Number(e.cam_vx),Number(e.cam_vy),Number(e.cam_vz)],origin:[Number(e.origin_x),Number(e.origin_y),Number(e.origin_z)],hitVoxel:[Number(e.hit_vx),Number(e.hit_vy),Number(e.hit_vz)],hit:[Number(e.hit_x),Number(e.hit_y),Number(e.hit_z)],mesh:String(e.mesh??""),count:Number(e.count)})))}flowHeatmap(e){return this.get("api/v1/heatmaps/flow",e).then(e=>e.map(e=>{let t={azimuth_bin:Number(e.azimuth_bin),elevation_bin:Number(e.elevation_bin),mesh:String(e.mesh??""),count:Number(e.count)};return null!=e.origin_vx&&(t.originVoxel=[Number(e.origin_vx),Number(e.origin_vy),Number(e.origin_vz)],t.origin=[Number(e.origin_x),Number(e.origin_y),Number(e.origin_z)]),t}))}scenes(e){return this.get("api/v1/scenes",e).then(e=>e.map(e=>({...e,events:Number(e.events)})))}timeseries(e){return this.get("api/v1/timeseries",e).then(e=>e.map(e=>({bucket:Number(e.bucket),events:Number(e.events??0),avg_fps:Number(e.avg_fps??0)})))}eventCounts(e){return this.get("api/v1/event-counts",e).then(e=>e.map(e=>({event_type:String(e.event_type),count:Number(e.count??0)})))}funnel(e,t){return this.get("api/v1/funnel",{...t,steps:JSON.stringify(e)}).then(e=>e.map(e=>({step:Number(e.step),sessions:Number(e.sessions??0)})))}coverage(e){return this.get("api/v1/coverage",e).then(e=>e.map(e=>({vx:Number(e.vx),vy:Number(e.vy),vz:Number(e.vz),count:Number(e.count??0)})))}cameraDistance(e){return this.get("api/v1/camera/distance",e).then(e=>e.map(e=>({bucket:Number(e.bucket),count:Number(e.count??0)})))}navigation(e){return this.get("api/v1/navigation",e).then(e=>e.map(e=>({session_id:String(e.session_id??""),segments:Number(e.segments??0),total_distance:Number(e.total_distance??0),active_segments:Number(e.active_segments??0),active_distance:Number(e.active_distance??0)})))}cameraGestures(e){return this.get("api/v1/camera-gestures",e).then(e=>e.map(e=>({kind:String(e.kind??""),gestures:Number(e.gestures??0),total_ms:Number(e.total_ms??0),avg_ms:Number(e.avg_ms??0),max_ms:Number(e.max_ms??0)})))}interactionsBySource(e){return this.get("api/v1/interactions/sources",e).then(e=>e.map(e=>({event_type:String(e.event_type??""),source:String(e.source??""),count:Number(e.count??0),sessions:Number(e.sessions??0)})))}sessionMeta(e){return this.get(`api/v1/sessions/${encodeURIComponent(e)}/meta`)}async sceneRepresentation(e){try{return await this.get(`api/v1/scenes/${encodeURIComponent(e)}/representation`)}catch(e){if(e instanceof i&&404===e.status)return null;throw e}}async liveToken(){let e=new URL("api/v1/live/token",l(this.baseUrl)),t=await fetch(e,{method:"POST",headers:{"x-api-key":this.apiKey},cache:"no-store"});if(!t.ok)throw new i(await t.text().catch(()=>"")||t.statusText,t.status);return await t.json()}livePresenceUrl(e){let t=new URL("api/v1/live/presence",l(this.baseUrl));return t.searchParams.set("token",e),t.toString()}liveStreamUrl(e,t){let s=new URL("api/v1/live/stream",l(this.baseUrl));return s.searchParams.set("token",e),t&&t.length>0&&s.searchParams.set("types",t.join(",")),s.toString()}liveSessionUrl(e,t){let s=new URL(`api/v1/live/sessions/${encodeURIComponent(t)}`,l(this.baseUrl));return s.searchParams.set("token",e),s.toString()}}function l(e){return e.endsWith("/")?e:`${e}/`}async function o(e,t){let s=await e.scenes(t).catch(()=>[]);if(0===s.length)return[];let n=await Promise.all(s.map(t=>e.sceneRepresentation(t.scene_id).catch(()=>null))),r=new Set,a=[];for(let e of n)for(let t of e?.proxy?.meshes??[])r.has(t.name)||(r.add(t.name),a.push(t));return a}e.s(["ApiError",0,i,"CollectorApi",0,c],20880),e.s(["mergeSceneProxies",0,o],89339);var u=e.i(11623);function h(e,t,s,n){let r={cancelled:!1,source:null,timer:null},a=0,i=async()=>{let i;if(r.cancelled)return;n(0===a?"connecting":"reconnecting");try{let{token:s}=await e.liveToken();i=t(s)}catch{c();return}if(r.cancelled)return;let l=new EventSource(i);r.source=l,l.onopen=()=>{a=0,n("open")},l.onerror=()=>{l.close(),r.source===l&&(r.source=null),c()},s(l)},c=()=>{if(r.cancelled)return;n("reconnecting");let e=Math.min(1e3*2**a,15e3);a+=1,r.timer=setTimeout(()=>void i(),e)};return i(),()=>{r.cancelled=!0,r.timer&&clearTimeout(r.timer),r.source?.close(),r.source=null}}async function m(e,t,s){let n=e.getReader(),r=new TextDecoder,a="";for(t.addEventListener("abort",()=>void n.cancel().catch(()=>{}));;){let{done:e,value:t}=await n.read();if(e)return;let i=(a+=r.decode(t,{stream:!0})).indexOf("\n\n");for(;i>=0;){let e=a.slice(0,i);a=a.slice(i+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")),i=a.indexOf("\n\n")}}}e.s(["useLivePresence",0,function(e,t,s){let[n,r]=(0,u.useState)(null),[a,i]=(0,u.useState)("idle");return(0,u.useEffect)(()=>{if(!s||!t||!e){i("idle"),r(null);return}let n=new c(e,t);return h(n,e=>n.livePresenceUrl(e),e=>{e.addEventListener("presence",e=>{try{r(JSON.parse(e.data))}catch{}})},i)},[e,t,s]),{snapshot:n,status:a}},"useLiveSession",0,function(e,t,s,n,r,a){let[i,l]=(0,u.useState)("idle"),[o,h]=(0,u.useState)(!1),[p,d]=(0,u.useState)(0),b=(0,u.useRef)(r),g=(0,u.useRef)(a);return b.current=r,g.current=a,(0,u.useEffect)(()=>{if(!n||!t||!e||!s)return void l("idle");let r=new c(e,t),a=!1,i=0,o=null,u=null;h(!1),d(0);let p=()=>{if(a)return;l("reconnecting");let e=Math.min(1e3*2**i,15e3);i+=1,u=setTimeout(()=>void v(),e)},v=async()=>{let e;if(!a){l(0===i?"connecting":"reconnecting"),g.current(),d(0);try{({token:e}=await r.liveToken())}catch{p();return}if(!a){o=new AbortController;try{let t=await fetch(r.liveSessionUrl(e,s),{headers:{accept:"text/event-stream"},cache:"no-store",signal:o.signal});if(403===t.status){h(!0),l("idle");return}if(!t.ok||!t.body)return void p();i=0,l("open"),await m(t.body,o.signal,e=>{try{b.current(JSON.parse(e)),d(e=>e+1)}catch{}}),a||p()}catch{a||p()}}}};return v(),()=>{a=!0,u&&clearTimeout(u),o?.abort()}},[e,t,s,n]),{status:i,gated:o,count:p}},"useLiveStream",0,function(e,t,s,n,r){let[a,i]=(0,u.useState)("idle"),l=(0,u.useRef)(n);l.current=n;let o=r&&r.length>0?[...r].sort().join(","):"";return(0,u.useEffect)(()=>{if(!s||!t||!e)return void i("idle");let n=new c(e,t),r=o?o.split(","):void 0;return h(n,e=>n.liveStreamUrl(e,r),e=>{e.addEventListener("event",e=>{try{l.current(JSON.parse(e.data))}catch{}})},i)},[e,t,s,o]),{status:a}}],88725)},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/3pyggl13glbdc.js"].map(t=>e.l(t))).then(()=>t(67186)))},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/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(t=>e.l(t))).then(()=>t(70928)))},14074,e=>{e.v(t=>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(t=>e.l(t))).then(()=>t(87566)))},2213,e=>{e.v(t=>Promise.all(["static/chunks/3wqs57qehored.js","static/chunks/1j--a56ji33_x.js","static/chunks/1vzmzrjhlm1q5.js","static/chunks/2npk7tr63h7rl.js","static/chunks/1vkww9l6lgqag.js","static/chunks/1vpcaaf-0dn7q.js","static/chunks/0f_nv15a8q415.js","static/chunks/3pyggl13glbdc.js","static/chunks/3vaho-xrtuchd.js","static/chunks/25ctnyh7njp-d.js","static/chunks/3pdpaqzwhhijn.js"].map(t=>e.l(t))).then(()=>t(95758)))},15002,e=>{e.v(t=>Promise.all(["static/chunks/34gp3hvr3j6um.js","static/chunks/0x6i6e6863tir.js","static/chunks/3pdpaqzwhhijn.js","static/chunks/3vaho-xrtuchd.js","static/chunks/2gh4z57fem0_v.js","static/chunks/25ctnyh7njp-d.js","static/chunks/28ycc-1519hl2.js"].map(t=>e.l(t))).then(()=>t(95729)))},35983,e=>{e.v(t=>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(t=>e.l(t))).then(()=>t(50608)))},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)))},69091,e=>{e.v(t=>Promise.all(["static/chunks/3s2d9ymcd0l4e.js"].map(t=>e.l(t))).then(()=>t(12449)))},33996,e=>{e.v(t=>Promise.all(["static/chunks/0g_v2zswo4l6f.js"].map(t=>e.l(t))).then(()=>t(25453)))},56403,e=>{e.v(t=>Promise.all(["static/chunks/3qw6q7d74g5wp.js"].map(t=>e.l(t))).then(()=>t(61518)))}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,71028,e=>{"use strict";var t=e.i(28100),l=e.i(11623),n=e.i(56054),r=e.i(62238),a=e.i(59683),i=e.i(37660),o=e.i(93425),s=e.i(42279);let c="__all__";function u(e){return`${e[0]},${e[1]},${e[2]}`}function h({label:e,value:l,onChange:n,allLabel:r,options:a}){return(0,t.jsxs)("label",{className:"flex items-center gap-1.5 rounded-md border border-edge bg-ink/80 px-2 py-1 text-xs text-fg backdrop-blur",children:[(0,t.jsx)("span",{className:"font-medium text-fg-muted",children:e}),(0,t.jsxs)("select",{className:"max-w-[12rem] bg-transparent text-white outline-none",value:l,onChange:e=>n(e.target.value),children:[(0,t.jsx)("option",{value:c,children:r}),a.map(e=>(0,t.jsx)("option",{value:e.value,children:e.label},e.value))]})]})}e.s(["ClickRays3D",0,function({rays:m,cellSize:d,proxyMeshes:f=[]}){let g=(0,l.useRef)(null),p=(0,l.useRef)(null),b=(0,l.useRef)(null),[x,w]=(0,l.useState)("loading"),[v,y]=(0,l.useState)(null),[k,C]=(0,l.useState)(c),[j,A]=(0,l.useState)(c),[M,L]=(0,l.useState)(null),S=(0,l.useMemo)(()=>{let e=new Map;for(let t of m){let l=u(t.camVoxel),n=e.get(l);n?n.count+=t.count:e.set(l,{key:l,voxel:t.camVoxel,count:t.count})}return[...e.values()].sort((e,t)=>t.count-e.count)},[m]),P=(0,l.useMemo)(()=>{let e=new Map;for(let t of m)""!==t.mesh&&e.set(t.mesh,(e.get(t.mesh)??0)+t.count);return[...e.entries()].map(([e,t])=>({name:e,count:t})).sort((e,t)=>t.count-e.count)},[m]);return(0,l.useEffect)(()=>{k!==c&&(S.some(e=>e.key===k)||C(c))},[k,S]),(0,l.useEffect)(()=>{j!==c&&(P.some(e=>e.name===j)||A(c))},[j,P]),(0,l.useEffect)(()=>{let t=g.current;if(!t)return;if(0===m.length)return void w("empty");let l=!1,i=null;return w("loading"),y(null),(async()=>{try{let[{Engine:o},{Scene:s},{ArcRotateCamera:h},{HemisphericLight:g},{Vector3:x,Color3:v,Color4:y,Matrix:C},{MeshBuilder:A},{StandardMaterial:M}]=await Promise.all([e.A(3905),e.A(94432),e.A(59694),e.A(88004),e.A(27940),e.A(27124),e.A(14074),e.A(35983),e.A(18561)]);if(l)return;let S=k===c?m:m.filter(e=>u(e.camVoxel)===k);if(0===S.length)return void w("empty");let P=S.reduce((e,t)=>Math.max(e,t.count),1),R=0,N=0,z=0,E=0,T=(e,t,l)=>{R+=e,N+=t,z+=l,E++};for(let e of S)T(e.origin[0],e.origin[1],e.origin[2]),T(e.hit[0],e.hit[1],e.hit[2]);let V=E>0?new x(R/E,N/E,z/E):x.Zero(),B=4*d;for(let e of S)for(let t of[e.origin,e.hit]){let e=t[0]-V.x,l=t[1]-V.y,n=t[2]-V.z;B=Math.max(B,Math.sqrt(e*e+l*l+n*n))}let $=new o(t,!0,{preserveDrawingBuffer:!1}),F=new s($);F.clearColor=new y(.04,.05,.07,1);let I=new h("rays-cam",Math.PI/4,Math.PI/3,2.4*B,V,F);if(I.attachControl(t,!0),(0,r.disableWheelZoom)(I),p.current=I,b.current={target:V,alpha:I.alpha,beta:I.beta,radius:I.radius},new g("rays-light",new x(.4,1,.3),F),f.length>0){let e=A.CreateBox("scene-proxy",{size:1},F),t=new M("scene-proxy-mat",F);t.wireframe=!0,t.disableLighting=!0,t.emissiveColor=new v(.32,.4,.52),t.alpha=.35,e.material=t,e.isPickable=!0,e.thinInstanceEnablePicking=!0,e.metadata={hoverLabels:f.map(e=>e.name)};let l=f.length,n=new Float32Array(16*l);for(let e=0;e<l;e++){let t=f[e].aabb,l=Math.max(t[3]-t[0],.001),r=Math.max(t[4]-t[1],.001),a=Math.max(t[5]-t[2],.001);C.Scaling(l,r,a).multiply(C.Translation((t[0]+t[3])/2,(t[1]+t[4])/2,(t[2]+t[5])/2)).copyToArray(n,16*e)}e.thinInstanceSetBuffer("matrix",n,16,!0)}let Z=[],D=[];for(let e of S){let t=e.count/P,[l,r,a]=(0,n.heatRgb)(t),i=new y(l,r,a,.35+.65*t);Z.push([new x(e.origin[0],e.origin[1],e.origin[2]),new x(e.hit[0],e.hit[1],e.hit[2])]),D.push([i,i])}Z.length>0&&(A.CreateLineSystem("click-rays",{lines:Z,colors:D,useVertexAlpha:!0},F).isPickable=!1);let _=new Map;for(let e of S)_.set(u(e.camVoxel),e.camVoxel);if(_.size>0){let e=A.CreateSphere("rays-eye",{diameter:.6*d,segments:6},F),t=new M("rays-eye-mat",F);t.disableLighting=!0,t.emissiveColor=new v(.9,.95,1),e.material=t;let l=[..._.values()],n=new Float32Array(16*l.length);for(let e=0;e<l.length;e++){let t=l[e];C.Translation((t[0]+.5)*d,(t[1]+.5)*d,(t[2]+.5)*d).copyToArray(n,16*e)}e.thinInstanceSetBuffer("matrix",n,16,!0)}if(j!==c){let e=m.filter(e=>e.mesh===j);if(e.length>0){let t,l=f.find(e=>e.name===j);if(l){let e=l.aabb;t=new x((e[0]+e[3])/2,(e[1]+e[4])/2,(e[2]+e[5])/2)}else{let l=0,n=0,r=0;for(let t of e)l+=t.hit[0],n+=t.hit[1],r+=t.hit[2];t=new x(l/e.length,n/e.length,r/e.length)}let r=Math.max(3*d,.18*B),a=e.reduce((e,t)=>Math.max(e,t.count),1),i=[],o=[];for(let l of e){let e=l.origin[0]-l.hit[0],s=l.origin[1]-l.hit[1],c=l.origin[2]-l.hit[2],u=Math.sqrt(e*e+s*s+c*c)||1,h=l.count/a,m=r*(.4+.6*h),d=new x(t.x+e/u*m,t.y+s/u*m,t.z+c/u*m),[f,g,p]=(0,n.heatRgb)(h),b=new y(f,g,p,1);i.push([t.clone(),d]),o.push([new y(f,g,p,.25),b])}A.CreateLineSystem("mesh-rose",{lines:i,colors:o,useVertexAlpha:!0},F).isPickable=!1;let s=A.CreateSphere("mesh-rose-hub",{diameter:.8*d,segments:8},F),c=new M("mesh-rose-hub-mat",F);c.disableLighting=!0,c.emissiveColor=new v(1,.85,.4),s.material=c,s.position=t,s.isPickable=!0,s.metadata={hoverLabel:j}}}$.runRenderLoop(()=>F.render());let q=()=>$.resize();window.addEventListener("resize",q);let H=(0,a.attachMeshHover)(F,t,L),K=(0,r.attachDoubleClickFocus)(F,t,I);w("ready"),i=()=>{window.removeEventListener("resize",q),H(),K(),L(null),p.current=null,b.current=null,F.dispose(),$.dispose()}}catch(e){if(l)return;w("error"),y(e instanceof Error?e.message:"Failed to render click rays.")}})(),()=>{l=!0,i?.()}},[m,d,f,k,j]),(0,t.jsx)(o.Panel,{title:"Click rays (3D)",subtitle:"Each click joined to the view it was made from — gate by viewpoint or focus a mesh; double-click to recenter",children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("canvas",{ref:g,className:"aspect-video w-full rounded-lg border border-edge bg-ink"}),M?(0,t.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:M.x+12,top:M.y+12},children:M.label}):null,"ready"===x?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"absolute left-3 top-3 flex gap-2",children:[(0,t.jsx)(h,{label:"Viewpoint",value:k,onChange:C,allLabel:"All viewpoints",options:S.map(e=>({value:e.key,label:`(${e.voxel.join(", ")}) \xb7 ${e.count}`}))}),(0,t.jsx)(h,{label:"Mesh rose",value:j,onChange:A,allLabel:"No mesh focus",options:P.map(e=>({value:e.name,label:`${e.name} \xb7 ${e.count}`}))})]}),(0,t.jsx)(s.ZoomButtons,{onZoom:e=>p.current&&(0,r.stepZoom)(p.current,e),onReset:()=>p.current&&b.current&&(0,r.resetFocus)(p.current,b.current)}),(0,t.jsx)(i.HeatLegend,{title:"Click volume",lowLabel:"few clicks",highLabel:"most clicks",note:"Lines run from the camera position (bright eye) to where the click landed. Pick a viewpoint to see only clicks made from there; pick a mesh to see which directions its clicks came from."})]}):(0,t.jsx)("div",{className:"pointer-events-none absolute inset-0 grid place-items-center text-sm text-fg-muted",children:"loading"===x?"Rendering…":"empty"===x?"No correlated clicks in range.":"error"===x?v??"Click rays unavailable.":null})]})})}])},61518,e=>{e.n(e.i(71028))}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,28538,e=>{"use strict";var t=e.i(28100),n=e.i(11623);e.i(82665);var i=e.i(20880),r=e.i(89339),s=e.i(88725),l=e.i(62238),a=e.i(93425),o=e.i(42279);let c=new Set,u=[{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 h(e,t,n){let i=Math.max(1,n),r=new Map;u.forEach((e,t)=>{for(let n of e.types)r.set(n,t)});let s=u.map(()=>new Set);for(let n of e){let e=r.get(n.type);if(void 0===e)continue;let l=Math.min(1,Math.max(0,(n.ts-t)/i));s[e].add(Math.round(600*l))}return u.map((e,t)=>({key:e.key,label:e.label,color:e.color,marks:[...s[t]].sort((e,t)=>e-t).map(e=>e/600)})).filter(e=>e.marks.length>0)}function d(e){let t=Math.max(0,Math.round(e/1e3)),n=Math.floor(t/60);return`${n}:${(t%60).toString().padStart(2,"0")}`}function p(e){let t=e.slice(e.lastIndexOf("/")+1);return t.length>20?`${t.slice(0,19)}\u2026`:t}function m({lanes:e,duration:n,progress:i,onSeek:r,hiddenTypes:s}){let l=e.filter(e=>{let t=u.find(t=>t.key===e.key);if(!t)return!0;for(let e of t.types)if(!s.has(e))return!0;return!1});if(0===l.length)return null;let a=`${Math.min(100,Math.max(0,i/Math.max(1,n)*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:l.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 i;return t=e.clientX,void r(Math.min(1,Math.max(0,(t-(i=e.currentTarget.getBoundingClientRect()).left)/(i.width||1)))*n)},children:[(0,t.jsx)("div",{className:"flex flex-col gap-1",children:l.map(e=>(0,t.jsx)("div",{className:"relative h-2.5 rounded-sm bg-white/5",children:e.marks.map((n,i)=>(0,t.jsx)("span",{"aria-hidden":!0,className:"pointer-events-none absolute top-0 h-full w-px",style:{left:`${100*n}%`,backgroundColor:e.color,opacity:.85}},i))},e.key))}),(0,t.jsx)("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-1 w-px bg-saffron",style:{left:a}})]})]})}e.s(["SessionReplay",0,function({baseUrl:u,apiKey:f,sessionId:g,hiddenTypes:b,isLive:y=!1}){let x=(0,n.useRef)(null),w=(0,n.useRef)(null),v=(0,n.useRef)(0),k=(0,n.useRef)(b??c),j=(0,n.useRef)(!1),M=(0,n.useRef)(null),C=(0,n.useRef)(!1),_=(0,n.useRef)(!1),S=(0,n.useRef)(null),N=(0,n.useRef)(0),P=(0,n.useRef)([]),R=(0,n.useRef)([]),$=(0,n.useRef)([]),z=(0,n.useRef)(!0),I=(0,n.useRef)("birdview"),L=(0,n.useRef)(null),V=(0,n.useRef)(null),A=(0,n.useRef)([]),q=(0,n.useRef)(null),E=(0,n.useRef)(null),[T,F]=(0,n.useState)("idle"),[W,B]=(0,n.useState)(null),[Z,O]=(0,n.useState)(0),[K,H]=(0,n.useState)(0),[G,U]=(0,n.useState)(!1),[X,D]=(0,n.useState)([]),[J,Q]=(0,n.useState)([]),[Y,ee]=(0,n.useState)([]),[et,en]=(0,n.useState)(!0),[ei,er]=(0,n.useState)(!1),[es,el]=(0,n.useState)("birdview"),[ea,eo]=(0,n.useState)(null),[ec,eu]=(0,n.useState)(!1),[eh,ed]=(0,n.useState)(!1),[ep,em]=(0,n.useState)(null);(0,n.useEffect)(()=>{z.current=et},[et]),(0,n.useEffect)(()=>{_.current=G},[G]),(0,n.useEffect)(()=>{C.current=ei},[ei]),(0,n.useEffect)(()=>{I.current=es,j.current=!0},[es]),(0,n.useEffect)(()=>{k.current=b??c,j.current=!0},[b]),(0,n.useEffect)(()=>{let t=x.current;if(!t)return;let n=!1,s=null;return F("loading"),B(null),U(!1),O(0),H(0),D([]),Q([]),ee([]),eo(null),L.current=null,P.current=[],R.current=[],$.current=[],v.current=0,q.current=null,A.current=[],V.current=null,eu(!1),ed(!1),em(null),(async()=>{try{let[{Engine:a},{Scene:o},{ArcRotateCamera:c},{UniversalCamera:d},{HemisphericLight:p},{Vector3:m,Color3:b,Color4:x,Matrix:E},{MeshBuilder:T},{StandardMaterial:W},{fetchSessionEvents:B,ReplayPlayer:Z}]=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 B({endpoint:u,apiKey:f,sessionId:g});if(n)return;if(0===K.length)return void F("empty");let G=K[0].ts,X=K[0].ts;for(let e of K)e.ts<G&&(G=e.ts),e.ts>X&&(X=e.ts);let J=new i.CollectorApi(u,f),Y=await (0,r.mergeSceneProxies)(J,{since:G-1,until:X+1});if(n)return;let et=[...K].sort((e,t)=>e.ts-t.ts),en=et[0].ts,ei=[],es=[],el=new Map,ea=null;for(let e of et){let t=e.ts-en;if("camera_sample"===e.type){ea=[e.position[0],e.position[1],e.position[2]],ei.push({at:t,position:ea,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 n=e.childPath?`${e.nodeId}/${e.childPath}`:e.nodeId,i=el.get(n);i||(i=[],el.set(n,i)),i.push({at:t,position:[e.position[0],e.position[1],e.position[2]]});continue}if("pointer_click"===e.type&&e.hitPoint){let n=e.ray?.origin??ea;if(!n)continue;es.push({at:t,type:"pointer_click",origin:[n[0],n[1],n[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(!ea)continue;es.push({at:t,type:"mesh_interaction",origin:[ea[0],ea[1],ea[2]],hit:[e.point[0],e.point[1],e.point[2]],...e.mesh?{mesh:e.mesh}:{}})}}if(0===ei.length&&0===es.length&&0===el.size)return void F("empty");let ec=new a(t,!0,{preserveDrawingBuffer:!1}),eu=new o(ec);eu.clearColor=new x(.04,.05,.07,1),V.current=eu;let eh=new c("birdview-cam",-Math.PI/2,.22,12,m.Zero(),eu);eh.attachControl(t,!0),(0,l.disableWheelZoom)(eh),w.current=eh,new p("replay-light",new m(0,1,0),eu);let ed=new d("replay-follow-cam",m.Zero(),eu);ed.minZ=.05,ed.fov=Math.PI/3,eu.activeCamera=eh;let ep="birdview",em=T.CreateGround("replay-ground",{width:20,height:20,subdivisions:20},eu),ef=new W("replay-ground-mat",eu);ef.diffuseColor=new b(.12,.14,.18),ef.wireframe=!0,em.material=ef;let eg=new Set(el.keys()),eb=new Set(Array.from(eg,e=>e.slice(e.lastIndexOf("/")+1))),ey=[],ex=[],ew=new Set,ev=e=>{if(ew.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;ew.add(e.name);let t=e.aabb,n=Math.max(t[3]-t[0],.001),i=Math.max(t[4]-t[1],.001),r=Math.max(t[5]-t[2],.001),s=T.CreateBox(`replay-proxy-${e.name}`,{width:n,height:i,depth:r},eu);s.position=new m((t[0]+t[3])/2,(t[1]+t[4])/2,(t[2]+t[5])/2);let l=new W(`replay-proxy-mat-${e.name}`,eu);return l.wireframe=!0,l.disableLighting=!0,l.emissiveColor=new b(.32,.4,.52),l.alpha=.35,s.material=l,s.isPickable=!1,q.current&&s.setEnabled(!1),ex.push(s),ey.push({name:e.name,center:new m((t[0]+t[3])/2,t[4],(t[2]+t[5])/2)}),!0};for(let e of Y)ev(e);P.current=ey,R.current=ey.map(()=>null),Q(ey.map(e=>e.name)),A.current=ex;let ek=async()=>{let e=await (0,r.mergeSceneProxies)(J,{since:G-1}).catch(()=>null);if(n||!e)return;let t=!1;for(let n of e)ev(n)&&(t=!0);t&&(P.current=ey,R.current=ey.map((e,t)=>R.current[t]??null),Q(ey.map(e=>e.name)),j.current=!0)},ej=[[.91,.47,.98],[.4,.95,.6],[.98,.8,.3],[.45,.85,1]],eM=e=>{let t=e.indexOf("/");return -1===t?e:e.slice(0,t)},eC=[],e_=new Map,eS=0,eN=(e,t,n)=>{let i=T.CreateSphere(`replay-actor-${e}`,{diameter:.5,segments:12},eu),r=new W(`replay-actor-mat-${e}`,eu);r.disableLighting=!0;let s=ej[eS%ej.length];r.emissiveColor=new b(s[0],s[1],s[2]),i.material=r,i.isPickable=!1,i.isVisible=!1,eS++;let l={key:e,mesh:i,samples:n,driveKey:t};return eC.push(l),e_.set(e,l),l},eP=new Map,eR=new Map;for(let[e,t]of el){if(0===t.length)continue;let n=eM(e);if(e===n)eP.set(n,t);else{let i=eR.get(n);(!i||t.length>i.samples.length)&&eR.set(n,{key:e,samples:t})}}for(let e of new Set([...eP.keys(),...eR.keys()])){let t=eP.get(e);if(t)eN(e,e,t);else{let t=eR.get(e);eN(e,t.key,t.samples)}}$.current=eC.map(()=>null),ee(eC.map(e=>e.key));let e$=(e,t)=>{if(0===e.length||t<e[0].at)return null;let n=0,i=e.length-1,r=-1;for(;n<=i;){let s=n+i>>1;e[s].at<=t?(r=s,n=s+1):i=s-1}if(r<0)return null;let s=e[r],l=e[r+1];if(!l)return s.position;let a=l.at-s.at;if(a<=0)return s.position;let o=Math.max(0,Math.min(1,(t-s.at)/a));return[s.position[0]+(l.position[0]-s.position[0])*o,s.position[1]+(l.position[1]-s.position[1])*o,s.position[2]+(l.position[2]-s.position[2])*o]},ez=1,eI=1.4,eL=T.CreateSphere("replay-camera-origin",{diameter:.35,segments:12},eu),eV=new W("replay-camera-origin-mat",eu);eV.disableLighting=!0,eV.emissiveColor=new b(.6,.9,1),eL.material=eV;let eA=T.CreateLines("replay-camera-frustum",{points:[m.Zero(),new m(0,0,1)]},eu);eA.color=new b(.7,.95,1),eA.isPickable=!1;let eq=T.CreateCylinder("replay-camera-cone",{height:1,diameterTop:0,diameterBottom:1,tessellation:24},eu);eq.bakeTransformIntoVertices(E.RotationX(-Math.PI/2).multiply(E.Translation(0,0,.5)));let eE=new W("replay-camera-cone-mat",eu);eE.disableLighting=!0,eE.emissiveColor=new b(.4,.78,1),eE.alpha=.16,eE.backFaceCulling=!1,eq.material=eE,eq.isPickable=!1,eq.isVisible=!1;let eT=(e,t,n,i)=>{if(e?.dispose(),0===n.length)return null;let r=T.CreateLineSystem(t,{lines:n,...i?{colors:i,useVertexAlpha:!0}:{}},eu);return r.isPickable=!1,r},eF=null,eW=null,eB=null,eZ=()=>{let e=k.current,t=[],n=[];for(let i of es){if(e.has(i.type))continue;let[r,s,l]=i.hit,a="mesh_interaction"===i.type?new x(.45,.85,1,.32):new x(1,.7,.35,.32);t.push([new m(r-.1,s,l),new m(r+.1,s,l)]),t.push([new m(r,s-.1,l),new m(r,s+.1,l)]),t.push([new m(r,s,l-.1),new m(r,s,l+.1)]),n.push([a,a],[a,a],[a,a])}eB=eT(eB,"replay-persistent-marks",t,n)};eZ();let eO=T.CreateSphere("replay-glow",{diameter:1,segments:12},eu),eK=new W("replay-glow-mat",eu);eK.disableLighting=!0,eK.emissiveColor=new b(1,.62,.2),eK.alpha=0,eO.material=eK,eO.isPickable=!1,eO.isVisible=!1;let eH=1/0,eG=1/0,eU=1/0,eX=-1/0,eD=-1/0,eJ=-1/0,eQ=!1,eY=e=>{eH=Math.min(eH,e[0]),eG=Math.min(eG,e[1]),eU=Math.min(eU,e[2]),eX=Math.max(eX,e[0]),eD=Math.max(eD,e[1]),eJ=Math.max(eJ,e[2])},e0=()=>{let e;if(eQ||!Number.isFinite(eH))return;let t=(eH+eX)/2,n=(eG+eD)/2,i=(eU+eJ)/2,r=eX-eH,s=eD-eG,l=eJ-eU,a=Math.sqrt(r*r+s*s+l*l);eh.setTarget(new m(t,n,i)),e=1.3*a,eh.radius=Number.isFinite(e)?Math.max(8,e):12,eQ=!0};for(let e of ei)eY(e.position);for(let e of es)eY(e.origin),eY(e.hit);for(let e of el.values())for(let t of e)eY(t.position);for(let e of Y)eY(e.aabb.slice(0,3)),eY(e.aabb.slice(3,6));e0();{let e=eX-eH,t=eD-eG,n=eJ-eU,i=Number.isFinite(e)?Math.sqrt(e*e+t*t+n*n):0,r=Math.min(Math.max(.035*i,.45),Math.max(.45,.18*i));ez=r/.35,eI=Math.max(.16*i,3.2*r,1.4),eL.scaling.setAll(ez)}let e1=-1,e2=e=>{var i;let r=j.current;if(!r&&e===e1)return;j.current=!1,e1=e,r&&eZ();let s=k.current;(i=I.current)!==ep&&(ep=i,"follow"===i?(eh.detachControl(),eu.activeCamera=ed):(eu.activeCamera=eh,eh.attachControl(t,!0)));let l="follow"===I.current,a=s.has("camera_sample")?null:(e=>{if(0===ei.length)return null;let t=0,n=ei.length-1,i=-1;for(;t<=n;){let r=t+n>>1;ei[r].at<=e?(i=r,t=r+1):n=r-1}return i>=0?ei[i]:null})(e);if(a){eL.position.set(a.position[0],a.position[1],a.position[2]);let e=a.direction,t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2])||1,n=eI,i=new m(a.position[0]+e[0]/t*n,a.position[1]+e[1]/t*n,a.position[2]+e[2]/t*n);if(l)eL.isVisible=!1,eA.isVisible=!1,eq.isVisible=!1,ed.position.set(a.position[0],a.position[1],a.position[2]),ed.setTarget(i),a.fov&&a.fov>0&&(ed.fov=a.fov);else{eL.isVisible=!0,eA.isVisible=!0,eA=T.CreateLines("replay-camera-frustum",{points:[eL.position.clone(),i],instance:eA},eu);let e=(a.fov&&a.fov>0?a.fov:Math.PI/3)/2,t=n*Math.tan(e);eq.isVisible=!0,eq.position.copyFrom(eL.position),eq.lookAt(i),eq.scaling.set(2*t,2*t,n)}}else eL.isVisible=!1,eA.isVisible=!1,eq.isVisible=!1;let o=s.has("node_transform");for(let t of eC){let n=o?null:e$(t.samples,e);if(!n){t.mesh.isVisible=!1;continue}t.mesh.isVisible=!0,t.mesh.position.set(n[0],n[1],n[2])}let c=es.filter(t=>!s.has(t.type)&&t.at<=e&&t.at>=e-2200),u=[],h=[],d=[],p=[],f=null;for(let t of c){let n=e-t.at,i=Math.max(0,Math.min(1,1-n/2200)),r=new x(1,.62,.2,.18+.72*i),s=new m(t.origin[0],t.origin[1],t.origin[2]),l=new m(t.hit[0],t.hit[1],t.hit[2]);u.push([s,l]),h.push([r,r]);let a=.12+.08*i;d.push([new m(l.x-a,l.y,l.z),new m(l.x+a,l.y,l.z)]),d.push([new m(l.x,l.y-a,l.z),new m(l.x,l.y+a,l.z)]),d.push([new m(l.x,l.y,l.z-a),new m(l.x,l.y,l.z+a)]);let o=new x(1,.78,.42,.22+.72*i);if(p.push([o,o],[o,o],[o,o]),n<=900){let e=1-n/900;(!f||e>f.t)&&(f={hit:t.hit,t:e})}}if(f){let e=.25+.9*f.t;eO.isVisible=!0,eO.scaling.set(e,e,e),eO.position.set(f.hit[0],f.hit[1],f.hit[2]),eK.alpha=.12+.5*f.t}else eO.isVisible=!1;let g=null,b=-1/0;for(let e of c)e.mesh&&e.at>b&&(b=e.at,g=e.mesh);g!==L.current&&(L.current=g,n||eo(g)),eF=eT(eF,"replay-trail-lines",u,h),eW=eT(eW,"replay-trail-hits",d,p)},e3=et.length>0?et[et.length-1].ts-en:0,e5=e3,e4=et.length>0?et[et.length-1].ts:-1/0,e8=et.map(e=>({type:e.type,ts:e.ts})),e9=0,e6=null;if(y)M.current=null,S.current=e=>{if(n)return;let t="number"==typeof e.ts?e.ts:NaN;if(!Number.isFinite(t)||t<=e4)return;e4=t;let i=t-en;if(i>e5&&(e5=i),i>e3&&(e3=i),e8.push({type:e.type,ts:t}),"camera_sample"===e.type){let t=e.position,n=e.direction;if(t&&n){let r=[t[0],t[1],t[2]];ea=r;let s="number"==typeof e.fov?e.fov:void 0;ei.push({at:i,position:r,direction:[n[0],n[1],n[2]],...void 0!==s?{fov:s}:{}}),eY(r),e0()}}else if("pointer_click"===e.type){let t=e.hitPoint,n=e.ray,r=n?.origin??ea;if(t&&r){let n="string"==typeof e.hitMesh?e.hitMesh:void 0;es.push({at:i,type:"pointer_click",origin:[r[0],r[1],r[2]],hit:[t[0],t[1],t[2]],...n?{mesh:n}:{}}),eY(t),j.current=!0}}else if("mesh_interaction"===e.type){let t=e.point;if(t&&ea){let n="string"==typeof e.mesh?e.mesh:void 0;es.push({at:i,type:"mesh_interaction",origin:[ea[0],ea[1],ea[2]],hit:[t[0],t[1],t[2]],...n?{mesh:n}:{}}),eY(t),j.current=!0}}else if("node_transform"===e.type){let t=e.position;if(e.boneId||"string"!=typeof e.nodeId||!t)return;let n="string"==typeof e.childPath?e.childPath:void 0,r=n?`${e.nodeId}/${n}`:e.nodeId;((e,t)=>{let n=eM(e),i=e_.get(n);if(!i){i=eN(n,e,[]);let t=$.current;$.current=eC.map((e,n)=>t[n]??null),ee(eC.map(e=>e.key))}e===i.driveKey?i.samples.push(t):e===n&&i.driveKey!==n&&(i.driveKey=n,i.samples.length=0,i.samples.push(t))})(r,{at:i,position:[t[0],t[1],t[2]]}),eY(t)}let r=performance.now();r-e9>250&&(e9=r,D(h(e8,en,Math.max(1,e3)))),C.current&&i>v.current&&(v.current=i)},N.current=e3,v.current=e3,C.current=!0,er(!0),U(!1),O(e3),H(e3),D(h(e8,en,Math.max(1,e3))),e2(e3),e6=setInterval(()=>void ek(),4e3);else{let e=new Z(K,{reset(){},apply(){}},{onProgress:e=>{n||(v.current=e,H(e))},onComplete:()=>{n||U(!1)}});M.current=e,O(e.durationMs),D(h(et,en,e.durationMs)),e.update(0),e2(0)}let e7=E.Identity(),te=new Map,tt=e=>{let t=te.get(e);if(t)return t;let n={w:e.offsetWidth||60,h:e.offsetHeight||16};return e.offsetWidth>0&&te.set(e,n),n},tn=performance.now(),ti=0;ec.runRenderLoop(()=>{if(y){let e=performance.now(),t=e-tn;if(tn=e,C.current)v.current+=t,v.current>e3&&(e3=v.current),N.current=e3,H(v.current),e-ti>250&&(ti=e,O(e3));else if(_.current){let e=v.current+t;e>=e3&&(e=e3),v.current=e,H(e)}}e2(v.current),eu.render(),(()=>{if(!z.current)return;let e=t.clientWidth||ec.getRenderWidth(),n=t.clientHeight||ec.getRenderHeight(),i=eh.viewport.toGlobal(e,n),r=eu.getTransformMatrix(),s=L.current,l=e=>e.slice(e.lastIndexOf("/")+1),a=e=>!!s&&(s===e||l(s)===l(e)||e.endsWith(`/${s}`)||s.endsWith(`/${e}`)),o=[],c=P.current,u=R.current;for(let e=0;e<c.length;e++){let t=u[e];if(!t)continue;let n=m.Project(c[e].center,e7,r,i);if(n.z<0||n.z>1){t.style.opacity="0";continue}o.push({el:t,x:n.x,y:n.y,liftPct:140,highlighted:a(c[e].name)})}let h=$.current;for(let e=0;e<eC.length;e++){let t=h[e];if(!t)continue;let n=eC[e].mesh;if(!n.isVisible){t.style.opacity="0";continue}let s=m.Project(n.position,e7,r,i);if(s.z<0||s.z>1){t.style.opacity="0";continue}o.push({el:t,x:s.x,y:s.y,liftPct:180,highlighted:a(eC[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:n}=tt(e.el),i=e.x-t/2,r=e.x+t/2,s=e.y-e.liftPct/100*n,l=s,a=!0,o=0;for(;a&&o++<256;)for(let e of(a=!1,d))i<e.right&&r>e.left&&l<e.bottom&&l+n>e.top&&(l=e.bottom+1,a=!0);d.push({left:i,right:r,top:l,bottom:l+n});let c=l-s;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 tr=()=>ec.resize();window.addEventListener("resize",tr),F("ready"),s=()=>{window.removeEventListener("resize",tr),e6&&clearInterval(e6),S.current=null,M.current?.pause(),eA.dispose(),eq.dispose(),eF?.dispose(),eW?.dispose(),eB?.dispose(),eO.dispose(),q.current?.dispose(),q.current=null,A.current=[],V.current=null,eu.dispose(),ec.dispose(),w.current=null,M.current=null}}catch(e){if(n)return;F("error"),B(e instanceof Error?e.message:"Failed to load replay.")}})(),()=>{n=!0,s?.()}},[u,f,g,y]);let ef=(0,n.useCallback)(()=>{if(y){er(!1),C.current=!1,U(e=>{let t=!e;return _.current=t,t});return}let e=M.current;e&&U(t=>(t?e.pause():e.play(),!t))},[y]),eg=(0,n.useCallback)(e=>{if(y){er(!1),C.current=!1,U(!1),_.current=!1,v.current=e,H(e);return}let t=M.current;t&&(t.pause(),t.seek(e),U(!1),v.current=e,H(e))},[y]),eb=(0,n.useCallback)(()=>{er(!0),C.current=!0,U(!1),_.current=!1,v.current=N.current,H(N.current)},[]),{gated:ey}=(0,s.useLiveSession)(u,f,g,y&&"ready"===T,e=>S.current?.(e),()=>{}),ex=(0,n.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]),ew=(0,n.useCallback)(async t=>{let n=V.current;if(n){ed(!0),em(`Loading ${t.name}…`);try{let[{loadSceneBackdrop:i}]=await Promise.all([e.A(3633),e.A(91064)]);if(V.current!==n)return;q.current?.dispose();let r=await i(n,t);if(V.current!==n)return void r.dispose();for(let e of(q.current=r,A.current))e.setEnabled(!1);j.current=!0,eu(!0),em(`Loaded ${t.name} (${r.meshes.length} meshes).`)}catch(e){em(e instanceof Error?e.message:"Could not load model.")}finally{ed(!1)}}},[]),ev=(0,n.useCallback)(e=>{let t=e.target.files?.[0];e.target.value="",t&&ew(t)},[ew]),ek=(0,n.useCallback)(()=>{for(let e of(q.current?.dispose(),q.current=null,A.current))e.setEnabled(!0);j.current=!0,eu(!1),em(null)},[]);return(0,t.jsxs)(a.Panel,{title:y?"Session replay · live":"Session replay (birdview timeline)",subtitle:y?"Following this session live — new camera moves and interactions stream in and the timeline grows. Scrub back to review, then press ● LIVE to return to the edge.":"Scrub the camera path and interaction rays; every click stays marked and glows as the playhead passes it. The color-coded strip marks when each event fired (click to seek).",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("canvas",{ref:x,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 ${et?"":"hidden"}`,children:[J.map((e,n)=>(0,t.jsx)("div",{title:e,ref:e=>{e&&(R.current[n]=e)},className:`absolute left-0 top-0 whitespace-nowrap rounded px-1.5 py-0.5 text-[10px] font-medium opacity-0 transition-colors ${ex(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:p(e)},e)),Y.map((e,n)=>(0,t.jsx)("div",{title:e,ref:e=>{e&&($.current[n]=e)},className:`absolute left-0 top-0 whitespace-nowrap rounded px-1.5 py-0.5 text-[10px] font-medium opacity-0 transition-colors ${ex(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:p(e)},`actor-${e}`))]}),"ready"===T&&(J.length>0||Y.length>0)?(0,t.jsx)("button",{type:"button",onClick:()=>en(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":et?"true":"false",children:et?"Hide labels":"Show labels"}):null,"ready"===T&&"birdview"===es?(0,t.jsx)(o.ZoomButtons,{onZoom:e=>w.current&&(0,l.stepZoom)(w.current,e)}):null,"ready"!==T?(0,t.jsx)("div",{className:"pointer-events-none absolute inset-0 grid place-items-center text-sm text-fg-muted",children:"loading"===T?"Loading replay…":"empty"===T?"No replayable events (raw retention may be disabled).":"error"===T?W??"Replay unavailable.":null}):null]}),(0,t.jsxs)("div",{className:"mt-3 flex items-center gap-3",children:[(0,t.jsx)("button",{type:"button",onClick:ef,disabled:"ready"!==T,className:"rounded-md bg-amber px-3 py-1.5 text-sm font-medium text-ink transition hover:bg-ember disabled:opacity-40",children:G?"Pause":"Play"}),y?(0,t.jsxs)("button",{type:"button",onClick:eb,disabled:"ready"!==T,"aria-pressed":ei?"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 ${ei?"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 ${ei?"animate-pulse bg-rose-400":"bg-fg-muted"}`}),ei?"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:()=>el("birdview"),disabled:"ready"!==T,"aria-pressed":"birdview"===es?"true":"false",className:`rounded px-2 py-1 transition disabled:opacity-40 ${"birdview"===es?"bg-amber text-ink":"text-fg hover:text-white"}`,children:"Birdview"}),(0,t.jsx)("button",{type:"button",onClick:()=>el("follow"),disabled:"ready"!==T,"aria-pressed":"follow"===es?"true":"false",className:`rounded px-2 py-1 transition disabled:opacity-40 ${"follow"===es?"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:d(K)}),(0,t.jsx)("input",{type:"range",min:0,max:Math.max(1,Z),step:50,value:Math.min(K,Z),onChange:e=>eg(Number(e.target.value)),disabled:"ready"!==T,className:"flex-1 accent-amber"}),(0,t.jsx)("span",{className:"w-12 font-mono text-xs tabular-nums text-fg-muted",children:d(Z)})]}),"ready"===T?(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-3",children:[(0,t.jsx)("input",{ref:E,type:"file",accept:".glb,.gltf,model/gltf-binary,model/gltf+json",onChange:ev,className:"hidden"}),(0,t.jsx)("button",{type:"button",onClick:()=>E.current?.click(),disabled:eh,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:eh?"Loading model…":ec?"Replace model (.glb)":"Load model (.glb)"}),ec?(0,t.jsx)("button",{type:"button",onClick:ek,disabled:eh,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,ep?(0,t.jsx)("span",{className:"text-xs text-fg-muted",role:"status",children:ep}):(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"===T?(0,t.jsx)(m,{lanes:X,duration:Z,progress:K,onSeek:eg,hiddenTypes:b??c}):null,y&&ey&&"ready"===T?(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]})}])},12449,e=>{e.n(e.i(28538))},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)))},85461,e=>{e.v(t=>Promise.all(["static/chunks/0n8n481szj90g.js"].map(t=>e.l(t))).then(()=>t(57092)))},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/340pg0qkv5tqq.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/3bsvp8qhjqdu0.js","static/chunks/25ctnyh7njp-d.js","static/chunks/3pyggl13glbdc.js","static/chunks/3rl45k759wfi1.js","static/chunks/0fxfsshoxnnh6.js"].map(t=>e.l(t))).then(()=>t(83572)))}]);