@uptimizr/dashboard 0.1.3 → 0.2.0
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.
- package/out/404.html +1 -1
- package/out/__next.__PAGE__.txt +4 -4
- package/out/__next._full.txt +11 -11
- package/out/__next._head.txt +4 -4
- package/out/__next._index.txt +4 -4
- package/out/__next._tree.txt +2 -2
- package/out/_next/static/chunks/002cjeoit6-up.js +1 -0
- package/out/_next/static/chunks/02n1uiltexy3w.js +1 -0
- package/out/_next/static/chunks/03ab2khhe8-x5.js +1 -0
- package/out/_next/static/chunks/04_yytpc2paxy.js +1 -0
- package/out/_next/static/chunks/06qot1qvlsqaz.js +1 -0
- package/out/_next/static/chunks/07eeopuufsqp-.js +1501 -0
- package/out/_next/static/chunks/08a5xek662n8n.js +1 -0
- package/out/_next/static/chunks/08wuc9--s8zn_.js +1 -0
- package/out/_next/static/chunks/09510356f0lad.js +1 -0
- package/out/_next/static/chunks/0_eu72k69lxj7.js +1 -0
- package/out/_next/static/chunks/0beajlqy8p8b5.js +1 -0
- package/out/_next/static/chunks/0c83pe1mpx456.js +1 -0
- package/out/_next/static/chunks/0echnagbkyx79.js +1198 -0
- package/out/_next/static/chunks/0eh1ml86u8dh7.js +1 -0
- package/out/_next/static/chunks/0fh-9h9ylxskr.js +674 -0
- package/out/_next/static/chunks/0fzmc1up21g1i.js +1 -0
- package/out/_next/static/chunks/0grlb9lo8e502.js +1 -0
- package/out/_next/static/chunks/0h22pg-0xrxnm.js +1 -0
- package/out/_next/static/chunks/0j6p1pmc14t96.js +1 -0
- package/out/_next/static/chunks/0j_6dx-sttgsy.js +1 -0
- package/out/_next/static/chunks/0j__xaq_8_di1.js +1 -0
- package/out/_next/static/chunks/0kfd-cvj5fvtz.js +1 -0
- package/out/_next/static/chunks/0o_mp98xzqfyf.js +1 -0
- package/out/_next/static/chunks/0otsec99kdkt7.js +213 -0
- package/out/_next/static/chunks/0ql-s-tsmel_u.js +151 -0
- package/out/_next/static/chunks/0r47gs_e93cka.js +1 -0
- package/out/_next/static/chunks/0sqys6o2pbe1q.js +1328 -0
- package/out/_next/static/chunks/0titqrn1qmcsv.js +1 -0
- package/out/_next/static/chunks/0tnlbw78tgaxp.js +4 -0
- package/out/_next/static/chunks/0tw4dyl-cp-hd.js +1 -0
- package/out/_next/static/chunks/0vbce-8omgurc.js +1 -0
- package/out/_next/static/chunks/0vfsg5byzep_0.js +1 -0
- package/out/_next/static/chunks/{0gv7mblzv3dl3.js → 0w8_1yjvol1f0.js} +20 -20
- package/out/_next/static/chunks/0xh144a5fz58h.js +1 -0
- package/out/_next/static/chunks/0xjltg_pph0c8.js +1 -0
- package/out/_next/static/chunks/0yeqgh0dnas8d.js +1 -0
- package/out/_next/static/chunks/101-7e_7up7rk.js +1 -0
- package/out/_next/static/chunks/128e51hj_04r0.js +1 -0
- package/out/_next/static/chunks/{10fnxpln_5xfd.js → 12kv810lohbsx.js} +2 -2
- package/out/_next/static/chunks/137xbvd4nd41j.js +3 -0
- package/out/_next/static/chunks/14bws-suyy5zu.js +1 -0
- package/out/_next/static/chunks/14ggsmqwej_tt.js +1656 -0
- package/out/_next/static/chunks/17genz6pkmty_.js +1 -0
- package/out/_next/static/chunks/17xd8hnazzr0g.js +1454 -0
- package/out/_next/static/chunks/18dczy9ylt2s_.js +1 -0
- package/out/_next/static/chunks/18xs_kvsaolb0.js +1 -0
- package/out/_next/static/chunks/19016f8-ry0z6.js +1 -0
- package/out/_next/static/chunks/1_6oejyxj39li.js +1 -0
- package/out/_next/static/chunks/1_aon8nz9p1fr.js +1 -0
- package/out/_next/static/chunks/1_qzlkuxukhpq.js +779 -0
- package/out/_next/static/chunks/1akaj5rhgitn3.js +1 -0
- package/out/_next/static/chunks/1bvl1ws7b_3gn.js +1 -0
- package/out/_next/static/chunks/1cdbk6kxyr1c9.js +1 -0
- package/out/_next/static/chunks/1fbjkk55uu4_g.js +1 -0
- package/out/_next/static/chunks/1furcfsgrw_3g.js +1 -0
- package/out/_next/static/chunks/1g0-f1g3gn_rs.js +1 -0
- package/out/_next/static/chunks/1g7emwu85bifo.js +557 -0
- package/out/_next/static/chunks/{37vzwr3ciejf1.js → 1gs-5722l4u59.js} +1 -1
- package/out/_next/static/chunks/1gt4kh0_xmigy.js +1 -0
- package/out/_next/static/chunks/1h8xzuuhhglu9.js +1 -0
- package/out/_next/static/chunks/1hatz-jlztrn0.js +1 -0
- package/out/_next/static/chunks/1iioifo7i0t0_.js +1 -0
- package/out/_next/static/chunks/{0impkpmxx3ttp.js → 1iiz7jqgj20z0.js} +1 -1
- package/out/_next/static/chunks/1kujmd5n0j9nk.js +1 -0
- package/out/_next/static/chunks/{2kazjq29jeamx.js → 1ltux4lwz7muf.js} +160 -372
- package/out/_next/static/chunks/1m_buecgcq67j.js +740 -0
- package/out/_next/static/chunks/1n9sy0yt5d2vq.js +1 -0
- package/out/_next/static/chunks/1p1gz6dseck--.js +1 -0
- package/out/_next/static/chunks/1p1xtsfwvpuqo.js +1 -0
- package/out/_next/static/chunks/1p8f6okk2ewbz.js +1 -0
- package/out/_next/static/chunks/1qg_etglhvp9h.js +740 -0
- package/out/_next/static/chunks/1th_t5ujeqlkf.js +1 -0
- package/out/_next/static/chunks/1thr-mdzbu96v.js +1 -0
- package/out/_next/static/chunks/1tta1a064979p.js +1 -0
- package/out/_next/static/chunks/1u_riwm0nfww7.js +1 -0
- package/out/_next/static/chunks/1ua15kzid0_8p.js +2560 -0
- package/out/_next/static/chunks/1uu-rt_8p1edp.js +2712 -0
- package/out/_next/static/chunks/1uu93wuxigx4k.js +1 -0
- package/out/_next/static/chunks/{1flb8adpj6_2o.js → 1xpwp4m1tqugp.js} +1 -1
- package/out/_next/static/chunks/1ynju1jqfrcv0.js +1 -0
- package/out/_next/static/chunks/1zfojlgb15okk.js +1 -0
- package/out/_next/static/chunks/1zj8x5wbgnzz-.js +1 -0
- package/out/_next/static/chunks/1zl6t15gh34nn.js +1 -0
- package/out/_next/static/chunks/{1thjncpj7u6pq.js → 223vrr_4sfhsj.js} +1 -1
- package/out/_next/static/chunks/22cr2b04btguf.js +1 -0
- package/out/_next/static/chunks/242xhzxxetctz.js +1 -0
- package/out/_next/static/chunks/24essz5mmvx-6.js +1 -0
- package/out/_next/static/chunks/256k1jw1m--l7.js +146 -0
- package/out/_next/static/chunks/259obyrpxcv6r.js +1 -0
- package/out/_next/static/chunks/26v9yqicofqba.js +1 -0
- package/out/_next/static/chunks/290d93hmm_e8b.js +1 -0
- package/out/_next/static/chunks/2_2fk7iddrs43.js +1 -0
- package/out/_next/static/chunks/{00k_j_r7bv_eb.js → 2bjlls8-qe05r.js} +9 -9
- package/out/_next/static/chunks/2ckd7f1wbfod-.js +1 -0
- package/out/_next/static/chunks/{163fa70v4mgxj.js → 2d6hru4qo23tt.js} +1 -1
- package/out/_next/static/chunks/2ejvntxtvf5o9.js +1 -0
- package/out/_next/static/chunks/2f7_3tzf7xhps.js +1 -0
- package/out/_next/static/chunks/2gxd_o1g89_bv.js +1 -0
- package/out/_next/static/chunks/2hd2txb4-m9k1.js +1 -0
- package/out/_next/static/chunks/2hpxou_cnp4f_.js +1 -0
- package/out/_next/static/chunks/2izioctrfc0s5.js +1 -0
- package/out/_next/static/chunks/2jhnk4h4n0udv.js +1 -0
- package/out/_next/static/chunks/2jpkhkk9zi8-f.js +1 -0
- package/out/_next/static/chunks/2kpet_l1kq2sx.js +1 -0
- package/out/_next/static/chunks/2mdbvf1b5h00_.css +3 -0
- package/out/_next/static/chunks/2nck5w4c7leb7.js +1 -0
- package/out/_next/static/chunks/2our10fwtj87e.js +1 -0
- package/out/_next/static/chunks/2qq3uzsbiicw3.js +1194 -0
- package/out/_next/static/chunks/2qqqpu0ahfdda.js +1 -0
- package/out/_next/static/chunks/2u-f7mmxvk8wj.js +1 -0
- package/out/_next/static/chunks/2ue1wo4ryk87z.js +1 -0
- package/out/_next/static/chunks/2uk-vwlxe9-xr.js +1 -0
- package/out/_next/static/chunks/2ur5-lxdvv1jm.js +1 -0
- package/out/_next/static/chunks/2veqsohwfhfqc.js +1 -0
- package/out/_next/static/chunks/2vqlv9wnewhu9.js +1 -0
- package/out/_next/static/chunks/{1zvc1tv--w8nn.js → 2wzshintp5lf8.js} +1 -1
- package/out/_next/static/chunks/2x-00glogc485.js +1 -0
- package/out/_next/static/chunks/2yfxy0f5fqs4o.js +1 -0
- package/out/_next/static/chunks/2z88mt3ixktu3.js +1 -0
- package/out/_next/static/chunks/2z_jn9ud28fk7.js +1 -0
- package/out/_next/static/chunks/3-eswqjobiqk1.js +1 -0
- package/out/_next/static/chunks/30-tbi7pys6fp.js +4 -0
- package/out/_next/static/chunks/30c-nsedy_ce0.js +1 -0
- package/out/_next/static/chunks/31u5lbu1vxznh.js +1 -0
- package/out/_next/static/chunks/{2feca0xcipcyt.js → 32ahba5ezp467.js} +156 -156
- package/out/_next/static/chunks/337hn35kts7ud.js +1 -0
- package/out/_next/static/chunks/33dgpebv-tf73.js +1 -0
- package/out/_next/static/chunks/36jkdhq6kb-cf.js +1 -0
- package/out/_next/static/chunks/37epa8fz59vba.js +1166 -0
- package/out/_next/static/chunks/3833xfnz0a-ub.js +1 -0
- package/out/_next/static/chunks/38awrh_qxn22k.js +1 -0
- package/out/_next/static/chunks/{0wrm9jr-9bw0e.js → 38x3c1ra5slhe.js} +383 -913
- package/out/_next/static/chunks/39idqlqlcp5b9.js +1 -0
- package/out/_next/static/chunks/{2a3spdq-m8drh.js → 3_gku1pwluoo0.js} +1 -1
- package/out/_next/static/chunks/3_mu-4rdjajna.js +1450 -0
- package/out/_next/static/chunks/3coacc4-g-g5c.js +1 -0
- package/out/_next/static/chunks/3e00fzdfkclzq.js +1 -0
- package/out/_next/static/chunks/3e8fmlq0k5wkg.js +1 -0
- package/out/_next/static/chunks/3e9tzyrt4_98z.js +1 -0
- package/out/_next/static/chunks/3edelqkq92pil.js +1 -0
- package/out/_next/static/chunks/3figbil1t4ssj.js +593 -0
- package/out/_next/static/chunks/3gimb3z_mteou.js +1 -0
- package/out/_next/static/chunks/{2p2vv6cc9i-3q.js → 3idaz_s77e-j_.js} +9 -9
- package/out/_next/static/chunks/3j-4wuhs5weba.js +1 -0
- package/out/_next/static/chunks/3jjfnwvybayy7.js +1 -0
- package/out/_next/static/chunks/3jwm5dfk_78gc.js +1 -0
- package/out/_next/static/chunks/3k9d4ylc3li2t.js +1352 -0
- package/out/_next/static/chunks/3l3_0ack3gy4k.js +1 -0
- package/out/_next/static/chunks/3lwhs5ja7tun3.js +1 -0
- package/out/_next/static/chunks/3m6nmp2dca6un.js +1342 -0
- package/out/_next/static/chunks/3mbnfpufs2-7e.js +7 -0
- package/out/_next/static/chunks/3mcd08gmt038z.js +1 -0
- package/out/_next/static/chunks/3mt5th7b1i_u9.js +1 -0
- package/out/_next/static/chunks/3ne77mjdz2y7o.js +1 -0
- package/out/_next/static/chunks/3puhrqtujktyv.js +1 -0
- package/out/_next/static/chunks/3rdifucupcgkg.js +1 -0
- package/out/_next/static/chunks/3riekaxl3uxfb.js +1195 -0
- package/out/_next/static/chunks/3sdoskq_buttj.js +1 -0
- package/out/_next/static/chunks/3tg-ma9tv9xu4.js +1 -0
- package/out/_next/static/chunks/3tm-pqpmq_ppw.js +1 -0
- package/out/_next/static/chunks/3w9go565cjhq3.js +1636 -0
- package/out/_next/static/chunks/3wi9gzq2mtr_q.js +8 -0
- package/out/_next/static/chunks/3xagd_2_9zft2.js +1 -0
- package/out/_next/static/chunks/3xsq_anpad-fb.js +1 -0
- package/out/_next/static/chunks/3ycv2qq7vpbua.js +1 -0
- package/out/_next/static/chunks/3z84au-mitjjw.js +1 -0
- package/out/_next/static/chunks/4030dhur2h70-.js +1 -0
- package/out/_next/static/chunks/40ffffml4h_3r.js +4 -0
- package/out/_next/static/chunks/{3-shckrcpvbxu.js → 41wt50z9tx9cx.js} +108 -711
- package/out/_next/static/chunks/431slrqh0wa0g.js +1 -0
- package/out/_next/static/chunks/43s_lbd1i2krj.js +1 -0
- package/out/_next/static/chunks/{0-2y-_oomza2l.js → 44nxswtahaq4w.js} +18 -18
- package/out/_next/static/chunks/45bwefvdpztfs.js +1 -0
- package/out/_next/static/chunks/{turbopack-0sgd6pfbe1fy6.js → turbopack-19105pdhzxp1x.js} +1 -1
- package/out/_not-found/__next._full.txt +9 -9
- package/out/_not-found/__next._head.txt +4 -4
- package/out/_not-found/__next._index.txt +4 -4
- package/out/_not-found/__next._not-found.__PAGE__.txt +2 -2
- package/out/_not-found/__next._not-found.txt +3 -3
- package/out/_not-found/__next._tree.txt +2 -2
- package/out/_not-found.html +1 -1
- package/out/_not-found.txt +9 -9
- package/out/index.html +1 -1
- package/out/index.txt +11 -11
- package/package.json +5 -4
- package/out/_next/static/chunks/068j6934u8j16.js +0 -1
- package/out/_next/static/chunks/09e4adtr6w0xe.js +0 -1
- package/out/_next/static/chunks/0_rf76jneiwal.js +0 -176
- package/out/_next/static/chunks/0aznt7717miff.js +0 -1
- package/out/_next/static/chunks/0cu-q5q3a7uf3.js +0 -1
- package/out/_next/static/chunks/0fskcfh9vbhtv.js +0 -1
- package/out/_next/static/chunks/0o_tpe5tlugtr.js +0 -3
- package/out/_next/static/chunks/0pj9pajm2xz97.css +0 -3
- package/out/_next/static/chunks/0ufbyo1x3qkmo.js +0 -1
- package/out/_next/static/chunks/0wwcfw8i3j_zx.js +0 -1
- package/out/_next/static/chunks/0ys9-ozuluawt.js +0 -1
- package/out/_next/static/chunks/1-61zh4waha61.js +0 -1
- package/out/_next/static/chunks/10r_824wzt8hj.js +0 -1
- package/out/_next/static/chunks/11v6j6q59u-f_.js +0 -1
- package/out/_next/static/chunks/123xxske5c9na.js +0 -1
- package/out/_next/static/chunks/13isnf0--pmx1.js +0 -1
- package/out/_next/static/chunks/157d9euci08yu.js +0 -1
- package/out/_next/static/chunks/18u58lorfahxi.js +0 -4
- package/out/_next/static/chunks/1_aahautsz2v_.js +0 -1
- package/out/_next/static/chunks/1o1d0p-v1z8ty.js +0 -1
- package/out/_next/static/chunks/1vdjn0pkoyypn.js +0 -1
- package/out/_next/static/chunks/1yehxf-fmeicg.js +0 -1
- package/out/_next/static/chunks/1zx2q-r32thv1.js +0 -4
- package/out/_next/static/chunks/2-sjjedfr0kfq.js +0 -1
- package/out/_next/static/chunks/25b9x-li-tvk2.js +0 -1
- package/out/_next/static/chunks/2aelw3far6rii.js +0 -1
- package/out/_next/static/chunks/2aor7m-wbis85.js +0 -1
- package/out/_next/static/chunks/2fh-_9b6tqhvb.js +0 -1
- package/out/_next/static/chunks/2g5gecypj0rqe.js +0 -1
- package/out/_next/static/chunks/2szdcpl41-kzv.js +0 -1
- package/out/_next/static/chunks/2u6shh3oeycm-.js +0 -1
- package/out/_next/static/chunks/2unhhuv0arlcv.js +0 -1
- package/out/_next/static/chunks/310uz81hnnzsu.js +0 -1
- package/out/_next/static/chunks/3i3gbhccmhu7j.js +0 -210
- package/out/_next/static/chunks/3mqy-84_ul3t2.js +0 -1
- package/out/_next/static/chunks/3nz-dh9d7cehk.js +0 -1
- package/out/_next/static/chunks/3pufs8g4ui943.js +0 -1
- package/out/_next/static/chunks/3t06schbtqonl.js +0 -1
- package/out/_next/static/chunks/3v3-7fio3nw_t.js +0 -1
- package/out/_next/static/chunks/3v5ha25nxo43j.js +0 -1
- package/out/_next/static/chunks/3zskk1hxu3-_o.js +0 -1
- /package/out/_next/static/{yttuijl-0Cn9k8uTCfhIM → M9ZSIaKJeBgkjz1qktYio}/_buildManifest.js +0 -0
- /package/out/_next/static/{yttuijl-0Cn9k8uTCfhIM → M9ZSIaKJeBgkjz1qktYio}/_clientMiddlewareManifest.js +0 -0
- /package/out/_next/static/{yttuijl-0Cn9k8uTCfhIM → M9ZSIaKJeBgkjz1qktYio}/_ssgManifest.js +0 -0
|
@@ -1,3 +0,0 @@
|
|
|
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)}]);
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
@font-face{font-family:Space Grotesk;font-style:normal;font-weight:300 700;font-display:swap;src:url(../media/32687112bd2dd8db-s.1gepa_7fcx9fm.woff2)format("woff2");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Space Grotesk;font-style:normal;font-weight:300 700;font-display:swap;src:url(../media/28868e710e86be81-s.2eksvhm1z0jwa.woff2)format("woff2");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Space Grotesk;font-style:normal;font-weight:300 700;font-display:swap;src:url(../media/0c89a48fa5027cee-s.p.2cyn07wtgehh0.woff2)format("woff2");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Space Grotesk Fallback;src:local(Arial);ascent-override:89.71%;descent-override:26.62%;line-gap-override:0.0%;size-adjust:109.69%}.space_grotesk_59d6dcf5-module__z_Ctiq__className{font-family:Space Grotesk,Space Grotesk Fallback;font-style:normal}.space_grotesk_59d6dcf5-module__z_Ctiq__variable{--font-space-grotesk:"Space Grotesk", "Space Grotesk Fallback"}
|
|
2
|
-
@font-face{font-family:JetBrains Mono;font-style:normal;font-weight:100 800;font-display:swap;src:url(../media/13bf9871fe164e7f-s.2f7nqdagzwx2-.woff2)format("woff2");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:JetBrains Mono;font-style:normal;font-weight:100 800;font-display:swap;src:url(../media/cc545e633e20c56d-s.176arc174-8zp.woff2)format("woff2");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:JetBrains Mono;font-style:normal;font-weight:100 800;font-display:swap;src:url(../media/71b036adf157cdcf-s.0bp8oijd_gu96.woff2)format("woff2");unicode-range:U+370-377,U+37A-37F,U+384-38A,U+38C,U+38E-3A1,U+3A3-3FF}@font-face{font-family:JetBrains Mono;font-style:normal;font-weight:100 800;font-display:swap;src:url(../media/89b21bb081cb7469-s.1fby2rem9ngyr.woff2)format("woff2");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:JetBrains Mono;font-style:normal;font-weight:100 800;font-display:swap;src:url(../media/3fe682a82f50d426-s.0vfdmo25voy_0.woff2)format("woff2");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:JetBrains Mono;font-style:normal;font-weight:100 800;font-display:swap;src:url(../media/70bc3e132a0a741e-s.p.3t6q91iet4nsy.woff2)format("woff2");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:JetBrains Mono Fallback;src:local(Arial);ascent-override:75.79%;descent-override:22.29%;line-gap-override:0.0%;size-adjust:134.59%}.jetbrains_mono_38c99671-module__5Dhsuq__className{font-family:JetBrains Mono,JetBrains Mono Fallback;font-style:normal}.jetbrains_mono_38c99671-module__5Dhsuq__variable{--font-jetbrains-mono:"JetBrains Mono", "JetBrains Mono Fallback"}
|
|
3
|
-
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:var(--font-jetbrains-mono), ui-monospace, SFMono-Regular, monospace;--color-red-300:#ffa3a3;--color-red-400:#ff6568;--color-red-900:#82181a;--color-red-950:#460809;--color-amber-300:#ffd236;--color-amber-400:#fcbb00;--color-emerald-300:#5ee9b5;--color-emerald-400:#00d294;--color-emerald-500:#00bb7f;--color-sky-400:#00bcfe;--color-sky-500:#00a5ef;--color-fuchsia-300:#f2a9ff;--color-fuchsia-400:#ec6cff;--color-fuchsia-500:#e12afb;--color-rose-300:#ffa2ae;--color-rose-400:#ff667f;--color-rose-500:#ff2357;--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-6xl:72rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-normal:0em;--tracking-wide:.025em;--leading-tight:1.25;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--animate-ping:ping 1s cubic-bezier(0, 0, .2, 1) infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-sm:8px;--aspect-video:16 / 9;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-ink:#161210;--color-panel:#201913;--color-edge:#34291f;--color-fg-hi:#f4eadf;--color-fg:#d8c8b8;--color-fg-muted:#a8917c;--color-saffron:#f4c84b;--color-amber:#eda63e;--color-ember:#e07b39;--font-display:var(--font-space-grotesk), system-ui, sans-serif;--font-body:system-ui, -apple-system, "Segoe UI", Roboto, sans-serif}@supports (color:lab(0% 0 0)){:root,:host{--color-red-300:lab(76.5514% 36.422 15.5335);--color-red-400:lab(63.7053% 60.745 31.3109);--color-red-900:lab(28.5139% 44.5539 29.0463);--color-red-950:lab(13.003% 29.04 16.7519);--color-amber-300:lab(86.4156% 6.13147 78.3961);--color-amber-400:lab(80.1641% 16.6016 99.2089);--color-emerald-300:lab(83.9203% -48.7124 13.8849);--color-emerald-400:lab(75.0771% -60.7313 19.4147);--color-emerald-500:lab(66.9756% -58.27 19.5419);--color-sky-400:lab(70.687% -23.6078 -45.9483);--color-sky-500:lab(63.3038% -18.433 -51.0407);--color-fuchsia-300:lab(78.5378% 39.3533 -32.9615);--color-fuchsia-400:lab(66.1178% 66.0652 -52.4733);--color-fuchsia-500:lab(56.4256% 83.132 -64.639);--color-rose-300:lab(76.6339% 38.3549 9.68835);--color-rose-400:lab(64.4125% 63.0291 19.2068);--color-rose-500:lab(56.101% 79.4328 31.4532)}}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:0}.inset-y-1{inset-block:var(--spacing)}.top-0{top:0}.top-2{top:calc(var(--spacing) * 2)}.top-3{top:calc(var(--spacing) * 3)}.top-6{top:calc(var(--spacing) * 6)}.right-2{right:calc(var(--spacing) * 2)}.right-3{right:calc(var(--spacing) * 3)}.bottom-3{bottom:calc(var(--spacing) * 3)}.left-0{left:0}.left-1\/2{left:50%}.left-3{left:calc(var(--spacing) * 3)}.isolate{isolation:isolate}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.mx-auto{margin-inline:auto}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-auto{margin-top:auto}.mb-1{margin-bottom:var(--spacing)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.ml-1{margin-left:var(--spacing)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-auto{margin-left:auto}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.aspect-video{aspect-ratio:var(--aspect-video)}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-27\.5{height:calc(var(--spacing) * 27.5)}.h-full{height:100%}.max-h-64{max-height:calc(var(--spacing) * 64)}.w-1{width:var(--spacing)}.w-2{width:calc(var(--spacing) * 2)}.w-2\.5{width:calc(var(--spacing) * 2.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-10{width:calc(var(--spacing) * 10)}.w-12{width:calc(var(--spacing) * 12)}.w-16{width:calc(var(--spacing) * 16)}.w-24{width:calc(var(--spacing) * 24)}.w-28{width:calc(var(--spacing) * 28)}.w-36{width:calc(var(--spacing) * 36)}.w-37\.5{width:calc(var(--spacing) * 37.5)}.w-64{width:calc(var(--spacing) * 64)}.w-full{width:100%}.w-px{width:1px}.max-w-6xl{max-width:var(--container-6xl)}.max-w-44{max-width:calc(var(--spacing) * 44)}.max-w-64{max-width:calc(var(--spacing) * 64)}.max-w-72{max-width:calc(var(--spacing) * 72)}.max-w-\[12rem\]{max-width:12rem}.max-w-\[16rem\]{max-width:16rem}.max-w-\[20rem\]{max-width:20rem}.min-w-0{min-width:0}.min-w-36{min-width:calc(var(--spacing) * 36)}.min-w-40{min-width:calc(var(--spacing) * 40)}.min-w-56{min-width:calc(var(--spacing) * 56)}.flex-1{flex:1}.flex-none{flex:none}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.-translate-x-1\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-ping{animation:var(--animate-ping)}.animate-pulse{animation:var(--animate-pulse)}.cursor-crosshair{cursor:crosshair}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.resize{resize:both}.list-none{list-style-type:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-px{gap:1px}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-y-1{row-gap:var(--spacing)}.gap-y-3{row-gap:calc(var(--spacing) * 3)}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-amber{border-color:var(--color-amber)}.border-amber\/40{border-color:#eda63e66}@supports (color:color-mix(in lab, red, red)){.border-amber\/40{border-color:color-mix(in oklab, var(--color-amber) 40%, transparent)}}.border-edge{border-color:var(--color-edge)}.border-ink\/60{border-color:#16121099}@supports (color:color-mix(in lab, red, red)){.border-ink\/60{border-color:color-mix(in oklab, var(--color-ink) 60%, transparent)}}.border-red-900\/60{border-color:#82181a99}@supports (color:color-mix(in lab, red, red)){.border-red-900\/60{border-color:color-mix(in oklab, var(--color-red-900) 60%, transparent)}}.border-transparent{border-color:#0000}.bg-\[\#38bdf8\]{background-color:#38bdf8}.bg-\[\#f4c84b\]{background-color:#f4c84b}.bg-amber{background-color:var(--color-amber)}.bg-amber-400{background-color:var(--color-amber-400)}.bg-amber\/10{background-color:#eda63e1a}@supports (color:color-mix(in lab, red, red)){.bg-amber\/10{background-color:color-mix(in oklab, var(--color-amber) 10%, transparent)}}.bg-amber\/15{background-color:#eda63e26}@supports (color:color-mix(in lab, red, red)){.bg-amber\/15{background-color:color-mix(in oklab, var(--color-amber) 15%, transparent)}}.bg-amber\/30{background-color:#eda63e4d}@supports (color:color-mix(in lab, red, red)){.bg-amber\/30{background-color:color-mix(in oklab, var(--color-amber) 30%, transparent)}}.bg-black\/30{background-color:#0000004d}@supports (color:color-mix(in lab, red, red)){.bg-black\/30{background-color:color-mix(in oklab, var(--color-black) 30%, transparent)}}.bg-black\/70{background-color:#000000b3}@supports (color:color-mix(in lab, red, red)){.bg-black\/70{background-color:color-mix(in oklab, var(--color-black) 70%, transparent)}}.bg-emerald-400{background-color:var(--color-emerald-400)}.bg-emerald-500\/70{background-color:#00bb7fb3}@supports (color:color-mix(in lab, red, red)){.bg-emerald-500\/70{background-color:color-mix(in oklab, var(--color-emerald-500) 70%, transparent)}}.bg-fg-muted{background-color:var(--color-fg-muted)}.bg-fg\/15{background-color:#d8c8b826}@supports (color:color-mix(in lab, red, red)){.bg-fg\/15{background-color:color-mix(in oklab, var(--color-fg) 15%, transparent)}}.bg-fuchsia-400\/30{background-color:#ec6cff4d}@supports (color:color-mix(in lab, red, red)){.bg-fuchsia-400\/30{background-color:color-mix(in oklab, var(--color-fuchsia-400) 30%, transparent)}}.bg-ink{background-color:var(--color-ink)}.bg-ink\/40{background-color:#16121066}@supports (color:color-mix(in lab, red, red)){.bg-ink\/40{background-color:color-mix(in oklab, var(--color-ink) 40%, transparent)}}.bg-ink\/50{background-color:#16121080}@supports (color:color-mix(in lab, red, red)){.bg-ink\/50{background-color:color-mix(in oklab, var(--color-ink) 50%, transparent)}}.bg-ink\/60{background-color:#16121099}@supports (color:color-mix(in lab, red, red)){.bg-ink\/60{background-color:color-mix(in oklab, var(--color-ink) 60%, transparent)}}.bg-ink\/80{background-color:#161210cc}@supports (color:color-mix(in lab, red, red)){.bg-ink\/80{background-color:color-mix(in oklab, var(--color-ink) 80%, transparent)}}.bg-ink\/90{background-color:#161210e6}@supports (color:color-mix(in lab, red, red)){.bg-ink\/90{background-color:color-mix(in oklab, var(--color-ink) 90%, transparent)}}.bg-ink\/95{background-color:#161210f2}@supports (color:color-mix(in lab, red, red)){.bg-ink\/95{background-color:color-mix(in oklab, var(--color-ink) 95%, transparent)}}.bg-panel{background-color:var(--color-panel)}.bg-red-950\/40{background-color:#46080966}@supports (color:color-mix(in lab, red, red)){.bg-red-950\/40{background-color:color-mix(in oklab, var(--color-red-950) 40%, transparent)}}.bg-rose-400{background-color:var(--color-rose-400)}.bg-rose-500\/20{background-color:#ff235733}@supports (color:color-mix(in lab, red, red)){.bg-rose-500\/20{background-color:color-mix(in oklab, var(--color-rose-500) 20%, transparent)}}.bg-saffron{background-color:var(--color-saffron)}.bg-sky-400\/70{background-color:#00bcfeb3}@supports (color:color-mix(in lab, red, red)){.bg-sky-400\/70{background-color:color-mix(in oklab, var(--color-sky-400) 70%, transparent)}}.bg-sky-500\/70{background-color:#00a5efb3}@supports (color:color-mix(in lab, red, red)){.bg-sky-500\/70{background-color:color-mix(in oklab, var(--color-sky-500) 70%, transparent)}}.bg-transparent{background-color:#0000}.bg-white\/5{background-color:#ffffff0d}@supports (color:color-mix(in lab, red, red)){.bg-white\/5{background-color:color-mix(in oklab, var(--color-white) 5%, transparent)}}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:var(--spacing)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.pt-1{padding-top:var(--spacing)}.pr-1{padding-right:var(--spacing)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pb-0\.5{padding-bottom:calc(var(--spacing) * .5)}.pl-8{padding-left:calc(var(--spacing) * 8)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-display{font-family:var(--font-display)}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-normal{--tw-tracking:var(--tracking-normal);letter-spacing:var(--tracking-normal)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.whitespace-nowrap{white-space:nowrap}.text-amber{color:var(--color-amber)}.text-amber-300{color:var(--color-amber-300)}.text-emerald-300{color:var(--color-emerald-300)}.text-emerald-400{color:var(--color-emerald-400)}.text-fg{color:var(--color-fg)}.text-fg-hi{color:var(--color-fg-hi)}.text-fg-muted{color:var(--color-fg-muted)}.text-fg-muted\/40{color:#a8917c66}@supports (color:color-mix(in lab, red, red)){.text-fg-muted\/40{color:color-mix(in oklab, var(--color-fg-muted) 40%, transparent)}}.text-fuchsia-300{color:var(--color-fuchsia-300)}.text-ink{color:var(--color-ink)}.text-red-300{color:var(--color-red-300)}.text-red-400{color:var(--color-red-400)}.text-rose-300{color:var(--color-rose-300)}.text-rose-400{color:var(--color-rose-400)}.text-saffron{color:var(--color-saffron)}.text-white{color:var(--color-white)}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.accent-amber{accent-color:var(--color-amber)}.opacity-0{opacity:0}.opacity-75{opacity:.75}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring,.ring-1{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-amber\/30{--tw-shadow-color:#eda63e4d}@supports (color:color-mix(in lab, red, red)){.shadow-amber\/30{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-amber) 30%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-black\/20{--tw-shadow-color:#0003}@supports (color:color-mix(in lab, red, red)){.shadow-black\/20{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-black) 20%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-black\/40{--tw-shadow-color:#0006}@supports (color:color-mix(in lab, red, red)){.shadow-black\/40{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-black) 40%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-fuchsia-500\/30{--tw-shadow-color:#e12afb4d}@supports (color:color-mix(in lab, red, red)){.shadow-fuchsia-500\/30{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-fuchsia-500) 30%, transparent) var(--tw-shadow-alpha), transparent)}}.ring-amber{--tw-ring-color:var(--color-amber)}.ring-amber\/30{--tw-ring-color:#eda63e4d}@supports (color:color-mix(in lab, red, red)){.ring-amber\/30{--tw-ring-color:color-mix(in oklab, var(--color-amber) 30%, transparent)}}.ring-fuchsia-300{--tw-ring-color:var(--color-fuchsia-300)}.ring-fuchsia-400\/30{--tw-ring-color:#ec6cff4d}@supports (color:color-mix(in lab, red, red)){.ring-fuchsia-400\/30{--tw-ring-color:color-mix(in oklab, var(--color-fuchsia-400) 30%, transparent)}}.ring-rose-400\/40{--tw-ring-color:#ff667f66}@supports (color:color-mix(in lab, red, red)){.ring-rose-400\/40{--tw-ring-color:color-mix(in oklab, var(--color-rose-400) 40%, transparent)}}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.group-focus-within\:opacity-100:is(:where(.group):focus-within *){opacity:1}@media (hover:hover){.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.first\:rounded-l-md:first-child{border-top-left-radius:var(--radius-md);border-bottom-left-radius:var(--radius-md)}.last\:rounded-r-md:last-child{border-top-right-radius:var(--radius-md);border-bottom-right-radius:var(--radius-md)}@media (hover:hover){.hover\:border-amber:hover{border-color:var(--color-amber)}.hover\:border-amber\/60:hover{border-color:#eda63e99}@supports (color:color-mix(in lab, red, red)){.hover\:border-amber\/60:hover{border-color:color-mix(in oklab, var(--color-amber) 60%, transparent)}}.hover\:border-edge:hover{border-color:var(--color-edge)}.hover\:bg-ember:hover{background-color:var(--color-ember)}.hover\:bg-ink:hover{background-color:var(--color-ink)}.hover\:text-fg:hover{color:var(--color-fg)}.hover\:text-fg-hi:hover{color:var(--color-fg-hi)}.hover\:text-white:hover{color:var(--color-white)}}.focus\:border-saffron:focus{border-color:var(--color-saffron)}.focus\:ring-1:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\:ring-amber:focus{--tw-ring-color:var(--color-amber)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}@media (min-width:40rem){.sm\:col-span-2{grid-column:span 2/span 2}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:p-8{padding:calc(var(--spacing) * 8)}}@media (min-width:64rem){.lg\:col-span-2{grid-column:span 2/span 2}.lg\:col-span-3{grid-column:span 3/span 3}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}}:root{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}body{background-color:var(--color-ink);color:var(--color-fg);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:var(--font-body)}h1,h2,h3,h4{font-family:var(--font-display)}code,kbd,samp,pre{font-family:var(--font-mono)}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}@keyframes pulse{50%{opacity:.5}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,18064,30419,29485,e=>{"use strict";e.s(["IsWrapper",0,function(e){return void 0===e.getPipelineContext}],18064),e.s(["WebGLShaderProcessor",0,class{constructor(){this.shaderLanguage=0}postProcessor(e,t,r,i,s){return s.drawBuffersExtensionDisabled&&(e=e.replace(/#extension.+GL_EXT_draw_buffers.+(enable|require)/g,"")),e}}],30419);let t=/(flat\s)?\s*varying\s*.*/;e.s(["WebGL2ShaderProcessor",0,class{constructor(){this.shaderLanguage=0}attributeProcessor(e){return e.replace("attribute","in")}varyingCheck(e,r){return t.test(e)}varyingProcessor(e,t){return e.replace("varying",t?"in":"out")}postProcessor(e,t,r){let i=-1!==e.search(/#extension.+GL_EXT_draw_buffers.+require/);if(e=(e=e.replace(/#extension.+(GL_OVR_multiview2|GL_OES_standard_derivatives|GL_EXT_shader_texture_lod|GL_EXT_frag_depth|GL_EXT_draw_buffers).+(enable|require)/g,"")).replace(/texture2D\s*\(/g,"texture("),r){let r=-1!==e.search(/layout *\(location *= *0\) *out/g),s=-1!==t.indexOf("#define DUAL_SOURCE_BLENDING");s&&(e="#extension GL_EXT_blend_func_extended : require\n"+e),e=(e=(e=(e=(e=(e=(e=e.replace(/texture2DLodEXT\s*\(/g,"textureLod(")).replace(/textureCubeLodEXT\s*\(/g,"textureLod(")).replace(/textureCube\s*\(/g,"texture(")).replace(/gl_FragDepthEXT/g,"gl_FragDepth")).replace(/gl_FragColor/g,"glFragColor")).replace(/gl_FragData/g,"glFragData")).replace(/void\s+?main\s*\(/g,(i||r?"":s?"layout(location = 0, index = 0) out vec4 glFragColor;\nlayout(location = 0, index = 1) out vec4 glFragColor2;\n":"layout(location = 0) out vec4 glFragColor;\n")+"void main(")}else if(t.indexOf("#define VERTEXOUTPUT_INVARIANT")>=0&&(e="invariant gl_Position;\n"+e),-1!==t.indexOf("#define MULTIVIEW"))return"#extension GL_OVR_multiview2 : require\nlayout (num_views = 2) in;\n"+e;return e}}],29485)},24574,e=>{"use strict";class t{get underlyingResource(){return null}constructor(){this.references=0,this.capacity=0,this.is32Bits=!1,this.uniqueId=t._Counter++}}t._Counter=0,e.s(["DataBuffer",0,t])},20483,e=>{"use strict";var t=e.i(24574);class r extends t.DataBuffer{constructor(e){super(),this._buffer=e}get underlyingResource(){return this._buffer}}e.s(["WebGLDataBuffer",0,r])},68179,e=>{"use strict";function t(e){let t=r(e),s=i(e);return t-e>e-s?s:t}function r(e){return e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e}function i(e){return e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,(e|=e>>16)-(e>>1)}e.s(["FloorPOT",0,i,"GetExponentOfTwo",0,function(e,s,a=2){let n;switch(a){case 1:n=i(e);break;case 2:n=t(e);break;default:n=r(e)}return Math.min(n,s)},"IsExponentOfTwo",0,function(e){let t=1;do t*=2;while(t<e)return t===e},"Mix",0,function(e,t,r){return e*(1-r)+t*r},"NearestPOT",0,t])},71379,40462,79814,e=>{"use strict";var t,r,i,s,a,n,_,l,h=e.i(99904),u=e.i(8881),o=e.i(76535),c=e.i(18064),g=e.i(13379),f=e.i(64545),d=e.i(30419),E=e.i(29485),T=e.i(20483),R=e.i(68179);class p{get underlyingResource(){return this._webGLTexture}constructor(e=null,t){if(this._MSAARenderBuffers=null,this._context=t,!e&&!(e=t.createTexture()))throw Error("Unable to create webGL texture");this.set(e)}setUsage(){}set(e){this._webGLTexture=e}reset(){this._webGLTexture=null,this._MSAARenderBuffers=null}addMSAARenderBuffer(e){this._MSAARenderBuffers||(this._MSAARenderBuffers=[]),this._MSAARenderBuffers.push(e)}releaseMSAARenderBuffers(){if(this._MSAARenderBuffers){for(let e of this._MSAARenderBuffers)this._context.deleteRenderbuffer(e);this._MSAARenderBuffers=null}}getMSAARenderBuffer(e=0){return this._MSAARenderBuffers?.[e]??null}release(){this.releaseMSAARenderBuffers(),this._webGLTexture&&this._context.deleteTexture(this._webGLTexture),this.reset()}}e.s(["WebGLHardwareTexture",0,p],40462);var A=e.i(84201),x=e.i(75017),S=e.i(28799);function b(e){return 13===e||14===e||15===e||16===e||17===e||18===e||19===e}function m(e){return 13===e||17===e||18===e||19===e}e.s(["HasStencilAspect",0,m,"IsDepthTexture",0,b],79814);var B=e.i(41520),C=e.i(75405);class P{}class L extends o.AbstractEngine{get name(){return this._name}set name(e){this._name=e}get version(){return this._webGLVersion}static get ShadersRepository(){return h.Effect.ShadersRepository}static set ShadersRepository(e){h.Effect.ShadersRepository=e}get supportsUniformBuffers(){return this.webGLVersion>1&&!this.disableUniformBuffers}get needPOTTextures(){return this._webGLVersion<2||this.forcePOTTextures}get _supportsHardwareTextureRescaling(){return!1}set framebufferDimensionsObject(e){this._framebufferDimensionsObject=e}snapshotRenderingReset(){this.snapshotRendering=!1}constructor(e,t,r,i){let s;if(r=r||{},super(t??r.antialias,r,i),this._name="WebGL",this.forcePOTTextures=!1,this.validateShaderPrograms=!1,this.disableUniformBuffers=!1,this._webGLVersion=1,this._vertexAttribArraysEnabled=[],this._uintIndicesCurrentlySet=!1,this._currentBoundBuffer=[],this._currentFramebuffer=null,this._dummyFramebuffer=null,this._currentBufferPointers=[],this._currentInstanceLocations=[],this._currentInstanceBuffers=[],this._vaoRecordInProgress=!1,this._mustWipeVertexAttributes=!1,this._nextFreeTextureSlots=[],this._maxSimultaneousTextures=0,this._maxMSAASamplesOverride=null,this._unpackFlipYCached=null,this.enableUnpackFlipYCached=!0,this._boundUniforms={},!e)return;if(e.getContext){if(s=e,void 0===r.preserveDrawingBuffer&&(r.preserveDrawingBuffer=!1),void 0===r.xrCompatible&&(r.xrCompatible=!1),navigator&&navigator.userAgent){this._setupMobileChecks();const e=navigator.userAgent;for(const t of L.ExceptionList){const i=t.key,s=t.targets;if(new RegExp(i).test(e)){if(t.capture&&t.captureConstraint){const r=t.capture,i=t.captureConstraint,s=new RegExp(r).exec(e);if(s&&s.length>0&&parseInt(s[s.length-1])>=i)continue}for(const e of s)switch(e){case"uniformBuffer":this.disableUniformBuffers=!0;break;case"vao":this.disableVertexArrayObjects=!0;break;case"antialias":r.antialias=!1;break;case"maxMSAASamples":this._maxMSAASamplesOverride=1}}}}if(this._doNotHandleContextLost?this._onContextLost=()=>{(0,u.deleteStateObject)(this._gl)}:(this._onContextLost=e=>{e.preventDefault(),this._contextWasLost=!0,(0,u.deleteStateObject)(this._gl),g.Logger.Warn("WebGL context lost."),this.onContextLostObservable.notifyObservers(this)},this._onContextRestored=()=>{this._restoreEngineAfterContextLost(()=>this._initGLContext())},s.addEventListener("webglcontextrestored",this._onContextRestored,!1),r.powerPreference=r.powerPreference||"high-performance"),s.addEventListener("webglcontextlost",this._onContextLost,!1),this._badDesktopOS&&(r.xrCompatible=!1),!r.disableWebGL2Support)try{this._gl=s.getContext("webgl2",r)||s.getContext("experimental-webgl2",r),this._gl&&(this._webGLVersion=2,this._shaderPlatformName="WEBGL2",this._gl.deleteQuery||(this._webGLVersion=1,this._shaderPlatformName="WEBGL1"))}catch(e){}if(!this._gl){if(!s)throw Error("The provided canvas is null or undefined.");try{this._gl=s.getContext("webgl",r)||s.getContext("experimental-webgl",r)}catch(e){throw Error("WebGL not supported",{cause:e})}}if(!this._gl)throw Error("WebGL not supported")}else{this._gl=e,s=this._gl.canvas,this._gl.renderbufferStorageMultisample?(this._webGLVersion=2,this._shaderPlatformName="WEBGL2"):this._shaderPlatformName="WEBGL1";const t=this._gl.getContextAttributes();t&&(r.stencil=t.stencil)}this._sharedInit(s),this._gl.pixelStorei(this._gl.UNPACK_COLORSPACE_CONVERSION_WEBGL,this._gl.NONE),void 0!==r.useHighPrecisionFloats&&(this._highPrecisionShadersAllowed=r.useHighPrecisionFloats),this.resize(),this._initGLContext(),this._initFeatures();for(let e=0;e<this._caps.maxVertexAttribs;e++)this._currentBufferPointers[e]=new P;this._shaderProcessor=this.webGLVersion>1?new E.WebGL2ShaderProcessor:new d.WebGLShaderProcessor;const a=`Babylon.js v${L.Version}`;g.Logger.Log(a+` - ${this.description}`),this._renderingCanvas&&this._renderingCanvas.setAttribute&&this._renderingCanvas.setAttribute("data-engine",a);const n=(0,u.getStateObject)(this._gl);n.validateShaderPrograms=this.validateShaderPrograms,n.parallelShaderCompile=this._caps.parallelShaderCompile}_clearEmptyResources(){this._dummyFramebuffer=null,super._clearEmptyResources()}_getShaderProcessingContext(e){return null}areAllEffectsReady(){for(let e in this._compiledEffects)if(!this._compiledEffects[e].isReady())return!1;return!0}_initGLContext(){this._caps={maxTexturesImageUnits:this._gl.getParameter(this._gl.MAX_TEXTURE_IMAGE_UNITS),maxCombinedTexturesImageUnits:this._gl.getParameter(this._gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS),maxVertexTextureImageUnits:this._gl.getParameter(this._gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS),maxTextureSize:this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),maxSamples:this._webGLVersion>1?this._gl.getParameter(this._gl.MAX_SAMPLES):1,maxCubemapTextureSize:this._gl.getParameter(this._gl.MAX_CUBE_MAP_TEXTURE_SIZE),maxRenderTextureSize:this._gl.getParameter(this._gl.MAX_RENDERBUFFER_SIZE),maxVertexAttribs:this._gl.getParameter(this._gl.MAX_VERTEX_ATTRIBS),maxVaryingVectors:this._gl.getParameter(this._gl.MAX_VARYING_VECTORS),maxFragmentUniformVectors:this._gl.getParameter(this._gl.MAX_FRAGMENT_UNIFORM_VECTORS),maxVertexUniformVectors:this._gl.getParameter(this._gl.MAX_VERTEX_UNIFORM_VECTORS),shaderFloatPrecision:0,parallelShaderCompile:this._gl.getExtension("KHR_parallel_shader_compile")||void 0,standardDerivatives:this._webGLVersion>1||null!==this._gl.getExtension("OES_standard_derivatives"),maxAnisotropy:1,astc:this._gl.getExtension("WEBGL_compressed_texture_astc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_astc"),bptc:this._gl.getExtension("EXT_texture_compression_bptc")||this._gl.getExtension("WEBKIT_EXT_texture_compression_bptc"),s3tc:this._gl.getExtension("WEBGL_compressed_texture_s3tc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc"),s3tc_srgb:this._gl.getExtension("WEBGL_compressed_texture_s3tc_srgb")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc_srgb"),pvrtc:this._gl.getExtension("WEBGL_compressed_texture_pvrtc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),etc1:this._gl.getExtension("WEBGL_compressed_texture_etc1")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_etc1"),etc2:this._gl.getExtension("WEBGL_compressed_texture_etc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_etc")||this._gl.getExtension("WEBGL_compressed_texture_es3_0"),textureAnisotropicFilterExtension:this._gl.getExtension("EXT_texture_filter_anisotropic")||this._gl.getExtension("WEBKIT_EXT_texture_filter_anisotropic")||this._gl.getExtension("MOZ_EXT_texture_filter_anisotropic"),uintIndices:this._webGLVersion>1||null!==this._gl.getExtension("OES_element_index_uint"),fragmentDepthSupported:this._webGLVersion>1||null!==this._gl.getExtension("EXT_frag_depth"),highPrecisionShaderSupported:!1,timerQuery:this._gl.getExtension("EXT_disjoint_timer_query_webgl2")||this._gl.getExtension("EXT_disjoint_timer_query"),supportOcclusionQuery:this._webGLVersion>1,canUseTimestampForTimerQuery:!1,drawBuffersExtension:!1,maxMSAASamples:1,colorBufferFloat:!!(this._webGLVersion>1&&this._gl.getExtension("EXT_color_buffer_float")),blendFloat:null!==this._gl.getExtension("EXT_float_blend"),supportFloatTexturesResolve:!1,rg11b10ufColorRenderable:!1,colorBufferHalfFloat:!!(this._webGLVersion>1&&this._gl.getExtension("EXT_color_buffer_half_float")),textureFloat:!!(this._webGLVersion>1||this._gl.getExtension("OES_texture_float")),textureHalfFloat:!!(this._webGLVersion>1||this._gl.getExtension("OES_texture_half_float")),textureHalfFloatRender:!1,textureFloatLinearFiltering:!1,textureFloatRender:!1,textureHalfFloatLinearFiltering:!1,vertexArrayObject:!1,instancedArrays:!1,textureLOD:!!(this._webGLVersion>1||this._gl.getExtension("EXT_shader_texture_lod")),texelFetch:1!==this._webGLVersion,blendMinMax:!1,multiview:this._gl.getExtension("OVR_multiview2"),oculusMultiview:this._gl.getExtension("OCULUS_multiview"),depthTextureExtension:!1,canUseGLInstanceID:this._webGLVersion>1,canUseGLVertexID:this._webGLVersion>1,supportComputeShaders:!1,supportSRGBBuffers:!1,supportTransformFeedbacks:this._webGLVersion>1,textureMaxLevel:this._webGLVersion>1,texture2DArrayMaxLayerCount:this._webGLVersion>1?this._gl.getParameter(this._gl.MAX_ARRAY_TEXTURE_LAYERS):128,disableMorphTargetTexture:!1,textureNorm16:!!this._gl.getExtension("EXT_texture_norm16"),blendParametersPerTarget:!1,dualSourceBlending:!1,supportReadWriteStorageTextures:!1},this._caps.supportFloatTexturesResolve=this._caps.colorBufferFloat,this._caps.rg11b10ufColorRenderable=this._caps.colorBufferFloat,this._glVersion=this._gl.getParameter(this._gl.VERSION);let e=this._gl.getExtension("WEBGL_debug_renderer_info");null!=e&&(this._glRenderer=this._gl.getParameter(e.UNMASKED_RENDERER_WEBGL),this._glVendor=this._gl.getParameter(e.UNMASKED_VENDOR_WEBGL)),this._glVendor||(this._glVendor=this._gl.getParameter(this._gl.VENDOR)||"Unknown vendor"),this._glRenderer||(this._glRenderer=this._gl.getParameter(this._gl.RENDERER)||"Unknown renderer"),36193!==this._gl.HALF_FLOAT_OES&&(this._gl.HALF_FLOAT_OES=36193),34842!==this._gl.RGBA16F&&(this._gl.RGBA16F=34842),34836!==this._gl.RGBA32F&&(this._gl.RGBA32F=34836),35056!==this._gl.DEPTH24_STENCIL8&&(this._gl.DEPTH24_STENCIL8=35056),this._caps.timerQuery&&(1===this._webGLVersion&&(this._gl.getQuery=this._caps.timerQuery.getQueryEXT.bind(this._caps.timerQuery)),this._caps.canUseTimestampForTimerQuery=(this._gl.getQuery(this._caps.timerQuery.TIMESTAMP_EXT,this._caps.timerQuery.QUERY_COUNTER_BITS_EXT)??0)>0),this._caps.maxAnisotropy=this._caps.textureAnisotropicFilterExtension?this._gl.getParameter(this._caps.textureAnisotropicFilterExtension.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,this._caps.textureFloatLinearFiltering=!!(this._caps.textureFloat&&this._gl.getExtension("OES_texture_float_linear")),this._caps.textureFloatRender=!!(this._caps.textureFloat&&this._canRenderToFloatFramebuffer()),this._caps.textureHalfFloatLinearFiltering=!!(this._webGLVersion>1||this._caps.textureHalfFloat&&this._gl.getExtension("OES_texture_half_float_linear")),this._caps.textureNorm16&&(this._gl.R16_EXT=33322,this._gl.RG16_EXT=33324,this._gl.RGB16_EXT=32852,this._gl.RGBA16_EXT=32859,this._gl.R16_SNORM_EXT=36760,this._gl.RG16_SNORM_EXT=36761,this._gl.RGB16_SNORM_EXT=36762,this._gl.RGBA16_SNORM_EXT=36763);let t=this._gl.getExtension("OES_draw_buffers_indexed");if(this._caps.blendParametersPerTarget=!!t,this._alphaState=new B.AlphaState(this._caps.blendParametersPerTarget),t&&(this._gl.blendEquationSeparateIndexed=t.blendEquationSeparateiOES.bind(t),this._gl.blendEquationIndexed=t.blendEquationiOES.bind(t),this._gl.blendFuncSeparateIndexed=t.blendFuncSeparateiOES.bind(t),this._gl.blendFuncIndexed=t.blendFunciOES.bind(t),this._gl.colorMaskIndexed=t.colorMaskiOES.bind(t),this._gl.disableIndexed=t.disableiOES.bind(t),this._gl.enableIndexed=t.enableiOES.bind(t)),this._caps.dualSourceBlending=!!this._gl.getExtension("WEBGL_blend_func_extended"),this._caps.astc&&(this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR),this._caps.bptc&&(this._gl.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=this._caps.bptc.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT),this._caps.s3tc_srgb&&(this._gl.COMPRESSED_SRGB_S3TC_DXT1_EXT=this._caps.s3tc_srgb.COMPRESSED_SRGB_S3TC_DXT1_EXT,this._gl.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=this._caps.s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,this._gl.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=this._caps.s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT),this._caps.etc2&&(this._gl.COMPRESSED_SRGB8_ETC2=this._caps.etc2.COMPRESSED_SRGB8_ETC2,this._gl.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=this._caps.etc2.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC),this._webGLVersion>1&&5131!==this._gl.HALF_FLOAT_OES&&(this._gl.HALF_FLOAT_OES=5131),this._caps.textureHalfFloatRender=this._caps.textureHalfFloat&&this._canRenderToHalfFloatFramebuffer(),this._webGLVersion>1)this._caps.drawBuffersExtension=!0,this._caps.maxMSAASamples=null!==this._maxMSAASamplesOverride?this._maxMSAASamplesOverride:this._gl.getParameter(this._gl.MAX_SAMPLES),this._caps.maxDrawBuffers=this._gl.getParameter(this._gl.MAX_DRAW_BUFFERS);else{let e=this._gl.getExtension("WEBGL_draw_buffers");if(null!==e){this._caps.drawBuffersExtension=!0,this._gl.drawBuffers=e.drawBuffersWEBGL.bind(e),this._caps.maxDrawBuffers=this._gl.getParameter(e.MAX_DRAW_BUFFERS_WEBGL),this._gl.DRAW_FRAMEBUFFER=this._gl.FRAMEBUFFER;for(let t=0;t<16;t++)this._gl["COLOR_ATTACHMENT"+t+"_WEBGL"]=e["COLOR_ATTACHMENT"+t+"_WEBGL"]}}if(this._webGLVersion>1)this._caps.depthTextureExtension=!0;else{let e=this._gl.getExtension("WEBGL_depth_texture");null!=e&&(this._caps.depthTextureExtension=!0,this._gl.UNSIGNED_INT_24_8=e.UNSIGNED_INT_24_8_WEBGL)}if(this.disableVertexArrayObjects)this._caps.vertexArrayObject=!1;else if(this._webGLVersion>1)this._caps.vertexArrayObject=!0;else{let e=this._gl.getExtension("OES_vertex_array_object");null!=e&&(this._caps.vertexArrayObject=!0,this._gl.createVertexArray=e.createVertexArrayOES.bind(e),this._gl.bindVertexArray=e.bindVertexArrayOES.bind(e),this._gl.deleteVertexArray=e.deleteVertexArrayOES.bind(e))}if(this._webGLVersion>1)this._caps.instancedArrays=!0;else{let e=this._gl.getExtension("ANGLE_instanced_arrays");null!=e?(this._caps.instancedArrays=!0,this._gl.drawArraysInstanced=e.drawArraysInstancedANGLE.bind(e),this._gl.drawElementsInstanced=e.drawElementsInstancedANGLE.bind(e),this._gl.vertexAttribDivisor=e.vertexAttribDivisorANGLE.bind(e)):this._caps.instancedArrays=!1}if(this._gl.getShaderPrecisionFormat){let e=this._gl.getShaderPrecisionFormat(this._gl.VERTEX_SHADER,this._gl.HIGH_FLOAT),t=this._gl.getShaderPrecisionFormat(this._gl.FRAGMENT_SHADER,this._gl.HIGH_FLOAT);if(e&&t&&(this._caps.highPrecisionShaderSupported=0!==e.precision&&0!==t.precision,this._caps.shaderFloatPrecision=Math.min(e.precision,t.precision)),!this._shouldUseHighPrecisionShader){let e=this._gl.getShaderPrecisionFormat(this._gl.VERTEX_SHADER,this._gl.MEDIUM_FLOAT),t=this._gl.getShaderPrecisionFormat(this._gl.FRAGMENT_SHADER,this._gl.MEDIUM_FLOAT);e&&t&&(this._caps.shaderFloatPrecision=Math.min(e.precision,t.precision))}this._caps.shaderFloatPrecision<10&&(this._caps.shaderFloatPrecision=10)}if(this._webGLVersion>1)this._caps.blendMinMax=!0;else{let e=this._gl.getExtension("EXT_blend_minmax");null!=e&&(this._caps.blendMinMax=!0,this._gl.MAX=e.MAX_EXT,this._gl.MIN=e.MIN_EXT)}if(!this._caps.supportSRGBBuffers){if(this._webGLVersion>1)this._caps.supportSRGBBuffers=!0,this._glSRGBExtensionValues={SRGB:WebGL2RenderingContext.SRGB,SRGB8:WebGL2RenderingContext.SRGB8,SRGB8_ALPHA8:WebGL2RenderingContext.SRGB8_ALPHA8};else{let e=this._gl.getExtension("EXT_sRGB");null!=e&&(this._caps.supportSRGBBuffers=!0,this._glSRGBExtensionValues={SRGB:e.SRGB_EXT,SRGB8:e.SRGB_ALPHA_EXT,SRGB8_ALPHA8:e.SRGB_ALPHA_EXT})}if(this._creationOptions){let e=this._creationOptions.forceSRGBBufferSupportState;void 0!==e&&(this._caps.supportSRGBBuffers=this._caps.supportSRGBBuffers&&e)}}this._depthCullingState.depthTest=!0,this._depthCullingState.depthFunc=this._gl.LEQUAL,this._depthCullingState.depthMask=!0,this._maxSimultaneousTextures=this._caps.maxCombinedTexturesImageUnits;for(let e=0;e<this._maxSimultaneousTextures;e++)this._nextFreeTextureSlots.push(e);"Mali-G72"===this._glRenderer&&(this._caps.disableMorphTargetTexture=!0)}_initFeatures(){this._features={forceBitmapOverHTMLImageElement:"u"<typeof HTMLImageElement,supportRenderAndCopyToLodForFloatTextures:1!==this._webGLVersion,supportDepthStencilTexture:1!==this._webGLVersion,supportShadowSamplers:1!==this._webGLVersion,uniformBufferHardCheckMatrix:!1,allowTexturePrefiltering:1!==this._webGLVersion,trackUbosInFrame:!1,checkUbosContentBeforeUpload:!1,supportCSM:1!==this._webGLVersion,basisNeedsPOT:1===this._webGLVersion,support3DTextures:1!==this._webGLVersion,needTypeSuffixInShaderConstants:1!==this._webGLVersion,supportMSAA:1!==this._webGLVersion,supportSSAO2:1!==this._webGLVersion,supportIBLShadows:1!==this._webGLVersion,supportExtendedTextureFormats:1!==this._webGLVersion,supportSwitchCaseInShader:1!==this._webGLVersion,supportSyncTextureRead:!0,needsInvertingBitmap:!0,useUBOBindingCache:!0,needShaderCodeInlining:!1,needToAlwaysBindUniformBuffers:!1,supportRenderPasses:!1,supportSpriteInstancing:!0,forceVertexBufferStrideAndOffsetMultiple4Bytes:!1,_checkNonFloatVertexBuffersDontRecreatePipelineContext:!1}}get webGLVersion(){return this._webGLVersion}getClassName(){return"ThinEngine"}_prepareWorkingCanvas(){if(this._workingCanvas)return;this._workingCanvas=this.createCanvas(1,1);let e=this._workingCanvas.getContext("2d");e&&(this._workingContext=e)}getInfo(){return this.getGlInfo()}getGlInfo(){return{vendor:this._glVendor,renderer:this._glRenderer,version:this._glVersion}}extractDriverInfo(){let e=this.getGlInfo();return e&&e.renderer?e.renderer:""}getRenderWidth(e=!1){return!e&&this._currentRenderTarget?this._currentRenderTarget.width:this._framebufferDimensionsObject?this._framebufferDimensionsObject.framebufferWidth:this._gl.drawingBufferWidth}getRenderHeight(e=!1){return!e&&this._currentRenderTarget?this._currentRenderTarget.height:this._framebufferDimensionsObject?this._framebufferDimensionsObject.framebufferHeight:this._gl.drawingBufferHeight}clear(e,t,r,i=!1,s=0){let a=this.stencilStateComposer.useStencilGlobalOnly;this.stencilStateComposer.useStencilGlobalOnly=!0,this.applyStates(),this.stencilStateComposer.useStencilGlobalOnly=a;let n=0;if(t&&e){let t=!0;if(this._currentRenderTarget){let r=this._currentRenderTarget.texture?.format;if(8===r||9===r||10===r||11===r){let r=this._currentRenderTarget.texture?.type;7===r||5===r?(L._TempClearColorUint32[0]=255*e.r,L._TempClearColorUint32[1]=255*e.g,L._TempClearColorUint32[2]=255*e.b,L._TempClearColorUint32[3]=255*e.a,this._gl.clearBufferuiv(this._gl.COLOR,0,L._TempClearColorUint32)):(L._TempClearColorInt32[0]=255*e.r,L._TempClearColorInt32[1]=255*e.g,L._TempClearColorInt32[2]=255*e.b,L._TempClearColorInt32[3]=255*e.a,this._gl.clearBufferiv(this._gl.COLOR,0,L._TempClearColorInt32)),t=!1}}t&&(this._gl.clearColor(e.r,e.g,e.b,void 0!==e.a?e.a:1),n|=this._gl.COLOR_BUFFER_BIT)}r&&(this.useReverseDepthBuffer?(this._depthCullingState.depthFunc=this._gl.GEQUAL,this._gl.clearDepth(0)):this._gl.clearDepth(1),n|=this._gl.DEPTH_BUFFER_BIT),i&&(this._gl.clearStencil(s),n|=this._gl.STENCIL_BUFFER_BIT),this._gl.clear(n)}_viewport(e,t,r,i){(e!==this._viewportCached.x||t!==this._viewportCached.y||r!==this._viewportCached.z||i!==this._viewportCached.w)&&(this._viewportCached.x=e,this._viewportCached.y=t,this._viewportCached.z=r,this._viewportCached.w=i,this._gl.viewport(e,t,r,i))}endFrame(){super.endFrame(),this._badOS&&this.flushFramebuffer()}get performanceMonitor(){throw Error("Not Supported by ThinEngine")}bindFramebuffer(e,t=0,r,i,s,a=0,n=0){this._currentRenderTarget&&this._resolveAndGenerateMipMapsFramebuffer(this._currentRenderTarget),this._currentRenderTarget=e,this._bindUnboundFramebuffer(e._framebuffer);let _=this._gl;e.isMulti||(e.is2DArray||e.is3D?(_.framebufferTextureLayer(_.FRAMEBUFFER,_.COLOR_ATTACHMENT0,e.texture._hardwareTexture?.underlyingResource,a,n),e._currentLOD=a):e.isCube?_.framebufferTexture2D(_.FRAMEBUFFER,_.COLOR_ATTACHMENT0,_.TEXTURE_CUBE_MAP_POSITIVE_X+t,e.texture._hardwareTexture?.underlyingResource,a):e._currentLOD!==a&&(_.framebufferTexture2D(_.FRAMEBUFFER,_.COLOR_ATTACHMENT0,_.TEXTURE_2D,e.texture._hardwareTexture?.underlyingResource,a),e._currentLOD=a));let l=e._depthStencilTexture;if(l){e.is3D&&(e.texture.width!==l.width||e.texture.height!==l.height||e.texture.depth!==l.depth)&&g.Logger.Warn("Depth/Stencil attachment for 3D target must have same dimensions as color attachment");let r=e._depthStencilTextureWithStencil?_.DEPTH_STENCIL_ATTACHMENT:_.DEPTH_ATTACHMENT;e.is2DArray||e.is3D?_.framebufferTextureLayer(_.FRAMEBUFFER,r,l._hardwareTexture?.underlyingResource,a,n):e.isCube?_.framebufferTexture2D(_.FRAMEBUFFER,r,_.TEXTURE_CUBE_MAP_POSITIVE_X+t,l._hardwareTexture?.underlyingResource,a):_.framebufferTexture2D(_.FRAMEBUFFER,r,_.TEXTURE_2D,l._hardwareTexture?.underlyingResource,a)}e._MSAAFramebuffer&&this._bindUnboundFramebuffer(e._MSAAFramebuffer),this._cachedViewport&&!s?this.setViewport(this._cachedViewport,r,i):(!r&&(r=e.width,a&&(r/=Math.pow(2,a))),!i&&(i=e.height,a&&(i/=Math.pow(2,a))),this._viewport(0,0,r,i)),this.wipeCaches()}setStateCullFaceType(e,t){let r=this.cullBackFaces??e??!0?this._gl.BACK:this._gl.FRONT;(this._depthCullingState.cullFace!==r||t)&&(this._depthCullingState.cullFace=r)}setState(e,t=0,r,i=!1,s,a,n=0){(this._depthCullingState.cull!==e||r)&&(this._depthCullingState.cull=e),this.setStateCullFaceType(s,r),this.setZOffset(t),this.setZOffsetUnits(n);let _=i?this._gl.CW:this._gl.CCW;(this._depthCullingState.frontFace!==_||r)&&(this._depthCullingState.frontFace=_),this._stencilStateComposer.stencilMaterial=a}_resolveAndGenerateMipMapsFramebuffer(e,t=!1){e.disableAutomaticMSAAResolve||(e.isMulti?this.resolveMultiFramebuffer(e):this.resolveFramebuffer(e)),t||(e.isMulti?this.generateMipMapsMultiFramebuffer(e):this.generateMipMapsFramebuffer(e))}_bindUnboundFramebuffer(e){this._currentFramebuffer!==e&&(this._gl.bindFramebuffer(this._gl.FRAMEBUFFER,e),this._currentFramebuffer=e)}_currentFrameBufferIsDefaultFrameBuffer(){return null===this._currentFramebuffer}generateMipmaps(e){let t=this._getTextureTarget(e);this._bindTextureDirectly(t,e,!0),this._gl.generateMipmap(t),this._bindTextureDirectly(t,null)}unBindFramebuffer(e,t,r){this._currentRenderTarget=null,this._resolveAndGenerateMipMapsFramebuffer(e,t),r&&(e._MSAAFramebuffer&&this._bindUnboundFramebuffer(e._framebuffer),r()),this._bindUnboundFramebuffer(null)}generateMipMapsFramebuffer(e){!e.isMulti&&e.texture?.generateMipMaps&&!e.isCube&&this.generateMipmaps(e.texture)}resolveFramebuffer(e){let t=this._gl;if(!e._MSAAFramebuffer||e.isMulti)return;let r=e.resolveMSAAColors?t.COLOR_BUFFER_BIT:0;r|=e._generateDepthBuffer&&e.resolveMSAADepth?t.DEPTH_BUFFER_BIT:0,r|=e._generateStencilBuffer&&e.resolveMSAAStencil?t.STENCIL_BUFFER_BIT:0,t.bindFramebuffer(t.READ_FRAMEBUFFER,e._MSAAFramebuffer),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,e._framebuffer),t.blitFramebuffer(0,0,e.width,e.height,0,0,e.width,e.height,r,t.NEAREST)}flushFramebuffer(){this._gl.flush()}restoreDefaultFramebuffer(){this._currentRenderTarget?this.unBindFramebuffer(this._currentRenderTarget):this._bindUnboundFramebuffer(null),this._cachedViewport&&this.setViewport(this._cachedViewport),this.wipeCaches()}_resetVertexBufferBinding(){this.bindArrayBuffer(null),this._cachedVertexBuffers=null}createVertexBuffer(e,t,r){return this._createVertexBuffer(e,this._gl.STATIC_DRAW)}_createVertexBuffer(e,t){let r=this._gl.createBuffer();if(!r)throw Error("Unable to create vertex buffer");let i=new T.WebGLDataBuffer(r);return this.bindArrayBuffer(i),"number"!=typeof e?e instanceof Array?(this._gl.bufferData(this._gl.ARRAY_BUFFER,new Float32Array(e),t),i.capacity=4*e.length):(this._gl.bufferData(this._gl.ARRAY_BUFFER,e,t),i.capacity=e.byteLength):(this._gl.bufferData(this._gl.ARRAY_BUFFER,new Uint8Array(e),t),i.capacity=e),this._resetVertexBufferBinding(),i.references=1,i}createDynamicVertexBuffer(e,t){return this._createVertexBuffer(e,this._gl.DYNAMIC_DRAW)}_resetIndexBufferBinding(){this.bindIndexBuffer(null),this._cachedIndexBuffer=null}createIndexBuffer(e,t,r){let i=this._gl.createBuffer(),s=new T.WebGLDataBuffer(i);if(!i)throw Error("Unable to create index buffer");this.bindIndexBuffer(s);let a=this._normalizeIndexData(e);return this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER,a,t?this._gl.DYNAMIC_DRAW:this._gl.STATIC_DRAW),this._resetIndexBufferBinding(),s.references=1,s.is32Bits=4===a.BYTES_PER_ELEMENT,s}_normalizeIndexData(e){if(2===e.BYTES_PER_ELEMENT)return e;if(this._caps.uintIndices){if(e instanceof Uint32Array)return e;else for(let t=0;t<e.length;t++)if(e[t]>=65535)return new Uint32Array(e)}return new Uint16Array(e)}bindArrayBuffer(e){this._vaoRecordInProgress||this._unbindVertexArrayObject(),this._bindBuffer(e,this._gl.ARRAY_BUFFER)}bindUniformBlock(e,t,r){let i=e.program,s=this._gl.getUniformBlockIndex(i,t);this._gl.uniformBlockBinding(i,s,r)}bindIndexBuffer(e){this._vaoRecordInProgress||this._unbindVertexArrayObject(),this._bindBuffer(e,this._gl.ELEMENT_ARRAY_BUFFER)}_bindBuffer(e,t){(this._vaoRecordInProgress||this._currentBoundBuffer[t]!==e)&&(this._gl.bindBuffer(t,e?e.underlyingResource:null),this._currentBoundBuffer[t]=e)}updateArrayBuffer(e){this._gl.bufferSubData(this._gl.ARRAY_BUFFER,0,e)}_vertexAttribPointer(e,t,r,i,s,a,n){let _=this._currentBufferPointers[t];if(!_)return;let l=!1;_.active?(_.buffer!==e&&(_.buffer=e,l=!0),_.size!==r&&(_.size=r,l=!0),_.type!==i&&(_.type=i,l=!0),_.normalized!==s&&(_.normalized=s,l=!0),_.stride!==a&&(_.stride=a,l=!0),_.offset!==n&&(_.offset=n,l=!0)):(l=!0,_.active=!0,_.index=t,_.size=r,_.type=i,_.normalized=s,_.stride=a,_.offset=n,_.buffer=e),(l||this._vaoRecordInProgress)&&(this.bindArrayBuffer(e),i===this._gl.UNSIGNED_INT||i===this._gl.INT?this._gl.vertexAttribIPointer(t,r,i,a,n):this._gl.vertexAttribPointer(t,r,i,s,a,n))}_bindIndexBufferWithCache(e){null!=e&&this._cachedIndexBuffer!==e&&(this._cachedIndexBuffer=e,this.bindIndexBuffer(e),this._uintIndicesCurrentlySet=e.is32Bits)}_bindVertexBuffersAttributes(e,t,r){let i=t.getAttributesNames();this._vaoRecordInProgress||this._unbindVertexArrayObject(),this.unbindAllAttributes();for(let s=0;s<i.length;s++){let a=t.getAttributeLocation(s);if(a>=0){let t=i[s],n=null;if(r&&(n=r[t]),n||(n=e[t]),!n)continue;this._gl.enableVertexAttribArray(a),this._vaoRecordInProgress||(this._vertexAttribArraysEnabled[a]=!0);let _=n.getBuffer();_&&(this._vertexAttribPointer(_,a,n.getSize(),n.type,n.normalized,n.byteStride,n.byteOffset),n.getIsInstanced()&&(this._gl.vertexAttribDivisor(a,n.getInstanceDivisor()),this._vaoRecordInProgress||(this._currentInstanceLocations.push(a),this._currentInstanceBuffers.push(_))))}}}recordVertexArrayObject(e,t,r,i){let s=this._gl.createVertexArray();if(!s)throw Error("Unable to create VAO");return this._vaoRecordInProgress=!0,this._gl.bindVertexArray(s),this._mustWipeVertexAttributes=!0,this._bindVertexBuffersAttributes(e,r,i),this.bindIndexBuffer(t),this._vaoRecordInProgress=!1,this._gl.bindVertexArray(null),s}bindVertexArrayObject(e,t){this._cachedVertexArrayObject!==e&&(this._cachedVertexArrayObject=e,this._gl.bindVertexArray(e),this._cachedVertexBuffers=null,this._cachedIndexBuffer=null,this._uintIndicesCurrentlySet=null!=t&&t.is32Bits,this._mustWipeVertexAttributes=!0)}bindBuffersDirectly(e,t,r,i,s){if(this._cachedVertexBuffers!==e||this._cachedEffectForVertexBuffers!==s){this._cachedVertexBuffers=e,this._cachedEffectForVertexBuffers=s;let t=s.getAttributesCount();this._unbindVertexArrayObject(),this.unbindAllAttributes();let a=0;for(let n=0;n<t;n++)if(n<r.length){let t=s.getAttributeLocation(n);t>=0&&(this._gl.enableVertexAttribArray(t),this._vertexAttribArraysEnabled[t]=!0,this._vertexAttribPointer(e,t,r[n],this._gl.FLOAT,!1,i,a)),a+=4*r[n]}}this._bindIndexBufferWithCache(t)}_unbindVertexArrayObject(){this._cachedVertexArrayObject&&(this._cachedVertexArrayObject=null,this._gl.bindVertexArray(null))}bindBuffers(e,t,r,i){(this._cachedVertexBuffers!==e||this._cachedEffectForVertexBuffers!==r)&&(this._cachedVertexBuffers=e,this._cachedEffectForVertexBuffers=r,this._bindVertexBuffersAttributes(e,r,i)),this._bindIndexBufferWithCache(t)}unbindInstanceAttributes(){let e;for(let t=0,r=this._currentInstanceLocations.length;t<r;t++){let r=this._currentInstanceBuffers[t];e!=r&&r.references&&(e=r,this.bindArrayBuffer(r));let i=this._currentInstanceLocations[t];this._gl.vertexAttribDivisor(i,0)}this._currentInstanceBuffers.length=0,this._currentInstanceLocations.length=0}releaseVertexArrayObject(e){this._gl.deleteVertexArray(e)}_releaseBuffer(e){return e.references--,0===e.references&&(this._deleteBuffer(e),!0)}_deleteBuffer(e){this._gl.deleteBuffer(e.underlyingResource)}updateAndBindInstancesBuffer(e,t,r){if(this.bindArrayBuffer(e),t&&this._gl.bufferSubData(this._gl.ARRAY_BUFFER,0,t),void 0!==r[0].index)this.bindInstancesBuffer(e,r,!0);else for(let t=0;t<4;t++){let i=r[t];this._vertexAttribArraysEnabled[i]||(this._gl.enableVertexAttribArray(i),this._vertexAttribArraysEnabled[i]=!0),this._vertexAttribPointer(e,i,4,this._gl.FLOAT,!1,64,16*t),this._gl.vertexAttribDivisor(i,1),this._currentInstanceLocations.push(i),this._currentInstanceBuffers.push(e)}}bindInstancesBuffer(e,t,r=!0){this.bindArrayBuffer(e);let i=0;if(r)for(let e=0;e<t.length;e++)i+=4*t[e].attributeSize;for(let r=0;r<t.length;r++){let s=t[r];void 0===s.index&&(s.index=this._currentEffect.getAttributeLocationByName(s.attributeName)),s.index<0||(this._vertexAttribArraysEnabled[s.index]||(this._gl.enableVertexAttribArray(s.index),this._vertexAttribArraysEnabled[s.index]=!0),this._vertexAttribPointer(e,s.index,s.attributeSize,s.attributeType||this._gl.FLOAT,s.normalized||!1,i,s.offset),this._gl.vertexAttribDivisor(s.index,void 0===s.divisor?1:s.divisor),this._currentInstanceLocations.push(s.index),this._currentInstanceBuffers.push(e))}}disableInstanceAttributeByName(e){if(!this._currentEffect)return;let t=this._currentEffect.getAttributeLocationByName(e);this.disableInstanceAttribute(t)}disableInstanceAttribute(e){let t,r=!1;for(;-1!==(t=this._currentInstanceLocations.indexOf(e));)this._currentInstanceLocations.splice(t,1),this._currentInstanceBuffers.splice(t,1),r=!0;r&&(this._gl.vertexAttribDivisor(e,0),this.disableAttributeByIndex(e))}disableAttributeByIndex(e){this._gl.disableVertexAttribArray(e),this._vertexAttribArraysEnabled[e]=!1,this._currentBufferPointers[e].active=!1}draw(e,t,r,i){this.drawElementsType(+!e,t,r,i)}drawPointClouds(e,t,r){this.drawArraysType(2,e,t,r)}drawUnIndexed(e,t,r,i){this.drawArraysType(+!e,t,r,i)}drawElementsType(e,t,r,i){this.applyStates(),this._reportDrawCall();let s=this._drawMode(e),a=this._uintIndicesCurrentlySet?this._gl.UNSIGNED_INT:this._gl.UNSIGNED_SHORT,n=this._uintIndicesCurrentlySet?4:2;i?this._gl.drawElementsInstanced(s,r,a,t*n,i):this._gl.drawElements(s,r,a,t*n)}drawArraysType(e,t,r,i){this.applyStates(),this._reportDrawCall();let s=this._drawMode(e);i?this._gl.drawArraysInstanced(s,t,r,i):this._gl.drawArrays(s,t,r)}_drawMode(e){switch(e){case 0:default:return this._gl.TRIANGLES;case 2:case 3:return this._gl.POINTS;case 1:case 4:return this._gl.LINES;case 5:return this._gl.LINE_LOOP;case 6:return this._gl.LINE_STRIP;case 7:return this._gl.TRIANGLE_STRIP;case 8:return this._gl.TRIANGLE_FAN}}_releaseEffect(e){this._compiledEffects[e._key]&&delete this._compiledEffects[e._key];let t=e.getPipelineContext();t&&this._deletePipelineContext(t)}_deletePipelineContext(e){e&&e.program&&(e.program.__SPECTOR_rebuildProgram=null,(0,S.resetCachedPipeline)(e),this._gl&&(this._currentProgram===e.program&&this._setProgram(null),this._gl.deleteProgram(e.program)))}_getGlobalDefines(e){return(0,x._GetGlobalDefines)(e,this.isNDCHalfZRange,this.useReverseDepthBuffer,this.useExactSrgbConversions)}createEffect(e,t,r,i,s,a,n,_,l,o=0,c){let g="string"==typeof e?e:e.vertexToken||e.vertexSource||e.vertexElement||e.vertex,f="string"==typeof e?e:e.fragmentToken||e.fragmentSource||e.fragmentElement||e.fragment,d=this._getGlobalDefines(),E=void 0!==t.attributes,T=s??t.defines??"";d&&(T+=d);let R=g+"+"+f+"@"+T;if(this._compiledEffects[R]){let e=this._compiledEffects[R];return n&&e.isReady()&&n(e),e._refCount++,e}this._gl&&(0,u.getStateObject)(this._gl);let p=new h.Effect(e,t,E?this:r,i,this,s,a,n,_,l,R,t.shaderLanguage??o,t.extraInitializationsAsync??c);return this._compiledEffects[R]=p,p}_getShaderSource(e){return this._gl.getShaderSource(e)}createRawShaderProgram(e,t,r,i,s=null){let a=(0,u.getStateObject)(this._gl);return a._contextWasLost=this._contextWasLost,a.validateShaderPrograms=this.validateShaderPrograms,(0,u.createRawShaderProgram)(e,t,r,i||this._gl,s)}createShaderProgram(e,t,r,i,s,a=null){let n=(0,u.getStateObject)(this._gl);return n._contextWasLost=this._contextWasLost,n.validateShaderPrograms=this.validateShaderPrograms,(0,u.createShaderProgram)(e,t,r,i,s||this._gl,a)}inlineShaderCode(e){return e}createPipelineContext(e){this._gl&&((0,u.getStateObject)(this._gl).parallelShaderCompile=this._caps.parallelShaderCompile);let t=(0,u.createPipelineContext)(this._gl,e);return t.engine=this,t}createMaterialContext(){}createDrawContext(){}_finalizePipelineContext(e){return(0,u._finalizePipelineContext)(e,this._gl,this.validateShaderPrograms)}_preparePipelineContextAsync(e,t,r,i,s,a,n,_,l,h,o){let c=(0,u.getStateObject)(this._gl);return c._contextWasLost=this._contextWasLost,c.validateShaderPrograms=this.validateShaderPrograms,c._createShaderProgramInjection=this._createShaderProgram.bind(this),c.createRawShaderProgramInjection=this.createRawShaderProgram.bind(this),c.createShaderProgramInjection=this.createShaderProgram.bind(this),c.loadFileInjection=this._loadFile.bind(this),(0,u._preparePipelineContext)(e,t,r,i,s,a,n,_,l,h,o)}_createShaderProgram(e,t,r,i,s=null){return(0,u._createShaderProgram)(e,t,r,i,s)}_isRenderingStateCompiled(e){return!this._isDisposed&&(0,u._isRenderingStateCompiled)(e,this._gl,this.validateShaderPrograms)}_executeWhenRenderingStateIsCompiled(e,t){(0,u._executeWhenRenderingStateIsCompiled)(e,t)}getUniforms(e,t){let r=[];for(let i=0;i<t.length;i++)r.push(this._gl.getUniformLocation(e.program,t[i]));return r}getAttributes(e,t){let r=[];for(let i=0;i<t.length;i++)try{r.push(this._gl.getAttribLocation(e.program,t[i]))}catch(e){r.push(-1)}return r}enableEffect(e){(e=null!==e&&(0,c.IsWrapper)(e)?e.effect:e)&&e!==this._currentEffect&&(this._stencilStateComposer.stencilMaterial=void 0,this.bindSamplers(e),this._currentEffect=e,e.onBind&&e.onBind(e),e._onBindObservable&&e._onBindObservable.notifyObservers(e))}setInt(e,t){return!!e&&(this._gl.uniform1i(e,t),!0)}setInt2(e,t,r){return!!e&&(this._gl.uniform2i(e,t,r),!0)}setInt3(e,t,r,i){return!!e&&(this._gl.uniform3i(e,t,r,i),!0)}setInt4(e,t,r,i,s){return!!e&&(this._gl.uniform4i(e,t,r,i,s),!0)}setIntArray(e,t){return!!e&&(this._gl.uniform1iv(e,t),!0)}setIntArray2(e,t){return!!e&&t.length%2==0&&(this._gl.uniform2iv(e,t),!0)}setIntArray3(e,t){return!!e&&t.length%3==0&&(this._gl.uniform3iv(e,t),!0)}setIntArray4(e,t){return!!e&&t.length%4==0&&(this._gl.uniform4iv(e,t),!0)}setUInt(e,t){return!!e&&(this._gl.uniform1ui(e,t),!0)}setUInt2(e,t,r){return!!e&&(this._gl.uniform2ui(e,t,r),!0)}setUInt3(e,t,r,i){return!!e&&(this._gl.uniform3ui(e,t,r,i),!0)}setUInt4(e,t,r,i,s){return!!e&&(this._gl.uniform4ui(e,t,r,i,s),!0)}setUIntArray(e,t){return!!e&&(this._gl.uniform1uiv(e,t),!0)}setUIntArray2(e,t){return!!e&&t.length%2==0&&(this._gl.uniform2uiv(e,t),!0)}setUIntArray3(e,t){return!!e&&t.length%3==0&&(this._gl.uniform3uiv(e,t),!0)}setUIntArray4(e,t){return!!e&&t.length%4==0&&(this._gl.uniform4uiv(e,t),!0)}setArray(e,t){return!!e&&!(t.length<1)&&(this._gl.uniform1fv(e,t),!0)}setArray2(e,t){return!!e&&t.length%2==0&&(this._gl.uniform2fv(e,t),!0)}setArray3(e,t){return!!e&&t.length%3==0&&(this._gl.uniform3fv(e,t),!0)}setArray4(e,t){return!!e&&t.length%4==0&&(this._gl.uniform4fv(e,t),!0)}setMatrices(e,t){return!!e&&(this._gl.uniformMatrix4fv(e,!1,t),!0)}setMatrix3x3(e,t){return!!e&&(this._gl.uniformMatrix3fv(e,!1,t),!0)}setMatrix2x2(e,t){return!!e&&(this._gl.uniformMatrix2fv(e,!1,t),!0)}setFloat(e,t){return!!e&&(this._gl.uniform1f(e,t),!0)}setFloat2(e,t,r){return!!e&&(this._gl.uniform2f(e,t,r),!0)}setFloat3(e,t,r,i){return!!e&&(this._gl.uniform3f(e,t,r,i),!0)}setFloat4(e,t,r,i,s){return!!e&&(this._gl.uniform4f(e,t,r,i,s),!0)}applyStates(){if(this._depthCullingState.apply(this._gl),this._stencilStateComposer.apply(this._gl),this._alphaState.apply(this._gl,this._currentRenderTarget&&this._currentRenderTarget.textures?this._currentRenderTarget.textures.length:1),this._colorWriteChanged){this._colorWriteChanged=!1;let e=this._colorWrite;this._gl.colorMask(e,e,e,e)}}wipeCaches(e){(!this.preventCacheWipeBetweenFrames||e)&&(this._currentEffect=null,this._viewportCached.x=0,this._viewportCached.y=0,this._viewportCached.z=0,this._viewportCached.w=0,this._unbindVertexArrayObject(),e&&(this._currentProgram=null,this.resetTextureCache(),this._stencilStateComposer.reset(),this._depthCullingState.reset(),this._depthCullingState.depthFunc=this._gl.LEQUAL,this._alphaState.reset(),this._resetAlphaMode(),this._colorWrite=!0,this._colorWriteChanged=!0,this._unpackFlipYCached=null,this._gl.pixelStorei(this._gl.UNPACK_COLORSPACE_CONVERSION_WEBGL,this._gl.NONE),this._gl.pixelStorei(this._gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,0),this._mustWipeVertexAttributes=!0,this.unbindAllAttributes()),this._resetVertexBufferBinding(),this._cachedIndexBuffer=null,this._cachedEffectForVertexBuffers=null,this.bindIndexBuffer(null))}_getSamplingParameters(e,t){let r=this._gl,i=r.NEAREST,s=r.NEAREST,a=!1;switch(e){case 11:i=r.LINEAR,s=t?r.LINEAR_MIPMAP_NEAREST:r.LINEAR;break;case 3:i=r.LINEAR,a=!0,s=t?r.LINEAR_MIPMAP_LINEAR:r.LINEAR;break;case 8:a=!0,i=r.NEAREST,s=t?r.NEAREST_MIPMAP_LINEAR:r.NEAREST;break;case 4:i=r.NEAREST,s=t?r.NEAREST_MIPMAP_NEAREST:r.NEAREST;break;case 5:i=r.NEAREST,s=t?r.LINEAR_MIPMAP_NEAREST:r.LINEAR;break;case 6:a=!0,i=r.NEAREST,s=t?r.LINEAR_MIPMAP_LINEAR:r.LINEAR;break;case 7:i=r.NEAREST,s=r.LINEAR;break;case 1:i=r.NEAREST,s=r.NEAREST;break;case 9:i=r.LINEAR,s=t?r.NEAREST_MIPMAP_NEAREST:r.NEAREST;break;case 10:a=!0,i=r.LINEAR,s=t?r.NEAREST_MIPMAP_LINEAR:r.NEAREST;break;case 2:i=r.LINEAR,s=r.LINEAR;break;case 12:i=r.LINEAR,s=r.NEAREST}return{min:s,mag:i,hasMipMaps:a}}_createTexture(){let e=this._gl.createTexture();if(!e)throw Error("Unable to create texture");return e}_createHardwareTexture(){return new p(this._createTexture(),this._gl)}_createInternalTexture(e,t,r=!0,i=0){let s,a,n=!1,_=0,l=3,h=5,u=!1,o=1,c=!1,f=0,d=!1;void 0!==t&&"object"==typeof t?(s=!!t.generateMipMaps,n=!!t.createMipMaps,_=void 0===t.type?0:t.type,l=void 0===t.samplingMode?3:t.samplingMode,h=void 0===t.format?5:t.format,u=void 0!==t.useSRGBBuffer&&t.useSRGBBuffer,o=t.samples??1,a=t.label,c=!!t.createMSAATexture,f=t.comparisonFunction||0,d=!!t.isCube):s=!!t,u&&(u=this._caps.supportSRGBBuffers&&(this.webGLVersion>1||this.isWebGPU)),(1!==_||this._caps.textureFloatLinearFiltering)&&(2!==_||this._caps.textureHalfFloatLinearFiltering)||(l=1),1!==_||this._caps.textureFloat||(_=0,g.Logger.Warn("Float textures are not supported. Type forced to TEXTURETYPE_UNSIGNED_BYTE"));let E=b(h),T=m(h),R=this._gl,p=new A.InternalTexture(this,i),x=e.width||e,S=e.height||e,B=e.depth||0,C=e.layers||0,P=this._getSamplingParameters(l,(s||n)&&!E),L=0!==C?R.TEXTURE_2D_ARRAY:0!==B?R.TEXTURE_3D:d?R.TEXTURE_CUBE_MAP:R.TEXTURE_2D,M=E?this._getInternalFormatFromDepthTextureFormat(h,!0,T):this._getRGBABufferInternalSizedFormat(_,h,u),G=E?T?R.DEPTH_STENCIL:R.DEPTH_COMPONENT:this._getInternalFormat(h),I=E?this._getWebGLTextureTypeFromDepthTextureFormat(h):this._getWebGLTextureType(_);if(this._bindTextureDirectly(L,p),0!==C)p.is2DArray=!0,R.texImage3D(L,0,M,x,S,C,0,G,I,null);else if(0!==B)p.is3D=!0,R.texImage3D(L,0,M,x,S,B,0,G,I,null);else if(d){p.isCube=!0;for(let e=0;e<6;e++)R.texImage2D(R.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,M,x,S,0,G,I,null)}else R.texImage2D(L,0,M,x,S,0,G,I,null);if(R.texParameteri(L,R.TEXTURE_MAG_FILTER,P.mag),R.texParameteri(L,R.TEXTURE_MIN_FILTER,P.min),R.texParameteri(L,R.TEXTURE_WRAP_S,R.CLAMP_TO_EDGE),R.texParameteri(L,R.TEXTURE_WRAP_T,R.CLAMP_TO_EDGE),E&&this.webGLVersion>1&&(0===f?(R.texParameteri(L,R.TEXTURE_COMPARE_FUNC,515),R.texParameteri(L,R.TEXTURE_COMPARE_MODE,R.NONE)):(R.texParameteri(L,R.TEXTURE_COMPARE_FUNC,f),R.texParameteri(L,R.TEXTURE_COMPARE_MODE,R.COMPARE_REF_TO_TEXTURE))),(s||n)&&this._gl.generateMipmap(L),this._bindTextureDirectly(L,null),p._useSRGBBuffer=u,p.baseWidth=x,p.baseHeight=S,p.width=x,p.height=S,p.depth=C||B,p.isReady=!0,p.samples=o,p.generateMipMaps=s,p.samplingMode=l,p.type=_,p.format=h,p.label=a,p.comparisonFunction=f,this._internalTexturesCache.push(p),c){let e;if(!(e=b(p.format)?this._setupFramebufferDepthAttachments(m(p.format),19!==p.format,p.width,p.height,o,p.format,!0):this._createRenderBuffer(p.width,p.height,o,-1,this._getRGBABufferInternalSizedFormat(p.type,p.format,p._useSRGBBuffer),-1)))throw Error("Unable to create render buffer");p._autoMSAAManagement=!0;let t=p._hardwareTexture;t||(t=p._hardwareTexture=this._createHardwareTexture()),t.addMSAARenderBuffer(e)}return p}_getUseSRGBBuffer(e,t){return e&&this._caps.supportSRGBBuffers&&(this.webGLVersion>1||t)}createTexture(e,t,r,i,s=3,a=null,n=null,_=null,l=null,h=null,u=null,o,c,g,f){return this._createTextureBase(e,t,r,i,s,a,n,(...e)=>this._prepareWebGLTexture(...e,h),(e,t,r,s,a,n)=>{let _=this._gl,l=r.width===e&&r.height===t;a._creationFlags=g??0;let h=this._getTexImageParametersForCreateTexture(a.format,a._useSRGBBuffer);if(l)return _.texImage2D(_.TEXTURE_2D,0,h.internalFormat,h.format,h.type,r),!1;let u=this._caps.maxTextureSize;if(r.width>u||r.height>u||!this._supportsHardwareTextureRescaling)return this._prepareWorkingCanvas(),!!this._workingCanvas&&!!this._workingContext&&(this._workingCanvas.width=e,this._workingCanvas.height=t,this._workingContext.drawImage(r,0,0,r.width,r.height,0,0,e,t),_.texImage2D(_.TEXTURE_2D,0,h.internalFormat,h.format,h.type,this._workingCanvas),a.width=e,a.height=t,!1);{let e=new A.InternalTexture(this,2);this._bindTextureDirectly(_.TEXTURE_2D,e,!0),_.texImage2D(_.TEXTURE_2D,0,h.internalFormat,h.format,h.type,r),this._rescaleTexture(e,a,i,h.format,()=>{this._releaseTexture(e),this._bindTextureDirectly(_.TEXTURE_2D,a,!0),n()})}return!0},_,l,h,u,o,c,f)}_getTexImageParametersForCreateTexture(e,t){let r,i;return 1===this.webGLVersion?i=r=this._getInternalFormat(e,t):(r=this._getInternalFormat(e,!1),i=this._getRGBABufferInternalSizedFormat(0,e,t)),{internalFormat:i,format:r,type:this._gl.UNSIGNED_BYTE}}_rescaleTexture(e,t,r,i,s){}_unpackFlipY(e){this._unpackFlipYCached!==e&&(this._gl.pixelStorei(this._gl.UNPACK_FLIP_Y_WEBGL,+!!e),this.enableUnpackFlipYCached&&(this._unpackFlipYCached=e))}_getUnpackAlignement(){return this._gl.getParameter(this._gl.UNPACK_ALIGNMENT)}_getTextureTarget(e){return e.isCube?this._gl.TEXTURE_CUBE_MAP:e.is3D?this._gl.TEXTURE_3D:e.is2DArray||e.isMultiview?this._gl.TEXTURE_2D_ARRAY:this._gl.TEXTURE_2D}updateTextureSamplingMode(e,t,r=!1){let i=this._getTextureTarget(t),s=this._getSamplingParameters(e,t.useMipMaps||r);this._setTextureParameterInteger(i,this._gl.TEXTURE_MAG_FILTER,s.mag,t),this._setTextureParameterInteger(i,this._gl.TEXTURE_MIN_FILTER,s.min),r&&s.hasMipMaps&&(t.generateMipMaps=!0,this._gl.generateMipmap(i)),this._bindTextureDirectly(i,null),t.samplingMode=e}updateTextureDimensions(e,t,r,i=1){}updateTextureWrappingMode(e,t,r=null,i=null){let s=this._getTextureTarget(e);null!==t&&(this._setTextureParameterInteger(s,this._gl.TEXTURE_WRAP_S,this._getTextureWrapMode(t),e),e._cachedWrapU=t),null!==r&&(this._setTextureParameterInteger(s,this._gl.TEXTURE_WRAP_T,this._getTextureWrapMode(r),e),e._cachedWrapV=r),(e.is2DArray||e.is3D)&&null!==i&&(this._setTextureParameterInteger(s,this._gl.TEXTURE_WRAP_R,this._getTextureWrapMode(i),e),e._cachedWrapR=i),this._bindTextureDirectly(s,null)}_uploadCompressedDataToTextureDirectly(e,t,r,i,s,a=0,n=0){let _=this._gl,l=_.TEXTURE_2D;if(e.isCube&&(l=_.TEXTURE_CUBE_MAP_POSITIVE_X+a),e._useSRGBBuffer)switch(t){case 37492:case 36196:this._caps.etc2?t=_.COMPRESSED_SRGB8_ETC2:e._useSRGBBuffer=!1;break;case 37496:this._caps.etc2?t=_.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:e._useSRGBBuffer=!1;break;case 36492:t=_.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT;break;case 37808:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR;break;case 37809:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR;break;case 37810:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR;break;case 37811:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR;break;case 37812:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR;break;case 37813:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR;break;case 37814:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR;break;case 37815:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR;break;case 37816:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR;break;case 37817:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR;break;case 37818:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR;break;case 37819:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR;break;case 37820:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR;break;case 37821:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR;break;case 33776:this._caps.s3tc_srgb?t=_.COMPRESSED_SRGB_S3TC_DXT1_EXT:e._useSRGBBuffer=!1;break;case 33777:this._caps.s3tc_srgb?t=_.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:e._useSRGBBuffer=!1;break;case 33779:this._caps.s3tc_srgb?t=_.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:e._useSRGBBuffer=!1;break;default:e._useSRGBBuffer=!1}if(e.generateMipMaps){let a=e._hardwareTexture;a.memoryAllocated||(_.texStorage2D(e.isCube?_.TEXTURE_CUBE_MAP:_.TEXTURE_2D,Math.floor(Math.log2(Math.max(r,i)))+1,t,e.width,e.height),a.memoryAllocated=!0),this._gl.compressedTexSubImage2D(l,n,0,0,r,i,t,s)}else this._gl.compressedTexImage2D(l,n,t,r,i,0,s)}_uploadDataToTextureDirectly(e,t,r=0,i=0,s,a=!1){let n=this._gl,_=this._getWebGLTextureType(e.type),l=this._getInternalFormat(e.format),h=void 0===s?this._getRGBABufferInternalSizedFormat(e.type,e.format,e._useSRGBBuffer):this._getInternalFormat(s,e._useSRGBBuffer);this._unpackFlipY(e.invertY);let u=n.TEXTURE_2D;e.isCube&&(u=n.TEXTURE_CUBE_MAP_POSITIVE_X+r);let o=Math.round(Math.log(e.width)*Math.LOG2E),c=Math.round(Math.log(e.height)*Math.LOG2E),g=a?e.width:Math.pow(2,Math.max(o-i,0)),f=a?e.height:Math.pow(2,Math.max(c-i,0));n.texImage2D(u,i,h,g,f,0,l,_,t)}updateTextureData(e,t,r,i,s,a,n=0,_=0,l=!1){let h=this._gl,u=this._getWebGLTextureType(e.type),o=this._getInternalFormat(e.format);this._unpackFlipY(e.invertY);let c=h.TEXTURE_2D,g=h.TEXTURE_2D;e.isCube&&(g=h.TEXTURE_CUBE_MAP_POSITIVE_X+n,c=h.TEXTURE_CUBE_MAP),this._bindTextureDirectly(c,e,!0),h.texSubImage2D(g,_,r,i,s,a,o,u,t),l&&this._gl.generateMipmap(g),this._bindTextureDirectly(c,null)}_uploadArrayBufferViewToTexture(e,t,r=0,i=0){let s=this._gl,a=e.isCube?s.TEXTURE_CUBE_MAP:s.TEXTURE_2D;this._bindTextureDirectly(a,e,!0),this._uploadDataToTextureDirectly(e,t,r,i),this._bindTextureDirectly(a,null,!0)}_prepareWebGLTextureContinuation(e,t,r,i,s){let a=this._gl;if(!a)return;let n=this._getSamplingParameters(s,!r);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,n.mag),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,n.min),r||i||a.generateMipmap(a.TEXTURE_2D),this._bindTextureDirectly(a.TEXTURE_2D,null),t&&t.removePendingData(e),e.onLoadedObservable.notifyObservers(e),e.onLoadedObservable.clear()}_prepareWebGLTexture(e,t,r,i,s,a,n,_,l,h){let u=this.getCaps().maxTextureSize,o=Math.min(u,this.needPOTTextures?(0,R.GetExponentOfTwo)(i.width,u):i.width),c=Math.min(u,this.needPOTTextures?(0,R.GetExponentOfTwo)(i.height,u):i.height),g=this._gl;if(g){if(!e._hardwareTexture){r&&r.removePendingData(e);return}this._bindTextureDirectly(g.TEXTURE_2D,e,!0),this._unpackFlipY(void 0===s||!!s),e.baseWidth=i.width,e.baseHeight=i.height,e.width=o,e.height=c,e.isReady=!0,e.type=-1!==e.type?e.type:0,e.format=-1!==e.format?e.format:h??(".jpg"!==t||e._useSRGBBuffer?5:4),_(o,c,i,t,e,()=>{this._prepareWebGLTextureContinuation(e,r,a,n,l)})||this._prepareWebGLTextureContinuation(e,r,a,n,l)}}_getInternalFormatFromDepthTextureFormat(e,t,r){let i=this._gl;if(!t)return i.STENCIL_INDEX8;let s=r?i.DEPTH_STENCIL:i.DEPTH_COMPONENT;return this.webGLVersion>1?15===e?s=i.DEPTH_COMPONENT16:16===e?s=i.DEPTH_COMPONENT24:17===e||13===e?s=r?i.DEPTH24_STENCIL8:i.DEPTH_COMPONENT24:14===e?s=i.DEPTH_COMPONENT32F:18===e&&(s=r?i.DEPTH32F_STENCIL8:i.DEPTH_COMPONENT32F):s=i.DEPTH_COMPONENT16,s}_getWebGLTextureTypeFromDepthTextureFormat(e){let t=this._gl,r=t.UNSIGNED_INT;return 15===e?r=t.UNSIGNED_SHORT:17===e||13===e?r=t.UNSIGNED_INT_24_8:14===e?r=t.FLOAT:18===e?r=t.FLOAT_32_UNSIGNED_INT_24_8_REV:19===e&&(r=t.UNSIGNED_BYTE),r}_setupFramebufferDepthAttachments(e,t,r,i,s=1,a,n=!1){let _=this._gl;a=a??(e?13:14);let l=this._getInternalFormatFromDepthTextureFormat(a,t,e);return e&&t?this._createRenderBuffer(r,i,s,_.DEPTH_STENCIL,l,n?-1:_.DEPTH_STENCIL_ATTACHMENT):t?this._createRenderBuffer(r,i,s,l,l,n?-1:_.DEPTH_ATTACHMENT):e?this._createRenderBuffer(r,i,s,l,l,n?-1:_.STENCIL_ATTACHMENT):null}_createRenderBuffer(e,t,r,i,s,a,n=!0){let _=this._gl.createRenderbuffer();return this._updateRenderBuffer(_,e,t,r,i,s,a,n)}_updateRenderBuffer(e,t,r,i,s,a,n,_=!0){let l=this._gl;return l.bindRenderbuffer(l.RENDERBUFFER,e),i>1&&l.renderbufferStorageMultisample?l.renderbufferStorageMultisample(l.RENDERBUFFER,i,a,t,r):l.renderbufferStorage(l.RENDERBUFFER,s,t,r),-1!==n&&l.framebufferRenderbuffer(l.FRAMEBUFFER,n,l.RENDERBUFFER,e),_&&l.bindRenderbuffer(l.RENDERBUFFER,null),e}_releaseTexture(e){this._deleteTexture(e._hardwareTexture),this.unbindAllTextures();let t=this._internalTexturesCache.indexOf(e);-1!==t&&this._internalTexturesCache.splice(t,1),e._lodTextureHigh&&e._lodTextureHigh.dispose(),e._lodTextureMid&&e._lodTextureMid.dispose(),e._lodTextureLow&&e._lodTextureLow.dispose(),e._irradianceTexture&&e._irradianceTexture.dispose()}_deleteTexture(e){e?.release()}_setProgram(e){this._currentProgram!==e&&((0,u._setProgram)(e,this._gl),this._currentProgram=e)}bindSamplers(e){let t=e.getPipelineContext();this._setProgram(t.program);let r=e.getSamplers();for(let t=0;t<r.length;t++){let i=e.getUniform(r[t]);i&&(this._boundUniforms[t]=i)}this._currentEffect=null}_activateCurrentTexture(){this._currentTextureChannel!==this._activeChannel&&(this._gl.activeTexture(this._gl.TEXTURE0+this._activeChannel),this._currentTextureChannel=this._activeChannel)}_bindTextureDirectly(e,t,r=!1,i=!1){let s=!1,a=t&&t._associatedChannel>-1;if(r&&a&&(this._activeChannel=t._associatedChannel),this._boundTexturesCache[this._activeChannel]!==t||i){if(this._activateCurrentTexture(),t&&t.isMultiview)throw g.Logger.Error(["_bindTextureDirectly called with a multiview texture!",e,t]),"_bindTextureDirectly called with a multiview texture!";this._gl.bindTexture(e,t?._hardwareTexture?.underlyingResource??null),this._boundTexturesCache[this._activeChannel]=t,t&&(t._associatedChannel=this._activeChannel)}else r&&(s=!0,this._activateCurrentTexture());return a&&!r&&this._bindSamplerUniformToChannel(t._associatedChannel,this._activeChannel),s}_bindTexture(e,t,r){if(void 0===e)return;t&&(t._associatedChannel=e),this._activeChannel=e;let i=t?this._getTextureTarget(t):this._gl.TEXTURE_2D;this._bindTextureDirectly(i,t)}unbindAllTextures(){for(let e=0;e<this._maxSimultaneousTextures;e++)this._activeChannel=e,this._bindTextureDirectly(this._gl.TEXTURE_2D,null),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null),this.webGLVersion>1&&(this._bindTextureDirectly(this._gl.TEXTURE_3D,null),this._bindTextureDirectly(this._gl.TEXTURE_2D_ARRAY,null))}setTexture(e,t,r,i){void 0!==e&&(t&&(this._boundUniforms[e]=t),this._setTexture(e,r))}_bindSamplerUniformToChannel(e,t){let r=this._boundUniforms[e];r&&r._currentState!==t&&(this._gl.uniform1i(r,t),r._currentState=t)}_getTextureWrapMode(e){switch(e){case 1:break;case 0:return this._gl.CLAMP_TO_EDGE;case 2:return this._gl.MIRRORED_REPEAT}return this._gl.REPEAT}_setTexture(e,t,r=!1,i=!1,s=""){let a;if(!t)return null!=this._boundTexturesCache[e]&&(this._activeChannel=e,this._bindTextureDirectly(this._gl.TEXTURE_2D,null),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null),this.webGLVersion>1&&(this._bindTextureDirectly(this._gl.TEXTURE_3D,null),this._bindTextureDirectly(this._gl.TEXTURE_2D_ARRAY,null))),!1;if(t.video){this._activeChannel=e;let r=t.getInternalTexture();r&&(r._associatedChannel=e),t.update()}else if(4===t.delayLoadState)return t.delayLoad(),!1;a=i?t.depthStencilTexture:t.isReady()?t.getInternalTexture():t.isCube?this.emptyCubeTexture:t.is3D?this.emptyTexture3D:t.is2DArray?this.emptyTexture2DArray:this.emptyTexture,!r&&a&&(a._associatedChannel=e);let n=!0;this._boundTexturesCache[e]===a&&(r||this._bindSamplerUniformToChannel(a._associatedChannel,e),n=!1),this._activeChannel=e;let _=this._getTextureTarget(a);if(n&&this._bindTextureDirectly(_,a,r),a&&!a.isMultiview){if(a.isCube&&a._cachedCoordinatesMode!==t.coordinatesMode){a._cachedCoordinatesMode=t.coordinatesMode;let e=+(3!==t.coordinatesMode&&5!==t.coordinatesMode);t.wrapU=e,t.wrapV=e}a._cachedWrapU!==t.wrapU&&(a._cachedWrapU=t.wrapU,this._setTextureParameterInteger(_,this._gl.TEXTURE_WRAP_S,this._getTextureWrapMode(t.wrapU),a)),a._cachedWrapV!==t.wrapV&&(a._cachedWrapV=t.wrapV,this._setTextureParameterInteger(_,this._gl.TEXTURE_WRAP_T,this._getTextureWrapMode(t.wrapV),a)),a.is3D&&a._cachedWrapR!==t.wrapR&&(a._cachedWrapR=t.wrapR,this._setTextureParameterInteger(_,this._gl.TEXTURE_WRAP_R,this._getTextureWrapMode(t.wrapR),a)),this._setAnisotropicLevel(_,a,t.anisotropicFilteringLevel)}return!0}setTextureArray(e,t,r,i){if(void 0!==e&&t){this._textureUnits&&this._textureUnits.length===r.length||(this._textureUnits=new Int32Array(r.length));for(let t=0;t<r.length;t++){let i=r[t].getInternalTexture();i?(this._textureUnits[t]=e+t,i._associatedChannel=e+t):this._textureUnits[t]=-1}this._gl.uniform1iv(t,this._textureUnits);for(let e=0;e<r.length;e++)this._setTexture(this._textureUnits[e],r[e],!0)}}_setAnisotropicLevel(e,t,r){let i=this._caps.textureAnisotropicFilterExtension;11!==t.samplingMode&&3!==t.samplingMode&&2!==t.samplingMode&&(r=1),i&&t._cachedAnisotropicFilteringLevel!==r&&(this._setTextureParameterFloat(e,i.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(r,this._caps.maxAnisotropy),t),t._cachedAnisotropicFilteringLevel=r)}_setTextureParameterFloat(e,t,r,i){this._bindTextureDirectly(e,i,!0,!0),this._gl.texParameterf(e,t,r)}_setTextureParameterInteger(e,t,r,i){i&&this._bindTextureDirectly(e,i,!0,!0),this._gl.texParameteri(e,t,r)}unbindAllAttributes(){if(this._mustWipeVertexAttributes){this._mustWipeVertexAttributes=!1;for(let e=0;e<this._caps.maxVertexAttribs;e++)this.disableAttributeByIndex(e);return}for(let e=0,t=this._vertexAttribArraysEnabled.length;e<t;e++)!(e>=this._caps.maxVertexAttribs)&&this._vertexAttribArraysEnabled[e]&&this.disableAttributeByIndex(e)}releaseEffects(){this._compiledEffects={},this.onReleaseEffectsObservable.notifyObservers(this)}dispose(){(0,f.IsWindowObjectExist)()&&this._renderingCanvas&&(this._renderingCanvas.removeEventListener("webglcontextlost",this._onContextLost),this._onContextRestored&&this._renderingCanvas.removeEventListener("webglcontextrestored",this._onContextRestored)),super.dispose(),this._dummyFramebuffer&&this._gl.deleteFramebuffer(this._dummyFramebuffer),this.unbindAllAttributes(),this._boundUniforms={},this._workingCanvas=null,this._workingContext=null,this._currentBufferPointers.length=0,this._currentProgram=null,this._creationOptions.loseContextOnDispose&&this._gl.getExtension("WEBGL_lose_context")?.loseContext(),(0,u.deleteStateObject)(this._gl)}attachContextLostEvent(e){this._renderingCanvas&&this._renderingCanvas.addEventListener("webglcontextlost",e,!1)}attachContextRestoredEvent(e){this._renderingCanvas&&this._renderingCanvas.addEventListener("webglcontextrestored",e,!1)}getError(){return this._gl.getError()}_canRenderToFloatFramebuffer(){return this._webGLVersion>1?this._caps.colorBufferFloat:this._canRenderToFramebuffer(1)}_canRenderToHalfFloatFramebuffer(){return this._webGLVersion>1?this._caps.colorBufferFloat:this._canRenderToFramebuffer(2)}_canRenderToFramebuffer(e){let t=this._gl;for(;t.getError()!==t.NO_ERROR;);let r=!0,i=t.createTexture();t.bindTexture(t.TEXTURE_2D,i),t.texImage2D(t.TEXTURE_2D,0,this._getRGBABufferInternalSizedFormat(e),1,1,0,t.RGBA,this._getWebGLTextureType(e),null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST);let s=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,s),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,i,0);let a=t.checkFramebufferStatus(t.FRAMEBUFFER);if((r=(r=r&&a===t.FRAMEBUFFER_COMPLETE)&&t.getError()===t.NO_ERROR)&&(t.clear(t.COLOR_BUFFER_BIT),r=r&&t.getError()===t.NO_ERROR),r){t.bindFramebuffer(t.FRAMEBUFFER,null);let e=t.RGBA,i=t.UNSIGNED_BYTE,s=new Uint8Array(4);t.readPixels(0,0,1,1,e,i,s),r=r&&t.getError()===t.NO_ERROR}for(t.deleteTexture(i),t.deleteFramebuffer(s),t.bindFramebuffer(t.FRAMEBUFFER,null);!r&&t.getError()!==t.NO_ERROR;);return r}_getWebGLTextureType(e){if(1===this._webGLVersion){switch(e){case 1:return this._gl.FLOAT;case 2:return this._gl.HALF_FLOAT_OES;case 0:break;case 8:return this._gl.UNSIGNED_SHORT_4_4_4_4;case 9:return this._gl.UNSIGNED_SHORT_5_5_5_1;case 10:return this._gl.UNSIGNED_SHORT_5_6_5}return this._gl.UNSIGNED_BYTE}switch(e){case 3:return this._gl.BYTE;case 0:break;case 4:return this._gl.SHORT;case 5:return this._gl.UNSIGNED_SHORT;case 6:return this._gl.INT;case 7:return this._gl.UNSIGNED_INT;case 1:return this._gl.FLOAT;case 2:return this._gl.HALF_FLOAT;case 8:return this._gl.UNSIGNED_SHORT_4_4_4_4;case 9:return this._gl.UNSIGNED_SHORT_5_5_5_1;case 10:return this._gl.UNSIGNED_SHORT_5_6_5;case 11:return this._gl.UNSIGNED_INT_2_10_10_10_REV;case 12:return this._gl.UNSIGNED_INT_24_8;case 13:return this._gl.UNSIGNED_INT_10F_11F_11F_REV;case 14:return this._gl.UNSIGNED_INT_5_9_9_9_REV;case 15:return this._gl.FLOAT_32_UNSIGNED_INT_24_8_REV}return this._gl.UNSIGNED_BYTE}_getInternalFormat(e,t=!1){let r=t?this._glSRGBExtensionValues.SRGB8_ALPHA8:this._gl.RGBA;switch(e){case 0:r=this._gl.ALPHA;break;case 1:r=this._gl.LUMINANCE;break;case 2:r=this._gl.LUMINANCE_ALPHA;break;case 6:case 33322:case 36760:r=this._gl.RED;break;case 7:case 33324:case 36761:r=this._gl.RG;break;case 4:case 32852:case 36762:r=t?this._glSRGBExtensionValues.SRGB:this._gl.RGB;break;case 5:case 32859:case 36763:r=t?this._glSRGBExtensionValues.SRGB8_ALPHA8:this._gl.RGBA}if(this._webGLVersion>1)switch(e){case 8:r=this._gl.RED_INTEGER;break;case 9:r=this._gl.RG_INTEGER;break;case 10:r=this._gl.RGB_INTEGER;break;case 11:r=this._gl.RGBA_INTEGER}return r}_getRGBABufferInternalSizedFormat(e,t,r=!1){if(1===this._webGLVersion){if(void 0!==t)switch(t){case 0:return this._gl.ALPHA;case 1:return this._gl.LUMINANCE;case 2:return this._gl.LUMINANCE_ALPHA;case 4:return r?this._glSRGBExtensionValues.SRGB:this._gl.RGB}return this._gl.RGBA}switch(e){case 3:switch(t){case 6:return this._gl.R8_SNORM;case 7:return this._gl.RG8_SNORM;case 4:return this._gl.RGB8_SNORM;case 8:return this._gl.R8I;case 9:return this._gl.RG8I;case 10:return this._gl.RGB8I;case 11:return this._gl.RGBA8I;default:return this._gl.RGBA8_SNORM}case 0:switch(t){case 6:return this._gl.R8;case 7:return this._gl.RG8;case 4:return r?this._glSRGBExtensionValues.SRGB8:this._gl.RGB8;case 5:return r?this._glSRGBExtensionValues.SRGB8_ALPHA8:this._gl.RGBA8;case 8:return this._gl.R8UI;case 9:return this._gl.RG8UI;case 10:return this._gl.RGB8UI;case 11:return this._gl.RGBA8UI;case 0:return this._gl.ALPHA;case 1:return this._gl.LUMINANCE;case 2:return this._gl.LUMINANCE_ALPHA;default:return this._gl.RGBA8}case 4:switch(t){case 8:return this._gl.R16I;case 36760:return this._gl.R16_SNORM_EXT;case 36761:return this._gl.RG16_SNORM_EXT;case 36762:return this._gl.RGB16_SNORM_EXT;case 36763:return this._gl.RGBA16_SNORM_EXT;case 9:return this._gl.RG16I;case 10:return this._gl.RGB16I;default:return this._gl.RGBA16I}case 5:switch(t){case 8:return this._gl.R16UI;case 33322:return this._gl.R16_EXT;case 33324:return this._gl.RG16_EXT;case 32852:return this._gl.RGB16_EXT;case 32859:return this._gl.RGBA16_EXT;case 9:return this._gl.RG16UI;case 10:return this._gl.RGB16UI;default:return this._gl.RGBA16UI}case 6:switch(t){case 8:return this._gl.R32I;case 9:return this._gl.RG32I;case 10:return this._gl.RGB32I;default:return this._gl.RGBA32I}case 7:switch(t){case 8:return this._gl.R32UI;case 9:return this._gl.RG32UI;case 10:return this._gl.RGB32UI;default:return this._gl.RGBA32UI}case 1:switch(t){case 6:return this._gl.R32F;case 7:return this._gl.RG32F;case 4:return this._gl.RGB32F;default:return this._gl.RGBA32F}case 2:switch(t){case 6:return this._gl.R16F;case 7:return this._gl.RG16F;case 4:return this._gl.RGB16F;default:return this._gl.RGBA16F}case 10:return this._gl.RGB565;case 13:return this._gl.R11F_G11F_B10F;case 14:return this._gl.RGB9_E5;case 8:return this._gl.RGBA4;case 9:return this._gl.RGB5_A1;case 11:switch(t){case 5:default:return this._gl.RGB10_A2;case 11:return this._gl.RGB10_A2UI}}return r?this._glSRGBExtensionValues.SRGB8_ALPHA8:this._gl.RGBA8}readPixels(e,t,r,i,s=!0,a=!0,n=null){let _=s?this._gl.RGBA:this._gl.RGB,l=r*i*(s?4:3);if(n){if(n.length<l)return g.Logger.Error(`Data buffer is too small to store the read pixels (${n.length} should be more than ${l})`),Promise.resolve(n)}else n=new Uint8Array(l);return a&&this.flushFramebuffer(),this._gl.readPixels(e,t,r,i,_,this._gl.UNSIGNED_BYTE,n),Promise.resolve(n)}static get IsSupportedAsync(){return Promise.resolve(this.isSupported())}static get IsSupported(){return this.isSupported()}static isSupported(){if(null!==this._HasMajorPerformanceCaveat)return!this._HasMajorPerformanceCaveat;if(null===this._IsSupported)try{let e=o.AbstractEngine._CreateCanvas(1,1),t=e.getContext("webgl")||e.getContext("experimental-webgl");this._IsSupported=null!=t&&!!globalThis.WebGLRenderingContext}catch(e){this._IsSupported=!1}return this._IsSupported}static get HasMajorPerformanceCaveat(){if(null===this._HasMajorPerformanceCaveat)try{let e=o.AbstractEngine._CreateCanvas(1,1),t=e.getContext("webgl",{failIfMajorPerformanceCaveat:!0})||e.getContext("experimental-webgl",{failIfMajorPerformanceCaveat:!0});this._HasMajorPerformanceCaveat=!t}catch(e){this._HasMajorPerformanceCaveat=!1}return this._HasMajorPerformanceCaveat}}L._TempClearColorUint32=new Uint32Array(4),L._TempClearColorInt32=new Int32Array(4),L.ExceptionList=[{key:"Chrome/63.0",capture:"63\\.0\\.3239\\.(\\d+)",captureConstraint:108,targets:["uniformBuffer"]},{key:"Firefox/58",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:"Firefox/59",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:"Chrome/72.+?Mobile",capture:null,captureConstraint:null,targets:["vao"]},{key:"Chrome/73.+?Mobile",capture:null,captureConstraint:null,targets:["vao"]},{key:"Chrome/74.+?Mobile",capture:null,captureConstraint:null,targets:["vao"]},{key:"Mac OS.+Chrome/71",capture:null,captureConstraint:null,targets:["vao"]},{key:"Mac OS.+Chrome/72",capture:null,captureConstraint:null,targets:["vao"]},{key:"Mac OS.+Chrome",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:"Chrome/12\\d\\..+?Mobile",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:".*AppleWebKit.*(15.4).*Safari",capture:null,captureConstraint:null,targets:["antialias","maxMSAASamples"]},{key:".*(15.4).*AppleWebKit.*Safari",capture:null,captureConstraint:null,targets:["antialias","maxMSAASamples"]}],L._ConcatenateShader=x._ConcatenateShader,L._IsSupported=null,L._HasMajorPerformanceCaveat=null,(t=L.prototype).startTimeQuery??(t.startTimeQuery=(0,C._MissingSideEffect)("ThinEngine","startTimeQuery")),(r=L.prototype).endTimeQuery??(r.endTimeQuery=(0,C._MissingSideEffect)("ThinEngine","endTimeQuery")),(i=L.prototype).createUniformBuffer??(i.createUniformBuffer=(0,C._MissingSideEffect)("ThinEngine","createUniformBuffer")),(s=L.prototype).createDynamicUniformBuffer??(s.createDynamicUniformBuffer=(0,C._MissingSideEffect)("ThinEngine","createDynamicUniformBuffer")),(a=L.prototype).updateUniformBuffer??(a.updateUniformBuffer=(0,C._MissingSideEffect)("ThinEngine","updateUniformBuffer")),(n=L.prototype).bindUniformBuffer??(n.bindUniformBuffer=(0,C._MissingSideEffect)("ThinEngine","bindUniformBuffer")),(_=L.prototype).bindUniformBufferBase??(_.bindUniformBufferBase=(0,C._MissingSideEffect)("ThinEngine","bindUniformBufferBase")),(l=L.prototype).bindUniformBlock??(l.bindUniformBlock=(0,C._MissingSideEffect)("ThinEngine","bindUniformBlock")),e.s(["ThinEngine",0,L],71379)}]);
|