@vitejs/devtools-rolldown 0.1.10 → 0.1.12

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 (84) hide show
  1. package/dist/index.mjs +11 -10
  2. package/dist/nitro.json +1 -1
  3. package/dist/public/200.html +1 -1
  4. package/dist/public/404.html +1 -1
  5. package/dist/public/_nuxt/4NH8NIP0.js +1 -0
  6. package/dist/public/_nuxt/4u6R6kmy.js +1 -0
  7. package/dist/public/_nuxt/B4F3iFfR.js +1 -0
  8. package/dist/public/_nuxt/B8a2SqNB.js +1 -0
  9. package/dist/public/_nuxt/B9VntNhm.js +1 -0
  10. package/dist/public/_nuxt/{C1LKt3HR.js → BAo-e_JU.js} +1 -1
  11. package/dist/public/_nuxt/{CZg4aoum.js → BBjyA450.js} +1 -1
  12. package/dist/public/_nuxt/BEi8EpEX.js +2 -0
  13. package/dist/public/_nuxt/BGO_avQR.js +1 -0
  14. package/dist/public/_nuxt/{Dm4CqiyV.js → BH_Y2qlu.js} +1 -1
  15. package/dist/public/_nuxt/{DHvQIQw5.js → BIN2apLJ2.js} +1 -1
  16. package/dist/public/_nuxt/BKc1pqIm2.js +1 -0
  17. package/dist/public/_nuxt/BPmpuG8C.js +1 -0
  18. package/dist/public/_nuxt/BeLy3b84.js +1 -0
  19. package/dist/public/_nuxt/{C1U2XYRv.js → BkNrnf7z.js} +1 -1
  20. package/dist/public/_nuxt/BmalnO7M2.js +1 -0
  21. package/dist/public/_nuxt/Bpyx8FA-2.js +1 -0
  22. package/dist/public/_nuxt/C-jnQn3e2.js +1 -0
  23. package/dist/public/_nuxt/{okblV2iS.js → C1yaj-Vm.js} +1 -1
  24. package/dist/public/_nuxt/CHDa2Jyn.js +1 -0
  25. package/dist/public/_nuxt/{BO4_45PC.js → CI0Dr981.js} +1 -1
  26. package/dist/public/_nuxt/CKJSqDo0.js +1 -0
  27. package/dist/public/_nuxt/{DlCwyx2g.js → COgjeEhM.js} +1 -1
  28. package/dist/public/_nuxt/{sLhNJUFM2.js → COguKaym2.js} +1 -1
  29. package/dist/public/_nuxt/{Bw1q8I0g.js → CeYpEmO6.js} +1 -1
  30. package/dist/public/_nuxt/CsnuQTMT.js +1 -0
  31. package/dist/public/_nuxt/Cz3MAfkg.js +1 -0
  32. package/dist/public/_nuxt/{COS9SmxY.js → D-q_RBTz.js} +1 -1
  33. package/dist/public/_nuxt/D4alSS1R2.js +1 -0
  34. package/dist/public/_nuxt/D5wH9XYc.js +1 -0
  35. package/dist/public/_nuxt/{OKWcjHDe.js → DHH1zTqi.js} +1 -1
  36. package/dist/public/_nuxt/DOP22jZa.js +1 -0
  37. package/dist/public/_nuxt/DVNjK2Kc.js +1 -0
  38. package/dist/public/_nuxt/Dnap40Ul.js +1 -0
  39. package/dist/public/_nuxt/DtDZGs9N2.js +12 -0
  40. package/dist/public/_nuxt/{kJJURm8F.js → Du2TAFfS.js} +1 -1
  41. package/dist/public/_nuxt/{9H-i61wf2.js → Dy-Bcz622.js} +1 -1
  42. package/dist/public/_nuxt/JI1WloZr2.js +1 -0
  43. package/dist/public/_nuxt/{DNtQ0ruM.js → MPr03GYv2.js} +1 -1
  44. package/dist/public/_nuxt/MtfbxdGf.js +1 -0
  45. package/dist/public/_nuxt/WOQUZE4V.js +3 -0
  46. package/dist/public/_nuxt/builds/latest.json +1 -1
  47. package/dist/public/_nuxt/builds/meta/22fa3e65-827c-4bf4-9626-ed9f35ca13df.json +1 -0
  48. package/dist/public/_nuxt/{entry.Bhlr47SV.css → entry.ByRjDeYo.css} +1 -1
  49. package/dist/public/_nuxt/error-404.DW3F0okm.css +1 -0
  50. package/dist/public/_nuxt/error-500.B7h4CJww.css +1 -0
  51. package/dist/public/_nuxt/hanhGz4p.js +1 -0
  52. package/dist/public/_nuxt/{KgssGmNv.js → mwlMWDmZ.js} +1 -1
  53. package/dist/public/_nuxt/{BdJ_JF0w.js → n6uS-XK5.js} +1 -1
  54. package/dist/public/index.html +1 -1
  55. package/package.json +12 -12
  56. package/dist/public/_nuxt/006NdgFm.js +0 -2
  57. package/dist/public/_nuxt/B5qpg37n.js +0 -1
  58. package/dist/public/_nuxt/BBP0yOsf2.js +0 -1
  59. package/dist/public/_nuxt/BgoIwvw3.js +0 -1
  60. package/dist/public/_nuxt/BhkwvCN32.js +0 -1
  61. package/dist/public/_nuxt/Bv5LSOyE2.js +0 -1
  62. package/dist/public/_nuxt/C0aRgtmJ.js +0 -1
  63. package/dist/public/_nuxt/C9r1FtUd.js +0 -1
  64. package/dist/public/_nuxt/CEtF9LWU.js +0 -3
  65. package/dist/public/_nuxt/CSK2QzqY.js +0 -1
  66. package/dist/public/_nuxt/Cb77vzCb.js +0 -1
  67. package/dist/public/_nuxt/Ccj-rFEC.js +0 -1
  68. package/dist/public/_nuxt/CfGVkjRe.js +0 -1
  69. package/dist/public/_nuxt/Cn7bMz0c2.js +0 -1
  70. package/dist/public/_nuxt/D04G8HHr.js +0 -1
  71. package/dist/public/_nuxt/DJTkDKGN.js +0 -1
  72. package/dist/public/_nuxt/DXL3SCKY.js +0 -12
  73. package/dist/public/_nuxt/DbSMFLvz.js +0 -1
  74. package/dist/public/_nuxt/DkA3R_W8.js +0 -1
  75. package/dist/public/_nuxt/XDMGgUv8.js +0 -1
  76. package/dist/public/_nuxt/builds/meta/b5744aa7-f5f0-4ca6-8795-e3208cdd7167.json +0 -1
  77. package/dist/public/_nuxt/dIDzU19U.js +0 -1
  78. package/dist/public/_nuxt/error-404.DAZPnRlV.css +0 -1
  79. package/dist/public/_nuxt/error-500.DM9xp1Lx.css +0 -1
  80. package/dist/public/_nuxt/fdFrOGYe.js +0 -1
  81. /package/dist/public/_nuxt/{DoJ6DaKu.js → Cvg1SSG2.js} +0 -0
  82. /package/dist/public/_nuxt/{5tvbNeKa.js → D4aX0j39.js} +0 -0
  83. /package/dist/public/_nuxt/{qIAw3Eg02.js → DjsgV5Nj2.js} +0 -0
  84. /package/dist/public/_nuxt/{BUwCbG2W.js → XAUaDDss.js} +0 -0
@@ -0,0 +1 @@
1
+ import{At as e,B as t,Bt as n,Ct as r,Dt as i,E as a,Et as o,F as s,Ft as c,I as l,It as u,Kt as d,L as f,Lt as p,M as m,Mt as ee,Nt as h,Ot as te,Pt as g,Rt as _,St as ne,T as v,Vt as re,Y as y,b,bt as x,i as S,jt as ie,kt as C,m as ae,ot as oe,p as se,vt as w,xt as ce,y as le,zt as T}from"./WOQUZE4V.js";var E=void 0,D=typeof window<`u`&&window.trustedTypes;if(D)try{E=D.createPolicy(`vue`,{createHTML:e=>e})}catch{}var ue=E?e=>E.createHTML(e):e=>e,de=`http://www.w3.org/2000/svg`,fe=`http://www.w3.org/1998/Math/MathML`,O=typeof document<`u`?document:null,pe=O&&O.createElement(`template`),me={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?O.createElementNS(de,e):t===`mathml`?O.createElementNS(fe,e):n?O.createElement(e,{is:n}):O.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>O.createTextNode(e),createComment:e=>O.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>O.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===a||!(i=i.nextSibling)););else{pe.innerHTML=ue(r===`svg`?`<svg>${e}</svg>`:r===`mathml`?`<math>${e}</math>`:e);let i=pe.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},k=`transition`,A=`animation`,j=Symbol(`_vtc`),he={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},ge=C({},ae,he),_e=(e=>(e.displayName=`Transition`,e.props=ge,e))((e,{slots:t})=>s(se,ye(e),t)),M=(e,t=[])=>{h(e)?e.forEach(e=>e(...t)):e&&e(...t)},ve=e=>e?h(e)?e.some(e=>e.length>1):e.length>1:!1;function ye(e){let t={};for(let n in e)n in he||(t[n]=e[n]);if(e.css===!1)return t;let{name:n=`v`,type:r,duration:i,enterFromClass:a=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:s=`${n}-enter-to`,appearFromClass:c=a,appearActiveClass:l=o,appearToClass:u=s,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:p=`${n}-leave-to`}=e,m=be(i),ee=m&&m[0],h=m&&m[1],{onBeforeEnter:te,onEnter:g,onEnterCancelled:_,onLeave:ne,onLeaveCancelled:v,onBeforeAppear:re=te,onAppear:y=g,onAppearCancelled:b=_}=t,x=(e,t,n,r)=>{e._enterCancelled=r,P(e,t?u:s),P(e,t?l:o),n&&n()},S=(e,t)=>{e._isLeaving=!1,P(e,d),P(e,p),P(e,f),t&&t()},ie=e=>(t,n)=>{let i=e?y:g,o=()=>x(t,e,n);M(i,[t,o]),Se(()=>{P(t,e?c:a),N(t,e?u:s),ve(i)||we(t,r,ee,o)})};return C(t,{onBeforeEnter(e){M(te,[e]),N(e,a),N(e,o)},onBeforeAppear(e){M(re,[e]),N(e,c),N(e,l)},onEnter:ie(!1),onAppear:ie(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>S(e,t);N(e,d),e._enterCancelled?(N(e,f),Oe(e)):(Oe(e),N(e,f)),Se(()=>{e._isLeaving&&(P(e,d),N(e,p),ve(ne)||we(e,r,h,n))}),M(ne,[e,n])},onEnterCancelled(e){x(e,!1,void 0,!0),M(_,[e])},onAppearCancelled(e){x(e,!0,void 0,!0),M(b,[e])},onLeaveCancelled(e){S(e),M(v,[e])}})}function be(e){if(e==null)return null;if(u(e))return[xe(e.enter),xe(e.leave)];{let t=xe(e);return[t,t]}}function xe(e){return d(e)}function N(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[j]||(e[j]=new Set)).add(t)}function P(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[j];n&&(n.delete(t),n.size||(e[j]=void 0))}function Se(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}var Ce=0;function we(e,t,n,r){let i=e._endId=++Ce,a=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(a,n);let{type:o,timeout:s,propCount:c}=Te(e,t);if(!o)return r();let l=o+`end`,u=0,d=()=>{e.removeEventListener(l,f),a()},f=t=>{t.target===e&&++u>=c&&d()};setTimeout(()=>{u<c&&d()},s+1),e.addEventListener(l,f)}function Te(e,t){let n=window.getComputedStyle(e),r=e=>(n[e]||``).split(`, `),i=r(`${k}Delay`),a=r(`${k}Duration`),o=Ee(i,a),s=r(`${A}Delay`),c=r(`${A}Duration`),l=Ee(s,c),u=null,d=0,f=0;t===k?o>0&&(u=k,d=o,f=a.length):t===A?l>0&&(u=A,d=l,f=c.length):(d=Math.max(o,l),u=d>0?o>l?k:A:null,f=u?u===k?a.length:c.length:0);let p=u===k&&/\b(?:transform|all)(?:,|$)/.test(r(`${k}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function Ee(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((t,n)=>De(t)+De(e[n])))}function De(e){return e===`auto`?0:Number(e.slice(0,-1).replace(`,`,`.`))*1e3}function Oe(e){return(e?e.ownerDocument:document).body.offsetHeight}function ke(e,t,n){let r=e[j];r&&(t=(t?[t,...r]:[...r]).join(` `)),t==null?e.removeAttribute(`class`):n?e.setAttribute(`class`,t):e.className=t}var Ae=Symbol(`_vod`),je=Symbol(`_vsh`),Me={name:`show`,beforeMount(e,{value:t},{transition:n}){e[Ae]=e.style.display===`none`?``:e.style.display,n&&t?n.beforeEnter(e):F(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),F(e,!0),r.enter(e)):r.leave(e,()=>{F(e,!1)}):F(e,t))},beforeUnmount(e,{value:t}){F(e,t)}};function F(e,t){e.style.display=t?e[Ae]:`none`,e[je]=!t}var Ne=Symbol(``),Pe=/(?:^|;)\s*display\s*:/;function Fe(e,t,n){let r=e.style,i=T(n),a=!1;if(n&&!i){if(t)if(T(t))for(let e of t.split(`;`)){let t=e.slice(0,e.indexOf(`:`)).trim();n[t]??Le(r,t,``)}else for(let e in t)n[e]??Le(r,e,``);for(let e in n)e===`display`&&(a=!0),Le(r,e,n[e])}else if(i){if(t!==n){let e=r[Ne];e&&(n+=`;`+e),r.cssText=n,a=Pe.test(n)}}else t&&e.removeAttribute(`style`);Ae in e&&(e[Ae]=a?r.display:``,e[je]&&(r.display=`none`))}var Ie=/\s*!important$/;function Le(t,n,r){if(h(r))r.forEach(e=>Le(t,n,e));else if(r??=``,n.startsWith(`--`))t.setProperty(n,r);else{let i=Be(t,n);Ie.test(r)?t.setProperty(e(i),r.replace(Ie,``),`important`):t[i]=r}}var Re=[`Webkit`,`Moz`,`ms`],ze={};function Be(e,t){let n=ze[t];if(n)return n;let r=i(t);if(r!==`filter`&&r in e)return ze[t]=r;r=te(r);for(let n=0;n<Re.length;n++){let i=Re[n]+r;if(i in e)return ze[t]=i}return t}var Ve=`http://www.w3.org/1999/xlink`;function He(e,t,r,i,a,o=_(t)){i&&t.startsWith(`xlink:`)?r==null?e.removeAttributeNS(Ve,t.slice(6,t.length)):e.setAttributeNS(Ve,t,r):r==null||o&&!ie(r)?e.removeAttribute(t):e.setAttribute(t,o?``:n(r)?String(r):r)}function Ue(e,t,n,r,i){if(t===`innerHTML`||t===`textContent`){n!=null&&(e[t]=t===`innerHTML`?ue(n):n);return}let a=e.tagName;if(t===`value`&&a!==`PROGRESS`&&!a.includes(`-`)){let r=a===`OPTION`?e.getAttribute(`value`)||``:e.value,i=n==null?e.type===`checkbox`?`on`:``:String(n);(r!==i||!(`_value`in e))&&(e.value=i),n??e.removeAttribute(t),e._value=n;return}let o=!1;if(n===``||n==null){let r=typeof e[t];r===`boolean`?n=ie(n):n==null&&r===`string`?(n=``,o=!0):r===`number`&&(n=0,o=!0)}try{e[t]=n}catch{}o&&e.removeAttribute(i||t)}function I(e,t,n,r){e.addEventListener(t,n,r)}function We(e,t,n,r){e.removeEventListener(t,n,r)}var Ge=Symbol(`_vei`);function Ke(e,t,n,r,i=null){let a=e[Ge]||(e[Ge]={}),o=a[t];if(r&&o)o.value=r;else{let[n,s]=Je(t);r?I(e,n,a[t]=Qe(r,i),s):o&&(We(e,n,o,s),a[t]=void 0)}}var qe=/(?:Once|Passive|Capture)$/;function Je(t){let n;if(qe.test(t)){n={};let e;for(;e=t.match(qe);)t=t.slice(0,t.length-e[0].length),n[e[0].toLowerCase()]=!0}return[t[2]===`:`?t.slice(3):e(t.slice(2)),n]}var Ye=0,Xe=Promise.resolve(),Ze=()=>Ye||=(Xe.then(()=>Ye=0),Date.now());function Qe(e,t){let n=e=>{if(!e._vts)e._vts=Date.now();else if(e._vts<=n.attached)return;le($e(e,n.value),t,5,[e])};return n.value=e,n.attached=Ze(),n}function $e(e,t){if(h(t)){let n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(e=>t=>!t._stopped&&e&&e(t))}else return t}var et=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,tt=(e,t,n,r,a,o)=>{let s=a===`svg`;t===`class`?ke(e,r,s):t===`style`?Fe(e,n,r):p(t)?c(t)||Ke(e,t,n,r,o):(t[0]===`.`?(t=t.slice(1),!0):t[0]===`^`?(t=t.slice(1),!1):nt(e,t,r,s))?(Ue(e,t,r),!e.tagName.includes(`-`)&&(t===`value`||t===`checked`||t===`selected`)&&He(e,t,r,s,o,t!==`value`)):e._isVueCE&&(rt(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!T(r)))?Ue(e,i(t),r,o,t):(t===`true-value`?e._trueValue=r:t===`false-value`&&(e._falseValue=r),He(e,t,r,s))};function nt(e,t,n,r){if(r)return!!(t===`innerHTML`||t===`textContent`||t in e&&et(t)&&g(n));if(t===`spellcheck`||t===`draggable`||t===`translate`||t===`autocorrect`||t===`sandbox`&&e.tagName===`IFRAME`||t===`form`||t===`list`&&e.tagName===`INPUT`||t===`type`&&e.tagName===`TEXTAREA`)return!1;if(t===`width`||t===`height`){let t=e.tagName;if(t===`IMG`||t===`VIDEO`||t===`CANVAS`||t===`SOURCE`)return!1}return et(t)&&T(n)?!1:t in e}function rt(e,t){let n=e._def.props;if(!n)return!1;let r=i(t);return Array.isArray(n)?n.some(e=>i(e)===r):Object.keys(n).some(e=>i(e)===r)}var it=e=>{let t=e.props[`onUpdate:modelValue`]||!1;return h(t)?e=>ee(t,e):t};function at(e){e.target.composing=!0}function ot(e){let t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event(`input`)))}var st=Symbol(`_assign`);function ct(e,t,n){return t&&(e=e.trim()),n&&(e=re(e)),e}var lt={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e[st]=it(i);let a=r||i.props&&i.props.type===`number`;I(e,t?`change`:`input`,t=>{t.target.composing||e[st](ct(e.value,n,a))}),(n||a)&&I(e,`change`,()=>{e.value=ct(e.value,n,a)}),t||(I(e,`compositionstart`,at),I(e,`compositionend`,ot),I(e,`change`,ot))},mounted(e,{value:t}){e.value=t??``},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[st]=it(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?re(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},ut=[`ctrl`,`shift`,`alt`,`meta`],dt={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>ut.some(n=>e[`${n}Key`]&&!t.includes(n))},ft=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=dt[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},pt={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},mt=(t,n)=>{let r=t._withKeys||={},i=n.join(`.`);return r[i]||(r[i]=(r=>{if(!(`key`in r))return;let i=e(r.key);if(n.some(e=>e===i||pt[e]===i))return t(r)}))},ht=C({patchProp:tt},me),gt,_t=!1;function vt(){return gt||=a(ht)}function yt(){return gt=_t?gt:v(ht),_t=!0,gt}var bt=((...e)=>{let t=vt().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=Ct(e);if(!r)return;let i=t._component;!g(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,St(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t}),xt=((...e)=>{let t=yt().createApp(...e),{mount:n}=t;return t.mount=e=>{let t=Ct(e);if(t)return n(t,!0,St(t))},t});function St(e){if(e instanceof SVGElement)return`svg`;if(typeof MathMLElement==`function`&&e instanceof MathMLElement)return`mathml`}function Ct(e){return T(e)?document.querySelector(e):e}var wt=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,Tt=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,Et=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function Dt(e,t){if(e===`__proto__`||e===`constructor`&&t&&typeof t==`object`&&`prototype`in t){Ot(e);return}return t}function Ot(e){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`)}function kt(e,t={}){if(typeof e!=`string`)return e;if(e[0]===`"`&&e[e.length-1]===`"`&&e.indexOf(`\\`)===-1)return e.slice(1,-1);let n=e.trim();if(n.length<=9)switch(n.toLowerCase()){case`true`:return!0;case`false`:return!1;case`undefined`:return;case`null`:return null;case`nan`:return NaN;case`infinity`:return 1/0;case`-infinity`:return-1/0}if(!Et.test(e)){if(t.strict)throw SyntaxError(`[destr] Invalid JSON`);return e}try{if(wt.test(e)||Tt.test(e)){if(t.strict)throw Error(`[destr] Possible prototype pollution`);return JSON.parse(e,Dt)}return JSON.parse(e)}catch(n){if(t.strict)throw n;return e}}String.fromCharCode;var At=/#/g,jt=/&/g,Mt=/\//g,Nt=/=/g,Pt=/\?/g,Ft=/\+/g,It=/%5e/gi,Lt=/%60/gi,Rt=/%7c/gi,zt=/%20/gi,Bt=/%2f/gi,Vt=/%252f/gi;function Ht(e){return encodeURI(``+e).replace(Rt,`|`)}function Ut(e){return Ht(typeof e==`string`?e:JSON.stringify(e)).replace(Ft,`%2B`).replace(zt,`+`).replace(At,`%23`).replace(jt,`%26`).replace(Lt,"`").replace(It,`^`).replace(Mt,`%2F`)}function Wt(e){return Ut(e).replace(Nt,`%3D`)}function Gt(e){return Ht(e).replace(At,`%23`).replace(Pt,`%3F`).replace(Vt,`%2F`).replace(jt,`%26`).replace(Ft,`%2B`)}function L(e=``){try{return decodeURIComponent(``+e)}catch{return``+e}}function Kt(e){return L(e.replace(Bt,`%252F`))}function qt(e){return L(e.replace(Ft,` `))}function Jt(e){return L(e.replace(Ft,` `))}function Yt(e=``){let t=Object.create(null);e[0]===`?`&&(e=e.slice(1));for(let n of e.split(`&`)){let e=n.match(/([^=]+)=?(.*)/)||[];if(e.length<2)continue;let r=qt(e[1]);if(r===`__proto__`||r===`constructor`)continue;let i=Jt(e[2]||``);t[r]===void 0?t[r]=i:Array.isArray(t[r])?t[r].push(i):t[r]=[t[r],i]}return t}function Xt(e,t){return(typeof t==`number`||typeof t==`boolean`)&&(t=String(t)),t?Array.isArray(t)?t.map(t=>`${Wt(e)}=${Ut(t)}`).join(`&`):`${Wt(e)}=${Ut(t)}`:Wt(e)}function Zt(e){return Object.keys(e).filter(t=>e[t]!==void 0).map(t=>Xt(t,e[t])).filter(Boolean).join(`&`)}var Qt=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,$t=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,en=/^([/\\]\s*){2,}[^/\\]/,tn=/^[\s\0]*(blob|data|javascript|vbscript):$/i,nn=/\/$|\/\?|\/#/,rn=/^\.?\//;function R(e,t={}){return typeof t==`boolean`&&(t={acceptRelative:t}),t.strict?Qt.test(e):$t.test(e)||(t.acceptRelative?en.test(e):!1)}function an(e){return!!e&&tn.test(e)}function on(e=``,t){return t?nn.test(e):e.endsWith(`/`)}function z(e=``,t){if(!t)return(on(e)?e.slice(0,-1):e)||`/`;if(!on(e,!0))return e||`/`;let n=e,r=``,i=e.indexOf(`#`);i!==-1&&(n=e.slice(0,i),r=e.slice(i));let[a,...o]=n.split(`?`);return((a.endsWith(`/`)?a.slice(0,-1):a)||`/`)+(o.length>0?`?${o.join(`?`)}`:``)+r}function sn(e=``,t){if(!t)return e.endsWith(`/`)?e:e+`/`;if(on(e,!0))return e||`/`;let n=e,r=``,i=e.indexOf(`#`);if(i!==-1&&(n=e.slice(0,i),r=e.slice(i),!n))return r;let[a,...o]=n.split(`?`);return a+`/`+(o.length>0?`?${o.join(`?`)}`:``)+r}function cn(e,t){if(dn(t)||R(e))return e;let n=z(t);if(e.startsWith(n)){let t=e[n.length];if(!t||t===`/`||t===`?`)return e}return pn(n,e)}function ln(e,t){if(dn(t))return e;let n=z(t);if(!e.startsWith(n))return e;let r=e[n.length];if(r&&r!==`/`&&r!==`?`)return e;let i=e.slice(n.length);return i[0]===`/`?i:`/`+i}function un(e,t){let n=_n(e);return n.search=Zt({...Yt(n.search),...t}),yn(n)}function dn(e){return!e||e===`/`}function fn(e){return e&&e!==`/`}function pn(e,...t){let n=e||``;for(let e of t.filter(e=>fn(e)))if(n){let t=e.replace(rn,``);n=sn(n)+t}else n=e;return n}function mn(...e){let t=/\/(?!\/)/,n=e.filter(Boolean),r=[],i=0;for(let e of n)if(!(!e||e===`/`)){for(let[n,a]of e.split(t).entries())if(!(!a||a===`.`)){if(a===`..`){if(r.length===1&&R(r[0]))continue;r.pop(),i--;continue}if(n===1&&r[r.length-1]?.endsWith(`:/`)){r[r.length-1]+=`/`+a;continue}r.push(a),i++}}let a=r.join(`/`);return i>=0?n[0]?.startsWith(`/`)&&!a.startsWith(`/`)?a=`/`+a:n[0]?.startsWith(`./`)&&!a.startsWith(`./`)&&(a=`./`+a):a=`../`.repeat(-1*i)+a,n[n.length-1]?.endsWith(`/`)&&!a.endsWith(`/`)&&(a+=`/`),a}function hn(e,t){return L(z(e))===L(z(t))}var gn=Symbol.for(`ufo:protocolRelative`);function _n(e=``,t){let n=e.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(n){let[,e,t=``]=n;return{protocol:e.toLowerCase(),pathname:t,href:e+t,auth:``,host:``,search:``,hash:``}}if(!R(e,{acceptRelative:!0}))return t?_n(t+e):vn(e);let[,r=``,i,a=``]=e.replace(/\\/g,`/`).match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[],[,o=``,s=``]=a.match(/([^#/?]*)(.*)?/)||[];r===`file:`&&(s=s.replace(/\/(?=[A-Za-z]:)/,``));let{pathname:c,search:l,hash:u}=vn(s);return{protocol:r.toLowerCase(),auth:i?i.slice(0,Math.max(0,i.length-1)):``,host:o,pathname:c,search:l,hash:u,[gn]:!r}}function vn(e=``){let[t=``,n=``,r=``]=(e.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:t,search:n,hash:r}}function yn(e){let t=e.pathname||``,n=e.search?(e.search.startsWith(`?`)?``:`?`)+e.search:``,r=e.hash||``,i=e.auth?e.auth+`@`:``,a=e.host||``;return(e.protocol||e[gn]?(e.protocol||``)+`//`:``)+i+a+t+n+r}function bn(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)===`[object Module]`:!0}function xn(e,t,n=`.`,r){if(!bn(t))return xn(e,{},n,r);let i=Object.assign({},t);for(let t in e){if(t===`__proto__`||t===`constructor`)continue;let a=e[t];a!=null&&(r&&r(i,t,a,n)||(Array.isArray(a)&&Array.isArray(i[t])?i[t]=[...a,...i[t]]:bn(a)&&bn(i[t])?i[t]=xn(a,i[t],(n?`${n}.`:``)+t.toString(),r):i[t]=a))}return i}function Sn(e){return(...t)=>t.reduce((t,n)=>xn(t,n,``,e),{})}var Cn=Sn();function wn(e,t){try{return t in e}catch{return!1}}var Tn=class extends Error{static __h3_error__=!0;statusCode=500;fatal=!1;unhandled=!1;statusMessage;data;cause;constructor(e,t={}){super(e,t),t.cause&&!this.cause&&(this.cause=t.cause)}toJSON(){let e={message:this.message,statusCode:An(this.statusCode,500)};return this.statusMessage&&(e.statusMessage=kn(this.statusMessage)),this.data!==void 0&&(e.data=this.data),e}};function En(e){if(typeof e==`string`)return new Tn(e);if(Dn(e))return e;let t=new Tn(e.message??e.statusMessage??``,{cause:e.cause||e});if(wn(e,`stack`))try{Object.defineProperty(t,`stack`,{get(){return e.stack}})}catch{try{t.stack=e.stack}catch{}}if(e.data&&(t.data=e.data),e.statusCode?t.statusCode=An(e.statusCode,t.statusCode):e.status&&(t.statusCode=An(e.status,t.statusCode)),e.statusMessage?t.statusMessage=e.statusMessage:e.statusText&&(t.statusMessage=e.statusText),t.statusMessage){let e=t.statusMessage;kn(t.statusMessage)!==e&&console.warn("[h3] Please prefer using `message` for longer error messages instead of `statusMessage`. In the future, `statusMessage` will be sanitized by default.")}return e.fatal!==void 0&&(t.fatal=e.fatal),e.unhandled!==void 0&&(t.unhandled=e.unhandled),t}function Dn(e){return e?.constructor?.__h3_error__===!0}var On=/[^\u0009\u0020-\u007E]/g;function kn(e=``){return e.replace(On,``)}function An(e,t=200){return!e||(typeof e==`string`&&(e=Number.parseInt(e,10)),e<100||e>999)?t:e}globalThis.Headers,globalThis.Response;var jn=Symbol(`layout-meta`),Mn=Symbol(`route`);import.meta.url.replace(/\/app\/.*$/,`/`);var B=()=>S()?.$router,Nn=()=>l()?f(Mn,S()._route):S()._route;function Pn(e){return e}var Fn=()=>{try{if(S()._processingMiddleware)return!0}catch{return!1}return!1},In=(e,t)=>{e||=`/`;let n=typeof e==`string`?e:`path`in e?Ln(e):B().resolve(e).href;if(t?.open){let{target:e=`_blank`,windowFeatures:r={}}=t.open,i=[];for(let[e,t]of Object.entries(r))t!==void 0&&i.push(`${e.toLowerCase()}=${t}`);return open(n,e,i.join(`, `)),Promise.resolve()}let r=R(n,{acceptRelative:!0}),i=t?.external||r;if(i){if(!t?.external)throw Error("Navigating to an external URL is not allowed by default. Use `navigateTo(url, { external: true })`.");let{protocol:e}=new URL(n,window.location.href);if(e&&an(e))throw Error(`Cannot navigate to a URL with '${e}' protocol.`)}let a=Fn();if(!i&&a){if(t?.replace){if(typeof e==`string`){let{pathname:t,search:n,hash:r}=_n(e);return{path:t,...n&&{query:Yt(n)},...r&&{hash:r},replace:!0}}return{...e,replace:!0}}return e}let o=B(),s=S();if(i)return s._scope.stop(),t?.replace?location.replace(n):location.href=n,a?s.isHydrating?new Promise(()=>{}):!1:Promise.resolve();let c=typeof e==`string`?Rn(e):e;return t?.replace?o.replace(c):o.push(c)};function Ln(e){return un(e.path||``,e.query||{})+(e.hash||``)}function Rn(e){let t=_n(e);return Gt(Kt(t.pathname))+t.search+t.hash}var zn=`__nuxt_error`,Bn=()=>r(S().payload,`error`),Vn=e=>{let t=Wn(e);try{let e=Bn();S().hooks.callHook(`app:error`,t),e.value||=t}catch{throw t}return t},Hn=async(e={})=>{let t=S(),n=Bn();t.callHook(`app:error:cleared`,e),e.redirect&&await B().replace(e.redirect),n.value=void 0},Un=e=>!!e&&typeof e==`object`&&`__nuxt_error`in e,Wn=e=>{typeof e!=`string`&&e.statusText&&(e.message??=e.statusText);let t=En(e);return Object.defineProperty(t,zn,{value:!0,configurable:!1,writable:!1}),Object.defineProperty(t,`status`,{get:()=>t.statusCode,configurable:!0}),Object.defineProperty(t,`statusText`,{get:()=>t.statusMessage,configurable:!0}),t},V=typeof document<`u`;function Gn(e){return typeof e==`object`||`displayName`in e||`props`in e||`__vccOpts`in e}function Kn(e){return e.__esModule||e[Symbol.toStringTag]===`Module`||e.default&&Gn(e.default)}var H=Object.assign;function qn(e,t){let n={};for(let r in t){let i=t[r];n[r]=U(i)?i.map(e):e(i)}return n}var Jn=()=>{},U=Array.isArray;function Yn(e,t){let n={};for(let r in e)n[r]=r in t?t[r]:e[r];return n}var W=function(e){return e[e.MATCHER_NOT_FOUND=1]=`MATCHER_NOT_FOUND`,e[e.NAVIGATION_GUARD_REDIRECT=2]=`NAVIGATION_GUARD_REDIRECT`,e[e.NAVIGATION_ABORTED=4]=`NAVIGATION_ABORTED`,e[e.NAVIGATION_CANCELLED=8]=`NAVIGATION_CANCELLED`,e[e.NAVIGATION_DUPLICATED=16]=`NAVIGATION_DUPLICATED`,e}({}),Xn=Symbol(``);W.MATCHER_NOT_FOUND,W.NAVIGATION_GUARD_REDIRECT,W.NAVIGATION_ABORTED,W.NAVIGATION_CANCELLED,W.NAVIGATION_DUPLICATED;function G(e,t){return H(Error(),{type:e,[Xn]:!0},t)}function K(e,t){return e instanceof Error&&Xn in e&&(t==null||!!(e.type&t))}var Zn=Symbol(``),Qn=Symbol(``),$n=Symbol(``),er=Symbol(``),tr=Symbol(``),nr=/#/g,rr=/&/g,ir=/\//g,ar=/=/g,or=/\?/g,sr=/\+/g,cr=/%5B/g,lr=/%5D/g,ur=/%5E/g,dr=/%60/g,fr=/%7B/g,pr=/%7C/g,mr=/%7D/g,hr=/%20/g;function gr(e){return e==null?``:encodeURI(``+e).replace(pr,`|`).replace(cr,`[`).replace(lr,`]`)}function _r(e){return gr(e).replace(fr,`{`).replace(mr,`}`).replace(ur,`^`)}function vr(e){return gr(e).replace(sr,`%2B`).replace(hr,`+`).replace(nr,`%23`).replace(rr,`%26`).replace(dr,"`").replace(fr,`{`).replace(mr,`}`).replace(ur,`^`)}function yr(e){return vr(e).replace(ar,`%3D`)}function br(e){return gr(e).replace(nr,`%23`).replace(or,`%3F`)}function xr(e){return br(e).replace(ir,`%2F`)}function Sr(e){if(e==null)return null;try{return decodeURIComponent(``+e)}catch{}return``+e}var Cr=/\/$/,wr=e=>e.replace(Cr,``);function Tr(e,t,n=`/`){let r,i={},a=``,o=``,s=t.indexOf(`#`),c=t.indexOf(`?`);return c=s>=0&&c>s?-1:c,c>=0&&(r=t.slice(0,c),a=t.slice(c,s>0?s:t.length),i=e(a.slice(1))),s>=0&&(r||=t.slice(0,s),o=t.slice(s,t.length)),r=Mr(r??t,n),{fullPath:r+a+o,path:r,query:i,hash:Sr(o)}}function Er(e,t){let n=t.query?e(t.query):``;return t.path+(n&&`?`)+n+(t.hash||``)}function Dr(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||`/`}function Or(e,t,n){let r=t.matched.length-1,i=n.matched.length-1;return r>-1&&r===i&&q(t.matched[r],n.matched[i])&&kr(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function q(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function kr(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!Ar(e[n],t[n]))return!1;return!0}function Ar(e,t){return U(e)?jr(e,t):U(t)?jr(t,e):(e&&e.valueOf())===(t&&t.valueOf())}function jr(e,t){return U(t)?e.length===t.length&&e.every((e,n)=>e===t[n]):e.length===1&&e[0]===t}function Mr(e,t){if(e.startsWith(`/`))return e;if(!e)return t;let n=t.split(`/`),r=e.split(`/`),i=r[r.length-1];(i===`..`||i===`.`)&&r.push(``);let a=n.length-1,o,s;for(o=0;o<r.length;o++)if(s=r[o],s!==`.`)if(s===`..`)a>1&&a--;else break;return n.slice(0,a).join(`/`)+`/`+r.slice(o).join(`/`)}var J={path:`/`,name:void 0,params:{},query:{},hash:``,fullPath:`/`,matched:[],meta:{},redirectedFrom:void 0},Nr=function(e){return e.pop=`pop`,e.push=`push`,e}({}),Pr=function(e){return e.back=`back`,e.forward=`forward`,e.unknown=``,e}({});function Fr(e){if(!e)if(V){let t=document.querySelector(`base`);e=t&&t.getAttribute(`href`)||`/`,e=e.replace(/^\w+:\/\/[^\/]+/,``)}else e=`/`;return e[0]!==`/`&&e[0]!==`#`&&(e=`/`+e),wr(e)}var Ir=/^[^#]+#/;function Lr(e,t){return e.replace(Ir,`#`)+t}function Rr(e,t){let n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}var zr=()=>({left:window.scrollX,top:window.scrollY});function Br(e){let t;if(`el`in e){let n=e.el,r=typeof n==`string`&&n.startsWith(`#`),i=typeof n==`string`?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!i)return;t=Rr(i,e)}else t=e;`scrollBehavior`in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left==null?window.scrollX:t.left,t.top==null?window.scrollY:t.top)}function Vr(e,t){return(history.state?history.state.position-t:-1)+e}var Hr=new Map;function Ur(e,t){Hr.set(e,t)}function Wr(e){let t=Hr.get(e);return Hr.delete(e),t}function Gr(e){return typeof e==`string`||e&&typeof e==`object`}function Kr(e){return typeof e==`string`||typeof e==`symbol`}function qr(e){let t={};if(e===``||e===`?`)return t;let n=(e[0]===`?`?e.slice(1):e).split(`&`);for(let e=0;e<n.length;++e){let r=n[e].replace(sr,` `),i=r.indexOf(`=`),a=Sr(i<0?r:r.slice(0,i)),o=i<0?null:Sr(r.slice(i+1));if(a in t){let e=t[a];U(e)||(e=t[a]=[e]),e.push(o)}else t[a]=o}return t}function Jr(e){let t=``;for(let n in e){let r=e[n];if(n=yr(n),r==null){r!==void 0&&(t+=(t.length?`&`:``)+n);continue}(U(r)?r.map(e=>e&&vr(e)):[r&&vr(r)]).forEach(e=>{e!==void 0&&(t+=(t.length?`&`:``)+n,e!=null&&(t+=`=`+e))})}return t}function Yr(e){let t={};for(let n in e){let r=e[n];r!==void 0&&(t[n]=U(r)?r.map(e=>e==null?null:``+e):r==null?r:``+r)}return t}function Y(){let e=[];function t(t){return e.push(t),()=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function X(e,t,n,r,i,a=e=>e()){let o=r&&(r.enterCallbacks[i]=r.enterCallbacks[i]||[]);return()=>new Promise((s,c)=>{let l=e=>{e===!1?c(G(W.NAVIGATION_ABORTED,{from:n,to:t})):e instanceof Error?c(e):Gr(e)?c(G(W.NAVIGATION_GUARD_REDIRECT,{from:t,to:e})):(o&&r.enterCallbacks[i]===o&&typeof e==`function`&&o.push(e),s())},u=a(()=>e.call(r&&r.instances[i],t,n,l)),d=Promise.resolve(u);e.length<3&&(d=d.then(l)),d.catch(e=>c(e))})}function Xr(e,t,n,r,i=e=>e()){let a=[];for(let o of e)for(let e in o.components){let s=o.components[e];if(!(t!==`beforeRouteEnter`&&!o.instances[e]))if(Gn(s)){let c=(s.__vccOpts||s)[t];c&&a.push(X(c,n,r,o,e,i))}else{let c=s();a.push(()=>c.then(a=>{if(!a)throw Error(`Couldn't resolve component "${e}" at "${o.path}"`);let s=Kn(a)?a.default:a;o.mods[e]=a,o.components[e]=s;let c=(s.__vccOpts||s)[t];return c&&X(c,n,r,o,e,i)()}))}}return a}function Zr(e,t){let n=[],r=[],i=[],a=Math.max(t.matched.length,e.matched.length);for(let o=0;o<a;o++){let a=t.matched[o];a&&(e.matched.find(e=>q(e,a))?r.push(a):n.push(a));let s=e.matched[o];s&&(t.matched.find(e=>q(e,s))||i.push(s))}return[n,r,i]}var Qr=()=>location.protocol+`//`+location.host;function $r(e,t){let{pathname:n,search:r,hash:i}=t,a=e.indexOf(`#`);if(a>-1){let t=i.includes(e.slice(a))?e.slice(a).length:1,n=i.slice(t);return n[0]!==`/`&&(n=`/`+n),Dr(n,``)}return Dr(n,e)+r+i}function ei(e,t,n,r){let i=[],a=[],o=null,s=({state:a})=>{let s=$r(e,location),c=n.value,l=t.value,u=0;if(a){if(n.value=s,t.value=a,o&&o===c){o=null;return}u=l?a.position-l.position:0}else r(s);i.forEach(e=>{e(n.value,c,{delta:u,type:Nr.pop,direction:u?u>0?Pr.forward:Pr.back:Pr.unknown})})};function c(){o=n.value}function l(e){i.push(e);let t=()=>{let t=i.indexOf(e);t>-1&&i.splice(t,1)};return a.push(t),t}function u(){if(document.visibilityState===`hidden`){let{history:e}=window;if(!e.state)return;e.replaceState(H({},e.state,{scroll:zr()}),``)}}function d(){for(let e of a)e();a=[],window.removeEventListener(`popstate`,s),window.removeEventListener(`pagehide`,u),document.removeEventListener(`visibilitychange`,u)}return window.addEventListener(`popstate`,s),window.addEventListener(`pagehide`,u),document.addEventListener(`visibilitychange`,u),{pauseListeners:c,listen:l,destroy:d}}function ti(e,t,n,r=!1,i=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:i?zr():null}}function ni(e){let{history:t,location:n}=window,r={value:$r(e,n)},i={value:t.state};i.value||a(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function a(r,a,o){let s=e.indexOf(`#`),c=s>-1?(n.host&&document.querySelector(`base`)?e:e.slice(s))+r:Qr()+e+r;try{t[o?`replaceState`:`pushState`](a,``,c),i.value=a}catch(e){console.error(e),n[o?`replace`:`assign`](c)}}function o(e,n){a(e,H({},t.state,ti(i.value.back,e,i.value.forward,!0),n,{position:i.value.position}),!0),r.value=e}function s(e,n){let o=H({},i.value,t.state,{forward:e,scroll:zr()});a(o.current,o,!0),a(e,H({},ti(r.value,e,null),{position:o.position+1},n),!1),r.value=e}return{location:r,state:i,push:s,replace:o}}function ri(e){e=Fr(e);let t=ni(e),n=ei(e,t.state,t.location,t.replace);function r(e,t=!0){t||n.pauseListeners(),history.go(e)}let i=H({location:``,base:e,go:r,createHref:Lr.bind(null,e)},t,n);return Object.defineProperty(i,`location`,{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(i,`state`,{enumerable:!0,get:()=>t.state.value}),i}function ii(e){return e=location.host?e||location.pathname+location.search:``,e.includes(`#`)||(e+=`#`),ri(e)}var Z=function(e){return e[e.Static=0]=`Static`,e[e.Param=1]=`Param`,e[e.Group=2]=`Group`,e}({}),Q=function(e){return e[e.Static=0]=`Static`,e[e.Param=1]=`Param`,e[e.ParamRegExp=2]=`ParamRegExp`,e[e.ParamRegExpEnd=3]=`ParamRegExpEnd`,e[e.EscapeNext=4]=`EscapeNext`,e}(Q||{}),ai={type:Z.Static,value:``},oi=/[a-zA-Z0-9_]/;function si(e){if(!e)return[[]];if(e===`/`)return[[ai]];if(!e.startsWith(`/`))throw Error(`Invalid path "${e}"`);function t(e){throw Error(`ERR (${n})/"${l}": ${e}`)}let n=Q.Static,r=n,i=[],a;function o(){a&&i.push(a),a=[]}let s=0,c,l=``,u=``;function d(){l&&=(n===Q.Static?a.push({type:Z.Static,value:l}):n===Q.Param||n===Q.ParamRegExp||n===Q.ParamRegExpEnd?(a.length>1&&(c===`*`||c===`+`)&&t(`A repeatable param (${l}) must be alone in its segment. eg: '/:ids+.`),a.push({type:Z.Param,value:l,regexp:u,repeatable:c===`*`||c===`+`,optional:c===`*`||c===`?`})):t(`Invalid state to consume buffer`),``)}function f(){l+=c}for(;s<e.length;){if(c=e[s++],c===`\\`&&n!==Q.ParamRegExp){r=n,n=Q.EscapeNext;continue}switch(n){case Q.Static:c===`/`?(l&&d(),o()):c===`:`?(d(),n=Q.Param):f();break;case Q.EscapeNext:f(),n=r;break;case Q.Param:c===`(`?n=Q.ParamRegExp:oi.test(c)?f():(d(),n=Q.Static,c!==`*`&&c!==`?`&&c!==`+`&&s--);break;case Q.ParamRegExp:c===`)`?u[u.length-1]==`\\`?u=u.slice(0,-1)+c:n=Q.ParamRegExpEnd:u+=c;break;case Q.ParamRegExpEnd:d(),n=Q.Static,c!==`*`&&c!==`?`&&c!==`+`&&s--,u=``;break;default:t(`Unknown state`);break}}return n===Q.ParamRegExp&&t(`Unfinished custom RegExp for param "${l}"`),d(),o(),i}var ci=`[^/]+?`,li={sensitive:!1,strict:!1,start:!0,end:!0},$=function(e){return e[e._multiplier=10]=`_multiplier`,e[e.Root=90]=`Root`,e[e.Segment=40]=`Segment`,e[e.SubSegment=30]=`SubSegment`,e[e.Static=40]=`Static`,e[e.Dynamic=20]=`Dynamic`,e[e.BonusCustomRegExp=10]=`BonusCustomRegExp`,e[e.BonusWildcard=-50]=`BonusWildcard`,e[e.BonusRepeatable=-20]=`BonusRepeatable`,e[e.BonusOptional=-8]=`BonusOptional`,e[e.BonusStrict=.7000000000000001]=`BonusStrict`,e[e.BonusCaseSensitive=.25]=`BonusCaseSensitive`,e}($||{}),ui=/[.+*?^${}()[\]/\\]/g;function di(e,t){let n=H({},li,t),r=[],i=n.start?`^`:``,a=[];for(let t of e){let e=t.length?[]:[$.Root];n.strict&&!t.length&&(i+=`/`);for(let r=0;r<t.length;r++){let o=t[r],s=$.Segment+(n.sensitive?$.BonusCaseSensitive:0);if(o.type===Z.Static)r||(i+=`/`),i+=o.value.replace(ui,`\\$&`),s+=$.Static;else if(o.type===Z.Param){let{value:e,repeatable:n,optional:c,regexp:l}=o;a.push({name:e,repeatable:n,optional:c});let u=l||ci;if(u!==ci){s+=$.BonusCustomRegExp;try{RegExp(`(${u})`)}catch(t){throw Error(`Invalid custom RegExp for param "${e}" (${u}): `+t.message)}}let d=n?`((?:${u})(?:/(?:${u}))*)`:`(${u})`;r||(d=c&&t.length<2?`(?:/${d})`:`/`+d),c&&(d+=`?`),i+=d,s+=$.Dynamic,c&&(s+=$.BonusOptional),n&&(s+=$.BonusRepeatable),u===`.*`&&(s+=$.BonusWildcard)}e.push(s)}r.push(e)}if(n.strict&&n.end){let e=r.length-1;r[e][r[e].length-1]+=$.BonusStrict}n.strict||(i+=`/?`),n.end?i+=`$`:n.strict&&!i.endsWith(`/`)&&(i+=`(?:/|$)`);let o=new RegExp(i,n.sensitive?``:`i`);function s(e){let t=e.match(o),n={};if(!t)return null;for(let e=1;e<t.length;e++){let r=t[e]||``,i=a[e-1];n[i.name]=r&&i.repeatable?r.split(`/`):r}return n}function c(t){let n=``,r=!1;for(let i of e){(!r||!n.endsWith(`/`))&&(n+=`/`),r=!1;for(let e of i)if(e.type===Z.Static)n+=e.value;else if(e.type===Z.Param){let{value:a,repeatable:o,optional:s}=e,c=a in t?t[a]:``;if(U(c)&&!o)throw Error(`Provided param "${a}" is an array but it is not repeatable (* or + modifiers)`);let l=U(c)?c.join(`/`):c;if(!l)if(s)i.length<2&&(n.endsWith(`/`)?n=n.slice(0,-1):r=!0);else throw Error(`Missing required param "${a}"`);n+=l}}return n||`/`}return{re:o,score:r,keys:a,parse:s,stringify:c}}function fi(e,t){let n=0;for(;n<e.length&&n<t.length;){let r=t[n]-e[n];if(r)return r;n++}return e.length<t.length?e.length===1&&e[0]===$.Static+$.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===$.Static+$.Segment?1:-1:0}function pi(e,t){let n=0,r=e.score,i=t.score;for(;n<r.length&&n<i.length;){let e=fi(r[n],i[n]);if(e)return e;n++}if(Math.abs(i.length-r.length)===1){if(mi(r))return 1;if(mi(i))return-1}return i.length-r.length}function mi(e){let t=e[e.length-1];return e.length>0&&t[t.length-1]<0}var hi={strict:!1,end:!0,sensitive:!1};function gi(e,t,n){let r=H(di(si(e.path),n),{record:e,parent:t,children:[],alias:[]});return t&&!r.record.aliasOf==!t.record.aliasOf&&t.children.push(r),r}function _i(e,t){let n=[],r=new Map;t=Yn(hi,t);function i(e){return r.get(e)}function a(e,n,r){let i=!r,s=yi(e);s.aliasOf=r&&r.record;let l=Yn(t,e),u=[s];if(`alias`in e){let t=typeof e.alias==`string`?[e.alias]:e.alias;for(let e of t)u.push(yi(H({},s,{components:r?r.record.components:s.components,path:e,aliasOf:r?r.record:s})))}let d,f;for(let t of u){let{path:u}=t;if(n&&u[0]!==`/`){let e=n.record.path,r=e[e.length-1]===`/`?``:`/`;t.path=n.record.path+(u&&r+u)}if(d=gi(t,n,l),r?r.alias.push(d):(f||=d,f!==d&&f.alias.push(d),i&&e.name&&!xi(d)&&o(e.name)),Ti(d)&&c(d),s.children){let e=s.children;for(let t=0;t<e.length;t++)a(e[t],d,r&&r.children[t])}r||=d}return f?()=>{o(f)}:Jn}function o(e){if(Kr(e)){let t=r.get(e);t&&(r.delete(e),n.splice(n.indexOf(t),1),t.children.forEach(o),t.alias.forEach(o))}else{let t=n.indexOf(e);t>-1&&(n.splice(t,1),e.record.name&&r.delete(e.record.name),e.children.forEach(o),e.alias.forEach(o))}}function s(){return n}function c(e){let t=Ci(e,n);n.splice(t,0,e),e.record.name&&!xi(e)&&r.set(e.record.name,e)}function l(e,t){let i,a={},o,s;if(`name`in e&&e.name){if(i=r.get(e.name),!i)throw G(W.MATCHER_NOT_FOUND,{location:e});s=i.record.name,a=H(vi(t.params,i.keys.filter(e=>!e.optional).concat(i.parent?i.parent.keys.filter(e=>e.optional):[]).map(e=>e.name)),e.params&&vi(e.params,i.keys.map(e=>e.name))),o=i.stringify(a)}else if(e.path!=null)o=e.path,i=n.find(e=>e.re.test(o)),i&&(a=i.parse(o),s=i.record.name);else{if(i=t.name?r.get(t.name):n.find(e=>e.re.test(t.path)),!i)throw G(W.MATCHER_NOT_FOUND,{location:e,currentLocation:t});s=i.record.name,a=H({},t.params,e.params),o=i.stringify(a)}let c=[],l=i;for(;l;)c.unshift(l.record),l=l.parent;return{name:s,path:o,params:a,matched:c,meta:Si(c)}}e.forEach(e=>a(e));function u(){n.length=0,r.clear()}return{addRoute:a,resolve:l,removeRoute:o,clearRoutes:u,getRoutes:s,getRecordMatcher:i}}function vi(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function yi(e){let t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:bi(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:`components`in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,`mods`,{value:{}}),t}function bi(e){let t={},n=e.props||!1;if(`component`in e)t.default=n;else for(let r in e.components)t[r]=typeof n==`object`?n[r]:n;return t}function xi(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Si(e){return e.reduce((e,t)=>H(e,t.meta),{})}function Ci(e,t){let n=0,r=t.length;for(;n!==r;){let i=n+r>>1;pi(e,t[i])<0?r=i:n=i+1}let i=wi(e);return i&&(r=t.lastIndexOf(i,r-1)),r}function wi(e){let t=e;for(;t=t.parent;)if(Ti(t)&&pi(e,t)===0)return t}function Ti({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Ei(e){let t=f($n),n=f(er),r=b(()=>{let n=o(e.to);return t.resolve(n)}),i=b(()=>{let{matched:e}=r.value,{length:t}=e,i=e[t-1],a=n.matched;if(!i||!a.length)return-1;let o=a.findIndex(q.bind(null,i));if(o>-1)return o;let s=ji(e[t-2]);return t>1&&ji(i)===s&&a[a.length-1].path!==s?a.findIndex(q.bind(null,e[t-2])):o}),a=b(()=>i.value>-1&&Ai(n.params,r.value.params)),s=b(()=>i.value>-1&&i.value===n.matched.length-1&&kr(n.params,r.value.params));function c(n={}){if(ki(n)){let n=t[o(e.replace)?`replace`:`push`](o(e.to)).catch(Jn);return e.viewTransition&&typeof document<`u`&&`startViewTransition`in document&&document.startViewTransition(()=>n),n}return Promise.resolve()}return{route:r,href:b(()=>r.value.href),isActive:a,isExactActive:s,navigate:c}}function Di(e){return e.length===1?e[0]:e}var Oi=m({name:`RouterLink`,compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:`page`},viewTransition:Boolean},useLink:Ei,setup(e,{slots:t}){let n=w(Ei(e)),{options:r}=f($n),i=b(()=>({[Mi(e.activeClass,r.linkActiveClass,`router-link-active`)]:n.isActive,[Mi(e.exactActiveClass,r.linkExactActiveClass,`router-link-exact-active`)]:n.isExactActive}));return()=>{let r=t.default&&Di(t.default(n));return e.custom?r:s(`a`,{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:i.value},r)}}});function ki(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){let t=e.currentTarget.getAttribute(`target`);if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function Ai(e,t){for(let n in t){let r=t[n],i=e[n];if(typeof r==`string`){if(r!==i)return!1}else if(!U(i)||i.length!==r.length||r.some((e,t)=>e.valueOf()!==i[t].valueOf()))return!1}return!0}function ji(e){return e?e.aliasOf?e.aliasOf.path:e.path:``}var Mi=(e,t,n)=>e??t??n,Ni=m({name:`RouterView`,inheritAttrs:!1,props:{name:{type:String,default:`default`},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){let r=f(tr),i=b(()=>e.route||r.value),a=f(Qn,0),c=b(()=>{let e=o(a),{matched:t}=i.value,n;for(;(n=t[e])&&!n.components;)e++;return e}),l=b(()=>i.value.matched[c.value]);y(Qn,b(()=>c.value+1)),y(Zn,l),y(tr,i);let u=x();return oe(()=>[u.value,l.value,e.name],([e,t,n],[r,i,a])=>{t&&(t.instances[n]=e,i&&i!==t&&e&&e===r&&(t.leaveGuards.size||(t.leaveGuards=i.leaveGuards),t.updateGuards.size||(t.updateGuards=i.updateGuards))),e&&t&&(!i||!q(t,i)||!r)&&(t.enterCallbacks[n]||[]).forEach(t=>t(e))},{flush:`post`}),()=>{let r=i.value,a=e.name,o=l.value,c=o&&o.components[a];if(!c)return Pi(n.default,{Component:c,route:r});let d=o.props[a],f=s(c,H({},d?d===!0?r.params:typeof d==`function`?d(r):d:null,t,{onVnodeUnmounted:e=>{e.component.isUnmounted&&(o.instances[a]=null)},ref:u}));return Pi(n.default,{Component:f,route:r})||f}}});function Pi(e,t){if(!e)return null;let n=e(t);return n.length===1?n[0]:n}var Fi=Ni;function Ii(e){let n=_i(e.routes,e),r=e.parseQuery||qr,i=e.stringifyQuery||Jr,a=e.history,s=Y(),c=Y(),l=Y(),u=ne(J),d=J;V&&e.scrollBehavior&&`scrollRestoration`in history&&(history.scrollRestoration=`manual`);let f=qn.bind(null,e=>``+e),p=qn.bind(null,xr),m=qn.bind(null,Sr);function ee(e,t){let r,i;return Kr(e)?(r=n.getRecordMatcher(e),i=t):i=e,n.addRoute(i,r)}function h(e){let t=n.getRecordMatcher(e);t&&n.removeRoute(t)}function te(){return n.getRoutes().map(e=>e.record)}function g(e){return!!n.getRecordMatcher(e)}function _(e,t){if(t=H({},t||u.value),typeof e==`string`){let i=Tr(r,e,t.path),o=n.resolve({path:i.path},t),s=a.createHref(i.fullPath);return H(i,o,{params:m(o.params),hash:Sr(i.hash),redirectedFrom:void 0,href:s})}let o;if(e.path!=null)o=H({},e,{path:Tr(r,e.path,t.path).path});else{let n=H({},e.params);for(let e in n)n[e]??delete n[e];o=H({},e,{params:p(n)}),t.params=p(t.params)}let s=n.resolve(o,t),c=e.hash||``;s.params=f(m(s.params));let l=Er(i,H({},e,{hash:_r(c),path:s.path})),d=a.createHref(l);return H({fullPath:l,hash:c,query:i===Jr?Yr(e.query):e.query||{}},s,{redirectedFrom:void 0,href:d})}function v(e){return typeof e==`string`?Tr(r,e,u.value.path):H({},e)}function re(e,t){if(d!==e)return G(W.NAVIGATION_CANCELLED,{from:t,to:e})}function y(e){return S(e)}function b(e){return y(H(v(e),{replace:!0}))}function x(e,t){let n=e.matched[e.matched.length-1];if(n&&n.redirect){let{redirect:r}=n,i=typeof r==`function`?r(e,t):r;return typeof i==`string`&&(i=i.includes(`?`)||i.includes(`#`)?i=v(i):{path:i},i.params={}),H({query:e.query,hash:e.hash,params:i.path==null?e.params:{}},i)}}function S(e,t){let n=d=_(e),r=u.value,a=e.state,o=e.force,s=e.replace===!0,c=x(n,r);if(c)return S(H(v(c),{state:typeof c==`object`?H({},a,c.state):a,force:o,replace:s}),t||n);let l=n;l.redirectedFrom=t;let f;return!o&&Or(i,r,n)&&(f=G(W.NAVIGATION_DUPLICATED,{to:l,from:r}),O(r,r,!0,!1)),(f?Promise.resolve(f):ae(l,r)).catch(e=>K(e)?K(e,W.NAVIGATION_GUARD_REDIRECT)?e:fe(e):ue(e,l,r)).then(e=>{if(e){if(K(e,W.NAVIGATION_GUARD_REDIRECT))return S(H({replace:s},v(e.to),{state:typeof e.to==`object`?H({},a,e.to.state):a,force:o}),t||l)}else e=se(l,r,!0,s,a);return oe(l,r,e),e})}function ie(e,t){let n=re(e,t);return n?Promise.reject(n):Promise.resolve()}function C(e){let t=k.values().next().value;return t&&typeof t.runWithContext==`function`?t.runWithContext(e):e()}function ae(e,t){let n,[r,i,a]=Zr(e,t);n=Xr(r.reverse(),`beforeRouteLeave`,e,t);for(let i of r)i.leaveGuards.forEach(r=>{n.push(X(r,e,t))});let o=ie.bind(null,e,t);return n.push(o),j(n).then(()=>{n=[];for(let r of s.list())n.push(X(r,e,t));return n.push(o),j(n)}).then(()=>{n=Xr(i,`beforeRouteUpdate`,e,t);for(let r of i)r.updateGuards.forEach(r=>{n.push(X(r,e,t))});return n.push(o),j(n)}).then(()=>{n=[];for(let r of a)if(r.beforeEnter)if(U(r.beforeEnter))for(let i of r.beforeEnter)n.push(X(i,e,t));else n.push(X(r.beforeEnter,e,t));return n.push(o),j(n)}).then(()=>(e.matched.forEach(e=>e.enterCallbacks={}),n=Xr(a,`beforeRouteEnter`,e,t,C),n.push(o),j(n))).then(()=>{n=[];for(let r of c.list())n.push(X(r,e,t));return n.push(o),j(n)}).catch(e=>K(e,W.NAVIGATION_CANCELLED)?e:Promise.reject(e))}function oe(e,t,n){l.list().forEach(r=>C(()=>r(e,t,n)))}function se(e,t,n,r,i){let o=re(e,t);if(o)return o;let s=t===J,c=V?history.state:{};n&&(r||s?a.replace(e.fullPath,H({scroll:s&&c&&c.scroll},i)):a.push(e.fullPath,i)),u.value=e,O(e,t,n,s),fe()}let w;function le(){w||=a.listen((e,t,n)=>{if(!A.listening)return;let r=_(e),i=x(r,A.currentRoute.value);if(i){S(H(i,{replace:!0,force:!0}),r).catch(Jn);return}d=r;let o=u.value;V&&Ur(Vr(o.fullPath,n.delta),zr()),ae(r,o).catch(e=>K(e,W.NAVIGATION_ABORTED|W.NAVIGATION_CANCELLED)?e:K(e,W.NAVIGATION_GUARD_REDIRECT)?(S(H(v(e.to),{force:!0}),r).then(e=>{K(e,W.NAVIGATION_ABORTED|W.NAVIGATION_DUPLICATED)&&!n.delta&&n.type===Nr.pop&&a.go(-1,!1)}).catch(Jn),Promise.reject()):(n.delta&&a.go(-n.delta,!1),ue(e,r,o))).then(e=>{e||=se(r,o,!1),e&&(n.delta&&!K(e,W.NAVIGATION_CANCELLED)?a.go(-n.delta,!1):n.type===Nr.pop&&K(e,W.NAVIGATION_ABORTED|W.NAVIGATION_DUPLICATED)&&a.go(-1,!1)),oe(r,o,e)}).catch(Jn)})}let T=Y(),E=Y(),D;function ue(e,t,n){fe(e);let r=E.list();return r.length?r.forEach(r=>r(e,t,n)):console.error(e),Promise.reject(e)}function de(){return D&&u.value!==J?Promise.resolve():new Promise((e,t)=>{T.add([e,t])})}function fe(e){return D||(D=!e,le(),T.list().forEach(([t,n])=>e?n(e):t()),T.reset()),e}function O(n,r,i,a){let{scrollBehavior:o}=e;if(!V||!o)return Promise.resolve();let s=!i&&Wr(Vr(n.fullPath,0))||(a||!i)&&history.state&&history.state.scroll||null;return t().then(()=>o(n,r,s)).then(e=>e&&Br(e)).catch(e=>ue(e,n,r))}let pe=e=>a.go(e),me,k=new Set,A={currentRoute:u,listening:!0,addRoute:ee,removeRoute:h,clearRoutes:n.clearRoutes,hasRoute:g,getRoutes:te,resolve:_,options:e,push:y,replace:b,go:pe,back:()=>pe(-1),forward:()=>pe(1),beforeEach:s.add,beforeResolve:c.add,afterEach:l.add,onError:E.add,isReady:de,install(e){e.component(`RouterLink`,Oi),e.component(`RouterView`,Fi),e.config.globalProperties.$router=A,Object.defineProperty(e.config.globalProperties,`$route`,{enumerable:!0,get:()=>o(u)}),V&&!me&&u.value===J&&(me=!0,y(a.location).catch(e=>{}));let t={};for(let e in J)Object.defineProperty(t,e,{get:()=>u.value[e],enumerable:!0});e.provide($n,A),e.provide(er,ce(t)),e.provide(tr,u);let n=e.unmount;k.add(e),e.unmount=function(){k.delete(e),k.size<1&&(d=J,w&&w(),w=null,u.value=J,me=!1,D=!1),n()}}};function j(e){return e.reduce((e,t)=>e.then(()=>C(t)),Promise.resolve())}return A}var Li=(e,t)=>({default:()=>e?s(_e,e===!0?{}:e,t):t.default?.()}),Ri=/(:\w+)\([^)]+\)/g,zi=/(:\w+)[?+*]/g,Bi=/:\w+/g;function Vi(e){let t=e?.meta.key??e.path.replace(Ri,`$1`).replace(zi,`$1`).replace(Bi,t=>e.params[t.slice(1)]?.toString()||``);return typeof t==`function`?t(e):t}function Hi(e,t){return e===t||t===J?!1:Vi(e)===Vi(t)?!e.matched.every((e,n)=>e.components&&e.components.default===t.matched[n]?.components?.default):!0}function Ui(e){return Array.isArray(e)?e:[e]}function Wi(e){let t=[];for(let n of e)n&&t.push({...n,onAfterLeave:n.onAfterLeave?Ui(n.onAfterLeave):void 0,onBeforeLeave:n.onBeforeLeave?Ui(n.onBeforeLeave):void 0});return Cn(...t)}var Gi={scrollBehavior(e,t,n){let r=S(),i=B().options?.scrollBehaviorType??`auto`;return e.path.replace(/\/$/,``)===t.path.replace(/\/$/,``)?t.hash&&!e.hash?{left:0,top:0}:e.hash?{el:e.hash,top:Ki(e.hash),behavior:i}:!1:(typeof e.meta.scrollToTop==`function`?e.meta.scrollToTop(e,t):e.meta.scrollToTop)===!1?!1:t===J?qi(e,t,n,i):new Promise(a=>{let o=()=>{requestAnimationFrame(()=>a(qi(e,t,n,i)))};r.hooks.hookOnce(`page:loading:end`,()=>{let e=r[`~transitionPromise`];e?e.then(o):o()})})}};function Ki(e){try{let t=document.querySelector(e);if(t)return(Number.parseFloat(getComputedStyle(t).scrollMarginTop)||0)+(Number.parseFloat(getComputedStyle(document.documentElement).scrollPaddingTop)||0)}catch{}return 0}function qi(e,t,n,r){if(n)return n;let i=Hi(e,t);return e.hash?{el:e.hash,top:Ki(e.hash),behavior:i?r:`instant`}:{left:0,top:0}}var Ji={hashMode:!1,scrollBehaviorType:`auto`,...Gi},Yi=globalThis.requestIdleCallback||(e=>{let t=Date.now(),n={didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-t))};return setTimeout(()=>{e(n)},1)}),Xi=globalThis.cancelIdleCallback||(e=>{clearTimeout(e)}),Zi=e=>{let t=S();t.isHydrating?t.hooks.hookOnce(`app:suspense:resolve`,()=>{Yi(()=>e())}):Yi(()=>e())};function Qi(e){if(e?.__asyncLoader&&!e.__asyncResolved)return e.__asyncLoader()}async function $i(e,t=B()){let{path:n,matched:r}=t.resolve(e);if(!r.length||(t._routePreloaded||=new Set,t._routePreloaded.has(n)))return;let i=t._preloadPromises||=[];if(i.length>4)return Promise.all(i).then(()=>$i(e,t));t._routePreloaded.add(n);for(let e of r){let t=e.components?.default;if(typeof t!=`function`)continue;let n=Promise.resolve(t()).catch(()=>{}).finally(()=>i.splice(i.indexOf(n),1));i.push(n)}await Promise.all(i)}export{pn as A,xt as B,Nn as C,R as D,Mn as E,ln as F,Me as H,z as I,kt as L,cn as M,un as N,hn as O,sn as P,_e as R,Ln as S,jn as T,mt as U,lt as V,ft as W,Vn as _,Yi as a,Rn as b,Li as c,ii as d,ri as f,Un as g,Wn as h,Xi as i,Yt as j,mn as k,Fi as l,Hn as m,$i as n,Ji as o,J as p,Zi as r,Wi as s,Qi as t,Ii as u,Bn as v,B as w,In as x,Pn as y,bt as z};
@@ -1 +1 @@
1
- import{F as e,Ht as t,M as n,b as r,q as i,w as a}from"./CEtF9LWU.js";import{s as o,t as s}from"./kJJURm8F.js";var c=[`title`],l=Object.assign(n({__name:`FileIcon`,props:{filename:{}},setup(e){let n=e,s=r(()=>o(n.filename));return(e,n)=>(i(),a(`div`,{"flex-none":``,"icon-catppuccin":``,title:s.value.description||s.value.name,class:t([s.value.icon])},null,10,c))}}),{__name:`DisplayFileIcon`}),u=n({name:`HighlightedPath`,props:{path:{type:String,required:!0},minimal:{type:Boolean,default:!1}},setup(t){return()=>{let n=t.path.split(/([?/&:=])/g),r=`path`,i=n.map(()=>[]),a=n.map(()=>[]),o=n.map(t=>e(`span`,{class:``},t)),c=new Set;return n.forEach((e,l)=>{if(e===`?`&&(r=`query`),r===`path`){if(/^\.+$/.test(e)||e===`/`?i[l]?.push(`op50`):(e===`node_modules`||e===`dist`||e===`lib`||/^\.\w/.test(e))&&i[l]?.push(`op60`),e===`node_modules`&&t.minimal)for(let e=0;e<l+2;e++)c.add(e);if(e===`.pnpm`&&(o[l]&&(o[l].children=`~`,i[l]?.push(`op25!`),i[l-1]?.push(`op25!`)),c.add(l+1),c.add(l+2),i[l+3]?.push(`op25!`),o[l+4]?.children===`node_modules`&&(c.add(l+3),c.add(l+4),i[l+5]?.push(`op25!`))),e===`:`&&(o[l-1]&&a[l-1]?.push(`color: ${s(n[l-1])}`),i[l]?.push(`op50`)),n[l-2]===`node_modules`&&!e.startsWith(`.`)){let t=`color: ${s(n[l])}`;a[l]?.push(t),e.startsWith(`@`)&&(a[l+1]?.push(t),a[l+2]?.push(t))}}r===`query`&&(e===`?`?i[l]?.push(`text-red-500 dark:text-red-400`):e===`&`&&i[l]?.push(`text-orange-500 dark:text-orange-400`),e===`=`?i[l]?.push(`text-orange-900 dark:text-orange-200 op50`):n[l+1]===`=`?i[l]?.push(`text-amber-900 dark:text-amber-200`):i[l]?.push(`text-orange-900 dark:text-orange-200`))}),o.forEach((e,t)=>{e.props&&(e.props.class=i[t]?.join(` `)??``,e.props.style=a[t]?.join(`;`)??``)}),Array.from(c).sort((e,t)=>t-e).forEach(e=>{o.splice(e,1)}),o}}});export{l as n,u as t};
1
+ import{F as e,Ht as t,M as n,b as r,q as i,w as a}from"./WOQUZE4V.js";import{s as o,t as s}from"./Du2TAFfS.js";var c=[`title`],l=Object.assign(n({__name:`FileIcon`,props:{filename:{}},setup(e){let n=e,s=r(()=>o(n.filename));return(e,n)=>(i(),a(`div`,{"flex-none":``,"icon-catppuccin":``,title:s.value.description||s.value.name,class:t([s.value.icon])},null,10,c))}}),{__name:`DisplayFileIcon`}),u=n({name:`HighlightedPath`,props:{path:{type:String,required:!0},minimal:{type:Boolean,default:!1}},setup(t){return()=>{let n=t.path.split(/([?/&:=])/g),r=`path`,i=n.map(()=>[]),a=n.map(()=>[]),o=n.map(t=>e(`span`,{class:``},t)),c=new Set;return n.forEach((e,l)=>{if(e===`?`&&(r=`query`),r===`path`){if(/^\.+$/.test(e)||e===`/`?i[l]?.push(`op50`):(e===`node_modules`||e===`dist`||e===`lib`||/^\.\w/.test(e))&&i[l]?.push(`op60`),e===`node_modules`&&t.minimal)for(let e=0;e<l+2;e++)c.add(e);if(e===`.pnpm`&&(o[l]&&(o[l].children=`~`,i[l]?.push(`op25!`),i[l-1]?.push(`op25!`)),c.add(l+1),c.add(l+2),i[l+3]?.push(`op25!`),o[l+4]?.children===`node_modules`&&(c.add(l+3),c.add(l+4),i[l+5]?.push(`op25!`))),e===`:`&&(o[l-1]&&a[l-1]?.push(`color: ${s(n[l-1])}`),i[l]?.push(`op50`)),n[l-2]===`node_modules`&&!e.startsWith(`.`)){let t=`color: ${s(n[l])}`;a[l]?.push(t),e.startsWith(`@`)&&(a[l+1]?.push(t),a[l+2]?.push(t))}}r===`query`&&(e===`?`?i[l]?.push(`text-red-500 dark:text-red-400`):e===`&`&&i[l]?.push(`text-orange-500 dark:text-orange-400`),e===`=`?i[l]?.push(`text-orange-900 dark:text-orange-200 op50`):n[l+1]===`=`?i[l]?.push(`text-amber-900 dark:text-amber-200`):i[l]?.push(`text-orange-900 dark:text-orange-200`))}),o.forEach((e,t)=>{e.props&&(e.props.class=i[t]?.join(` `)??``,e.props.style=a[t]?.join(`;`)??``)}),Array.from(c).sort((e,t)=>t-e).forEach(e=>{o.splice(e,1)}),o}}});export{l as n,u as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./Dnap40Ul.js";import{A as t,B as n,C as r,D as i,Et as a,Gt as o,Ht as s,M as c,S as l,Wt as u,Z as d,at as f,b as p,bt as m,et as h,h as g,k as _,lt as v,ot as y,q as b,st as x,ut as S,vt as C,w,x as T}from"./WOQUZE4V.js";import{C as E}from"./BeLy3b84.js";import{t as D}from"./B8a2SqNB.js";import{t as O}from"./n6uS-XK5.js";import{r as k}from"./B4F3iFfR.js";import{r as A,t as j}from"./hanhGz4p.js";import{a as M,p as N,u as P}from"./MtfbxdGf.js";import{i as F,t as ee}from"./B9VntNhm.js";import{n as I}from"./DVNjK2Kc.js";import{n as te,r as ne,t as L}from"./4NH8NIP0.js";import{a as re,c as ie,i as ae,n as R,o as z,r as oe,t as se}from"./C1yaj-Vm.js";import{t as ce}from"./BIN2apLJ2.js";import{n as le,r as ue,t as B}from"./Bpyx8FA-2.js";var V=[`onClick`],de=Object.assign(c({__name:`FlatList`,props:{chunks:{},session:{},link:{type:Boolean,default:!0},basic:{type:Boolean,default:!1}},emits:[`select`],setup(e,{emit:n}){let i=n;return(n,a)=>{let o=F;return b(),l(L,{items:e.chunks,"key-prop":`chunk_id`},{default:v(({item:n})=>[T(`div`,{flex:``,pb2:``,onClick:e=>i(`select`,n)},[t(o,{chunk:n,basic:e.basic,link:e.link,"w-full":``,"font-mono":``,border:`~ rounded base`,px2:``,py1:``,"text-sm":``,hover:`bg-active`,flex:`~ gap-4 items-center`},{"left-after":v(()=>[n.is_initial?(b(),l(k,{key:0,text:`initial`})):r(``,!0)]),_:2},1032,[`chunk`,`basic`,`link`])],8,V)]),_:1},8,[`items`])}}}),{__name:`ChunksFlatList`}),H={op50:``,"font-mono":``,w12:``},U=[`title`],W={flex:`~ gap-1 items-center`},fe=Object.assign(c({__name:`Graph`,props:{session:{},chunks:{},entryId:{default:``}},setup(e){let i=e,s=p(()=>i.chunks),c=E();return I({modules:s,spacing:{width:450,height:55,linkOffset:15,margin:120,gap:150},generateGraph:e=>{let{isFirstCalculateGraph:t,scale:r,spacing:o,tree:c,hierarchy:l,collapsedNodes:u,container:d,modulesMap:f,nodes:p,links:m,nodesMap:h,linksMap:g,width:_,height:v,childToParentMap:y}=e;return()=>{_.value=window.innerWidth,v.value=window.innerHeight;let e=s.value.filter(e=>i.entryId?e.id===i.entryId:e.reason===`entry`),b=new Set,x=l({module:{id:`~root`}},n=>`${n.module?.id}`==`~root`?(e.forEach(e=>{b.add(e),t.value&&y.set(e.id,`~root`)}),e.map(e=>({module:e,expanded:!u.has(e.id),hasChildren:!1}))):u.has(`${n.module?.id}`)?[]:n.module.imports?.map(e=>{let r=f.value.get(`${e.chunk_id}`);if(!(!r||b.has(r)))return t.value&&y.set(r.id,n.module.id),b.add(r),{module:r,expanded:!u.has(r.id),hasChildren:!1}}).filter(e=>e!==void 0));t.value&&=!1,c().nodeSize([a(o.height),a(o.width)+a(o.gap)])(x);let S=x.descendants();for(let e of S)[e.x,e.y]=[e.y-a(o.width),e.x];let C=Math.min(...S.map(e=>e.x)),w=Math.min(...S.map(e=>e.y));if(C<a(o.margin))for(let e of S)e.x+=Math.abs(C)+a(o.margin);if(w<a(o.margin))for(let e of S)e.y+=Math.abs(w)+a(o.margin);p.value=S,h.clear();for(let e of S)h.set(`${e.data.module.id}`,e);let T=x.links().filter(e=>`${e.source.data.module.id}`!=`~root`).map(e=>({...e,id:`${e.source.data.module.id}|${e.target.data.module.id}`})),E=s.value.flatMap(e=>e.imports.filter(t=>!T.some(n=>n.id===`${e.chunk_id}|${t.chunk_id}`)).map(t=>({source:h.get(`${e.chunk_id}`),target:h.get(`${t.chunk_id}`),id:`${e.chunk_id}|${t.chunk_id}`}))),D=[...T,...E];g.clear();for(let e of D)g.set(e.id,e);m.value=D,n(()=>{_.value=d.value.scrollWidth/r.value+a(o.margin),v.value=d.value.scrollHeight/r.value+a(o.margin)})}}}),(n,i)=>{let u=O,d=B;return b(),l(d,{session:e.session,modules:s.value,"expand-controls":!1},{default:v(({node:e})=>[t(u,{class:`flex items-center`,to:{path:a(c).path,query:{chunk:e.data.module.chunk_id}}},{default:v(()=>[T(`span`,H,`#`+o(e.data.module.id),1),T(`div`,{flex:`~ gap-2 items-center`,title:`Chunk #${e.data.module.id}`},[T(`div`,null,o(e.data.module.name||`[unnamed]`),1),t(k,{text:e.data.module.reason},null,8,[`text`]),e.data.module.is_initial?(b(),l(k,{key:0,text:`initial`})):r(``,!0)],8,U),i[1]||=T(`div`,{"flex-auto":``},null,-1),T(`div`,W,[i[0]||=T(`div`,{"i-ph-package-duotone":``},null,-1),_(` `+o(e.data.module.modules.length),1)])]),_:2},1032,[`to`])]),_:1},8,[`session`,`modules`])}}}),{__name:`ChunksGraph`}),G={grid:`~ cols-[max-content_1fr] gap-2`,p4:``},K={flex:`~ col gap-4`},q={key:0,grid:`~ cols-[250px_1fr] gap-1`},J=[`onClick`],Y={key:0,"text-primary":``},X={key:1},Z=[`onClick`],Q=[`title`],pe=Object.assign(c({__name:`Sunburst`,props:{graph:{},selected:{}},emits:[`select`],setup(e,{emit:n}){let i=e,s=n,c=f(`el`);return x(()=>c.value?.append(i.graph.el)),(n,i)=>{let l=R,f=A,p=h(`tooltip`);return b(),w(`div`,G,[T(`div`,{ref_key:`el`,ref:c,"w-500px":``},null,512),T(`div`,K,[t(l,{border:`b base`,py2:``,selected:e.selected,options:e.graph.options,onSelect:i[0]||=e=>s(`select`,e)},null,8,[`selected`,`options`]),e.selected?(b(),w(`div`,q,[(b(!0),w(g,null,d(e.selected.children,n=>(b(),w(g,{key:n.id},[T(`button`,{"ws-nowrap":``,"text-nowrap":``,"text-left":``,"overflow-hidden":``,"text-ellipsis":``,"text-sm":``,hover:`bg-active`,rounded:``,px2:``,onClick:e=>s(`select`,n)},[n.meta&&n.meta===e.selected?.meta?(b(),w(`span`,Y,`(self)`)):(b(),w(`span`,X,o(n.meta?.name||n.id),1))],8,J),T(`button`,{relative:``,flex:`~ gap-1 items-center`,hover:`bg-active`,rounded:``,onClick:e=>s(`select`,n)},[T(`div`,{"h-5":``,rounded:``,shadow:``,border:`~ base`,style:u({background:a(z)(e.graph.options.getColor?.(n)||`#000`),width:`${n.size/e.selected.size*100}%`})},null,4),t(f,{"text-xs":``,bytes:n.size,total:e.selected.size,"percent-ratio":3},null,8,[`bytes`,`total`]),n.children.length>0?S((b(),w(`div`,{key:0,title:`${n.children.length} modules`,"text-xs":``,"op-fade":``},[_(` (`+o(n.children.length)+`) `,1)],8,Q)),[[p,`${n.children.length} modules`]]):r(``,!0)],8,Z)],64))),128))])):r(``,!0)])])}}}),{__name:`ChunksSunburst`}),me=Object.assign(c({__name:`Flamegraph`,props:{graph:{}},setup(e){let t=e,n=f(`el`);return x(()=>n.value?.append(t.graph.el)),(e,t)=>(b(),w(`div`,{ref_key:`el`,ref:n},null,512))}}),{__name:`ChunksFlamegraph`}),he={sticky:``,"left-4":``,"right-4":``,"top-4":``,"z-panel-nav":``,"p-4":``},ge={key:0,h10:``,mr2:``,flex:`~ items-center`},_e={flex:`~ wrap gap-2 items-center`,p2:``,border:`t base`},ve=[`onClick`],ye={key:0,class:`px5 pt-4`,flex:`~ col gap-4`},be={key:1,class:`px5 pt-4`,flex:`~ col gap-4`},xe={key:3,flex:`~ col gap-2`},Se={key:4,flex:`~ col gap-2`,"pt-4":``},Ce={key:5,flex:`~ col gap-2`,"pt-4":``},we={key:0,border:`~ base rounded-lg`,"bg-base":``,p2:``,flex:`~ col gap-2`,"min-w-50":``,"shadow-lg":``},Te={flex:`~ gap-2 items-center`},Ee={truncate:``},De={flex:`~ gap-2 items-center`},Oe={key:0,flex:`~ gap-2 items-center`},ke={"text-xs":``},Ae={key:1,flex:`~ gap-2 items-center`},$=c({__name:`chunks`,props:{session:{}},setup(n){let c=n,u=C(P()),f=[{label:`List`,value:`list`,icon:`i-ph-list-bullets-duotone`},{label:`Detailed List`,value:`detailed-list`,icon:`i-ph-list-magnifying-glass-duotone`},{label:`Graph`,value:`graph`,icon:`i-ph-graph-duotone`},{label:`Treemap`,value:`treemap`,icon:`i-ph-checkerboard-duotone`},{label:`Sunburst`,value:`sunburst`,icon:`i-ph-chart-donut-duotone`},{label:`Flamegraph`,value:`flamegraph`,icon:`i-ph-chart-bar-horizontal-duotone`}],h=m({search:``}),x=e(),{state:S,isLoading:E}=M(async()=>await x.value.call(`vite:rolldown:get-chunks-graph`,{session:c.session.id}),null),O=p(()=>{let e=new Map;return S.value?.forEach(t=>{e.set(`${t.chunk_id}`,t)}),e}),F=p(()=>S.value?.map(e=>({...e,id:`${e.chunk_id}`}))??[]),I=N(()=>F.value,()=>new ne(F.value,{includeScore:!0,keys:[`name`],ignoreLocation:!0,threshold:.4})),L=p(()=>h.value.search?I.value.search(h.value.search).map(e=>e.item):F.value),{pathSelectorVisible:z,pathNodes:B,selectPathNodes:V,togglePathSelector:H,normalizedGraph:U}=ue({onToggle:e=>{h.value.search=e?!1:``},dataMap:p(()=>O.value),list:p(()=>L.value),importIdKey:`chunk_id`});function W(e){j.value.chunkViewType=e}let G=p(()=>{let e=new Map;for(let t of c.session.modulesList)e.set(t.id,t);return e});function K(e){return e.asset?.size?e.asset.size:e.modules.reduce((e,t)=>{let n=G.value.get(t);return!n||!n.buildMetrics?.transforms?.length?e:e+n.buildMetrics.transforms.at(-1).transformed_code_size},0)}let{tree:q,chartOptions:J,graph:Y,nodeHover:X,nodeSelected:Z,selectedNode:Q,selectNode:$,buildGraph:je}=se({data:p(()=>L.value.map(e=>({...e,filename:e.name||`chunk-${e.chunk_id}`,size:K(e)}))),nameKey:`filename`,sizeKey:`size`,rootText:`Chunks`,nodeType:`chunk`,graphOptions:{onClick(e){e&&(X.value=e)},onHover(e){e&&(X.value=e),e===null&&(X.value=void 0)},onLeave(){X.value=void 0},onSelect(e){Z.value=e||q.value.root,Q.value=e?.meta}},onUpdate(){switch(j.value.chunkViewType){case`sunburst`:Y.value=new ae(q.value.root,J.value);break;case`treemap`:Y.value=new re(q.value.root,{...J.value,selectedPaddingRatio:0});break;case`flamegraph`:Y.value=new oe(q.value.root,J.value);break}}});return y(()=>j.value.chunkViewType,()=>{[`treemap`,`sunburst`,`flamegraph`].includes(j.value.chunkViewType)&&je()}),(e,c)=>{let p=D,m=de,y=le,x=te,S=ee,C=fe,M=R,N=pe,P=me,F=A,I=ie;return a(E)?(b(),l(p,{key:0})):(b(),w(`div`,{key:1,relative:``,class:s({"max-h-screen of-hidden":a(j).chunkViewType===`graph`})},[T(`div`,he,[t(x,{modelValue:h.value,"onUpdate:modelValue":c[2]||=e=>h.value=e,rules:[]},i({"search-end":v(()=>[a(j).chunkViewType===`graph`?(b(),w(`div`,ge,[T(`button`,{"w-8":``,"h-8":``,"rounded-full":``,flex:``,"items-center":``,"justify-center":``,hover:`bg-active op100`,op50:``,title:`Graph Path Selector`,onClick:c[1]||=e=>a(H)(!0)},[...c[5]||=[T(`i`,{"i-ri:route-line":``,flex:``},null,-1)]])])):r(``,!0)]),default:v(()=>[T(`div`,_e,[c[6]||=T(`span`,{op50:``,pl2:``,"text-sm":``},`View as`,-1),(b(),w(g,null,d(f,e=>T(`button`,{key:e.value,"btn-action":``,class:s(a(j).chunkViewType===e.value?`bg-active`:`grayscale op50`),onClick:t=>W(e.value)},[T(`div`,{class:s(e.icon)},null,2),_(` `+o(e.label),1)],10,ve)),64))])]),_:2},[a(z)?{name:`search`,fn:v(()=>[t(y,{session:n.session,data:L.value,"import-id-key":`chunk_id`,"search-keys":[`name`],onSelect:a(V),onClose:c[0]||=e=>a(H)(!1)},{list:v(({select:e,data:r})=>[t(m,{session:n.session,chunks:r,link:!1,basic:!0,onSelect:e},null,8,[`session`,`chunks`,`onSelect`])]),item:v(({id:e})=>[_(o(O.value.get(e)?.name||`[unnamed]`),1)]),_:1},8,[`session`,`data`,`onSelect`])]),key:`0`}:void 0]),1032,[`modelValue`])]),a(j).chunkViewType===`list`?(b(),w(`div`,ye,[t(m,{session:n.session,chunks:L.value},null,8,[`session`,`chunks`])])):r(``,!0),a(j).chunkViewType===`detailed-list`?(b(),w(`div`,be,[(b(!0),w(g,null,d(L.value,e=>(b(),l(S,{key:e.id,border:`~ base rounded-lg`,p3:``,chunk:e,chunks:L.value,session:n.session},null,8,[`chunk`,`chunks`,`session`]))),128))])):a(j).chunkViewType===`graph`?(b(),l(C,{key:2,class:`pt32`,session:n.session,chunks:a(U),"entry-id":a(B).start},null,8,[`session`,`chunks`,`entry-id`])):a(j).chunkViewType===`treemap`?(b(),w(`div`,xe,[a(Y)?(b(),l(ce,{key:0,graph:a(Y),selected:a(Z),onSelect:c[3]||=e=>a($)(e)},{default:v(({selected:e,options:n,onSelect:r})=>[t(M,{border:`b base`,py2:``,"min-h-10":``,selected:e,options:n,onSelect:r},null,8,[`selected`,`options`,`onSelect`])]),_:1},8,[`graph`,`selected`])):r(``,!0)])):a(j).chunkViewType===`sunburst`?(b(),w(`div`,Se,[a(Y)?(b(),l(N,{key:0,graph:a(Y),selected:a(Z),onSelect:c[4]||=e=>a($)(e)},null,8,[`graph`,`selected`])):r(``,!0)])):a(j).chunkViewType===`flamegraph`?(b(),w(`div`,Ce,[a(Y)?(b(),l(P,{key:0,graph:a(Y)},null,8,[`graph`])):r(``,!0)])):r(``,!0),t(I,{"hover-x":u.x,"hover-y":u.y},{default:v(()=>[a(X)?.meta?(b(),w(`div`,we,[T(`div`,Te,[c[7]||=T(`i`,{"i-ph-shapes-duotone":``,"flex-none":``},null,-1),T(`span`,Ee,o(a(X).meta.name||`[unnamed]`),1)]),T(`div`,De,[c[8]||=T(`span`,{op50:``,"text-xs":``},`Size:`,-1),t(F,{bytes:a(X).meta.size,"text-xs":``},null,8,[`bytes`])]),a(X).meta.modules?.length?(b(),w(`div`,Oe,[c[9]||=T(`span`,{op50:``,"text-xs":``},`Modules:`,-1),T(`span`,ke,o(a(X).meta.modules?.length),1)])):r(``,!0),a(X).meta.is_initial?(b(),w(`div`,Ae,[t(k,{text:`initial`})])):r(``,!0)])):r(``,!0)]),_:1},8,[`hover-x`,`hover-y`])],2))}}});export{$ as default};
@@ -0,0 +1 @@
1
+ import{A as e,C as t,Et as n,G as r,Gt as i,Ht as a,M as o,Q as s,R as c,S as l,Ut as u,Wt as d,Z as f,b as p,bt as m,et as h,h as g,lt as _,ot as v,q as y,rt as b,ut as x,w as S,x as C,z as w}from"./WOQUZE4V.js";import{R as T,V as E,W as D}from"./BeLy3b84.js";import{n as O,r as k}from"./BPmpuG8C.js";import{p as A}from"./MtfbxdGf.js";import{a as j,c as M,i as N,o as ee,r as P,s as F,t as I}from"./DVNjK2Kc.js";import{r as L}from"./4NH8NIP0.js";var R={"flex-1":``,"w-0":``,"h-full":``},z={key:0,"w-full":``,"overflow-hidden":``,flex:`~ items-center`,border:`~ base rounded`,p1:``,relative:``},B={"overflow-hidden":``,"text-ellipsis":``,pr6:``,"w-0":``,"flex-1":``},V=[`placeholder`],H={class:`p2 w100`,flex:`~ col gap2`},U=Object.assign(o({__name:`PathSelectorItem`,props:c({selector:{},placeholder:{},session:{},data:{default:void 0},emptyStateText:{default:void 0},onClear:{type:Function,default:void 0}},{search:{required:!0},searchModifiers:{}}),emits:c([`clear`],[`update:search`]),setup(e,{emit:t}){let r=t,i=b(e,`search`);return(t,a)=>(y(),S(`div`,R,[e.selector.state.value.selected?(y(),S(`div`,z,[C(`div`,B,[s(t.$slots,`item`)]),C(`button`,{"i-carbon-clean":``,"text-4":``,hover:`op100`,op50:``,title:`Clear`,absolute:``,"right-2":``,onClick:a[0]||=e=>r(`clear`)})])):(y(),l(n(O),{key:1,distance:15,triggers:[`click`],"auto-hide":!1,delay:{show:300,hide:150},class:`h-full`},{popper:_(()=>[C(`div`,H,[e.data?.length?s(t.$slots,`list`,{key:0}):s(t.$slots,`empty`,{key:1})])]),default:_(()=>[x(C(`input`,{"onUpdate:modelValue":a[1]||=e=>i.value=e,py1:``,px4:``,"w-full":``,"h-full":``,border:`~ base rounded-1`,style:{outline:`none`},placeholder:e.placeholder,onBlur:a[2]||=(...e)=>n(k)&&n(k)(...e)},null,40,V),[[E,i.value]])]),_:3}))]))}}),{__name:`DataPathSelectorItem`});function W(e){let t=m({search:``,selected:null}),n=m(),r=p(e.getModules);function i(t){n.value=A(t,()=>new L(t.value,{includeScore:!0,keys:e.searchKeys||[`id`],ignoreLocation:!0,threshold:.4}))}function a(e){t.value.selected=e.id,t.value.search=``}function o(){t.value.selected=null}return{state:t,modules:r,fuse:n,initSelector:i,select:a,clear:o}}function G(e){let{onToggle:t,dataMap:n,list:r,importIdKey:i}=e,a=m(!1),o=m({start:``,end:``});function s(e){a.value=e??!a.value,t?.(a.value)}function c(e){o.value={start:e.start,end:e.end}}return{pathSelectorVisible:a,togglePathSelector:s,pathNodes:o,selectPathNodes:c,normalizedGraph:p(()=>{let{start:e,end:t}=o.value;if(!e&&!t)return r.value;let a=new Set,s=(e,t,n)=>{let r=[e],i=new Set,o=new Map([[`${e}`,[`${e}`]]]);for(;r.length>0;){let e=r.shift();i.has(e)||(i.add(e),n?e===n&&o.get(e)?.forEach(e=>a.add(e)):a.add(e),(!n||e!==n)&&t(e).forEach(t=>{i.has(`${t}`)||(r.push(`${t}`),n&&o.set(`${t}`,[...o.get(e)||[],`${t}`]))}))}};return e&&t?s(e,e=>n.value.get(e)?.imports.map(e=>e[i])||[],t):e&&s(e,e=>n.value.get(e)?.imports.map(e=>e[i])||[]),r.value.filter(e=>a.has(e.id)).map(t=>t.id===e?{...t,importers:[]}:t)})}}var K={h10:``,px4:``,p1:``,relative:``,flex:`~ gap2 items-center`},q={flex:`~ items-center gap2`,class:`flex-1 h-full`,"min-w-0":``},J={flex:`~ items-center justify-center`,"w-full":``,"h-20":``},Y={italic:``,op50:``},X=Object.assign(o({__name:`PathSelector`,props:{session:{},data:{},importIdKey:{},searchKeys:{}},emits:[`close`,`select`],setup(t,{emit:r}){let a=t,o=r,c=p(()=>{let e=new Map;return a.data.forEach(t=>{e.set(t.id,t)}),e}),l=W({searchKeys:a.searchKeys,getModules:()=>l.state.value.search?l.fuse.value.value?.search(l.state.value.search).map(e=>e.item)??[]:a.data});l.initSelector(p(()=>a.data));function u(e,t=new Set){if(t.has(e))return[];t.add(e);let n=c.value.get(e);if(!n?.imports?.length)return[];let r=[];for(let e of n.imports){let n=c.value.get(`${e[a.importIdKey]}`);n&&(t.has(n.id)||(r.push(n),r.push(...u(n.id,t))))}return r}let d=W({searchKeys:a.searchKeys,getModules:()=>l.state.value.selected?u(l.state.value.selected):[]});d.initSelector(d.modules);let f=p(()=>d.state.value.search?d.fuse.value.value?.search(d.state.value.search).map(e=>e.item)??[]:d.modules.value);v([()=>l.state.value.selected,()=>d.state.value.selected],()=>{o(`select`,{start:l.state.value.selected??``,end:d.state.value.selected??``})});function m(){o(`select`,{start:``,end:``}),o(`close`)}return(r,a)=>{let o=U;return y(),S(`div`,K,[C(`div`,q,[e(o,{search:n(l).state.value.search,"onUpdate:search":a[0]||=e=>n(l).state.value.search=e,placeholder:`Start`,selector:n(l),session:t.session,data:n(l).modules.value,onClear:a[1]||=()=>{n(l).clear(),n(d).clear()}},{list:_(()=>[s(r.$slots,`list`,{select:n(l).select,data:n(l).modules.value})]),item:_(()=>[s(r.$slots,`item`,{id:n(l).state.value.selected})]),_:3},8,[`search`,`selector`,`session`,`data`]),a[3]||=C(`div`,{class:`i-carbon-arrow-right op50`,"flex-shrink-0":``},null,-1),e(o,{search:n(d).state.value.search,"onUpdate:search":a[2]||=e=>n(d).state.value.search=e,placeholder:`End`,selector:n(d),session:t.session,data:f.value,onClear:n(d).clear},{list:_(()=>[s(r.$slots,`list`,{select:n(d).select,data:f.value})]),item:_(()=>[s(r.$slots,`item`,{id:n(d).state.value.selected})]),empty:_(()=>[C(`div`,J,[C(`span`,Y,i(n(l).state.value.selected?`No modules`:`Select a start module to get end modules`),1)])]),_:3},8,[`search`,`selector`,`session`,`data`,`onClear`])]),e(I,{class:`mr--2`,onClick:m})])}}}),{__name:`DataPathSelector`}),Z=Object.assign(o({inheritAttrs:!1,__name:`TimeoutView`,props:{content:{},hideInterval:{default:1500}},setup(e){let n=m(!1),r=null;return v(()=>e.content,()=>{r&&clearTimeout(r),n.value=!0,r=setTimeout(()=>{n.value=!1},e.hideInterval)}),(r,a)=>(y(),l(T,{"enter-active-class":`transition-opacity duration-200 ease-in`,"leave-active-class":`transition-opacity duration-500 ease-out`,"enter-from-class":`opacity-0`,"leave-to-class":`opacity-0`},{default:_(()=>[n.value?(y(),S(`div`,u(w({key:0},r.$attrs)),i(e.content),17)):t(``,!0)]),_:1}))}}),{__name:`DisplayTimeoutView`}),Q=[`width`,`height`],te=[`d`],ne={class:`w-4`},re=[`disabled`,`title`,`onClick`],ie={fixed:``,"right-6":``,"bottom-6":``,"z-panel-nav":``,flex:`~ col gap-2 items-center`},ae={"w-10":``,flex:`~ items-center justify-center`},oe={"bg-glass":``,"rounded-full":``,border:``,"border-base":``,shadow:``,flex:`~ col gap-1 p1`},$=[`disabled`],se=[`disabled`],ce=[`disabled`],le=[`disabled`],ue=Object.assign(o({__name:`ModuleGraph`,props:{modules:{},session:{},expandControls:{type:Boolean,default:!0}},setup(i){let o=i,{isFirstCalculateGraph:c,childToParentMap:l,collapsedNodes:u,calculateGraph:p,container:m,width:_,height:b,scale:w,nodes:T,links:E,spacing:O,nodesRefMap:k}=F(),{isGrabbing:A,init:I}=j(),{zoomIn:L,zoomOut:R,ZOOM_MIN:z,ZOOM_MAX:B}=ee(),{isGraphNodeToggling:V,toggleNode:H,expandAll:U,collapseAll:W}=M({modules:o.modules});return r(()=>{I(),v(()=>o.modules,()=>{c.value=!0,u.clear(),l.clear(),p()},{immediate:!0})}),(r,o)=>{let c=Z,l=h(`tooltip`);return y(),S(`div`,{ref_key:`container`,ref:m,"w-full":``,"h-screen":``,"of-scroll":``,relative:``,"select-none":``,class:a(n(A)?`cursor-grabbing`:``)},[C(`div`,{style:d({width:`${n(_)*n(w)}px`,height:`${n(b)*n(w)}px`})},[C(`div`,{flex:`~ items-center justify-center`,style:d({transform:`scale(${n(w)})`,transformOrigin:`0 0`})},[C(`div`,{absolute:``,"left-0":``,"top-0":``,style:d({width:`${n(_)}px`,height:`${n(b)}px`}),class:`bg-dots`},null,4),(y(),S(`svg`,{"pointer-events-none":``,absolute:``,"left-0":``,"top-0":``,"z-graph-link":``,width:n(_),height:n(b)},[C(`g`,null,[(y(!0),S(g,null,f(n(E),e=>(y(),S(g,{key:e.id},[e.target?s(r.$slots,`link`,{key:0,link:e,d:n(P)(e,n(O)),linkClass:n(N)(e)},()=>[(y(),S(`path`,{key:e.id,d:n(P)(e,n(O)),class:a(n(N)(e)),fill:`none`},null,10,te))]):t(``,!0)],64))),128))])],8,Q)),(y(!0),S(g,null,f(n(T),e=>(y(),S(g,{key:e.data.module.id},[e.data.module.id===`~root`?t(``,!0):(y(),S(`div`,{key:0,absolute:``,class:`group z-graph-node flex gap-1 items-center`,style:d({left:`${e.x}px`,top:`${e.y}px`,transform:`translate(-50%, -50%)`})},[C(`div`,{flex:`~ items-center gap-1`,"bg-glass":``,border:`~ base rounded`,class:`group-hover:bg-active block px2 p1`,style:d({minWidth:`${n(n(O).width)}px`,maxWidth:`${n(n(O).width)}px`,maxHeight:`${n(n(O).height)}px`,overflow:`hidden`,transition:`all 0.3s ease`})},[s(r.$slots,`default`,{node:e,nodesRefMap:n(k)})],4),C(`div`,ne,[e.data.hasChildren?(y(),S(`button`,{key:0,"w-4":``,"h-4":``,"rounded-full":``,flex:`items-center justify-center`,"text-xs":``,border:`~ active`,class:a([`flex cursor-pointer z-graph-node-active bg-base`,{"cursor-not-allowed":n(V),"hover:bg-active":!n(V)}]),disabled:n(V),title:e.data.expanded?`Collapse`:`Expand`,onClick:D(t=>n(H)(e.data.module.id),[`stop`])},[C(`div`,{class:a([`text-primary h-4`,[e.data.expanded?`i-ph-minus`:`i-ph-plus`]]),transition:`transform duration-200`},null,2)],10,re)):t(``,!0)])],4))],64))),128))],4)],4),C(`div`,ie,[C(`div`,ae,[e(c,{content:`${Math.round(n(w)*100)}%`,class:`text-sm`},null,8,[`content`])]),C(`div`,oe,[i.expandControls?(y(),S(g,{key:0},[x((y(),S(`button`,{"w-10":``,"h-10":``,"rounded-full":``,"hover:bg-active":``,"op-fade":``,"hover:op100":``,flex:`~ items-center justify-center`,disabled:n(V),class:a({"op50 cursor-not-allowed":n(V),"hover:bg-active":!n(V)}),title:`Expand All`,onClick:o[0]||=e=>n(U)()},[...o[4]||=[C(`div`,{class:`i-ph-arrows-out-simple-duotone`},null,-1)]],10,$)),[[l,`Expand All`,void 0,{left:!0}]]),x((y(),S(`button`,{"w-10":``,"h-10":``,"rounded-full":``,"hover:bg-active":``,"op-fade":``,"hover:op100":``,flex:`~ items-center justify-center`,disabled:n(V),class:a({"op50 cursor-not-allowed":n(V),"hover:bg-active":!n(V)}),title:`Collapse All`,onClick:o[1]||=e=>n(W)()},[...o[5]||=[C(`div`,{class:`i-ph-arrows-in-simple-duotone`},null,-1)]],10,se)),[[l,`Collapse All`,void 0,{left:!0}]]),o[6]||=C(`div`,{border:`t base`,my1:``},null,-1)],64)):t(``,!0),x((y(),S(`button`,{disabled:n(w)>=n(B),"w-10":``,"h-10":``,"rounded-full":``,"hover:bg-active":``,"op-fade":``,"hover:op100":``,"disabled:op20":``,"disabled:bg-none":``,"disabled:cursor-not-allowed":``,flex:`~ items-center justify-center`,title:`Zoom In (Ctrl + =)`,onClick:o[2]||=e=>n(L)()},[...o[7]||=[C(`div`,{"i-ph-magnifying-glass-plus-duotone":``},null,-1)]],8,ce)),[[l,`Zoom In (Ctrl + =)`,void 0,{left:!0}]]),x((y(),S(`button`,{disabled:n(w)<=n(z),"w-10":``,"h-10":``,"rounded-full":``,"hover:bg-active":``,"op-fade":``,"hover:op100":``,"disabled:op20":``,"disabled:bg-none":``,"disabled:cursor-not-allowed":``,flex:`~ items-center justify-center`,title:`Zoom Out (Ctrl + -)`,onClick:o[3]||=e=>n(R)()},[...o[8]||=[C(`div`,{"i-ph-magnifying-glass-minus-duotone":``},null,-1)]],8,le)),[[l,`Zoom Out (Ctrl + -)`,void 0,{left:!0}]])])])],2)}}}),{__name:`DisplayModuleGraph`});export{X as n,G as r,ue as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./Dnap40Ul.js";import{$ as t,A as n,C as r,Et as i,Gt as a,Ht as o,M as s,S as c,Z as l,b as u,bt as d,h as f,k as p,lt as m,ot as h,q as g,vt as _,w as v,x as y}from"./WOQUZE4V.js";import{C as b,w as x}from"./BeLy3b84.js";import{i as S,n as C}from"./BPmpuG8C.js";import{t as w}from"./B8a2SqNB.js";import{t as T}from"./n6uS-XK5.js";import{r as E,t as D}from"./B4F3iFfR.js";import{r as O,t as k}from"./hanhGz4p.js";import{a as A,o as j,p as ee,u as te}from"./MtfbxdGf.js";import{n as M,r as N,t as P}from"./4NH8NIP0.js";import{a as ne,c as F,n as I,t as re}from"./C1yaj-Vm.js";import{t as L}from"./BAo-e_JU.js";import{t as ie}from"./BIN2apLJ2.js";var R={flex:`~ row gap-1`,"of-hidden":``},z={key:0,flex:`~ row gap-1`,"ws-nowrap":``},B={key:1},V={p2:``,flex:`~ col gap-1`},H=Object.assign(s({__name:`Importers`,props:{package:{},session:{},showVersion:{type:Boolean}},setup(e){let i=e,a=u(()=>{let e=new Map;return i.package.files.filter(e=>!!e.importers).flatMap(e=>e.importers).filter(e=>!e.path.startsWith(i.package?.dir??``)).forEach(t=>{e.set(t.path,t)}),Array.from(e.values())});return(i,o)=>{let s=D,u=t(`VMenu`);return g(),v(`div`,R,[a.value[0]?(g(),v(`div`,z,[n(s,{id:a.value[0].path,session:e.session,link:``},null,8,[`id`,`session`]),a.value[0].version&&e.showVersion?(g(),c(E,{key:0,text:a.value[0].version,as:`span`},null,8,[`text`])):r(``,!0)])):(g(),v(`span`,B,` - `)),a.value.length>1?(g(),c(u,{key:2,delay:{show:200,hide:0},"flex-none":``},{popper:m(()=>[y(`div`,V,[(g(!0),v(f,null,l(a.value,t=>(g(),v(`div`,{key:t.path,flex:`~ row gap-1 items-center nowrap`,"w-max":``},[n(s,{id:t.path,session:e.session,"ws-nowrap":``,"flex-1":``,"disable-tooltip":``,link:``},null,8,[`id`,`session`]),t.version&&e.showVersion?(g(),c(E,{key:0,text:`v${t.version}`,as:`span`},null,8,[`text`])):r(``,!0)]))),128))])]),default:m(()=>[n(E,{text:`+${a.value.length}`,color:100,class:`text-xs rounded px1`},null,8,[`text`])]),_:1})):r(``,!0)])}}}),{__name:`PackagesImporters`}),U={role:`table`,"min-w-max":``,border:`~ base rounded-xl`},W={role:`row`,class:`border-b border-base`,flex:`~ row`},G=[`title`],K={key:0,"font-mono":``},q={key:0,title:`Package version`,role:`columnheader`,"rounded-tr-2":``,"flex-none":``,"min-w40":``,"ws-nowrap":``,"text-left":``,"py1.5":``,px2:``,"font-600":``},J={flex:`~ row gap1 items-center justify-end`,"w-full":``,relative:``,pr2:``},Y={key:0,role:`cell`,"font-mono":``,"flex-none":``,w80:``,"py1.5":``,px2:``,"ws-nowrap":``,"text-sm":``,"overflow-hidden":``,truncate:``},X={"font-mono":``,"text-sm":``},Z={role:`cell`,flex:`~ items-center justify-end`,"flex-none":``,"font-mono":``,"py1.5":``,px2:``,"text-sm":``,"min-w40":``,op80:``},ae={p2:``,flex:`~ col gap-1`},oe={w24:``,"inline-flex":``},se={role:`cell`,flex:`~ items-center`,"flex-1":``,"font-mono":``,"py1.5":``,pl20:``,pr2:``,"text-sm":``,op80:``},ce={key:1},Q=Object.assign(s({__name:`Table`,props:{packages:{},session:{},disableSizeSort:{type:Boolean,default:!1},groupView:{type:Boolean,default:!1}},setup(e){let t=b(),{state:s,next:u}=j([``,`desc`,`asc`],{initialValue:k.value.packageSizeSortType});function d(){u(),k.value.packageSizeSortType=s.value}return(u,h)=>{let _=L,b=O,x=D,w=H,E=T;return g(),v(`div`,U,[y(`div`,W,[y(`div`,{title:e.groupView?`Package`:`Bundled packages`,role:`columnheader`,"rounded-tl-2":``,"flex-none":``,"ws-nowrap":``,"py1.5":``,px2:``,"font-600":``,class:o([e.groupView?`min-w40`:`min-w80`])},[e.groupView?(g(),v(`div`,K,[n(_,{name:e.packages?.[0]?.name},null,8,[`name`])])):(g(),v(f,{key:1},[p(` Package `)],64))],10,G),e.groupView?r(``,!0):(g(),v(`div`,q,` Version `)),y(`div`,{title:`Transformed code size`,role:`columnheader`,"rounded-tr-2":``,"flex-none":``,"ws-nowrap":``,"py1.5":``,"font-600":``,"min-w40":``,class:o([e.groupView?`px2`:`pl2`])},[y(`button`,J,[h[0]||=p(` Size `,-1),e.disableSizeSort?r(``,!0):(g(),v(`span`,{key:0,"w-6":``,"h-6":``,"rounded-full":``,"cursor-pointer":``,hover:`bg-active`,flex:`~ items-center justify-center`,onClick:d},[y(`i`,{"text-xs":``,class:o([i(s)===`asc`?`i-ph-arrow-up-duotone`:`i-ph-arrow-down-duotone`,i(s)?`op100 text-primary`:`op50`])},null,2)]))])],2),h[1]||=y(`div`,{title:`Importers`,role:`columnheader`,"rounded-tr-2":``,"flex-none":``,"ws-nowrap":``,"py1.5":``,pl20:``,pr2:``,"font-600":``,"min-w50":``},` Importers `,-1)]),e.packages.length?(g(),c(P,{key:0,role:`rowgroup`,items:e.packages,"key-prop":`dir`},{default:m(({item:s,index:c})=>[n(E,{role:`row`,flex:`~ row`,class:o([`border-base border-b-1 border-dashed`,[c===e.packages.length-1?`border-b-0`:``]]),to:{path:i(t).path,query:{package:`${s.name}@${s.version}`}}},{default:m(()=>[n(i(S),{triggers:[`hover`],delay:1200,disabled:s.name.length<30},{popper:m(()=>[y(`span`,X,a(s.name),1)]),default:m(()=>[e.groupView?r(``,!0):(g(),v(`div`,Y,[n(_,{name:s.name},null,8,[`name`])]))]),_:2},1032,[`disabled`]),y(`div`,{role:`cell`,flex:`~ items-center`,"text-left":``,"flex-none":``,"font-mono":``,"py1.5":``,px2:``,"text-sm":``,"min-w40":``,op80:``,class:o({"text-primary":s.duplicated})},a(s.version),3),y(`div`,Z,[n(i(C),{delay:{show:200,hide:0}},{popper:m(()=>[y(`div`,ae,[(g(!0),v(f,null,l(s.files.filter(e=>!!e.transformedCodeSize),t=>(g(),v(`div`,{key:t.path,flex:`~ row gap-1 items-center nowrap`,"w-max":``},[y(`span`,oe,[n(b,{bytes:t.transformedCodeSize},null,8,[`bytes`])]),n(x,{id:t.path,session:e.session,"ws-nowrap":``,"flex-1":``,"disable-tooltip":``,link:``,cwd:s.dir},null,8,[`id`,`session`,`cwd`])]))),128))])]),default:m(()=>[n(b,{bytes:s.transformedCodeSize},null,8,[`bytes`])]),_:2},1024)]),y(`div`,se,[n(w,{package:s,session:e.session,"show-version":e.groupView},null,8,[`package`,`session`,`show-version`])])]),_:2},1032,[`class`,`to`])]),_:1},8,[`items`])):(g(),v(`div`,ce,[...h[2]||=[y(`div`,{p4:``},[y(`div`,{"w-full":``,"h-48":``,flex:`~ items-center justify-center`,op50:``,italic:``},[y(`p`,null,` No data `)])],-1)]]))])}}}),{__name:`PackagesTable`}),le={key:1,p4:``},ue=Object.assign(s({__name:`Duplicated`,props:{packages:{},session:{}},setup(e){let t=e,r=u(()=>t.packages.filter(e=>e.duplicated)),i=u(()=>r.value.reduce((e,t)=>(e[t.name]=[...e[t.name]||[],t],e),{}));return(t,a)=>{let o=Q;return r.value.length?(g(!0),v(f,{key:0},l(i.value,(t,r)=>(g(),v(`div`,{key:r},[n(o,{packages:t,session:e.session,"group-view":``,"disable-size-sort":``},null,8,[`packages`,`session`])]))),128)):(g(),v(`div`,le,[...a[0]||=[y(`div`,{"w-full":``,"h-48":``,flex:`~ items-center justify-center`,op50:``,italic:``},` No duplicate packages `,-1)]]))}}}),{__name:`PackagesDuplicated`}),de={key:1,relative:``},$={sticky:``,"left-4":``,"right-4":``,"top-4":``,"z-panel-nav":``,"p-4":``},fe={flex:`~ wrap gap-2 items-center`,p2:``,border:`t base`},pe=[`onClick`],me={flex:`~ col gap-2`,pt4:``,px4:``,pb4:``,"overflow-x-auto":``},he={fixed:``,"bottom-4":``,"py-1":``,"px-2":``,"bg-glass":``,left:`1/2`,"translate-x":`-1/2`,border:`~ base rounded-full`,text:`center xs`},ge={op50:``},_e={key:1,"w-full":``,"h-48":``,flex:`~ items-center justify-center`,op50:``,italic:``},ve={key:0,"bg-glass":``,border:`~ base rounded`,p2:``,"text-sm":``,flex:`~ col gap-2`},ye={flex:`~ gap-1 items-center`},be={flex:`~ gap-1 items-center`},xe=s({__name:`packages`,props:{session:{}},setup(t){let s=t,S=_(te()),C=b(),T=x(),E=[{match:/.*/,name:`direct`,description:`Direct Dependencies`,icon:`i-octicon:package-dependencies-24 light:filter-invert-30!`},{match:/.*/,name:`transitive`,description:`Transitive Dependencies`,icon:`i-octicon:package-24 light:filter-invert-30!`}],D=e(),j=d({search:``,selected:[`direct`,`transitive`]}),{state:P,isLoading:L}=A(async()=>await D.value.call(`vite:rolldown:get-packages`,{session:s.session.id}),null),R=ee(()=>P.value,()=>new N(P.value,{includeScore:!0,keys:[`name`],ignoreLocation:!0,threshold:.4})),z=u(()=>P.value?Object.values(P.value.reduce((e,t)=>(e[t.name]=(e[t.name]||0)+1,e),{})).filter(e=>e>1).length:0),B=u(()=>[{label:`Table`,value:`table`,icon:`i-ph-table-duotone`},{label:`Treemap`,value:`treemap`,icon:`i-ph-checkerboard-duotone`},{label:`Duplicate Packages${z.value>0?` (${z.value})`:``}`,value:`duplicate-packages`,icon:`i-ph-package-duotone`}]),V=u(()=>j.value.search?R.value.search(j.value.search).map(e=>e.item):[...P.value||[]]),H=u(()=>{let e=k.value.packageSizeSortType,t=V.value.toSorted((e,t)=>(e.name||``).localeCompare(t.name||``));return(e?t.sort((t,n)=>e===`asc`?t.transformedCodeSize-n.transformedCodeSize:n.transformedCodeSize-t.transformedCodeSize):t).filter(e=>!j.value.selected||j.value.selected.some(t=>t.match(e.type)))});function U(e){k.value.packageViewType=e}let{tree:W,chartOptions:G,graph:K,nodeHover:q,nodeSelected:J,selectedNode:Y,selectNode:X,buildGraph:Z}=re({data:H,nameKey:`name`,sizeKey:`transformedCodeSize`,rootText:`Packages`,nodeType:`package`,graphOptions:{onHover(e){e&&!C.query.package&&(q.value=e),e===null&&(q.value=void 0)},onClick(e){e.meta?.type===`package`&&T.replace({query:{...C.query,package:`${e.meta?.name}@${e.meta?.version}`}})},onLeave(){q.value=void 0},onSelect(e){J.value=e||W.value.root,Y.value=e?.meta}},onUpdate(){k.value.packageViewType===`treemap`&&(K.value=new ne(W.value.root,{...G.value,selectedPaddingRatio:0}))}});return h(()=>k.value.packageViewType,()=>{Z()}),(e,s)=>{let u=w,d=M,h=Q,_=I,b=ue,x=O,C=F;return i(L)?(g(),c(u,{key:0})):(g(),v(`div`,de,[y(`div`,$,[n(d,{modelValue:j.value,"onUpdate:modelValue":s[0]||=e=>j.value=e,rules:E},{default:m(()=>[y(`div`,fe,[s[2]||=y(`span`,{op50:``,pl2:``,"text-sm":``},`View as`,-1),(g(!0),v(f,null,l(B.value,e=>(g(),v(`button`,{key:e.value,"btn-action":``,class:o(i(k).packageViewType===e.value?`bg-active`:`grayscale op50`),onClick:t=>U(e.value)},[y(`div`,{class:o(e.icon)},null,2),p(` `+a(e.label),1)],10,pe))),128))])]),_:1},8,[`modelValue`])]),y(`div`,me,[i(k).packageViewType===`table`?(g(),v(f,{key:0},[n(h,{packages:H.value,session:t.session},null,8,[`packages`,`session`]),y(`div`,he,[y(`span`,ge,a(V.value.length)+` of `+a(i(P)?.length||0),1)])],64)):i(k).packageViewType===`treemap`?(g(),v(f,{key:1},[i(K)&&H.value.length?(g(),c(ie,{key:0,graph:i(K),selected:i(J),onSelect:s[1]||=e=>i(X)(e)},{default:m(({selected:e,options:t,onSelect:r})=>[n(_,{border:`b base`,py2:``,"min-h-10":``,selected:e,options:t,onSelect:r},null,8,[`selected`,`options`,`onSelect`])]),_:1},8,[`graph`,`selected`])):(g(),v(`span`,_e,` No Data `))],64)):i(k).packageViewType===`duplicate-packages`?(g(),c(b,{key:2,packages:H.value,session:t.session},null,8,[`packages`,`session`])):r(``,!0)]),n(C,{"hover-x":S.x,"hover-y":S.y},{default:m(()=>[i(q)?.meta?(g(),v(`div`,ve,[y(`div`,ye,a(i(q).text),1),y(`div`,be,[n(x,{bytes:i(q).size,percent:!1},null,8,[`bytes`])])])):r(``,!0)]),_:1},8,[`hover-x`,`hover-y`])]))}}});export{xe as default};
@@ -1 +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"./CEtF9LWU.js";import{a as x,c as S,d as C,f as w,i as ee,l as T,o as te,r as ne,u as re}from"./5tvbNeKa.js";import{t as E}from"./DJTkDKGN.js";import{t as D}from"./D04G8HHr.js";import{t as ie}from"./DbSMFLvz.js";function O(){return typeof window<`u`}function k(e){return ae(e)?(e.nodeName||``).toLowerCase():`#document`}function A(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function j(e){return((ae(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function ae(e){return O()?e instanceof Node||e instanceof A(e).Node:!1}function M(e){return O()?e instanceof Element||e instanceof A(e).Element:!1}function N(e){return O()?e instanceof HTMLElement||e instanceof A(e).HTMLElement:!1}function oe(e){return!O()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof A(e).ShadowRoot}function P(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 se(e){return/^(table|td|th)$/.test(k(e))}function F(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var ce=/transform|translate|scale|rotate|perspective|filter/,le=/paint|layout|strict|content/,I=e=>!!e&&e!==`none`,ue;function de(e){let t=M(e)?R(e):e;return I(t.transform)||I(t.translate)||I(t.scale)||I(t.rotate)||I(t.perspective)||!pe()&&(I(t.backdropFilter)||I(t.filter))||ce.test(t.willChange||``)||le.test(t.contain||``)}function fe(e){let t=B(e);for(;N(t)&&!L(t);){if(de(t))return t;if(F(t))return null;t=B(t)}return null}function pe(){return ue??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),ue}function L(e){return/^(html|body|#document)$/.test(k(e))}function R(e){return A(e).getComputedStyle(e)}function z(e){return M(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function B(e){if(k(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||oe(e)&&e.host||j(e);return oe(t)?t.host:t}function me(e){let t=B(e);return L(t)?e.ownerDocument?e.ownerDocument.body:e.body:N(t)&&P(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=A(r);if(i){let e=ge(a);return t.concat(a,a.visualViewport||[],P(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=N(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=w(n)!==a||w(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function ve(e){return M(e)?e:e.contextElement}function V(e){let t=ve(e);if(!N(t))return S(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=_e(t),o=(a?w(n.width):n.width)/r,s=(a?w(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var ye=S(0);function be(e){let t=A(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!==A(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=S(1);t&&(r?M(r)&&(o=V(r)):o=V(e));let s=xe(a,n,r)?be(a):S(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=A(a),t=r&&M(r)?A(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=A(i),i=ge(n)}}return C({width:u,height:d,x:c,y:l})}function U(e,t){let n=z(e).scrollLeft;return t?t.left+n:H(j(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=j(r),s=t?F(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=S(1),u=S(0),d=N(r);if((d||!d&&!a)&&((k(r)!==`body`||P(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):S(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=j(e),n=z(e),r=e.ownerDocument.body,i=T(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=T(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+U(e),s=-n.scrollTop;return R(r).direction===`rtl`&&(o+=T(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Ee=25;function De(e,t){let n=A(e),r=j(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=N(e)?V(e):S(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(j(e));else if(M(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 C(r)}function Ae(e,t){let n=B(e);return n===t||!M(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=>M(e)&&k(e)!==`body`),i=null,a=R(e).position===`fixed`,o=a?B(e):e;for(;M(o)&&!L(o);){let t=R(o),n=de(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||P(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`?F(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=T(n.top,s),c=re(n.right,c),l=re(n.bottom,l),u=T(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=N(t),i=j(t),a=n===`fixed`,o=H(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=S(0);function l(){c.x=U(i)}if(r||!r&&!a)if((k(t)!==`body`||P(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):S(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(!N(e)||R(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return j(e)===n&&(n=n.ownerDocument.body),n}function Le(e,t){let n=A(e);if(F(e))return n;if(!N(e)){let t=B(e);for(;t&&!L(t);){if(M(t)&&!Fe(t))return t;t=B(t)}return n}let r=Ie(e,t);for(;r&&se(r)&&Fe(r);)r=Ie(r,t);return r&&L(r)&&Fe(r)&&!de(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:j,getClippingRect:Me,getOffsetParent:Le,getElementRects:Re,getClientRects:we,getDimensions:Ne,getScale:V,isElement:M,isRTL:ze},Ve=x,He=te,Ue=ee,We=(e,t,n)=>{let r=new Map,i={platform:Be,...n},a={...i.platform,_c:r};return ne(e,t,{...i,platform:a})},Ge=Object.assign(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)]))}}),{__name:`DisplayGraphHoverView`});function Ke(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 qe,Je,Ye,W,G,K=1,Xe;function Ze(e,t,n,r,i){if(!Array.isArray(e))return e;let a=window.devicePixelRatio||1;if(qe!==t||Je!==a||Ye!==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;qe=t,Je=a,Ye=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()}Xe=t.createPattern(W,`repeat`),K/=n}return n/=64*K*a,n-=Math.floor(n),n*=64*K*a,Xe.setTransform(new DOMMatrix([K,0,0,K,n,r])),Xe}function Qe(e){return Array.isArray(e)?`url('data:image/svg+xml,<svg width="26" height="26" xmlns="http://www.w3.org/2000/svg"><rect width="26" height="26" fill="${e[0]}"/><rect width="26" height="26" fill="${e[1]}" fill-opacity="25%"/><path d="M22.5 -3.5L-3.5 22.5M35.5 9.5L9.5 35.5" stroke="${e[1]}" stroke-opacity="67%" stroke-width="9.19239"/></svg>')`:e}function $e(e){return t=>t.id&&e[t.id]||t.color}function et(e,t=1,n=1){let r={};return tt(r,e,0,Math.PI*2,t,n),$e(r)}function tt(e,t,n,r,i=1,a=1){let o=t.size;e[t.id]=Ke(n+r/2,i,a);for(let s of t.children){let t=s.size/o*r;tt(e,s,n,t,i,a),n+=t}}var nt=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`;function rt(e=16,t=nt){let n=``,r=e,i=t.length;for(;r--;)n+=t[Math.random()*i|0];return n}function it(e,t,n=(e,t)=>t.size-e.size){if(e.__nanovis)return e;let r={...e};return r.id||=rt(),r.parent||=t,r.children||=[],r.sizeSelf==null&&r.size!=null&&r.children.length===0?r.sizeSelf=r.size:r.sizeSelf||=0,r.children=(r.children||[]).map(e=>it(e,r,n)),r.size||=r.children.reduce((e,t)=>e+t.size,0)+r.sizeSelf,n&&r.children.sort(n),Object.defineProperty(r,`__nanovis`,{enumerable:!1,value:!0}),r}function at(e){return e.children.length===0?1:Math.max(...e.children.map(e=>at(e)))+1}var ot=/\bFirefox\//.test(navigator.userAgent),st;function ct(e){return st?st.format(e):`${e}`}function q(){return(window.performance||Date).now()}function lt(e){let t=e.toFixed(1).split(`.`,2);return`${ct(+t[0])}.${t[1]}`}function ut(e){return e===1?`1 byte`:e<1024?`${ct(e)} bytes`:e<1024*1024?`${lt(e/1024)} kb`:e<1024*1024*1024?`${lt(e/(1024*1024))} mb`:`${lt(e/(1024*1024*1024))} gb`}function dt(e,t,n,r,i,a){if(ot){let o=e.lineWidth,s=o/2;e.fillStyle=t,e.fillRect(n-s,r-s,i+o,o),e.fillRect(n-s,r+s,o,a-o),e.fillRect(n-s,r+a-s,i+o,o),e.fillRect(n+i-s,r+s,o,a-o);return}e.strokeStyle=t,e.strokeRect(n,r,i,a)}function ft(e){return window.addEventListener(`wheel`,e,{passive:!1}),()=>window.removeEventListener(`wheel`,e)}function pt(e){return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)}try{st=new Intl.NumberFormat}catch{}var mt=()=>({emit(e,...t){for(let n=this.events[e]||[],r=0,i=n.length;r<i;r++)n[r](...t)},events:{},on(e,t){return(this.events[e]||=[]).push(t),()=>{this.events[e]=this.events[e]?.filter(e=>t!==e)}}}),J={getText:e=>e.text,getSubtext:e=>e.subtext,animate:!0,animateDuration:350},ht={fallback:`#CCC`,stroke:`#0008`,text:`#222`,hover:`#fff5`,shadow:`#0008`,fg:`#fff`,bg:`#222`},gt=46,_t=`14px sans-serif`,vt=`bold ${_t}`,yt=class{el;canvas;c;width=0;height=0;ratio=1;root;maxDepth;events;options;palette;disposables;getColor;getText;getSubtext;_animationFrame=null;constructor(e,t){this.options={...J,...t};let{getColor:n=et(e),getText:r=()=>void 0,getSubtext:i=()=>void 0}=this.options;this.palette={...ht,...t.palette},this.el=document.createElement(`div`),this.canvas=document.createElement(`canvas`),this.c=this.canvas.getContext(`2d`),this.root=e,this.maxDepth=at(e),this.disposables=[],this.events=mt(),this.getColor=n,this.getText=r,this.getSubtext=i,this.setFont(_t),t.onClick&&this.events.on(`click`,t.onClick),t.onHover&&this.events.on(`hover`,t.onHover),t.onLeave&&this.events.on(`leave`,t.onLeave),t.onSelect&&this.events.on(`select`,t.onSelect),this.el.addEventListener(`mouseleave`,()=>{this.events.emit(`leave`)})}invalidate(){this._animationFrame===null&&(this._animationFrame=requestAnimationFrame(()=>{this._animationFrame=null,this.tick()}))}tick(){this.draw()}draw(){}resize(){this.ratio=window.devicePixelRatio||1,this.canvas.style.width=`${this.width}px`,this.canvas.style.height=`${this.height}px`,this.canvas.width=Math.round(this.width*this.ratio),this.canvas.height=Math.round(this.height*this.ratio),this.c.scale(this.ratio,this.ratio),this.draw()}select(e,t){this.events.emit(`select`,e)}dispose(){this.disposables.forEach(e=>e()),this.disposables.length=0,this.el.remove()}[Symbol.dispose](){this.dispose()}_font=`14px sans-serif`;_fontWidthCache=new Map;ellipsisWidth=0;getFontCache(){return this._fontWidthCache.has(this._font)||this._fontWidthCache.set(this._font,{}),this._fontWidthCache.get(this._font)}setFont(e){this._font=e,this.c.font=e,this.c.textBaseline=`middle`,this.ellipsisWidth=3*this.charCodeWidth(gt)}charCodeWidth(e){let t=this.getFontCache(),n=t[e];return n===void 0&&(n=this.c.measureText(String.fromCharCode(e)).width,t[e]=n),n}textOverflowEllipsis(e,t){if(t<this.ellipsisWidth)return[``,0];let n=0,r=e.length,i=0;for(;i<r;){let r=this.charCodeWidth(e.charCodeAt(i));if(t<n+this.ellipsisWidth+r)return[`${e.slice(0,i)}...`,n+this.ellipsisWidth];n+=r,i++}return[e,n]}},Y=24,bt=5,xt=.01,St=1e3,Ct=class extends yt{mainEl=document.createElement(`div`);totalBytes;viewportMin;viewportMax;zoomedOutMin=0;zoomedOutWidth=0;prevWheelTime=0;prevWheelWasZoom=!1;stripeScaleAdjust=1;hoveredNode=null;selectedNode=null;nodeStartBytes=new Map;animationFromMin=0;animationFromMax=0;animationToMin=0;animationToMax=0;animationStart=0;constructor(e,t={}){super(e,t),this.totalBytes=e.size,this.viewportMin=this.animationFromMin=this.animationToMin=0,this.viewportMax=this.animationFromMax=this.animationToMax=this.totalBytes,Object.assign(this.mainEl.style,{position:`relative`}),Object.assign(this.canvas.style,{position:`absolute`,left:`0`,top:`0`});let n=!1;this.canvas.onmousedown=e=>{if(n=!1,e.button!==2){let t=e.pageX,r=e=>{let r=e.pageX-t;!n&&Math.abs(r)<3||(n=!0,this.modifyViewport(-r,0,null),t=e.pageX)},i=()=>{document.removeEventListener(`mousemove`,r),document.removeEventListener(`mouseup`,i)};e.preventDefault(),document.addEventListener(`mousemove`,r),document.addEventListener(`mouseup`,i)}},this.canvas.onmousemove=e=>{this.updateHover(e)},this.canvas.onmouseout=()=>{this.changeHoveredNode(null)},this.canvas.onclick=e=>{if(n)return;let t=this.hitTestNode(e);this.changeHoveredNode(t),this.changeSelectedNode(t),t&&this.events.emit(`click`,t,e)},this.disposables.push(ft(e=>{let t=e.deltaX,n=e.deltaY,r=q(),i=r-this.prevWheelTime<50?this.prevWheelWasZoom:e.ctrlKey||e.metaKey;this.prevWheelTime=r,this.prevWheelWasZoom=i,(i||Math.abs(t)>=Math.abs(n))&&e.preventDefault(),this.modifyViewport(t,n,i?e.pageX:null),this.updateHover(e)})),this.resize(),Promise.resolve().then(()=>this.resize()),this.disposables.push(pt(()=>this.resize())),this.mainEl.append(this.canvas),this.el.append(this.mainEl)}tick(){let e=(q()-this.animationStart)/(this.options.animateDuration??J.animateDuration);e<0||e>1?(e=1,this.viewportMin=this.animationToMin,this.viewportMax=this.animationToMax):(e<.5?e*=4*e*e:(e=1-e,e*=4*e*e,e=1-e),this.viewportMin=this.animationFromMin+(this.animationToMin-this.animationFromMin)*e,this.viewportMax=this.animationFromMax+(this.animationToMax-this.animationFromMax)*e,this.invalidate()),this.draw()}draw(){this.c.clearRect(0,0,this.width,this.height),this.drawNode(this.root,0,0,-1/0,1)}changeSelectedNode(e,t=this.options.animate??J.animate){if(this.selectedNode!==e&&(this.selectedNode=e,this.events.emit(`select`,e),e&&this.nodeStartBytes.has(e.id))){let n=this.nodeStartBytes.get(e.id),r=n+e.size;n=Math.max(0,n-e.size*xt),r=Math.min(this.totalBytes,r+e.size*xt),this.setViewport(n,r,t)}}select(e,t=this.options.animate??J.animate){this.changeSelectedNode(e,t)}resize(){this.width=this.el.clientWidth,this.height=this.maxDepth*Y+1,this.zoomedOutMin=this.width-St>>1,this.zoomedOutWidth=this.zoomedOutMin+St,this.zoomedOutMin<0&&(this.zoomedOutMin=0),this.zoomedOutWidth>this.width&&(this.zoomedOutWidth=this.width),this.zoomedOutWidth-=this.zoomedOutMin,this.stripeScaleAdjust=this.totalBytes/this.zoomedOutWidth,this.mainEl.style.height=`${this.height}px`,super.resize()}drawNode(e,t,n,r,i){this.nodeStartBytes.set(e.id,n);let a=this.zoomedOutWidth/(this.viewportMax-this.viewportMin),o=this.zoomedOutMin+(n-this.viewportMin)*a,s=e.size*a,c=o+s;if(c<r+1.5)return r;if(o+s<0||o>this.width)return c;let l=s<2?2:s,u=(o>0?o:0)+bt,d=t+Y/2,f=this.getText(e)||``,p=this.getSubtext(e)||``,m,h=0,g=s+o-u,_=Ze(this.getColor(e)||this.palette.fallback,this.c,this.zoomedOutMin-this.viewportMin*a,Y,a*this.stripeScaleAdjust),v=this.palette.text,y=-1/0;i&1?(v=this.palette.fg,this.setFont(vt)):(this.c.fillStyle=_,this.c.fillRect(o,t,l,Y),(i&2||this.hoveredNode&&e.id===this.hoveredNode.id)&&(this.c.fillStyle=this.palette.hover,this.c.fillRect(o,t,l,Y),i|=2)),this.ellipsisWidth<g&&(m=this.c.measureText(f).width,m<=g?h+=m:(f=this.textOverflowEllipsis(f,g)[0],h=g),this.c.fillStyle=v,this.c.fillText(f,u,d)),i&1&&this.setFont(_t),h+this.ellipsisWidth<g&&(p&&f&&(p=` - ${p}`),m=this.c.measureText(p).width,h+m>g&&(p=this.textOverflowEllipsis(p,g-h)[0]),this.c.globalAlpha=.5,this.c.fillText(p,u+h,d),this.c.globalAlpha=1);for(let r of e.children)y=this.drawNode(r,t+Y,n,y,i&-2),n+=r.size;return i&1||dt(this.c,this.palette.stroke,o+.5,t+.5,l,Y),c}changeHoveredNode(e){this.hoveredNode!==e&&(this.hoveredNode=e,this.canvas.style.cursor=e&&!e.children.length?`pointer`:`auto`,this.invalidate())}hitTestNode(e){let t=this.canvas.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top,i=this.viewportMin+(this.viewportMax-this.viewportMin)/this.zoomedOutWidth*(n-this.zoomedOutMin),a=(e,t,n)=>{if(i>=n&&i<n+e.size){if(r>=t&&r<t+Y&&e.id)return e;if(r>=t+Y)for(let r of e.children){let e=a(r,t+Y,n);if(e)return e;n+=r.size}}return null};return a(this.root,0,0)}modifyViewport(e,t,n){let r=this.viewportMin,i=this.viewportMax,a=0;if(n!==null){let e=r+(i-r)/this.zoomedOutWidth*(n-this.zoomedOutMin),a=1.01**t;r=e+(r-e)*a,i=e+(i-e)*a}else a=e*(i-r)/this.zoomedOutWidth;r+a<0?a=-r:i+a>this.totalBytes&&(a=this.totalBytes-i),r+=a,i+=a,r<0&&(r=0),i>this.totalBytes&&(i=this.totalBytes),this.setViewport(r,i,!1)}setViewport(e,t,n){this.animationFromMin=this.viewportMin,this.animationFromMax=this.viewportMax,this.animationToMin=e,this.animationToMax=t,n?this.animationStart=q():this.animationStart=0,this.invalidate()}updateHover(e){let t=this.hitTestNode(e);this.changeHoveredNode(t),this.events.emit(`hover`,t,e)}};function wt(e,t){for(;t;){if(t===e)return!0;t=t.parent}return!1}function Tt(e,t,n){if(e===t)return;let r=t.parent,i=r.size||1,a=0;Tt(e,r,n);for(let e of r.children){if(e===t){n.startAngle_+=n.sweepAngle_*a/i,n.sweepAngle_=e.size/i*n.sweepAngle_;break}a+=e.size}n.depth_+=1}var Et={};function Dt(e){return Et[e]||(Et[e]=400*Math.log(1+Math.log(1+e/8))),Et[e]}var X=-Math.PI/2,Ot=class extends yt{currentNode;hoveredNode;centerX=0;centerY=0;animationStart=0;radiusScale=1;sourceDepth=0;sourceStartAngle=X;sourceSweepAngle=Math.PI*2;targetNode;targetDepth=this.sourceDepth;targetStartAngle=this.sourceStartAngle;targetSweepAngle=this.sourceSweepAngle;animatedNode;animatedDepth=this.sourceDepth;animatedStartAngle=this.sourceStartAngle;animatedSweepAngle=this.sourceSweepAngle;previousHoveredNode;historyStack=[];constructor(e,t={}){for(;e.children.length===1;)e=e.children[0];super(e,t),this.currentNode=e,this.targetNode=this.currentNode,this.animatedNode=this.currentNode,this.canvas.onmousemove=e=>{this.handleMouseMove(e)},this.canvas.onmouseout=e=>{this.changeHoveredNode(void 0),this.events.emit(`hover`,null,e)},this.canvas.onclick=e=>{let t=this.hitTestNode(e);if(!t)return;this.events.emit(`click`,t,e);let n=[];t===this.animatedNode.parent?this.historyStack.length>0&&(t=this.historyStack.pop(),n=this.historyStack.slice()):n=this.historyStack.concat(this.currentNode),this.events.emit(`click`,t,e),t.children.length>0?(this.select(t),this.historyStack=n):e.preventDefault()},this.el.append(this.canvas),this.resize(),Promise.resolve().then(()=>this.resize()),this.disposables.push(pt(()=>this.resize())),this.disposables.push(ft(e=>this.handleMouseMove(e)))}select(e,t){(this.currentNode!==e||this.root)&&(this.currentNode=e||this.root,this.updateSunburst(t),this.events.emit(`select`,e))}resize(){this.width=this.el.clientWidth,this.height=this.width,this.centerX=this.width>>1,this.centerY=this.height>>1;let e=2*Math.ceil(Dt(this.maxDepth));this.radiusScale=this.width/e,super.resize()}draw(){this.c.clearRect(0,0,this.width,this.height),this.drawNode(this.animatedNode,this.animatedDepth,this.computeRadius(this.animatedDepth),this.animatedStartAngle,this.animatedSweepAngle,3,-1/0),this.c.strokeStyle=this.palette.stroke,this.c.beginPath(),this.drawNode(this.animatedNode,this.animatedDepth,this.computeRadius(this.animatedDepth),this.animatedStartAngle,this.animatedSweepAngle,1,-1/0),this.c.stroke(),this.animatedDepth===0&&(this.c.fillStyle=this.palette.stroke,this.setFont(vt),this.c.textAlign=`center`,this.c.fillText(this.getSubtext(this.targetNode)??ut(this.targetNode.size),this.centerX,this.centerY))}drawNode(e,t,n,r,i,a,o){let s=this.computeRadius(t+1);if(s>this.centerY)return o;e===this.hoveredNode&&(a|=8);let c=(n+s)/2,l=r+i;if(l-o<1.5/c)return o;let u=2/c;if(i>u&&(u=i),a&2)this.c.fillStyle=Ze(this.getColor(e)||this.palette.fallback,this.c,this.centerX,this.centerY,1),this.c.beginPath(),this.c.arc(this.centerX,this.centerY,n,r,r+u,!1),this.c.arc(this.centerX,this.centerY,s,r+u,r,!0),this.c.fill(),this.hoveredNode&&(a&8||e.parent===this.hoveredNode)&&(this.c.fillStyle=this.palette.hover,this.c.fill());else{let e=u===Math.PI*2,t=a&4||e?s:n;a&1&&n>0&&this.c.arc(this.centerX,this.centerY,n,r+u,r,!0),this.c.moveTo(this.centerX+t*Math.cos(r),this.centerY+t*Math.sin(r)),this.c.arc(this.centerX,this.centerY,s,r,r+u,!1),e||this.c.lineTo(this.centerX+n*Math.cos(r+u),this.centerY+n*Math.sin(r+u))}let d=e.size,f=a&10,p=0,m=-1/0;for(let n of e.children)m=this.drawNode(n,t+1,s,r+i*p/d,n.size/d*i,f,m),p+=n.size,f|=4;return l}changeHoveredNode(e,t){this.hoveredNode!==e&&(this.hoveredNode=e,this.updateSunburst(t))}hitTestNode(e){let t=this.canvas.getBoundingClientRect(),n=e.clientX-t.left-this.centerX,r=e.clientY-t.top-this.centerY,i=Math.sqrt(n*n+r*r),a=Math.atan2(r,n),o=(e,t,n,r,s)=>{let c=this.computeRadius(t+1);if(c>this.centerY)return;if(i>=n&&i<c){let t=a-r;if(t/=Math.PI*2,t-=Math.floor(t),t*=Math.PI*2,t<s)return e===this.animatedNode?e.parent:e}let l=e.size,u=0;for(let n of e.children){let e=o(n,t+1,c,r+s*u/l,n.size/l*s);if(e)return e;u+=n.size}};return o(this.animatedNode,this.animatedDepth,this.computeRadius(this.animatedDepth),this.animatedStartAngle,this.animatedSweepAngle)}tick(){let e=(q()-this.animationStart)/(this.options.animateDuration??J.animateDuration);e<0||e>1?(e=1,this.animatedNode=this.targetNode,this.targetDepth=0,this.targetStartAngle=X,this.targetSweepAngle=Math.PI*2):(e<.5?e*=4*e*e:(e=1-e,e*=4*e*e,e=1-e),this.invalidate()),this.animatedDepth=this.sourceDepth+(this.targetDepth-this.sourceDepth)*e,this.animatedStartAngle=this.sourceStartAngle+(this.targetStartAngle-this.sourceStartAngle)*e,this.animatedSweepAngle=this.sourceSweepAngle+(this.targetSweepAngle-this.sourceSweepAngle)*e,this.draw()}handleMouseMove(e){let t=this.hitTestNode(e);this.changeHoveredNode(t),t&&t!==this.animatedNode.parent?(this.events.emit(`hover`,t,e),this.canvas.style.cursor=`pointer`):this.events.emit(`hover`,null,e)}computeRadius(e){return Dt(e)*this.radiusScale}updateSunburst(e=this.options.animate??!0){if(this.previousHoveredNode!==this.hoveredNode&&(this.previousHoveredNode=this.hoveredNode,this.hoveredNode||(this.canvas.style.cursor=`auto`,this.events.emit(`hover`,null)),this.invalidate()),this.targetNode!==this.currentNode){if(this.historyStack.length=0,this.invalidate(),e&&(this.animationStart=q()),wt(this.animatedNode,this.currentNode)){let e={depth_:this.animatedDepth,startAngle_:this.animatedStartAngle,sweepAngle_:this.animatedSweepAngle};Tt(this.animatedNode,this.currentNode,e),this.animatedDepth=e.depth_,this.animatedStartAngle=e.startAngle_,this.animatedSweepAngle=e.sweepAngle_,this.targetDepth=0,this.targetStartAngle=X,this.targetSweepAngle=Math.PI*2,this.animatedNode=this.currentNode}else if(wt(this.currentNode,this.animatedNode)){let e={depth_:0,startAngle_:X,sweepAngle_:Math.PI*2};Tt(this.currentNode,this.animatedNode,e),this.targetDepth=e.depth_,this.targetStartAngle=e.startAngle_,this.targetSweepAngle=e.sweepAngle_}else this.animationStart=-1/0,this.animatedNode=this.currentNode;this.sourceDepth=this.animatedDepth,this.sourceStartAngle=this.animatedStartAngle,this.sourceSweepAngle=this.animatedSweepAngle,this.targetNode=this.currentNode,this.events.emit(`select`,this.currentNode)}}},Z=4,Q=20,kt=2*Z,$=Q+Z;function At(e,t,n,r,i){let a=[],o=(t,n,r,i,a)=>{let o=e[t].size*a,s=e[n].size*a;return Math.max(r*r*o/(i*i),i*i/(r*r*s))};return((t,n,r,i,s)=>{for(;t<e.length;){let c=0;for(let n=t;n<e.length;n++)c+=e[n].size;let l=Math.min(i,s),u=i*s/c,d=t,f=0,p=0;for(;d<e.length;){let n=e[d].size*u,r=o(t,d,l,f+n,u);if(d>t&&p<r)break;f+=n,p=r,d++}let m=Math.round(f/l),h=0;for(let o=t;o<d;o++){let t=e[o],c=t.size*u,d=Math.round(l*h/f),p=Math.round(l*(h+c)/f),[g,_,v,y]=i>=s?[n,r+d,m,p-d]:[n+d,r,p-d,m];a.push({node:t,box:[g,_,v,y],children:v>kt&&y>$?At(t.children,g+Z,_+Q,v-kt,y-$):[]}),h+=c}t=d,i>=s?(n+=m,i-=m):(r+=m,s-=m)}})(0,t,n,r,i),a}var jt=class extends yt{hoveredNode=null;currentNode=null;bgOriginX=0;bgOriginY=0;layers={base:null};baseLayoutCache;currentOriginX=0;currentOriginY=0;animationStart=0;animationBlend=1;animationSource=null;animationTarget=null;constructor(e,t={}){super(e,t),this.canvas.addEventListener(`mousemove`,e=>{this.updateHover(e)}),this.canvas.addEventListener(`mouseout`,e=>{this.changeHoveredNode(null),this.events.emit(`hover`,null,e)}),this.el.addEventListener(`click`,e=>{let t=this.hitTestNode(e);if(t){let n=t.node;this.events.emit(`click`,n,e),n.children.length?t===this.layers.current?this.updateHover(e):(this.changeCurrentLayout(t),this.changeHoveredNode(null)):this.updateHover(e)}else this.currentNode&&(this.changeCurrentLayout(null),this.updateHover(e))}),this.el.append(this.canvas),this.resize(),Promise.resolve().then(()=>this.resize()),this.disposables.push(ft(e=>this.updateHover(e))),this.disposables.push(pt(()=>this.resize()))}select(e,t){let n=null;e===this.root&&(e=null),n=e?this.searchFor([this.layers.current,this.layers.base],e):null,this.changeCurrentLayout(n,t)}drawBaseLayout(){!this.width||!this.height||(this.c.clearRect(0,0,this.width,this.height),this.bgOriginX=this.bgOriginY=0,this.baseLayoutCache?this.c.putImageData(this.baseLayoutCache,0,0):(this.drawLayout(this.layers.base,0,[]),this.baseLayoutCache=this.c.getImageData(0,0,this.width*this.ratio,this.height*this.ratio)))}draw(){this.drawBaseLayout(),this.layers.current||this.drawHoverHighlight(this.layers.base);let e=this.layers.current?this.animationSource?this.animationTarget?1:1-this.animationBlend:this.animationBlend:0;if(this.layers.current){let[t,n,r,i]=this.layers.base.box;this.c.globalAlpha=.6*(!this.layers.current||!this.animationSource?1:e),this.c.fillStyle=this.palette.bg,this.c.fillRect(t,n,r,i),this.c.globalAlpha=1}if(this.layers.previous&&this.drawLayout(this.layers.previous,1,[this.layers.current]),this.layers.current){let[t,n,r,i]=this.layers.current.box,a=this.c.getTransform(),o=Math.sqrt(a.a*a.d);this.c.save(),this.c.shadowColor=this.palette.shadow,this.c.shadowBlur=30*e*o,this.c.shadowOffsetX=o*(2*this.width),this.c.shadowOffsetY=o*(2*this.height+15*e),this.c.fillRect(t-2*this.width,n-2*this.height,r,i),this.c.restore(),this.bgOriginX=this.currentOriginX,this.bgOriginY=this.currentOriginY,this.drawLayout(this.layers.current,0,[]),this.drawHoverHighlight(this.layers.current)}}tick(){let e=this.animationBlend,t=this.currentNode;this.animationBlend=(q()-this.animationStart)/(this.options.animateDuration??J.animateDuration),this.animationBlend<0||this.animationBlend>1?(this.currentNode=this.animationTarget,this.layers.previous=void 0,this.animationBlend=1):(this.animationBlend=1-this.animationBlend,this.animationBlend*=this.animationBlend*this.animationBlend,this.animationBlend=1-this.animationBlend,this.invalidate()),(this.animationBlend!==e||this.currentNode!==t)&&this.updateCurrentLayout(),this.draw()}resize(){this.baseLayoutCache=void 0;let e=this.width,t=this.height;this.width=Math.min(this.el.clientWidth,1600),this.height=Math.max(Math.round(this.width/2),innerHeight-200),(this.width!==e||this.height!==t||!this.layers.base)&&(this.layers.base=At([this.root],0,0,this.width-1,this.height-1)[0],this.updateCurrentLayout()),super.resize()}*iterateNodeToDraw(e,t,n){let r=e.node,[i,a,o,s]=e.box,c=(r===this.hoveredNode?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=Ze(this.getColor(e.value.node)||this.palette.fallback,this.c,this.bgOriginX,this.bgOriginY,1),e.value.children.length?(this.c.fillRect(t,n,i,Q),this.c.fillRect(t,n+a-Z,i,Z),this.c.fillRect(t,n+Q,Z,a-$),this.c.fillRect(t+i-Z,n+Q,Z,a-$)):this.c.fillRect(t,n,i,a)}}drawLayout(e,t,n){this.drawNodeBackground(e,t,n),this.drawNodeForeground(e,t,n)}drawNodeForeground(e,t,n){let r=this.iterateNodeToDraw(e,t,n);for(;;){let e=r.next();if(e.done)return;let t=e.value.node,[n,i,a,o]=e.value.box;if(dt(this.c,this.palette.stroke,n+.5,i+.5,a,o),o>=Q){this.c.fillStyle=this.palette.text;let e=a-kt,r=i+Math.round($/2),[s,c]=this.textOverflowEllipsis(this.getText(t)||``,e),l=n+Math.round((a-c)/2),u=this.getText(t),d=this.getSubtext(t);if(s===u&&t.children.length){let t=d||``;t&&u&&(t=` - ${t}`);let[i,o]=this.textOverflowEllipsis(t,e-c);l=n+Math.round((a-c-o)/2),this.c.globalAlpha=.5,this.c.fillText(i,l+c,r),this.c.globalAlpha=1}if(this.c.fillText(s,l,r),o>$+16&&!t.children.length){let[t,r]=this.textOverflowEllipsis(d||``,e);this.c.globalAlpha=.5;let s=u?Q:Q/2+Z;this.c.fillText(t,n+Math.round((a-r)/2),i+s+Math.round(o-$)/2),this.c.globalAlpha=1}}}}updateCurrentLayout(){let e=this.options.selectedPaddingRatio??.2;if(this.currentNode){let[t,n,r,i]=this.currentNode.box,a=t+r,o=n+i,s=Math.round(this.width*e/2),c=Math.round(this.height*e/2),l=this.width-s-1,u=this.height-c-1,d=this.animationTarget?this.animationBlend:1-this.animationBlend,f=Math.round(t+(s-t)*d),p=Math.round(n+(c-n)*d),m=Math.round(a+(l-a)*d),h=Math.round(o+(u-o)*d),g=e=>e-Math.floor(e/64-.5)*64;this.layers.current=At([this.currentNode.node],f,p,m-f,h-p)[0],this.currentOriginX=g(-(t+a)/2)*(1-d)+(f+m)/2,this.currentOriginY=g(-(n+o)/2)*(1-d)+(p+h)/2}else this.layers.current=void 0,this.currentOriginX=0,this.currentOriginY=0}hitTestNode(e){let t=this.canvas.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top,i=(e,t)=>{for(let a of e){let[e,o,s,c]=a.box;if(n>=e&&r>=o&&n<e+s&&r<o+c)return i(a.children,!1)||(t?null:a)}return null};return this.layers.current?i([this.layers.current],!1):i([this.layers.base],!0)}updateHover(e){let t=this.hitTestNode(e);this.changeHoveredNode(t&&t.node),this.events.emit(`hover`,t?.node||null,e)}changeHoveredNode(e){this.hoveredNode!==e&&(this.hoveredNode=e,this.canvas.style.cursor=e&&!e.children.length?`pointer`:`auto`,this.invalidate())}searchFor(e,t){for(let n of e){if(!n)continue;let e=n.node===t?n:this.searchFor(n.children,t);if(e)return e}return null}changeCurrentLayout(e,t=this.options.animate){this.animationTarget!==e&&(this.events.emit(`select`,e?.node||null),this.layers.previous=e?this.layers.current:void 0,t&&(this.animationBlend=0,this.animationStart=q(),this.animationSource=this.currentNode),this.animationTarget=e,this.currentNode=e||this.searchFor([this.layers.base],this.currentNode.node),this.updateCurrentLayout(),this.invalidate())}},Mt={flex:`~ gap-1 items-center wrap`},Nt={key:0,"i-ph-arrow-right-bold":``,"text-sm":``,"op-fade":``},Pt=[`onClick`],Ft=Object.assign(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`,Mt,[(g(!0),v(m,null,u(o.value,(e,n)=>(g(),v(m,{key:e.id},[n>0?(g(),v(`div`,Nt)):t(``,!0),b(`button`,{hover:`bg-active`,rounded:``,px1:``,onClick:t=>a(`select`,e)},[b(`span`,null,r(e.text||e.id),1)],8,Pt)],64))),128))]))}}),{__name:`ChartNavBreadcrumb`});function It(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=D(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=D(o.size).join(` `),o.children.length&&t/o.size>.1&&o.children.push({id:`${o.id}-self`,text:``,size:t,sizeSelf:t,subtext:D(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:D(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}}),x=f(()=>({animate:ie.value.chartAnimation,palette:{stroke:E.value?`#222`:`#555`,fg:E.value?`#fff`:`#000`,bg:E.value?`#111`:`#fff`},getColor:et(b.value.root,E.value?.8:.9,E.value?1:1.1),getSubtext:e=>e.subtext,...u}));function S(e,t){_.value=e?.meta,e?.children.length||(e=e?.parent),v.value?.select(e,t)}function C(){y?.(),g.value=b.value.root,d?.(),e(()=>{let e=_.value&&b.value.map.get(_.value[a])||null;e&&S(e,!1)}),y=()=>{v.value?.dispose(),v.value=void 0,_.value=void 0}}return e(()=>{h(()=>[b.value,x.value],()=>{C()},{deep:!0,immediate:!1}),C()}),i(()=>{y?.()}),{tree:b,graph:v,chartOptions:x,nodeHover:m,nodeSelected:g,selectedNode:_,selectNode:S,buildGraph:C}}export{jt as a,Ge as c,Ot as i,Ft as n,Qe as o,Ct as r,it as s,It as t};
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"./WOQUZE4V.js";import{a as x,c as S,d as C,f as w,i as ee,l as T,o as te,r as ne,u as re}from"./D4aX0j39.js";import{t as E}from"./DOP22jZa.js";import{t as D}from"./CKJSqDo0.js";import{t as ie}from"./hanhGz4p.js";function O(){return typeof window<`u`}function k(e){return ae(e)?(e.nodeName||``).toLowerCase():`#document`}function A(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function j(e){return((ae(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function ae(e){return O()?e instanceof Node||e instanceof A(e).Node:!1}function M(e){return O()?e instanceof Element||e instanceof A(e).Element:!1}function N(e){return O()?e instanceof HTMLElement||e instanceof A(e).HTMLElement:!1}function oe(e){return!O()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof A(e).ShadowRoot}function P(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 se(e){return/^(table|td|th)$/.test(k(e))}function F(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var ce=/transform|translate|scale|rotate|perspective|filter/,le=/paint|layout|strict|content/,I=e=>!!e&&e!==`none`,ue;function de(e){let t=M(e)?R(e):e;return I(t.transform)||I(t.translate)||I(t.scale)||I(t.rotate)||I(t.perspective)||!pe()&&(I(t.backdropFilter)||I(t.filter))||ce.test(t.willChange||``)||le.test(t.contain||``)}function fe(e){let t=B(e);for(;N(t)&&!L(t);){if(de(t))return t;if(F(t))return null;t=B(t)}return null}function pe(){return ue??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),ue}function L(e){return/^(html|body|#document)$/.test(k(e))}function R(e){return A(e).getComputedStyle(e)}function z(e){return M(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function B(e){if(k(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||oe(e)&&e.host||j(e);return oe(t)?t.host:t}function me(e){let t=B(e);return L(t)?e.ownerDocument?e.ownerDocument.body:e.body:N(t)&&P(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=A(r);if(i){let e=ge(a);return t.concat(a,a.visualViewport||[],P(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=N(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=w(n)!==a||w(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function ve(e){return M(e)?e:e.contextElement}function V(e){let t=ve(e);if(!N(t))return S(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=_e(t),o=(a?w(n.width):n.width)/r,s=(a?w(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var ye=S(0);function be(e){let t=A(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!==A(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=S(1);t&&(r?M(r)&&(o=V(r)):o=V(e));let s=xe(a,n,r)?be(a):S(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=A(a),t=r&&M(r)?A(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=A(i),i=ge(n)}}return C({width:u,height:d,x:c,y:l})}function U(e,t){let n=z(e).scrollLeft;return t?t.left+n:H(j(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=j(r),s=t?F(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=S(1),u=S(0),d=N(r);if((d||!d&&!a)&&((k(r)!==`body`||P(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):S(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=j(e),n=z(e),r=e.ownerDocument.body,i=T(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=T(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+U(e),s=-n.scrollTop;return R(r).direction===`rtl`&&(o+=T(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Ee=25;function De(e,t){let n=A(e),r=j(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=N(e)?V(e):S(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(j(e));else if(M(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 C(r)}function Ae(e,t){let n=B(e);return n===t||!M(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=>M(e)&&k(e)!==`body`),i=null,a=R(e).position===`fixed`,o=a?B(e):e;for(;M(o)&&!L(o);){let t=R(o),n=de(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||P(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`?F(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=T(n.top,s),c=re(n.right,c),l=re(n.bottom,l),u=T(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=N(t),i=j(t),a=n===`fixed`,o=H(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=S(0);function l(){c.x=U(i)}if(r||!r&&!a)if((k(t)!==`body`||P(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):S(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(!N(e)||R(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return j(e)===n&&(n=n.ownerDocument.body),n}function Le(e,t){let n=A(e);if(F(e))return n;if(!N(e)){let t=B(e);for(;t&&!L(t);){if(M(t)&&!Fe(t))return t;t=B(t)}return n}let r=Ie(e,t);for(;r&&se(r)&&Fe(r);)r=Ie(r,t);return r&&L(r)&&Fe(r)&&!de(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:j,getClippingRect:Me,getOffsetParent:Le,getElementRects:Re,getClientRects:we,getDimensions:Ne,getScale:V,isElement:M,isRTL:ze},Ve=x,He=te,Ue=ee,We=(e,t,n)=>{let r=new Map,i={platform:Be,...n},a={...i.platform,_c:r};return ne(e,t,{...i,platform:a})},Ge=Object.assign(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)]))}}),{__name:`DisplayGraphHoverView`});function Ke(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 qe,Je,Ye,W,G,K=1,Xe;function Ze(e,t,n,r,i){if(!Array.isArray(e))return e;let a=window.devicePixelRatio||1;if(qe!==t||Je!==a||Ye!==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;qe=t,Je=a,Ye=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()}Xe=t.createPattern(W,`repeat`),K/=n}return n/=64*K*a,n-=Math.floor(n),n*=64*K*a,Xe.setTransform(new DOMMatrix([K,0,0,K,n,r])),Xe}function Qe(e){return Array.isArray(e)?`url('data:image/svg+xml,<svg width="26" height="26" xmlns="http://www.w3.org/2000/svg"><rect width="26" height="26" fill="${e[0]}"/><rect width="26" height="26" fill="${e[1]}" fill-opacity="25%"/><path d="M22.5 -3.5L-3.5 22.5M35.5 9.5L9.5 35.5" stroke="${e[1]}" stroke-opacity="67%" stroke-width="9.19239"/></svg>')`:e}function $e(e){return t=>t.id&&e[t.id]||t.color}function et(e,t=1,n=1){let r={};return tt(r,e,0,Math.PI*2,t,n),$e(r)}function tt(e,t,n,r,i=1,a=1){let o=t.size;e[t.id]=Ke(n+r/2,i,a);for(let s of t.children){let t=s.size/o*r;tt(e,s,n,t,i,a),n+=t}}var nt=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`;function rt(e=16,t=nt){let n=``,r=e,i=t.length;for(;r--;)n+=t[Math.random()*i|0];return n}function it(e,t,n=(e,t)=>t.size-e.size){if(e.__nanovis)return e;let r={...e};return r.id||=rt(),r.parent||=t,r.children||=[],r.sizeSelf==null&&r.size!=null&&r.children.length===0?r.sizeSelf=r.size:r.sizeSelf||=0,r.children=(r.children||[]).map(e=>it(e,r,n)),r.size||=r.children.reduce((e,t)=>e+t.size,0)+r.sizeSelf,n&&r.children.sort(n),Object.defineProperty(r,`__nanovis`,{enumerable:!1,value:!0}),r}function at(e){return e.children.length===0?1:Math.max(...e.children.map(e=>at(e)))+1}var ot=/\bFirefox\//.test(navigator.userAgent),st;function ct(e){return st?st.format(e):`${e}`}function q(){return(window.performance||Date).now()}function lt(e){let t=e.toFixed(1).split(`.`,2);return`${ct(+t[0])}.${t[1]}`}function ut(e){return e===1?`1 byte`:e<1024?`${ct(e)} bytes`:e<1024*1024?`${lt(e/1024)} kb`:e<1024*1024*1024?`${lt(e/(1024*1024))} mb`:`${lt(e/(1024*1024*1024))} gb`}function dt(e,t,n,r,i,a){if(ot){let o=e.lineWidth,s=o/2;e.fillStyle=t,e.fillRect(n-s,r-s,i+o,o),e.fillRect(n-s,r+s,o,a-o),e.fillRect(n-s,r+a-s,i+o,o),e.fillRect(n+i-s,r+s,o,a-o);return}e.strokeStyle=t,e.strokeRect(n,r,i,a)}function ft(e){return window.addEventListener(`wheel`,e,{passive:!1}),()=>window.removeEventListener(`wheel`,e)}function pt(e){return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)}try{st=new Intl.NumberFormat}catch{}var mt=()=>({emit(e,...t){for(let n=this.events[e]||[],r=0,i=n.length;r<i;r++)n[r](...t)},events:{},on(e,t){return(this.events[e]||=[]).push(t),()=>{this.events[e]=this.events[e]?.filter(e=>t!==e)}}}),J={getText:e=>e.text,getSubtext:e=>e.subtext,animate:!0,animateDuration:350},ht={fallback:`#CCC`,stroke:`#0008`,text:`#222`,hover:`#fff5`,shadow:`#0008`,fg:`#fff`,bg:`#222`},gt=46,_t=`14px sans-serif`,vt=`bold ${_t}`,yt=class{el;canvas;c;width=0;height=0;ratio=1;root;maxDepth;events;options;palette;disposables;getColor;getText;getSubtext;_animationFrame=null;constructor(e,t){this.options={...J,...t};let{getColor:n=et(e),getText:r=()=>void 0,getSubtext:i=()=>void 0}=this.options;this.palette={...ht,...t.palette},this.el=document.createElement(`div`),this.canvas=document.createElement(`canvas`),this.c=this.canvas.getContext(`2d`),this.root=e,this.maxDepth=at(e),this.disposables=[],this.events=mt(),this.getColor=n,this.getText=r,this.getSubtext=i,this.setFont(_t),t.onClick&&this.events.on(`click`,t.onClick),t.onHover&&this.events.on(`hover`,t.onHover),t.onLeave&&this.events.on(`leave`,t.onLeave),t.onSelect&&this.events.on(`select`,t.onSelect),this.el.addEventListener(`mouseleave`,()=>{this.events.emit(`leave`)})}invalidate(){this._animationFrame===null&&(this._animationFrame=requestAnimationFrame(()=>{this._animationFrame=null,this.tick()}))}tick(){this.draw()}draw(){}resize(){this.ratio=window.devicePixelRatio||1,this.canvas.style.width=`${this.width}px`,this.canvas.style.height=`${this.height}px`,this.canvas.width=Math.round(this.width*this.ratio),this.canvas.height=Math.round(this.height*this.ratio),this.c.scale(this.ratio,this.ratio),this.draw()}select(e,t){this.events.emit(`select`,e)}dispose(){this.disposables.forEach(e=>e()),this.disposables.length=0,this.el.remove()}[Symbol.dispose](){this.dispose()}_font=`14px sans-serif`;_fontWidthCache=new Map;ellipsisWidth=0;getFontCache(){return this._fontWidthCache.has(this._font)||this._fontWidthCache.set(this._font,{}),this._fontWidthCache.get(this._font)}setFont(e){this._font=e,this.c.font=e,this.c.textBaseline=`middle`,this.ellipsisWidth=3*this.charCodeWidth(gt)}charCodeWidth(e){let t=this.getFontCache(),n=t[e];return n===void 0&&(n=this.c.measureText(String.fromCharCode(e)).width,t[e]=n),n}textOverflowEllipsis(e,t){if(t<this.ellipsisWidth)return[``,0];let n=0,r=e.length,i=0;for(;i<r;){let r=this.charCodeWidth(e.charCodeAt(i));if(t<n+this.ellipsisWidth+r)return[`${e.slice(0,i)}...`,n+this.ellipsisWidth];n+=r,i++}return[e,n]}},Y=24,bt=5,xt=.01,St=1e3,Ct=class extends yt{mainEl=document.createElement(`div`);totalBytes;viewportMin;viewportMax;zoomedOutMin=0;zoomedOutWidth=0;prevWheelTime=0;prevWheelWasZoom=!1;stripeScaleAdjust=1;hoveredNode=null;selectedNode=null;nodeStartBytes=new Map;animationFromMin=0;animationFromMax=0;animationToMin=0;animationToMax=0;animationStart=0;constructor(e,t={}){super(e,t),this.totalBytes=e.size,this.viewportMin=this.animationFromMin=this.animationToMin=0,this.viewportMax=this.animationFromMax=this.animationToMax=this.totalBytes,Object.assign(this.mainEl.style,{position:`relative`}),Object.assign(this.canvas.style,{position:`absolute`,left:`0`,top:`0`});let n=!1;this.canvas.onmousedown=e=>{if(n=!1,e.button!==2){let t=e.pageX,r=e=>{let r=e.pageX-t;!n&&Math.abs(r)<3||(n=!0,this.modifyViewport(-r,0,null),t=e.pageX)},i=()=>{document.removeEventListener(`mousemove`,r),document.removeEventListener(`mouseup`,i)};e.preventDefault(),document.addEventListener(`mousemove`,r),document.addEventListener(`mouseup`,i)}},this.canvas.onmousemove=e=>{this.updateHover(e)},this.canvas.onmouseout=()=>{this.changeHoveredNode(null)},this.canvas.onclick=e=>{if(n)return;let t=this.hitTestNode(e);this.changeHoveredNode(t),this.changeSelectedNode(t),t&&this.events.emit(`click`,t,e)},this.disposables.push(ft(e=>{let t=e.deltaX,n=e.deltaY,r=q(),i=r-this.prevWheelTime<50?this.prevWheelWasZoom:e.ctrlKey||e.metaKey;this.prevWheelTime=r,this.prevWheelWasZoom=i,(i||Math.abs(t)>=Math.abs(n))&&e.preventDefault(),this.modifyViewport(t,n,i?e.pageX:null),this.updateHover(e)})),this.resize(),Promise.resolve().then(()=>this.resize()),this.disposables.push(pt(()=>this.resize())),this.mainEl.append(this.canvas),this.el.append(this.mainEl)}tick(){let e=(q()-this.animationStart)/(this.options.animateDuration??J.animateDuration);e<0||e>1?(e=1,this.viewportMin=this.animationToMin,this.viewportMax=this.animationToMax):(e<.5?e*=4*e*e:(e=1-e,e*=4*e*e,e=1-e),this.viewportMin=this.animationFromMin+(this.animationToMin-this.animationFromMin)*e,this.viewportMax=this.animationFromMax+(this.animationToMax-this.animationFromMax)*e,this.invalidate()),this.draw()}draw(){this.c.clearRect(0,0,this.width,this.height),this.drawNode(this.root,0,0,-1/0,1)}changeSelectedNode(e,t=this.options.animate??J.animate){if(this.selectedNode!==e&&(this.selectedNode=e,this.events.emit(`select`,e),e&&this.nodeStartBytes.has(e.id))){let n=this.nodeStartBytes.get(e.id),r=n+e.size;n=Math.max(0,n-e.size*xt),r=Math.min(this.totalBytes,r+e.size*xt),this.setViewport(n,r,t)}}select(e,t=this.options.animate??J.animate){this.changeSelectedNode(e,t)}resize(){this.width=this.el.clientWidth,this.height=this.maxDepth*Y+1,this.zoomedOutMin=this.width-St>>1,this.zoomedOutWidth=this.zoomedOutMin+St,this.zoomedOutMin<0&&(this.zoomedOutMin=0),this.zoomedOutWidth>this.width&&(this.zoomedOutWidth=this.width),this.zoomedOutWidth-=this.zoomedOutMin,this.stripeScaleAdjust=this.totalBytes/this.zoomedOutWidth,this.mainEl.style.height=`${this.height}px`,super.resize()}drawNode(e,t,n,r,i){this.nodeStartBytes.set(e.id,n);let a=this.zoomedOutWidth/(this.viewportMax-this.viewportMin),o=this.zoomedOutMin+(n-this.viewportMin)*a,s=e.size*a,c=o+s;if(c<r+1.5)return r;if(o+s<0||o>this.width)return c;let l=s<2?2:s,u=(o>0?o:0)+bt,d=t+Y/2,f=this.getText(e)||``,p=this.getSubtext(e)||``,m,h=0,g=s+o-u,_=Ze(this.getColor(e)||this.palette.fallback,this.c,this.zoomedOutMin-this.viewportMin*a,Y,a*this.stripeScaleAdjust),v=this.palette.text,y=-1/0;i&1?(v=this.palette.fg,this.setFont(vt)):(this.c.fillStyle=_,this.c.fillRect(o,t,l,Y),(i&2||this.hoveredNode&&e.id===this.hoveredNode.id)&&(this.c.fillStyle=this.palette.hover,this.c.fillRect(o,t,l,Y),i|=2)),this.ellipsisWidth<g&&(m=this.c.measureText(f).width,m<=g?h+=m:(f=this.textOverflowEllipsis(f,g)[0],h=g),this.c.fillStyle=v,this.c.fillText(f,u,d)),i&1&&this.setFont(_t),h+this.ellipsisWidth<g&&(p&&f&&(p=` - ${p}`),m=this.c.measureText(p).width,h+m>g&&(p=this.textOverflowEllipsis(p,g-h)[0]),this.c.globalAlpha=.5,this.c.fillText(p,u+h,d),this.c.globalAlpha=1);for(let r of e.children)y=this.drawNode(r,t+Y,n,y,i&-2),n+=r.size;return i&1||dt(this.c,this.palette.stroke,o+.5,t+.5,l,Y),c}changeHoveredNode(e){this.hoveredNode!==e&&(this.hoveredNode=e,this.canvas.style.cursor=e&&!e.children.length?`pointer`:`auto`,this.invalidate())}hitTestNode(e){let t=this.canvas.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top,i=this.viewportMin+(this.viewportMax-this.viewportMin)/this.zoomedOutWidth*(n-this.zoomedOutMin),a=(e,t,n)=>{if(i>=n&&i<n+e.size){if(r>=t&&r<t+Y&&e.id)return e;if(r>=t+Y)for(let r of e.children){let e=a(r,t+Y,n);if(e)return e;n+=r.size}}return null};return a(this.root,0,0)}modifyViewport(e,t,n){let r=this.viewportMin,i=this.viewportMax,a=0;if(n!==null){let e=r+(i-r)/this.zoomedOutWidth*(n-this.zoomedOutMin),a=1.01**t;r=e+(r-e)*a,i=e+(i-e)*a}else a=e*(i-r)/this.zoomedOutWidth;r+a<0?a=-r:i+a>this.totalBytes&&(a=this.totalBytes-i),r+=a,i+=a,r<0&&(r=0),i>this.totalBytes&&(i=this.totalBytes),this.setViewport(r,i,!1)}setViewport(e,t,n){this.animationFromMin=this.viewportMin,this.animationFromMax=this.viewportMax,this.animationToMin=e,this.animationToMax=t,n?this.animationStart=q():this.animationStart=0,this.invalidate()}updateHover(e){let t=this.hitTestNode(e);this.changeHoveredNode(t),this.events.emit(`hover`,t,e)}};function wt(e,t){for(;t;){if(t===e)return!0;t=t.parent}return!1}function Tt(e,t,n){if(e===t)return;let r=t.parent,i=r.size||1,a=0;Tt(e,r,n);for(let e of r.children){if(e===t){n.startAngle_+=n.sweepAngle_*a/i,n.sweepAngle_=e.size/i*n.sweepAngle_;break}a+=e.size}n.depth_+=1}var Et={};function Dt(e){return Et[e]||(Et[e]=400*Math.log(1+Math.log(1+e/8))),Et[e]}var X=-Math.PI/2,Ot=class extends yt{currentNode;hoveredNode;centerX=0;centerY=0;animationStart=0;radiusScale=1;sourceDepth=0;sourceStartAngle=X;sourceSweepAngle=Math.PI*2;targetNode;targetDepth=this.sourceDepth;targetStartAngle=this.sourceStartAngle;targetSweepAngle=this.sourceSweepAngle;animatedNode;animatedDepth=this.sourceDepth;animatedStartAngle=this.sourceStartAngle;animatedSweepAngle=this.sourceSweepAngle;previousHoveredNode;historyStack=[];constructor(e,t={}){for(;e.children.length===1;)e=e.children[0];super(e,t),this.currentNode=e,this.targetNode=this.currentNode,this.animatedNode=this.currentNode,this.canvas.onmousemove=e=>{this.handleMouseMove(e)},this.canvas.onmouseout=e=>{this.changeHoveredNode(void 0),this.events.emit(`hover`,null,e)},this.canvas.onclick=e=>{let t=this.hitTestNode(e);if(!t)return;this.events.emit(`click`,t,e);let n=[];t===this.animatedNode.parent?this.historyStack.length>0&&(t=this.historyStack.pop(),n=this.historyStack.slice()):n=this.historyStack.concat(this.currentNode),this.events.emit(`click`,t,e),t.children.length>0?(this.select(t),this.historyStack=n):e.preventDefault()},this.el.append(this.canvas),this.resize(),Promise.resolve().then(()=>this.resize()),this.disposables.push(pt(()=>this.resize())),this.disposables.push(ft(e=>this.handleMouseMove(e)))}select(e,t){(this.currentNode!==e||this.root)&&(this.currentNode=e||this.root,this.updateSunburst(t),this.events.emit(`select`,e))}resize(){this.width=this.el.clientWidth,this.height=this.width,this.centerX=this.width>>1,this.centerY=this.height>>1;let e=2*Math.ceil(Dt(this.maxDepth));this.radiusScale=this.width/e,super.resize()}draw(){this.c.clearRect(0,0,this.width,this.height),this.drawNode(this.animatedNode,this.animatedDepth,this.computeRadius(this.animatedDepth),this.animatedStartAngle,this.animatedSweepAngle,3,-1/0),this.c.strokeStyle=this.palette.stroke,this.c.beginPath(),this.drawNode(this.animatedNode,this.animatedDepth,this.computeRadius(this.animatedDepth),this.animatedStartAngle,this.animatedSweepAngle,1,-1/0),this.c.stroke(),this.animatedDepth===0&&(this.c.fillStyle=this.palette.stroke,this.setFont(vt),this.c.textAlign=`center`,this.c.fillText(this.getSubtext(this.targetNode)??ut(this.targetNode.size),this.centerX,this.centerY))}drawNode(e,t,n,r,i,a,o){let s=this.computeRadius(t+1);if(s>this.centerY)return o;e===this.hoveredNode&&(a|=8);let c=(n+s)/2,l=r+i;if(l-o<1.5/c)return o;let u=2/c;if(i>u&&(u=i),a&2)this.c.fillStyle=Ze(this.getColor(e)||this.palette.fallback,this.c,this.centerX,this.centerY,1),this.c.beginPath(),this.c.arc(this.centerX,this.centerY,n,r,r+u,!1),this.c.arc(this.centerX,this.centerY,s,r+u,r,!0),this.c.fill(),this.hoveredNode&&(a&8||e.parent===this.hoveredNode)&&(this.c.fillStyle=this.palette.hover,this.c.fill());else{let e=u===Math.PI*2,t=a&4||e?s:n;a&1&&n>0&&this.c.arc(this.centerX,this.centerY,n,r+u,r,!0),this.c.moveTo(this.centerX+t*Math.cos(r),this.centerY+t*Math.sin(r)),this.c.arc(this.centerX,this.centerY,s,r,r+u,!1),e||this.c.lineTo(this.centerX+n*Math.cos(r+u),this.centerY+n*Math.sin(r+u))}let d=e.size,f=a&10,p=0,m=-1/0;for(let n of e.children)m=this.drawNode(n,t+1,s,r+i*p/d,n.size/d*i,f,m),p+=n.size,f|=4;return l}changeHoveredNode(e,t){this.hoveredNode!==e&&(this.hoveredNode=e,this.updateSunburst(t))}hitTestNode(e){let t=this.canvas.getBoundingClientRect(),n=e.clientX-t.left-this.centerX,r=e.clientY-t.top-this.centerY,i=Math.sqrt(n*n+r*r),a=Math.atan2(r,n),o=(e,t,n,r,s)=>{let c=this.computeRadius(t+1);if(c>this.centerY)return;if(i>=n&&i<c){let t=a-r;if(t/=Math.PI*2,t-=Math.floor(t),t*=Math.PI*2,t<s)return e===this.animatedNode?e.parent:e}let l=e.size,u=0;for(let n of e.children){let e=o(n,t+1,c,r+s*u/l,n.size/l*s);if(e)return e;u+=n.size}};return o(this.animatedNode,this.animatedDepth,this.computeRadius(this.animatedDepth),this.animatedStartAngle,this.animatedSweepAngle)}tick(){let e=(q()-this.animationStart)/(this.options.animateDuration??J.animateDuration);e<0||e>1?(e=1,this.animatedNode=this.targetNode,this.targetDepth=0,this.targetStartAngle=X,this.targetSweepAngle=Math.PI*2):(e<.5?e*=4*e*e:(e=1-e,e*=4*e*e,e=1-e),this.invalidate()),this.animatedDepth=this.sourceDepth+(this.targetDepth-this.sourceDepth)*e,this.animatedStartAngle=this.sourceStartAngle+(this.targetStartAngle-this.sourceStartAngle)*e,this.animatedSweepAngle=this.sourceSweepAngle+(this.targetSweepAngle-this.sourceSweepAngle)*e,this.draw()}handleMouseMove(e){let t=this.hitTestNode(e);this.changeHoveredNode(t),t&&t!==this.animatedNode.parent?(this.events.emit(`hover`,t,e),this.canvas.style.cursor=`pointer`):this.events.emit(`hover`,null,e)}computeRadius(e){return Dt(e)*this.radiusScale}updateSunburst(e=this.options.animate??!0){if(this.previousHoveredNode!==this.hoveredNode&&(this.previousHoveredNode=this.hoveredNode,this.hoveredNode||(this.canvas.style.cursor=`auto`,this.events.emit(`hover`,null)),this.invalidate()),this.targetNode!==this.currentNode){if(this.historyStack.length=0,this.invalidate(),e&&(this.animationStart=q()),wt(this.animatedNode,this.currentNode)){let e={depth_:this.animatedDepth,startAngle_:this.animatedStartAngle,sweepAngle_:this.animatedSweepAngle};Tt(this.animatedNode,this.currentNode,e),this.animatedDepth=e.depth_,this.animatedStartAngle=e.startAngle_,this.animatedSweepAngle=e.sweepAngle_,this.targetDepth=0,this.targetStartAngle=X,this.targetSweepAngle=Math.PI*2,this.animatedNode=this.currentNode}else if(wt(this.currentNode,this.animatedNode)){let e={depth_:0,startAngle_:X,sweepAngle_:Math.PI*2};Tt(this.currentNode,this.animatedNode,e),this.targetDepth=e.depth_,this.targetStartAngle=e.startAngle_,this.targetSweepAngle=e.sweepAngle_}else this.animationStart=-1/0,this.animatedNode=this.currentNode;this.sourceDepth=this.animatedDepth,this.sourceStartAngle=this.animatedStartAngle,this.sourceSweepAngle=this.animatedSweepAngle,this.targetNode=this.currentNode,this.events.emit(`select`,this.currentNode)}}},Z=4,Q=20,kt=2*Z,$=Q+Z;function At(e,t,n,r,i){let a=[],o=(t,n,r,i,a)=>{let o=e[t].size*a,s=e[n].size*a;return Math.max(r*r*o/(i*i),i*i/(r*r*s))};return((t,n,r,i,s)=>{for(;t<e.length;){let c=0;for(let n=t;n<e.length;n++)c+=e[n].size;let l=Math.min(i,s),u=i*s/c,d=t,f=0,p=0;for(;d<e.length;){let n=e[d].size*u,r=o(t,d,l,f+n,u);if(d>t&&p<r)break;f+=n,p=r,d++}let m=Math.round(f/l),h=0;for(let o=t;o<d;o++){let t=e[o],c=t.size*u,d=Math.round(l*h/f),p=Math.round(l*(h+c)/f),[g,_,v,y]=i>=s?[n,r+d,m,p-d]:[n+d,r,p-d,m];a.push({node:t,box:[g,_,v,y],children:v>kt&&y>$?At(t.children,g+Z,_+Q,v-kt,y-$):[]}),h+=c}t=d,i>=s?(n+=m,i-=m):(r+=m,s-=m)}})(0,t,n,r,i),a}var jt=class extends yt{hoveredNode=null;currentNode=null;bgOriginX=0;bgOriginY=0;layers={base:null};baseLayoutCache;currentOriginX=0;currentOriginY=0;animationStart=0;animationBlend=1;animationSource=null;animationTarget=null;constructor(e,t={}){super(e,t),this.canvas.addEventListener(`mousemove`,e=>{this.updateHover(e)}),this.canvas.addEventListener(`mouseout`,e=>{this.changeHoveredNode(null),this.events.emit(`hover`,null,e)}),this.el.addEventListener(`click`,e=>{let t=this.hitTestNode(e);if(t){let n=t.node;this.events.emit(`click`,n,e),n.children.length?t===this.layers.current?this.updateHover(e):(this.changeCurrentLayout(t),this.changeHoveredNode(null)):this.updateHover(e)}else this.currentNode&&(this.changeCurrentLayout(null),this.updateHover(e))}),this.el.append(this.canvas),this.resize(),Promise.resolve().then(()=>this.resize()),this.disposables.push(ft(e=>this.updateHover(e))),this.disposables.push(pt(()=>this.resize()))}select(e,t){let n=null;e===this.root&&(e=null),n=e?this.searchFor([this.layers.current,this.layers.base],e):null,this.changeCurrentLayout(n,t)}drawBaseLayout(){!this.width||!this.height||(this.c.clearRect(0,0,this.width,this.height),this.bgOriginX=this.bgOriginY=0,this.baseLayoutCache?this.c.putImageData(this.baseLayoutCache,0,0):(this.drawLayout(this.layers.base,0,[]),this.baseLayoutCache=this.c.getImageData(0,0,this.width*this.ratio,this.height*this.ratio)))}draw(){this.drawBaseLayout(),this.layers.current||this.drawHoverHighlight(this.layers.base);let e=this.layers.current?this.animationSource?this.animationTarget?1:1-this.animationBlend:this.animationBlend:0;if(this.layers.current){let[t,n,r,i]=this.layers.base.box;this.c.globalAlpha=.6*(!this.layers.current||!this.animationSource?1:e),this.c.fillStyle=this.palette.bg,this.c.fillRect(t,n,r,i),this.c.globalAlpha=1}if(this.layers.previous&&this.drawLayout(this.layers.previous,1,[this.layers.current]),this.layers.current){let[t,n,r,i]=this.layers.current.box,a=this.c.getTransform(),o=Math.sqrt(a.a*a.d);this.c.save(),this.c.shadowColor=this.palette.shadow,this.c.shadowBlur=30*e*o,this.c.shadowOffsetX=o*(2*this.width),this.c.shadowOffsetY=o*(2*this.height+15*e),this.c.fillRect(t-2*this.width,n-2*this.height,r,i),this.c.restore(),this.bgOriginX=this.currentOriginX,this.bgOriginY=this.currentOriginY,this.drawLayout(this.layers.current,0,[]),this.drawHoverHighlight(this.layers.current)}}tick(){let e=this.animationBlend,t=this.currentNode;this.animationBlend=(q()-this.animationStart)/(this.options.animateDuration??J.animateDuration),this.animationBlend<0||this.animationBlend>1?(this.currentNode=this.animationTarget,this.layers.previous=void 0,this.animationBlend=1):(this.animationBlend=1-this.animationBlend,this.animationBlend*=this.animationBlend*this.animationBlend,this.animationBlend=1-this.animationBlend,this.invalidate()),(this.animationBlend!==e||this.currentNode!==t)&&this.updateCurrentLayout(),this.draw()}resize(){this.baseLayoutCache=void 0;let e=this.width,t=this.height;this.width=Math.min(this.el.clientWidth,1600),this.height=Math.max(Math.round(this.width/2),innerHeight-200),(this.width!==e||this.height!==t||!this.layers.base)&&(this.layers.base=At([this.root],0,0,this.width-1,this.height-1)[0],this.updateCurrentLayout()),super.resize()}*iterateNodeToDraw(e,t,n){let r=e.node,[i,a,o,s]=e.box,c=r===this.hoveredNode|(e===this.animationTarget?2:0);if(t===1)for(let e of n){if(!e)continue;let[n,r,c,l]=e.box;if(i>=n&&a>=r&&i+o<=n+c&&a+s<=r+l){t=2;break}}for(let r of e.children)c|=yield*this.iterateNodeToDraw(r,t,n);return t!==2&&(yield e),c}drawHoverHighlight(e){let t=this.iterateNodeToDraw(e,0,[]),n=this.c.globalCompositeOperation;for(;;){let e=t.next();if(e.done){this.c.globalCompositeOperation=n;return}let r=e.value.node;if(this.hoveredNode===r){this.c.globalCompositeOperation=`overlay`;let[t,n,r,i]=e.value.box;this.c.fillStyle=this.palette.hover,this.c.fillRect(t,n,r,i)}}}drawNodeBackground(e,t,n){let r=this.iterateNodeToDraw(e,t,n);for(;;){let e=r.next();if(e.done)return e.value;let[t,n,i,a]=e.value.box;this.c.fillStyle=Ze(this.getColor(e.value.node)||this.palette.fallback,this.c,this.bgOriginX,this.bgOriginY,1),e.value.children.length?(this.c.fillRect(t,n,i,Q),this.c.fillRect(t,n+a-Z,i,Z),this.c.fillRect(t,n+Q,Z,a-$),this.c.fillRect(t+i-Z,n+Q,Z,a-$)):this.c.fillRect(t,n,i,a)}}drawLayout(e,t,n){this.drawNodeBackground(e,t,n),this.drawNodeForeground(e,t,n)}drawNodeForeground(e,t,n){let r=this.iterateNodeToDraw(e,t,n);for(;;){let e=r.next();if(e.done)return;let t=e.value.node,[n,i,a,o]=e.value.box;if(dt(this.c,this.palette.stroke,n+.5,i+.5,a,o),o>=Q){this.c.fillStyle=this.palette.text;let e=a-kt,r=i+Math.round($/2),[s,c]=this.textOverflowEllipsis(this.getText(t)||``,e),l=n+Math.round((a-c)/2),u=this.getText(t),d=this.getSubtext(t);if(s===u&&t.children.length){let t=d||``;t&&u&&(t=` - ${t}`);let[i,o]=this.textOverflowEllipsis(t,e-c);l=n+Math.round((a-c-o)/2),this.c.globalAlpha=.5,this.c.fillText(i,l+c,r),this.c.globalAlpha=1}if(this.c.fillText(s,l,r),o>$+16&&!t.children.length){let[t,r]=this.textOverflowEllipsis(d||``,e);this.c.globalAlpha=.5;let s=u?Q:Q/2+Z;this.c.fillText(t,n+Math.round((a-r)/2),i+s+Math.round(o-$)/2),this.c.globalAlpha=1}}}}updateCurrentLayout(){let e=this.options.selectedPaddingRatio??.2;if(this.currentNode){let[t,n,r,i]=this.currentNode.box,a=t+r,o=n+i,s=Math.round(this.width*e/2),c=Math.round(this.height*e/2),l=this.width-s-1,u=this.height-c-1,d=this.animationTarget?this.animationBlend:1-this.animationBlend,f=Math.round(t+(s-t)*d),p=Math.round(n+(c-n)*d),m=Math.round(a+(l-a)*d),h=Math.round(o+(u-o)*d),g=e=>e-Math.floor(e/64-.5)*64;this.layers.current=At([this.currentNode.node],f,p,m-f,h-p)[0],this.currentOriginX=g(-(t+a)/2)*(1-d)+(f+m)/2,this.currentOriginY=g(-(n+o)/2)*(1-d)+(p+h)/2}else this.layers.current=void 0,this.currentOriginX=0,this.currentOriginY=0}hitTestNode(e){let t=this.canvas.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top,i=(e,t)=>{for(let a of e){let[e,o,s,c]=a.box;if(n>=e&&r>=o&&n<e+s&&r<o+c)return i(a.children,!1)||(t?null:a)}return null};return this.layers.current?i([this.layers.current],!1):i([this.layers.base],!0)}updateHover(e){let t=this.hitTestNode(e);this.changeHoveredNode(t&&t.node),this.events.emit(`hover`,t?.node||null,e)}changeHoveredNode(e){this.hoveredNode!==e&&(this.hoveredNode=e,this.canvas.style.cursor=e&&!e.children.length?`pointer`:`auto`,this.invalidate())}searchFor(e,t){for(let n of e){if(!n)continue;let e=n.node===t?n:this.searchFor(n.children,t);if(e)return e}return null}changeCurrentLayout(e,t=this.options.animate){this.animationTarget!==e&&(this.events.emit(`select`,e?.node||null),this.layers.previous=e?this.layers.current:void 0,t&&(this.animationBlend=0,this.animationStart=q(),this.animationSource=this.currentNode),this.animationTarget=e,this.currentNode=e||this.searchFor([this.layers.base],this.currentNode.node),this.updateCurrentLayout(),this.invalidate())}},Mt={flex:`~ gap-1 items-center wrap`},Nt={key:0,"i-ph-arrow-right-bold":``,"text-sm":``,"op-fade":``},Pt=[`onClick`],Ft=Object.assign(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`,Mt,[(g(!0),v(m,null,u(o.value,(e,n)=>(g(),v(m,{key:e.id},[n>0?(g(),v(`div`,Nt)):t(``,!0),b(`button`,{hover:`bg-active`,rounded:``,px1:``,onClick:t=>a(`select`,e)},[b(`span`,null,r(e.text||e.id),1)],8,Pt)],64))),128))]))}}),{__name:`ChartNavBreadcrumb`});function It(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=D(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=D(o.size).join(` `),o.children.length&&t/o.size>.1&&o.children.push({id:`${o.id}-self`,text:``,size:t,sizeSelf:t,subtext:D(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:D(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}}),x=f(()=>({animate:ie.value.chartAnimation,palette:{stroke:E.value?`#222`:`#555`,fg:E.value?`#fff`:`#000`,bg:E.value?`#111`:`#fff`},getColor:et(b.value.root,E.value?.8:.9,E.value?1:1.1),getSubtext:e=>e.subtext,...u}));function S(e,t){_.value=e?.meta,e?.children.length||(e=e?.parent),v.value?.select(e,t)}function C(){y?.(),g.value=b.value.root,d?.(),e(()=>{let e=_.value&&b.value.map.get(_.value[a])||null;e&&S(e,!1)}),y=()=>{v.value?.dispose(),v.value=void 0,_.value=void 0}}return e(()=>{h(()=>[b.value,x.value],()=>{C()},{deep:!0,immediate:!1}),C()}),i(()=>{y?.()}),{tree:b,graph:v,chartOptions:x,nodeHover:m,nodeSelected:g,selectedNode:_,selectNode:S,buildGraph:C}}export{jt as a,Ge as c,Ot as i,Ft as n,Qe as o,Ct as r,it as s,It as t};
@@ -0,0 +1 @@
1
+ import{B as e,F as t,H as n,L as r,M as i,Y as a,_ as o,bt as s,g as c,h as l,i as u,ot as d,xt as f}from"./WOQUZE4V.js";import{E as p,T as m,c as h,l as g,s as _,w as v}from"./BeLy3b84.js";var y=`modulepreload`,b=function(e,t){return new URL(e,t).href},x={},S=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=b(t,n),t in x)return;x[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:y,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},C=/(:\w+)\([^)]+\)/g,w=/(:\w+)[?+*]/g,T=/:\w+/g,E=(e,t)=>t.path.replace(C,`$1`).replace(w,`$1`).replace(T,t=>e.params[t.slice(1)]?.toString()||``),D=(e,t)=>{let n=e.route.matched.find(t=>t.components?.default===e.Component.type),r=t??n?.meta.key??(n&&E(e.route,n));return typeof r==`function`?r(e.route):r},O=(e,n)=>({default:()=>e?t(c,e===!0?{}:e,n):n});function k(e){return Array.isArray(e)?e:[e]}var A=(e=`RouteProvider`)=>i({name:e,props:{route:{type:Object,required:!0},vnode:Object,vnodeRef:Object,renderKey:String,trackRootNodes:Boolean},setup(e){let n=e.renderKey,r=e.route,i={};for(let t in e.route)Object.defineProperty(i,t,{get:()=>n===e.renderKey?e.route[t]:r[t],enumerable:!0});return a(p,f(i)),()=>e.vnode?t(e.vnode,{ref:e.vnodeRef}):e.vnode}}),j=A(),M=new WeakMap,N=i({name:`NuxtPage`,inheritAttrs:!1,props:{name:{type:String},transition:{type:[Boolean,Object],default:void 0},keepalive:{type:[Boolean,Object],default:void 0},route:{type:Object},pageKey:{type:[Function,String],default:null}},setup(i,{attrs:a,slots:c,expose:l}){let f=u(),y=s(),b=r(p,null),x;l({pageRef:y});let S=r(m,null),C,w=f.deferHydration(),T=!1,E=0;if(f.isHydrating){let e=f.hooks.hookOnce(`app:error`,w);v().beforeEach(e)}i.pageKey&&d(()=>i.pageKey,(e,t)=>{e!==t&&f.callHook(`page:loading:start`)});let k=!1;{let e=v().beforeResolve(()=>{k=!1});n(()=>{e(),w()})}return()=>t(g,{name:i.name,route:i.route,...a},{default:n=>{let r=P(b,n.route,n.Component),a=b&&b.matched.length===n.route.matched.length;if(!n.Component){if(C&&!a)return C;w();return}if(C&&S&&!S.isCurrent(n.route))return C;if(r&&b&&(!S||S?.isCurrent(b)))return a||C?C:null;let s=D(n,i.pageKey),l=F(b,n.route,n.Component);!f.isHydrating&&x===s&&!l&&e(()=>{k||(k=!0,f.callHook(`page:loading:end`))}),T&&x!==s&&E++,x=s;let u=!!(i.transition??n.route.meta.pageTransition??!1),d=u&&_([i.transition,n.route.meta.pageTransition,!1,{onAfterLeave(){f[`~transitionFinish`]?.(),delete f[`~transitionFinish`],delete f[`~transitionPromise`],f.callHook(`page:transition:finish`,n.Component)}}]),p=i.keepalive??n.route.meta.keepalive??!1;return C=h(u&&d,O(p,t(o,{key:E,suspensible:!0,onPending:()=>{T=!0,u&&!f[`~transitionPromise`]&&(f[`~transitionPromise`]=new Promise(e=>{f[`~transitionFinish`]=e})),f.callHook(`page:start`,n.Component)},onResolve:async()=>{T=!1;try{await e(),f._route.sync?.(),await f.callHook(`page:finish`,n.Component),!k&&!l&&(k=!0,await f.callHook(`page:loading:end`))}finally{w()}}},{default:()=>{let e={key:s||void 0,vnode:c.default?I(c.default,n):n.Component,route:n.route,renderKey:s||void 0,trackRootNodes:u,vnodeRef:y};if(!p)return t(j,e);let r=n.Component.type,i=r,a=M.get(i);return a||(a=A(r.name||r.__name),M.set(i,a)),t(a,e)}}))).default(),C}})}});function P(e,t,n){if(!e)return!1;let r=t.matched.findIndex(e=>e.components?.default===n?.type);return!r||r===-1?!1:t.matched.slice(0,r).some((t,n)=>t.components?.default!==e.matched[n]?.components?.default)||n&&D({route:t,Component:n})!==D({route:e,Component:n})}function F(e,t,n){return e?t.matched.findIndex(e=>e.components?.default===n?.type)<t.matched.length-1:!1}function I(e,n){let r=e(n);return r.length===1?t(r[0]):t(l,void 0,r)}export{k as n,S as r,N as t};
@@ -1 +1 @@
1
- import{i as e,r as t}from"./fdFrOGYe.js";import{A as n,C as r,Et as i,Gt as a,Ht as o,M as s,S as c,Z as l,b as u,bt as d,ct as f,h as p,k as m,lt as h,q as g,tt as _,w as v,x as y,z as b}from"./CEtF9LWU.js";import{t as x}from"./BdJ_JF0w.js";import{t as S}from"./CZg4aoum.js";import{r as C,t as w}from"./CfGVkjRe.js";import{t as T}from"./XDMGgUv8.js";import{t as E}from"./COS9SmxY.js";var D={flex:`~ col gap-2`},O={flex:`~ gap-1 items-center`,"font-mono":``,op50:``,"text-sm":``},k={"font-mono":``,"font-sm":``},A={key:0,flex:`~ gap-1 items-center`},j={key:0,op50:``,"text-xs":``,border:`~ base rounded-md`,px1:``,"font-mono":``},M=Object.assign(s({__name:`SessionSelector`,props:{sessionMode:{},sessions:{},selectedSessionIds:{},selectedSessions:{}},emits:[`select`],setup(e,{emit:t}){let o=e,s=t;function d(e){return E(e.meta.inputs[0]?.filename??``,e.meta.cwd).path}let f=u(()=>{let e=o.selectedSessions?.[0];return e?d(e):``});function S(e){return f.value&&f.value!==d(e)}function M(e){o.sessionMode===`compare`&&!S(e)&&s(`select`,e)}return(t,o)=>{let s=w;return g(),v(`div`,D,[(g(!0),v(p,null,l(e.sessions,t=>(g(),v(`div`,{key:t.id,flex:`~ row gap-2`,relative:``},[(g(),c(_(e.sessionMode===`list`?i(x):`button`),b({to:`/session/${t.id}`},{ref_for:!0},e.sessionMode===`list`?{}:{type:`button`},{"aria-label":`Session ${t.id}`,border:`~ rounded-md`,class:e.sessionMode===`list`?[`hover:bg-active`,`border-base`]:[e.selectedSessionIds.includes(t.id)?`border-active`:`border-base`,S(t)||e.selectedSessions.length===2&&!e.selectedSessionIds.includes(t.id)?`op50`:`hover:bg-active`],flex:`~ col gap-1`,px4:``,py3:``,"w-full":``,onClick:e=>M(t)}),{default:h(()=>[y(`div`,O,[o[0]||=y(`div`,{"i-ph-hash-duotone":``},null,-1),m(` `+a(t.id),1)]),y(`div`,k,a(t.meta.cwd),1),t.meta.inputs[0]?(g(),v(`div`,A,[n(s,{id:t.meta.inputs[0].filename,cwd:t.meta.cwd},null,8,[`id`,`cwd`]),n(C,{text:t.meta.inputs[0].name||`entry`},null,8,[`text`]),t.meta.inputs.length>1?(g(),v(`span`,j,` +`+a(t.meta.inputs.length-1),1)):r(``,!0)])):r(``,!0),n(T,{timestamp:t.timestamp,pt2:``,"text-sm":``,op50:``},null,8,[`timestamp`])]),_:2},1040,[`to`,`aria-label`,`class`,`onClick`]))]))),128))])}}}),{__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=s({__name:`index`,async setup(s){let _,b,C=d(`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=d([]),E=u(()=>T.value.map(e=>e.id).sort()),D=u(()=>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=t(),k=([_,b]=f(()=>O.value.call(`vite:rolldown:list-sessions`)),_=await _,b(),_);function A(e){E.value.includes(e.id)?T.value=T.value.filter(t=>t.id!==e.id):T.value=[...T.value,e]}return(t,s)=>{let u=e,d=M,f=S,_=x;return g(),v(`div`,N,[n(u),i(k).length?(g(),v(`p`,P,a(C.value===`list`?`Select a build session to get started:`:`Select 2 build sessions to compare:`),1)):(g(),v(`p`,F,` No sessions yet, run a build to get started. `)),y(`div`,I,[n(d,{"session-mode":C.value,sessions:i(k),"selected-session-ids":E.value,"selected-sessions":T.value,onSelect:A},null,8,[`session-mode`,`sessions`,`selected-session-ids`,`selected-sessions`])]),i(k).length?(g(),v(`div`,L,[y(`div`,R,[(g(),v(p,null,l(w,e=>y(`button`,{key:e.value,title:e.label,"flex-1":``,op50:``,flex:`~ items-center justify-center`,class:o({"bg-active text-base op100!":C.value===e.value}),hover:`bg-active text-base op100!`,onClick:t=>C.value=e.value},[y(`span`,{class:o([e.icon,`text-sm`])},null,2)],10,z)),64))])])):r(``,!0),T.value.length>0&&C.value===`compare`?(g(),v(`div`,B,[n(f,{sessions:D.value,class:`flex-col gap0 [&>div]:border-none! [&>first-child]:border-b!`},null,8,[`sessions`]),y(`div`,V,[T.value.length===2?(g(),c(_,{key:0,tag:`button`,to:`/compare/${E.value.join(`,`)}`,"btn-action":``,"rounded-8":``,"text-3":``,flex:`~ justify-center`,w30:``,h8:``},{default:h(()=>[...s[0]||=[m(` Compare `,-1)]]),_:1},8,[`to`])):(g(),v(`div`,H,` Select one more session to compare. `))])])):r(``,!0)])}}});export{U as default};
1
+ import{i as e,r as t}from"./Dnap40Ul.js";import{A as n,C as r,Et as i,Gt as a,Ht as o,M as s,S as c,Z as l,b as u,bt as d,ct as f,h as p,k as m,lt as h,q as g,tt as _,w as v,x as y,z as b}from"./WOQUZE4V.js";import{t as x}from"./n6uS-XK5.js";import{t as S}from"./BBjyA450.js";import{r as C,t as w}from"./B4F3iFfR.js";import{t as T}from"./BGO_avQR.js";import{t as E}from"./D-q_RBTz.js";var D={flex:`~ col gap-2`},O={flex:`~ gap-1 items-center`,"font-mono":``,op50:``,"text-sm":``},k={"font-mono":``,"font-sm":``},A={key:0,flex:`~ gap-1 items-center`},j={key:0,op50:``,"text-xs":``,border:`~ base rounded-md`,px1:``,"font-mono":``},M=Object.assign(s({__name:`SessionSelector`,props:{sessionMode:{},sessions:{},selectedSessionIds:{},selectedSessions:{}},emits:[`select`],setup(e,{emit:t}){let o=e,s=t;function d(e){return E(e.meta.inputs[0]?.filename??``,e.meta.cwd).path}let f=u(()=>{let e=o.selectedSessions?.[0];return e?d(e):``});function S(e){return f.value&&f.value!==d(e)}function M(e){o.sessionMode===`compare`&&!S(e)&&s(`select`,e)}return(t,o)=>{let s=w;return g(),v(`div`,D,[(g(!0),v(p,null,l(e.sessions,t=>(g(),v(`div`,{key:t.id,flex:`~ row gap-2`,relative:``},[(g(),c(_(e.sessionMode===`list`?i(x):`button`),b({to:`/session/${t.id}`},{ref_for:!0},e.sessionMode===`list`?{}:{type:`button`},{"aria-label":`Session ${t.id}`,border:`~ rounded-md`,class:e.sessionMode===`list`?[`hover:bg-active`,`border-base`]:[e.selectedSessionIds.includes(t.id)?`border-active`:`border-base`,S(t)||e.selectedSessions.length===2&&!e.selectedSessionIds.includes(t.id)?`op50`:`hover:bg-active`],flex:`~ col gap-1`,px4:``,py3:``,"w-full":``,onClick:e=>M(t)}),{default:h(()=>[y(`div`,O,[o[0]||=y(`div`,{"i-ph-hash-duotone":``},null,-1),m(` `+a(t.id),1)]),y(`div`,k,a(t.meta.cwd),1),t.meta.inputs[0]?(g(),v(`div`,A,[n(s,{id:t.meta.inputs[0].filename,cwd:t.meta.cwd},null,8,[`id`,`cwd`]),n(C,{text:t.meta.inputs[0].name||`entry`},null,8,[`text`]),t.meta.inputs.length>1?(g(),v(`span`,j,` +`+a(t.meta.inputs.length-1),1)):r(``,!0)])):r(``,!0),n(T,{timestamp:t.timestamp,pt2:``,"text-sm":``,op50:``},null,8,[`timestamp`])]),_:2},1040,[`to`,`aria-label`,`class`,`onClick`]))]))),128))])}}}),{__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=s({__name:`index`,async setup(s){let _,b,C=d(`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=d([]),E=u(()=>T.value.map(e=>e.id).sort()),D=u(()=>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=t(),k=([_,b]=f(()=>O.value.call(`vite:rolldown:list-sessions`)),_=await _,b(),_);function A(e){E.value.includes(e.id)?T.value=T.value.filter(t=>t.id!==e.id):T.value=[...T.value,e]}return(t,s)=>{let u=e,d=M,f=S,_=x;return g(),v(`div`,N,[n(u),i(k).length?(g(),v(`p`,P,a(C.value===`list`?`Select a build session to get started:`:`Select 2 build sessions to compare:`),1)):(g(),v(`p`,F,` No sessions yet, run a build to get started. `)),y(`div`,I,[n(d,{"session-mode":C.value,sessions:i(k),"selected-session-ids":E.value,"selected-sessions":T.value,onSelect:A},null,8,[`session-mode`,`sessions`,`selected-session-ids`,`selected-sessions`])]),i(k).length?(g(),v(`div`,L,[y(`div`,R,[(g(),v(p,null,l(w,e=>y(`button`,{key:e.value,title:e.label,"flex-1":``,op50:``,flex:`~ items-center justify-center`,class:o({"bg-active text-base op100!":C.value===e.value}),hover:`bg-active text-base op100!`,onClick:t=>C.value=e.value},[y(`span`,{class:o([e.icon,`text-sm`])},null,2)],10,z)),64))])])):r(``,!0),T.value.length>0&&C.value===`compare`?(g(),v(`div`,B,[n(f,{sessions:D.value,class:`flex-col gap0 [&>div]:border-none! [&>first-child]:border-b!`},null,8,[`sessions`]),y(`div`,V,[T.value.length===2?(g(),c(_,{key:0,tag:`button`,to:`/compare/${E.value.join(`,`)}`,"btn-action":``,"rounded-8":``,"text-3":``,flex:`~ justify-center`,w30:``,h8:``},{default:h(()=>[...s[0]||=[m(` Compare `,-1)]]),_:1},8,[`to`])):(g(),v(`div`,H,` Select one more session to compare. `))])])):r(``,!0)])}}});export{U as default};
@@ -0,0 +1 @@
1
+ function e(e,t=2){let n=[`Bytes`,`kB`,`MB`,`GB`,`TB`],r=Math.floor(Math.log(e)/Math.log(1e3));return r===0?[e,`B`]:[(+(e/1e3**r).toFixed(t)).toLocaleString(),n[r]]}function t(e,t){let n={name:t,children:{},items:[]};function r(e,t,i=n){if(!e)return;if(t.length<=1){i.items.push(e);return}let a=t.shift();i.children[a]||(i.children[a]={name:a,children:{},items:[]}),r(e,t,i.children[a])}e.forEach(e=>{r(e,e.path.split(/\//g).filter(Boolean))});function i(e){if(!e)return;let t=Object.values(e.children);if(t.length===1&&!e.items.length){let n=t[0];e.name=e.name?`${e.name}/${n.name}`:n.name,e.items=n.items,e.children=n.children,i(e)}else t.forEach(i)}return Object.values(n.children).forEach(i),n}function n(e){return new Date(e).toLocaleString(void 0,{hour12:!1,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,fractionalSecondDigits:3})}export{n,t as r,e as t};
@@ -1 +1 @@
1
- import{Ct as e,_t as t,b as n,ot as r,vt as i}from"./CEtF9LWU.js";var a=0,o=i(new Map),s=n(()=>Array.from(o.values()).flat());function c(n){let i=e(n),s=()=>{};function c(e){s();let t=a++;o.set(t,e),s=()=>{o.delete(t)}}return r(i,e=>{c(e)},{immediate:!0}),t(()=>{s()}),()=>{s()}}export{c as n,s as t};
1
+ import{Ct as e,_t as t,b as n,ot as r,vt as i}from"./WOQUZE4V.js";var a=0,o=i(new Map),s=n(()=>Array.from(o.values()).flat());function c(n){let i=e(n),s=()=>{};function c(e){s();let t=a++;o.set(t,e),s=()=>{o.delete(t)}}return r(i,e=>{c(e)},{immediate:!0}),t(()=>{s()}),()=>{s()}}export{c as n,s as t};
@@ -1 +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,h as l,k as u,lt as d,q as f,w as p,x as m}from"./CEtF9LWU.js";import{t as h}from"./BdJ_JF0w.js";import{r as g,t as _}from"./CfGVkjRe.js";import{t as v}from"./KgssGmNv.js";import{t as y}from"./Bw1q8I0g.js";import{t as b}from"./DlCwyx2g.js";var x={flex:`~ col gap-2`,p6:``},S={flex:`~ gap-2`},C={border:`~ base rounded`,p4:``,grid:`~ cols-[max-content_160px_2fr] gap-2 items-center`},w={"font-mono":``,truncate:``},T=[`datetime`],E={key:4},D={border:`~ base rounded`,p4:``,grid:`~ cols-[max-content_1fr] gap-2 items-center`},O={flex:`~ wrap gap-2`},k=a({__name:`index`,props:{session:{}},setup(a){let k=a,A=c(()=>[{title:`Build ID`,value:k.session.id,icon:`i-ph-hash-duotone`},{title:`Created At`,value:new Date(k.session.meta.timestamp),icon:`i-ph-clock-duotone`},{title:`Build Duration`,value:k.session.buildDuration,icon:`i-ph-timer-duotone`,type:`duration`},{title:`Directory`,value:k.session.meta.cwd,icon:`i-ph-folder-duotone`},{title:`Total Modules`,value:k.session.modulesList.length,icon:`i-ph-files-duotone`},{title:`Plugins`,value:k.session.meta.plugins.length,icon:`i-ph-plugs-duotone`},{title:`Platform`,value:k.session.meta.platform,icon:`i-ph-cpu-duotone`,type:`badge`},{title:`Format`,value:k.session.meta.format,icon:`i-ph-file-duotone`,type:`badge`}]);return(c,j)=>{let M=h,N=_;return f(),p(`div`,x,[m(`div`,S,[e(M,{"btn-action":``,to:{path:`/`}},{default:d(()=>[...j[0]||=[m(`div`,{"i-ph-arrow-bend-up-left-duotone":``},null,-1),u(` Re-select Session `,-1)]]),_:1})]),j[1]||=m(`div`,{op50:``,"mt-10":``},` Meta Info `,-1),m(`div`,C,[(f(!0),p(l,null,s(A.value,e=>(f(),p(l,{key:e.title},[m(`div`,{class:i(e.icon)},null,2),m(`div`,null,r(e.title),1),m(`div`,w,[e.value instanceof Date?(f(),p(`time`,{key:0,datetime:e.value.toISOString()},r(e.value.toLocaleString()),9,T)):e.type===`badge`?(f(),o(g,{key:1,text:String(e.value),py1:``},null,8,[`text`])):e.type===`duration`?(f(),o(v,{key:2,duration:+e.value},null,8,[`duration`])):typeof e.value==`number`?(f(),o(y,{key:3,number:e.value,py1:``,"rounded-full":``,"inline-block":``,"text-sm":``},null,8,[`number`])):(f(),p(`span`,E,r(e.value),1))])],64))),128))]),j[2]||=m(`div`,{op50:``,"mt-4":``},` Build Entries `,-1),m(`div`,D,[(f(!0),p(l,null,s(k.session.meta.inputs,t=>(f(),p(l,{key:t},[e(g,{text:t.name||``},null,8,[`text`]),e(N,{id:t.filename||``,session:a.session,link:!0},null,8,[`id`,`session`])],64))),128))]),j[3]||=m(`div`,{op50:``,"mt-4":``},` Views `,-1),m(`div`,O,[(f(!0),p(l,null,s(n(b),e=>(f(),p(l,{key:e.to},[e.category===`session`?(f(),o(M,{key:0,"btn-action":``,to:{path:e.to},flex:`~ col`,"min-w-40":``,p4:``},{default:d(()=>[m(`div`,{class:i(e.icon),"text-2xl":``},null,2),u(` `+r(e.title),1)]),_:2},1032,[`to`])):t(``,!0)],64))),128))])])}}});export{k as default};
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,h as l,k as u,lt as d,q as f,w as p,x as m}from"./WOQUZE4V.js";import{t as h}from"./n6uS-XK5.js";import{r as g,t as _}from"./B4F3iFfR.js";import{t as v}from"./mwlMWDmZ.js";import{t as y}from"./CeYpEmO6.js";import{t as b}from"./COgjeEhM.js";var x={flex:`~ col gap-2`,p6:``},S={flex:`~ gap-2`},C={border:`~ base rounded`,p4:``,grid:`~ cols-[max-content_160px_2fr] gap-2 items-center`},w={"font-mono":``,truncate:``},T=[`datetime`],E={key:4},D={border:`~ base rounded`,p4:``,grid:`~ cols-[max-content_1fr] gap-2 items-center`},O={flex:`~ wrap gap-2`},k=a({__name:`index`,props:{session:{}},setup(a){let k=a,A=c(()=>[{title:`Build ID`,value:k.session.id,icon:`i-ph-hash-duotone`},{title:`Created At`,value:new Date(k.session.meta.timestamp),icon:`i-ph-clock-duotone`},{title:`Build Duration`,value:k.session.buildDuration,icon:`i-ph-timer-duotone`,type:`duration`},{title:`Directory`,value:k.session.meta.cwd,icon:`i-ph-folder-duotone`},{title:`Total Modules`,value:k.session.modulesList.length,icon:`i-ph-files-duotone`},{title:`Plugins`,value:k.session.meta.plugins.length,icon:`i-ph-plugs-duotone`},{title:`Platform`,value:k.session.meta.platform,icon:`i-ph-cpu-duotone`,type:`badge`},{title:`Format`,value:k.session.meta.format,icon:`i-ph-file-duotone`,type:`badge`}]);return(c,j)=>{let M=h,N=_;return f(),p(`div`,x,[m(`div`,S,[e(M,{"btn-action":``,to:{path:`/`}},{default:d(()=>[...j[0]||=[m(`div`,{"i-ph-arrow-bend-up-left-duotone":``},null,-1),u(` Re-select Session `,-1)]]),_:1})]),j[1]||=m(`div`,{op50:``,"mt-10":``},` Meta Info `,-1),m(`div`,C,[(f(!0),p(l,null,s(A.value,e=>(f(),p(l,{key:e.title},[m(`div`,{class:i(e.icon)},null,2),m(`div`,null,r(e.title),1),m(`div`,w,[e.value instanceof Date?(f(),p(`time`,{key:0,datetime:e.value.toISOString()},r(e.value.toLocaleString()),9,T)):e.type===`badge`?(f(),o(g,{key:1,text:String(e.value),py1:``},null,8,[`text`])):e.type===`duration`?(f(),o(v,{key:2,duration:+e.value},null,8,[`duration`])):typeof e.value==`number`?(f(),o(y,{key:3,number:e.value,py1:``,"rounded-full":``,"inline-block":``,"text-sm":``},null,8,[`number`])):(f(),p(`span`,E,r(e.value),1))])],64))),128))]),j[2]||=m(`div`,{op50:``,"mt-4":``},` Build Entries `,-1),m(`div`,D,[(f(!0),p(l,null,s(k.session.meta.inputs,t=>(f(),p(l,{key:t},[e(g,{text:t.name||``},null,8,[`text`]),e(N,{id:t.filename||``,session:a.session,link:!0},null,8,[`id`,`session`])],64))),128))]),j[3]||=m(`div`,{op50:``,"mt-4":``},` Views `,-1),m(`div`,O,[(f(!0),p(l,null,s(n(b),e=>(f(),p(l,{key:e.to},[e.category===`session`?(f(),o(M,{key:0,"btn-action":``,to:{path:e.to},flex:`~ col`,"min-w-40":``,p4:``},{default:d(()=>[m(`div`,{class:i(e.icon),"text-2xl":``},null,2),u(` `+r(e.title),1)]),_:2},1032,[`to`])):t(``,!0)],64))),128))])])}}});export{k as default};
@@ -1 +1 @@
1
- import{C as e,Gt as t,Ht as n,M as r,Q as i,b as a,k as o,q as s,w as c}from"./CEtF9LWU.js";var l=r({__name:`DisplayNumberBadge`,props:{number:{},color:{default:`badge-color-gray op75`},icon:{},prefix:{},suffix:{},format:{default:`locale`}},setup(r){let l=r,u=a(()=>l.format===`percent`?Number(l.number).toLocaleString(void 0,{style:`percent`,minimumFractionDigits:2,maximumFractionDigits:2}):Number(l.number).toLocaleString());return(a,l)=>(s(),c(`div`,{class:n([r.color,`px-0.4em py-0.2em font-mono line-height-none flex items-center`])},[r.icon?(s(),c(`div`,{key:0,class:n([r.icon,`mr-1`])},null,2)):e(``,!0),o(` `+t(r.prefix||``)+t(u.value)+t(r.suffix||``)+` `,1),i(a.$slots,`after`)],2))}});export{l as t};
1
+ import{C as e,Gt as t,Ht as n,M as r,Q as i,b as a,k as o,q as s,w as c}from"./WOQUZE4V.js";var l=r({__name:`DisplayNumberBadge`,props:{number:{},color:{default:`badge-color-gray op75`},icon:{},prefix:{},suffix:{},format:{default:`locale`}},setup(r){let l=r,u=a(()=>l.format===`percent`?Number(l.number).toLocaleString(void 0,{style:`percent`,minimumFractionDigits:2,maximumFractionDigits:2}):Number(l.number).toLocaleString());return(a,l)=>(s(),c(`div`,{class:n([r.color,`px-0.4em py-0.2em font-mono line-height-none flex items-center`])},[r.icon?(s(),c(`div`,{key:0,class:n([r.icon,`mr-1`])},null,2)):e(``,!0),o(` `+t(r.prefix||``)+t(u.value)+t(r.suffix||``)+` `,1),i(a.$slots,`after`)],2))}});export{l as t};
@@ -0,0 +1 @@
1
+ import{A as e,Gt as t,k as n,lt as r,q as i,w as a,x as o}from"./WOQUZE4V.js";import{t as s}from"./4u6R6kmy.js";import{t as c}from"./n6uS-XK5.js";import{t as l}from"./XAUaDDss.js";var u={class:`antialiased bg-white dark:bg-[#020420] dark:text-white font-sans grid min-h-screen overflow-hidden place-content-center text-[#020420] tracking-wide`},d={class:`max-w-520px text-center`},f=[`textContent`],p=[`textContent`],m=[`textContent`],h={class:`flex items-center justify-center w-full`},g=l({__name:`error-404`,props:{appName:{type:String,default:`Nuxt`},status:{type:Number,default:404},statusText:{type:String,default:`Page not found`},description:{type:String,default:`Sorry, the page you are looking for could not be found.`},backHome:{type:String,default:`Go back home`}},setup(l){let g=l;return s({title:`${g.status} - ${g.statusText} | ${g.appName}`,script:[{innerHTML:`!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))r(e);new MutationObserver(e=>{for(const o of e)if("childList"===o.type)for(const e of o.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&r(e)}).observe(document,{childList:!0,subtree:!0})}function r(e){if(e.ep)return;e.ep=!0;const r=function(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?r.credentials="include":"anonymous"===e.crossOrigin?r.credentials="omit":r.credentials="same-origin",r}(e);fetch(e.href,r)}}();`}],style:[{innerHTML:`*,:after,:before{border-color:var(--un-default-border-color,#e5e7eb);border-style:solid;border-width:0;box-sizing:border-box}:after,:before{--un-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}h1,h2{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}h1,h2,p{margin:0}*,:after,:before{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 transparent;--un-ring-shadow:0 0 transparent;--un-shadow-inset: ;--un-shadow:0 0 transparent;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }`}]}),(s,g)=>{let _=c;return i(),a(`div`,u,[o(`div`,d,[o(`h1`,{class:`font-semibold leading-none mb-4 sm:text-[110px] tabular-nums text-[80px]`,textContent:t(l.status)},null,8,f),o(`h2`,{class:`font-semibold mb-2 sm:text-3xl text-2xl`,textContent:t(l.statusText)},null,8,p),o(`p`,{class:`mb-4 px-2 text-[#64748B] text-md`,textContent:t(l.description)},null,8,m),o(`div`,h,[e(_,{to:`/`,class:`font-medium hover:text-[#00DC82] text-sm underline underline-offset-3`},{default:r(()=>[n(t(l.backHome),1)]),_:1})])])])}}},[[`__scopeId`,`data-v-c5d0ac39`]]);export{g as default};
@@ -0,0 +1 @@
1
+ import{r as e}from"./Dnap40Ul.js";import{A as t,C as n,G as r,Gt as i,Ht as a,M as o,S as s,Z as c,b as l,bt as u,h as d,k as f,lt as p,q as m,w as h,x as g,z as _}from"./WOQUZE4V.js";import{C as v}from"./BeLy3b84.js";import{t as y}from"./B8a2SqNB.js";import{t as b}from"./n6uS-XK5.js";import{t as x}from"./BBjyA450.js";import{t as S}from"./CKJSqDo0.js";var C=Object.assign(o({__name:`ComparisonMetric`,props:{current:{},previous:{}},setup(e){let t=e,n=l(()=>t.previous===t.current),r=l(()=>Math.abs((t.current-t.previous)/t.previous*100).toFixed(n.value?0:2)),o=l(()=>n.value?``:t.current>t.previous?`+`:`-`),s=l(()=>n.value?`text-gray-500`:t.current>t.previous?`text-green-500`:`text-red-500`);return(e,t)=>(m(),h(`span`,{"text-4":``,"mt-1":``,"font-mono":``,class:a(s.value)},i(o.value)+i(r.value)+`% `,3))}}),{__name:`DisplayComparisonMetric`}),w=[`title`],T={flex:`~ gap-2`,"items-center":``},E={key:0},D={"font-semibold":``,"text-5":``,"font-mono":``},O={"font-semibold":``,"text-4":``,"font-mono":``},k={key:1},A={"font-semibold":``,"text-5":``,"font-mono":``},j=Object.assign(o({__name:`MetricCard`,props:{name:{},description:{},icon:{},current:{},previous:{},format:{}},setup(e){let t=e,r=l(()=>t.format===`bytes`?S(t.current):t.current);return(t,o)=>{let c=C;return m(),h(d,null,[g(`div`,{"font-500":``,op50:``,"text-4":``,flex:`~ items-center gap-2`,title:e.description},[g(`div`,{class:a([e.icon,`text-xl`])},null,2),f(` `+i(e.name),1)],8,w),g(`div`,T,[e.format===`bytes`?(m(),h(`div`,E,[g(`span`,D,i(r.value[0]),1),g(`span`,O,i(r.value[1]),1)])):(m(),h(`div`,k,[g(`span`,A,i(r.value),1)])),e.previous>0&&e.current>0?(m(),s(c,{key:2,current:e.current,previous:e.previous},null,8,[`current`,`previous`])):n(``,!0)])],64)}}}),{__name:`CompareMetricCard`}),M={key:1,"h-screen":``,"w-screen":``,"max-w-screen":``,"max-h-screen":``,"of-hidden":``,p6:``,flex:`~ col gap-2`},N={flex:`~ gap-2`},P={flex:`~ col`,border:`~ base rounded-lg`,p3:``,mt10:``},F={grid:`~ cols-6 gap5`,"w-full":``,pt3:``},I=o({__name:`index`,setup(n){let i=u(!1),o=v().params,S=e(),C=u([]),w=u([]);async function T(e){let t=await S.value.call(`vite:rolldown:get-packages`,{session:e}),n=t.filter(e=>e.duplicated);return{total:t.length,duplicated:n.length}}r(async()=>{i.value=!0;let e=o.sessions.split(`,`),[t,...n]=await Promise.all([S.value.call(`vite:rolldown:get-session-compare-summary`,{sessions:e}),...e.map(e=>T(e))]);C.value=t,w.value=n,i.value=!1});let E=l(()=>C.value.map((e,t)=>({...e,createdAt:new Date(e.meta?.timestamp??0),title:t===0?`Session A`:`Session B`}))),D=l(()=>{let[e,t]=E.value;return[{name:`Bundle Size`,description:`Total file size of the assets`,icon:`i-ph-package-duotone`,current:t?.bundle_size??0,previous:e?.bundle_size??0,format:`bytes`},{name:`Initial JS`,description:`Total file size of the initial JS chunks`,icon:`i-ph-file-js-duotone`,current:t?.initial_js??0,previous:e?.initial_js??0,format:`bytes`},{name:`Modules`,description:`Total number of modules`,icon:`i-ph-graph-duotone`,current:t?.modules??0,previous:e?.modules??0},{name:`Packages`,description:`Total number of packages`,icon:`i-ph-package-duotone`,current:w.value?.[1]?.total??0,previous:w.value?.[0]?.total??0},{name:`Duplicated Packages`,description:`Total number of duplicated packages`,icon:`i-ph-package-duotone`,current:w.value?.[1]?.duplicated??0,previous:w.value?.[0]?.duplicated??0},{name:`Plugins`,description:`Total number of plugins`,icon:`i-ph-plugs-duotone`,current:t?.meta?.plugins.length??0,previous:e?.meta?.plugins.length??0},{name:`Chunks`,description:`Total number of chunks`,icon:`i-ph-shapes-duotone`,current:t?.chunks??0,previous:e?.chunks??0},{name:`Assets`,description:`Total number of assets`,icon:`i-ph-package-duotone`,current:t?.assets??0,previous:e?.assets??0}]});return(e,n)=>{let r=y,o=b,l=x,u=j;return i.value?(m(),s(r,{key:0})):(m(),h(`div`,M,[g(`div`,N,[t(o,{"btn-action":``,to:{path:`/`}},{default:p(()=>[...n[0]||=[g(`div`,{"i-ph-arrow-bend-up-left-duotone":``},null,-1),f(` Re-select Session `,-1)]]),_:1})]),g(`div`,P,[n[1]||=g(`div`,{py3:``,"indent-2":``},` Compare Overview `,-1),t(l,{sessions:E.value},null,8,[`sessions`]),g(`div`,F,[(m(!0),h(d,null,c(D.value,(e,n)=>(m(),h(`div`,{key:e.name,class:a(n<2?`col-span-3`:`col-span-2`),border:`~ base rounded`,p4:``,flex:`~ col`,gap2:``},[t(u,_({ref_for:!0},e),null,16)],2))),128))])])]))}}});export{I as default};
@@ -1 +1 @@
1
- import{u as e}from"./kJJURm8F.js";import{n as t}from"./CfGVkjRe.js";import{n,t as r}from"./DoJ6DaKu.js";function i(e){let t=e.match(/.*\/node_modules\/(.*)$/)?.[1];if(t)return t}var a=e((e,a)=>{let o=e.replace(/%2F/g,`/`).replace(/\\/g,`/`);if(n(o)||/^\w+:/.test(o)&&!/^[a-z]:\\/i.test(e))return{moduleName:o,path:o};let s=r(o),c=i(o);if(s&&c)return{moduleName:s,path:c};try{let e=t(a,o);return!e.startsWith(`./`)&&!e.startsWith(`../`)&&(e=`./${e}`),e.startsWith(`./.nuxt/`)&&(e=`#build${e.slice(7)}`),{path:e}}catch{return{path:o}}});export{a as t};
1
+ import{u as e}from"./Du2TAFfS.js";import{n as t}from"./B4F3iFfR.js";import{n,t as r}from"./Cvg1SSG2.js";function i(e){let t=e.match(/.*\/node_modules\/(.*)$/)?.[1];if(t)return t}var a=e((e,a)=>{let o=e.replace(/%2F/g,`/`).replace(/\\/g,`/`);if(n(o)||/^\w+:/.test(o)&&!/^[a-z]:\\/i.test(e))return{moduleName:o,path:o};let s=r(o),c=i(o);if(s&&c)return{moduleName:s,path:c};try{let e=t(a,o);return!e.startsWith(`./`)&&!e.startsWith(`../`)&&(e=`./${e}`),e.startsWith(`./.nuxt/`)&&(e=`#build${e.slice(7)}`),{path:e}}catch{return{path:o}}});export{a as t};
@@ -0,0 +1 @@
1
+ import{A as e,B as t,C as n,D as r,Et as i,Gt as a,Ht as o,M as s,S as c,Z as l,b as u,bt as d,h as f,k as p,lt as m,q as h,w as g,x as _}from"./WOQUZE4V.js";import{C as v,w as y}from"./BeLy3b84.js";import{r as b}from"./CKJSqDo0.js";import{a as x,s as S}from"./Du2TAFfS.js";import{t as C}from"./B4F3iFfR.js";import{t as w}from"./D-q_RBTz.js";import{t as T}from"./hanhGz4p.js";import{t as E}from"./BH_Y2qlu.js";import{h as D,p as O}from"./MtfbxdGf.js";import{n as k}from"./DVNjK2Kc.js";import{n as A,r as j,t as M}from"./4NH8NIP0.js";import{t as N}from"./DHH1zTqi.js";import{t as P}from"./MPr03GYv2.js";import{n as F,r as I,t as L}from"./Bpyx8FA-2.js";import{n as R,t as z}from"./DjsgV5Nj2.js";var B={flex:`~ col gap-2`,p4:``},V=[`onClick`],H=Object.assign(s({__name:`FlatList`,props:{session:{},modules:{},disableTooltip:{type:Boolean,default:!1},link:{type:Boolean,default:!0}},emits:[`select`],setup(t,{emit:n}){let r=n;return(n,i)=>{let a=C;return h(),g(`div`,B,[e(M,{items:t.modules,"key-prop":`id`},{default:m(({item:n})=>[_(`div`,{flex:``,pb2:``,onClick:e=>r(`select`,n)},[e(a,{id:n.id,session:t.session,hover:`bg-active`,block:``,px2:``,p1:``,"w-full":``,border:`~ base rounded`,link:t.link,"disable-tooltip":t.disableTooltip},null,8,[`id`,`session`,`link`,`disable-tooltip`])],8,V)]),_:1},8,[`items`])])}}}),{__name:`ModulesFlatList`}),U={flex:`~ col gap-2`,p4:``},W={flex:``,pb2:``},G={flex:`~ gap-1 wrap`,"text-xs":``},K={flex:`~ auto text-xs wrap`},q={key:0,flex:`~ items-center`},J={key:0,op20:``},Y={flex:`~ none gap-1 wrap justify-end`},X=Object.assign(s({__name:`DetailedList`,props:{session:{},modules:{}},setup(t){let r=t,i=u(()=>{let e=new Map;for(let t of r.modules){let n=t.buildMetrics?.transforms.filter(e=>e.source_code_size!==e.transformed_code_size).filter(e=>e.transformed_code_size);e.set(t.id,n)}return e});return(r,a)=>{let o=N,s=E,u=C;return h(),g(`div`,U,[e(M,{items:t.modules,"key-prop":`id`},{default:m(({item:r})=>[_(`div`,W,[e(u,{id:r.id,session:t.session,hover:`bg-active`,block:``,px2:``,p1:``,"w-full":``,border:`~ base rounded`,link:!0},{detail:m(()=>[_(`div`,G,[_(`ul`,K,[(h(!0),g(f,null,l(i.value.get(r.id),(t,a)=>(h(),g(f,{key:a},[t.source_code_size!==t.transformed_code_size&&t.transformed_code_size?(h(),g(`li`,q,[e(o,{name:t.plugin_name,class:`font-mono ws-nowrap op-50`},null,8,[`name`]),a===i.value.get(r.id).length-1?n(``,!0):(h(),g(`span`,J,`|`))])):n(``,!0)],64))),128))]),a[0]||=_(`div`,{flex:`~ auto gap-1`,"of-hidden":``},null,-1),_(`div`,Y,[_(`span`,null,[r.buildMetrics?(h(),c(s,{key:0,metrics:r.buildMetrics},null,8,[`metrics`])):n(``,!0)])])])]),_:2},1032,[`id`,`session`])])]),_:1},8,[`items`])])}}}),{__name:`ModulesDetailedList`}),Z=[`d`,`stroke-dasharray`],Q=Object.assign(s({__name:`Graph`,props:{modules:{},session:{}},setup(n){let r=n,a=u(()=>r.modules);return k({modules:a,spacing:{width:400,height:55,linkOffset:20,margin:800,gap:150},generateGraph:e=>{let{isFirstCalculateGraph:n,scale:r,spacing:o,tree:s,hierarchy:c,collapsedNodes:l,container:d,modulesMap:f,nodes:p,links:m,nodesMap:h,linksMap:g,width:_,height:v,childToParentMap:y,focusOn:b}=e,x=u(()=>a.value.filter(e=>e.importers.length===0));return(e=!0)=>{_.value=window.innerWidth,v.value=window.innerHeight;let a=new Set,u=c({module:{id:`~root`}},e=>e.module.id===`~root`?(x.value.forEach(e=>{a.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 r=f.value.get(t.module_id);if(r&&!a.has(r)&&!(y.has(r.id)&&y.get(r.id)!==e.module.id))return a.add(r),n.value&&y.set(r.id,e.module.id),{module:r,import:t,expanded:!l.has(r.id),hasChildren:!1}}).filter(e=>e!==void 0));n.value&&=!1,s().nodeSize([i(o.height),i(o.width)+i(o.gap)])(u);let S=u.descendants();for(let e of S)[e.x,e.y]=[e.y-i(o.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<i(o.margin))for(let e of S)e.x+=Math.abs(C)+i(o.margin);if(w<i(o.margin))for(let e of S)e.y+=Math.abs(w)+i(o.margin);p.value=S,h.clear();for(let e of S)h.set(e.data.module.id,e);let T=u.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=d.value.scrollWidth/r.value+i(o.margin),v.value=d.value.scrollHeight/r.value+i(o.margin);let n=x.value?.[0]?.id;e&&n&&t(()=>{b(n,!1)})})}}}),(t,r)=>{let i=C,s=L;return h(),c(s,{session:n.session,modules:a.value},{default:m(({node:t,nodesRefMap:r})=>[e(i,{id:t.data.module.id,ref:e=>r.set(t.data.module.id,e?.$el),link:!0,session:n.session,minimal:!0,flex:`1`},null,8,[`id`,`session`])]),link:m(({link:e,d:t,linkClass:n})=>[_(`path`,{d:t,class:o(n),"stroke-dasharray":e.import?.kind===`dynamic-import`?`3 6`:void 0,fill:`none`},null,10,Z)]),_:1},8,[`session`,`modules`])}}}),{__name:`ModulesGraph`}),$={"of-auto":``,"max-h-screen":``,relative:``},ee={flex:`~ col gap-2`,p4:``},te=Object.assign(s({__name:`Folder`,props:{session:{},modules:{}},setup(t){let r=t,i=u(()=>{if(!r.session.modulesList.length)return{workspace:{children:{},items:[]},nodeModules:{children:{},items:[]},virtual:{children:{},items:[]}};let e=[],t=[],n=[];return r.modules.map(e=>({full:e.id,path:e.path})).forEach(i=>{i.full.startsWith(r.session.meta.cwd)?(i.path.startsWith(`../`)||(i.path=i.full.slice(r.session.meta.cwd.length+1)),e.push(i)):i.full.includes(`node_modules`)?t.push({full:i.full,path:i.full}):i.full.startsWith(`virtual:`)&&n.push(i)}),{workspace:b(e,`Project Root`),nodeModules:b(t,`Node Modules`),virtual:b(n,`Virtual Modules`)}});return(t,r)=>{let a=P;return h(),g(`div`,$,[_(`div`,ee,[Object.keys(i.value.workspace.children).length?(h(),c(a,{key:0,node:i.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`])):n(``,!0),Object.keys(i.value.nodeModules.children).length?(h(),g(f,{key:1},[r[0]||=_(`div`,{"w-full":``,"h-1px":``,border:`t base`},null,-1),e(a,{node:i.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)):n(``,!0),Object.keys(i.value.virtual.children).length?(h(),g(f,{key:2},[r[1]||=_(`div`,{"w-full":``,"h-1px":``,border:`t base`},null,-1),e(a,{node:i.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)):n(``,!0)])])}}}),{__name:`ModulesFolder`}),ne={sticky:``,"left-4":``,"right-4":``,"top-4":``,"z-panel-nav":``,"p-4":``},re={key:0,h10:``,mr2:``,flex:`~ items-center`},ie={flex:`~ wrap gap-2 items-center`,p2:``,border:`t base`},ae=[`onClick`],oe={key:4,fixed:``,"bottom-4":``,"py-1":``,"px-2":``,"bg-glass":``,left:`1/2`,"translate-x":`-1/2`,border:`~ base rounded-full`,text:`center xs`},se={op50:``},ce=s({__name:`index`,props:{session:{}},setup(t){let s=t,b=v(),E=y(),k=d({search:b.query.search||``,selected:b.query.file_types?R(b.query.file_types):null,node_modules:b.query.node_modules?R(b.query.node_modules):null}),M=[{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`}];D(k.value,e=>{let t={...b.query,search:e.search||void 0,file_types:e.selected||void 0,node_modules:e.node_modules||void 0};E.replace({query:z(t)})},{debounce:500});let N=u(()=>s.session.modulesList.map(e=>({mod:e,path:w(e.id,s.session.meta.cwd),type:S(e.id)}))),P=u(()=>x.filter(e=>N.value.some(t=>e.match.test(t.mod.id)))),L=u(()=>{let e=N.value;return k.value.selected&&(e=e.filter(e=>{let t=S(e.mod.id);return k.value.selected.includes(t.name)})),k.value.node_modules&&(e=e.filter(e=>e.path.moduleName&&k.value.node_modules.includes(e.path.moduleName))),e.map(e=>({...e.mod,path:e.path.path}))}),{pathSelectorVisible:B,selectPathNodes:V,togglePathSelector:U,normalizedGraph:W}=I({onToggle:e=>{k.value.search=e?!1:``},dataMap:u(()=>new Map(s.session.modulesList.map(e=>[e.id,e]))),list:L,importIdKey:`module_id`}),G=O(()=>L.value,()=>new j(L.value,{includeScore:!0,keys:[`id`],ignoreLocation:!0,threshold:.4})),K=u(()=>k.value.search?G.value.search(k.value.search).map(e=>e.item):L.value);function q(e){b.query.module&&E.replace({query:{...b.query,module:void 0}}),T.value.moduleGraphViewType=e}return(s,u)=>{let d=H,v=C,y=F,b=A,x=X,S=Q,w=te;return h(),g(`div`,{relative:``,class:o({"max-h-screen of-hidden":i(T).moduleGraphViewType===`graph`})},[_(`div`,ne,[e(b,{modelValue:k.value,"onUpdate:modelValue":u[2]||=e=>k.value=e,rules:P.value},r({"search-end":m(()=>[i(T).moduleGraphViewType===`graph`?(h(),g(`div`,re,[_(`button`,{"w-8":``,"h-8":``,"rounded-full":``,flex:``,"items-center":``,"justify-center":``,hover:`bg-active op100`,op50:``,title:`Graph Path Selector`,onClick:u[1]||=e=>i(U)(!0)},[...u[3]||=[_(`i`,{"i-ri:route-line":``,flex:``},null,-1)]])])):n(``,!0)]),default:m(()=>[_(`div`,ie,[u[4]||=_(`span`,{op50:``,pl2:``,"text-sm":``},`View as`,-1),(h(),g(f,null,l(M,e=>_(`button`,{key:e.value,"btn-action":``,class:o(i(T).moduleGraphViewType===e.value?`bg-active`:`grayscale op50`),onClick:t=>q(e.value)},[_(`div`,{class:o(e.icon)},null,2),p(` `+a(e.label),1)],10,ae)),64))])]),_:2},[i(B)?{name:`search`,fn:m(()=>[e(y,{session:t.session,data:K.value,"import-id-key":`module_id`,"search-keys":[`id`],onSelect:i(V),onClose:u[0]||=e=>i(U)(!1)},{list:m(({select:e,data:r})=>[r?.length?(h(),c(d,{key:0,session:t.session,modules:r,"disable-tooltip":``,link:!1,onSelect:e},null,8,[`session`,`modules`,`onSelect`])):n(``,!0)]),item:m(({id:n})=>[e(v,{id:n,session:t.session,block:``,"text-nowrap":``,link:!1,"disable-tooltip":!0},null,8,[`id`,`session`])]),_:1},8,[`session`,`data`,`onSelect`])]),key:`0`}:void 0]),1032,[`modelValue`,`rules`])]),i(T).moduleGraphViewType===`list`?(h(),c(d,{key:0,session:t.session,modules:K.value},null,8,[`session`,`modules`])):i(T).moduleGraphViewType===`detailed-list`?(h(),c(x,{key:1,session:t.session,modules:K.value},null,8,[`session`,`modules`])):i(T).moduleGraphViewType===`graph`?(h(),c(S,{key:2,session:t.session,modules:i(W)},null,8,[`session`,`modules`])):(h(),c(w,{key:3,session:t.session,modules:K.value},null,8,[`session`,`modules`])),i(T).moduleGraphViewType===`list`||i(T).moduleGraphViewType===`detailed-list`?(h(),g(`div`,oe,[_(`span`,se,a(K.value.length)+` of `+a(t.session.modulesList.length),1)])):n(``,!0)],2)}}});export{ce as default};
@@ -0,0 +1 @@
1
+ import{Gt as e,q as t,w as n,x as r}from"./WOQUZE4V.js";import{t as i}from"./4u6R6kmy.js";import{t as a}from"./XAUaDDss.js";var o={class:`antialiased bg-white dark:bg-[#020420] dark:text-white font-sans grid min-h-screen overflow-hidden place-content-center text-[#020420] tracking-wide`},s={class:`max-w-520px text-center`},c=[`textContent`],l=[`textContent`],u=[`textContent`],d=a({__name:`error-500`,props:{appName:{type:String,default:`Nuxt`},status:{type:Number,default:500},statusText:{type:String,default:`Internal server error`},description:{type:String,default:`This page is temporarily unavailable.`},refresh:{type:String,default:`Refresh this page`}},setup(a){let d=a;return i({title:`${d.status} - ${d.statusText} | ${d.appName}`,script:[{innerHTML:`!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))r(e);new MutationObserver(e=>{for(const o of e)if("childList"===o.type)for(const e of o.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&r(e)}).observe(document,{childList:!0,subtree:!0})}function r(e){if(e.ep)return;e.ep=!0;const r=function(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?r.credentials="include":"anonymous"===e.crossOrigin?r.credentials="omit":r.credentials="same-origin",r}(e);fetch(e.href,r)}}();`}],style:[{innerHTML:`*,:after,:before{border-color:var(--un-default-border-color,#e5e7eb);border-style:solid;border-width:0;box-sizing:border-box}:after,:before{--un-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}h1,h2{font-size:inherit;font-weight:inherit}h1,h2,p{margin:0}*,:after,:before{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 transparent;--un-ring-shadow:0 0 transparent;--un-shadow-inset: ;--un-shadow:0 0 transparent;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }`}]}),(i,d)=>(t(),n(`div`,o,[r(`div`,s,[r(`h1`,{class:`font-semibold leading-none mb-4 sm:text-[110px] tabular-nums text-[80px]`,textContent:e(a.status)},null,8,c),r(`h2`,{class:`font-semibold mb-2 sm:text-3xl text-2xl`,textContent:e(a.statusText)},null,8,l),r(`p`,{class:`mb-4 px-2 text-[#64748B] text-md`,textContent:e(a.description)},null,8,u)])]))}},[[`__scopeId`,`data-v-fa4eb58f`]]);export{d as default};
@@ -1 +1 @@
1
- import{F as e,M as t,S as n,q as r,tt as i}from"./CEtF9LWU.js";import{t as a}from"./kJJURm8F.js";var o=Object.assign(t({__name:`PluginName`,props:{name:{},compact:{type:Boolean},colored:{type:Boolean},hide:{type:Boolean}},setup(t){let o=t,s=[`__load__`,`vite-plugin-`,`vite-`,`rollup-plugin-`,`rollup-`,`unplugin-`],c=[...s,`vite:`];function l(){let t=o.compact?c:s;for(let n of t)if(o.name.startsWith(n))return o.compact?e(`span`,o.name.slice(n.length)):e(`span`,[e(`span`,{class:`op50`},n),e(`span`,o.name.slice(n.length))]);let n=o.name.split(`:`);return n.length>1?e(`span`,[e(`span`,{style:{color:a(n[0])}},`${n[0]}:`),e(`span`,n.slice(1).join(`:`))]):e(`span`,o.name)}return(e,t)=>(r(),n(i(l)))}}),{__name:`DisplayPluginName`});export{o as t};
1
+ import{F as e,M as t,S as n,q as r,tt as i}from"./WOQUZE4V.js";import{t as a}from"./Du2TAFfS.js";var o=Object.assign(t({__name:`PluginName`,props:{name:{},compact:{type:Boolean},colored:{type:Boolean},hide:{type:Boolean}},setup(t){let o=t,s=[`__load__`,`vite-plugin-`,`vite-`,`rollup-plugin-`,`rollup-`,`unplugin-`],c=[...s,`vite:`];function l(){let t=o.compact?c:s;for(let n of t)if(o.name.startsWith(n))return o.compact?e(`span`,o.name.slice(n.length)):e(`span`,[e(`span`,{class:`op50`},n),e(`span`,o.name.slice(n.length))]);let n=o.name.split(`:`);return n.length>1?e(`span`,[e(`span`,{style:{color:a(n[0])}},`${n[0]}:`),e(`span`,n.slice(1).join(`:`))]):e(`span`,o.name)}return(e,t)=>(r(),n(i(l)))}}),{__name:`DisplayPluginName`});export{o as t};