@vitejs/devtools-vite 0.0.0-alpha.18 → 0.0.0-alpha.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/dist/index.d.mts +112 -9
  2. package/dist/index.mjs +107 -102
  3. package/dist/nitro.json +1 -1
  4. package/dist/public/200.html +1 -1
  5. package/dist/public/404.html +1 -1
  6. package/dist/public/_nuxt/{7Xmy2J8w.js → 07wnyZKd.js} +1 -1
  7. package/dist/public/_nuxt/{BKyQoL6o.js → B60rA_aW.js} +1 -1
  8. package/dist/public/_nuxt/{BMA1s1VI.js → B67x4GCP.js} +1 -1
  9. package/dist/public/_nuxt/{qjx43ao6.js → B8MMDSYB.js} +1 -1
  10. package/dist/public/_nuxt/{C3jmS5U3.js → BLS3T3KA.js} +1 -1
  11. package/dist/public/_nuxt/{DMWw7fde.js → BMsX1CNy.js} +1 -1
  12. package/dist/public/_nuxt/{Bexkoyc0.js → BOkXdHom.js} +1 -1
  13. package/dist/public/_nuxt/{BC_PfwI9.js → BOwnK8_Y.js} +1 -1
  14. package/dist/public/_nuxt/{Brb1aI-2.js → BYgsyBgs.js} +1 -1
  15. package/dist/public/_nuxt/{CuCopH82.js → BZp_Rqiq.js} +1 -1
  16. package/dist/public/_nuxt/{CiEs9bP4.js → Bax2Xuss.js} +1 -1
  17. package/dist/public/_nuxt/{C6Dt55Q_.js → BfzWwsgH.js} +1 -1
  18. package/dist/public/_nuxt/{DC_Jmw0F.js → Bgr0OgUi.js} +1 -1
  19. package/dist/public/_nuxt/{C2OwekHB.js → BrGG6h5U.js} +1 -1
  20. package/dist/public/_nuxt/{B3PvEETZ.js → Bt0_xjwR.js} +1 -1
  21. package/dist/public/_nuxt/{w-XmH5Bg.js → C-y-Odbu.js} +1 -1
  22. package/dist/public/_nuxt/{CEjOBQvu.js → C3ZA0X0n.js} +1 -1
  23. package/dist/public/_nuxt/{Cuw21ZGH.js → C9D_b0Ie.js} +1 -1
  24. package/dist/public/_nuxt/CbraBRjp.js +33 -0
  25. package/dist/public/_nuxt/{DPbvd5Yn.js → CquGjqBi.js} +1 -1
  26. package/dist/public/_nuxt/{CbwMXojR.js → CvbH1QZS.js} +1 -1
  27. package/dist/public/_nuxt/CwJmFVn8.js +1 -0
  28. package/dist/public/_nuxt/CyjCHwlN.js +1 -0
  29. package/dist/public/_nuxt/{D4hayKlJ.js → DFnm02Ud.js} +1 -1
  30. package/dist/public/_nuxt/{D4jWsLoz.js → DGvZD3jQ.js} +1 -1
  31. package/dist/public/_nuxt/{HdutzUjM.js → DQp_1U8q.js} +1 -1
  32. package/dist/public/_nuxt/{BZWmKTD9.js → DabxYzqu.js} +1 -1
  33. package/dist/public/_nuxt/DilC1n1-.js +6 -0
  34. package/dist/public/_nuxt/{IRC0Jirb.js → DtmncGDc.js} +1 -1
  35. package/dist/public/_nuxt/{BZtNaBML.js → DyBWaXpL.js} +1 -1
  36. package/dist/public/_nuxt/{CPoVdMeM.js → PBmE2B7U.js} +1 -1
  37. package/dist/public/_nuxt/{B9OSaO_y.js → Q3kWpZ_f.js} +1 -1
  38. package/dist/public/_nuxt/{Cs8a9RWb.js → SUptJs8y.js} +1 -1
  39. package/dist/public/_nuxt/builds/latest.json +1 -1
  40. package/dist/public/_nuxt/builds/meta/9de1cd1a-93a8-4fbf-8efa-effa9e85ee82.json +1 -0
  41. package/dist/public/_nuxt/{entry.CsYdxLia.css → entry.Dp3ya9sb.css} +1 -1
  42. package/dist/public/_nuxt/error-404.CrzVG6qf.css +1 -0
  43. package/dist/public/_nuxt/error-500.UTTFHdkP.css +1 -0
  44. package/dist/public/_nuxt/{BmVkH5Zk.js → jTMXHbZw.js} +1 -1
  45. package/dist/public/_nuxt/{DIDN4Ni9.js → p1Do6sW6.js} +1 -1
  46. package/dist/public/index.html +1 -1
  47. package/package.json +8 -7
  48. package/dist/public/_nuxt/BUo-D9gX.js +0 -6
  49. package/dist/public/_nuxt/DYWgomYl.js +0 -1
  50. package/dist/public/_nuxt/builds/meta/2a08e48f-ceea-4c2d-9171-63b36d85d409.json +0 -1
  51. package/dist/public/_nuxt/ebWyu6T_.js +0 -33
  52. package/dist/public/_nuxt/error-404.l69urhXw.css +0 -1
  53. package/dist/public/_nuxt/error-500.C1nOm2YL.css +0 -1
  54. package/dist/public/_nuxt/xNC6DpAO.js +0 -1
@@ -1 +1 @@
1
- import{G as e,Ht as t,Jt as n,Lt as r,Mt as i,Rt as a,Tt as o,Vt as s,W as c,c as l,ct as u,en as d,ft as f,g as p,in as m,it as h,kt as g,lt as _,mt as v,ot as y,p as b,pt as x,qt as S,rn as C,st as w,tn as T,ut as E,x as D,y as O,zt as k}from"./BUo-D9gX.js";import{t as A}from"./w-XmH5Bg.js";import{i as j}from"./DQtLZa7C.js";import"./Cuw21ZGH.js";import{n as M}from"./B9OSaO_y.js";import{r as N,t as P}from"./IRC0Jirb.js";import{a as ee,c as F,i as I,n as L,o as R,r as te,t as z}from"./HdutzUjM.js";import{t as B}from"./BKyQoL6o.js";import{t as V}from"./C6Dt55Q_.js";import{t as H}from"./D4hayKlJ.js";import{t as U}from"./CEQkJ3Wx.js";import{t as ne}from"./DMWw7fde.js";var W={flex:`~ gap-1`},G={"overflow-hidden":``,"text-ellipsis":``,"break-all":``,"line-clamp-2":``},K={op50:``},q=v({__name:`ListItem`,props:{asset:{}},setup(e){return(t,n)=>{let r=M,i=A;return o(),u(i,{to:{query:{asset:e.asset.filename}},"w-full":``,"font-mono":``,border:`~ rounded base`,px2:``,py1:``,"text-sm":``,hover:`bg-active`},{default:s(()=>[w(`div`,W,[x(r,{filename:e.asset.filename},null,8,[`filename`]),w(`span`,G,[f(m(e.asset.filename)+` `,1),w(`span`,K,` (`+m(e.asset.chunk?.name?.replace(/[\[\]]/g,``))+`) `,1)])])]),_:1},8,[`to`])}}}),J=Object.assign(q,{__name:`AssetsListItem`}),Y={p4:``},X={flex:``,pb2:``},Z=v({__name:`List`,props:{assets:{}},setup(e){return(t,n)=>{let r=J,i=V;return o(),E(`div`,Y,[x(i,{items:e.assets,"key-prop":`filename`},{default:s(({item:e})=>[w(`div`,X,[x(r,{asset:e},null,8,[`asset`])])]),_:1},8,[`items`])])}}}),re=Object.assign(Z,{__name:`AssetsList`}),Q={flex:`~ gap-2`,p4:``},ie={op50:``},ae=v({__name:`Folder`,props:{assets:{},session:{}},setup(e){let t=e,n=y(()=>{let e=[];return t.assets.forEach(t=>{e.push({full:t.filename,path:t.filename})}),j(e,`Project`)}),r=y(()=>new Map(t.assets.map(e=>[e.filename,e])));return(t,i)=>{let a=H;return o(),E(`div`,Q,[e.assets?.length?(o(),u(a,{key:0,"flex-1":``,node:n.value,icon:`i-catppuccin:folder-dist catppuccin`,"icon-open":`i-catppuccin:folder-dist-open catppuccin`,link:!0,"link-query-key":`asset`},{extra:s(({node:e})=>[w(`span`,ie,` (`+m(r.value.get(e.full)?.chunk?.name?.replace(/[\[\]]/g,``))+`) `,1)]),_:1},8,[`node`])):_(``,!0)])}}}),oe=Object.assign(ae,{__name:`AssetsFolder`}),se={grid:`~ cols-[max-content_1fr] gap-2`,p4:``},ce={flex:`~ col gap-4`},le={key:0,grid:`~ cols-[250px_1fr] gap-1`},ue=[`onClick`],de={key:0,"text-primary":``},fe={key:1},pe=[`onClick`],me=[`title`],he=v({__name:`Sunburst`,props:{graph:{},selected:{}},emits:[`select`],setup(e,{emit:n}){let a=e,s=n,c=r(`el`);return k(()=>c.value?.append(a.graph.el)),(n,r)=>{let a=L,l=N,u=i(`tooltip`);return o(),E(`div`,se,[w(`div`,{ref_key:`el`,ref:c,"w-500px":``},null,512),w(`div`,ce,[x(a,{border:`b base`,py2:``,selected:e.selected,options:e.graph.options,onSelect:r[0]||=e=>s(`select`,e)},null,8,[`selected`,`options`]),e.selected?(o(),E(`div`,le,[(o(!0),E(h,null,g(e.selected.children,n=>(o(),E(h,{key:n.id},[w(`button`,{"ws-nowrap":``,"text-nowrap":``,"text-left":``,"overflow-hidden":``,"text-ellipsis":``,"text-sm":``,hover:`bg-active`,rounded:``,px2:``,onClick:e=>s(`select`,n)},[n.meta&&n.meta===e.selected?.meta?(o(),E(`span`,de,`(self)`)):(o(),E(`span`,fe,m(n.id),1))],8,ue),w(`button`,{relative:``,flex:`~ gap-1 items-center`,hover:`bg-active`,rounded:``,onClick:e=>s(`select`,n)},[w(`div`,{"h-5":``,rounded:``,shadow:``,border:`~ base`,style:C({background:d(R)(e.graph.options.getColor?.(n)||`#000`),width:`${n.size/e.selected.size*100}%`})},null,4),x(l,{"text-xs":``,bytes:n.size,total:e.selected.size,"percent-ratio":3},null,8,[`bytes`,`total`]),n.children.length>0?t((o(),E(`div`,{key:0,title:`${n.children.length} dependencies`,"text-xs":``,"op-fade":``},[f(` (`+m(n.children.length)+`) `,1)],8,me)),[[u,`${n.children.length} dependencies`]]):_(``,!0)],8,pe)],64))),128))])):_(``,!0)])])}}}),ge=Object.assign(he,{__name:`AssetsSunburst`}),_e=v({__name:`Flamegraph`,props:{graph:{}},setup(e){let t=e,n=r(`el`);return k(()=>n.value?.append(t.graph.el)),(e,t)=>(o(),E(`div`,{ref_key:`el`,ref:n},null,512))}}),ve=Object.assign(_e,{__name:`AssetsFlamegraph`}),ye={key:1,relative:``,"max-h-screen":``,"of-hidden":``},be={absolute:``,"left-4":``,"top-4":``,"z-panel-nav":``},xe={flex:`~ gap-2 items-center`,p2:``,border:`t base`},Se=[`onClick`],$={"of-auto":``,"h-screen":``,flex:`~ col gap-2`,pt32:``},Ce={absolute:``,"bottom-4":``,"py-1":``,"px-2":``,"bg-glass":``,left:`1/2`,"translate-x":`-1/2`,border:`~ base rounded-full`,text:`center xs`},we={op50:``},Te={key:0,"bg-glass":``,border:`~ base rounded`,p2:``,"text-sm":``,flex:`~ col gap-2`},Ee={flex:`~ gap-1 items-center`},De={flex:`~ gap-1 items-center`},Oe=v({__name:`assets`,props:{session:{}},setup(t){let r=t,i=S(b()),v=n({search:``}),C=e(),k=c(),A=[{label:`List`,value:`list`,icon:`i-ph-list-duotone`},{label:`Folder`,value:`folder`,icon:`i-ph-folder-duotone`},{label:`Treemap`,value:`treemap`,icon:`i-ph-checkerboard-duotone`},{label:`Sunburst`,value:`sunburst`,icon:`i-ph-chart-donut-duotone`},{label:`Flamegraph`,value:`flamegraph`,icon:`i-ph-chart-bar-horizontal-duotone`}],j=O(),{state:M,isLoading:R}=l(async()=>await j.value.$call(`vite:rolldown:get-assets-list`,{session:r.session.id}),null),V=p(()=>M.value,()=>new U(M.value,{includeScore:!0,keys:[`filename`],ignoreLocation:!0,threshold:.4})),H=y(()=>v.value.search?V.value.search(v.value.search).map(e=>e.item):M.value);function W(e){P.value.assetViewType=e}let{tree:G,chartOptions:K,graph:q,nodeHover:J,nodeSelected:Y,selectedNode:X,selectNode:Z,buildGraph:Q}=z({data:H,nameKey:`filename`,sizeKey:`size`,rootText:`Project`,nodeType:`file`,graphOptions:{onClick(e){e&&(J.value=e),e.meta?.type===`file`&&(X.value=e.meta,C.replace({query:{asset:e.meta.filename}}))},onHover(e){e&&!k.query.asset&&(J.value=e),e===null&&(J.value=void 0)},onLeave(){J.value=void 0},onSelect(e){Y.value=e||G.value.root,X.value=e?.meta}},onUpdate(){switch(P.value.assetViewType){case`sunburst`:q.value=new I(G.value.root,K.value);break;case`treemap`:q.value=new ee(G.value.root,{...K.value,selectedPaddingRatio:0});break;default:q.value=new te(G.value.root,K.value)}}});return a(()=>P.value.assetViewType,()=>{Q()}),(e,n)=>{let r=D,a=B,c=re,l=oe,p=L,y=ge,b=ve,S=N,C=F;return d(R)?(o(),u(r,{key:0})):(o(),E(`div`,ye,[w(`div`,be,[x(a,{modelValue:v.value,"onUpdate:modelValue":n[0]||=e=>v.value=e,rules:[]},{default:s(()=>[w(`div`,xe,[n[3]||=w(`span`,{op50:``,pl2:``,"text-sm":``},`View as`,-1),(o(),E(h,null,g(A,e=>w(`button`,{key:e.value,"btn-action":``,class:T(d(P).assetViewType===e.value?`bg-active`:`grayscale op50`),onClick:t=>W(e.value)},[w(`div`,{class:T(e.icon)},null,2),f(` `+m(e.label),1)],10,Se)),64))])]),_:1},8,[`modelValue`])]),w(`div`,$,[d(P).assetViewType===`list`?(o(),E(h,{key:0},[H.value?.length?(o(),u(c,{key:0,assets:H.value,session:t.session},null,8,[`assets`,`session`])):_(``,!0),w(`div`,Ce,[w(`span`,we,m(H.value.length)+` of `+m(d(M)?.length||0),1)])],64)):d(P).assetViewType===`folder`?(o(),E(h,{key:1},[H.value?.length?(o(),u(l,{key:0,assets:H.value,session:t.session},null,8,[`assets`,`session`])):_(``,!0)],64)):d(P).assetViewType===`treemap`?(o(),E(h,{key:2},[d(q)?(o(),u(ne,{key:0,graph:d(q),selected:d(Y),onSelect:n[1]||=e=>d(Z)(e)},{default:s(({selected:e,options:t,onSelect:n})=>[x(p,{border:`b base`,py2:``,"min-h-10":``,selected:e,options:t,onSelect:n},null,8,[`selected`,`options`,`onSelect`])]),_:1},8,[`graph`,`selected`])):_(``,!0)],64)):d(P).assetViewType===`sunburst`?(o(),E(h,{key:3},[d(q)?(o(),u(y,{key:0,graph:d(q),selected:d(Y),onSelect:n[2]||=e=>d(Z)(e)},null,8,[`graph`,`selected`])):_(``,!0)],64)):d(P).assetViewType===`flamegraph`?(o(),E(h,{key:4},[d(q)?(o(),u(b,{key:0,graph:d(q)},null,8,[`graph`])):_(``,!0)],64)):_(``,!0)]),x(C,{"hover-x":i.x,"hover-y":i.y},{default:s(()=>[d(J)?.meta?(o(),E(`div`,Te,[w(`div`,Ee,m(d(J).text),1),w(`div`,De,[x(S,{bytes:d(J).size,percent:!1},null,8,[`bytes`])])])):_(``,!0)]),_:1},8,[`hover-x`,`hover-y`])]))}}});export{Oe as default};
1
+ import{G as e,Ht as t,Jt as n,Lt as r,Mt as i,Rt as a,Tt as o,Vt as s,W as c,c as l,ct as u,en as d,ft as f,g as p,in as m,it as h,kt as g,lt as _,mt as v,ot as y,p as b,pt as x,qt as S,rn as C,st as w,tn as T,ut as E,x as D,y as O,zt as k}from"./DilC1n1-.js";import{t as A}from"./C-y-Odbu.js";import{i as j}from"./DQtLZa7C.js";import"./C9D_b0Ie.js";import{n as M}from"./Q3kWpZ_f.js";import{r as N,t as P}from"./DtmncGDc.js";import{a as ee,c as F,i as I,n as L,o as R,r as te,t as z}from"./DQp_1U8q.js";import{t as B}from"./B60rA_aW.js";import{t as V}from"./BfzWwsgH.js";import{t as H}from"./DFnm02Ud.js";import{t as U}from"./CEQkJ3Wx.js";import{t as ne}from"./BMsX1CNy.js";var W={flex:`~ gap-1`},G={"overflow-hidden":``,"text-ellipsis":``,"break-all":``,"line-clamp-2":``},K={op50:``},q=v({__name:`ListItem`,props:{asset:{}},setup(e){return(t,n)=>{let r=M,i=A;return o(),u(i,{to:{query:{asset:e.asset.filename}},"w-full":``,"font-mono":``,border:`~ rounded base`,px2:``,py1:``,"text-sm":``,hover:`bg-active`},{default:s(()=>[w(`div`,W,[x(r,{filename:e.asset.filename},null,8,[`filename`]),w(`span`,G,[f(m(e.asset.filename)+` `,1),w(`span`,K,` (`+m(e.asset.chunk?.name?.replace(/[\[\]]/g,``))+`) `,1)])])]),_:1},8,[`to`])}}}),J=Object.assign(q,{__name:`AssetsListItem`}),Y={p4:``},X={flex:``,pb2:``},Z=v({__name:`List`,props:{assets:{}},setup(e){return(t,n)=>{let r=J,i=V;return o(),E(`div`,Y,[x(i,{items:e.assets,"key-prop":`filename`},{default:s(({item:e})=>[w(`div`,X,[x(r,{asset:e},null,8,[`asset`])])]),_:1},8,[`items`])])}}}),re=Object.assign(Z,{__name:`AssetsList`}),Q={flex:`~ gap-2`,p4:``},ie={op50:``},ae=v({__name:`Folder`,props:{assets:{},session:{}},setup(e){let t=e,n=y(()=>{let e=[];return t.assets.forEach(t=>{e.push({full:t.filename,path:t.filename})}),j(e,`Project`)}),r=y(()=>new Map(t.assets.map(e=>[e.filename,e])));return(t,i)=>{let a=H;return o(),E(`div`,Q,[e.assets?.length?(o(),u(a,{key:0,"flex-1":``,node:n.value,icon:`i-catppuccin:folder-dist catppuccin`,"icon-open":`i-catppuccin:folder-dist-open catppuccin`,link:!0,"link-query-key":`asset`},{extra:s(({node:e})=>[w(`span`,ie,` (`+m(r.value.get(e.full)?.chunk?.name?.replace(/[\[\]]/g,``))+`) `,1)]),_:1},8,[`node`])):_(``,!0)])}}}),oe=Object.assign(ae,{__name:`AssetsFolder`}),se={grid:`~ cols-[max-content_1fr] gap-2`,p4:``},ce={flex:`~ col gap-4`},le={key:0,grid:`~ cols-[250px_1fr] gap-1`},ue=[`onClick`],de={key:0,"text-primary":``},fe={key:1},pe=[`onClick`],me=[`title`],he=v({__name:`Sunburst`,props:{graph:{},selected:{}},emits:[`select`],setup(e,{emit:n}){let a=e,s=n,c=r(`el`);return k(()=>c.value?.append(a.graph.el)),(n,r)=>{let a=L,l=N,u=i(`tooltip`);return o(),E(`div`,se,[w(`div`,{ref_key:`el`,ref:c,"w-500px":``},null,512),w(`div`,ce,[x(a,{border:`b base`,py2:``,selected:e.selected,options:e.graph.options,onSelect:r[0]||=e=>s(`select`,e)},null,8,[`selected`,`options`]),e.selected?(o(),E(`div`,le,[(o(!0),E(h,null,g(e.selected.children,n=>(o(),E(h,{key:n.id},[w(`button`,{"ws-nowrap":``,"text-nowrap":``,"text-left":``,"overflow-hidden":``,"text-ellipsis":``,"text-sm":``,hover:`bg-active`,rounded:``,px2:``,onClick:e=>s(`select`,n)},[n.meta&&n.meta===e.selected?.meta?(o(),E(`span`,de,`(self)`)):(o(),E(`span`,fe,m(n.id),1))],8,ue),w(`button`,{relative:``,flex:`~ gap-1 items-center`,hover:`bg-active`,rounded:``,onClick:e=>s(`select`,n)},[w(`div`,{"h-5":``,rounded:``,shadow:``,border:`~ base`,style:C({background:d(R)(e.graph.options.getColor?.(n)||`#000`),width:`${n.size/e.selected.size*100}%`})},null,4),x(l,{"text-xs":``,bytes:n.size,total:e.selected.size,"percent-ratio":3},null,8,[`bytes`,`total`]),n.children.length>0?t((o(),E(`div`,{key:0,title:`${n.children.length} dependencies`,"text-xs":``,"op-fade":``},[f(` (`+m(n.children.length)+`) `,1)],8,me)),[[u,`${n.children.length} dependencies`]]):_(``,!0)],8,pe)],64))),128))])):_(``,!0)])])}}}),ge=Object.assign(he,{__name:`AssetsSunburst`}),_e=v({__name:`Flamegraph`,props:{graph:{}},setup(e){let t=e,n=r(`el`);return k(()=>n.value?.append(t.graph.el)),(e,t)=>(o(),E(`div`,{ref_key:`el`,ref:n},null,512))}}),ve=Object.assign(_e,{__name:`AssetsFlamegraph`}),ye={key:1,relative:``,"max-h-screen":``,"of-hidden":``},be={absolute:``,"left-4":``,"top-4":``,"z-panel-nav":``},xe={flex:`~ gap-2 items-center`,p2:``,border:`t base`},Se=[`onClick`],$={"of-auto":``,"h-screen":``,flex:`~ col gap-2`,pt32:``},Ce={absolute:``,"bottom-4":``,"py-1":``,"px-2":``,"bg-glass":``,left:`1/2`,"translate-x":`-1/2`,border:`~ base rounded-full`,text:`center xs`},we={op50:``},Te={key:0,"bg-glass":``,border:`~ base rounded`,p2:``,"text-sm":``,flex:`~ col gap-2`},Ee={flex:`~ gap-1 items-center`},De={flex:`~ gap-1 items-center`},Oe=v({__name:`assets`,props:{session:{}},setup(t){let r=t,i=S(b()),v=n({search:``}),C=e(),k=c(),A=[{label:`List`,value:`list`,icon:`i-ph-list-duotone`},{label:`Folder`,value:`folder`,icon:`i-ph-folder-duotone`},{label:`Treemap`,value:`treemap`,icon:`i-ph-checkerboard-duotone`},{label:`Sunburst`,value:`sunburst`,icon:`i-ph-chart-donut-duotone`},{label:`Flamegraph`,value:`flamegraph`,icon:`i-ph-chart-bar-horizontal-duotone`}],j=O(),{state:M,isLoading:R}=l(async()=>await j.value.$call(`vite:rolldown:get-assets-list`,{session:r.session.id}),null),V=p(()=>M.value,()=>new U(M.value,{includeScore:!0,keys:[`filename`],ignoreLocation:!0,threshold:.4})),H=y(()=>v.value.search?V.value.search(v.value.search).map(e=>e.item):M.value);function W(e){P.value.assetViewType=e}let{tree:G,chartOptions:K,graph:q,nodeHover:J,nodeSelected:Y,selectedNode:X,selectNode:Z,buildGraph:Q}=z({data:H,nameKey:`filename`,sizeKey:`size`,rootText:`Project`,nodeType:`file`,graphOptions:{onClick(e){e&&(J.value=e),e.meta?.type===`file`&&(X.value=e.meta,C.replace({query:{asset:e.meta.filename}}))},onHover(e){e&&!k.query.asset&&(J.value=e),e===null&&(J.value=void 0)},onLeave(){J.value=void 0},onSelect(e){Y.value=e||G.value.root,X.value=e?.meta}},onUpdate(){switch(P.value.assetViewType){case`sunburst`:q.value=new I(G.value.root,K.value);break;case`treemap`:q.value=new ee(G.value.root,{...K.value,selectedPaddingRatio:0});break;default:q.value=new te(G.value.root,K.value)}}});return a(()=>P.value.assetViewType,()=>{Q()}),(e,n)=>{let r=D,a=B,c=re,l=oe,p=L,y=ge,b=ve,S=N,C=F;return d(R)?(o(),u(r,{key:0})):(o(),E(`div`,ye,[w(`div`,be,[x(a,{modelValue:v.value,"onUpdate:modelValue":n[0]||=e=>v.value=e,rules:[]},{default:s(()=>[w(`div`,xe,[n[3]||=w(`span`,{op50:``,pl2:``,"text-sm":``},`View as`,-1),(o(),E(h,null,g(A,e=>w(`button`,{key:e.value,"btn-action":``,class:T(d(P).assetViewType===e.value?`bg-active`:`grayscale op50`),onClick:t=>W(e.value)},[w(`div`,{class:T(e.icon)},null,2),f(` `+m(e.label),1)],10,Se)),64))])]),_:1},8,[`modelValue`])]),w(`div`,$,[d(P).assetViewType===`list`?(o(),E(h,{key:0},[H.value?.length?(o(),u(c,{key:0,assets:H.value,session:t.session},null,8,[`assets`,`session`])):_(``,!0),w(`div`,Ce,[w(`span`,we,m(H.value.length)+` of `+m(d(M)?.length||0),1)])],64)):d(P).assetViewType===`folder`?(o(),E(h,{key:1},[H.value?.length?(o(),u(l,{key:0,assets:H.value,session:t.session},null,8,[`assets`,`session`])):_(``,!0)],64)):d(P).assetViewType===`treemap`?(o(),E(h,{key:2},[d(q)?(o(),u(ne,{key:0,graph:d(q),selected:d(Y),onSelect:n[1]||=e=>d(Z)(e)},{default:s(({selected:e,options:t,onSelect:n})=>[x(p,{border:`b base`,py2:``,"min-h-10":``,selected:e,options:t,onSelect:n},null,8,[`selected`,`options`,`onSelect`])]),_:1},8,[`graph`,`selected`])):_(``,!0)],64)):d(P).assetViewType===`sunburst`?(o(),E(h,{key:3},[d(q)?(o(),u(y,{key:0,graph:d(q),selected:d(Y),onSelect:n[2]||=e=>d(Z)(e)},null,8,[`graph`,`selected`])):_(``,!0)],64)):d(P).assetViewType===`flamegraph`?(o(),E(h,{key:4},[d(q)?(o(),u(b,{key:0,graph:d(q)},null,8,[`graph`])):_(``,!0)],64)):_(``,!0)]),x(C,{"hover-x":i.x,"hover-y":i.y},{default:s(()=>[d(J)?.meta?(o(),E(`div`,Te,[w(`div`,Ee,m(d(J).text),1),w(`div`,De,[x(S,{bytes:d(J).size,percent:!1},null,8,[`bytes`])])])):_(``,!0)]),_:1},8,[`hover-x`,`hover-y`])]))}}});export{Oe as default};
@@ -1 +1 @@
1
- import{C as e,Tt as t,V as n,in as r,st as i,ut as a}from"./BUo-D9gX.js";var o={class:`antialiased bg-white dark:bg-[#020420] dark:text-white font-sans grid min-h-screen overflow-hidden place-content-center text-[#020420] tracking-wide`},s={class:`max-w-520px text-center`},c=[`textContent`],l=[`textContent`],u=[`textContent`],d=e({__name:`error-500`,props:{appName:{type:String,default:`Nuxt`},statusCode:{type:Number,default:500},statusMessage:{type:String,default:`Internal server error`},description:{type:String,default:`This page is temporarily unavailable.`},refresh:{type:String,default:`Refresh this page`}},setup(e){let d=e;return n({title:`${d.statusCode} - ${d.statusMessage} | ${d.appName}`,script:[{innerHTML:`!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))r(e);new MutationObserver(e=>{for(const o of e)if("childList"===o.type)for(const e of o.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&r(e)}).observe(document,{childList:!0,subtree:!0})}function r(e){if(e.ep)return;e.ep=!0;const r=function(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?r.credentials="include":"anonymous"===e.crossOrigin?r.credentials="omit":r.credentials="same-origin",r}(e);fetch(e.href,r)}}();`}],style:[{innerHTML:`*,:after,:before{border-color:var(--un-default-border-color,#e5e7eb);border-style:solid;border-width:0;box-sizing:border-box}:after,:before{--un-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}h1,h2{font-size:inherit;font-weight:inherit}h1,h2,p{margin:0}*,:after,:before{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 transparent;--un-ring-shadow:0 0 transparent;--un-shadow-inset: ;--un-shadow:0 0 transparent;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }`}]}),(n,d)=>(t(),a(`div`,o,[i(`div`,s,[i(`h1`,{class:`font-semibold leading-none mb-4 sm:text-[110px] tabular-nums text-[80px]`,textContent:r(e.statusCode)},null,8,c),i(`h2`,{class:`font-semibold mb-2 sm:text-3xl text-2xl`,textContent:r(e.statusMessage)},null,8,l),i(`p`,{class:`mb-4 px-2 text-[#64748B] text-md`,textContent:r(e.description)},null,8,u)])]))}},[[`__scopeId`,`data-v-ba000b8a`]]);export{d as default};
1
+ import{C as e,Tt as t,V as n,in as r,st as i,ut as a}from"./DilC1n1-.js";var o={class:`antialiased bg-white dark:bg-[#020420] dark:text-white font-sans grid min-h-screen overflow-hidden place-content-center text-[#020420] tracking-wide`},s={class:`max-w-520px text-center`},c=[`textContent`],l=[`textContent`],u=[`textContent`],d=e({__name:`error-500`,props:{appName:{type:String,default:`Nuxt`},statusCode:{type:Number,default:500},statusMessage:{type:String,default:`Internal server error`},description:{type:String,default:`This page is temporarily unavailable.`},refresh:{type:String,default:`Refresh this page`}},setup(e){let d=e;return n({title:`${d.statusCode} - ${d.statusMessage} | ${d.appName}`,script:[{innerHTML:`!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))r(e);new MutationObserver(e=>{for(const o of e)if("childList"===o.type)for(const e of o.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&r(e)}).observe(document,{childList:!0,subtree:!0})}function r(e){if(e.ep)return;e.ep=!0;const r=function(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?r.credentials="include":"anonymous"===e.crossOrigin?r.credentials="omit":r.credentials="same-origin",r}(e);fetch(e.href,r)}}();`}],style:[{innerHTML:`*,:after,:before{border-color:var(--un-default-border-color,#e5e7eb);border-style:solid;border-width:0;box-sizing:border-box}:after,:before{--un-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}h1,h2{font-size:inherit;font-weight:inherit}h1,h2,p{margin:0}*,:after,:before{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 transparent;--un-ring-shadow:0 0 transparent;--un-shadow-inset: ;--un-shadow:0 0 transparent;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }`}]}),(n,d)=>(t(),a(`div`,o,[i(`div`,s,[i(`h1`,{class:`font-semibold leading-none mb-4 sm:text-[110px] tabular-nums text-[80px]`,textContent:r(e.statusCode)},null,8,c),i(`h2`,{class:`font-semibold mb-2 sm:text-3xl text-2xl`,textContent:r(e.statusMessage)},null,8,l),i(`p`,{class:`mb-4 px-2 text-[#64748B] text-md`,textContent:r(e.description)},null,8,u)])]))}},[[`__scopeId`,`data-v-546bea95`]]);export{d as default};
@@ -0,0 +1 @@
1
+ import{G as e,Jt as t,Tt as n,Vt as r,W as i,ct as a,en as o,ft as s,g as c,in as l,it as u,kt as d,lt as f,mt as p,ot as m,pt as h,st as g,tn as _,ut as v,v as y,xt as b}from"./DilC1n1-.js";import"./C-y-Odbu.js";import{i as x}from"./DQtLZa7C.js";import{a as S,s as C}from"./C9D_b0Ie.js";import"./Q3kWpZ_f.js";import{t as w}from"./jTMXHbZw.js";import"./DnpfwSMy.js";import{t as T}from"./Bt0_xjwR.js";import"./SUptJs8y.js";import{t as E}from"./DtmncGDc.js";import{t as D}from"./B8MMDSYB.js";import{t as O}from"./BOwnK8_Y.js";import{t as k}from"./BrGG6h5U.js";import{t as A}from"./B60rA_aW.js";import{t as j}from"./BfzWwsgH.js";import{t as M}from"./DFnm02Ud.js";import{t as ee}from"./CEQkJ3Wx.js";import{t as N}from"./C3ZA0X0n.js";import{n as P,t as F}from"./DJHNY-5T.js";var I={flex:`~ col gap-2`,p4:``},L={flex:``,pb2:``},R=p({__name:`FlatList`,props:{session:{},modules:{}},setup(e){return(t,i)=>{let a=w,o=j;return n(),v(`div`,I,[h(o,{items:e.modules,"key-prop":`id`},{default:r(({item:t})=>[g(`div`,L,[h(a,{id:t.id,session:e.session,hover:`bg-active`,block:``,px2:``,p1:``,"w-full":``,border:`~ base rounded`,link:!0},null,8,[`id`,`session`])])]),_:1},8,[`items`])])}}}),z=Object.assign(R,{__name:`ModulesFlatList`}),B={flex:`~ col gap-2`,p4:``},V={flex:``,pb2:``},H={flex:`~ gap-1 wrap`,"text-xs":``},U={flex:`~ auto text-xs wrap`},W={key:0,flex:`~ items-center`},G={key:0,op20:``},K={flex:`~ none gap-1 wrap justify-end`},q=p({__name:`DetailedList`,props:{session:{},modules:{}},setup(e){let t=e,i=m(()=>{let e=new Map;for(let n of t.modules){let t=n.buildMetrics?.transforms.filter(e=>e.source_code_size!==e.transformed_code_size).filter(e=>e.transformed_code_size);e.set(n.id,t)}return e});return(t,o)=>{let s=k,c=D,l=w,p=j;return n(),v(`div`,B,[h(p,{items:e.modules,"key-prop":`id`},{default:r(({item:t})=>[g(`div`,V,[h(l,{id:t.id,session:e.session,hover:`bg-active`,block:``,px2:``,p1:``,"w-full":``,border:`~ base rounded`,link:!0},{detail:r(()=>[g(`div`,H,[g(`ul`,U,[(n(!0),v(u,null,d(i.value.get(t.id),(e,r)=>(n(),v(u,{key:r},[e.source_code_size!==e.transformed_code_size&&e.transformed_code_size?(n(),v(`li`,W,[h(s,{name:e.plugin_name,class:`font-mono ws-nowrap op-50`},null,8,[`name`]),r===i.value.get(t.id).length-1?f(``,!0):(n(),v(`span`,G,`|`))])):f(``,!0)],64))),128))]),o[0]||=g(`div`,{flex:`~ auto gap-1`,"of-hidden":``},null,-1),g(`div`,K,[g(`span`,null,[t.buildMetrics?(n(),a(c,{key:0,metrics:t.buildMetrics},null,8,[`metrics`])):f(``,!0)])])])]),_:2},1032,[`id`,`session`])])]),_:1},8,[`items`])])}}}),J=Object.assign(q,{__name:`ModulesDetailedList`}),Y=[`d`,`stroke-dasharray`],X=p({__name:`Graph`,props:{modules:{},session:{}},setup(e){let t=e,i=m(()=>t.modules);return O({modules:i,spacing:{width:400,height:55,linkOffset:20,margin:800,gap:150},generateGraph:e=>{let{isFirstCalculateGraph:t,scale:n,spacing:r,tree:a,hierarchy:s,collapsedNodes:c,container:l,modulesMap:u,nodes:d,links:f,nodesMap:p,linksMap:h,width:g,height:_,childToParentMap:v,focusOn:y}=e,x=m(()=>i.value.filter(e=>e.importers.length===0));return(e=!0)=>{g.value=window.innerWidth,_.value=window.innerHeight;let i=new Set,m=s({module:{id:`~root`}},e=>e.module.id===`~root`?(x.value.forEach(e=>{i.add(e),t.value&&v.set(e.id,`~root`)}),x.value.map(e=>({module:e,expanded:!c.has(e.id),hasChildren:!1}))):c.has(e.module.id)?[]:e.module.imports.map(n=>{let r=u.value.get(n.module_id);if(r&&!i.has(r)&&!(v.has(r.id)&&v.get(r.id)!==e.module.id))return i.add(r),t.value&&v.set(r.id,e.module.id),{module:r,import:n,expanded:!c.has(r.id),hasChildren:!1}}).filter(e=>e!==void 0));t.value&&=!1,a().nodeSize([o(r.height),o(r.width)+o(r.gap)])(m);let S=m.descendants();for(let e of S)[e.x,e.y]=[e.y-o(r.width),e.x],e.data.module.imports&&(e.data.hasChildren=e.data.module.imports?.filter(t=>v.get(t.module_id)===e.data.module.id).length>0);let C=Math.min(...S.map(e=>e.x)),w=Math.min(...S.map(e=>e.y));if(C<o(r.margin))for(let e of S)e.x+=Math.abs(C)+o(r.margin);if(w<o(r.margin))for(let e of S)e.y+=Math.abs(w)+o(r.margin);d.value=S,p.clear();for(let e of S)p.set(e.data.module.id,e);let T=m.links().filter(e=>e.source.data.module.id!==`~root`).map(e=>({...e,import:e.source.data.import,id:`${e.source.data.module.id}|${e.target.data.module.id}`}));h.clear();for(let e of T)h.set(e.id,e);f.value=T,b(()=>{g.value=l.value.scrollWidth/n.value+o(r.margin),_.value=l.value.scrollHeight/n.value+o(r.margin);let t=x.value?.[0]?.id;e&&t&&b(()=>{y(t,!1)})})}}}),(t,o)=>{let s=w,c=N;return n(),a(c,{session:e.session,modules:i.value},{default:r(({node:t,nodesRefMap:n})=>[h(s,{id:t.data.module.id,ref:e=>n.set(t.data.module.id,e?.$el),link:!0,session:e.session,minimal:!0,flex:`1`},null,8,[`id`,`session`])]),link:r(({link:e,d:t,linkClass:n})=>[g(`path`,{d:t,class:_(n),"stroke-dasharray":e.import?.kind===`dynamic-import`?`3 6`:void 0,fill:`none`},null,10,Y)]),_:1},8,[`session`,`modules`])}}}),Z=Object.assign(X,{__name:`ModulesGraph`}),Q={"of-auto":``,"max-h-screen":``,"pt-45":``,relative:``},te={flex:`~ col gap-2`,p4:``},ne=p({__name:`Folder`,props:{session:{},modules:{}},setup(e){let t=e,r=m(()=>{if(!t.session.modulesList.length)return{workspace:{children:{},items:[]},nodeModules:{children:{},items:[]},virtual:{children:{},items:[]}};let e=[],n=[],r=[];return t.modules.map(e=>({full:e.id,path:e.path})).forEach(i=>{i.full.startsWith(t.session.meta.cwd)?(i.path.startsWith(`../`)||(i.path=i.full.slice(t.session.meta.cwd.length+1)),e.push(i)):i.full.includes(`node_modules`)?n.push({full:i.full,path:i.full}):i.full.startsWith(`virtual:`)&&r.push(i)}),{workspace:x(e,`Project Root`),nodeModules:x(n,`Node Modules`),virtual:x(r,`Virtual Modules`)}});return(e,t)=>{let i=M;return n(),v(`div`,Q,[g(`div`,te,[Object.keys(r.value.workspace.children).length?(n(),a(i,{key:0,node:r.value.workspace,p:`l3`,icon:`i-catppuccin:folder-dist icon-catppuccin`,"icon-open":`i-catppuccin:folder-dist-open icon-catppuccin`,link:!0},null,8,[`node`])):f(``,!0),Object.keys(r.value.nodeModules.children).length?(n(),v(u,{key:1},[t[0]||=g(`div`,{"w-full":``,"h-1px":``,border:`t base`},null,-1),h(i,{node:r.value.nodeModules,p:`l3`,icon:`i-catppuccin:folder-node icon-catppuccin`,"icon-open":`i-catppuccin:folder-node-open icon-catppuccin`,link:!0,open:!1},null,8,[`node`])],64)):f(``,!0),Object.keys(r.value.virtual.children).length?(n(),v(u,{key:2},[t[1]||=g(`div`,{"w-full":``,"h-1px":``,border:`t base`},null,-1),h(i,{node:r.value.virtual,p:`l3`,icon:`i-catppuccin:folder-components icon-catppuccin`,"icon-open":`i-catppuccin:folder-components-open icon-catppuccin`,link:!0,open:!1},null,8,[`node`])],64)):f(``,!0)])])}}}),re=Object.assign(ne,{__name:`ModulesFolder`}),ie={relative:``,"max-h-screen":``,"of-hidden":``},ae={absolute:``,"left-4":``,"top-4":``,"z-panel-nav":``},oe={flex:`~ gap-2 items-center`,p2:``,border:`t base`},$=[`onClick`],se={key:0,"of-auto":``,"h-screen":``,"pt-45":``},ce={absolute:``,"bottom-4":``,"py-1":``,"px-2":``,"bg-glass":``,left:`1/2`,"translate-x":`-1/2`,border:`~ base rounded-full`,text:`center xs`},le={op50:``},ue={key:1,"of-auto":``,"h-screen":``,"pt-45":``},de={absolute:``,"bottom-4":``,"py-1":``,"px-2":``,"bg-glass":``,left:`1/2`,"translate-x":`-1/2`,border:`~ base rounded-full`,text:`center xs`},fe={op50:``},pe=p({__name:`index`,props:{session:{}},setup(f){let p=f,b=i(),x=e(),w=t({search:b.query.search||``,selected:b.query.file_types?P(b.query.file_types):null,node_modules:b.query.node_modules?P(b.query.node_modules):null}),D=[{label:`List`,value:`list`,icon:`i-ph-list-bullets-duotone`},{label:`Detailed List`,value:`detailed-list`,icon:`i-ph-list-magnifying-glass-duotone`},{label:`Graph`,value:`graph`,icon:`i-ph-graph-duotone`},{label:`Folder`,value:`folder`,icon:`i-ph-folder-duotone`}];y(w.value,e=>{let t={...b.query,search:e.search||void 0,file_types:e.selected||void 0,node_modules:e.node_modules||void 0};x.replace({query:F(t)})},{debounce:500});let O=m(()=>p.session.modulesList.map(e=>({mod:e,path:T(e.id,p.session.meta.cwd),type:C(e.id)}))),k=m(()=>S.filter(e=>O.value.some(t=>e.match.test(t.mod.id)))),j=m(()=>{let e=O.value;return w.value.selected&&(e=e.filter(e=>{let t=C(e.mod.id);return w.value.selected.includes(t.name)})),w.value.node_modules&&(e=e.filter(e=>e.path.moduleName&&w.value.node_modules.includes(e.path.moduleName))),e.map(e=>({...e.mod,path:e.path.path}))}),M=c(()=>j.value,()=>new ee(j.value,{includeScore:!0,keys:[`id`],ignoreLocation:!0,threshold:.4})),N=m(()=>w.value.search?M.value.search(w.value.search).map(e=>e.item):j.value);function I(e){b.query.module&&x.replace({query:{...b.query,module:void 0}}),E.value.moduleGraphViewType=e}return(e,t)=>{let i=A,c=z,p=J,m=Z,y=re;return n(),v(`div`,ie,[g(`div`,ae,[h(i,{modelValue:w.value,"onUpdate:modelValue":t[0]||=e=>w.value=e,rules:k.value},{default:r(()=>[g(`div`,oe,[t[1]||=g(`span`,{op50:``,pl2:``,"text-sm":``},`View as`,-1),(n(),v(u,null,d(D,e=>g(`button`,{key:e.value,"btn-action":``,class:_(o(E).moduleGraphViewType===e.value?`bg-active`:`grayscale op50`),onClick:t=>I(e.value)},[g(`div`,{class:_(e.icon)},null,2),s(` `+l(e.label),1)],10,$)),64))])]),_:1},8,[`modelValue`,`rules`])]),o(E).moduleGraphViewType===`list`?(n(),v(`div`,se,[h(c,{session:f.session,modules:N.value},null,8,[`session`,`modules`]),g(`div`,ce,[g(`span`,le,l(N.value.length)+` of `+l(f.session.modulesList.length),1)])])):o(E).moduleGraphViewType===`detailed-list`?(n(),v(`div`,ue,[h(p,{session:f.session,modules:N.value},null,8,[`session`,`modules`]),g(`div`,de,[g(`span`,fe,l(N.value.length)+` of `+l(f.session.modulesList.length),1)])])):o(E).moduleGraphViewType===`graph`?(n(),a(m,{key:2,session:f.session,modules:N.value},null,8,[`session`,`modules`])):(n(),a(y,{key:3,session:f.session,modules:N.value},null,8,[`session`,`modules`]))])}}});export{pe as default};
@@ -0,0 +1 @@
1
+ import{G as e,Jt as t,Tt as n,Vt as r,W as i,en as a,g as o,in as s,mt as c,ot as l,pt as u,st as d,ut as f,v as p}from"./DilC1n1-.js";import{t as m}from"./C-y-Odbu.js";import{i as h,l as g,o as _}from"./C9D_b0Ie.js";import{t as v}from"./BrGG6h5U.js";import{t as y}from"./B60rA_aW.js";import{t as b}from"./BfzWwsgH.js";import{t as x}from"./CEQkJ3Wx.js";import{n as S,t as C}from"./DJHNY-5T.js";var w={flex:`~ col gap-2`,p4:``},T={flex:``,pb2:``},E={"w-8":``,"text-right":``,"text-xs":``,op50:``},D={"overflow-hidden":``,"text-ellipsis":``,"break-all":``,"line-clamp-2":``},O=c({__name:`FlatList`,props:{plugins:{}},setup(e){let t=i();return(i,o)=>{let c=v,l=m,p=b;return n(),f(`div`,w,[u(p,{items:e.plugins,"key-prop":`plugin_id`},{default:r(({item:e})=>[d(`div`,T,[u(l,{to:{path:a(t).path,query:{plugin:e.plugin_id}},"font-mono":``,border:`~ rounded base`,"w-full":``,px2:``,py1:``,"text-sm":``,hover:`bg-active`,flex:`~ gap-4 items-center`},{default:r(()=>[d(`div`,E,` #`+s(e.plugin_id),1),d(`span`,D,[u(c,{name:e.name},null,8,[`name`])])]),_:2},1032,[`to`])])]),_:1},8,[`items`])])}}}),k=Object.assign(O,{__name:`PluginsFlatList`}),A={relative:``,"max-h-screen":``,"of-hidden":``},j={absolute:``,"left-4":``,"top-4":``,"z-panel-nav":``},M={"of-auto":``,"h-screen":``,flex:`~ col gap-2`,pt32:``},N={absolute:``,"bottom-4":``,"py-1":``,"px-2":``,"bg-glass":``,left:`1/2`,"translate-x":`-1/2`,border:`~ base rounded-full`,text:`center xs`},P={op50:``},F=c({__name:`plugins`,props:{session:{}},setup(r){let a=r,c=i(),m=e(),v=t({search:c.query.search||``,selected:c.query.plugin_types?S(c.query.plugin_types):null}),b=l(()=>[..._.filter(e=>a.session?.meta?.plugins?.some(t=>e.match.test(t.name))),h]),w=l(()=>{let e=a.session?.meta?.plugins;return v.value.selected&&(e=e.filter(e=>{let t=g(e.name);return v.value.selected.includes(t.name)})),e}),T=o(()=>w.value,()=>new x(w.value,{includeScore:!0,keys:[`name`],ignoreLocation:!0,threshold:.4})),E=l(()=>v.value.search?T.value.search(v.value.search).map(e=>e.item):w.value);return p(v.value,e=>{let t={...c.query,search:e.search||void 0,plugin_types:e.selected||void 0};m.replace({query:C(t)})},{debounce:500}),(e,t)=>{let i=y,a=k;return n(),f(`div`,A,[d(`div`,j,[u(i,{modelValue:v.value,"onUpdate:modelValue":t[0]||=e=>v.value=e,rules:b.value},null,8,[`modelValue`,`rules`])]),d(`div`,M,[u(a,{plugins:E.value??[]},null,8,[`plugins`]),d(`div`,N,[d(`span`,P,s(E.value.length)+` of `+s(r.session?.meta?.plugins?.length||0),1)])])])}}});export{F as default};
@@ -1 +1 @@
1
- import{At as e,Ft as t,Nt as n,Tt as r,Vt as i,W as a,ct as o,en as s,it as c,kt as l,lt as u,mt as d,pt as f,rn as p,st as m,tn as h,ut as g,yt as _}from"./BUo-D9gX.js";import{t as v}from"./w-XmH5Bg.js";import{n as y,t as b}from"./B9OSaO_y.js";var x=[`open`],S={"font-mono":``},C={"font-mono":``},w=d({__name:`TreeNode`,props:_({node:{},icon:{default:`i-catppuccin:folder icon-catppuccin`},iconOpen:{default:`i-catppuccin:folder-open icon-catppuccin`},link:{type:[String,Boolean]},linkQueryKey:{default:`module`},padding:{default:0},open:{type:Boolean}},{open:{type:Boolean,required:!1,default:!0},openModifiers:{}}),emits:_([`select`],[`update:open`]),setup(d,{emit:_}){let w=d,E=_,D=t(d,`open`),O=a(),k=window.location;function A(e){w.link||E(`select`,e)}return(t,a)=>{let _=b,w=T,E=y;return r(),g(`details`,{open:D.value,onToggle:a[0]||=e=>D.value=e.target?.open},[m(`summary`,{"cursor-default":``,"select-none":``,"text-sm":``,truncate:``,style:p({paddingLeft:`${d.padding+.5}rem`}),flex:`~ gap-1`,px2:``,py1:``,rounded:``,hover:`bg-active `},[m(`div`,{class:h([`i-ph-caret-right-duotone transition op50`,D.value?`rotate-90`:``])},null,2),m(`div`,{class:h(D.value&&d.iconOpen||d.icon),"inline-block":``,"vertical-text-bottom":``},null,2),m(`div`,S,[f(_,{path:d.node.name||``},null,8,[`path`])])],4),D.value?(r(),g(c,{key:0},[(r(!0),g(c,null,l(Object.entries(d.node.children),n=>(r(),o(w,{key:n[0],node:n[1],link:d.link,padding:d.padding+1,"link-query-key":d.linkQueryKey,onSelect:A},{extra:i(({node:n})=>[e(t.$slots,`extra`,{node:n})]),_:3},8,[`node`,`link`,`padding`,`link-query-key`]))),128)),(r(!0),g(c,null,l(d.node.items,a=>(r(),o(n(d.link?s(v):`div`),{key:a.full,to:d.link?typeof d.link==`string`?d.link:{path:s(O).path,query:{...s(O).query,[d.linkQueryKey]:a.full},hash:s(k).hash}:void 0,"text-sm":``,"ws-nowrap":``,flex:`~ gap-1`,px2:``,py1:``,rounded:``,hover:`bg-active`,style:p({paddingLeft:`${d.padding+2.7}rem`}),onClick:e=>A(a)},{default:i(()=>[f(E,{filename:a.full},null,8,[`filename`]),m(`div`,C,[f(_,{path:a.path.split(`/`).pop()||``},null,8,[`path`]),e(t.$slots,`extra`,{node:a})])]),_:2},1032,[`to`,`style`,`onClick`]))),128))],64)):u(``,!0)],40,x)}}}),T=Object.assign(w,{__name:`DisplayTreeNode`});export{T as t};
1
+ import{At as e,Ft as t,Nt as n,Tt as r,Vt as i,W as a,ct as o,en as s,it as c,kt as l,lt as u,mt as d,pt as f,rn as p,st as m,tn as h,ut as g,yt as _}from"./DilC1n1-.js";import{t as v}from"./C-y-Odbu.js";import{n as y,t as b}from"./Q3kWpZ_f.js";var x=[`open`],S={"font-mono":``},C={"font-mono":``},w=d({__name:`TreeNode`,props:_({node:{},icon:{default:`i-catppuccin:folder icon-catppuccin`},iconOpen:{default:`i-catppuccin:folder-open icon-catppuccin`},link:{type:[String,Boolean]},linkQueryKey:{default:`module`},padding:{default:0},open:{type:Boolean}},{open:{type:Boolean,required:!1,default:!0},openModifiers:{}}),emits:_([`select`],[`update:open`]),setup(d,{emit:_}){let w=d,E=_,D=t(d,`open`),O=a(),k=window.location;function A(e){w.link||E(`select`,e)}return(t,a)=>{let _=b,w=T,E=y;return r(),g(`details`,{open:D.value,onToggle:a[0]||=e=>D.value=e.target?.open},[m(`summary`,{"cursor-default":``,"select-none":``,"text-sm":``,truncate:``,style:p({paddingLeft:`${d.padding+.5}rem`}),flex:`~ gap-1`,px2:``,py1:``,rounded:``,hover:`bg-active `},[m(`div`,{class:h([`i-ph-caret-right-duotone transition op50`,D.value?`rotate-90`:``])},null,2),m(`div`,{class:h(D.value&&d.iconOpen||d.icon),"inline-block":``,"vertical-text-bottom":``},null,2),m(`div`,S,[f(_,{path:d.node.name||``},null,8,[`path`])])],4),D.value?(r(),g(c,{key:0},[(r(!0),g(c,null,l(Object.entries(d.node.children),n=>(r(),o(w,{key:n[0],node:n[1],link:d.link,padding:d.padding+1,"link-query-key":d.linkQueryKey,onSelect:A},{extra:i(({node:n})=>[e(t.$slots,`extra`,{node:n})]),_:3},8,[`node`,`link`,`padding`,`link-query-key`]))),128)),(r(!0),g(c,null,l(d.node.items,a=>(r(),o(n(d.link?s(v):`div`),{key:a.full,to:d.link?typeof d.link==`string`?d.link:{path:s(O).path,query:{...s(O).query,[d.linkQueryKey]:a.full},hash:s(k).hash}:void 0,"text-sm":``,"ws-nowrap":``,flex:`~ gap-1`,px2:``,py1:``,rounded:``,hover:`bg-active`,style:p({paddingLeft:`${d.padding+2.7}rem`}),onClick:e=>A(a)},{default:i(()=>[f(E,{filename:a.full},null,8,[`filename`]),m(`div`,C,[f(_,{path:a.path.split(`/`).pop()||``},null,8,[`path`]),e(t.$slots,`extra`,{node:a})])]),_:2},1032,[`to`,`style`,`onClick`]))),128))],64)):u(``,!0)],40,x)}}}),T=Object.assign(w,{__name:`DisplayTreeNode`});export{T as t};
@@ -1 +1 @@
1
- import{E as e,Tt as t,Vt as n,W as r,c as i,ct as a,en as o,in as s,it as c,kt as l,lt as u,mt as d,pt as f,st as p,ut as m,x as h,y as g}from"./BUo-D9gX.js";import"./w-XmH5Bg.js";import"./Cuw21ZGH.js";import"./B9OSaO_y.js";import{r as _,t as v}from"./BmVkH5Zk.js";import{t as y}from"./BZWmKTD9.js";import{t as b}from"./C2OwekHB.js";var x={key:0},S={key:2},C={op50:``},w={key:3},T=[`textContent`],E=[`textContent`],D=d({__name:`RawEventsTable`,props:{events:{},fields:{default:()=>[`event_id`,`action`,`module_id`,`plugin_name`,`timestamp`,`content`,`*`]},session:{}},setup(r){let i=r;function d(e,t){let n=new Set(t);return n.has(`content`)&&n.add(`content`),n.has(`plugin_name`)&&n.add(`plugin_index`),Object.fromEntries(Object.entries(e).filter(([e])=>!n.has(e)))}function h(e){return e.action===`HookLoadCallEnd`||e.action===`HookTransformCallStart`||e.action===`HookTransformCallEnd`?e.content:null}return(g,D)=>{let O=v,k=_,A=b,j=y;return t(),m(c,null,[r.events.length?u(``,!0):(t(),m(`div`,x,[...D[0]||=[p(`div`,{p5:``,italic:``},` No events found `,-1)]])),p(`table`,null,[p(`tbody`,null,[(t(!0),m(c,null,l(i.events,g=>(t(),m(`tr`,{key:g.event_id},[(t(!0),m(c,null,l(i.fields,i=>(t(),m(`td`,{key:i,px2:``},[i===`module_id`?(t(),a(O,{key:0,id:`module_id`in g?g.module_id:``,session:r.session},null,8,[`id`,`session`])):i===`action`?(t(),a(k,{key:1,text:g.action},null,8,[`text`])):i===`plugin_name`&&`plugin_name`in g?(t(),m(`div`,S,[f(A,{"font-mono":``,name:g.plugin_name},null,8,[`name`]),p(`code`,C,`#`+s(g.plugin_id),1)])):i===`event_id`?(t(),m(`div`,w,s(g.event_id),1)):i===`content`&&h(g)?(t(),a(o(e),{key:4},{popper:n(()=>[p(`pre`,{p1:``,"text-sm":``,textContent:s(h(g))},null,8,T)]),default:n(()=>[D[1]||=p(`div`,{"i-ph-code":``},null,-1)]),_:2},1024)):i===`timestamp`&&`timestamp`in g?(t(),a(j,{key:5,"text-sm":``,timestamp:g.timestamp},null,8,[`timestamp`])):i===`*`?(t(),m(`pre`,{key:6,"text-sm":``,textContent:s(d(g,r.fields))},null,8,E)):u(``,!0)]))),128))]))),128))])])],64)}}}),O=Object.assign(D,{__name:`DataRawEventsTable`}),k={key:1},A=d({__name:`raw`,props:{session:{}},setup(e){let n=e,s=g(),l=r().query,d=i(async()=>await s.value.$call(`vite:rolldown:get-module-raw-events`,{session:n.session.id,module:l.module}),{events:[]});return(n,r)=>{let i=h,s=O;return t(),m(c,null,[o(d).isLoading?(t(),a(i,{key:0})):u(``,!0),p(`div`,null,[o(d).isReady?(t(),a(s,{key:0,events:o(d).state.value.events,session:e.session},null,8,[`events`,`session`])):(t(),m(`div`,k,[f(i)]))])],64)}}});export{A as default};
1
+ import{E as e,Tt as t,Vt as n,W as r,c as i,ct as a,en as o,in as s,it as c,kt as l,lt as u,mt as d,pt as f,st as p,ut as m,x as h,y as g}from"./DilC1n1-.js";import"./C-y-Odbu.js";import"./C9D_b0Ie.js";import"./Q3kWpZ_f.js";import{r as _,t as v}from"./jTMXHbZw.js";import{t as y}from"./DabxYzqu.js";import{t as b}from"./BrGG6h5U.js";var x={key:0},S={key:2},C={op50:``},w={key:3},T=[`textContent`],E=[`textContent`],D=d({__name:`RawEventsTable`,props:{events:{},fields:{default:()=>[`event_id`,`action`,`module_id`,`plugin_name`,`timestamp`,`content`,`*`]},session:{}},setup(r){let i=r;function d(e,t){let n=new Set(t);return n.has(`content`)&&n.add(`content`),n.has(`plugin_name`)&&n.add(`plugin_index`),Object.fromEntries(Object.entries(e).filter(([e])=>!n.has(e)))}function h(e){return e.action===`HookLoadCallEnd`||e.action===`HookTransformCallStart`||e.action===`HookTransformCallEnd`?e.content:null}return(g,D)=>{let O=v,k=_,A=b,j=y;return t(),m(c,null,[r.events.length?u(``,!0):(t(),m(`div`,x,[...D[0]||=[p(`div`,{p5:``,italic:``},` No events found `,-1)]])),p(`table`,null,[p(`tbody`,null,[(t(!0),m(c,null,l(i.events,g=>(t(),m(`tr`,{key:g.event_id},[(t(!0),m(c,null,l(i.fields,i=>(t(),m(`td`,{key:i,px2:``},[i===`module_id`?(t(),a(O,{key:0,id:`module_id`in g?g.module_id:``,session:r.session},null,8,[`id`,`session`])):i===`action`?(t(),a(k,{key:1,text:g.action},null,8,[`text`])):i===`plugin_name`&&`plugin_name`in g?(t(),m(`div`,S,[f(A,{"font-mono":``,name:g.plugin_name},null,8,[`name`]),p(`code`,C,`#`+s(g.plugin_id),1)])):i===`event_id`?(t(),m(`div`,w,s(g.event_id),1)):i===`content`&&h(g)?(t(),a(o(e),{key:4},{popper:n(()=>[p(`pre`,{p1:``,"text-sm":``,textContent:s(h(g))},null,8,T)]),default:n(()=>[D[1]||=p(`div`,{"i-ph-code":``},null,-1)]),_:2},1024)):i===`timestamp`&&`timestamp`in g?(t(),a(j,{key:5,"text-sm":``,timestamp:g.timestamp},null,8,[`timestamp`])):i===`*`?(t(),m(`pre`,{key:6,"text-sm":``,textContent:s(d(g,r.fields))},null,8,E)):u(``,!0)]))),128))]))),128))])])],64)}}}),O=Object.assign(D,{__name:`DataRawEventsTable`}),k={key:1},A=d({__name:`raw`,props:{session:{}},setup(e){let n=e,s=g(),l=r().query,d=i(async()=>await s.value.$call(`vite:rolldown:get-module-raw-events`,{session:n.session.id,module:l.module}),{events:[]});return(n,r)=>{let i=h,s=O;return t(),m(c,null,[o(d).isLoading?(t(),a(i,{key:0})):u(``,!0),p(`div`,null,[o(d).isReady?(t(),a(s,{key:0,events:o(d).state.value.events,session:e.session},null,8,[`events`,`session`])):(t(),m(`div`,k,[f(i)]))])],64)}}});export{A as default};
@@ -1 +1 @@
1
- import{A as e,At as t,D as n,F as r,Jt as i,Lt as a,M as o,N as s,O as c,P as l,Qt as u,Rt as d,Tt as f,Xt as p,at as m,ct as h,en as g,in as _,it as v,j as y,k as b,kt as ee,lt as te,mt as ne,ot as x,rn as re,st as S,t as C,ut as w,wt as ie,xt as ae}from"./BUo-D9gX.js";import{t as T}from"./DQtLZa7C.js";import{t as oe}from"./IRC0Jirb.js";function E(){return typeof window<`u`}function D(e){return se(e)?(e.nodeName||``).toLowerCase():`#document`}function O(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function k(e){return((se(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function se(e){return E()?e instanceof Node||e instanceof O(e).Node:!1}function A(e){return E()?e instanceof Element||e instanceof O(e).Element:!1}function j(e){return E()?e instanceof HTMLElement||e instanceof O(e).HTMLElement:!1}function ce(e){return!E()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof O(e).ShadowRoot}var le=new Set([`inline`,`contents`]);function M(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=I(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!le.has(i)}var ue=new Set([`table`,`td`,`th`]);function de(e){return ue.has(D(e))}var fe=[`:popover-open`,`:modal`];function N(e){return fe.some(t=>{try{return e.matches(t)}catch{return!1}})}var pe=[`transform`,`translate`,`scale`,`rotate`,`perspective`],me=[`transform`,`translate`,`scale`,`rotate`,`perspective`,`filter`],he=[`paint`,`layout`,`strict`,`content`];function ge(e){let t=P(),n=A(e)?I(e):e;return pe.some(e=>n[e]?n[e]!==`none`:!1)||(n.containerType?n.containerType!==`normal`:!1)||!t&&(n.backdropFilter?n.backdropFilter!==`none`:!1)||!t&&(n.filter?n.filter!==`none`:!1)||me.some(e=>(n.willChange||``).includes(e))||he.some(e=>(n.contain||``).includes(e))}function _e(e){let t=R(e);for(;j(t)&&!F(t);){if(ge(t))return t;if(N(t))return null;t=R(t)}return null}function P(){return typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter`,`none`)}var ve=new Set([`html`,`body`,`#document`]);function F(e){return ve.has(D(e))}function I(e){return O(e).getComputedStyle(e)}function L(e){return A(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function R(e){if(D(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ce(e)&&e.host||k(e);return ce(t)?t.host:t}function ye(e){let t=R(e);return F(t)?e.ownerDocument?e.ownerDocument.body:e.body:j(t)&&M(t)?t:ye(t)}function be(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=ye(e),i=r===e.ownerDocument?.body,a=O(r);if(i){let e=xe(a);return t.concat(a,a.visualViewport||[],M(r)?r:[],e&&n?be(e):[])}return t.concat(r,be(r,[],n))}function xe(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Se(e){let t=I(e),n=parseFloat(t.width)||0,i=parseFloat(t.height)||0,a=j(e),o=a?e.offsetWidth:n,s=a?e.offsetHeight:i,c=r(n)!==o||r(i)!==s;return c&&(n=o,i=s),{width:n,height:i,$:c}}function Ce(e){return A(e)?e:e.contextElement}function z(e){let t=Ce(e);if(!j(t))return y(1);let n=t.getBoundingClientRect(),{width:i,height:a,$:o}=Se(t),s=(o?r(n.width):n.width)/i,c=(o?r(n.height):n.height)/a;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}var we=y(0);function Te(e){let t=O(e);return!P()||!t.visualViewport?we:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ee(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==O(e)?!1:t}function B(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Ce(e),o=y(1);t&&(r?A(r)&&(o=z(r)):o=z(e));let s=Ee(a,n,r)?Te(a):y(0),c=(i.left+s.x)/o.x,u=(i.top+s.y)/o.y,d=i.width/o.x,f=i.height/o.y;if(a){let e=O(a),t=r&&A(r)?O(r):r,n=e,i=xe(n);for(;i&&r&&t!==n;){let e=z(i),t=i.getBoundingClientRect(),r=I(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,u*=e.y,d*=e.x,f*=e.y,c+=a,u+=o,n=O(i),i=xe(n)}}return l({width:d,height:f,x:c,y:u})}function V(e,t){let n=L(e).scrollLeft;return t?t.left+n:B(k(e)).left+n}function De(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-V(e,n),y:n.top+t.scrollTop}}function Oe(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=k(r),s=t?N(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=y(1),u=y(0),d=j(r);if((d||!d&&!a)&&((D(r)!==`body`||M(o))&&(c=L(r)),j(r))){let e=B(r);l=z(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?De(o,c):y(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function ke(e){return Array.from(e.getClientRects())}function Ae(e){let t=k(e),n=L(e),r=e.ownerDocument.body,i=o(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=o(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),s=-n.scrollLeft+V(e),c=-n.scrollTop;return I(r).direction===`rtl`&&(s+=o(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:s,y:c}}var je=25;function Me(e,t){let n=O(e),r=k(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=P();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=V(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=je&&(a-=o)}else l<=je&&(a+=l);return{width:a,height:o,x:s,y:c}}var Ne=new Set([`absolute`,`fixed`]);function Pe(e,t){let n=B(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=j(e)?z(e):y(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Fe(e,t,n){let r;if(t===`viewport`)r=Me(e,n);else if(t===`document`)r=Ae(k(e));else if(A(t))r=Pe(t,n);else{let n=Te(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return l(r)}function Ie(e,t){let n=R(e);return n===t||!A(n)||F(n)?!1:I(n).position===`fixed`||Ie(n,t)}function Le(e,t){let n=t.get(e);if(n)return n;let r=be(e,[],!1).filter(e=>A(e)&&D(e)!==`body`),i=null,a=I(e).position===`fixed`,o=a?R(e):e;for(;A(o)&&!F(o);){let t=I(o),n=ge(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&Ne.has(i.position)||M(o)&&!n&&Ie(e,o))?r=r.filter(e=>e!==o):i=t,o=R(o)}return t.set(e,r),r}function Re(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?N(t)?[]:Le(t,this._c):[].concat(n),r],c=a[0],l=a.reduce((e,n)=>{let r=Fe(t,n,i);return e.top=o(r.top,e.top),e.right=s(r.right,e.right),e.bottom=s(r.bottom,e.bottom),e.left=o(r.left,e.left),e},Fe(t,c,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function ze(e){let{width:t,height:n}=Se(e);return{width:t,height:n}}function Be(e,t,n){let r=j(t),i=k(t),a=n===`fixed`,o=B(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=y(0);function l(){c.x=V(i)}if(r||!r&&!a)if((D(t)!==`body`||M(i))&&(s=L(t)),r){let e=B(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?De(i,s):y(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Ve(e){return I(e).position===`static`}function He(e,t){if(!j(e)||I(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return k(e)===n&&(n=n.ownerDocument.body),n}function Ue(e,t){let n=O(e);if(N(e))return n;if(!j(e)){let t=R(e);for(;t&&!F(t);){if(A(t)&&!Ve(t))return t;t=R(t)}return n}let r=He(e,t);for(;r&&de(r)&&Ve(r);)r=He(r,t);return r&&F(r)&&Ve(r)&&!ge(r)?n:r||_e(e)||n}var We=async function(e){let t=this.getOffsetParent||Ue,n=this.getDimensions,r=await n(e.floating);return{reference:Be(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ge(e){return I(e).direction===`rtl`}var Ke={convertOffsetParentRelativeRectToViewportRelativeRect:Oe,getDocumentElement:k,getClippingRect:Re,getOffsetParent:Ue,getElementRects:We,getClientRects:ke,getDimensions:ze,getScale:z,isElement:A,isRTL:Ge},qe=b,Je=e,Ye=c,Xe=(e,t,r)=>{let i=new Map,a={platform:Ke,...r},o={...a.platform,_c:i};return n(e,t,{...a,platform:o})},Ze=ne({__name:`GraphHoverView`,props:{hoverX:{},hoverY:{}},setup(e){let{hoverX:n,hoverY:r}=u(e),o=a(`hoverElement`),s=i(0),c=i(0);return d([n,r],([e,t])=>{Xe({getBoundingClientRect(){return{width:0,height:0,x:e,y:t,left:e,right:e,top:t,bottom:t}}},o.value,{placement:`right-start`,middleware:[Ye(),Je(),qe({mainAxis:8,alignmentAxis:8})]}).then(({x:e,y:t})=>{s.value=e,c.value=t})}),(e,n)=>(f(),h(m,{to:`body`},[S(`div`,{ref_key:`hoverElement`,ref:o,fixed:``,"z-panel-content":``,"pointer-events-none":``,style:re({left:`${s.value}px`,top:`${c.value}px`})},[t(e.$slots,`default`)],4)]))}}),Qe=Object.assign(Ze,{__name:`DisplayGraphHoverView`});function $e(e,t=1,n=1){let r=(.6+.4*Math.max(0,Math.cos(e)))*t,i=(.5+.2*Math.max(0,Math.cos(e+Math.PI*2/3)))*n;return`hsl(${e*180/Math.PI}deg, ${Math.round(100*r)}%, ${Math.round(100*i)}%)`}var et,tt,nt,H,U,W=1,rt;function it(e,t,n,r,i){if(!Array.isArray(e))return e;let a=window.devicePixelRatio||1;if(et!==t||tt!==a||nt!==i){let n=Math.round(64*a)/64;W=i,W=Math.log2(W),W-=Math.floor(W);let r=W,o=Math.min(1,8*r);W=2**W;let s=8*Math.SQRT2/W;et=t,tt=a,nt=i,H||=document.createElement(`canvas`),U||=H.getContext(`2d`),H.width=H.height=Math.round(64*n),U.scale(n,n),U.fillStyle=e[0],U.fillRect(0,0,64,64),U.globalAlpha=.25,U.fillStyle=e[1],U.fillRect(0,0,64,64),U.globalAlpha=.67,U.strokeStyle=e[1],U.beginPath();for(let e=0;e<=64;e+=16)U.moveTo(e-32,e+32),U.lineTo(e+32,e-32);if(U.lineWidth=s*(1-(o-r)/2),U.stroke(),o+r>0){U.beginPath();for(let e=8;e<64;e+=16)U.moveTo(e-32,e+32),U.lineTo(e+32,e-32);U.lineWidth=s*(o+r)/2,U.stroke()}rt=t.createPattern(H,`repeat`),W/=n}return n/=64*W*a,n-=Math.floor(n),n*=64*W*a,rt.setTransform(new DOMMatrix([W,0,0,W,n,r])),rt}function at(e){return Array.isArray(e)?`url('data:image/svg+xml,<svg width="26" height="26" xmlns="http://www.w3.org/2000/svg"><rect width="26" height="26" fill="${e[0]}"/><rect width="26" height="26" fill="${e[1]}" fill-opacity="25%"/><path d="M22.5 -3.5L-3.5 22.5M35.5 9.5L9.5 35.5" stroke="${e[1]}" stroke-opacity="67%" stroke-width="9.19239"/></svg>')`:e}function ot(e){return t=>t.id&&e[t.id]||t.color}function st(e,t=1,n=1){let r={};return ct(r,e,0,Math.PI*2,t,n),ot(r)}function ct(e,t,n,r,i=1,a=1){let o=t.size;e[t.id]=$e(n+r/2,i,a);for(let s of t.children){let t=s.size/o*r;ct(e,s,n,t,i,a),n+=t}}var lt=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`;function ut(e=16,t=lt){let n=``,r=e,i=t.length;for(;r--;)n+=t[Math.random()*i|0];return n}function dt(e,t,n=(e,t)=>t.size-e.size){if(e.__nanovis)return e;let r={...e};return r.id||=ut(),r.parent||=t,r.children||=[],r.sizeSelf==null&&r.size!=null&&r.children.length===0?r.sizeSelf=r.size:r.sizeSelf||=0,r.children=(r.children||[]).map(e=>dt(e,r,n)),r.size||=r.children.reduce((e,t)=>e+t.size,0)+r.sizeSelf,n&&r.children.sort(n),Object.defineProperty(r,`__nanovis`,{enumerable:!1,value:!0}),r}function ft(e){return e.children.length===0?1:Math.max(...e.children.map(e=>ft(e)))+1}var pt=/\bFirefox\//.test(navigator.userAgent),mt;function ht(e){return mt?mt.format(e):`${e}`}function G(){return(window.performance||Date).now()}function gt(e){let t=e.toFixed(1).split(`.`,2);return`${ht(+t[0])}.${t[1]}`}function _t(e){return e===1?`1 byte`:e<1024?`${ht(e)} bytes`:e<1024*1024?`${gt(e/1024)} kb`:e<1024*1024*1024?`${gt(e/(1024*1024))} mb`:`${gt(e/(1024*1024*1024))} gb`}function vt(e,t,n,r,i,a){if(pt){let o=e.lineWidth,s=o/2;e.fillStyle=t,e.fillRect(n-s,r-s,i+o,o),e.fillRect(n-s,r+s,o,a-o),e.fillRect(n-s,r+a-s,i+o,o),e.fillRect(n+i-s,r+s,o,a-o);return}e.strokeStyle=t,e.strokeRect(n,r,i,a)}function yt(e){return window.addEventListener(`wheel`,e,{passive:!1}),()=>window.removeEventListener(`wheel`,e)}function bt(e){return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)}try{mt=new Intl.NumberFormat}catch{}var xt=()=>({emit(e,...t){for(let n=this.events[e]||[],r=0,i=n.length;r<i;r++)n[r](...t)},events:{},on(e,t){return(this.events[e]||=[]).push(t),()=>{this.events[e]=this.events[e]?.filter(e=>t!==e)}}}),K={getText:e=>e.text,getSubtext:e=>e.subtext,animate:!0,animateDuration:350},St={fallback:`#CCC`,stroke:`#0008`,text:`#222`,hover:`#fff5`,shadow:`#0008`,fg:`#fff`,bg:`#222`},Ct=46,wt=`14px sans-serif`,Tt=`bold ${wt}`,Et=class{el;canvas;c;width=0;height=0;ratio=1;root;maxDepth;events;options;palette;disposables;getColor;getText;getSubtext;_animationFrame=null;constructor(e,t){this.options={...K,...t};let{getColor:n=st(e),getText:r=()=>void 0,getSubtext:i=()=>void 0}=this.options;this.palette={...St,...t.palette},this.el=document.createElement(`div`),this.canvas=document.createElement(`canvas`),this.c=this.canvas.getContext(`2d`),this.root=e,this.maxDepth=ft(e),this.disposables=[],this.events=xt(),this.getColor=n,this.getText=r,this.getSubtext=i,this.setFont(wt),t.onClick&&this.events.on(`click`,t.onClick),t.onHover&&this.events.on(`hover`,t.onHover),t.onLeave&&this.events.on(`leave`,t.onLeave),t.onSelect&&this.events.on(`select`,t.onSelect),this.el.addEventListener(`mouseleave`,()=>{this.events.emit(`leave`)})}invalidate(){this._animationFrame===null&&(this._animationFrame=requestAnimationFrame(()=>{this._animationFrame=null,this.tick()}))}tick(){this.draw()}draw(){}resize(){this.ratio=window.devicePixelRatio||1,this.canvas.style.width=`${this.width}px`,this.canvas.style.height=`${this.height}px`,this.canvas.width=Math.round(this.width*this.ratio),this.canvas.height=Math.round(this.height*this.ratio),this.c.scale(this.ratio,this.ratio),this.draw()}select(e,t){this.events.emit(`select`,e)}dispose(){this.disposables.forEach(e=>e()),this.disposables.length=0,this.el.remove()}[Symbol.dispose](){this.dispose()}_font=`14px sans-serif`;_fontWidthCache=new Map;ellipsisWidth=0;getFontCache(){return this._fontWidthCache.has(this._font)||this._fontWidthCache.set(this._font,{}),this._fontWidthCache.get(this._font)}setFont(e){this._font=e,this.c.font=e,this.c.textBaseline=`middle`,this.ellipsisWidth=3*this.charCodeWidth(Ct)}charCodeWidth(e){let t=this.getFontCache(),n=t[e];return n===void 0&&(n=this.c.measureText(String.fromCharCode(e)).width,t[e]=n),n}textOverflowEllipsis(e,t){if(t<this.ellipsisWidth)return[``,0];let n=0,r=e.length,i=0;for(;i<r;){let r=this.charCodeWidth(e.charCodeAt(i));if(t<n+this.ellipsisWidth+r)return[`${e.slice(0,i)}...`,n+this.ellipsisWidth];n+=r,i++}return[e,n]}},q=24,Dt=5,Ot=.01,kt=1e3,At=class extends Et{mainEl=document.createElement(`div`);totalBytes;viewportMin;viewportMax;zoomedOutMin=0;zoomedOutWidth=0;prevWheelTime=0;prevWheelWasZoom=!1;stripeScaleAdjust=1;hoveredNode=null;selectedNode=null;nodeStartBytes=new Map;animationFromMin=0;animationFromMax=0;animationToMin=0;animationToMax=0;animationStart=0;constructor(e,t={}){super(e,t),this.totalBytes=e.size,this.viewportMin=this.animationFromMin=this.animationToMin=0,this.viewportMax=this.animationFromMax=this.animationToMax=this.totalBytes,Object.assign(this.mainEl.style,{position:`relative`}),Object.assign(this.canvas.style,{position:`absolute`,left:`0`,top:`0`});let n=!1;this.canvas.onmousedown=e=>{if(n=!1,e.button!==2){let t=e.pageX,r=e=>{let r=e.pageX-t;!n&&Math.abs(r)<3||(n=!0,this.modifyViewport(-r,0,null),t=e.pageX)},i=()=>{document.removeEventListener(`mousemove`,r),document.removeEventListener(`mouseup`,i)};e.preventDefault(),document.addEventListener(`mousemove`,r),document.addEventListener(`mouseup`,i)}},this.canvas.onmousemove=e=>{this.updateHover(e)},this.canvas.onmouseout=()=>{this.changeHoveredNode(null)},this.canvas.onclick=e=>{if(n)return;let t=this.hitTestNode(e);this.changeHoveredNode(t),this.changeSelectedNode(t),t&&this.events.emit(`click`,t,e)},this.disposables.push(yt(e=>{let t=e.deltaX,n=e.deltaY,r=G(),i=r-this.prevWheelTime<50?this.prevWheelWasZoom:e.ctrlKey||e.metaKey;this.prevWheelTime=r,this.prevWheelWasZoom=i,(i||Math.abs(t)>=Math.abs(n))&&e.preventDefault(),this.modifyViewport(t,n,i?e.pageX:null),this.updateHover(e)})),this.resize(),Promise.resolve().then(()=>this.resize()),this.disposables.push(bt(()=>this.resize())),this.mainEl.append(this.canvas),this.el.append(this.mainEl)}tick(){let e=(G()-this.animationStart)/(this.options.animateDuration??K.animateDuration);e<0||e>1?(e=1,this.viewportMin=this.animationToMin,this.viewportMax=this.animationToMax):(e<.5?e*=4*e*e:(e=1-e,e*=4*e*e,e=1-e),this.viewportMin=this.animationFromMin+(this.animationToMin-this.animationFromMin)*e,this.viewportMax=this.animationFromMax+(this.animationToMax-this.animationFromMax)*e,this.invalidate()),this.draw()}draw(){this.c.clearRect(0,0,this.width,this.height),this.drawNode(this.root,0,0,-1/0,1)}changeSelectedNode(e,t=this.options.animate??K.animate){if(this.selectedNode!==e&&(this.selectedNode=e,this.events.emit(`select`,e),e&&this.nodeStartBytes.has(e.id))){let n=this.nodeStartBytes.get(e.id),r=n+e.size;n=Math.max(0,n-e.size*Ot),r=Math.min(this.totalBytes,r+e.size*Ot),this.setViewport(n,r,t)}}select(e,t=this.options.animate??K.animate){this.changeSelectedNode(e,t)}resize(){this.width=this.el.clientWidth,this.height=this.maxDepth*q+1,this.zoomedOutMin=this.width-kt>>1,this.zoomedOutWidth=this.zoomedOutMin+kt,this.zoomedOutMin<0&&(this.zoomedOutMin=0),this.zoomedOutWidth>this.width&&(this.zoomedOutWidth=this.width),this.zoomedOutWidth-=this.zoomedOutMin,this.stripeScaleAdjust=this.totalBytes/this.zoomedOutWidth,this.mainEl.style.height=`${this.height}px`,super.resize()}drawNode(e,t,n,r,i){this.nodeStartBytes.set(e.id,n);let a=this.zoomedOutWidth/(this.viewportMax-this.viewportMin),o=this.zoomedOutMin+(n-this.viewportMin)*a,s=e.size*a,c=o+s;if(c<r+1.5)return r;if(o+s<0||o>this.width)return c;let l=s<2?2:s,u=(o>0?o:0)+Dt,d=t+q/2,f=this.getText(e)||``,p=this.getSubtext(e)||``,m,h=0,g=s+o-u,_=it(this.getColor(e)||this.palette.fallback,this.c,this.zoomedOutMin-this.viewportMin*a,q,a*this.stripeScaleAdjust),v=this.palette.text,y=-1/0;i&1?(v=this.palette.fg,this.setFont(Tt)):(this.c.fillStyle=_,this.c.fillRect(o,t,l,q),(i&2||this.hoveredNode&&e.id===this.hoveredNode.id)&&(this.c.fillStyle=this.palette.hover,this.c.fillRect(o,t,l,q),i|=2)),this.ellipsisWidth<g&&(m=this.c.measureText(f).width,m<=g?h+=m:(f=this.textOverflowEllipsis(f,g)[0],h=g),this.c.fillStyle=v,this.c.fillText(f,u,d)),i&1&&this.setFont(wt),h+this.ellipsisWidth<g&&(p&&f&&(p=` - ${p}`),m=this.c.measureText(p).width,h+m>g&&(p=this.textOverflowEllipsis(p,g-h)[0]),this.c.globalAlpha=.5,this.c.fillText(p,u+h,d),this.c.globalAlpha=1);for(let r of e.children)y=this.drawNode(r,t+q,n,y,i&-2),n+=r.size;return i&1||vt(this.c,this.palette.stroke,o+.5,t+.5,l,q),c}changeHoveredNode(e){this.hoveredNode!==e&&(this.hoveredNode=e,this.canvas.style.cursor=e&&!e.children.length?`pointer`:`auto`,this.invalidate())}hitTestNode(e){let t=this.canvas.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top,i=this.viewportMin+(this.viewportMax-this.viewportMin)/this.zoomedOutWidth*(n-this.zoomedOutMin),a=(e,t,n)=>{if(i>=n&&i<n+e.size){if(r>=t&&r<t+q&&e.id)return e;if(r>=t+q)for(let r of e.children){let e=a(r,t+q,n);if(e)return e;n+=r.size}}return null};return a(this.root,0,0)}modifyViewport(e,t,n){let r=this.viewportMin,i=this.viewportMax,a=0;if(n!==null){let e=r+(i-r)/this.zoomedOutWidth*(n-this.zoomedOutMin),a=1.01**t;r=e+(r-e)*a,i=e+(i-e)*a}else a=e*(i-r)/this.zoomedOutWidth;r+a<0?a=-r:i+a>this.totalBytes&&(a=this.totalBytes-i),r+=a,i+=a,r<0&&(r=0),i>this.totalBytes&&(i=this.totalBytes),this.setViewport(r,i,!1)}setViewport(e,t,n){this.animationFromMin=this.viewportMin,this.animationFromMax=this.viewportMax,this.animationToMin=e,this.animationToMax=t,n?this.animationStart=G():this.animationStart=0,this.invalidate()}updateHover(e){let t=this.hitTestNode(e);this.changeHoveredNode(t),this.events.emit(`hover`,t,e)}};function jt(e,t){for(;t;){if(t===e)return!0;t=t.parent}return!1}function J(e,t,n){if(e===t)return;let r=t.parent,i=r.size||1,a=0;J(e,r,n);for(let e of r.children){if(e===t){n.startAngle_+=n.sweepAngle_*a/i,n.sweepAngle_=e.size/i*n.sweepAngle_;break}a+=e.size}n.depth_+=1}var Mt={};function Nt(e){return Mt[e]||(Mt[e]=400*Math.log(1+Math.log(1+e/8))),Mt[e]}var Y=-Math.PI/2,Pt=class extends Et{currentNode;hoveredNode;centerX=0;centerY=0;animationStart=0;radiusScale=1;sourceDepth=0;sourceStartAngle=Y;sourceSweepAngle=Math.PI*2;targetNode;targetDepth=this.sourceDepth;targetStartAngle=this.sourceStartAngle;targetSweepAngle=this.sourceSweepAngle;animatedNode;animatedDepth=this.sourceDepth;animatedStartAngle=this.sourceStartAngle;animatedSweepAngle=this.sourceSweepAngle;previousHoveredNode;historyStack=[];constructor(e,t={}){for(;e.children.length===1;)e=e.children[0];super(e,t),this.currentNode=e,this.targetNode=this.currentNode,this.animatedNode=this.currentNode,this.canvas.onmousemove=e=>{this.handleMouseMove(e)},this.canvas.onmouseout=e=>{this.changeHoveredNode(void 0),this.events.emit(`hover`,null,e)},this.canvas.onclick=e=>{let t=this.hitTestNode(e);if(!t)return;this.events.emit(`click`,t,e);let n=[];t===this.animatedNode.parent?this.historyStack.length>0&&(t=this.historyStack.pop(),n=this.historyStack.slice()):n=this.historyStack.concat(this.currentNode),this.events.emit(`click`,t,e),t.children.length>0?(this.select(t),this.historyStack=n):e.preventDefault()},this.el.append(this.canvas),this.resize(),Promise.resolve().then(()=>this.resize()),this.disposables.push(bt(()=>this.resize())),this.disposables.push(yt(e=>this.handleMouseMove(e)))}select(e,t){(this.currentNode!==e||this.root)&&(this.currentNode=e||this.root,this.updateSunburst(t),this.events.emit(`select`,e))}resize(){this.width=this.el.clientWidth,this.height=this.width,this.centerX=this.width>>1,this.centerY=this.height>>1;let e=2*Math.ceil(Nt(this.maxDepth));this.radiusScale=this.width/e,super.resize()}draw(){this.c.clearRect(0,0,this.width,this.height),this.drawNode(this.animatedNode,this.animatedDepth,this.computeRadius(this.animatedDepth),this.animatedStartAngle,this.animatedSweepAngle,3,-1/0),this.c.strokeStyle=this.palette.stroke,this.c.beginPath(),this.drawNode(this.animatedNode,this.animatedDepth,this.computeRadius(this.animatedDepth),this.animatedStartAngle,this.animatedSweepAngle,1,-1/0),this.c.stroke(),this.animatedDepth===0&&(this.c.fillStyle=this.palette.stroke,this.setFont(Tt),this.c.textAlign=`center`,this.c.fillText(this.getSubtext(this.targetNode)??_t(this.targetNode.size),this.centerX,this.centerY))}drawNode(e,t,n,r,i,a,o){let s=this.computeRadius(t+1);if(s>this.centerY)return o;e===this.hoveredNode&&(a|=8);let c=(n+s)/2,l=r+i;if(l-o<1.5/c)return o;let u=2/c;if(i>u&&(u=i),a&2)this.c.fillStyle=it(this.getColor(e)||this.palette.fallback,this.c,this.centerX,this.centerY,1),this.c.beginPath(),this.c.arc(this.centerX,this.centerY,n,r,r+u,!1),this.c.arc(this.centerX,this.centerY,s,r+u,r,!0),this.c.fill(),this.hoveredNode&&(a&8||e.parent===this.hoveredNode)&&(this.c.fillStyle=this.palette.hover,this.c.fill());else{let e=u===Math.PI*2,t=a&4||e?s:n;a&1&&n>0&&this.c.arc(this.centerX,this.centerY,n,r+u,r,!0),this.c.moveTo(this.centerX+t*Math.cos(r),this.centerY+t*Math.sin(r)),this.c.arc(this.centerX,this.centerY,s,r,r+u,!1),e||this.c.lineTo(this.centerX+n*Math.cos(r+u),this.centerY+n*Math.sin(r+u))}let d=e.size,f=a&10,p=0,m=-1/0;for(let n of e.children)m=this.drawNode(n,t+1,s,r+i*p/d,n.size/d*i,f,m),p+=n.size,f|=4;return l}changeHoveredNode(e,t){this.hoveredNode!==e&&(this.hoveredNode=e,this.updateSunburst(t))}hitTestNode(e){let t=this.canvas.getBoundingClientRect(),n=e.clientX-t.left-this.centerX,r=e.clientY-t.top-this.centerY,i=Math.sqrt(n*n+r*r),a=Math.atan2(r,n),o=(e,t,n,r,s)=>{let c=this.computeRadius(t+1);if(c>this.centerY)return;if(i>=n&&i<c){let t=a-r;if(t/=Math.PI*2,t-=Math.floor(t),t*=Math.PI*2,t<s)return e===this.animatedNode?e.parent:e}let l=e.size,u=0;for(let n of e.children){let e=o(n,t+1,c,r+s*u/l,n.size/l*s);if(e)return e;u+=n.size}};return o(this.animatedNode,this.animatedDepth,this.computeRadius(this.animatedDepth),this.animatedStartAngle,this.animatedSweepAngle)}tick(){let e=(G()-this.animationStart)/(this.options.animateDuration??K.animateDuration);e<0||e>1?(e=1,this.animatedNode=this.targetNode,this.targetDepth=0,this.targetStartAngle=Y,this.targetSweepAngle=Math.PI*2):(e<.5?e*=4*e*e:(e=1-e,e*=4*e*e,e=1-e),this.invalidate()),this.animatedDepth=this.sourceDepth+(this.targetDepth-this.sourceDepth)*e,this.animatedStartAngle=this.sourceStartAngle+(this.targetStartAngle-this.sourceStartAngle)*e,this.animatedSweepAngle=this.sourceSweepAngle+(this.targetSweepAngle-this.sourceSweepAngle)*e,this.draw()}handleMouseMove(e){let t=this.hitTestNode(e);this.changeHoveredNode(t),t&&t!==this.animatedNode.parent?(this.events.emit(`hover`,t,e),this.canvas.style.cursor=`pointer`):this.events.emit(`hover`,null,e)}computeRadius(e){return Nt(e)*this.radiusScale}updateSunburst(e=this.options.animate??!0){if(this.previousHoveredNode!==this.hoveredNode&&(this.previousHoveredNode=this.hoveredNode,this.hoveredNode||(this.canvas.style.cursor=`auto`,this.events.emit(`hover`,null)),this.invalidate()),this.targetNode!==this.currentNode){if(this.historyStack.length=0,this.invalidate(),e&&(this.animationStart=G()),jt(this.animatedNode,this.currentNode)){let e={depth_:this.animatedDepth,startAngle_:this.animatedStartAngle,sweepAngle_:this.animatedSweepAngle};J(this.animatedNode,this.currentNode,e),this.animatedDepth=e.depth_,this.animatedStartAngle=e.startAngle_,this.animatedSweepAngle=e.sweepAngle_,this.targetDepth=0,this.targetStartAngle=Y,this.targetSweepAngle=Math.PI*2,this.animatedNode=this.currentNode}else if(jt(this.currentNode,this.animatedNode)){let e={depth_:0,startAngle_:Y,sweepAngle_:Math.PI*2};J(this.currentNode,this.animatedNode,e),this.targetDepth=e.depth_,this.targetStartAngle=e.startAngle_,this.targetSweepAngle=e.sweepAngle_}else this.animationStart=-1/0,this.animatedNode=this.currentNode;this.sourceDepth=this.animatedDepth,this.sourceStartAngle=this.animatedStartAngle,this.sourceSweepAngle=this.animatedSweepAngle,this.targetNode=this.currentNode,this.events.emit(`select`,this.currentNode)}}},X=4,Z=20,Ft=2*X,Q=Z+X;function $(e,t,n,r,i){let a=[],o=(t,n,r,i,a)=>{let o=e[t].size*a,s=e[n].size*a;return Math.max(r*r*o/(i*i),i*i/(r*r*s))};return((t,n,r,i,s)=>{for(;t<e.length;){let c=0;for(let n=t;n<e.length;n++)c+=e[n].size;let l=Math.min(i,s),u=i*s/c,d=t,f=0,p=0;for(;d<e.length;){let n=e[d].size*u,r=o(t,d,l,f+n,u);if(d>t&&p<r)break;f+=n,p=r,d++}let m=Math.round(f/l),h=0;for(let o=t;o<d;o++){let t=e[o],c=t.size*u,d=Math.round(l*h/f),p=Math.round(l*(h+c)/f),[g,_,v,y]=i>=s?[n,r+d,m,p-d]:[n+d,r,p-d,m];a.push({node:t,box:[g,_,v,y],children:v>Ft&&y>Q?$(t.children,g+X,_+Z,v-Ft,y-Q):[]}),h+=c}t=d,i>=s?(n+=m,i-=m):(r+=m,s-=m)}})(0,t,n,r,i),a}var It=class extends Et{hoveredNode=null;currentNode=null;bgOriginX=0;bgOriginY=0;layers={base:null};baseLayoutCache;currentOriginX=0;currentOriginY=0;animationStart=0;animationBlend=1;animationSource=null;animationTarget=null;constructor(e,t={}){super(e,t),this.canvas.addEventListener(`mousemove`,e=>{this.updateHover(e)}),this.canvas.addEventListener(`mouseout`,e=>{this.changeHoveredNode(null),this.events.emit(`hover`,null,e)}),this.el.addEventListener(`click`,e=>{let t=this.hitTestNode(e);if(t){let n=t.node;this.events.emit(`click`,n,e),n.children.length?t===this.layers.current?this.updateHover(e):(this.changeCurrentLayout(t),this.changeHoveredNode(null)):this.updateHover(e)}else this.currentNode&&(this.changeCurrentLayout(null),this.updateHover(e))}),this.el.append(this.canvas),this.resize(),Promise.resolve().then(()=>this.resize()),this.disposables.push(yt(e=>this.updateHover(e))),this.disposables.push(bt(()=>this.resize()))}select(e,t){let n=null;e===this.root&&(e=null),n=e?this.searchFor([this.layers.current,this.layers.base],e):null,this.changeCurrentLayout(n,t)}drawBaseLayout(){!this.width||!this.height||(this.c.clearRect(0,0,this.width,this.height),this.bgOriginX=this.bgOriginY=0,this.baseLayoutCache?this.c.putImageData(this.baseLayoutCache,0,0):(this.drawLayout(this.layers.base,0,[]),this.baseLayoutCache=this.c.getImageData(0,0,this.width*this.ratio,this.height*this.ratio)))}draw(){this.drawBaseLayout(),this.layers.current||this.drawHoverHighlight(this.layers.base);let e=this.layers.current?this.animationSource?this.animationTarget?1:1-this.animationBlend:this.animationBlend:0;if(this.layers.current){let[t,n,r,i]=this.layers.base.box;this.c.globalAlpha=.6*(!this.layers.current||!this.animationSource?1:e),this.c.fillStyle=this.palette.bg,this.c.fillRect(t,n,r,i),this.c.globalAlpha=1}if(this.layers.previous&&this.drawLayout(this.layers.previous,1,[this.layers.current]),this.layers.current){let[t,n,r,i]=this.layers.current.box,a=this.c.getTransform(),o=Math.sqrt(a.a*a.d);this.c.save(),this.c.shadowColor=this.palette.shadow,this.c.shadowBlur=o*(30*e),this.c.shadowOffsetX=o*(2*this.width),this.c.shadowOffsetY=o*(2*this.height+15*e),this.c.fillRect(t-2*this.width,n-2*this.height,r,i),this.c.restore(),this.bgOriginX=this.currentOriginX,this.bgOriginY=this.currentOriginY,this.drawLayout(this.layers.current,0,[]),this.drawHoverHighlight(this.layers.current)}}tick(){let e=this.animationBlend,t=this.currentNode;this.animationBlend=(G()-this.animationStart)/(this.options.animateDuration??K.animateDuration),this.animationBlend<0||this.animationBlend>1?(this.currentNode=this.animationTarget,this.layers.previous=void 0,this.animationBlend=1):(this.animationBlend=1-this.animationBlend,this.animationBlend*=this.animationBlend*this.animationBlend,this.animationBlend=1-this.animationBlend,this.invalidate()),(this.animationBlend!==e||this.currentNode!==t)&&this.updateCurrentLayout(),this.draw()}resize(){this.baseLayoutCache=void 0;let e=this.width,t=this.height;this.width=Math.min(this.el.clientWidth,1600),this.height=Math.max(Math.round(this.width/2),innerHeight-200),(this.width!==e||this.height!==t||!this.layers.base)&&(this.layers.base=$([this.root],0,0,this.width-1,this.height-1)[0],this.updateCurrentLayout()),super.resize()}*iterateNodeToDraw(e,t,n){let r=e.node,[i,a,o,s]=e.box,c=(r===this.hoveredNode?1:0)|(e===this.animationTarget?2:0);if(t===1)for(let e of n){if(!e)continue;let[n,r,c,l]=e.box;if(i>=n&&a>=r&&i+o<=n+c&&a+s<=r+l){t=2;break}}for(let r of e.children)c|=yield*this.iterateNodeToDraw(r,t,n);return t!==2&&(yield e),c}drawHoverHighlight(e){let t=this.iterateNodeToDraw(e,0,[]),n=this.c.globalCompositeOperation;for(;;){let e=t.next();if(e.done){this.c.globalCompositeOperation=n;return}let r=e.value.node;if(this.hoveredNode===r){this.c.globalCompositeOperation=`overlay`;let[t,n,r,i]=e.value.box;this.c.fillStyle=this.palette.hover,this.c.fillRect(t,n,r,i)}}}drawNodeBackground(e,t,n){let r=this.iterateNodeToDraw(e,t,n);for(;;){let e=r.next();if(e.done)return e.value;let[t,n,i,a]=e.value.box;this.c.fillStyle=it(this.getColor(e.value.node)||this.palette.fallback,this.c,this.bgOriginX,this.bgOriginY,1),e.value.children.length?(this.c.fillRect(t,n,i,Z),this.c.fillRect(t,n+a-X,i,X),this.c.fillRect(t,n+Z,X,a-Q),this.c.fillRect(t+i-X,n+Z,X,a-Q)):this.c.fillRect(t,n,i,a)}}drawLayout(e,t,n){this.drawNodeBackground(e,t,n),this.drawNodeForeground(e,t,n)}drawNodeForeground(e,t,n){let r=this.iterateNodeToDraw(e,t,n);for(;;){let e=r.next();if(e.done)return;let t=e.value.node,[n,i,a,o]=e.value.box;if(vt(this.c,this.palette.stroke,n+.5,i+.5,a,o),o>=Z){this.c.fillStyle=this.palette.text;let e=a-Ft,r=i+Math.round(Q/2),[s,c]=this.textOverflowEllipsis(this.getText(t)||``,e),l=n+Math.round((a-c)/2),u=this.getText(t),d=this.getSubtext(t);if(s===u&&t.children.length){let t=d||``;t&&u&&(t=` - ${t}`);let[i,o]=this.textOverflowEllipsis(t,e-c);l=n+Math.round((a-c-o)/2),this.c.globalAlpha=.5,this.c.fillText(i,l+c,r),this.c.globalAlpha=1}if(this.c.fillText(s,l,r),o>Q+16&&!t.children.length){let[t,r]=this.textOverflowEllipsis(d||``,e);this.c.globalAlpha=.5;let s=u?Z:Z/2+X;this.c.fillText(t,n+Math.round((a-r)/2),i+s+Math.round(o-Q)/2),this.c.globalAlpha=1}}}}updateCurrentLayout(){let e=this.options.selectedPaddingRatio??.2;if(this.currentNode){let[t,n,r,i]=this.currentNode.box,a=t+r,o=n+i,s=Math.round(this.width*e/2),c=Math.round(this.height*e/2),l=this.width-s-1,u=this.height-c-1,d=this.animationTarget?this.animationBlend:1-this.animationBlend,f=Math.round(t+(s-t)*d),p=Math.round(n+(c-n)*d),m=Math.round(a+(l-a)*d),h=Math.round(o+(u-o)*d),g=e=>e-Math.floor(e/64-.5)*64;this.layers.current=$([this.currentNode.node],f,p,m-f,h-p)[0],this.currentOriginX=g(-(t+a)/2)*(1-d)+(f+m)/2,this.currentOriginY=g(-(n+o)/2)*(1-d)+(p+h)/2}else this.layers.current=void 0,this.currentOriginX=0,this.currentOriginY=0}hitTestNode(e){let t=this.canvas.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top,i=(e,t)=>{for(let a of e){let[e,o,s,c]=a.box;if(n>=e&&r>=o&&n<e+s&&r<o+c)return i(a.children,!1)||(t?null:a)}return null};return this.layers.current?i([this.layers.current],!1):i([this.layers.base],!0)}updateHover(e){let t=this.hitTestNode(e);this.changeHoveredNode(t&&t.node),this.events.emit(`hover`,t?.node||null,e)}changeHoveredNode(e){this.hoveredNode!==e&&(this.hoveredNode=e,this.canvas.style.cursor=e&&!e.children.length?`pointer`:`auto`,this.invalidate())}searchFor(e,t){for(let n of e){if(!n)continue;let e=n.node===t?n:this.searchFor(n.children,t);if(e)return e}return null}changeCurrentLayout(e,t=this.options.animate){this.animationTarget!==e&&(this.events.emit(`select`,e?.node||null),this.layers.previous=e?this.layers.current:void 0,t&&(this.animationBlend=0,this.animationStart=G(),this.animationSource=this.currentNode),this.animationTarget=e,this.currentNode=e||this.searchFor([this.layers.base],this.currentNode.node),this.updateCurrentLayout(),this.invalidate())}},Lt={flex:`~ gap-1 items-center wrap`},Rt={key:0,"i-ph-arrow-right-bold":``,"text-sm":``,"op-fade":``},zt=[`onClick`],Bt=ne({__name:`NavBreadcrumb`,props:{selected:{},options:{}},emits:[`select`],setup(e,{emit:t}){let n=e,r=t,i=x(()=>{let e=[],t=n.selected;for(;t;)e.unshift(t),t=t.parent;return e});return(e,t)=>(f(),w(`div`,Lt,[(f(!0),w(v,null,ee(i.value,(e,t)=>(f(),w(v,{key:e.id},[t>0?(f(),w(`div`,Rt)):te(``,!0),S(`button`,{hover:`bg-active`,rounded:``,px1:``,onClick:t=>r(`select`,e)},[S(`span`,null,_(e.text||e.id),1)],8,zt)],64))),128))]))}}),Vt=Object.assign(Bt,{__name:`ChartNavBreadcrumb`});function Ht(e){let{data:t,nameKey:n,sizeKey:r,rootText:a,nodeType:o,graphOptions:s,onUpdate:c}=e,l=p(void 0),u=p(void 0),f=i(void 0),m=p(void 0),h,_=x(()=>{if(e.tree)return e.tree.value;let i=g(t),s=new Map,c=0,l={id:`~root`,text:a,size:0,sizeSelf:0,children:[]};if(!i?.length)return{map:s,root:l,maxDepth:c};let u=[];u.unshift(()=>{l.size+=l.children.reduce((e,t)=>e+t.size,0),l.subtext=T(l.size).join(` `),l.children.sort((e,t)=>t.size-e.size||e.id.localeCompare(t.id))});function d(e,t,n,r,i){if(s.has(t))return s.get(t);i>c&&(c=i);let a={id:t,text:n,size:0,sizeSelf:0,children:[],meta:{...e,path:n,type:`folder`},parent:r};return s.set(t,a),r.children.push(a),u.unshift(()=>{let t=a.sizeSelf;a.size+=a.children.reduce((e,t)=>e+t.size,0),a.subtext=T(a.size).join(` `),a.children.length&&t/a.size>.1&&a.children.push({id:`${a.id}-self`,text:``,size:t,sizeSelf:t,subtext:T(t).join(` `),children:[],meta:{...e,path:``,type:o},parent:a}),a.children.sort((e,t)=>t.size-e.size||e.id.localeCompare(t.id))}),a}function f(e){let t=e[n].split(`/`).filter(Boolean),i=l,a=``,c=0;t.forEach((l,u)=>{if(a+=(a?`/`:``)+l,c++,u===t.length-1){let t={id:e[n],text:l,size:e[r],sizeSelf:e[r],subtext:T(e[r]).join(` `),children:[],meta:{...e,path:l,type:o}};i.children.push(t),s.set(e[n],t)}else i=d(e,a,l,i,c)})}return i.forEach(f),u.forEach(e=>e()),{map:s,root:l,maxDepth:c}}),v=x(()=>({animate:oe.value.chartAnimation,palette:{stroke:C.value?`#222`:`#555`,fg:C.value?`#fff`:`#000`,bg:C.value?`#111`:`#fff`},getColor:st(_.value.root,C.value?.8:.9,C.value?1:1.1),getSubtext:e=>e.subtext,...s}));function y(e,t){f.value=e?.meta,e?.children.length||(e=e?.parent),m.value?.select(e,t)}function b(){h?.(),u.value=_.value.root,c?.(),ae(()=>{let e=f.value&&_.value.map.get(f.value[n])||null;e&&y(e,!1)}),h=()=>{m.value?.dispose(),m.value=void 0,f.value=void 0}}return ae(()=>{d(()=>[_.value,v.value],()=>{b()},{deep:!0,immediate:!1}),b()}),ie(()=>{h?.()}),{tree:_,graph:m,chartOptions:v,nodeHover:l,nodeSelected:u,selectedNode:f,selectNode:y,buildGraph:b}}export{It as a,Qe as c,Pt as i,Vt as n,at as o,At as r,dt as s,Ht as t};
1
+ import{A as e,At as t,D as n,F as r,Jt as i,Lt as a,M as o,N as s,O as c,P as l,Qt as u,Rt as d,Tt as f,Xt as p,at as m,ct as h,en as g,in as _,it as v,j as y,k as b,kt as ee,lt as te,mt as ne,ot as x,rn as re,st as S,t as C,ut as w,wt as ie,xt as ae}from"./DilC1n1-.js";import{t as T}from"./DQtLZa7C.js";import{t as oe}from"./DtmncGDc.js";function E(){return typeof window<`u`}function D(e){return se(e)?(e.nodeName||``).toLowerCase():`#document`}function O(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function k(e){return((se(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function se(e){return E()?e instanceof Node||e instanceof O(e).Node:!1}function A(e){return E()?e instanceof Element||e instanceof O(e).Element:!1}function j(e){return E()?e instanceof HTMLElement||e instanceof O(e).HTMLElement:!1}function ce(e){return!E()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof O(e).ShadowRoot}var le=new Set([`inline`,`contents`]);function M(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=I(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!le.has(i)}var ue=new Set([`table`,`td`,`th`]);function de(e){return ue.has(D(e))}var fe=[`:popover-open`,`:modal`];function N(e){return fe.some(t=>{try{return e.matches(t)}catch{return!1}})}var pe=[`transform`,`translate`,`scale`,`rotate`,`perspective`],me=[`transform`,`translate`,`scale`,`rotate`,`perspective`,`filter`],he=[`paint`,`layout`,`strict`,`content`];function ge(e){let t=P(),n=A(e)?I(e):e;return pe.some(e=>n[e]?n[e]!==`none`:!1)||(n.containerType?n.containerType!==`normal`:!1)||!t&&(n.backdropFilter?n.backdropFilter!==`none`:!1)||!t&&(n.filter?n.filter!==`none`:!1)||me.some(e=>(n.willChange||``).includes(e))||he.some(e=>(n.contain||``).includes(e))}function _e(e){let t=R(e);for(;j(t)&&!F(t);){if(ge(t))return t;if(N(t))return null;t=R(t)}return null}function P(){return typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter`,`none`)}var ve=new Set([`html`,`body`,`#document`]);function F(e){return ve.has(D(e))}function I(e){return O(e).getComputedStyle(e)}function L(e){return A(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function R(e){if(D(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ce(e)&&e.host||k(e);return ce(t)?t.host:t}function ye(e){let t=R(e);return F(t)?e.ownerDocument?e.ownerDocument.body:e.body:j(t)&&M(t)?t:ye(t)}function be(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=ye(e),i=r===e.ownerDocument?.body,a=O(r);if(i){let e=xe(a);return t.concat(a,a.visualViewport||[],M(r)?r:[],e&&n?be(e):[])}return t.concat(r,be(r,[],n))}function xe(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Se(e){let t=I(e),n=parseFloat(t.width)||0,i=parseFloat(t.height)||0,a=j(e),o=a?e.offsetWidth:n,s=a?e.offsetHeight:i,c=r(n)!==o||r(i)!==s;return c&&(n=o,i=s),{width:n,height:i,$:c}}function Ce(e){return A(e)?e:e.contextElement}function z(e){let t=Ce(e);if(!j(t))return y(1);let n=t.getBoundingClientRect(),{width:i,height:a,$:o}=Se(t),s=(o?r(n.width):n.width)/i,c=(o?r(n.height):n.height)/a;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}var we=y(0);function Te(e){let t=O(e);return!P()||!t.visualViewport?we:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ee(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==O(e)?!1:t}function B(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Ce(e),o=y(1);t&&(r?A(r)&&(o=z(r)):o=z(e));let s=Ee(a,n,r)?Te(a):y(0),c=(i.left+s.x)/o.x,u=(i.top+s.y)/o.y,d=i.width/o.x,f=i.height/o.y;if(a){let e=O(a),t=r&&A(r)?O(r):r,n=e,i=xe(n);for(;i&&r&&t!==n;){let e=z(i),t=i.getBoundingClientRect(),r=I(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,u*=e.y,d*=e.x,f*=e.y,c+=a,u+=o,n=O(i),i=xe(n)}}return l({width:d,height:f,x:c,y:u})}function V(e,t){let n=L(e).scrollLeft;return t?t.left+n:B(k(e)).left+n}function De(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-V(e,n),y:n.top+t.scrollTop}}function Oe(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=k(r),s=t?N(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=y(1),u=y(0),d=j(r);if((d||!d&&!a)&&((D(r)!==`body`||M(o))&&(c=L(r)),j(r))){let e=B(r);l=z(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?De(o,c):y(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function ke(e){return Array.from(e.getClientRects())}function Ae(e){let t=k(e),n=L(e),r=e.ownerDocument.body,i=o(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=o(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),s=-n.scrollLeft+V(e),c=-n.scrollTop;return I(r).direction===`rtl`&&(s+=o(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:s,y:c}}var je=25;function Me(e,t){let n=O(e),r=k(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=P();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=V(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=je&&(a-=o)}else l<=je&&(a+=l);return{width:a,height:o,x:s,y:c}}var Ne=new Set([`absolute`,`fixed`]);function Pe(e,t){let n=B(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=j(e)?z(e):y(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Fe(e,t,n){let r;if(t===`viewport`)r=Me(e,n);else if(t===`document`)r=Ae(k(e));else if(A(t))r=Pe(t,n);else{let n=Te(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return l(r)}function Ie(e,t){let n=R(e);return n===t||!A(n)||F(n)?!1:I(n).position===`fixed`||Ie(n,t)}function Le(e,t){let n=t.get(e);if(n)return n;let r=be(e,[],!1).filter(e=>A(e)&&D(e)!==`body`),i=null,a=I(e).position===`fixed`,o=a?R(e):e;for(;A(o)&&!F(o);){let t=I(o),n=ge(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&Ne.has(i.position)||M(o)&&!n&&Ie(e,o))?r=r.filter(e=>e!==o):i=t,o=R(o)}return t.set(e,r),r}function Re(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?N(t)?[]:Le(t,this._c):[].concat(n),r],c=a[0],l=a.reduce((e,n)=>{let r=Fe(t,n,i);return e.top=o(r.top,e.top),e.right=s(r.right,e.right),e.bottom=s(r.bottom,e.bottom),e.left=o(r.left,e.left),e},Fe(t,c,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function ze(e){let{width:t,height:n}=Se(e);return{width:t,height:n}}function Be(e,t,n){let r=j(t),i=k(t),a=n===`fixed`,o=B(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=y(0);function l(){c.x=V(i)}if(r||!r&&!a)if((D(t)!==`body`||M(i))&&(s=L(t)),r){let e=B(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?De(i,s):y(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Ve(e){return I(e).position===`static`}function He(e,t){if(!j(e)||I(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return k(e)===n&&(n=n.ownerDocument.body),n}function Ue(e,t){let n=O(e);if(N(e))return n;if(!j(e)){let t=R(e);for(;t&&!F(t);){if(A(t)&&!Ve(t))return t;t=R(t)}return n}let r=He(e,t);for(;r&&de(r)&&Ve(r);)r=He(r,t);return r&&F(r)&&Ve(r)&&!ge(r)?n:r||_e(e)||n}var We=async function(e){let t=this.getOffsetParent||Ue,n=this.getDimensions,r=await n(e.floating);return{reference:Be(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ge(e){return I(e).direction===`rtl`}var Ke={convertOffsetParentRelativeRectToViewportRelativeRect:Oe,getDocumentElement:k,getClippingRect:Re,getOffsetParent:Ue,getElementRects:We,getClientRects:ke,getDimensions:ze,getScale:z,isElement:A,isRTL:Ge},qe=b,Je=e,Ye=c,Xe=(e,t,r)=>{let i=new Map,a={platform:Ke,...r},o={...a.platform,_c:i};return n(e,t,{...a,platform:o})},Ze=ne({__name:`GraphHoverView`,props:{hoverX:{},hoverY:{}},setup(e){let{hoverX:n,hoverY:r}=u(e),o=a(`hoverElement`),s=i(0),c=i(0);return d([n,r],([e,t])=>{Xe({getBoundingClientRect(){return{width:0,height:0,x:e,y:t,left:e,right:e,top:t,bottom:t}}},o.value,{placement:`right-start`,middleware:[Ye(),Je(),qe({mainAxis:8,alignmentAxis:8})]}).then(({x:e,y:t})=>{s.value=e,c.value=t})}),(e,n)=>(f(),h(m,{to:`body`},[S(`div`,{ref_key:`hoverElement`,ref:o,fixed:``,"z-panel-content":``,"pointer-events-none":``,style:re({left:`${s.value}px`,top:`${c.value}px`})},[t(e.$slots,`default`)],4)]))}}),Qe=Object.assign(Ze,{__name:`DisplayGraphHoverView`});function $e(e,t=1,n=1){let r=(.6+.4*Math.max(0,Math.cos(e)))*t,i=(.5+.2*Math.max(0,Math.cos(e+Math.PI*2/3)))*n;return`hsl(${e*180/Math.PI}deg, ${Math.round(100*r)}%, ${Math.round(100*i)}%)`}var et,tt,nt,H,U,W=1,rt;function it(e,t,n,r,i){if(!Array.isArray(e))return e;let a=window.devicePixelRatio||1;if(et!==t||tt!==a||nt!==i){let n=Math.round(64*a)/64;W=i,W=Math.log2(W),W-=Math.floor(W);let r=W,o=Math.min(1,8*r);W=2**W;let s=8*Math.SQRT2/W;et=t,tt=a,nt=i,H||=document.createElement(`canvas`),U||=H.getContext(`2d`),H.width=H.height=Math.round(64*n),U.scale(n,n),U.fillStyle=e[0],U.fillRect(0,0,64,64),U.globalAlpha=.25,U.fillStyle=e[1],U.fillRect(0,0,64,64),U.globalAlpha=.67,U.strokeStyle=e[1],U.beginPath();for(let e=0;e<=64;e+=16)U.moveTo(e-32,e+32),U.lineTo(e+32,e-32);if(U.lineWidth=s*(1-(o-r)/2),U.stroke(),o+r>0){U.beginPath();for(let e=8;e<64;e+=16)U.moveTo(e-32,e+32),U.lineTo(e+32,e-32);U.lineWidth=s*(o+r)/2,U.stroke()}rt=t.createPattern(H,`repeat`),W/=n}return n/=64*W*a,n-=Math.floor(n),n*=64*W*a,rt.setTransform(new DOMMatrix([W,0,0,W,n,r])),rt}function at(e){return Array.isArray(e)?`url('data:image/svg+xml,<svg width="26" height="26" xmlns="http://www.w3.org/2000/svg"><rect width="26" height="26" fill="${e[0]}"/><rect width="26" height="26" fill="${e[1]}" fill-opacity="25%"/><path d="M22.5 -3.5L-3.5 22.5M35.5 9.5L9.5 35.5" stroke="${e[1]}" stroke-opacity="67%" stroke-width="9.19239"/></svg>')`:e}function ot(e){return t=>t.id&&e[t.id]||t.color}function st(e,t=1,n=1){let r={};return ct(r,e,0,Math.PI*2,t,n),ot(r)}function ct(e,t,n,r,i=1,a=1){let o=t.size;e[t.id]=$e(n+r/2,i,a);for(let s of t.children){let t=s.size/o*r;ct(e,s,n,t,i,a),n+=t}}var lt=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`;function ut(e=16,t=lt){let n=``,r=e,i=t.length;for(;r--;)n+=t[Math.random()*i|0];return n}function dt(e,t,n=(e,t)=>t.size-e.size){if(e.__nanovis)return e;let r={...e};return r.id||=ut(),r.parent||=t,r.children||=[],r.sizeSelf==null&&r.size!=null&&r.children.length===0?r.sizeSelf=r.size:r.sizeSelf||=0,r.children=(r.children||[]).map(e=>dt(e,r,n)),r.size||=r.children.reduce((e,t)=>e+t.size,0)+r.sizeSelf,n&&r.children.sort(n),Object.defineProperty(r,`__nanovis`,{enumerable:!1,value:!0}),r}function ft(e){return e.children.length===0?1:Math.max(...e.children.map(e=>ft(e)))+1}var pt=/\bFirefox\//.test(navigator.userAgent),mt;function ht(e){return mt?mt.format(e):`${e}`}function G(){return(window.performance||Date).now()}function gt(e){let t=e.toFixed(1).split(`.`,2);return`${ht(+t[0])}.${t[1]}`}function _t(e){return e===1?`1 byte`:e<1024?`${ht(e)} bytes`:e<1024*1024?`${gt(e/1024)} kb`:e<1024*1024*1024?`${gt(e/(1024*1024))} mb`:`${gt(e/(1024*1024*1024))} gb`}function vt(e,t,n,r,i,a){if(pt){let o=e.lineWidth,s=o/2;e.fillStyle=t,e.fillRect(n-s,r-s,i+o,o),e.fillRect(n-s,r+s,o,a-o),e.fillRect(n-s,r+a-s,i+o,o),e.fillRect(n+i-s,r+s,o,a-o);return}e.strokeStyle=t,e.strokeRect(n,r,i,a)}function yt(e){return window.addEventListener(`wheel`,e,{passive:!1}),()=>window.removeEventListener(`wheel`,e)}function bt(e){return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)}try{mt=new Intl.NumberFormat}catch{}var xt=()=>({emit(e,...t){for(let n=this.events[e]||[],r=0,i=n.length;r<i;r++)n[r](...t)},events:{},on(e,t){return(this.events[e]||=[]).push(t),()=>{this.events[e]=this.events[e]?.filter(e=>t!==e)}}}),K={getText:e=>e.text,getSubtext:e=>e.subtext,animate:!0,animateDuration:350},St={fallback:`#CCC`,stroke:`#0008`,text:`#222`,hover:`#fff5`,shadow:`#0008`,fg:`#fff`,bg:`#222`},Ct=46,wt=`14px sans-serif`,Tt=`bold ${wt}`,Et=class{el;canvas;c;width=0;height=0;ratio=1;root;maxDepth;events;options;palette;disposables;getColor;getText;getSubtext;_animationFrame=null;constructor(e,t){this.options={...K,...t};let{getColor:n=st(e),getText:r=()=>void 0,getSubtext:i=()=>void 0}=this.options;this.palette={...St,...t.palette},this.el=document.createElement(`div`),this.canvas=document.createElement(`canvas`),this.c=this.canvas.getContext(`2d`),this.root=e,this.maxDepth=ft(e),this.disposables=[],this.events=xt(),this.getColor=n,this.getText=r,this.getSubtext=i,this.setFont(wt),t.onClick&&this.events.on(`click`,t.onClick),t.onHover&&this.events.on(`hover`,t.onHover),t.onLeave&&this.events.on(`leave`,t.onLeave),t.onSelect&&this.events.on(`select`,t.onSelect),this.el.addEventListener(`mouseleave`,()=>{this.events.emit(`leave`)})}invalidate(){this._animationFrame===null&&(this._animationFrame=requestAnimationFrame(()=>{this._animationFrame=null,this.tick()}))}tick(){this.draw()}draw(){}resize(){this.ratio=window.devicePixelRatio||1,this.canvas.style.width=`${this.width}px`,this.canvas.style.height=`${this.height}px`,this.canvas.width=Math.round(this.width*this.ratio),this.canvas.height=Math.round(this.height*this.ratio),this.c.scale(this.ratio,this.ratio),this.draw()}select(e,t){this.events.emit(`select`,e)}dispose(){this.disposables.forEach(e=>e()),this.disposables.length=0,this.el.remove()}[Symbol.dispose](){this.dispose()}_font=`14px sans-serif`;_fontWidthCache=new Map;ellipsisWidth=0;getFontCache(){return this._fontWidthCache.has(this._font)||this._fontWidthCache.set(this._font,{}),this._fontWidthCache.get(this._font)}setFont(e){this._font=e,this.c.font=e,this.c.textBaseline=`middle`,this.ellipsisWidth=3*this.charCodeWidth(Ct)}charCodeWidth(e){let t=this.getFontCache(),n=t[e];return n===void 0&&(n=this.c.measureText(String.fromCharCode(e)).width,t[e]=n),n}textOverflowEllipsis(e,t){if(t<this.ellipsisWidth)return[``,0];let n=0,r=e.length,i=0;for(;i<r;){let r=this.charCodeWidth(e.charCodeAt(i));if(t<n+this.ellipsisWidth+r)return[`${e.slice(0,i)}...`,n+this.ellipsisWidth];n+=r,i++}return[e,n]}},q=24,Dt=5,Ot=.01,kt=1e3,At=class extends Et{mainEl=document.createElement(`div`);totalBytes;viewportMin;viewportMax;zoomedOutMin=0;zoomedOutWidth=0;prevWheelTime=0;prevWheelWasZoom=!1;stripeScaleAdjust=1;hoveredNode=null;selectedNode=null;nodeStartBytes=new Map;animationFromMin=0;animationFromMax=0;animationToMin=0;animationToMax=0;animationStart=0;constructor(e,t={}){super(e,t),this.totalBytes=e.size,this.viewportMin=this.animationFromMin=this.animationToMin=0,this.viewportMax=this.animationFromMax=this.animationToMax=this.totalBytes,Object.assign(this.mainEl.style,{position:`relative`}),Object.assign(this.canvas.style,{position:`absolute`,left:`0`,top:`0`});let n=!1;this.canvas.onmousedown=e=>{if(n=!1,e.button!==2){let t=e.pageX,r=e=>{let r=e.pageX-t;!n&&Math.abs(r)<3||(n=!0,this.modifyViewport(-r,0,null),t=e.pageX)},i=()=>{document.removeEventListener(`mousemove`,r),document.removeEventListener(`mouseup`,i)};e.preventDefault(),document.addEventListener(`mousemove`,r),document.addEventListener(`mouseup`,i)}},this.canvas.onmousemove=e=>{this.updateHover(e)},this.canvas.onmouseout=()=>{this.changeHoveredNode(null)},this.canvas.onclick=e=>{if(n)return;let t=this.hitTestNode(e);this.changeHoveredNode(t),this.changeSelectedNode(t),t&&this.events.emit(`click`,t,e)},this.disposables.push(yt(e=>{let t=e.deltaX,n=e.deltaY,r=G(),i=r-this.prevWheelTime<50?this.prevWheelWasZoom:e.ctrlKey||e.metaKey;this.prevWheelTime=r,this.prevWheelWasZoom=i,(i||Math.abs(t)>=Math.abs(n))&&e.preventDefault(),this.modifyViewport(t,n,i?e.pageX:null),this.updateHover(e)})),this.resize(),Promise.resolve().then(()=>this.resize()),this.disposables.push(bt(()=>this.resize())),this.mainEl.append(this.canvas),this.el.append(this.mainEl)}tick(){let e=(G()-this.animationStart)/(this.options.animateDuration??K.animateDuration);e<0||e>1?(e=1,this.viewportMin=this.animationToMin,this.viewportMax=this.animationToMax):(e<.5?e*=4*e*e:(e=1-e,e*=4*e*e,e=1-e),this.viewportMin=this.animationFromMin+(this.animationToMin-this.animationFromMin)*e,this.viewportMax=this.animationFromMax+(this.animationToMax-this.animationFromMax)*e,this.invalidate()),this.draw()}draw(){this.c.clearRect(0,0,this.width,this.height),this.drawNode(this.root,0,0,-1/0,1)}changeSelectedNode(e,t=this.options.animate??K.animate){if(this.selectedNode!==e&&(this.selectedNode=e,this.events.emit(`select`,e),e&&this.nodeStartBytes.has(e.id))){let n=this.nodeStartBytes.get(e.id),r=n+e.size;n=Math.max(0,n-e.size*Ot),r=Math.min(this.totalBytes,r+e.size*Ot),this.setViewport(n,r,t)}}select(e,t=this.options.animate??K.animate){this.changeSelectedNode(e,t)}resize(){this.width=this.el.clientWidth,this.height=this.maxDepth*q+1,this.zoomedOutMin=this.width-kt>>1,this.zoomedOutWidth=this.zoomedOutMin+kt,this.zoomedOutMin<0&&(this.zoomedOutMin=0),this.zoomedOutWidth>this.width&&(this.zoomedOutWidth=this.width),this.zoomedOutWidth-=this.zoomedOutMin,this.stripeScaleAdjust=this.totalBytes/this.zoomedOutWidth,this.mainEl.style.height=`${this.height}px`,super.resize()}drawNode(e,t,n,r,i){this.nodeStartBytes.set(e.id,n);let a=this.zoomedOutWidth/(this.viewportMax-this.viewportMin),o=this.zoomedOutMin+(n-this.viewportMin)*a,s=e.size*a,c=o+s;if(c<r+1.5)return r;if(o+s<0||o>this.width)return c;let l=s<2?2:s,u=(o>0?o:0)+Dt,d=t+q/2,f=this.getText(e)||``,p=this.getSubtext(e)||``,m,h=0,g=s+o-u,_=it(this.getColor(e)||this.palette.fallback,this.c,this.zoomedOutMin-this.viewportMin*a,q,a*this.stripeScaleAdjust),v=this.palette.text,y=-1/0;i&1?(v=this.palette.fg,this.setFont(Tt)):(this.c.fillStyle=_,this.c.fillRect(o,t,l,q),(i&2||this.hoveredNode&&e.id===this.hoveredNode.id)&&(this.c.fillStyle=this.palette.hover,this.c.fillRect(o,t,l,q),i|=2)),this.ellipsisWidth<g&&(m=this.c.measureText(f).width,m<=g?h+=m:(f=this.textOverflowEllipsis(f,g)[0],h=g),this.c.fillStyle=v,this.c.fillText(f,u,d)),i&1&&this.setFont(wt),h+this.ellipsisWidth<g&&(p&&f&&(p=` - ${p}`),m=this.c.measureText(p).width,h+m>g&&(p=this.textOverflowEllipsis(p,g-h)[0]),this.c.globalAlpha=.5,this.c.fillText(p,u+h,d),this.c.globalAlpha=1);for(let r of e.children)y=this.drawNode(r,t+q,n,y,i&-2),n+=r.size;return i&1||vt(this.c,this.palette.stroke,o+.5,t+.5,l,q),c}changeHoveredNode(e){this.hoveredNode!==e&&(this.hoveredNode=e,this.canvas.style.cursor=e&&!e.children.length?`pointer`:`auto`,this.invalidate())}hitTestNode(e){let t=this.canvas.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top,i=this.viewportMin+(this.viewportMax-this.viewportMin)/this.zoomedOutWidth*(n-this.zoomedOutMin),a=(e,t,n)=>{if(i>=n&&i<n+e.size){if(r>=t&&r<t+q&&e.id)return e;if(r>=t+q)for(let r of e.children){let e=a(r,t+q,n);if(e)return e;n+=r.size}}return null};return a(this.root,0,0)}modifyViewport(e,t,n){let r=this.viewportMin,i=this.viewportMax,a=0;if(n!==null){let e=r+(i-r)/this.zoomedOutWidth*(n-this.zoomedOutMin),a=1.01**t;r=e+(r-e)*a,i=e+(i-e)*a}else a=e*(i-r)/this.zoomedOutWidth;r+a<0?a=-r:i+a>this.totalBytes&&(a=this.totalBytes-i),r+=a,i+=a,r<0&&(r=0),i>this.totalBytes&&(i=this.totalBytes),this.setViewport(r,i,!1)}setViewport(e,t,n){this.animationFromMin=this.viewportMin,this.animationFromMax=this.viewportMax,this.animationToMin=e,this.animationToMax=t,n?this.animationStart=G():this.animationStart=0,this.invalidate()}updateHover(e){let t=this.hitTestNode(e);this.changeHoveredNode(t),this.events.emit(`hover`,t,e)}};function jt(e,t){for(;t;){if(t===e)return!0;t=t.parent}return!1}function J(e,t,n){if(e===t)return;let r=t.parent,i=r.size||1,a=0;J(e,r,n);for(let e of r.children){if(e===t){n.startAngle_+=n.sweepAngle_*a/i,n.sweepAngle_=e.size/i*n.sweepAngle_;break}a+=e.size}n.depth_+=1}var Mt={};function Nt(e){return Mt[e]||(Mt[e]=400*Math.log(1+Math.log(1+e/8))),Mt[e]}var Y=-Math.PI/2,Pt=class extends Et{currentNode;hoveredNode;centerX=0;centerY=0;animationStart=0;radiusScale=1;sourceDepth=0;sourceStartAngle=Y;sourceSweepAngle=Math.PI*2;targetNode;targetDepth=this.sourceDepth;targetStartAngle=this.sourceStartAngle;targetSweepAngle=this.sourceSweepAngle;animatedNode;animatedDepth=this.sourceDepth;animatedStartAngle=this.sourceStartAngle;animatedSweepAngle=this.sourceSweepAngle;previousHoveredNode;historyStack=[];constructor(e,t={}){for(;e.children.length===1;)e=e.children[0];super(e,t),this.currentNode=e,this.targetNode=this.currentNode,this.animatedNode=this.currentNode,this.canvas.onmousemove=e=>{this.handleMouseMove(e)},this.canvas.onmouseout=e=>{this.changeHoveredNode(void 0),this.events.emit(`hover`,null,e)},this.canvas.onclick=e=>{let t=this.hitTestNode(e);if(!t)return;this.events.emit(`click`,t,e);let n=[];t===this.animatedNode.parent?this.historyStack.length>0&&(t=this.historyStack.pop(),n=this.historyStack.slice()):n=this.historyStack.concat(this.currentNode),this.events.emit(`click`,t,e),t.children.length>0?(this.select(t),this.historyStack=n):e.preventDefault()},this.el.append(this.canvas),this.resize(),Promise.resolve().then(()=>this.resize()),this.disposables.push(bt(()=>this.resize())),this.disposables.push(yt(e=>this.handleMouseMove(e)))}select(e,t){(this.currentNode!==e||this.root)&&(this.currentNode=e||this.root,this.updateSunburst(t),this.events.emit(`select`,e))}resize(){this.width=this.el.clientWidth,this.height=this.width,this.centerX=this.width>>1,this.centerY=this.height>>1;let e=2*Math.ceil(Nt(this.maxDepth));this.radiusScale=this.width/e,super.resize()}draw(){this.c.clearRect(0,0,this.width,this.height),this.drawNode(this.animatedNode,this.animatedDepth,this.computeRadius(this.animatedDepth),this.animatedStartAngle,this.animatedSweepAngle,3,-1/0),this.c.strokeStyle=this.palette.stroke,this.c.beginPath(),this.drawNode(this.animatedNode,this.animatedDepth,this.computeRadius(this.animatedDepth),this.animatedStartAngle,this.animatedSweepAngle,1,-1/0),this.c.stroke(),this.animatedDepth===0&&(this.c.fillStyle=this.palette.stroke,this.setFont(Tt),this.c.textAlign=`center`,this.c.fillText(this.getSubtext(this.targetNode)??_t(this.targetNode.size),this.centerX,this.centerY))}drawNode(e,t,n,r,i,a,o){let s=this.computeRadius(t+1);if(s>this.centerY)return o;e===this.hoveredNode&&(a|=8);let c=(n+s)/2,l=r+i;if(l-o<1.5/c)return o;let u=2/c;if(i>u&&(u=i),a&2)this.c.fillStyle=it(this.getColor(e)||this.palette.fallback,this.c,this.centerX,this.centerY,1),this.c.beginPath(),this.c.arc(this.centerX,this.centerY,n,r,r+u,!1),this.c.arc(this.centerX,this.centerY,s,r+u,r,!0),this.c.fill(),this.hoveredNode&&(a&8||e.parent===this.hoveredNode)&&(this.c.fillStyle=this.palette.hover,this.c.fill());else{let e=u===Math.PI*2,t=a&4||e?s:n;a&1&&n>0&&this.c.arc(this.centerX,this.centerY,n,r+u,r,!0),this.c.moveTo(this.centerX+t*Math.cos(r),this.centerY+t*Math.sin(r)),this.c.arc(this.centerX,this.centerY,s,r,r+u,!1),e||this.c.lineTo(this.centerX+n*Math.cos(r+u),this.centerY+n*Math.sin(r+u))}let d=e.size,f=a&10,p=0,m=-1/0;for(let n of e.children)m=this.drawNode(n,t+1,s,r+i*p/d,n.size/d*i,f,m),p+=n.size,f|=4;return l}changeHoveredNode(e,t){this.hoveredNode!==e&&(this.hoveredNode=e,this.updateSunburst(t))}hitTestNode(e){let t=this.canvas.getBoundingClientRect(),n=e.clientX-t.left-this.centerX,r=e.clientY-t.top-this.centerY,i=Math.sqrt(n*n+r*r),a=Math.atan2(r,n),o=(e,t,n,r,s)=>{let c=this.computeRadius(t+1);if(c>this.centerY)return;if(i>=n&&i<c){let t=a-r;if(t/=Math.PI*2,t-=Math.floor(t),t*=Math.PI*2,t<s)return e===this.animatedNode?e.parent:e}let l=e.size,u=0;for(let n of e.children){let e=o(n,t+1,c,r+s*u/l,n.size/l*s);if(e)return e;u+=n.size}};return o(this.animatedNode,this.animatedDepth,this.computeRadius(this.animatedDepth),this.animatedStartAngle,this.animatedSweepAngle)}tick(){let e=(G()-this.animationStart)/(this.options.animateDuration??K.animateDuration);e<0||e>1?(e=1,this.animatedNode=this.targetNode,this.targetDepth=0,this.targetStartAngle=Y,this.targetSweepAngle=Math.PI*2):(e<.5?e*=4*e*e:(e=1-e,e*=4*e*e,e=1-e),this.invalidate()),this.animatedDepth=this.sourceDepth+(this.targetDepth-this.sourceDepth)*e,this.animatedStartAngle=this.sourceStartAngle+(this.targetStartAngle-this.sourceStartAngle)*e,this.animatedSweepAngle=this.sourceSweepAngle+(this.targetSweepAngle-this.sourceSweepAngle)*e,this.draw()}handleMouseMove(e){let t=this.hitTestNode(e);this.changeHoveredNode(t),t&&t!==this.animatedNode.parent?(this.events.emit(`hover`,t,e),this.canvas.style.cursor=`pointer`):this.events.emit(`hover`,null,e)}computeRadius(e){return Nt(e)*this.radiusScale}updateSunburst(e=this.options.animate??!0){if(this.previousHoveredNode!==this.hoveredNode&&(this.previousHoveredNode=this.hoveredNode,this.hoveredNode||(this.canvas.style.cursor=`auto`,this.events.emit(`hover`,null)),this.invalidate()),this.targetNode!==this.currentNode){if(this.historyStack.length=0,this.invalidate(),e&&(this.animationStart=G()),jt(this.animatedNode,this.currentNode)){let e={depth_:this.animatedDepth,startAngle_:this.animatedStartAngle,sweepAngle_:this.animatedSweepAngle};J(this.animatedNode,this.currentNode,e),this.animatedDepth=e.depth_,this.animatedStartAngle=e.startAngle_,this.animatedSweepAngle=e.sweepAngle_,this.targetDepth=0,this.targetStartAngle=Y,this.targetSweepAngle=Math.PI*2,this.animatedNode=this.currentNode}else if(jt(this.currentNode,this.animatedNode)){let e={depth_:0,startAngle_:Y,sweepAngle_:Math.PI*2};J(this.currentNode,this.animatedNode,e),this.targetDepth=e.depth_,this.targetStartAngle=e.startAngle_,this.targetSweepAngle=e.sweepAngle_}else this.animationStart=-1/0,this.animatedNode=this.currentNode;this.sourceDepth=this.animatedDepth,this.sourceStartAngle=this.animatedStartAngle,this.sourceSweepAngle=this.animatedSweepAngle,this.targetNode=this.currentNode,this.events.emit(`select`,this.currentNode)}}},X=4,Z=20,Ft=2*X,Q=Z+X;function $(e,t,n,r,i){let a=[],o=(t,n,r,i,a)=>{let o=e[t].size*a,s=e[n].size*a;return Math.max(r*r*o/(i*i),i*i/(r*r*s))};return((t,n,r,i,s)=>{for(;t<e.length;){let c=0;for(let n=t;n<e.length;n++)c+=e[n].size;let l=Math.min(i,s),u=i*s/c,d=t,f=0,p=0;for(;d<e.length;){let n=e[d].size*u,r=o(t,d,l,f+n,u);if(d>t&&p<r)break;f+=n,p=r,d++}let m=Math.round(f/l),h=0;for(let o=t;o<d;o++){let t=e[o],c=t.size*u,d=Math.round(l*h/f),p=Math.round(l*(h+c)/f),[g,_,v,y]=i>=s?[n,r+d,m,p-d]:[n+d,r,p-d,m];a.push({node:t,box:[g,_,v,y],children:v>Ft&&y>Q?$(t.children,g+X,_+Z,v-Ft,y-Q):[]}),h+=c}t=d,i>=s?(n+=m,i-=m):(r+=m,s-=m)}})(0,t,n,r,i),a}var It=class extends Et{hoveredNode=null;currentNode=null;bgOriginX=0;bgOriginY=0;layers={base:null};baseLayoutCache;currentOriginX=0;currentOriginY=0;animationStart=0;animationBlend=1;animationSource=null;animationTarget=null;constructor(e,t={}){super(e,t),this.canvas.addEventListener(`mousemove`,e=>{this.updateHover(e)}),this.canvas.addEventListener(`mouseout`,e=>{this.changeHoveredNode(null),this.events.emit(`hover`,null,e)}),this.el.addEventListener(`click`,e=>{let t=this.hitTestNode(e);if(t){let n=t.node;this.events.emit(`click`,n,e),n.children.length?t===this.layers.current?this.updateHover(e):(this.changeCurrentLayout(t),this.changeHoveredNode(null)):this.updateHover(e)}else this.currentNode&&(this.changeCurrentLayout(null),this.updateHover(e))}),this.el.append(this.canvas),this.resize(),Promise.resolve().then(()=>this.resize()),this.disposables.push(yt(e=>this.updateHover(e))),this.disposables.push(bt(()=>this.resize()))}select(e,t){let n=null;e===this.root&&(e=null),n=e?this.searchFor([this.layers.current,this.layers.base],e):null,this.changeCurrentLayout(n,t)}drawBaseLayout(){!this.width||!this.height||(this.c.clearRect(0,0,this.width,this.height),this.bgOriginX=this.bgOriginY=0,this.baseLayoutCache?this.c.putImageData(this.baseLayoutCache,0,0):(this.drawLayout(this.layers.base,0,[]),this.baseLayoutCache=this.c.getImageData(0,0,this.width*this.ratio,this.height*this.ratio)))}draw(){this.drawBaseLayout(),this.layers.current||this.drawHoverHighlight(this.layers.base);let e=this.layers.current?this.animationSource?this.animationTarget?1:1-this.animationBlend:this.animationBlend:0;if(this.layers.current){let[t,n,r,i]=this.layers.base.box;this.c.globalAlpha=.6*(!this.layers.current||!this.animationSource?1:e),this.c.fillStyle=this.palette.bg,this.c.fillRect(t,n,r,i),this.c.globalAlpha=1}if(this.layers.previous&&this.drawLayout(this.layers.previous,1,[this.layers.current]),this.layers.current){let[t,n,r,i]=this.layers.current.box,a=this.c.getTransform(),o=Math.sqrt(a.a*a.d);this.c.save(),this.c.shadowColor=this.palette.shadow,this.c.shadowBlur=o*(30*e),this.c.shadowOffsetX=o*(2*this.width),this.c.shadowOffsetY=o*(2*this.height+15*e),this.c.fillRect(t-2*this.width,n-2*this.height,r,i),this.c.restore(),this.bgOriginX=this.currentOriginX,this.bgOriginY=this.currentOriginY,this.drawLayout(this.layers.current,0,[]),this.drawHoverHighlight(this.layers.current)}}tick(){let e=this.animationBlend,t=this.currentNode;this.animationBlend=(G()-this.animationStart)/(this.options.animateDuration??K.animateDuration),this.animationBlend<0||this.animationBlend>1?(this.currentNode=this.animationTarget,this.layers.previous=void 0,this.animationBlend=1):(this.animationBlend=1-this.animationBlend,this.animationBlend*=this.animationBlend*this.animationBlend,this.animationBlend=1-this.animationBlend,this.invalidate()),(this.animationBlend!==e||this.currentNode!==t)&&this.updateCurrentLayout(),this.draw()}resize(){this.baseLayoutCache=void 0;let e=this.width,t=this.height;this.width=Math.min(this.el.clientWidth,1600),this.height=Math.max(Math.round(this.width/2),innerHeight-200),(this.width!==e||this.height!==t||!this.layers.base)&&(this.layers.base=$([this.root],0,0,this.width-1,this.height-1)[0],this.updateCurrentLayout()),super.resize()}*iterateNodeToDraw(e,t,n){let r=e.node,[i,a,o,s]=e.box,c=(r===this.hoveredNode?1:0)|(e===this.animationTarget?2:0);if(t===1)for(let e of n){if(!e)continue;let[n,r,c,l]=e.box;if(i>=n&&a>=r&&i+o<=n+c&&a+s<=r+l){t=2;break}}for(let r of e.children)c|=yield*this.iterateNodeToDraw(r,t,n);return t!==2&&(yield e),c}drawHoverHighlight(e){let t=this.iterateNodeToDraw(e,0,[]),n=this.c.globalCompositeOperation;for(;;){let e=t.next();if(e.done){this.c.globalCompositeOperation=n;return}let r=e.value.node;if(this.hoveredNode===r){this.c.globalCompositeOperation=`overlay`;let[t,n,r,i]=e.value.box;this.c.fillStyle=this.palette.hover,this.c.fillRect(t,n,r,i)}}}drawNodeBackground(e,t,n){let r=this.iterateNodeToDraw(e,t,n);for(;;){let e=r.next();if(e.done)return e.value;let[t,n,i,a]=e.value.box;this.c.fillStyle=it(this.getColor(e.value.node)||this.palette.fallback,this.c,this.bgOriginX,this.bgOriginY,1),e.value.children.length?(this.c.fillRect(t,n,i,Z),this.c.fillRect(t,n+a-X,i,X),this.c.fillRect(t,n+Z,X,a-Q),this.c.fillRect(t+i-X,n+Z,X,a-Q)):this.c.fillRect(t,n,i,a)}}drawLayout(e,t,n){this.drawNodeBackground(e,t,n),this.drawNodeForeground(e,t,n)}drawNodeForeground(e,t,n){let r=this.iterateNodeToDraw(e,t,n);for(;;){let e=r.next();if(e.done)return;let t=e.value.node,[n,i,a,o]=e.value.box;if(vt(this.c,this.palette.stroke,n+.5,i+.5,a,o),o>=Z){this.c.fillStyle=this.palette.text;let e=a-Ft,r=i+Math.round(Q/2),[s,c]=this.textOverflowEllipsis(this.getText(t)||``,e),l=n+Math.round((a-c)/2),u=this.getText(t),d=this.getSubtext(t);if(s===u&&t.children.length){let t=d||``;t&&u&&(t=` - ${t}`);let[i,o]=this.textOverflowEllipsis(t,e-c);l=n+Math.round((a-c-o)/2),this.c.globalAlpha=.5,this.c.fillText(i,l+c,r),this.c.globalAlpha=1}if(this.c.fillText(s,l,r),o>Q+16&&!t.children.length){let[t,r]=this.textOverflowEllipsis(d||``,e);this.c.globalAlpha=.5;let s=u?Z:Z/2+X;this.c.fillText(t,n+Math.round((a-r)/2),i+s+Math.round(o-Q)/2),this.c.globalAlpha=1}}}}updateCurrentLayout(){let e=this.options.selectedPaddingRatio??.2;if(this.currentNode){let[t,n,r,i]=this.currentNode.box,a=t+r,o=n+i,s=Math.round(this.width*e/2),c=Math.round(this.height*e/2),l=this.width-s-1,u=this.height-c-1,d=this.animationTarget?this.animationBlend:1-this.animationBlend,f=Math.round(t+(s-t)*d),p=Math.round(n+(c-n)*d),m=Math.round(a+(l-a)*d),h=Math.round(o+(u-o)*d),g=e=>e-Math.floor(e/64-.5)*64;this.layers.current=$([this.currentNode.node],f,p,m-f,h-p)[0],this.currentOriginX=g(-(t+a)/2)*(1-d)+(f+m)/2,this.currentOriginY=g(-(n+o)/2)*(1-d)+(p+h)/2}else this.layers.current=void 0,this.currentOriginX=0,this.currentOriginY=0}hitTestNode(e){let t=this.canvas.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top,i=(e,t)=>{for(let a of e){let[e,o,s,c]=a.box;if(n>=e&&r>=o&&n<e+s&&r<o+c)return i(a.children,!1)||(t?null:a)}return null};return this.layers.current?i([this.layers.current],!1):i([this.layers.base],!0)}updateHover(e){let t=this.hitTestNode(e);this.changeHoveredNode(t&&t.node),this.events.emit(`hover`,t?.node||null,e)}changeHoveredNode(e){this.hoveredNode!==e&&(this.hoveredNode=e,this.canvas.style.cursor=e&&!e.children.length?`pointer`:`auto`,this.invalidate())}searchFor(e,t){for(let n of e){if(!n)continue;let e=n.node===t?n:this.searchFor(n.children,t);if(e)return e}return null}changeCurrentLayout(e,t=this.options.animate){this.animationTarget!==e&&(this.events.emit(`select`,e?.node||null),this.layers.previous=e?this.layers.current:void 0,t&&(this.animationBlend=0,this.animationStart=G(),this.animationSource=this.currentNode),this.animationTarget=e,this.currentNode=e||this.searchFor([this.layers.base],this.currentNode.node),this.updateCurrentLayout(),this.invalidate())}},Lt={flex:`~ gap-1 items-center wrap`},Rt={key:0,"i-ph-arrow-right-bold":``,"text-sm":``,"op-fade":``},zt=[`onClick`],Bt=ne({__name:`NavBreadcrumb`,props:{selected:{},options:{}},emits:[`select`],setup(e,{emit:t}){let n=e,r=t,i=x(()=>{let e=[],t=n.selected;for(;t;)e.unshift(t),t=t.parent;return e});return(e,t)=>(f(),w(`div`,Lt,[(f(!0),w(v,null,ee(i.value,(e,t)=>(f(),w(v,{key:e.id},[t>0?(f(),w(`div`,Rt)):te(``,!0),S(`button`,{hover:`bg-active`,rounded:``,px1:``,onClick:t=>r(`select`,e)},[S(`span`,null,_(e.text||e.id),1)],8,zt)],64))),128))]))}}),Vt=Object.assign(Bt,{__name:`ChartNavBreadcrumb`});function Ht(e){let{data:t,nameKey:n,sizeKey:r,rootText:a,nodeType:o,graphOptions:s,onUpdate:c}=e,l=p(void 0),u=p(void 0),f=i(void 0),m=p(void 0),h,_=x(()=>{if(e.tree)return e.tree.value;let i=g(t),s=new Map,c=0,l={id:`~root`,text:a,size:0,sizeSelf:0,children:[]};if(!i?.length)return{map:s,root:l,maxDepth:c};let u=[];u.unshift(()=>{l.size+=l.children.reduce((e,t)=>e+t.size,0),l.subtext=T(l.size).join(` `),l.children.sort((e,t)=>t.size-e.size||e.id.localeCompare(t.id))});function d(e,t,n,r,i){if(s.has(t))return s.get(t);i>c&&(c=i);let a={id:t,text:n,size:0,sizeSelf:0,children:[],meta:{...e,path:n,type:`folder`},parent:r};return s.set(t,a),r.children.push(a),u.unshift(()=>{let t=a.sizeSelf;a.size+=a.children.reduce((e,t)=>e+t.size,0),a.subtext=T(a.size).join(` `),a.children.length&&t/a.size>.1&&a.children.push({id:`${a.id}-self`,text:``,size:t,sizeSelf:t,subtext:T(t).join(` `),children:[],meta:{...e,path:``,type:o},parent:a}),a.children.sort((e,t)=>t.size-e.size||e.id.localeCompare(t.id))}),a}function f(e){let t=e[n].split(`/`).filter(Boolean),i=l,a=``,c=0;t.forEach((l,u)=>{if(a+=(a?`/`:``)+l,c++,u===t.length-1){let t={id:e[n],text:l,size:e[r],sizeSelf:e[r],subtext:T(e[r]).join(` `),children:[],meta:{...e,path:l,type:o}};i.children.push(t),s.set(e[n],t)}else i=d(e,a,l,i,c)})}return i.forEach(f),u.forEach(e=>e()),{map:s,root:l,maxDepth:c}}),v=x(()=>({animate:oe.value.chartAnimation,palette:{stroke:C.value?`#222`:`#555`,fg:C.value?`#fff`:`#000`,bg:C.value?`#111`:`#fff`},getColor:st(_.value.root,C.value?.8:.9,C.value?1:1.1),getSubtext:e=>e.subtext,...s}));function y(e,t){f.value=e?.meta,e?.children.length||(e=e?.parent),m.value?.select(e,t)}function b(){h?.(),u.value=_.value.root,c?.(),ae(()=>{let e=f.value&&_.value.map.get(f.value[n])||null;e&&y(e,!1)}),h=()=>{m.value?.dispose(),m.value=void 0,f.value=void 0}}return ae(()=>{d(()=>[_.value,v.value],()=>{b()},{deep:!0,immediate:!1}),b()}),ie(()=>{h?.()}),{tree:_,graph:m,chartOptions:v,nodeHover:l,nodeSelected:u,selectedNode:f,selectNode:y,buildGraph:b}}export{It as a,Qe as c,Pt as i,Vt as n,at as o,At as r,dt as s,Ht as t};
@@ -1 +1 @@
1
- import{Tt as e,en as t,i as n,in as r,lt as i,mt as a,ut as o}from"./BUo-D9gX.js";var s={key:0,"font-mono":``},c=a({__name:`Timestamp`,props:{timestamp:{}},setup(a){let c=a;return(l,u)=>a.timestamp?(e(),o(`span`,s,r(t(n)(new Date(c.timestamp))),1)):i(``,!0)}}),l=Object.assign(c,{__name:`DisplayTimestamp`});export{l as t};
1
+ import{Tt as e,en as t,i as n,in as r,lt as i,mt as a,ut as o}from"./DilC1n1-.js";var s={key:0,"font-mono":``},c=a({__name:`Timestamp`,props:{timestamp:{}},setup(a){let c=a;return(l,u)=>a.timestamp?(e(),o(`span`,s,r(t(n)(new Date(c.timestamp))),1)):i(``,!0)}}),l=Object.assign(c,{__name:`DisplayTimestamp`});export{l as t};