@vitejs/devtools-rolldown 0.0.0-alpha.34 → 0.1.1

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 (82) hide show
  1. package/dist/index.mjs +1 -1
  2. package/dist/nitro.json +2 -2
  3. package/dist/public/200.html +1 -1
  4. package/dist/public/404.html +1 -1
  5. package/dist/public/_nuxt/5X3skKrQ2.js +1 -0
  6. package/dist/public/_nuxt/6dmQ5yi9.js +1 -0
  7. package/dist/public/_nuxt/B8Pee7C0.js +1 -0
  8. package/dist/public/_nuxt/BGo3TQDe2.js +1 -0
  9. package/dist/public/_nuxt/{DHg88w8Z.js → BWso7RtX.js} +1 -1
  10. package/dist/public/_nuxt/Bc8dubgH.js +1 -0
  11. package/dist/public/_nuxt/BcmauC2P2.js +1 -0
  12. package/dist/public/_nuxt/Bp4eI3o72.js +1 -0
  13. package/dist/public/_nuxt/Bqcxb-Bh2.js +1 -0
  14. package/dist/public/_nuxt/BxiRKmyC.js +2 -0
  15. package/dist/public/_nuxt/ByPScZnZ.js +1 -0
  16. package/dist/public/_nuxt/C2GH2ak5.js +1 -0
  17. package/dist/public/_nuxt/CNF2WI0B.js +1 -0
  18. package/dist/public/_nuxt/{7Sa9VFur.js → CNhzLIej.js} +1 -1
  19. package/dist/public/_nuxt/COVKvZqR.js +1 -0
  20. package/dist/public/_nuxt/CYHE6NHg.js +1 -0
  21. package/dist/public/_nuxt/{CB-NGWfo.js → CeUdh6JR.js} +1 -1
  22. package/dist/public/_nuxt/CoGMAm3u.js +1 -0
  23. package/dist/public/_nuxt/Csgp_tbz2.js +1 -0
  24. package/dist/public/_nuxt/CslYnwdN.js +1 -0
  25. package/dist/public/_nuxt/Cy7pLEz3.js +1 -0
  26. package/dist/public/_nuxt/CyUS7GqK.js +3 -0
  27. package/dist/public/_nuxt/D0PBHtPK.js +1 -0
  28. package/dist/public/_nuxt/{CyP4eEAT.js → D4uTGA7r.js} +1 -1
  29. package/dist/public/_nuxt/D9y1gK-U.js +2 -0
  30. package/dist/public/_nuxt/DE4LYGEQ.js +1 -0
  31. package/dist/public/_nuxt/{BaYNXXCt.js → DGePBXlZ.js} +1 -1
  32. package/dist/public/_nuxt/DSjaPvg5.js +1 -0
  33. package/dist/public/_nuxt/DjwOaWuE.js +1 -0
  34. package/dist/public/_nuxt/{Bpozzw1A.js → EJd6K-J0.js} +1 -1
  35. package/dist/public/_nuxt/{CDw62R4I.js → GNBXjCbD.js} +1 -1
  36. package/dist/public/_nuxt/L1-1zWht.js +1 -0
  37. package/dist/public/_nuxt/VSGDfpIu.js +1 -0
  38. package/dist/public/_nuxt/builds/latest.json +1 -1
  39. package/dist/public/_nuxt/builds/meta/e07d8142-6388-4c97-8d9e-c9e7fc0dd7f8.json +1 -0
  40. package/dist/public/_nuxt/d4UCo6ai.js +1 -0
  41. package/dist/public/_nuxt/{entry.DAebTvdU.css → entry.Cxm9MFjI.css} +1 -1
  42. package/dist/public/_nuxt/error-404.DCvw7d8G.css +1 -0
  43. package/dist/public/_nuxt/error-500.DMS_OhD_.css +1 -0
  44. package/dist/public/_nuxt/{D7AbeHTq.js → jJjSdHHs.js} +1 -1
  45. package/dist/public/_nuxt/lwvhLhUg.js +12 -0
  46. package/dist/public/_nuxt/njczzgS1.js +1 -0
  47. package/dist/public/_nuxt/pNZCMUGD.js +1 -0
  48. package/dist/public/index.html +1 -1
  49. package/package.json +5 -5
  50. package/dist/public/_nuxt/28OcTI2e2.js +0 -1
  51. package/dist/public/_nuxt/7JITT7Lv.js +0 -1
  52. package/dist/public/_nuxt/B5KEqWuS.js +0 -1
  53. package/dist/public/_nuxt/B7Uzi9u5.js +0 -3
  54. package/dist/public/_nuxt/B91g3LoS.js +0 -1
  55. package/dist/public/_nuxt/BAH7Ften.js +0 -1
  56. package/dist/public/_nuxt/BAiFz_-P2.js +0 -1
  57. package/dist/public/_nuxt/BLYeE3ho.js +0 -1
  58. package/dist/public/_nuxt/BO4gZbVl.js +0 -1
  59. package/dist/public/_nuxt/Bdtk5UYE.js +0 -1
  60. package/dist/public/_nuxt/BnNq-Z_V.js +0 -1
  61. package/dist/public/_nuxt/CQTlMuLw.js +0 -1
  62. package/dist/public/_nuxt/CYor1418.js +0 -1
  63. package/dist/public/_nuxt/CvoV-A9Y.js +0 -1
  64. package/dist/public/_nuxt/CzK_iMhR.js +0 -2
  65. package/dist/public/_nuxt/D63F5Z8a.js +0 -1
  66. package/dist/public/_nuxt/D6aQCUZx2.js +0 -1
  67. package/dist/public/_nuxt/DOpxmm79.js +0 -12
  68. package/dist/public/_nuxt/DV7TRE8i.js +0 -1
  69. package/dist/public/_nuxt/DaLz16aP.js +0 -2
  70. package/dist/public/_nuxt/DkEU1LAY.js +0 -1
  71. package/dist/public/_nuxt/DoxsY2al.js +0 -1
  72. package/dist/public/_nuxt/DrHs6mcp.js +0 -1
  73. package/dist/public/_nuxt/DvWFi_Ii2.js +0 -1
  74. package/dist/public/_nuxt/DyswZ8iG.js +0 -1
  75. package/dist/public/_nuxt/Y4YMtQtL.js +0 -1
  76. package/dist/public/_nuxt/bSvnGjgQ2.js +0 -1
  77. package/dist/public/_nuxt/builds/meta/74b7fb54-18a3-4ed3-aa42-c12c389e8a64.json +0 -1
  78. package/dist/public/_nuxt/error-404.DlglkSik.css +0 -1
  79. package/dist/public/_nuxt/error-500.BbJeK9S9.css +0 -1
  80. package/dist/public/_nuxt/hXXIFrrE.js +0 -1
  81. package/dist/public/_nuxt/p7Mpv4Xd2.js +0 -1
  82. package/dist/public/_nuxt/wmMbYO2d.js +0 -1
@@ -0,0 +1 @@
1
+ import{B as e,C as t,Et as n,Gt as r,K as i,M as a,Q as o,S as s,St as c,Wt as l,Z as u,at as d,b as f,bt as p,h as m,ot as h,q as g,v as _,w as v,wt as y,x as b}from"./CyUS7GqK.js";import{a as ee,c as x,d as S,f as C,i as te,l as w,o as ne,r as re,u as ie}from"./BrE3R8vW.js";import{t as T}from"./D0PBHtPK.js";import{t as E}from"./D04G8HHr.js";import{t as ae}from"./jJjSdHHs.js";function D(){return typeof window<`u`}function O(e){return oe(e)?(e.nodeName||``).toLowerCase():`#document`}function k(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function A(e){return((oe(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function oe(e){return D()?e instanceof Node||e instanceof k(e).Node:!1}function j(e){return D()?e instanceof Element||e instanceof k(e).Element:!1}function M(e){return D()?e instanceof HTMLElement||e instanceof k(e).HTMLElement:!1}function se(e){return!D()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof k(e).ShadowRoot}function N(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=R(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function ce(e){return/^(table|td|th)$/.test(O(e))}function P(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var le=/transform|translate|scale|rotate|perspective|filter/,ue=/paint|layout|strict|content/,F=e=>!!e&&e!==`none`,de;function I(e){let t=j(e)?R(e):e;return F(t.transform)||F(t.translate)||F(t.scale)||F(t.rotate)||F(t.perspective)||!pe()&&(F(t.backdropFilter)||F(t.filter))||le.test(t.willChange||``)||ue.test(t.contain||``)}function fe(e){let t=B(e);for(;M(t)&&!L(t);){if(I(t))return t;if(P(t))return null;t=B(t)}return null}function pe(){return de??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),de}function L(e){return/^(html|body|#document)$/.test(O(e))}function R(e){return k(e).getComputedStyle(e)}function z(e){return j(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function B(e){if(O(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||se(e)&&e.host||A(e);return se(t)?t.host:t}function me(e){let t=B(e);return L(t)?e.ownerDocument?e.ownerDocument.body:e.body:M(t)&&N(t)?t:me(t)}function he(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=me(e),i=r===e.ownerDocument?.body,a=k(r);if(i){let e=ge(a);return t.concat(a,a.visualViewport||[],N(r)?r:[],e&&n?he(e):[])}else return t.concat(r,he(r,[],n))}function ge(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function _e(e){let t=R(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=M(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=C(n)!==a||C(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function ve(e){return j(e)?e:e.contextElement}function V(e){let t=ve(e);if(!M(t))return x(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=_e(t),o=(a?C(n.width):n.width)/r,s=(a?C(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var ye=x(0);function be(e){let t=k(e);return!pe()||!t.visualViewport?ye:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function xe(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==k(e)?!1:t}function H(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=ve(e),o=x(1);t&&(r?j(r)&&(o=V(r)):o=V(e));let s=xe(a,n,r)?be(a):x(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=k(a),t=r&&j(r)?k(r):r,n=e,i=ge(n);for(;i&&r&&t!==n;){let e=V(i),t=i.getBoundingClientRect(),r=R(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=k(i),i=ge(n)}}return S({width:u,height:d,x:c,y:l})}function U(e,t){let n=z(e).scrollLeft;return t?t.left+n:H(A(e)).left+n}function Se(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-U(e,n),y:n.top+t.scrollTop}}function Ce(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=A(r),s=t?P(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=x(1),u=x(0),d=M(r);if((d||!d&&!a)&&((O(r)!==`body`||N(o))&&(c=z(r)),d)){let e=H(r);l=V(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Se(o,c):x(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 we(e){return Array.from(e.getClientRects())}function Te(e){let t=A(e),n=z(e),r=e.ownerDocument.body,i=w(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=w(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+U(e),s=-n.scrollTop;return R(r).direction===`rtl`&&(o+=w(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Ee=25;function De(e,t){let n=k(e),r=A(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=pe();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=U(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<=Ee&&(a-=o)}else l<=Ee&&(a+=l);return{width:a,height:o,x:s,y:c}}function Oe(e,t){let n=H(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=M(e)?V(e):x(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function ke(e,t,n){let r;if(t===`viewport`)r=De(e,n);else if(t===`document`)r=Te(A(e));else if(j(t))r=Oe(t,n);else{let n=be(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return S(r)}function Ae(e,t){let n=B(e);return n===t||!j(n)||L(n)?!1:R(n).position===`fixed`||Ae(n,t)}function je(e,t){let n=t.get(e);if(n)return n;let r=he(e,[],!1).filter(e=>j(e)&&O(e)!==`body`),i=null,a=R(e).position===`fixed`,o=a?B(e):e;for(;j(o)&&!L(o);){let t=R(o),n=I(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||N(o)&&!n&&Ae(e,o))?r=r.filter(e=>e!==o):i=t,o=B(o)}return t.set(e,r),r}function Me(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?P(t)?[]:je(t,this._c):[].concat(n),r],o=ke(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=ke(t,a[e],i);s=w(n.top,s),c=ie(n.right,c),l=ie(n.bottom,l),u=w(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Ne(e){let{width:t,height:n}=_e(e);return{width:t,height:n}}function Pe(e,t,n){let r=M(t),i=A(t),a=n===`fixed`,o=H(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=x(0);function l(){c.x=U(i)}if(r||!r&&!a)if((O(t)!==`body`||N(i))&&(s=z(t)),r){let e=H(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?Se(i,s):x(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 Fe(e){return R(e).position===`static`}function Ie(e,t){if(!M(e)||R(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return A(e)===n&&(n=n.ownerDocument.body),n}function Le(e,t){let n=k(e);if(P(e))return n;if(!M(e)){let t=B(e);for(;t&&!L(t);){if(j(t)&&!Fe(t))return t;t=B(t)}return n}let r=Ie(e,t);for(;r&&ce(r)&&Fe(r);)r=Ie(r,t);return r&&L(r)&&Fe(r)&&!I(r)?n:r||fe(e)||n}var Re=async function(e){let t=this.getOffsetParent||Le,n=this.getDimensions,r=await n(e.floating);return{reference:Pe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ze(e){return R(e).direction===`rtl`}var Be={convertOffsetParentRelativeRectToViewportRelativeRect:Ce,getDocumentElement:A,getClippingRect:Me,getOffsetParent:Le,getElementRects:Re,getClientRects:we,getDimensions:Ne,getScale:V,isElement:j,isRTL:ze},Ve=ee,He=ne,Ue=te,We=(e,t,n)=>{let r=new Map,i={platform:Be,...n},a={...i.platform,_c:r};return re(e,t,{...i,platform:a})},Ge=a({__name:`GraphHoverView`,props:{hoverX:{},hoverY:{}},setup(e){let{hoverX:t,hoverY:n}=y(e),r=d(`hoverElement`),i=p(0),a=p(0);return h([t,n],([e,t])=>{We({getBoundingClientRect(){return{width:0,height:0,x:e,y:t,left:e,right:e,top:t,bottom:t}}},r.value,{placement:`right-start`,middleware:[Ue(),He(),Ve({mainAxis:8,alignmentAxis:8})]}).then(({x:e,y:t})=>{i.value=e,a.value=t})}),(e,t)=>(g(),s(_,{to:`body`},[b(`div`,{ref_key:`hoverElement`,ref:r,fixed:``,"z-panel-content":``,"pointer-events-none":``,style:l({left:`${i.value}px`,top:`${a.value}px`})},[o(e.$slots,`default`)],4)]))}}),Ke=Object.assign(Ge,{__name:`DisplayGraphHoverView`});function qe(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 Je,Ye,Xe,W,G,K=1,Ze;function Qe(e,t,n,r,i){if(!Array.isArray(e))return e;let a=window.devicePixelRatio||1;if(Je!==t||Ye!==a||Xe!==i){let n=Math.round(64*a)/64;K=i,K=Math.log2(K),K-=Math.floor(K);let r=K,o=Math.min(1,8*r);K=2**K;let s=8*Math.SQRT2/K;Je=t,Ye=a,Xe=i,W||=document.createElement(`canvas`),G||=W.getContext(`2d`),W.width=W.height=Math.round(64*n),G.scale(n,n),G.fillStyle=e[0],G.fillRect(0,0,64,64),G.globalAlpha=.25,G.fillStyle=e[1],G.fillRect(0,0,64,64),G.globalAlpha=.67,G.strokeStyle=e[1],G.beginPath();for(let e=0;e<=64;e+=16)G.moveTo(e-32,e+32),G.lineTo(e+32,e-32);if(G.lineWidth=s*(1-(o-r)/2),G.stroke(),o+r>0){G.beginPath();for(let e=8;e<64;e+=16)G.moveTo(e-32,e+32),G.lineTo(e+32,e-32);G.lineWidth=s*(o+r)/2,G.stroke()}Ze=t.createPattern(W,`repeat`),K/=n}return n/=64*K*a,n-=Math.floor(n),n*=64*K*a,Ze.setTransform(new DOMMatrix([K,0,0,K,n,r])),Ze}function $e(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 et(e){return t=>t.id&&e[t.id]||t.color}function tt(e,t=1,n=1){let r={};return nt(r,e,0,Math.PI*2,t,n),et(r)}function nt(e,t,n,r,i=1,a=1){let o=t.size;e[t.id]=qe(n+r/2,i,a);for(let s of t.children){let t=s.size/o*r;nt(e,s,n,t,i,a),n+=t}}var rt=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`;function it(e=16,t=rt){let n=``,r=e,i=t.length;for(;r--;)n+=t[Math.random()*i|0];return n}function at(e,t,n=(e,t)=>t.size-e.size){if(e.__nanovis)return e;let r={...e};return r.id||=it(),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=>at(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 ot(e){return e.children.length===0?1:Math.max(...e.children.map(e=>ot(e)))+1}var st=/\bFirefox\//.test(navigator.userAgent),ct;function lt(e){return ct?ct.format(e):`${e}`}function q(){return(window.performance||Date).now()}function ut(e){let t=e.toFixed(1).split(`.`,2);return`${lt(+t[0])}.${t[1]}`}function dt(e){return e===1?`1 byte`:e<1024?`${lt(e)} bytes`:e<1024*1024?`${ut(e/1024)} kb`:e<1024*1024*1024?`${ut(e/(1024*1024))} mb`:`${ut(e/(1024*1024*1024))} gb`}function ft(e,t,n,r,i,a){if(st){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 pt(e){return window.addEventListener(`wheel`,e,{passive:!1}),()=>window.removeEventListener(`wheel`,e)}function mt(e){return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)}try{ct=new Intl.NumberFormat}catch{}var ht=()=>({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},gt={fallback:`#CCC`,stroke:`#0008`,text:`#222`,hover:`#fff5`,shadow:`#0008`,fg:`#fff`,bg:`#222`},_t=46,vt=`14px sans-serif`,yt=`bold ${vt}`,bt=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=tt(e),getText:r=()=>void 0,getSubtext:i=()=>void 0}=this.options;this.palette={...gt,...t.palette},this.el=document.createElement(`div`),this.canvas=document.createElement(`canvas`),this.c=this.canvas.getContext(`2d`),this.root=e,this.maxDepth=ot(e),this.disposables=[],this.events=ht(),this.getColor=n,this.getText=r,this.getSubtext=i,this.setFont(vt),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(_t)}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,xt=5,St=.01,Ct=1e3,wt=class extends bt{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(pt(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(mt(()=>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*St),r=Math.min(this.totalBytes,r+e.size*St),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-Ct>>1,this.zoomedOutWidth=this.zoomedOutMin+Ct,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)+xt,d=t+Y/2,f=this.getText(e)||``,p=this.getSubtext(e)||``,m,h=0,g=s+o-u,_=Qe(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(yt)):(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(vt),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||ft(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 Tt(e,t){for(;t;){if(t===e)return!0;t=t.parent}return!1}function Et(e,t,n){if(e===t)return;let r=t.parent,i=r.size||1,a=0;Et(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 Dt={};function Ot(e){return Dt[e]||(Dt[e]=400*Math.log(1+Math.log(1+e/8))),Dt[e]}var X=-Math.PI/2,kt=class extends bt{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(mt(()=>this.resize())),this.disposables.push(pt(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(Ot(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(yt),this.c.textAlign=`center`,this.c.fillText(this.getSubtext(this.targetNode)??dt(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=Qe(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 Ot(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()),Tt(this.animatedNode,this.currentNode)){let e={depth_:this.animatedDepth,startAngle_:this.animatedStartAngle,sweepAngle_:this.animatedSweepAngle};Et(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(Tt(this.currentNode,this.animatedNode)){let e={depth_:0,startAngle_:X,sweepAngle_:Math.PI*2};Et(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,At=2*Z,$=Q+Z;function jt(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>At&&y>$?jt(t.children,g+Z,_+Q,v-At,y-$):[]}),h+=c}t=d,i>=s?(n+=m,i-=m):(r+=m,s-=m)}})(0,t,n,r,i),a}var Mt=class extends bt{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(pt(e=>this.updateHover(e))),this.disposables.push(mt(()=>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=jt([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=Qe(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(ft(this.c,this.palette.stroke,n+.5,i+.5,a,o),o>=Q){this.c.fillStyle=this.palette.text;let e=a-At,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=jt([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())}},Nt={flex:`~ gap-1 items-center wrap`},Pt={key:0,"i-ph-arrow-right-bold":``,"text-sm":``,"op-fade":``},Ft=[`onClick`],It=a({__name:`NavBreadcrumb`,props:{selected:{},options:{}},emits:[`select`],setup(e,{emit:n}){let i=e,a=n,o=f(()=>{let e=[],t=i.selected;for(;t;)e.unshift(t),t=t.parent;return e});return(e,n)=>(g(),v(`div`,Nt,[(g(!0),v(m,null,u(o.value,(e,n)=>(g(),v(m,{key:e.id},[n>0?(g(),v(`div`,Pt)):t(``,!0),b(`button`,{hover:`bg-active`,rounded:``,px1:``,onClick:t=>a(`select`,e)},[b(`span`,null,r(e.text||e.id),1)],8,Ft)],64))),128))]))}}),Lt=Object.assign(It,{__name:`ChartNavBreadcrumb`});function Rt(t){let{data:r,nameKey:a,sizeKey:o,rootText:s,nodeType:l,graphOptions:u,onUpdate:d}=t,m=c(void 0),g=c(void 0),_=p(void 0),v=c(void 0),y,b=f(()=>{if(t.tree)return t.tree.value;let e=n(r),i=new Map,c=0,u={id:`~root`,text:s,size:0,sizeSelf:0,children:[]};if(!e?.length)return{map:i,root:u,maxDepth:c};let d=[];d.unshift(()=>{u.size+=u.children.reduce((e,t)=>e+t.size,0),u.subtext=E(u.size).join(` `),u.children.sort((e,t)=>t.size-e.size||e.id.localeCompare(t.id))});function f(e,t,n,r,a){if(i.has(t))return i.get(t);a>c&&(c=a);let o={id:t,text:n,size:0,sizeSelf:0,children:[],meta:{...e,path:n,type:`folder`},parent:r};return i.set(t,o),r.children.push(o),d.unshift(()=>{let t=o.sizeSelf;o.size+=o.children.reduce((e,t)=>e+t.size,0),o.subtext=E(o.size).join(` `),o.children.length&&t/o.size>.1&&o.children.push({id:`${o.id}-self`,text:``,size:t,sizeSelf:t,subtext:E(t).join(` `),children:[],meta:{...e,path:``,type:l},parent:o}),o.children.sort((e,t)=>t.size-e.size||e.id.localeCompare(t.id))}),o}function p(e){let t=e[a].split(`/`).filter(Boolean),n=u,r=``,s=0;t.forEach((c,u)=>{if(r+=(r?`/`:``)+c,s++,u===t.length-1){let t={id:e[a],text:c,size:e[o],sizeSelf:e[o],subtext:E(e[o]).join(` `),children:[],meta:{...e,path:c,type:l}};n.children.push(t),i.set(e[a],t)}else n=f(e,r,c,n,s)})}return e.forEach(p),d.forEach(e=>e()),{map:i,root:u,maxDepth:c}}),ee=f(()=>({animate:ae.value.chartAnimation,palette:{stroke:T.value?`#222`:`#555`,fg:T.value?`#fff`:`#000`,bg:T.value?`#111`:`#fff`},getColor:tt(b.value.root,T.value?.8:.9,T.value?1:1.1),getSubtext:e=>e.subtext,...u}));function x(e,t){_.value=e?.meta,e?.children.length||(e=e?.parent),v.value?.select(e,t)}function S(){y?.(),g.value=b.value.root,d?.(),e(()=>{let e=_.value&&b.value.map.get(_.value[a])||null;e&&x(e,!1)}),y=()=>{v.value?.dispose(),v.value=void 0,_.value=void 0}}return e(()=>{h(()=>[b.value,ee.value],()=>{S()},{deep:!0,immediate:!1}),S()}),i(()=>{y?.()}),{tree:b,graph:v,chartOptions:ee,nodeHover:m,nodeSelected:g,selectedNode:_,selectNode:x,buildGraph:S}}export{Mt as a,Ke as c,kt as i,Lt as n,$e as o,wt as r,at as s,Rt as t};
@@ -1 +1 @@
1
- {"id":"74b7fb54-18a3-4ed3-aa42-c12c389e8a64","timestamp":1773204919880}
1
+ {"id":"e07d8142-6388-4c97-8d9e-c9e7fc0dd7f8","timestamp":1773673639565}
@@ -0,0 +1 @@
1
+ {"id":"e07d8142-6388-4c97-8d9e-c9e7fc0dd7f8","timestamp":1773673639565,"prerendered":[]}
@@ -0,0 +1 @@
1
+ import{A as e,C as t,Et as n,Gt as r,Ht as i,M as a,S as o,Z as s,b as c,bt as l,ct as u,h as d,k as f,lt as p,q as m,tt as h,w as g,x as _}from"./CyUS7GqK.js";import"./Bc8dubgH.js";import{i as v,r as y}from"./CeUdh6JR.js";import{t as b}from"./B8Pee7C0.js";import{t as x}from"./ByPScZnZ.js";import{r as S,t as C}from"./Cy7pLEz3.js";import{t as w}from"./CoGMAm3u.js";import{t as T}from"./DGePBXlZ.js";var E={flex:`~ col gap-2`},D={flex:`~ gap-1 items-center`,"font-mono":``,op50:``,"text-sm":``},O={"font-mono":``,"font-sm":``},k={key:0,flex:`~ gap-1 items-center`},A={key:0,op50:``,"text-xs":``,border:`~ base rounded-md`,px1:``,"font-mono":``},j=a({__name:`SessionSelector`,props:{sessionMode:{},sessions:{},selectedSessionIds:{},selectedSessions:{}},emits:[`select`],setup(a,{emit:l}){let u=a,v=l;function y(e){return T(e.meta.inputs[0]?.filename??``,e.meta.cwd).path}let x=c(()=>{let e=u.selectedSessions?.[0];return e?y(e):``});function j(e){return x.value&&x.value!==y(e)}function M(e){u.sessionMode===`compare`&&!j(e)&&v(`select`,e)}return(c,l)=>{let u=C;return m(),g(`div`,E,[(m(!0),g(d,null,s(a.sessions,s=>(m(),g(`div`,{key:s.id,flex:`~ row gap-2`,relative:``},[(m(),o(h(a.sessionMode===`list`?n(b):`div`),{to:`/session/${s.id}`,border:`~ rounded-md`,class:i(a.sessionMode===`list`?[`hover:bg-active`,`border-base`]:[a.selectedSessionIds.includes(s.id)?`border-active`:`border-base`,j(s)||a.selectedSessions.length===2&&!a.selectedSessionIds.includes(s.id)?`op50`:`hover:bg-active`]),flex:`~ col gap-1`,px4:``,py3:``,"w-full":``,onClick:e=>M(s)},{default:p(()=>[_(`div`,D,[l[0]||=_(`div`,{"i-ph-hash-duotone":``},null,-1),f(` `+r(s.id),1)]),_(`div`,O,r(s.meta.cwd),1),s.meta.inputs[0]?(m(),g(`div`,k,[e(u,{id:s.meta.inputs[0].filename,cwd:s.meta.cwd},null,8,[`id`,`cwd`]),e(S,{text:s.meta.inputs[0].name||`entry`},null,8,[`text`]),s.meta.inputs.length>1?(m(),g(`span`,A,` +`+r(s.meta.inputs.length-1),1)):t(``,!0)])):t(``,!0),e(w,{timestamp:s.timestamp,pt2:``,"text-sm":``,op50:``},null,8,[`timestamp`])]),_:2},1032,[`to`,`class`,`onClick`]))]))),128))])}}}),M=Object.assign(j,{__name:`PanelSessionSelector`}),N={p4:``,flex:`~ col gap-4`,"items-center":``,"justify-center":``,relative:``},P={key:0,op50:``},F={key:1,op50:``},I={relative:``,flex:`~ col gap3 items-center`},L={key:2,fixed:``,"top-5":``,"right-5":``,flex:`~ col gap2`},R={flex:`~ row justify-around`,w20:``,h8:``,border:`~ base rounded-8`,"of-hidden":``},z=[`title`,`onClick`],B={key:3,fixed:``,"bottom-5":``,"right-5":``,border:`~ base rounded-2`,w100:``,"max-lg:w85":``,"bg-glass":``,"z-panel-content":``},V={flex:`~ justify-center`,p2:``},H={key:1,op80:``,"text-sm":``},U=a({__name:`index`,async setup(a){let h,S,C=l(`list`),w=[{label:`Session List`,icon:`i-ph-list-bullets-duotone`,value:`list`},{label:`Session Compare`,icon:`i-ph-git-diff-duotone`,value:`compare`}],T=l([]),E=c(()=>T.value.map(e=>e.id).sort()),D=c(()=>T.value.toSorted((e,t)=>e.timestamp-t.timestamp).map((e,t)=>({...e,createdAt:new Date(e.timestamp),title:t===0?`Session A`:`Session B`}))),O=y(),k=([h,S]=u(()=>O.value.call(`vite:rolldown:list-sessions`)),h=await h,S(),h);function A(e){E.value.includes(e.id)?T.value=T.value.filter(t=>t.id!==e.id):T.value=[...T.value,e]}return(a,c)=>{let l=v,u=M,h=x,y=b;return m(),g(`div`,N,[e(l),n(k).length?(m(),g(`p`,P,r(C.value===`list`?`Select a build session to get started:`:`Select 2 build sessions to compare:`),1)):(m(),g(`p`,F,` No sessions yet, run a build to get started. `)),_(`div`,I,[e(u,{"session-mode":C.value,sessions:n(k),"selected-session-ids":E.value,"selected-sessions":T.value,onSelect:A},null,8,[`session-mode`,`sessions`,`selected-session-ids`,`selected-sessions`])]),n(k).length?(m(),g(`div`,L,[_(`div`,R,[(m(),g(d,null,s(w,e=>_(`button`,{key:e.value,title:e.label,"flex-1":``,op50:``,flex:`~ items-center justify-center`,class:i({"bg-active text-base op100!":C.value===e.value}),hover:`bg-active text-base op100!`,onClick:t=>C.value=e.value},[_(`span`,{class:i([e.icon,`text-sm`])},null,2)],10,z)),64))])])):t(``,!0),T.value.length>0&&C.value===`compare`?(m(),g(`div`,B,[e(h,{sessions:D.value,class:`flex-col gap0 [&>div]:border-none! [&>first-child]:border-b!`},null,8,[`sessions`]),_(`div`,V,[T.value.length===2?(m(),o(y,{key:0,tag:`button`,to:`/compare/${E.value.join(`,`)}`,"btn-action":``,"rounded-8":``,"text-3":``,flex:`~ justify-center`,w30:``,h8:``},{default:p(()=>[...c[0]||=[f(` Compare `,-1)]]),_:1},8,[`to`])):(m(),g(`div`,H,` Select one more session to compare. `))])])):t(``,!0)])}}});export{U as default};