@vitejs/devtools-rolldown 0.1.22 → 0.1.24

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 (88) hide show
  1. package/dist/nitro.json +1 -1
  2. package/dist/public/200.html +1 -1
  3. package/dist/public/404.html +1 -1
  4. package/dist/public/_nuxt/-nSv7b_c2.js +1 -0
  5. package/dist/public/_nuxt/{DGzTCPXE.js → B6PLDwAm.js} +2 -2
  6. package/dist/public/_nuxt/BGfhRWSX.js +1 -0
  7. package/dist/public/_nuxt/BNrUSHd9.js +1 -0
  8. package/dist/public/_nuxt/BRoY9F4B.js +1 -0
  9. package/dist/public/_nuxt/Ba06j5HF.js +1 -0
  10. package/dist/public/_nuxt/BdES0TNB.js +1 -0
  11. package/dist/public/_nuxt/BkDUEabV.js +7 -0
  12. package/dist/public/_nuxt/C4TkllWS.js +1 -0
  13. package/dist/public/_nuxt/C9xBafiu.js +1 -0
  14. package/dist/public/_nuxt/CGpzF1Fi.js +1 -0
  15. package/dist/public/_nuxt/CSmrzcuw.js +1 -0
  16. package/dist/public/_nuxt/CZ4Hed_B.js +1 -0
  17. package/dist/public/_nuxt/CiUxnt4q.js +1 -0
  18. package/dist/public/_nuxt/ClI9EQhu.js +1 -0
  19. package/dist/public/_nuxt/CtfgqrR6.js +1 -0
  20. package/dist/public/_nuxt/CwkL5c9p.js +1 -0
  21. package/dist/public/_nuxt/D0ELUVmr.js +1 -0
  22. package/dist/public/_nuxt/D5Xmlx1F.js +1 -0
  23. package/dist/public/_nuxt/D7E3leYJ.js +1 -0
  24. package/dist/public/_nuxt/DJiAfyJ9.js +1 -0
  25. package/dist/public/_nuxt/DS9O9jUU.js +1 -0
  26. package/dist/public/_nuxt/DiwqOTKG.js +1 -0
  27. package/dist/public/_nuxt/DuyiIaXF.js +1 -0
  28. package/dist/public/_nuxt/FMlLtEkh.js +1 -0
  29. package/dist/public/_nuxt/I45WLXVn.js +1 -0
  30. package/dist/public/_nuxt/{DUEAe2mZ.js → LBCmYgDk.js} +1 -1
  31. package/dist/public/_nuxt/MF_ZggB1.js +1 -0
  32. package/dist/public/_nuxt/WhNLRjQY.js +1 -0
  33. package/dist/public/_nuxt/_z5g9W2Q.js +1 -0
  34. package/dist/public/_nuxt/a5P2pi4b.js +1 -0
  35. package/dist/public/_nuxt/builds/latest.json +1 -1
  36. package/dist/public/_nuxt/builds/meta/5a61abc8-46d6-4af6-abd0-8590de61b77e.json +1 -0
  37. package/dist/public/_nuxt/dedBpiqn.js +1 -0
  38. package/dist/public/_nuxt/{entry.CnoZstXg.css → entry.1MQ3GdUL.css} +1 -1
  39. package/dist/public/_nuxt/error-404.DtuC41lL.css +1 -0
  40. package/dist/public/_nuxt/error-500.CcphR6Fr.css +1 -0
  41. package/dist/public/_nuxt/gzfwXX0r.js +1 -0
  42. package/dist/public/_nuxt/rtwgPkwM2.js +1 -0
  43. package/dist/public/index.html +1 -1
  44. package/package.json +7 -7
  45. package/dist/public/_nuxt/5tvbNeKa.js +0 -1
  46. package/dist/public/_nuxt/B2xjE9S9.js +0 -1
  47. package/dist/public/_nuxt/B7_BsZam2.js +0 -1
  48. package/dist/public/_nuxt/BDcpuUbg.js +0 -1
  49. package/dist/public/_nuxt/BM8UMmvc.js +0 -1
  50. package/dist/public/_nuxt/BQdCEVtN.js +0 -1
  51. package/dist/public/_nuxt/BT76Oq15.js +0 -1
  52. package/dist/public/_nuxt/BWhQiJfC2.js +0 -1
  53. package/dist/public/_nuxt/BZZwdm9H2.js +0 -1
  54. package/dist/public/_nuxt/BgSZqMub.js +0 -1
  55. package/dist/public/_nuxt/Bi5REHPk.js +0 -1
  56. package/dist/public/_nuxt/BywRM_M7.js +0 -1
  57. package/dist/public/_nuxt/CCApufKY2.js +0 -1
  58. package/dist/public/_nuxt/COhEYQbe.js +0 -1
  59. package/dist/public/_nuxt/CTNFxt3v.js +0 -1
  60. package/dist/public/_nuxt/CXpJVZ-W.js +0 -1
  61. package/dist/public/_nuxt/CY_j28gw.js +0 -1
  62. package/dist/public/_nuxt/Cf2rORiJ.js +0 -1
  63. package/dist/public/_nuxt/Cm8gy9GJ.js +0 -1
  64. package/dist/public/_nuxt/Crmmgcgo.js +0 -1
  65. package/dist/public/_nuxt/D1flKd96.js +0 -1
  66. package/dist/public/_nuxt/D1igyLjg.js +0 -1
  67. package/dist/public/_nuxt/D3O7sl5Q.js +0 -1
  68. package/dist/public/_nuxt/DAfG6Q5x.js +0 -3
  69. package/dist/public/_nuxt/DGp5TtxR.js +0 -1
  70. package/dist/public/_nuxt/DIY3Np8j.js +0 -1
  71. package/dist/public/_nuxt/DMpb9tLN2.js +0 -1
  72. package/dist/public/_nuxt/DfB5JIVQ.js +0 -4
  73. package/dist/public/_nuxt/JqkF4g2X.js +0 -1
  74. package/dist/public/_nuxt/Tbnz_kEc.js +0 -1
  75. package/dist/public/_nuxt/UXZdwVQx2.js +0 -1
  76. package/dist/public/_nuxt/builds/meta/aadc6ea3-cb4b-43e9-ad21-d65e7418491c.json +0 -1
  77. package/dist/public/_nuxt/error-404.cCAauWc2.css +0 -1
  78. package/dist/public/_nuxt/error-500.BFrkx7fE.css +0 -1
  79. package/dist/public/_nuxt/qKmu99_C.js +0 -1
  80. package/dist/public/_nuxt/qNFXE2Qb.js +0 -1
  81. package/dist/public/_nuxt/qTund2SX.js +0 -2
  82. package/dist/public/_nuxt/s8CxCfpb.js +0 -1
  83. package/dist/public/_nuxt/uoAMmAT1.js +0 -1
  84. package/dist/public/_nuxt/xgeU2imy.js +0 -1
  85. /package/dist/public/_nuxt/{CqfNwh25.js → BkPBhH2x.js} +0 -0
  86. /package/dist/public/_nuxt/{DoJ6DaKu.js → DWG474Ej.js} +0 -0
  87. /package/dist/public/_nuxt/{qIAw3Eg02.js → DYINlKP5.js} +0 -0
  88. /package/dist/public/_nuxt/{BUwCbG2W.js → tBStlNYu.js} +0 -0
@@ -0,0 +1 @@
1
+ import{$t as e,Ct as t,Dt as n,Et as r,Ft as i,Kt as a,Ot as o,Qt as s,St as c,T as l,Tt as u,Ut as d,Vt as f,Zt as p,bt as m,cn as h,gn as g,hn as _,it as v,j as y,m as b,nn as x,r as S,sn as C,t as w,tn as T,vn as E,vt as D,wt as O,xt as k,yn as A}from"#entry";import{t as j}from"./CGpzF1Fi.js";import{r as M}from"./CtfgqrR6.js";import{r as N,t as P}from"./dedBpiqn.js";import{i as F,t as ee}from"./CZ4Hed_B.js";import{n as I}from"./_z5g9W2Q.js";import{n as te,r as ne,t as L}from"./C9xBafiu.js";import{a as re,c as ie,i as ae,n as R,o as z,r as oe,t as se}from"./BNrUSHd9.js";import{t as ce}from"./D0ELUVmr.js";import{n as le,r as ue,t as B}from"./C4TkllWS.js";var V=[`onClick`],de=Object.assign(o({__name:`FlatList`,props:{chunks:{},session:{},link:{type:Boolean,default:!0},basic:{type:Boolean,default:!1}},emits:[`select`],setup(e,{emit:r}){let i=r;return(r,a)=>{let o=F;return f(),c(L,{items:e.chunks,"key-prop":`chunk_id`},{default:T(({item:r})=>[k(`div`,{flex:``,pb2:``,onClick:e=>i(`select`,r)},[n(o,{chunk:r,basic:e.basic,link:e.link,"w-full":``,"font-mono":``,border:`~ rounded base`,px2:``,py1:``,"text-sm":``,hover:`bg-active`,flex:`~ gap-4 items-center`},{"left-after":T(()=>[r.is_initial?(f(),c(M,{key:0,text:`initial`})):t(``,!0)]),_:2},1032,[`chunk`,`basic`,`link`])],8,V)]),_:1},8,[`items`])}}}),{__name:`ChunksFlatList`}),H={op50:``,"font-mono":``,w12:``},U=[`title`],W={flex:`~ gap-1 items-center`},fe=Object.assign(o({__name:`Graph`,props:{session:{},chunks:{},entryId:{default:``}},setup(e){let a=e,o=m(()=>a.chunks),s=v();return I({modules:o,spacing:{width:450,height:55,linkOffset:15,margin:120,gap:150},generateGraph:e=>{let{isFirstCalculateGraph:t,scale:n,spacing:r,tree:s,hierarchy:c,collapsedNodes:l,container:u,modulesMap:d,nodes:f,links:p,nodesMap:m,linksMap:h,width:g,height:v,childToParentMap:y}=e;return()=>{g.value=window.innerWidth,v.value=window.innerHeight;let e=o.value.filter(e=>a.entryId?e.id===a.entryId:e.reason===`entry`),b=new Set,x=c({module:{id:`~root`}},n=>`${n.module?.id}`==`~root`?(e.forEach(e=>{b.add(e),t.value&&y.set(e.id,`~root`)}),e.map(e=>({module:e,expanded:!l.has(e.id),hasChildren:!1}))):l.has(`${n.module?.id}`)?[]:n.module.imports?.map(e=>{let r=d.value.get(`${e.chunk_id}`);if(!(!r||b.has(r)))return t.value&&y.set(r.id,n.module.id),b.add(r),{module:r,expanded:!l.has(r.id),hasChildren:!1}}).filter(e=>e!==void 0));t.value&&=!1,s().nodeSize([_(r.height),_(r.width)+_(r.gap)])(x);let S=x.descendants();for(let e of S)[e.x,e.y]=[e.y-_(r.width),e.x];let C=Math.min(...S.map(e=>e.x)),w=Math.min(...S.map(e=>e.y));if(C<_(r.margin))for(let e of S)e.x+=Math.abs(C)+_(r.margin);if(w<_(r.margin))for(let e of S)e.y+=Math.abs(w)+_(r.margin);f.value=S,m.clear();for(let e of S)m.set(`${e.data.module.id}`,e);let T=x.links().filter(e=>`${e.source.data.module.id}`!=`~root`).map(e=>({...e,id:`${e.source.data.module.id}|${e.target.data.module.id}`})),E=o.value.flatMap(e=>e.imports.filter(t=>!T.some(n=>n.id===`${e.chunk_id}|${t.chunk_id}`)).map(t=>({source:m.get(`${e.chunk_id}`),target:m.get(`${t.chunk_id}`),id:`${e.chunk_id}|${t.chunk_id}`}))),D=[...T,...E];h.clear();for(let e of D)h.set(e.id,e);p.value=D,i(()=>{g.value=u.value.scrollWidth/n.value+_(r.margin),v.value=u.value.scrollHeight/n.value+_(r.margin)})}}}),(i,a)=>{let l=j,u=B;return f(),c(u,{session:e.session,modules:o.value,"expand-controls":!1},{default:T(({node:e})=>[n(l,{class:`flex items-center`,to:{path:_(s).path,query:{chunk:e.data.module.chunk_id}}},{default:T(()=>[k(`span`,H,`#`+A(e.data.module.id),1),k(`div`,{flex:`~ gap-2 items-center`,title:`Chunk #${e.data.module.id}`},[k(`div`,null,A(e.data.module.name||`[unnamed]`),1),n(M,{text:e.data.module.reason},null,8,[`text`]),e.data.module.is_initial?(f(),c(M,{key:0,text:`initial`})):t(``,!0)],8,U),a[1]||=k(`div`,{"flex-auto":``},null,-1),k(`div`,W,[a[0]||=k(`div`,{"i-ph-package-duotone":``},null,-1),r(` `+A(e.data.module.modules.length),1)])]),_:2},1032,[`to`])]),_:1},8,[`session`,`modules`])}}}),{__name:`ChunksGraph`}),G={grid:`~ cols-[max-content_1fr] gap-2`,p4:``},K={flex:`~ col gap-4`},q={key:0,grid:`~ cols-[250px_1fr] gap-1`},J=[`onClick`],Y={key:0,"text-primary":``},X={key:1},Z=[`onClick`],Q=[`title`],pe=Object.assign(o({__name:`Sunburst`,props:{graph:{},selected:{}},emits:[`select`],setup(i,{emit:o}){let s=i,c=o,l=p(`el`);return e(()=>l.value?.append(s.graph.el)),(e,o)=>{let s=R,u=N,p=a(`tooltip`);return f(),O(`div`,G,[k(`div`,{ref_key:`el`,ref:l,"w-500px":``},null,512),k(`div`,K,[n(s,{border:`b base`,py2:``,selected:i.selected,options:i.graph.options,onSelect:o[0]||=e=>c(`select`,e)},null,8,[`selected`,`options`]),i.selected?(f(),O(`div`,q,[(f(!0),O(D,null,d(i.selected.children,e=>(f(),O(D,{key:e.id},[k(`button`,{"ws-nowrap":``,"text-nowrap":``,"text-left":``,"overflow-hidden":``,"text-ellipsis":``,"text-sm":``,hover:`bg-active`,rounded:``,px2:``,onClick:t=>c(`select`,e)},[e.meta&&e.meta===i.selected?.meta?(f(),O(`span`,Y,`(self)`)):(f(),O(`span`,X,A(e.meta?.name||e.id),1))],8,J),k(`button`,{relative:``,flex:`~ gap-1 items-center`,hover:`bg-active`,rounded:``,onClick:t=>c(`select`,e)},[k(`div`,{"h-5":``,rounded:``,shadow:``,border:`~ base`,style:E({background:_(z)(i.graph.options.getColor?.(e)||`#000`),width:`${e.size/i.selected.size*100}%`})},null,4),n(u,{"text-xs":``,bytes:e.size,total:i.selected.size,"percent-ratio":3},null,8,[`bytes`,`total`]),e.children.length>0?x((f(),O(`div`,{key:0,title:`${e.children.length} modules`,"text-xs":``,"op-fade":``},[r(` (`+A(e.children.length)+`) `,1)],8,Q)),[[p,`${e.children.length} modules`]]):t(``,!0)],8,Z)],64))),128))])):t(``,!0)])])}}}),{__name:`ChunksSunburst`}),me=Object.assign(o({__name:`Flamegraph`,props:{graph:{}},setup(t){let n=t,r=p(`el`);return e(()=>r.value?.append(n.graph.el)),(e,t)=>(f(),O(`div`,{ref_key:`el`,ref:r},null,512))}}),{__name:`ChunksFlamegraph`}),he={sticky:``,"left-4":``,"right-4":``,"top-4":``,"z-panel-nav":``,"p-4":``},ge={key:0,h10:``,mr2:``,flex:`~ items-center`},_e={flex:`~ wrap gap-2 items-center`,p2:``,border:`t base`},ve=[`onClick`],ye={key:0,class:`px5 pt-4`,flex:`~ col gap-4`},be={key:1,class:`px5 pt-4`,flex:`~ col gap-4`},xe={key:3,flex:`~ col gap-2`},Se={key:4,flex:`~ col gap-2`,"pt-4":``},Ce={key:5,flex:`~ col gap-2`,"pt-4":``},we={key:0,border:`~ base rounded-lg`,"bg-base":``,p2:``,flex:`~ col gap-2`,"min-w-50":``,"shadow-lg":``},Te={flex:`~ gap-2 items-center`},Ee={truncate:``},De={flex:`~ gap-2 items-center`},Oe={key:0,flex:`~ gap-2 items-center`},ke={"text-xs":``},Ae={key:1,flex:`~ gap-2 items-center`},$=o({__name:`chunks`,props:{session:{}},setup(e){let i=e,a=C(l()),o=[{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:`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`}],p=h({search:``}),v=w(),{state:x,isLoading:E}=b(async()=>await v.value.call(`vite:rolldown:get-chunks-graph`,{session:i.session.id}),null),j=m(()=>{let e=new Map;return x.value?.forEach(t=>{e.set(`${t.chunk_id}`,t)}),e}),F=m(()=>x.value?.map(e=>({...e,id:`${e.chunk_id}`}))??[]),I=y(()=>F.value,()=>new ne(F.value,{includeScore:!0,keys:[`name`],ignoreLocation:!0,threshold:.4})),L=m(()=>p.value.search?I.value.search(p.value.search).map(e=>e.item):F.value),{pathSelectorVisible:z,pathNodes:B,selectPathNodes:V,togglePathSelector:H,normalizedGraph:U}=ue({onToggle:e=>{p.value.search=e?!1:``},dataMap:m(()=>j.value),list:m(()=>L.value),importIdKey:`chunk_id`});function W(e){P.value.chunkViewType=e}let G=m(()=>{let e=new Map;for(let t of i.session.modulesList)e.set(t.id,t);return e});function K(e){return e.asset?.size?e.asset.size:e.modules.reduce((e,t)=>{let n=G.value.get(t);return!n||!n.buildMetrics?.transforms?.length?e:e+n.buildMetrics.transforms.at(-1).transformed_code_size},0)}let{tree:q,chartOptions:J,graph:Y,nodeHover:X,nodeSelected:Z,selectedNode:Q,selectNode:$,buildGraph:je}=se({data:m(()=>L.value.map(e=>({...e,filename:e.name||`chunk-${e.chunk_id}`,size:K(e)}))),nameKey:`filename`,sizeKey:`size`,rootText:`Chunks`,nodeType:`chunk`,graphOptions:{onClick(e){e&&(X.value=e)},onHover(e){e&&(X.value=e),e===null&&(X.value=void 0)},onLeave(){X.value=void 0},onSelect(e){Z.value=e||q.value.root,Q.value=e?.meta}},onUpdate(){switch(P.value.chunkViewType){case`sunburst`:Y.value=new ae(q.value.root,J.value);break;case`treemap`:Y.value=new re(q.value.root,{...J.value,selectedPaddingRatio:0});break;case`flamegraph`:Y.value=new oe(q.value.root,J.value);break}}});return s(()=>P.value.chunkViewType,()=>{[`treemap`,`sunburst`,`flamegraph`].includes(P.value.chunkViewType)&&je()}),(i,s)=>{let l=S,m=de,h=le,v=te,y=ee,b=fe,x=R,C=pe,w=me,F=N,I=ie;return _(E)?(f(),c(l,{key:0})):(f(),O(`div`,{key:1,relative:``,class:g({"max-h-screen of-hidden":_(P).chunkViewType===`graph`})},[k(`div`,he,[n(v,{modelValue:p.value,"onUpdate:modelValue":s[2]||=e=>p.value=e,rules:[]},u({"search-end":T(()=>[_(P).chunkViewType===`graph`?(f(),O(`div`,ge,[k(`button`,{"w-8":``,"h-8":``,"rounded-full":``,flex:``,"items-center":``,"justify-center":``,hover:`bg-active op100`,op50:``,title:`Graph Path Selector`,onClick:s[1]||=e=>_(H)(!0)},[...s[5]||=[k(`i`,{"i-ri:route-line":``,flex:``},null,-1)]])])):t(``,!0)]),default:T(()=>[k(`div`,_e,[s[6]||=k(`span`,{op50:``,pl2:``,"text-sm":``},`View as`,-1),(f(),O(D,null,d(o,e=>k(`button`,{key:e.value,"btn-action":``,class:g(_(P).chunkViewType===e.value?`bg-active`:`grayscale op50`),onClick:t=>W(e.value)},[k(`div`,{class:g(e.icon)},null,2),r(` `+A(e.label),1)],10,ve)),64))])]),_:2},[_(z)?{name:`search`,fn:T(()=>[n(h,{session:e.session,data:L.value,"import-id-key":`chunk_id`,"search-keys":[`name`],onSelect:_(V),onClose:s[0]||=e=>_(H)(!1)},{list:T(({select:t,data:r})=>[n(m,{session:e.session,chunks:r,link:!1,basic:!0,onSelect:t},null,8,[`session`,`chunks`,`onSelect`])]),item:T(({id:e})=>[r(A(j.value.get(e)?.name||`[unnamed]`),1)]),_:1},8,[`session`,`data`,`onSelect`])]),key:`0`}:void 0]),1032,[`modelValue`])]),_(P).chunkViewType===`list`?(f(),O(`div`,ye,[n(m,{session:e.session,chunks:L.value},null,8,[`session`,`chunks`])])):t(``,!0),_(P).chunkViewType===`detailed-list`?(f(),O(`div`,be,[(f(!0),O(D,null,d(L.value,t=>(f(),c(y,{key:t.id,border:`~ base rounded-lg`,p3:``,chunk:t,chunks:L.value,session:e.session},null,8,[`chunk`,`chunks`,`session`]))),128))])):_(P).chunkViewType===`graph`?(f(),c(b,{key:2,class:`pt32`,session:e.session,chunks:_(U),"entry-id":_(B).start},null,8,[`session`,`chunks`,`entry-id`])):_(P).chunkViewType===`treemap`?(f(),O(`div`,xe,[_(Y)?(f(),c(ce,{key:0,graph:_(Y),selected:_(Z),onSelect:s[3]||=e=>_($)(e)},{default:T(({selected:e,options:t,onSelect:r})=>[n(x,{border:`b base`,py2:``,"min-h-10":``,selected:e,options:t,onSelect:r},null,8,[`selected`,`options`,`onSelect`])]),_:1},8,[`graph`,`selected`])):t(``,!0)])):_(P).chunkViewType===`sunburst`?(f(),O(`div`,Se,[_(Y)?(f(),c(C,{key:0,graph:_(Y),selected:_(Z),onSelect:s[4]||=e=>_($)(e)},null,8,[`graph`,`selected`])):t(``,!0)])):_(P).chunkViewType===`flamegraph`?(f(),O(`div`,Ce,[_(Y)?(f(),c(w,{key:0,graph:_(Y)},null,8,[`graph`])):t(``,!0)])):t(``,!0),n(I,{"hover-x":a.x,"hover-y":a.y},{default:T(()=>[_(X)?.meta?(f(),O(`div`,we,[k(`div`,Te,[s[7]||=k(`i`,{"i-ph-shapes-duotone":``,"flex-none":``},null,-1),k(`span`,Ee,A(_(X).meta.name||`[unnamed]`),1)]),k(`div`,De,[s[8]||=k(`span`,{op50:``,"text-xs":``},`Size:`,-1),n(F,{bytes:_(X).meta.size,"text-xs":``},null,8,[`bytes`])]),_(X).meta.modules?.length?(f(),O(`div`,Oe,[s[9]||=k(`span`,{op50:``,"text-xs":``},`Modules:`,-1),k(`span`,ke,A(_(X).meta.modules?.length),1)])):t(``,!0),_(X).meta.is_initial?(f(),O(`div`,Ae,[n(M,{text:`initial`})])):t(``,!0)])):t(``,!0)]),_:1},8,[`hover-x`,`hover-y`])],2))}}});export{$ as default};
@@ -0,0 +1 @@
1
+ import{B as e,Bt as t,Ct as n,Ft as r,G as i,H as a,J as o,K as s,Ot as c,Qt as l,St as u,U as d,Ut as f,V as p,Vt as m,W as h,Wt as g,Zt as _,a as v,bt as y,cn as ee,fn as te,hn as ne,q as b,un as re,vn as ie,vt as ae,wt as x,xt as S,yn as oe,yt as se}from"#entry";import{t as C}from"./BkPBhH2x.js";import{t as ce}from"./dedBpiqn.js";function w(){return typeof window<`u`}function T(e){return le(e)?(e.nodeName||``).toLowerCase():`#document`}function E(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function D(e){return((le(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function le(e){return w()?e instanceof Node||e instanceof E(e).Node:!1}function O(e){return w()?e instanceof Element||e instanceof E(e).Element:!1}function k(e){return w()?e instanceof HTMLElement||e instanceof E(e).HTMLElement:!1}function ue(e){return!w()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof E(e).ShadowRoot}function A(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=F(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function de(e){return/^(table|td|th)$/.test(T(e))}function j(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var fe=/transform|translate|scale|rotate|perspective|filter/,pe=/paint|layout|strict|content/,M=e=>!!e&&e!==`none`,me;function N(e){let t=O(e)?F(e):e;return M(t.transform)||M(t.translate)||M(t.scale)||M(t.rotate)||M(t.perspective)||!ge()&&(M(t.backdropFilter)||M(t.filter))||fe.test(t.willChange||``)||pe.test(t.contain||``)}function he(e){let t=L(e);for(;k(t)&&!P(t);){if(N(t))return t;if(j(t))return null;t=L(t)}return null}function ge(){return me??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),me}function P(e){return/^(html|body|#document)$/.test(T(e))}function F(e){return E(e).getComputedStyle(e)}function I(e){return O(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function L(e){if(T(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ue(e)&&e.host||D(e);return ue(t)?t.host:t}function _e(e){let t=L(e);return P(t)?e.ownerDocument?e.ownerDocument.body:e.body:k(t)&&A(t)?t:_e(t)}function ve(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=_e(e),i=r===e.ownerDocument?.body,a=E(r);if(i){let e=ye(a);return t.concat(a,a.visualViewport||[],A(r)?r:[],e&&n?ve(e):[])}else return t.concat(r,ve(r,[],n))}function ye(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function be(e){let t=F(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=k(e),a=i?e.offsetWidth:n,s=i?e.offsetHeight:r,c=o(n)!==a||o(r)!==s;return c&&(n=a,r=s),{width:n,height:r,$:c}}function xe(e){return O(e)?e:e.contextElement}function R(e){let t=xe(e);if(!k(t))return h(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=be(t),s=(a?o(n.width):n.width)/r,c=(a?o(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}var Se=h(0);function Ce(e){let t=E(e);return!ge()||!t.visualViewport?Se:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function we(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==E(e)?!1:t}function z(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=xe(e),o=h(1);t&&(r?O(r)&&(o=R(r)):o=R(e));let s=we(a,n,r)?Ce(a):h(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=E(a),t=r&&O(r)?E(r):r,n=e,i=ye(n);for(;i&&r&&t!==n;){let e=R(i),t=i.getBoundingClientRect(),r=F(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=E(i),i=ye(n)}}return b({width:u,height:d,x:c,y:l})}function B(e,t){let n=I(e).scrollLeft;return t?t.left+n:z(D(e)).left+n}function Te(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-B(e,n),y:n.top+t.scrollTop}}function Ee(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=D(r),s=t?j(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=h(1),u=h(0),d=k(r);if((d||!d&&!a)&&((T(r)!==`body`||A(o))&&(c=I(r)),d)){let e=z(r);l=R(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Te(o,c):h(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 De(e){return Array.from(e.getClientRects())}function Oe(e){let t=D(e),n=I(e),r=e.ownerDocument.body,a=i(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=i(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),s=-n.scrollLeft+B(e),c=-n.scrollTop;return F(r).direction===`rtl`&&(s+=i(t.clientWidth,r.clientWidth)-a),{width:a,height:o,x:s,y:c}}var ke=25;function Ae(e,t){let n=E(e),r=D(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=ge();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=B(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<=ke&&(a-=o)}else l<=ke&&(a+=l);return{width:a,height:o,x:s,y:c}}function je(e,t){let n=z(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=k(e)?R(e):h(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Me(e,t,n){let r;if(t===`viewport`)r=Ae(e,n);else if(t===`document`)r=Oe(D(e));else if(O(t))r=je(t,n);else{let n=Ce(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return b(r)}function Ne(e,t){let n=L(e);return n===t||!O(n)||P(n)?!1:F(n).position===`fixed`||Ne(n,t)}function Pe(e,t){let n=t.get(e);if(n)return n;let r=ve(e,[],!1).filter(e=>O(e)&&T(e)!==`body`),i=null,a=F(e).position===`fixed`,o=a?L(e):e;for(;O(o)&&!P(o);){let t=F(o),n=N(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||A(o)&&!n&&Ne(e,o))?r=r.filter(e=>e!==o):i=t,o=L(o)}return t.set(e,r),r}function Fe(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e,o=[...n===`clippingAncestors`?j(t)?[]:Pe(t,this._c):[].concat(n),r],c=Me(t,o[0],a),l=c.top,u=c.right,d=c.bottom,f=c.left;for(let e=1;e<o.length;e++){let n=Me(t,o[e],a);l=i(n.top,l),u=s(n.right,u),d=s(n.bottom,d),f=i(n.left,f)}return{width:u-f,height:d-l,x:f,y:l}}function Ie(e){let{width:t,height:n}=be(e);return{width:t,height:n}}function Le(e,t,n){let r=k(t),i=D(t),a=n===`fixed`,o=z(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=h(0);function l(){c.x=B(i)}if(r||!r&&!a)if((T(t)!==`body`||A(i))&&(s=I(t)),r){let e=z(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?Te(i,s):h(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 V(e){return F(e).position===`static`}function Re(e,t){if(!k(e)||F(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return D(e)===n&&(n=n.ownerDocument.body),n}function ze(e,t){let n=E(e);if(j(e))return n;if(!k(e)){let t=L(e);for(;t&&!P(t);){if(O(t)&&!V(t))return t;t=L(t)}return n}let r=Re(e,t);for(;r&&de(r)&&V(r);)r=Re(r,t);return r&&P(r)&&V(r)&&!N(r)?n:r||he(e)||n}var Be=async function(e){let t=this.getOffsetParent||ze,n=this.getDimensions,r=await n(e.floating);return{reference:Le(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ve(e){return F(e).direction===`rtl`}var He={convertOffsetParentRelativeRectToViewportRelativeRect:Ee,getDocumentElement:D,getClippingRect:Fe,getOffsetParent:ze,getElementRects:Be,getClientRects:De,getDimensions:Ie,getScale:R,isElement:O,isRTL:Ve},Ue=a,We=d,Ge=p,Ke=(t,n,r)=>{let i=new Map,a={platform:He,...r},o={...a.platform,_c:i};return e(t,n,{...a,platform:o})},qe=Object.assign(c({__name:`GraphHoverView`,props:{hoverX:{},hoverY:{}},setup(e){let{hoverX:t,hoverY:n}=te(e),r=_(`hoverElement`),i=ee(0),a=ee(0);return l([t,n],([e,t])=>{Ke({getBoundingClientRect(){return{width:0,height:0,x:e,y:t,left:e,right:e,top:t,bottom:t}}},r.value,{placement:`right-start`,middleware:[Ge(),We(),Ue({mainAxis:8,alignmentAxis:8})]}).then(({x:e,y:t})=>{i.value=e,a.value=t})}),(e,t)=>(m(),u(se,{to:`body`},[S(`div`,{ref_key:`hoverElement`,ref:r,fixed:``,"z-panel-content":``,"pointer-events-none":``,style:ie({left:`${i.value}px`,top:`${a.value}px`})},[g(e.$slots,`default`)],4)]))}}),{__name:`DisplayGraphHoverView`});function Je(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 Ye,Xe,Ze,H,U,W=1,G;function K(e,t,n,r,i){if(!Array.isArray(e))return e;let a=window.devicePixelRatio||1;if(Ye!==t||Xe!==a||Ze!==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;Ye=t,Xe=a,Ze=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()}G=t.createPattern(H,`repeat`),W/=n}return n/=64*W*a,n-=Math.floor(n),n*=64*W*a,G.setTransform(new DOMMatrix([W,0,0,W,n,r])),G}function Qe(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 $e(e){return t=>t.id&&e[t.id]||t.color}function et(e,t=1,n=1){let r={};return tt(r,e,0,Math.PI*2,t,n),$e(r)}function tt(e,t,n,r,i=1,a=1){let o=t.size;e[t.id]=Je(n+r/2,i,a);for(let s of t.children){let t=s.size/o*r;tt(e,s,n,t,i,a),n+=t}}var nt=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`;function rt(e=16,t=nt){let n=``,r=e,i=t.length;for(;r--;)n+=t[Math.random()*i|0];return n}function it(e,t,n=(e,t)=>t.size-e.size){if(e.__nanovis)return e;let r={...e};return r.id||=rt(),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=>it(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 at(e){return e.children.length===0?1:Math.max(...e.children.map(e=>at(e)))+1}var ot=/\bFirefox\//.test(navigator.userAgent),st;function ct(e){return st?st.format(e):`${e}`}function q(){return(window.performance||Date).now()}function lt(e){let t=e.toFixed(1).split(`.`,2);return`${ct(+t[0])}.${t[1]}`}function ut(e){return e===1?`1 byte`:e<1024?`${ct(e)} bytes`:e<1024*1024?`${lt(e/1024)} kb`:e<1024*1024*1024?`${lt(e/(1024*1024))} mb`:`${lt(e/(1024*1024*1024))} gb`}function dt(e,t,n,r,i,a){if(ot){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 ft(e){return window.addEventListener(`wheel`,e,{passive:!1}),()=>window.removeEventListener(`wheel`,e)}function pt(e){return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)}try{st=new Intl.NumberFormat}catch{}var mt=()=>({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)}}}),J={getText:e=>e.text,getSubtext:e=>e.subtext,animate:!0,animateDuration:350},ht={fallback:`#CCC`,stroke:`#0008`,text:`#222`,hover:`#fff5`,shadow:`#0008`,fg:`#fff`,bg:`#222`},gt=46,_t=`14px sans-serif`,vt=`bold ${_t}`,yt=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={...J,...t};let{getColor:n=et(e),getText:r=()=>void 0,getSubtext:i=()=>void 0}=this.options;this.palette={...ht,...t.palette},this.el=document.createElement(`div`),this.canvas=document.createElement(`canvas`),this.c=this.canvas.getContext(`2d`),this.root=e,this.maxDepth=at(e),this.disposables=[],this.events=mt(),this.getColor=n,this.getText=r,this.getSubtext=i,this.setFont(_t),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(gt)}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]}},Y=24,bt=5,xt=.01,St=1e3,Ct=class extends yt{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(ft(e=>{let t=e.deltaX,n=e.deltaY,r=q(),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(pt(()=>this.resize())),this.mainEl.append(this.canvas),this.el.append(this.mainEl)}tick(){let e=(q()-this.animationStart)/(this.options.animateDuration??J.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??J.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*xt),r=Math.min(this.totalBytes,r+e.size*xt),this.setViewport(n,r,t)}}select(e,t=this.options.animate??J.animate){this.changeSelectedNode(e,t)}resize(){this.width=this.el.clientWidth,this.height=this.maxDepth*Y+1,this.zoomedOutMin=this.width-St>>1,this.zoomedOutWidth=this.zoomedOutMin+St,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)+bt,d=t+Y/2,f=this.getText(e)||``,p=this.getSubtext(e)||``,m,h=0,g=s+o-u,_=K(this.getColor(e)||this.palette.fallback,this.c,this.zoomedOutMin-this.viewportMin*a,Y,a*this.stripeScaleAdjust),v=this.palette.text,y=-1/0;i&1?(v=this.palette.fg,this.setFont(vt)):(this.c.fillStyle=_,this.c.fillRect(o,t,l,Y),(i&2||this.hoveredNode&&e.id===this.hoveredNode.id)&&(this.c.fillStyle=this.palette.hover,this.c.fillRect(o,t,l,Y),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(_t),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+Y,n,y,i&-2),n+=r.size;return i&1||dt(this.c,this.palette.stroke,o+.5,t+.5,l,Y),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+Y&&e.id)return e;if(r>=t+Y)for(let r of e.children){let e=a(r,t+Y,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=q():this.animationStart=0,this.invalidate()}updateHover(e){let t=this.hitTestNode(e);this.changeHoveredNode(t),this.events.emit(`hover`,t,e)}};function wt(e,t){for(;t;){if(t===e)return!0;t=t.parent}return!1}function Tt(e,t,n){if(e===t)return;let r=t.parent,i=r.size||1,a=0;Tt(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 Et={};function Dt(e){return Et[e]||(Et[e]=400*Math.log(1+Math.log(1+e/8))),Et[e]}var X=-Math.PI/2,Ot=class extends yt{currentNode;hoveredNode;centerX=0;centerY=0;animationStart=0;radiusScale=1;sourceDepth=0;sourceStartAngle=X;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(pt(()=>this.resize())),this.disposables.push(ft(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(Dt(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(vt),this.c.textAlign=`center`,this.c.fillText(this.getSubtext(this.targetNode)??ut(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=K(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=(q()-this.animationStart)/(this.options.animateDuration??J.animateDuration);e<0||e>1?(e=1,this.animatedNode=this.targetNode,this.targetDepth=0,this.targetStartAngle=X,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 Dt(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=q()),wt(this.animatedNode,this.currentNode)){let e={depth_:this.animatedDepth,startAngle_:this.animatedStartAngle,sweepAngle_:this.animatedSweepAngle};Tt(this.animatedNode,this.currentNode,e),this.animatedDepth=e.depth_,this.animatedStartAngle=e.startAngle_,this.animatedSweepAngle=e.sweepAngle_,this.targetDepth=0,this.targetStartAngle=X,this.targetSweepAngle=Math.PI*2,this.animatedNode=this.currentNode}else if(wt(this.currentNode,this.animatedNode)){let e={depth_:0,startAngle_:X,sweepAngle_:Math.PI*2};Tt(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)}}},Z=4,Q=20,kt=2*Z,$=Q+Z;function At(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>kt&&y>$?At(t.children,g+Z,_+Q,v-kt,y-$):[]}),h+=c}t=d,i>=s?(n+=m,i-=m):(r+=m,s-=m)}})(0,t,n,r,i),a}var jt=class extends yt{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(ft(e=>this.updateHover(e))),this.disposables.push(pt(()=>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=30*e*o,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=(q()-this.animationStart)/(this.options.animateDuration??J.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=At([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|(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=K(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,Q),this.c.fillRect(t,n+a-Z,i,Z),this.c.fillRect(t,n+Q,Z,a-$),this.c.fillRect(t+i-Z,n+Q,Z,a-$)):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(dt(this.c,this.palette.stroke,n+.5,i+.5,a,o),o>=Q){this.c.fillStyle=this.palette.text;let e=a-kt,r=i+Math.round($/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>$+16&&!t.children.length){let[t,r]=this.textOverflowEllipsis(d||``,e);this.c.globalAlpha=.5;let s=u?Q:Q/2+Z;this.c.fillText(t,n+Math.round((a-r)/2),i+s+Math.round(o-$)/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=At([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=q(),this.animationSource=this.currentNode),this.animationTarget=e,this.currentNode=e||this.searchFor([this.layers.base],this.currentNode.node),this.updateCurrentLayout(),this.invalidate())}},Mt={flex:`~ gap-1 items-center wrap`},Nt={key:0,"i-ph-arrow-right-bold":``,"text-sm":``,"op-fade":``},Pt=[`onClick`],Ft=Object.assign(c({__name:`NavBreadcrumb`,props:{selected:{},options:{}},emits:[`select`],setup(e,{emit:t}){let r=e,i=t,a=y(()=>{let e=[],t=r.selected;for(;t;)e.unshift(t),t=t.parent;return e});return(e,t)=>(m(),x(`div`,Mt,[(m(!0),x(ae,null,f(a.value,(e,t)=>(m(),x(ae,{key:e.id},[t>0?(m(),x(`div`,Nt)):n(``,!0),S(`button`,{hover:`bg-active`,rounded:``,px1:``,onClick:t=>i(`select`,e)},[S(`span`,null,oe(e.text||e.id),1)],8,Pt)],64))),128))]))}}),{__name:`ChartNavBreadcrumb`});function It(e){let{data:n,nameKey:i,sizeKey:a,rootText:o,nodeType:s,graphOptions:c,onUpdate:u}=e,d=re(void 0),f=re(void 0),p=ee(void 0),m=re(void 0),h,g=y(()=>{if(e.tree)return e.tree.value;let t=ne(n),r=new Map,c=0,l={id:`~root`,text:o,size:0,sizeSelf:0,children:[]};if(!t?.length)return{map:r,root:l,maxDepth:c};let u=[];u.unshift(()=>{l.size+=l.children.reduce((e,t)=>e+t.size,0),l.subtext=C(l.size).join(` `),l.children.sort((e,t)=>t.size-e.size||e.id.localeCompare(t.id))});function d(e,t,n,i,a){if(r.has(t))return r.get(t);a>c&&(c=a);let o={id:t,text:n,size:0,sizeSelf:0,children:[],meta:{...e,path:n,type:`folder`},parent:i};return r.set(t,o),i.children.push(o),u.unshift(()=>{let t=o.sizeSelf;o.size+=o.children.reduce((e,t)=>e+t.size,0),o.subtext=C(o.size).join(` `),o.children.length&&t/o.size>.1&&o.children.push({id:`${o.id}-self`,text:``,size:t,sizeSelf:t,subtext:C(t).join(` `),children:[],meta:{...e,path:``,type:s},parent:o}),o.children.sort((e,t)=>t.size-e.size||e.id.localeCompare(t.id))}),o}function f(e){let t=e[i].split(`/`).filter(Boolean),n=l,o=``,c=0;t.forEach((l,u)=>{if(o+=(o?`/`:``)+l,c++,u===t.length-1){let t={id:e[i],text:l,size:e[a],sizeSelf:e[a],subtext:C(e[a]).join(` `),children:[],meta:{...e,path:l,type:s}};n.children.push(t),r.set(e[i],t)}else n=d(e,o,l,n,c)})}return t.forEach(f),u.forEach(e=>e()),{map:r,root:l,maxDepth:c}}),_=y(()=>({animate:ce.value.chartAnimation,palette:{stroke:v.value?`#222`:`#555`,fg:v.value?`#fff`:`#000`,bg:v.value?`#111`:`#fff`},getColor:et(g.value.root,v.value?.8:.9,v.value?1:1.1),getSubtext:e=>e.subtext,...c}));function te(e,t){p.value=e?.meta,e?.children.length||(e=e?.parent),m.value?.select(e,t)}function b(){h?.(),f.value=g.value.root,u?.(),r(()=>{let e=p.value&&g.value.map.get(p.value[i])||null;e&&te(e,!1)}),h=()=>{m.value?.dispose(),m.value=void 0,p.value=void 0}}return r(()=>{l(()=>[g.value,_.value],()=>{b()},{deep:!0,immediate:!1}),b()}),t(()=>{h?.()}),{tree:g,graph:m,chartOptions:_,nodeHover:d,nodeSelected:f,selectedNode:p,selectNode:te,buildGraph:b}}export{jt as a,qe as c,Ot as i,Ft as n,Qe as o,Ct as r,it as s,It as t};
@@ -0,0 +1 @@
1
+ import{Ot as e,St as t,Vt as n,Wt as r,bt as i,gn as a,tn as o,wt as s,xt as c,yn as l}from"#entry";function u(e,t){let n=[];return n=e==null?[``,`-`]:e<1?[`<1`,`ms`]:e<1e3?[e.toFixed(0),`ms`]:e<1e3*60?[(e/1e3).toFixed(1),`s`]:[(e/1e3/60).toFixed(1),`min`],t?n.join(` `):n}var d={"ml-0.4":``,"text-xs":``,op75:``},f=e({__name:`DisplayNumberWithUnit`,props:{number:{},unit:{}},setup(e){return(t,i)=>(n(),s(`div`,null,[r(t.$slots,`default`),c(`span`,null,l(e.number),1),c(`span`,d,l(e.unit),1)]))}}),p=e({__name:`DisplayDuration`,props:{duration:{},factor:{default:1},unit:{default:`ms`},color:{type:Boolean,default:!0}},setup(e){let s=e,c=i(()=>{if(s.duration!=null)return s.unit===`ns`?s.duration/1e3:s.duration});function l(e){return!s.color||e==null?``:(e*=s.factor,e<1?`op50`:e>1e4?`color-scale-critical`:e>1e3?`color-scale-high`:e>500?`color-scale-medium`:e>200?`color-scale-low`:`color-scale-neutral`)}let d=i(()=>u(c.value));return(e,i)=>(n(),t(f,{class:a(l(c.value)),number:d.value[0],unit:d.value[1]},{default:o(()=>[r(e.$slots,`default`)]),_:3},8,[`class`,`number`,`unit`]))}});export{u as n,p as t};
@@ -0,0 +1 @@
1
+ import{Ot as e,Vt as t,bt as n,gn as r,jt as i,wt as a}from"#entry";import{s as o,t as s}from"./WhNLRjQY.js";var c=[`title`],l=Object.assign(e({__name:`FileIcon`,props:{filename:{}},setup(e){let i=e,s=n(()=>o(i.filename));return(e,n)=>(t(),a(`div`,{"flex-none":``,"icon-catppuccin":``,title:s.value.description||s.value.name,class:r([s.value.icon])},null,10,c))}}),{__name:`DisplayFileIcon`}),u=e({name:`HighlightedPath`,props:{path:{type:String,required:!0},minimal:{type:Boolean,default:!1}},setup(e){return()=>{let t=e.path.split(/([?/&:=])/g),n=`path`,r=t.map(()=>[]),a=t.map(()=>[]),o=t.map(e=>i(`span`,{class:``},e)),c=new Set;return t.forEach((i,l)=>{if(i===`?`&&(n=`query`),n===`path`){if(/^\.+$/.test(i)||i===`/`?r[l]?.push(`op50`):(i===`node_modules`||i===`dist`||i===`lib`||/^\.\w/.test(i))&&r[l]?.push(`op60`),i===`node_modules`&&e.minimal)for(let e=0;e<l+2;e++)c.add(e);if(i===`.pnpm`&&(o[l]&&(o[l].children=`~`,r[l]?.push(`op25!`),r[l-1]?.push(`op25!`)),c.add(l+1),c.add(l+2),r[l+3]?.push(`op25!`),o[l+4]?.children===`node_modules`&&(c.add(l+3),c.add(l+4),r[l+5]?.push(`op25!`))),i===`:`&&(o[l-1]&&a[l-1]?.push(`color: ${s(t[l-1])}`),r[l]?.push(`op50`)),t[l-2]===`node_modules`&&!i.startsWith(`.`)){let e=`color: ${s(t[l])}`;a[l]?.push(e),i.startsWith(`@`)&&(a[l+1]?.push(e),a[l+2]?.push(e))}}n===`query`&&(i===`?`?r[l]?.push(`text-red-500 dark:text-red-400`):i===`&`&&r[l]?.push(`text-orange-500 dark:text-orange-400`),i===`=`?r[l]?.push(`text-orange-900 dark:text-orange-200 op50`):t[l+1]===`=`?r[l]?.push(`text-amber-900 dark:text-amber-200`):r[l]?.push(`text-orange-900 dark:text-orange-200`))}),o.forEach((e,t)=>{e.props&&(e.props.class=r[t]?.join(` `)??``,e.props.style=a[t]?.join(`;`)??``)}),Array.from(c).sort((e,t)=>t-e).forEach(e=>{o.splice(e,1)}),o}}});export{l as n,u as t};
@@ -0,0 +1 @@
1
+ import{Ct as e,Dt as t,Ot as n,Vt as r,bt as i,hn as a,tn as o,vt as s,wt as c,xt as l}from"#entry";import{r as u}from"./dedBpiqn.js";import{n as d,t as f}from"./BRoY9F4B.js";var p={"text-xs":``,"font-mono":``,flex:`~ items-center gap-3`,ml2:``},m={flex:`~ gap-1 items-center`},h=Object.assign(n({__name:`BuildMetrics`,props:{metrics:{}},setup(n){let h=n,g=i(()=>{let e=h.metrics,t=e?.resolve_ids.reduce((e,t)=>(e+=t.duration,e),0),n=e?.loads?.reduce((e,t)=>(e+=t.duration,e),0),r=e?.transforms.reduce((e,t)=>(e+=t.duration,e),0);return{resolveIds:t,loads:n,transforms:r,total:t+n+r}}),_=i(()=>(h.metrics?.transforms)?.[0]?.source_code_size),v=i(()=>(h.metrics?.transforms.filter(e=>e.transformed_code_size)).at(-1)?.transformed_code_size);return(n,i)=>{let h=u;return r(),c(`div`,p,[t(f,{duration:g.value.resolveIds,flex:`~ gap-1 items-center`,title:`Resolve Id hooks cost: ${a(d)(g.value.resolveIds,!0)}`},{default:o(()=>[...i[0]||=[l(`span`,{"i-ph-magnifying-glass-duotone":``,"inline-block":``},null,-1)]]),_:1},8,[`duration`,`title`]),t(f,{duration:g.value.loads,flex:`~ gap-1 items-center`,title:`Load hooks cost: ${a(d)(g.value.loads,!0)}`},{default:o(()=>[...i[1]||=[l(`span`,{"i-ph-upload-simple-duotone":``,"inline-block":``},null,-1)]]),_:1},8,[`duration`,`title`]),t(f,{duration:g.value.transforms,flex:`~ gap-1 items-center`,title:`Transform hooks cost: ${a(d)(g.value.transforms,!0)}`},{default:o(()=>[...i[2]||=[l(`span`,{"i-ph-magic-wand-duotone":``,"inline-block":``},null,-1)]]),_:1},8,[`duration`,`title`]),i[6]||=l(`span`,{op40:``},`|`,-1),t(f,{duration:g.value.total,flex:`~ gap-1 items-center`,title:`Total build cost: ${a(d)(g.value.total,!0)}`},{default:o(()=>[...i[3]||=[l(`span`,{"i-ph-clock-duotone":``,"inline-block":``},null,-1)]]),_:1},8,[`duration`,`title`]),_.value&&v.value?(r(),c(s,{key:0},[i[5]||=l(`span`,{op40:``},`|`,-1),l(`div`,m,[t(h,{title:`Source code size`,bytes:_.value},null,8,[`bytes`]),i[4]||=l(`span`,{"i-ph-arrow-right-duotone":``,op50:``},null,-1),t(h,{title:`Transformed code size`,bytes:v.value},null,8,[`bytes`])])],64)):e(``,!0)])}}}),{__name:`ModulesBuildMetrics`});export{h as t};