@uptimizr/dashboard 0.1.1 → 0.1.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/0927l-ygd5c8d.js +1 -0
  8. package/out/_next/static/chunks/09e4adtr6w0xe.js +1 -0
  9. package/out/_next/static/chunks/0g_v2zswo4l6f.js +1 -0
  10. package/out/_next/static/chunks/0o_tpe5tlugtr.js +3 -0
  11. package/out/_next/static/chunks/0pj9pajm2xz97.css +3 -0
  12. package/out/_next/static/chunks/{30yzu213bqtq0.js → 10fnxpln_5xfd.js} +1 -1
  13. package/out/_next/static/chunks/11v6j6q59u-f_.js +1 -0
  14. package/out/_next/static/chunks/{turbopack-2ropzf0axp1x9.js → turbopack-0sgd6pfbe1fy6.js} +1 -1
  15. package/out/_not-found/__next._full.txt +2 -2
  16. package/out/_not-found/__next._head.txt +1 -1
  17. package/out/_not-found/__next._index.txt +2 -2
  18. package/out/_not-found/__next._not-found.__PAGE__.txt +1 -1
  19. package/out/_not-found/__next._not-found.txt +1 -1
  20. package/out/_not-found/__next._tree.txt +2 -2
  21. package/out/_not-found.html +1 -1
  22. package/out/_not-found.txt +2 -2
  23. package/out/index.html +1 -1
  24. package/out/index.txt +3 -3
  25. package/package.json +4 -4
  26. package/out/_next/static/chunks/00zdau6mcqeae.js +0 -1
  27. package/out/_next/static/chunks/0tx1j_ghpz7rc.css +0 -3
  28. package/out/_next/static/chunks/1lsg-22yob8dx.js +0 -1
  29. package/out/_next/static/chunks/21o42k82w4llc.js +0 -1
  30. package/out/_next/static/chunks/2d09v5u7dfq0q.js +0 -1
  31. package/out/_next/static/chunks/2tws5udjdcmh3.js +0 -1
  32. package/out/_next/static/chunks/2yiy_l8bwiw2_.js +0 -3
  33. package/out/_next/static/chunks/30fq_t9e2_fv-.js +0 -1
  34. /package/out/_next/static/{Hn5EPlVBFzONWfhyS_1fO → yttuijl-0Cn9k8uTCfhIM}/_buildManifest.js +0 -0
  35. /package/out/_next/static/{Hn5EPlVBFzONWfhyS_1fO → yttuijl-0Cn9k8uTCfhIM}/_clientMiddlewareManifest.js +0 -0
  36. /package/out/_next/static/{Hn5EPlVBFzONWfhyS_1fO → yttuijl-0Cn9k8uTCfhIM}/_ssgManifest.js +0 -0
package/out/404.html CHANGED
@@ -1 +1 @@
1
- <!DOCTYPE html><html lang="en" class="space_grotesk_59d6dcf5-module__z_Ctiq__variable jetbrains_mono_38c99671-module__5Dhsuq__variable"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/chunks/0tx1j_ghpz7rc.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/3sjq_xoi4rbyg.js"/><script src="/_next/static/chunks/30yzu213bqtq0.js" async=""></script><script src="/_next/static/chunks/0tl_moiyi2txt.js" async=""></script><script src="/_next/static/chunks/turbopack-2ropzf0axp1x9.js" async=""></script><script src="/_next/static/chunks/0impkpmxx3ttp.js" async=""></script><meta name="robots" content="noindex"/><meta name="next-size-adjust" content=""/><title>404: This page could not be found.</title><title>Uptimizr — 3D Scene Analytics</title><meta name="description" content="Open-source analytics dashboard for 3D scenes."/><link rel="icon" href="/icon.svg?icon.08h29dad3pcxg.svg" sizes="any" type="image/svg+xml"/><script src="/_next/static/chunks/0cz1d0mv5g_q7.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/3sjq_xoi4rbyg.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[87346,[\"/_next/static/chunks/0impkpmxx3ttp.js\"],\"default\"]\n3:I[62327,[\"/_next/static/chunks/0impkpmxx3ttp.js\"],\"default\"]\n4:I[96686,[\"/_next/static/chunks/0impkpmxx3ttp.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[96686,[\"/_next/static/chunks/0impkpmxx3ttp.js\"],\"ViewportBoundary\"]\na:I[96686,[\"/_next/static/chunks/0impkpmxx3ttp.js\"],\"MetadataBoundary\"]\nc:I[50404,[\"/_next/static/chunks/0impkpmxx3ttp.js\"],\"default\",1]\n:HL[\"/_next/static/chunks/0tx1j_ghpz7rc.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",16],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/0tx1j_ghpz7rc.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/0impkpmxx3ttp.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"className\":\"space_grotesk_59d6dcf5-module__z_Ctiq__variable jetbrains_mono_38c99671-module__5Dhsuq__variable\",\"children\":[\"$\",\"body\",null,{\"children\":[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:notFound:0:1:props:style\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style\",\"children\":404}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style\",\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,null]},null,false,\"$@7\"]},null,false,null],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/0tx1j_ghpz7rc.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"Hn5EPlVBFzONWfhyS_1fO\"}\n"])</script><script>self.__next_f.push([1,"d:[]\n7:\"$Wd\"\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"e:I[74838,[\"/_next/static/chunks/0impkpmxx3ttp.js\"],\"IconMark\"]\n6:null\nb:[[\"$\",\"title\",\"0\",{\"children\":\"Uptimizr — 3D Scene Analytics\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Open-source analytics dashboard for 3D scenes.\"}],[\"$\",\"link\",\"2\",{\"rel\":\"icon\",\"href\":\"/icon.svg?icon.08h29dad3pcxg.svg\",\"sizes\":\"any\",\"type\":\"image/svg+xml\"}],[\"$\",\"$Le\",\"3\",{}]]\n"])</script></body></html>
1
+ <!DOCTYPE html><html lang="en" class="space_grotesk_59d6dcf5-module__z_Ctiq__variable jetbrains_mono_38c99671-module__5Dhsuq__variable"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/chunks/0pj9pajm2xz97.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/3sjq_xoi4rbyg.js"/><script src="/_next/static/chunks/10fnxpln_5xfd.js" async=""></script><script src="/_next/static/chunks/0tl_moiyi2txt.js" async=""></script><script src="/_next/static/chunks/turbopack-0sgd6pfbe1fy6.js" async=""></script><script src="/_next/static/chunks/0impkpmxx3ttp.js" async=""></script><meta name="robots" content="noindex"/><meta name="next-size-adjust" content=""/><title>404: This page could not be found.</title><title>Uptimizr — 3D Scene Analytics</title><meta name="description" content="Open-source analytics dashboard for 3D scenes."/><link rel="icon" href="/icon.svg?icon.08h29dad3pcxg.svg" sizes="any" type="image/svg+xml"/><script src="/_next/static/chunks/0cz1d0mv5g_q7.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/3sjq_xoi4rbyg.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[87346,[\"/_next/static/chunks/0impkpmxx3ttp.js\"],\"default\"]\n3:I[62327,[\"/_next/static/chunks/0impkpmxx3ttp.js\"],\"default\"]\n4:I[96686,[\"/_next/static/chunks/0impkpmxx3ttp.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[96686,[\"/_next/static/chunks/0impkpmxx3ttp.js\"],\"ViewportBoundary\"]\na:I[96686,[\"/_next/static/chunks/0impkpmxx3ttp.js\"],\"MetadataBoundary\"]\nc:I[50404,[\"/_next/static/chunks/0impkpmxx3ttp.js\"],\"default\",1]\n:HL[\"/_next/static/chunks/0pj9pajm2xz97.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",16],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/0pj9pajm2xz97.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/0impkpmxx3ttp.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"className\":\"space_grotesk_59d6dcf5-module__z_Ctiq__variable jetbrains_mono_38c99671-module__5Dhsuq__variable\",\"children\":[\"$\",\"body\",null,{\"children\":[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:notFound:0:1:props:style\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style\",\"children\":404}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style\",\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,null]},null,false,\"$@7\"]},null,false,null],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/0pj9pajm2xz97.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"yttuijl-0Cn9k8uTCfhIM\"}\n"])</script><script>self.__next_f.push([1,"d:[]\n7:\"$Wd\"\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"e:I[74838,[\"/_next/static/chunks/0impkpmxx3ttp.js\"],\"IconMark\"]\n6:null\nb:[[\"$\",\"title\",\"0\",{\"children\":\"Uptimizr — 3D Scene Analytics\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Open-source analytics dashboard for 3D scenes.\"}],[\"$\",\"link\",\"2\",{\"rel\":\"icon\",\"href\":\"/icon.svg?icon.08h29dad3pcxg.svg\",\"sizes\":\"any\",\"type\":\"image/svg+xml\"}],[\"$\",\"$Le\",\"3\",{}]]\n"])</script></body></html>
@@ -1,9 +1,9 @@
1
1
  1:"$Sreact.fragment"
2
2
  2:I[97541,["/_next/static/chunks/0impkpmxx3ttp.js"],"ClientPageRoot"]
3
- 3:I[14936,["/_next/static/chunks/0impkpmxx3ttp.js","/_next/static/chunks/00zdau6mcqeae.js","/_next/static/chunks/1flb8adpj6_2o.js","/_next/static/chunks/2yiy_l8bwiw2_.js"],"default"]
3
+ 3:I[14936,["/_next/static/chunks/0impkpmxx3ttp.js","/_next/static/chunks/11v6j6q59u-f_.js","/_next/static/chunks/1flb8adpj6_2o.js","/_next/static/chunks/0o_tpe5tlugtr.js"],"default"]
4
4
  6:I[96686,["/_next/static/chunks/0impkpmxx3ttp.js"],"OutletBoundary"]
5
5
  7:"$Sreact.suspense"
6
- 0:{"rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","script","script-0",{"src":"/_next/static/chunks/00zdau6mcqeae.js","async":true}],["$","script","script-1",{"src":"/_next/static/chunks/1flb8adpj6_2o.js","async":true}],["$","script","script-2",{"src":"/_next/static/chunks/2yiy_l8bwiw2_.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"Hn5EPlVBFzONWfhyS_1fO"}
6
+ 0:{"rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","script","script-0",{"src":"/_next/static/chunks/11v6j6q59u-f_.js","async":true}],["$","script","script-1",{"src":"/_next/static/chunks/1flb8adpj6_2o.js","async":true}],["$","script","script-2",{"src":"/_next/static/chunks/0o_tpe5tlugtr.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"yttuijl-0Cn9k8uTCfhIM"}
7
7
  4:{}
8
8
  5:"$0:rsc:props:children:0:props:serverProvidedParams:params"
9
9
  8:null
@@ -2,16 +2,16 @@
2
2
  2:I[87346,["/_next/static/chunks/0impkpmxx3ttp.js"],"default"]
3
3
  3:I[62327,["/_next/static/chunks/0impkpmxx3ttp.js"],"default"]
4
4
  4:I[97541,["/_next/static/chunks/0impkpmxx3ttp.js"],"ClientPageRoot"]
5
- 5:I[14936,["/_next/static/chunks/0impkpmxx3ttp.js","/_next/static/chunks/00zdau6mcqeae.js","/_next/static/chunks/1flb8adpj6_2o.js","/_next/static/chunks/2yiy_l8bwiw2_.js"],"default"]
5
+ 5:I[14936,["/_next/static/chunks/0impkpmxx3ttp.js","/_next/static/chunks/11v6j6q59u-f_.js","/_next/static/chunks/1flb8adpj6_2o.js","/_next/static/chunks/0o_tpe5tlugtr.js"],"default"]
6
6
  8:I[96686,["/_next/static/chunks/0impkpmxx3ttp.js"],"OutletBoundary"]
7
7
  9:"$Sreact.suspense"
8
8
  b:I[96686,["/_next/static/chunks/0impkpmxx3ttp.js"],"ViewportBoundary"]
9
9
  d:I[96686,["/_next/static/chunks/0impkpmxx3ttp.js"],"MetadataBoundary"]
10
10
  f:I[50404,["/_next/static/chunks/0impkpmxx3ttp.js"],"default",1]
11
- :HL["/_next/static/chunks/0tx1j_ghpz7rc.css","style"]
11
+ :HL["/_next/static/chunks/0pj9pajm2xz97.css","style"]
12
12
  :HL["/_next/static/media/0c89a48fa5027cee-s.p.2cyn07wtgehh0.woff2","font",{"crossOrigin":"","type":"font/woff2"}]
13
13
  :HL["/_next/static/media/70bc3e132a0a741e-s.p.3t6q91iet4nsy.woff2","font",{"crossOrigin":"","type":"font/woff2"}]
14
- 0:{"P":null,"c":["",""],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",16],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0tx1j_ghpz7rc.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/_next/static/chunks/0impkpmxx3ttp.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","className":"space_grotesk_59d6dcf5-module__z_Ctiq__variable jetbrains_mono_38c99671-module__5Dhsuq__variable","children":["$","body",null,{"children":["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]]}],{"children":[["$","$1","c",{"children":[["$","$L4",null,{"Component":"$5","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@6","$@7"]}}],[["$","script","script-0",{"src":"/_next/static/chunks/00zdau6mcqeae.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/_next/static/chunks/1flb8adpj6_2o.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/_next/static/chunks/2yiy_l8bwiw2_.js","async":true,"nonce":"$undefined"}]],["$","$L8",null,{"children":["$","$9",null,{"name":"Next.MetadataOutlet","children":"$@a"}]}]]}],{},null,false,null]},null,false,null],["$","$1","h",{"children":[null,["$","$Lb",null,{"children":"$Lc"}],["$","div",null,{"hidden":true,"children":["$","$Ld",null,{"children":["$","$9",null,{"name":"Next.Metadata","children":"$Le"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],false]],"m":"$undefined","G":["$f",[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0tx1j_ghpz7rc.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]]],"S":true,"h":null,"s":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"Hn5EPlVBFzONWfhyS_1fO"}
14
+ 0:{"P":null,"c":["",""],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",16],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0pj9pajm2xz97.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/_next/static/chunks/0impkpmxx3ttp.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","className":"space_grotesk_59d6dcf5-module__z_Ctiq__variable jetbrains_mono_38c99671-module__5Dhsuq__variable","children":["$","body",null,{"children":["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]]}],{"children":[["$","$1","c",{"children":[["$","$L4",null,{"Component":"$5","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@6","$@7"]}}],[["$","script","script-0",{"src":"/_next/static/chunks/11v6j6q59u-f_.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/_next/static/chunks/1flb8adpj6_2o.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/_next/static/chunks/0o_tpe5tlugtr.js","async":true,"nonce":"$undefined"}]],["$","$L8",null,{"children":["$","$9",null,{"name":"Next.MetadataOutlet","children":"$@a"}]}]]}],{},null,false,null]},null,false,null],["$","$1","h",{"children":[null,["$","$Lb",null,{"children":"$Lc"}],["$","div",null,{"hidden":true,"children":["$","$Ld",null,{"children":["$","$9",null,{"name":"Next.Metadata","children":"$Le"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],false]],"m":"$undefined","G":["$f",[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0pj9pajm2xz97.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]]],"S":true,"h":null,"s":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"yttuijl-0Cn9k8uTCfhIM"}
15
15
  6:{}
16
16
  7:"$0:f:0:1:1:children:0:props:children:0:props:serverProvidedParams:params"
17
17
  c:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]
@@ -3,4 +3,4 @@
3
3
  3:I[96686,["/_next/static/chunks/0impkpmxx3ttp.js"],"MetadataBoundary"]
4
4
  4:"$Sreact.suspense"
5
5
  5:I[74838,["/_next/static/chunks/0impkpmxx3ttp.js"],"IconMark"]
6
- 0:{"rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"Uptimizr — 3D Scene Analytics"}],["$","meta","1",{"name":"description","content":"Open-source analytics dashboard for 3D scenes."}],["$","link","2",{"rel":"icon","href":"/icon.svg?icon.08h29dad3pcxg.svg","sizes":"any","type":"image/svg+xml"}],["$","$L5","3",{}]]}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"Hn5EPlVBFzONWfhyS_1fO"}
6
+ 0:{"rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"Uptimizr — 3D Scene Analytics"}],["$","meta","1",{"name":"description","content":"Open-source analytics dashboard for 3D scenes."}],["$","link","2",{"rel":"icon","href":"/icon.svg?icon.08h29dad3pcxg.svg","sizes":"any","type":"image/svg+xml"}],["$","$L5","3",{}]]}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"yttuijl-0Cn9k8uTCfhIM"}
@@ -1,5 +1,5 @@
1
1
  1:"$Sreact.fragment"
2
2
  2:I[87346,["/_next/static/chunks/0impkpmxx3ttp.js"],"default"]
3
3
  3:I[62327,["/_next/static/chunks/0impkpmxx3ttp.js"],"default"]
4
- :HL["/_next/static/chunks/0tx1j_ghpz7rc.css","style"]
5
- 0:{"rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0tx1j_ghpz7rc.css","precedence":"next"}],["$","script","script-0",{"src":"/_next/static/chunks/0impkpmxx3ttp.js","async":true}]],["$","html",null,{"lang":"en","className":"space_grotesk_59d6dcf5-module__z_Ctiq__variable jetbrains_mono_38c99671-module__5Dhsuq__variable","children":["$","body",null,{"children":["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"Hn5EPlVBFzONWfhyS_1fO"}
4
+ :HL["/_next/static/chunks/0pj9pajm2xz97.css","style"]
5
+ 0:{"rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0pj9pajm2xz97.css","precedence":"next"}],["$","script","script-0",{"src":"/_next/static/chunks/0impkpmxx3ttp.js","async":true}]],["$","html",null,{"lang":"en","className":"space_grotesk_59d6dcf5-module__z_Ctiq__variable jetbrains_mono_38c99671-module__5Dhsuq__variable","children":["$","body",null,{"children":["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"yttuijl-0Cn9k8uTCfhIM"}
@@ -1,4 +1,4 @@
1
- :HL["/_next/static/chunks/0tx1j_ghpz7rc.css","style"]
1
+ :HL["/_next/static/chunks/0pj9pajm2xz97.css","style"]
2
2
  :HL["/_next/static/media/0c89a48fa5027cee-s.p.2cyn07wtgehh0.woff2","font",{"crossOrigin":"","type":"font/woff2"}]
3
3
  :HL["/_next/static/media/70bc3e132a0a741e-s.p.3t6q91iet4nsy.woff2","font",{"crossOrigin":"","type":"font/woff2"}]
4
- 0:{"tree":{"name":"","param":null,"prefetchHints":16,"slots":{"children":{"name":"__PAGE__","param":null,"prefetchHints":0,"slots":null}}},"staleTime":300,"buildId":"Hn5EPlVBFzONWfhyS_1fO"}
4
+ 0:{"tree":{"name":"","param":null,"prefetchHints":16,"slots":{"children":{"name":"__PAGE__","param":null,"prefetchHints":0,"slots":null}}},"staleTime":300,"buildId":"yttuijl-0Cn9k8uTCfhIM"}
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,71028,e=>{"use strict";var t=e.i(29212),l=e.i(94179),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(66022),e.A(48505),e.A(53976),e.A(42436),e.A(89370),e.A(67141),e.A(20693),e.A(9607),e.A(96664)]);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))}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,28538,e=>{"use strict";var t=e.i(29212),i=e.i(94179);e.i(82665);var n=e.i(20880),r=e.i(88725),s=e.i(62238),l=e.i(93425),a=e.i(42279);let o=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 c(e,t,i){let n=Math.max(1,i),r=new Map;u.forEach((e,t)=>{for(let i of e.types)r.set(i,t)});let s=u.map(()=>new Set);for(let i of e){let e=r.get(i.type);if(void 0===e)continue;let l=Math.min(1,Math.max(0,(i.ts-t)/n));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 p(e){let t=Math.max(0,Math.round(e/1e3)),i=Math.floor(t/60);return`${i}:${(t%60).toString().padStart(2,"0")}`}function h(e){let t=e.slice(e.lastIndexOf("/")+1);return t.length>20?`${t.slice(0,19)}\u2026`:t}function d({lanes:e,duration:i,progress:n,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,n/Math.max(1,i)*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 n;return t=e.clientX,void r(Math.min(1,Math.max(0,(t-(n=e.currentTarget.getBoundingClientRect()).left)/(n.width||1)))*i)},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((i,n)=>(0,t.jsx)("span",{"aria-hidden":!0,className:"pointer-events-none absolute top-0 h-full w-px",style:{left:`${100*i}%`,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:a}})]})]})}e.s(["SessionReplay",0,function({baseUrl:u,apiKey:m,sessionId:f,hiddenTypes:y,isLive:g=!1}){let b=(0,i.useRef)(null),x=(0,i.useRef)(null),w=(0,i.useRef)(0),v=(0,i.useRef)(y??o),k=(0,i.useRef)(!1),M=(0,i.useRef)(null),C=(0,i.useRef)(!1),j=(0,i.useRef)(!1),S=(0,i.useRef)(null),_=(0,i.useRef)(0),N=(0,i.useRef)([]),P=(0,i.useRef)([]),$=(0,i.useRef)([]),R=(0,i.useRef)(!0),I=(0,i.useRef)("birdview"),V=(0,i.useRef)(null),[z,A]=(0,i.useState)("idle"),[L,E]=(0,i.useState)(null),[T,W]=(0,i.useState)(0),[F,B]=(0,i.useState)(0),[Z,O]=(0,i.useState)(!1),[K,q]=(0,i.useState)([]),[H,G]=(0,i.useState)([]),[U,X]=(0,i.useState)([]),[D,J]=(0,i.useState)(!0),[Q,Y]=(0,i.useState)(!1),[ee,et]=(0,i.useState)("birdview"),[ei,en]=(0,i.useState)(null);(0,i.useEffect)(()=>{R.current=D},[D]),(0,i.useEffect)(()=>{j.current=Z},[Z]),(0,i.useEffect)(()=>{C.current=Q},[Q]),(0,i.useEffect)(()=>{I.current=ee,k.current=!0},[ee]),(0,i.useEffect)(()=>{v.current=y??o,k.current=!0},[y]),(0,i.useEffect)(()=>{let t=b.current;if(!t)return;let i=!1,r=null;return A("loading"),E(null),O(!1),W(0),B(0),q([]),G([]),X([]),en(null),V.current=null,N.current=[],P.current=[],$.current=[],w.current=0,(async()=>{try{let l,[{Engine:a},{Scene:o},{ArcRotateCamera:p},{UniversalCamera:h},{HemisphericLight:d},{Vector3:y,Color3:b,Color4:z,Matrix:L},{MeshBuilder:E},{StandardMaterial:T},{fetchSessionEvents:F,ReplayPlayer:Z}]=await Promise.all([e.A(66022),e.A(48505),e.A(53976),e.A(32633),e.A(42436),e.A(89370),e.A(67141),e.A(20693),e.A(85461),e.A(96664)]),K=await F({endpoint:u,apiKey:m,sessionId:f});if(i)return;if(0===K.length)return void A("empty");for(let e of K){let t=e.sceneId;if("string"==typeof t&&t){l=t;break}}let H=l?(await new n.CollectorApi(u,m).sceneRepresentation(l).catch(()=>null))?.proxy?.meshes??[]:[];if(i)return;let U=[...K].sort((e,t)=>e.ts-t.ts),D=U[0].ts,J=[],Q=[],ee=new Map,et=null;for(let e of U){let t=e.ts-D;if("camera_sample"===e.type){et=[e.position[0],e.position[1],e.position[2]],J.push({at:t,position:et,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 i=e.childPath?`${e.nodeId}/${e.childPath}`:e.nodeId,n=ee.get(i);n||(n=[],ee.set(i,n)),n.push({at:t,position:[e.position[0],e.position[1],e.position[2]]});continue}if("pointer_click"===e.type&&e.hitPoint){let i=e.ray?.origin??et;if(!i)continue;Q.push({at:t,type:"pointer_click",origin:[i[0],i[1],i[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(!et)continue;Q.push({at:t,type:"mesh_interaction",origin:[et[0],et[1],et[2]],hit:[e.point[0],e.point[1],e.point[2]],...e.mesh?{mesh:e.mesh}:{}})}}if(0===J.length&&0===Q.length&&0===ee.size)return void A("empty");let ei=new a(t,!0,{preserveDrawingBuffer:!1}),er=new o(ei);er.clearColor=new z(.04,.05,.07,1);let es=new p("birdview-cam",-Math.PI/2,.22,12,y.Zero(),er);es.attachControl(t,!0),(0,s.disableWheelZoom)(es),x.current=es,new d("replay-light",new y(0,1,0),er);let el=new h("replay-follow-cam",y.Zero(),er);el.minZ=.05,el.fov=Math.PI/3,er.activeCamera=es;let ea="birdview",eo=E.CreateGround("replay-ground",{width:20,height:20,subdivisions:20},er),eu=new T("replay-ground-mat",er);eu.diffuseColor=new b(.12,.14,.18),eu.wireframe=!0,eo.material=eu;let ec=new Set(ee.keys()),ep=new Set(Array.from(ec,e=>e.slice(e.lastIndexOf("/")+1))),eh=e=>{if(e.path){for(let t of ec)if(e.path===t||e.path.endsWith(`/${t}`))return!0}return ep.has(e.name)},ed=[];for(let e of H){if(eh(e))continue;let t=e.aabb,i=Math.max(t[3]-t[0],.001),n=Math.max(t[4]-t[1],.001),r=Math.max(t[5]-t[2],.001),s=E.CreateBox(`replay-proxy-${e.name}`,{width:i,height:n,depth:r},er);s.position=new y((t[0]+t[3])/2,(t[1]+t[4])/2,(t[2]+t[5])/2);let l=new T(`replay-proxy-mat-${e.name}`,er);l.wireframe=!0,l.disableLighting=!0,l.emissiveColor=new b(.32,.4,.52),l.alpha=.35,s.material=l,s.isPickable=!1,ed.push({name:e.name,center:new y((t[0]+t[3])/2,t[4],(t[2]+t[5])/2)})}N.current=ed,P.current=ed.map(()=>null),G(ed.map(e=>e.name));let em=[[.91,.47,.98],[.4,.95,.6],[.98,.8,.3],[.45,.85,1]],ef=e=>{let t=e.indexOf("/");return -1===t?e:e.slice(0,t)},ey=[],eg=new Map,eb=0,ex=(e,t,i)=>{let n=E.CreateSphere(`replay-actor-${e}`,{diameter:.5,segments:12},er),r=new T(`replay-actor-mat-${e}`,er);r.disableLighting=!0;let s=em[eb%em.length];r.emissiveColor=new b(s[0],s[1],s[2]),n.material=r,n.isPickable=!1,n.isVisible=!1,eb++;let l={key:e,mesh:n,samples:i,driveKey:t};return ey.push(l),eg.set(e,l),l},ew=new Map,ev=new Map;for(let[e,t]of ee){if(0===t.length)continue;let i=ef(e);if(e===i)ew.set(i,t);else{let n=ev.get(i);(!n||t.length>n.samples.length)&&ev.set(i,{key:e,samples:t})}}for(let e of new Set([...ew.keys(),...ev.keys()])){let t=ew.get(e);if(t)ex(e,e,t);else{let t=ev.get(e);ex(e,t.key,t.samples)}}$.current=ey.map(()=>null),X(ey.map(e=>e.key));let ek=(e,t)=>{if(0===e.length||t<e[0].at)return null;let i=0,n=e.length-1,r=-1;for(;i<=n;){let s=i+n>>1;e[s].at<=t?(r=s,i=s+1):n=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]},eM=1,eC=1.4,ej=E.CreateSphere("replay-camera-origin",{diameter:.35,segments:12},er),eS=new T("replay-camera-origin-mat",er);eS.disableLighting=!0,eS.emissiveColor=new b(.6,.9,1),ej.material=eS;let e_=E.CreateLines("replay-camera-frustum",{points:[y.Zero(),new y(0,0,1)]},er);e_.color=new b(.7,.95,1),e_.isPickable=!1;let eN=E.CreateCylinder("replay-camera-cone",{height:1,diameterTop:0,diameterBottom:1,tessellation:24},er);eN.bakeTransformIntoVertices(L.RotationX(-Math.PI/2).multiply(L.Translation(0,0,.5)));let eP=new T("replay-camera-cone-mat",er);eP.disableLighting=!0,eP.emissiveColor=new b(.4,.78,1),eP.alpha=.16,eP.backFaceCulling=!1,eN.material=eP,eN.isPickable=!1,eN.isVisible=!1;let e$=(e,t,i,n)=>{if(e?.dispose(),0===i.length)return null;let r=E.CreateLineSystem(t,{lines:i,...n?{colors:n,useVertexAlpha:!0}:{}},er);return r.isPickable=!1,r},eR=null,eI=null,eV=null,ez=()=>{let e=v.current,t=[],i=[];for(let n of Q){if(e.has(n.type))continue;let[r,s,l]=n.hit,a="mesh_interaction"===n.type?new z(.45,.85,1,.32):new z(1,.7,.35,.32);t.push([new y(r-.1,s,l),new y(r+.1,s,l)]),t.push([new y(r,s-.1,l),new y(r,s+.1,l)]),t.push([new y(r,s,l-.1),new y(r,s,l+.1)]),i.push([a,a],[a,a],[a,a])}eV=e$(eV,"replay-persistent-marks",t,i)};ez();let eA=E.CreateSphere("replay-glow",{diameter:1,segments:12},er),eL=new T("replay-glow-mat",er);eL.disableLighting=!0,eL.emissiveColor=new b(1,.62,.2),eL.alpha=0,eA.material=eL,eA.isPickable=!1,eA.isVisible=!1;let eE=1/0,eT=1/0,eW=1/0,eF=-1/0,eB=-1/0,eZ=-1/0,eO=!1,eK=e=>{eE=Math.min(eE,e[0]),eT=Math.min(eT,e[1]),eW=Math.min(eW,e[2]),eF=Math.max(eF,e[0]),eB=Math.max(eB,e[1]),eZ=Math.max(eZ,e[2])},eq=()=>{let e;if(eO||!Number.isFinite(eE))return;let t=(eE+eF)/2,i=(eT+eB)/2,n=(eW+eZ)/2,r=eF-eE,s=eB-eT,l=eZ-eW,a=Math.sqrt(r*r+s*s+l*l);es.setTarget(new y(t,i,n)),e=1.3*a,es.radius=Number.isFinite(e)?Math.max(8,e):12,eO=!0};for(let e of J)eK(e.position);for(let e of Q)eK(e.origin),eK(e.hit);for(let e of ee.values())for(let t of e)eK(t.position);for(let e of H)eK(e.aabb.slice(0,3)),eK(e.aabb.slice(3,6));eq();{let e=eF-eE,t=eB-eT,i=eZ-eW,n=Number.isFinite(e)?Math.sqrt(e*e+t*t+i*i):0,r=Math.min(Math.max(.035*n,.45),Math.max(.45,.18*n));eM=r/.35,eC=Math.max(.16*n,3.2*r,1.4),ej.scaling.setAll(eM)}let eH=-1,eG=e=>{var n;let r=k.current;if(!r&&e===eH)return;k.current=!1,eH=e,r&&ez();let s=v.current;(n=I.current)!==ea&&(ea=n,"follow"===n?(es.detachControl(),er.activeCamera=el):(er.activeCamera=es,es.attachControl(t,!0)));let l="follow"===I.current,a=s.has("camera_sample")?null:(e=>{if(0===J.length)return null;let t=0,i=J.length-1,n=-1;for(;t<=i;){let r=t+i>>1;J[r].at<=e?(n=r,t=r+1):i=r-1}return n>=0?J[n]:null})(e);if(a){ej.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,i=eC,n=new y(a.position[0]+e[0]/t*i,a.position[1]+e[1]/t*i,a.position[2]+e[2]/t*i);if(l)ej.isVisible=!1,e_.isVisible=!1,eN.isVisible=!1,el.position.set(a.position[0],a.position[1],a.position[2]),el.setTarget(n),a.fov&&a.fov>0&&(el.fov=a.fov);else{ej.isVisible=!0,e_.isVisible=!0,e_=E.CreateLines("replay-camera-frustum",{points:[ej.position.clone(),n],instance:e_},er);let e=(a.fov&&a.fov>0?a.fov:Math.PI/3)/2,t=i*Math.tan(e);eN.isVisible=!0,eN.position.copyFrom(ej.position),eN.lookAt(n),eN.scaling.set(2*t,2*t,i)}}else ej.isVisible=!1,e_.isVisible=!1,eN.isVisible=!1;let o=s.has("node_transform");for(let t of ey){let i=o?null:ek(t.samples,e);if(!i){t.mesh.isVisible=!1;continue}t.mesh.isVisible=!0,t.mesh.position.set(i[0],i[1],i[2])}let u=Q.filter(t=>!s.has(t.type)&&t.at<=e&&t.at>=e-2200),c=[],p=[],h=[],d=[],m=null;for(let t of u){let i=e-t.at,n=Math.max(0,Math.min(1,1-i/2200)),r=new z(1,.62,.2,.18+.72*n),s=new y(t.origin[0],t.origin[1],t.origin[2]),l=new y(t.hit[0],t.hit[1],t.hit[2]);c.push([s,l]),p.push([r,r]);let a=.12+.08*n;h.push([new y(l.x-a,l.y,l.z),new y(l.x+a,l.y,l.z)]),h.push([new y(l.x,l.y-a,l.z),new y(l.x,l.y+a,l.z)]),h.push([new y(l.x,l.y,l.z-a),new y(l.x,l.y,l.z+a)]);let o=new z(1,.78,.42,.22+.72*n);if(d.push([o,o],[o,o],[o,o]),i<=900){let e=1-i/900;(!m||e>m.t)&&(m={hit:t.hit,t:e})}}if(m){let e=.25+.9*m.t;eA.isVisible=!0,eA.scaling.set(e,e,e),eA.position.set(m.hit[0],m.hit[1],m.hit[2]),eL.alpha=.12+.5*m.t}else eA.isVisible=!1;let f=null,g=-1/0;for(let e of u)e.mesh&&e.at>g&&(g=e.at,f=e.mesh);f!==V.current&&(V.current=f,i||en(f)),eR=e$(eR,"replay-trail-lines",c,p),eI=e$(eI,"replay-trail-hits",h,d)},eU=U.length>0?U[U.length-1].ts-D:0,eX=eU,eD=U.length>0?U[U.length-1].ts:-1/0,eJ=U.map(e=>({type:e.type,ts:e.ts})),eQ=0;if(g)M.current=null,S.current=e=>{if(i)return;let t="number"==typeof e.ts?e.ts:NaN;if(!Number.isFinite(t)||t<=eD)return;eD=t;let n=t-D;if(n>eX&&(eX=n),n>eU&&(eU=n),eJ.push({type:e.type,ts:t}),"camera_sample"===e.type){let t=e.position,i=e.direction;if(t&&i){let r=[t[0],t[1],t[2]];et=r;let s="number"==typeof e.fov?e.fov:void 0;J.push({at:n,position:r,direction:[i[0],i[1],i[2]],...void 0!==s?{fov:s}:{}}),eK(r),eq()}}else if("pointer_click"===e.type){let t=e.hitPoint,i=e.ray,r=i?.origin??et;if(t&&r){let i="string"==typeof e.hitMesh?e.hitMesh:void 0;Q.push({at:n,type:"pointer_click",origin:[r[0],r[1],r[2]],hit:[t[0],t[1],t[2]],...i?{mesh:i}:{}}),eK(t),k.current=!0}}else if("mesh_interaction"===e.type){let t=e.point;if(t&&et){let i="string"==typeof e.mesh?e.mesh:void 0;Q.push({at:n,type:"mesh_interaction",origin:[et[0],et[1],et[2]],hit:[t[0],t[1],t[2]],...i?{mesh:i}:{}}),eK(t),k.current=!0}}else if("node_transform"===e.type){let t=e.position;if(e.boneId||"string"!=typeof e.nodeId||!t)return;let i="string"==typeof e.childPath?e.childPath:void 0,r=i?`${e.nodeId}/${i}`:e.nodeId;((e,t)=>{let i=ef(e),n=eg.get(i);if(!n){n=ex(i,e,[]);let t=$.current;$.current=ey.map((e,i)=>t[i]??null),X(ey.map(e=>e.key))}e===n.driveKey?n.samples.push(t):e===i&&n.driveKey!==i&&(n.driveKey=i,n.samples.length=0,n.samples.push(t))})(r,{at:n,position:[t[0],t[1],t[2]]}),eK(t)}let r=performance.now();r-eQ>250&&(eQ=r,q(c(eJ,D,Math.max(1,eU)))),C.current&&n>w.current&&(w.current=n)},_.current=eU,w.current=eU,C.current=!0,Y(!0),O(!1),W(eU),B(eU),q(c(eJ,D,Math.max(1,eU))),eG(eU);else{let e=new Z(K,{reset(){},apply(){}},{onProgress:e=>{i||(w.current=e,B(e))},onComplete:()=>{i||O(!1)}});M.current=e,W(e.durationMs),q(c(U,D,e.durationMs)),e.update(0),eG(0)}let eY=L.Identity(),e0=new Map,e1=e=>{let t=e0.get(e);if(t)return t;let i={w:e.offsetWidth||60,h:e.offsetHeight||16};return e.offsetWidth>0&&e0.set(e,i),i},e2=performance.now(),e3=0;ei.runRenderLoop(()=>{if(g){let e=performance.now(),t=e-e2;if(e2=e,C.current)w.current+=t,w.current>eU&&(eU=w.current),_.current=eU,B(w.current),e-e3>250&&(e3=e,W(eU));else if(j.current){let e=w.current+t;e>=eU&&(e=eU),w.current=e,B(e)}}eG(w.current),er.render(),(()=>{if(!R.current)return;let e=t.clientWidth||ei.getRenderWidth(),i=t.clientHeight||ei.getRenderHeight(),n=es.viewport.toGlobal(e,i),r=er.getTransformMatrix(),s=V.current,l=e=>e.slice(e.lastIndexOf("/")+1),a=e=>!!s&&(s===e||l(s)===l(e)||e.endsWith(`/${s}`)||s.endsWith(`/${e}`)),o=[],u=N.current,c=P.current;for(let e=0;e<u.length;e++){let t=c[e];if(!t)continue;let i=y.Project(u[e].center,eY,r,n);if(i.z<0||i.z>1){t.style.opacity="0";continue}o.push({el:t,x:i.x,y:i.y,liftPct:140,highlighted:a(u[e].name)})}let p=$.current;for(let e=0;e<ey.length;e++){let t=p[e];if(!t)continue;let i=ey[e].mesh;if(!i.isVisible){t.style.opacity="0";continue}let s=y.Project(i.position,eY,r,n);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(ey[e].key)})}o.sort((e,t)=>e.highlighted!==t.highlighted?e.highlighted?-1:1:e.y-t.y||e.x-t.x);let h=[];for(let e of o){let{w:t,h:i}=e1(e.el),n=e.x-t/2,r=e.x+t/2,s=e.y-e.liftPct/100*i,l=s,a=!0,o=0;for(;a&&o++<256;)for(let e of(a=!1,h))n<e.right&&r>e.left&&l<e.bottom&&l+i>e.top&&(l=e.bottom+1,a=!0);h.push({left:n,right:r,top:l,bottom:l+i});let u=l-s;e.el.style.opacity="1",e.el.style.zIndex=e.highlighted?"10":"",e.el.style.transform=`translate(${e.x}px, ${e.y+u}px) translate(-50%, -${e.liftPct}%)`}})()});let e5=()=>ei.resize();window.addEventListener("resize",e5),A("ready"),r=()=>{window.removeEventListener("resize",e5),S.current=null,M.current?.pause(),e_.dispose(),eN.dispose(),eR?.dispose(),eI?.dispose(),eV?.dispose(),eA.dispose(),er.dispose(),ei.dispose(),x.current=null,M.current=null}}catch(e){if(i)return;A("error"),E(e instanceof Error?e.message:"Failed to load replay.")}})(),()=>{i=!0,r?.()}},[u,m,f,g]);let er=(0,i.useCallback)(()=>{if(g){Y(!1),C.current=!1,O(e=>{let t=!e;return j.current=t,t});return}let e=M.current;e&&O(t=>(t?e.pause():e.play(),!t))},[g]),es=(0,i.useCallback)(e=>{if(g){Y(!1),C.current=!1,O(!1),j.current=!1,w.current=e,B(e);return}let t=M.current;t&&(t.pause(),t.seek(e),O(!1),w.current=e,B(e))},[g]),el=(0,i.useCallback)(()=>{Y(!0),C.current=!0,O(!1),j.current=!1,w.current=_.current,B(_.current)},[]),{gated:ea}=(0,r.useLiveSession)(u,m,f,g&&"ready"===z,e=>S.current?.(e),()=>{}),eo=(0,i.useCallback)(e=>{if(!ei)return!1;if(ei===e)return!0;let t=e=>e.slice(e.lastIndexOf("/")+1);return t(ei)===t(e)||e.endsWith(`/${ei}`)||ei.endsWith(`/${e}`)},[ei]);return(0,t.jsxs)(l.Panel,{title:g?"Session replay · live":"Session replay (birdview timeline)",subtitle:g?"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:b,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 ${D?"":"hidden"}`,children:[H.map((e,i)=>(0,t.jsx)("div",{title:e,ref:e=>{e&&(P.current[i]=e)},className:`absolute left-0 top-0 whitespace-nowrap rounded px-1.5 py-0.5 text-[10px] font-medium opacity-0 transition-colors ${eo(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:h(e)},e)),U.map((e,i)=>(0,t.jsx)("div",{title:e,ref:e=>{e&&($.current[i]=e)},className:`absolute left-0 top-0 whitespace-nowrap rounded px-1.5 py-0.5 text-[10px] font-medium opacity-0 transition-colors ${eo(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:h(e)},`actor-${e}`))]}),"ready"===z&&(H.length>0||U.length>0)?(0,t.jsx)("button",{type:"button",onClick:()=>J(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":D?"true":"false",children:D?"Hide labels":"Show labels"}):null,"ready"===z&&"birdview"===ee?(0,t.jsx)(a.ZoomButtons,{onZoom:e=>x.current&&(0,s.stepZoom)(x.current,e)}):null,"ready"!==z?(0,t.jsx)("div",{className:"pointer-events-none absolute inset-0 grid place-items-center text-sm text-fg-muted",children:"loading"===z?"Loading replay…":"empty"===z?"No replayable events (raw retention may be disabled).":"error"===z?L??"Replay unavailable.":null}):null]}),(0,t.jsxs)("div",{className:"mt-3 flex items-center gap-3",children:[(0,t.jsx)("button",{type:"button",onClick:er,disabled:"ready"!==z,className:"rounded-md bg-amber px-3 py-1.5 text-sm font-medium text-ink transition hover:bg-ember disabled:opacity-40",children:Z?"Pause":"Play"}),g?(0,t.jsxs)("button",{type:"button",onClick:el,disabled:"ready"!==z,"aria-pressed":Q?"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 ${Q?"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 ${Q?"animate-pulse bg-rose-400":"bg-fg-muted"}`}),Q?"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:()=>et("birdview"),disabled:"ready"!==z,"aria-pressed":"birdview"===ee?"true":"false",className:`rounded px-2 py-1 transition disabled:opacity-40 ${"birdview"===ee?"bg-amber text-ink":"text-fg hover:text-white"}`,children:"Birdview"}),(0,t.jsx)("button",{type:"button",onClick:()=>et("follow"),disabled:"ready"!==z,"aria-pressed":"follow"===ee?"true":"false",className:`rounded px-2 py-1 transition disabled:opacity-40 ${"follow"===ee?"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:p(F)}),(0,t.jsx)("input",{type:"range",min:0,max:Math.max(1,T),step:50,value:Math.min(F,T),onChange:e=>es(Number(e.target.value)),disabled:"ready"!==z,className:"flex-1 accent-amber"}),(0,t.jsx)("span",{className:"w-12 font-mono text-xs tabular-nums text-fg-muted",children:p(T)})]}),"ready"===z?(0,t.jsx)(d,{lanes:K,duration:T,progress:F,onSeek:es,hiddenTypes:y??o}):null,g&&ea&&"ready"===z?(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))},32633,e=>{e.v(t=>Promise.all(["static/chunks/3v3-7fio3nw_t.js","static/chunks/0v82oqyoy9zol.js","static/chunks/10r_824wzt8hj.js","static/chunks/18u58lorfahxi.js","static/chunks/2unhhuv0arlcv.js","static/chunks/1nj82er7msdto.js","static/chunks/13isnf0--pmx1.js"].map(t=>e.l(t))).then(()=>t(30118)))},85461,e=>{e.v(t=>Promise.all(["static/chunks/0n8n481szj90g.js"].map(t=>e.l(t))).then(()=>t(57092)))}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,25453,o=>{o.n(o.i(38413))}]);
@@ -0,0 +1,3 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,51581,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"BailoutToCSR",{enumerable:!0,get:function(){return a}});let n=e.r(59922);function a({reason:e,children:t}){if("u"<typeof window)throw Object.defineProperty(new n.BailoutToCSRError(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return t}},16201,(e,t,s)=>{"use strict";function n(e){return e.split("/").map(e=>encodeURIComponent(e)).join("/")}Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"encodeURIPath",{enumerable:!0,get:function(){return n}})},1299,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"PreloadChunks",{enumerable:!0,get:function(){return o}});let n=e.r(29212),a=e.r(90611),l=e.r(50803),r=e.r(16201),i=e.r(29434);function o({moduleIds:e}){if("u">typeof window)return null;let t=l.workAsyncStorage.getStore();if(void 0===t)return null;let s=[];if(t.reactLoadableManifest&&e){let n=t.reactLoadableManifest;for(let t of e){if(!n[t])continue;let e=n[t].files;s.push(...e)}}if(0===s.length)return null;let c=(0,i.getAssetTokenQuery)();return(0,n.jsx)(n.Fragment,{children:s.map(e=>{let s=`${t.assetPrefix}/_next/${(0,r.encodeURIPath)(e)}${c}`;return e.endsWith(".css")?(0,n.jsx)("link",{precedence:"dynamic",href:s,rel:"stylesheet",as:"style",nonce:t.nonce},e):((0,a.preload)(s,{as:"script",fetchPriority:"low",nonce:t.nonce}),null)})})}},89699,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"default",{enumerable:!0,get:function(){return c}});let n=e.r(29212),a=e.r(94179),l=e.r(51581),r=e.r(1299);function i(e){return{default:e&&"default"in e?e.default:e}}let o={loader:()=>Promise.resolve(i(()=>null)),loading:null,ssr:!0},c=function(e){let t={...o,...e},s=(0,a.lazy)(()=>t.loader().then(i)),c=t.loading;function d(e){let i=c?(0,n.jsx)(c,{isLoading:!0,pastDelay:!0,error:null}):null,o=!t.ssr||!!t.loading,d=o?a.Suspense:a.Fragment,u=t.ssr?(0,n.jsxs)(n.Fragment,{children:["u"<typeof window?(0,n.jsx)(r.PreloadChunks,{moduleIds:t.modules}):null,(0,n.jsx)(s,{...e})]}):(0,n.jsx)(l.BailoutToCSR,{reason:"next/dynamic",children:(0,n.jsx)(s,{...e})});return(0,n.jsx)(d,{...o?{fallback:i}:{},children:u})}return d.displayName="LoadableComponent",d}},80268,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"default",{enumerable:!0,get:function(){return a}});let n=e.r(81258)._(e.r(89699));function a(e,t){let s={};"function"==typeof e&&(s.loader=e);let a={...s,...t};return(0,n.default)({...a,modules:a.loadableGenerated?.modules})}("function"==typeof s.default||"object"==typeof s.default&&null!==s.default)&&void 0===s.default.__esModule&&(Object.defineProperty(s.default,"__esModule",{value:!0}),Object.assign(s.default,s),t.exports=s.default)},14936,e=>{"use strict";e.i(23838);var t=e.i(29212),s=e.i(80268),n=e.i(94179),a=e.i(82665),l=e.i(20880);let r={window:"1h"},i=[{id:"1h",label:"Last hour"},{id:"24h",label:"Last 24h"},{id:"7d",label:"Last 7 days"},{id:"all",label:"All time"}],o={"1h":36e5,"24h":864e5,"7d":6048e5};function c(e,t=Date.now()){return"all"===e.window?{}:"custom"===e.window?{since:e.since,until:e.until}:{since:t-o[e.window],until:t}}function d(e,t=Date.now()){return{...c(e,t),scene:e.scene&&e.scene.length>0?e.scene:void 0,source:e.source,cameraMode:e.cameraMode}}let u=[60,300,900,1800,3600,10800,21600,43200,86400,604800];function m(e,t=80){let s=Math.max(60,Math.round(e/t/1e3));return u.find(e=>e>=s)??604800}function h(e){return"xr-controller"===e?"XR controller":e.charAt(0).toUpperCase()+e.slice(1)}let x=["mouse","touch","stylus","pen","xr-controller","hand","gaze","transient","other"];var p=e.i(56054);function g(e,t=1){let[s,n,a]=(0,p.heatRgb)(e);return`rgba(${Math.round(255*s)}, ${Math.round(255*n)}, ${Math.round(255*a)}, ${t})`}function f(e,t=0){return Number.isFinite(e)?e.toLocaleString(void 0,{maximumFractionDigits:t}):"—"}var b=e.i(88725),v=e.i(93425);function w({panels:e,ctx:s,surface:n,revision:a=0}){let l=e.filter(e=>!!(e.surfaces??["overview"]).includes(n)&&(!e.enabled||e.enabled(s)));return(0,t.jsx)(t.Fragment,{children:l.map(e=>(0,t.jsx)("div",{className:2===e.span?"lg:col-span-2":void 0,children:(0,t.jsx)(j,{panel:e,ctx:s,revision:a})},e.id))})}function j({panel:e,ctx:s,revision:a}){let{data:l,loading:r,error:i}=function(e,t,s=0){let[a,l]=(0,n.useState)({data:null,loading:!!e.load,error:null}),r=JSON.stringify(t.params);return(0,n.useEffect)(()=>{if(!e.load)return void l({data:null,loading:!1,error:null});let s=!0,n=new AbortController;return l(e=>({...e,loading:!0,error:null})),e.load({...t,signal:n.signal}).then(e=>{s&&l({data:e,loading:!1,error:null})},e=>{s&&!n.signal.aborted&&l({data:null,loading:!1,error:e instanceof Error?e:Error(String(e))})}),()=>{s=!1,n.abort()}},[e,r,t.surface,t.sessionId,s]),a}(e,s,a),o="function"==typeof e.subtitle?e.subtitle(s):e.subtitle,c=r&&!!e.load&&null==l,d=function(){let[e,t]=(0,n.useState)(!1);return(0,n.useEffect)(()=>t(!0),[]),e}(),u=!e.clientOnly||d;return(0,t.jsx)(v.Panel,{title:e.title,subtitle:o,help:e.help,collapsible:e.collapsible,children:u?i?(0,t.jsxs)("p",{className:"text-sm text-fg-muted",children:["Could not load: ",i.message]}):c?(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"Loading…"}):e.render({data:l,ctx:s}):null})}function y(e){return Number.isNaN(e)||e<0?0:e>1?1:e}function N(e){let t=y(e),s=[[0,.1,.9],[0,.85,1],[.1,.9,.2],[1,.85,0],[1,.15,0],[1,1,1]],n=s.length-1,a=t*n,l=Math.min(Math.floor(a),n-1),r=a-l,i=s[l],o=s[l+1];return i&&o?[i[0]+(o[0]-i[0])*r,i[1]+(o[1]-i[1])*r,i[2]+(o[2]-i[2])*r]:[1,1,1]}var k=e.i(62238),M=e.i(59683),S=e.i(37660),z=e.i(42279);function C({bins:s,gridSize:a}){let l=(0,n.useRef)(null),r=(0,n.useRef)(null),i=(0,n.useRef)(null),[o,c]=(0,n.useState)("loading"),[d,u]=(0,n.useState)(null),[m,h]=(0,n.useState)("markers"),[x,g]=(0,n.useState)(null);return(0,n.useEffect)(()=>{let t=l.current;if(!t)return;if(0===s.length)return void c("empty");let n=!1,o=null;return c("loading"),u(null),(async()=>{try{let[{Engine:l},{Scene:d},{ArcRotateCamera:u},{HemisphericLight:h},{Vector3:x,Color3:f,Color4:b,Matrix:v},{MeshBuilder:w},{StandardMaterial:j},{Mesh:S},{DynamicTexture:z}]=await Promise.all([e.A(66022),e.A(48505),e.A(53976),e.A(42436),e.A(89370),e.A(67141),e.A(20693),e.A(8850),e.A(63836),e.A(9607),e.A(96664)]);if(n)return;let C=new l(t,!0,{preserveDrawingBuffer:!1}),P=new d(C);P.clearColor=new b(.04,.05,.07,1);let _=x.Zero(),$=new u("dome-cam",Math.PI/3,Math.PI/2.4,3.6,_,P);$.attachControl(t,!0),$.lowerRadiusLimit=1.6,$.upperRadiusLimit=8,(0,k.disableWheelZoom)($),r.current=$,i.current={target:_,alpha:$.alpha,beta:$.beta,radius:$.radius},new h("dome-light",new x(.3,1,.2),P);let I=w.CreateSphere("dome",{diameter:2,segments:20},P),R=new j("dome-mat",P);R.wireframe=!0,R.disableLighting=!0,R.emissiveColor=new f(.16,.2,.28),R.alpha=.5,I.material=R,I.isPickable=!1;let A=[];for(let e=0;e<=64;e++){let t=e/64*Math.PI*2;A.push(new x(Math.cos(t),0,Math.sin(t)))}let E=w.CreateLines("dome-horizon",{points:A},P);E.color=new f(.3,.36,.46),E.isPickable=!1;let T=w.CreateLines("dome-forward",{points:[x.Zero(),new x(1.25,0,0)]},P);T.color=new f(.4,.7,.95),T.isPickable=!1;let F=s.reduce((e,t)=>Math.max(e,t.count),1),L=a>0?a:1;if("markers"===m){let e=w.CreateBox("dome-marker",{size:1},P),t=new j("dome-marker-mat",P);t.disableLighting=!0,t.emissiveColor=f.White(),t.specularColor=new f(0,0,0),e.material=t,e.isPickable=!0,e.thinInstanceEnablePicking=!0;let n=s.length,a=new Float32Array(16*n),l=new Float32Array(4*n),r=Array(n);for(let e=0;e<n;e++){let t=s[e],n=(t.azimuth_bin+.5)/L*Math.PI*2-Math.PI,i=(t.elevation_bin+.5)/L*Math.PI-Math.PI/2,o=Math.cos(i),c=o*Math.cos(n),d=Math.sin(i),u=o*Math.sin(n),m=t.count/F,h=.03+.12*m;v.Scaling(h,h,h).multiply(v.Translation(c,d,u)).copyToArray(a,16*e);let[x,g,f]=(0,p.heatRgb)(m);l[4*e]=x,l[4*e+1]=g,l[4*e+2]=f,l[4*e+3]=1,r[e]=`dir (${t.azimuth_bin}, ${t.elevation_bin}) \xb7 ${t.count}`}e.thinInstanceSetBuffer("matrix",a,16,!0),e.thinInstanceSetBuffer("color",l,4,!0),e.metadata={hoverLabels:r}}else{let e=function(e,t={}){let s=void 0!==t.width&&t.width>0?Math.floor(t.width):256,n=void 0!==t.height&&t.height>0?Math.floor(t.height):Math.max(1,Math.floor(s/2)),a=t.colorRamp??N,l=void 0!==t.blurBins&&t.blurBins>0?t.blurBins:1.5,r=y(t.alphaFloor??0),i=y(t.opacity??1),o=e.gridSize>0?e.gridSize:1,c=new Uint8ClampedArray(s*n*4),d=e.bins.filter(e=>e.count>0);if(0===d.length)return{width:s,height:n,rgba:c};let u=Math.max(1e-4,Math.PI/o*l),m=2*u*u,h=Math.cos(Math.min(Math.PI,3*u)),x=d.map(e=>{var t,s;let n,[a,l]=(t=e.azimuthBin,s=e.elevationBin,[(t+.5)/o*Math.PI*2-Math.PI,(s+.5)/o*Math.PI-Math.PI/2]);return[(n=Math.cos(l))*Math.cos(a),Math.sin(l),n*Math.sin(a)]}),p=new Float32Array(s*n),g=0;for(let e=0;e<n;e++){let t=Math.PI/2-(e+.5)/n*Math.PI,a=Math.cos(t),l=Math.sin(t);for(let t=0;t<s;t++){let n=(t+.5)/s*Math.PI*2-Math.PI,r=a*Math.cos(n),i=a*Math.sin(n),o=0;for(let e=0;e<d.length;e++){let t=x[e],s=r*t[0]+l*t[1]+i*t[2];if(s<h)continue;let n=Math.acos(s>1?1:s<-1?-1:s);o+=d[e].count*Math.exp(-(n*n)/m)}p[e*s+t]=o,o>g&&(g=o)}}if(g<=0)return{width:s,height:n,rgba:c};for(let e=0;e<p.length;e++){let t=y(p[e]/g),[s,n,l]=a(t),o=(r+(1-r)*t)*i,d=4*e;c[d]=Math.round(255*s),c[d+1]=Math.round(255*n),c[d+2]=Math.round(255*l),c[d+3]=Math.round(255*y(o))}return{width:s,height:n,rgba:c}}({bins:s.map(e=>({azimuthBin:e.azimuth_bin,elevationBin:e.elevation_bin,count:e.count})),gridSize:L},{width:256,blurBins:1.5,opacity:.95}),t=new z("dome-skytex",{width:e.width,height:e.height},P,!1);t.hasAlpha=!0;let n=t.getContext(),a=n.createImageData(e.width,e.height);a.data.set(e.rgba),n.putImageData(a,0,0),t.update();let l=w.CreateSphere("dome-sky",{diameter:2,segments:48,sideOrientation:S.DOUBLESIDE},P),r=new j("dome-sky-mat",P);r.disableLighting=!0,r.emissiveColor=f.White(),r.diffuseColor=new f(0,0,0),r.specularColor=new f(0,0,0),r.emissiveTexture=t,r.opacityTexture=t,r.backFaceCulling=!1,l.material=r,l.isPickable=!1}C.runRenderLoop(()=>P.render());let B=()=>C.resize();window.addEventListener("resize",B);let D=(0,M.attachMeshHover)(P,t,g),O=(0,k.attachDoubleClickFocus)(P,t,$);c("ready"),o=()=>{window.removeEventListener("resize",B),D(),O(),g(null),r.current=null,i.current=null,P.dispose(),C.dispose()}}catch(e){if(n)return;c("error"),u(e instanceof Error?e.message:"Failed to render dome.")}})(),()=>{n=!0,o?.()}},[s,a,m]),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("canvas",{ref:l,className:"aspect-video w-full rounded-lg border border-edge bg-ink"}),x?(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:x.x+12,top:x.y+12},children:x.label}):null,"ready"===o?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"absolute left-3 top-3 flex overflow-hidden rounded-md border border-edge bg-ink/80 text-xs backdrop-blur",children:["markers","skydome"].map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>h(e),className:`px-2.5 py-1 ${m===e?"bg-fg/15 font-medium text-white":"text-fg-muted hover:text-fg"}`,children:"markers"===e?"Markers":"Skydome"},e))}),(0,t.jsx)(z.ZoomButtons,{onZoom:e=>r.current&&(0,k.stepZoom)(r.current,e),onReset:()=>r.current&&i.current&&(0,k.resetFocus)(r.current,i.current)}),(0,t.jsx)(S.HeatLegend,{title:"Gaze density",lowLabel:"rarely",highLabel:"most-viewed",note:"markers"===m?"Each marker is a look-direction (camera forward). Blue line = forward, ring = horizon. Color & size scale with how often that direction was viewed.":"Continuous equirectangular heat field: the same gaze bins splatted into a smooth thermal texture wrapped on the dome. The in-scene SDK overlay (showGazeSkydome) renders this inward so you can stand inside it in WebXR."})]}):(0,t.jsx)("div",{className:"pointer-events-none absolute inset-0 grid place-items-center text-sm text-fg-muted",children:"loading"===o?"Rendering…":"empty"===o?"No camera samples in range.":"error"===o?d??"Dome unavailable.":null})]})}function P({bins:e,cellSize:s}){let a=(0,n.useRef)(null);return(0,n.useEffect)(()=>{let t=a.current;if(!t)return;let s=t.getContext("2d");if(!s||(s.clearRect(0,0,360,360),s.fillStyle="#0b0e14",s.fillRect(0,0,360,360),0===e.length))return;let n=1/0,l=-1/0,r=1/0,i=-1/0,o=0;for(let t of e)t.gx<n&&(n=t.gx),t.gx>l&&(l=t.gx),t.gz<r&&(r=t.gz),t.gz>i&&(i=t.gz),t.count>o&&(o=t.count);let c=344/Math.max(l-n+1,i-r+1);for(let t of e){s.fillStyle=g(o>0?t.count/o:0,.9);let e=8+(t.gx-n)*c,a=8+(i-t.gz)*c;s.fillRect(e,a,Math.ceil(c),Math.ceil(c))}},[e,s]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"flex justify-center",children:(0,t.jsx)("canvas",{ref:a,width:360,height:360,className:"rounded-lg border border-edge","aria-label":"Floor-plan position heatmap"})}),0===e.length?(0,t.jsx)("p",{className:"mt-2 text-center text-xs text-fg-muted",children:"No camera-position data in range. Capture a first-person session to populate the plan."}):null]})}function _({points:e}){let s=(0,n.useRef)(null);return(0,n.useEffect)(()=>{let t=s.current;if(!t)return;let n=t.getContext("2d");if(!n||(n.clearRect(0,0,360,360),n.fillStyle="#0b0e14",n.fillRect(0,0,360,360),0===e.length))return;let a=1/0,l=-1/0,r=1/0,i=-1/0;for(let t of e)t.gx<a&&(a=t.gx),t.gx>l&&(l=t.gx),t.gz<r&&(r=t.gz),t.gz>i&&(i=t.gz);let o=344/Math.max(l-a+1,i-r+1),c=(e,t)=>[8+(e-a+.5)*o,8+(i-t+.5)*o],d=function(e){let t=new Map;for(let s of e){let e=t.get(s.session_id);e||(e=[],t.set(s.session_id,e));let n=e[e.length-1];n&&n.gx===s.gx&&n.gz===s.gz||e.push({gx:s.gx,gz:s.gz})}return[...t.values()].map(e=>({cells:e}))}(e);for(let e of(n.lineWidth=2,n.lineJoin="round",n.lineCap="round",n.globalCompositeOperation="lighter",n.strokeStyle="rgba(251, 191, 36, 0.18)",d)){if(e.cells.length<2)continue;n.beginPath();let[t,s]=c(e.cells[0].gx,e.cells[0].gz);n.moveTo(t,s);for(let t=1;t<e.cells.length;t++){let[s,a]=c(e.cells[t].gx,e.cells[t].gz);n.lineTo(s,a)}n.stroke()}n.globalCompositeOperation="source-over"},[e]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"flex justify-center",children:(0,t.jsx)("canvas",{ref:s,width:360,height:360,className:"rounded-lg border border-edge","aria-label":"Aggregate desire-line paths"})}),0===e.length?(0,t.jsx)("p",{className:"mt-2 text-center text-xs text-fg-muted",children:"No camera-path data in range. Capture first-person sessions to populate the desire lines."}):null]})}let $={hover:"#60a5fa",pick:"#34d399",click:"#fbbf24",drag:"#f472b6",select:"#a78bfa",squeeze:"#fb7185",grab:"#22d3ee",release:"#94a3b8",teleport:"#f59e0b"};function I(e){return $[e]??"#64748b"}function R({rows:e,topN:s=8}){let n=function(e,t){let s=new Map;for(let t of e){let e=s.get(t.mesh);e||(e={mesh:t.mesh,total:0,kinds:[]},s.set(t.mesh,e)),e.kinds.push({kind:t.kind,count:t.count}),e.total+=t.count}let n=[...s.values()].sort((e,t)=>t.total-e.total).slice(0,t);for(let e of n)e.kinds.sort((e,t)=>t.count-e.count);return n}(e,s);if(0===n.length)return(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"No mesh interactions in range."});let a=[...new Set(e.map(e=>e.kind))];return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("ul",{className:"space-y-2",children:n.map(e=>(0,t.jsxs)("li",{className:"text-sm",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("span",{className:"truncate font-mono text-xs text-fg",children:e.mesh}),(0,t.jsx)("span",{className:"tabular-nums text-fg-muted",children:f(e.total)})]}),(0,t.jsx)("div",{className:"mt-1 flex h-2 w-full overflow-hidden rounded bg-ink/60",children:e.kinds.map(s=>(0,t.jsx)("div",{className:"h-full",style:{width:`${e.total>0?s.count/e.total*100:0}%`,backgroundColor:I(s.kind)},title:`${s.kind}: ${f(s.count)}`},s.kind))})]},e.mesh))}),(0,t.jsx)("ul",{className:"flex flex-wrap gap-x-3 gap-y-1",children:a.map(e=>(0,t.jsxs)("li",{className:"flex items-center gap-1.5 text-xs text-fg-muted",children:[(0,t.jsx)("span",{className:"inline-block h-2 w-2 rounded-sm",style:{backgroundColor:I(e)}}),e]},e))})]})}let A={mouse:"#60a5fa",touch:"#34d399",stylus:"#a78bfa",pen:"#a78bfa","xr-controller":"#fbbf24",hand:"#f472b6",gaze:"#22d3ee",transient:"#fb7185",keyboard:"#f59e0b",gamepad:"#c084fc",other:"#94a3b8"};function E(e){return A[e]??"#64748b"}function T({buckets:e}){if(e.length<2)return(0,t.jsx)("span",{className:"text-[10px] text-fg-muted",children:"—"});let s=e.reduce((e,t)=>Math.max(e,t),0)||1;return(0,t.jsx)("div",{className:"flex h-5 items-end gap-px","aria-hidden":!0,children:e.map((e,n)=>(0,t.jsx)("div",{className:"w-1 rounded-sm bg-sky-400/70",style:{height:`${Math.max(8,e/s*100)}%`}},n))})}function F({delta:e}){return e>0?(0,t.jsxs)("span",{className:"tabular-nums text-xs text-emerald-400",children:["▲ ",f(e)]}):e<0?(0,t.jsxs)("span",{className:"tabular-nums text-xs text-rose-400",children:["▼ ",f(-e)]}):(0,t.jsx)("span",{className:"text-xs text-fg-muted",children:"—"})}function L({sources:e,trend:s,topN:n=8}){let a=function(e,t,s){let n=new Map;for(let t of e){let e=n.get(t.mesh);e||(e={total:0,sources:new Map},n.set(t.mesh,e)),e.total+=t.count,e.sources.set(t.source,(e.sources.get(t.source)??0)+t.count)}let a=new Map;for(let e of t){let t=a.get(e.mesh);t?t.push(e):a.set(e.mesh,[e])}return[...n.entries()].map(([e,t])=>{let s=(a.get(e)??[]).slice().sort((e,t)=>e.bucket-t.bucket).map(e=>e.count),n=Math.floor(s.length/2),l=s.slice(0,n).reduce((e,t)=>e+t,0),r=s.slice(n).reduce((e,t)=>e+t,0);return{mesh:e,total:t.total,sources:[...t.sources.entries()].map(([e,t])=>({source:e,count:t})).sort((e,t)=>t.count-e.count),buckets:s,delta:r-l}}).sort((e,t)=>t.total-e.total).slice(0,s)}(e,s,n);return 0===a.length?(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"No mesh interactions in range."}):(0,t.jsx)("ol",{className:"space-y-2",children:a.map((e,s)=>(0,t.jsx)("li",{className:"text-sm",children:(0,t.jsxs)("details",{className:"group",children:[(0,t.jsxs)("summary",{className:"flex cursor-pointer list-none items-center gap-3",children:[(0,t.jsx)("span",{className:"w-5 shrink-0 text-right tabular-nums text-xs text-fg-muted",children:s+1}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-fg",children:e.mesh}),(0,t.jsx)(T,{buckets:e.buckets}),(0,t.jsx)(F,{delta:e.delta}),(0,t.jsx)("span",{className:"w-12 shrink-0 text-right tabular-nums text-fg-muted",children:f(e.total)})]}),(0,t.jsx)("ul",{className:"mt-1.5 space-y-1 pl-8",children:e.sources.map(s=>(0,t.jsxs)("li",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsx)("span",{className:"inline-block h-2 w-2 shrink-0 rounded-sm",style:{backgroundColor:E(s.source)}}),(0,t.jsx)("span",{className:"w-24 shrink-0 truncate text-fg-muted",children:s.source}),(0,t.jsx)("div",{className:"h-1.5 flex-1 overflow-hidden rounded bg-ink/60",children:(0,t.jsx)("div",{className:"h-full rounded",style:{width:`${e.total>0?s.count/e.total*100:0}%`,backgroundColor:E(s.source)}})}),(0,t.jsx)("span",{className:"w-10 shrink-0 text-right tabular-nums text-fg-muted",children:f(s.count)})]},s.source))})]})},e.mesh))})}let B={mouse:"#60a5fa",touch:"#34d399",stylus:"#a78bfa",pen:"#a78bfa","xr-controller":"#fbbf24",hand:"#f472b6",gaze:"#22d3ee",transient:"#fb7185",keyboard:"#f59e0b",gamepad:"#c084fc",other:"#94a3b8"};function D(e){return B[e]??"#64748b"}function O({sources:e,actions:s,topActions:n=8}){let a=function(e){let t=new Map;for(let s of e)t.set(s.source,(t.get(s.source)??0)+s.count);let s=[...t.values()].reduce((e,t)=>e+t,0);return[...t.entries()].map(([e,t])=>({source:e,count:t,share:s>0?t/s:0})).sort((e,t)=>t.count-e.count)}(e),l=s.slice(0,n);return 0===a.length&&0===l.length?(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"No input interactions in range."}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-fg-muted",children:"Modality share"}),0===a.length?(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"No source-bearing interactions in range."}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"flex h-3 w-full overflow-hidden rounded bg-ink/60",children:a.map(e=>(0,t.jsx)("div",{className:"h-full",style:{width:`${100*e.share}%`,backgroundColor:D(e.source)},title:`${e.source}: ${f(e.count)}`},e.source))}),(0,t.jsx)("ul",{className:"mt-2 flex flex-wrap gap-x-3 gap-y-1",children:a.map(e=>(0,t.jsxs)("li",{className:"flex items-center gap-1.5 text-xs text-fg-muted",children:[(0,t.jsx)("span",{className:"inline-block h-2 w-2 rounded-sm",style:{backgroundColor:D(e.source)}}),e.source,(0,t.jsxs)("span",{className:"tabular-nums text-fg",children:[Math.round(100*e.share),"%"]})]},e.source))})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-fg-muted",children:"Most-used shortcuts"}),0===l.length?(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"No input_action events in range."}):(0,t.jsx)("ul",{className:"space-y-1.5",children:l.map(e=>(0,t.jsxs)("li",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)("span",{className:"inline-block h-2 w-2 shrink-0 rounded-sm",style:{backgroundColor:D(e.source)}}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-fg",children:e.action}),(0,t.jsx)("span",{className:"shrink-0 text-xs text-fg-muted",children:e.source}),(0,t.jsx)("span",{className:"w-12 shrink-0 text-right tabular-nums text-fg-muted",children:f(e.count)})]},`${e.action}/${e.source}`))})]})]})}function U({coverage:e,proxyMeshes:s,cellSize:n,topN:a=12}){if(0===s.length)return(0,t.jsxs)("div",{className:"space-y-2 text-sm text-fg-muted",children:[(0,t.jsx)("p",{children:"No scene proxy is registered, so there is no reference geometry to call “dead”."}),(0,t.jsx)("p",{children:"Register proxy geometry (ADR 0014) via the scene representation API to enumerate the regions visitors could approach."})]});if(0===e.length)return(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"No camera-position samples in range — every region reads as dead. Widen the range or check that first-person camera samples are being captured."});let l=function(e,t,s,n=1){let a=s*n,l=t.slice(0,600).map(t=>{let n=0;for(let l of e)(function(e,t,s,n,a,l){let r=(e+.5)*n,i=(t+.5)*n,o=(s+.5)*n,[c,d,u,m,h,x]=a;return r>=c-l&&r<=m+l&&i>=d-l&&i<=h+l&&o>=u-l&&o<=x+l})(l.vx,l.vy,l.vz,s,t.aabb,a)&&(n+=l.count);return{mesh:t.name,path:t.path,nearbySamples:n,dead:0===n}});return l.sort((e,t)=>e.nearbySamples-t.nearbySamples),{rows:l,deadCount:l.filter(e=>e.dead).length,total:l.length}}(e,s,n),r=l.rows.reduce((e,t)=>Math.max(e,t.nearbySamples),0)||1,i=l.rows.slice(0,a);return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("p",{className:"text-xs text-fg-muted",children:[(0,t.jsx)("span",{className:"tabular-nums text-fg",children:f(l.deadCount)})," of"," ",(0,t.jsx)("span",{className:"tabular-nums text-fg",children:f(l.total)})," proxy meshes are dead (no nearby camera samples)."]}),(0,t.jsx)("ul",{className:"space-y-1.5",children:i.map(e=>(0,t.jsxs)("li",{className:"text-sm",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("span",{className:"truncate font-mono text-xs text-fg",title:e.path??e.mesh,children:e.mesh}),e.dead?(0,t.jsx)("span",{className:"shrink-0 rounded bg-rose-500/20 px-1.5 text-xs text-rose-300",children:"dead"}):(0,t.jsx)("span",{className:"shrink-0 tabular-nums text-xs text-fg-muted",children:f(e.nearbySamples)})]}),(0,t.jsx)("div",{className:"mt-1 h-1.5 w-full overflow-hidden rounded bg-ink/60",children:(0,t.jsx)("div",{className:"h-full rounded bg-sky-500/70",style:{width:`${e.nearbySamples/r*100}%`}})})]},e.path??e.mesh))})]})}function W({label:e,value:s}){return(0,t.jsxs)("div",{className:"rounded-lg bg-ink/60 p-3",children:[(0,t.jsx)("div",{className:"text-xs uppercase tracking-wide text-fg-muted",children:e}),(0,t.jsx)("div",{className:"mt-1 text-2xl font-semibold tabular-nums text-fg-hi",children:s})]})}function H({bins:e}){if(0===e.length)return(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"No FPS samples in range."});let s=[...e].sort((e,t)=>e.bucket-t.bucket),n=s.reduce((e,t)=>Math.max(e,t.sessions),0)||1,a=s.length>1?s[1].bucket-s[0].bucket:10;return(0,t.jsx)("div",{className:"space-y-1.5",children:s.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsxs)("span",{className:"w-16 shrink-0 text-right tabular-nums text-fg-muted",children:[e.bucket,"–",e.bucket+a]}),(0,t.jsx)("div",{className:"h-4 flex-1 overflow-hidden rounded bg-ink/60",children:(0,t.jsx)("div",{className:"h-full rounded bg-emerald-500/70",style:{width:`${e.sessions/n*100}%`}})}),(0,t.jsx)("span",{className:"w-10 shrink-0 tabular-nums text-fg-muted",children:e.sessions})]},e.bucket))})}function G({distribution:e,histogram:s}){return e&&0!==e.samples?(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[(0,t.jsx)(W,{label:"p05 FPS (worst)",value:f(e.p05_fps,1)}),(0,t.jsx)(W,{label:"p50 FPS (typical)",value:f(e.p50_fps,1)}),(0,t.jsx)(W,{label:"p95 FPS (best)",value:f(e.p95_fps,1)}),(0,t.jsx)(W,{label:"Sessions",value:f(e.sessions)})]}),(0,t.jsx)(H,{bins:s})]}):(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"No performance samples in range."})}function V(e){return`${Math.round(100*e)}%`}function Z({data:e}){if(!e||0===e.samples)return(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"No frame-perf samples in range."});let s=e.p50_fps>=50&&e.p50_render_scale>0&&e.p50_render_scale<.9,n=[{label:"Median FPS",value:f(Math.round(e.p50_fps))},{label:"Avg FPS",value:f(Math.round(e.avg_fps))},{label:"Median render scale",value:V(e.p50_render_scale)},{label:"Avg render scale",value:V(e.avg_render_scale)},{label:"Downscaled frames",value:V(e.downscaled_share)},{label:"Samples",value:f(e.samples)}];return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("dl",{className:"grid grid-cols-2 gap-x-4 gap-y-3 sm:grid-cols-3",children:n.map(e=>(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs text-fg-muted",children:e.label}),(0,t.jsx)("dd",{className:"tabular-nums text-lg text-fg",children:e.value})]},e.label))}),s?(0,t.jsxs)("p",{className:"rounded-md border border-amber/40 bg-amber/10 px-3 py-2 text-xs text-amber",children:["Good FPS is being bought with resolution — the median frame renders at"," ",V(e.p50_render_scale)," scale. The headline FPS overstates the device experience."]}):null]})}let K="__other_sp__",X="__other_mesh__";function q(e){return`${e[0]}|${e[1]}|${e[2]}`}function J(e,t){return t<=1?0:1.4-e/(t-1)*2.8}let Y="__all__",Q={maxStandpoints:6,maxMeshes:10,maxRibbons:70};function ee(e,t){return`${e}|${t}`}function et({links:s,gridSize:a,proxyMeshes:r=[],maxLinks:i=80,baseUrl:o,apiKey:c,flowQuery:d,hasFirstPerson:u=!1}){let m=(0,n.useRef)(null),h=(0,n.useRef)(null),x=(0,n.useRef)(null),[g,f]=(0,n.useState)("loading"),[b,v]=(0,n.useState)(null),[w,j]=(0,n.useState)(Y),[y,N]=(0,n.useState)(Y),[C,P]=(0,n.useState)(Y),[_,$]=(0,n.useState)("aggregate"),[I,R]=(0,n.useState)(null),[A,E]=(0,n.useState)("all"),[T,F]=(0,n.useState)(s),L=!!(o&&d),B=(0,n.useMemo)(()=>d?JSON.stringify(d):"",[d]),D=(0,n.useRef)(!1);(0,n.useEffect)(()=>{!D.current&&u&&(E("first-person"),D.current=!0)},[u]),(0,n.useEffect)(()=>{u&&"viewer"===A&&E("first-person")},[u,A]),(0,n.useEffect)(()=>{L||F(s)},[s,L]),(0,n.useEffect)(()=>{if(!o||!d)return;let e=!1,t=new l.CollectorApi(o,c??""),s="all"===A?void 0:A;return t.flowHeatmap({...d,bins:a,limit:400,groupByOrigin:!0,cameraMode:s}).then(t=>{e||F(t)}).catch(()=>{e||F([])}),()=>{e=!0}},[o,c,B,A,a]);let O=(0,n.useMemo)(()=>{let e=new Map;for(let t of T){if(!t.originVoxel)continue;let s=q(t.originVoxel),n=t.origin,a=e.get(s);a?(a.count+=t.count,n&&(a.ox+=n[0]*t.count,a.oy+=n[1]*t.count,a.oz+=n[2]*t.count,a.wsum+=t.count)):e.set(s,{key:s,voxel:t.originVoxel,count:t.count,ox:n?n[0]*t.count:0,oy:n?n[1]*t.count:0,oz:n?n[2]*t.count:0,wsum:n?t.count:0})}return[...e.values()].map(e=>({key:e.key,voxel:e.voxel,count:e.count,origin:e.wsum>0?[e.ox/e.wsum,e.oy/e.wsum,e.oz/e.wsum]:void 0})).sort((e,t)=>t.count-e.count)},[T]),U=O.length>0,W=(0,n.useMemo)(()=>C===Y?null:O.find(e=>e.key===C)??null,[O,C]),H=(0,n.useMemo)(()=>(function(e,t,s,n){let a=e.filter(e=>e.originVoxel);if(0===a.length)return{standpoints:[],gazes:[],meshes:[],ribbons:[],maxCount:1};let l=t.slice(0,Math.max(1,n.maxStandpoints)),r=new Set(l.map(e=>e.key)),i=e=>{let t=e.originVoxel?q(e.originVoxel):K;return r.has(t)?t:K},o=new Map;for(let e of a)o.set(e.mesh,(o.get(e.mesh)??0)+e.count);let c=new Set([...o.entries()].sort((e,t)=>t[1]-e[1]).slice(0,Math.max(1,n.maxMeshes)).map(([e])=>e)),d=e=>c.has(e)?e:X,u=new Map;for(let e of a){let t=i(e),s=d(e.mesh),n=`${t}|${e.azimuth_bin}|${e.elevation_bin}|${s}`,a=u.get(n);a?a.count+=e.count:u.set(n,{standpointId:t,gazeId:`${t}|${e.azimuth_bin}|${e.elevation_bin}`,meshId:s,azimuthBin:e.azimuth_bin,elevationBin:e.elevation_bin,count:e.count})}let m=[...u.values()].sort((e,t)=>t.count-e.count),h=m.slice(0,Math.max(1,n.maxRibbons)),x=m.slice(Math.max(1,n.maxRibbons));if(x.length>0){let e=new Map(h.map(e=>[`${e.standpointId}|${e.azimuthBin}|${e.elevationBin}|${X}`,e]));for(let t of x){let s=`${t.standpointId}|${t.azimuthBin}|${t.elevationBin}|${X}`,n=e.get(s);if(n)n.count+=t.count;else{let n={standpointId:t.standpointId,gazeId:t.gazeId,meshId:X,azimuthBin:t.azimuthBin,elevationBin:t.elevationBin,count:t.count};e.set(s,n),h.push(n)}}}let p=new Set(h.map(e=>e.standpointId)),g=new Set(h.map(e=>e.meshId)),f=[...l.filter(e=>p.has(e.key)).map(e=>e.key),...p.has(K)?[K]:[]],b=f.map((e,t)=>{let s=l.find(t=>t.key===e),n=h.filter(t=>t.standpointId===e).reduce((e,t)=>e+t.count,0);return{id:e,kind:"standpoint",pos:[-2.6,J(t,f.length),0],count:n,label:s?`[${s.voxel[0]}, ${s.voxel[1]}, ${s.voxel[2]}]`:"Other standpoints",isOther:e===K}}),v=new Map(b.map(e=>[e.id,e.pos[1]])),w=new Map;for(let e of h)w.set(e.meshId,(w.get(e.meshId)??0)+e.count);let j=[...g].sort((e,t)=>(w.get(t)??0)-(w.get(e)??0));j.sort((e,t)=>(e===X)-(t===X));let y=j.map((e,t)=>({id:e,kind:"mesh",pos:[2.6,J(t,j.length),0],count:w.get(e)??0,label:e===X?"Other meshes":e,isOther:e===X})),N=new Map;for(let e of h){let t=N.get(e.gazeId);t?t.count+=e.count:N.set(e.gazeId,{az:e.azimuthBin,el:e.elevationBin,sp:e.standpointId,count:e.count})}let k=[...N.entries()].map(([e,t])=>{let n=v.get(t.sp)??0,a=(t.az+.5)/s-.5;return{id:e,kind:"gaze",pos:[0,n+((t.el+.5)/s-.5)*.85,1.6*a],count:t.count,label:`(${t.az}, ${t.el})`,isOther:!1}}),M=h.reduce((e,t)=>Math.max(e,t.count),1);return{standpoints:b,gazes:k,meshes:y,ribbons:h,maxCount:M}})(T,O,a,Q),[T,O,a]),G="twostage"===_&&U;(0,n.useEffect)(()=>{"twostage"!==_||U||$("aggregate")},[_,U]);let V=(0,n.useMemo)(()=>{if(C!==Y&&U)return T.filter(e=>e.originVoxel&&q(e.originVoxel)===C);if(!U)return T;let e=new Map;for(let t of T){let s=`${t.azimuth_bin}|${t.elevation_bin}|${t.mesh}`,n=e.get(s);n?n.count+=t.count:e.set(s,{azimuth_bin:t.azimuth_bin,elevation_bin:t.elevation_bin,mesh:t.mesh,count:t.count})}return[...e.values()]},[T,C,U]),Z=(0,n.useMemo)(()=>[...V].sort((e,t)=>t.count-e.count).slice(0,Math.max(1,i)),[V,i]),es=(0,n.useMemo)(()=>{let e=new Map;for(let t of Z)e.set(t.mesh,(e.get(t.mesh)??0)+t.count);return[...e.entries()].sort((e,t)=>t[1]-e[1])},[Z]),er=(0,n.useMemo)(()=>{let e=new Map;for(let t of Z){let s=ee(t.azimuth_bin,t.elevation_bin),n=e.get(s);n?n.count+=t.count:e.set(s,{azimuthBin:t.azimuth_bin,elevationBin:t.elevation_bin,count:t.count})}return[...e.values()].sort((e,t)=>t.count-e.count)},[Z]);(0,n.useEffect)(()=>{!G&&w!==Y&&(es.some(([e])=>e===w)||j(Y))},[G,w,es]),(0,n.useEffect)(()=>{!G&&y!==Y&&(er.some(e=>ee(e.azimuthBin,e.elevationBin)===y)||N(Y))},[G,y,er]),(0,n.useEffect)(()=>{!G&&C!==Y&&(O.some(e=>e.key===C)||P(Y))},[G,C,O]),(0,n.useEffect)(()=>{j(Y),N(Y),P(Y)},[_]);let ei=(0,n.useMemo)(()=>G?H.ribbons.filter(e=>{let t=C===Y||e.standpointId===C,s=y===Y||ee(e.azimuthBin,e.elevationBin)===y,n=w===Y||e.meshId===w;return t&&s&&n}).length:Z.filter(e=>{let t=y===Y||ee(e.azimuth_bin,e.elevation_bin)===y,s=w===Y||e.mesh===w;return t&&s}).length,[G,H,Z,w,y,C]),eo=G?H.ribbons.length:Z.length,ec=(0,n.useMemo)(()=>G?H.standpoints.map(e=>({value:e.id,label:`${e.label} \xb7 ${e.count}`})):O.slice(0,24).map(e=>({value:e.key,label:`[${e.voxel[0]}, ${e.voxel[1]}, ${e.voxel[2]}] \xb7 ${e.count}`})),[G,H,O]),ed=(0,n.useMemo)(()=>{if(G){let e=new Map;for(let t of H.ribbons){let s=ee(t.azimuthBin,t.elevationBin),n=e.get(s);n?n.count+=t.count:e.set(s,{az:t.azimuthBin,el:t.elevationBin,count:t.count})}return[...e.values()].sort((e,t)=>t.count-e.count).map(e=>({value:ee(e.az,e.el),label:`(${e.az}, ${e.el}) \xb7 ${e.count}`}))}return er.map(e=>({value:ee(e.azimuthBin,e.elevationBin),label:`(${e.azimuthBin}, ${e.elevationBin}) \xb7 ${e.count}`}))},[G,H,er]),eu=(0,n.useMemo)(()=>G?H.meshes.map(e=>({value:e.id,label:`${e.label} \xb7 ${e.count}`})):es.map(([e,t])=>({value:e,label:`${e} \xb7 ${t}`})),[G,H,es]);return(0,n.useEffect)(()=>{let t=m.current;if(!t||G)return;if(0===Z.length)return void f("empty");let s=!1,n=null;return f("loading"),v(null),(async()=>{try{let[{Engine:l},{Scene:i},{ArcRotateCamera:o},{HemisphericLight:c},{Vector3:d,Color3:u,Color4:m},{MeshBuilder:g},{StandardMaterial:b}]=await Promise.all([e.A(66022),e.A(48505),e.A(53976),e.A(42436),e.A(89370),e.A(67141),e.A(20693),e.A(96664)]);if(s)return;let v=new l(t,!0,{preserveDrawingBuffer:!1}),j=new i(v);j.clearColor=new m(.04,.05,.07,1);let N=new Map;for(let e of r)N.set(e.name,function(e){let t=e.aabb;return[(t[0]+t[3])/2,(t[1]+t[4])/2,(t[2]+t[5])/2]}(e));let S=new Map,z=es.map(([e])=>e).filter(e=>!N.has(e));for(let e=0;e<z.length;e++){let t=z[e],s=function(e){let t=0;for(let s=0;s<e.length;s++)t=31*t+e.charCodeAt(s)|0;return Math.abs(t)}(t),n=e/Math.max(1,z.length)*Math.PI*2+s%100/100*.35;S.set(t,[2.2*Math.cos(n),-.35+(s%7-3)*.06,2.2*Math.sin(n)])}for(let[e,t]of N.entries())S.set(e,t);let C=0,P=0,_=0,$=0;for(let e of S.values())C+=e[0],P+=e[1],_+=e[2],$++;let I=new d(C/Math.max(1,$),P/Math.max(1,$),_/Math.max(1,$)),A=1.8;for(let e of S.values()){let t=e[0]-I.x,s=e[1]-I.y,n=e[2]-I.z;A=Math.max(A,Math.sqrt(t*t+s*s+n*n))}let E=.75*A+1,T=Math.max(1,A/1.8),F=Z.reduce((e,t)=>Math.max(e,t.count),1),L=new b("flow-source-node",j);L.disableLighting=!0,L.emissiveColor=new u(.45,.75,1);let B=new b("flow-target-node",j);B.disableLighting=!0,B.emissiveColor=new u(1,.82,.42);let D=new Set,O=new Set,U=e=>{let t=y===Y||ee(e.azimuth_bin,e.elevation_bin)===y,s=w===Y||e.mesh===w;return t&&s},H=new Set,G=new Set;for(let e of Z)U(e)&&(H.add(ee(e.azimuth_bin,e.elevation_bin)),G.add(e.mesh));for(let e of Z){let t=`${e.azimuth_bin}|${e.elevation_bin}`,s=S.get(e.mesh);if(!s)continue;let n=U(e),l=(e.azimuth_bin+.5)/a*Math.PI*2-Math.PI,r=(e.elevation_bin+.5)/a*Math.PI-Math.PI/2,i=Math.cos(r),o=i*Math.cos(l),c=Math.sin(r),m=i*Math.sin(l),h=new d(I.x+o*E,I.y+c*E,I.z+m*E),x=new d(s[0],s[1],s[2]);if(!D.has(t)){let e=g.CreateSphere(`flow-src-${t}`,{diameter:.12*T,segments:6},j);e.position=h;let s=L.clone(`flow-src-mat-${t}`);s.alpha=H.has(t)||w===Y&&y===Y?1:.22,e.material=s,e.isPickable=!1,D.add(t)}if(!O.has(e.mesh)){let t=g.CreateSphere(`flow-target-${e.mesh}`,{diameter:.2*T,segments:7},j);t.position=x;let s=B.clone(`flow-target-mat-${e.mesh}`);s.alpha=G.has(e.mesh)||w===Y&&y===Y?1:.22,t.material=s,t.isPickable=!0,t.metadata={hoverLabel:e.mesh},O.add(e.mesh)}let f=h.add(x).scale(.5),v=f.subtract(I),N=Math.sqrt(v.x*v.x+v.y*v.y+v.z*v.z),k=N>1e-6?v.x/N:0,M=N>1e-6?v.y/N:1,z=N>1e-6?v.z/N:0,C=(.35+e.count/F*.75)*T,P=new d(f.x+k*C,f.y+M*C+.12*T,f.z+z*C),_=[];for(let e=0;e<=18;e++){let t=e/18,s=1-t;_.push(new d(s*s*h.x+2*s*t*P.x+t*t*x.x,s*s*h.y+2*s*t*P.y+t*t*x.y,s*s*h.z+2*s*t*P.z+t*t*x.z))}let $=e.count/F,[R,A,W]=(0,p.heatRgb)($),V=g.CreateTube(`flow-link-${e.mesh}-${t}`,{path:_,radius:(n?1:.4)*(.012+.04*$)*T,tessellation:8,cap:0,sideOrientation:0},j),Z=new b(`flow-link-mat-${e.mesh}-${t}`,j);Z.disableLighting=!0,Z.emissiveColor=new u(R,A,W),Z.alpha=n?.35+.65*$:.08,V.material=Z,V.isPickable=!0,V.metadata={hoverLabel:e.mesh}}let V=new o("flow-cam",Math.PI/4,Math.PI/3,3.4*A,I,j);V.attachControl(t,!0),(0,k.disableWheelZoom)(V),h.current=V,x.current={target:I,alpha:V.alpha,beta:V.beta,radius:V.radius},new c("flow-light",new d(.3,1,.2),j);let K=g.CreateSphere("flow-source-dome",{diameter:2*E,segments:20},j);K.position=I;let X=new b("flow-source-dome-mat",j);X.wireframe=!0,X.disableLighting=!0,X.emissiveColor=new u(.16,.2,.28),X.alpha=.35,K.material=X,K.isPickable=!1;let q=W?.origin;if(q){let e=new d(q[0],q[1],q[2]),t=g.CreateSphere("flow-standpoint",{diameter:.26*T,segments:10},j);t.position=e;let s=new b("flow-standpoint-mat",j);s.disableLighting=!0,s.emissiveColor=new u(.95,.45,.95),t.material=s,t.isPickable=!1;let n=g.CreateLines("flow-standpoint-stem",{points:[e,new d(e.x,I.y,e.z)]},j);n.color=new u(.95,.45,.95),n.isPickable=!1}v.runRenderLoop(()=>j.render());let J=()=>v.resize();window.addEventListener("resize",J);let Q=(0,M.attachMeshHover)(j,t,R),et=(0,k.attachDoubleClickFocus)(j,t,V);f("ready"),n=()=>{window.removeEventListener("resize",J),Q(),et(),R(null),h.current=null,x.current=null,j.dispose(),v.dispose()}}catch(e){if(s)return;f("error"),v(e instanceof Error?e.message:"Failed to render flow links.")}})(),()=>{s=!0,n?.()}},[Z,a,r,w,y,W,G]),(0,n.useEffect)(()=>{let t=m.current;if(!t||!G)return;if(0===H.ribbons.length)return void f("empty");let s=!1,n=null;return f("loading"),v(null),(async()=>{try{let[{Engine:a},{Scene:l},{ArcRotateCamera:r},{HemisphericLight:i},{Vector3:o,Color3:c,Color4:d},{MeshBuilder:u},{StandardMaterial:m}]=await Promise.all([e.A(66022),e.A(48505),e.A(53976),e.A(42436),e.A(89370),e.A(67141),e.A(20693),e.A(96664)]);if(s)return;let g=new a(t,!0,{preserveDrawingBuffer:!1}),b=new l(g);b.clearColor=new d(.04,.05,.07,1);let v=e=>{let t=C===Y||e.standpointId===C,s=y===Y||ee(e.azimuthBin,e.elevationBin)===y,n=w===Y||e.meshId===w;return t&&s&&n},j=C!==Y||y!==Y||w!==Y,N=new Set;for(let e of H.ribbons)v(e)&&(N.add(e.standpointId),N.add(e.gazeId),N.add(e.meshId));let S={standpoint:[.95,.45,.95],gaze:[.45,.75,1],mesh:[1,.82,.42]},z={standpoint:.26,gaze:.13,mesh:.22},P=[...H.standpoints,...H.gazes,...H.meshes],_=new Map(P.map(e=>[e.id,e.pos])),$=new Map(P.map(e=>[e.id,e.label]));for(let e of P){let t=u.CreateSphere(`ts-node-${e.kind}-${e.id}`,{diameter:z[e.kind],segments:8},b);t.position=new o(e.pos[0],e.pos[1],e.pos[2]);let s=new m(`ts-node-mat-${e.kind}-${e.id}`,b);s.disableLighting=!0;let[n,a,l]=S[e.kind];s.emissiveColor=new c(n,a,l),s.alpha=!j||N.has(e.id)?1:.2,t.material=s,t.isPickable=!0,t.metadata={hoverLabel:e.label}}let I=(e,t,s)=>{let n=e[0],a=e[1],l=e[2],r=t[0],i=t[1],c=t[2],d=[(n+r)/2,(a+i)/2+s,(l+c)/2],u=[];for(let e=0;e<=12;e++){let t=e/12,s=1-t;u.push(new o(s*s*n+2*s*t*d[0]+t*t*r,s*s*a+2*s*t*d[1]+t*t*i,s*s*l+2*s*t*d[2]+t*t*c))}return u};for(let e of H.ribbons){let t=_.get(e.standpointId),s=_.get(e.gazeId),n=_.get(e.meshId);if(!t||!s||!n)continue;let a=e.count/H.maxCount,l=.18+.5*a,r=[...I(t,s,l),...I(s,n,l).slice(1)],i=v(e),[o,d,h]=(0,p.heatRgb)(a),x=u.CreateTube(`ts-link-${e.standpointId}-${e.gazeId}-${e.meshId}`,{path:r,radius:(i?1:.4)*(.012+.04*a),tessellation:8,cap:0,sideOrientation:0},b),g=new m(`ts-link-mat-${e.standpointId}-${e.gazeId}-${e.meshId}`,b);g.disableLighting=!0,g.emissiveColor=new c(o,d,h),g.alpha=i?.35+.65*a:j?.06:.18,x.material=g,x.isPickable=!0,x.metadata={hoverLabel:$.get(e.meshId)??e.meshId}}let A=o.Zero(),E=new r("ts-cam",Math.PI/2,Math.PI/2.4,8.5,A,b);E.attachControl(t,!0),(0,k.disableWheelZoom)(E),h.current=E,x.current={target:A,alpha:E.alpha,beta:E.beta,radius:E.radius},new i("ts-light",new o(.3,1,.2),b),g.runRenderLoop(()=>b.render());let T=()=>g.resize();window.addEventListener("resize",T);let F=(0,M.attachMeshHover)(b,t,R),L=(0,k.attachDoubleClickFocus)(b,t,E);f("ready"),n=()=>{window.removeEventListener("resize",T),F(),L(),R(null),h.current=null,x.current=null,b.dispose(),g.dispose()}}catch(e){if(s)return;f("error"),v(e instanceof Error?e.message:"Failed to render flow links.")}})(),()=>{s=!0,n?.()}},[G,H,C,y,w]),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("canvas",{ref:m,className:"aspect-video w-full rounded-lg border border-edge bg-ink"}),I?(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:I.x+12,top:I.y+12},children:I.label}):null,"ready"===g?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"absolute left-3 top-3 flex flex-wrap gap-2",children:[U?(0,t.jsxs)("div",{className:"flex items-center gap-1 rounded-md border border-edge bg-ink/80 p-0.5 text-xs backdrop-blur",children:[(0,t.jsx)(ea,{active:!G,onClick:()=>$("aggregate"),children:"Aggregate"}),(0,t.jsx)(ea,{active:G,onClick:()=>$("twostage"),children:"Two-stage"})]}):null,L?(0,t.jsxs)("div",{className:"flex items-center gap-1 rounded-md border border-edge bg-ink/80 p-0.5 text-xs backdrop-blur",children:[(0,t.jsx)(ea,{active:"first-person"===A,onClick:()=>E("first-person"),children:"Walk"}),(0,t.jsx)(ea,{active:"viewer"===A,onClick:()=>E("viewer"),disabled:u,title:u?"Orbit (viewer) flow isn't available for walkable scenes":void 0,children:"Orbit"}),(0,t.jsx)(ea,{active:"all"===A,onClick:()=>E("all"),children:"All"})]}):null,U?(0,t.jsx)(en,{label:"Standpoint",value:C,onChange:P,allLabel:"All standpoints",options:ec}):null,(0,t.jsx)(en,{label:G?"Gaze":"Source",value:y,onChange:N,allLabel:G?"All gaze sectors":"All sources",options:ed}),(0,t.jsx)(en,{label:"Mesh",value:w,onChange:j,allLabel:"All meshes",options:eu})]}),G?(0,t.jsx)(el,{standpoints:O,proxyMeshes:r,selectedKey:C,onSelect:e=>P(t=>t===e?Y:e)}):null,(0,t.jsxs)("div",{className:"pointer-events-none absolute bottom-3 right-3 flex max-w-[20rem] flex-col items-end gap-2",children:[L&&!u?(0,t.jsxs)("div",{className:"rounded-md border border-edge bg-ink/80 px-2 py-1 text-xs text-fg-muted backdrop-blur",children:["Orbit-dominated scene — viewer ",(0,t.jsx)("em",{children:"position"})," adds little here. Use the"," ",(0,t.jsx)("strong",{children:"View dome"})," (§7.5) above for where viewers looked."]}):null,(0,t.jsxs)("div",{className:"rounded-md border border-edge bg-ink/80 px-2 py-1 text-xs text-fg backdrop-blur",children:["Active links: ",ei,"/",eo]})]}),(0,t.jsx)(z.ZoomButtons,{onZoom:e=>h.current&&(0,k.stepZoom)(h.current,e),onReset:()=>h.current&&x.current&&(0,k.resetFocus)(h.current,x.current)}),(0,t.jsx)(S.HeatLegend,{title:"Flow volume",lowLabel:"fewer links",highLabel:"dominant links",note:G?"Three columns: standpoint → gaze sector → mesh. Top standpoints/meshes are kept; the tail folds into an “Other” node. Pick a standpoint (or click the minimap), gaze sector, or mesh to emphasize matching ribbons.":"Each arc aggregates clicks from one camera-direction bin to a mesh. Pick a source or mesh to emphasize matching links and dim the rest."})]}):(0,t.jsx)("div",{className:"pointer-events-none absolute inset-0 grid place-items-center text-sm text-fg-muted",children:"loading"===g?"Rendering…":"empty"===g?"No aggregate flow links in range.":"error"===g?b??"Flow view unavailable.":null})]})}let es=(0,t.jsxs)(t.Fragment,{children:["Each ",(0,t.jsx)("strong",{children:"source"})," is a camera ",(0,t.jsx)("em",{children:"gaze-direction bin"})," — a cell on the sphere of where viewers were looking (grouped by azimuth/elevation). Each ",(0,t.jsx)("strong",{children:"target"})," is a"," ",(0,t.jsx)("em",{children:"mesh that was clicked"}),". A ribbon's thickness is how many clicks on that mesh happened while viewers looked from that direction, so you can see which viewpoints drive interaction with which objects. When the scene reports ",(0,t.jsx)("em",{children:"standpoints"}),'(where the viewer stood, §7.8), pick one to gate the flow to clicks made from that vantage — a pin marks it in the scene. "All standpoints" is the aggregate view. Switch to ',(0,t.jsx)("strong",{children:"Two-stage"})," ","for a three-column ",(0,t.jsx)("em",{children:"standpoint → gaze sector → mesh"}),'flow with a birdview minimap; the busiest standpoints/meshes are kept and the tail folds into an "Other" node.']});function en({label:e,value:s,onChange:n,allLabel:a,options:l}){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:s,onChange:e=>n(e.target.value),children:[(0,t.jsx)("option",{value:Y,children:a}),l.map(e=>(0,t.jsx)("option",{value:e.value,children:e.label},e.value))]})]})}function ea({active:e,onClick:s,children:n,disabled:a=!1,title:l}){return(0,t.jsx)("button",{type:"button",onClick:s,disabled:a,title:l,className:`rounded px-2 py-0.5 font-medium transition ${a?"cursor-not-allowed text-fg-muted/40":e?"bg-amber text-ink":"text-fg-muted hover:text-fg"}`,children:n})}function el({standpoints:e,proxyMeshes:s,selectedKey:a,onSelect:l}){let r=(0,n.useRef)(null),i=(0,n.useMemo)(()=>e.filter(e=>e.origin),[e]),o=(0,n.useMemo)(()=>{let e=1/0,t=-1/0,n=1/0,a=-1/0,l=(s,l)=>{e=Math.min(e,s),t=Math.max(t,s),n=Math.min(n,l),a=Math.max(a,l)};for(let e of s)l(e.aabb[0],e.aabb[2]),l(e.aabb[3],e.aabb[5]);for(let e of i)l(e.origin[0],e.origin[2]);return Number.isFinite(e)?(t-e<.001&&(e-=1,t+=1),a-n<.001&&(n-=1,a+=1),{minX:e,maxX:t,minZ:n,maxZ:a}):{minX:-1,maxX:1,minZ:-1,maxZ:1}},[s,i]),c=(0,n.useMemo)(()=>{let e=Math.min(134/(o.maxX-o.minX),94/(o.maxZ-o.minZ));return(t,s)=>[8+(t-o.minX)*e,8+(s-o.minZ)*e]},[o]),d=(0,n.useMemo)(()=>i.reduce((e,t)=>Math.max(e,t.count),1),[i]);return(0,n.useEffect)(()=>{let e=r.current,t=e?.getContext("2d");if(!t)return;let n=window.devicePixelRatio||1;for(let a of(e.width=150*n,e.height=110*n,t.setTransform(n,0,0,n,0,0),t.clearRect(0,0,150,110),t.fillStyle="rgba(8,10,14,0.85)",t.fillRect(0,0,150,110),t.strokeStyle="rgba(120,140,170,0.35)",t.lineWidth=1,s)){let[e,s]=c(a.aabb[0],a.aabb[2]),[n,l]=c(a.aabb[3],a.aabb[5]);t.strokeRect(Math.min(e,n),Math.min(s,l),Math.abs(n-e),Math.abs(l-s))}for(let e of i){let[s,n]=c(e.origin[0],e.origin[2]),l=2+e.count/d*4,r=e.key===a;t.beginPath(),t.arc(s,n,l,0,2*Math.PI),t.fillStyle=r?"rgba(242,115,242,1)":"rgba(242,115,242,0.55)",t.fill(),r&&(t.beginPath(),t.arc(s,n,l+2.5,0,2*Math.PI),t.strokeStyle="rgba(255,255,255,0.9)",t.lineWidth=1.5,t.stroke())}},[s,i,c,d,a]),(0,t.jsxs)("div",{className:"absolute right-3 top-3 rounded-md border border-edge bg-ink/80 p-1 backdrop-blur",children:[(0,t.jsx)("div",{className:"px-1 pb-0.5 text-[10px] font-medium text-fg-muted",children:"Standpoints (top view)"}),(0,t.jsx)("canvas",{ref:r,className:"h-27.5 w-37.5 cursor-pointer rounded",onClick:e=>{let t=r.current;if(!t||0===i.length)return;let s=t.getBoundingClientRect(),n=(e.clientX-s.left)/s.width*150,a=(e.clientY-s.top)/s.height*110,o=null,d=1/0;for(let e of i){let[t,s]=c(e.origin[0],e.origin[2]),l=(t-n)**2+(s-a)**2;l<d&&(d=l,o=e)}o&&d<=196&&l(o.key)}})]})}function er(e){let t=Math.min(1,Math.max(0,e));return[.118+(.22-.118)*t,.227+.513*t,.541+(.97-.541)*t]}function ei(e){return`${e.vx}|${e.vy}|${e.vz}`}function eo({gazeVoxels:s,clickVoxels:a,cellSize:l,proxyMeshes:r=[]}){let i=(0,n.useRef)(null),o=(0,n.useRef)(null),c=(0,n.useRef)(null),[d,u]=(0,n.useState)("loading"),[m,h]=(0,n.useState)(null),[x,g]=(0,n.useState)("overlay"),[f,b]=(0,n.useState)(null);return(0,n.useEffect)(()=>{let t=i.current;if(!t)return;if(0===s.length&&0===a.length&&0===r.length)return void u("empty");let n=!1,d=null;return u("loading"),h(null),(async()=>{try{let[{Engine:i},{Scene:m},{ArcRotateCamera:h},{HemisphericLight:g},{Vector3:f,Color3:v,Color4:w,Matrix:j},{MeshBuilder:y},{StandardMaterial:N}]=await Promise.all([e.A(66022),e.A(48505),e.A(53976),e.A(42436),e.A(89370),e.A(67141),e.A(20693),e.A(9607),e.A(96664)]);if(n)return;let S=s.reduce((e,t)=>Math.max(e,t.count),1),z=a.reduce((e,t)=>Math.max(e,t.count),1),C=[...s,...a],P=0,_=0,$=0,I=0;for(let e of C)P+=(e.vx+.5)*l,_+=(e.vy+.5)*l,$+=(e.vz+.5)*l,I++;if(0===I)for(let e of r)P+=(e.aabb[0]+e.aabb[3])/2,_+=(e.aabb[1]+e.aabb[4])/2,$+=(e.aabb[2]+e.aabb[5])/2,I++;let R=new f(P/I,_/I,$/I),A=4*l;for(let e of C){let t=(e.vx+.5)*l-R.x,s=(e.vy+.5)*l-R.y,n=(e.vz+.5)*l-R.z;A=Math.max(A,Math.sqrt(t*t+s*s+n*n))}for(let e of r){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;A=Math.max(A,Math.sqrt(t*t+s*s+n*n))}let E=new i(t,!0,{preserveDrawingBuffer:!1}),T=new m(E);T.clearColor=new w(.04,.05,.07,1);let F=new h("divergence-cam",Math.PI/4,Math.PI/3,2.4*A,R,T);if(F.attachControl(t,!0),(0,k.disableWheelZoom)(F),o.current=F,c.current={target:R,alpha:F.alpha,beta:F.beta,radius:F.radius},new g("divergence-light",new f(.4,1,.3),T),r.length>0){let e=y.CreateBox("scene-proxy",{size:1},T),t=new N("scene-proxy-mat",T);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:r.map(e=>e.name)};let s=r.length,n=new Float32Array(16*s);for(let e=0;e<s;e++){let t=r[e].aabb,s=Math.max(t[3]-t[0],.001),a=Math.max(t[4]-t[1],.001),l=Math.max(t[5]-t[2],.001);j.Scaling(s,a,l).multiply(j.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 L=Math.max(.02*A,.25*l)/(.9*l),B=(e,t,s,n,a)=>{if(0===t.length)return;let r=y.CreateSphere(e,{diameter:.9*l,segments:6},T),i=new N(`${e}-mat`,T);i.diffuseColor=new v(1,1,1),i.specularColor=new v(0,0,0),r.material=i,r.metadata={hoverLabel:a};let o=t.length,c=new Float32Array(16*o),d=new Float32Array(4*o);for(let e=0;e<o;e++){let a=t[e],r=a.count/s,i=L*(.5+.5*r);j.Scaling(i,i,i).multiply(j.Translation((a.vx+.5)*l,(a.vy+.5)*l,(a.vz+.5)*l)).copyToArray(c,16*e);let[o,u,m]=n(r);d[4*e]=o,d[4*e+1]=u,d[4*e+2]=m,d[4*e+3]=1}r.thinInstanceSetBuffer("matrix",c,16,!1),r.thinInstanceSetBuffer("color",d,4,!0)};if("divergence"===x){let e=new Map(s.map(e=>[ei(e),e])),t=new Map(a.map(e=>[ei(e),e])),n=new Set([...e.keys(),...t.keys()]),l=[],r=[];for(let s of n){let n=(e.get(s)?.count??0)/S,a=(t.get(s)?.count??0)/z,i=t.get(s)??e.get(s),o=a-n,c={vx:i.vx,vy:i.vy,vz:i.vz,count:1e3*Math.abs(o)};(o>=0?l:r).push(c)}B("div-click",l,1e3,p.heatRgb,"Click-heavy"),B("div-gaze",r,1e3,er,"Gaze-heavy")}else("overlay"===x||"gaze"===x)&&B("gaze-voxel",s,S,er,"Gaze"),("overlay"===x||"click"===x)&&B("click-voxel",a,z,p.heatRgb,"Click");E.runRenderLoop(()=>T.render());let D=()=>E.resize();window.addEventListener("resize",D);let O=(0,M.attachMeshHover)(T,t,b),U=(0,k.attachDoubleClickFocus)(T,t,F);u("ready"),d=()=>{window.removeEventListener("resize",D),O(),U(),b(null),o.current=null,c.current=null,T.dispose(),E.dispose()}}catch(e){if(n)return;u("error"),h(e instanceof Error?e.message:"Failed to render overlay.")}})(),()=>{n=!0,d?.()}},[s,a,l,r,x]),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("canvas",{ref:i,className:"aspect-video w-full rounded-lg border border-edge bg-ink"}),f?(0,t.jsx)("div",{className:"pointer-events-none absolute z-10 max-w-64 truncate rounded border border-edge bg-ink/90 px-1.5 py-0.5 text-xs text-white shadow backdrop-blur",style:{left:f.x+12,top:f.y+12},children:f.label}):null,"ready"===d?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"absolute left-3 top-3 flex items-center gap-1 rounded-md border border-edge bg-ink/80 p-0.5 text-xs backdrop-blur",children:[(0,t.jsx)(ed,{active:"overlay"===x,onClick:()=>g("overlay"),children:"Overlay"}),(0,t.jsx)(ed,{active:"gaze"===x,onClick:()=>g("gaze"),children:"Gaze"}),(0,t.jsx)(ed,{active:"click"===x,onClick:()=>g("click"),children:"Clicks"}),(0,t.jsx)(ed,{active:"divergence"===x,onClick:()=>g("divergence"),children:"Divergence"})]}),(0,t.jsx)(z.ZoomButtons,{onZoom:e=>o.current&&(0,k.stepZoom)(o.current,e),onReset:()=>o.current&&c.current&&(0,k.resetFocus)(o.current,c.current)}),(0,t.jsx)(ec,{mode:x})]}):(0,t.jsx)("div",{className:"pointer-events-none absolute inset-0 grid place-items-center text-sm text-fg-muted",children:"loading"===d?"Rendering…":"empty"===d?"No gaze or click hit-points in range. Enable gaze + pointer capture in the SDK.":"error"===d?m??"Overlay unavailable.":null})]})}function ec({mode:e}){return(0,t.jsxs)("div",{className:"absolute bottom-3 right-3 max-w-72 rounded-md border border-edge bg-ink/80 px-2 py-1.5 text-xs text-fg backdrop-blur",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-[#38bdf8]"}),"divergence"===e?"Gaze-heavy":"Gaze"]}),(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-[#f4c84b]"}),"divergence"===e?"Click-heavy":"Clicks"]})]}),(0,t.jsx)("p",{className:"mt-1 text-fg-muted",children:"divergence"===e?"Per-voxel normalized difference: which signal dominates each cell. Color & size scale with the gap.":"Gaze = where viewers looked; Clicks = where they acted. Cells with gaze but no clicks are looked-at but un-acted-on."})]})}function ed({active:e,onClick:s,children:n}){return(0,t.jsx)("button",{type:"button",onClick:s,className:`rounded px-2 py-0.5 font-medium transition ${e?"bg-amber text-ink":"text-fg-muted hover:text-fg"}`,children:n})}let eu={orbit:"Orbit",pan:"Pan",dolly:"Dolly",zoom:"Zoom",roll:"Roll",fly:"Fly",navigate:"Navigate"};function em({stats:e}){let s=[...e].sort((e,t)=>t.gestures-e.gestures),n=s.reduce((e,t)=>e+t.gestures,0),a=s.reduce((e,t)=>Math.max(e,t.gestures),0);return 0===s.length||0===n?(0,t.jsxs)("p",{className:"text-sm text-fg-muted",children:["No camera-navigation gestures in range. Enable ",(0,t.jsx)("code",{children:"cameraGesture"})," capture in the SDK (on by default for Babylon) to populate this."]}):(0,t.jsx)("ul",{className:"space-y-3",children:s.map(e=>{var s,l;let r=n>0?e.gestures/n*100:0;return(0,t.jsxs)("li",{className:"text-sm",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("span",{className:"font-medium text-fg",children:eu[s=e.kind]??s.charAt(0).toUpperCase()+s.slice(1)}),(0,t.jsxs)("span",{className:"tabular-nums text-fg-muted",children:[f(e.gestures),(0,t.jsxs)("span",{className:"ml-1 text-xs text-fg-muted",children:["· ",r.toFixed(0),"%"]}),(0,t.jsxs)("span",{className:"ml-2 text-xs text-fg-muted",children:["avg ",!Number.isFinite(l=e.avg_ms)||l<=0?"0 ms":l<1e3?`${Math.round(l)} ms`:`${(l/1e3).toFixed(l<1e4?2:1)} s`]})]})]}),(0,t.jsx)("div",{className:"mt-1 h-1.5 w-full overflow-hidden rounded bg-ink/60",children:(0,t.jsx)("div",{className:"h-full rounded bg-amber",style:{width:`${a>0?e.gestures/a*100:0}%`}})})]},e.kind)})})}let eh="#161210",ex={fontSize:13,color:"#a8917c"},ep={padding:"6px 10px",fontSize:13,borderTop:"1px solid #34291f"};function eg({sessions:e,onSelect:s,selectedId:n}){return 0===e.length?(0,t.jsx)("p",{style:ex,children:"No sessions in range."}):(0,t.jsx)("div",{style:{maxHeight:320,overflow:"auto"},children:(0,t.jsxs)("table",{style:{width:"100%",borderCollapse:"collapse",textAlign:"left"},children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{style:{fontSize:11,textTransform:"uppercase",color:"#a8917c"},children:[(0,t.jsx)("th",{style:{padding:"6px 10px"},children:"Session"}),(0,t.jsx)("th",{style:{padding:"6px 10px"},children:"Visitor"}),(0,t.jsx)("th",{style:{padding:"6px 10px",textAlign:"right"},children:"Events"}),(0,t.jsx)("th",{style:{padding:"6px 10px"},children:"Started"})]})}),(0,t.jsx)("tbody",{children:e.map(e=>{var a;let l,r=e.session_id===n;return(0,t.jsxs)("tr",{onClick:s?()=>s(e.session_id):void 0,style:{cursor:s?"pointer":"default",background:r?"rgba(237,166,62,0.15)":void 0},children:[(0,t.jsx)("td",{style:{...ep,fontFamily:"ui-monospace, monospace",color:"#d8c8b8"},children:e.session_id.slice(0,12)}),(0,t.jsx)("td",{style:{...ep,fontFamily:"ui-monospace, monospace",color:"#a8917c"},children:e.visitor_id.slice(0,8)}),(0,t.jsx)("td",{style:{...ep,textAlign:"right",fontVariantNumeric:"tabular-nums"},children:f(e.events)}),(0,t.jsx)("td",{style:{...ep,fontSize:12,color:"#a8917c"},children:Number.isNaN((l=new Date((a=e.started_at).includes("T")?a:a.replace(" ","T")+"Z")).getTime())?a:l.toLocaleString()})]},e.session_id)})})]})})}function ef({bins:e,gridSize:s,size:a=320,className:l,style:r}){let i=(0,n.useRef)(null);return(0,n.useEffect)(()=>{let t=i.current;if(!t)return;let n=t.getContext("2d");n&&function(e,t,s,n){if(e.clearRect(0,0,n,n),e.fillStyle=eh,e.fillRect(0,0,n,n),0===t.length)return;let a=t.reduce((e,t)=>Math.max(e,t.count),0),l=n/s;for(let s of t)e.fillStyle=g(a>0?s.count/a:0,.85),e.fillRect(s.gx*l,s.gy*l,Math.ceil(l),Math.ceil(l))}(n,e,s,a)},[e,s,a]),(0,t.jsx)("canvas",{ref:i,width:a,height:a,className:l,style:r,"aria-label":"Pointer heatmap"})}function eb({bins:e,gridSize:s,size:a=340,className:l,style:r}){let i=(0,n.useRef)(null);return(0,n.useEffect)(()=>{let t=i.current;if(!t)return;let n=t.getContext("2d");if(!n)return;let l=Math.min(window.devicePixelRatio||1,2);t.width=a*l,t.height=a*l,n.setTransform(l,0,0,l,0,0),function(e,t,s,n){let a=n/2,l=n/2,r=n/2-18;if(e.clearRect(0,0,n,n),e.fillStyle=eh,e.fillRect(0,0,n,n),e.strokeStyle="#34291f",e.lineWidth=1,e.beginPath(),e.arc(a,l,r,0,2*Math.PI),e.stroke(),e.beginPath(),e.arc(a,l,r/2,0,2*Math.PI),e.stroke(),t.length>0){let n=t.reduce((e,t)=>Math.max(e,t.count),0),i=2*Math.PI/s;for(let o of t){let t=n>0?o.count/n:0,c=1-(o.elevation_bin+1)/s,d=1-o.elevation_bin/s,u=Math.max(0,c)*r,m=Math.max(0,d)*r,h=o.azimuth_bin*i,x=h+i;e.beginPath(),e.arc(a,l,m,h,x),e.arc(a,l,u,x,h,!0),e.closePath(),e.fillStyle=g(t,.85),e.fill()}}let i=(t,s,n)=>{e.lineWidth=3,e.strokeStyle="rgba(22,18,16,0.9)",e.strokeText(t,s,n),e.fillStyle="#d8c8b8",e.fillText(t,s,n)};for(let t of(e.font="600 10px ui-sans-serif, system-ui, sans-serif",e.textAlign="left",e.textBaseline="middle",e.strokeStyle="rgba(203,213,225,0.35)",e.lineWidth=1,e.beginPath(),e.moveTo(a,l),e.lineTo(a,l-r),e.stroke(),[0,r/2,r]))e.beginPath(),e.moveTo(a-3,l-t),e.lineTo(a+3,l-t),e.stroke();i("up",a+6,l),i("horizon",a+6,l-r/2),i("down",a+6,l-r+2)}(n,e,s,a)},[e,s,a]),(0,t.jsx)("canvas",{ref:i,className:l,style:{width:a,height:a,...r},"aria-label":"Camera view-direction heatmap: top-down polar plot where the center is looking up, the middle ring is the horizon, and the rim is looking down; color shows how often each direction was viewed."})}let ev={background:"rgba(32,25,19,0.6)",borderRadius:8,padding:12},ew={fontSize:11,textTransform:"uppercase",letterSpacing:"0.04em",color:"#a8917c"},ej={marginTop:4,fontSize:24,fontWeight:600,color:"#f4eadf",fontVariantNumeric:"tabular-nums"};function ey({label:e,value:s}){return(0,t.jsxs)("div",{style:ev,children:[(0,t.jsx)("div",{style:ew,children:e}),(0,t.jsx)("div",{style:ej,children:s})]})}function eN({perf:e}){return e&&0!==e.samples?(0,t.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:12},children:[(0,t.jsx)(ey,{label:"Samples",value:f(e.samples)}),(0,t.jsx)(ey,{label:"Avg FPS",value:f(e.avg_fps,1)}),(0,t.jsx)(ey,{label:"p50 FPS",value:f(e.p50_fps,1)}),(0,t.jsx)(ey,{label:"Min FPS",value:f(e.min_fps,1)})]}):(0,t.jsx)("p",{style:ex,children:"No performance samples in range."})}function ek({bins:e,gridSize:s}){return(0,t.jsx)("div",{className:"flex justify-center",children:(0,t.jsx)(ef,{bins:e,gridSize:s,className:"rounded-lg border border-edge"})})}function eM({meshes:e}){let s=e.reduce((e,t)=>Math.max(e,t.count),0);return 0===e.length?(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"No mesh interactions in range."}):(0,t.jsx)("ul",{className:"space-y-1.5",children:e.map(e=>(0,t.jsxs)("li",{className:"text-sm",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("span",{className:"truncate font-mono text-xs text-fg",children:e.mesh}),(0,t.jsx)("span",{className:"tabular-nums text-fg-muted",children:f(e.count)})]}),(0,t.jsx)("div",{className:"mt-1 h-1.5 w-full overflow-hidden rounded bg-ink/60",children:(0,t.jsx)("div",{className:"h-full rounded bg-amber",style:{width:`${s>0?e.count/s*100:0}%`}})})]},e.mesh))})}var eS=e.i(38413);function ez(e){return"session"===e.surface&&e.sessionId?{...e.params,session:e.sessionId}:e.params}async function eC(e){let t=e.params.scene;if(!t){let s=await e.api.scenes(e.params).catch(()=>[]);1===s.length&&(t=s[0]?.scene_id)}if(!t)return[];let s=await e.api.sceneRepresentation(t).catch(()=>null);return s?.proxy?.meshes??[]}let eP=[{id:"top-meshes",title:"Top meshes",subtitle:"Most-interacted meshes",span:1,surfaces:["overview","session"],load:e=>e.api.topMeshes({...ez(e),source:void 0,scene:void 0,limit:25}),render:({data:e})=>(0,t.jsx)(eM,{meshes:e??[]})},{id:"mesh-leaderboard",title:"Part-popularity leaderboard",subtitle:"Ranked meshes, with trend and input split",help:"The most-interacted meshes ranked by total active interactions (clicks / hovers / picks / drags — passive gaze is excluded), each with a trend sparkline (rising/falling over the range) and an input-source split (mouse / touch / XR / …). Expand a row to see which sources drove it. Unlike the plain Top-meshes list, gaze-only hits don't inflate the ranking.",span:1,surfaces:["overview","session"],load:async e=>{let[t,s]=await Promise.all([e.api.topMeshesBySource({...ez(e),source:void 0,limit:400}),e.api.topMeshesTrend({...ez(e),source:void 0,interval:function(e){let{since:t,until:s}=e.params;return null==t||null==s||s<=t?3600:m(s-t,24)}(e),limit:2e3})]);return{sources:t,trend:s}},render:({data:e})=>(0,t.jsx)(L,{sources:e.sources??[],trend:e.trend??[]})},{id:"pointer-heatmap",title:"Pointer heatmap",subtitle:"Normalized screen positions",span:1,surfaces:["overview","session"],clientOnly:!0,load:e=>e.api.pointerHeatmap({...ez(e),bins:50}),render:({data:e})=>(0,t.jsx)(ek,{bins:e??[],gridSize:50})},{id:"camera-dome-3d",title:"View-direction dome (3D)",subtitle:"Where the audience looked, mapped onto a sphere — drag to orbit, +/- to zoom, double-click to focus",span:2,surfaces:["overview","session"],clientOnly:!0,load:e=>e.api.cameraHeatmap({...ez(e),source:void 0,bins:36}),render:({data:e})=>(0,t.jsx)(C,{bins:e??[],gridSize:36})},{id:"floor-plan",title:"Floor-plan heatmap",subtitle:"Where visitors stand (top-down, first-person)",help:"Camera positions binned on the ground plane — the first-person counterpart of the pointer heatmap. Filter to the first-person camera mode to isolate walkable sessions.",span:1,surfaces:["overview","session"],clientOnly:!0,enabled:e=>"viewer"!==e.filters.cameraMode,load:e=>e.api.cameraPositionHeatmap({...ez(e),cellSize:1}),render:({data:e})=>(0,t.jsx)(P,{bins:e??[],cellSize:1})},{id:"desire-lines",title:"Desire lines",subtitle:"The routes visitors actually walk",help:"Every session's camera path, binned onto the ground plane and overlaid as a faint poly-line. Where many visitors walk the same way the lines pile up into bright 'desire lines' — the routes people take vs. the ones the scene intended. Filter to the first-person camera mode to isolate walkable sessions.",span:1,surfaces:["overview"],clientOnly:!0,enabled:e=>"viewer"!==e.filters.cameraMode,load:e=>e.api.aggregatePaths({...ez(e),cellSize:1}),render:({data:e})=>(0,t.jsx)(_,{points:e??[]})},{id:"mesh-interaction-kinds",title:"Interaction kinds",subtitle:"How visitors act on each mesh",help:"Per-mesh breakdown of interaction kinds (hover, pick, click, drag, …) from mesh_interaction events. The dwell ranking says which objects draw attention; this says how people act on them — a hovered-but-never-picked mesh reads very differently from a dragged one.",span:1,surfaces:["overview","session"],load:e=>e.api.meshKinds({...ez(e),limit:200}),render:({data:e})=>(0,t.jsx)(R,{rows:e??[]})},{id:"input-modality-split",title:"Input-modality split",subtitle:"Keyboard / gamepad / touch / XR — and top shortcuts",help:"How visitors drive the experience: the share of interactions per input source (mouse / touch / keyboard / gamepad / XR), from the input-source breakdown (ADR 0011), paired with the most-used app-level shortcuts/actions from input_action events (ADR 0023).",span:1,surfaces:["overview","session"],load:async e=>{let[t,s]=await Promise.all([e.api.interactionsBySource({...ez(e),source:void 0,limit:100}),e.api.topInputActions({...ez(e),source:void 0,limit:50})]);return{sources:t,actions:s}},render:({data:e})=>(0,t.jsx)(O,{sources:e.sources??[],actions:e.actions??[]})},{id:"render-scale-truth",title:"Render-scale truth",subtitle:"Is that FPS real, or downscaled?",help:"Adaptive renderers keep frame rate up by quietly dropping resolution. This pairs the FPS headline with the render scale that bought it, and flags the 'good FPS at a low render scale' case where the headline overstates the real device experience.",span:1,surfaces:["overview","session"],load:e=>e.api.renderScale(ez(e)),render:({data:e})=>(0,t.jsx)(Z,{data:e})},{id:"perf-distribution",title:"Performance distribution",subtitle:"p05 / p50 / p95 FPS bands, not just the average",help:"The shape of rendering performance, not a single average: p05 (worst), p50 (typical) and p95 (best) FPS computed per-session then aggregated (ADR 0028 §1), plus a histogram of per-session median FPS. One session contributes one data point, so a few chatty sessions can't skew the curve.",span:1,surfaces:["overview","session"],load:async e=>{let[t,s]=await Promise.all([e.api.perfDistribution(ez(e)),e.api.fpsHistogram(ez(e))]);return{distribution:t,histogram:s}},render:({data:e})=>(0,t.jsx)(G,{distribution:e.distribution,histogram:e.histogram??[]})},{id:"world-heatmap-3d",title:eS.WORLD_HEATMAP_TITLE,subtitle:eS.WORLD_HEATMAP_SUBTITLE,span:2,surfaces:["overview","session"],clientOnly:!0,load:async e=>{let[t,s]=await Promise.all([e.api.worldHeatmap({...ez(e),cellSize:.5}),eC(e)]);return{voxels:t,proxyMeshes:s}},render:({data:e})=>(0,t.jsx)(eS.WorldHeatmap3DView,{voxels:e.voxels,cellSize:.5,proxyMeshes:e.proxyMeshes})},{id:"navigation-mix",title:"Navigation-style mix",subtitle:"Orbit / pan / dolly / zoom / roll / fly share + avg gesture duration",span:1,surfaces:["overview","session"],load:e=>e.api.cameraGestures({...ez(e),source:void 0}),render:({data:e})=>(0,t.jsx)(em,{stats:e??[]})},{id:"dead-zone-report",title:"Dead-zone report",subtitle:"Scene parts visitors never approach",help:"The negative space: registered proxy meshes (ADR 0014) with near-zero camera proximity, computed by subtracting the occupied camera-position voxels (scene coverage) from the scene's proxy geometry. Ranked coldest first. Requires a registered scene proxy to know which regions could be visited.",span:1,surfaces:["overview","session"],load:async e=>{let[t,s]=await Promise.all([e.api.coverage({...ez(e),cellSize:1}),eC(e)]);return{coverage:t,proxyMeshes:s}},render:({data:e})=>(0,t.jsx)(U,{coverage:e.coverage??[],proxyMeshes:e.proxyMeshes??[],cellSize:1})},{id:"flow-sankey-3d",title:"Flow Sankey (3D)",subtitle:"Direction-bin → mesh links (aggregate), or standpoint → gaze → mesh (two-stage) — double-click to focus",help:es,span:2,surfaces:["overview","session"],clientOnly:!0,load:async e=>{let t={...ez(e),cameraMode:void 0},[s,n]=await Promise.all([e.api.flowHeatmap({...t,bins:36,limit:400,groupByOrigin:!0}),eC(e)]);return{links:s,proxyMeshes:n,flowQuery:t}},render:({data:e,ctx:s})=>(0,t.jsx)(et,{links:e.links,gridSize:36,proxyMeshes:e.proxyMeshes,maxLinks:80,baseUrl:s.baseUrl,apiKey:s.apiKey,flowQuery:e.flowQuery,hasFirstPerson:s.capabilities.hasFirstPerson})},{id:"gaze-click-divergence-3d",title:"Gaze vs. click divergence",subtitle:"Where viewers look (gaze) vs. where they act (clicks), voxel-binned in world space — double-click to focus",span:2,surfaces:["overview","session"],clientOnly:!0,load:async e=>{let[t,s,n]=await Promise.all([e.api.gazeHeatmap({...ez(e),source:void 0,cellSize:.5}),e.api.worldHeatmap({...ez(e),cellSize:.5}),eC(e)]);return{gaze:t,click:s,proxyMeshes:n}},render:({data:e})=>(0,t.jsx)(eo,{gazeVoxels:e.gaze,clickVoxels:e.click,cellSize:.5,proxyMeshes:e.proxyMeshes})}];function e_({bins:e,gridSize:s}){return(0,t.jsx)(v.Panel,{title:"View-direction heatmap",subtitle:"Top-down sphere — center = looking up, rim = looking down",help:(0,t.jsxs)(t.Fragment,{children:["A flattened top-down view of where the camera pointed."," ",(0,t.jsx)("strong",{children:"Distance from the center"})," is the up/down tilt: the ",(0,t.jsx)("strong",{children:"center"})," ","is looking straight up, the ",(0,t.jsx)("strong",{children:"middle ring"})," is the horizon (level), and the"," ",(0,t.jsx)("strong",{children:"outer rim"})," is looking straight down. The"," ",(0,t.jsx)("strong",{children:"angle around the disc"})," is the facing (azimuth) direction. Color shows how often each direction was viewed, normalized to the most-viewed direction in range."]}),children:(0,t.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,t.jsx)(eb,{bins:e,gridSize:s,className:"rounded-lg border border-edge"}),e.length>0?(0,t.jsxs)("div",{className:"flex items-center gap-2 text-[10px] text-fg-muted",children:[(0,t.jsx)("span",{className:"font-medium text-fg",children:"View density"}),(0,t.jsx)("span",{children:"rarely"}),(0,t.jsx)("span",{className:"h-2 w-28 rounded-sm",style:{background:p.HEAT_GRADIENT}}),(0,t.jsx)("span",{children:"most-viewed"})]}):null]})})}function e$(e){return null==e?"":new Date(e-6e4*new Date(e).getTimezoneOffset()).toISOString().slice(0,16)}function eI(e){if(!e)return;let t=new Date(e).getTime();return Number.isNaN(t)?void 0:t}function eR({filters:e,scenes:s,onChange:n,busy:a}){let l=t=>n({...e,...t});return(0,t.jsxs)("section",{className:"mb-6 flex flex-wrap items-end gap-x-4 gap-y-3 rounded-xl border border-edge bg-panel p-4",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("span",{className:"text-xs text-fg-muted",children:"Time window"}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-1",role:"group","aria-label":"Time window",children:[i.map(s=>{let n=e.window===s.id;return(0,t.jsx)("button",{type:"button",onClick:()=>l({window:s.id}),className:`rounded-md border px-2.5 py-1.5 text-xs transition ${n?"border-amber bg-amber/10 text-saffron":"border-edge text-fg hover:border-amber/60 hover:text-fg-hi"}`,children:s.label},s.id)}),(0,t.jsx)("button",{type:"button",onClick:()=>l({window:"custom",since:e.since??Date.now()-864e5,until:e.until??Date.now()}),className:`rounded-md border px-2.5 py-1.5 text-xs transition ${"custom"===e.window?"border-amber bg-amber/10 text-saffron":"border-edge text-fg hover:border-amber/60 hover:text-fg-hi"}`,children:"Custom"})]})]}),"custom"===e.window?(0,t.jsxs)("div",{className:"flex items-end gap-2",children:[(0,t.jsxs)("label",{className:"flex flex-col gap-1 text-xs text-fg-muted",children:["From",(0,t.jsx)("input",{type:"datetime-local",value:e$(e.since),onChange:e=>l({since:eI(e.target.value)}),className:"rounded-md border border-edge bg-ink px-2 py-1.5 text-xs text-fg outline-none focus:border-saffron"})]}),(0,t.jsxs)("label",{className:"flex flex-col gap-1 text-xs text-fg-muted",children:["To",(0,t.jsx)("input",{type:"datetime-local",value:e$(e.until),onChange:e=>l({until:eI(e.target.value)}),className:"rounded-md border border-edge bg-ink px-2 py-1.5 text-xs text-fg outline-none focus:border-saffron"})]})]}):null,(0,t.jsxs)("label",{className:"flex flex-col gap-1 text-xs text-fg-muted",children:["Scene",(0,t.jsxs)("select",{value:e.scene??"",onChange:e=>l({scene:e.target.value||void 0}),className:"min-w-40 rounded-md border border-edge bg-ink px-2 py-1.5 text-xs text-fg outline-none focus:border-saffron",children:[(0,t.jsx)("option",{value:"",children:"All scenes"}),s.map(e=>(0,t.jsxs)("option",{value:e.scene_id,children:[e.scene_id," (",e.events.toLocaleString(),")"]},e.scene_id))]})]}),(0,t.jsxs)("label",{className:"flex flex-col gap-1 text-xs text-fg-muted",children:["Input source",(0,t.jsxs)("select",{value:e.source??"",onChange:e=>l({source:e.target.value||void 0}),className:"min-w-36 rounded-md border border-edge bg-ink px-2 py-1.5 text-xs text-fg outline-none focus:border-saffron",children:[(0,t.jsx)("option",{value:"",children:"All sources"}),x.map(e=>(0,t.jsx)("option",{value:e,children:h(e)},e))]})]}),(0,t.jsxs)("label",{className:"flex flex-col gap-1 text-xs text-fg-muted",children:["Camera mode",(0,t.jsxs)("select",{value:e.cameraMode??"",onChange:e=>l({cameraMode:e.target.value||void 0}),className:"min-w-36 rounded-md border border-edge bg-ink px-2 py-1.5 text-xs text-fg outline-none focus:border-saffron",children:[(0,t.jsx)("option",{value:"",children:"All cameras"}),(0,t.jsx)("option",{value:"viewer",children:"Viewer (orbit)"}),(0,t.jsx)("option",{value:"first-person",children:"First-person (walk)"})]})]}),(0,t.jsx)("span",{className:`ml-auto text-xs ${a?"text-saffron":"text-fg-muted"}`,"aria-live":"polite",children:a?"Refreshing…":"Up to date"})]})}function eA({rows:e}){let s=function(e){let t=new Map;for(let s of e){let e=t.get(s.source);e||(e={source:s.source,total:0,sessions:0,byType:[]},t.set(s.source,e)),e.total+=s.count,e.sessions=Math.max(e.sessions,s.sessions),e.byType.push({event_type:s.event_type,count:s.count})}for(let e of t.values())e.byType.sort((e,t)=>t.count-e.count);return[...t.values()].sort((e,t)=>t.total-e.total)}(e),n=s.reduce((e,t)=>Math.max(e,t.total),0);return(0,t.jsx)(v.Panel,{title:"Input sources",subtitle:"Interactions by input source",children:0===s.length?(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"No source-bearing interactions in range."}):(0,t.jsx)("ul",{className:"space-y-3",children:s.map(e=>(0,t.jsxs)("li",{className:"text-sm",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("span",{className:"font-medium text-fg",children:h(e.source)}),(0,t.jsxs)("span",{className:"tabular-nums text-fg-muted",children:[f(e.total),(0,t.jsxs)("span",{className:"ml-1 text-xs text-fg-muted",children:["· ",f(e.sessions)," ",1===e.sessions?"session":"sessions"]})]})]}),(0,t.jsx)("div",{className:"mt-1 h-1.5 w-full overflow-hidden rounded bg-ink/60",children:(0,t.jsx)("div",{className:"h-full rounded bg-amber",style:{width:`${n>0?e.total/n*100:0}%`}})}),(0,t.jsx)("div",{className:"mt-1.5 flex flex-wrap gap-1.5",children:e.byType.map(e=>{let s;return(0,t.jsxs)("span",{className:"rounded bg-ink/60 px-1.5 py-0.5 font-mono text-[11px] text-fg-muted",children:[(s=e.event_type.replace(/_/g," ")).charAt(0).toUpperCase()+s.slice(1)," ",f(e.count)]},e.event_type)})})]},e.source))})})}function eE({perf:e}){return(0,t.jsx)(v.Panel,{title:"Rendering performance",subtitle:"frame_perf samples",children:(0,t.jsx)(eN,{perf:e})})}function eT({label:e,value:s,unit:n}){return(0,t.jsxs)("div",{className:"rounded-lg bg-ink/60 p-3",children:[(0,t.jsx)("div",{className:"text-xs uppercase tracking-wide text-fg-muted",children:e}),(0,t.jsxs)("div",{className:"mt-1 text-2xl font-semibold tabular-nums text-fg-hi",children:[s,n?(0,t.jsx)("span",{className:"ml-1 text-sm font-normal text-fg-muted",children:n}):null]})]})}function eF(e){return f(e/1048576,1)}function eL({bins:e}){if(0===e.length)return(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"No FPS samples in range."});let s=[...e].sort((e,t)=>e.bucket-t.bucket),n=s.reduce((e,t)=>Math.max(e,t.sessions),0)||1,a=s.length>1?s[1].bucket-s[0].bucket:10;return(0,t.jsx)("div",{className:"space-y-1.5",children:s.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsxs)("span",{className:"w-16 shrink-0 text-right tabular-nums text-fg-muted",children:[e.bucket,"–",e.bucket+a]}),(0,t.jsx)("div",{className:"h-4 flex-1 overflow-hidden rounded bg-ink/60",children:(0,t.jsx)("div",{className:"h-full rounded bg-emerald-500/70",style:{width:`${e.sessions/n*100}%`}})}),(0,t.jsx)("span",{className:"w-10 shrink-0 tabular-nums text-fg-muted",children:e.sessions})]},e.bucket))})}function eB({data:e}){let{distribution:s,histogram:n,frameTime:a,jank:l,byDevice:r,byScene:i,resources:o,stability:c}=e,d=(s?.samples??0)>0;return(0,t.jsxs)("section",{className:"space-y-4",children:[(0,t.jsx)("h2",{className:"text-sm font-semibold uppercase tracking-wide text-fg-muted",children:"Performance"}),(0,t.jsx)(v.Panel,{title:"FPS distribution",subtitle:"per-session p05 / p50 / p95, summarized across sessions",children:d?(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[(0,t.jsx)(eT,{label:"p05 FPS (worst)",value:f(s.p05_fps,1)}),(0,t.jsx)(eT,{label:"p50 FPS (typical)",value:f(s.p50_fps,1)}),(0,t.jsx)(eT,{label:"p95 FPS (best)",value:f(s.p95_fps,1)}),(0,t.jsx)(eT,{label:"Sessions",value:f(s.sessions)})]}),(0,t.jsx)(eL,{bins:n})]}):(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"No performance samples in range."})}),(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2",children:[(0,t.jsx)(v.Panel,{title:"Frame time",subtitle:"per-session median & worst-window p95",children:a&&0!==a.sessions?(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsx)(eT,{label:"p50 frame time",value:f(a.p50_ms,1),unit:"ms"}),(0,t.jsx)(eT,{label:"p95 frame time",value:f(a.p95_ms,1),unit:"ms"})]}):(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"No frame-time samples in range."})}),(0,t.jsx)(v.Panel,{title:"Jank",subtitle:"long frames per sample window",children:l&&0!==l.sessions?(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsx)(eT,{label:"Median session",value:f(l.median_rate,2)}),(0,t.jsx)(eT,{label:"Worst decile",value:f(l.worst_decile_rate,2)})]}):(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"No jank data in range."})})]}),(0,t.jsx)(v.Panel,{title:"FPS by device",subtitle:"per-session median FPS, attributed to session_start.device",children:0===r.length?(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"No device data in range."}):(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"w-full text-left text-sm",children:[(0,t.jsx)("thead",{className:"text-xs uppercase tracking-wide text-fg-muted",children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{className:"py-1 pr-4 font-medium",children:"Backend"}),(0,t.jsx)("th",{className:"py-1 pr-4 font-medium",children:"Mobile"}),(0,t.jsx)("th",{className:"py-1 pr-4 font-medium",children:"GPU"}),(0,t.jsx)("th",{className:"py-1 pr-4 text-right font-medium",children:"Sessions"}),(0,t.jsx)("th",{className:"py-1 text-right font-medium",children:"p50 FPS"})]})}),(0,t.jsx)("tbody",{className:"text-fg",children:r.map((e,s)=>(0,t.jsxs)("tr",{className:"border-t border-ink/60",children:[(0,t.jsx)("td",{className:"py-1 pr-4",children:e.engine||"—"}),(0,t.jsx)("td",{className:"py-1 pr-4",children:"true"===e.is_mobile?"yes":"no"}),(0,t.jsx)("td",{className:"py-1 pr-4 max-w-[16rem] truncate",title:e.renderer,children:e.renderer||"—"}),(0,t.jsx)("td",{className:"py-1 pr-4 text-right tabular-nums",children:f(e.sessions)}),(0,t.jsx)("td",{className:"py-1 text-right tabular-nums",children:f(e.p50_fps,1)})]},`${e.engine}|${e.is_mobile}|${e.renderer}|${s}`))})]})})}),(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2",children:[(0,t.jsx)(v.Panel,{title:"FPS by scene",subtitle:"per-session median FPS per scene",children:0===i.length?(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"No scene data in range."}):(0,t.jsxs)("table",{className:"w-full text-left text-sm",children:[(0,t.jsx)("thead",{className:"text-xs uppercase tracking-wide text-fg-muted",children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{className:"py-1 pr-4 font-medium",children:"Scene"}),(0,t.jsx)("th",{className:"py-1 pr-4 text-right font-medium",children:"Sessions"}),(0,t.jsx)("th",{className:"py-1 text-right font-medium",children:"p50 FPS"})]})}),(0,t.jsx)("tbody",{className:"text-fg",children:i.map(e=>(0,t.jsxs)("tr",{className:"border-t border-ink/60",children:[(0,t.jsx)("td",{className:"py-1 pr-4",children:e.scene_id||"—"}),(0,t.jsx)("td",{className:"py-1 pr-4 text-right tabular-nums",children:f(e.sessions)}),(0,t.jsx)("td",{className:"py-1 text-right tabular-nums",children:f(e.p50_fps,1)})]},e.scene_id))})]})}),(0,t.jsx)(v.Panel,{title:"Stability",subtitle:"hard failures frame_perf can't show",children:c?(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,t.jsx)(eT,{label:"Context losses",value:f(c.context_losses)}),(0,t.jsx)(eT,{label:"Compile stalls",value:f(c.compile_stalls)}),(0,t.jsx)(eT,{label:"Incidents",value:f(c.incidents)})]}):(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"No stability data in range."})})]}),(0,t.jsx)(v.Panel,{title:"Resource footprint",subtitle:"per-session p50 / p95 of what the scene asked of the device",children:o&&0!==o.sessions?(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:[(0,t.jsx)(eT,{label:"p50 JS heap",value:eF(o.p50_js_heap_bytes),unit:"MB"}),(0,t.jsx)(eT,{label:"p50 texture",value:eF(o.p50_texture_bytes),unit:"MB"}),(0,t.jsx)(eT,{label:"p50 triangles",value:f(o.p50_triangles)}),(0,t.jsx)(eT,{label:"p95 JS heap",value:eF(o.p95_js_heap_bytes),unit:"MB"}),(0,t.jsx)(eT,{label:"p95 texture",value:eF(o.p95_texture_bytes),unit:"MB"}),(0,t.jsx)(eT,{label:"p95 triangles",value:f(o.p95_triangles)})]}):(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"No resource samples in range."})})]})}function eD({label:e,value:s,tone:n="neutral",hint:a}){return(0,t.jsxs)("div",{className:"rounded-lg border border-edge bg-ink/40 px-3 py-2.5",children:[(0,t.jsx)("p",{className:"text-xs uppercase tracking-wide text-fg-muted",children:e}),(0,t.jsx)("p",{className:`mt-0.5 text-lg font-semibold tabular-nums ${"bad"===n?"text-red-300":"warn"===n?"text-amber-300":"good"===n?"text-emerald-300":"text-fg-hi"}`,children:s}),a?(0,t.jsx)("p",{className:"text-[11px] text-fg-muted",children:a}):null]})}function eO({counts:e,perf:s}){let n=new Map(e.map(e=>[e.event_type,e.count])),a=e=>n.get(e)??0,l=a("session_start"),r=a("runtime_error"),i=a("context_lost"),o=a("focus_change"),c=a("visibility_change"),d=a("viewport_resize"),u=e.reduce((e,t)=>e+t.count,0),m=l>0?r/l:0;return(0,t.jsx)(v.Panel,{title:"Scene health",subtitle:"Errors, GPU context loss & attention gaps in the selected window",children:u>0?(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3",children:[(0,t.jsx)(eD,{label:"Errors",value:f(r),tone:r>0?"bad":"good",hint:l>0?`${m.toFixed(2)} / session`:void 0}),(0,t.jsx)(eD,{label:"Context loss",value:f(i),tone:i>0?"warn":"good",hint:"GPU device lost"}),(0,t.jsx)(eD,{label:"Avg FPS",value:s&&s.samples>0?f(s.avg_fps,1):"—",tone:s&&s.samples>0?s.avg_fps>=50?"good":"warn":"neutral",hint:s&&s.samples>0?`min ${f(s.min_fps,0)}`:void 0}),(0,t.jsx)(eD,{label:"Sessions",value:f(l)}),(0,t.jsx)(eD,{label:"Attention",value:f(o+c),hint:"focus + visibility changes"}),(0,t.jsx)(eD,{label:"Resizes",value:f(d),hint:"viewport changes"})]}):(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"No events in range."})})}function eU({label:e,value:s,hint:n}){return(0,t.jsxs)("div",{className:"rounded-lg border border-edge bg-ink/40 px-3 py-2.5",children:[(0,t.jsx)("p",{className:"text-xs uppercase tracking-wide text-fg-muted",children:e}),(0,t.jsx)("p",{className:"mt-0.5 text-lg font-semibold tabular-nums text-fg-hi",children:s}),n?(0,t.jsx)("p",{className:"text-[11px] text-fg-muted",children:n}):null]})}function eW({buckets:e,bucketSize:s}){if(0===e.length)return(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"No camera samples in range."});let n=[...e].sort((e,t)=>e.bucket-t.bucket),a=n.reduce((e,t)=>Math.max(e,t.count),0)||1;return(0,t.jsx)("div",{className:"flex flex-col gap-1",children:n.map(e=>{let n=e.bucket*s;return(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("span",{className:"w-24 shrink-0 text-right font-mono text-[11px] text-fg-muted",children:[f(n,1),"–",f(n+s,1)]}),(0,t.jsx)("div",{className:"h-3.5 flex-1 overflow-hidden rounded-sm bg-ink/60",children:(0,t.jsx)("div",{className:"h-full rounded-sm bg-amber",style:{width:`${e.count/a*100}%`}})}),(0,t.jsx)("span",{className:"w-12 shrink-0 text-right font-mono text-[11px] text-fg-muted",children:f(e.count)})]},e.bucket)})})}function eH({coverage:e,cellSize:s,distance:n,bucketSize:a,navigation:l}){let r=e.length,i=e.reduce((e,t)=>e+t.count,0),o=l.reduce((e,t)=>e+t.total_distance,0),c=l.reduce((e,t)=>e+t.segments,0),d=l.reduce((e,t)=>e+t.active_segments,0),u=l.length,m=r>0||l.length>0;return(0,t.jsx)(v.Panel,{title:"Scene traversal",subtitle:"Coverage, camera distance & navigation effort — derived from camera_sample",collapsible:!0,defaultCollapsed:!0,children:m?(0,t.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:[(0,t.jsx)(eU,{label:"Visited cells",value:f(r),hint:`${f(s,2)} u voxels`}),(0,t.jsx)(eU,{label:"Camera samples",value:f(i)}),(0,t.jsx)(eU,{label:"Avg travel",value:f(u>0?o/u:0,1),hint:u>0?`over ${f(u)} sessions`:void 0}),(0,t.jsx)(eU,{label:"Active movement",value:`${f(100*(c>0?d/c:0),0)}%`,hint:"of camera segments"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"mb-1.5 text-xs uppercase tracking-wide text-fg-muted",children:"Camera distance distribution"}),(0,t.jsx)(eW,{buckets:n,bucketSize:a})]})]}):(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"No camera samples in range."})})}let eG={babylon:"Babylon.js","babylon-lite":"Babylon (lite)",three:"three.js",playcanvas:"PlayCanvas",r3f:"react-three-fiber",aframe:"A-Frame"};function eV({project:e,playgroundUrl:s,onView:a,onOpenOverlay:l}){var r;let i=e.scene,o=i?.engines.length?i.engines:[],[c,d]=(0,n.useState)(i?.defaultEngine??o[0]??""),u=s.length>0&&c.length>0;return(0,t.jsxs)("div",{className:"flex flex-col gap-3 rounded-xl border border-edge bg-panel p-4",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-fg-hi",children:i?.label??e.name}),(0,t.jsx)("p",{className:"text-xs text-fg-muted",children:e.name})]}),i?(0,t.jsx)("span",{className:"shrink-0 rounded-full border border-edge bg-ink/50 px-2 py-0.5 text-[11px] text-fg-muted",children:"first-person"===i.cameraMode?"first-person":"viewer"}):null]}),i?.description?(0,t.jsx)("p",{className:"text-xs leading-relaxed text-fg-muted",children:i.description}):(0,t.jsx)("p",{className:"text-xs leading-relaxed text-fg-muted",children:"A project without scene metadata — open its analytics directly."}),o.length>1?(0,t.jsxs)("label",{className:"flex flex-col gap-1 text-[11px] text-fg-muted",children:["Engine",(0,t.jsx)("select",{className:"rounded-md border border-edge bg-ink px-2 py-1.5 text-xs text-fg outline-none focus:border-saffron",value:c,onChange:e=>d(e.target.value),children:o.map(e=>(0,t.jsx)("option",{value:e,children:eG[e]??e},e))})]}):1===o.length?(0,t.jsxs)("p",{className:"text-[11px] text-fg-muted",children:["Engine: ",eG[r=o[0]]??r]}):null,(0,t.jsxs)("div",{className:"mt-auto flex flex-wrap gap-2 pt-1",children:[(0,t.jsx)("button",{type:"button",onClick:()=>a(e),className:"rounded-md bg-amber px-3 py-1.5 text-xs font-medium text-ink transition hover:bg-ember",children:"View analytics"}),i?(0,t.jsx)("button",{type:"button",disabled:!u,onClick:()=>l(e,c),className:"rounded-md border border-edge px-3 py-1.5 text-xs text-fg transition hover:border-amber hover:text-fg-hi disabled:opacity-40",children:"Open live scene"}):null]})]})}function eZ({projects:e,playgroundUrl:s,onView:a}){let[l,r]=(0,n.useState)(null),i=(0,n.useMemo)(()=>{let t=[],s=[],n=[];for(let a of e)a.scene?"first-person"===a.scene.cameraMode?s.push(a):t.push(a):n.push(a);return{viewer:t,firstPerson:s,other:n}},[e]),o=(e,t)=>{let n=e.scene;n&&s&&r({url:`${s.replace(/\/$/,"")}/?scene=${encodeURIComponent(n.id)}&engine=${encodeURIComponent(t)}`,title:`${n.label} \xb7 ${eG[t]??t}`})},c=(e,n)=>n.length>0?(0,t.jsxs)("section",{className:"flex flex-col gap-3",children:[(0,t.jsx)("h2",{className:"text-xs font-semibold uppercase tracking-wide text-fg-muted",children:e}),(0,t.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:n.map(e=>(0,t.jsx)(eV,{project:e,playgroundUrl:s,onView:a,onOpenOverlay:o},e.id))})]}):null;return(0,t.jsxs)(v.Panel,{title:"Scenes",subtitle:"Pick a scene to explore its analytics, or open it live to test capture.",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-6",children:[c("Viewer",i.viewer),c("First-person",i.firstPerson),c("Other projects",i.other)]}),l?(0,t.jsx)("div",{className:"fixed inset-0 z-50 flex flex-col bg-black/70 p-4 sm:p-8",role:"dialog","aria-modal":"true","aria-label":"Live scene overlay",children:(0,t.jsxs)("div",{className:"mx-auto flex h-full w-full max-w-6xl flex-col overflow-hidden rounded-xl border border-edge bg-panel",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3 border-b border-edge px-4 py-2.5",children:[(0,t.jsx)("p",{className:"text-sm text-fg",children:l.title}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("a",{href:l.url,target:"_blank",rel:"noreferrer",className:"rounded-md border border-edge px-3 py-1.5 text-xs text-fg transition hover:border-amber hover:text-fg-hi",children:"Open in new tab ↗"}),(0,t.jsx)("button",{type:"button",onClick:()=>r(null),className:"rounded-md border border-edge px-3 py-1.5 text-xs text-fg transition hover:border-amber hover:text-fg-hi",children:"Close ✕"})]})]}),(0,t.jsx)("iframe",{title:l.title,src:l.url,className:"h-full w-full flex-1 bg-ink"})]})}):null]})}function eK({sessions:e,onSelect:s,selectedId:n}){return(0,t.jsx)(v.Panel,{title:"Sessions",subtitle:s?`${e.length} most recent \xb7 select to drill in`:`${e.length} most recent`,children:(0,t.jsx)(eg,{sessions:e,onSelect:s,selectedId:n})})}function eX({baseUrl:e,apiKey:s,sessionId:a,scene:r}){let i=(0,n.useRef)(null),[o,c]=(0,n.useState)([]),[d,u]=(0,n.useState)("loading");return(0,n.useEffect)(()=>{let t=!1;return u("loading"),new l.CollectorApi(e,s).sessionTrajectory(a,{scene:r,limit:5e3}).then(e=>{t||(c(e),u("ready"))}).catch(()=>{t||(c([]),u("error"))}),()=>{t=!0}},[e,s,a,r]),(0,n.useEffect)(()=>{let e=i.current;if(!e)return;let t=e.getContext("2d");if(!t||(t.clearRect(0,0,360,360),t.fillStyle="#0b0e14",t.fillRect(0,0,360,360),0===o.length))return;let s=1/0,n=-1/0,a=1/0,l=-1/0;for(let e of o)e.x<s&&(s=e.x),e.x>n&&(n=e.x),e.z<a&&(a=e.z),e.z>l&&(l=e.z);let r=328/Math.max(n-s,l-a,.001),c=e=>[16+(e.x-s)*r,16+(l-e.z)*r];t.lineWidth=2,t.strokeStyle="#38bdf8",t.beginPath(),o.forEach((e,s)=>{let[n,a]=c(e);0===s?t.moveTo(n,a):t.lineTo(n,a)}),t.stroke();let d=o[0],u=o[o.length-1];if(d){let[e,s]=c(d);t.fillStyle="#22c55e",t.beginPath(),t.arc(e,s,5,0,2*Math.PI),t.fill()}if(u){let[e,s]=c(u);t.fillStyle="#ef4444",t.beginPath(),t.arc(e,s,5,0,2*Math.PI),t.fill()}},[o]),(0,t.jsxs)(v.Panel,{title:"Walked path",subtitle:"Camera trajectory (top-down)",help:"The ordered route this session's camera took across the X/Z ground plane — green is the start, red is the end. Meaningful for first-person (walkable) sessions.",children:[(0,t.jsx)("div",{className:"flex justify-center",children:(0,t.jsx)("canvas",{ref:i,width:360,height:360,className:"rounded-lg border border-edge","aria-label":"Session camera trajectory"})}),"loading"===d?(0,t.jsx)("p",{className:"mt-2 text-center text-xs text-fg-muted",children:"Loading trajectory…"}):"error"===d?(0,t.jsx)("p",{className:"mt-2 text-center text-xs text-red-400",children:"Failed to load trajectory."}):0===o.length?(0,t.jsx)("p",{className:"mt-2 text-center text-xs text-fg-muted",children:"No camera movement recorded for this session."}):null]})}function eq(e){return e>=36e5?`${Math.round(e/36e5)}h`:e>=6e4?`${Math.round(e/6e4)}m`:e>=1e3?`${Math.round(e/1e3)}s`:`${e}ms`}function eJ({buckets:e,intervalMs:s,onBrush:a,onClear:l,brushed:r}){let i=(0,n.useRef)(null),o=(0,n.useRef)(null),[c,d]=(0,n.useState)(640),u=(0,n.useRef)(null),[m,h]=(0,n.useState)(null);(0,n.useEffect)(()=>{let e=i.current;if(!e)return;let t=()=>d(Math.max(320,e.clientWidth));t();let s=new ResizeObserver(t);return s.observe(e),()=>s.disconnect()},[]);let x={x:40,y:14,w:Math.max(1,c-40-36),h:114},p=e.length>0?{start:e[0].bucket,end:e[e.length-1].bucket+s}:null,g=(0,n.useCallback)(e=>{if(!p)return 0;let t=(e-x.x)/x.w;return Math.round(p.start+Math.max(0,Math.min(1,t))*(p.end-p.start))},[p,x.x,x.w]);(0,n.useEffect)(()=>{let t=o.current;if(!t)return;let n=t.getContext("2d");if(!n)return;if(n.clearRect(0,0,c,150),n.fillStyle="#0b0e14",n.fillRect(0,0,c,150),0===e.length||!p){n.fillStyle="#64748b",n.font="12px system-ui, sans-serif",n.textAlign="center",n.fillText("No events in range",c/2,75);return}let a=e.reduce((e,t)=>Math.max(e,t.events),0)||1,l=p.end-p.start,r=Math.max(1,x.w/e.length*.8);for(let t of e){let e=x.x+(t.bucket-p.start)/l*x.w,s=t.events/a*x.h;n.fillStyle="rgba(56, 189, 248, 0.55)",n.fillRect(e,x.y+x.h-s,r,s)}if(n.font="10px system-ui, sans-serif",n.textBaseline="middle",n.fillStyle="rgba(56, 189, 248, 0.95)",n.textAlign="right",n.fillText(String(a),x.x-5,x.y+4),n.fillText("0",x.x-5,x.y+x.h),n.textBaseline="alphabetic",n.fillStyle="rgba(56, 189, 248, 0.7)",n.textAlign="left",n.fillText(`events / ${eq(s)}`,x.x,144),m){let e=Math.min(m.x0,m.x1),t=Math.max(m.x0,m.x1);n.fillStyle="rgba(56, 189, 248, 0.18)",n.fillRect(e,x.y,t-e,x.h),n.strokeStyle="rgba(56, 189, 248, 0.8)",n.lineWidth=1,n.strokeRect(e,x.y,t-e,x.h)}},[e,c,p,m,s,x.x,x.y,x.w,x.h]);let f=()=>{let e=u.current;if(u.current=null,h(null),!e||4>Math.abs(e.x1-e.x0))return;let t=g(Math.min(e.x0,e.x1)),s=g(Math.max(e.x0,e.x1));s>t&&a(t,s)};return(0,t.jsx)(v.Panel,{title:"Event volume over time",subtitle:`Bars: events per ${eq(s)} \xb7 drag to zoom the time window`,children:(0,t.jsxs)("div",{ref:i,className:"relative",children:[(0,t.jsx)("canvas",{ref:o,width:c,height:150,className:"w-full cursor-crosshair rounded-lg border border-edge",onMouseDown:e=>{let t=e.currentTarget.getBoundingClientRect(),s=e.clientX-t.left;u.current={x0:s,x1:s},h({x0:s,x1:s})},onMouseMove:e=>{if(!u.current)return;let t=e.currentTarget.getBoundingClientRect(),s={...u.current,x1:e.clientX-t.left};u.current=s,h(s)},onMouseUp:f,onMouseLeave:f,"aria-label":"Event volume time series"}),r&&l?(0,t.jsx)("button",{type:"button",onClick:l,className:"absolute right-2 top-2 rounded-md border border-edge bg-ink/80 px-2 py-1 text-xs text-fg transition hover:border-amber hover:text-fg-hi",children:"Clear zoom"}):null]})})}var eY=e.i(19761);function eQ({label:e,value:s}){return(0,t.jsxs)("div",{className:"flex items-baseline justify-between gap-3 py-0.5",children:[(0,t.jsx)("span",{className:"shrink-0 text-xs text-fg-muted",children:e}),(0,t.jsx)("span",{className:"min-w-0 truncate text-right font-mono text-xs text-fg",title:s,children:s})]})}function e0({title:e,rows:s}){return 0===s.length?null:(0,t.jsxs)("div",{className:"rounded-lg border border-edge bg-ink/40 p-3",children:[(0,t.jsx)("p",{className:"mb-1.5 text-[10px] font-semibold uppercase tracking-wide text-fg-muted",children:e}),s.map(([e,s])=>(0,t.jsx)(eQ,{label:e,value:s},e))]})}function e1(e){let t=[];for(let[s,n]of e){let e=null==n||""===n?null:Array.isArray(n)?n.join(" × "):"boolean"==typeof n?n?"yes":"no":"object"==typeof n?JSON.stringify(n):String(n);null!=e&&t.push([s,e])}return t}function e2({baseUrl:e,apiKey:s,sessionId:a,hiddenTypes:l,onToggleType:r,onSetAllHidden:i}){let o,c,d,[u,m]=(0,n.useState)([]),[h,x]=(0,n.useState)("loading"),[p,g]=(0,n.useState)(null),[f,b]=(0,n.useState)(new Set);(0,n.useEffect)(()=>{let t=!1;return x("loading"),g(null),m([]),b(new Set),(async()=>{try{let n=await (0,eY.fetchSessionEvents)({endpoint:e,apiKey:s,sessionId:a});if(t)return;m(n),x(0===n.length?"empty":"ready")}catch(e){if(t)return;x("error"),g(e instanceof Error?e.message:"Failed to load session data.")}})(),()=>{t=!0}},[e,s,a]);let{meta:w,byType:j,allTypes:y,sorted:N}=(0,n.useMemo)(()=>{let e=[...u].sort((e,t)=>e.ts-t.ts),t=new Map;for(let s of e)t.set(s.type,(t.get(s.type)??0)+1);let s=[...t.keys()].sort(),n=e[0];return{meta:{start:n,end:e[e.length-1],startEvent:e.find(e=>"session_start"===e.type)},byType:t,allTypes:s,sorted:e}},[u]);if("ready"!==h)return(0,t.jsx)(v.Panel,{title:"Session data",subtitle:"Metadata and captured event breakdown",children:(0,t.jsx)("p",{className:"py-6 text-center text-sm text-fg-muted",children:"loading"===h?"Loading session data…":"empty"===h?"No events captured for this session.":p??"Session data unavailable."})});let k=w.start,M=w.end,S=w.startEvent,z=k&&M?M.ts-k.ts:0,C=e=>e?new Date(e).toLocaleString():"—",P=k?.pageMeta,_=e1([["Project",k?.projectId],["Session",k?.sessionId],["Visitor",k?.visitorId],["SDK",k?.sdkVersion],["Scene ID",k?.sceneId],["URL",k?.url],["Started",C(k?.ts)],["Ended",C(M?.ts)],["Duration",(c=Math.floor((o=Math.round(z/1e3))/60),d=o%60,c>0?`${c}m ${d}s`:`${d}s`)],["Events",String(N.length)]]),$=P?e1([["Title",P.title],["Language",P.language],["Referrer",P.referrer],["Viewport",P.viewport],["Device pixel ratio",P.devicePixelRatio]]):[],I=S?.type==="session_start"?S.device:void 0,R=S?.type==="session_start"?S.graphics:void 0,A=S?.type==="session_start"?S.scene:void 0,E=S?.type==="session_start"?S.connector:void 0,T=S?.type==="session_start"?S.user:void 0,F=e1([["Engine",I?.engine],["Graphics API",R?.api],["Backend",R?.backend],["API version",R?.apiVersion],["Shading language",R?.shadingLanguage],["GPU vendor",I?.vendor],["GPU renderer",I?.renderer],["Max texture size",I?.maxTextureSize],["CPU cores",I?.hardwareConcurrency],["Device memory (GB)",I?.deviceMemoryGb],["Mobile",I?.isMobile]]),L=e1([["Connector",E?[E.name,E.version].filter(Boolean).join(" "):null],["Coordinate system",E?.coordinateSystem],["Description",A?.description],["Camera type",A?.cameraType],["Camera name",A?.cameraName],["Mesh count",A?.meshCount],["User id",T?.id],["User traits",T?.traits]]),B=y.every(e=>l.has(e));return(0,t.jsxs)(v.Panel,{title:"Session data",subtitle:"Metadata that was sent and a per-feature breakdown — toggle a type to show/hide it in the replay, expand to inspect raw payloads",help:(0,t.jsxs)(t.Fragment,{children:["Project-level metadata beyond the ",(0,t.jsx)("strong",{children:"Project ID"}),"isn't stored in the OSS collector (Phase 1) — everything here is derived from the session's own events. The"," ",(0,t.jsx)("strong",{children:"Device / graphics"})," and ",(0,t.jsx)("strong",{children:"Scene / connector"})," blocks come from the one-time ",(0,t.jsx)("code",{children:"session_start"})," event."]}),children:[(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[(0,t.jsx)(e0,{title:"Identity",rows:_}),(0,t.jsx)(e0,{title:"Page context",rows:$}),(0,t.jsx)(e0,{title:"Device / graphics",rows:F}),(0,t.jsx)(e0,{title:"Scene / connector",rows:L})]}),(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsxs)("div",{className:"mb-2 flex items-center justify-between",children:[(0,t.jsxs)("p",{className:"text-[10px] font-semibold uppercase tracking-wide text-fg-muted",children:["Captured features (",y.length," event types)"]}),(0,t.jsx)("button",{type:"button",onClick:()=>i(!B,y),className:"rounded-md border border-edge px-2 py-1 text-xs text-fg transition hover:border-amber hover:text-fg-hi",children:B?"Show all":"Hide all"})]}),(0,t.jsx)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-2 lg:grid-cols-3",children:y.map(e=>{let s=!l.has(e),n=f.has(e),a=N.filter(t=>t.type===e).slice(0,3);return(0,t.jsxs)("div",{className:`self-start rounded-lg border border-edge bg-ink/40 ${n?"sm:col-span-2 lg:col-span-3":""}`,children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 px-2.5 py-1.5",children:[(0,t.jsxs)("label",{className:"flex min-w-0 flex-1 cursor-pointer items-center gap-2",children:[(0,t.jsx)("input",{type:"checkbox",checked:s,onChange:()=>r(e),className:"accent-amber"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs text-fg",children:e})]}),(0,t.jsx)("span",{className:"tabular-nums text-xs text-fg-muted",children:j.get(e)}),(0,t.jsx)("button",{type:"button",onClick:()=>b(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s}),"aria-expanded":n?"true":"false",className:"rounded border border-edge px-1.5 py-0.5 text-[10px] text-fg-muted transition hover:border-amber hover:text-fg-hi",children:n?"Hide raw":"Raw"})]}),n?(0,t.jsxs)("pre",{className:"max-h-64 overflow-auto border-t border-edge bg-black/30 px-3 py-2 text-[10px] leading-relaxed text-fg",children:[a.map(e=>JSON.stringify(e,null,2)).join("\n\n"),(j.get(e)??0)>a.length?`
2
+
3
+ … ${(j.get(e)??0)-a.length} more`:""]}):null]},e)})})]})]})}function e5(e){return e.length>10?`${e.slice(0,8)}…`:e}function e3(e,t){let s=Math.max(0,Math.round((t-e)/1e3));if(s<60)return`${s}s ago`;let n=Math.floor(s/60);return n<60?`${n}m ago`:`${Math.floor(n/60)}h ago`}let e4={active:"bg-emerald-400",recent:"bg-amber-400",idle:"bg-fg-muted"},e6={idle:"offline",connecting:"connecting…",open:"live",reconnecting:"reconnecting…"};function e8({status:e,sessions:s}){let n="open"===e;return(0,t.jsxs)("span",{className:"inline-flex items-center gap-2 rounded-full border border-edge bg-ink px-3 py-1 text-xs",children:[(0,t.jsxs)("span",{className:"relative flex h-2 w-2",children:[n?(0,t.jsx)("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-emerald-400 opacity-75"}):null,(0,t.jsx)("span",{className:`relative inline-flex h-2 w-2 rounded-full ${n?"bg-emerald-400":"idle"===e?"bg-fg-muted":"bg-amber-400"}`})]}),(0,t.jsx)("span",{className:"font-medium text-fg",children:n?`${f(s)} live now`:e6[e]})]})}function e9({snapshot:e,status:s,feed:n,now:a,onSelectSession:l}){let r=e?.sessions??[],i=e?.activeSessions??0,o=e?.activeVisitors??0;return(0,t.jsxs)(v.Panel,{title:"Live now",subtitle:"Active sessions and a real-time event feed, updating in place.",help:(0,t.jsx)(t.Fragment,{children:"Sessions seen within the liveness window, streamed over SSE from the collector. The roster is intentionally non-identifying — no geo, user-agent, or visitor id. Click a session to follow it live."}),children:[(0,t.jsxs)("div",{className:"mb-3 flex flex-wrap items-center gap-4",children:[(0,t.jsx)(e8,{status:s,sessions:i}),(0,t.jsxs)("span",{className:"text-xs text-fg-muted",children:[(0,t.jsx)("span",{className:"font-semibold text-fg",children:f(o)})," visitor",1===o?"":"s"]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("p",{className:"mb-2 text-xs uppercase tracking-wide text-fg-muted",children:["Sessions (",r.length,")"]}),0===r.length?(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"open"===s?"No active sessions right now.":"Waiting for live data…"}):(0,t.jsx)("ul",{className:"flex max-h-64 flex-col gap-1 overflow-y-auto pr-1",children:r.map(e=>(0,t.jsx)("li",{children:l?(0,t.jsxs)("button",{type:"button",onClick:()=>l(e.sessionId),className:"flex w-full items-center gap-2 rounded-md border border-transparent px-2 py-1.5 text-left transition hover:border-edge hover:bg-ink",children:[(0,t.jsx)("span",{className:`h-2 w-2 flex-none rounded-full ${e4[e.activity]}`,"aria-hidden":"true"}),(0,t.jsx)("span",{className:"font-mono text-xs text-fg",children:e5(e.sessionId)}),(0,t.jsx)("span",{className:"truncate text-xs text-fg-muted",children:e.sceneId}),(0,t.jsx)("span",{className:"ml-auto flex-none text-xs text-fg-muted",children:e3(e.lastSeen,a)})]}):(0,t.jsxs)("div",{className:"flex w-full items-center gap-2 px-2 py-1.5",children:[(0,t.jsx)("span",{className:`h-2 w-2 flex-none rounded-full ${e4[e.activity]}`,"aria-hidden":"true"}),(0,t.jsx)("span",{className:"font-mono text-xs text-fg",children:e5(e.sessionId)}),(0,t.jsx)("span",{className:"truncate text-xs text-fg-muted",children:e.sceneId}),(0,t.jsx)("span",{className:"ml-auto flex-none text-xs text-fg-muted",children:e3(e.lastSeen,a)})]})},e.sessionId))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"mb-2 text-xs uppercase tracking-wide text-fg-muted",children:"Event feed"}),0===n.length?(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"open"===s?"Listening for events…":"Waiting for live data…"}):(0,t.jsx)("ul",{className:"flex max-h-64 flex-col gap-1 overflow-y-auto pr-1 font-mono text-xs",children:n.map((e,s)=>(0,t.jsxs)("li",{className:"flex items-center gap-2 rounded-md px-2 py-1",children:[(0,t.jsx)("span",{className:"flex-none rounded bg-amber/15 px-1.5 py-0.5 text-[11px] text-saffron",children:e.type}),(0,t.jsx)("span",{className:"text-fg-muted",children:e5(e.sessionId)}),(0,t.jsx)("span",{className:"ml-auto flex-none text-fg-muted",children:e3(e.ts,a)})]},`${e.sessionId}-${e.ts}-${s}`))})]})]})]})}let e7=(0,s.default)(()=>e.A(69091).then(e=>e.SessionReplay),{loadableGenerated:{modules:[12449]},ssr:!1}),te=(0,s.default)(()=>e.A(33996).then(e=>e.WorldHeatmap3D),{loadableGenerated:{modules:[25453]},ssr:!1}),tt=(0,s.default)(()=>e.A(56403).then(e=>e.ClickRays3D),{loadableGenerated:{modules:[61518]},ssr:!1}),ts={sessions:[],camera:[],perf:null,gaze:[],clickRays:[],hasFirstPerson:!1,proxyMeshes:[],timeseries:[],counts:[],coverage:[],distance:[],navigation:[],sources:[],floorPlan:[],performance:{distribution:null,histogram:[],frameTime:null,jank:null,byDevice:[],byScene:[],resources:null,stability:null},intervalMs:36e5};e.s(["default",0,function(){let[e,s]=(0,n.useState)(a.DEFAULT_COLLECTOR_URL),[i,o]=(0,n.useState)(a.DEFAULT_API_KEY),[u,h]=(0,n.useState)([]),[x,p]=(0,n.useState)(""),[g,f]=(0,n.useState)(r),[v,j]=(0,n.useState)([]),[y,N]=(0,n.useState)(ts),[k,M]=(0,n.useState)("idle"),[S,z]=(0,n.useState)(null),[C,P]=(0,n.useState)(null),[_,$]=(0,n.useState)("idle"),[I,R]=(0,n.useState)(new Set),[A,E]=(0,n.useState)([]),[T,F]=(0,n.useState)(()=>Date.now()),[L,B]=(0,n.useState)(0),D=(0,n.useRef)(new Set),O=(0,n.useRef)(g);O.current=g;let U=(0,n.useRef)(r.window),W=(0,n.useRef)(x);W.current=x;let H=(0,n.useRef)(C);H.current=C;let G=(0,n.useRef)(null),V=(0,n.useRef)(null),Z=(0,n.useRef)(!1),K=(0,n.useCallback)((e,t)=>{let s=`/projects/${encodeURIComponent(e)}`;return t?`${s}/session/${encodeURIComponent(t)}`:s},[]),X=(0,n.useCallback)(e=>{window.location.pathname!==e&&window.history.pushState({},"",e)},[]);(0,n.useEffect)(()=>{let e=window.location.pathname.match(/^\/projects\/([^/]+)(?:\/session\/([^/]+))?/);e?.[1]&&(G.current=decodeURIComponent(e[1]),e[2]&&(V.current=decodeURIComponent(e[2])))},[]),(0,n.useEffect)(()=>{a.COLLECTOR_URL_IS_PINNED||s(window.location.origin)},[]),(0,n.useEffect)(()=>{let e=!1;return fetch("/api/projects").then(e=>e.ok?e.json():[]).then(t=>{if(e||!Array.isArray(t)||0===t.length)return;h(t);let[s]=t,n=G.current,l=(n?t.find(e=>e.id===n):void 0)??t.find(e=>e.apiKey===a.DEFAULT_API_KEY)??s;l&&(p(l.id),o(l.apiKey),(n&&l.id===n||1===t.length&&!l.scene)&&(Z.current=!0))}).catch(()=>{}),()=>{e=!0}},[]);let q=(0,n.useCallback)(async t=>{let s=t??i;if(!s){M("error"),z("An API key is required.");return}M("loading"),z(null),P(null),$("idle");let n=O.current,a=d(n),r=c(n),o=new l.CollectorApi(e,s);try{let e=await o.sessions({...a,source:void 0,limit:100}),t=r.until??Date.now(),s=r.since;if(null==s){let n=e.reduce((e,t)=>{var s;let n=(s=t.started_at,new Date(s.includes("T")?s:s.replace(" ","T")+"Z").getTime());return Number.isFinite(n)?Math.min(e,n):e},Date.now());s=Number.isFinite(n)?n:t-864e5}let n=m(Math.max(6e4,t-s)),[l,i,c,d,u,h,x,p,g,f,b,v,w]=await Promise.all([o.cameraHeatmap({...a,source:void 0,bins:36}),o.perf({...a,source:void 0}),o.gazeHeatmap({...a,source:void 0,cellSize:.5}),o.clickRays({...a,cellSize:.5}),o.scenes({since:r.since,until:r.until,limit:200}),o.timeseries({since:r.since,until:r.until,scene:a.scene,interval:n}),o.eventCounts({since:r.since,until:r.until,scene:a.scene}),o.coverage({...a,source:void 0,cellSize:1}),o.cameraDistance({...a,source:void 0,bucketSize:1}),o.navigation({...a,source:void 0}),o.interactionsBySource(a),o.cameraPositionHeatmap({...a,source:void 0,cameraMode:"first-person",cellSize:1}),(async()=>{let[e,t,s,n,l,r,i,c]=await Promise.all([o.perfDistribution({...a,source:void 0}),o.fpsHistogram({...a,source:void 0}),o.frameTimePercentiles({...a,source:void 0}),o.jankRate({...a,source:void 0}),o.perfByDevice({...a,source:void 0}),o.perfByScene({...a,source:void 0,scene:void 0}),o.resourcePercentiles({...a,source:void 0}),o.stabilityCounts({...a,source:void 0})]);return{distribution:e,histogram:t,frameTime:s,jank:n,byDevice:l,byScene:r,resources:i,stability:c}})()]);j(u);let y=a.scene??(1===u.length?u[0]?.scene_id:void 0),k=y?(await o.sceneRepresentation(y).catch(()=>null))?.proxy?.meshes??[]:[];N({sessions:e,camera:l,perf:i,gaze:c,clickRays:d,hasFirstPerson:v.length>0,proxyMeshes:k,timeseries:h,counts:x,coverage:p,distance:g,navigation:f,sources:b,floorPlan:v,performance:w,intervalMs:1e3*n}),M("ready")}catch(e){N(ts),M("error"),z(e instanceof l.ApiError?`${e.status}: ${e.message}`:e instanceof Error?e.message:"Request failed.")}},[i,e]),J=(0,n.useCallback)(e=>{p(e.id),o(e.apiKey),X(K(e.id)),q(e.apiKey)},[q,K,X]);(0,n.useEffect)(()=>{if("idle"===k)return;let e=setTimeout(()=>void q(),300);return()=>clearTimeout(e)},[g]);let Y="idle"!==k&&!!i,Q=(0,n.useRef)(0),ee=(0,n.useRef)(!1);ee.current=null!=C;let et=(0,n.useCallback)(e=>{E(t=>[e,...t].slice(0,30)),D.current.forEach(t=>t(e));let t=Date.now();ee.current||t-Q.current<5e3||(Q.current=t,q(),B(e=>e+1))},[q]),{snapshot:es,status:en}=(0,b.useLivePresence)(e,i,Y);(0,b.useLiveStream)(e,i,Y,et),(0,n.useEffect)(()=>{if(!Y)return;let e=setInterval(()=>F(Date.now()),1e3);return()=>clearInterval(e)},[Y]);let ea=(0,n.useCallback)(async t=>{let s=d(O.current),n=new l.CollectorApi(e,i),[a,r,o]=await Promise.all([n.cameraHeatmap({...s,source:void 0,bins:36,session:t}),n.perf({...s,source:void 0,session:t}),n.sessionMeta(t).catch(()=>null)]);return{id:t,meta:o,camera:a,perf:r}},[e,i]),el=(0,n.useCallback)(async e=>{let t=W.current;t&&X(K(t,e)),window.scrollTo({top:0,behavior:"smooth"}),P({id:e,meta:null,camera:[],perf:null}),$("loading"),R(new Set);try{P(await ea(e)),$("ready")}catch(e){$("error"),z(e instanceof l.ApiError?`${e.status}: ${e.message}`:e instanceof Error?e.message:"Request failed.")}},[ea,K,X]),er=(0,n.useCallback)(()=>{let e=W.current;e&&X(K(e)),P(null),$("idle"),R(new Set)},[K,X]),ei=(0,n.useCallback)(e=>{let t=u.find(t=>t.id===e);p(e),t&&o(t.apiKey),N(ts),j([]),M("idle"),z(null),P(null),$("idle"),R(new Set)},[u]),eo=(0,n.useCallback)(e=>{R(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]),ec=(0,n.useCallback)((e,t)=>{R(e?new Set(t):new Set)},[]),ed=(0,n.useCallback)((e,t)=>{f(s=>("custom"!==s.window&&(U.current=s.window),{...s,window:"custom",since:e,until:t}))},[]),eu=(0,n.useCallback)(()=>{f(e=>({...e,window:U.current}))},[]);(0,n.useEffect)(()=>{Z.current&&i&&(Z.current=!1,q())},[u,i,q]),(0,n.useEffect)(()=>{if("ready"===k&&V.current){let e=V.current;V.current=null,el(e)}},[k,el]),(0,n.useEffect)(()=>{let e=()=>{let e=window.location.pathname.match(/^\/projects\/[^/]+(?:\/session\/([^/]+))?/),t=e?.[1]?decodeURIComponent(e[1]):null;t?H.current?.id!==t&&el(t):H.current&&er()};return window.addEventListener("popstate",e),()=>window.removeEventListener("popstate",e)},[el,er]);let em=(0,n.useMemo)(()=>new l.CollectorApi(e,i),[e,i]),eh=(0,n.useMemo)(()=>d(g),[g,L]),ex=(0,n.useCallback)(e=>{let t=D.current;return t.add(e),()=>{t.delete(e)}},[]),ep=(0,n.useMemo)(()=>({selectSession:e=>void el(e),setTimeRange:(e,t)=>ed(e,t),setFilters:e=>f(t=>({...t,...e}))}),[el,ed]),eg={api:em,baseUrl:e,apiKey:i,params:eh,filters:g,capabilities:{hasFirstPerson:y.hasFirstPerson},actions:ep,live:{presence:es,enabled:Y,subscribe:ex}},ef={...eg,surface:"overview"},eb=C?{...eg,surface:"session",sessionId:C.id}:null,ev=!!(C&&es?.sessions.some(e=>e.sessionId===C.id)),ew=(0,n.useRef)(ev);return(0,n.useEffect)(()=>{let e=ew.current;if(ew.current=ev,!e||ev)return;let t=H.current;if(!t||"ready"!==_)return;let s=t.id,n=!1;return(async()=>{try{let e=await ea(s);n||H.current?.id!==s||P(e)}catch{}})(),()=>{n=!0}},[ev,_,ea]),(0,n.useEffect)(()=>{if(!ev||"ready"!==_)return;let e=H.current?.id;if(!e)return;let t=!1,s=setInterval(()=>{(async()=>{try{let s=await ea(e);t||H.current?.id!==e||P(s)}catch{}})()},1e3);return()=>{t=!0,clearInterval(s)}},[ev,_,ea]),(0,t.jsxs)("main",{className:"mx-auto max-w-6xl px-6 py-8",children:[(0,t.jsxs)("header",{className:"mb-6 flex items-center gap-3",children:[(0,t.jsx)("img",{src:"/logo.svg",alt:"Uptimizr",width:36,height:36,className:"h-9 w-9 shrink-0"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"font-display text-2xl font-bold text-fg-hi",children:"Uptimizr"}),(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"Analytics for 3D scenes — open-source collector."})]})]}),(0,t.jsxs)("form",{className:"mb-6 flex flex-wrap items-end gap-3 rounded-xl border border-edge bg-panel p-4",onSubmit:e=>{e.preventDefault(),x&&X(K(x)),q()},children:[u.length>0?(0,t.jsxs)("label",{className:"flex flex-col gap-1 text-xs text-fg-muted",children:["Project",(0,t.jsx)("select",{className:"min-w-56 rounded-md border border-edge bg-ink px-3 py-2 text-sm text-fg outline-none focus:border-saffron",value:x,onChange:e=>ei(e.target.value),children:u.map(e=>(0,t.jsx)("option",{value:e.id,children:e.name},e.id))})]}):null,(0,t.jsxs)("label",{className:"flex flex-1 flex-col gap-1 text-xs text-fg-muted",children:["Collector URL",(0,t.jsx)("input",{className:"min-w-56 rounded-md border border-edge bg-ink px-3 py-2 text-sm text-fg outline-none focus:border-saffron",value:e,onChange:e=>s(e.target.value),placeholder:"http://localhost:4318"})]}),(0,t.jsxs)("label",{className:"flex flex-1 flex-col gap-1 text-xs text-fg-muted",children:["Project API key",(0,t.jsx)("input",{className:"min-w-56 rounded-md border border-edge bg-ink px-3 py-2 text-sm text-fg outline-none focus:border-saffron",value:i,onChange:e=>o(e.target.value),type:"password",placeholder:"utk_…"})]}),(0,t.jsx)("button",{type:"submit",disabled:"loading"===k,className:"rounded-md bg-amber px-4 py-2 text-sm font-medium text-ink transition hover:bg-ember disabled:opacity-50",children:"loading"===k?"Loading…":"Load"})]}),"idle"!==k?(0,t.jsx)(eR,{filters:g,scenes:v,onChange:f,busy:"loading"===k}):null,S?(0,t.jsx)("div",{className:"mb-6 rounded-lg border border-red-900/60 bg-red-950/40 px-4 py-3 text-sm text-red-300",children:S}):null,"idle"===k?u.length>0?(0,t.jsx)(eZ,{projects:u,playgroundUrl:a.DEFAULT_PLAYGROUND_URL,onView:J}):(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"Enter your collector URL and a project API key, then load to view analytics."}):C?(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-5 lg:grid-cols-2",children:[(0,t.jsxs)("div",{className:"lg:col-span-2 flex flex-wrap items-center justify-between gap-3 rounded-xl border border-edge bg-panel p-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-xs uppercase tracking-wide text-fg-muted",children:"Session"}),(0,t.jsx)("p",{className:"font-mono text-sm text-fg",children:C.id}),(0,t.jsx)("p",{className:"mt-1 text-xs text-fg-muted",children:"loading"===_?"Loading session…":[C.meta?.scene?.sceneId?`scene: ${C.meta.scene.sceneId}`:null,C.meta?.device?.gpu?`gpu: ${C.meta.device.gpu}`:null,C.meta?.startedAt?`started: ${C.meta.startedAt}`:null].filter(Boolean).join(" · ")||"No session metadata."})]}),(0,t.jsx)("button",{type:"button",onClick:er,className:"rounded-md border border-edge px-3 py-2 text-sm text-fg transition hover:border-amber hover:text-fg-hi",children:"← All sessions"})]}),(0,t.jsx)("div",{className:"lg:col-span-2",children:(0,t.jsx)(e7,{baseUrl:e,apiKey:i,sessionId:C.id,hiddenTypes:I,isLive:ev})}),(0,t.jsx)("div",{className:"lg:col-span-2",children:(0,t.jsx)(e2,{baseUrl:e,apiKey:i,sessionId:C.id,hiddenTypes:I,onToggleType:eo,onSetAllHidden:ec})}),(0,t.jsx)(eE,{perf:C.perf}),eb?(0,t.jsx)(w,{panels:eP,ctx:eb,surface:"session",revision:L}):null,(0,t.jsx)(e_,{bins:C.camera,gridSize:36}),C.meta?.scene?.cameraType==="free"?(0,t.jsx)(eX,{baseUrl:e,apiKey:i,sessionId:C.id,scene:C.meta?.scene?.sceneId??g.scene}):null,(0,t.jsx)("div",{className:"lg:col-span-2",children:(0,t.jsx)(eK,{sessions:y.sessions,selectedId:C.id,onSelect:el})})]}):(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-5 lg:grid-cols-2",children:[(0,t.jsx)("div",{className:"lg:col-span-2",children:(0,t.jsx)(e9,{snapshot:es,status:en,feed:A,now:T,onSelectSession:el})}),(0,t.jsx)("div",{className:"lg:col-span-2",children:(0,t.jsx)(eJ,{buckets:y.timeseries,intervalMs:y.intervalMs,onBrush:ed,brushed:"custom"===g.window,onClear:eu})}),(0,t.jsx)("div",{className:"lg:col-span-2",children:(0,t.jsx)(eO,{counts:y.counts,perf:y.perf})}),(0,t.jsx)("div",{className:"lg:col-span-2",children:(0,t.jsx)(eH,{coverage:y.coverage,cellSize:1,distance:y.distance,bucketSize:1,navigation:y.navigation})}),(0,t.jsx)(eE,{perf:y.perf}),(0,t.jsx)(w,{panels:eP,ctx:ef,surface:"overview",revision:L}),(0,t.jsx)("div",{className:"lg:col-span-2",children:(0,t.jsx)(eB,{data:y.performance})}),(0,t.jsx)(eA,{rows:y.sources}),(0,t.jsx)(e_,{bins:y.camera,gridSize:36}),(0,t.jsx)("div",{className:"lg:col-span-2",children:(0,t.jsx)(te,{voxels:y.gaze,cellSize:.5,proxyMeshes:y.proxyMeshes,title:"Gaze heatmap (3D)",subtitle:"Camera-pose gaze hit-points voxel-binned in world space — what viewers actually look at",legendTitle:"Gaze density",legendLow:"few looks",legendHigh:"most looks",legendNote:"Each marker is a voxel where the camera-forward (gaze) ray hit your scene. Enable gaze capture in the SDK to populate this.",emptyLabel:"No gaze hit-points in range. Enable gaze capture in the SDK."})}),(0,t.jsx)("div",{className:"lg:col-span-2",children:(0,t.jsx)(tt,{rays:y.clickRays,cellSize:.5,proxyMeshes:y.proxyMeshes})}),(0,t.jsx)("div",{className:"lg:col-span-2",children:(0,t.jsx)(eK,{sessions:y.sessions,onSelect:el})})]})]})}],14936)}]);