@vitejs/devtools-vite 0.0.0-alpha.6 → 0.0.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{dirs-Z7VQHyIZ.js → dirs-K_XnRVOr.js} +1 -1
- package/dist/dirs.js +1 -1
- package/dist/index.d.ts +30 -8
- package/dist/index.js +75 -53
- package/dist/nitro.json +2 -2
- package/dist/public/200.html +1 -1
- package/dist/public/404.html +1 -1
- package/dist/public/_nuxt/0mOko9PX.js +1 -0
- package/dist/public/_nuxt/17ealR8P.js +1 -0
- package/dist/public/_nuxt/2OALqkc2.js +1 -0
- package/dist/public/_nuxt/AuXMpmu_.js +1 -0
- package/dist/public/_nuxt/B-MkobAt.js +1 -0
- package/dist/public/_nuxt/B7i9KC-T.js +1 -0
- package/dist/public/_nuxt/BA32mbNN.js +11 -0
- package/dist/public/_nuxt/BQPGP7j8.js +1 -0
- package/dist/public/_nuxt/BRMjfH79.js +1 -0
- package/dist/public/_nuxt/B_mZ82Ef.js +1 -0
- package/dist/public/_nuxt/BqsmMM9I.js +2 -0
- package/dist/public/_nuxt/C8mRFS2c.js +1 -0
- package/dist/public/_nuxt/{IrMnfQaU.js → CAhTQkqV.js} +1 -1
- package/dist/public/_nuxt/CIEMjxLP.js +1 -0
- package/dist/public/_nuxt/CIa3yLEd.js +1 -0
- package/dist/public/_nuxt/CbzAqNxs.js +1 -0
- package/dist/public/_nuxt/CeqjGqGg.js +1 -0
- package/dist/public/_nuxt/CiYp-ND6.js +1 -0
- package/dist/public/_nuxt/CqhxNBIt.js +1 -0
- package/dist/public/_nuxt/Cql2HFZJ.js +1 -0
- package/dist/public/_nuxt/D-ZnEyqr.js +1 -0
- package/dist/public/_nuxt/D5wipTtw.js +1 -0
- package/dist/public/_nuxt/DBFcewx9.js +33 -0
- package/dist/public/_nuxt/{BQ-NBLhA.js → DL1ysgP5.js} +1 -1
- package/dist/public/_nuxt/DQtLZa7C.js +1 -0
- package/dist/public/_nuxt/DY1DGGP1.js +1 -0
- package/dist/public/_nuxt/Dck9PP97.js +1 -0
- package/dist/public/_nuxt/DdKbKDl1.js +1 -0
- package/dist/public/_nuxt/Jdu9jmuG.js +1 -0
- package/dist/public/_nuxt/{BdGMcGSQ.js → SO3ppn9m.js} +1 -1
- package/dist/public/_nuxt/X7aOo9pb.js +1 -0
- package/dist/public/_nuxt/_h9oVyD9.js +1 -0
- package/dist/public/_nuxt/_hSlj5r4.js +1 -0
- package/dist/public/_nuxt/builds/latest.json +1 -1
- package/dist/public/_nuxt/builds/meta/e64426aa-3532-49bb-9bf1-178874074559.json +1 -0
- package/dist/public/_nuxt/diff.worker-DCsgdfuV.js +10 -0
- package/dist/public/_nuxt/entry.DwSNyIHU.css +1 -0
- package/dist/public/_nuxt/error-404.CCdr3eE4.css +1 -0
- package/dist/public/_nuxt/error-500.D-vBsHK_.css +1 -0
- package/dist/public/_nuxt/qsYzBPmV.js +1 -0
- package/dist/public/_nuxt/zFCtWS_S.js +1 -0
- package/dist/public/index.html +1 -1
- package/package.json +14 -14
- package/dist/public/_nuxt/B2fBtupD.js +0 -1
- package/dist/public/_nuxt/B4wxy85L.js +0 -1
- package/dist/public/_nuxt/BBRXmiYk.js +0 -1
- package/dist/public/_nuxt/BFrgWt5v.js +0 -1
- package/dist/public/_nuxt/BJ1En-qd.js +0 -1
- package/dist/public/_nuxt/BL9XEsp7.js +0 -1
- package/dist/public/_nuxt/BNZPks8A.js +0 -1
- package/dist/public/_nuxt/BO9hKuA-.js +0 -1
- package/dist/public/_nuxt/BhYsQoJN.js +0 -1
- package/dist/public/_nuxt/Bjr51Ks8.js +0 -1
- package/dist/public/_nuxt/BsPDwkF1.js +0 -1
- package/dist/public/_nuxt/C-pOSrl5.js +0 -1
- package/dist/public/_nuxt/C2X_oPur.js +0 -1
- package/dist/public/_nuxt/CQNn9qP2.js +0 -1
- package/dist/public/_nuxt/CRvrEAK3.js +0 -1
- package/dist/public/_nuxt/CS-6x7S3.js +0 -33
- package/dist/public/_nuxt/CS0-317H.js +0 -1
- package/dist/public/_nuxt/CWCLHkLi.js +0 -1
- package/dist/public/_nuxt/C_113ylp.js +0 -11
- package/dist/public/_nuxt/Ci9NHG69.js +0 -1
- package/dist/public/_nuxt/Ckf7xQdg.js +0 -1
- package/dist/public/_nuxt/DQCLStiA.js +0 -1
- package/dist/public/_nuxt/DSjlpmm-.js +0 -1
- package/dist/public/_nuxt/DUOY-ITr.js +0 -1
- package/dist/public/_nuxt/DZeYNBxL.js +0 -1
- package/dist/public/_nuxt/D_Sk_I-u.js +0 -1
- package/dist/public/_nuxt/DoCLzHNP.js +0 -1
- package/dist/public/_nuxt/KKO2iSg5.js +0 -2
- package/dist/public/_nuxt/Z5tyTJaP.js +0 -1
- package/dist/public/_nuxt/builds/meta/be0bb935-d565-4624-9bbc-88aa98997368.json +0 -1
- package/dist/public/_nuxt/diff.worker-BXxwMoGc.js +0 -10
- package/dist/public/_nuxt/entry.BnzQeNUH.css +0 -1
- package/dist/public/_nuxt/error-404.yUUAZDjV.css +0 -1
- package/dist/public/_nuxt/error-500.BHZzZRS-.css +0 -1
- package/dist/public/_nuxt/m0y8FcT0.js +0 -1
- package/dist/public/_nuxt/tS5wJZMm.js +0 -1
- package/dist/public/_nuxt/z9pSC1xM.js +0 -1
- /package/dist/public/_nuxt/{l47FwQA-.js → C_nQe8Pd.js} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{B as e,F as t,I as n,It as r,L as i,N as a,P as o,R as s,Ut as c,V as l,Wt as u,bt as d,dt as f,en as p,in as m,jt as h,ln as g,mt as _,pt as v,z as y}from"#entry";function b(){return typeof window<`u`}function x(e){return ee(e)?(e.nodeName||``).toLowerCase():`#document`}function S(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function C(e){return((ee(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function ee(e){return b()?e instanceof Node||e instanceof S(e).Node:!1}function w(e){return b()?e instanceof Element||e instanceof S(e).Element:!1}function T(e){return b()?e instanceof HTMLElement||e instanceof S(e).HTMLElement:!1}function te(e){return!b()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof S(e).ShadowRoot}var ne=new Set([`inline`,`contents`]);function E(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=A(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!ne.has(i)}var re=new Set([`table`,`td`,`th`]);function ie(e){return re.has(x(e))}var ae=[`:popover-open`,`:modal`];function D(e){return ae.some(t=>{try{return e.matches(t)}catch{return!1}})}var oe=[`transform`,`translate`,`scale`,`rotate`,`perspective`],se=[`transform`,`translate`,`scale`,`rotate`,`perspective`,`filter`],ce=[`paint`,`layout`,`strict`,`content`];function O(e){let t=ue(),n=w(e)?A(e):e;return oe.some(e=>n[e]?n[e]!==`none`:!1)||(n.containerType?n.containerType!==`normal`:!1)||!t&&(n.backdropFilter?n.backdropFilter!==`none`:!1)||!t&&(n.filter?n.filter!==`none`:!1)||se.some(e=>(n.willChange||``).includes(e))||ce.some(e=>(n.contain||``).includes(e))}function le(e){let t=M(e);for(;T(t)&&!k(t);){if(O(t))return t;if(D(t))return null;t=M(t)}return null}function ue(){return typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter`,`none`)}var de=new Set([`html`,`body`,`#document`]);function k(e){return de.has(x(e))}function A(e){return S(e).getComputedStyle(e)}function j(e){return w(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function M(e){if(x(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||te(e)&&e.host||C(e);return te(t)?t.host:t}function fe(e){let t=M(e);return k(t)?e.ownerDocument?e.ownerDocument.body:e.body:T(t)&&E(t)?t:fe(t)}function N(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=fe(e),i=r===e.ownerDocument?.body,a=S(r);if(i){let e=P(a);return t.concat(a,a.visualViewport||[],E(r)?r:[],e&&n?N(e):[])}return t.concat(r,N(r,[],n))}function P(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function pe(e){let t=A(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=T(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=l(n)!==a||l(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function me(e){return w(e)?e:e.contextElement}function F(e){let t=me(e);if(!T(t))return i(1);let n=t.getBoundingClientRect(),{width:r,height:a,$:o}=pe(t),s=(o?l(n.width):n.width)/r,c=(o?l(n.height):n.height)/a;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}var he=i(0);function ge(e){let t=S(e);return!ue()||!t.visualViewport?he:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function _e(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==S(e)?!1:t}function I(t,n,r,a){n===void 0&&(n=!1),r===void 0&&(r=!1);let o=t.getBoundingClientRect(),s=me(t),c=i(1);n&&(a?w(a)&&(c=F(a)):c=F(t));let l=_e(s,r,a)?ge(s):i(0),u=(o.left+l.x)/c.x,d=(o.top+l.y)/c.y,f=o.width/c.x,p=o.height/c.y;if(s){let e=S(s),t=a&&w(a)?S(a):a,n=e,r=P(n);for(;r&&a&&t!==n;){let e=F(r),t=r.getBoundingClientRect(),i=A(r),a=t.left+(r.clientLeft+parseFloat(i.paddingLeft))*e.x,o=t.top+(r.clientTop+parseFloat(i.paddingTop))*e.y;u*=e.x,d*=e.y,f*=e.x,p*=e.y,u+=a,d+=o,n=S(r),r=P(n)}}return e({width:f,height:p,x:u,y:d})}function L(e,t){let n=j(e).scrollLeft;return t?t.left+n:I(C(e)).left+n}function ve(e,t){let n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-L(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function ye(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e,o=a===`fixed`,s=C(r),c=t?D(t.floating):!1;if(r===s||c&&o)return n;let l={scrollLeft:0,scrollTop:0},u=i(1),d=i(0),f=T(r);if((f||!f&&!o)&&((x(r)!==`body`||E(s))&&(l=j(r)),T(r))){let e=I(r);u=F(r),d.x=e.x+r.clientLeft,d.y=e.y+r.clientTop}let p=s&&!f&&!o?ve(s,l):i(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x+p.x,y:n.y*u.y-l.scrollTop*u.y+d.y+p.y}}function be(e){return Array.from(e.getClientRects())}function xe(e){let t=C(e),n=j(e),r=e.ownerDocument.body,i=s(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=s(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+L(e),c=-n.scrollTop;return A(r).direction===`rtl`&&(o+=s(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:c}}var Se=25;function Ce(e,t){let n=S(e),r=C(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=ue();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=L(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<=Se&&(a-=o)}else l<=Se&&(a+=l);return{width:a,height:o,x:s,y:c}}var we=new Set([`absolute`,`fixed`]);function Te(e,t){let n=I(e,!0,t===`fixed`),r=n.top+e.clientTop,a=n.left+e.clientLeft,o=T(e)?F(e):i(1),s=e.clientWidth*o.x,c=e.clientHeight*o.y,l=a*o.x,u=r*o.y;return{width:s,height:c,x:l,y:u}}function Ee(t,n,r){let i;if(n===`viewport`)i=Ce(t,r);else if(n===`document`)i=xe(C(t));else if(w(n))i=Te(n,r);else{let e=ge(t);i={x:n.x-e.x,y:n.y-e.y,width:n.width,height:n.height}}return e(i)}function De(e,t){let n=M(e);return n===t||!w(n)||k(n)?!1:A(n).position===`fixed`||De(n,t)}function Oe(e,t){let n=t.get(e);if(n)return n;let r=N(e,[],!1).filter(e=>w(e)&&x(e)!==`body`),i=null,a=A(e).position===`fixed`,o=a?M(e):e;for(;w(o)&&!k(o);){let t=A(o),n=O(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&we.has(i.position)||E(o)&&!n&&De(e,o))?r=r.filter(e=>e!==o):i=t,o=M(o)}return t.set(e,r),r}function ke(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?D(t)?[]:Oe(t,this._c):[].concat(n),r],o=a[0],c=a.reduce((e,n)=>{let r=Ee(t,n,i);return e.top=s(r.top,e.top),e.right=y(r.right,e.right),e.bottom=y(r.bottom,e.bottom),e.left=s(r.left,e.left),e},Ee(t,o,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Ae(e){let{width:t,height:n}=pe(e);return{width:t,height:n}}function je(e,t,n){let r=T(t),a=C(t),o=n===`fixed`,s=I(e,!0,o,t),c={scrollLeft:0,scrollTop:0},l=i(0);function u(){l.x=L(a)}if(r||!r&&!o)if((x(t)!==`body`||E(a))&&(c=j(t)),r){let e=I(t,!0,o,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else a&&u();o&&!r&&a&&u();let d=a&&!r&&!o?ve(a,c):i(0),f=s.left+c.scrollLeft-l.x-d.x,p=s.top+c.scrollTop-l.y-d.y;return{x:f,y:p,width:s.width,height:s.height}}function R(e){return A(e).position===`static`}function Me(e,t){if(!T(e)||A(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return C(e)===n&&(n=n.ownerDocument.body),n}function Ne(e,t){let n=S(e);if(D(e))return n;if(!T(e)){let t=M(e);for(;t&&!k(t);){if(w(t)&&!R(t))return t;t=M(t)}return n}let r=Me(e,t);for(;r&&ie(r)&&R(r);)r=Me(r,t);return r&&k(r)&&R(r)&&!O(r)?n:r||le(e)||n}var Pe=async function(e){let t=this.getOffsetParent||Ne,n=this.getDimensions,r=await n(e.floating);return{reference:je(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Fe(e){return A(e).direction===`rtl`}var Ie={convertOffsetParentRelativeRectToViewportRelativeRect:ye,getDocumentElement:C,getClippingRect:ke,getOffsetParent:Ne,getElementRects:Pe,getClientRects:be,getDimensions:Ae,getScale:F,isElement:w,isRTL:Fe},Le=t,Re=n,ze=o,Be=(e,t,n)=>{let r=new Map,i={platform:Ie,...n},o={...i.platform,_c:r};return a(e,t,{...i,platform:o})},Ve=d({__name:`GraphHoverView`,props:{hoverX:{},hoverY:{}},setup(e){let{hoverX:t,hoverY:n}=m(e),i=c(`hoverElement`),a=p(0),o=p(0);return u([t,n],([e,t])=>{Be({getBoundingClientRect(){return{width:0,height:0,x:e,y:t,left:e,right:e,top:t,bottom:t}}},i.value,{placement:`right-start`,middleware:[ze(),Re(),Le({mainAxis:8,alignmentAxis:8})]}).then(({x:e,y:t})=>{a.value=e,o.value=t})}),(e,t)=>(h(),_(f,{to:`body`},[v(`div`,{ref_key:`hoverElement`,ref:i,fixed:``,"z-panel-content":``,style:g({left:`${a.value}px`,top:`${o.value}px`})},[r(e.$slots,`default`)],4)]))}}),He=Object.assign(Ve,{__name:`DisplayGraphHoverView`});function Ue(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 We,Ge,Ke,z,B,V=1,H;function U(e,t,n,r,i){if(!Array.isArray(e))return e;let a=window.devicePixelRatio||1;if(We!==t||Ge!==a||Ke!==i){let n=Math.round(64*a)/64;V=i,V=Math.log2(V),V-=Math.floor(V);let r=V,o=Math.min(1,8*r);V=2**V;let s=8*Math.SQRT2/V;We=t,Ge=a,Ke=i,z||=document.createElement(`canvas`),B||=z.getContext(`2d`),z.width=z.height=Math.round(64*n),B.scale(n,n),B.fillStyle=e[0],B.fillRect(0,0,64,64),B.globalAlpha=.25,B.fillStyle=e[1],B.fillRect(0,0,64,64),B.globalAlpha=.67,B.strokeStyle=e[1],B.beginPath();for(let e=0;e<=64;e+=16)B.moveTo(e-32,e+32),B.lineTo(e+32,e-32);if(B.lineWidth=s*(1-(o-r)/2),B.stroke(),o+r>0){B.beginPath();for(let e=8;e<64;e+=16)B.moveTo(e-32,e+32),B.lineTo(e+32,e-32);B.lineWidth=s*(o+r)/2,B.stroke()}H=t.createPattern(z,`repeat`),V/=n}return n/=64*V*a,n-=Math.floor(n),n*=64*V*a,H.setTransform(new DOMMatrix([V,0,0,V,n,r])),H}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 Je(e){return t=>t.id&&e[t.id]||t.color}function Ye(e,t=1,n=1){let r={};return Xe(r,e,0,Math.PI*2,t,n),Je(r)}function Xe(e,t,n,r,i=1,a=1){let o=t.size;e[t.id]=Ue(n+r/2,i,a);for(let s of t.children){let t=s.size/o*r;Xe(e,s,n,t,i,a),n+=t}}var Ze=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`;function Qe(e=16,t=Ze){let n=``,r=e,i=t.length;for(;r--;)n+=t[Math.random()*i|0];return n}function $e(e,t,n=(e,t)=>t.size-e.size){if(e.__nanovis)return e;let r={...e};return r.id||=Qe(),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=>$e(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 et(e){return e.children.length===0?1:Math.max(...e.children.map(e=>et(e)))+1}var tt=/\bFirefox\//.test(navigator.userAgent),W;function nt(e){return W?W.format(e):`${e}`}function G(){return(window.performance||Date).now()}function K(e){let t=e.toFixed(1).split(`.`,2);return`${nt(+t[0])}.${t[1]}`}function rt(e){return e===1?`1 byte`:e<1024?`${nt(e)} bytes`:e<1024*1024?`${K(e/1024)} kb`:e<1024*1024*1024?`${K(e/(1024*1024))} mb`:`${K(e/(1024*1024*1024))} gb`}function it(e,t,n,r,i,a){if(tt){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 at(e){return window.addEventListener(`wheel`,e,{passive:!1}),()=>window.removeEventListener(`wheel`,e)}function ot(e){return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)}try{W=new Intl.NumberFormat}catch{}var st=()=>({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)}}}),q={getText:e=>e.text,getSubtext:e=>e.subtext,animate:!0,animateDuration:350},ct={fallback:`#CCC`,stroke:`#0008`,text:`#222`,hover:`#fff5`,shadow:`#0008`,fg:`#fff`,bg:`#222`},lt=46,J=`14px sans-serif`,ut=`bold ${J}`,dt=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={...q,...t};let{getColor:n=Ye(e),getText:r=()=>void 0,getSubtext:i=()=>void 0}=this.options;this.palette={...ct,...t.palette},this.el=document.createElement(`div`),this.canvas=document.createElement(`canvas`),this.c=this.canvas.getContext(`2d`),this.root=e,this.maxDepth=et(e),this.disposables=[],this.events=st(),this.getColor=n,this.getText=r,this.getSubtext=i,this.setFont(J),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(lt)}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,ft=5,pt=.01,mt=1e3,ht=class extends dt{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(at(e=>{let t=e.deltaX,n=e.deltaY,r=G(),i=r-this.prevWheelTime<50?this.prevWheelWasZoom:e.ctrlKey||e.metaKey;this.prevWheelTime=r,this.prevWheelWasZoom=i,(i||Math.abs(t)>=Math.abs(n))&&e.preventDefault(),this.modifyViewport(t,n,i?e.pageX:null),this.updateHover(e)})),this.resize(),Promise.resolve().then(()=>this.resize()),this.disposables.push(ot(()=>this.resize())),this.mainEl.append(this.canvas),this.el.append(this.mainEl)}tick(){let e=(G()-this.animationStart)/(this.options.animateDuration??q.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??q.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*pt),r=Math.min(this.totalBytes,r+e.size*pt),this.setViewport(n,r,t)}}select(e,t=this.options.animate??q.animate){this.changeSelectedNode(e,t)}resize(){this.width=this.el.clientWidth,this.height=this.maxDepth*Y+1,this.zoomedOutMin=this.width-mt>>1,this.zoomedOutWidth=this.zoomedOutMin+mt,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)+ft,d=t+Y/2,f=this.getText(e)||``,p=this.getSubtext(e)||``,m,h=0,g=s+o-u,_=U(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(ut)):(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(J),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||it(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=G():this.animationStart=0,this.invalidate()}updateHover(e){let t=this.hitTestNode(e);this.changeHoveredNode(t),this.events.emit(`hover`,t,e)}};function gt(e,t){for(;t;){if(t===e)return!0;t=t.parent}return!1}function _t(e,t,n){if(e===t)return;let r=t.parent,i=r.size||1,a=0;_t(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 vt={};function yt(e){return vt[e]||(vt[e]=400*Math.log(1+Math.log(1+e/8))),vt[e]}var X=-Math.PI/2,bt=class extends dt{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(ot(()=>this.resize())),this.disposables.push(at(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(yt(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(ut),this.c.textAlign=`center`,this.c.fillText(rt(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=U(this.getColor(e)||this.palette.fallback,this.c,this.centerX,this.centerY,1),this.c.beginPath(),this.c.arc(this.centerX,this.centerY,n,r,r+u,!1),this.c.arc(this.centerX,this.centerY,s,r+u,r,!0),this.c.fill(),this.hoveredNode&&(a&8||e.parent===this.hoveredNode)&&(this.c.fillStyle=this.palette.hover,this.c.fill());else{let e=u===Math.PI*2,t=a&4||e?s:n;a&1&&n>0&&this.c.arc(this.centerX,this.centerY,n,r+u,r,!0),this.c.moveTo(this.centerX+t*Math.cos(r),this.centerY+t*Math.sin(r)),this.c.arc(this.centerX,this.centerY,s,r,r+u,!1),e||this.c.lineTo(this.centerX+n*Math.cos(r+u),this.centerY+n*Math.sin(r+u))}let d=e.size,f=a&10,p=0,m=-1/0;for(let n of e.children)m=this.drawNode(n,t+1,s,r+i*p/d,n.size/d*i,f,m),p+=n.size,f|=4;return l}changeHoveredNode(e,t){this.hoveredNode!==e&&(this.hoveredNode=e,this.updateSunburst(t))}hitTestNode(e){let t=this.canvas.getBoundingClientRect(),n=e.clientX-t.left-this.centerX,r=e.clientY-t.top-this.centerY,i=Math.sqrt(n*n+r*r),a=Math.atan2(r,n),o=(e,t,n,r,s)=>{let c=this.computeRadius(t+1);if(c>this.centerY)return;if(i>=n&&i<c){let t=a-r;if(t/=Math.PI*2,t-=Math.floor(t),t*=Math.PI*2,t<s)return e===this.animatedNode?e.parent:e}let l=e.size,u=0;for(let n of e.children){let e=o(n,t+1,c,r+s*u/l,n.size/l*s);if(e)return e;u+=n.size}};return o(this.animatedNode,this.animatedDepth,this.computeRadius(this.animatedDepth),this.animatedStartAngle,this.animatedSweepAngle)}tick(){let e=(G()-this.animationStart)/(this.options.animateDuration??q.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 yt(e)*this.radiusScale}updateSunburst(e=this.options.animate??!0){if(this.previousHoveredNode!==this.hoveredNode&&(this.previousHoveredNode=this.hoveredNode,this.hoveredNode||(this.canvas.style.cursor=`auto`,this.events.emit(`hover`,null)),this.invalidate()),this.targetNode!==this.currentNode){if(this.historyStack.length=0,this.invalidate(),e&&(this.animationStart=G()),gt(this.animatedNode,this.currentNode)){let e={depth_:this.animatedDepth,startAngle_:this.animatedStartAngle,sweepAngle_:this.animatedSweepAngle};_t(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(gt(this.currentNode,this.animatedNode)){let e={depth_:0,startAngle_:X,sweepAngle_:Math.PI*2};_t(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,xt=2*Z,$=Q+Z;function St(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>xt&&y>$?St(t.children,g+Z,_+Q,v-xt,y-$):[]}),h+=c}t=d,i>=s?(n+=m,i-=m):(r+=m,s-=m)}})(0,t,n,r,i),a}var Ct=class extends dt{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(at(e=>this.updateHover(e))),this.disposables.push(ot(()=>this.resize()))}select(e,t){let n=null;e===this.root&&(e=null),n=e?this.searchFor([this.layers.current,this.layers.base],e):null,this.changeCurrentLayout(n,t)}drawBaseLayout(){!this.width||!this.height||(this.c.clearRect(0,0,this.width,this.height),this.bgOriginX=this.bgOriginY=0,this.baseLayoutCache?this.c.putImageData(this.baseLayoutCache,0,0):(this.drawLayout(this.layers.base,0,[]),this.baseLayoutCache=this.c.getImageData(0,0,this.width*this.ratio,this.height*this.ratio)))}draw(){this.drawBaseLayout(),this.layers.current||this.drawHoverHighlight(this.layers.base);let e=this.layers.current?this.animationSource?this.animationTarget?1:1-this.animationBlend:this.animationBlend:0;if(this.layers.current){let[t,n,r,i]=this.layers.base.box;this.c.globalAlpha=.6*(!this.layers.current||!this.animationSource?1:e),this.c.fillStyle=this.palette.bg,this.c.fillRect(t,n,r,i),this.c.globalAlpha=1}if(this.layers.previous&&this.drawLayout(this.layers.previous,1,[this.layers.current]),this.layers.current){let[t,n,r,i]=this.layers.current.box,a=this.c.getTransform(),o=Math.sqrt(a.a*a.d);this.c.save(),this.c.shadowColor=this.palette.shadow,this.c.shadowBlur=o*(30*e),this.c.shadowOffsetX=o*(2*this.width),this.c.shadowOffsetY=o*(2*this.height+15*e),this.c.fillRect(t-2*this.width,n-2*this.height,r,i),this.c.restore(),this.bgOriginX=this.currentOriginX,this.bgOriginY=this.currentOriginY,this.drawLayout(this.layers.current,0,[]),this.drawHoverHighlight(this.layers.current)}}tick(){let e=this.animationBlend,t=this.currentNode;this.animationBlend=(G()-this.animationStart)/(this.options.animateDuration??q.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=St([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=U(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(it(this.c,this.palette.stroke,n+.5,i+.5,a,o),o>=Q){this.c.fillStyle=this.palette.text;let e=a-xt,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=St([this.currentNode.node],f,p,m-f,h-p)[0],this.currentOriginX=g(-(t+a)/2)*(1-d)+(f+m)/2,this.currentOriginY=g(-(n+o)/2)*(1-d)+(p+h)/2}else this.layers.current=void 0,this.currentOriginX=0,this.currentOriginY=0}hitTestNode(e){let t=this.canvas.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top,i=(e,t)=>{for(let a of e){let[e,o,s,c]=a.box;if(n>=e&&r>=o&&n<e+s&&r<o+c)return i(a.children,!1)||(t?null:a)}return null};return this.layers.current?i([this.layers.current],!1):i([this.layers.base],!0)}updateHover(e){let t=this.hitTestNode(e);this.changeHoveredNode(t&&t.node),this.events.emit(`hover`,t?.node||null,e)}changeHoveredNode(e){this.hoveredNode!==e&&(this.hoveredNode=e,this.canvas.style.cursor=e&&!e.children.length?`pointer`:`auto`,this.invalidate())}searchFor(e,t){for(let n of e){if(!n)continue;let e=n.node===t?n:this.searchFor(n.children,t);if(e)return e}return null}changeCurrentLayout(e,t=this.options.animate){this.animationTarget!==e&&(this.events.emit(`select`,e?.node||null),this.layers.previous=e?this.layers.current:void 0,t&&(this.animationBlend=0,this.animationStart=G(),this.animationSource=this.currentNode),this.animationTarget=e,this.currentNode=e||this.searchFor([this.layers.base],this.currentNode.node),this.updateCurrentLayout(),this.invalidate())}};export{Ye as a,qe as i,bt as n,$e as o,Ct as r,He as s,ht as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{C as e,Dt as t,Ft as n,X as r,Z as i,bt as a,en as o,ft as s,gt as c,ht as l,jt as u,m as d,mt as f,on as p,pt as m,qt as h,sn as g,un as _,ut as v,vt as y,yt as b}from"#entry";import"./Bjr51Ks8.js";import{i as x}from"./Ci9NHG69.js";import{a as S,s as C}from"./CQNn9qP2.js";import"./BO9hKuA-.js";import{t as w}from"./BQ-NBLhA.js";import"./DnpfwSMy.js";import{t as T}from"./BdGMcGSQ.js";import"./DZeYNBxL.js";import"./B2fBtupD.js";import{t as E}from"./C-pOSrl5.js";import{t as D}from"./D_Sk_I-u.js";import{t as O}from"./IrMnfQaU.js";import{t as k}from"./BBRXmiYk.js";import{n as A,t as j}from"./KKO2iSg5.js";import{t as M}from"./B4wxy85L.js";import{t as ee}from"./Z5tyTJaP.js";import{t as N}from"./m0y8FcT0.js";import{n as P,t as F}from"./l47FwQA-.js";var I={flex:`~ col gap-2`,p4:``},L={flex:``,pb2:``},R=a({__name:`FlatList`,props:{session:{},modules:{}},setup(e){return(t,n)=>{let r=w,i=j;return u(),c(`div`,I,[b(i,{items:e.modules,"key-prop":`id`},{default:h(({item:t})=>[m(`div`,L,[b(r,{id:t.id,session:e.session,hover:`bg-active`,block:``,px2:``,p1:``,"w-full":``,border:`~ base rounded`,link:!0},null,8,[`id`,`session`])])]),_:1},8,[`items`])])}}}),z=Object.assign(R,{__name:`ModulesFlatList`}),B={flex:`~ col gap-2`,p4:``},V={flex:``,pb2:``},H={flex:`~ gap-1 wrap`,"text-xs":``},U={flex:`~ auto text-xs wrap`},W={key:0,flex:`~ items-center`},G={key:0,op20:``},K={flex:`~ none gap-1 wrap justify-end`},q=a({__name:`DetailedList`,props:{session:{},modules:{}},setup(e){let t=e,r=s(()=>{let e=new Map;for(let n of t.modules){let t=n.buildMetrics?.transforms.filter(e=>e.source_code_size!==e.transformed_code_size).filter(e=>e.transformed_code_size);e.set(n.id,t)}return e});return(t,i)=>{let a=k,o=E,s=w,d=j;return u(),c(`div`,B,[b(d,{items:e.modules,"key-prop":`id`},{default:h(({item:t})=>[m(`div`,V,[b(s,{id:t.id,session:e.session,hover:`bg-active`,block:``,px2:``,p1:``,"w-full":``,border:`~ base rounded`,link:!0},{detail:h(()=>[m(`div`,H,[m(`ul`,U,[(u(!0),c(v,null,n(r.value.get(t.id),(e,n)=>(u(),c(v,{key:n},[e.source_code_size!==e.transformed_code_size&&e.transformed_code_size?(u(),c(`li`,W,[b(a,{name:e.plugin_name,class:`font-mono ws-nowrap op-50`},null,8,[`name`]),n===r.value.get(t.id).length-1?l(``,!0):(u(),c(`span`,G,`|`))])):l(``,!0)],64))),128))]),i[0]||=m(`div`,{flex:`~ auto gap-1`,"of-hidden":``},null,-1),m(`div`,K,[m(`span`,null,[t.buildMetrics?(u(),f(o,{key:0,metrics:t.buildMetrics},null,8,[`metrics`])):l(``,!0)])])])]),_:2},1032,[`id`,`session`])])]),_:1},8,[`items`])])}}}),J=Object.assign(q,{__name:`ModulesDetailedList`}),Y=[`d`,`stroke-dasharray`],X=a({__name:`Graph`,props:{modules:{},session:{}},setup(e){let n=e,r=s(()=>n.modules);return O({modules:r,spacing:{width:400,height:55,linkOffset:20,margin:800,gap:150},generateGraph:e=>{let{isFirstCalculateGraph:n,scale:i,spacing:a,tree:o,hierarchy:c,collapsedNodes:l,container:u,modulesMap:d,nodes:f,links:m,nodesMap:h,linksMap:g,width:_,height:v,childToParentMap:y,focusOn:b}=e,x=s(()=>r.value.filter(e=>e.importers.length===0));return(e=!0)=>{_.value=window.innerWidth,v.value=window.innerHeight;let r=new Set,s=c({module:{id:`~root`}},e=>e.module.id===`~root`?(x.value.forEach(e=>{r.add(e),n.value&&y.set(e.id,`~root`)}),x.value.map(e=>({module:e,expanded:!l.has(e.id),hasChildren:!1}))):l.has(e.module.id)?[]:e.module.imports.map(t=>{let i=d.value.get(t.module_id);if(i&&!r.has(i)&&!(y.has(i.id)&&y.get(i.id)!==e.module.id))return r.add(i),n.value&&y.set(i.id,e.module.id),{module:i,import:t,expanded:!l.has(i.id),hasChildren:!1}}).filter(e=>e!==void 0));n.value&&=!1,o().nodeSize([p(a.height),p(a.width)+p(a.gap)])(s);let S=s.descendants();for(let e of S)[e.x,e.y]=[e.y-p(a.width),e.x],e.data.module.imports&&(e.data.hasChildren=e.data.module.imports?.filter(t=>y.get(t.module_id)===e.data.module.id).length>0);let C=Math.min(...S.map(e=>e.x)),w=Math.min(...S.map(e=>e.y));if(C<p(a.margin))for(let e of S)e.x+=Math.abs(C)+p(a.margin);if(w<p(a.margin))for(let e of S)e.y+=Math.abs(w)+p(a.margin);f.value=S,h.clear();for(let e of S)h.set(e.data.module.id,e);let T=s.links().filter(e=>e.source.data.module.id!==`~root`).map(e=>({...e,import:e.source.data.import,id:`${e.source.data.module.id}|${e.target.data.module.id}`}));g.clear();for(let e of T)g.set(e.id,e);m.value=T,t(()=>{_.value=u.value.scrollWidth/i.value+p(a.margin),v.value=u.value.scrollHeight/i.value+p(a.margin);let n=x.value?.[0]?.id;e&&n&&t(()=>{b(n,!1)})})}}}),(t,n)=>{let i=w,a=N;return u(),f(a,{session:e.session,modules:r.value},{default:h(({node:t,nodesRefMap:n})=>[b(i,{id:t.data.module.id,ref:e=>n.set(t.data.module.id,e?.$el),link:!0,session:e.session,minimal:!0,flex:`1`},null,8,[`id`,`session`])]),link:h(({link:e,d:t,linkClass:n})=>[m(`path`,{d:t,class:g(n),"stroke-dasharray":e.import?.kind===`dynamic-import`?`3 6`:void 0,fill:`none`},null,10,Y)]),_:1},8,[`session`,`modules`])}}}),Z=Object.assign(X,{__name:`ModulesGraph`}),Q={"of-auto":``,"max-h-screen":``,"pt-45":``,relative:``},te={flex:`~ col gap-2`,p4:``},ne=a({__name:`Folder`,props:{session:{},modules:{}},setup(e){let t=e,n=s(()=>{if(!t.session.modulesList.length)return{workspace:{children:{},items:[]},nodeModules:{children:{},items:[]},virtual:{children:{},items:[]}};let e=[],n=[],r=[];return t.modules.map(e=>({full:e.id,path:e.path})).forEach(i=>{i.full.startsWith(t.session.meta.cwd)?(i.path.startsWith(`../`)||(i.path=i.full.slice(t.session.meta.cwd.length+1)),e.push(i)):i.full.includes(`node_modules`)?n.push({full:i.full,path:i.full}):i.full.startsWith(`virtual:`)&&r.push(i)}),{workspace:x(e,`Project Root`),nodeModules:x(n,`Node Modules`),virtual:x(r,`Virtual Modules`)}});return(e,t)=>{let r=M;return u(),c(`div`,Q,[m(`div`,te,[Object.keys(n.value.workspace.children).length?(u(),f(r,{key:0,node:n.value.workspace,p:`l3`,icon:`i-catppuccin:folder-dist icon-catppuccin`,"icon-open":`i-catppuccin:folder-dist-open icon-catppuccin`,link:!0},null,8,[`node`])):l(``,!0),Object.keys(n.value.nodeModules.children).length?(u(),c(v,{key:1},[t[0]||=m(`div`,{"w-full":``,"h-1px":``,border:`t base`},null,-1),b(r,{node:n.value.nodeModules,p:`l3`,icon:`i-catppuccin:folder-node icon-catppuccin`,"icon-open":`i-catppuccin:folder-node-open icon-catppuccin`,link:!0,open:!1},null,8,[`node`])],64)):l(``,!0),Object.keys(n.value.virtual.children).length?(u(),c(v,{key:2},[t[1]||=m(`div`,{"w-full":``,"h-1px":``,border:`t base`},null,-1),b(r,{node:n.value.virtual,p:`l3`,icon:`i-catppuccin:folder-components icon-catppuccin`,"icon-open":`i-catppuccin:folder-components-open icon-catppuccin`,link:!0,open:!1},null,8,[`node`])],64)):l(``,!0)])])}}}),re=Object.assign(ne,{__name:`ModulesFolder`}),ie={relative:``,"max-h-screen":``,"of-hidden":``},ae={absolute:``,"left-4":``,"top-4":``,"z-panel-nav":``},oe={flex:`~ gap-2 items-center`,p2:``,border:`t base`},$=[`onClick`],se={key:0,"of-auto":``,"h-screen":``,"pt-45":``},ce={absolute:``,"bottom-4":``,"py-1":``,"px-2":``,"bg-glass":``,left:`1/2`,"translate-x":`-1/2`,border:`~ base rounded-full`,text:`center xs`},le={op50:``},ue={key:1,"of-auto":``,"h-screen":``,"pt-45":``},de={absolute:``,"bottom-4":``,"py-1":``,"px-2":``,"bg-glass":``,left:`1/2`,"translate-x":`-1/2`,border:`~ base rounded-full`,text:`center xs`},fe={op50:``},pe=a({__name:`index`,props:{session:{}},setup(t){let a=t,l=r(),x=i(),w=o({search:l.query.search||``,selected:l.query.file_types?P(l.query.file_types):null,node_modules:l.query.node_modules?P(l.query.node_modules):null}),E=[{label:`List`,value:`list`,icon:`i-ph-list-bullets-duotone`},{label:`Detailed List`,value:`detailed-list`,icon:`i-ph-list-magnifying-glass-duotone`},{label:`Graph`,value:`graph`,icon:`i-ph-graph-duotone`},{label:`Folder`,value:`folder`,icon:`i-ph-folder-duotone`}];e(w.value,e=>{let t={...l.query,search:e.search||void 0,file_types:e.selected||void 0,node_modules:e.node_modules||void 0};x.replace({query:F(t)})},{debounce:500});let O=s(()=>a.session.modulesList.map(e=>{let t=T(e.id,a.session.meta.cwd),n=C(e.id);return{mod:e,path:t,type:n}})),k=s(()=>S.filter(e=>O.value.some(t=>e.match.test(t.mod.id)))),j=s(()=>{let e=O.value;return w.value.selected&&(e=e.filter(e=>{let t=C(e.mod.id);return w.value.selected.includes(t.name)})),w.value.node_modules&&(e=e.filter(e=>e.path.moduleName&&w.value.node_modules.includes(e.path.moduleName))),e.map(e=>({...e.mod,path:e.path.path}))}),M=d(()=>j.value,()=>new ee(j.value,{includeScore:!0,keys:[`id`],ignoreLocation:!0,threshold:.4})),N=s(()=>w.value.search?M.value.search(w.value.search).map(e=>e.item):j.value);function I(e){l.query.module&&x.replace({query:{...l.query,module:void 0}}),D.value.moduleGraphViewType=e}return(e,r)=>{let i=A,a=z,o=J,s=Z,l=re;return u(),c(`div`,ie,[m(`div`,ae,[b(i,{modelValue:w.value,"onUpdate:modelValue":r[0]||=e=>w.value=e,rules:k.value},{default:h(()=>[m(`div`,oe,[r[1]||=m(`span`,{op50:``,pl2:``,"text-sm":``},`View as`,-1),(u(),c(v,null,n(E,e=>m(`button`,{key:e.value,"btn-action":``,class:g(p(D).moduleGraphViewType===e.value?`bg-active`:`grayscale op50`),onClick:t=>I(e.value)},[m(`div`,{class:g(e.icon)},null,2),y(` `+_(e.label),1)],10,$)),64))])]),_:1},8,[`modelValue`,`rules`])]),p(D).moduleGraphViewType===`list`?(u(),c(`div`,se,[b(a,{session:t.session,modules:N.value},null,8,[`session`,`modules`]),m(`div`,ce,[m(`span`,le,_(N.value.length)+` of `+_(t.session.modulesList.length),1)])])):p(D).moduleGraphViewType===`detailed-list`?(u(),c(`div`,ue,[b(o,{session:t.session,modules:N.value},null,8,[`session`,`modules`]),m(`div`,de,[m(`span`,fe,_(N.value.length)+` of `+_(t.session.modulesList.length),1)])])):p(D).moduleGraphViewType===`graph`?(u(),f(s,{key:2,session:t.session,modules:N.value},null,8,[`session`,`modules`])):(u(),f(l,{key:3,session:t.session,modules:N.value},null,8,[`session`,`modules`]))])}}});export{pe as default};
|